@lunit/design-system 1.0.0-a.2 → 1.0.0-a.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc.json +16 -0
- package/dist/cjs/components/Alert/index.js +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/Chip/index.js +1 -1
- package/dist/cjs/components/Chip/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/Alert/Alert.js +20 -4
- package/dist/components/Alert/Alert.js.map +1 -1
- package/dist/components/Alert/Alert.styled.js +49 -0
- package/dist/components/Alert/Alert.styled.js.map +1 -0
- package/dist/components/Alert/Alert.types.js +2 -0
- package/dist/components/Alert/Alert.types.js.map +1 -0
- package/dist/components/Alert/Alert.utils.js +37 -0
- package/dist/components/Alert/Alert.utils.js.map +1 -0
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.styled.js +31 -21
- package/dist/components/Button/Button.styled.js.map +1 -1
- package/dist/components/Button/utils/getHoverStyle.js +7 -0
- package/dist/components/Button/utils/getHoverStyle.js.map +1 -0
- package/dist/components/Chip/Chip.js +1 -1
- package/dist/components/Chip/Chip.js.map +1 -1
- package/dist/components/Chip/Chip.styled.js +2 -3
- package/dist/components/Chip/Chip.styled.js.map +1 -1
- package/dist/components/TextField/TextField.js +15 -3
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/TextField/TextField.style.js +245 -0
- package/dist/components/TextField/TextField.style.js.map +1 -0
- package/dist/components/TextField/TextField.types.js +2 -0
- package/dist/components/TextField/TextField.types.js.map +1 -0
- package/dist/components/TextField/TextFieldIcon.js +7 -0
- package/dist/components/TextField/TextFieldIcon.js.map +1 -0
- package/dist/components/Toast/Toast.js +26 -0
- package/dist/components/Toast/Toast.js.map +1 -0
- package/dist/components/Toast/Toast.styled.js +49 -0
- package/dist/components/Toast/Toast.styled.js.map +1 -0
- package/dist/components/Toast/Toast.types.js +2 -0
- package/dist/components/Toast/Toast.types.js.map +1 -0
- package/dist/components/Toast/Toast.utils.js +13 -0
- package/dist/components/Toast/Toast.utils.js.map +1 -0
- package/dist/components/Toast/index.js +2 -0
- package/dist/components/Toast/index.js.map +1 -0
- package/dist/foundation/colors/base/grey.js +16 -0
- package/dist/foundation/colors/base/grey.js.map +1 -1
- package/dist/foundation/colors/base/lunitGreen.js +2 -2
- package/dist/foundation/colors/base/lunitGreen.js.map +1 -1
- package/dist/foundation/colors/base/lunitTeal.js +5 -5
- package/dist/foundation/colors/base/lunitTeal.js.map +1 -1
- package/dist/foundation/colors/base/red.js +2 -2
- package/dist/foundation/colors/index.js +24 -4
- package/dist/foundation/colors/index.js.map +1 -1
- package/dist/foundation/colors/token/component.js +265 -291
- package/dist/foundation/colors/token/component.js.map +1 -1
- package/dist/foundation/colors/token/core.js +132 -125
- package/dist/foundation/colors/token/core.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/theme.js +5 -0
- package/dist/theme.js.map +1 -1
- package/dist/types/components/Alert/Alert.d.ts +3 -1
- package/dist/types/components/Alert/Alert.styled.d.ts +6 -0
- package/dist/types/components/Alert/Alert.types.d.ts +9 -0
- package/dist/types/components/Alert/Alert.utils.d.ts +4 -0
- package/dist/types/components/Button/Button.d.ts +1 -1
- package/dist/types/components/Button/Button.styled.d.ts +26 -2
- package/dist/types/components/Button/Button.types.d.ts +4 -4
- package/dist/types/components/Button/utils/getHoverStyle.d.ts +6 -0
- package/dist/types/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/types/components/Chip/Chip.d.ts +1 -1
- package/dist/types/components/Chip/Chip.styled.d.ts +13 -13
- package/dist/types/components/Chip/Chip.types.d.ts +1 -1
- package/dist/types/components/DataTable/DataTable.d.ts +1 -1
- package/dist/types/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/types/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/types/components/FormLabel/FormLabel.d.ts +1 -1
- package/dist/types/components/Modal/Modal.d.ts +1 -1
- package/dist/types/components/Radio/Radio.d.ts +1 -1
- package/dist/types/components/TextField/TextField.d.ts +2 -1
- package/dist/types/components/TextField/TextField.style.d.ts +9 -0
- package/dist/types/components/TextField/TextField.types.d.ts +29 -0
- package/dist/types/components/TextField/TextFieldIcon.d.ts +8 -0
- package/dist/types/components/TextField/index.d.ts +1 -0
- package/dist/types/components/Toast/Toast.d.ts +4 -0
- package/dist/types/components/Toast/Toast.styled.d.ts +1 -0
- package/dist/types/components/Toast/Toast.types.d.ts +4 -0
- package/dist/types/components/Toast/Toast.utils.d.ts +2 -0
- package/dist/types/components/Toast/index.d.ts +1 -0
- package/dist/types/components/Toggle/Toggle.d.ts +1 -1
- package/dist/types/components/ToggleButton/ToggleButton.d.ts +1 -1
- package/dist/types/components/ToggleButton/ToggleButton.styled.d.ts +2 -2
- package/dist/types/components/ToggleButton/ToggleButton.types.d.ts +4 -4
- package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +1 -1
- package/dist/types/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/types/foundation/colors/base/grey.d.ts +16 -0
- package/dist/types/foundation/colors/base/lunitGreen.d.ts +2 -2
- package/dist/types/foundation/colors/base/lunitTeal.d.ts +2 -2
- package/dist/types/foundation/colors/index.d.ts +42 -9
- package/dist/types/foundation/colors/types.d.ts +1 -3
- package/dist/types/foundation/index.d.ts +37 -5
- package/dist/types/index.d.ts +1 -0
- package/package.json +21 -16
- package/src/components/Alert/Alert.styled.ts +63 -0
- package/src/components/Alert/Alert.tsx +47 -5
- package/src/components/Alert/Alert.types.ts +10 -0
- package/src/components/Alert/Alert.utils.ts +49 -0
- package/src/components/Button/Button.styled.ts +33 -21
- package/src/components/Button/Button.tsx +1 -5
- package/src/components/Button/Button.types.ts +4 -4
- package/src/components/Button/utils/getHoverStyle.ts +7 -0
- package/src/components/Chip/Chip.styled.ts +6 -4
- package/src/components/Chip/Chip.tsx +1 -1
- package/src/components/Chip/Chip.types.ts +2 -2
- package/src/components/TextField/TextField.style.ts +316 -0
- package/src/components/TextField/TextField.tsx +75 -3
- package/src/components/TextField/TextField.types.ts +38 -0
- package/src/components/TextField/TextFieldIcon.tsx +24 -0
- package/src/components/TextField/index.ts +6 -0
- package/src/components/Toast/Toast.styled.ts +49 -0
- package/src/components/Toast/Toast.tsx +66 -0
- package/src/components/Toast/Toast.types.ts +14 -0
- package/src/components/Toast/Toast.utils.ts +17 -0
- package/src/components/Toast/index.tsx +1 -0
- package/src/components/ToggleButton/ToggleButton.types.ts +4 -7
- package/src/foundation/colors/base/grey.ts +17 -0
- package/src/foundation/colors/base/lunitGreen.ts +2 -2
- package/src/foundation/colors/base/lunitTeal.ts +5 -5
- package/src/foundation/colors/base/red.ts +2 -2
- package/src/foundation/colors/index.ts +29 -8
- package/src/foundation/colors/token/component.ts +300 -326
- package/src/foundation/colors/token/core.ts +152 -145
- package/src/foundation/colors/types.ts +1 -3
- package/src/index.ts +1 -0
- package/src/stories/components/Alert/Alert.stories.tsx +148 -4
- package/src/stories/components/Button/BasicButton.stories.tsx +19 -28
- package/src/stories/components/Button/IconButton.stories.tsx +39 -28
- package/src/stories/components/Button/Kind.stories.tsx +83 -57
- package/src/stories/components/Chip/Chip.stories.tsx +94 -82
- package/src/stories/components/DataTable/DataTable.stories.tsx +6 -4
- package/src/stories/components/DatePicker/DatePicker.stories.tsx +6 -4
- package/src/stories/components/Dropdown/Dropdown.stories.tsx +12 -6
- package/src/stories/components/Modal/Modal.stories.tsx +6 -4
- package/src/stories/components/SelectControl/Checkbox.stories.tsx +31 -23
- package/src/stories/components/SelectControl/RadioGroup.stories.tsx +6 -5
- package/src/stories/components/SelectControl/RadioStatus.stories.tsx +6 -4
- package/src/stories/components/SelectControl/Toggle.stories.tsx +33 -19
- package/src/stories/components/TextField/TextFieldMulti.stories.tsx +137 -0
- package/src/stories/components/TextField/TextFieldSingle.stories.tsx +283 -0
- package/src/stories/components/TextField/TextFieldSize.stories.tsx +134 -0
- package/src/stories/components/Toast/Toast.stories.tsx +152 -0
- package/src/stories/components/ToggleButton/Basic.stories.tsx +35 -31
- package/src/stories/components/ToggleButton/Group.stories.tsx +21 -21
- package/src/stories/components/ToggleButton/ToggleButtonKind.stories.tsx +53 -43
- package/src/stories/components/ToggleButton/WithIcon.stories.tsx +35 -36
- package/src/stories/components/Tooltip/Tooltip.stories.tsx +6 -4
- package/src/stories/foundation/Elevation/Elevation.stories.tsx +10 -6
- package/src/stories/foundation/Typography/{Typography.stories.mdx → Typography.mdx} +10 -5
- package/src/stories/foundation/Typography/Typography.stories.tsx +46 -36
- package/src/stories/foundation/Typography/TypographyExamples.stories.tsx +44 -0
- package/src/stories/foundation/colors/Colors.stories.tsx +7 -5
- package/src/stories/foundation/colors/Mui.stories.tsx +18 -0
- package/src/stories/foundation/colors/Token.inComponent.stories.tsx +2 -2
- package/src/stories/foundation/colors/TokenPaletteTable.stories.tsx +28 -0
- package/src/stories/foundation/colors/TokenPaletteTable.tsx +127 -0
- package/src/theme.ts +5 -0
- package/src/stories/components/TextField/TextField.stories.tsx +0 -13
- package/src/stories/foundation/colors/Token.stories.tsx +0 -190
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
2
|
+
import Bell from "@lunit/design-system-icons/Bell";
|
|
3
3
|
import { action } from "@storybook/addon-actions";
|
|
4
4
|
|
|
5
5
|
import Button from "@/components/Button";
|
|
6
6
|
|
|
7
|
-
import type {
|
|
7
|
+
import type { StoryFn, Meta } from "@storybook/react";
|
|
8
8
|
|
|
9
9
|
export default {
|
|
10
10
|
title: "Components/Button",
|
|
11
11
|
component: Button,
|
|
12
|
+
args: {
|
|
13
|
+
kind: "contained",
|
|
14
|
+
color: "primary",
|
|
15
|
+
disabled: false,
|
|
16
|
+
size: "small",
|
|
17
|
+
onClick: action("onClick"),
|
|
18
|
+
},
|
|
12
19
|
argTypes: {
|
|
13
20
|
icon: {
|
|
14
21
|
control: false,
|
|
15
22
|
description: `Use this prop when you want to add icon.
|
|
16
|
-
|
|
17
|
-
\n and only Icon can be checked when used with hasIconOnly.`,
|
|
23
|
+
\n It is added to the left of the text criteria`,
|
|
18
24
|
table: {
|
|
19
25
|
defaultValue: { summary: "undefined" },
|
|
20
26
|
type: { summary: "React.ReactNode" },
|
|
@@ -26,7 +32,6 @@ export default {
|
|
|
26
32
|
},
|
|
27
33
|
options: ["contained", "outlined", "ghost"],
|
|
28
34
|
description: "Button has three Kinds Contained, Outlined, Ghost",
|
|
29
|
-
defaultValue: "contained",
|
|
30
35
|
table: {
|
|
31
36
|
defaultValue: { summary: "contained" },
|
|
32
37
|
},
|
|
@@ -36,7 +41,6 @@ export default {
|
|
|
36
41
|
type: "radio",
|
|
37
42
|
},
|
|
38
43
|
options: ["primary", "secondary", "error"],
|
|
39
|
-
defaultValue: "primary",
|
|
40
44
|
table: {
|
|
41
45
|
defaultValue: { summary: "primary" },
|
|
42
46
|
},
|
|
@@ -45,7 +49,6 @@ export default {
|
|
|
45
49
|
control: {
|
|
46
50
|
type: "boolean",
|
|
47
51
|
},
|
|
48
|
-
defaultValue: false,
|
|
49
52
|
table: {
|
|
50
53
|
defaultValue: { summary: "false" },
|
|
51
54
|
},
|
|
@@ -55,7 +58,6 @@ export default {
|
|
|
55
58
|
type: "radio",
|
|
56
59
|
},
|
|
57
60
|
options: ["small", "medium", "large"],
|
|
58
|
-
defaultValue: "small",
|
|
59
61
|
table: {
|
|
60
62
|
defaultValue: { summary: "small" },
|
|
61
63
|
},
|
|
@@ -70,7 +72,6 @@ export default {
|
|
|
70
72
|
function: action("onClick"),
|
|
71
73
|
undefined: undefined,
|
|
72
74
|
},
|
|
73
|
-
defaultValue: "function",
|
|
74
75
|
description:
|
|
75
76
|
"It is a callback function that is called when the button is clicked.",
|
|
76
77
|
},
|
|
@@ -81,7 +82,6 @@ export default {
|
|
|
81
82
|
"children",
|
|
82
83
|
"icon",
|
|
83
84
|
"onClick",
|
|
84
|
-
"hasIconOnly",
|
|
85
85
|
"disabled",
|
|
86
86
|
"size",
|
|
87
87
|
"kind",
|
|
@@ -95,34 +95,45 @@ export default {
|
|
|
95
95
|
},
|
|
96
96
|
},
|
|
97
97
|
},
|
|
98
|
-
} as
|
|
98
|
+
} as Meta<typeof Button>;
|
|
99
99
|
|
|
100
|
-
const IconButtonTemplate:
|
|
100
|
+
const IconButtonTemplate: StoryFn<typeof Button> = (args) => (
|
|
101
101
|
<Button icon={<Bell />} {...args}>
|
|
102
102
|
{args.children}
|
|
103
103
|
</Button>
|
|
104
104
|
);
|
|
105
105
|
|
|
106
|
-
export const IconOnlyButton =
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
106
|
+
export const IconOnlyButton = {
|
|
107
|
+
render: IconButtonTemplate,
|
|
108
|
+
|
|
109
|
+
argTypes: {
|
|
110
|
+
children: {
|
|
111
|
+
control: false,
|
|
112
|
+
type: "string",
|
|
113
|
+
table: {
|
|
114
|
+
defaultValue: { summary: "undefined" },
|
|
115
|
+
},
|
|
113
116
|
},
|
|
114
117
|
},
|
|
118
|
+
|
|
119
|
+
name: "Icon only",
|
|
115
120
|
};
|
|
116
|
-
IconOnlyButton.storyName = "Icon only";
|
|
117
121
|
|
|
118
|
-
export const IconWithTextButton =
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
export const IconWithTextButton = {
|
|
123
|
+
render: IconButtonTemplate,
|
|
124
|
+
|
|
125
|
+
args: {
|
|
126
|
+
children: "Text",
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
argTypes: {
|
|
130
|
+
children: {
|
|
131
|
+
type: "string",
|
|
132
|
+
table: {
|
|
133
|
+
defaultValue: { summary: "undefined" },
|
|
134
|
+
},
|
|
125
135
|
},
|
|
126
136
|
},
|
|
137
|
+
|
|
138
|
+
name: "Icon",
|
|
127
139
|
};
|
|
128
|
-
IconWithTextButton.storyName = "Icon";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import {
|
|
3
|
-
Box,
|
|
4
3
|
Table,
|
|
5
4
|
TableHead,
|
|
6
5
|
TableRow,
|
|
@@ -11,21 +10,26 @@ import { action } from "@storybook/addon-actions";
|
|
|
11
10
|
|
|
12
11
|
import Button from "@/components/Button";
|
|
13
12
|
|
|
14
|
-
import type {
|
|
13
|
+
import type { StoryFn, Meta } from "@storybook/react";
|
|
15
14
|
|
|
16
15
|
export default {
|
|
17
16
|
title: "Components/Button",
|
|
18
17
|
component: Button,
|
|
18
|
+
args: {
|
|
19
|
+
kind: "contained",
|
|
20
|
+
children: "Text",
|
|
21
|
+
disabled: false,
|
|
22
|
+
size: "small",
|
|
23
|
+
onClick: action("onClick"),
|
|
24
|
+
},
|
|
19
25
|
argTypes: {
|
|
20
26
|
children: {
|
|
21
27
|
type: "string",
|
|
22
|
-
defaultValue: "Text",
|
|
23
28
|
},
|
|
24
29
|
disabled: {
|
|
25
30
|
control: {
|
|
26
31
|
type: "boolean",
|
|
27
32
|
},
|
|
28
|
-
defaultValue: false,
|
|
29
33
|
table: {
|
|
30
34
|
defaultValue: { summary: "false" },
|
|
31
35
|
},
|
|
@@ -35,7 +39,6 @@ export default {
|
|
|
35
39
|
type: "radio",
|
|
36
40
|
},
|
|
37
41
|
options: ["small", "medium", "large"],
|
|
38
|
-
defaultValue: "small",
|
|
39
42
|
table: {
|
|
40
43
|
defaultValue: { summary: "small" },
|
|
41
44
|
},
|
|
@@ -50,7 +53,6 @@ export default {
|
|
|
50
53
|
function: action("onClick"),
|
|
51
54
|
undefined: undefined,
|
|
52
55
|
},
|
|
53
|
-
defaultValue: "function",
|
|
54
56
|
description:
|
|
55
57
|
"It is a callback function that is called when the button is clicked.",
|
|
56
58
|
},
|
|
@@ -58,7 +60,6 @@ export default {
|
|
|
58
60
|
control: false,
|
|
59
61
|
options: ["contained", "outlined", "ghost"],
|
|
60
62
|
description: "Button has three Kinds Contained, Outlined, Ghost",
|
|
61
|
-
defaultValue: "contained",
|
|
62
63
|
table: {
|
|
63
64
|
defaultValue: { summary: "contained" },
|
|
64
65
|
},
|
|
@@ -68,6 +69,17 @@ export default {
|
|
|
68
69
|
controls: {
|
|
69
70
|
include: ["onClick", "children", "color", "size", "disabled", "kind"],
|
|
70
71
|
},
|
|
72
|
+
pseudo: {
|
|
73
|
+
hover: [
|
|
74
|
+
"#hover1",
|
|
75
|
+
"#hover2",
|
|
76
|
+
"#hover3",
|
|
77
|
+
"#hover4",
|
|
78
|
+
"#hover5",
|
|
79
|
+
"#hover6",
|
|
80
|
+
"#hover7",
|
|
81
|
+
],
|
|
82
|
+
},
|
|
71
83
|
docs: {
|
|
72
84
|
description: {
|
|
73
85
|
component: `It is a kind Button docs. For more details, please
|
|
@@ -75,9 +87,9 @@ export default {
|
|
|
75
87
|
},
|
|
76
88
|
},
|
|
77
89
|
},
|
|
78
|
-
} as
|
|
90
|
+
} as Meta<typeof Button>;
|
|
79
91
|
|
|
80
|
-
const ButtonTemplate:
|
|
92
|
+
const ButtonTemplate: StoryFn<typeof Button> = ({
|
|
81
93
|
kind,
|
|
82
94
|
color,
|
|
83
95
|
children,
|
|
@@ -140,9 +152,11 @@ const ButtonTemplate: ComponentStory<typeof Button> = ({
|
|
|
140
152
|
);
|
|
141
153
|
};
|
|
142
154
|
|
|
143
|
-
export const Kind =
|
|
155
|
+
export const Kind = {
|
|
156
|
+
render: ButtonTemplate,
|
|
157
|
+
};
|
|
144
158
|
|
|
145
|
-
const ContainedButtonTemplate:
|
|
159
|
+
const ContainedButtonTemplate: StoryFn<typeof Button> = (args) => {
|
|
146
160
|
return (
|
|
147
161
|
<>
|
|
148
162
|
<Table sx={{ width: 650 }}>
|
|
@@ -190,17 +204,17 @@ const ContainedButtonTemplate: ComponentStory<typeof Button> = (args) => {
|
|
|
190
204
|
Hover
|
|
191
205
|
</TableCell>
|
|
192
206
|
<TableCell>
|
|
193
|
-
<Button {...args} id="
|
|
207
|
+
<Button {...args} id="hover1" kind="contained">
|
|
194
208
|
{args.children}
|
|
195
209
|
</Button>
|
|
196
210
|
</TableCell>
|
|
197
211
|
<TableCell>
|
|
198
|
-
<Button {...args} id="
|
|
212
|
+
<Button {...args} id="hover2" kind="contained" color="secondary">
|
|
199
213
|
{args.children}
|
|
200
214
|
</Button>
|
|
201
215
|
</TableCell>
|
|
202
216
|
<TableCell>
|
|
203
|
-
<Button {...args} id="
|
|
217
|
+
<Button {...args} id="hover3" kind="contained" color="error">
|
|
204
218
|
{args.children}
|
|
205
219
|
</Button>
|
|
206
220
|
</TableCell>
|
|
@@ -265,23 +279,27 @@ const ContainedButtonTemplate: ComponentStory<typeof Button> = (args) => {
|
|
|
265
279
|
);
|
|
266
280
|
};
|
|
267
281
|
|
|
268
|
-
export const KindContained =
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
282
|
+
export const KindContained = {
|
|
283
|
+
render: ContainedButtonTemplate,
|
|
284
|
+
|
|
285
|
+
argTypes: {
|
|
286
|
+
color: {
|
|
287
|
+
control: "false",
|
|
288
|
+
options: ["primary", "secondary", "error"],
|
|
289
|
+
defaultValue: "primary",
|
|
290
|
+
description: `The color of the component.
|
|
291
|
+
\n It supports both default and custom theme colors,
|
|
292
|
+
\n which can be added as shown in the palette customization guide.`,
|
|
293
|
+
table: {
|
|
294
|
+
defaultValue: { summary: "primary" },
|
|
295
|
+
},
|
|
279
296
|
},
|
|
280
297
|
},
|
|
298
|
+
|
|
299
|
+
name: "Kind: Contained",
|
|
281
300
|
};
|
|
282
|
-
KindContained.storyName = "Kind: Contained";
|
|
283
301
|
|
|
284
|
-
const GhostButtonTemplate:
|
|
302
|
+
const GhostButtonTemplate: StoryFn<typeof Button> = (args) => {
|
|
285
303
|
return (
|
|
286
304
|
<>
|
|
287
305
|
<Table sx={{ width: 650 }}>
|
|
@@ -329,17 +347,17 @@ const GhostButtonTemplate: ComponentStory<typeof Button> = (args) => {
|
|
|
329
347
|
Hover
|
|
330
348
|
</TableCell>
|
|
331
349
|
<TableCell>
|
|
332
|
-
<Button {...args} id="
|
|
350
|
+
<Button {...args} id="hover4" kind="ghost">
|
|
333
351
|
{args.children}
|
|
334
352
|
</Button>
|
|
335
353
|
</TableCell>
|
|
336
354
|
<TableCell>
|
|
337
|
-
<Button {...args} id="
|
|
355
|
+
<Button {...args} id="hover5" kind="ghost" color="secondary">
|
|
338
356
|
{args.children}
|
|
339
357
|
</Button>
|
|
340
358
|
</TableCell>
|
|
341
359
|
<TableCell>
|
|
342
|
-
<Button {...args} id="
|
|
360
|
+
<Button {...args} id="hover6" kind="ghost" color="error">
|
|
343
361
|
{args.children}
|
|
344
362
|
</Button>
|
|
345
363
|
</TableCell>
|
|
@@ -406,23 +424,27 @@ const GhostButtonTemplate: ComponentStory<typeof Button> = (args) => {
|
|
|
406
424
|
);
|
|
407
425
|
};
|
|
408
426
|
|
|
409
|
-
export const KindGhost =
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
defaultValue:
|
|
427
|
+
export const KindGhost = {
|
|
428
|
+
render: GhostButtonTemplate,
|
|
429
|
+
|
|
430
|
+
argTypes: {
|
|
431
|
+
color: {
|
|
432
|
+
control: "false",
|
|
433
|
+
options: ["primary", "secondary", "error"],
|
|
434
|
+
description: `The color of the component.
|
|
435
|
+
\n It supports both default and custom theme colors,
|
|
436
|
+
\n which can be added as shown in the palette customization guide.`,
|
|
437
|
+
defaultValue: "primary",
|
|
438
|
+
table: {
|
|
439
|
+
defaultValue: { summary: "primary" },
|
|
440
|
+
},
|
|
420
441
|
},
|
|
421
442
|
},
|
|
443
|
+
|
|
444
|
+
name: "Kind: Ghost",
|
|
422
445
|
};
|
|
423
|
-
KindGhost.storyName = "Kind: Ghost";
|
|
424
446
|
|
|
425
|
-
const OutlinedButtonTemplate:
|
|
447
|
+
const OutlinedButtonTemplate: StoryFn<typeof Button> = ({
|
|
426
448
|
color,
|
|
427
449
|
...restProps
|
|
428
450
|
}) => {
|
|
@@ -457,7 +479,7 @@ const OutlinedButtonTemplate: ComponentStory<typeof Button> = ({
|
|
|
457
479
|
Hover
|
|
458
480
|
</TableCell>
|
|
459
481
|
<TableCell>
|
|
460
|
-
<Button {...restProps} id="
|
|
482
|
+
<Button {...restProps} id="hover7" kind="outlined">
|
|
461
483
|
Text
|
|
462
484
|
</Button>
|
|
463
485
|
</TableCell>
|
|
@@ -496,19 +518,23 @@ const OutlinedButtonTemplate: ComponentStory<typeof Button> = ({
|
|
|
496
518
|
);
|
|
497
519
|
};
|
|
498
520
|
|
|
499
|
-
export const KindOutlined =
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
521
|
+
export const KindOutlined = {
|
|
522
|
+
render: OutlinedButtonTemplate,
|
|
523
|
+
|
|
524
|
+
argTypes: {
|
|
525
|
+
color: {
|
|
526
|
+
control: "false",
|
|
527
|
+
options: ["primary"],
|
|
528
|
+
defaultValue: "primary",
|
|
529
|
+
description: `The color of the component.
|
|
530
|
+
\n It supports both default and custom theme colors,
|
|
531
|
+
\n which can be added as shown in the palette customization guide.`,
|
|
532
|
+
table: {
|
|
533
|
+
type: { summary: "primary" },
|
|
534
|
+
defaultValue: { summary: "primary" },
|
|
535
|
+
},
|
|
511
536
|
},
|
|
512
537
|
},
|
|
538
|
+
|
|
539
|
+
name: "Kind: Outlined",
|
|
513
540
|
};
|
|
514
|
-
KindOutlined.storyName = "Kind: Outlined";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Meta } from "@storybook/react";
|
|
3
3
|
import { action } from "@storybook/addon-actions";
|
|
4
4
|
import Chip from "@/components/Chip";
|
|
5
5
|
import {
|
|
@@ -11,15 +11,6 @@ import {
|
|
|
11
11
|
Warning16,
|
|
12
12
|
} from "@lunit/design-system-icons";
|
|
13
13
|
|
|
14
|
-
import type {
|
|
15
|
-
OutlinedChipProps,
|
|
16
|
-
ReadOnlyContainedChipProps,
|
|
17
|
-
EnableContainedChipProps,
|
|
18
|
-
DeletableContainedChipProps,
|
|
19
|
-
ChipProps,
|
|
20
|
-
ChipThumbnail,
|
|
21
|
-
} from "@/components/Chip/Chip.types";
|
|
22
|
-
|
|
23
14
|
export default {
|
|
24
15
|
title: "Components/Chips",
|
|
25
16
|
component: Chip,
|
|
@@ -31,7 +22,6 @@ export default {
|
|
|
31
22
|
description: `Contained chip can have onClick event. When Chip is clickable, onDelete is disabled.`,
|
|
32
23
|
control: {
|
|
33
24
|
type: "select",
|
|
34
|
-
defaultValue: undefined,
|
|
35
25
|
},
|
|
36
26
|
options: ["function", undefined],
|
|
37
27
|
mapping: {
|
|
@@ -50,13 +40,11 @@ export default {
|
|
|
50
40
|
function: action("onDelete"),
|
|
51
41
|
undefined: undefined,
|
|
52
42
|
},
|
|
53
|
-
defaultValue: null,
|
|
54
43
|
},
|
|
55
44
|
|
|
56
45
|
thumbnail: {
|
|
57
46
|
control: {
|
|
58
47
|
type: "select",
|
|
59
|
-
defaultValue: "undefined",
|
|
60
48
|
},
|
|
61
49
|
options: [
|
|
62
50
|
undefined,
|
|
@@ -104,93 +92,117 @@ export default {
|
|
|
104
92
|
expanded: true,
|
|
105
93
|
},
|
|
106
94
|
},
|
|
107
|
-
} as
|
|
95
|
+
} as Meta<typeof Chip>;
|
|
108
96
|
|
|
109
|
-
const
|
|
97
|
+
export const Outlined = {
|
|
98
|
+
parameters: {
|
|
99
|
+
docs: {
|
|
100
|
+
description: {
|
|
101
|
+
story: `Outlined chip only contains label and shows the state of disabled.`,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
controls: {
|
|
105
|
+
exclude: [
|
|
106
|
+
"thumbnail",
|
|
107
|
+
"onClick",
|
|
108
|
+
"onDelete",
|
|
109
|
+
"disabled",
|
|
110
|
+
"clickable",
|
|
111
|
+
"skipFocusWhenDisabled",
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
110
115
|
|
|
111
|
-
|
|
116
|
+
args: {
|
|
117
|
+
color: "primary",
|
|
118
|
+
kind: "outlined",
|
|
119
|
+
},
|
|
112
120
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
121
|
+
name: "Kind: Outlined",
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export const Contained = {
|
|
125
|
+
parameters: {
|
|
126
|
+
controls: {
|
|
127
|
+
exclude: [
|
|
128
|
+
"thumbnail",
|
|
129
|
+
"onClick",
|
|
130
|
+
"onDelete",
|
|
131
|
+
"disabled",
|
|
132
|
+
"clickable",
|
|
133
|
+
"skipFocusWhenDisabled",
|
|
134
|
+
],
|
|
117
135
|
},
|
|
118
136
|
},
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
"onDelete",
|
|
124
|
-
"disabled",
|
|
125
|
-
"clickable",
|
|
126
|
-
"skipFocusWhenDisabled",
|
|
127
|
-
],
|
|
137
|
+
|
|
138
|
+
args: {
|
|
139
|
+
color: "primary",
|
|
140
|
+
kind: "contained",
|
|
128
141
|
},
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
color: "primary",
|
|
132
|
-
kind: "outlined",
|
|
142
|
+
|
|
143
|
+
name: "Kind: Contained / Read Only",
|
|
133
144
|
};
|
|
134
145
|
|
|
135
|
-
export const
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
"onClick",
|
|
141
|
-
"onDelete",
|
|
142
|
-
"disabled",
|
|
143
|
-
"clickable",
|
|
144
|
-
"skipFocusWhenDisabled",
|
|
145
|
-
],
|
|
146
|
+
export const ContainedWithClick = {
|
|
147
|
+
args: {
|
|
148
|
+
...Contained.args,
|
|
149
|
+
onClick: action("onClick"),
|
|
150
|
+
onDelete: undefined,
|
|
146
151
|
},
|
|
147
|
-
};
|
|
148
|
-
Contained.args = {
|
|
149
|
-
color: "primary",
|
|
150
|
-
kind: "contained",
|
|
151
|
-
};
|
|
152
152
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
story: `Contained chip can have onClick event. When Chip is clickable, onDelete is disabled.`,
|
|
153
|
+
parameters: {
|
|
154
|
+
docs: {
|
|
155
|
+
description: {
|
|
156
|
+
story: `Contained chip can have onClick event. When Chip is clickable, onDelete is disabled.`,
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
controls: {
|
|
160
|
+
exclude: ["onDelete", "deletable"],
|
|
162
161
|
},
|
|
163
162
|
},
|
|
164
|
-
controls: {
|
|
165
|
-
exclude: ["onDelete", "deletable"],
|
|
166
|
-
},
|
|
167
|
-
};
|
|
168
163
|
|
|
169
|
-
|
|
170
|
-
ContainedWithDelete.args = {
|
|
171
|
-
...Contained.args,
|
|
172
|
-
onClick: undefined,
|
|
173
|
-
onDelete: action("onDelete"),
|
|
164
|
+
name: "Kind: Contained / Enable",
|
|
174
165
|
};
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
166
|
+
|
|
167
|
+
export const ContainedWithDelete = {
|
|
168
|
+
args: {
|
|
169
|
+
...Contained.args,
|
|
170
|
+
onClick: undefined,
|
|
171
|
+
onDelete: action("onDelete"),
|
|
180
172
|
},
|
|
181
|
-
|
|
182
|
-
|
|
173
|
+
|
|
174
|
+
parameters: {
|
|
175
|
+
docs: {
|
|
176
|
+
description: {
|
|
177
|
+
story: `Contained chip can have delete button. When Chip is deletable, onClick is disabled.`,
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
controls: {
|
|
181
|
+
exclude: ["onClick", "clickable"],
|
|
182
|
+
},
|
|
183
183
|
},
|
|
184
|
-
};
|
|
185
184
|
|
|
186
|
-
|
|
187
|
-
ContainedWithThumbnail.args = {
|
|
188
|
-
thumbnail: "Initial",
|
|
185
|
+
name: "Kind: Contained / Deletable",
|
|
189
186
|
};
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
187
|
+
|
|
188
|
+
export const ContainedWithThumbnail = {
|
|
189
|
+
args: {
|
|
190
|
+
...Contained.args,
|
|
191
|
+
thumbnail: "Initial",
|
|
192
|
+
onClick: undefined,
|
|
193
|
+
onDelete: undefined,
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
parameters: {
|
|
197
|
+
docs: {
|
|
198
|
+
description: {
|
|
199
|
+
story: `Contained chip can have thumbnail as "avatar", "logo", and lunit icons.`,
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
controls: {
|
|
203
|
+
exclude: ["onClick", "onDelete"],
|
|
194
204
|
},
|
|
195
205
|
},
|
|
206
|
+
|
|
207
|
+
name: "Kind: Contained with Thumbnail",
|
|
196
208
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { StoryFn, Meta } from "@storybook/react";
|
|
3
3
|
|
|
4
4
|
import DataTable from "@/components/DataTable";
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: "Components/DataTable",
|
|
8
8
|
component: DataTable,
|
|
9
|
-
} as
|
|
9
|
+
} as Meta<typeof DataTable>;
|
|
10
10
|
|
|
11
|
-
const Template:
|
|
11
|
+
const Template: StoryFn<typeof DataTable> = () => <DataTable />;
|
|
12
12
|
|
|
13
|
-
export const LunitDataTable =
|
|
13
|
+
export const LunitDataTable = {
|
|
14
|
+
render: Template,
|
|
15
|
+
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { StoryFn, Meta } from "@storybook/react";
|
|
3
3
|
|
|
4
4
|
import DatePicker from "@/components/DatePicker";
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: "Components/DatePicker",
|
|
8
8
|
component: DatePicker,
|
|
9
|
-
} as
|
|
9
|
+
} as Meta<typeof DatePicker>;
|
|
10
10
|
|
|
11
|
-
const Template:
|
|
11
|
+
const Template: StoryFn<typeof DatePicker> = () => <DatePicker />;
|
|
12
12
|
|
|
13
|
-
export const LunitDatePicker =
|
|
13
|
+
export const LunitDatePicker = {
|
|
14
|
+
render: Template,
|
|
15
|
+
};
|