@lunit/design-system 2.1.0 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc.json +1 -1
- package/README.md +22 -21
- package/dist/cjs/components/Alert/index.js +1 -1
- package/dist/cjs/components/Alert/index.js.map +1 -1
- package/dist/cjs/components/Button/index.js +1 -1
- package/dist/cjs/components/Button/index.js.map +1 -1
- package/dist/cjs/components/Checkbox/index.js +1 -1
- package/dist/cjs/components/Checkbox/index.js.map +1 -1
- package/dist/cjs/components/Chip/index.js +1 -1
- package/dist/cjs/components/Chip/index.js.map +1 -1
- package/dist/cjs/components/DataTable/index.js.map +1 -1
- package/dist/cjs/components/DatePicker/index.js.map +1 -1
- package/dist/cjs/components/Dialog/index.js +1 -1
- package/dist/cjs/components/Dialog/index.js.map +1 -1
- package/dist/cjs/components/Dropdown/index.js +1 -1
- package/dist/cjs/components/Dropdown/index.js.map +1 -1
- package/dist/cjs/components/FormLabel/index.js +1 -1
- package/dist/cjs/components/FormLabel/index.js.map +1 -1
- package/dist/cjs/components/Radio/index.js +1 -1
- package/dist/cjs/components/Radio/index.js.map +1 -1
- package/dist/cjs/components/RadioGroup/index.js.map +1 -1
- package/dist/cjs/components/TextField/index.js +1 -1
- package/dist/cjs/components/TextField/index.js.map +1 -1
- package/dist/cjs/components/Toggle/index.js +1 -1
- package/dist/cjs/components/Toggle/index.js.map +1 -1
- package/dist/cjs/components/ToggleButton/index.js +1 -1
- package/dist/cjs/components/ToggleButton/index.js.map +1 -1
- package/dist/cjs/components/Tooltip/index.js.map +1 -1
- package/dist/cjs/components/Typography/index.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/components/Alert/Alert.js +8 -8
- package/dist/components/Alert/Alert.js.map +1 -1
- package/dist/components/Alert/Alert.styled.js +26 -26
- package/dist/components/Alert/Alert.styled.js.map +1 -1
- package/dist/components/Alert/Alert.utils.js +9 -9
- package/dist/components/Alert/Alert.utils.js.map +1 -1
- package/dist/components/Alert/index.js +1 -1
- package/dist/components/Button/Button.js +23 -17
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.styled.js +88 -88
- package/dist/components/Button/Button.styled.js.map +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Button/utils/getButtonPaddingBySizeAndKind.js +9 -9
- package/dist/components/Button/utils/getButtonPaddingBySizeAndKind.js.map +1 -1
- package/dist/components/Button/utils/getHoverStyle.js +1 -1
- package/dist/components/Button/utils/getHoverStyle.js.map +1 -1
- package/dist/components/Button/utils/getIconButtonPaddingBySizeAndKind.js +6 -12
- package/dist/components/Button/utils/getIconButtonPaddingBySizeAndKind.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +9 -9
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/Chip/Chip.js +29 -26
- package/dist/components/Chip/Chip.js.map +1 -1
- package/dist/components/Chip/Chip.styled.js +52 -52
- package/dist/components/Chip/Chip.styled.js.map +1 -1
- package/dist/components/Chip/consts.js +5 -5
- package/dist/components/Chip/index.js +1 -1
- package/dist/components/DataTable/DataTable.js +1 -1
- package/dist/components/DataTable/index.js +1 -1
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/Dialog/Dialog.js +18 -18
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Dialog/Dialog.styled.js +90 -90
- package/dist/components/Dialog/Dialog.styled.js.map +1 -1
- package/dist/components/Dialog/components/DialogAction.js +6 -6
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/Dropdown/Dropdown.js +23 -21
- package/dist/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/components/Dropdown/Dropdown.styled.js +85 -86
- package/dist/components/Dropdown/Dropdown.styled.js.map +1 -1
- package/dist/components/Dropdown/DropdownItem.js +14 -14
- package/dist/components/Dropdown/DropdownItem.js.map +1 -1
- package/dist/components/Dropdown/index.js +2 -2
- package/dist/components/Dropdown/index.js.map +1 -1
- package/dist/components/FormLabel/FormLabel.js +1 -1
- package/dist/components/FormLabel/FormLabel.styled.js +2 -2
- package/dist/components/FormLabel/FormLabel.styled.js.map +1 -1
- package/dist/components/FormLabel/index.js +1 -1
- package/dist/components/Radio/Radio.js +8 -8
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/Radio/index.js +1 -1
- package/dist/components/RadioGroup/index.js +1 -1
- package/dist/components/TextField/TextField.js +8 -8
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/TextField/TextField.style.js +112 -112
- package/dist/components/TextField/TextField.style.js.map +1 -1
- package/dist/components/TextField/TextFieldIcon.js +2 -2
- package/dist/components/TextField/TextFieldIcon.js.map +1 -1
- package/dist/components/TextField/index.js +1 -1
- package/dist/components/Toast/Toast.js +13 -13
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/Toast/Toast.styled.js +26 -26
- package/dist/components/Toast/Toast.utils.js +3 -3
- package/dist/components/Toast/Toast.utils.js.map +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/Toggle/Toggle.js +3 -4
- package/dist/components/Toggle/Toggle.js.map +1 -1
- package/dist/components/Toggle/Toggle.styled.js +30 -30
- package/dist/components/Toggle/Toggle.styled.js.map +1 -1
- package/dist/components/Toggle/index.js +1 -1
- package/dist/components/ToggleButton/ToggleButton.js +6 -6
- package/dist/components/ToggleButton/ToggleButton.js.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.styled.js +20 -20
- package/dist/components/ToggleButton/ToggleButton.styled.js.map +1 -1
- package/dist/components/ToggleButton/index.js +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.js +2 -2
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.js.map +1 -1
- package/dist/components/ToggleButtonGroup/index.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/Typography/Typography.js +1 -1
- package/dist/components/Typography/Typography.js.map +1 -1
- package/dist/components/Typography/index.js +1 -1
- package/dist/foundation/Elevation/index.js +27 -27
- package/dist/foundation/Elevation/utils.js +1 -1
- package/dist/foundation/Elevation/utils.js.map +1 -1
- package/dist/foundation/Typography/index.js +35 -35
- package/dist/foundation/Typography/index.js.map +1 -1
- package/dist/foundation/Typography/tokens.js +136 -136
- package/dist/foundation/Typography/tokens.js.map +1 -1
- package/dist/foundation/colors/base/blue.js +12 -12
- package/dist/foundation/colors/base/green.js +12 -12
- package/dist/foundation/colors/base/grey.js +28 -28
- package/dist/foundation/colors/base/index.js +11 -11
- package/dist/foundation/colors/base/lunitGreen.js +11 -11
- package/dist/foundation/colors/base/lunitTeal.js +12 -12
- package/dist/foundation/colors/base/magenta.js +12 -12
- package/dist/foundation/colors/base/opacity.js +4 -4
- package/dist/foundation/colors/base/orange.js +12 -12
- package/dist/foundation/colors/base/purple.js +12 -12
- package/dist/foundation/colors/base/red.js +12 -12
- package/dist/foundation/colors/base/yellow.js +12 -12
- package/dist/foundation/colors/index.js +119 -121
- package/dist/foundation/colors/index.js.map +1 -1
- package/dist/foundation/colors/token/component.js +184 -212
- package/dist/foundation/colors/token/component.js.map +1 -1
- package/dist/foundation/colors/token/core.js +112 -133
- package/dist/foundation/colors/token/core.js.map +1 -1
- package/dist/foundation/colors/token/index.js +2 -2
- package/dist/foundation/index.js +5 -5
- package/dist/index.js +20 -20
- package/dist/theme.js +6 -6
- package/dist/types/components/Alert/Alert.d.ts +2 -2
- package/dist/types/components/Alert/Alert.styled.d.ts +1 -2
- package/dist/types/components/Alert/Alert.types.d.ts +2 -2
- package/dist/types/components/Alert/Alert.utils.d.ts +1 -1
- package/dist/types/components/Alert/index.d.ts +1 -1
- package/dist/types/components/Button/Button.d.ts +1 -1
- package/dist/types/components/Button/Button.styled.d.ts +249 -265
- package/dist/types/components/Button/Button.types.d.ts +16 -16
- package/dist/types/components/Button/index.d.ts +1 -1
- package/dist/types/components/Button/utils/getButtonPaddingBySizeAndKind.d.ts +4 -4
- package/dist/types/components/Button/utils/getHoverStyle.d.ts +2 -1
- package/dist/types/components/Button/utils/getIconButtonPaddingBySizeAndKind.d.ts +4 -4
- package/dist/types/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/types/components/Checkbox/index.d.ts +1 -1
- package/dist/types/components/Chip/Chip.d.ts +1 -1
- package/dist/types/components/Chip/Chip.styled.d.ts +6 -79
- package/dist/types/components/Chip/Chip.types.d.ts +15 -14
- package/dist/types/components/Chip/index.d.ts +1 -1
- package/dist/types/components/DataTable/index.d.ts +1 -1
- package/dist/types/components/DatePicker/index.d.ts +1 -1
- package/dist/types/components/Dialog/Dialog.d.ts +11 -11
- package/dist/types/components/Dialog/Dialog.styled.d.ts +3 -4
- package/dist/types/components/Dialog/components/DialogAction.d.ts +2 -2
- package/dist/types/components/Dialog/index.d.ts +2 -2
- package/dist/types/components/Dropdown/Dropdown.d.ts +2 -2
- package/dist/types/components/Dropdown/Dropdown.styled.d.ts +4 -39
- package/dist/types/components/Dropdown/Dropdown.types.d.ts +5 -5
- package/dist/types/components/Dropdown/DropdownItem.d.ts +3 -3
- package/dist/types/components/Dropdown/index.d.ts +3 -3
- package/dist/types/components/FormLabel/FormLabel.d.ts +1 -1
- package/dist/types/components/FormLabel/index.d.ts +1 -1
- package/dist/types/components/Radio/Radio.d.ts +1 -1
- package/dist/types/components/Radio/index.d.ts +1 -1
- package/dist/types/components/RadioGroup/index.d.ts +1 -1
- package/dist/types/components/TextField/TextField.d.ts +2 -2
- package/dist/types/components/TextField/TextField.style.d.ts +3 -4
- package/dist/types/components/TextField/TextField.types.d.ts +6 -6
- package/dist/types/components/TextField/TextFieldIcon.d.ts +2 -2
- package/dist/types/components/TextField/index.d.ts +2 -2
- package/dist/types/components/Toast/Toast.d.ts +2 -2
- package/dist/types/components/Toast/Toast.types.d.ts +3 -3
- package/dist/types/components/Toast/Toast.utils.d.ts +1 -1
- package/dist/types/components/Toast/index.d.ts +2 -2
- package/dist/types/components/Toggle/Toggle.d.ts +1 -1
- package/dist/types/components/Toggle/Toggle.styled.d.ts +2 -2
- package/dist/types/components/Toggle/Toggle.types.d.ts +3 -3
- package/dist/types/components/Toggle/index.d.ts +1 -1
- package/dist/types/components/ToggleButton/ToggleButton.d.ts +1 -1
- package/dist/types/components/ToggleButton/ToggleButton.styled.d.ts +2 -34
- package/dist/types/components/ToggleButton/ToggleButton.types.d.ts +10 -10
- package/dist/types/components/ToggleButton/index.d.ts +1 -1
- package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +1 -1
- package/dist/types/components/ToggleButtonGroup/index.d.ts +1 -1
- package/dist/types/components/Tooltip/index.d.ts +1 -1
- package/dist/types/components/Typography/Typography.d.ts +6 -6
- package/dist/types/components/Typography/index.d.ts +1 -1
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/foundation/Elevation/index.d.ts +22 -22
- package/dist/types/foundation/Typography/index.d.ts +78 -78
- package/dist/types/foundation/Typography/tokens.d.ts +69 -69
- package/dist/types/foundation/colors/base/index.d.ts +11 -11
- package/dist/types/foundation/colors/index.d.ts +13 -20
- package/dist/types/foundation/colors/token/component.d.ts +1 -1
- package/dist/types/foundation/colors/token/core.d.ts +1 -1
- package/dist/types/foundation/colors/token/index.d.ts +2 -2
- package/dist/types/foundation/colors/types.d.ts +0 -7
- package/dist/types/foundation/index.d.ts +4 -11
- package/dist/types/foundation/spacing.d.ts +1 -1
- package/dist/types/index.d.ts +20 -20
- package/dist/types/theme.d.ts +1 -1
- package/package.json +22 -26
- package/src/components/Alert/Alert.styled.ts +39 -49
- package/src/components/Alert/Alert.tsx +10 -16
- package/src/components/Alert/Alert.types.ts +2 -2
- package/src/components/Alert/Alert.utils.ts +13 -22
- package/src/components/Alert/index.ts +1 -1
- package/src/components/Button/Button.styled.ts +98 -101
- package/src/components/Button/Button.tsx +71 -69
- package/src/components/Button/Button.types.ts +19 -21
- package/src/components/Button/index.ts +1 -1
- package/src/components/Button/utils/getButtonPaddingBySizeAndKind.ts +13 -13
- package/src/components/Button/utils/getHoverStyle.ts +4 -2
- package/src/components/Button/utils/getIconButtonPaddingBySizeAndKind.ts +10 -19
- package/src/components/Checkbox/Checkbox.tsx +13 -25
- package/src/components/Checkbox/index.ts +1 -1
- package/src/components/Chip/Chip.styled.ts +69 -72
- package/src/components/Chip/Chip.tsx +33 -55
- package/src/components/Chip/Chip.types.ts +18 -24
- package/src/components/Chip/consts.ts +5 -5
- package/src/components/Chip/index.ts +1 -1
- package/src/components/DataTable/DataTable.tsx +2 -2
- package/src/components/DataTable/index.ts +1 -1
- package/src/components/DatePicker/DatePicker.tsx +2 -2
- package/src/components/DatePicker/index.ts +1 -1
- package/src/components/Dialog/Dialog.styled.ts +112 -114
- package/src/components/Dialog/Dialog.tsx +41 -46
- package/src/components/Dialog/components/DialogAction.tsx +8 -8
- package/src/components/Dialog/index.ts +3 -3
- package/src/components/Dropdown/Dropdown.styled.tsx +88 -89
- package/src/components/Dropdown/Dropdown.tsx +29 -30
- package/src/components/Dropdown/Dropdown.types.ts +6 -5
- package/src/components/Dropdown/DropdownItem.tsx +18 -29
- package/src/components/Dropdown/index.ts +3 -7
- package/src/components/FormLabel/FormLabel.styled.ts +3 -3
- package/src/components/FormLabel/FormLabel.tsx +3 -3
- package/src/components/FormLabel/index.ts +1 -1
- package/src/components/Radio/Radio.tsx +12 -29
- package/src/components/Radio/index.ts +1 -1
- package/src/components/RadioGroup/index.ts +1 -1
- package/src/components/TextField/TextField.style.ts +123 -132
- package/src/components/TextField/TextField.tsx +50 -62
- package/src/components/TextField/TextField.types.ts +7 -8
- package/src/components/TextField/TextFieldIcon.tsx +4 -7
- package/src/components/TextField/index.ts +2 -2
- package/src/components/Toast/Toast.styled.ts +26 -26
- package/src/components/Toast/Toast.tsx +14 -28
- package/src/components/Toast/Toast.types.ts +3 -8
- package/src/components/Toast/Toast.utils.ts +5 -8
- package/src/components/Toast/index.tsx +2 -2
- package/src/components/Toggle/Toggle.styled.ts +31 -32
- package/src/components/Toggle/Toggle.tsx +5 -11
- package/src/components/Toggle/Toggle.types.ts +3 -3
- package/src/components/Toggle/index.ts +1 -1
- package/src/components/ToggleButton/ToggleButton.styled.ts +47 -49
- package/src/components/ToggleButton/ToggleButton.tsx +91 -97
- package/src/components/ToggleButton/ToggleButton.types.ts +10 -10
- package/src/components/ToggleButton/index.ts +1 -1
- package/src/components/ToggleButtonGroup/ToggleButtonGroup.tsx +3 -8
- package/src/components/ToggleButtonGroup/index.tsx +1 -1
- package/src/components/Tooltip/Tooltip.tsx +2 -2
- package/src/components/Tooltip/index.ts +1 -1
- package/src/components/Typography/Typography.tsx +7 -10
- package/src/components/Typography/index.ts +1 -1
- package/src/components/index.ts +2 -2
- package/src/foundation/Elevation/index.ts +27 -27
- package/src/foundation/Elevation/utils.ts +14 -8
- package/src/foundation/Typography/index.ts +58 -57
- package/src/foundation/Typography/tokens.ts +138 -138
- package/src/foundation/colors/base/blue.ts +12 -12
- package/src/foundation/colors/base/green.ts +12 -12
- package/src/foundation/colors/base/grey.ts +28 -28
- package/src/foundation/colors/base/index.ts +11 -11
- package/src/foundation/colors/base/lunitGreen.ts +11 -11
- package/src/foundation/colors/base/lunitTeal.ts +12 -12
- package/src/foundation/colors/base/magenta.ts +12 -12
- package/src/foundation/colors/base/opacity.ts +4 -4
- package/src/foundation/colors/base/orange.ts +12 -12
- package/src/foundation/colors/base/purple.ts +12 -12
- package/src/foundation/colors/base/red.ts +12 -12
- package/src/foundation/colors/base/yellow.ts +12 -12
- package/src/foundation/colors/index.ts +119 -120
- package/src/foundation/colors/token/component.ts +185 -213
- package/src/foundation/colors/token/core.ts +113 -134
- package/src/foundation/colors/token/index.ts +2 -2
- package/src/foundation/colors/types.ts +0 -7
- package/src/foundation/index.ts +8 -8
- package/src/foundation/spacing.ts +1 -1
- package/src/index.ts +20 -20
- package/src/stories/GettingStarted.mdx +9 -15
- package/src/stories/components/Alert/Alert.stories.tsx +39 -46
- package/src/stories/components/Button/BasicButton.stories.tsx +68 -59
- package/src/stories/components/Button/ButtonDocs.mdx +17 -41
- package/src/stories/components/Button/Color.stories.tsx +28 -51
- package/src/stories/components/Button/IconButton.stories.tsx +40 -47
- package/src/stories/components/Button/Kind.stories.tsx +100 -213
- package/src/stories/components/CheckBox/BasicCheckbox.stories.tsx +52 -71
- package/src/stories/components/CheckBox/CheckboxDocs.mdx +6 -6
- package/src/stories/components/Chip/Chip.stories.tsx +75 -75
- package/src/stories/components/Chip/ChipDocs.mdx +12 -13
- package/src/stories/components/DataTable/DataTable.stories.tsx +4 -4
- package/src/stories/components/DatePicker/DatePicker.stories.tsx +4 -4
- package/src/stories/components/Dialog/Dialog.stories.tsx +103 -124
- package/src/stories/components/Dialog/DialogDocs.mdx +7 -13
- package/src/stories/components/Dropdown/Dropdown.stories.tsx +96 -82
- package/src/stories/components/Dropdown/DropdownDocs.mdx +275 -0
- package/src/stories/components/Dropdown/DropdownExamples.stories.tsx +40 -47
- package/src/stories/components/Dropdown/DropdownItem.stories.tsx +113 -98
- package/src/stories/components/SelectControl/RadioGroup.stories.tsx +17 -30
- package/src/stories/components/SelectControl/RadioStatus.stories.tsx +16 -23
- package/src/stories/components/SelectControl/Toggle.stories.tsx +33 -78
- package/src/stories/components/TextField/BasicTextField.stories.tsx +44 -60
- package/src/stories/components/TextField/TextFieldDocs.mdx +8 -12
- package/src/stories/components/TextField/TextFieldMulti.stories.tsx +39 -58
- package/src/stories/components/TextField/TextFieldSingle.stories.tsx +74 -121
- package/src/stories/components/TextField/TextFieldSize.stories.tsx +35 -56
- package/src/stories/components/Toast/Toast.stories.tsx +39 -49
- package/src/stories/components/ToggleButton/Basic.stories.tsx +237 -235
- package/src/stories/components/ToggleButton/ToggleButtonDocs.mdx +10 -14
- package/src/stories/components/ToggleButton/ToggleButtonKind.stories.tsx +144 -203
- package/src/stories/components/ToggleButton/WithIcon.stories.tsx +87 -107
- package/src/stories/components/Tooltip/Tooltip.stories.tsx +4 -4
- package/src/stories/foundation/Elevation/Elevation.stories.tsx +48 -73
- package/src/stories/foundation/Elevation/styled.ts +3 -3
- package/src/stories/foundation/Typography/Typography.mdx +9 -13
- package/src/stories/foundation/Typography/Typography.stories.tsx +25 -41
- package/src/stories/foundation/Typography/TypographyGroup.tsx +14 -25
- package/src/stories/foundation/Typography/const.ts +13 -19
- package/src/stories/foundation/colors/ColorSystem.tsx +42 -40
- package/src/stories/foundation/colors/Colors.stories.tsx +40 -41
- package/src/stories/foundation/colors/Docs.mdx +73 -77
- package/src/stories/foundation/colors/Mui.stories.tsx +6 -8
- package/src/stories/foundation/colors/Token.inComponent.stories.tsx +81 -71
- package/src/stories/foundation/colors/TokenPaletteTable.stories.tsx +7 -7
- package/src/stories/foundation/colors/TokenPaletteTable.tsx +23 -49
- package/src/stories/foundation/colors/styled.ts +26 -26
- package/src/theme.ts +6 -6
- package/src/types.d.ts +1 -1
- package/tsconfig.build.json +1 -5
- package/tsconfig.json +0 -1
- package/src/stories/components/ToggleButton/Group.stories.tsx +0 -221
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
import React, { useState } from
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
TableRow,
|
|
6
|
-
TableBody,
|
|
7
|
-
TableCell,
|
|
8
|
-
Box,
|
|
9
|
-
} from "@mui/material";
|
|
10
|
-
import { action } from "@storybook/addon-actions";
|
|
11
|
-
import Bell from "@lunit/design-system-icons/Bell";
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Table, TableHead, TableRow, TableBody, TableCell, Box } from '@mui/material';
|
|
3
|
+
import { action } from 'storybook/actions';
|
|
4
|
+
import Bell from '@lunit/design-system-icons/Bell';
|
|
12
5
|
|
|
13
|
-
import ToggleButton from
|
|
6
|
+
import ToggleButton from '@/components/ToggleButton';
|
|
14
7
|
|
|
15
|
-
import type { StoryFn, Meta } from
|
|
8
|
+
import type { StoryFn, Meta } from '@storybook/react-webpack5';
|
|
16
9
|
|
|
17
10
|
export default {
|
|
18
|
-
title:
|
|
11
|
+
title: 'Components/ToggleButton',
|
|
19
12
|
component: ToggleButton,
|
|
20
13
|
args: {
|
|
21
|
-
kind:
|
|
22
|
-
color:
|
|
23
|
-
selectedColor:
|
|
24
|
-
size:
|
|
14
|
+
kind: 'contained',
|
|
15
|
+
color: 'primary',
|
|
16
|
+
selectedColor: 'primary',
|
|
17
|
+
size: 'small',
|
|
25
18
|
disabled: false,
|
|
26
19
|
},
|
|
27
20
|
argTypes: {
|
|
@@ -30,87 +23,86 @@ export default {
|
|
|
30
23
|
description: `Use this prop when you want to add icon.
|
|
31
24
|
\n It is added to the left of the text criteria`,
|
|
32
25
|
table: {
|
|
33
|
-
defaultValue: { summary:
|
|
34
|
-
type: { summary:
|
|
26
|
+
defaultValue: { summary: 'undefined' },
|
|
27
|
+
type: { summary: 'React.ReactNode' },
|
|
35
28
|
},
|
|
36
29
|
},
|
|
37
30
|
value: {
|
|
38
31
|
control: false,
|
|
39
|
-
table: { type: { summary:
|
|
32
|
+
table: { type: { summary: 'any' } },
|
|
40
33
|
},
|
|
41
34
|
selected: {
|
|
42
35
|
control: false,
|
|
43
36
|
table: {
|
|
44
|
-
defaultValue: { summary:
|
|
37
|
+
defaultValue: { summary: 'false' },
|
|
45
38
|
},
|
|
46
39
|
},
|
|
47
40
|
selectedColor: {
|
|
48
41
|
control: false,
|
|
49
|
-
options: [
|
|
42
|
+
options: ['primary', 'secondary'],
|
|
50
43
|
description:
|
|
51
|
-
|
|
44
|
+
'The color of the button when it is in an select state. It has nothing to do with active button',
|
|
52
45
|
table: {
|
|
53
|
-
defaultValue: { summary:
|
|
46
|
+
defaultValue: { summary: 'primary' },
|
|
54
47
|
},
|
|
55
48
|
},
|
|
56
49
|
color: {
|
|
57
50
|
control: {
|
|
58
|
-
type:
|
|
51
|
+
type: 'radio',
|
|
59
52
|
},
|
|
60
|
-
options: [
|
|
61
|
-
description:
|
|
53
|
+
options: ['primary', 'secondary'],
|
|
54
|
+
description: 'Button has three Kinds Contained, Ghost',
|
|
62
55
|
table: {
|
|
63
|
-
defaultValue: { summary:
|
|
56
|
+
defaultValue: { summary: 'primary' },
|
|
64
57
|
},
|
|
65
58
|
},
|
|
66
59
|
kind: {
|
|
67
60
|
control: {
|
|
68
|
-
type:
|
|
61
|
+
type: 'radio',
|
|
69
62
|
},
|
|
70
|
-
options: [
|
|
63
|
+
options: ['contained', 'outlined', 'ghost'],
|
|
71
64
|
table: {
|
|
72
|
-
defaultValue: { summary:
|
|
65
|
+
defaultValue: { summary: 'contained' },
|
|
73
66
|
},
|
|
74
67
|
},
|
|
75
68
|
children: {
|
|
76
|
-
type:
|
|
69
|
+
type: 'string',
|
|
77
70
|
},
|
|
78
71
|
disabled: {
|
|
79
72
|
control: {
|
|
80
|
-
type:
|
|
73
|
+
type: 'boolean',
|
|
81
74
|
},
|
|
82
75
|
table: {
|
|
83
|
-
defaultValue: { summary:
|
|
76
|
+
defaultValue: { summary: 'false' },
|
|
84
77
|
},
|
|
85
78
|
},
|
|
86
79
|
size: {
|
|
87
80
|
control: {
|
|
88
|
-
type:
|
|
81
|
+
type: 'radio',
|
|
89
82
|
},
|
|
90
|
-
options: [
|
|
83
|
+
options: ['small', 'medium', 'large'],
|
|
91
84
|
table: {
|
|
92
|
-
defaultValue: { summary:
|
|
85
|
+
defaultValue: { summary: 'small' },
|
|
93
86
|
},
|
|
94
87
|
},
|
|
95
88
|
onClick: {
|
|
96
|
-
type:
|
|
89
|
+
type: 'function',
|
|
97
90
|
control: {
|
|
98
|
-
type:
|
|
91
|
+
type: 'select',
|
|
99
92
|
},
|
|
100
|
-
options: [
|
|
93
|
+
options: ['function', undefined],
|
|
101
94
|
mapping: {
|
|
102
|
-
function: action(
|
|
95
|
+
function: action('onClick'),
|
|
103
96
|
undefined: undefined,
|
|
104
97
|
},
|
|
105
|
-
description:
|
|
106
|
-
"It is a callback function that is called when the button is clicked.",
|
|
98
|
+
description: 'It is a callback function that is called when the button is clicked.',
|
|
107
99
|
},
|
|
108
100
|
onChange: {
|
|
109
|
-
type:
|
|
101
|
+
type: 'function',
|
|
110
102
|
control: false,
|
|
111
|
-
options: [
|
|
103
|
+
options: ['function', undefined],
|
|
112
104
|
mapping: {
|
|
113
|
-
function: action(
|
|
105
|
+
function: action('onChange'),
|
|
114
106
|
undefined: undefined,
|
|
115
107
|
},
|
|
116
108
|
},
|
|
@@ -118,17 +110,17 @@ export default {
|
|
|
118
110
|
parameters: {
|
|
119
111
|
controls: {
|
|
120
112
|
include: [
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
113
|
+
'icon',
|
|
114
|
+
'value',
|
|
115
|
+
'kind',
|
|
116
|
+
'selectedColor',
|
|
117
|
+
'onClick',
|
|
118
|
+
'children',
|
|
119
|
+
'disabled',
|
|
120
|
+
'size',
|
|
121
|
+
'selected',
|
|
122
|
+
'color',
|
|
123
|
+
'onChange',
|
|
132
124
|
],
|
|
133
125
|
},
|
|
134
126
|
docs: {
|
|
@@ -157,28 +149,22 @@ const Template: StoryFn<typeof ToggleButton> = (arg) => {
|
|
|
157
149
|
<Table sx={{ width: 330 }}>
|
|
158
150
|
<TableHead>
|
|
159
151
|
<TableRow>
|
|
160
|
-
<TableCell sx={{ typography:
|
|
152
|
+
<TableCell sx={{ typography: 'body2_14_medium', color: 'inherit' }}>
|
|
161
153
|
Selected color
|
|
162
154
|
</TableCell>
|
|
163
|
-
<TableCell sx={{ typography:
|
|
164
|
-
|
|
165
|
-
</TableCell>
|
|
166
|
-
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
167
|
-
Secondary
|
|
168
|
-
</TableCell>
|
|
155
|
+
<TableCell sx={{ typography: 'body2_14_medium', color: 'inherit' }}>Primary</TableCell>
|
|
156
|
+
<TableCell sx={{ typography: 'body2_14_medium', color: 'inherit' }}>Secondary</TableCell>
|
|
169
157
|
</TableRow>
|
|
170
158
|
</TableHead>
|
|
171
159
|
<TableBody>
|
|
172
160
|
<TableRow>
|
|
173
|
-
<TableCell sx={{ typography:
|
|
174
|
-
Selected
|
|
175
|
-
</TableCell>
|
|
161
|
+
<TableCell sx={{ typography: 'body2_14_medium', color: 'inherit' }}>Selected</TableCell>
|
|
176
162
|
<TableCell>
|
|
177
163
|
<ToggleButton
|
|
178
164
|
{...arg}
|
|
179
165
|
icon={<Bell />}
|
|
180
166
|
value="primary"
|
|
181
|
-
onChange={() => handleChange(
|
|
167
|
+
onChange={() => handleChange('primary')}
|
|
182
168
|
selected={values.primary}
|
|
183
169
|
>
|
|
184
170
|
{arg.children}
|
|
@@ -190,7 +176,7 @@ const Template: StoryFn<typeof ToggleButton> = (arg) => {
|
|
|
190
176
|
icon={<Bell />}
|
|
191
177
|
selectedColor="secondary"
|
|
192
178
|
value="secondary"
|
|
193
|
-
onChange={() => handleChange(
|
|
179
|
+
onChange={() => handleChange('secondary')}
|
|
194
180
|
selected={values.secondary}
|
|
195
181
|
>
|
|
196
182
|
{arg.children}
|
|
@@ -204,16 +190,16 @@ const Template: StoryFn<typeof ToggleButton> = (arg) => {
|
|
|
204
190
|
|
|
205
191
|
export const IconStory = {
|
|
206
192
|
render: Template,
|
|
207
|
-
name:
|
|
193
|
+
name: 'Icon',
|
|
208
194
|
|
|
209
195
|
args: {
|
|
210
|
-
children:
|
|
196
|
+
children: 'Text',
|
|
211
197
|
},
|
|
212
198
|
|
|
213
199
|
argTypes: {
|
|
214
200
|
children: {
|
|
215
|
-
type:
|
|
216
|
-
defaultValue:
|
|
201
|
+
type: 'string',
|
|
202
|
+
defaultValue: 'text',
|
|
217
203
|
},
|
|
218
204
|
},
|
|
219
205
|
};
|
|
@@ -233,12 +219,12 @@ const IconDocsTemplate: StoryFn<typeof ToggleButton> = (arg) => {
|
|
|
233
219
|
};
|
|
234
220
|
|
|
235
221
|
return (
|
|
236
|
-
<Box sx={{
|
|
222
|
+
<Box sx={{ '& button': { marginRight: 2 } }}>
|
|
237
223
|
<ToggleButton
|
|
238
224
|
{...arg}
|
|
239
225
|
icon={<Bell />}
|
|
240
226
|
value="contained"
|
|
241
|
-
onChange={() => handleChange(
|
|
227
|
+
onChange={() => handleChange('contained')}
|
|
242
228
|
selected={values.contained}
|
|
243
229
|
>
|
|
244
230
|
Contained
|
|
@@ -249,7 +235,7 @@ const IconDocsTemplate: StoryFn<typeof ToggleButton> = (arg) => {
|
|
|
249
235
|
kind="outlined"
|
|
250
236
|
color="primary"
|
|
251
237
|
value="outlined"
|
|
252
|
-
onChange={() => handleChange(
|
|
238
|
+
onChange={() => handleChange('outlined')}
|
|
253
239
|
selected={values.outlined}
|
|
254
240
|
>
|
|
255
241
|
Outlined
|
|
@@ -259,7 +245,7 @@ const IconDocsTemplate: StoryFn<typeof ToggleButton> = (arg) => {
|
|
|
259
245
|
icon={<Bell />}
|
|
260
246
|
kind="ghost"
|
|
261
247
|
value="ghost"
|
|
262
|
-
onChange={() => handleChange(
|
|
248
|
+
onChange={() => handleChange('ghost')}
|
|
263
249
|
selected={values.ghost}
|
|
264
250
|
>
|
|
265
251
|
Ghost
|
|
@@ -270,20 +256,20 @@ const IconDocsTemplate: StoryFn<typeof ToggleButton> = (arg) => {
|
|
|
270
256
|
|
|
271
257
|
export const IconDocs = {
|
|
272
258
|
render: IconDocsTemplate,
|
|
273
|
-
name:
|
|
259
|
+
name: 'Icon Docs',
|
|
274
260
|
args: {
|
|
275
|
-
children:
|
|
261
|
+
children: 'Text',
|
|
276
262
|
},
|
|
277
263
|
argTypes: {
|
|
278
264
|
children: {
|
|
279
|
-
type:
|
|
280
|
-
defaultValue:
|
|
265
|
+
type: 'string',
|
|
266
|
+
defaultValue: 'text',
|
|
281
267
|
},
|
|
282
268
|
},
|
|
283
269
|
parameters: {
|
|
284
270
|
chromatic: { disableSnapshot: true },
|
|
285
271
|
controls: {
|
|
286
|
-
include: [
|
|
272
|
+
include: ['color', 'size', 'disabled', 'children'],
|
|
287
273
|
},
|
|
288
274
|
},
|
|
289
275
|
};
|
|
@@ -305,28 +291,22 @@ const IconOnlyTemplate: StoryFn<typeof ToggleButton> = (arg) => {
|
|
|
305
291
|
<Table sx={{ width: 330 }}>
|
|
306
292
|
<TableHead>
|
|
307
293
|
<TableRow>
|
|
308
|
-
<TableCell sx={{ typography:
|
|
294
|
+
<TableCell sx={{ typography: 'body2_14_medium', color: 'inherit' }}>
|
|
309
295
|
Selected color
|
|
310
296
|
</TableCell>
|
|
311
|
-
<TableCell sx={{ typography:
|
|
312
|
-
|
|
313
|
-
</TableCell>
|
|
314
|
-
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
315
|
-
Secondary
|
|
316
|
-
</TableCell>
|
|
297
|
+
<TableCell sx={{ typography: 'body2_14_medium', color: 'inherit' }}>Primary</TableCell>
|
|
298
|
+
<TableCell sx={{ typography: 'body2_14_medium', color: 'inherit' }}>Secondary</TableCell>
|
|
317
299
|
</TableRow>
|
|
318
300
|
</TableHead>
|
|
319
301
|
<TableBody>
|
|
320
302
|
<TableRow>
|
|
321
|
-
<TableCell sx={{ typography:
|
|
322
|
-
Selected
|
|
323
|
-
</TableCell>
|
|
303
|
+
<TableCell sx={{ typography: 'body2_14_medium', color: 'inherit' }}>Selected</TableCell>
|
|
324
304
|
<TableCell>
|
|
325
305
|
<ToggleButton
|
|
326
306
|
{...arg}
|
|
327
307
|
icon={<Bell />}
|
|
328
308
|
value="primary"
|
|
329
|
-
onChange={() => handleChange(
|
|
309
|
+
onChange={() => handleChange('primary')}
|
|
330
310
|
selected={values.primary}
|
|
331
311
|
>
|
|
332
312
|
{arg.children}
|
|
@@ -338,7 +318,7 @@ const IconOnlyTemplate: StoryFn<typeof ToggleButton> = (arg) => {
|
|
|
338
318
|
icon={<Bell />}
|
|
339
319
|
selectedColor="secondary"
|
|
340
320
|
value="secondary"
|
|
341
|
-
onChange={() => handleChange(
|
|
321
|
+
onChange={() => handleChange('secondary')}
|
|
342
322
|
selected={values.secondary}
|
|
343
323
|
>
|
|
344
324
|
{arg.children}
|
|
@@ -352,18 +332,18 @@ const IconOnlyTemplate: StoryFn<typeof ToggleButton> = (arg) => {
|
|
|
352
332
|
|
|
353
333
|
export const WithIconOnlyStory = {
|
|
354
334
|
render: IconOnlyTemplate,
|
|
355
|
-
name:
|
|
335
|
+
name: 'Icon only',
|
|
356
336
|
|
|
357
337
|
argTypes: {
|
|
358
338
|
children: {
|
|
359
|
-
type:
|
|
339
|
+
type: 'string',
|
|
360
340
|
controls: false,
|
|
361
341
|
},
|
|
362
342
|
},
|
|
363
343
|
};
|
|
364
344
|
|
|
365
345
|
const IconOnlyDocsTemplate: StoryFn<typeof ToggleButton> = (arg) => {
|
|
366
|
-
const {
|
|
346
|
+
const { ...restArg } = arg;
|
|
367
347
|
|
|
368
348
|
const [values, setValues] = useState({
|
|
369
349
|
contained: false,
|
|
@@ -379,12 +359,12 @@ const IconOnlyDocsTemplate: StoryFn<typeof ToggleButton> = (arg) => {
|
|
|
379
359
|
};
|
|
380
360
|
|
|
381
361
|
return (
|
|
382
|
-
<Box sx={{
|
|
362
|
+
<Box sx={{ '& button': { marginRight: 2 } }}>
|
|
383
363
|
<ToggleButton
|
|
384
364
|
{...restArg}
|
|
385
365
|
icon={<Bell />}
|
|
386
366
|
value="contained"
|
|
387
|
-
onChange={() => handleChange(
|
|
367
|
+
onChange={() => handleChange('contained')}
|
|
388
368
|
selected={values.contained}
|
|
389
369
|
/>
|
|
390
370
|
<ToggleButton
|
|
@@ -393,7 +373,7 @@ const IconOnlyDocsTemplate: StoryFn<typeof ToggleButton> = (arg) => {
|
|
|
393
373
|
kind="outlined"
|
|
394
374
|
color="primary"
|
|
395
375
|
value="outlined"
|
|
396
|
-
onChange={() => handleChange(
|
|
376
|
+
onChange={() => handleChange('outlined')}
|
|
397
377
|
selected={values.outlined}
|
|
398
378
|
/>
|
|
399
379
|
|
|
@@ -402,7 +382,7 @@ const IconOnlyDocsTemplate: StoryFn<typeof ToggleButton> = (arg) => {
|
|
|
402
382
|
icon={<Bell />}
|
|
403
383
|
kind="ghost"
|
|
404
384
|
value="ghost"
|
|
405
|
-
onChange={() => handleChange(
|
|
385
|
+
onChange={() => handleChange('ghost')}
|
|
406
386
|
selected={values.ghost}
|
|
407
387
|
/>
|
|
408
388
|
</Box>
|
|
@@ -411,20 +391,20 @@ const IconOnlyDocsTemplate: StoryFn<typeof ToggleButton> = (arg) => {
|
|
|
411
391
|
|
|
412
392
|
export const IconOnlyDocs = {
|
|
413
393
|
render: IconOnlyDocsTemplate,
|
|
414
|
-
name:
|
|
394
|
+
name: 'Icon Only Docs',
|
|
415
395
|
args: {
|
|
416
|
-
children:
|
|
396
|
+
children: 'Text',
|
|
417
397
|
},
|
|
418
398
|
argTypes: {
|
|
419
399
|
children: {
|
|
420
|
-
type:
|
|
421
|
-
defaultValue:
|
|
400
|
+
type: 'string',
|
|
401
|
+
defaultValue: 'text',
|
|
422
402
|
},
|
|
423
403
|
},
|
|
424
404
|
parameters: {
|
|
425
405
|
chromatic: { disableSnapshot: true },
|
|
426
406
|
controls: {
|
|
427
|
-
include: [
|
|
407
|
+
include: ['color', 'size', 'disabled', 'children'],
|
|
428
408
|
},
|
|
429
409
|
},
|
|
430
410
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { StoryFn, Meta } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StoryFn, Meta } from '@storybook/react-webpack5';
|
|
3
3
|
|
|
4
|
-
import Tooltip from
|
|
4
|
+
import Tooltip from '@/components/Tooltip';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
-
title:
|
|
7
|
+
title: 'Components/Tooltip',
|
|
8
8
|
component: Tooltip,
|
|
9
9
|
} as Meta<typeof Tooltip>;
|
|
10
10
|
|