@lunit/design-system 1.0.0-a.1 → 1.0.0-a.2
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/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 +7 -0
- package/dist/components/Alert/Alert.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 +170 -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/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 +143 -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 +7 -0
- package/dist/components/TextField/TextField.js.map +1 -0
- package/dist/components/TextField/index.js +1 -1
- package/dist/components/TextField/index.js.map +1 -1
- 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 +36 -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 +188 -0
- package/dist/foundation/colors/index.js.map +1 -0
- package/dist/foundation/colors/token/component.js +449 -0
- package/dist/foundation/colors/token/component.js.map +1 -0
- package/dist/foundation/colors/token/core.js +199 -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 +16 -1
- package/dist/index.js.map +1 -1
- package/dist/theme.js +34 -0
- package/dist/theme.js.map +1 -0
- package/dist/types/components/Chip/Chip.styled.d.ts +79 -0
- package/package.json +19 -10
- package/src/components/Alert/Alert.tsx +9 -0
- package/src/components/Alert/index.ts +1 -0
- package/src/components/Button/Button.styled.ts +220 -0
- package/src/components/Button/Button.tsx +54 -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/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 +162 -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.tsx +8 -0
- package/src/components/TextField/index.ts +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 +28 -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 +36 -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 +235 -0
- package/src/foundation/colors/token/component.ts +456 -0
- package/src/foundation/colors/token/core.ts +204 -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 +85 -0
- package/src/foundation/index.ts +25 -0
- package/src/foundation/spacing.ts +3 -0
- package/src/index.ts +17 -0
- package/src/stories/components/Alert/Alert.stories.tsx +13 -0
- package/src/stories/components/Button/BasicButton.stories.tsx +177 -0
- package/src/stories/components/Button/IconButton.stories.tsx +128 -0
- package/src/stories/components/Button/Kind.stories.tsx +514 -0
- package/src/stories/components/Chip/Chip.stories.tsx +196 -0
- package/src/stories/components/DataTable/DataTable.stories.tsx +13 -0
- package/src/stories/components/DatePicker/DatePicker.stories.tsx +13 -0
- package/src/stories/components/Dropdown/Dropdown.stories.tsx +15 -0
- package/src/stories/components/Modal/Modal.stories.tsx +13 -0
- package/src/stories/components/SelectControl/Checkbox.stories.tsx +248 -0
- package/src/stories/components/SelectControl/RadioGroup.stories.tsx +67 -0
- package/src/stories/components/SelectControl/RadioStatus.stories.tsx +91 -0
- package/src/stories/components/SelectControl/Toggle.stories.tsx +429 -0
- package/src/stories/components/TextField/TextField.stories.tsx +13 -0
- package/src/stories/components/ToggleButton/Basic.stories.tsx +342 -0
- package/src/stories/components/ToggleButton/Group.stories.tsx +221 -0
- package/src/stories/components/ToggleButton/ToggleButtonKind.stories.tsx +698 -0
- package/src/stories/components/ToggleButton/WithIcon.stories.tsx +293 -0
- package/src/stories/components/Tooltip/Tooltip.stories.tsx +13 -0
- package/src/stories/foundation/Elevation/Elevation.stories.tsx +264 -0
- package/src/stories/foundation/Elevation/styled.ts +12 -0
- package/src/stories/foundation/Typography/Typography.stories.mdx +71 -0
- package/src/stories/foundation/Typography/Typography.stories.tsx +91 -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 +64 -0
- package/src/stories/foundation/colors/Token.inComponent.stories.tsx +167 -0
- package/src/stories/foundation/colors/Token.stories.tsx +190 -0
- package/src/stories/foundation/colors/styled.ts +39 -0
- package/src/theme.ts +41 -0
- package/src/types.d.ts +4 -0
- package/tsconfig.build.json +2 -0
- package/dist/components/Chip/Chip.styled.d.ts +0 -41
- package/dist/components/HelloWorld/HelloWorld.d.ts +0 -28
- package/webpack.config.js +0 -51
- /package/dist/{components → types/components}/Alert/Alert.d.ts +0 -0
- /package/dist/{components → types/components}/Alert/index.d.ts +0 -0
- /package/dist/{components → types/components}/Button/Button.d.ts +0 -0
- /package/dist/{components → types/components}/Button/Button.styled.d.ts +0 -0
- /package/dist/{components → types/components}/Button/Button.types.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/Chip.types.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}/TextField/TextField.d.ts +0 -0
- /package/dist/{components → types/components}/TextField/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/ToggleButton.styled.d.ts +0 -0
- /package/dist/{components → types/components}/ToggleButton/ToggleButton.types.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/grey.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/colors/base/index.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/colors/base/lunitGreen.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/colors/base/lunitTeal.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/index.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}/colors/types.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/index.d.ts +0 -0
- /package/dist/{foundation → types/foundation}/spacing.d.ts +0 -0
- /package/dist/{index.d.ts → types/index.d.ts} +0 -0
- /package/dist/{theme.d.ts → types/theme.d.ts} +0 -0
|
@@ -0,0 +1,514 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
Box,
|
|
4
|
+
Table,
|
|
5
|
+
TableHead,
|
|
6
|
+
TableRow,
|
|
7
|
+
TableBody,
|
|
8
|
+
TableCell,
|
|
9
|
+
} from "@mui/material";
|
|
10
|
+
import { action } from "@storybook/addon-actions";
|
|
11
|
+
|
|
12
|
+
import Button from "@/components/Button";
|
|
13
|
+
|
|
14
|
+
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
title: "Components/Button",
|
|
18
|
+
component: Button,
|
|
19
|
+
argTypes: {
|
|
20
|
+
children: {
|
|
21
|
+
type: "string",
|
|
22
|
+
defaultValue: "Text",
|
|
23
|
+
},
|
|
24
|
+
disabled: {
|
|
25
|
+
control: {
|
|
26
|
+
type: "boolean",
|
|
27
|
+
},
|
|
28
|
+
defaultValue: false,
|
|
29
|
+
table: {
|
|
30
|
+
defaultValue: { summary: "false" },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
size: {
|
|
34
|
+
control: {
|
|
35
|
+
type: "radio",
|
|
36
|
+
},
|
|
37
|
+
options: ["small", "medium", "large"],
|
|
38
|
+
defaultValue: "small",
|
|
39
|
+
table: {
|
|
40
|
+
defaultValue: { summary: "small" },
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
onClick: {
|
|
44
|
+
type: "function",
|
|
45
|
+
control: {
|
|
46
|
+
type: "radio",
|
|
47
|
+
},
|
|
48
|
+
options: ["function", undefined],
|
|
49
|
+
mapping: {
|
|
50
|
+
function: action("onClick"),
|
|
51
|
+
undefined: undefined,
|
|
52
|
+
},
|
|
53
|
+
defaultValue: "function",
|
|
54
|
+
description:
|
|
55
|
+
"It is a callback function that is called when the button is clicked.",
|
|
56
|
+
},
|
|
57
|
+
kind: {
|
|
58
|
+
control: false,
|
|
59
|
+
options: ["contained", "outlined", "ghost"],
|
|
60
|
+
description: "Button has three Kinds Contained, Outlined, Ghost",
|
|
61
|
+
defaultValue: "contained",
|
|
62
|
+
table: {
|
|
63
|
+
defaultValue: { summary: "contained" },
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
parameters: {
|
|
68
|
+
controls: {
|
|
69
|
+
include: ["onClick", "children", "color", "size", "disabled", "kind"],
|
|
70
|
+
},
|
|
71
|
+
docs: {
|
|
72
|
+
description: {
|
|
73
|
+
component: `It is a kind Button docs. For more details, please
|
|
74
|
+
see [Material-UI Button](https://mui.com/material-ui/react-button/).`,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
} as ComponentMeta<typeof Button>;
|
|
79
|
+
|
|
80
|
+
const ButtonTemplate: ComponentStory<typeof Button> = ({
|
|
81
|
+
kind,
|
|
82
|
+
color,
|
|
83
|
+
children,
|
|
84
|
+
...restProps
|
|
85
|
+
}) => {
|
|
86
|
+
return (
|
|
87
|
+
<>
|
|
88
|
+
<Table sx={{ width: 600 }}>
|
|
89
|
+
<TableHead>
|
|
90
|
+
<TableRow>
|
|
91
|
+
<TableCell
|
|
92
|
+
colSpan={3}
|
|
93
|
+
sx={{
|
|
94
|
+
typography: "body1_16_semibold",
|
|
95
|
+
color: "inherit",
|
|
96
|
+
}}
|
|
97
|
+
>
|
|
98
|
+
Kind
|
|
99
|
+
</TableCell>
|
|
100
|
+
</TableRow>
|
|
101
|
+
<TableRow>
|
|
102
|
+
<TableCell
|
|
103
|
+
sx={{
|
|
104
|
+
width: "33.33333%",
|
|
105
|
+
typography: "body2_14_medium",
|
|
106
|
+
color: "inherit",
|
|
107
|
+
}}
|
|
108
|
+
>
|
|
109
|
+
Contained(default)
|
|
110
|
+
</TableCell>
|
|
111
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
112
|
+
Outlined
|
|
113
|
+
</TableCell>
|
|
114
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
115
|
+
Ghost
|
|
116
|
+
</TableCell>
|
|
117
|
+
</TableRow>
|
|
118
|
+
</TableHead>
|
|
119
|
+
<TableBody>
|
|
120
|
+
<TableRow>
|
|
121
|
+
<TableCell>
|
|
122
|
+
<Button color={color} {...restProps}>
|
|
123
|
+
{children}
|
|
124
|
+
</Button>
|
|
125
|
+
</TableCell>
|
|
126
|
+
<TableCell>
|
|
127
|
+
<Button kind="outlined" color="primary" {...restProps}>
|
|
128
|
+
{children}
|
|
129
|
+
</Button>
|
|
130
|
+
</TableCell>
|
|
131
|
+
<TableCell>
|
|
132
|
+
<Button kind="ghost" color={color} {...restProps}>
|
|
133
|
+
{children}
|
|
134
|
+
</Button>
|
|
135
|
+
</TableCell>
|
|
136
|
+
</TableRow>
|
|
137
|
+
</TableBody>
|
|
138
|
+
</Table>
|
|
139
|
+
</>
|
|
140
|
+
);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export const Kind = ButtonTemplate.bind({});
|
|
144
|
+
|
|
145
|
+
const ContainedButtonTemplate: ComponentStory<typeof Button> = (args) => {
|
|
146
|
+
return (
|
|
147
|
+
<>
|
|
148
|
+
<Table sx={{ width: 650 }}>
|
|
149
|
+
<TableHead>
|
|
150
|
+
<TableRow>
|
|
151
|
+
<TableCell></TableCell>
|
|
152
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
153
|
+
Contained Primary
|
|
154
|
+
</TableCell>
|
|
155
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
156
|
+
Contained Secondary
|
|
157
|
+
</TableCell>
|
|
158
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
159
|
+
Contained Error
|
|
160
|
+
</TableCell>
|
|
161
|
+
</TableRow>
|
|
162
|
+
</TableHead>
|
|
163
|
+
<TableBody>
|
|
164
|
+
<TableRow>
|
|
165
|
+
<TableCell
|
|
166
|
+
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
167
|
+
>
|
|
168
|
+
Enable
|
|
169
|
+
</TableCell>
|
|
170
|
+
<TableCell>
|
|
171
|
+
<Button {...args} kind="contained">
|
|
172
|
+
{args.children}
|
|
173
|
+
</Button>
|
|
174
|
+
</TableCell>
|
|
175
|
+
<TableCell>
|
|
176
|
+
<Button {...args} kind="contained" color="secondary">
|
|
177
|
+
{args.children}
|
|
178
|
+
</Button>
|
|
179
|
+
</TableCell>
|
|
180
|
+
<TableCell>
|
|
181
|
+
<Button {...args} kind="contained" color="error">
|
|
182
|
+
{args.children}
|
|
183
|
+
</Button>
|
|
184
|
+
</TableCell>
|
|
185
|
+
</TableRow>
|
|
186
|
+
<TableRow>
|
|
187
|
+
<TableCell
|
|
188
|
+
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
189
|
+
>
|
|
190
|
+
Hover
|
|
191
|
+
</TableCell>
|
|
192
|
+
<TableCell>
|
|
193
|
+
<Button {...args} id="hover" kind="contained">
|
|
194
|
+
{args.children}
|
|
195
|
+
</Button>
|
|
196
|
+
</TableCell>
|
|
197
|
+
<TableCell>
|
|
198
|
+
<Button {...args} id="hover" kind="contained" color="secondary">
|
|
199
|
+
{args.children}
|
|
200
|
+
</Button>
|
|
201
|
+
</TableCell>
|
|
202
|
+
<TableCell>
|
|
203
|
+
<Button {...args} id="hover" kind="contained" color="error">
|
|
204
|
+
{args.children}
|
|
205
|
+
</Button>
|
|
206
|
+
</TableCell>
|
|
207
|
+
</TableRow>
|
|
208
|
+
<TableRow>
|
|
209
|
+
<TableCell
|
|
210
|
+
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
211
|
+
>
|
|
212
|
+
Focus
|
|
213
|
+
</TableCell>
|
|
214
|
+
<TableCell>
|
|
215
|
+
<Button {...args} kind="contained" className="Mui-focusVisible">
|
|
216
|
+
{args.children}
|
|
217
|
+
</Button>
|
|
218
|
+
</TableCell>
|
|
219
|
+
<TableCell>
|
|
220
|
+
<Button
|
|
221
|
+
{...args}
|
|
222
|
+
kind="contained"
|
|
223
|
+
color="secondary"
|
|
224
|
+
className="Mui-focusVisible"
|
|
225
|
+
>
|
|
226
|
+
{args.children}
|
|
227
|
+
</Button>
|
|
228
|
+
</TableCell>
|
|
229
|
+
<TableCell>
|
|
230
|
+
<Button
|
|
231
|
+
{...args}
|
|
232
|
+
kind="contained"
|
|
233
|
+
color="error"
|
|
234
|
+
className="Mui-focusVisible"
|
|
235
|
+
>
|
|
236
|
+
{args.children}
|
|
237
|
+
</Button>
|
|
238
|
+
</TableCell>
|
|
239
|
+
</TableRow>
|
|
240
|
+
<TableRow>
|
|
241
|
+
<TableCell
|
|
242
|
+
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
243
|
+
>
|
|
244
|
+
Disabled
|
|
245
|
+
</TableCell>
|
|
246
|
+
<TableCell>
|
|
247
|
+
<Button {...args} kind="contained" disabled>
|
|
248
|
+
{args.children}
|
|
249
|
+
</Button>
|
|
250
|
+
</TableCell>
|
|
251
|
+
<TableCell>
|
|
252
|
+
<Button {...args} kind="contained" color="secondary" disabled>
|
|
253
|
+
{args.children}
|
|
254
|
+
</Button>
|
|
255
|
+
</TableCell>
|
|
256
|
+
<TableCell>
|
|
257
|
+
<Button {...args} kind="contained" color="error" disabled>
|
|
258
|
+
{args.children}
|
|
259
|
+
</Button>
|
|
260
|
+
</TableCell>
|
|
261
|
+
</TableRow>
|
|
262
|
+
</TableBody>
|
|
263
|
+
</Table>
|
|
264
|
+
</>
|
|
265
|
+
);
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
export const KindContained = ContainedButtonTemplate.bind({});
|
|
269
|
+
KindContained.argTypes = {
|
|
270
|
+
color: {
|
|
271
|
+
control: "false",
|
|
272
|
+
options: ["primary", "secondary", "error"],
|
|
273
|
+
defaultValue: "primary",
|
|
274
|
+
description: `The color of the component.
|
|
275
|
+
\n It supports both default and custom theme colors,
|
|
276
|
+
\n which can be added as shown in the palette customization guide.`,
|
|
277
|
+
table: {
|
|
278
|
+
defaultValue: { summary: "primary" },
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
};
|
|
282
|
+
KindContained.storyName = "Kind: Contained";
|
|
283
|
+
|
|
284
|
+
const GhostButtonTemplate: ComponentStory<typeof Button> = (args) => {
|
|
285
|
+
return (
|
|
286
|
+
<>
|
|
287
|
+
<Table sx={{ width: 650 }}>
|
|
288
|
+
<TableHead>
|
|
289
|
+
<TableRow>
|
|
290
|
+
<TableCell></TableCell>
|
|
291
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
292
|
+
Ghost Primary
|
|
293
|
+
</TableCell>
|
|
294
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
295
|
+
Ghost Secondary
|
|
296
|
+
</TableCell>
|
|
297
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
298
|
+
Ghost Error
|
|
299
|
+
</TableCell>
|
|
300
|
+
</TableRow>
|
|
301
|
+
</TableHead>
|
|
302
|
+
<TableBody>
|
|
303
|
+
<TableRow>
|
|
304
|
+
<TableCell
|
|
305
|
+
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
306
|
+
>
|
|
307
|
+
Enable
|
|
308
|
+
</TableCell>
|
|
309
|
+
<TableCell>
|
|
310
|
+
<Button {...args} kind="ghost">
|
|
311
|
+
{args.children}
|
|
312
|
+
</Button>
|
|
313
|
+
</TableCell>
|
|
314
|
+
<TableCell>
|
|
315
|
+
<Button {...args} kind="ghost" color="secondary">
|
|
316
|
+
{args.children}
|
|
317
|
+
</Button>
|
|
318
|
+
</TableCell>
|
|
319
|
+
<TableCell>
|
|
320
|
+
<Button {...args} kind="ghost" color="error">
|
|
321
|
+
{args.children}
|
|
322
|
+
</Button>
|
|
323
|
+
</TableCell>
|
|
324
|
+
</TableRow>
|
|
325
|
+
<TableRow>
|
|
326
|
+
<TableCell
|
|
327
|
+
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
328
|
+
>
|
|
329
|
+
Hover
|
|
330
|
+
</TableCell>
|
|
331
|
+
<TableCell>
|
|
332
|
+
<Button {...args} id="hover" kind="ghost">
|
|
333
|
+
{args.children}
|
|
334
|
+
</Button>
|
|
335
|
+
</TableCell>
|
|
336
|
+
<TableCell>
|
|
337
|
+
<Button {...args} id="hover" kind="ghost" color="secondary">
|
|
338
|
+
{args.children}
|
|
339
|
+
</Button>
|
|
340
|
+
</TableCell>
|
|
341
|
+
<TableCell>
|
|
342
|
+
<Button {...args} id="hover" kind="ghost" color="error">
|
|
343
|
+
{args.children}
|
|
344
|
+
</Button>
|
|
345
|
+
</TableCell>
|
|
346
|
+
</TableRow>
|
|
347
|
+
<TableRow>
|
|
348
|
+
<TableCell
|
|
349
|
+
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
350
|
+
>
|
|
351
|
+
Focus
|
|
352
|
+
</TableCell>
|
|
353
|
+
<TableCell>
|
|
354
|
+
<Button {...args} kind="ghost" className="Mui-focusVisible">
|
|
355
|
+
{args.children}
|
|
356
|
+
</Button>
|
|
357
|
+
</TableCell>
|
|
358
|
+
<TableCell>
|
|
359
|
+
<Button
|
|
360
|
+
{...args}
|
|
361
|
+
kind="ghost"
|
|
362
|
+
color="secondary"
|
|
363
|
+
className="Mui-focusVisible"
|
|
364
|
+
>
|
|
365
|
+
{args.children}
|
|
366
|
+
</Button>
|
|
367
|
+
</TableCell>
|
|
368
|
+
<TableCell>
|
|
369
|
+
<Button
|
|
370
|
+
{...args}
|
|
371
|
+
kind="ghost"
|
|
372
|
+
color="error"
|
|
373
|
+
className="Mui-focusVisible"
|
|
374
|
+
>
|
|
375
|
+
{args.children}
|
|
376
|
+
</Button>
|
|
377
|
+
</TableCell>
|
|
378
|
+
</TableRow>
|
|
379
|
+
<TableRow>
|
|
380
|
+
<TableCell
|
|
381
|
+
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
382
|
+
>
|
|
383
|
+
Disabled
|
|
384
|
+
</TableCell>
|
|
385
|
+
<TableCell>
|
|
386
|
+
<Button {...args} kind="ghost" disabled>
|
|
387
|
+
{args.children}
|
|
388
|
+
</Button>
|
|
389
|
+
</TableCell>
|
|
390
|
+
<TableCell>
|
|
391
|
+
<Button {...args} kind="ghost" color="secondary" disabled>
|
|
392
|
+
{args.children}
|
|
393
|
+
</Button>
|
|
394
|
+
</TableCell>
|
|
395
|
+
<TableCell>
|
|
396
|
+
<Button {...args} kind="ghost" color="error" disabled>
|
|
397
|
+
{args.children}
|
|
398
|
+
</Button>
|
|
399
|
+
</TableCell>
|
|
400
|
+
</TableRow>
|
|
401
|
+
</TableBody>
|
|
402
|
+
</Table>
|
|
403
|
+
<br />
|
|
404
|
+
<br />
|
|
405
|
+
</>
|
|
406
|
+
);
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
export const KindGhost = GhostButtonTemplate.bind({});
|
|
410
|
+
KindGhost.argTypes = {
|
|
411
|
+
color: {
|
|
412
|
+
control: "false",
|
|
413
|
+
options: ["primary", "secondary", "error"],
|
|
414
|
+
description: `The color of the component.
|
|
415
|
+
\n It supports both default and custom theme colors,
|
|
416
|
+
\n which can be added as shown in the palette customization guide.`,
|
|
417
|
+
defaultValue: "primary",
|
|
418
|
+
table: {
|
|
419
|
+
defaultValue: { summary: "primary" },
|
|
420
|
+
},
|
|
421
|
+
},
|
|
422
|
+
};
|
|
423
|
+
KindGhost.storyName = "Kind: Ghost";
|
|
424
|
+
|
|
425
|
+
const OutlinedButtonTemplate: ComponentStory<typeof Button> = ({
|
|
426
|
+
color,
|
|
427
|
+
...restProps
|
|
428
|
+
}) => {
|
|
429
|
+
return (
|
|
430
|
+
<>
|
|
431
|
+
<Table sx={{ width: 250 }}>
|
|
432
|
+
<TableHead>
|
|
433
|
+
<TableRow>
|
|
434
|
+
<TableCell></TableCell>
|
|
435
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
436
|
+
Outlined Primary
|
|
437
|
+
</TableCell>
|
|
438
|
+
</TableRow>
|
|
439
|
+
</TableHead>
|
|
440
|
+
<TableBody>
|
|
441
|
+
<TableRow>
|
|
442
|
+
<TableCell
|
|
443
|
+
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
444
|
+
>
|
|
445
|
+
Enable
|
|
446
|
+
</TableCell>
|
|
447
|
+
<TableCell>
|
|
448
|
+
<Button {...restProps} kind="outlined">
|
|
449
|
+
Text
|
|
450
|
+
</Button>
|
|
451
|
+
</TableCell>
|
|
452
|
+
</TableRow>
|
|
453
|
+
<TableRow>
|
|
454
|
+
<TableCell
|
|
455
|
+
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
456
|
+
>
|
|
457
|
+
Hover
|
|
458
|
+
</TableCell>
|
|
459
|
+
<TableCell>
|
|
460
|
+
<Button {...restProps} id="hover" kind="outlined">
|
|
461
|
+
Text
|
|
462
|
+
</Button>
|
|
463
|
+
</TableCell>
|
|
464
|
+
</TableRow>
|
|
465
|
+
<TableRow>
|
|
466
|
+
<TableCell
|
|
467
|
+
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
468
|
+
>
|
|
469
|
+
Focus
|
|
470
|
+
</TableCell>
|
|
471
|
+
<TableCell>
|
|
472
|
+
<Button
|
|
473
|
+
{...restProps}
|
|
474
|
+
kind="outlined"
|
|
475
|
+
className="Mui-focusVisible"
|
|
476
|
+
>
|
|
477
|
+
Text
|
|
478
|
+
</Button>
|
|
479
|
+
</TableCell>
|
|
480
|
+
</TableRow>
|
|
481
|
+
<TableRow>
|
|
482
|
+
<TableCell
|
|
483
|
+
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
484
|
+
>
|
|
485
|
+
Disabled
|
|
486
|
+
</TableCell>
|
|
487
|
+
<TableCell>
|
|
488
|
+
<Button {...restProps} kind="outlined" disabled>
|
|
489
|
+
Text
|
|
490
|
+
</Button>
|
|
491
|
+
</TableCell>
|
|
492
|
+
</TableRow>
|
|
493
|
+
</TableBody>
|
|
494
|
+
</Table>
|
|
495
|
+
</>
|
|
496
|
+
);
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
export const KindOutlined = OutlinedButtonTemplate.bind({});
|
|
500
|
+
KindOutlined.argTypes = {
|
|
501
|
+
color: {
|
|
502
|
+
control: "false",
|
|
503
|
+
options: ["primary"],
|
|
504
|
+
defaultValue: "primary",
|
|
505
|
+
description: `The color of the component.
|
|
506
|
+
\n It supports both default and custom theme colors,
|
|
507
|
+
\n which can be added as shown in the palette customization guide.`,
|
|
508
|
+
table: {
|
|
509
|
+
type: { summary: "primary" },
|
|
510
|
+
defaultValue: { summary: "primary" },
|
|
511
|
+
},
|
|
512
|
+
},
|
|
513
|
+
};
|
|
514
|
+
KindOutlined.storyName = "Kind: Outlined";
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import { action } from "@storybook/addon-actions";
|
|
4
|
+
import Chip from "@/components/Chip";
|
|
5
|
+
import {
|
|
6
|
+
Logo16,
|
|
7
|
+
Avatar16,
|
|
8
|
+
Success16,
|
|
9
|
+
Error16,
|
|
10
|
+
Information16,
|
|
11
|
+
Warning16,
|
|
12
|
+
} from "@lunit/design-system-icons";
|
|
13
|
+
|
|
14
|
+
import type {
|
|
15
|
+
OutlinedChipProps,
|
|
16
|
+
ReadOnlyContainedChipProps,
|
|
17
|
+
EnableContainedChipProps,
|
|
18
|
+
DeletableContainedChipProps,
|
|
19
|
+
ChipProps,
|
|
20
|
+
ChipThumbnail,
|
|
21
|
+
} from "@/components/Chip/Chip.types";
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
title: "Components/Chips",
|
|
25
|
+
component: Chip,
|
|
26
|
+
argTypes: {
|
|
27
|
+
kind: {
|
|
28
|
+
description: `Default status of Contained or Outlined Chip is readOnly. You can pass onClick, onDelete or thumbnail to Contained Chip only.`,
|
|
29
|
+
},
|
|
30
|
+
onClick: {
|
|
31
|
+
description: `Contained chip can have onClick event. When Chip is clickable, onDelete is disabled.`,
|
|
32
|
+
control: {
|
|
33
|
+
type: "select",
|
|
34
|
+
defaultValue: undefined,
|
|
35
|
+
},
|
|
36
|
+
options: ["function", undefined],
|
|
37
|
+
mapping: {
|
|
38
|
+
function: action("onClick"),
|
|
39
|
+
undefined: undefined,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
onDelete: {
|
|
43
|
+
description:
|
|
44
|
+
"Contained chip can have onDelete event. When Chip is deletable, onClick is disabled.",
|
|
45
|
+
control: {
|
|
46
|
+
type: "select",
|
|
47
|
+
},
|
|
48
|
+
options: ["function", undefined],
|
|
49
|
+
mapping: {
|
|
50
|
+
function: action("onDelete"),
|
|
51
|
+
undefined: undefined,
|
|
52
|
+
},
|
|
53
|
+
defaultValue: null,
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
thumbnail: {
|
|
57
|
+
control: {
|
|
58
|
+
type: "select",
|
|
59
|
+
defaultValue: "undefined",
|
|
60
|
+
},
|
|
61
|
+
options: [
|
|
62
|
+
undefined,
|
|
63
|
+
"Initial",
|
|
64
|
+
"Logo16",
|
|
65
|
+
"Avatar16",
|
|
66
|
+
"Avatar16Filled",
|
|
67
|
+
"Success16",
|
|
68
|
+
"Success16Filled",
|
|
69
|
+
"Error16",
|
|
70
|
+
"Error16Filled",
|
|
71
|
+
"Information16",
|
|
72
|
+
"Information16Filled",
|
|
73
|
+
"Warning16",
|
|
74
|
+
"Warning16Filled",
|
|
75
|
+
],
|
|
76
|
+
mapping: {
|
|
77
|
+
undefined: undefined,
|
|
78
|
+
Initial: "W as initial",
|
|
79
|
+
Logo16: <Logo16 />,
|
|
80
|
+
Avatar16: <Avatar16 />,
|
|
81
|
+
Avatar16Filled: <Avatar16 variant="filled" />,
|
|
82
|
+
Success16: <Success16 />,
|
|
83
|
+
Success16Filled: <Success16 variant="filled" />,
|
|
84
|
+
Error16: <Error16 />,
|
|
85
|
+
Error16Filled: <Error16 variant="filled" />,
|
|
86
|
+
Information16: <Information16 />,
|
|
87
|
+
Information16Filled: <Information16 variant="filled" />,
|
|
88
|
+
Warning16: <Warning16 />,
|
|
89
|
+
Warning16Filled: <Warning16 variant="filled" />,
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
args: {
|
|
94
|
+
kind: "contained",
|
|
95
|
+
label: "label@lunit.io",
|
|
96
|
+
},
|
|
97
|
+
parameters: {
|
|
98
|
+
docs: {
|
|
99
|
+
description: {
|
|
100
|
+
component: `Chips are compact elements that represent an input, attribute, or action.`,
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
controls: {
|
|
104
|
+
expanded: true,
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
} as ComponentMeta<typeof Chip>;
|
|
108
|
+
|
|
109
|
+
const Template: ComponentStory<typeof Chip> = (args) => <Chip {...args} />;
|
|
110
|
+
|
|
111
|
+
export const Outlined = Template.bind({});
|
|
112
|
+
|
|
113
|
+
Outlined.parameters = {
|
|
114
|
+
docs: {
|
|
115
|
+
description: {
|
|
116
|
+
story: `Outlined chip only contains label and shows the state of disabled.`,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
controls: {
|
|
120
|
+
exclude: [
|
|
121
|
+
"thumbnail",
|
|
122
|
+
"onClick",
|
|
123
|
+
"onDelete",
|
|
124
|
+
"disabled",
|
|
125
|
+
"clickable",
|
|
126
|
+
"skipFocusWhenDisabled",
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
Outlined.args = {
|
|
131
|
+
color: "primary",
|
|
132
|
+
kind: "outlined",
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export const Contained = Template.bind({});
|
|
136
|
+
Contained.parameters = {
|
|
137
|
+
controls: {
|
|
138
|
+
exclude: [
|
|
139
|
+
"thumbnail",
|
|
140
|
+
"onClick",
|
|
141
|
+
"onDelete",
|
|
142
|
+
"disabled",
|
|
143
|
+
"clickable",
|
|
144
|
+
"skipFocusWhenDisabled",
|
|
145
|
+
],
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
Contained.args = {
|
|
149
|
+
color: "primary",
|
|
150
|
+
kind: "contained",
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export const ContainedWithClick = Template.bind({});
|
|
154
|
+
ContainedWithClick.args = {
|
|
155
|
+
onClick: action("onClick"),
|
|
156
|
+
onDelete: undefined,
|
|
157
|
+
};
|
|
158
|
+
ContainedWithClick.parameters = {
|
|
159
|
+
docs: {
|
|
160
|
+
description: {
|
|
161
|
+
story: `Contained chip can have onClick event. When Chip is clickable, onDelete is disabled.`,
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
controls: {
|
|
165
|
+
exclude: ["onDelete", "deletable"],
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export const ContainedWithDelete = Template.bind({});
|
|
170
|
+
ContainedWithDelete.args = {
|
|
171
|
+
...Contained.args,
|
|
172
|
+
onClick: undefined,
|
|
173
|
+
onDelete: action("onDelete"),
|
|
174
|
+
};
|
|
175
|
+
ContainedWithDelete.parameters = {
|
|
176
|
+
docs: {
|
|
177
|
+
description: {
|
|
178
|
+
story: `Contained chip can have delete button. When Chip is deletable, onClick is disabled.`,
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
controls: {
|
|
182
|
+
exclude: ["onClick", "clickable"],
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
export const ContainedWithThumbnail = Template.bind({});
|
|
187
|
+
ContainedWithThumbnail.args = {
|
|
188
|
+
thumbnail: "Initial",
|
|
189
|
+
};
|
|
190
|
+
ContainedWithThumbnail.parameters = {
|
|
191
|
+
docs: {
|
|
192
|
+
description: {
|
|
193
|
+
story: `Contained chip can have thumbnail as "avatar", "logo", and lunit icons.`,
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
};
|