diff --git a/packages/react-cascader/src/index.tsx b/packages/react-cascader/src/index.tsx index e21c13b96e..c6a0e1e604 100644 --- a/packages/react-cascader/src/index.tsx +++ b/packages/react-cascader/src/index.tsx @@ -4,7 +4,9 @@ import { HTMLInputProps, IProps } from '@uiw/utils'; import Dropdown, { DropdownProps } from '@uiw/react-dropdown'; import Menu from '@uiw/react-menu'; import Icon from '@uiw/react-icon'; -import './style/index.less'; +// import './style/index.less'; +import { CascaderIconWarp, CascaderIcon } from './style'; +import { Close } from '@uiw/icons/lib/Close'; type ValueType = Array; type OptionType = { value: string | number; label: React.ReactNode; children?: Array }; @@ -256,7 +258,9 @@ function Cascader(props: CascaderProps) { addonAfter={ {!disabled && selectIconType === 'close' && ( - + + + )} } diff --git a/packages/react-cascader/src/style/index.ts b/packages/react-cascader/src/style/index.ts new file mode 100644 index 0000000000..b3341d2c7c --- /dev/null +++ b/packages/react-cascader/src/style/index.ts @@ -0,0 +1,30 @@ +import styled, { css } from 'styled-components'; +import { getThemeVariantValue, HTMLDivProps, ThemeVariantValueOptions } from '@uiw/utils'; +import { IconBase, IconBaseProps } from '@uiw/react-icon'; + +export interface CascaderIconWarpProps extends IconBaseProps, ThemeVariantValueOptions { + closebtn?: boolean; +} + +export const CascaderIcon = styled.div` + height: 1em; + width: 1em; +`; + +export const CascaderIconWarp = styled(IconBase)` + ${(props) => + props.closebtn && + css` + & { + font-size: 15px; + margin-right: 1px; + color: ${(props) => getThemeVariantValue(props, 'colorCascaderClose')}; + } + `} +`; + +CascaderIconWarp.defaultProps = { + defaultTheme: { + colorCascaderClose: '#393e48', + }, +};