@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,211 @@
|
|
|
1
|
+
import { ColorTokenValueBySurface } from "./types";
|
|
2
|
+
|
|
3
|
+
export interface TokenCoreColorValue {
|
|
4
|
+
[token: string]: ColorTokenValueBySurface;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const tokenCoreColor: TokenCoreColorValue = {
|
|
8
|
+
bg_01: {
|
|
9
|
+
light1: "--grey_0",
|
|
10
|
+
light2: "--grey_10",
|
|
11
|
+
dark1: "--grey_90",
|
|
12
|
+
dark2: "--grey_85",
|
|
13
|
+
dark3: "--grey_80",
|
|
14
|
+
dark4: "--grey_70",
|
|
15
|
+
},
|
|
16
|
+
bg_02: {
|
|
17
|
+
light1: "--grey_0",
|
|
18
|
+
light2: "--grey_0",
|
|
19
|
+
dark1: "--grey_70",
|
|
20
|
+
dark2: "--grey_70",
|
|
21
|
+
dark3: "--grey_70",
|
|
22
|
+
dark4: "--grey_70",
|
|
23
|
+
},
|
|
24
|
+
bg_03: {
|
|
25
|
+
light1: "--grey_0",
|
|
26
|
+
light2: "--grey_0",
|
|
27
|
+
dark1: "--grey_85",
|
|
28
|
+
dark2: "--grey_85",
|
|
29
|
+
dark3: "--grey_85",
|
|
30
|
+
dark4: "--grey_85",
|
|
31
|
+
},
|
|
32
|
+
text_primary: {
|
|
33
|
+
light1: "--lunit_teal_50",
|
|
34
|
+
light2: "--lunit_teal_50",
|
|
35
|
+
dark1: "--lunit_teal_40",
|
|
36
|
+
dark2: "--lunit_teal_40",
|
|
37
|
+
dark3: "--lunit_teal_40",
|
|
38
|
+
dark4: "--lunit_teal_40",
|
|
39
|
+
},
|
|
40
|
+
text_normal: {
|
|
41
|
+
light1: "--grey_95",
|
|
42
|
+
light2: "--grey_95",
|
|
43
|
+
dark1: "--grey_5",
|
|
44
|
+
dark2: "--grey_5",
|
|
45
|
+
dark3: "--grey_5",
|
|
46
|
+
dark4: "--grey_5",
|
|
47
|
+
},
|
|
48
|
+
text_medium: {
|
|
49
|
+
light1: "--grey_60",
|
|
50
|
+
light2: "--grey_60",
|
|
51
|
+
dark1: "--grey_40",
|
|
52
|
+
dark2: "--grey_40",
|
|
53
|
+
dark3: "--grey_40",
|
|
54
|
+
dark4: "--grey_30",
|
|
55
|
+
},
|
|
56
|
+
text_light: {
|
|
57
|
+
light1: "--grey_40",
|
|
58
|
+
light2: "--grey_40",
|
|
59
|
+
dark1: "--grey_50",
|
|
60
|
+
dark2: "--grey_50",
|
|
61
|
+
dark3: "--grey_50",
|
|
62
|
+
dark4: "--grey_40",
|
|
63
|
+
},
|
|
64
|
+
text_error: {
|
|
65
|
+
light1: "--red_40",
|
|
66
|
+
light2: "--red_40",
|
|
67
|
+
dark1: "--red_40",
|
|
68
|
+
dark2: "--red_40",
|
|
69
|
+
dark3: "--red_30",
|
|
70
|
+
dark4: "--red_30",
|
|
71
|
+
},
|
|
72
|
+
text_success: {
|
|
73
|
+
// TODO: sucess -> success 로 바뀌었으니 코드 내 사용되는 부분 확인해서 업데이트. 개발자들에게도 공지할것.
|
|
74
|
+
light1: "--green_40",
|
|
75
|
+
light2: "--green_40",
|
|
76
|
+
dark1: "--green_40",
|
|
77
|
+
dark2: "--green_40",
|
|
78
|
+
dark3: "--green_30",
|
|
79
|
+
dark4: "--green_30",
|
|
80
|
+
},
|
|
81
|
+
text_warning: {
|
|
82
|
+
light1: "--orange_40",
|
|
83
|
+
light2: "--orange_40",
|
|
84
|
+
dark1: "--orange_40",
|
|
85
|
+
dark2: "--orange_40",
|
|
86
|
+
dark3: "--orange_30",
|
|
87
|
+
dark4: "--orange_30",
|
|
88
|
+
},
|
|
89
|
+
text_info: {
|
|
90
|
+
light1: "--blue_40",
|
|
91
|
+
light2: "--blue_40",
|
|
92
|
+
dark1: "--blue_40",
|
|
93
|
+
dark2: "--blue_40",
|
|
94
|
+
dark3: "--blue_30",
|
|
95
|
+
dark4: "--blue_30",
|
|
96
|
+
},
|
|
97
|
+
link_primary: {
|
|
98
|
+
light1: "--blue_40",
|
|
99
|
+
light2: "--blue_40",
|
|
100
|
+
dark1: "--blue_40",
|
|
101
|
+
dark2: "--blue_40",
|
|
102
|
+
dark3: "--blue_30",
|
|
103
|
+
dark4: "--blue_30",
|
|
104
|
+
},
|
|
105
|
+
link_hover: {
|
|
106
|
+
light1: "--blue_50",
|
|
107
|
+
light2: "--blue_50",
|
|
108
|
+
dark1: "--blue_50",
|
|
109
|
+
dark2: "--blue_50",
|
|
110
|
+
dark3: "--blue_40",
|
|
111
|
+
dark4: "--blue_40",
|
|
112
|
+
},
|
|
113
|
+
link_visited: {
|
|
114
|
+
light1: "--purple_50",
|
|
115
|
+
light2: "--purple_50",
|
|
116
|
+
dark1: "--purple_50",
|
|
117
|
+
dark2: "--purple_50",
|
|
118
|
+
dark3: "--purple_40",
|
|
119
|
+
dark4: "--purple_40",
|
|
120
|
+
},
|
|
121
|
+
icon_error_02: {
|
|
122
|
+
light1: "--red_40",
|
|
123
|
+
light2: "--red_40",
|
|
124
|
+
dark1: "--red_30",
|
|
125
|
+
dark2: "--red_30",
|
|
126
|
+
dark3: "--red_30",
|
|
127
|
+
dark4: "--red_30",
|
|
128
|
+
},
|
|
129
|
+
icon_success_02: {
|
|
130
|
+
// TODO: sucess -> success 로 바뀌었으니 코드 내 사용되는 부분 확인해서 업데이트. 개발자들에게도 공지할것.
|
|
131
|
+
light1: "--green_40",
|
|
132
|
+
light2: "--green_40",
|
|
133
|
+
dark1: "--green_30",
|
|
134
|
+
dark2: "--green_30",
|
|
135
|
+
dark3: "--green_30",
|
|
136
|
+
dark4: "--green_30",
|
|
137
|
+
},
|
|
138
|
+
icon_warning_02: {
|
|
139
|
+
light1: "--orange_40",
|
|
140
|
+
light2: "--orange_40",
|
|
141
|
+
dark1: "--orange_30",
|
|
142
|
+
dark2: "--orange_30",
|
|
143
|
+
dark3: "--orange_30",
|
|
144
|
+
dark4: "--orange_30",
|
|
145
|
+
},
|
|
146
|
+
icon_info_02: {
|
|
147
|
+
light1: "--blue_40",
|
|
148
|
+
light2: "--blue_40",
|
|
149
|
+
dark1: "--blue_30",
|
|
150
|
+
dark2: "--blue_30",
|
|
151
|
+
dark3: "--blue_30",
|
|
152
|
+
dark4: "--blue_30",
|
|
153
|
+
},
|
|
154
|
+
hover: {
|
|
155
|
+
// TODO: 알파값 적용 코드는 일단 하드코딩. 나중에 수정할것
|
|
156
|
+
light1: "rgba(0, 0, 0, 0.1)", // grey_100 10%
|
|
157
|
+
light2: "rgba(0, 0, 0, 0.1)", // grey_100 10%
|
|
158
|
+
dark1: "rgba(0, 0, 0, 0.1)", // grey_100 10%
|
|
159
|
+
dark2: "rgba(0, 0, 0, 0.1)", // grey_100 10%
|
|
160
|
+
dark3: "rgba(0, 0, 0, 0.1)", // grey_100 10%
|
|
161
|
+
dark4: "rgba(0, 0, 0, 0.1)", // grey_100 10%
|
|
162
|
+
},
|
|
163
|
+
focused: {
|
|
164
|
+
light1: "--lunit_teal_40",
|
|
165
|
+
light2: "--lunit_teal_40",
|
|
166
|
+
dark1: "--lunit_teal_40",
|
|
167
|
+
dark2: "--lunit_teal_40",
|
|
168
|
+
dark3: "--lunit_teal_40",
|
|
169
|
+
dark4: "--lunit_teal_40",
|
|
170
|
+
},
|
|
171
|
+
selected: {
|
|
172
|
+
light1: "--lunit_teal_10",
|
|
173
|
+
light2: "--lunit_teal_10",
|
|
174
|
+
dark1: "--lunit_teal_80",
|
|
175
|
+
dark2: "--lunit_teal_80",
|
|
176
|
+
dark3: "--lunit_teal_80",
|
|
177
|
+
dark4: "--lunit_teal_80",
|
|
178
|
+
},
|
|
179
|
+
shadow_01: {
|
|
180
|
+
light1: "rgba(0, 0, 0, 0.12)", // "--grey_100 12%",
|
|
181
|
+
light2: "rgba(0, 0, 0, 0.12)", // "--grey_100 12%",
|
|
182
|
+
dark4: "rgba(0, 0, 0, 0.32)", // "--grey_100 32%",
|
|
183
|
+
dark3: "rgba(0, 0, 0, 0.32)", // "--grey_100 32%",
|
|
184
|
+
dark2: "rgba(0, 0, 0, 0.32)", // "--grey_100 32%",
|
|
185
|
+
dark1: "rgba(0, 0, 0, 0.32)", // "--grey_100 32%",
|
|
186
|
+
},
|
|
187
|
+
shadow_02: {
|
|
188
|
+
light1: "rgba(0, 0, 0, 0.18)", // "--grey_100 18%",
|
|
189
|
+
light2: "rgba(0, 0, 0, 0.18)", // "--grey_100 18%",
|
|
190
|
+
dark4: "rgba(0, 0, 0, 0.4)", // "--grey_100 40%",
|
|
191
|
+
dark3: "rgba(0, 0, 0, 0.4)", // "--grey_100 40%",
|
|
192
|
+
dark2: "rgba(0, 0, 0, 0.4)", // "--grey_100 40%",
|
|
193
|
+
dark1: "rgba(0, 0, 0, 0.4)", // "--grey_100 40%",
|
|
194
|
+
},
|
|
195
|
+
shadow_03: {
|
|
196
|
+
light1: "rgba(0, 0, 0, 0.12)", // "--grey_100 12%",
|
|
197
|
+
light2: "rgba(0, 0, 0, 0.12)", // "--grey_100 12%",
|
|
198
|
+
dark4: "rgba(0, 0, 0, 0.36)", // "--grey_100 36%",
|
|
199
|
+
dark3: "rgba(0, 0, 0, 0.36)", // "--grey_100 36%",
|
|
200
|
+
dark2: "rgba(0, 0, 0, 0.36)", // "--grey_100 36%",
|
|
201
|
+
dark1: "rgba(0, 0, 0, 0.36)", // "--grey_100 36%",
|
|
202
|
+
},
|
|
203
|
+
shadow_04: {
|
|
204
|
+
light1: "rgba(0, 0, 0, 0.18)", // "--grey_100 18%",
|
|
205
|
+
light2: "rgba(0, 0, 0, 0.18)", // "--grey_100 18%",
|
|
206
|
+
dark4: "rgba(0, 0, 0, 0.48)", // "--grey_100 48%",
|
|
207
|
+
dark3: "rgba(0, 0, 0, 0.48)", // "--grey_100 48%",
|
|
208
|
+
dark2: "rgba(0, 0, 0, 0.48)", // "--grey_100 48%",
|
|
209
|
+
dark1: "rgba(0, 0, 0, 0.48)", // "--grey_100 48%",
|
|
210
|
+
},
|
|
211
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
type CSSPropertyColor = React.CSSProperties["color"];
|
|
2
|
+
|
|
3
|
+
export interface ColorToken {
|
|
4
|
+
core: {
|
|
5
|
+
bg_01: CSSPropertyColor;
|
|
6
|
+
bg_02: CSSPropertyColor;
|
|
7
|
+
bg_03: CSSPropertyColor;
|
|
8
|
+
text_primary: CSSPropertyColor;
|
|
9
|
+
text_normal: CSSPropertyColor;
|
|
10
|
+
text_medium: CSSPropertyColor;
|
|
11
|
+
text_light: CSSPropertyColor;
|
|
12
|
+
text_error: CSSPropertyColor;
|
|
13
|
+
text_success: CSSPropertyColor;
|
|
14
|
+
text_warning: CSSPropertyColor;
|
|
15
|
+
text_info: CSSPropertyColor;
|
|
16
|
+
link_primary: CSSPropertyColor;
|
|
17
|
+
link_hover: CSSPropertyColor;
|
|
18
|
+
link_visited: CSSPropertyColor;
|
|
19
|
+
icon_error_02: CSSPropertyColor;
|
|
20
|
+
icon_success_02: CSSPropertyColor;
|
|
21
|
+
icon_warning_02: CSSPropertyColor;
|
|
22
|
+
icon_info_02: CSSPropertyColor;
|
|
23
|
+
hover: CSSPropertyColor;
|
|
24
|
+
focused: CSSPropertyColor;
|
|
25
|
+
selected: CSSPropertyColor;
|
|
26
|
+
shadow_01: CSSPropertyColor;
|
|
27
|
+
shadow_02: CSSPropertyColor;
|
|
28
|
+
shadow_03: CSSPropertyColor;
|
|
29
|
+
shadow_04: CSSPropertyColor;
|
|
30
|
+
};
|
|
31
|
+
component: {
|
|
32
|
+
btn_contained_primary_bg: CSSPropertyColor;
|
|
33
|
+
btn_contained_primary_text: CSSPropertyColor;
|
|
34
|
+
btn_contained_secondary_bg: CSSPropertyColor;
|
|
35
|
+
btn_contained_secondary_text: CSSPropertyColor;
|
|
36
|
+
btn_contained_error_bg: CSSPropertyColor;
|
|
37
|
+
btn_contained_error_text: CSSPropertyColor;
|
|
38
|
+
btn_outlined_primary_border: CSSPropertyColor;
|
|
39
|
+
btn_outlined_primary_text: CSSPropertyColor;
|
|
40
|
+
btn_ghost_primary_text: CSSPropertyColor;
|
|
41
|
+
btn_ghost_secondary_text: CSSPropertyColor;
|
|
42
|
+
btn_ghost_error_text: CSSPropertyColor;
|
|
43
|
+
btn_selected_primary_bg: CSSPropertyColor;
|
|
44
|
+
btn_selected_primary_text: CSSPropertyColor;
|
|
45
|
+
btn_selected_secondary_bg: CSSPropertyColor;
|
|
46
|
+
btn_selected_secondary_text: CSSPropertyColor;
|
|
47
|
+
selectcontrol_on: CSSPropertyColor;
|
|
48
|
+
selectcontrol_off: CSSPropertyColor;
|
|
49
|
+
selectcontrol_handler: CSSPropertyColor;
|
|
50
|
+
selectcontrol_handler_shadow: CSSPropertyColor;
|
|
51
|
+
textfield_bg: CSSPropertyColor;
|
|
52
|
+
textfield_border_error: CSSPropertyColor;
|
|
53
|
+
dropdown_divider_border: CSSPropertyColor;
|
|
54
|
+
datatable_border_01: CSSPropertyColor;
|
|
55
|
+
datatable_border_02: CSSPropertyColor;
|
|
56
|
+
datatable_zebra: CSSPropertyColor;
|
|
57
|
+
scrollbars_bg: CSSPropertyColor;
|
|
58
|
+
scrollbars_hover: CSSPropertyColor;
|
|
59
|
+
scrollbars_pressed: CSSPropertyColor;
|
|
60
|
+
modal_overlay: CSSPropertyColor;
|
|
61
|
+
tooltip_bg: CSSPropertyColor;
|
|
62
|
+
tooltip_text_normal: CSSPropertyColor;
|
|
63
|
+
tooltip_text_medium: CSSPropertyColor;
|
|
64
|
+
alert_error_bg: CSSPropertyColor;
|
|
65
|
+
alert_error_border: CSSPropertyColor;
|
|
66
|
+
alert_success_bg: CSSPropertyColor;
|
|
67
|
+
alert_success_border: CSSPropertyColor;
|
|
68
|
+
alert_info_bg: CSSPropertyColor;
|
|
69
|
+
alert_info_border: CSSPropertyColor;
|
|
70
|
+
alert_warning_bg: CSSPropertyColor;
|
|
71
|
+
alert_warning_border: CSSPropertyColor;
|
|
72
|
+
chip_primary_bg: CSSPropertyColor;
|
|
73
|
+
chip_primary_text: CSSPropertyColor;
|
|
74
|
+
chip_secondary_bg: CSSPropertyColor;
|
|
75
|
+
chip_secondary_text: CSSPropertyColor;
|
|
76
|
+
chip_error_bg: CSSPropertyColor;
|
|
77
|
+
chip_error_text: CSSPropertyColor;
|
|
78
|
+
chip_warning_bg: CSSPropertyColor;
|
|
79
|
+
chip_warning_text: CSSPropertyColor;
|
|
80
|
+
chip_success_bg: CSSPropertyColor;
|
|
81
|
+
chip_success_text: CSSPropertyColor;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Components, Theme } from "@mui/material";
|
|
2
|
+
import { deepmerge } from "@mui/utils";
|
|
3
|
+
import paletteOptions, { createColorCssBaseline } from "./colors";
|
|
4
|
+
import typographyOptions, {
|
|
5
|
+
createTypographyCssBaseline,
|
|
6
|
+
typographyDefaultProps,
|
|
7
|
+
} from "./Typography";
|
|
8
|
+
import { createElevationCssBaseline, elevationOptions } from "./Elevation";
|
|
9
|
+
|
|
10
|
+
export const foundationCssBaseline: Components<Theme>["MuiCssBaseline"] = {
|
|
11
|
+
styleOverrides: deepmerge(
|
|
12
|
+
deepmerge(createTypographyCssBaseline(), createColorCssBaseline()),
|
|
13
|
+
createElevationCssBaseline()
|
|
14
|
+
),
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const typography = typographyOptions;
|
|
18
|
+
|
|
19
|
+
export { typographyDefaultProps };
|
|
20
|
+
|
|
21
|
+
export const palette = paletteOptions;
|
|
22
|
+
|
|
23
|
+
export const elevation = elevationOptions;
|
|
24
|
+
|
|
25
|
+
export { spacing } from "./spacing";
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { default as theme } from "./theme";
|
|
2
|
+
export { base as baseColors } from "./foundation/colors";
|
|
3
|
+
|
|
4
|
+
export { default as Alert } from "./components/Alert";
|
|
5
|
+
export { default as Button } from "./components/Button";
|
|
6
|
+
export { default as Chip } from "./components/Chip";
|
|
7
|
+
export { default as DataTable } from "./components/DataTable";
|
|
8
|
+
export { default as DatePicker } from "./components/DatePicker";
|
|
9
|
+
export { default as Dropdown } from "./components/Dropdown";
|
|
10
|
+
export { default as FormLabel } from "./components/FormLabel";
|
|
11
|
+
export { default as Modal } from "./components/Modal";
|
|
12
|
+
export { default as Radio } from "./components/Radio";
|
|
13
|
+
export { default as RadioGroup } from "./components/RadioGroup";
|
|
14
|
+
export { default as TextField } from "./components/TextField";
|
|
15
|
+
export { default as Toggle } from "./components/Toggle";
|
|
16
|
+
export { default as ToggleButton } from "./components/ToggleButton";
|
|
17
|
+
export { default as ToggleButtonGroup } from "./components/ToggleButtonGroup";
|
|
18
|
+
export { default as Tooltip } from "./components/Tooltip";
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Box, Typography } from "@mui/material";
|
|
3
|
+
import { StoryFn, Meta } from "@storybook/react";
|
|
4
|
+
|
|
5
|
+
import Alert from "@/components/Alert";
|
|
6
|
+
import Button from "@/components/Button";
|
|
7
|
+
import theme from "@/theme";
|
|
8
|
+
import { action } from "@storybook/addon-actions";
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
title: "Components/Alert",
|
|
12
|
+
component: Alert,
|
|
13
|
+
argTypes: {
|
|
14
|
+
title: {
|
|
15
|
+
control: "text",
|
|
16
|
+
description: "Used to represent the title of the alert.",
|
|
17
|
+
},
|
|
18
|
+
severity: {
|
|
19
|
+
control: "radio",
|
|
20
|
+
table: {
|
|
21
|
+
defaultValue: { summary: "success" },
|
|
22
|
+
},
|
|
23
|
+
options: ["success", "info", "warning", "error", undefined],
|
|
24
|
+
description: `\`success\`, \`info\`, \`warning\`, \`error\`, \`undefined\``,
|
|
25
|
+
},
|
|
26
|
+
onClose: {
|
|
27
|
+
control: "function",
|
|
28
|
+
description: `Callback fired when the component requests to be closed.
|
|
29
|
+
When provided, a close icon button is displayed that triggers the callback when clicked.`,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
parameters: {
|
|
33
|
+
controls: {
|
|
34
|
+
include: ["title", "severity", "onClose"],
|
|
35
|
+
},
|
|
36
|
+
docs: {
|
|
37
|
+
description: {
|
|
38
|
+
component: `An alert displays a short, important message in a way that attracts the
|
|
39
|
+
user's attention without interrupting the user's task.
|
|
40
|
+
see [Material-UI Alert](https://mui.com/components/alert/)`,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
decorators: [
|
|
45
|
+
(Story) => (
|
|
46
|
+
<Box
|
|
47
|
+
sx={{
|
|
48
|
+
display: "flex",
|
|
49
|
+
flexDirection: "column",
|
|
50
|
+
padding: "3em",
|
|
51
|
+
gap: "1em",
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
{Story()}
|
|
55
|
+
</Box>
|
|
56
|
+
),
|
|
57
|
+
],
|
|
58
|
+
} as Meta<typeof Alert>;
|
|
59
|
+
|
|
60
|
+
const AlertChildrenContentLong = () => {
|
|
61
|
+
return (
|
|
62
|
+
<Typography variant="body2_14_regular">
|
|
63
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
|
|
64
|
+
tempor incididunt ut{" "}
|
|
65
|
+
<u style={{ color: theme.palette.token.core.link_primary }}>
|
|
66
|
+
labore et dolore
|
|
67
|
+
</u>{" "}
|
|
68
|
+
magna aliqua. A diam sollicitudin tempor id eu nisl nunc mi. Auctor augue
|
|
69
|
+
mauris augue neque gravida in fermentum.
|
|
70
|
+
</Typography>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const AlertChildrenContentShort = () => {
|
|
75
|
+
return (
|
|
76
|
+
<Typography variant="body2_14_regular">
|
|
77
|
+
Lorem ipsum dolor sit amet, consectetur adipiscin
|
|
78
|
+
</Typography>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const AlertBottomAction = () => {
|
|
83
|
+
return (
|
|
84
|
+
<Box sx={{ display: "flex", columnGap: "8px" }}>
|
|
85
|
+
<Button color="primary" kind="contained">
|
|
86
|
+
Button
|
|
87
|
+
</Button>
|
|
88
|
+
<Button color="secondary" kind="ghost">
|
|
89
|
+
Button
|
|
90
|
+
</Button>
|
|
91
|
+
</Box>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const Template: StoryFn<typeof Alert> = (args) => (
|
|
96
|
+
<Alert sx={{ width: "620px" }} {...args}>
|
|
97
|
+
<AlertChildrenContentLong />
|
|
98
|
+
</Alert>
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
const Template2: StoryFn<typeof Alert> = (args) => (
|
|
102
|
+
<>
|
|
103
|
+
<Alert sx={{ width: "504px" }} {...args}>
|
|
104
|
+
<AlertChildrenContentLong />
|
|
105
|
+
</Alert>
|
|
106
|
+
<Alert sx={{ width: "620px" }} severity={args.severity} onClose={() => {}}>
|
|
107
|
+
<AlertChildrenContentLong />
|
|
108
|
+
</Alert>
|
|
109
|
+
<Alert sx={{ width: "620px" }} severity={args.severity} onClose={() => {}}>
|
|
110
|
+
<AlertChildrenContentShort />
|
|
111
|
+
</Alert>
|
|
112
|
+
<Alert sx={{ width: "620px" }} severity={args.severity}>
|
|
113
|
+
<AlertChildrenContentShort />
|
|
114
|
+
</Alert>
|
|
115
|
+
</>
|
|
116
|
+
);
|
|
117
|
+
const Template3: StoryFn<typeof Alert> = (args) => (
|
|
118
|
+
<>
|
|
119
|
+
<Alert
|
|
120
|
+
sx={{ width: "504px" }}
|
|
121
|
+
bottomAction={<AlertBottomAction />}
|
|
122
|
+
{...args}
|
|
123
|
+
>
|
|
124
|
+
<AlertChildrenContentLong />
|
|
125
|
+
</Alert>
|
|
126
|
+
</>
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
export const AlertBase = {
|
|
130
|
+
render: Template,
|
|
131
|
+
|
|
132
|
+
args: {
|
|
133
|
+
title: "Alert title",
|
|
134
|
+
severity: "success",
|
|
135
|
+
onClose: action("Close Button is clicked"),
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export const AlertVariant = {
|
|
140
|
+
render: Template2,
|
|
141
|
+
|
|
142
|
+
args: {
|
|
143
|
+
title: "Alert title",
|
|
144
|
+
severity: "success",
|
|
145
|
+
onClose: action("Close Button is clicked"),
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export const AlertWithBottomAction = {
|
|
150
|
+
render: Template3,
|
|
151
|
+
|
|
152
|
+
args: {
|
|
153
|
+
title: "Alert title",
|
|
154
|
+
severity: "success",
|
|
155
|
+
onClose: action("Close Button is clicked"),
|
|
156
|
+
},
|
|
157
|
+
};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { action } from "@storybook/addon-actions";
|
|
3
|
+
import {
|
|
4
|
+
Table,
|
|
5
|
+
TableHead,
|
|
6
|
+
TableRow,
|
|
7
|
+
TableBody,
|
|
8
|
+
TableCell,
|
|
9
|
+
} from "@mui/material";
|
|
10
|
+
import Bell from "@lunit/design-system-icons/Bell";
|
|
11
|
+
|
|
12
|
+
import Button from "@/components/Button";
|
|
13
|
+
|
|
14
|
+
import type { StoryObj, StoryFn, Meta } from "@storybook/react";
|
|
15
|
+
import type { ButtonProps } from "@/components/Button/Button.types";
|
|
16
|
+
|
|
17
|
+
type Size = Pick<ButtonProps, "size">;
|
|
18
|
+
type SizeValues = Size[keyof Size];
|
|
19
|
+
const sizeList: SizeValues[] = ["small", "medium", "large"];
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
title: "Components/Button",
|
|
23
|
+
component: Button,
|
|
24
|
+
args: {
|
|
25
|
+
kind: "contained",
|
|
26
|
+
children: "Text",
|
|
27
|
+
color: "primary",
|
|
28
|
+
disabled: false,
|
|
29
|
+
size: "small",
|
|
30
|
+
onClick: action("onClick"),
|
|
31
|
+
},
|
|
32
|
+
argTypes: {
|
|
33
|
+
icon: {
|
|
34
|
+
control: false,
|
|
35
|
+
description: `Use this prop when you want to add icon.
|
|
36
|
+
\n It is added to the left of the text criteria`,
|
|
37
|
+
table: {
|
|
38
|
+
defaultValue: { summary: "undefined" },
|
|
39
|
+
type: { summary: "React.ReactNode" },
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
children: {
|
|
43
|
+
type: "string",
|
|
44
|
+
},
|
|
45
|
+
kind: {
|
|
46
|
+
control: {
|
|
47
|
+
type: "radio",
|
|
48
|
+
},
|
|
49
|
+
options: ["contained", "outlined", "ghost"],
|
|
50
|
+
description: "Button has three Kinds Contained, Outlined, Ghost",
|
|
51
|
+
table: {
|
|
52
|
+
defaultValue: { summary: "contained" },
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
color: {
|
|
56
|
+
control: {
|
|
57
|
+
type: "radio",
|
|
58
|
+
},
|
|
59
|
+
options: ["primary", "secondary", "error"],
|
|
60
|
+
table: {
|
|
61
|
+
defaultValue: { summary: "primary" },
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
disabled: {
|
|
65
|
+
control: {
|
|
66
|
+
type: "boolean",
|
|
67
|
+
},
|
|
68
|
+
table: {
|
|
69
|
+
defaultValue: { summary: "false" },
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
size: {
|
|
73
|
+
control: {
|
|
74
|
+
type: "radio",
|
|
75
|
+
},
|
|
76
|
+
options: ["small", "medium", "large"],
|
|
77
|
+
table: {
|
|
78
|
+
defaultValue: { summary: "small" },
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
onClick: {
|
|
82
|
+
type: "function",
|
|
83
|
+
control: {
|
|
84
|
+
type: "radio",
|
|
85
|
+
},
|
|
86
|
+
options: ["function", undefined],
|
|
87
|
+
mapping: {
|
|
88
|
+
function: action("onClick"),
|
|
89
|
+
undefined: undefined,
|
|
90
|
+
},
|
|
91
|
+
description:
|
|
92
|
+
"It is a callback function that is called when the button is clicked.",
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
parameters: {
|
|
96
|
+
controls: {
|
|
97
|
+
include: [
|
|
98
|
+
"onClick",
|
|
99
|
+
"children",
|
|
100
|
+
"disabled",
|
|
101
|
+
"size",
|
|
102
|
+
"kind",
|
|
103
|
+
"color",
|
|
104
|
+
"icon",
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
docs: {
|
|
108
|
+
description: {
|
|
109
|
+
component: `It is a Clickable default Button. For more details, please
|
|
110
|
+
see [Material-UI Button](https://mui.com/material-ui/react-button/).`,
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
} as Meta<typeof Button>;
|
|
115
|
+
|
|
116
|
+
export const BasicButton: StoryObj<typeof Button> = {
|
|
117
|
+
render: (args) => <Button {...args}>{args.children}</Button>,
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const SizeButtonTemplate: StoryFn<typeof Button> = (args) => {
|
|
121
|
+
return (
|
|
122
|
+
<Table sx={{ width: 900 }}>
|
|
123
|
+
<TableHead>
|
|
124
|
+
<TableRow>
|
|
125
|
+
<TableCell
|
|
126
|
+
colSpan={3}
|
|
127
|
+
sx={{
|
|
128
|
+
typography: "body1_16_semibold",
|
|
129
|
+
color: "inherit",
|
|
130
|
+
}}
|
|
131
|
+
>
|
|
132
|
+
Size
|
|
133
|
+
</TableCell>
|
|
134
|
+
</TableRow>
|
|
135
|
+
<TableRow>
|
|
136
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
137
|
+
Small
|
|
138
|
+
</TableCell>
|
|
139
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
140
|
+
Medium
|
|
141
|
+
</TableCell>
|
|
142
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
143
|
+
Large
|
|
144
|
+
</TableCell>
|
|
145
|
+
</TableRow>
|
|
146
|
+
</TableHead>
|
|
147
|
+
<TableBody>
|
|
148
|
+
<TableRow>
|
|
149
|
+
{sizeList.map((size) => (
|
|
150
|
+
<TableCell key={size} sx={{ "& button": { marginRight: "10px" } }}>
|
|
151
|
+
<Button {...args} icon={<Bell />} size={size} />
|
|
152
|
+
<Button {...args} size={size}>
|
|
153
|
+
{args.children}
|
|
154
|
+
</Button>
|
|
155
|
+
<Button {...args} icon={<Bell />} size={size}>
|
|
156
|
+
{args.children}
|
|
157
|
+
</Button>
|
|
158
|
+
</TableCell>
|
|
159
|
+
))}
|
|
160
|
+
</TableRow>
|
|
161
|
+
</TableBody>
|
|
162
|
+
</Table>
|
|
163
|
+
);
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export const Size = {
|
|
167
|
+
render: SizeButtonTemplate,
|
|
168
|
+
};
|