Skip to content

Commit

Permalink
fix: remove unwanted lodash dependency from the `@trendmicro/react-…
Browse files Browse the repository at this point in the history
…styled-ui` package
  • Loading branch information
cheton committed Mar 19, 2022
1 parent 8c6dbd0 commit 4fe93f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
3 changes: 1 addition & 2 deletions packages/react/src/Skeleton/styles.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { css, keyframes } from '@emotion/react';
import _includes from 'lodash/includes';
import useColorMode from '../useColorMode';

const pulse = keyframes`
Expand Down Expand Up @@ -121,7 +120,7 @@ const useSkeletonStyle = ({
const variantProps = getVariantProps(_props);

const builtinAnimationTypes = ['pulse', 'wave'];
if (_includes(builtinAnimationTypes, animation)) {
if (builtinAnimationTypes.includes(animation)) {
animation = undefined;
}

Expand Down
22 changes: 6 additions & 16 deletions packages/react/src/Tabs/styles.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useContext } from 'react';
import _merge from 'lodash/merge';
import { TabContext } from './context';
import useColorMode from '../useColorMode';
import useTheme from '../useTheme';
Expand Down Expand Up @@ -44,19 +43,6 @@ const tabList = {
borderStyle: 'solid'
};

const statusProps = {
_focus: {
zIndex: '3'
},
_selected: {
cursor: 'default'
},
_disabled: {
cursor: 'not-allowed',
borderColor: 'transparent',
},
};

const lineStyle = ({ size, colorMode, theme }) => {
const _color = { light: theme.colors['black:primary'], dark: theme.colors['white:emphasis'] }[colorMode];
const _fontColor = setColorWithOpacity(_color, 0.6);
Expand All @@ -82,13 +68,17 @@ const lineStyle = ({ size, colorMode, theme }) => {
},
_selected: {
color: _selectedFontColor,
cursor: 'default',
borderBottomColor: _selectedBorderColor
},
_focus: {
borderBottomColor: _focusBorderColor
borderBottomColor: _focusBorderColor,
zIndex: '3'
},
_disabled: {
color: _disabledColor,
cursor: 'not-allowed',
borderColor: 'transparent',
borderBottomColor: _disabledBorderColor,
backgroundColor: _disabledBackgroundColor
},
Expand Down Expand Up @@ -232,7 +222,7 @@ export const useTabStyle = () => {
return {
...tabProps,
...(tabSizes[size] ? tabSizes[size] : tabSizes.md),
..._merge(_variantStyle.tab, statusProps),
..._variantStyle.tab,
...(_orientationStyle && _orientationStyle.tab),
...(isFitted && { flex: 1 }),
};
Expand Down

0 comments on commit 4fe93f8

Please sign in to comment.