@lunit/design-system 2.1.0 → 2.2.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/README.md +2 -2
- package/dist/cjs/components/Alert/index.js +1 -1
- package/dist/cjs/components/Alert/index.js.map +1 -1
- package/dist/cjs/components/Button/index.js +1 -1
- package/dist/cjs/components/Button/index.js.map +1 -1
- package/dist/cjs/components/Checkbox/index.js +1 -1
- package/dist/cjs/components/Checkbox/index.js.map +1 -1
- package/dist/cjs/components/Chip/index.js +1 -1
- package/dist/cjs/components/Chip/index.js.map +1 -1
- package/dist/cjs/components/DataTable/index.js.map +1 -1
- package/dist/cjs/components/DatePicker/index.js.map +1 -1
- package/dist/cjs/components/Dialog/index.js +1 -1
- package/dist/cjs/components/Dialog/index.js.map +1 -1
- package/dist/cjs/components/Dropdown/index.js +1 -1
- package/dist/cjs/components/Dropdown/index.js.map +1 -1
- package/dist/cjs/components/FormLabel/index.js +1 -1
- package/dist/cjs/components/FormLabel/index.js.map +1 -1
- package/dist/cjs/components/Radio/index.js +1 -1
- package/dist/cjs/components/Radio/index.js.map +1 -1
- package/dist/cjs/components/RadioGroup/index.js.map +1 -1
- package/dist/cjs/components/TextField/index.js +1 -1
- package/dist/cjs/components/TextField/index.js.map +1 -1
- package/dist/cjs/components/Toggle/index.js +1 -1
- package/dist/cjs/components/Toggle/index.js.map +1 -1
- package/dist/cjs/components/ToggleButton/index.js +1 -1
- package/dist/cjs/components/ToggleButton/index.js.map +1 -1
- package/dist/cjs/components/Tooltip/index.js.map +1 -1
- package/dist/cjs/components/Typography/index.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/types/components/Button/Button.styled.d.ts +35 -50
- package/dist/types/components/Chip/Chip.styled.d.ts +4 -76
- package/dist/types/components/Chip/Chip.types.d.ts +1 -1
- package/dist/types/components/Dropdown/Dropdown.styled.d.ts +3 -37
- package/dist/types/components/Dropdown/Dropdown.types.d.ts +1 -1
- package/dist/types/components/TextField/TextField.types.d.ts +1 -1
- package/dist/types/components/TextField/TextFieldIcon.d.ts +1 -1
- package/dist/types/components/ToggleButton/ToggleButton.styled.d.ts +1 -32
- package/dist/types/components/Typography/Typography.d.ts +1 -1
- package/package.json +21 -23
- package/src/components/Chip/Chip.types.ts +2 -0
- package/src/components/Dropdown/Dropdown.types.ts +2 -0
- package/src/components/TextField/TextField.types.ts +2 -0
- package/src/components/TextField/TextFieldIcon.tsx +1 -1
- package/src/stories/GettingStarted.mdx +10 -16
- package/src/stories/components/Alert/Alert.stories.tsx +3 -3
- package/src/stories/components/Button/BasicButton.stories.tsx +2 -2
- package/src/stories/components/Button/ButtonDocs.mdx +1 -1
- package/src/stories/components/Button/Color.stories.tsx +2 -2
- package/src/stories/components/Button/IconButton.stories.tsx +2 -2
- package/src/stories/components/Button/Kind.stories.tsx +2 -2
- package/src/stories/components/CheckBox/BasicCheckbox.stories.tsx +2 -2
- package/src/stories/components/CheckBox/CheckboxDocs.mdx +1 -1
- package/src/stories/components/Chip/Chip.stories.tsx +2 -2
- package/src/stories/components/Chip/ChipDocs.mdx +1 -1
- package/src/stories/components/DataTable/DataTable.stories.tsx +1 -1
- package/src/stories/components/DatePicker/DatePicker.stories.tsx +1 -1
- package/src/stories/components/Dialog/Dialog.stories.tsx +19 -8
- package/src/stories/components/Dialog/DialogDocs.mdx +1 -1
- package/src/stories/components/Dropdown/Dropdown.stories.tsx +6 -6
- package/src/stories/components/Dropdown/DropdownExamples.stories.tsx +3 -3
- package/src/stories/components/Dropdown/DropdownItem.stories.tsx +6 -6
- package/src/stories/components/SelectControl/RadioGroup.stories.tsx +1 -1
- package/src/stories/components/SelectControl/RadioStatus.stories.tsx +1 -1
- package/src/stories/components/SelectControl/Toggle.stories.tsx +2 -2
- package/src/stories/components/TextField/BasicTextField.stories.tsx +9 -16
- package/src/stories/components/TextField/TextFieldDocs.mdx +1 -1
- package/src/stories/components/TextField/TextFieldMulti.stories.tsx +8 -11
- package/src/stories/components/TextField/TextFieldSingle.stories.tsx +8 -11
- package/src/stories/components/TextField/TextFieldSize.stories.tsx +7 -8
- package/src/stories/components/Toast/Toast.stories.tsx +8 -3
- package/src/stories/components/ToggleButton/Basic.stories.tsx +152 -113
- package/src/stories/components/ToggleButton/ToggleButtonDocs.mdx +1 -1
- package/src/stories/components/ToggleButton/ToggleButtonKind.stories.tsx +5 -5
- package/src/stories/components/ToggleButton/WithIcon.stories.tsx +2 -2
- package/src/stories/components/Tooltip/Tooltip.stories.tsx +1 -1
- package/src/stories/foundation/Elevation/Elevation.stories.tsx +1 -20
- package/src/stories/foundation/Typography/Typography.mdx +1 -1
- package/src/stories/foundation/Typography/Typography.stories.tsx +1 -1
- package/src/stories/foundation/colors/Colors.stories.tsx +2 -2
- package/src/stories/foundation/colors/Docs.mdx +1 -1
- package/src/stories/foundation/colors/Mui.stories.tsx +1 -1
- package/src/stories/foundation/colors/Token.inComponent.stories.tsx +1 -1
- package/src/stories/foundation/colors/TokenPaletteTable.stories.tsx +1 -1
- package/tsconfig.json +0 -1
- package/src/stories/components/ToggleButton/Group.stories.tsx +0 -221
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Box, Typography } from "@mui/material";
|
|
3
|
-
import { StoryFn, Meta } from "@storybook/react";
|
|
3
|
+
import { StoryFn, Meta } from "@storybook/react-webpack5";
|
|
4
4
|
|
|
5
5
|
import Alert from "@/components/Alert";
|
|
6
6
|
import Button from "@/components/Button";
|
|
7
7
|
import theme from "@/theme";
|
|
8
|
-
import { action } from "
|
|
8
|
+
import { action } from "storybook/actions";
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
11
|
title: "Components/Alert",
|
|
@@ -24,7 +24,7 @@ export default {
|
|
|
24
24
|
description: `\`success\`, \`info\`, \`warning\`, \`error\`, \`undefined\``,
|
|
25
25
|
},
|
|
26
26
|
onClose: {
|
|
27
|
-
control:
|
|
27
|
+
control: false, // TODO: 스토리북 버전업 과정에서 control 이 'function' 타입을 지원하지 않아 false 로 변경. 현재 스토리북에서 동작은 이상없으나 필요한 사항이 있으면 수정할 것
|
|
28
28
|
description: `Callback fired when the component requests to be closed.
|
|
29
29
|
When provided, a close icon button is displayed that triggers the callback when clicked.`,
|
|
30
30
|
},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { action } from "
|
|
2
|
+
import { action } from "storybook/actions";
|
|
3
3
|
import { Box } from "@mui/material";
|
|
4
4
|
|
|
5
5
|
import Button from "@/components/Button";
|
|
6
6
|
|
|
7
|
-
import type { StoryObj, StoryFn, Meta } from "@storybook/react";
|
|
7
|
+
import type { StoryObj, StoryFn, Meta } from "@storybook/react-webpack5";
|
|
8
8
|
|
|
9
9
|
export default {
|
|
10
10
|
title: "Components/Button",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Box } from "@mui/material";
|
|
3
|
-
import { action } from "
|
|
3
|
+
import { action } from "storybook/actions";
|
|
4
4
|
|
|
5
5
|
import Button from "@/components/Button";
|
|
6
6
|
|
|
7
|
-
import type { StoryFn, Meta } from "@storybook/react";
|
|
7
|
+
import type { StoryFn, Meta } from "@storybook/react-webpack5";
|
|
8
8
|
|
|
9
9
|
export default {
|
|
10
10
|
title: "Components/Button",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Bell from "@lunit/design-system-icons/Bell";
|
|
3
|
-
import { action } from "
|
|
3
|
+
import { action } from "storybook/actions";
|
|
4
4
|
|
|
5
5
|
import Button from "@/components/Button";
|
|
6
6
|
|
|
7
|
-
import type { StoryFn, Meta } from "@storybook/react";
|
|
7
|
+
import type { StoryFn, Meta } from "@storybook/react-webpack5";
|
|
8
8
|
import { Box } from "@mui/material";
|
|
9
9
|
|
|
10
10
|
export default {
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
TableBody,
|
|
7
7
|
TableCell,
|
|
8
8
|
} from "@mui/material";
|
|
9
|
-
import { action } from "
|
|
9
|
+
import { action } from "storybook/actions";
|
|
10
10
|
|
|
11
11
|
import Button from "@/components/Button";
|
|
12
12
|
|
|
13
|
-
import type { StoryFn, Meta } from "@storybook/react";
|
|
13
|
+
import type { StoryFn, Meta } from "@storybook/react-webpack5";
|
|
14
14
|
|
|
15
15
|
export default {
|
|
16
16
|
title: "Components/Button",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useState, useEffect } from "react";
|
|
2
2
|
import { Box, FormControlLabel } from "@mui/material";
|
|
3
|
-
import { action } from "
|
|
3
|
+
import { action } from "storybook/actions";
|
|
4
4
|
import Checkbox from "@/components/Checkbox";
|
|
5
5
|
import FormLabel from "@/components/FormLabel";
|
|
6
|
-
import { Meta, StoryFn } from "@storybook/react";
|
|
6
|
+
import { Meta, StoryFn } from "@storybook/react-webpack5";
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
9
|
title: "Components/Checkbox",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Meta } from "@storybook/react";
|
|
3
|
-
import { action } from "
|
|
2
|
+
import { Meta } from "@storybook/react-webpack5";
|
|
3
|
+
import { action } from "storybook/actions";
|
|
4
4
|
import { Box } from "@mui/system";
|
|
5
5
|
|
|
6
6
|
import Chip from "@/components/Chip";
|
|
@@ -5,12 +5,11 @@ import Error from "@lunit/design-system-icons/Error";
|
|
|
5
5
|
import Button from "@/components/Button";
|
|
6
6
|
import Dialog from "@/components/Dialog";
|
|
7
7
|
|
|
8
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
8
|
+
import type { Meta, StoryObj } from "@storybook/react-webpack5";
|
|
9
9
|
|
|
10
10
|
const meta: Meta<typeof Dialog> = {
|
|
11
11
|
title: "components/Dialog",
|
|
12
12
|
component: Dialog,
|
|
13
|
-
tags: ["autodocs"],
|
|
14
13
|
parameters: {
|
|
15
14
|
docs: { disable: true, hidden: true },
|
|
16
15
|
},
|
|
@@ -30,7 +29,9 @@ export const PassiveModal: Story = {
|
|
|
30
29
|
|
|
31
30
|
return (
|
|
32
31
|
<div style={{ width: "100vw", height: "100vh" }}>
|
|
33
|
-
<div ref={
|
|
32
|
+
<div ref={ref => {
|
|
33
|
+
setTarget(ref);
|
|
34
|
+
}} />
|
|
34
35
|
<Dialog
|
|
35
36
|
className={classNameFromGlobal}
|
|
36
37
|
isOpen={Boolean(target)}
|
|
@@ -54,7 +55,9 @@ export const ActionModal: Story = {
|
|
|
54
55
|
|
|
55
56
|
return (
|
|
56
57
|
<div style={{ width: "100vw", height: "100vh" }}>
|
|
57
|
-
<div ref={
|
|
58
|
+
<div ref={ref => {
|
|
59
|
+
setTarget(ref);
|
|
60
|
+
}} />
|
|
58
61
|
<Dialog
|
|
59
62
|
className={classNameFromGlobal}
|
|
60
63
|
isOpen={Boolean(target)}
|
|
@@ -148,7 +151,9 @@ export const SmallFalse: Story = {
|
|
|
148
151
|
|
|
149
152
|
return (
|
|
150
153
|
<div style={{ width: "100vw", height: "100vh" }}>
|
|
151
|
-
<div ref={
|
|
154
|
+
<div ref={ref => {
|
|
155
|
+
setTarget(ref);
|
|
156
|
+
}} />
|
|
152
157
|
<Dialog
|
|
153
158
|
className={classNameFromGlobal}
|
|
154
159
|
isOpen={Boolean(target)}
|
|
@@ -173,7 +178,9 @@ export const WithTitleIcon: Story = {
|
|
|
173
178
|
|
|
174
179
|
return (
|
|
175
180
|
<div style={{ width: "100vw", height: "100vh" }}>
|
|
176
|
-
<div ref={
|
|
181
|
+
<div ref={ref => {
|
|
182
|
+
setTarget(ref);
|
|
183
|
+
}} />
|
|
177
184
|
<Dialog
|
|
178
185
|
className={classNameFromGlobal}
|
|
179
186
|
isOpen={Boolean(target)}
|
|
@@ -218,7 +225,9 @@ export const WithCustomStyle: Story = {
|
|
|
218
225
|
|
|
219
226
|
return (
|
|
220
227
|
<div style={{ width: "100vw", height: "100vh" }}>
|
|
221
|
-
<div ref={
|
|
228
|
+
<div ref={ref => {
|
|
229
|
+
setTarget(ref);
|
|
230
|
+
}} />
|
|
222
231
|
<Dialog
|
|
223
232
|
className={classNameFromGlobal}
|
|
224
233
|
isOpen={Boolean(target)}
|
|
@@ -249,7 +258,9 @@ export const WithScroll: Story = {
|
|
|
249
258
|
|
|
250
259
|
return (
|
|
251
260
|
<div style={{ width: "100vw", height: "100vh" }}>
|
|
252
|
-
<div ref={
|
|
261
|
+
<div ref={ref => {
|
|
262
|
+
setTarget(ref);
|
|
263
|
+
}} />
|
|
253
264
|
<Dialog
|
|
254
265
|
className={classNameFromGlobal}
|
|
255
266
|
isOpen={Boolean(target)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { StoryFn, Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { StoryFn, Meta, StoryObj } from "@storybook/react-webpack5";
|
|
3
3
|
|
|
4
4
|
import Dropdown, { DropdownItem } from "@/components/Dropdown";
|
|
5
5
|
import { Box, SelectChangeEvent } from "@mui/material";
|
|
@@ -51,7 +51,7 @@ const BasicDropdownTemplate: StoryFn<typeof Dropdown> = (args, context) => {
|
|
|
51
51
|
} = event;
|
|
52
52
|
setSelectedValue(
|
|
53
53
|
// On autofill we get a stringified value.
|
|
54
|
-
typeof value === "string" ? value.split(",") : (value as string[])
|
|
54
|
+
typeof value === "string" ? value.split(",") : (value as string[]),
|
|
55
55
|
);
|
|
56
56
|
};
|
|
57
57
|
|
|
@@ -91,7 +91,7 @@ const SizeTemplate: StoryFn<typeof Dropdown> = (args, context) => {
|
|
|
91
91
|
} = event;
|
|
92
92
|
setSelectedValue(
|
|
93
93
|
// On autofill we get a stringified value.
|
|
94
|
-
typeof value === "string" ? value.split(",") : (value as string[])
|
|
94
|
+
typeof value === "string" ? value.split(",") : (value as string[]),
|
|
95
95
|
);
|
|
96
96
|
};
|
|
97
97
|
|
|
@@ -170,7 +170,7 @@ const SelectTypeTemplate: StoryFn<typeof Dropdown> = (args, context) => {
|
|
|
170
170
|
} = event;
|
|
171
171
|
setSelectedValue2(
|
|
172
172
|
// On autofill we get a stringified value.
|
|
173
|
-
typeof value === "string" ? value.split(",") : (value as string[])
|
|
173
|
+
typeof value === "string" ? value.split(",") : (value as string[]),
|
|
174
174
|
);
|
|
175
175
|
};
|
|
176
176
|
|
|
@@ -229,7 +229,7 @@ const ErrorTemplate: StoryFn<typeof Dropdown> = (args, context) => {
|
|
|
229
229
|
} = event;
|
|
230
230
|
setSelectedValue(
|
|
231
231
|
// On autofill we get a stringified value.
|
|
232
|
-
typeof value === "string" ? value.split(",") : (value as string[])
|
|
232
|
+
typeof value === "string" ? value.split(",") : (value as string[]),
|
|
233
233
|
);
|
|
234
234
|
};
|
|
235
235
|
|
|
@@ -275,7 +275,7 @@ const DisabledTemplate: StoryFn<typeof Dropdown> = (args, context) => {
|
|
|
275
275
|
} = event;
|
|
276
276
|
setSelectedValue(
|
|
277
277
|
// On autofill we get a stringified value.
|
|
278
|
-
typeof value === "string" ? value.split(",") : (value as string[])
|
|
278
|
+
typeof value === "string" ? value.split(",") : (value as string[]),
|
|
279
279
|
);
|
|
280
280
|
};
|
|
281
281
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { StoryFn, Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { StoryFn, Meta, StoryObj } from "@storybook/react-webpack5";
|
|
3
3
|
|
|
4
4
|
import Dropdown, { DropdownItem } from "@/components/Dropdown";
|
|
5
5
|
import {
|
|
@@ -71,7 +71,7 @@ const DropdownExampleTemplate: StoryFn<typeof Dropdown> = (args, context) => {
|
|
|
71
71
|
} = event;
|
|
72
72
|
setEx2SelectedValue(
|
|
73
73
|
// On autofill we get a stringified value.
|
|
74
|
-
typeof value === "string" ? value.split(",") : (value as string[])
|
|
74
|
+
typeof value === "string" ? value.split(",") : (value as string[]),
|
|
75
75
|
);
|
|
76
76
|
};
|
|
77
77
|
const [ex3selectedValue, setEx3SelectedValue] = useState<string>("test1");
|
|
@@ -162,7 +162,7 @@ const DropdownExampleTemplate: StoryFn<typeof Dropdown> = (args, context) => {
|
|
|
162
162
|
return (selected as string[])
|
|
163
163
|
.map(
|
|
164
164
|
(value) =>
|
|
165
|
-
dropdownContent[value as keyof typeof dropdownContent]
|
|
165
|
+
dropdownContent[value as keyof typeof dropdownContent],
|
|
166
166
|
)
|
|
167
167
|
.join(", ");
|
|
168
168
|
}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { StoryFn, Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { StoryFn, Meta, StoryObj } from "@storybook/react-webpack5";
|
|
3
3
|
|
|
4
4
|
import Dropdown, {
|
|
5
5
|
DropdownDivider,
|
|
@@ -68,7 +68,7 @@ export default {
|
|
|
68
68
|
|
|
69
69
|
const BasicDropdownItemTemplate: StoryFn<typeof DropdownItem> = (
|
|
70
70
|
args,
|
|
71
|
-
context
|
|
71
|
+
context,
|
|
72
72
|
) => {
|
|
73
73
|
const classNameFromGlobal = context.globals.theme;
|
|
74
74
|
|
|
@@ -113,7 +113,7 @@ export const BasicDropdownItem: StoryObj<typeof DropdownItem> = {
|
|
|
113
113
|
|
|
114
114
|
const DropdownItemSelectStyleTemplate: StoryFn<typeof DropdownItem> = (
|
|
115
115
|
args,
|
|
116
|
-
context
|
|
116
|
+
context,
|
|
117
117
|
) => {
|
|
118
118
|
const classNameFromGlobal = context.globals.theme;
|
|
119
119
|
|
|
@@ -131,7 +131,7 @@ const DropdownItemSelectStyleTemplate: StoryFn<typeof DropdownItem> = (
|
|
|
131
131
|
} = event;
|
|
132
132
|
setSelectedValue2(
|
|
133
133
|
// On autofill we get a stringified value.
|
|
134
|
-
typeof value === "string" ? value.split(",") : (value as string[])
|
|
134
|
+
typeof value === "string" ? value.split(",") : (value as string[]),
|
|
135
135
|
);
|
|
136
136
|
};
|
|
137
137
|
|
|
@@ -226,7 +226,7 @@ export const DropdownItemSelectStyle: StoryObj<typeof DropdownItem> = {
|
|
|
226
226
|
|
|
227
227
|
const DropdownItemWithIconTextTemplate: StoryFn<typeof DropdownItem> = (
|
|
228
228
|
args,
|
|
229
|
-
context
|
|
229
|
+
context,
|
|
230
230
|
) => {
|
|
231
231
|
const classNameFromGlobal = context.globals.theme;
|
|
232
232
|
|
|
@@ -289,7 +289,7 @@ export const DropdownItemWithIconText: StoryObj<typeof DropdownItem> = {
|
|
|
289
289
|
|
|
290
290
|
const DropdownItemDividerSubtitleTemplate: StoryFn<typeof DropdownItem> = (
|
|
291
291
|
args,
|
|
292
|
-
context
|
|
292
|
+
context,
|
|
293
293
|
) => {
|
|
294
294
|
const classNameFromGlobal = context.globals.theme;
|
|
295
295
|
|
|
@@ -2,7 +2,7 @@ import React, { useEffect } from "react";
|
|
|
2
2
|
import Radio from "@/components/Radio";
|
|
3
3
|
import RadioGroup from "@/components/RadioGroup";
|
|
4
4
|
import FormLabel from "@/components/FormLabel";
|
|
5
|
-
import { Meta, StoryFn } from "@storybook/react";
|
|
5
|
+
import { Meta, StoryFn } from "@storybook/react-webpack5";
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
title: "Components/Radio",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
|
2
|
-
import { StoryFn, Meta } from "@storybook/react";
|
|
2
|
+
import { StoryFn, Meta } from "@storybook/react-webpack5";
|
|
3
3
|
import Toggle from "@/components/Toggle/Toggle";
|
|
4
4
|
import {
|
|
5
5
|
Box,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
TextField,
|
|
12
12
|
} from "@mui/material";
|
|
13
13
|
import FormLabel from "@/components/FormLabel";
|
|
14
|
-
import { action } from "
|
|
14
|
+
import { action } from "storybook/actions";
|
|
15
15
|
|
|
16
16
|
export default {
|
|
17
17
|
title: "Components/Toggle",
|
|
@@ -4,7 +4,7 @@ import { Bell } from "@lunit/design-system-icons";
|
|
|
4
4
|
|
|
5
5
|
import TextField from "@/components/TextField/TextField";
|
|
6
6
|
|
|
7
|
-
import type { StoryObj, Meta, StoryFn } from "@storybook/react";
|
|
7
|
+
import type { StoryObj, Meta, StoryFn } from "@storybook/react-webpack5";
|
|
8
8
|
|
|
9
9
|
export default {
|
|
10
10
|
title: "Components/TextField",
|
|
@@ -19,40 +19,33 @@ export default {
|
|
|
19
19
|
},
|
|
20
20
|
argTypes: {
|
|
21
21
|
multiline: {
|
|
22
|
-
control: {
|
|
23
|
-
type: "radio",
|
|
24
|
-
},
|
|
22
|
+
control: { type: "radio" },
|
|
25
23
|
options: [true, false],
|
|
26
24
|
description:
|
|
27
25
|
"The multiline prop transforms the text field into a TextareaAutosize element.",
|
|
28
26
|
},
|
|
29
27
|
error: {
|
|
30
|
-
control: {
|
|
31
|
-
type: "radio",
|
|
32
|
-
},
|
|
28
|
+
control: { type: "radio" },
|
|
33
29
|
options: [true, false],
|
|
34
30
|
description:
|
|
35
31
|
"The error prop toggles the error state. The helperText prop can then be used to provide feedback to the user about the error.",
|
|
36
32
|
},
|
|
37
33
|
disabled: {
|
|
38
|
-
control: {
|
|
39
|
-
type: "radio",
|
|
40
|
-
},
|
|
34
|
+
control: { type: "radio" },
|
|
41
35
|
options: [true, false],
|
|
42
36
|
description: "If true, the text field will be disabled.",
|
|
43
37
|
table: {
|
|
44
|
-
defaultValue: { summary: false },
|
|
45
|
-
type: { summary:
|
|
38
|
+
defaultValue: { summary: "false" },
|
|
39
|
+
type: { summary: "boolean" },
|
|
46
40
|
},
|
|
47
41
|
},
|
|
48
42
|
size: {
|
|
49
|
-
control: {
|
|
50
|
-
|
|
51
|
-
},
|
|
43
|
+
control: { type: "radio" },
|
|
44
|
+
options: ["small", "medium", "large"],
|
|
52
45
|
description: "The size of the text field.",
|
|
53
46
|
table: {
|
|
54
47
|
defaultValue: { summary: "small" },
|
|
55
|
-
type: { summary:
|
|
48
|
+
type: { summary: "string" },
|
|
56
49
|
},
|
|
57
50
|
},
|
|
58
51
|
placeholder: {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
|
|
11
11
|
import TextField from "@/components/TextField/TextField";
|
|
12
12
|
|
|
13
|
-
import type { StoryFn, Meta } from "@storybook/react";
|
|
13
|
+
import type { StoryFn, Meta } from "@storybook/react-webpack5";
|
|
14
14
|
|
|
15
15
|
export default {
|
|
16
16
|
title: "Components/TextField",
|
|
@@ -24,24 +24,21 @@ export default {
|
|
|
24
24
|
},
|
|
25
25
|
argTypes: {
|
|
26
26
|
disabled: {
|
|
27
|
-
control: {
|
|
28
|
-
type: "radio",
|
|
29
|
-
},
|
|
27
|
+
control: { type: "radio" },
|
|
30
28
|
options: [true, false],
|
|
31
29
|
description: "If true, the text field will be disabled.",
|
|
32
30
|
table: {
|
|
33
|
-
defaultValue: { summary: false },
|
|
34
|
-
type: { summary:
|
|
31
|
+
defaultValue: { summary: "false" },
|
|
32
|
+
type: { summary: "boolean" },
|
|
35
33
|
},
|
|
36
34
|
},
|
|
37
35
|
size: {
|
|
38
|
-
control: {
|
|
39
|
-
|
|
40
|
-
},
|
|
36
|
+
control: { type: "radio" },
|
|
37
|
+
options: ["small", "medium", "large"],
|
|
41
38
|
description: "The size of the text field.",
|
|
42
39
|
table: {
|
|
43
40
|
defaultValue: { summary: "small" },
|
|
44
|
-
type: { summary:
|
|
41
|
+
type: { summary: "string" },
|
|
45
42
|
},
|
|
46
43
|
},
|
|
47
44
|
rows: {
|
|
@@ -50,7 +47,7 @@ export default {
|
|
|
50
47
|
\n the rows default value is undefined.`,
|
|
51
48
|
table: {
|
|
52
49
|
defaultValue: { summary: "undefined" },
|
|
53
|
-
type: { summary:
|
|
50
|
+
type: { summary: "number" },
|
|
54
51
|
},
|
|
55
52
|
},
|
|
56
53
|
placeholder: {
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
TableHead,
|
|
8
8
|
TableRow,
|
|
9
9
|
} from "@mui/material";
|
|
10
|
-
import { action } from "
|
|
10
|
+
import { action } from "storybook/actions";
|
|
11
11
|
import { Bell } from "@lunit/design-system-icons";
|
|
12
12
|
|
|
13
13
|
import TextField from "@/components/TextField/TextField";
|
|
14
14
|
|
|
15
|
-
import type { StoryFn, Meta } from "@storybook/react";
|
|
15
|
+
import type { StoryFn, Meta } from "@storybook/react-webpack5";
|
|
16
16
|
|
|
17
17
|
export default {
|
|
18
18
|
title: "Components/TextField",
|
|
@@ -26,24 +26,21 @@ export default {
|
|
|
26
26
|
},
|
|
27
27
|
argTypes: {
|
|
28
28
|
disabled: {
|
|
29
|
-
control: {
|
|
30
|
-
type: "radio",
|
|
31
|
-
},
|
|
29
|
+
control: { type: "radio" },
|
|
32
30
|
options: [true, false],
|
|
33
31
|
description: "If true, the text field will be disabled.",
|
|
34
32
|
table: {
|
|
35
|
-
defaultValue: { summary: false },
|
|
36
|
-
type: { summary:
|
|
33
|
+
defaultValue: { summary: "false" },
|
|
34
|
+
type: { summary: "boolean" },
|
|
37
35
|
},
|
|
38
36
|
},
|
|
39
37
|
size: {
|
|
40
|
-
control: {
|
|
41
|
-
|
|
42
|
-
},
|
|
38
|
+
control: { type: "radio" },
|
|
39
|
+
options: ["small", "medium", "large"],
|
|
43
40
|
description: "The size of the text field.",
|
|
44
41
|
table: {
|
|
45
42
|
defaultValue: { summary: "small" },
|
|
46
|
-
type: { summary:
|
|
43
|
+
type: { summary: "string" },
|
|
47
44
|
},
|
|
48
45
|
},
|
|
49
46
|
placeholder: {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
|
|
11
11
|
import TextField from "@/components/TextField/TextField";
|
|
12
12
|
|
|
13
|
-
import type { StoryFn, Meta } from "@storybook/react";
|
|
13
|
+
import type { StoryFn, Meta } from "@storybook/react-webpack5";
|
|
14
14
|
|
|
15
15
|
export default {
|
|
16
16
|
title: "Components/TextField",
|
|
@@ -23,22 +23,21 @@ export default {
|
|
|
23
23
|
},
|
|
24
24
|
argTypes: {
|
|
25
25
|
disabled: {
|
|
26
|
-
control: {
|
|
27
|
-
type: "radio",
|
|
28
|
-
},
|
|
26
|
+
control: { type: "radio" },
|
|
29
27
|
options: [true, false],
|
|
30
28
|
description: "If true, the text field will be disabled.",
|
|
31
29
|
table: {
|
|
32
|
-
defaultValue: { summary: false },
|
|
33
|
-
type: { summary:
|
|
30
|
+
defaultValue: { summary: "false" },
|
|
31
|
+
type: { summary: "boolean" },
|
|
34
32
|
},
|
|
35
33
|
},
|
|
36
34
|
size: {
|
|
37
|
-
control:
|
|
35
|
+
control: { type: "radio" },
|
|
36
|
+
options: ["small", "medium", "large"],
|
|
38
37
|
description: "The size of the text field.",
|
|
39
38
|
table: {
|
|
40
39
|
defaultValue: { summary: "small" },
|
|
41
|
-
type: { summary:
|
|
40
|
+
type: { summary: "string" },
|
|
42
41
|
},
|
|
43
42
|
},
|
|
44
43
|
placeholder: {
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { StoryFn, Meta } from "@storybook/react";
|
|
2
|
+
import { StoryFn, Meta } from "@storybook/react-webpack5";
|
|
3
3
|
import { Box } from "@mui/material";
|
|
4
4
|
|
|
5
5
|
import Toast from "@/components/Toast";
|
|
6
|
-
import { action } from "
|
|
6
|
+
import { action } from "storybook/actions";
|
|
7
7
|
import Button from "@/components/Button";
|
|
8
8
|
|
|
9
9
|
export default {
|
|
10
10
|
title: "Components/Toast",
|
|
11
11
|
component: Toast,
|
|
12
|
+
args: {
|
|
13
|
+
onClose: action("onClose"),
|
|
14
|
+
},
|
|
12
15
|
argTypes: {
|
|
13
16
|
severity: {
|
|
14
17
|
control: "radio",
|
|
@@ -30,7 +33,9 @@ export default {
|
|
|
30
33
|
control: {
|
|
31
34
|
type: "select",
|
|
32
35
|
},
|
|
33
|
-
|
|
36
|
+
table: {
|
|
37
|
+
defaultValue: { summary: "function" },
|
|
38
|
+
},
|
|
34
39
|
options: ["function", undefined],
|
|
35
40
|
mapping: {
|
|
36
41
|
function: action("onClose"),
|