@lunit/design-system 2.2.0 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc.json +1 -1
- package/README.md +22 -21
- package/dist/cjs/components/Alert/index.js +1 -1
- package/dist/cjs/components/Alert/index.js.map +1 -1
- package/dist/cjs/components/Button/index.js +1 -1
- package/dist/cjs/components/Button/index.js.map +1 -1
- package/dist/cjs/components/Checkbox/index.js +1 -1
- package/dist/cjs/components/Checkbox/index.js.map +1 -1
- package/dist/cjs/components/Chip/index.js +1 -1
- package/dist/cjs/components/Chip/index.js.map +1 -1
- package/dist/cjs/components/DataTable/index.js.map +1 -1
- package/dist/cjs/components/DatePicker/index.js.map +1 -1
- package/dist/cjs/components/Dialog/index.js +1 -1
- package/dist/cjs/components/Dialog/index.js.map +1 -1
- package/dist/cjs/components/Dropdown/index.js +1 -1
- package/dist/cjs/components/Dropdown/index.js.map +1 -1
- package/dist/cjs/components/FormLabel/index.js.map +1 -1
- package/dist/cjs/components/Radio/index.js +1 -1
- package/dist/cjs/components/Radio/index.js.map +1 -1
- package/dist/cjs/components/RadioGroup/index.js.map +1 -1
- package/dist/cjs/components/TextField/index.js +1 -1
- package/dist/cjs/components/TextField/index.js.map +1 -1
- package/dist/cjs/components/Toggle/index.js +1 -1
- package/dist/cjs/components/Toggle/index.js.map +1 -1
- package/dist/cjs/components/ToggleButton/index.js +1 -1
- package/dist/cjs/components/ToggleButton/index.js.map +1 -1
- package/dist/cjs/components/Tooltip/index.js.map +1 -1
- package/dist/cjs/components/Typography/index.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/components/Alert/Alert.js +8 -8
- package/dist/components/Alert/Alert.js.map +1 -1
- package/dist/components/Alert/Alert.styled.js +26 -26
- package/dist/components/Alert/Alert.styled.js.map +1 -1
- package/dist/components/Alert/Alert.utils.js +9 -9
- package/dist/components/Alert/Alert.utils.js.map +1 -1
- package/dist/components/Alert/index.js +1 -1
- package/dist/components/Button/Button.js +23 -17
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.styled.js +88 -88
- package/dist/components/Button/Button.styled.js.map +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Button/utils/getButtonPaddingBySizeAndKind.js +9 -9
- package/dist/components/Button/utils/getButtonPaddingBySizeAndKind.js.map +1 -1
- package/dist/components/Button/utils/getHoverStyle.js +1 -1
- package/dist/components/Button/utils/getHoverStyle.js.map +1 -1
- package/dist/components/Button/utils/getIconButtonPaddingBySizeAndKind.js +6 -12
- package/dist/components/Button/utils/getIconButtonPaddingBySizeAndKind.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +9 -9
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/Chip/Chip.js +29 -26
- package/dist/components/Chip/Chip.js.map +1 -1
- package/dist/components/Chip/Chip.styled.js +52 -52
- package/dist/components/Chip/Chip.styled.js.map +1 -1
- package/dist/components/Chip/consts.js +5 -5
- package/dist/components/Chip/index.js +1 -1
- package/dist/components/DataTable/DataTable.js +1 -1
- package/dist/components/DataTable/index.js +1 -1
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/Dialog/Dialog.js +18 -18
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Dialog/Dialog.styled.js +90 -90
- package/dist/components/Dialog/Dialog.styled.js.map +1 -1
- package/dist/components/Dialog/components/DialogAction.js +6 -6
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/Dropdown/Dropdown.js +23 -21
- package/dist/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/components/Dropdown/Dropdown.styled.js +85 -86
- package/dist/components/Dropdown/Dropdown.styled.js.map +1 -1
- package/dist/components/Dropdown/DropdownItem.js +14 -14
- package/dist/components/Dropdown/DropdownItem.js.map +1 -1
- package/dist/components/Dropdown/index.js +2 -2
- package/dist/components/Dropdown/index.js.map +1 -1
- package/dist/components/FormLabel/FormLabel.js +1 -1
- package/dist/components/FormLabel/FormLabel.styled.js +2 -2
- package/dist/components/FormLabel/FormLabel.styled.js.map +1 -1
- package/dist/components/FormLabel/index.js +1 -1
- package/dist/components/Radio/Radio.js +8 -8
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/Radio/index.js +1 -1
- package/dist/components/RadioGroup/index.js +1 -1
- package/dist/components/TextField/TextField.js +8 -8
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/TextField/TextField.style.js +112 -112
- package/dist/components/TextField/TextField.style.js.map +1 -1
- package/dist/components/TextField/TextFieldIcon.js +2 -2
- package/dist/components/TextField/TextFieldIcon.js.map +1 -1
- package/dist/components/TextField/index.js +1 -1
- package/dist/components/Toast/Toast.js +13 -13
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/Toast/Toast.styled.js +26 -26
- package/dist/components/Toast/Toast.utils.js +3 -3
- package/dist/components/Toast/Toast.utils.js.map +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/Toggle/Toggle.js +3 -4
- package/dist/components/Toggle/Toggle.js.map +1 -1
- package/dist/components/Toggle/Toggle.styled.js +30 -30
- package/dist/components/Toggle/Toggle.styled.js.map +1 -1
- package/dist/components/Toggle/index.js +1 -1
- package/dist/components/ToggleButton/ToggleButton.js +6 -6
- package/dist/components/ToggleButton/ToggleButton.js.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.styled.js +20 -20
- package/dist/components/ToggleButton/ToggleButton.styled.js.map +1 -1
- package/dist/components/ToggleButton/index.js +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.js +2 -2
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.js.map +1 -1
- package/dist/components/ToggleButtonGroup/index.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/Typography/Typography.js +1 -1
- package/dist/components/Typography/Typography.js.map +1 -1
- package/dist/components/Typography/index.js +1 -1
- package/dist/foundation/Elevation/index.js +27 -27
- package/dist/foundation/Elevation/utils.js +1 -1
- package/dist/foundation/Elevation/utils.js.map +1 -1
- package/dist/foundation/Typography/index.js +35 -35
- package/dist/foundation/Typography/index.js.map +1 -1
- package/dist/foundation/Typography/tokens.js +136 -136
- package/dist/foundation/Typography/tokens.js.map +1 -1
- package/dist/foundation/colors/base/blue.js +12 -12
- package/dist/foundation/colors/base/green.js +12 -12
- package/dist/foundation/colors/base/grey.js +28 -28
- package/dist/foundation/colors/base/index.js +11 -11
- package/dist/foundation/colors/base/lunitGreen.js +11 -11
- package/dist/foundation/colors/base/lunitTeal.js +12 -12
- package/dist/foundation/colors/base/magenta.js +12 -12
- package/dist/foundation/colors/base/opacity.js +4 -4
- package/dist/foundation/colors/base/orange.js +12 -12
- package/dist/foundation/colors/base/purple.js +12 -12
- package/dist/foundation/colors/base/red.js +12 -12
- package/dist/foundation/colors/base/yellow.js +12 -12
- package/dist/foundation/colors/index.js +119 -121
- package/dist/foundation/colors/index.js.map +1 -1
- package/dist/foundation/colors/token/component.js +184 -212
- package/dist/foundation/colors/token/component.js.map +1 -1
- package/dist/foundation/colors/token/core.js +112 -133
- package/dist/foundation/colors/token/core.js.map +1 -1
- package/dist/foundation/colors/token/index.js +2 -2
- package/dist/foundation/index.js +5 -5
- package/dist/index.js +20 -20
- package/dist/theme.js +6 -6
- package/dist/types/components/Alert/Alert.d.ts +2 -2
- package/dist/types/components/Alert/Alert.styled.d.ts +1 -2
- package/dist/types/components/Alert/Alert.types.d.ts +2 -2
- package/dist/types/components/Alert/Alert.utils.d.ts +1 -1
- package/dist/types/components/Alert/index.d.ts +1 -1
- package/dist/types/components/Button/Button.d.ts +1 -1
- package/dist/types/components/Button/Button.styled.d.ts +226 -227
- package/dist/types/components/Button/Button.types.d.ts +16 -16
- package/dist/types/components/Button/index.d.ts +1 -1
- package/dist/types/components/Button/utils/getButtonPaddingBySizeAndKind.d.ts +4 -4
- package/dist/types/components/Button/utils/getHoverStyle.d.ts +2 -1
- package/dist/types/components/Button/utils/getIconButtonPaddingBySizeAndKind.d.ts +4 -4
- package/dist/types/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/types/components/Checkbox/index.d.ts +1 -1
- package/dist/types/components/Chip/Chip.d.ts +1 -1
- package/dist/types/components/Chip/Chip.styled.d.ts +6 -7
- package/dist/types/components/Chip/Chip.types.d.ts +15 -14
- package/dist/types/components/Chip/index.d.ts +1 -1
- package/dist/types/components/DataTable/index.d.ts +1 -1
- package/dist/types/components/DatePicker/index.d.ts +1 -1
- package/dist/types/components/Dialog/Dialog.d.ts +11 -11
- package/dist/types/components/Dialog/Dialog.styled.d.ts +3 -4
- package/dist/types/components/Dialog/components/DialogAction.d.ts +2 -2
- package/dist/types/components/Dialog/index.d.ts +2 -2
- package/dist/types/components/Dropdown/Dropdown.d.ts +2 -2
- package/dist/types/components/Dropdown/Dropdown.styled.d.ts +3 -4
- package/dist/types/components/Dropdown/Dropdown.types.d.ts +5 -5
- package/dist/types/components/Dropdown/DropdownItem.d.ts +3 -3
- package/dist/types/components/Dropdown/index.d.ts +3 -3
- package/dist/types/components/FormLabel/FormLabel.d.ts +1 -1
- package/dist/types/components/FormLabel/index.d.ts +1 -1
- package/dist/types/components/Radio/Radio.d.ts +1 -1
- package/dist/types/components/Radio/index.d.ts +1 -1
- package/dist/types/components/RadioGroup/index.d.ts +1 -1
- package/dist/types/components/TextField/TextField.d.ts +2 -2
- package/dist/types/components/TextField/TextField.style.d.ts +3 -4
- package/dist/types/components/TextField/TextField.types.d.ts +6 -6
- package/dist/types/components/TextField/TextFieldIcon.d.ts +2 -2
- package/dist/types/components/TextField/index.d.ts +2 -2
- package/dist/types/components/Toast/Toast.d.ts +2 -2
- package/dist/types/components/Toast/Toast.types.d.ts +3 -3
- package/dist/types/components/Toast/Toast.utils.d.ts +1 -1
- package/dist/types/components/Toast/index.d.ts +2 -2
- package/dist/types/components/Toggle/Toggle.d.ts +1 -1
- package/dist/types/components/Toggle/Toggle.styled.d.ts +2 -2
- package/dist/types/components/Toggle/Toggle.types.d.ts +3 -3
- package/dist/types/components/Toggle/index.d.ts +1 -1
- package/dist/types/components/ToggleButton/ToggleButton.d.ts +1 -1
- package/dist/types/components/ToggleButton/ToggleButton.styled.d.ts +2 -3
- package/dist/types/components/ToggleButton/ToggleButton.types.d.ts +10 -10
- package/dist/types/components/ToggleButton/index.d.ts +1 -1
- package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +1 -1
- package/dist/types/components/ToggleButtonGroup/index.d.ts +1 -1
- package/dist/types/components/Tooltip/index.d.ts +1 -1
- package/dist/types/components/Typography/Typography.d.ts +6 -6
- package/dist/types/components/Typography/index.d.ts +1 -1
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/foundation/Elevation/index.d.ts +22 -22
- package/dist/types/foundation/Typography/index.d.ts +78 -78
- package/dist/types/foundation/Typography/tokens.d.ts +69 -69
- package/dist/types/foundation/colors/base/index.d.ts +11 -11
- package/dist/types/foundation/colors/index.d.ts +13 -20
- package/dist/types/foundation/colors/token/component.d.ts +1 -1
- package/dist/types/foundation/colors/token/core.d.ts +1 -1
- package/dist/types/foundation/colors/token/index.d.ts +2 -2
- package/dist/types/foundation/colors/types.d.ts +0 -7
- package/dist/types/foundation/index.d.ts +4 -11
- package/dist/types/foundation/spacing.d.ts +1 -1
- package/dist/types/index.d.ts +20 -20
- package/dist/types/theme.d.ts +1 -1
- package/package.json +9 -11
- package/src/components/Alert/Alert.styled.ts +39 -49
- package/src/components/Alert/Alert.tsx +10 -16
- package/src/components/Alert/Alert.types.ts +2 -2
- package/src/components/Alert/Alert.utils.ts +13 -22
- package/src/components/Alert/index.ts +1 -1
- package/src/components/Button/Button.styled.ts +98 -101
- package/src/components/Button/Button.tsx +71 -69
- package/src/components/Button/Button.types.ts +19 -21
- package/src/components/Button/index.ts +1 -1
- package/src/components/Button/utils/getButtonPaddingBySizeAndKind.ts +13 -13
- package/src/components/Button/utils/getHoverStyle.ts +4 -2
- package/src/components/Button/utils/getIconButtonPaddingBySizeAndKind.ts +10 -19
- package/src/components/Checkbox/Checkbox.tsx +13 -25
- package/src/components/Checkbox/index.ts +1 -1
- package/src/components/Chip/Chip.styled.ts +69 -72
- package/src/components/Chip/Chip.tsx +33 -55
- package/src/components/Chip/Chip.types.ts +17 -25
- package/src/components/Chip/consts.ts +5 -5
- package/src/components/Chip/index.ts +1 -1
- package/src/components/DataTable/DataTable.tsx +2 -2
- package/src/components/DataTable/index.ts +1 -1
- package/src/components/DatePicker/DatePicker.tsx +2 -2
- package/src/components/DatePicker/index.ts +1 -1
- package/src/components/Dialog/Dialog.styled.ts +112 -114
- package/src/components/Dialog/Dialog.tsx +41 -46
- package/src/components/Dialog/components/DialogAction.tsx +8 -8
- package/src/components/Dialog/index.ts +3 -3
- package/src/components/Dropdown/Dropdown.styled.tsx +88 -89
- package/src/components/Dropdown/Dropdown.tsx +29 -30
- package/src/components/Dropdown/Dropdown.types.ts +5 -6
- package/src/components/Dropdown/DropdownItem.tsx +18 -29
- package/src/components/Dropdown/index.ts +3 -7
- package/src/components/FormLabel/FormLabel.styled.ts +3 -3
- package/src/components/FormLabel/FormLabel.tsx +3 -3
- package/src/components/FormLabel/index.ts +1 -1
- package/src/components/Radio/Radio.tsx +12 -29
- package/src/components/Radio/index.ts +1 -1
- package/src/components/RadioGroup/index.ts +1 -1
- package/src/components/TextField/TextField.style.ts +123 -132
- package/src/components/TextField/TextField.tsx +50 -62
- package/src/components/TextField/TextField.types.ts +6 -9
- package/src/components/TextField/TextFieldIcon.tsx +4 -7
- package/src/components/TextField/index.ts +2 -2
- package/src/components/Toast/Toast.styled.ts +26 -26
- package/src/components/Toast/Toast.tsx +14 -28
- package/src/components/Toast/Toast.types.ts +3 -8
- package/src/components/Toast/Toast.utils.ts +5 -8
- package/src/components/Toast/index.tsx +2 -2
- package/src/components/Toggle/Toggle.styled.ts +31 -32
- package/src/components/Toggle/Toggle.tsx +5 -11
- package/src/components/Toggle/Toggle.types.ts +3 -3
- package/src/components/Toggle/index.ts +1 -1
- package/src/components/ToggleButton/ToggleButton.styled.ts +47 -49
- package/src/components/ToggleButton/ToggleButton.tsx +91 -97
- package/src/components/ToggleButton/ToggleButton.types.ts +10 -10
- package/src/components/ToggleButton/index.ts +1 -1
- package/src/components/ToggleButtonGroup/ToggleButtonGroup.tsx +3 -8
- package/src/components/ToggleButtonGroup/index.tsx +1 -1
- package/src/components/Tooltip/Tooltip.tsx +2 -2
- package/src/components/Tooltip/index.ts +1 -1
- package/src/components/Typography/Typography.tsx +7 -10
- package/src/components/Typography/index.ts +1 -1
- package/src/components/index.ts +2 -2
- package/src/foundation/Elevation/index.ts +27 -27
- package/src/foundation/Elevation/utils.ts +14 -8
- package/src/foundation/Typography/index.ts +58 -57
- package/src/foundation/Typography/tokens.ts +138 -138
- package/src/foundation/colors/base/blue.ts +12 -12
- package/src/foundation/colors/base/green.ts +12 -12
- package/src/foundation/colors/base/grey.ts +28 -28
- package/src/foundation/colors/base/index.ts +11 -11
- package/src/foundation/colors/base/lunitGreen.ts +11 -11
- package/src/foundation/colors/base/lunitTeal.ts +12 -12
- package/src/foundation/colors/base/magenta.ts +12 -12
- package/src/foundation/colors/base/opacity.ts +4 -4
- package/src/foundation/colors/base/orange.ts +12 -12
- package/src/foundation/colors/base/purple.ts +12 -12
- package/src/foundation/colors/base/red.ts +12 -12
- package/src/foundation/colors/base/yellow.ts +12 -12
- package/src/foundation/colors/index.ts +119 -120
- package/src/foundation/colors/token/component.ts +185 -213
- package/src/foundation/colors/token/core.ts +113 -134
- package/src/foundation/colors/token/index.ts +2 -2
- package/src/foundation/colors/types.ts +0 -7
- package/src/foundation/index.ts +8 -8
- package/src/foundation/spacing.ts +1 -1
- package/src/index.ts +20 -20
- package/src/stories/GettingStarted.mdx +6 -6
- package/src/stories/components/Alert/Alert.stories.tsx +38 -45
- package/src/stories/components/Button/BasicButton.stories.tsx +68 -59
- package/src/stories/components/Button/ButtonDocs.mdx +17 -41
- package/src/stories/components/Button/Color.stories.tsx +28 -51
- package/src/stories/components/Button/IconButton.stories.tsx +40 -47
- package/src/stories/components/Button/Kind.stories.tsx +100 -213
- package/src/stories/components/CheckBox/BasicCheckbox.stories.tsx +52 -71
- package/src/stories/components/CheckBox/CheckboxDocs.mdx +6 -6
- package/src/stories/components/Chip/Chip.stories.tsx +75 -75
- package/src/stories/components/Chip/ChipDocs.mdx +12 -13
- package/src/stories/components/DataTable/DataTable.stories.tsx +4 -4
- package/src/stories/components/DatePicker/DatePicker.stories.tsx +4 -4
- package/src/stories/components/Dialog/Dialog.stories.tsx +103 -135
- package/src/stories/components/Dialog/DialogDocs.mdx +7 -13
- package/src/stories/components/Dropdown/Dropdown.stories.tsx +96 -82
- package/src/stories/components/Dropdown/DropdownDocs.mdx +275 -0
- package/src/stories/components/Dropdown/DropdownExamples.stories.tsx +40 -47
- package/src/stories/components/Dropdown/DropdownItem.stories.tsx +113 -98
- package/src/stories/components/SelectControl/RadioGroup.stories.tsx +17 -30
- package/src/stories/components/SelectControl/RadioStatus.stories.tsx +16 -23
- package/src/stories/components/SelectControl/Toggle.stories.tsx +33 -78
- package/src/stories/components/TextField/BasicTextField.stories.tsx +44 -53
- package/src/stories/components/TextField/TextFieldDocs.mdx +8 -12
- package/src/stories/components/TextField/TextFieldMulti.stories.tsx +39 -55
- package/src/stories/components/TextField/TextFieldSingle.stories.tsx +74 -118
- package/src/stories/components/TextField/TextFieldSize.stories.tsx +35 -55
- package/src/stories/components/Toast/Toast.stories.tsx +35 -50
- package/src/stories/components/ToggleButton/Basic.stories.tsx +115 -152
- package/src/stories/components/ToggleButton/ToggleButtonDocs.mdx +10 -14
- package/src/stories/components/ToggleButton/ToggleButtonKind.stories.tsx +141 -200
- package/src/stories/components/ToggleButton/WithIcon.stories.tsx +87 -107
- package/src/stories/components/Tooltip/Tooltip.stories.tsx +4 -4
- package/src/stories/foundation/Elevation/Elevation.stories.tsx +48 -54
- package/src/stories/foundation/Elevation/styled.ts +3 -3
- package/src/stories/foundation/Typography/Typography.mdx +9 -13
- package/src/stories/foundation/Typography/Typography.stories.tsx +25 -41
- package/src/stories/foundation/Typography/TypographyGroup.tsx +14 -25
- package/src/stories/foundation/Typography/const.ts +13 -19
- package/src/stories/foundation/colors/ColorSystem.tsx +42 -40
- package/src/stories/foundation/colors/Colors.stories.tsx +40 -41
- package/src/stories/foundation/colors/Docs.mdx +73 -77
- package/src/stories/foundation/colors/Mui.stories.tsx +6 -8
- package/src/stories/foundation/colors/Token.inComponent.stories.tsx +81 -71
- package/src/stories/foundation/colors/TokenPaletteTable.stories.tsx +7 -7
- package/src/stories/foundation/colors/TokenPaletteTable.tsx +23 -49
- package/src/stories/foundation/colors/styled.ts +26 -26
- package/src/theme.ts +6 -6
- package/src/types.d.ts +1 -1
- package/tsconfig.build.json +1 -5
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { OUTLINED_BORDER_WIDTH } from
|
|
1
|
+
import { OUTLINED_BORDER_WIDTH } from '../const';
|
|
2
2
|
|
|
3
|
-
import type { ButtonProps } from
|
|
4
|
-
import { ToggleButtonProps } from
|
|
3
|
+
import type { ButtonProps } from '../Button.types';
|
|
4
|
+
import { ToggleButtonProps } from '@/components/ToggleButton/ToggleButton.types';
|
|
5
5
|
|
|
6
|
-
type GetIconButtonPaddingBySizeAndKindProps = Pick<
|
|
7
|
-
|
|
8
|
-
"kind" | "size"
|
|
9
|
-
> &
|
|
10
|
-
Pick<ToggleButtonProps, "selected">;
|
|
6
|
+
type GetIconButtonPaddingBySizeAndKindProps = Pick<ButtonProps, 'kind' | 'size'> &
|
|
7
|
+
Pick<ToggleButtonProps, 'selected'>;
|
|
11
8
|
|
|
12
9
|
/**
|
|
13
10
|
* When kind is outlined,
|
|
@@ -19,20 +16,14 @@ export const getIconButtonPaddingBySizeAndKind = ({
|
|
|
19
16
|
size,
|
|
20
17
|
selected = false,
|
|
21
18
|
}: GetIconButtonPaddingBySizeAndKindProps) => {
|
|
22
|
-
if (size ===
|
|
23
|
-
return kind ===
|
|
24
|
-
? `${4 - OUTLINED_BORDER_WIDTH}px`
|
|
25
|
-
: "4px";
|
|
19
|
+
if (size === 'small') {
|
|
20
|
+
return kind === 'outlined' && !selected ? `${4 - OUTLINED_BORDER_WIDTH}px` : '4px';
|
|
26
21
|
}
|
|
27
22
|
|
|
28
|
-
if (size ===
|
|
29
|
-
return kind ===
|
|
30
|
-
? `${8 - OUTLINED_BORDER_WIDTH}px`
|
|
31
|
-
: "8px";
|
|
23
|
+
if (size === 'medium') {
|
|
24
|
+
return kind === 'outlined' && !selected ? `${8 - OUTLINED_BORDER_WIDTH}px` : '8px';
|
|
32
25
|
}
|
|
33
26
|
|
|
34
27
|
// size === "large"
|
|
35
|
-
return kind ===
|
|
36
|
-
? `${12 - OUTLINED_BORDER_WIDTH}px`
|
|
37
|
-
: "12px";
|
|
28
|
+
return kind === 'outlined' && !selected ? `${12 - OUTLINED_BORDER_WIDTH}px` : '12px';
|
|
38
29
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { styled } from
|
|
3
|
-
import MuiCheckbox from
|
|
4
|
-
import type { CheckboxProps } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
import MuiCheckbox from '@mui/material/Checkbox';
|
|
4
|
+
import type { CheckboxProps } from '@mui/material';
|
|
5
5
|
|
|
6
6
|
const CustomCheckbox = styled(MuiCheckbox)(({ theme }) => ({
|
|
7
7
|
width: 20,
|
|
8
8
|
height: 20,
|
|
9
9
|
padding: 0,
|
|
10
|
-
|
|
10
|
+
'&.Mui-disabled': {
|
|
11
11
|
opacity: 0.38,
|
|
12
12
|
},
|
|
13
|
-
|
|
13
|
+
'&.Mui-focusVisible:after': {
|
|
14
14
|
content: '""',
|
|
15
|
-
position:
|
|
15
|
+
position: 'absolute',
|
|
16
16
|
width: 24,
|
|
17
17
|
height: 24,
|
|
18
|
-
border: `1px solid ${theme.palette.lunit_token.core.
|
|
19
|
-
borderRadius:
|
|
18
|
+
border: `1px solid ${theme.palette.lunit_token.core.status_focused}`,
|
|
19
|
+
borderRadius: '7px',
|
|
20
20
|
},
|
|
21
21
|
}));
|
|
22
22
|
|
|
@@ -25,21 +25,15 @@ const iconSize = {
|
|
|
25
25
|
height: 18,
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
const DefaultIcon = styled(
|
|
28
|
+
const DefaultIcon = styled('span')(({ theme }) => ({
|
|
29
29
|
...iconSize,
|
|
30
|
-
borderRadius:
|
|
30
|
+
borderRadius: '20%',
|
|
31
31
|
boxShadow: `inset 0 0 0 1.5px ${theme.palette.lunit_token.component.selectcontrol_off}`,
|
|
32
32
|
}));
|
|
33
33
|
|
|
34
34
|
const CheckedIcon = () => {
|
|
35
35
|
return (
|
|
36
|
-
<svg
|
|
37
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
38
|
-
width="20"
|
|
39
|
-
height="20"
|
|
40
|
-
viewBox="0 0 20 20"
|
|
41
|
-
fill="none"
|
|
42
|
-
>
|
|
36
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
43
37
|
<path
|
|
44
38
|
fillRule="evenodd"
|
|
45
39
|
clipRule="evenodd"
|
|
@@ -52,13 +46,7 @@ const CheckedIcon = () => {
|
|
|
52
46
|
|
|
53
47
|
const IndeterminateIcon = () => {
|
|
54
48
|
return (
|
|
55
|
-
<svg
|
|
56
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
57
|
-
width="20"
|
|
58
|
-
height="20"
|
|
59
|
-
viewBox="0 0 20 20"
|
|
60
|
-
fill="none"
|
|
61
|
-
>
|
|
49
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
62
50
|
<path
|
|
63
51
|
fillRule="evenodd"
|
|
64
52
|
clipRule="evenodd"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from
|
|
1
|
+
export { default } from './Checkbox';
|
|
@@ -1,34 +1,30 @@
|
|
|
1
|
-
import { Chip as MuiChip, styled } from
|
|
2
|
-
import { CHIP_COLORS } from
|
|
1
|
+
import { Chip as MuiChip, styled } from '@mui/material';
|
|
2
|
+
import { CHIP_COLORS } from './consts';
|
|
3
3
|
|
|
4
|
-
import type { Theme } from
|
|
4
|
+
import type { Theme } from '@mui/material/styles';
|
|
5
5
|
import type {
|
|
6
6
|
ChipColor,
|
|
7
7
|
OutlinedChipProps,
|
|
8
8
|
BaseContainedChipProps,
|
|
9
9
|
EnableContainedChipProps,
|
|
10
|
-
} from
|
|
10
|
+
} from './Chip.types';
|
|
11
11
|
|
|
12
12
|
const COMMON_STYLES = {
|
|
13
|
-
height:
|
|
14
|
-
width:
|
|
15
|
-
minWidth:
|
|
16
|
-
boxShadow:
|
|
17
|
-
|
|
13
|
+
height: '22px',
|
|
14
|
+
width: 'auto',
|
|
15
|
+
minWidth: '22px',
|
|
16
|
+
boxShadow: 'none',
|
|
17
|
+
'&.Mui-disabled': {
|
|
18
18
|
opacity: 1,
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
'& .MuiChip-label': {
|
|
21
21
|
padding: 0,
|
|
22
|
-
marginInline:
|
|
22
|
+
marginInline: '8px',
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
const getColorToken = (
|
|
27
|
-
token
|
|
28
|
-
theme: Theme,
|
|
29
|
-
color?: ChipColor
|
|
30
|
-
) => {
|
|
31
|
-
if (token === "text") {
|
|
26
|
+
const getColorToken = (token: 'text' | 'bg', theme: Theme, color?: ChipColor) => {
|
|
27
|
+
if (token === 'text') {
|
|
32
28
|
switch (color) {
|
|
33
29
|
case CHIP_COLORS.PRIMARY:
|
|
34
30
|
return theme.palette.lunit_token.component.chip_primary_text;
|
|
@@ -62,96 +58,97 @@ const getColorToken = (
|
|
|
62
58
|
};
|
|
63
59
|
|
|
64
60
|
export const StyledOutlinedChip = styled(MuiChip, {
|
|
65
|
-
shouldForwardProp: (prop) => ![
|
|
61
|
+
shouldForwardProp: (prop) => !['color'].includes(prop.toString()),
|
|
66
62
|
})<OutlinedChipProps>(({ theme, color }) => ({
|
|
67
63
|
...COMMON_STYLES,
|
|
68
64
|
...theme.typography.caption,
|
|
69
65
|
|
|
70
|
-
color: getColorToken(
|
|
71
|
-
borderColor: getColorToken(
|
|
66
|
+
color: getColorToken('text', theme, color),
|
|
67
|
+
borderColor: getColorToken('text', theme, color),
|
|
72
68
|
}));
|
|
73
69
|
|
|
74
70
|
export const StyledContainedChipBase = styled(MuiChip, {
|
|
75
|
-
shouldForwardProp: (prop) => ![
|
|
71
|
+
shouldForwardProp: (prop) => !['color'].includes(prop.toString()),
|
|
76
72
|
})<BaseContainedChipProps>(() => ({ theme, color }) => ({
|
|
77
73
|
...COMMON_STYLES,
|
|
78
74
|
...theme.typography.caption,
|
|
79
75
|
|
|
80
76
|
color: theme.palette.lunit_token.core.text_normal,
|
|
81
|
-
backgroundColor: getColorToken(
|
|
77
|
+
backgroundColor: getColorToken('bg', theme, color),
|
|
82
78
|
|
|
83
|
-
|
|
84
|
-
marginBlock:
|
|
85
|
-
marginLeft:
|
|
86
|
-
marginRight:
|
|
87
|
-
height:
|
|
88
|
-
width:
|
|
89
|
-
color: getColorToken(
|
|
79
|
+
'& .MuiSvgIcon-root': {
|
|
80
|
+
marginBlock: '3px',
|
|
81
|
+
marginLeft: '3px',
|
|
82
|
+
marginRight: '4px',
|
|
83
|
+
height: '16px',
|
|
84
|
+
width: '16px',
|
|
85
|
+
color: getColorToken('text', theme, color),
|
|
90
86
|
},
|
|
91
|
-
|
|
92
|
-
marginBlock:
|
|
93
|
-
marginLeft:
|
|
94
|
-
marginRight:
|
|
95
|
-
height:
|
|
96
|
-
width:
|
|
97
|
-
fontSize:
|
|
87
|
+
'& .MuiChip-avatar': {
|
|
88
|
+
marginBlock: '3px',
|
|
89
|
+
marginLeft: '4px',
|
|
90
|
+
marginRight: '5px',
|
|
91
|
+
height: '14px',
|
|
92
|
+
width: '14px',
|
|
93
|
+
fontSize: '11px',
|
|
98
94
|
fontWeight: 500,
|
|
99
|
-
lineHeight:
|
|
100
|
-
display:
|
|
101
|
-
textAlign:
|
|
102
|
-
alignItems:
|
|
103
|
-
color: getColorToken(
|
|
104
|
-
backgroundColor: getColorToken(
|
|
95
|
+
lineHeight: '16px',
|
|
96
|
+
display: 'flex',
|
|
97
|
+
textAlign: 'center',
|
|
98
|
+
alignItems: 'center',
|
|
99
|
+
color: getColorToken('bg', theme, color),
|
|
100
|
+
backgroundColor: getColorToken('text', theme, color),
|
|
105
101
|
},
|
|
106
102
|
}));
|
|
107
103
|
|
|
108
104
|
export const StyledContainedChipEnable = styled(StyledContainedChipBase, {
|
|
109
|
-
shouldForwardProp: (prop) => ![
|
|
105
|
+
shouldForwardProp: (prop) => !['color'].includes(prop.toString()),
|
|
110
106
|
})<EnableContainedChipProps>(() => ({ theme, color }) => ({
|
|
111
107
|
/**
|
|
112
108
|
* Setting the z-index of the chip to 0 and the z-index of the pseudo element to -1
|
|
113
109
|
* allows the pseudo element(hover layer) to be rendered between the chip and the chip's children.
|
|
114
110
|
*/
|
|
115
|
-
position:
|
|
111
|
+
position: 'relative',
|
|
116
112
|
left: 0,
|
|
117
113
|
right: 0,
|
|
118
114
|
zIndex: 0,
|
|
119
|
-
|
|
120
|
-
backgroundColor: getColorToken(
|
|
115
|
+
'&:hover': {
|
|
116
|
+
backgroundColor: getColorToken('bg', theme, color),
|
|
121
117
|
},
|
|
122
|
-
|
|
123
|
-
position:
|
|
118
|
+
'&:hover::before': {
|
|
119
|
+
position: 'absolute',
|
|
124
120
|
zIndex: -1,
|
|
125
121
|
content: '""',
|
|
126
122
|
top: 0,
|
|
127
123
|
left: 0,
|
|
128
124
|
right: 0,
|
|
129
125
|
bottom: 0,
|
|
130
|
-
backgroundColor: theme.palette.lunit_token.core.
|
|
131
|
-
borderRadius:
|
|
126
|
+
backgroundColor: theme.palette.lunit_token.core.status_hover,
|
|
127
|
+
borderRadius: '11px',
|
|
132
128
|
},
|
|
133
129
|
}));
|
|
134
130
|
|
|
135
|
-
export const StyledContainedChipDeletable = styled(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
131
|
+
export const StyledContainedChipDeletable = styled(StyledContainedChipBase)<BaseContainedChipProps>(
|
|
132
|
+
() =>
|
|
133
|
+
({ theme }) => ({
|
|
134
|
+
'& .MuiChip-deleteIcon': {
|
|
135
|
+
marginLeft: '4px',
|
|
136
|
+
marginRight: '3px',
|
|
137
|
+
},
|
|
142
138
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
})
|
|
139
|
+
'& .delete-icon-hover-layer': {
|
|
140
|
+
position: 'absolute',
|
|
141
|
+
zIndex: 1000,
|
|
142
|
+
top: 0,
|
|
143
|
+
left: 'auto',
|
|
144
|
+
right: 0,
|
|
145
|
+
bottom: 0,
|
|
146
|
+
opacity: 0,
|
|
147
|
+
color: theme.palette.lunit_token.core.status_hover,
|
|
148
|
+
':hover': {
|
|
149
|
+
cursor: 'pointer',
|
|
150
|
+
opacity: 1,
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
}),
|
|
154
|
+
);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Avatar } from
|
|
3
|
-
import Close16 from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Avatar } from '@mui/material';
|
|
3
|
+
import Close16 from '@lunit/design-system-icons/Close16';
|
|
4
4
|
import {
|
|
5
5
|
StyledOutlinedChip,
|
|
6
6
|
StyledContainedChipBase,
|
|
7
7
|
StyledContainedChipEnable,
|
|
8
8
|
StyledContainedChipDeletable,
|
|
9
|
-
} from
|
|
9
|
+
} from './Chip.styled';
|
|
10
10
|
|
|
11
11
|
import type {
|
|
12
12
|
OutlinedChipProps,
|
|
@@ -16,57 +16,36 @@ import type {
|
|
|
16
16
|
ChipProps,
|
|
17
17
|
ChipType,
|
|
18
18
|
ChipThumbnail,
|
|
19
|
-
} from
|
|
20
|
-
|
|
21
|
-
const Chip: ChipType = (props: ChipProps) => {
|
|
22
|
-
const { kind, variant, onDelete, onClick, ...restProps } = props;
|
|
23
|
-
|
|
24
|
-
const isOutlined = kind === "outlined" || variant === "outlined";
|
|
25
|
-
|
|
26
|
-
if (isOutlined) return <OutlinedChip {...props} />;
|
|
27
|
-
else if (onClick) return <EnableContainedChip {...props} />;
|
|
28
|
-
else if (onDelete) return <DeletableContainedChip {...props} />;
|
|
29
|
-
|
|
30
|
-
return <ReadOnlyContainedChip {...restProps} />;
|
|
31
|
-
};
|
|
19
|
+
} from './Chip.types';
|
|
32
20
|
|
|
33
21
|
const OutlinedChip = (props: OutlinedChipProps) => {
|
|
34
|
-
const { color =
|
|
22
|
+
const { color = 'primary', ...restProps } = props;
|
|
35
23
|
|
|
36
|
-
return
|
|
37
|
-
<StyledOutlinedChip
|
|
38
|
-
{...restProps}
|
|
39
|
-
variant="outlined"
|
|
40
|
-
disabled
|
|
41
|
-
color={color}
|
|
42
|
-
/>
|
|
43
|
-
);
|
|
24
|
+
return <StyledOutlinedChip {...restProps} variant="outlined" disabled color={color} />;
|
|
44
25
|
};
|
|
45
26
|
|
|
46
27
|
/**
|
|
47
28
|
* Conditional styling for contained chip
|
|
48
29
|
*/
|
|
49
30
|
const getAvatar = (thumbnail: ChipThumbnail | undefined) => {
|
|
50
|
-
if (!thumbnail || typeof thumbnail !==
|
|
31
|
+
if (!thumbnail || typeof thumbnail !== 'string') return;
|
|
51
32
|
if (thumbnail.length === 0) return <Avatar />;
|
|
52
33
|
return <Avatar>{thumbnail.slice(0, 1).toLocaleUpperCase()}</Avatar>;
|
|
53
34
|
};
|
|
54
35
|
const getIcon = (thumbnail: ChipThumbnail | undefined) => {
|
|
55
|
-
if (thumbnail && typeof thumbnail !==
|
|
36
|
+
if (thumbnail && typeof thumbnail !== 'string') return thumbnail;
|
|
56
37
|
return undefined;
|
|
57
38
|
};
|
|
58
|
-
const getLabelMargin = (
|
|
59
|
-
thumbnail: ChipThumbnail | undefined,
|
|
60
|
-
deletable?: boolean
|
|
61
|
-
) => {
|
|
39
|
+
const getLabelMargin = (thumbnail: ChipThumbnail | undefined, deletable?: boolean) => {
|
|
62
40
|
return {
|
|
63
|
-
marginLeft: thumbnail ?
|
|
64
|
-
marginRight: deletable ?
|
|
41
|
+
marginLeft: thumbnail ? '0px' : '8px',
|
|
42
|
+
marginRight: deletable ? '0px' : '8px',
|
|
65
43
|
};
|
|
66
44
|
};
|
|
67
45
|
|
|
68
46
|
const ReadOnlyContainedChip = (props: ReadOnlyContainedChipProps) => {
|
|
69
|
-
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
48
|
+
const { color = 'primary', thumbnail, sx, variant, ...restProps } = props;
|
|
70
49
|
|
|
71
50
|
return (
|
|
72
51
|
<StyledContainedChipBase
|
|
@@ -76,7 +55,7 @@ const ReadOnlyContainedChip = (props: ReadOnlyContainedChipProps) => {
|
|
|
76
55
|
icon={getIcon(thumbnail)}
|
|
77
56
|
color={color}
|
|
78
57
|
sx={{
|
|
79
|
-
|
|
58
|
+
'& .MuiChip-label': {
|
|
80
59
|
...getLabelMargin(thumbnail),
|
|
81
60
|
},
|
|
82
61
|
...sx,
|
|
@@ -86,15 +65,8 @@ const ReadOnlyContainedChip = (props: ReadOnlyContainedChipProps) => {
|
|
|
86
65
|
};
|
|
87
66
|
|
|
88
67
|
const EnableContainedChip = (props: EnableContainedChipProps) => {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
thumbnail,
|
|
92
|
-
onDelete,
|
|
93
|
-
onClick,
|
|
94
|
-
sx,
|
|
95
|
-
variant,
|
|
96
|
-
...restProps
|
|
97
|
-
} = props;
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
69
|
+
const { color = 'primary', thumbnail, onClick, variant, ...restProps } = props;
|
|
98
70
|
|
|
99
71
|
return (
|
|
100
72
|
<StyledContainedChipEnable
|
|
@@ -104,7 +76,7 @@ const EnableContainedChip = (props: EnableContainedChipProps) => {
|
|
|
104
76
|
icon={getIcon(thumbnail)}
|
|
105
77
|
color={color}
|
|
106
78
|
sx={{
|
|
107
|
-
|
|
79
|
+
'& .MuiChip-label': {
|
|
108
80
|
...getLabelMargin(thumbnail),
|
|
109
81
|
},
|
|
110
82
|
}}
|
|
@@ -121,14 +93,8 @@ const DeleteIconWithHoverLayer = ({ onClick }: { onClick: () => void }) => {
|
|
|
121
93
|
);
|
|
122
94
|
};
|
|
123
95
|
const DeletableContainedChip = (props: DeletableContainedChipProps) => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
thumbnail,
|
|
127
|
-
onDelete,
|
|
128
|
-
sx,
|
|
129
|
-
variant,
|
|
130
|
-
...restProps
|
|
131
|
-
} = props;
|
|
96
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
97
|
+
const { color = 'primary', thumbnail, onDelete, sx, variant, ...restProps } = props;
|
|
132
98
|
|
|
133
99
|
return (
|
|
134
100
|
<StyledContainedChipDeletable
|
|
@@ -139,7 +105,7 @@ const DeletableContainedChip = (props: DeletableContainedChipProps) => {
|
|
|
139
105
|
avatar={getAvatar(thumbnail)}
|
|
140
106
|
icon={getIcon(thumbnail)}
|
|
141
107
|
sx={{
|
|
142
|
-
|
|
108
|
+
'& .MuiChip-label': {
|
|
143
109
|
...getLabelMargin(thumbnail, Boolean(onDelete)),
|
|
144
110
|
},
|
|
145
111
|
...sx,
|
|
@@ -148,4 +114,16 @@ const DeletableContainedChip = (props: DeletableContainedChipProps) => {
|
|
|
148
114
|
);
|
|
149
115
|
};
|
|
150
116
|
|
|
117
|
+
const Chip: ChipType = (props: ChipProps) => {
|
|
118
|
+
const { kind, variant, onDelete, onClick, ...restProps } = props;
|
|
119
|
+
|
|
120
|
+
const isOutlined = kind === 'outlined' || variant === 'outlined';
|
|
121
|
+
|
|
122
|
+
if (isOutlined) return <OutlinedChip {...props} />;
|
|
123
|
+
if (onClick) return <EnableContainedChip {...props} />;
|
|
124
|
+
if (onDelete) return <DeletableContainedChip {...props} />;
|
|
125
|
+
|
|
126
|
+
return <ReadOnlyContainedChip {...restProps} />;
|
|
127
|
+
};
|
|
128
|
+
|
|
151
129
|
export default Chip;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { CHIP_COLORS } from './consts';
|
|
2
3
|
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
ChipTypeMap as MuiChipTypeMap,
|
|
6
|
-
} from "@mui/material";
|
|
7
|
-
import type { OverridableComponent } from "@mui/material/OverridableComponent";
|
|
4
|
+
import type { ChipProps as MuiChipProps, ChipTypeMap as MuiChipTypeMap } from '@mui/material';
|
|
5
|
+
import type { OverridableComponent } from '@mui/material/OverridableComponent';
|
|
8
6
|
|
|
9
|
-
import type { JSX } from
|
|
7
|
+
import type { JSX } from 'react';
|
|
10
8
|
|
|
11
|
-
type DesignSystemChipKind =
|
|
12
|
-
type DesignSystemAndMuiContainedChipKind =
|
|
9
|
+
type DesignSystemChipKind = 'outlined' | 'contained';
|
|
10
|
+
type DesignSystemAndMuiContainedChipKind = 'filled' | 'contained';
|
|
13
11
|
type ColorKeys = keyof typeof CHIP_COLORS;
|
|
14
12
|
export type ChipColor = (typeof CHIP_COLORS)[ColorKeys];
|
|
15
13
|
export type ChipThumbnail = string | JSX.Element;
|
|
@@ -18,31 +16,25 @@ export type ChipThumbnail = string | JSX.Element;
|
|
|
18
16
|
* Mui Chip's variant is 'kind' in our design system
|
|
19
17
|
*/
|
|
20
18
|
export interface BaseChipProps
|
|
21
|
-
extends Pick<
|
|
22
|
-
MuiChipProps,
|
|
23
|
-
"label" | "sx" | "style" | "classes" | "onDelete"
|
|
24
|
-
> {
|
|
19
|
+
extends Pick<MuiChipProps, 'label' | 'sx' | 'style' | 'classes' | 'onDelete'> {
|
|
25
20
|
// either kind or variant
|
|
26
21
|
kind?: DesignSystemChipKind;
|
|
27
|
-
variant?:
|
|
22
|
+
variant?: 'outlined' | DesignSystemAndMuiContainedChipKind;
|
|
28
23
|
// mui variant = outlined | "filled" | undefined
|
|
29
24
|
color?: ChipColor;
|
|
30
25
|
}
|
|
31
26
|
|
|
32
27
|
export interface OutlinedChipProps extends BaseChipProps {
|
|
33
|
-
kind?:
|
|
34
|
-
variant?:
|
|
28
|
+
kind?: 'outlined';
|
|
29
|
+
variant?: 'outlined';
|
|
35
30
|
onClick?: never;
|
|
36
31
|
onDelete?: never;
|
|
37
32
|
}
|
|
38
33
|
|
|
39
34
|
export interface BaseContainedChipProps
|
|
40
35
|
extends BaseChipProps,
|
|
41
|
-
Omit<
|
|
42
|
-
|
|
43
|
-
"color" | "size" | "avatar" | "deleteIcon" | "icon" | "variant"
|
|
44
|
-
> {
|
|
45
|
-
kind?: "contained";
|
|
36
|
+
Omit<MuiChipProps, 'color' | 'size' | 'avatar' | 'deleteIcon' | 'icon' | 'variant'> {
|
|
37
|
+
kind?: 'contained';
|
|
46
38
|
variant?: DesignSystemAndMuiContainedChipKind;
|
|
47
39
|
thumbnail?: ChipThumbnail;
|
|
48
40
|
onClick?: () => void;
|
|
@@ -68,12 +60,12 @@ export type ContainedChipProps =
|
|
|
68
60
|
|
|
69
61
|
export type ChipProps = OutlinedChipProps | ContainedChipProps;
|
|
70
62
|
|
|
71
|
-
export
|
|
63
|
+
export interface ChipTypeMap<
|
|
72
64
|
P = {},
|
|
73
|
-
D extends React.ElementType = MuiChipTypeMap[
|
|
74
|
-
>
|
|
65
|
+
D extends React.ElementType = MuiChipTypeMap['defaultComponent'],
|
|
66
|
+
> {
|
|
75
67
|
props: P & ChipProps;
|
|
76
68
|
defaultComponent: D;
|
|
77
|
-
}
|
|
69
|
+
}
|
|
78
70
|
|
|
79
71
|
export type ChipType = OverridableComponent<ChipTypeMap>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const CHIP_COLORS = {
|
|
2
|
-
PRIMARY:
|
|
3
|
-
SECONDARY:
|
|
4
|
-
ERROR:
|
|
5
|
-
WARNING:
|
|
6
|
-
SUCCESS:
|
|
2
|
+
PRIMARY: 'primary',
|
|
3
|
+
SECONDARY: 'secondary',
|
|
4
|
+
ERROR: 'error',
|
|
5
|
+
WARNING: 'warning',
|
|
6
|
+
SUCCESS: 'success',
|
|
7
7
|
} as const;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from
|
|
1
|
+
export { default } from './Chip';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from
|
|
1
|
+
export { default } from './DataTable';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from
|
|
1
|
+
export { default } from './DatePicker';
|