@ceed/cds 1.34.0 → 1.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordions/Accordions.d.ts +1 -0
- package/dist/components/Alert/Alert.d.ts +5 -5
- package/dist/components/Autocomplete/Autocomplete.d.ts +2 -2
- package/dist/components/Avatar/Avatar.d.ts +7 -17
- package/dist/components/Box/Box.d.ts +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +6 -5
- package/dist/components/Button/Button.d.ts +3 -2
- package/dist/components/Calendar/Calendar.d.ts +1 -0
- package/dist/components/Card/Card.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/Chip/Chip.d.ts +1 -0
- package/dist/components/Container/Container.d.ts +6 -1
- package/dist/components/CurrencyInput/CurrencyInput.d.ts +1 -1
- package/dist/components/DialogActions/DialogActions.d.ts +1 -0
- package/dist/components/DialogContent/DialogContent.d.ts +1 -0
- package/dist/components/DialogFrame/DialogFrame.d.ts +1 -1
- package/dist/components/DialogTitle/DialogTitle.d.ts +1 -0
- package/dist/components/Divider/Divider.d.ts +1 -0
- package/dist/components/Drawer/Drawer.d.ts +1 -0
- package/dist/components/Dropdown/Dropdown.d.ts +28 -1
- package/dist/components/FormControl/FormControl.d.ts +1 -0
- package/dist/components/FormHelperText/FormHelperText.d.ts +1 -0
- package/dist/components/FormLabel/FormLabel.d.ts +1 -0
- package/dist/components/Grid/Grid.d.ts +1 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -2
- package/dist/components/IconMenuButton/IconMenuButton.d.ts +7 -6
- package/dist/components/InfoSign/InfoSign.d.ts +3 -2
- package/dist/components/Input/Input.d.ts +8 -22
- package/dist/components/InsetDrawer/InsetDrawer.d.ts +1 -0
- package/dist/components/Markdown/Markdown.d.ts +9 -24
- package/dist/components/Menu/Menu.d.ts +2 -1
- package/dist/components/MenuButton/MenuButton.d.ts +10 -8
- package/dist/components/Modal/Modal.d.ts +4 -2
- package/dist/components/NavigationGroup/NavigationGroup.d.ts +3 -2
- package/dist/components/NavigationItem/NavigationItem.d.ts +3 -2
- package/dist/components/Navigator/Navigator.d.ts +5 -4
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/Radio/Radio.d.ts +1 -0
- package/dist/components/RadioList/RadioList.d.ts +3 -2
- package/dist/components/SearchBar/SearchBar.d.ts +6 -5
- package/dist/components/SearchBar/index.d.ts +3 -2
- package/dist/components/Select/Select.d.ts +12 -10
- package/dist/components/Sheet/Sheet.d.ts +1 -0
- package/dist/components/Stack/Stack.d.ts +1 -0
- package/dist/components/Stepper/Stepper.d.ts +2 -1
- package/dist/components/Switch/Switch.d.ts +1 -0
- package/dist/components/Table/Table.d.ts +7 -5
- package/dist/components/Tabs/Tabs.d.ts +1 -0
- package/dist/components/Textarea/Textarea.d.ts +8 -20
- package/dist/components/Tooltip/Tooltip.d.ts +1 -0
- package/dist/components/Typography/Typography.d.ts +1 -0
- package/dist/components/Uploader/Uploader.d.ts +18 -17
- package/dist/components/data-display/Avatar.md +60 -72
- package/dist/components/data-display/Badge.md +197 -181
- package/dist/components/data-display/Chip.md +164 -142
- package/dist/components/data-display/DataTable.md +843 -338
- package/dist/components/data-display/InfoSign.md +1 -3
- package/dist/components/data-display/Markdown.md +93 -125
- package/dist/components/data-display/Table.md +1453 -1007
- package/dist/components/data-display/Typography.md +113 -116
- package/dist/components/feedback/Alert.md +80 -86
- package/dist/components/feedback/CircularProgress.md +32 -36
- package/dist/components/feedback/Dialog.md +25 -17
- package/dist/components/feedback/Modal.md +296 -264
- package/dist/components/feedback/Skeleton.md +125 -89
- package/dist/components/index.d.ts +63 -4
- package/dist/components/inputs/Autocomplete.md +191 -95
- package/dist/components/inputs/Button.md +83 -83
- package/dist/components/inputs/ButtonGroup.md +195 -185
- package/dist/components/inputs/Calendar.md +25 -28
- package/dist/components/inputs/Checkbox.md +11 -29
- package/dist/components/inputs/CurrencyInput.md +4 -4
- package/dist/components/inputs/DatePicker.md +229 -110
- package/dist/components/inputs/DateRangePicker.md +248 -137
- package/dist/components/inputs/FilterableCheckboxGroup.md +115 -55
- package/dist/components/inputs/FormControl.md +75 -69
- package/dist/components/inputs/IconButton.md +229 -205
- package/dist/components/inputs/Input.md +131 -98
- package/dist/components/inputs/MonthPicker.md +186 -84
- package/dist/components/inputs/MonthRangePicker.md +73 -49
- package/dist/components/inputs/PercentageInput.md +15 -31
- package/dist/components/inputs/RadioButton.md +320 -256
- package/dist/components/inputs/RadioList.md +66 -50
- package/dist/components/inputs/RadioTileGroup.md +287 -170
- package/dist/components/inputs/SearchBar.md +154 -55
- package/dist/components/inputs/Select.md +106 -95
- package/dist/components/inputs/Slider.md +153 -102
- package/dist/components/inputs/Switch.md +193 -138
- package/dist/components/inputs/Textarea.md +15 -20
- package/dist/components/inputs/Uploader/Uploader.md +68 -39
- package/dist/components/layout/Box.md +841 -662
- package/dist/components/layout/Container.md +3 -11
- package/dist/components/layout/Grid.md +480 -394
- package/dist/components/layout/Stack.md +739 -566
- package/dist/components/navigation/Breadcrumbs.md +4 -4
- package/dist/components/navigation/Drawer.md +34 -25
- package/dist/components/navigation/Dropdown.md +745 -408
- package/dist/components/navigation/IconMenuButton.md +14 -6
- package/dist/components/navigation/InsetDrawer.md +8 -13
- package/dist/components/navigation/Link.md +1 -2
- package/dist/components/navigation/Menu.md +623 -502
- package/dist/components/navigation/MenuButton.md +18 -10
- package/dist/components/navigation/NavigationGroup.md +19 -50
- package/dist/components/navigation/NavigationItem.md +6 -6
- package/dist/components/navigation/Navigator.md +26 -28
- package/dist/components/navigation/Pagination.md +86 -75
- package/dist/components/navigation/Stepper.md +2 -12
- package/dist/components/navigation/Tabs.md +48 -36
- package/dist/components/surfaces/Accordions.md +89 -172
- package/dist/components/surfaces/Card.md +1094 -709
- package/dist/components/surfaces/Divider.md +562 -412
- package/dist/components/surfaces/Sheet.md +700 -518
- package/dist/guides/ThemeProvider.md +8 -8
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +4 -4
- package/dist/index.cjs +1079 -1052
- package/dist/index.d.ts +2 -1
- package/dist/index.js +725 -690
- package/framer/index.js +1 -1
- package/package.json +32 -35
|
@@ -43,63 +43,63 @@ Typography levels are divided into three groups: **Headings**, **Titles**, and *
|
|
|
43
43
|
|
|
44
44
|
```tsx
|
|
45
45
|
<>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
</>
|
|
46
|
+
<Stack direction="row" spacing={2}>
|
|
47
|
+
<Typography level="h1">h1</Typography>
|
|
48
|
+
<Typography {...args} level="h1" />
|
|
49
|
+
</Stack>
|
|
50
|
+
<Stack direction="row" spacing={2}>
|
|
51
|
+
<Typography level="h2">h2</Typography>
|
|
52
|
+
<Typography {...args} level="h2" />
|
|
53
|
+
</Stack>
|
|
54
|
+
<Stack direction="row" spacing={2}>
|
|
55
|
+
<Typography level="h3">h3</Typography>
|
|
56
|
+
<Typography {...args} level="h3" />
|
|
57
|
+
</Stack>
|
|
58
|
+
<Stack direction="row" spacing={2}>
|
|
59
|
+
<Typography level="h4">h4</Typography>
|
|
60
|
+
<Typography {...args} level="h4" />
|
|
61
|
+
</Stack>
|
|
62
|
+
<Stack direction="row" spacing={2}>
|
|
63
|
+
<Typography level="title-lg">title-lg</Typography>
|
|
64
|
+
<Typography {...args} level="title-lg" />
|
|
65
|
+
</Stack>
|
|
66
|
+
<Stack direction="row" spacing={2}>
|
|
67
|
+
<Typography level="title-md">title-md</Typography>
|
|
68
|
+
<Typography {...args} level="title-md" />
|
|
69
|
+
</Stack>
|
|
70
|
+
<Stack direction="row" spacing={2}>
|
|
71
|
+
<Typography level="title-sm">title-sm</Typography>
|
|
72
|
+
<Typography {...args} level="title-sm" />
|
|
73
|
+
</Stack>
|
|
74
|
+
<Stack direction="row" spacing={2}>
|
|
75
|
+
<Typography level="body-lg">body-lg</Typography>
|
|
76
|
+
<Typography {...args} level="body-lg" />
|
|
77
|
+
</Stack>
|
|
78
|
+
<Stack direction="row" spacing={2}>
|
|
79
|
+
<Typography level="body-md">body-md</Typography>
|
|
80
|
+
<Typography {...args} level="body-md" />
|
|
81
|
+
</Stack>
|
|
82
|
+
<Stack direction="row" spacing={2}>
|
|
83
|
+
<Typography level="body-sm">body-sm</Typography>
|
|
84
|
+
<Typography {...args} level="body-sm" />
|
|
85
|
+
</Stack>
|
|
86
|
+
<Stack direction="row" spacing={2}>
|
|
87
|
+
<Typography level="body-xs">body-xs</Typography>
|
|
88
|
+
<Typography {...args} level="body-xs" />
|
|
89
|
+
</Stack>
|
|
90
|
+
<Stack direction="row" spacing={2}>
|
|
91
|
+
<Typography level="marketing-lg">marketing-lg</Typography>
|
|
92
|
+
<Typography {...args} level="marketing-lg" />
|
|
93
|
+
</Stack>
|
|
94
|
+
<Stack direction="row" spacing={2}>
|
|
95
|
+
<Typography level="marketing-md">marketing-md</Typography>
|
|
96
|
+
<Typography {...args} level="marketing-md" />
|
|
97
|
+
</Stack>
|
|
98
|
+
<Stack direction="row" spacing={2}>
|
|
99
|
+
<Typography level="marketing-sm">marketing-sm</Typography>
|
|
100
|
+
<Typography {...args} level="marketing-sm" />
|
|
101
|
+
</Stack>
|
|
102
|
+
</>
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
### Style Reference
|
|
@@ -124,11 +124,11 @@ Heading levels define page structure and hierarchy. They use the display font fa
|
|
|
124
124
|
|
|
125
125
|
```tsx
|
|
126
126
|
<>
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
</>
|
|
127
|
+
<Typography level="h1">h1 - Main page heading</Typography>
|
|
128
|
+
<Typography level="h2">h2 - Section heading</Typography>
|
|
129
|
+
<Typography level="h3">h3 - Subsection heading</Typography>
|
|
130
|
+
<Typography level="h4">h4 - Detail heading</Typography>
|
|
131
|
+
</>
|
|
132
132
|
```
|
|
133
133
|
|
|
134
134
|
```tsx
|
|
@@ -144,10 +144,10 @@ Title levels are used for UI labels, card titles, and other emphasized text that
|
|
|
144
144
|
|
|
145
145
|
```tsx
|
|
146
146
|
<>
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
</>
|
|
147
|
+
<Typography level="title-lg">title-lg - Large title</Typography>
|
|
148
|
+
<Typography level="title-md">title-md - Medium title</Typography>
|
|
149
|
+
<Typography level="title-sm">title-sm - Small title</Typography>
|
|
150
|
+
</>
|
|
151
151
|
```
|
|
152
152
|
|
|
153
153
|
```tsx
|
|
@@ -162,11 +162,11 @@ Body levels are used for readable content and descriptions. The default level `b
|
|
|
162
162
|
|
|
163
163
|
```tsx
|
|
164
164
|
<>
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
</>
|
|
165
|
+
<Typography level="body-lg">body-lg - Large body text</Typography>
|
|
166
|
+
<Typography level="body-md">body-md - Regular body text</Typography>
|
|
167
|
+
<Typography level="body-sm">body-sm - Small body text</Typography>
|
|
168
|
+
<Typography level="body-xs">body-xs - Extra small text</Typography>
|
|
169
|
+
</>
|
|
170
170
|
```
|
|
171
171
|
|
|
172
172
|
```tsx
|
|
@@ -222,12 +222,12 @@ Typography supports five semantic colors via the `color` prop. Use `textColor` t
|
|
|
222
222
|
|
|
223
223
|
```tsx
|
|
224
224
|
<>
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
</>
|
|
225
|
+
<Typography color="primary">Primary color</Typography>
|
|
226
|
+
<Typography color="neutral">Neutral color</Typography>
|
|
227
|
+
<Typography color="danger">Danger color</Typography>
|
|
228
|
+
<Typography color="success">Success color</Typography>
|
|
229
|
+
<Typography color="warning">Warning color</Typography>
|
|
230
|
+
</>
|
|
231
231
|
```
|
|
232
232
|
|
|
233
233
|
```tsx
|
|
@@ -247,16 +247,16 @@ Use the `component` prop to render Typography as a different HTML element or Rea
|
|
|
247
247
|
|
|
248
248
|
```tsx
|
|
249
249
|
<>
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
</>
|
|
250
|
+
<Typography level="h1" component="h2">
|
|
251
|
+
h1 style rendered as h2 tag
|
|
252
|
+
</Typography>
|
|
253
|
+
<Typography level="body-md" component="span">
|
|
254
|
+
body-md rendered as span
|
|
255
|
+
</Typography>
|
|
256
|
+
<Typography level="title-md" component="label">
|
|
257
|
+
title-md rendered as label
|
|
258
|
+
</Typography>
|
|
259
|
+
</>
|
|
260
260
|
```
|
|
261
261
|
|
|
262
262
|
```tsx
|
|
@@ -295,16 +295,12 @@ Use `startDecorator` and `endDecorator` to add icons or other elements before or
|
|
|
295
295
|
|
|
296
296
|
```tsx
|
|
297
297
|
<>
|
|
298
|
-
|
|
299
|
-
Text with
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
<Typography startDecorator={<InfoOutlined />} endDecorator={<ArrowForward />}>
|
|
305
|
-
Text with both decorators
|
|
306
|
-
</Typography>
|
|
307
|
-
</>
|
|
298
|
+
<Typography startDecorator={<InfoOutlined />}>Text with start decorator</Typography>
|
|
299
|
+
<Typography endDecorator={<ArrowForward />}>Text with end decorator</Typography>
|
|
300
|
+
<Typography startDecorator={<InfoOutlined />} endDecorator={<ArrowForward />}>
|
|
301
|
+
Text with both decorators
|
|
302
|
+
</Typography>
|
|
303
|
+
</>
|
|
308
304
|
```
|
|
309
305
|
|
|
310
306
|
```tsx
|
|
@@ -329,18 +325,20 @@ import ArrowForward from '@mui/icons-material/ArrowForward';
|
|
|
329
325
|
Use the `noWrap` prop to truncate overflowing text with an ellipsis. Pair it with a `maxWidth` to constrain the text width.
|
|
330
326
|
|
|
331
327
|
```tsx
|
|
332
|
-
<Typography
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
328
|
+
<Typography
|
|
329
|
+
noWrap
|
|
330
|
+
sx={{
|
|
331
|
+
maxWidth: 200
|
|
332
|
+
}}
|
|
333
|
+
>
|
|
334
|
+
This is a long text that will be truncated with an ellipsis when it exceeds the maximum width of
|
|
335
|
+
the container.
|
|
336
|
+
</Typography>
|
|
338
337
|
```
|
|
339
338
|
|
|
340
339
|
```tsx
|
|
341
340
|
<Typography noWrap sx={{ maxWidth: 200 }}>
|
|
342
|
-
This is a long text that will be truncated with an ellipsis when it exceeds
|
|
343
|
-
the maximum width.
|
|
341
|
+
This is a long text that will be truncated with an ellipsis when it exceeds the maximum width.
|
|
344
342
|
</Typography>
|
|
345
343
|
```
|
|
346
344
|
|
|
@@ -349,19 +347,21 @@ exceeds the maximum width of the container.
|
|
|
349
347
|
You can pass a responsive object to the `level` prop, or use `sx` to set responsive font sizes.
|
|
350
348
|
|
|
351
349
|
```tsx
|
|
352
|
-
{
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
</Typography
|
|
350
|
+
{
|
|
351
|
+
/* Responsive level */
|
|
352
|
+
}
|
|
353
|
+
<Typography level={{ xs: 'h3', sm: 'h2', md: 'h1' }}>Responsive Heading</Typography>;
|
|
356
354
|
|
|
357
|
-
{
|
|
355
|
+
{
|
|
356
|
+
/* Responsive font size via sx */
|
|
357
|
+
}
|
|
358
358
|
<Typography
|
|
359
359
|
sx={{
|
|
360
360
|
fontSize: { xs: '1rem', sm: '1.25rem', md: '1.5rem' },
|
|
361
361
|
}}
|
|
362
362
|
>
|
|
363
363
|
Responsive text
|
|
364
|
-
</Typography
|
|
364
|
+
</Typography>;
|
|
365
365
|
```
|
|
366
366
|
|
|
367
367
|
## Common Use Cases
|
|
@@ -381,17 +381,14 @@ function ArticlePage() {
|
|
|
381
381
|
</Typography>
|
|
382
382
|
|
|
383
383
|
<Typography level="body-md" sx={{ mb: 2 }}>
|
|
384
|
-
The main content of the article goes here. This text uses a readable size
|
|
385
|
-
and line spacing.
|
|
384
|
+
The main content of the article goes here. This text uses a readable size and line spacing.
|
|
386
385
|
</Typography>
|
|
387
386
|
|
|
388
387
|
<Typography level="h2" sx={{ mt: 4, mb: 2 }}>
|
|
389
388
|
Section Title
|
|
390
389
|
</Typography>
|
|
391
390
|
|
|
392
|
-
<Typography level="body-md">
|
|
393
|
-
The section content continues here.
|
|
394
|
-
</Typography>
|
|
391
|
+
<Typography level="body-md">The section content continues here.</Typography>
|
|
395
392
|
</article>
|
|
396
393
|
);
|
|
397
394
|
}
|
|
@@ -72,56 +72,66 @@ The most basic Alert usage.
|
|
|
72
72
|
You can distinguish message types through various colors.
|
|
73
73
|
|
|
74
74
|
```tsx
|
|
75
|
-
<div
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
<Alert {...props} color="
|
|
90
|
-
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
<Alert {...props} color="
|
|
119
|
-
<Alert {...props} color="
|
|
120
|
-
|
|
121
|
-
<
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
75
|
+
<div
|
|
76
|
+
style={{
|
|
77
|
+
display: "flex",
|
|
78
|
+
flexDirection: "column",
|
|
79
|
+
gap: "5px"
|
|
80
|
+
}}
|
|
81
|
+
>
|
|
82
|
+
<div
|
|
83
|
+
style={{
|
|
84
|
+
display: "flex",
|
|
85
|
+
flexDirection: "column",
|
|
86
|
+
gap: "5px"
|
|
87
|
+
}}
|
|
88
|
+
>
|
|
89
|
+
<Alert {...props} color="primary" variant="plain" />
|
|
90
|
+
<Alert {...props} color="neutral" variant="plain" />
|
|
91
|
+
<Alert {...props} color="danger" variant="plain" />
|
|
92
|
+
<Alert {...props} color="success" variant="plain" />
|
|
93
|
+
<Alert {...props} color="warning" variant="plain" />
|
|
94
|
+
</div>
|
|
95
|
+
<div
|
|
96
|
+
style={{
|
|
97
|
+
display: "flex",
|
|
98
|
+
flexDirection: "column",
|
|
99
|
+
gap: "5px"
|
|
100
|
+
}}
|
|
101
|
+
>
|
|
102
|
+
<Alert {...props} color="primary" variant="soft" />
|
|
103
|
+
<Alert {...props} color="neutral" variant="soft" />
|
|
104
|
+
<Alert {...props} color="danger" variant="soft" />
|
|
105
|
+
<Alert {...props} color="success" variant="soft" />
|
|
106
|
+
<Alert {...props} color="warning" variant="soft" />
|
|
107
|
+
</div>
|
|
108
|
+
<div
|
|
109
|
+
style={{
|
|
110
|
+
display: "flex",
|
|
111
|
+
flexDirection: "column",
|
|
112
|
+
gap: "5px"
|
|
113
|
+
}}
|
|
114
|
+
>
|
|
115
|
+
<Alert {...props} color="primary" variant="solid" />
|
|
116
|
+
<Alert {...props} color="neutral" variant="solid" />
|
|
117
|
+
<Alert {...props} color="danger" variant="solid" />
|
|
118
|
+
<Alert {...props} color="success" variant="solid" />
|
|
119
|
+
<Alert {...props} color="warning" variant="solid" />
|
|
120
|
+
</div>
|
|
121
|
+
<div
|
|
122
|
+
style={{
|
|
123
|
+
display: "flex",
|
|
124
|
+
flexDirection: "column",
|
|
125
|
+
gap: "5px"
|
|
126
|
+
}}
|
|
127
|
+
>
|
|
128
|
+
<Alert {...props} color="primary" variant="outlined" />
|
|
129
|
+
<Alert {...props} color="neutral" variant="outlined" />
|
|
130
|
+
<Alert {...props} color="danger" variant="outlined" />
|
|
131
|
+
<Alert {...props} color="success" variant="outlined" />
|
|
132
|
+
<Alert {...props} color="warning" variant="outlined" />
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
125
135
|
```
|
|
126
136
|
|
|
127
137
|
- **primary**: General informational message
|
|
@@ -218,17 +228,9 @@ function LoginForm() {
|
|
|
218
228
|
/>
|
|
219
229
|
)}
|
|
220
230
|
|
|
221
|
-
{success &&
|
|
222
|
-
<Alert
|
|
223
|
-
color="success"
|
|
224
|
-
content="로그인이 완료되었습니다."
|
|
225
|
-
startDecorator={<CheckCircleIcon />}
|
|
226
|
-
/>
|
|
227
|
-
)}
|
|
231
|
+
{success && <Alert color="success" content="로그인이 완료되었습니다." startDecorator={<CheckCircleIcon />} />}
|
|
228
232
|
|
|
229
|
-
<form onSubmit={handleSubmit}>
|
|
230
|
-
{/* Form fields */}
|
|
231
|
-
</form>
|
|
233
|
+
<form onSubmit={handleSubmit}>{/* Form fields */}</form>
|
|
232
234
|
</Stack>
|
|
233
235
|
);
|
|
234
236
|
}
|
|
@@ -296,14 +298,18 @@ function DataProcessingStatus({ status, progress, onCancel, onRetry }) {
|
|
|
296
298
|
title: '데이터 처리 중',
|
|
297
299
|
content: `진행률: ${progress}%`,
|
|
298
300
|
startDecorator: <CircularProgress size="sm" />,
|
|
299
|
-
actions:
|
|
301
|
+
actions: (
|
|
302
|
+
<Button size="sm" onClick={onCancel}>
|
|
303
|
+
취소
|
|
304
|
+
</Button>
|
|
305
|
+
),
|
|
300
306
|
};
|
|
301
307
|
case 'completed':
|
|
302
308
|
return {
|
|
303
309
|
color: 'success',
|
|
304
310
|
title: '처리 완료',
|
|
305
311
|
content: '모든 데이터가 성공적으로 처리되었습니다.',
|
|
306
|
-
startDecorator: <CheckCircleIcon
|
|
312
|
+
startDecorator: <CheckCircleIcon />,
|
|
307
313
|
};
|
|
308
314
|
case 'failed':
|
|
309
315
|
return {
|
|
@@ -311,7 +317,11 @@ function DataProcessingStatus({ status, progress, onCancel, onRetry }) {
|
|
|
311
317
|
title: '처리 실패',
|
|
312
318
|
content: '데이터 처리 중 오류가 발생했습니다.',
|
|
313
319
|
startDecorator: <ErrorIcon />,
|
|
314
|
-
actions:
|
|
320
|
+
actions: (
|
|
321
|
+
<Button size="sm" onClick={onRetry}>
|
|
322
|
+
다시 시도
|
|
323
|
+
</Button>
|
|
324
|
+
),
|
|
315
325
|
};
|
|
316
326
|
default:
|
|
317
327
|
return null;
|
|
@@ -445,23 +455,19 @@ function DismissibleAlerts() {
|
|
|
445
455
|
]);
|
|
446
456
|
|
|
447
457
|
const dismissAlert = (id) => {
|
|
448
|
-
setAlerts(prev => prev.filter(alert => alert.id !== id));
|
|
458
|
+
setAlerts((prev) => prev.filter((alert) => alert.id !== id));
|
|
449
459
|
};
|
|
450
460
|
|
|
451
461
|
return (
|
|
452
462
|
<Stack spacing={2}>
|
|
453
|
-
{alerts.map(alert => (
|
|
463
|
+
{alerts.map((alert) => (
|
|
454
464
|
<Alert
|
|
455
465
|
key={alert.id}
|
|
456
466
|
color={getAlertColor(alert.type)}
|
|
457
467
|
content={alert.message}
|
|
458
468
|
startDecorator={getAlertIcon(alert.type)}
|
|
459
469
|
actions={
|
|
460
|
-
<IconButton
|
|
461
|
-
size="sm"
|
|
462
|
-
variant="plain"
|
|
463
|
-
onClick={() => dismissAlert(alert.id)}
|
|
464
|
-
>
|
|
470
|
+
<IconButton size="sm" variant="plain" onClick={() => dismissAlert(alert.id)}>
|
|
465
471
|
<CloseIcon />
|
|
466
472
|
</IconButton>
|
|
467
473
|
}
|
|
@@ -566,11 +572,7 @@ The title and content are structured appropriately for screen readers.
|
|
|
566
572
|
title="오류 발생"
|
|
567
573
|
content="입력하신 정보를 다시 확인해주세요."
|
|
568
574
|
startDecorator={<ErrorIcon aria-hidden="true" />}
|
|
569
|
-
actions={
|
|
570
|
-
<Button aria-label="오류 메시지 닫기">
|
|
571
|
-
닫기
|
|
572
|
-
</Button>
|
|
573
|
-
}
|
|
575
|
+
actions={<Button aria-label="오류 메시지 닫기">닫기</Button>}
|
|
574
576
|
/>
|
|
575
577
|
```
|
|
576
578
|
|
|
@@ -634,13 +636,7 @@ function AutoDismissAlert() {
|
|
|
634
636
|
|
|
635
637
|
if (!visible) return null;
|
|
636
638
|
|
|
637
|
-
return
|
|
638
|
-
<Alert
|
|
639
|
-
color="success"
|
|
640
|
-
content="저장이 완료되었습니다."
|
|
641
|
-
startDecorator={<CheckIcon />}
|
|
642
|
-
/>
|
|
643
|
-
);
|
|
639
|
+
return <Alert color="success" content="저장이 완료되었습니다." startDecorator={<CheckIcon />} />;
|
|
644
640
|
}
|
|
645
641
|
```
|
|
646
642
|
|
|
@@ -651,11 +647,9 @@ function AutoDismissAlert() {
|
|
|
651
647
|
2. **Memoization**: Consider memoizing complex Alert content.
|
|
652
648
|
|
|
653
649
|
```tsx
|
|
654
|
-
const alertContent = useMemo(() =>
|
|
655
|
-
<ComplexAlertContent data={data} />
|
|
656
|
-
), [data]);
|
|
650
|
+
const alertContent = useMemo(() => <ComplexAlertContent data={data} />, [data]);
|
|
657
651
|
|
|
658
|
-
<Alert content={alertContent}
|
|
652
|
+
<Alert content={alertContent} />;
|
|
659
653
|
```
|
|
660
654
|
|
|
661
655
|
3. **Batch handling**: Manage multiple Alerts efficiently.
|