@lunit/design-system 1.0.0-b.4 → 2.0.0
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 +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/Dialog/index.js +2 -0
- package/dist/cjs/components/Dialog/index.js.map +1 -0
- package/dist/cjs/components/Radio/index.js +1 -1
- package/dist/cjs/components/Radio/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/ToggleButton/index.js +1 -1
- package/dist/cjs/components/ToggleButton/index.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/components/Button/Button.js +21 -3
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.styled.js +3 -6
- package/dist/components/Button/Button.styled.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +9 -19
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Chip/Chip.js +6 -5
- package/dist/components/Chip/Chip.js.map +1 -1
- package/dist/components/Dialog/Dialog.js +61 -0
- package/dist/components/Dialog/Dialog.js.map +1 -0
- package/dist/components/Dialog/Dialog.styled.js +137 -0
- package/dist/components/Dialog/Dialog.styled.js.map +1 -0
- package/dist/components/Dialog/components/DialogAction.js +18 -0
- package/dist/components/Dialog/components/DialogAction.js.map +1 -0
- package/dist/components/Dialog/index.js +2 -0
- package/dist/components/Dialog/index.js.map +1 -0
- package/dist/components/Radio/Radio.js +7 -21
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/TextField/TextField.js +4 -4
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.styled.js +2 -3
- package/dist/components/ToggleButton/ToggleButton.styled.js.map +1 -1
- package/dist/foundation/Elevation/index.js +1 -1
- package/dist/foundation/Elevation/index.js.map +1 -1
- package/dist/foundation/Typography/index.js +12 -0
- package/dist/foundation/Typography/index.js.map +1 -1
- package/dist/foundation/Typography/tokens.js +1 -17
- package/dist/foundation/Typography/tokens.js.map +1 -1
- package/dist/foundation/colors/base/grey.js +3 -1
- package/dist/foundation/colors/base/grey.js.map +1 -1
- package/dist/foundation/colors/index.js +9 -6
- package/dist/foundation/colors/index.js.map +1 -1
- package/dist/foundation/colors/token/component.js +31 -115
- package/dist/foundation/colors/token/component.js.map +1 -1
- package/dist/foundation/colors/token/core.js +43 -75
- package/dist/foundation/colors/token/core.js.map +1 -1
- package/dist/foundation/index.js +1 -1
- package/dist/foundation/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/components/Alert/Alert.utils.d.ts +3 -3
- package/dist/types/components/Button/Button.styled.d.ts +9 -12
- package/dist/types/components/Button/Button.types.d.ts +8 -5
- package/dist/types/components/Chip/Chip.styled.d.ts +12 -12
- package/dist/types/components/Chip/Chip.types.d.ts +7 -2
- package/dist/types/components/Dialog/Dialog.d.ts +50 -0
- package/dist/types/components/Dialog/Dialog.styled.d.ts +12 -0
- package/dist/types/components/Dialog/components/DialogAction.d.ts +8 -0
- package/dist/types/components/Dialog/index.d.ts +2 -0
- package/dist/types/components/TextField/TextField.types.d.ts +8 -3
- package/dist/types/components/Toast/Toast.utils.d.ts +1 -1
- package/dist/types/components/ToggleButton/ToggleButton.styled.d.ts +2 -2
- package/dist/types/foundation/Elevation/index.d.ts +1 -1
- package/dist/types/foundation/Typography/index.d.ts +13 -1
- package/dist/types/foundation/Typography/tokens.d.ts +1 -1
- package/dist/types/foundation/colors/base/grey.d.ts +2 -0
- package/dist/types/foundation/colors/index.d.ts +9 -6
- package/dist/types/foundation/colors/token/types.d.ts +0 -2
- package/dist/types/foundation/colors/types.d.ts +78 -76
- package/dist/types/foundation/index.d.ts +9 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Button/Button.styled.ts +3 -6
- package/src/components/Button/Button.tsx +117 -42
- package/src/components/Button/Button.types.ts +8 -4
- package/src/components/Checkbox/Checkbox.tsx +39 -22
- package/src/components/Chip/Chip.tsx +15 -4
- package/src/components/Chip/Chip.types.ts +9 -2
- package/src/components/Dialog/Dialog.styled.ts +165 -0
- package/src/components/Dialog/Dialog.tsx +195 -0
- package/src/components/Dialog/components/DialogAction.tsx +36 -0
- package/src/components/Dialog/index.ts +14 -0
- package/src/components/Radio/Radio.tsx +37 -25
- package/src/components/TextField/TextField.tsx +10 -10
- package/src/components/TextField/TextField.types.ts +11 -4
- package/src/components/ToggleButton/ToggleButton.styled.ts +2 -3
- package/src/foundation/Elevation/index.ts +1 -1
- package/src/foundation/Typography/index.ts +12 -0
- package/src/foundation/Typography/tokens.ts +1 -17
- package/src/foundation/colors/base/grey.ts +3 -1
- package/src/foundation/colors/index.ts +9 -6
- package/src/foundation/colors/token/component.ts +24 -108
- package/src/foundation/colors/token/core.ts +39 -71
- package/src/foundation/colors/token/types.ts +0 -2
- package/src/foundation/colors/types.ts +78 -75
- package/src/foundation/index.ts +1 -1
- package/src/index.ts +1 -1
- package/src/stories/GettingStarted.mdx +88 -0
- package/src/stories/components/Button/BasicButton.stories.tsx +91 -52
- package/src/stories/components/Button/ButtonDocs.mdx +187 -0
- package/src/stories/components/Button/Color.stories.tsx +132 -0
- package/src/stories/components/Button/IconButton.stories.tsx +42 -25
- package/src/stories/components/Button/Kind.stories.tsx +75 -77
- package/src/stories/components/{SelectControl/Checkbox.stories.tsx → CheckBox/BasicCheckbox.stories.tsx} +84 -105
- package/src/stories/components/CheckBox/CheckboxDocs.mdx +85 -0
- package/src/stories/components/Chip/Chip.stories.tsx +80 -5
- package/src/stories/components/Chip/ChipDocs.mdx +132 -0
- package/src/stories/components/Dialog/Dialog.stories.tsx +320 -0
- package/src/stories/components/TextField/BasicTextField.stories.tsx +214 -0
- package/src/stories/components/TextField/TextFieldDocs.mdx +140 -0
- package/src/stories/components/TextField/TextFieldSize.stories.tsx +26 -3
- package/src/stories/components/ToggleButton/Basic.stories.tsx +312 -0
- package/src/stories/components/ToggleButton/ToggleButtonDocs.mdx +180 -0
- package/src/stories/components/ToggleButton/ToggleButtonKind.stories.tsx +65 -0
- package/src/stories/components/ToggleButton/WithIcon.stories.tsx +138 -0
- package/src/stories/foundation/Typography/Typography.mdx +31 -46
- package/src/stories/foundation/Typography/Typography.stories.tsx +30 -1
- package/src/stories/foundation/colors/ColorSystem.tsx +86 -0
- package/src/stories/foundation/colors/Docs.mdx +225 -0
- package/src/stories/foundation/colors/TokenPaletteTable.tsx +1 -5
- package/src/components/Modal/Modal.tsx +0 -8
- package/src/components/Modal/index.ts +0 -1
- package/src/stories/components/Modal/Modal.stories.tsx +0 -15
- package/src/stories/foundation/Typography/TypographyExamples.stories.tsx +0 -44
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Box } from "@mui/material";
|
|
3
|
+
import { action } from "@storybook/addon-actions";
|
|
4
|
+
|
|
5
|
+
import Button from "@/components/Button";
|
|
6
|
+
|
|
7
|
+
import type { StoryFn, Meta } from "@storybook/react";
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: "Components/Button",
|
|
11
|
+
component: Button,
|
|
12
|
+
args: {
|
|
13
|
+
children: "Text",
|
|
14
|
+
disabled: false,
|
|
15
|
+
size: "small",
|
|
16
|
+
onClick: action("onClick"),
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
children: {
|
|
20
|
+
type: "string",
|
|
21
|
+
},
|
|
22
|
+
disabled: {
|
|
23
|
+
control: {
|
|
24
|
+
type: "boolean",
|
|
25
|
+
},
|
|
26
|
+
table: {
|
|
27
|
+
defaultValue: { summary: "false" },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
size: {
|
|
31
|
+
control: {
|
|
32
|
+
type: "radio",
|
|
33
|
+
},
|
|
34
|
+
options: ["small", "medium", "large"],
|
|
35
|
+
table: {
|
|
36
|
+
defaultValue: { summary: "small" },
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
onClick: {
|
|
40
|
+
type: "function",
|
|
41
|
+
control: {
|
|
42
|
+
type: "radio",
|
|
43
|
+
},
|
|
44
|
+
options: ["function", undefined],
|
|
45
|
+
mapping: {
|
|
46
|
+
function: action("onClick"),
|
|
47
|
+
undefined: undefined,
|
|
48
|
+
},
|
|
49
|
+
description:
|
|
50
|
+
"It is a callback function that is called when the button is clicked.",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
parameters: {
|
|
54
|
+
controls: {
|
|
55
|
+
include: ["onClick", "children", "size", "disabled", "kind", "variant"],
|
|
56
|
+
},
|
|
57
|
+
pseudo: {
|
|
58
|
+
hover: [
|
|
59
|
+
"#hover1",
|
|
60
|
+
"#hover2",
|
|
61
|
+
"#hover3",
|
|
62
|
+
"#hover4",
|
|
63
|
+
"#hover5",
|
|
64
|
+
"#hover6",
|
|
65
|
+
"#hover7",
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
docs: {
|
|
69
|
+
description: {
|
|
70
|
+
component: `It is a kind Button docs. For more details, please
|
|
71
|
+
see [Material-UI Button](https://mui.com/material-ui/react-button/).`,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
} as Meta<typeof Button>;
|
|
76
|
+
|
|
77
|
+
const ColorButtonTemplate: StoryFn<typeof Button> = (args) => {
|
|
78
|
+
const { children, kind, variant, ...restArgs } = args;
|
|
79
|
+
return (
|
|
80
|
+
<Box sx={{ display: "flex", flexDirection: "column", gap: 4 }}>
|
|
81
|
+
<Box>
|
|
82
|
+
<Button
|
|
83
|
+
sx={{ mr: 2 }}
|
|
84
|
+
{...restArgs}
|
|
85
|
+
variant="contained"
|
|
86
|
+
color="primary"
|
|
87
|
+
>
|
|
88
|
+
{children}
|
|
89
|
+
</Button>
|
|
90
|
+
<Button
|
|
91
|
+
sx={{ mr: 2 }}
|
|
92
|
+
{...restArgs}
|
|
93
|
+
variant="contained"
|
|
94
|
+
color="secondary"
|
|
95
|
+
>
|
|
96
|
+
{children}
|
|
97
|
+
</Button>
|
|
98
|
+
<Button {...restArgs} variant="contained" color="error">
|
|
99
|
+
{children}
|
|
100
|
+
</Button>
|
|
101
|
+
</Box>
|
|
102
|
+
<Box>
|
|
103
|
+
<Button sx={{ mr: 2 }} {...restArgs} variant="outlined" color="primary">
|
|
104
|
+
{children}
|
|
105
|
+
</Button>
|
|
106
|
+
<Button
|
|
107
|
+
sx={{ mr: 2 }}
|
|
108
|
+
{...restArgs}
|
|
109
|
+
variant="outlined"
|
|
110
|
+
color="secondary"
|
|
111
|
+
>
|
|
112
|
+
{children}
|
|
113
|
+
</Button>
|
|
114
|
+
</Box>
|
|
115
|
+
<Box>
|
|
116
|
+
<Button sx={{ mr: 2 }} {...restArgs} variant="text" color="primary">
|
|
117
|
+
{children}
|
|
118
|
+
</Button>
|
|
119
|
+
<Button sx={{ mr: 2 }} {...restArgs} variant="text" color="secondary">
|
|
120
|
+
{children}
|
|
121
|
+
</Button>
|
|
122
|
+
<Button {...restArgs} variant="text" color="error">
|
|
123
|
+
{children}
|
|
124
|
+
</Button>
|
|
125
|
+
</Box>
|
|
126
|
+
</Box>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export const Color = {
|
|
131
|
+
render: ColorButtonTemplate,
|
|
132
|
+
};
|
|
@@ -5,12 +5,12 @@ import { action } from "@storybook/addon-actions";
|
|
|
5
5
|
import Button from "@/components/Button";
|
|
6
6
|
|
|
7
7
|
import type { StoryFn, Meta } from "@storybook/react";
|
|
8
|
+
import { Box } from "@mui/material";
|
|
8
9
|
|
|
9
10
|
export default {
|
|
10
11
|
title: "Components/Button",
|
|
11
12
|
component: Button,
|
|
12
13
|
args: {
|
|
13
|
-
kind: "contained",
|
|
14
14
|
color: "primary",
|
|
15
15
|
disabled: false,
|
|
16
16
|
size: "small",
|
|
@@ -26,16 +26,6 @@ export default {
|
|
|
26
26
|
type: { summary: "React.ReactNode" },
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
|
-
kind: {
|
|
30
|
-
control: {
|
|
31
|
-
type: "radio",
|
|
32
|
-
},
|
|
33
|
-
options: ["contained", "outlined", "ghost"],
|
|
34
|
-
description: "Button has three Kinds Contained, Outlined, Ghost",
|
|
35
|
-
table: {
|
|
36
|
-
defaultValue: { summary: "contained" },
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
29
|
color: {
|
|
40
30
|
control: {
|
|
41
31
|
type: "radio",
|
|
@@ -79,12 +69,12 @@ export default {
|
|
|
79
69
|
parameters: {
|
|
80
70
|
controls: {
|
|
81
71
|
include: [
|
|
82
|
-
"children",
|
|
83
72
|
"icon",
|
|
84
73
|
"onClick",
|
|
85
74
|
"disabled",
|
|
86
75
|
"size",
|
|
87
76
|
"kind",
|
|
77
|
+
"variant",
|
|
88
78
|
"color",
|
|
89
79
|
],
|
|
90
80
|
},
|
|
@@ -97,15 +87,48 @@ export default {
|
|
|
97
87
|
},
|
|
98
88
|
} as Meta<typeof Button>;
|
|
99
89
|
|
|
100
|
-
const IconButtonTemplate: StoryFn<typeof Button> = (args) =>
|
|
101
|
-
|
|
102
|
-
{args.children}
|
|
103
|
-
</Button>
|
|
104
|
-
);
|
|
90
|
+
const IconButtonTemplate: StoryFn<typeof Button> = (args) => {
|
|
91
|
+
const { variant, kind, ...restArgs } = args;
|
|
105
92
|
|
|
106
|
-
|
|
107
|
-
|
|
93
|
+
return (
|
|
94
|
+
<Box sx={{ display: "flex", gap: 2 }}>
|
|
95
|
+
<Button icon={<Bell />} {...restArgs} kind="contained">
|
|
96
|
+
Contained
|
|
97
|
+
</Button>
|
|
98
|
+
<Button
|
|
99
|
+
icon={<Bell />}
|
|
100
|
+
{...restArgs}
|
|
101
|
+
color={args.color === "error" ? "primary" : args.color}
|
|
102
|
+
kind="outlined"
|
|
103
|
+
>
|
|
104
|
+
Outlined
|
|
105
|
+
</Button>
|
|
106
|
+
<Button icon={<Bell />} {...restArgs} kind="ghost">
|
|
107
|
+
Ghost
|
|
108
|
+
</Button>
|
|
109
|
+
</Box>
|
|
110
|
+
);
|
|
111
|
+
};
|
|
108
112
|
|
|
113
|
+
const IconOnlyButtonTemplate: StoryFn<typeof Button> = (args) => {
|
|
114
|
+
const { variant, kind, ...restArgs } = args;
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<Box sx={{ display: "flex", gap: 2 }}>
|
|
118
|
+
<Button icon={<Bell />} {...restArgs} kind="contained" />
|
|
119
|
+
<Button
|
|
120
|
+
icon={<Bell />}
|
|
121
|
+
{...restArgs}
|
|
122
|
+
color={args.color === "error" ? "primary" : args.color}
|
|
123
|
+
kind="outlined"
|
|
124
|
+
/>
|
|
125
|
+
<Button icon={<Bell />} {...restArgs} kind="ghost" />
|
|
126
|
+
</Box>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export const IconOnlyButton = {
|
|
131
|
+
render: IconOnlyButtonTemplate,
|
|
109
132
|
argTypes: {
|
|
110
133
|
children: {
|
|
111
134
|
control: false,
|
|
@@ -115,17 +138,11 @@ export const IconOnlyButton = {
|
|
|
115
138
|
},
|
|
116
139
|
},
|
|
117
140
|
},
|
|
118
|
-
|
|
119
141
|
name: "Icon only",
|
|
120
142
|
};
|
|
121
143
|
|
|
122
144
|
export const IconWithTextButton = {
|
|
123
145
|
render: IconButtonTemplate,
|
|
124
|
-
|
|
125
|
-
args: {
|
|
126
|
-
children: "Text",
|
|
127
|
-
},
|
|
128
|
-
|
|
129
146
|
argTypes: {
|
|
130
147
|
children: {
|
|
131
148
|
type: "string",
|
|
@@ -20,7 +20,10 @@ export default {
|
|
|
20
20
|
children: "Text",
|
|
21
21
|
disabled: false,
|
|
22
22
|
size: "small",
|
|
23
|
-
onClick:
|
|
23
|
+
onClick: () => {
|
|
24
|
+
action("onClick")();
|
|
25
|
+
console.log("onClick");
|
|
26
|
+
},
|
|
24
27
|
},
|
|
25
28
|
argTypes: {
|
|
26
29
|
children: {
|
|
@@ -64,10 +67,28 @@ export default {
|
|
|
64
67
|
defaultValue: { summary: "contained" },
|
|
65
68
|
},
|
|
66
69
|
},
|
|
70
|
+
variant: {
|
|
71
|
+
control: {
|
|
72
|
+
type: "radio",
|
|
73
|
+
},
|
|
74
|
+
options: ["contained", "outlined", "text", "ghost"],
|
|
75
|
+
description: "The variant is alias of kind.",
|
|
76
|
+
table: {
|
|
77
|
+
defaultValue: { summary: "contained" },
|
|
78
|
+
},
|
|
79
|
+
},
|
|
67
80
|
},
|
|
68
81
|
parameters: {
|
|
69
82
|
controls: {
|
|
70
|
-
include: [
|
|
83
|
+
include: [
|
|
84
|
+
"onClick",
|
|
85
|
+
"children",
|
|
86
|
+
"color",
|
|
87
|
+
"size",
|
|
88
|
+
"disabled",
|
|
89
|
+
"kind",
|
|
90
|
+
"variant",
|
|
91
|
+
],
|
|
71
92
|
},
|
|
72
93
|
pseudo: {
|
|
73
94
|
hover: [
|
|
@@ -92,62 +113,21 @@ export default {
|
|
|
92
113
|
const ButtonTemplate: StoryFn<typeof Button> = ({
|
|
93
114
|
kind,
|
|
94
115
|
color,
|
|
116
|
+
variant,
|
|
95
117
|
children,
|
|
96
118
|
...restProps
|
|
97
119
|
}) => {
|
|
98
120
|
return (
|
|
99
121
|
<>
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
>
|
|
110
|
-
Kind
|
|
111
|
-
</TableCell>
|
|
112
|
-
</TableRow>
|
|
113
|
-
<TableRow>
|
|
114
|
-
<TableCell
|
|
115
|
-
sx={{
|
|
116
|
-
width: "33.33333%",
|
|
117
|
-
typography: "body2_14_medium",
|
|
118
|
-
color: "inherit",
|
|
119
|
-
}}
|
|
120
|
-
>
|
|
121
|
-
Contained(default)
|
|
122
|
-
</TableCell>
|
|
123
|
-
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
124
|
-
Outlined
|
|
125
|
-
</TableCell>
|
|
126
|
-
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
127
|
-
Ghost
|
|
128
|
-
</TableCell>
|
|
129
|
-
</TableRow>
|
|
130
|
-
</TableHead>
|
|
131
|
-
<TableBody>
|
|
132
|
-
<TableRow>
|
|
133
|
-
<TableCell>
|
|
134
|
-
<Button color={color} {...restProps}>
|
|
135
|
-
{children}
|
|
136
|
-
</Button>
|
|
137
|
-
</TableCell>
|
|
138
|
-
<TableCell>
|
|
139
|
-
<Button kind="outlined" color="primary" {...restProps}>
|
|
140
|
-
{children}
|
|
141
|
-
</Button>
|
|
142
|
-
</TableCell>
|
|
143
|
-
<TableCell>
|
|
144
|
-
<Button kind="ghost" color={color} {...restProps}>
|
|
145
|
-
{children}
|
|
146
|
-
</Button>
|
|
147
|
-
</TableCell>
|
|
148
|
-
</TableRow>
|
|
149
|
-
</TableBody>
|
|
150
|
-
</Table>
|
|
122
|
+
<Button color={color} {...restProps} sx={{ mr: 2 }}>
|
|
123
|
+
{children}
|
|
124
|
+
</Button>
|
|
125
|
+
<Button kind="outlined" color="primary" {...restProps} sx={{ mr: 2 }}>
|
|
126
|
+
{children}
|
|
127
|
+
</Button>
|
|
128
|
+
<Button kind="ghost" color={color} {...restProps}>
|
|
129
|
+
{children}
|
|
130
|
+
</Button>
|
|
151
131
|
</>
|
|
152
132
|
);
|
|
153
133
|
};
|
|
@@ -157,6 +137,7 @@ export const Kind = {
|
|
|
157
137
|
};
|
|
158
138
|
|
|
159
139
|
const ContainedButtonTemplate: StoryFn<typeof Button> = (args) => {
|
|
140
|
+
const { kind, variant, ...restProps } = args;
|
|
160
141
|
return (
|
|
161
142
|
<>
|
|
162
143
|
<Table sx={{ width: 650 }}>
|
|
@@ -182,17 +163,17 @@ const ContainedButtonTemplate: StoryFn<typeof Button> = (args) => {
|
|
|
182
163
|
Enable
|
|
183
164
|
</TableCell>
|
|
184
165
|
<TableCell>
|
|
185
|
-
<Button {...
|
|
166
|
+
<Button {...restProps} kind="contained">
|
|
186
167
|
{args.children}
|
|
187
168
|
</Button>
|
|
188
169
|
</TableCell>
|
|
189
170
|
<TableCell>
|
|
190
|
-
<Button {...
|
|
171
|
+
<Button {...restProps} kind="contained" color="secondary">
|
|
191
172
|
{args.children}
|
|
192
173
|
</Button>
|
|
193
174
|
</TableCell>
|
|
194
175
|
<TableCell>
|
|
195
|
-
<Button {...
|
|
176
|
+
<Button {...restProps} kind="contained" color="error">
|
|
196
177
|
{args.children}
|
|
197
178
|
</Button>
|
|
198
179
|
</TableCell>
|
|
@@ -204,17 +185,22 @@ const ContainedButtonTemplate: StoryFn<typeof Button> = (args) => {
|
|
|
204
185
|
Hover
|
|
205
186
|
</TableCell>
|
|
206
187
|
<TableCell>
|
|
207
|
-
<Button {...
|
|
188
|
+
<Button {...restProps} id="hover1" kind="contained">
|
|
208
189
|
{args.children}
|
|
209
190
|
</Button>
|
|
210
191
|
</TableCell>
|
|
211
192
|
<TableCell>
|
|
212
|
-
<Button
|
|
193
|
+
<Button
|
|
194
|
+
{...restProps}
|
|
195
|
+
id="hover2"
|
|
196
|
+
kind="contained"
|
|
197
|
+
color="secondary"
|
|
198
|
+
>
|
|
213
199
|
{args.children}
|
|
214
200
|
</Button>
|
|
215
201
|
</TableCell>
|
|
216
202
|
<TableCell>
|
|
217
|
-
<Button {...
|
|
203
|
+
<Button {...restProps} id="hover3" kind="contained" color="error">
|
|
218
204
|
{args.children}
|
|
219
205
|
</Button>
|
|
220
206
|
</TableCell>
|
|
@@ -226,13 +212,17 @@ const ContainedButtonTemplate: StoryFn<typeof Button> = (args) => {
|
|
|
226
212
|
Focus
|
|
227
213
|
</TableCell>
|
|
228
214
|
<TableCell>
|
|
229
|
-
<Button
|
|
215
|
+
<Button
|
|
216
|
+
{...restProps}
|
|
217
|
+
kind="contained"
|
|
218
|
+
className="Mui-focusVisible"
|
|
219
|
+
>
|
|
230
220
|
{args.children}
|
|
231
221
|
</Button>
|
|
232
222
|
</TableCell>
|
|
233
223
|
<TableCell>
|
|
234
224
|
<Button
|
|
235
|
-
{...
|
|
225
|
+
{...restProps}
|
|
236
226
|
kind="contained"
|
|
237
227
|
color="secondary"
|
|
238
228
|
className="Mui-focusVisible"
|
|
@@ -242,7 +232,7 @@ const ContainedButtonTemplate: StoryFn<typeof Button> = (args) => {
|
|
|
242
232
|
</TableCell>
|
|
243
233
|
<TableCell>
|
|
244
234
|
<Button
|
|
245
|
-
{...
|
|
235
|
+
{...restProps}
|
|
246
236
|
kind="contained"
|
|
247
237
|
color="error"
|
|
248
238
|
className="Mui-focusVisible"
|
|
@@ -258,17 +248,22 @@ const ContainedButtonTemplate: StoryFn<typeof Button> = (args) => {
|
|
|
258
248
|
Disabled
|
|
259
249
|
</TableCell>
|
|
260
250
|
<TableCell>
|
|
261
|
-
<Button {...
|
|
251
|
+
<Button {...restProps} kind="contained" disabled>
|
|
262
252
|
{args.children}
|
|
263
253
|
</Button>
|
|
264
254
|
</TableCell>
|
|
265
255
|
<TableCell>
|
|
266
|
-
<Button
|
|
256
|
+
<Button
|
|
257
|
+
{...restProps}
|
|
258
|
+
kind="contained"
|
|
259
|
+
color="secondary"
|
|
260
|
+
disabled
|
|
261
|
+
>
|
|
267
262
|
{args.children}
|
|
268
263
|
</Button>
|
|
269
264
|
</TableCell>
|
|
270
265
|
<TableCell>
|
|
271
|
-
<Button {...
|
|
266
|
+
<Button {...restProps} kind="contained" color="error" disabled>
|
|
272
267
|
{args.children}
|
|
273
268
|
</Button>
|
|
274
269
|
</TableCell>
|
|
@@ -300,6 +295,7 @@ export const KindContained = {
|
|
|
300
295
|
};
|
|
301
296
|
|
|
302
297
|
const GhostButtonTemplate: StoryFn<typeof Button> = (args) => {
|
|
298
|
+
const { kind, variant, ...restProps } = args;
|
|
303
299
|
return (
|
|
304
300
|
<>
|
|
305
301
|
<Table sx={{ width: 650 }}>
|
|
@@ -325,17 +321,17 @@ const GhostButtonTemplate: StoryFn<typeof Button> = (args) => {
|
|
|
325
321
|
Enable
|
|
326
322
|
</TableCell>
|
|
327
323
|
<TableCell>
|
|
328
|
-
<Button {...
|
|
324
|
+
<Button {...restProps} kind="ghost">
|
|
329
325
|
{args.children}
|
|
330
326
|
</Button>
|
|
331
327
|
</TableCell>
|
|
332
328
|
<TableCell>
|
|
333
|
-
<Button {...
|
|
329
|
+
<Button {...restProps} kind="ghost" color="secondary">
|
|
334
330
|
{args.children}
|
|
335
331
|
</Button>
|
|
336
332
|
</TableCell>
|
|
337
333
|
<TableCell>
|
|
338
|
-
<Button {...
|
|
334
|
+
<Button {...restProps} kind="ghost" color="error">
|
|
339
335
|
{args.children}
|
|
340
336
|
</Button>
|
|
341
337
|
</TableCell>
|
|
@@ -347,17 +343,17 @@ const GhostButtonTemplate: StoryFn<typeof Button> = (args) => {
|
|
|
347
343
|
Hover
|
|
348
344
|
</TableCell>
|
|
349
345
|
<TableCell>
|
|
350
|
-
<Button {...
|
|
346
|
+
<Button {...restProps} id="hover4" kind="ghost">
|
|
351
347
|
{args.children}
|
|
352
348
|
</Button>
|
|
353
349
|
</TableCell>
|
|
354
350
|
<TableCell>
|
|
355
|
-
<Button {...
|
|
351
|
+
<Button {...restProps} id="hover5" kind="ghost" color="secondary">
|
|
356
352
|
{args.children}
|
|
357
353
|
</Button>
|
|
358
354
|
</TableCell>
|
|
359
355
|
<TableCell>
|
|
360
|
-
<Button {...
|
|
356
|
+
<Button {...restProps} id="hover6" kind="ghost" color="error">
|
|
361
357
|
{args.children}
|
|
362
358
|
</Button>
|
|
363
359
|
</TableCell>
|
|
@@ -369,13 +365,13 @@ const GhostButtonTemplate: StoryFn<typeof Button> = (args) => {
|
|
|
369
365
|
Focus
|
|
370
366
|
</TableCell>
|
|
371
367
|
<TableCell>
|
|
372
|
-
<Button {...
|
|
368
|
+
<Button {...restProps} kind="ghost" className="Mui-focusVisible">
|
|
373
369
|
{args.children}
|
|
374
370
|
</Button>
|
|
375
371
|
</TableCell>
|
|
376
372
|
<TableCell>
|
|
377
373
|
<Button
|
|
378
|
-
{...
|
|
374
|
+
{...restProps}
|
|
379
375
|
kind="ghost"
|
|
380
376
|
color="secondary"
|
|
381
377
|
className="Mui-focusVisible"
|
|
@@ -385,7 +381,7 @@ const GhostButtonTemplate: StoryFn<typeof Button> = (args) => {
|
|
|
385
381
|
</TableCell>
|
|
386
382
|
<TableCell>
|
|
387
383
|
<Button
|
|
388
|
-
{...
|
|
384
|
+
{...restProps}
|
|
389
385
|
kind="ghost"
|
|
390
386
|
color="error"
|
|
391
387
|
className="Mui-focusVisible"
|
|
@@ -401,17 +397,17 @@ const GhostButtonTemplate: StoryFn<typeof Button> = (args) => {
|
|
|
401
397
|
Disabled
|
|
402
398
|
</TableCell>
|
|
403
399
|
<TableCell>
|
|
404
|
-
<Button {...
|
|
400
|
+
<Button {...restProps} kind="ghost" disabled>
|
|
405
401
|
{args.children}
|
|
406
402
|
</Button>
|
|
407
403
|
</TableCell>
|
|
408
404
|
<TableCell>
|
|
409
|
-
<Button {...
|
|
405
|
+
<Button {...restProps} kind="ghost" color="secondary" disabled>
|
|
410
406
|
{args.children}
|
|
411
407
|
</Button>
|
|
412
408
|
</TableCell>
|
|
413
409
|
<TableCell>
|
|
414
|
-
<Button {...
|
|
410
|
+
<Button {...restProps} kind="ghost" color="error" disabled>
|
|
415
411
|
{args.children}
|
|
416
412
|
</Button>
|
|
417
413
|
</TableCell>
|
|
@@ -445,6 +441,8 @@ export const KindGhost = {
|
|
|
445
441
|
};
|
|
446
442
|
|
|
447
443
|
const OutlinedButtonTemplate: StoryFn<typeof Button> = ({
|
|
444
|
+
kind,
|
|
445
|
+
variant,
|
|
448
446
|
color,
|
|
449
447
|
...restProps
|
|
450
448
|
}) => {
|