@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,21 +1,51 @@
|
|
|
1
|
-
import React, { ReactNode } from
|
|
2
|
-
import { Meta } from
|
|
3
|
-
import { Box, styled, TextField, Typography, useTheme } from
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { Meta } from '@storybook/react-webpack5';
|
|
3
|
+
import { Box, styled, TextField, Typography, useTheme } from '@mui/material';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
interface BaseBoxProps {
|
|
6
|
+
theme: 'light' | 'dark';
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const BaseBox = ({ theme, children }: BaseBoxProps) => {
|
|
11
|
+
return (
|
|
12
|
+
<Box
|
|
13
|
+
className={theme === 'light' ? 'light1' : 'dark1'}
|
|
14
|
+
sx={{
|
|
15
|
+
width: 500,
|
|
16
|
+
height: 200,
|
|
17
|
+
bgcolor: (sxTheme) => sxTheme.palette.lunit_token.core.bg_01,
|
|
18
|
+
border: '1px solid',
|
|
19
|
+
p: 2,
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
22
|
+
<Typography
|
|
23
|
+
variant="body1_16_semibold"
|
|
24
|
+
sx={{
|
|
25
|
+
color: (sxTheme) => sxTheme.palette.lunit_token.core.text_normal,
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
{theme === 'light' ? '= light1 =' : '= dark1 ='}
|
|
29
|
+
</Typography>
|
|
30
|
+
{children}
|
|
31
|
+
</Box>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const StyledTextField = styled(TextField)(({ theme }) => ({
|
|
36
|
+
'& .MuiInputBase-root': {
|
|
37
|
+
backgroundColor: theme.palette.lunit_token.component.textfield_bg,
|
|
38
|
+
color: theme.palette.lunit_token.core.text_normal,
|
|
39
|
+
'& .MuiInputBase-input': {
|
|
40
|
+
padding: '8px 16px',
|
|
41
|
+
},
|
|
42
|
+
'&.Mui-focused fieldset': {
|
|
43
|
+
borderColor: theme.palette.lunit_token.core.status_focused,
|
|
16
44
|
},
|
|
17
|
-
}
|
|
45
|
+
},
|
|
46
|
+
}));
|
|
18
47
|
|
|
48
|
+
export const InComponentWithStyled = () => {
|
|
19
49
|
return (
|
|
20
50
|
<>
|
|
21
51
|
<BaseBox theme="light">
|
|
@@ -29,11 +59,11 @@ export const InComponentWithStyled = () => {
|
|
|
29
59
|
};
|
|
30
60
|
|
|
31
61
|
export default {
|
|
32
|
-
title:
|
|
62
|
+
title: 'Foundation/Colors/ColorToken',
|
|
33
63
|
component: InComponentWithStyled,
|
|
34
64
|
decorators: [
|
|
35
65
|
(Story) => (
|
|
36
|
-
<div style={{ display:
|
|
66
|
+
<div style={{ display: 'flex', flexDirection: 'column', width: '100%' }}>
|
|
37
67
|
<Story />
|
|
38
68
|
</div>
|
|
39
69
|
),
|
|
@@ -47,29 +77,32 @@ export const InComponentWithSx = () => {
|
|
|
47
77
|
<TextField
|
|
48
78
|
placeholder="Text Field with SX"
|
|
49
79
|
sx={{
|
|
50
|
-
|
|
51
|
-
backgroundColor: (theme) =>
|
|
52
|
-
theme.palette.lunit_token.component.textfield_bg,
|
|
80
|
+
'& .MuiInputBase-root': {
|
|
81
|
+
backgroundColor: (theme) => theme.palette.lunit_token.component.textfield_bg,
|
|
53
82
|
color: (theme) => theme.palette.lunit_token.core.text_normal,
|
|
54
|
-
|
|
55
|
-
padding:
|
|
83
|
+
'& .MuiInputBase-input': {
|
|
84
|
+
padding: '8px 16px',
|
|
56
85
|
},
|
|
57
|
-
|
|
58
|
-
borderColor: (theme) => theme.palette.lunit_token.core.
|
|
86
|
+
'&.Mui-focused fieldset': {
|
|
87
|
+
borderColor: (theme) => theme.palette.lunit_token.core.status_focused,
|
|
59
88
|
},
|
|
60
89
|
},
|
|
61
90
|
}}
|
|
62
91
|
/>
|
|
63
|
-
<Box
|
|
92
|
+
<Box
|
|
93
|
+
sx={{
|
|
94
|
+
width: 150,
|
|
95
|
+
height: 50,
|
|
96
|
+
bgcolor: '#DFDFE2',
|
|
97
|
+
mt: 3,
|
|
98
|
+
}}
|
|
99
|
+
>
|
|
64
100
|
Hello!
|
|
65
101
|
<Box
|
|
66
102
|
sx={{
|
|
67
|
-
backgroundColor: (theme) =>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
theme.palette.lunit_token.component.alert_info_border,
|
|
71
|
-
boxShadow: (theme) =>
|
|
72
|
-
`20px -10px 5px ${theme.palette.lunit_token.core.shadow_01}`,
|
|
103
|
+
backgroundColor: (theme) => theme.palette.lunit_token.component.alert_info_bg,
|
|
104
|
+
color: (theme) => theme.palette.lunit_token.component.alert_info_border,
|
|
105
|
+
boxShadow: (theme) => `20px -10px 5px ${theme.palette.lunit_token.core.shadow_01}`,
|
|
73
106
|
width: 300,
|
|
74
107
|
height: 80,
|
|
75
108
|
}}
|
|
@@ -82,29 +115,32 @@ export const InComponentWithSx = () => {
|
|
|
82
115
|
<TextField
|
|
83
116
|
placeholder="Text Field with SX"
|
|
84
117
|
sx={{
|
|
85
|
-
|
|
86
|
-
backgroundColor: (theme) =>
|
|
87
|
-
theme.palette.lunit_token.component.textfield_bg,
|
|
118
|
+
'& .MuiInputBase-root': {
|
|
119
|
+
backgroundColor: (theme) => theme.palette.lunit_token.component.textfield_bg,
|
|
88
120
|
color: (theme) => theme.palette.lunit_token.core.text_normal,
|
|
89
|
-
|
|
90
|
-
padding:
|
|
121
|
+
'& .MuiInputBase-input': {
|
|
122
|
+
padding: '8px 16px',
|
|
91
123
|
},
|
|
92
|
-
|
|
93
|
-
borderColor: (theme) => theme.palette.lunit_token.core.
|
|
124
|
+
'&.Mui-focused fieldset': {
|
|
125
|
+
borderColor: (theme) => theme.palette.lunit_token.core.status_focused,
|
|
94
126
|
},
|
|
95
127
|
},
|
|
96
128
|
}}
|
|
97
129
|
/>
|
|
98
|
-
<Box
|
|
130
|
+
<Box
|
|
131
|
+
sx={{
|
|
132
|
+
width: 150,
|
|
133
|
+
height: 50,
|
|
134
|
+
bgcolor: '#DFDFE2',
|
|
135
|
+
mt: 3,
|
|
136
|
+
}}
|
|
137
|
+
>
|
|
99
138
|
Hello!
|
|
100
139
|
<Box
|
|
101
140
|
sx={{
|
|
102
|
-
backgroundColor: (theme) =>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
theme.palette.lunit_token.component.alert_info_border,
|
|
106
|
-
boxShadow: (theme) =>
|
|
107
|
-
`20px -10px 5px ${theme.palette.lunit_token.core.shadow_01}`,
|
|
141
|
+
backgroundColor: (theme) => theme.palette.lunit_token.component.alert_info_bg,
|
|
142
|
+
color: (theme) => theme.palette.lunit_token.component.alert_info_border,
|
|
143
|
+
boxShadow: (theme) => `20px -10px 5px ${theme.palette.lunit_token.core.shadow_01}`,
|
|
108
144
|
width: 300,
|
|
109
145
|
height: 80,
|
|
110
146
|
}}
|
|
@@ -141,29 +177,3 @@ export const InComponentWithInlineStyle = () => {
|
|
|
141
177
|
</>
|
|
142
178
|
);
|
|
143
179
|
};
|
|
144
|
-
|
|
145
|
-
interface BaseBoxProps {
|
|
146
|
-
theme: "light" | "dark";
|
|
147
|
-
children: ReactNode;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const BaseBox = ({ theme, children }: BaseBoxProps) => {
|
|
151
|
-
return (
|
|
152
|
-
<Box
|
|
153
|
-
className={theme === "light" ? "light1" : "dark1"}
|
|
154
|
-
width={500}
|
|
155
|
-
height={200}
|
|
156
|
-
bgcolor={(sxTheme) => sxTheme.palette.lunit_token.core.bg_01}
|
|
157
|
-
border="1px solid"
|
|
158
|
-
p={2}
|
|
159
|
-
>
|
|
160
|
-
<Typography
|
|
161
|
-
variant="body1_16_semibold"
|
|
162
|
-
color={(sxTheme) => sxTheme.palette.lunit_token.core.text_normal}
|
|
163
|
-
>
|
|
164
|
-
{theme === "light" ? "= light1 =" : "= dark1 ="}
|
|
165
|
-
</Typography>
|
|
166
|
-
{children}
|
|
167
|
-
</Box>
|
|
168
|
-
);
|
|
169
|
-
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Meta } from
|
|
2
|
-
import TokenPaletteTable from
|
|
1
|
+
import { Meta } from '@storybook/react-webpack5';
|
|
2
|
+
import TokenPaletteTable from './TokenPaletteTable';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
title:
|
|
5
|
+
title: 'Foundation/Colors',
|
|
6
6
|
component: TokenPaletteTable,
|
|
7
7
|
parameters: {
|
|
8
8
|
controls: {
|
|
@@ -13,16 +13,16 @@ export default {
|
|
|
13
13
|
|
|
14
14
|
export const CoreTokens = {
|
|
15
15
|
args: {
|
|
16
|
-
kind:
|
|
16
|
+
kind: 'core',
|
|
17
17
|
},
|
|
18
18
|
|
|
19
|
-
name:
|
|
19
|
+
name: 'Palette: Core Tokens',
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export const ComponentTokens = {
|
|
23
23
|
args: {
|
|
24
|
-
kind:
|
|
24
|
+
kind: 'component',
|
|
25
25
|
},
|
|
26
26
|
|
|
27
|
-
name:
|
|
27
|
+
name: 'Palette: Component Tokens',
|
|
28
28
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Box,
|
|
4
4
|
Table,
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
TableCell,
|
|
10
10
|
useTheme,
|
|
11
11
|
SxProps,
|
|
12
|
-
} from
|
|
13
|
-
import { StyledTypography } from
|
|
14
|
-
import { tokenCoreColor } from
|
|
15
|
-
import { tokenComponentColor } from
|
|
12
|
+
} from '@mui/material';
|
|
13
|
+
import { StyledTypography } from './styled';
|
|
14
|
+
import { tokenCoreColor } from '@/foundation/colors/token/core';
|
|
15
|
+
import { tokenComponentColor } from '@/foundation/colors/token/component';
|
|
16
16
|
|
|
17
|
-
import type { ColorToken } from
|
|
18
|
-
import type { ColorTokenValueBySurface } from
|
|
17
|
+
import type { ColorToken } from '@/foundation/colors/types';
|
|
18
|
+
import type { ColorTokenValueBySurface } from '@/foundation/colors/token/types';
|
|
19
19
|
|
|
20
20
|
interface TokenPaletteTableProps {
|
|
21
21
|
kind: keyof ColorToken;
|
|
@@ -25,9 +25,7 @@ const TokenPaletteTable = ({ kind }: TokenPaletteTableProps) => {
|
|
|
25
25
|
const theme = useTheme();
|
|
26
26
|
|
|
27
27
|
const colorTokenMap = Object.entries(
|
|
28
|
-
kind ===
|
|
29
|
-
? theme.palette.lunit_token.core
|
|
30
|
-
: theme.palette.lunit_token.component
|
|
28
|
+
kind === 'core' ? theme.palette.lunit_token.core : theme.palette.lunit_token.component,
|
|
31
29
|
);
|
|
32
30
|
|
|
33
31
|
const TokenPaletteCell = (props: {
|
|
@@ -37,23 +35,17 @@ const TokenPaletteTable = ({ kind }: TokenPaletteTableProps) => {
|
|
|
37
35
|
}) => {
|
|
38
36
|
const { surface, paletteKey, sx } = props;
|
|
39
37
|
|
|
40
|
-
const tokenComponentColorFlatten = Object.values(
|
|
41
|
-
tokenComponentColor
|
|
42
|
-
).reduce((acc, cur) => {
|
|
38
|
+
const tokenComponentColorFlatten = Object.values(tokenComponentColor).reduce((acc, cur) => {
|
|
43
39
|
return { ...acc, ...cur };
|
|
44
40
|
}, {});
|
|
45
41
|
|
|
46
42
|
const boxColorByToken =
|
|
47
|
-
kind ===
|
|
48
|
-
? theme.palette.lunit_token.core[paletteKey as keyof ColorToken[
|
|
49
|
-
: theme.palette.lunit_token.component[
|
|
50
|
-
paletteKey as keyof ColorToken["component"]
|
|
51
|
-
];
|
|
43
|
+
kind === 'core'
|
|
44
|
+
? theme.palette.lunit_token.core[paletteKey as keyof ColorToken['core']]
|
|
45
|
+
: theme.palette.lunit_token.component[paletteKey as keyof ColorToken['component']];
|
|
52
46
|
|
|
53
47
|
const globalColorByToken =
|
|
54
|
-
kind ===
|
|
55
|
-
? tokenCoreColor[paletteKey]
|
|
56
|
-
: tokenComponentColorFlatten[paletteKey];
|
|
48
|
+
kind === 'core' ? tokenCoreColor[paletteKey] : tokenComponentColorFlatten[paletteKey];
|
|
57
49
|
|
|
58
50
|
return (
|
|
59
51
|
<TableCell
|
|
@@ -66,28 +58,18 @@ const TokenPaletteTable = ({ kind }: TokenPaletteTableProps) => {
|
|
|
66
58
|
<Box
|
|
67
59
|
sx={{
|
|
68
60
|
background: boxColorByToken,
|
|
69
|
-
borderTop:
|
|
70
|
-
borderBottom:
|
|
71
|
-
borderColor:
|
|
72
|
-
height:
|
|
61
|
+
borderTop: '1px solid',
|
|
62
|
+
borderBottom: '1px solid',
|
|
63
|
+
borderColor: 'rgba(0, 0, 0, 0.12)',
|
|
64
|
+
height: '12px',
|
|
73
65
|
...sx,
|
|
74
66
|
}}
|
|
75
|
-
|
|
67
|
+
/>
|
|
76
68
|
<StyledTypography>{globalColorByToken[surface]}</StyledTypography>
|
|
77
69
|
</TableCell>
|
|
78
70
|
);
|
|
79
71
|
};
|
|
80
72
|
|
|
81
|
-
const deprecatedTokenList = [
|
|
82
|
-
"btn_secondary_border",
|
|
83
|
-
"btn_selected_secondary_bg",
|
|
84
|
-
"datatable_border_01",
|
|
85
|
-
"datatable_border_02",
|
|
86
|
-
"hover",
|
|
87
|
-
"focused",
|
|
88
|
-
"selected",
|
|
89
|
-
];
|
|
90
|
-
|
|
91
73
|
return (
|
|
92
74
|
<TableContainer>
|
|
93
75
|
<Table stickyHeader>
|
|
@@ -106,27 +88,19 @@ const TokenPaletteTable = ({ kind }: TokenPaletteTableProps) => {
|
|
|
106
88
|
</TableRow>
|
|
107
89
|
</TableHead>
|
|
108
90
|
<TableBody>
|
|
109
|
-
{colorTokenMap.map(([paletteKey
|
|
91
|
+
{colorTokenMap.map(([paletteKey]) => (
|
|
110
92
|
<TableRow key={paletteKey}>
|
|
111
|
-
<TableCell sx={{ height:
|
|
93
|
+
<TableCell sx={{ height: '72px' }}>
|
|
112
94
|
<StyledTypography>
|
|
113
|
-
{kind}.{paletteKey}
|
|
114
|
-
{deprecatedTokenList.includes(paletteKey) && (
|
|
115
|
-
<Box
|
|
116
|
-
component="span"
|
|
117
|
-
sx={{ color: "red", fontWeight: "bold" }}
|
|
118
|
-
>
|
|
119
|
-
(Deprecated)
|
|
120
|
-
</Box>
|
|
121
|
-
)}
|
|
95
|
+
{kind}.{paletteKey}
|
|
122
96
|
</StyledTypography>
|
|
123
97
|
</TableCell>
|
|
124
98
|
<TokenPaletteCell
|
|
125
99
|
surface="light1"
|
|
126
100
|
paletteKey={paletteKey}
|
|
127
101
|
sx={{
|
|
128
|
-
borderLeft:
|
|
129
|
-
borderLeftColor:
|
|
102
|
+
borderLeft: '1px solid',
|
|
103
|
+
borderLeftColor: 'rgba(0, 0, 0, 0.12)',
|
|
130
104
|
}}
|
|
131
105
|
/>
|
|
132
106
|
<TokenPaletteCell surface="light2" paletteKey={paletteKey} />
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { styled, Typography } from '@mui/material';
|
|
2
2
|
|
|
3
|
-
export const Container = styled(
|
|
4
|
-
display:
|
|
5
|
-
flexDirection:
|
|
6
|
-
width:
|
|
3
|
+
export const Container = styled('div')({
|
|
4
|
+
display: 'flex',
|
|
5
|
+
flexDirection: 'column',
|
|
6
|
+
width: '100%',
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
-
export const PaletteContainer = styled(
|
|
10
|
-
display:
|
|
11
|
-
width:
|
|
12
|
-
flexWrap:
|
|
9
|
+
export const PaletteContainer = styled('div')({
|
|
10
|
+
display: 'flex',
|
|
11
|
+
width: '100%',
|
|
12
|
+
flexWrap: 'wrap',
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
export const ColorContainer = styled(
|
|
16
|
-
display:
|
|
17
|
-
flexDirection:
|
|
18
|
-
alignItems:
|
|
19
|
-
width:
|
|
20
|
-
marginRight:
|
|
21
|
-
marginBottom:
|
|
15
|
+
export const ColorContainer = styled('div')({
|
|
16
|
+
display: 'flex',
|
|
17
|
+
flexDirection: 'column',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
width: '84px',
|
|
20
|
+
marginRight: '20px',
|
|
21
|
+
marginBottom: '20px',
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
export const Color = styled(
|
|
25
|
-
width:
|
|
26
|
-
height:
|
|
27
|
-
borderRadius:
|
|
28
|
-
marginBottom:
|
|
29
|
-
display:
|
|
30
|
-
justifyContent:
|
|
31
|
-
alignItems:
|
|
32
|
-
border:
|
|
24
|
+
export const Color = styled('div')({
|
|
25
|
+
width: '84px',
|
|
26
|
+
height: '84px',
|
|
27
|
+
borderRadius: '16px',
|
|
28
|
+
marginBottom: '4px',
|
|
29
|
+
display: 'flex',
|
|
30
|
+
justifyContent: 'center',
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
border: '1px solid rgba(0, 0, 0, 0.03)',
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
export const StyledTypography = styled(Typography)(({ theme }) => ({
|
|
36
36
|
color: theme.palette.lunit_token.core.text_normal,
|
|
37
37
|
marginLeft: 8,
|
|
38
|
-
fontSize:
|
|
38
|
+
fontSize: '12px',
|
|
39
39
|
}));
|
package/src/theme.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { deepmerge } from
|
|
2
|
-
import { createTheme, ThemeOptions } from
|
|
1
|
+
import { deepmerge } from '@mui/utils';
|
|
2
|
+
import { createTheme, ThemeOptions } from '@mui/material';
|
|
3
3
|
import {
|
|
4
4
|
foundationCssBaseline,
|
|
5
5
|
palette,
|
|
6
6
|
typography,
|
|
7
7
|
typographyDefaultProps,
|
|
8
8
|
spacing,
|
|
9
|
-
} from
|
|
10
|
-
import { componentsCssBaseline } from
|
|
9
|
+
} from './foundation';
|
|
10
|
+
import { componentsCssBaseline } from './components';
|
|
11
11
|
|
|
12
12
|
export const themeOptions: ThemeOptions = {
|
|
13
13
|
typography,
|
|
@@ -20,14 +20,14 @@ export const themeOptions: ThemeOptions = {
|
|
|
20
20
|
// css-in-js이기 때문에 MuiPaper-root class에만 추가해도
|
|
21
21
|
// Paper 컴포넌트를 쓰는 모든 스타일에서 명시도 역전이 발생하지 않음
|
|
22
22
|
root: {
|
|
23
|
-
boxShadow:
|
|
23
|
+
boxShadow: 'var(--elevation-shadow)',
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
27
|
MuiTooltip: {
|
|
28
28
|
styleOverrides: {
|
|
29
29
|
tooltip: {
|
|
30
|
-
boxShadow:
|
|
30
|
+
boxShadow: 'var(--elevation-shadow)',
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
},
|
package/src/types.d.ts
CHANGED
package/tsconfig.build.json
CHANGED