@lunit/design-system 1.0.0-a.2 → 1.0.0-a.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.
Files changed (161) hide show
  1. package/.babelrc.json +16 -0
  2. package/dist/cjs/components/Alert/index.js +1 -1
  3. package/dist/cjs/components/Alert/index.js.map +1 -1
  4. package/dist/cjs/components/Button/index.js +1 -1
  5. package/dist/cjs/components/Button/index.js.map +1 -1
  6. package/dist/cjs/components/Chip/index.js +1 -1
  7. package/dist/cjs/components/Chip/index.js.map +1 -1
  8. package/dist/cjs/components/TextField/index.js +1 -1
  9. package/dist/cjs/components/TextField/index.js.map +1 -1
  10. package/dist/cjs/components/ToggleButton/index.js +1 -1
  11. package/dist/cjs/components/ToggleButton/index.js.map +1 -1
  12. package/dist/cjs/index.js +1 -1
  13. package/dist/cjs/index.js.map +1 -1
  14. package/dist/components/Alert/Alert.js +16 -4
  15. package/dist/components/Alert/Alert.js.map +1 -1
  16. package/dist/components/Alert/Alert.styled.js +48 -0
  17. package/dist/components/Alert/Alert.styled.js.map +1 -0
  18. package/dist/components/Alert/Alert.types.js +2 -0
  19. package/dist/components/Alert/Alert.types.js.map +1 -0
  20. package/dist/components/Alert/Alert.utils..js +38 -0
  21. package/dist/components/Alert/Alert.utils..js.map +1 -0
  22. package/dist/components/Button/Button.js +1 -1
  23. package/dist/components/Button/Button.js.map +1 -1
  24. package/dist/components/Button/Button.styled.js +31 -21
  25. package/dist/components/Button/Button.styled.js.map +1 -1
  26. package/dist/components/Button/utils/getHoverStyle.js +7 -0
  27. package/dist/components/Button/utils/getHoverStyle.js.map +1 -0
  28. package/dist/components/Chip/Chip.js +1 -1
  29. package/dist/components/Chip/Chip.js.map +1 -1
  30. package/dist/components/Chip/Chip.styled.js +2 -3
  31. package/dist/components/Chip/Chip.styled.js.map +1 -1
  32. package/dist/components/TextField/TextField.js +15 -3
  33. package/dist/components/TextField/TextField.js.map +1 -1
  34. package/dist/components/TextField/TextField.style.js +245 -0
  35. package/dist/components/TextField/TextField.style.js.map +1 -0
  36. package/dist/components/TextField/TextField.types.js +2 -0
  37. package/dist/components/TextField/TextField.types.js.map +1 -0
  38. package/dist/components/TextField/TextFieldIcon.js +7 -0
  39. package/dist/components/TextField/TextFieldIcon.js.map +1 -0
  40. package/dist/components/Toast/Toast.js +26 -0
  41. package/dist/components/Toast/Toast.js.map +1 -0
  42. package/dist/components/Toast/Toast.styled.js +49 -0
  43. package/dist/components/Toast/Toast.styled.js.map +1 -0
  44. package/dist/components/Toast/Toast.types.js +2 -0
  45. package/dist/components/Toast/Toast.types.js.map +1 -0
  46. package/dist/components/Toast/Toast.utils.js +14 -0
  47. package/dist/components/Toast/Toast.utils.js.map +1 -0
  48. package/dist/components/Toast/index.js +2 -0
  49. package/dist/components/Toast/index.js.map +1 -0
  50. package/dist/foundation/colors/base/grey.js +16 -0
  51. package/dist/foundation/colors/base/grey.js.map +1 -1
  52. package/dist/foundation/colors/base/lunitGreen.js +2 -2
  53. package/dist/foundation/colors/base/lunitGreen.js.map +1 -1
  54. package/dist/foundation/colors/base/lunitTeal.js +5 -5
  55. package/dist/foundation/colors/base/lunitTeal.js.map +1 -1
  56. package/dist/foundation/colors/base/red.js +2 -2
  57. package/dist/foundation/colors/index.js +24 -4
  58. package/dist/foundation/colors/index.js.map +1 -1
  59. package/dist/foundation/colors/token/component.js +265 -291
  60. package/dist/foundation/colors/token/component.js.map +1 -1
  61. package/dist/foundation/colors/token/core.js +132 -125
  62. package/dist/foundation/colors/token/core.js.map +1 -1
  63. package/dist/index.js +1 -0
  64. package/dist/index.js.map +1 -1
  65. package/dist/theme.js +5 -0
  66. package/dist/theme.js.map +1 -1
  67. package/dist/types/components/Alert/Alert.d.ts +3 -1
  68. package/dist/types/components/Alert/Alert.styled.d.ts +6 -0
  69. package/dist/types/components/Alert/Alert.types.d.ts +9 -0
  70. package/dist/types/components/Alert/Alert.utils..d.ts +4 -0
  71. package/dist/types/components/Button/Button.d.ts +1 -1
  72. package/dist/types/components/Button/Button.styled.d.ts +26 -2
  73. package/dist/types/components/Button/Button.types.d.ts +4 -4
  74. package/dist/types/components/Button/utils/getHoverStyle.d.ts +6 -0
  75. package/dist/types/components/Chip/Chip.styled.d.ts +9 -9
  76. package/dist/types/components/Chip/Chip.types.d.ts +1 -1
  77. package/dist/types/components/TextField/TextField.d.ts +2 -1
  78. package/dist/types/components/TextField/TextField.style.d.ts +9 -0
  79. package/dist/types/components/TextField/TextField.types.d.ts +29 -0
  80. package/dist/types/components/TextField/TextFieldIcon.d.ts +8 -0
  81. package/dist/types/components/TextField/index.d.ts +1 -0
  82. package/dist/types/components/Toast/Toast.d.ts +4 -0
  83. package/dist/types/components/Toast/Toast.styled.d.ts +1 -0
  84. package/dist/types/components/Toast/Toast.types.d.ts +4 -0
  85. package/dist/types/components/Toast/Toast.utils.d.ts +2 -0
  86. package/dist/types/components/Toast/index.d.ts +1 -0
  87. package/dist/types/components/ToggleButton/ToggleButton.styled.d.ts +1 -1
  88. package/dist/types/components/ToggleButton/ToggleButton.types.d.ts +4 -4
  89. package/dist/types/foundation/colors/base/grey.d.ts +16 -0
  90. package/dist/types/foundation/colors/base/lunitGreen.d.ts +2 -2
  91. package/dist/types/foundation/colors/base/lunitTeal.d.ts +2 -2
  92. package/dist/types/foundation/colors/index.d.ts +42 -9
  93. package/dist/types/foundation/colors/types.d.ts +1 -3
  94. package/dist/types/foundation/index.d.ts +37 -5
  95. package/dist/types/index.d.ts +1 -0
  96. package/package.json +21 -16
  97. package/src/components/Alert/Alert.styled.ts +60 -0
  98. package/src/components/Alert/Alert.tsx +49 -5
  99. package/src/components/Alert/Alert.types.ts +10 -0
  100. package/src/components/Alert/Alert.utils..ts +41 -0
  101. package/src/components/Button/Button.styled.ts +33 -21
  102. package/src/components/Button/Button.tsx +1 -5
  103. package/src/components/Button/Button.types.ts +4 -4
  104. package/src/components/Button/utils/getHoverStyle.ts +7 -0
  105. package/src/components/Chip/Chip.styled.ts +6 -4
  106. package/src/components/Chip/Chip.tsx +1 -1
  107. package/src/components/Chip/Chip.types.ts +2 -2
  108. package/src/components/TextField/TextField.style.ts +316 -0
  109. package/src/components/TextField/TextField.tsx +75 -3
  110. package/src/components/TextField/TextField.types.ts +38 -0
  111. package/src/components/TextField/TextFieldIcon.tsx +24 -0
  112. package/src/components/TextField/index.ts +6 -0
  113. package/src/components/Toast/Toast.styled.ts +49 -0
  114. package/src/components/Toast/Toast.tsx +66 -0
  115. package/src/components/Toast/Toast.types.ts +14 -0
  116. package/src/components/Toast/Toast.utils.ts +15 -0
  117. package/src/components/Toast/index.tsx +1 -0
  118. package/src/components/ToggleButton/ToggleButton.types.ts +4 -7
  119. package/src/foundation/colors/base/grey.ts +17 -0
  120. package/src/foundation/colors/base/lunitGreen.ts +2 -2
  121. package/src/foundation/colors/base/lunitTeal.ts +5 -5
  122. package/src/foundation/colors/base/red.ts +2 -2
  123. package/src/foundation/colors/index.ts +29 -8
  124. package/src/foundation/colors/token/component.ts +300 -326
  125. package/src/foundation/colors/token/core.ts +152 -145
  126. package/src/foundation/colors/types.ts +1 -3
  127. package/src/index.ts +1 -0
  128. package/src/stories/components/Alert/Alert.stories.tsx +148 -4
  129. package/src/stories/components/Button/BasicButton.stories.tsx +19 -28
  130. package/src/stories/components/Button/IconButton.stories.tsx +39 -28
  131. package/src/stories/components/Button/Kind.stories.tsx +83 -57
  132. package/src/stories/components/Chip/Chip.stories.tsx +94 -82
  133. package/src/stories/components/DataTable/DataTable.stories.tsx +6 -4
  134. package/src/stories/components/DatePicker/DatePicker.stories.tsx +6 -4
  135. package/src/stories/components/Dropdown/Dropdown.stories.tsx +12 -6
  136. package/src/stories/components/Modal/Modal.stories.tsx +6 -4
  137. package/src/stories/components/SelectControl/Checkbox.stories.tsx +31 -23
  138. package/src/stories/components/SelectControl/RadioGroup.stories.tsx +6 -5
  139. package/src/stories/components/SelectControl/RadioStatus.stories.tsx +6 -4
  140. package/src/stories/components/SelectControl/Toggle.stories.tsx +33 -19
  141. package/src/stories/components/TextField/TextFieldMulti.stories.tsx +137 -0
  142. package/src/stories/components/TextField/TextFieldSingle.stories.tsx +283 -0
  143. package/src/stories/components/TextField/TextFieldSize.stories.tsx +134 -0
  144. package/src/stories/components/Toast/Toast.stories.tsx +152 -0
  145. package/src/stories/components/ToggleButton/Basic.stories.tsx +35 -31
  146. package/src/stories/components/ToggleButton/Group.stories.tsx +21 -21
  147. package/src/stories/components/ToggleButton/ToggleButtonKind.stories.tsx +53 -43
  148. package/src/stories/components/ToggleButton/WithIcon.stories.tsx +35 -36
  149. package/src/stories/components/Tooltip/Tooltip.stories.tsx +6 -4
  150. package/src/stories/foundation/Elevation/Elevation.stories.tsx +10 -6
  151. package/src/stories/foundation/Typography/{Typography.stories.mdx → Typography.mdx} +10 -5
  152. package/src/stories/foundation/Typography/Typography.stories.tsx +46 -36
  153. package/src/stories/foundation/Typography/TypographyExamples.stories.tsx +44 -0
  154. package/src/stories/foundation/colors/Colors.stories.tsx +7 -5
  155. package/src/stories/foundation/colors/Mui.stories.tsx +18 -0
  156. package/src/stories/foundation/colors/Token.inComponent.stories.tsx +2 -2
  157. package/src/stories/foundation/colors/TokenPaletteTable.stories.tsx +28 -0
  158. package/src/stories/foundation/colors/TokenPaletteTable.tsx +127 -0
  159. package/src/theme.ts +5 -0
  160. package/src/stories/components/TextField/TextField.stories.tsx +0 -13
  161. package/src/stories/foundation/colors/Token.stories.tsx +0 -190
@@ -1,20 +1,26 @@
1
1
  import React from "react";
2
- import { Bell } from "@lunit/design-system-icons";
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 { ComponentStory, ComponentMeta } from "@storybook/react";
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
- \n It is added to the left of the text criteria,
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 ComponentMeta<typeof Button>;
98
+ } as Meta<typeof Button>;
99
99
 
100
- const IconButtonTemplate: ComponentStory<typeof Button> = (args) => (
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 = IconButtonTemplate.bind({});
107
- IconOnlyButton.argTypes = {
108
- children: {
109
- control: false,
110
- type: "string",
111
- table: {
112
- defaultValue: { summary: "undefined" },
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 = IconButtonTemplate.bind({});
119
- IconWithTextButton.argTypes = {
120
- children: {
121
- type: "string",
122
- defaultValue: "Text",
123
- table: {
124
- defaultValue: { summary: "undefined" },
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 { ComponentStory, ComponentMeta } from "@storybook/react";
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 ComponentMeta<typeof Button>;
90
+ } as Meta<typeof Button>;
79
91
 
80
- const ButtonTemplate: ComponentStory<typeof Button> = ({
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 = ButtonTemplate.bind({});
155
+ export const Kind = {
156
+ render: ButtonTemplate,
157
+ };
144
158
 
145
- const ContainedButtonTemplate: ComponentStory<typeof Button> = (args) => {
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="hover" kind="contained">
207
+ <Button {...args} id="hover1" kind="contained">
194
208
  {args.children}
195
209
  </Button>
196
210
  </TableCell>
197
211
  <TableCell>
198
- <Button {...args} id="hover" kind="contained" color="secondary">
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="hover" kind="contained" color="error">
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 = ContainedButtonTemplate.bind({});
269
- KindContained.argTypes = {
270
- color: {
271
- control: "false",
272
- options: ["primary", "secondary", "error"],
273
- defaultValue: "primary",
274
- description: `The color of the component.
275
- \n It supports both default and custom theme colors,
276
- \n which can be added as shown in the palette customization guide.`,
277
- table: {
278
- defaultValue: { summary: "primary" },
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: ComponentStory<typeof Button> = (args) => {
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="hover" kind="ghost">
350
+ <Button {...args} id="hover4" kind="ghost">
333
351
  {args.children}
334
352
  </Button>
335
353
  </TableCell>
336
354
  <TableCell>
337
- <Button {...args} id="hover" kind="ghost" color="secondary">
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="hover" kind="ghost" color="error">
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 = GhostButtonTemplate.bind({});
410
- KindGhost.argTypes = {
411
- color: {
412
- control: "false",
413
- options: ["primary", "secondary", "error"],
414
- description: `The color of the component.
415
- \n It supports both default and custom theme colors,
416
- \n which can be added as shown in the palette customization guide.`,
417
- defaultValue: "primary",
418
- table: {
419
- defaultValue: { summary: "primary" },
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: ComponentStory<typeof Button> = ({
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="hover" kind="outlined">
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 = OutlinedButtonTemplate.bind({});
500
- KindOutlined.argTypes = {
501
- color: {
502
- control: "false",
503
- options: ["primary"],
504
- defaultValue: "primary",
505
- description: `The color of the component.
506
- \n It supports both default and custom theme colors,
507
- \n which can be added as shown in the palette customization guide.`,
508
- table: {
509
- type: { summary: "primary" },
510
- defaultValue: { summary: "primary" },
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 { ComponentStory, ComponentMeta } from "@storybook/react";
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 ComponentMeta<typeof Chip>;
95
+ } as Meta<typeof Chip>;
108
96
 
109
- const Template: ComponentStory<typeof Chip> = (args) => <Chip {...args} />;
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
- export const Outlined = Template.bind({});
116
+ args: {
117
+ color: "primary",
118
+ kind: "outlined",
119
+ },
112
120
 
113
- Outlined.parameters = {
114
- docs: {
115
- description: {
116
- story: `Outlined chip only contains label and shows the state of disabled.`,
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
- controls: {
120
- exclude: [
121
- "thumbnail",
122
- "onClick",
123
- "onDelete",
124
- "disabled",
125
- "clickable",
126
- "skipFocusWhenDisabled",
127
- ],
137
+
138
+ args: {
139
+ color: "primary",
140
+ kind: "contained",
128
141
  },
129
- };
130
- Outlined.args = {
131
- color: "primary",
132
- kind: "outlined",
142
+
143
+ name: "Kind: Contained / Read Only",
133
144
  };
134
145
 
135
- export const Contained = Template.bind({});
136
- Contained.parameters = {
137
- controls: {
138
- exclude: [
139
- "thumbnail",
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
- export const ContainedWithClick = Template.bind({});
154
- ContainedWithClick.args = {
155
- onClick: action("onClick"),
156
- onDelete: undefined,
157
- };
158
- ContainedWithClick.parameters = {
159
- docs: {
160
- description: {
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
- export const ContainedWithDelete = Template.bind({});
170
- ContainedWithDelete.args = {
171
- ...Contained.args,
172
- onClick: undefined,
173
- onDelete: action("onDelete"),
164
+ name: "Kind: Contained / Enable",
174
165
  };
175
- ContainedWithDelete.parameters = {
176
- docs: {
177
- description: {
178
- story: `Contained chip can have delete button. When Chip is deletable, onClick is disabled.`,
179
- },
166
+
167
+ export const ContainedWithDelete = {
168
+ args: {
169
+ ...Contained.args,
170
+ onClick: undefined,
171
+ onDelete: action("onDelete"),
180
172
  },
181
- controls: {
182
- exclude: ["onClick", "clickable"],
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
- export const ContainedWithThumbnail = Template.bind({});
187
- ContainedWithThumbnail.args = {
188
- thumbnail: "Initial",
185
+ name: "Kind: Contained / Deletable",
189
186
  };
190
- ContainedWithThumbnail.parameters = {
191
- docs: {
192
- description: {
193
- story: `Contained chip can have thumbnail as "avatar", "logo", and lunit icons.`,
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 { ComponentStory, ComponentMeta } from "@storybook/react";
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 ComponentMeta<typeof DataTable>;
9
+ } as Meta<typeof DataTable>;
10
10
 
11
- const Template: ComponentStory<typeof DataTable> = () => <DataTable />;
11
+ const Template: StoryFn<typeof DataTable> = () => <DataTable />;
12
12
 
13
- export const LunitDataTable = Template.bind({});
13
+ export const LunitDataTable = {
14
+ render: Template,
15
+ };
@@ -1,13 +1,15 @@
1
1
  import React from "react";
2
- import { ComponentStory, ComponentMeta } from "@storybook/react";
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 ComponentMeta<typeof DatePicker>;
9
+ } as Meta<typeof DatePicker>;
10
10
 
11
- const Template: ComponentStory<typeof DatePicker> = () => <DatePicker />;
11
+ const Template: StoryFn<typeof DatePicker> = () => <DatePicker />;
12
12
 
13
- export const LunitDatePicker = Template.bind({});
13
+ export const LunitDatePicker = {
14
+ render: Template,
15
+ };