@lunit/design-system 1.0.0-a.1 → 1.0.0-a.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 +16 -0
- package/dist/cjs/components/Alert/index.js +2 -0
- package/dist/cjs/components/Alert/index.js.map +1 -0
- package/dist/cjs/components/Button/index.js +2 -0
- package/dist/cjs/components/Button/index.js.map +1 -0
- package/dist/cjs/components/Checkbox/index.js +2 -0
- package/dist/cjs/components/Checkbox/index.js.map +1 -0
- package/dist/cjs/components/Chip/index.js +2 -0
- package/dist/cjs/components/Chip/index.js.map +1 -0
- package/dist/cjs/components/DataTable/index.js +2 -0
- package/dist/cjs/components/DataTable/index.js.map +1 -0
- package/dist/cjs/components/DatePicker/index.js +2 -0
- package/dist/cjs/components/DatePicker/index.js.map +1 -0
- package/dist/cjs/components/Dropdown/index.js +2 -0
- package/dist/cjs/components/Dropdown/index.js.map +1 -0
- package/dist/cjs/components/FormLabel/index.js +2 -0
- package/dist/cjs/components/FormLabel/index.js.map +1 -0
- package/dist/cjs/components/Modal/index.js +2 -0
- package/dist/cjs/components/Modal/index.js.map +1 -0
- package/dist/cjs/components/Radio/index.js +2 -0
- package/dist/cjs/components/Radio/index.js.map +1 -0
- package/dist/cjs/components/RadioGroup/index.js +2 -0
- package/dist/cjs/components/RadioGroup/index.js.map +1 -0
- package/dist/cjs/components/TextField/index.js +2 -0
- package/dist/cjs/components/TextField/index.js.map +1 -0
- package/dist/cjs/components/Toggle/index.js +2 -0
- package/dist/cjs/components/Toggle/index.js.map +1 -0
- package/dist/cjs/components/ToggleButton/index.js +2 -0
- package/dist/cjs/components/ToggleButton/index.js.map +1 -0
- package/dist/cjs/components/Tooltip/index.js +2 -0
- package/dist/cjs/components/Tooltip/index.js.map +1 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/components/Alert/Alert.js +19 -0
- package/dist/components/Alert/Alert.js.map +1 -0
- package/dist/components/Alert/Alert.styled.js +48 -0
- package/dist/components/Alert/Alert.styled.js.map +1 -0
- package/dist/components/Alert/Alert.types.js +2 -0
- package/dist/components/Alert/Alert.types.js.map +1 -0
- package/dist/components/Alert/Alert.utils..js +38 -0
- package/dist/components/Alert/Alert.utils..js.map +1 -0
- package/dist/components/Alert/index.js +1 -1
- package/dist/components/Alert/index.js.map +1 -1
- package/dist/components/Button/Button.js +9 -0
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/Button/Button.styled.js +180 -0
- package/dist/components/Button/Button.styled.js.map +1 -0
- package/dist/components/Button/Button.types.js +2 -0
- package/dist/components/Button/Button.types.js.map +1 -0
- package/dist/components/Button/const.js +3 -0
- package/dist/components/Button/const.js.map +1 -0
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Button/utils/getButtonPaddingBySizeAndKind.js +23 -0
- package/dist/components/Button/utils/getButtonPaddingBySizeAndKind.js.map +1 -0
- package/dist/components/Button/utils/getHoverStyle.js +7 -0
- package/dist/components/Button/utils/getHoverStyle.js.map +1 -0
- package/dist/components/Button/utils/getIconButtonPaddingBySizeAndKind.js +23 -0
- package/dist/components/Button/utils/getIconButtonPaddingBySizeAndKind.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.js +49 -0
- package/dist/components/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Chip/Chip.js +70 -0
- package/dist/components/Chip/Chip.js.map +1 -0
- package/dist/components/Chip/Chip.styled.js +142 -0
- package/dist/components/Chip/Chip.styled.js.map +1 -0
- package/dist/components/Chip/Chip.types.js +2 -0
- package/dist/components/Chip/Chip.types.js.map +1 -0
- package/dist/components/Chip/consts.js +8 -0
- package/dist/components/Chip/consts.js.map +1 -0
- package/dist/components/Chip/index.js +1 -1
- package/dist/components/Chip/index.js.map +1 -1
- package/dist/components/DataTable/DataTable.js +7 -0
- package/dist/components/DataTable/DataTable.js.map +1 -0
- package/dist/components/DataTable/index.js +1 -1
- package/dist/components/DataTable/index.js.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +7 -0
- package/dist/components/DatePicker/DatePicker.js.map +1 -0
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/DatePicker/index.js.map +1 -1
- package/dist/components/Dropdown/Dropdown.js +7 -0
- package/dist/components/Dropdown/Dropdown.js.map +1 -0
- package/dist/components/Dropdown/index.js +1 -1
- package/dist/components/Dropdown/index.js.map +1 -1
- package/dist/components/FormLabel/FormLabel.js +7 -0
- package/dist/components/FormLabel/FormLabel.js.map +1 -0
- package/dist/components/FormLabel/FormLabel.styled.js +8 -0
- package/dist/components/FormLabel/FormLabel.styled.js.map +1 -0
- package/dist/components/FormLabel/index.js +1 -1
- package/dist/components/FormLabel/index.js.map +1 -1
- package/dist/components/Modal/Modal.js +7 -0
- package/dist/components/Modal/Modal.js.map +1 -0
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Radio/Radio.js +43 -0
- package/dist/components/Radio/Radio.js.map +1 -0
- package/dist/components/Radio/index.js +1 -1
- package/dist/components/Radio/index.js.map +1 -1
- package/dist/components/RadioGroup/index.js +2 -1
- package/dist/components/RadioGroup/index.js.map +1 -1
- package/dist/components/TextField/TextField.js +19 -0
- package/dist/components/TextField/TextField.js.map +1 -0
- package/dist/components/TextField/TextField.style.js +245 -0
- package/dist/components/TextField/TextField.style.js.map +1 -0
- package/dist/components/TextField/TextField.types.js +2 -0
- package/dist/components/TextField/TextField.types.js.map +1 -0
- package/dist/components/TextField/TextFieldIcon.js +7 -0
- package/dist/components/TextField/TextFieldIcon.js.map +1 -0
- package/dist/components/TextField/index.js +1 -1
- package/dist/components/TextField/index.js.map +1 -1
- package/dist/components/Toast/Toast.js +26 -0
- package/dist/components/Toast/Toast.js.map +1 -0
- package/dist/components/Toast/Toast.styled.js +49 -0
- package/dist/components/Toast/Toast.styled.js.map +1 -0
- package/dist/components/Toast/Toast.types.js +2 -0
- package/dist/components/Toast/Toast.types.js.map +1 -0
- package/dist/components/Toast/Toast.utils.js +14 -0
- package/dist/components/Toast/Toast.utils.js.map +1 -0
- package/dist/components/Toast/index.js +2 -0
- package/dist/components/Toast/index.js.map +1 -0
- package/dist/components/Toggle/Toggle.js +13 -0
- package/dist/components/Toggle/Toggle.js.map +1 -0
- package/dist/components/Toggle/Toggle.styled.js +155 -0
- package/dist/components/Toggle/Toggle.styled.js.map +1 -0
- package/dist/components/Toggle/Toggle.types.js +2 -0
- package/dist/components/Toggle/Toggle.types.js.map +1 -0
- package/dist/components/Toggle/index.js +1 -1
- package/dist/components/Toggle/index.js.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.js +12 -0
- package/dist/components/ToggleButton/ToggleButton.js.map +1 -0
- package/dist/components/ToggleButton/ToggleButton.styled.js +35 -0
- package/dist/components/ToggleButton/ToggleButton.styled.js.map +1 -0
- package/dist/components/ToggleButton/ToggleButton.types.js +2 -0
- package/dist/components/ToggleButton/ToggleButton.types.js.map +1 -0
- package/dist/components/ToggleButton/index.js +1 -1
- package/dist/components/ToggleButton/index.js.map +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.js +7 -0
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.js.map +1 -0
- package/dist/components/ToggleButtonGroup/index.js +2 -0
- package/dist/components/ToggleButtonGroup/index.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.js +7 -0
- package/dist/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/Tooltip/index.js.map +1 -1
- package/dist/components/index.js +7 -0
- package/dist/components/index.js.map +1 -0
- package/dist/foundation/Elevation/index.js +66 -0
- package/dist/foundation/Elevation/index.js.map +1 -0
- package/dist/foundation/Elevation/utils.js +9 -0
- package/dist/foundation/Elevation/utils.js.map +1 -0
- package/dist/foundation/Typography/index.js +62 -0
- package/dist/foundation/Typography/index.js.map +1 -0
- package/dist/foundation/Typography/tokens.js +155 -0
- package/dist/foundation/Typography/tokens.js.map +1 -0
- package/dist/foundation/colors/base/blue.js +26 -0
- package/dist/foundation/colors/base/blue.js.map +1 -0
- package/dist/foundation/colors/base/green.js +26 -0
- package/dist/foundation/colors/base/green.js.map +1 -0
- package/dist/foundation/colors/base/grey.js +52 -0
- package/dist/foundation/colors/base/grey.js.map +1 -0
- package/dist/foundation/colors/base/index.js +12 -0
- package/dist/foundation/colors/base/index.js.map +1 -0
- package/dist/foundation/colors/base/lunitGreen.js +26 -0
- package/dist/foundation/colors/base/lunitGreen.js.map +1 -0
- package/dist/foundation/colors/base/lunitTeal.js +26 -0
- package/dist/foundation/colors/base/lunitTeal.js.map +1 -0
- package/dist/foundation/colors/base/magenta.js +26 -0
- package/dist/foundation/colors/base/magenta.js.map +1 -0
- package/dist/foundation/colors/base/opacity.js +7 -0
- package/dist/foundation/colors/base/opacity.js.map +1 -0
- package/dist/foundation/colors/base/orange.js +26 -0
- package/dist/foundation/colors/base/orange.js.map +1 -0
- package/dist/foundation/colors/base/purple.js +26 -0
- package/dist/foundation/colors/base/purple.js.map +1 -0
- package/dist/foundation/colors/base/red.js +26 -0
- package/dist/foundation/colors/base/red.js.map +1 -0
- package/dist/foundation/colors/base/yellow.js +26 -0
- package/dist/foundation/colors/base/yellow.js.map +1 -0
- package/dist/foundation/colors/index.js +208 -0
- package/dist/foundation/colors/index.js.map +1 -0
- package/dist/foundation/colors/token/component.js +423 -0
- package/dist/foundation/colors/token/component.js.map +1 -0
- package/dist/foundation/colors/token/core.js +206 -0
- package/dist/foundation/colors/token/core.js.map +1 -0
- package/dist/foundation/colors/token/index.js +3 -0
- package/dist/foundation/colors/token/index.js.map +1 -0
- package/dist/foundation/colors/token/types.js +2 -0
- package/dist/foundation/colors/token/types.js.map +1 -0
- package/dist/foundation/colors/types.js +2 -0
- package/dist/foundation/colors/types.js.map +1 -0
- package/dist/foundation/index.js +13 -0
- package/dist/foundation/index.js.map +1 -0
- package/dist/foundation/spacing.js +2 -0
- package/dist/foundation/spacing.js.map +1 -0
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/theme.js +39 -0
- package/dist/theme.js.map +1 -0
- package/dist/types/components/Alert/Alert.d.ts +4 -0
- package/dist/types/components/Alert/Alert.styled.d.ts +6 -0
- package/dist/types/components/Alert/Alert.types.d.ts +9 -0
- package/dist/types/components/Alert/Alert.utils..d.ts +4 -0
- package/dist/types/components/Button/Button.d.ts +3 -0
- package/dist/{components → types/components}/Button/Button.styled.d.ts +26 -2
- package/dist/{components → types/components}/Button/Button.types.d.ts +4 -4
- package/dist/types/components/Button/utils/getHoverStyle.d.ts +6 -0
- package/dist/types/components/Chip/Chip.styled.d.ts +79 -0
- package/dist/{components → types/components}/Chip/Chip.types.d.ts +1 -1
- package/dist/types/components/TextField/TextField.d.ts +3 -0
- package/dist/types/components/TextField/TextField.style.d.ts +9 -0
- package/dist/types/components/TextField/TextField.types.d.ts +29 -0
- package/dist/types/components/TextField/TextFieldIcon.d.ts +8 -0
- package/dist/types/components/TextField/index.d.ts +2 -0
- package/dist/types/components/Toast/Toast.d.ts +4 -0
- package/dist/types/components/Toast/Toast.styled.d.ts +1 -0
- package/dist/types/components/Toast/Toast.types.d.ts +4 -0
- package/dist/types/components/Toast/Toast.utils.d.ts +2 -0
- package/dist/types/components/Toast/index.d.ts +1 -0
- package/dist/{components → types/components}/ToggleButton/ToggleButton.styled.d.ts +1 -1
- package/dist/{components → types/components}/ToggleButton/ToggleButton.types.d.ts +4 -4
- package/dist/{foundation → types/foundation}/colors/base/grey.d.ts +16 -0
- package/dist/{foundation → types/foundation}/colors/base/lunitGreen.d.ts +2 -2
- package/dist/{foundation → types/foundation}/colors/base/lunitTeal.d.ts +2 -2
- package/dist/{foundation → types/foundation}/colors/index.d.ts +42 -9
- package/dist/{foundation → types/foundation}/colors/types.d.ts +1 -3
- package/dist/{foundation → types/foundation}/index.d.ts +37 -5
- package/dist/{index.d.ts → types/index.d.ts} +1 -0
- package/package.json +37 -23
- package/src/components/Alert/Alert.styled.ts +60 -0
- package/src/components/Alert/Alert.tsx +53 -0
- package/src/components/Alert/Alert.types.ts +10 -0
- package/src/components/Alert/Alert.utils..ts +41 -0
- package/src/components/Alert/index.ts +1 -0
- package/src/components/Button/Button.styled.ts +232 -0
- package/src/components/Button/Button.tsx +50 -0
- package/src/components/Button/Button.types.ts +25 -0
- package/src/components/Button/const.ts +2 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Button/utils/getButtonPaddingBySizeAndKind.ts +35 -0
- package/src/components/Button/utils/getHoverStyle.ts +7 -0
- package/src/components/Button/utils/getIconButtonPaddingBySizeAndKind.ts +38 -0
- package/src/components/Checkbox/Checkbox.tsx +67 -0
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/Chip/Chip.styled.ts +164 -0
- package/src/components/Chip/Chip.tsx +132 -0
- package/src/components/Chip/Chip.types.ts +56 -0
- package/src/components/Chip/consts.ts +7 -0
- package/src/components/Chip/index.ts +1 -0
- package/src/components/DataTable/DataTable.tsx +8 -0
- package/src/components/DataTable/index.ts +1 -0
- package/src/components/DatePicker/DatePicker.tsx +8 -0
- package/src/components/DatePicker/index.ts +1 -0
- package/src/components/Dropdown/Dropdown.tsx +11 -0
- package/src/components/Dropdown/index.ts +1 -0
- package/src/components/FormLabel/FormLabel.styled.ts +8 -0
- package/src/components/FormLabel/FormLabel.tsx +9 -0
- package/src/components/FormLabel/index.ts +1 -0
- package/src/components/Modal/Modal.tsx +8 -0
- package/src/components/Modal/index.ts +1 -0
- package/src/components/Radio/Radio.tsx +58 -0
- package/src/components/Radio/index.ts +1 -0
- package/src/components/RadioGroup/index.ts +2 -0
- package/src/components/TextField/TextField.style.ts +316 -0
- package/src/components/TextField/TextField.tsx +80 -0
- package/src/components/TextField/TextField.types.ts +38 -0
- package/src/components/TextField/TextFieldIcon.tsx +24 -0
- package/src/components/TextField/index.ts +7 -0
- package/src/components/Toast/Toast.styled.ts +49 -0
- package/src/components/Toast/Toast.tsx +66 -0
- package/src/components/Toast/Toast.types.ts +14 -0
- package/src/components/Toast/Toast.utils.ts +15 -0
- package/src/components/Toast/index.tsx +1 -0
- package/src/components/Toggle/Toggle.styled.ts +162 -0
- package/src/components/Toggle/Toggle.tsx +18 -0
- package/src/components/Toggle/Toggle.types.ts +14 -0
- package/src/components/Toggle/index.ts +1 -0
- package/src/components/ToggleButton/ToggleButton.styled.ts +58 -0
- package/src/components/ToggleButton/ToggleButton.tsx +89 -0
- package/src/components/ToggleButton/ToggleButton.types.ts +25 -0
- package/src/components/ToggleButton/index.ts +1 -0
- package/src/components/ToggleButtonGroup/ToggleButtonGroup.tsx +13 -0
- package/src/components/ToggleButtonGroup/index.tsx +1 -0
- package/src/components/Tooltip/Tooltip.tsx +9 -0
- package/src/components/Tooltip/index.ts +1 -0
- package/src/components/index.ts +9 -0
- package/src/foundation/Elevation/index.ts +72 -0
- package/src/foundation/Elevation/utils.ts +11 -0
- package/src/foundation/Typography/index.ts +96 -0
- package/src/foundation/Typography/tokens.ts +162 -0
- package/src/foundation/colors/base/blue.ts +27 -0
- package/src/foundation/colors/base/green.ts +27 -0
- package/src/foundation/colors/base/grey.ts +53 -0
- package/src/foundation/colors/base/index.ts +11 -0
- package/src/foundation/colors/base/lunitGreen.ts +27 -0
- package/src/foundation/colors/base/lunitTeal.ts +27 -0
- package/src/foundation/colors/base/magenta.ts +27 -0
- package/src/foundation/colors/base/opacity.ts +6 -0
- package/src/foundation/colors/base/orange.ts +27 -0
- package/src/foundation/colors/base/purple.ts +27 -0
- package/src/foundation/colors/base/red.ts +27 -0
- package/src/foundation/colors/base/yellow.ts +27 -0
- package/src/foundation/colors/index.ts +256 -0
- package/src/foundation/colors/token/component.ts +430 -0
- package/src/foundation/colors/token/core.ts +211 -0
- package/src/foundation/colors/token/index.ts +2 -0
- package/src/foundation/colors/token/types.ts +8 -0
- package/src/foundation/colors/types.ts +83 -0
- package/src/foundation/index.ts +25 -0
- package/src/foundation/spacing.ts +3 -0
- package/src/index.ts +18 -0
- package/src/stories/components/Alert/Alert.stories.tsx +157 -0
- package/src/stories/components/Button/BasicButton.stories.tsx +168 -0
- package/src/stories/components/Button/IconButton.stories.tsx +139 -0
- package/src/stories/components/Button/Kind.stories.tsx +540 -0
- package/src/stories/components/Chip/Chip.stories.tsx +208 -0
- package/src/stories/components/DataTable/DataTable.stories.tsx +15 -0
- package/src/stories/components/DatePicker/DatePicker.stories.tsx +15 -0
- package/src/stories/components/Dropdown/Dropdown.stories.tsx +21 -0
- package/src/stories/components/Modal/Modal.stories.tsx +15 -0
- package/src/stories/components/SelectControl/Checkbox.stories.tsx +256 -0
- package/src/stories/components/SelectControl/RadioGroup.stories.tsx +68 -0
- package/src/stories/components/SelectControl/RadioStatus.stories.tsx +93 -0
- package/src/stories/components/SelectControl/Toggle.stories.tsx +443 -0
- package/src/stories/components/TextField/TextFieldMulti.stories.tsx +137 -0
- package/src/stories/components/TextField/TextFieldSingle.stories.tsx +283 -0
- package/src/stories/components/TextField/TextFieldSize.stories.tsx +134 -0
- package/src/stories/components/Toast/Toast.stories.tsx +152 -0
- package/src/stories/components/ToggleButton/Basic.stories.tsx +346 -0
- package/src/stories/components/ToggleButton/Group.stories.tsx +221 -0
- package/src/stories/components/ToggleButton/ToggleButtonKind.stories.tsx +708 -0
- package/src/stories/components/ToggleButton/WithIcon.stories.tsx +292 -0
- package/src/stories/components/Tooltip/Tooltip.stories.tsx +15 -0
- package/src/stories/foundation/Elevation/Elevation.stories.tsx +268 -0
- package/src/stories/foundation/Elevation/styled.ts +12 -0
- package/src/stories/foundation/Typography/Typography.mdx +76 -0
- package/src/stories/foundation/Typography/Typography.stories.tsx +101 -0
- package/src/stories/foundation/Typography/TypographyExamples.stories.tsx +44 -0
- package/src/stories/foundation/Typography/TypographyGroup.tsx +71 -0
- package/src/stories/foundation/Typography/const.ts +25 -0
- package/src/stories/foundation/colors/Colors.stories.tsx +66 -0
- package/src/stories/foundation/colors/Mui.stories.tsx +18 -0
- package/src/stories/foundation/colors/Token.inComponent.stories.tsx +167 -0
- package/src/stories/foundation/colors/TokenPaletteTable.stories.tsx +28 -0
- package/src/stories/foundation/colors/TokenPaletteTable.tsx +127 -0
- package/src/stories/foundation/colors/styled.ts +39 -0
- package/src/theme.ts +46 -0
- package/src/types.d.ts +4 -0
- package/tsconfig.build.json +2 -0
- package/dist/components/Alert/Alert.d.ts +0 -2
- package/dist/components/Button/Button.d.ts +0 -3
- package/dist/components/Chip/Chip.styled.d.ts +0 -41
- package/dist/components/HelloWorld/HelloWorld.d.ts +0 -28
- package/dist/components/TextField/TextField.d.ts +0 -2
- package/dist/components/TextField/index.d.ts +0 -1
- package/webpack.config.js +0 -51
- /package/dist/{components → types/components}/Alert/index.d.ts +0 -0
- /package/dist/{components → types/components}/Button/const.d.ts +0 -0
- /package/dist/{components → types/components}/Button/index.d.ts +0 -0
- /package/dist/{components → types/components}/Button/utils/getButtonPaddingBySizeAndKind.d.ts +0 -0
- /package/dist/{components → types/components}/Button/utils/getIconButtonPaddingBySizeAndKind.d.ts +0 -0
- /package/dist/{components → types/components}/Checkbox/Checkbox.d.ts +0 -0
- /package/dist/{components → types/components}/Checkbox/index.d.ts +0 -0
- /package/dist/{components → types/components}/Chip/Chip.d.ts +0 -0
- /package/dist/{components → types/components}/Chip/consts.d.ts +0 -0
- /package/dist/{components → types/components}/Chip/index.d.ts +0 -0
- /package/dist/{components → types/components}/DataTable/DataTable.d.ts +0 -0
- /package/dist/{components → types/components}/DataTable/index.d.ts +0 -0
- /package/dist/{components → types/components}/DatePicker/DatePicker.d.ts +0 -0
- /package/dist/{components → types/components}/DatePicker/index.d.ts +0 -0
- /package/dist/{components → types/components}/Dropdown/Dropdown.d.ts +0 -0
- /package/dist/{components → types/components}/Dropdown/index.d.ts +0 -0
- /package/dist/{components → types/components}/FormLabel/FormLabel.d.ts +0 -0
- /package/dist/{components → types/components}/FormLabel/FormLabel.styled.d.ts +0 -0
- /package/dist/{components → types/components}/FormLabel/index.d.ts +0 -0
- /package/dist/{components → types/components}/Modal/Modal.d.ts +0 -0
- /package/dist/{components → types/components}/Modal/index.d.ts +0 -0
- /package/dist/{components → types/components}/Radio/Radio.d.ts +0 -0
- /package/dist/{components → types/components}/Radio/index.d.ts +0 -0
- /package/dist/{components → types/components}/RadioGroup/index.d.ts +0 -0
- /package/dist/{components → types/components}/Toggle/Toggle.d.ts +0 -0
- /package/dist/{components → types/components}/Toggle/Toggle.styled.d.ts +0 -0
- /package/dist/{components → types/components}/Toggle/Toggle.types.d.ts +0 -0
- /package/dist/{components → types/components}/Toggle/index.d.ts +0 -0
- /package/dist/{components → types/components}/ToggleButton/ToggleButton.d.ts +0 -0
- /package/dist/{components → types/components}/ToggleButton/index.d.ts +0 -0
- /package/dist/{components → types/components}/ToggleButtonGroup/ToggleButtonGroup.d.ts +0 -0
- /package/dist/{components → types/components}/ToggleButtonGroup/index.d.ts +0 -0
- /package/dist/{components → types/components}/Tooltip/Tooltip.d.ts +0 -0
- /package/dist/{components → types/components}/Tooltip/index.d.ts +0 -0
- /package/dist/{components → types/components}/index.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/Elevation/index.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/Elevation/utils.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/Typography/index.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/Typography/tokens.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/colors/base/blue.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/colors/base/green.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/colors/base/index.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/colors/base/magenta.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/colors/base/opacity.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/colors/base/orange.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/colors/base/purple.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/colors/base/red.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/colors/base/yellow.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/colors/token/component.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/colors/token/core.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/colors/token/index.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/colors/token/types.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/spacing.d.ts +0 -0
- /package/dist/{theme.d.ts → types/theme.d.ts} +0 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { styled, Switch as MuiSwitch, SwitchProps } from "@mui/material";
|
|
2
|
+
interface ToggleProps extends SwitchProps {
|
|
3
|
+
toggleSize: 'medium' | 'large'
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const toggleStyles = {
|
|
7
|
+
medium: {
|
|
8
|
+
root: {
|
|
9
|
+
width: 28,
|
|
10
|
+
height: 18,
|
|
11
|
+
borderRadius: 9,
|
|
12
|
+
},
|
|
13
|
+
focus: {
|
|
14
|
+
width: 34,
|
|
15
|
+
height: 24,
|
|
16
|
+
borderRadius: 12,
|
|
17
|
+
},
|
|
18
|
+
switch: {
|
|
19
|
+
transition: "all 100ms ease-in-out",
|
|
20
|
+
},
|
|
21
|
+
switchChecked: {
|
|
22
|
+
transform: 'translateX(10px)',
|
|
23
|
+
},
|
|
24
|
+
thumb: {
|
|
25
|
+
width: 14,
|
|
26
|
+
height: 14,
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
large: {
|
|
30
|
+
root:{
|
|
31
|
+
width: 44,
|
|
32
|
+
height: 24,
|
|
33
|
+
borderRadius: 12,
|
|
34
|
+
},
|
|
35
|
+
focus: {
|
|
36
|
+
width: 50,
|
|
37
|
+
height: 30,
|
|
38
|
+
borderRadius: 14,
|
|
39
|
+
},
|
|
40
|
+
switch: {
|
|
41
|
+
transition: "all 150ms ease-in-out",
|
|
42
|
+
},
|
|
43
|
+
switchChecked: {
|
|
44
|
+
transform: 'translateX(20px)',
|
|
45
|
+
},
|
|
46
|
+
thumb: {
|
|
47
|
+
width: 20,
|
|
48
|
+
height: 20,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const indeterminateStyles = {
|
|
54
|
+
large: {
|
|
55
|
+
switchChecked: {
|
|
56
|
+
top: 8,
|
|
57
|
+
left: -8,
|
|
58
|
+
},
|
|
59
|
+
track: {
|
|
60
|
+
borderRadius: 12,
|
|
61
|
+
},
|
|
62
|
+
thumb: {
|
|
63
|
+
height: 4,
|
|
64
|
+
width: 16,
|
|
65
|
+
borderRadius: 2,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
medium: {
|
|
69
|
+
switchChecked: {
|
|
70
|
+
top: 6,
|
|
71
|
+
left: -4,
|
|
72
|
+
},
|
|
73
|
+
track: {
|
|
74
|
+
borderRadius: 12,
|
|
75
|
+
},
|
|
76
|
+
thumb: {
|
|
77
|
+
height: 2,
|
|
78
|
+
width: 12,
|
|
79
|
+
borderRadius: 2,
|
|
80
|
+
},
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const CommonToggle = styled(MuiSwitch, {
|
|
85
|
+
shouldForwardProp: (props) => props !== 'toggleSize',
|
|
86
|
+
})<ToggleProps>(({ theme, toggleSize, disabled }) => {
|
|
87
|
+
const checkedColor = theme.palette.token.component.selectcontrol_on;
|
|
88
|
+
const uncheckedColor = theme.palette.token.component.selectcontrol_off;
|
|
89
|
+
const handlerColor = theme.palette.token.component.selectcontrol_handler;
|
|
90
|
+
|
|
91
|
+
const toggleStyle = toggleStyles[toggleSize];
|
|
92
|
+
const toggleOpacity = disabled ? 0.38 : 1;
|
|
93
|
+
|
|
94
|
+
return {
|
|
95
|
+
...toggleStyle.root,
|
|
96
|
+
display: 'flex',
|
|
97
|
+
padding: 0,
|
|
98
|
+
overflow: "visible",
|
|
99
|
+
backgroundColor: "transparent",
|
|
100
|
+
opacity: toggleOpacity,
|
|
101
|
+
"& .Mui-focusVisible": {
|
|
102
|
+
// clear default focus style
|
|
103
|
+
boxShadow: "none",
|
|
104
|
+
background: "transparent",
|
|
105
|
+
borderColor: "transparent",
|
|
106
|
+
outline: "none",
|
|
107
|
+
"& + .MuiSwitch-track::after": {
|
|
108
|
+
...toggleStyle.focus,
|
|
109
|
+
content: '""',
|
|
110
|
+
position: "absolute",
|
|
111
|
+
border: `1px solid ${checkedColor}`,
|
|
112
|
+
boxSizing: "border-box",
|
|
113
|
+
top: -3, // border 1px + offset 2px
|
|
114
|
+
left: -3, // border 1px + offset 2px
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
'& .MuiSwitch-track': {
|
|
118
|
+
opacity: 1,
|
|
119
|
+
borderRadius: 12,
|
|
120
|
+
backgroundColor: uncheckedColor,
|
|
121
|
+
},
|
|
122
|
+
'& .MuiSwitch-thumb': {
|
|
123
|
+
...toggleStyle.thumb,
|
|
124
|
+
boxShadow: "0px 0px 1px rgba(0, 0, 0, 0.4)",
|
|
125
|
+
},
|
|
126
|
+
'& .MuiSwitch-switchBase': {
|
|
127
|
+
...toggleStyle.switch,
|
|
128
|
+
padding: 2,
|
|
129
|
+
opacity: 1,
|
|
130
|
+
'&.Mui-checked': {
|
|
131
|
+
...toggleStyle.switchChecked,
|
|
132
|
+
color: handlerColor,
|
|
133
|
+
'& + .MuiSwitch-track': {
|
|
134
|
+
opacity: 1,
|
|
135
|
+
backgroundColor: checkedColor,
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
'& .Mui-disabled + .MuiSwitch-track': {
|
|
140
|
+
opacity: 1,
|
|
141
|
+
},
|
|
142
|
+
}});
|
|
143
|
+
|
|
144
|
+
export const CommonIndeterminateToggle = styled(CommonToggle, {
|
|
145
|
+
shouldForwardProp: (props) => props !== 'toggleSize',
|
|
146
|
+
})(({ toggleSize }) => {
|
|
147
|
+
const indeterminateStyle = indeterminateStyles[toggleSize];
|
|
148
|
+
|
|
149
|
+
return {
|
|
150
|
+
padding: 0,
|
|
151
|
+
cursor: "pointer",
|
|
152
|
+
'& .MuiSwitch-switchBase.Mui-checked': {
|
|
153
|
+
...indeterminateStyle.switchChecked,
|
|
154
|
+
'& + .MuiSwitch-track': {
|
|
155
|
+
...indeterminateStyle.track,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
'& .MuiSwitch-thumb': {
|
|
159
|
+
...indeterminateStyle.thumb,
|
|
160
|
+
boxShadow: "none",
|
|
161
|
+
},
|
|
162
|
+
}});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { CommonToggle, CommonIndeterminateToggle } from './Toggle.styled'
|
|
3
|
+
import type { ToggleProps } from './Toggle.types'
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const Toggle = (props: ToggleProps) => {
|
|
7
|
+
const { size = "medium", indeterminate = false, disableRipple, ...switchProps } = props
|
|
8
|
+
|
|
9
|
+
if (indeterminate) {
|
|
10
|
+
const { checked: _, ...restProps } = switchProps;
|
|
11
|
+
// can't use checked props with indeterminate
|
|
12
|
+
return <CommonIndeterminateToggle toggleSize={size} checked focusRipple={false} disableRipple={disableRipple} {...restProps} />
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return <CommonToggle toggleSize={size} focusRipple={false} disableRipple={disableRipple} {...switchProps}/>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default Toggle
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SwitchProps } from "@mui/material"
|
|
2
|
+
|
|
3
|
+
export interface ToggleProps extends Omit<SwitchProps, "size" > {
|
|
4
|
+
/**
|
|
5
|
+
* The size of the component.
|
|
6
|
+
* @default medium
|
|
7
|
+
*/
|
|
8
|
+
size?: 'medium' | 'large'
|
|
9
|
+
/**
|
|
10
|
+
* If `true`, the component has consistent 'checked' value and change shape.
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
indeterminate?: boolean
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Toggle";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { styled } from "@mui/material/styles";
|
|
2
|
+
import { ToggleButton as MuiToggleButton } from "@mui/material";
|
|
3
|
+
|
|
4
|
+
import type { ToggleButtonProps } from "../ToggleButton/ToggleButton.types";
|
|
5
|
+
import {
|
|
6
|
+
commonStyle,
|
|
7
|
+
sizeStyle,
|
|
8
|
+
kindStyle,
|
|
9
|
+
iconStyle,
|
|
10
|
+
} from "../Button/Button.styled";
|
|
11
|
+
|
|
12
|
+
type CustomToggleButtonProps = ToggleButtonProps & { hasIconOnly: boolean };
|
|
13
|
+
|
|
14
|
+
export const CustomToggleButton = styled(MuiToggleButton, {
|
|
15
|
+
shouldForwardProp: (prop: string) => {
|
|
16
|
+
return !["icon", "kind", "selectedColor", "hasIconOnly"].includes(prop);
|
|
17
|
+
},
|
|
18
|
+
})<CustomToggleButtonProps>(
|
|
19
|
+
({
|
|
20
|
+
theme: {
|
|
21
|
+
typography,
|
|
22
|
+
palette: { token },
|
|
23
|
+
},
|
|
24
|
+
kind,
|
|
25
|
+
size,
|
|
26
|
+
color,
|
|
27
|
+
selectedColor,
|
|
28
|
+
hasIconOnly,
|
|
29
|
+
selected,
|
|
30
|
+
}) => {
|
|
31
|
+
return {
|
|
32
|
+
border: "none",
|
|
33
|
+
...commonStyle({ token }),
|
|
34
|
+
...iconStyle({ size, hasIconOnly }),
|
|
35
|
+
...sizeStyle({ size, kind, hasIconOnly, selected, typography }),
|
|
36
|
+
...kindStyle({ kind, color, token }),
|
|
37
|
+
...(selectedColor === "primary" && {
|
|
38
|
+
"&.Mui-selected, &.Mui-selected:hover": {
|
|
39
|
+
border: "none",
|
|
40
|
+
backgroundColor: token.component.btn_selected_primary_bg,
|
|
41
|
+
color: token.component.btn_selected_primary_text,
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
...(selectedColor === "secondary" && {
|
|
45
|
+
"&.Mui-selected, &.Mui-selected:hover": {
|
|
46
|
+
border: "none",
|
|
47
|
+
backgroundColor: token.component.btn_selected_secondary_bg,
|
|
48
|
+
color: token.component.btn_selected_secondary_text,
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
export const IconAndChildrenWrapper = styled("div")({
|
|
56
|
+
display: "flex",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
CustomToggleButton,
|
|
4
|
+
IconAndChildrenWrapper,
|
|
5
|
+
} from "./ToggleButton.styled";
|
|
6
|
+
import type { ToggleButtonProps } from "./ToggleButton.types";
|
|
7
|
+
|
|
8
|
+
const ToggleButton = (props: ToggleButtonProps) => {
|
|
9
|
+
const {
|
|
10
|
+
kind = "contained",
|
|
11
|
+
size = "small",
|
|
12
|
+
color = "primary",
|
|
13
|
+
selectedColor = "primary",
|
|
14
|
+
className = "",
|
|
15
|
+
icon,
|
|
16
|
+
selected,
|
|
17
|
+
children,
|
|
18
|
+
...buttonProps
|
|
19
|
+
} = props;
|
|
20
|
+
|
|
21
|
+
const hasIconOnly = Boolean(icon && !children);
|
|
22
|
+
const excludeToggleGroupClass = className
|
|
23
|
+
.replace("MuiToggleButtonGroup-grouped", "")
|
|
24
|
+
.replace("MuiToggleButtonGroup-groupedHorizontal", "");
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<>
|
|
28
|
+
{kind === "contained" || kind === "ghost" ? (
|
|
29
|
+
<CustomToggleButton
|
|
30
|
+
className={`${kind} ${excludeToggleGroupClass}`}
|
|
31
|
+
selected={selected}
|
|
32
|
+
kind={kind}
|
|
33
|
+
color={color}
|
|
34
|
+
size={size}
|
|
35
|
+
hasIconOnly={hasIconOnly}
|
|
36
|
+
selectedColor={selectedColor}
|
|
37
|
+
disableRipple
|
|
38
|
+
disableFocusRipple
|
|
39
|
+
{...buttonProps}
|
|
40
|
+
>
|
|
41
|
+
{!hasIconOnly ? (
|
|
42
|
+
<>
|
|
43
|
+
{icon ? (
|
|
44
|
+
<IconAndChildrenWrapper>
|
|
45
|
+
{icon}
|
|
46
|
+
{children}
|
|
47
|
+
</IconAndChildrenWrapper>
|
|
48
|
+
) : (
|
|
49
|
+
children
|
|
50
|
+
)}
|
|
51
|
+
</>
|
|
52
|
+
) : (
|
|
53
|
+
icon
|
|
54
|
+
)}
|
|
55
|
+
</CustomToggleButton>
|
|
56
|
+
) : (
|
|
57
|
+
<CustomToggleButton
|
|
58
|
+
className={`outlined ${excludeToggleGroupClass}`}
|
|
59
|
+
selected={selected}
|
|
60
|
+
kind="outlined"
|
|
61
|
+
color="primary"
|
|
62
|
+
size={size}
|
|
63
|
+
hasIconOnly={hasIconOnly}
|
|
64
|
+
selectedColor={selectedColor}
|
|
65
|
+
disableRipple
|
|
66
|
+
disableFocusRipple
|
|
67
|
+
{...buttonProps}
|
|
68
|
+
>
|
|
69
|
+
{!hasIconOnly ? (
|
|
70
|
+
<>
|
|
71
|
+
{icon ? (
|
|
72
|
+
<IconAndChildrenWrapper>
|
|
73
|
+
{icon}
|
|
74
|
+
{children}
|
|
75
|
+
</IconAndChildrenWrapper>
|
|
76
|
+
) : (
|
|
77
|
+
children
|
|
78
|
+
)}
|
|
79
|
+
</>
|
|
80
|
+
) : (
|
|
81
|
+
icon
|
|
82
|
+
)}
|
|
83
|
+
</CustomToggleButton>
|
|
84
|
+
)}
|
|
85
|
+
</>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export default ToggleButton;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ToggleButtonProps as MuiToggleButtonProps } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
interface ToggleButtonBaseProps extends Omit<MuiToggleButtonProps, "variant"> {
|
|
4
|
+
selectedColor?: "primary" | "secondary";
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
interface ContainedToggleButtonProps extends ToggleButtonBaseProps {
|
|
8
|
+
kind?: "contained";
|
|
9
|
+
color?: "primary" | "secondary";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface GhostToggleButtonProps extends ToggleButtonBaseProps {
|
|
13
|
+
kind?: "ghost";
|
|
14
|
+
color?: "primary" | "secondary";
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface OutlinedToggleButtonProps extends ToggleButtonBaseProps {
|
|
18
|
+
kind?: "outlined";
|
|
19
|
+
color?: "primary";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type ToggleButtonProps =
|
|
23
|
+
| ContainedToggleButtonProps
|
|
24
|
+
| GhostToggleButtonProps
|
|
25
|
+
| OutlinedToggleButtonProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./ToggleButton";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import MuiToggleButtonGroup, {
|
|
3
|
+
ToggleButtonGroupProps,
|
|
4
|
+
} from "@mui/material/ToggleButtonGroup";
|
|
5
|
+
|
|
6
|
+
const ToggleButtonGroup = ({
|
|
7
|
+
size = "small",
|
|
8
|
+
...props
|
|
9
|
+
}: ToggleButtonGroupProps) => {
|
|
10
|
+
return <MuiToggleButtonGroup size={size} {...props} />;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default ToggleButtonGroup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./ToggleButtonGroup";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Tooltip";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// re-export any MUI styleOverrides for components
|
|
2
|
+
|
|
3
|
+
import { Components, Theme } from "@mui/material";
|
|
4
|
+
|
|
5
|
+
export const componentsCssBaseline: Components<Theme>["MuiCssBaseline"] = {
|
|
6
|
+
styleOverrides: {
|
|
7
|
+
// @todo add any css baseline necessary for components
|
|
8
|
+
},
|
|
9
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import paletteOptions from "../colors";
|
|
2
|
+
import { createCSSVarNames, createCSSVars } from "./utils";
|
|
3
|
+
|
|
4
|
+
export const shadows = {
|
|
5
|
+
shadow1: `0px 4px 8px ${paletteOptions.token.core.shadow_01}`,
|
|
6
|
+
shadow2: `0px 3px 12px ${paletteOptions.token.core.shadow_02}`,
|
|
7
|
+
shadow3: `0px 12px 24px ${paletteOptions.token.core.shadow_03}`,
|
|
8
|
+
shadow4: `0px 12px 44px ${paletteOptions.token.core.shadow_04}`,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const shadowVars = createCSSVarNames(shadows);
|
|
12
|
+
|
|
13
|
+
export const elevations = {
|
|
14
|
+
elevation_00: "none",
|
|
15
|
+
elevation_01: `${shadowVars.shadow1}, ${shadowVars.shadow2}`,
|
|
16
|
+
elevation_02: `${shadowVars.shadow3}, ${shadowVars.shadow4}`,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const elevationOptions = {
|
|
20
|
+
...shadows,
|
|
21
|
+
...elevations,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const createElevationCssBaseline = () => {
|
|
25
|
+
return {
|
|
26
|
+
// :root에 모든 theme이 정의되어 있지 않으므로 surface*에서 찾아야 함
|
|
27
|
+
".light1, .light2, .dark1, .dark2, .dark3, .dark4": {
|
|
28
|
+
...createCSSVars(shadows),
|
|
29
|
+
...createCSSVars(elevations),
|
|
30
|
+
// `--elevation-shadow`가 정의되지 않아도 `box-shadow: var(--elevation-shadow)` 구문을 해석하려면 필요함
|
|
31
|
+
"--elevation-shadow": "none",
|
|
32
|
+
},
|
|
33
|
+
// Default component styles
|
|
34
|
+
".MuiPaper-root": {
|
|
35
|
+
"--elevation-shadow": elevationOptions.elevation_02,
|
|
36
|
+
},
|
|
37
|
+
".MuiDialog-paper": {
|
|
38
|
+
"--elevation-shadow": elevationOptions.elevation_02,
|
|
39
|
+
},
|
|
40
|
+
".MuiPopover-paper": {
|
|
41
|
+
"--elevation-shadow": elevationOptions.elevation_02,
|
|
42
|
+
},
|
|
43
|
+
// Date Range Picker, Select 등의 Menu element는 MuiMenu-paper에서 상속
|
|
44
|
+
".MuiMenu-paper": {
|
|
45
|
+
"--elevation-shadow": elevationOptions.elevation_01,
|
|
46
|
+
},
|
|
47
|
+
".MuiTooltip-tooltip": {
|
|
48
|
+
"--elevation-shadow": elevationOptions.elevation_01,
|
|
49
|
+
},
|
|
50
|
+
".MuiAlert-root": {
|
|
51
|
+
"--elevation-shadow": elevationOptions.elevation_02,
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
// Alternative to Paper `elevation` prop
|
|
55
|
+
".elevation0, .elevation1, .elevation2": {
|
|
56
|
+
boxShadow: "var(--elevation-shadow)",
|
|
57
|
+
},
|
|
58
|
+
".elevation3, .elevation4, .elevation5, .elevation6, .elevation7, .elevation8, .elevation9, .elevation10, .elevation11, .elevation12, .elevation13, .elevation14, .elevation15, .elevation16, .elevation17, .elevation18, .elevation19, .elevation20, .elevation21, .elevation22, .elevation23, .elevation24":
|
|
59
|
+
{
|
|
60
|
+
boxShadow: "none",
|
|
61
|
+
},
|
|
62
|
+
".elevation0": {
|
|
63
|
+
"--elevation-shadow": elevationOptions.elevation_00,
|
|
64
|
+
},
|
|
65
|
+
".elevation1": {
|
|
66
|
+
"--elevation-shadow": elevationOptions.elevation_01,
|
|
67
|
+
},
|
|
68
|
+
".elevation2": {
|
|
69
|
+
"--elevation-shadow": elevationOptions.elevation_02,
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const createCSSVars = <T extends Record<string, string>>(tokens: T) =>
|
|
2
|
+
Object.entries(tokens).reduce((vars, [name, value]) => {
|
|
3
|
+
vars[`--${name}` as keyof T] = value;
|
|
4
|
+
return vars;
|
|
5
|
+
}, {} as Record<keyof T, string>);
|
|
6
|
+
|
|
7
|
+
export const createCSSVarNames = <T extends Record<string, string>>(tokens: T) =>
|
|
8
|
+
Object.entries(tokens).reduce((vars, [name, value]) => {
|
|
9
|
+
vars[name as keyof T] = `var(--${name})`;
|
|
10
|
+
return vars;
|
|
11
|
+
}, {} as Record<keyof T, string>);
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { TypographyOptions } from "@mui/material/styles/createTypography";
|
|
2
|
+
import { fontVariants, cssVariables } from "./tokens";
|
|
3
|
+
|
|
4
|
+
type DSVariants =
|
|
5
|
+
| "headline1"
|
|
6
|
+
| "headline2"
|
|
7
|
+
| "headline3"
|
|
8
|
+
| "headline4"
|
|
9
|
+
| "headline5"
|
|
10
|
+
| "body1_16_semibold"
|
|
11
|
+
| "body1_16_regular"
|
|
12
|
+
| "body2_14_bold"
|
|
13
|
+
| "body2_14_medium"
|
|
14
|
+
| "body2_14_regular"
|
|
15
|
+
| "body3_12_semibold"
|
|
16
|
+
| "body3_12_regular"
|
|
17
|
+
| "button1"
|
|
18
|
+
| "button2";
|
|
19
|
+
|
|
20
|
+
type DSVariantsType = Record<DSVariants, React.CSSProperties>;
|
|
21
|
+
|
|
22
|
+
declare module "@mui/material/styles" {
|
|
23
|
+
interface TypographyVariants extends DSVariantsType {}
|
|
24
|
+
interface TypographyVariantsOptions extends Partial<DSVariantsType> {}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
type TypographyPropsVariantOverridesType = Record<DSVariants, true>;
|
|
28
|
+
declare module "@mui/material/Typography" {
|
|
29
|
+
interface TypographyPropsVariantOverrides
|
|
30
|
+
extends TypographyPropsVariantOverridesType {}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const fontFamily = [
|
|
34
|
+
"Pretendard",
|
|
35
|
+
"-apple-system",
|
|
36
|
+
"BlinkMacSystemFont",
|
|
37
|
+
"system-ui",
|
|
38
|
+
"Roboto",
|
|
39
|
+
'"Helvetica Neue"',
|
|
40
|
+
'"Segoe UI"',
|
|
41
|
+
'"Apple SD Gothic Neo"',
|
|
42
|
+
'"Noto Sans KR"',
|
|
43
|
+
'"Malgun Gothic"',
|
|
44
|
+
'"Apple Color Emoji"',
|
|
45
|
+
'"Segoe UI Emoji"',
|
|
46
|
+
'"Segoe UI Symbol"',
|
|
47
|
+
"sans-serif",
|
|
48
|
+
].join(",");
|
|
49
|
+
|
|
50
|
+
const typographyOptions: TypographyOptions = {
|
|
51
|
+
fontFamily,
|
|
52
|
+
...{
|
|
53
|
+
...fontVariants,
|
|
54
|
+
// alias Mui Typography variants
|
|
55
|
+
h1: fontVariants.headline1,
|
|
56
|
+
h2: fontVariants.headline2,
|
|
57
|
+
h3: fontVariants.headline3,
|
|
58
|
+
h4: fontVariants.headline4,
|
|
59
|
+
h5: fontVariants.headline5,
|
|
60
|
+
h6: fontVariants.headline5,
|
|
61
|
+
body1: fontVariants.body1_16_regular,
|
|
62
|
+
body2: fontVariants.body2_14_regular,
|
|
63
|
+
button: fontVariants.button2,
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const typographyDefaultProps = {
|
|
68
|
+
variantMapping: {
|
|
69
|
+
headline1: "h1",
|
|
70
|
+
headline2: "h2",
|
|
71
|
+
headline3: "h3",
|
|
72
|
+
headline4: "h4",
|
|
73
|
+
headline5: "h6",
|
|
74
|
+
body1_16_semibold: "p",
|
|
75
|
+
body1_16_regular: "p",
|
|
76
|
+
body2_14_bold: "p",
|
|
77
|
+
body2_14_medium: "p",
|
|
78
|
+
body2_14_regular: "p",
|
|
79
|
+
body3_12_semibold: "p",
|
|
80
|
+
body3_12_regular: "p",
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const createTypographyCssBaseline = () => {
|
|
85
|
+
return {
|
|
86
|
+
html: {
|
|
87
|
+
fontFamily,
|
|
88
|
+
fontFeatureSettings: `'tnum', 'ss01', 'ss02', 'ss08'`,
|
|
89
|
+
},
|
|
90
|
+
":root": {
|
|
91
|
+
...cssVariables,
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export default typographyOptions;
|