@lunit/design-system 2.2.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.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 +226 -227
- 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 -7
- 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 +3 -4
- 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 -3
- 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 +9 -11
- 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 +17 -25
- 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 +5 -6
- 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 +6 -9
- 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 +6 -6
- package/src/stories/components/Alert/Alert.stories.tsx +38 -45
- 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 -135
- 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 -53
- package/src/stories/components/TextField/TextFieldDocs.mdx +8 -12
- package/src/stories/components/TextField/TextFieldMulti.stories.tsx +39 -55
- package/src/stories/components/TextField/TextFieldSingle.stories.tsx +74 -118
- package/src/stories/components/TextField/TextFieldSize.stories.tsx +35 -55
- package/src/stories/components/Toast/Toast.stories.tsx +35 -50
- package/src/stories/components/ToggleButton/Basic.stories.tsx +115 -152
- package/src/stories/components/ToggleButton/ToggleButtonDocs.mdx +10 -14
- package/src/stories/components/ToggleButton/ToggleButtonKind.stories.tsx +141 -200
- 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 -54
- 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
|
@@ -1,121 +1,113 @@
|
|
|
1
|
-
import React, { useState } from
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
Table,
|
|
5
|
-
TableHead,
|
|
6
|
-
TableRow,
|
|
7
|
-
TableBody,
|
|
8
|
-
TableCell,
|
|
9
|
-
} from "@mui/material";
|
|
10
|
-
import { action } from "storybook/actions";
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Box, Table, TableHead, TableRow, TableBody, TableCell } from '@mui/material';
|
|
3
|
+
import { action } from 'storybook/actions';
|
|
11
4
|
|
|
12
|
-
import ToggleButton from
|
|
5
|
+
import ToggleButton from '@/components/ToggleButton';
|
|
13
6
|
|
|
14
|
-
import type { StoryFn, Meta } from
|
|
7
|
+
import type { StoryFn, Meta } from '@storybook/react-webpack5';
|
|
15
8
|
|
|
16
9
|
export default {
|
|
17
|
-
title:
|
|
10
|
+
title: 'Components/ToggleButton',
|
|
18
11
|
component: ToggleButton,
|
|
19
12
|
args: {
|
|
20
|
-
children:
|
|
21
|
-
kind:
|
|
22
|
-
color:
|
|
23
|
-
selectedColor:
|
|
24
|
-
size:
|
|
13
|
+
children: 'Text',
|
|
14
|
+
kind: 'contained',
|
|
15
|
+
color: 'primary',
|
|
16
|
+
selectedColor: 'primary',
|
|
17
|
+
size: 'small',
|
|
25
18
|
disabled: false,
|
|
26
19
|
},
|
|
27
20
|
argTypes: {
|
|
28
21
|
value: {
|
|
29
22
|
control: false,
|
|
30
|
-
table: { type: { summary:
|
|
23
|
+
table: { type: { summary: 'any' } },
|
|
31
24
|
},
|
|
32
25
|
selected: {
|
|
33
26
|
control: false,
|
|
34
27
|
table: {
|
|
35
|
-
defaultValue: { summary:
|
|
28
|
+
defaultValue: { summary: 'false' },
|
|
36
29
|
},
|
|
37
30
|
},
|
|
38
31
|
children: {
|
|
39
|
-
type:
|
|
32
|
+
type: 'string',
|
|
40
33
|
},
|
|
41
34
|
disabled: {
|
|
42
35
|
control: {
|
|
43
|
-
type:
|
|
36
|
+
type: 'boolean',
|
|
44
37
|
},
|
|
45
38
|
table: {
|
|
46
|
-
defaultValue: { summary:
|
|
39
|
+
defaultValue: { summary: 'false' },
|
|
47
40
|
},
|
|
48
41
|
},
|
|
49
42
|
size: {
|
|
50
43
|
control: {
|
|
51
|
-
type:
|
|
44
|
+
type: 'radio',
|
|
52
45
|
},
|
|
53
|
-
options: [
|
|
46
|
+
options: ['small', 'medium', 'large'],
|
|
54
47
|
table: {
|
|
55
|
-
defaultValue: { summary:
|
|
48
|
+
defaultValue: { summary: 'small' },
|
|
56
49
|
},
|
|
57
50
|
},
|
|
58
51
|
selectedColor: {
|
|
59
52
|
control: {
|
|
60
|
-
type:
|
|
53
|
+
type: 'radio',
|
|
61
54
|
},
|
|
62
|
-
options: [
|
|
55
|
+
options: ['primary', 'secondary'],
|
|
63
56
|
description:
|
|
64
|
-
|
|
57
|
+
'The color of the button when it is in an select state. It has nothing to do with active button',
|
|
65
58
|
table: {
|
|
66
|
-
defaultValue: { summary:
|
|
59
|
+
defaultValue: { summary: 'primary' },
|
|
67
60
|
},
|
|
68
61
|
},
|
|
69
62
|
onChange: {
|
|
70
|
-
type:
|
|
63
|
+
type: 'function',
|
|
71
64
|
control: false,
|
|
72
|
-
options: [
|
|
65
|
+
options: ['function', undefined],
|
|
73
66
|
mapping: {
|
|
74
|
-
function: action(
|
|
67
|
+
function: action('onChange'),
|
|
75
68
|
undefined: undefined,
|
|
76
69
|
},
|
|
77
70
|
},
|
|
78
71
|
onClick: {
|
|
79
|
-
type:
|
|
72
|
+
type: 'function',
|
|
80
73
|
control: {
|
|
81
|
-
type:
|
|
74
|
+
type: 'radio',
|
|
82
75
|
},
|
|
83
|
-
options: [
|
|
76
|
+
options: ['function', undefined],
|
|
84
77
|
mapping: {
|
|
85
|
-
function: action(
|
|
78
|
+
function: action('onClick'),
|
|
86
79
|
undefined: undefined,
|
|
87
80
|
},
|
|
88
|
-
description:
|
|
89
|
-
"It is a callback function that is called when the button is clicked.",
|
|
81
|
+
description: 'It is a callback function that is called when the button is clicked.',
|
|
90
82
|
},
|
|
91
83
|
color: {
|
|
92
|
-
options: [
|
|
84
|
+
options: ['primary', 'secondary'],
|
|
93
85
|
table: {
|
|
94
|
-
defaultValue: { summary:
|
|
86
|
+
defaultValue: { summary: 'primary' },
|
|
95
87
|
},
|
|
96
88
|
},
|
|
97
89
|
kind: {
|
|
98
90
|
control: false,
|
|
99
|
-
options: [
|
|
100
|
-
description:
|
|
91
|
+
options: ['contained', 'outlined', 'ghost'],
|
|
92
|
+
description: 'Button has three Kinds Contained, Outlined, Ghost',
|
|
101
93
|
table: {
|
|
102
|
-
defaultValue: { summary:
|
|
94
|
+
defaultValue: { summary: 'contained' },
|
|
103
95
|
},
|
|
104
96
|
},
|
|
105
97
|
},
|
|
106
98
|
parameters: {
|
|
107
99
|
controls: {
|
|
108
100
|
include: [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
101
|
+
'value',
|
|
102
|
+
'kind',
|
|
103
|
+
'selectedColor',
|
|
104
|
+
'onClick',
|
|
105
|
+
'children',
|
|
106
|
+
'disabled',
|
|
107
|
+
'size',
|
|
108
|
+
'selected',
|
|
109
|
+
'color',
|
|
110
|
+
'onChange',
|
|
119
111
|
],
|
|
120
112
|
},
|
|
121
113
|
docs: {
|
|
@@ -125,17 +117,14 @@ export default {
|
|
|
125
117
|
},
|
|
126
118
|
},
|
|
127
119
|
pseudo: {
|
|
128
|
-
hover: [
|
|
120
|
+
hover: ['#hover1', '#hover2', '#hover3'],
|
|
129
121
|
},
|
|
130
122
|
},
|
|
131
123
|
} as Meta<typeof ToggleButton>;
|
|
132
124
|
|
|
133
|
-
const ButtonTemplate: StoryFn<typeof ToggleButton> = ({
|
|
134
|
-
|
|
135
|
-
color,
|
|
136
|
-
children,
|
|
137
|
-
...restProps
|
|
138
|
-
}) => {
|
|
125
|
+
const ButtonTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
126
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
127
|
+
const { color, children, kind, ...restArgs } = args;
|
|
139
128
|
const [values, setValues] = useState({
|
|
140
129
|
contained: false,
|
|
141
130
|
outlined: false,
|
|
@@ -154,8 +143,8 @@ const ButtonTemplate: StoryFn<typeof ToggleButton> = ({
|
|
|
154
143
|
<TableCell
|
|
155
144
|
colSpan={3}
|
|
156
145
|
sx={{
|
|
157
|
-
typography:
|
|
158
|
-
color:
|
|
146
|
+
typography: 'body1_16_semibold',
|
|
147
|
+
color: 'inherit',
|
|
159
148
|
}}
|
|
160
149
|
>
|
|
161
150
|
Kind
|
|
@@ -164,19 +153,15 @@ const ButtonTemplate: StoryFn<typeof ToggleButton> = ({
|
|
|
164
153
|
<TableRow>
|
|
165
154
|
<TableCell
|
|
166
155
|
sx={{
|
|
167
|
-
width:
|
|
168
|
-
typography:
|
|
169
|
-
color:
|
|
156
|
+
width: '33.33333%',
|
|
157
|
+
typography: 'body2_14_medium',
|
|
158
|
+
color: 'inherit',
|
|
170
159
|
}}
|
|
171
160
|
>
|
|
172
161
|
Contained(default)
|
|
173
162
|
</TableCell>
|
|
174
|
-
<TableCell sx={{ typography:
|
|
175
|
-
|
|
176
|
-
</TableCell>
|
|
177
|
-
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
178
|
-
Ghost
|
|
179
|
-
</TableCell>
|
|
163
|
+
<TableCell sx={{ typography: 'body2_14_medium', color: 'inherit' }}>Outlined</TableCell>
|
|
164
|
+
<TableCell sx={{ typography: 'body2_14_medium', color: 'inherit' }}>Ghost</TableCell>
|
|
180
165
|
</TableRow>
|
|
181
166
|
</TableHead>
|
|
182
167
|
<TableBody>
|
|
@@ -184,9 +169,9 @@ const ButtonTemplate: StoryFn<typeof ToggleButton> = ({
|
|
|
184
169
|
<TableCell>
|
|
185
170
|
<ToggleButton
|
|
186
171
|
color={color}
|
|
187
|
-
{...
|
|
172
|
+
{...restArgs}
|
|
188
173
|
value="contained"
|
|
189
|
-
onChange={() => handleChange(
|
|
174
|
+
onChange={() => handleChange('contained')}
|
|
190
175
|
selected={values.contained}
|
|
191
176
|
>
|
|
192
177
|
{children}
|
|
@@ -196,9 +181,9 @@ const ButtonTemplate: StoryFn<typeof ToggleButton> = ({
|
|
|
196
181
|
<ToggleButton
|
|
197
182
|
kind="outlined"
|
|
198
183
|
color="primary"
|
|
199
|
-
{...
|
|
184
|
+
{...restArgs}
|
|
200
185
|
value="outlined"
|
|
201
|
-
onChange={() => handleChange(
|
|
186
|
+
onChange={() => handleChange('outlined')}
|
|
202
187
|
selected={values.outlined}
|
|
203
188
|
>
|
|
204
189
|
{children}
|
|
@@ -208,9 +193,9 @@ const ButtonTemplate: StoryFn<typeof ToggleButton> = ({
|
|
|
208
193
|
<ToggleButton
|
|
209
194
|
kind="ghost"
|
|
210
195
|
color={color}
|
|
211
|
-
{...
|
|
196
|
+
{...restArgs}
|
|
212
197
|
value="ghost"
|
|
213
|
-
onChange={() => handleChange(
|
|
198
|
+
onChange={() => handleChange('ghost')}
|
|
214
199
|
selected={values.ghost}
|
|
215
200
|
>
|
|
216
201
|
{children}
|
|
@@ -231,18 +216,15 @@ export const Kind = {
|
|
|
231
216
|
argTypes: {
|
|
232
217
|
color: {
|
|
233
218
|
control: {
|
|
234
|
-
type:
|
|
219
|
+
type: 'radio',
|
|
235
220
|
},
|
|
236
221
|
},
|
|
237
222
|
},
|
|
238
223
|
};
|
|
239
224
|
|
|
240
|
-
const ToggleButtonDocsTemplate: StoryFn<typeof ToggleButton> = ({
|
|
241
|
-
|
|
242
|
-
color,
|
|
243
|
-
children,
|
|
244
|
-
...restProps
|
|
245
|
-
}) => {
|
|
225
|
+
const ToggleButtonDocsTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
226
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
227
|
+
const { color, children, kind, ...restArgs } = args;
|
|
246
228
|
const [values, setValues] = useState({
|
|
247
229
|
contained: false,
|
|
248
230
|
outlined: false,
|
|
@@ -256,36 +238,36 @@ const ToggleButtonDocsTemplate: StoryFn<typeof ToggleButton> = ({
|
|
|
256
238
|
return (
|
|
257
239
|
<Box
|
|
258
240
|
sx={{
|
|
259
|
-
|
|
260
|
-
marginRight:
|
|
241
|
+
'& button': {
|
|
242
|
+
marginRight: '7px',
|
|
261
243
|
},
|
|
262
244
|
}}
|
|
263
245
|
>
|
|
264
246
|
<ToggleButton
|
|
265
247
|
color={color}
|
|
266
|
-
{...
|
|
248
|
+
{...restArgs}
|
|
267
249
|
value="contained"
|
|
268
|
-
onChange={() => handleChange(
|
|
250
|
+
onChange={() => handleChange('contained')}
|
|
269
251
|
selected={values.contained}
|
|
270
252
|
>
|
|
271
253
|
{children}
|
|
272
254
|
</ToggleButton>
|
|
273
255
|
<ToggleButton
|
|
274
256
|
kind="outlined"
|
|
275
|
-
|
|
276
|
-
{...restProps}
|
|
257
|
+
{...restArgs}
|
|
277
258
|
value="outlined"
|
|
278
|
-
onChange={() => handleChange(
|
|
259
|
+
onChange={() => handleChange('outlined')}
|
|
279
260
|
selected={values.outlined}
|
|
280
261
|
>
|
|
281
262
|
{children}
|
|
282
263
|
</ToggleButton>
|
|
264
|
+
|
|
283
265
|
<ToggleButton
|
|
284
266
|
kind="ghost"
|
|
285
267
|
color={color}
|
|
286
|
-
{...
|
|
268
|
+
{...restArgs}
|
|
287
269
|
value="ghost"
|
|
288
|
-
onChange={() => handleChange(
|
|
270
|
+
onChange={() => handleChange('ghost')}
|
|
289
271
|
selected={values.ghost}
|
|
290
272
|
>
|
|
291
273
|
{children}
|
|
@@ -302,6 +284,8 @@ export const KindDocs = {
|
|
|
302
284
|
};
|
|
303
285
|
|
|
304
286
|
const ContainedTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
287
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
288
|
+
const { color: _, ...restArgs } = args;
|
|
305
289
|
const [values, setValues] = useState({
|
|
306
290
|
primary: {
|
|
307
291
|
enable: false,
|
|
@@ -332,26 +316,24 @@ const ContainedTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
|
332
316
|
<Table sx={{ width: 450 }}>
|
|
333
317
|
<TableHead>
|
|
334
318
|
<TableRow>
|
|
335
|
-
<TableCell
|
|
336
|
-
<TableCell sx={{ typography:
|
|
319
|
+
<TableCell />
|
|
320
|
+
<TableCell sx={{ typography: 'body2_14_medium', color: 'inherit' }}>
|
|
337
321
|
Contained Primary
|
|
338
322
|
</TableCell>
|
|
339
|
-
<TableCell sx={{ typography:
|
|
323
|
+
<TableCell sx={{ typography: 'body2_14_medium', color: 'inherit' }}>
|
|
340
324
|
Contained Secondary
|
|
341
325
|
</TableCell>
|
|
342
326
|
</TableRow>
|
|
343
327
|
</TableHead>
|
|
344
328
|
<TableBody>
|
|
345
329
|
<TableRow>
|
|
346
|
-
<TableCell sx={{ typography:
|
|
347
|
-
Enable
|
|
348
|
-
</TableCell>
|
|
330
|
+
<TableCell sx={{ typography: 'body2_14_regular', color: 'inherit' }}>Enable</TableCell>
|
|
349
331
|
<TableCell>
|
|
350
332
|
<ToggleButton
|
|
351
|
-
{...
|
|
333
|
+
{...restArgs}
|
|
352
334
|
kind="contained"
|
|
353
335
|
value="enable"
|
|
354
|
-
onChange={() => handleChange(
|
|
336
|
+
onChange={() => handleChange('primary', 'enable')}
|
|
355
337
|
selected={values.primary.enable}
|
|
356
338
|
>
|
|
357
339
|
{args.children}
|
|
@@ -359,11 +341,11 @@ const ContainedTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
|
359
341
|
</TableCell>
|
|
360
342
|
<TableCell>
|
|
361
343
|
<ToggleButton
|
|
362
|
-
{...
|
|
344
|
+
{...restArgs}
|
|
363
345
|
kind="contained"
|
|
364
346
|
color="secondary"
|
|
365
347
|
value="enable"
|
|
366
|
-
onChange={() => handleChange(
|
|
348
|
+
onChange={() => handleChange('secondary', 'enable')}
|
|
367
349
|
selected={values.secondary.enable}
|
|
368
350
|
>
|
|
369
351
|
{args.children}
|
|
@@ -371,16 +353,14 @@ const ContainedTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
|
371
353
|
</TableCell>
|
|
372
354
|
</TableRow>
|
|
373
355
|
<TableRow>
|
|
374
|
-
<TableCell sx={{ typography:
|
|
375
|
-
Hover
|
|
376
|
-
</TableCell>
|
|
356
|
+
<TableCell sx={{ typography: 'body2_14_regular', color: 'inherit' }}>Hover</TableCell>
|
|
377
357
|
<TableCell>
|
|
378
358
|
<ToggleButton
|
|
379
|
-
{...
|
|
359
|
+
{...restArgs}
|
|
380
360
|
id="hover1"
|
|
381
361
|
kind="contained"
|
|
382
362
|
value="hover"
|
|
383
|
-
onChange={() => handleChange(
|
|
363
|
+
onChange={() => handleChange('primary', 'hover')}
|
|
384
364
|
selected={values.primary.hover}
|
|
385
365
|
>
|
|
386
366
|
{args.children}
|
|
@@ -388,12 +368,12 @@ const ContainedTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
|
388
368
|
</TableCell>
|
|
389
369
|
<TableCell>
|
|
390
370
|
<ToggleButton
|
|
391
|
-
{...
|
|
371
|
+
{...restArgs}
|
|
392
372
|
id="hover2"
|
|
393
373
|
kind="contained"
|
|
394
374
|
color="secondary"
|
|
395
375
|
value="hover"
|
|
396
|
-
onChange={() => handleChange(
|
|
376
|
+
onChange={() => handleChange('secondary', 'hover')}
|
|
397
377
|
selected={values.secondary.hover}
|
|
398
378
|
>
|
|
399
379
|
{args.children}
|
|
@@ -401,16 +381,14 @@ const ContainedTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
|
401
381
|
</TableCell>
|
|
402
382
|
</TableRow>
|
|
403
383
|
<TableRow>
|
|
404
|
-
<TableCell sx={{ typography:
|
|
405
|
-
Focus
|
|
406
|
-
</TableCell>
|
|
384
|
+
<TableCell sx={{ typography: 'body2_14_regular', color: 'inherit' }}>Focus</TableCell>
|
|
407
385
|
<TableCell>
|
|
408
386
|
<ToggleButton
|
|
409
|
-
{...
|
|
387
|
+
{...restArgs}
|
|
410
388
|
kind="contained"
|
|
411
389
|
className="Mui-focusVisible"
|
|
412
390
|
value="focus"
|
|
413
|
-
onChange={() => handleChange(
|
|
391
|
+
onChange={() => handleChange('primary', 'focus')}
|
|
414
392
|
selected={values.primary.focus}
|
|
415
393
|
>
|
|
416
394
|
{args.children}
|
|
@@ -418,12 +396,12 @@ const ContainedTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
|
418
396
|
</TableCell>
|
|
419
397
|
<TableCell>
|
|
420
398
|
<ToggleButton
|
|
421
|
-
{...
|
|
399
|
+
{...restArgs}
|
|
422
400
|
kind="contained"
|
|
423
401
|
color="secondary"
|
|
424
402
|
className="Mui-focusVisible"
|
|
425
403
|
value="focus"
|
|
426
|
-
onChange={() => handleChange(
|
|
404
|
+
onChange={() => handleChange('secondary', 'focus')}
|
|
427
405
|
selected={values.secondary.focus}
|
|
428
406
|
>
|
|
429
407
|
{args.children}
|
|
@@ -431,22 +409,14 @@ const ContainedTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
|
431
409
|
</TableCell>
|
|
432
410
|
</TableRow>
|
|
433
411
|
<TableRow>
|
|
434
|
-
<TableCell sx={{ typography:
|
|
435
|
-
Disabled
|
|
436
|
-
</TableCell>
|
|
412
|
+
<TableCell sx={{ typography: 'body2_14_regular', color: 'inherit' }}>Disabled</TableCell>
|
|
437
413
|
<TableCell>
|
|
438
|
-
<ToggleButton {...
|
|
414
|
+
<ToggleButton {...restArgs} kind="contained" disabled value="disabled">
|
|
439
415
|
{args.children}
|
|
440
416
|
</ToggleButton>
|
|
441
417
|
</TableCell>
|
|
442
418
|
<TableCell>
|
|
443
|
-
<ToggleButton
|
|
444
|
-
{...args}
|
|
445
|
-
kind="contained"
|
|
446
|
-
color="secondary"
|
|
447
|
-
disabled
|
|
448
|
-
value="text8"
|
|
449
|
-
>
|
|
419
|
+
<ToggleButton {...restArgs} kind="contained" color="secondary" disabled value="text8">
|
|
450
420
|
{args.children}
|
|
451
421
|
</ToggleButton>
|
|
452
422
|
</TableCell>
|
|
@@ -458,7 +428,7 @@ const ContainedTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
|
458
428
|
|
|
459
429
|
export const KindContained = {
|
|
460
430
|
render: ContainedTemplate,
|
|
461
|
-
name:
|
|
431
|
+
name: 'Kind: Contained',
|
|
462
432
|
|
|
463
433
|
argTypes: {
|
|
464
434
|
color: {
|
|
@@ -468,6 +438,8 @@ export const KindContained = {
|
|
|
468
438
|
};
|
|
469
439
|
|
|
470
440
|
const GhostTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
441
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
442
|
+
const { color: _, ...restArgs } = args;
|
|
471
443
|
const [values, setValues] = useState({
|
|
472
444
|
primary: {
|
|
473
445
|
enable: false,
|
|
@@ -499,28 +471,24 @@ const GhostTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
|
499
471
|
<Table sx={{ width: 450 }}>
|
|
500
472
|
<TableHead>
|
|
501
473
|
<TableRow>
|
|
502
|
-
<TableCell
|
|
503
|
-
<TableCell sx={{ typography:
|
|
474
|
+
<TableCell />
|
|
475
|
+
<TableCell sx={{ typography: 'body2_14_medium', color: 'inherit' }}>
|
|
504
476
|
Ghost Primary
|
|
505
477
|
</TableCell>
|
|
506
|
-
<TableCell sx={{ typography:
|
|
478
|
+
<TableCell sx={{ typography: 'body2_14_medium', color: 'inherit' }}>
|
|
507
479
|
Ghost Secondary
|
|
508
480
|
</TableCell>
|
|
509
481
|
</TableRow>
|
|
510
482
|
</TableHead>
|
|
511
483
|
<TableBody>
|
|
512
484
|
<TableRow>
|
|
513
|
-
<TableCell
|
|
514
|
-
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
515
|
-
>
|
|
516
|
-
Enable
|
|
517
|
-
</TableCell>
|
|
485
|
+
<TableCell sx={{ typography: 'body2_14_regular', color: 'inherit' }}>Enable</TableCell>
|
|
518
486
|
<TableCell>
|
|
519
487
|
<ToggleButton
|
|
520
|
-
{...
|
|
488
|
+
{...restArgs}
|
|
521
489
|
kind="ghost"
|
|
522
490
|
value="enable"
|
|
523
|
-
onChange={() => handleChange(
|
|
491
|
+
onChange={() => handleChange('primary', 'enable')}
|
|
524
492
|
selected={values.primary.enable}
|
|
525
493
|
>
|
|
526
494
|
{args.children}
|
|
@@ -528,11 +496,11 @@ const GhostTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
|
528
496
|
</TableCell>
|
|
529
497
|
<TableCell>
|
|
530
498
|
<ToggleButton
|
|
531
|
-
{...
|
|
499
|
+
{...restArgs}
|
|
532
500
|
kind="ghost"
|
|
533
501
|
color="secondary"
|
|
534
502
|
value="enable"
|
|
535
|
-
onChange={() => handleChange(
|
|
503
|
+
onChange={() => handleChange('secondary', 'enable')}
|
|
536
504
|
selected={values.secondary.enable}
|
|
537
505
|
>
|
|
538
506
|
{args.children}
|
|
@@ -540,18 +508,14 @@ const GhostTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
|
540
508
|
</TableCell>
|
|
541
509
|
</TableRow>
|
|
542
510
|
<TableRow>
|
|
543
|
-
<TableCell
|
|
544
|
-
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
545
|
-
>
|
|
546
|
-
Hover
|
|
547
|
-
</TableCell>
|
|
511
|
+
<TableCell sx={{ typography: 'body2_14_regular', color: 'inherit' }}>Hover</TableCell>
|
|
548
512
|
<TableCell>
|
|
549
513
|
<ToggleButton
|
|
550
|
-
{...
|
|
514
|
+
{...restArgs}
|
|
551
515
|
id="hover1"
|
|
552
516
|
kind="ghost"
|
|
553
517
|
value="hover"
|
|
554
|
-
onChange={() => handleChange(
|
|
518
|
+
onChange={() => handleChange('primary', 'hover')}
|
|
555
519
|
selected={values.primary.hover}
|
|
556
520
|
>
|
|
557
521
|
{args.children}
|
|
@@ -559,12 +523,12 @@ const GhostTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
|
559
523
|
</TableCell>
|
|
560
524
|
<TableCell>
|
|
561
525
|
<ToggleButton
|
|
562
|
-
{...
|
|
526
|
+
{...restArgs}
|
|
563
527
|
id="hover2"
|
|
564
528
|
kind="ghost"
|
|
565
529
|
color="secondary"
|
|
566
530
|
value="hover"
|
|
567
|
-
onChange={() => handleChange(
|
|
531
|
+
onChange={() => handleChange('secondary', 'hover')}
|
|
568
532
|
selected={values.secondary.hover}
|
|
569
533
|
>
|
|
570
534
|
{args.children}
|
|
@@ -572,18 +536,14 @@ const GhostTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
|
572
536
|
</TableCell>
|
|
573
537
|
</TableRow>
|
|
574
538
|
<TableRow>
|
|
575
|
-
<TableCell
|
|
576
|
-
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
577
|
-
>
|
|
578
|
-
Focus
|
|
579
|
-
</TableCell>
|
|
539
|
+
<TableCell sx={{ typography: 'body2_14_regular', color: 'inherit' }}>Focus</TableCell>
|
|
580
540
|
<TableCell>
|
|
581
541
|
<ToggleButton
|
|
582
|
-
{...
|
|
542
|
+
{...restArgs}
|
|
583
543
|
kind="ghost"
|
|
584
544
|
className="Mui-focusVisible"
|
|
585
545
|
value="focus"
|
|
586
|
-
onChange={() => handleChange(
|
|
546
|
+
onChange={() => handleChange('primary', 'focus')}
|
|
587
547
|
selected={values.primary.focus}
|
|
588
548
|
>
|
|
589
549
|
{args.children}
|
|
@@ -591,12 +551,12 @@ const GhostTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
|
591
551
|
</TableCell>
|
|
592
552
|
<TableCell>
|
|
593
553
|
<ToggleButton
|
|
594
|
-
{...
|
|
554
|
+
{...restArgs}
|
|
595
555
|
kind="ghost"
|
|
596
556
|
color="secondary"
|
|
597
557
|
className="Mui-focusVisible"
|
|
598
558
|
value="focus"
|
|
599
|
-
onChange={() => handleChange(
|
|
559
|
+
onChange={() => handleChange('secondary', 'focus')}
|
|
600
560
|
selected={values.secondary.focus}
|
|
601
561
|
>
|
|
602
562
|
{args.children}
|
|
@@ -604,24 +564,16 @@ const GhostTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
|
604
564
|
</TableCell>
|
|
605
565
|
</TableRow>
|
|
606
566
|
<TableRow>
|
|
607
|
-
<TableCell
|
|
608
|
-
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
609
|
-
>
|
|
567
|
+
<TableCell sx={{ typography: 'body2_14_regular', color: 'inherit' }}>
|
|
610
568
|
Disabled
|
|
611
569
|
</TableCell>
|
|
612
570
|
<TableCell>
|
|
613
|
-
<ToggleButton {...
|
|
571
|
+
<ToggleButton {...restArgs} kind="ghost" disabled value="disabled">
|
|
614
572
|
{args.children}
|
|
615
573
|
</ToggleButton>
|
|
616
574
|
</TableCell>
|
|
617
575
|
<TableCell>
|
|
618
|
-
<ToggleButton
|
|
619
|
-
{...args}
|
|
620
|
-
kind="ghost"
|
|
621
|
-
color="secondary"
|
|
622
|
-
disabled
|
|
623
|
-
value="disabled"
|
|
624
|
-
>
|
|
576
|
+
<ToggleButton {...restArgs} kind="ghost" color="secondary" disabled value="disabled">
|
|
625
577
|
{args.children}
|
|
626
578
|
</ToggleButton>
|
|
627
579
|
</TableCell>
|
|
@@ -636,7 +588,7 @@ const GhostTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
|
636
588
|
|
|
637
589
|
export const KindGhost = {
|
|
638
590
|
render: GhostTemplate,
|
|
639
|
-
name:
|
|
591
|
+
name: 'Kind: Ghost',
|
|
640
592
|
|
|
641
593
|
argTypes: {
|
|
642
594
|
color: {
|
|
@@ -645,10 +597,9 @@ export const KindGhost = {
|
|
|
645
597
|
},
|
|
646
598
|
};
|
|
647
599
|
|
|
648
|
-
const OutlinedTemplate: StoryFn<typeof ToggleButton> = ({
|
|
649
|
-
|
|
650
|
-
...restProps
|
|
651
|
-
}) => {
|
|
600
|
+
const OutlinedTemplate: StoryFn<typeof ToggleButton> = (args) => {
|
|
601
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
602
|
+
const { color, ...restProps } = args;
|
|
652
603
|
const [values, setValues] = useState({
|
|
653
604
|
primary: {
|
|
654
605
|
enable: false,
|
|
@@ -675,25 +626,22 @@ const OutlinedTemplate: StoryFn<typeof ToggleButton> = ({
|
|
|
675
626
|
<Table sx={{ width: 250 }}>
|
|
676
627
|
<TableHead>
|
|
677
628
|
<TableRow>
|
|
678
|
-
<TableCell
|
|
679
|
-
<TableCell sx={{ typography:
|
|
629
|
+
<TableCell />
|
|
630
|
+
<TableCell sx={{ typography: 'body2_14_medium', color: 'inherit' }}>
|
|
680
631
|
Outlined Primary
|
|
681
632
|
</TableCell>
|
|
682
633
|
</TableRow>
|
|
683
634
|
</TableHead>
|
|
684
635
|
<TableBody>
|
|
685
636
|
<TableRow>
|
|
686
|
-
<TableCell
|
|
687
|
-
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
688
|
-
>
|
|
689
|
-
Enable
|
|
690
|
-
</TableCell>
|
|
637
|
+
<TableCell sx={{ typography: 'body2_14_regular', color: 'inherit' }}>Enable</TableCell>
|
|
691
638
|
<TableCell>
|
|
692
639
|
<ToggleButton
|
|
693
640
|
{...restProps}
|
|
694
641
|
kind="outlined"
|
|
642
|
+
color="primary"
|
|
695
643
|
value="enable"
|
|
696
|
-
onChange={() => handleChange(
|
|
644
|
+
onChange={() => handleChange('primary', 'enable')}
|
|
697
645
|
selected={values.primary.enable}
|
|
698
646
|
>
|
|
699
647
|
Text
|
|
@@ -701,18 +649,15 @@ const OutlinedTemplate: StoryFn<typeof ToggleButton> = ({
|
|
|
701
649
|
</TableCell>
|
|
702
650
|
</TableRow>
|
|
703
651
|
<TableRow>
|
|
704
|
-
<TableCell
|
|
705
|
-
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
706
|
-
>
|
|
707
|
-
Hover
|
|
708
|
-
</TableCell>
|
|
652
|
+
<TableCell sx={{ typography: 'body2_14_regular', color: 'inherit' }}>Hover</TableCell>
|
|
709
653
|
<TableCell>
|
|
710
654
|
<ToggleButton
|
|
711
655
|
{...restProps}
|
|
712
656
|
id="hover1"
|
|
713
657
|
kind="outlined"
|
|
658
|
+
color="primary"
|
|
714
659
|
value="hover"
|
|
715
|
-
onChange={() => handleChange(
|
|
660
|
+
onChange={() => handleChange('primary', 'hover')}
|
|
716
661
|
selected={values.primary.hover}
|
|
717
662
|
>
|
|
718
663
|
Text
|
|
@@ -720,18 +665,15 @@ const OutlinedTemplate: StoryFn<typeof ToggleButton> = ({
|
|
|
720
665
|
</TableCell>
|
|
721
666
|
</TableRow>
|
|
722
667
|
<TableRow>
|
|
723
|
-
<TableCell
|
|
724
|
-
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
725
|
-
>
|
|
726
|
-
Focus
|
|
727
|
-
</TableCell>
|
|
668
|
+
<TableCell sx={{ typography: 'body2_14_regular', color: 'inherit' }}>Focus</TableCell>
|
|
728
669
|
<TableCell>
|
|
729
670
|
<ToggleButton
|
|
730
671
|
{...restProps}
|
|
731
672
|
kind="outlined"
|
|
673
|
+
color="primary"
|
|
732
674
|
className="Mui-focusVisible"
|
|
733
675
|
value="focus"
|
|
734
|
-
onChange={() => handleChange(
|
|
676
|
+
onChange={() => handleChange('primary', 'focus')}
|
|
735
677
|
selected={values.primary.focus}
|
|
736
678
|
>
|
|
737
679
|
Text
|
|
@@ -739,15 +681,14 @@ const OutlinedTemplate: StoryFn<typeof ToggleButton> = ({
|
|
|
739
681
|
</TableCell>
|
|
740
682
|
</TableRow>
|
|
741
683
|
<TableRow>
|
|
742
|
-
<TableCell
|
|
743
|
-
sx={{ typography: "body2_14_regular", color: "inherit" }}
|
|
744
|
-
>
|
|
684
|
+
<TableCell sx={{ typography: 'body2_14_regular', color: 'inherit' }}>
|
|
745
685
|
Disabled
|
|
746
686
|
</TableCell>
|
|
747
687
|
<TableCell>
|
|
748
688
|
<ToggleButton
|
|
749
689
|
{...restProps}
|
|
750
690
|
kind="outlined"
|
|
691
|
+
color="primary"
|
|
751
692
|
disabled
|
|
752
693
|
value="disabled"
|
|
753
694
|
>
|
|
@@ -763,7 +704,7 @@ const OutlinedTemplate: StoryFn<typeof ToggleButton> = ({
|
|
|
763
704
|
|
|
764
705
|
export const KindOutlined = {
|
|
765
706
|
render: OutlinedTemplate,
|
|
766
|
-
name:
|
|
707
|
+
name: 'Kind: Outlined',
|
|
767
708
|
|
|
768
709
|
argTypes: {
|
|
769
710
|
color: {
|