@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,292 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Table,
|
|
4
|
+
TableHead,
|
|
5
|
+
TableRow,
|
|
6
|
+
TableBody,
|
|
7
|
+
TableCell,
|
|
8
|
+
} from "@mui/material";
|
|
9
|
+
import { action } from "@storybook/addon-actions";
|
|
10
|
+
import Bell from "@lunit/design-system-icons/Bell";
|
|
11
|
+
|
|
12
|
+
import ToggleButton from "@/components/ToggleButton";
|
|
13
|
+
|
|
14
|
+
import type { StoryFn, Meta } from "@storybook/react";
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
title: "Components/ToggleButton",
|
|
18
|
+
component: ToggleButton,
|
|
19
|
+
args: {
|
|
20
|
+
kind: "contained",
|
|
21
|
+
color: "primary",
|
|
22
|
+
selectedColor: "primary",
|
|
23
|
+
size: "small",
|
|
24
|
+
disabled: false,
|
|
25
|
+
},
|
|
26
|
+
argTypes: {
|
|
27
|
+
icon: {
|
|
28
|
+
control: false,
|
|
29
|
+
description: `Use this prop when you want to add icon.
|
|
30
|
+
\n It is added to the left of the text criteria`,
|
|
31
|
+
table: {
|
|
32
|
+
defaultValue: { summary: "undefined" },
|
|
33
|
+
type: { summary: "React.ReactNode" },
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
value: {
|
|
37
|
+
control: false,
|
|
38
|
+
table: { type: { summary: "any" } },
|
|
39
|
+
},
|
|
40
|
+
selected: {
|
|
41
|
+
control: false,
|
|
42
|
+
table: {
|
|
43
|
+
defaultValue: { summary: "false" },
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
selectedColor: {
|
|
47
|
+
control: false,
|
|
48
|
+
options: ["primary", "secondary"],
|
|
49
|
+
description:
|
|
50
|
+
"The color of the button when it is in an select state. It has nothing to do with active button",
|
|
51
|
+
table: {
|
|
52
|
+
defaultValue: { summary: "primary" },
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
color: {
|
|
56
|
+
control: {
|
|
57
|
+
type: "radio",
|
|
58
|
+
},
|
|
59
|
+
options: ["primary", "secondary"],
|
|
60
|
+
description: "Button has three Kinds Contained, Ghost",
|
|
61
|
+
table: {
|
|
62
|
+
defaultValue: { summary: "primary" },
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
kind: {
|
|
66
|
+
control: {
|
|
67
|
+
type: "radio",
|
|
68
|
+
},
|
|
69
|
+
options: ["contained", "outlined", "ghost"],
|
|
70
|
+
table: {
|
|
71
|
+
defaultValue: { summary: "contained" },
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
children: {
|
|
75
|
+
type: "string",
|
|
76
|
+
},
|
|
77
|
+
disabled: {
|
|
78
|
+
control: {
|
|
79
|
+
type: "boolean",
|
|
80
|
+
},
|
|
81
|
+
table: {
|
|
82
|
+
defaultValue: { summary: "false" },
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
size: {
|
|
86
|
+
control: {
|
|
87
|
+
type: "radio",
|
|
88
|
+
},
|
|
89
|
+
options: ["small", "medium", "large"],
|
|
90
|
+
table: {
|
|
91
|
+
defaultValue: { summary: "small" },
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
onClick: {
|
|
95
|
+
type: "function",
|
|
96
|
+
control: {
|
|
97
|
+
type: "select",
|
|
98
|
+
},
|
|
99
|
+
options: ["function", undefined],
|
|
100
|
+
mapping: {
|
|
101
|
+
function: action("onClick"),
|
|
102
|
+
undefined: undefined,
|
|
103
|
+
},
|
|
104
|
+
description:
|
|
105
|
+
"It is a callback function that is called when the button is clicked.",
|
|
106
|
+
},
|
|
107
|
+
onChange: {
|
|
108
|
+
type: "function",
|
|
109
|
+
control: false,
|
|
110
|
+
options: ["function", undefined],
|
|
111
|
+
mapping: {
|
|
112
|
+
function: action("onChange"),
|
|
113
|
+
undefined: undefined,
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
parameters: {
|
|
118
|
+
controls: {
|
|
119
|
+
include: [
|
|
120
|
+
"icon",
|
|
121
|
+
"value",
|
|
122
|
+
"kind",
|
|
123
|
+
"selectedColor",
|
|
124
|
+
"onClick",
|
|
125
|
+
"children",
|
|
126
|
+
"disabled",
|
|
127
|
+
"size",
|
|
128
|
+
"selected",
|
|
129
|
+
"color",
|
|
130
|
+
"onChange",
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
docs: {
|
|
134
|
+
description: {
|
|
135
|
+
component: `A Toggle Button can be used to group related options. please
|
|
136
|
+
see [Material-UI Toggle Button](https://mui.com/material-ui/react-toggle-button/).`,
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
} as Meta<typeof ToggleButton>;
|
|
141
|
+
|
|
142
|
+
const Template: StoryFn<typeof ToggleButton> = (arg) => {
|
|
143
|
+
const [values, setValues] = useState({
|
|
144
|
+
primary: true,
|
|
145
|
+
secondary: true,
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
const handleChange = (value: keyof typeof values) => {
|
|
149
|
+
setValues({
|
|
150
|
+
...values,
|
|
151
|
+
[value]: !values[value],
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
return (
|
|
156
|
+
<Table sx={{ width: 330 }}>
|
|
157
|
+
<TableHead>
|
|
158
|
+
<TableRow>
|
|
159
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
160
|
+
Selected color
|
|
161
|
+
</TableCell>
|
|
162
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
163
|
+
Primary
|
|
164
|
+
</TableCell>
|
|
165
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
166
|
+
Secondary
|
|
167
|
+
</TableCell>
|
|
168
|
+
</TableRow>
|
|
169
|
+
</TableHead>
|
|
170
|
+
<TableBody>
|
|
171
|
+
<TableRow>
|
|
172
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
173
|
+
Selected
|
|
174
|
+
</TableCell>
|
|
175
|
+
<TableCell>
|
|
176
|
+
<ToggleButton
|
|
177
|
+
{...arg}
|
|
178
|
+
icon={<Bell />}
|
|
179
|
+
value="primary"
|
|
180
|
+
onChange={() => handleChange("primary")}
|
|
181
|
+
selected={values.primary}
|
|
182
|
+
>
|
|
183
|
+
{arg.children}
|
|
184
|
+
</ToggleButton>
|
|
185
|
+
</TableCell>
|
|
186
|
+
<TableCell>
|
|
187
|
+
<ToggleButton
|
|
188
|
+
{...arg}
|
|
189
|
+
icon={<Bell />}
|
|
190
|
+
selectedColor="secondary"
|
|
191
|
+
value="secondary"
|
|
192
|
+
onChange={() => handleChange("secondary")}
|
|
193
|
+
selected={values.secondary}
|
|
194
|
+
>
|
|
195
|
+
{arg.children}
|
|
196
|
+
</ToggleButton>
|
|
197
|
+
</TableCell>
|
|
198
|
+
</TableRow>
|
|
199
|
+
</TableBody>
|
|
200
|
+
</Table>
|
|
201
|
+
);
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
export const IconStory = {
|
|
205
|
+
render: Template,
|
|
206
|
+
name: "Icon",
|
|
207
|
+
|
|
208
|
+
args: {
|
|
209
|
+
children: "Text",
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
argTypes: {
|
|
213
|
+
children: {
|
|
214
|
+
type: "string",
|
|
215
|
+
defaultValue: "text",
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
const IconOnlyTemplate: StoryFn<typeof ToggleButton> = (arg) => {
|
|
221
|
+
const [values, setValues] = useState({
|
|
222
|
+
primary: true,
|
|
223
|
+
secondary: true,
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
const handleChange = (value: keyof typeof values) => {
|
|
227
|
+
setValues({
|
|
228
|
+
...values,
|
|
229
|
+
[value]: !values[value],
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
return (
|
|
234
|
+
<Table sx={{ width: 330 }}>
|
|
235
|
+
<TableHead>
|
|
236
|
+
<TableRow>
|
|
237
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
238
|
+
Selected color
|
|
239
|
+
</TableCell>
|
|
240
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
241
|
+
Primary
|
|
242
|
+
</TableCell>
|
|
243
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
244
|
+
Secondary
|
|
245
|
+
</TableCell>
|
|
246
|
+
</TableRow>
|
|
247
|
+
</TableHead>
|
|
248
|
+
<TableBody>
|
|
249
|
+
<TableRow>
|
|
250
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
251
|
+
Selected
|
|
252
|
+
</TableCell>
|
|
253
|
+
<TableCell>
|
|
254
|
+
<ToggleButton
|
|
255
|
+
{...arg}
|
|
256
|
+
icon={<Bell />}
|
|
257
|
+
value="primary"
|
|
258
|
+
onChange={() => handleChange("primary")}
|
|
259
|
+
selected={values.primary}
|
|
260
|
+
>
|
|
261
|
+
{arg.children}
|
|
262
|
+
</ToggleButton>
|
|
263
|
+
</TableCell>
|
|
264
|
+
<TableCell>
|
|
265
|
+
<ToggleButton
|
|
266
|
+
{...arg}
|
|
267
|
+
icon={<Bell />}
|
|
268
|
+
selectedColor="secondary"
|
|
269
|
+
value="secondary"
|
|
270
|
+
onChange={() => handleChange("secondary")}
|
|
271
|
+
selected={values.secondary}
|
|
272
|
+
>
|
|
273
|
+
{arg.children}
|
|
274
|
+
</ToggleButton>
|
|
275
|
+
</TableCell>
|
|
276
|
+
</TableRow>
|
|
277
|
+
</TableBody>
|
|
278
|
+
</Table>
|
|
279
|
+
);
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
export const WithIconOnlyStory = {
|
|
283
|
+
render: IconOnlyTemplate,
|
|
284
|
+
name: "Icon only",
|
|
285
|
+
|
|
286
|
+
argTypes: {
|
|
287
|
+
children: {
|
|
288
|
+
type: "string",
|
|
289
|
+
controls: false,
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StoryFn, Meta } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
import Tooltip from "@/components/Tooltip";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Components/Tooltip",
|
|
8
|
+
component: Tooltip,
|
|
9
|
+
} as Meta<typeof Tooltip>;
|
|
10
|
+
|
|
11
|
+
const Template: StoryFn<typeof Tooltip> = () => <Tooltip />;
|
|
12
|
+
|
|
13
|
+
export const LunitChip = {
|
|
14
|
+
render: Template,
|
|
15
|
+
};
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { StoryFn, Meta } from "@storybook/react";
|
|
3
|
+
import {
|
|
4
|
+
Alert,
|
|
5
|
+
Box,
|
|
6
|
+
Button,
|
|
7
|
+
Dialog,
|
|
8
|
+
DialogContent,
|
|
9
|
+
DialogTitle,
|
|
10
|
+
MenuItem,
|
|
11
|
+
Paper,
|
|
12
|
+
Select,
|
|
13
|
+
TextField,
|
|
14
|
+
Tooltip,
|
|
15
|
+
} from "@mui/material";
|
|
16
|
+
import { DatePicker, LocalizationProvider } from "@mui/x-date-pickers";
|
|
17
|
+
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
|
|
18
|
+
import { Dayjs } from "dayjs";
|
|
19
|
+
import { Container, Title } from "./styled";
|
|
20
|
+
|
|
21
|
+
interface ElevationProps {
|
|
22
|
+
surface: string;
|
|
23
|
+
isBase: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const Elevation = ({ surface, isBase = false }: ElevationProps) => {
|
|
27
|
+
const [open, setOpen] = useState<boolean>(false);
|
|
28
|
+
|
|
29
|
+
const handleClose = () => {
|
|
30
|
+
setOpen((prev: boolean) => !prev);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const handleClickOpen = () => {
|
|
34
|
+
setOpen(true);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const [value, setValue] = React.useState<Dayjs | null>(null);
|
|
38
|
+
|
|
39
|
+
if (isBase) {
|
|
40
|
+
return (
|
|
41
|
+
<Box
|
|
42
|
+
sx={{
|
|
43
|
+
p: 4,
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
<Title>Base Elevation</Title>
|
|
47
|
+
<Container>
|
|
48
|
+
<Box
|
|
49
|
+
sx={{
|
|
50
|
+
width: "300px",
|
|
51
|
+
height: "100px",
|
|
52
|
+
overflow: "hidden",
|
|
53
|
+
p: 3,
|
|
54
|
+
}}
|
|
55
|
+
className="elevation1"
|
|
56
|
+
>
|
|
57
|
+
Level 1
|
|
58
|
+
</Box>
|
|
59
|
+
<Box
|
|
60
|
+
sx={{
|
|
61
|
+
width: "300px",
|
|
62
|
+
height: "100px",
|
|
63
|
+
overflow: "hidden",
|
|
64
|
+
p: 3,
|
|
65
|
+
}}
|
|
66
|
+
className="elevation2"
|
|
67
|
+
>
|
|
68
|
+
Level 2
|
|
69
|
+
</Box>
|
|
70
|
+
</Container>
|
|
71
|
+
|
|
72
|
+
<Title>Paper</Title>
|
|
73
|
+
<Container>
|
|
74
|
+
<Paper
|
|
75
|
+
sx={{
|
|
76
|
+
width: "300px",
|
|
77
|
+
height: "100px",
|
|
78
|
+
overflow: "hidden",
|
|
79
|
+
p: 3,
|
|
80
|
+
}}
|
|
81
|
+
/>
|
|
82
|
+
</Container>
|
|
83
|
+
|
|
84
|
+
<Title>Dropdown</Title>
|
|
85
|
+
<Container>
|
|
86
|
+
<Select
|
|
87
|
+
label="Select option"
|
|
88
|
+
value="option1"
|
|
89
|
+
MenuProps={{
|
|
90
|
+
className: surface,
|
|
91
|
+
}}
|
|
92
|
+
>
|
|
93
|
+
<MenuItem value="option1">Option 1</MenuItem>
|
|
94
|
+
<MenuItem value="option2">Option 2</MenuItem>
|
|
95
|
+
<MenuItem value="option3">Option 3</MenuItem>
|
|
96
|
+
</Select>
|
|
97
|
+
</Container>
|
|
98
|
+
|
|
99
|
+
<Title>Date Picker</Title>
|
|
100
|
+
<Container>
|
|
101
|
+
<LocalizationProvider dateAdapter={AdapterDayjs}>
|
|
102
|
+
<DatePicker
|
|
103
|
+
label="Basic example"
|
|
104
|
+
value={value}
|
|
105
|
+
onChange={(newValue) => {
|
|
106
|
+
setValue(newValue);
|
|
107
|
+
}}
|
|
108
|
+
renderInput={(params) => <TextField {...params} />}
|
|
109
|
+
PaperProps={{
|
|
110
|
+
className: surface,
|
|
111
|
+
}}
|
|
112
|
+
/>
|
|
113
|
+
</LocalizationProvider>
|
|
114
|
+
</Container>
|
|
115
|
+
|
|
116
|
+
<Title>Alert</Title>
|
|
117
|
+
<Container>
|
|
118
|
+
<Alert sx={{ flex: 1 }}>
|
|
119
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
120
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. A diam
|
|
121
|
+
sollicitudin tempor id eu nisl nunc mi. Auctor augue mauris augue
|
|
122
|
+
neque gravida in fermentum.{" "}
|
|
123
|
+
</Alert>
|
|
124
|
+
</Container>
|
|
125
|
+
|
|
126
|
+
<Title>Modal & Popper</Title>
|
|
127
|
+
<Container>
|
|
128
|
+
<Button variant="contained" onClick={handleClickOpen}>
|
|
129
|
+
Open Dialog
|
|
130
|
+
</Button>
|
|
131
|
+
<Dialog
|
|
132
|
+
PaperProps={{
|
|
133
|
+
className: surface,
|
|
134
|
+
}}
|
|
135
|
+
onClose={handleClose}
|
|
136
|
+
open={open}
|
|
137
|
+
>
|
|
138
|
+
<DialogTitle>Title area</DialogTitle>
|
|
139
|
+
<DialogContent>
|
|
140
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
141
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. A diam
|
|
142
|
+
sollicitudin tempor id eu nisl nunc mi. Auctor augue mauris augue
|
|
143
|
+
neque gravida in fermentum.
|
|
144
|
+
</DialogContent>
|
|
145
|
+
</Dialog>
|
|
146
|
+
<Tooltip
|
|
147
|
+
title="Tooltip"
|
|
148
|
+
PopperProps={{ className: surface }}
|
|
149
|
+
placement="right"
|
|
150
|
+
>
|
|
151
|
+
<Button variant="contained">Open Tooltip</Button>
|
|
152
|
+
</Tooltip>
|
|
153
|
+
</Container>
|
|
154
|
+
</Box>
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
return (
|
|
158
|
+
<Box sx={{ height: "100vh" }}>
|
|
159
|
+
<Button onClick={handleClickOpen}>Open Dialog</Button>
|
|
160
|
+
<Dialog
|
|
161
|
+
sx={{
|
|
162
|
+
overflow: "hidden",
|
|
163
|
+
p: 3,
|
|
164
|
+
}}
|
|
165
|
+
PaperProps={{
|
|
166
|
+
className: surface,
|
|
167
|
+
}}
|
|
168
|
+
onClose={handleClose}
|
|
169
|
+
open={open}
|
|
170
|
+
>
|
|
171
|
+
<DialogTitle>Title area</DialogTitle>
|
|
172
|
+
<DialogContent>
|
|
173
|
+
{" "}
|
|
174
|
+
<Select
|
|
175
|
+
label="Select option"
|
|
176
|
+
value="option1"
|
|
177
|
+
MenuProps={{
|
|
178
|
+
className: surface,
|
|
179
|
+
}}
|
|
180
|
+
>
|
|
181
|
+
<MenuItem value="option1">Option 1</MenuItem>
|
|
182
|
+
<MenuItem value="option2">Option 2</MenuItem>
|
|
183
|
+
<MenuItem value="option3">Option 3</MenuItem>
|
|
184
|
+
</Select>
|
|
185
|
+
</DialogContent>
|
|
186
|
+
</Dialog>
|
|
187
|
+
</Box>
|
|
188
|
+
);
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export default {
|
|
192
|
+
title: "Foundation/Elevation",
|
|
193
|
+
component: Elevation,
|
|
194
|
+
argTypes: {
|
|
195
|
+
Paper: {
|
|
196
|
+
table: {
|
|
197
|
+
defaultValue: { summary: "Elevation 2" },
|
|
198
|
+
},
|
|
199
|
+
control: {
|
|
200
|
+
type: null,
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
Dropdown: {
|
|
204
|
+
table: {
|
|
205
|
+
defaultValue: { summary: "Elevation 1" },
|
|
206
|
+
},
|
|
207
|
+
control: {
|
|
208
|
+
type: null,
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
DatePicker: {
|
|
212
|
+
table: {
|
|
213
|
+
defaultValue: { summary: "Elevation 2" },
|
|
214
|
+
},
|
|
215
|
+
control: {
|
|
216
|
+
type: null,
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
Alert: {
|
|
220
|
+
table: {
|
|
221
|
+
defaultValue: { summary: "Elevation 2" },
|
|
222
|
+
},
|
|
223
|
+
control: {
|
|
224
|
+
type: null,
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
Dialog: {
|
|
228
|
+
table: {
|
|
229
|
+
defaultValue: { summary: "Elevation 2" },
|
|
230
|
+
},
|
|
231
|
+
control: {
|
|
232
|
+
type: null,
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
Tooltip: {
|
|
236
|
+
table: {
|
|
237
|
+
defaultValue: { summary: "Elevation 1" },
|
|
238
|
+
},
|
|
239
|
+
control: {
|
|
240
|
+
type: null,
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
parameters: {
|
|
245
|
+
docs: {
|
|
246
|
+
description: {
|
|
247
|
+
component: `The design system has Elevation 1 and Elevation 2. And components using elevation include Paper, Dropdown, DatePicker, Alert, Dialog, and Tooltip.\nEach component has a default value and if it is necessary to implement a component without elevation, you can add 'elevation0' to the class name.`,
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
} as Meta<typeof Elevation>;
|
|
252
|
+
|
|
253
|
+
const ElevationBase: StoryFn<typeof Elevation> = (
|
|
254
|
+
args,
|
|
255
|
+
{ globals: { theme } }
|
|
256
|
+
) => <Elevation {...args} surface={theme} isBase />;
|
|
257
|
+
|
|
258
|
+
const ElevationNesed: StoryFn<typeof Elevation> = (
|
|
259
|
+
args,
|
|
260
|
+
{ globals: { theme } }
|
|
261
|
+
) => <Elevation {...args} surface={theme} />;
|
|
262
|
+
|
|
263
|
+
export const Base = {
|
|
264
|
+
render: ElevationBase,
|
|
265
|
+
};
|
|
266
|
+
export const Nested = {
|
|
267
|
+
render: ElevationNesed,
|
|
268
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Box, styled, Typography } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const Container = styled(Box)(({ theme }) => ({
|
|
4
|
+
marginBottom: theme.spacing(10),
|
|
5
|
+
display: "flex",
|
|
6
|
+
gap: theme.spacing(8),
|
|
7
|
+
}));
|
|
8
|
+
|
|
9
|
+
export const Title = styled(Typography)(({ theme }) => ({
|
|
10
|
+
...theme.typography.h4,
|
|
11
|
+
marginBottom: theme.spacing(3),
|
|
12
|
+
}));
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Meta, Canvas, Story } from "@storybook/blocks";
|
|
2
|
+
import * as TypographyStories from "./TypographyExamples.stories";
|
|
3
|
+
|
|
4
|
+
import { Typography } from "@mui/material";
|
|
5
|
+
|
|
6
|
+
import { variants } from "./const";
|
|
7
|
+
|
|
8
|
+
import TypographyGroup from "./TypographyGroup";
|
|
9
|
+
|
|
10
|
+
<Meta of={TypographyStories} />
|
|
11
|
+
|
|
12
|
+
export const Template = (args) => <Typography {...args} />;
|
|
13
|
+
|
|
14
|
+
## Types
|
|
15
|
+
|
|
16
|
+
The typography component comes with variants below:
|
|
17
|
+
|
|
18
|
+
export const AllVariants = () => (
|
|
19
|
+
<>
|
|
20
|
+
<TypographyGroup
|
|
21
|
+
heading="Headline"
|
|
22
|
+
dummy="Headline 123456789"
|
|
23
|
+
variants={variants.headline}
|
|
24
|
+
/>
|
|
25
|
+
<TypographyGroup
|
|
26
|
+
heading="Body"
|
|
27
|
+
dummy={
|
|
28
|
+
<>
|
|
29
|
+
AI will be the new standard of care. 123456789
|
|
30
|
+
<br />
|
|
31
|
+
By Lunit. With AI, we aim to make data-driven medicine
|
|
32
|
+
<br />
|
|
33
|
+
the new standard of care.
|
|
34
|
+
</>
|
|
35
|
+
}
|
|
36
|
+
variants={variants.body}
|
|
37
|
+
/>
|
|
38
|
+
<TypographyGroup
|
|
39
|
+
heading="etc"
|
|
40
|
+
dummy="NEWS & UPDATE 71456"
|
|
41
|
+
variants={variants.etc}
|
|
42
|
+
/>
|
|
43
|
+
</>
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
<Story of={TypographyStories.AllVariants_} />
|
|
47
|
+
|
|
48
|
+
## Usage
|
|
49
|
+
|
|
50
|
+
### Typography component
|
|
51
|
+
|
|
52
|
+
<Canvas>
|
|
53
|
+
{/* <Story id="foundation-typography--typography-component" /> is deprecated, please migrate it to <Story of={referenceToStory} /> see: https://storybook.js.org/migration-guides/7.0 */}
|
|
54
|
+
|
|
55
|
+
<Story id="foundation-typography--typography-component" />
|
|
56
|
+
</Canvas>
|
|
57
|
+
|
|
58
|
+
### With styled utility
|
|
59
|
+
|
|
60
|
+
In some situations you might not be able to use the Typography component. Hopefully, you might be able to take advantage of the [typography](https://mui.com/material-ui/react-typography/#theme) keys of the theme.
|
|
61
|
+
|
|
62
|
+
<Canvas>
|
|
63
|
+
{/* <Story id="foundation-typography--styled" /> is deprecated, please migrate it to <Story of={referenceToStory} /> see: https://storybook.js.org/migration-guides/7.0 */}
|
|
64
|
+
|
|
65
|
+
<Story id="foundation-typography--styled" />
|
|
66
|
+
</Canvas>
|
|
67
|
+
|
|
68
|
+
### With the sx props
|
|
69
|
+
|
|
70
|
+
You can use all the variants with [the `sx` props](https://mui.com/system/getting-started/the-sx-prop/#typography).
|
|
71
|
+
|
|
72
|
+
<Canvas>
|
|
73
|
+
{/* <Story id="foundation-typography--sx-props" /> is deprecated, please migrate it to <Story of={referenceToStory} /> see: https://storybook.js.org/migration-guides/7.0 */}
|
|
74
|
+
|
|
75
|
+
<Story id="foundation-typography--sx-props" />
|
|
76
|
+
</Canvas>
|