@lunit/design-system 2.0.1 → 2.1.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 +107 -7
- 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 +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/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/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +2 -2
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Chip/Chip.styled.js +9 -16
- package/dist/components/Chip/Chip.styled.js.map +1 -1
- package/dist/components/Dialog/Dialog.js +0 -6
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Dropdown/Dropdown.js +37 -4
- package/dist/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/components/Dropdown/Dropdown.styled.js +161 -0
- package/dist/components/Dropdown/Dropdown.styled.js.map +1 -0
- package/dist/components/Dropdown/Dropdown.types.js +2 -0
- package/dist/components/Dropdown/Dropdown.types.js.map +1 -0
- package/dist/components/Dropdown/DropdownItem.js +36 -0
- package/dist/components/Dropdown/DropdownItem.js.map +1 -0
- package/dist/components/Dropdown/index.js +1 -0
- package/dist/components/Dropdown/index.js.map +1 -1
- package/dist/components/Radio/Radio.js +2 -2
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/TextField/TextField.js +1 -1
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/TextField/TextField.style.js +27 -3
- package/dist/components/TextField/TextField.style.js.map +1 -1
- package/dist/foundation/Typography/index.js +5 -0
- package/dist/foundation/Typography/index.js.map +1 -1
- package/dist/foundation/Typography/tokens.js +44 -0
- package/dist/foundation/Typography/tokens.js.map +1 -1
- package/dist/foundation/colors/base/blue.js +12 -10
- package/dist/foundation/colors/base/blue.js.map +1 -1
- package/dist/foundation/colors/base/green.js +11 -9
- package/dist/foundation/colors/base/green.js.map +1 -1
- package/dist/foundation/colors/base/grey.js +30 -15
- package/dist/foundation/colors/base/grey.js.map +1 -1
- package/dist/foundation/colors/base/lunitTeal.js +2 -0
- package/dist/foundation/colors/base/lunitTeal.js.map +1 -1
- package/dist/foundation/colors/base/magenta.js +3 -1
- package/dist/foundation/colors/base/magenta.js.map +1 -1
- package/dist/foundation/colors/base/orange.js +11 -9
- package/dist/foundation/colors/base/orange.js.map +1 -1
- package/dist/foundation/colors/base/purple.js +3 -1
- package/dist/foundation/colors/base/purple.js.map +1 -1
- package/dist/foundation/colors/base/red.js +5 -3
- package/dist/foundation/colors/base/red.js.map +1 -1
- package/dist/foundation/colors/base/yellow.js +12 -10
- package/dist/foundation/colors/base/yellow.js.map +1 -1
- package/dist/foundation/colors/index.js +3 -0
- package/dist/foundation/colors/index.js.map +1 -1
- package/dist/foundation/colors/token/component.js +26 -22
- package/dist/foundation/colors/token/component.js.map +1 -1
- package/dist/foundation/colors/token/core.js +21 -0
- package/dist/foundation/colors/token/core.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/components/Button/Button.styled.d.ts +3 -3
- package/dist/types/components/Chip/Chip.styled.d.ts +8 -8
- package/dist/types/components/Dialog/Dialog.d.ts +0 -3
- package/dist/types/components/Dropdown/Dropdown.d.ts +3 -1
- package/dist/types/components/Dropdown/Dropdown.styled.d.ts +41 -0
- package/dist/types/components/Dropdown/Dropdown.types.d.ts +11 -0
- package/dist/types/components/Dropdown/DropdownItem.d.ts +13 -0
- package/dist/types/components/Dropdown/index.d.ts +2 -0
- package/dist/types/components/ToggleButton/ToggleButton.styled.d.ts +2 -2
- package/dist/types/foundation/Typography/index.d.ts +21 -1
- package/dist/types/foundation/Typography/tokens.d.ts +15 -0
- package/dist/types/foundation/colors/base/blue.d.ts +2 -0
- package/dist/types/foundation/colors/base/green.d.ts +2 -0
- package/dist/types/foundation/colors/base/grey.d.ts +15 -0
- package/dist/types/foundation/colors/base/lunitTeal.d.ts +2 -0
- package/dist/types/foundation/colors/base/magenta.d.ts +2 -0
- package/dist/types/foundation/colors/base/orange.d.ts +2 -0
- package/dist/types/foundation/colors/base/purple.d.ts +2 -0
- package/dist/types/foundation/colors/base/red.d.ts +2 -0
- package/dist/types/foundation/colors/base/yellow.d.ts +2 -0
- package/dist/types/foundation/colors/index.d.ts +3 -0
- package/dist/types/foundation/colors/types.d.ts +3 -0
- package/dist/types/foundation/index.d.ts +3 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/Checkbox/Checkbox.tsx +4 -4
- package/src/components/Chip/Chip.styled.ts +9 -16
- package/src/components/Dialog/Dialog.tsx +0 -8
- package/src/components/Dropdown/Dropdown.styled.tsx +170 -0
- package/src/components/Dropdown/Dropdown.tsx +59 -8
- package/src/components/Dropdown/Dropdown.types.ts +15 -0
- package/src/components/Dropdown/DropdownItem.tsx +107 -0
- package/src/components/Dropdown/index.ts +6 -0
- package/src/components/Radio/Radio.tsx +4 -4
- package/src/components/TextField/TextField.style.ts +28 -3
- package/src/components/TextField/TextField.tsx +1 -7
- package/src/foundation/Typography/index.ts +10 -0
- package/src/foundation/Typography/tokens.ts +45 -0
- package/src/foundation/colors/base/blue.ts +12 -10
- package/src/foundation/colors/base/green.ts +11 -9
- package/src/foundation/colors/base/grey.ts +30 -15
- package/src/foundation/colors/base/lunitTeal.ts +2 -0
- package/src/foundation/colors/base/magenta.ts +3 -1
- package/src/foundation/colors/base/orange.ts +11 -9
- package/src/foundation/colors/base/purple.ts +3 -1
- package/src/foundation/colors/base/red.ts +5 -3
- package/src/foundation/colors/base/yellow.ts +12 -10
- package/src/foundation/colors/index.ts +3 -0
- package/src/foundation/colors/token/component.ts +26 -22
- package/src/foundation/colors/token/core.ts +21 -0
- package/src/foundation/colors/types.ts +3 -0
- package/src/index.ts +6 -1
- package/src/stories/components/Chip/Chip.stories.tsx +18 -0
- package/src/stories/components/Chip/ChipDocs.mdx +20 -0
- package/src/stories/components/Dialog/DialogDocs.mdx +2 -10
- package/src/stories/components/Dropdown/Dropdown.stories.tsx +299 -10
- package/src/stories/components/Dropdown/DropdownExamples.stories.tsx +221 -0
- package/src/stories/components/Dropdown/DropdownItem.stories.tsx +360 -0
- package/src/stories/components/TextField/BasicTextField.stories.tsx +28 -0
- package/src/stories/components/TextField/TextFieldDocs.mdx +12 -0
- package/src/stories/foundation/Typography/Typography.stories.tsx +13 -0
- package/src/stories/foundation/Typography/const.ts +6 -1
- package/src/stories/foundation/colors/TokenPaletteTable.tsx +19 -1
- package/dist/cjs/components/Modal/index.js +0 -2
- package/dist/cjs/components/Modal/index.js.map +0 -1
- package/dist/components/Modal/Modal.js +0 -7
- package/dist/components/Modal/Modal.js.map +0 -1
- package/dist/components/Modal/index.js +0 -2
- package/dist/components/Modal/index.js.map +0 -1
- package/dist/types/components/Modal/Modal.d.ts +0 -2
- package/dist/types/components/Modal/index.d.ts +0 -1
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { StoryFn, Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
import Dropdown, {
|
|
5
|
+
DropdownDivider,
|
|
6
|
+
DropdownItem,
|
|
7
|
+
DropdownSubtitle,
|
|
8
|
+
} from "@/components/Dropdown";
|
|
9
|
+
import {
|
|
10
|
+
Box,
|
|
11
|
+
SelectChangeEvent,
|
|
12
|
+
Table,
|
|
13
|
+
TableBody,
|
|
14
|
+
TableCell,
|
|
15
|
+
TableHead,
|
|
16
|
+
TableRow,
|
|
17
|
+
} from "@mui/material";
|
|
18
|
+
import Demo from "@lunit/design-system-icons/Demo";
|
|
19
|
+
import ViewfinderT1 from "@lunit/design-system-icons/ViewfinderT1";
|
|
20
|
+
import RulerT2 from "@lunit/design-system-icons/RulerT2";
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
title: "Components/Dropdown",
|
|
24
|
+
component: DropdownItem,
|
|
25
|
+
argTypes: {
|
|
26
|
+
leftIcon: {
|
|
27
|
+
control: false,
|
|
28
|
+
description: `Use this prop when you want to add icon.
|
|
29
|
+
\n It is added to the left of the text criteria`,
|
|
30
|
+
table: {
|
|
31
|
+
defaultValue: { summary: "undefined" },
|
|
32
|
+
type: { summary: "JSX.Element" },
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
rightText: {
|
|
36
|
+
description: "Use this prop when you want to add text.",
|
|
37
|
+
table: {
|
|
38
|
+
defaultValue: { summary: "undefined" },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
isFilledStyle: {
|
|
42
|
+
control: {
|
|
43
|
+
type: "radio",
|
|
44
|
+
},
|
|
45
|
+
options: [true, false],
|
|
46
|
+
description: "Only for GNB or few situations of single select type.",
|
|
47
|
+
table: {
|
|
48
|
+
defaultValue: { summary: "false" },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
disabled: {
|
|
52
|
+
control: {
|
|
53
|
+
type: "radio",
|
|
54
|
+
},
|
|
55
|
+
options: [true, false],
|
|
56
|
+
description: "If true, the component will be disabled.",
|
|
57
|
+
table: {
|
|
58
|
+
defaultValue: { summary: "false" },
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
parameters: {
|
|
63
|
+
controls: {
|
|
64
|
+
include: ["leftIcon", "rightText", "isFilledStyle", "disabled"],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
} as Meta<typeof DropdownItem>;
|
|
68
|
+
|
|
69
|
+
const BasicDropdownItemTemplate: StoryFn<typeof DropdownItem> = (
|
|
70
|
+
args,
|
|
71
|
+
context
|
|
72
|
+
) => {
|
|
73
|
+
const classNameFromGlobal = context.globals.theme;
|
|
74
|
+
|
|
75
|
+
const [selectedValue, setSelectedValue] = useState<string>("test1");
|
|
76
|
+
const handleSelectedValueChange = (event: SelectChangeEvent<unknown>) => {
|
|
77
|
+
const {
|
|
78
|
+
target: { value },
|
|
79
|
+
} = event;
|
|
80
|
+
setSelectedValue(value as string);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<Box>
|
|
85
|
+
<Dropdown
|
|
86
|
+
className={classNameFromGlobal}
|
|
87
|
+
value={selectedValue}
|
|
88
|
+
onChange={handleSelectedValueChange}
|
|
89
|
+
sx={{ width: "150px" }}
|
|
90
|
+
open={true}
|
|
91
|
+
>
|
|
92
|
+
<DropdownItem value={"test1"} {...args}>
|
|
93
|
+
Conquer cancer through AI
|
|
94
|
+
</DropdownItem>
|
|
95
|
+
<DropdownItem value={"test2"} {...args}>
|
|
96
|
+
test item 2
|
|
97
|
+
</DropdownItem>
|
|
98
|
+
<DropdownItem value={"test3"} {...args}>
|
|
99
|
+
test item 3
|
|
100
|
+
</DropdownItem>
|
|
101
|
+
</Dropdown>
|
|
102
|
+
</Box>
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const BasicDropdownItem: StoryObj<typeof DropdownItem> = {
|
|
107
|
+
render: BasicDropdownItemTemplate,
|
|
108
|
+
name: "Basic DropdownItem",
|
|
109
|
+
parameters: {
|
|
110
|
+
chromatic: { disableSnapshot: true },
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const DropdownItemSelectStyleTemplate: StoryFn<typeof DropdownItem> = (
|
|
115
|
+
args,
|
|
116
|
+
context
|
|
117
|
+
) => {
|
|
118
|
+
const classNameFromGlobal = context.globals.theme;
|
|
119
|
+
|
|
120
|
+
const [selectedValue, setSelectedValue] = useState<string>("test1");
|
|
121
|
+
const handleSelectedValueChange = (event: SelectChangeEvent<unknown>) => {
|
|
122
|
+
const {
|
|
123
|
+
target: { value },
|
|
124
|
+
} = event;
|
|
125
|
+
setSelectedValue(value as string);
|
|
126
|
+
};
|
|
127
|
+
const [selectedValue2, setSelectedValue2] = useState<string[]>(["test1"]);
|
|
128
|
+
const handleSelectedValueChange2 = (event: SelectChangeEvent<unknown>) => {
|
|
129
|
+
const {
|
|
130
|
+
target: { value },
|
|
131
|
+
} = event;
|
|
132
|
+
setSelectedValue2(
|
|
133
|
+
// On autofill we get a stringified value.
|
|
134
|
+
typeof value === "string" ? value.split(",") : (value as string[])
|
|
135
|
+
);
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
return (
|
|
139
|
+
<Table sx={{ maxWidth: "1200px" }}>
|
|
140
|
+
<TableHead>
|
|
141
|
+
<TableRow>
|
|
142
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
143
|
+
Single select
|
|
144
|
+
</TableCell>
|
|
145
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
146
|
+
Single select(Filled Style)
|
|
147
|
+
</TableCell>
|
|
148
|
+
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
|
|
149
|
+
Multiple select
|
|
150
|
+
</TableCell>
|
|
151
|
+
</TableRow>
|
|
152
|
+
</TableHead>
|
|
153
|
+
<TableBody>
|
|
154
|
+
<TableRow>
|
|
155
|
+
<TableCell>
|
|
156
|
+
<Dropdown
|
|
157
|
+
className={classNameFromGlobal}
|
|
158
|
+
value={selectedValue}
|
|
159
|
+
onChange={handleSelectedValueChange}
|
|
160
|
+
sx={{ width: "150px" }}
|
|
161
|
+
>
|
|
162
|
+
<DropdownItem value={"test1"} {...args}>
|
|
163
|
+
Conquer cancer through AI
|
|
164
|
+
</DropdownItem>
|
|
165
|
+
<DropdownItem value={"test2"} {...args}>
|
|
166
|
+
test item 2
|
|
167
|
+
</DropdownItem>
|
|
168
|
+
<DropdownItem value={"test3"} {...args}>
|
|
169
|
+
test item 3
|
|
170
|
+
</DropdownItem>
|
|
171
|
+
</Dropdown>
|
|
172
|
+
</TableCell>
|
|
173
|
+
<TableCell>
|
|
174
|
+
<Dropdown
|
|
175
|
+
className={classNameFromGlobal}
|
|
176
|
+
value={selectedValue}
|
|
177
|
+
onChange={handleSelectedValueChange}
|
|
178
|
+
sx={{ width: "150px" }}
|
|
179
|
+
>
|
|
180
|
+
<DropdownItem value={"test1"} isFilledStyle {...args}>
|
|
181
|
+
Conquer cancer through AI
|
|
182
|
+
</DropdownItem>
|
|
183
|
+
<DropdownItem value={"test2"} isFilledStyle {...args}>
|
|
184
|
+
test item 2
|
|
185
|
+
</DropdownItem>
|
|
186
|
+
<DropdownItem value={"test3"} isFilledStyle {...args}>
|
|
187
|
+
test item 3
|
|
188
|
+
</DropdownItem>
|
|
189
|
+
</Dropdown>
|
|
190
|
+
</TableCell>
|
|
191
|
+
<TableCell>
|
|
192
|
+
<Dropdown
|
|
193
|
+
className={classNameFromGlobal}
|
|
194
|
+
select="multiple"
|
|
195
|
+
value={selectedValue2}
|
|
196
|
+
onChange={handleSelectedValueChange2}
|
|
197
|
+
sx={{ width: "230px" }}
|
|
198
|
+
>
|
|
199
|
+
<DropdownItem value={"test1"} {...args}>
|
|
200
|
+
test item1
|
|
201
|
+
</DropdownItem>
|
|
202
|
+
<DropdownItem value={"test2"} {...args}>
|
|
203
|
+
test item 2
|
|
204
|
+
</DropdownItem>
|
|
205
|
+
<DropdownItem value={"test3"} {...args}>
|
|
206
|
+
test item 3
|
|
207
|
+
</DropdownItem>
|
|
208
|
+
</Dropdown>
|
|
209
|
+
</TableCell>
|
|
210
|
+
</TableRow>
|
|
211
|
+
</TableBody>
|
|
212
|
+
</Table>
|
|
213
|
+
);
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
export const DropdownItemSelectStyle: StoryObj<typeof DropdownItem> = {
|
|
217
|
+
render: DropdownItemSelectStyleTemplate,
|
|
218
|
+
name: "DropdownItem : Style by Select Type",
|
|
219
|
+
parameters: {
|
|
220
|
+
controls: {
|
|
221
|
+
include: [],
|
|
222
|
+
},
|
|
223
|
+
chromatic: { disableSnapshot: true },
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const DropdownItemWithIconTextTemplate: StoryFn<typeof DropdownItem> = (
|
|
228
|
+
args,
|
|
229
|
+
context
|
|
230
|
+
) => {
|
|
231
|
+
const classNameFromGlobal = context.globals.theme;
|
|
232
|
+
|
|
233
|
+
const [selectedValue, setSelectedValue] = useState<string>("test1");
|
|
234
|
+
const handleSelectedValueChange = (event: SelectChangeEvent<unknown>) => {
|
|
235
|
+
const {
|
|
236
|
+
target: { value },
|
|
237
|
+
} = event;
|
|
238
|
+
setSelectedValue(value as string);
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
return (
|
|
242
|
+
<Box>
|
|
243
|
+
<Dropdown
|
|
244
|
+
className={classNameFromGlobal}
|
|
245
|
+
value={selectedValue}
|
|
246
|
+
onChange={handleSelectedValueChange}
|
|
247
|
+
sx={{ width: "150px" }}
|
|
248
|
+
open={true}
|
|
249
|
+
>
|
|
250
|
+
<DropdownItem
|
|
251
|
+
value={"test1"}
|
|
252
|
+
leftIcon={<Demo fontSize="small" />}
|
|
253
|
+
rightText="lunit"
|
|
254
|
+
{...args}
|
|
255
|
+
>
|
|
256
|
+
Conquer cancer through AI
|
|
257
|
+
</DropdownItem>
|
|
258
|
+
<DropdownItem
|
|
259
|
+
value={"test2"}
|
|
260
|
+
leftIcon={<RulerT2 fontSize="small" />}
|
|
261
|
+
rightText="design"
|
|
262
|
+
{...args}
|
|
263
|
+
>
|
|
264
|
+
test item 2
|
|
265
|
+
</DropdownItem>
|
|
266
|
+
<DropdownItem
|
|
267
|
+
value={"test3"}
|
|
268
|
+
leftIcon={<ViewfinderT1 fontSize="small" />}
|
|
269
|
+
rightText="system"
|
|
270
|
+
{...args}
|
|
271
|
+
>
|
|
272
|
+
test item 3
|
|
273
|
+
</DropdownItem>
|
|
274
|
+
</Dropdown>
|
|
275
|
+
</Box>
|
|
276
|
+
);
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
export const DropdownItemWithIconText: StoryObj<typeof DropdownItem> = {
|
|
280
|
+
render: DropdownItemWithIconTextTemplate,
|
|
281
|
+
name: "DropdownItem : With Left Icon, Right Text",
|
|
282
|
+
parameters: {
|
|
283
|
+
controls: {
|
|
284
|
+
include: [],
|
|
285
|
+
},
|
|
286
|
+
chromatic: { disableSnapshot: true },
|
|
287
|
+
},
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
const DropdownItemDividerSubtitleTemplate: StoryFn<typeof DropdownItem> = (
|
|
291
|
+
args,
|
|
292
|
+
context
|
|
293
|
+
) => {
|
|
294
|
+
const classNameFromGlobal = context.globals.theme;
|
|
295
|
+
|
|
296
|
+
const [selectedValue, setSelectedValue] = useState<string>("test1");
|
|
297
|
+
const handleSelectedValueChange = (event: SelectChangeEvent<unknown>) => {
|
|
298
|
+
const {
|
|
299
|
+
target: { value },
|
|
300
|
+
} = event;
|
|
301
|
+
setSelectedValue(value as string);
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
return (
|
|
305
|
+
<Box>
|
|
306
|
+
<Dropdown
|
|
307
|
+
className={classNameFromGlobal}
|
|
308
|
+
value={selectedValue}
|
|
309
|
+
onChange={handleSelectedValueChange}
|
|
310
|
+
sx={{ width: "150px" }}
|
|
311
|
+
open={true}
|
|
312
|
+
>
|
|
313
|
+
<DropdownSubtitle title="Subtitle 1" />
|
|
314
|
+
<DropdownItem
|
|
315
|
+
value={"test1"}
|
|
316
|
+
leftIcon={<Demo fontSize="small" />}
|
|
317
|
+
{...args}
|
|
318
|
+
>
|
|
319
|
+
Conquer cancer through AI
|
|
320
|
+
</DropdownItem>
|
|
321
|
+
<DropdownItem
|
|
322
|
+
value={"test2"}
|
|
323
|
+
leftIcon={<RulerT2 fontSize="small" />}
|
|
324
|
+
{...args}
|
|
325
|
+
>
|
|
326
|
+
test item 2
|
|
327
|
+
</DropdownItem>
|
|
328
|
+
<DropdownItem
|
|
329
|
+
value={"test3"}
|
|
330
|
+
leftIcon={<ViewfinderT1 fontSize="small" />}
|
|
331
|
+
{...args}
|
|
332
|
+
>
|
|
333
|
+
test item 3
|
|
334
|
+
</DropdownItem>
|
|
335
|
+
<DropdownDivider />
|
|
336
|
+
<DropdownSubtitle title="Subtitle 2" />
|
|
337
|
+
<DropdownItem value={"test4"} {...args}>
|
|
338
|
+
Example 1
|
|
339
|
+
</DropdownItem>
|
|
340
|
+
<DropdownItem value={"test5"} {...args}>
|
|
341
|
+
Example 2
|
|
342
|
+
</DropdownItem>
|
|
343
|
+
<DropdownItem value={"test6"} {...args}>
|
|
344
|
+
Example 3
|
|
345
|
+
</DropdownItem>
|
|
346
|
+
</Dropdown>
|
|
347
|
+
</Box>
|
|
348
|
+
);
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
export const DropdownItemDividerSubtitle: StoryObj<typeof DropdownItem> = {
|
|
352
|
+
render: DropdownItemDividerSubtitleTemplate,
|
|
353
|
+
name: "DropdownItem : Divider, Subtitle",
|
|
354
|
+
parameters: {
|
|
355
|
+
controls: {
|
|
356
|
+
include: [],
|
|
357
|
+
},
|
|
358
|
+
chromatic: { disableSnapshot: true },
|
|
359
|
+
},
|
|
360
|
+
};
|
|
@@ -140,6 +140,34 @@ export const Disabled: StoryObj<typeof TextField> = {
|
|
|
140
140
|
},
|
|
141
141
|
};
|
|
142
142
|
|
|
143
|
+
const ReadOnlyTemplate: StoryFn<typeof TextField> = (args) => {
|
|
144
|
+
return (
|
|
145
|
+
<Box sx={{ display: "flex", gap: 2 }}>
|
|
146
|
+
<TextField
|
|
147
|
+
{...args}
|
|
148
|
+
inputProps={{ readOnly: true }}
|
|
149
|
+
defaultValue="Conquer Cancer through AI."
|
|
150
|
+
/>
|
|
151
|
+
<TextField
|
|
152
|
+
{...args}
|
|
153
|
+
multiline={true}
|
|
154
|
+
inputProps={{ readOnly: true }}
|
|
155
|
+
defaultValue="Conquer Cancer through AI. We develop AI that detects early-stage cancer and optimizes cancer treatment."
|
|
156
|
+
/>
|
|
157
|
+
</Box>
|
|
158
|
+
);
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export const ReadOnly: StoryObj<typeof TextField> = {
|
|
162
|
+
render: ReadOnlyTemplate,
|
|
163
|
+
parameters: {
|
|
164
|
+
controls: {
|
|
165
|
+
include: ["size", "helperText", "error", "disabled"],
|
|
166
|
+
},
|
|
167
|
+
chromatic: { disableSnapshot: true },
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
|
|
143
171
|
const ErrorTemplate: StoryFn<typeof TextField> = (args) => {
|
|
144
172
|
return (
|
|
145
173
|
<Box sx={{ display: "flex", gap: 2 }}>
|
|
@@ -78,6 +78,18 @@ Default disabled is `false`.
|
|
|
78
78
|
<TextField multiline disabled />
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
+
### ReadOnly
|
|
82
|
+
|
|
83
|
+
The read-only textField can be applied with inputProps's the readOnly property.<br />
|
|
84
|
+
You can save the text value you want to show in defaultValue property.
|
|
85
|
+
|
|
86
|
+
<Canvas of={TextFieldStories.ReadOnly} sourceState="none" />
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
<TextField inputProps={{ readOnly: true }} defaultValue="Conquer Cancer through AI." />
|
|
90
|
+
<TextField multiline inputProps={{ readOnly: true }} defaultValue="Conquer Cancer through AI. We develop AI that detects early-stage cancer and optimizes cancer treatment."/>
|
|
91
|
+
```
|
|
92
|
+
|
|
81
93
|
### Error
|
|
82
94
|
|
|
83
95
|
The error prop toggles the error state.<br />
|
|
@@ -29,6 +29,19 @@ export const AllVariants = () => (
|
|
|
29
29
|
}
|
|
30
30
|
variants={variants.body}
|
|
31
31
|
/>
|
|
32
|
+
<TypographyGroup
|
|
33
|
+
heading="Small Body Variation"
|
|
34
|
+
dummy={
|
|
35
|
+
<>
|
|
36
|
+
AI will be the new standard of care. 123456789
|
|
37
|
+
<br />
|
|
38
|
+
By Lunit. With AI, we aim to make data-driven medicine
|
|
39
|
+
<br />
|
|
40
|
+
the new standard of care.
|
|
41
|
+
</>
|
|
42
|
+
}
|
|
43
|
+
variants={variants.smallBody}
|
|
44
|
+
/>
|
|
32
45
|
<TypographyGroup
|
|
33
46
|
heading="etc"
|
|
34
47
|
dummy="NEWS & UPDATE 71456"
|
|
@@ -13,13 +13,18 @@ const body = [
|
|
|
13
13
|
"body2_14_regular",
|
|
14
14
|
"body3_12_semibold",
|
|
15
15
|
"body3_12_regular",
|
|
16
|
+
"body_m2",
|
|
17
|
+
"body_reg6",
|
|
18
|
+
"body_reg8",
|
|
16
19
|
] as const;
|
|
20
|
+
const smallBody = ["small_body_sb1", "small_body_m2"] as const;
|
|
17
21
|
const etc = ["button1", "button2", "caption", "overline"] as const;
|
|
18
22
|
|
|
19
23
|
export const variants = {
|
|
20
24
|
headline,
|
|
21
25
|
body,
|
|
26
|
+
smallBody,
|
|
22
27
|
etc,
|
|
23
28
|
};
|
|
24
29
|
|
|
25
|
-
export const variantArray = [...headline, ...body, ...etc];
|
|
30
|
+
export const variantArray = [...headline, ...body, ...smallBody, ...etc];
|
|
@@ -78,6 +78,16 @@ const TokenPaletteTable = ({ kind }: TokenPaletteTableProps) => {
|
|
|
78
78
|
);
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
+
const deprecatedTokenList = [
|
|
82
|
+
"btn_secondary_border",
|
|
83
|
+
"btn_selected_secondary_bg",
|
|
84
|
+
"datatable_border_01",
|
|
85
|
+
"datatable_border_02",
|
|
86
|
+
"hover",
|
|
87
|
+
"focused",
|
|
88
|
+
"selected",
|
|
89
|
+
];
|
|
90
|
+
|
|
81
91
|
return (
|
|
82
92
|
<TableContainer>
|
|
83
93
|
<Table stickyHeader>
|
|
@@ -100,7 +110,15 @@ const TokenPaletteTable = ({ kind }: TokenPaletteTableProps) => {
|
|
|
100
110
|
<TableRow key={paletteKey}>
|
|
101
111
|
<TableCell sx={{ height: "72px" }}>
|
|
102
112
|
<StyledTypography>
|
|
103
|
-
{kind}.{paletteKey}
|
|
113
|
+
{kind}.{paletteKey}{" "}
|
|
114
|
+
{deprecatedTokenList.includes(paletteKey) && (
|
|
115
|
+
<Box
|
|
116
|
+
component="span"
|
|
117
|
+
sx={{ color: "red", fontWeight: "bold" }}
|
|
118
|
+
>
|
|
119
|
+
(Deprecated)
|
|
120
|
+
</Box>
|
|
121
|
+
)}
|
|
104
122
|
</StyledTypography>
|
|
105
123
|
</TableCell>
|
|
106
124
|
<TokenPaletteCell
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var e={d:(r,t)=>{for(var o in t)e.o(t,o)&&!e.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:t[o]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{default:()=>l});const t=require("react/jsx-runtime"),o=require("@mui/material"),l=()=>(0,t.jsx)(o.Box,{children:"Modal"});module.exports=r})();
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"components/Modal/index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFV,EAAyBC,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,mCCL9D,MAAM,EAA+BC,QAAQ,qBCAvC,EAA+BA,QAAQ,iBCO7C,EAJc,KACL,SAAC,EAAAC,IAAG,oB","sources":["webpack://@lunit/design-system/webpack/bootstrap","webpack://@lunit/design-system/webpack/runtime/define property getters","webpack://@lunit/design-system/webpack/runtime/hasOwnProperty shorthand","webpack://@lunit/design-system/webpack/runtime/make namespace object","webpack://@lunit/design-system/external commonjs \"react/jsx-runtime\"","webpack://@lunit/design-system/external commonjs \"@mui/material\"","webpack://@lunit/design-system/./src/components/Modal/Modal.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react/jsx-runtime\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material\");","import React from \"react\";\nimport { Box } from \"@mui/material\";\n\nconst Modal = () => {\n return <Box>Modal</Box>;\n};\n\nexport default Modal;\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","Box"],"sourceRoot":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,MAAM,KAAK,GAAG,GAAG,EAAE;IACjB,OAAO,KAAC,GAAG,wBAAY,CAAC;AAC1B,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Modal";
|