@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,47 +1,47 @@
|
|
|
1
|
-
import { Alert, styled } from
|
|
2
|
-
import { getIconColor } from
|
|
1
|
+
import { Alert, styled } from '@mui/material';
|
|
2
|
+
import { getIconColor } from './Toast.utils';
|
|
3
3
|
|
|
4
4
|
export const StyledToast = styled(Alert)(({ theme, severity }) => {
|
|
5
5
|
return {
|
|
6
6
|
'div[class*="MuiAlert"]': {
|
|
7
|
-
display:
|
|
8
|
-
alignItems:
|
|
7
|
+
display: 'flex',
|
|
8
|
+
alignItems: 'center',
|
|
9
9
|
},
|
|
10
|
-
|
|
11
|
-
padding:
|
|
10
|
+
'&.MuiAlert-root': {
|
|
11
|
+
padding: '8px 16px 8px 16px',
|
|
12
12
|
margin: 0,
|
|
13
13
|
color: theme.palette.lunit_token.core.text_normal,
|
|
14
14
|
backgroundColor: theme.palette.lunit_token.core.bg_03,
|
|
15
|
-
borderRadius:
|
|
15
|
+
borderRadius: '8px',
|
|
16
16
|
},
|
|
17
|
-
|
|
18
|
-
height:
|
|
19
|
-
marginRight:
|
|
17
|
+
'& .MuiAlert-icon': {
|
|
18
|
+
height: '36px',
|
|
19
|
+
marginRight: '16px',
|
|
20
20
|
fontSize: 20,
|
|
21
21
|
color: `${getIconColor(theme, severity)}`,
|
|
22
|
-
|
|
23
|
-
height:
|
|
24
|
-
width:
|
|
22
|
+
'& .MuiSvgIcon-root': {
|
|
23
|
+
height: '16px',
|
|
24
|
+
width: '16px',
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
|
-
|
|
27
|
+
'& .MuiAlert-message': {
|
|
28
28
|
// max length of toast message is 400px
|
|
29
|
-
maxWidth:
|
|
30
|
-
minHeight:
|
|
31
|
-
padding:
|
|
29
|
+
maxWidth: '400px',
|
|
30
|
+
minHeight: '28px',
|
|
31
|
+
padding: '8px 0 8px 0',
|
|
32
32
|
fontWeight: 400,
|
|
33
|
-
fontSize:
|
|
34
|
-
lineHeight:
|
|
35
|
-
|
|
36
|
-
display:
|
|
33
|
+
fontSize: '14px',
|
|
34
|
+
lineHeight: '20px',
|
|
35
|
+
'& .Toast-message': {
|
|
36
|
+
display: 'block',
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
|
-
|
|
40
|
-
alignSelf:
|
|
41
|
-
minHeight:
|
|
42
|
-
marginRight:
|
|
39
|
+
'& .MuiAlert-action': {
|
|
40
|
+
alignSelf: 'flex-start',
|
|
41
|
+
minHeight: '36px',
|
|
42
|
+
marginRight: '0px',
|
|
43
43
|
padding: 0,
|
|
44
|
-
|
|
44
|
+
'& .MuiSvgIcon-root': {
|
|
45
45
|
color: theme.palette.lunit_token.core.text_normal,
|
|
46
46
|
},
|
|
47
47
|
},
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import Success from
|
|
2
|
-
import Error from
|
|
3
|
-
import Warning from
|
|
4
|
-
import Information from
|
|
5
|
-
import Close from
|
|
1
|
+
import Success from '@lunit/design-system-icons/Success16';
|
|
2
|
+
import Error from '@lunit/design-system-icons/Error16';
|
|
3
|
+
import Warning from '@lunit/design-system-icons/Warning16';
|
|
4
|
+
import Information from '@lunit/design-system-icons/Information16';
|
|
5
|
+
import Close from '@lunit/design-system-icons/Close';
|
|
6
6
|
|
|
7
|
-
import { Typography } from
|
|
8
|
-
import React, { forwardRef } from
|
|
7
|
+
import { Typography } from '@mui/material';
|
|
8
|
+
import React, { forwardRef } from 'react';
|
|
9
9
|
|
|
10
|
-
import Button from
|
|
11
|
-
import { StyledToast } from
|
|
12
|
-
import type { ToastProps } from
|
|
10
|
+
import Button from '../Button';
|
|
11
|
+
import { StyledToast } from './Toast.styled';
|
|
12
|
+
import type { ToastProps } from './Toast.types';
|
|
13
13
|
|
|
14
14
|
const MAPPED_ICON = {
|
|
15
15
|
success: <Success variant="filled" />,
|
|
@@ -20,15 +20,8 @@ const MAPPED_ICON = {
|
|
|
20
20
|
|
|
21
21
|
// this forwardRef is required for using with Snackbar component
|
|
22
22
|
const Toast = forwardRef<HTMLDivElement, ToastProps>((props, ref) => {
|
|
23
|
-
const {
|
|
24
|
-
|
|
25
|
-
icon,
|
|
26
|
-
children,
|
|
27
|
-
action,
|
|
28
|
-
onClose,
|
|
29
|
-
...rest
|
|
30
|
-
} = props;
|
|
31
|
-
const iconConfig = severity === "normal" ? { icon: false } : { severity };
|
|
23
|
+
const { severity = 'normal', children, action, onClose, ...rest } = props;
|
|
24
|
+
const iconConfig = severity === 'normal' ? { icon: false } : { severity };
|
|
32
25
|
|
|
33
26
|
return (
|
|
34
27
|
<StyledToast
|
|
@@ -37,14 +30,7 @@ const Toast = forwardRef<HTMLDivElement, ToastProps>((props, ref) => {
|
|
|
37
30
|
action={
|
|
38
31
|
<>
|
|
39
32
|
{action}
|
|
40
|
-
{onClose &&
|
|
41
|
-
<Button
|
|
42
|
-
icon={<Close />}
|
|
43
|
-
kind="ghost"
|
|
44
|
-
size="medium"
|
|
45
|
-
onClick={onClose}
|
|
46
|
-
/>
|
|
47
|
-
)}
|
|
33
|
+
{onClose && <Button icon={<Close />} kind="ghost" size="medium" onClick={onClose} />}
|
|
48
34
|
</>
|
|
49
35
|
}
|
|
50
36
|
{...iconConfig}
|
|
@@ -54,7 +40,7 @@ const Toast = forwardRef<HTMLDivElement, ToastProps>((props, ref) => {
|
|
|
54
40
|
className="Toast-message"
|
|
55
41
|
variant="body2_14_regular"
|
|
56
42
|
sx={{
|
|
57
|
-
whiteSpace:
|
|
43
|
+
whiteSpace: 'pre-line',
|
|
58
44
|
}}
|
|
59
45
|
>
|
|
60
46
|
{children}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import { AlertProps as BaseAlertProps } from
|
|
1
|
+
import { AlertProps as BaseAlertProps } from '@mui/material';
|
|
2
2
|
|
|
3
3
|
export interface ToastProps
|
|
4
4
|
extends Omit<
|
|
5
5
|
BaseAlertProps,
|
|
6
|
-
|
|
|
7
|
-
| "slots"
|
|
8
|
-
| "slotProps"
|
|
9
|
-
| "components"
|
|
10
|
-
| "componentsProps"
|
|
11
|
-
| "severity"
|
|
6
|
+
'variant' | 'slots' | 'slotProps' | 'components' | 'componentsProps' | 'severity'
|
|
12
7
|
> {
|
|
13
|
-
severity?:
|
|
8
|
+
severity?: 'success' | 'info' | 'warning' | 'error' | 'normal';
|
|
14
9
|
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import type { AlertColor, Theme } from
|
|
1
|
+
import type { AlertColor, Theme } from '@mui/material';
|
|
2
2
|
|
|
3
|
-
export const getIconColor = (
|
|
4
|
-
theme: Theme,
|
|
5
|
-
severity: AlertColor | undefined
|
|
6
|
-
) => {
|
|
3
|
+
export const getIconColor = (theme: Theme, severity: AlertColor | undefined) => {
|
|
7
4
|
switch (severity) {
|
|
8
|
-
case
|
|
5
|
+
case 'info':
|
|
9
6
|
return theme.palette.lunit_token.core.icon_info_02;
|
|
10
|
-
case
|
|
7
|
+
case 'warning':
|
|
11
8
|
return theme.palette.lunit_token.core.icon_warning_02;
|
|
12
|
-
case
|
|
9
|
+
case 'error':
|
|
13
10
|
return theme.palette.lunit_token.core.icon_error_02;
|
|
14
11
|
default:
|
|
15
12
|
return theme.palette.lunit_token.core.icon_success_02;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from
|
|
2
|
-
export type { ToastProps } from
|
|
1
|
+
export { default } from './Toast';
|
|
2
|
+
export type { ToastProps } from './Toast.types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { styled, Switch as MuiSwitch, SwitchProps } from
|
|
1
|
+
import { styled, Switch as MuiSwitch, SwitchProps } from '@mui/material';
|
|
2
2
|
interface ToggleProps extends SwitchProps {
|
|
3
|
-
toggleSize:
|
|
3
|
+
toggleSize: 'small' | 'large';
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
const toggleStyles = {
|
|
@@ -16,10 +16,10 @@ const toggleStyles = {
|
|
|
16
16
|
borderRadius: 12,
|
|
17
17
|
},
|
|
18
18
|
switch: {
|
|
19
|
-
transition:
|
|
19
|
+
transition: 'all 100ms ease-in-out',
|
|
20
20
|
},
|
|
21
21
|
switchChecked: {
|
|
22
|
-
transform:
|
|
22
|
+
transform: 'translateX(10px)',
|
|
23
23
|
},
|
|
24
24
|
thumb: {
|
|
25
25
|
width: 14,
|
|
@@ -38,10 +38,10 @@ const toggleStyles = {
|
|
|
38
38
|
borderRadius: 14,
|
|
39
39
|
},
|
|
40
40
|
switch: {
|
|
41
|
-
transition:
|
|
41
|
+
transition: 'all 150ms ease-in-out',
|
|
42
42
|
},
|
|
43
43
|
switchChecked: {
|
|
44
|
-
transform:
|
|
44
|
+
transform: 'translateX(20px)',
|
|
45
45
|
},
|
|
46
46
|
thumb: {
|
|
47
47
|
width: 20,
|
|
@@ -82,12 +82,11 @@ const indeterminateStyles = {
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
export const CommonToggle = styled(MuiSwitch, {
|
|
85
|
-
shouldForwardProp: (props) => props !==
|
|
85
|
+
shouldForwardProp: (props) => props !== 'toggleSize',
|
|
86
86
|
})<ToggleProps>(({ theme, toggleSize, disabled }) => {
|
|
87
87
|
const checkedColor = theme.palette.lunit_token.component.selectcontrol_on;
|
|
88
88
|
const uncheckedColor = theme.palette.lunit_token.component.selectcontrol_off;
|
|
89
|
-
const handlerColor =
|
|
90
|
-
theme.palette.lunit_token.component.selectcontrol_handler;
|
|
89
|
+
const handlerColor = theme.palette.lunit_token.component.selectcontrol_handler;
|
|
91
90
|
|
|
92
91
|
const toggleStyle = toggleStyles[toggleSize];
|
|
93
92
|
const toggleOpacity = disabled ? 0.38 : 1;
|
|
@@ -96,70 +95,70 @@ export const CommonToggle = styled(MuiSwitch, {
|
|
|
96
95
|
...toggleStyle.root,
|
|
97
96
|
|
|
98
97
|
padding: 0,
|
|
99
|
-
overflow:
|
|
100
|
-
backgroundColor:
|
|
98
|
+
overflow: 'visible',
|
|
99
|
+
backgroundColor: 'transparent',
|
|
101
100
|
opacity: toggleOpacity,
|
|
102
|
-
|
|
101
|
+
'& .Mui-focusVisible': {
|
|
103
102
|
// clear default focus style
|
|
104
|
-
boxShadow:
|
|
105
|
-
background:
|
|
106
|
-
borderColor:
|
|
107
|
-
outline:
|
|
108
|
-
|
|
103
|
+
boxShadow: 'none',
|
|
104
|
+
background: 'transparent',
|
|
105
|
+
borderColor: 'transparent',
|
|
106
|
+
outline: 'none',
|
|
107
|
+
'& + .MuiSwitch-track::after': {
|
|
109
108
|
...toggleStyle.focus,
|
|
110
109
|
content: '""',
|
|
111
|
-
position:
|
|
110
|
+
position: 'absolute',
|
|
112
111
|
border: `1px solid ${checkedColor}`,
|
|
113
|
-
boxSizing:
|
|
112
|
+
boxSizing: 'border-box',
|
|
114
113
|
top: -3, // border 1px + offset 2px
|
|
115
114
|
left: -3, // border 1px + offset 2px
|
|
116
115
|
},
|
|
117
116
|
},
|
|
118
|
-
|
|
117
|
+
'& .MuiSwitch-track': {
|
|
119
118
|
opacity: 1,
|
|
120
119
|
borderRadius: 12,
|
|
121
120
|
backgroundColor: uncheckedColor,
|
|
122
121
|
},
|
|
123
|
-
|
|
122
|
+
'& .MuiSwitch-thumb': {
|
|
124
123
|
...toggleStyle.thumb,
|
|
125
|
-
boxShadow:
|
|
124
|
+
boxShadow: '0px 0px 1px rgba(0, 0, 0, 0.4)',
|
|
126
125
|
},
|
|
127
|
-
|
|
126
|
+
'& .MuiSwitch-switchBase': {
|
|
128
127
|
...toggleStyle.switch,
|
|
129
128
|
padding: 2,
|
|
130
129
|
opacity: 1,
|
|
131
|
-
|
|
130
|
+
'&.Mui-checked': {
|
|
132
131
|
...toggleStyle.switchChecked,
|
|
133
132
|
color: handlerColor,
|
|
134
|
-
|
|
133
|
+
'& + .MuiSwitch-track': {
|
|
135
134
|
opacity: 1,
|
|
136
135
|
backgroundColor: checkedColor,
|
|
137
136
|
},
|
|
138
137
|
},
|
|
139
138
|
},
|
|
140
|
-
|
|
139
|
+
'& .Mui-disabled + .MuiSwitch-track': {
|
|
141
140
|
opacity: 1,
|
|
142
141
|
},
|
|
143
142
|
};
|
|
144
143
|
});
|
|
145
144
|
|
|
146
145
|
export const CommonIndeterminateToggle = styled(CommonToggle, {
|
|
147
|
-
shouldForwardProp: (props) => props !==
|
|
146
|
+
shouldForwardProp: (props) => props !== 'toggleSize',
|
|
148
147
|
})(({ toggleSize }) => {
|
|
149
148
|
const indeterminateStyle = indeterminateStyles[toggleSize];
|
|
150
149
|
|
|
151
150
|
return {
|
|
152
151
|
padding: 0,
|
|
153
|
-
cursor:
|
|
154
|
-
|
|
152
|
+
cursor: 'pointer',
|
|
153
|
+
'& .MuiSwitch-switchBase.Mui-checked': {
|
|
155
154
|
...indeterminateStyle.switchChecked,
|
|
156
|
-
|
|
155
|
+
'& + .MuiSwitch-track': {
|
|
157
156
|
...indeterminateStyle.track,
|
|
158
157
|
},
|
|
159
158
|
},
|
|
160
|
-
|
|
159
|
+
'& .MuiSwitch-thumb': {
|
|
161
160
|
...indeterminateStyle.thumb,
|
|
162
|
-
boxShadow:
|
|
161
|
+
boxShadow: 'none',
|
|
163
162
|
},
|
|
164
163
|
};
|
|
165
164
|
});
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { CommonToggle, CommonIndeterminateToggle } from
|
|
3
|
-
import type { ToggleProps } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CommonToggle, CommonIndeterminateToggle } from './Toggle.styled';
|
|
3
|
+
import type { ToggleProps } from './Toggle.types';
|
|
4
4
|
|
|
5
5
|
const Toggle = (props: ToggleProps) => {
|
|
6
|
-
const {
|
|
7
|
-
size = "small",
|
|
8
|
-
indeterminate = false,
|
|
9
|
-
disableRipple,
|
|
10
|
-
...switchProps
|
|
11
|
-
} = props;
|
|
6
|
+
const { size = 'small', indeterminate = false, disableRipple, ...switchProps } = props;
|
|
12
7
|
|
|
13
8
|
if (indeterminate) {
|
|
14
|
-
const { checked: _, ...restProps } = switchProps;
|
|
15
9
|
// can't use checked props with indeterminate
|
|
16
10
|
return (
|
|
17
11
|
<CommonIndeterminateToggle
|
|
@@ -19,7 +13,7 @@ const Toggle = (props: ToggleProps) => {
|
|
|
19
13
|
checked
|
|
20
14
|
focusRipple={false}
|
|
21
15
|
disableRipple={disableRipple}
|
|
22
|
-
{...
|
|
16
|
+
{...switchProps}
|
|
23
17
|
/>
|
|
24
18
|
);
|
|
25
19
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { SwitchProps } from
|
|
1
|
+
import type { SwitchProps } from '@mui/material';
|
|
2
2
|
|
|
3
|
-
export interface ToggleProps extends Omit<SwitchProps,
|
|
3
|
+
export interface ToggleProps extends Omit<SwitchProps, 'size'> {
|
|
4
4
|
/**
|
|
5
5
|
* The size of the component.
|
|
6
6
|
* @default small
|
|
7
7
|
*/
|
|
8
|
-
size?:
|
|
8
|
+
size?: 'small' | 'large';
|
|
9
9
|
/**
|
|
10
10
|
* If `true`, the component has consistent 'checked' value and change shape.
|
|
11
11
|
* @default false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from
|
|
1
|
+
export { default } from './Toggle';
|
|
@@ -1,65 +1,63 @@
|
|
|
1
|
-
import { styled } from
|
|
2
|
-
import { ToggleButton as MuiToggleButton } from
|
|
1
|
+
import { styled } from '@mui/material/styles';
|
|
2
|
+
import { ToggleButton as MuiToggleButton } from '@mui/material';
|
|
3
3
|
|
|
4
|
-
import type { ToggleButtonProps } from
|
|
5
|
-
import { commonStyle, sizeStyle, kindStyle } from
|
|
4
|
+
import type { ToggleButtonProps } from '../ToggleButton/ToggleButton.types';
|
|
5
|
+
import { commonStyle, sizeStyle, kindStyle } from '../Button/Button.styled';
|
|
6
6
|
|
|
7
7
|
type CustomToggleButtonProps = ToggleButtonProps & { hasIconOnly: boolean };
|
|
8
8
|
|
|
9
9
|
export const CustomToggleButton = styled(MuiToggleButton, {
|
|
10
10
|
shouldForwardProp: (prop: string) => {
|
|
11
|
-
return ![
|
|
11
|
+
return !['icon', 'kind', 'selectedColor', 'hasIconOnly'].includes(prop);
|
|
12
12
|
},
|
|
13
|
-
})<CustomToggleButtonProps>(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
);
|
|
13
|
+
})<CustomToggleButtonProps>(({
|
|
14
|
+
theme: {
|
|
15
|
+
typography,
|
|
16
|
+
palette: { lunit_token },
|
|
17
|
+
},
|
|
18
|
+
kind,
|
|
19
|
+
size,
|
|
20
|
+
color,
|
|
21
|
+
selectedColor,
|
|
22
|
+
hasIconOnly,
|
|
23
|
+
selected,
|
|
24
|
+
}) => {
|
|
25
|
+
return {
|
|
26
|
+
border: 'none',
|
|
27
|
+
...commonStyle({ lunit_token }),
|
|
28
|
+
...sizeStyle({ size, kind, hasIconOnly, selected, typography }),
|
|
29
|
+
...kindStyle({ kind, color, lunit_token }),
|
|
30
|
+
...(selectedColor === 'primary' && {
|
|
31
|
+
'&.Mui-selected, &.Mui-selected:hover': {
|
|
32
|
+
border: 'none',
|
|
33
|
+
backgroundColor: lunit_token.component.btn_selected_primary_bg,
|
|
34
|
+
color: lunit_token.component.btn_selected_primary_text,
|
|
35
|
+
},
|
|
36
|
+
}),
|
|
37
|
+
...(selectedColor === 'secondary' && {
|
|
38
|
+
'&.Mui-selected, &.Mui-selected:hover': {
|
|
39
|
+
border: 'none',
|
|
40
|
+
backgroundColor: lunit_token.component.btn_secondary_bg,
|
|
41
|
+
color: lunit_token.component.btn_selected_secondary_text,
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
};
|
|
45
|
+
});
|
|
48
46
|
|
|
49
|
-
export const IconAndChildrenWrapper = styled(
|
|
50
|
-
display:
|
|
51
|
-
alignItems:
|
|
47
|
+
export const IconAndChildrenWrapper = styled('div')({
|
|
48
|
+
display: 'flex',
|
|
49
|
+
alignItems: 'center',
|
|
52
50
|
});
|
|
53
51
|
|
|
54
|
-
export const IconWrapper = styled(
|
|
52
|
+
export const IconWrapper = styled('div')<{
|
|
55
53
|
hasIconOnly: boolean;
|
|
56
54
|
size: string;
|
|
57
55
|
}>(({ hasIconOnly, size }) => ({
|
|
58
|
-
width:
|
|
59
|
-
height:
|
|
60
|
-
marginRight: hasIconOnly ?
|
|
56
|
+
width: '20px',
|
|
57
|
+
height: '20px',
|
|
58
|
+
marginRight: hasIconOnly ? '0px' : size === 'large' ? '8px' : '4px',
|
|
61
59
|
|
|
62
|
-
|
|
63
|
-
fontSize:
|
|
60
|
+
'*:nth-of-type(1)': {
|
|
61
|
+
fontSize: '20px',
|
|
64
62
|
},
|
|
65
63
|
}));
|