@ceed/ads 1.35.1 → 1.37.0-next.1
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 +85 -95
- 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/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/Dropdown/Dropdown.d.ts +28 -1
- package/dist/components/FilterMenu/components/MonthRange.d.ts +11 -0
- package/dist/components/FilterMenu/types.d.ts +5 -1
- package/dist/components/FilterableCheckboxGroup/FilterableCheckboxGroup.d.ts +1 -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 +2 -2
- package/dist/components/ProfileMenu/ProfileMenu.d.ts +3 -3
- package/dist/components/Radio/Radio.d.ts +1 -0
- package/dist/components/RadioList/RadioList.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/ThemeProvider/ThemeProvider.d.ts +24 -2
- 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 +61 -73
- package/dist/components/data-display/Badge.md +198 -182
- package/dist/components/data-display/Chip.md +165 -143
- 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 +1454 -1008
- package/dist/components/data-display/Tooltip.md +1 -1
- package/dist/components/data-display/Typography.md +101 -104
- package/dist/components/feedback/Alert.md +81 -87
- package/dist/components/feedback/CircularProgress.md +34 -38
- package/dist/components/feedback/Dialog.md +25 -17
- package/dist/components/feedback/Modal.md +297 -266
- package/dist/components/feedback/Skeleton.md +125 -89
- package/dist/components/index.d.ts +60 -1
- package/dist/components/inputs/Autocomplete.md +192 -96
- package/dist/components/inputs/Button.md +85 -85
- package/dist/components/inputs/ButtonGroup.md +197 -187
- package/dist/components/inputs/Calendar.md +25 -28
- package/dist/components/inputs/Checkbox.md +13 -31
- package/dist/components/inputs/CurrencyInput.md +6 -6
- package/dist/components/inputs/DatePicker.md +229 -110
- package/dist/components/inputs/DateRangePicker.md +248 -137
- package/dist/components/inputs/FilterMenu.md +138 -8
- package/dist/components/inputs/FilterableCheckboxGroup.md +116 -56
- package/dist/components/inputs/FormControl.md +76 -70
- package/dist/components/inputs/IconButton.md +231 -207
- package/dist/components/inputs/Input.md +133 -100
- package/dist/components/inputs/MonthPicker.md +186 -84
- package/dist/components/inputs/MonthRangePicker.md +73 -49
- package/dist/components/inputs/PercentageInput.md +17 -33
- package/dist/components/inputs/RadioButton.md +322 -258
- package/dist/components/inputs/RadioList.md +68 -52
- package/dist/components/inputs/RadioTileGroup.md +287 -170
- package/dist/components/inputs/SearchBar.md +82 -60
- package/dist/components/inputs/Select.md +108 -97
- package/dist/components/inputs/Slider.md +155 -104
- package/dist/components/inputs/Switch.md +194 -139
- package/dist/components/inputs/Textarea.md +17 -22
- package/dist/components/inputs/Uploader/Uploader.md +69 -40
- 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 +182 -116
- package/dist/components/navigation/Dropdown.md +732 -391
- package/dist/components/navigation/IconMenuButton.md +15 -7
- package/dist/components/navigation/InsetDrawer.md +550 -378
- package/dist/components/navigation/Link.md +104 -94
- package/dist/components/navigation/Menu.md +624 -503
- package/dist/components/navigation/MenuButton.md +19 -11
- 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 +87 -76
- package/dist/components/navigation/ProfileMenu.md +67 -45
- package/dist/components/navigation/Stepper.md +2 -12
- package/dist/components/navigation/Tabs.md +210 -184
- package/dist/components/surfaces/Accordions.md +90 -173
- package/dist/components/surfaces/Card.md +1096 -711
- package/dist/components/surfaces/Divider.md +562 -412
- package/dist/components/surfaces/Sheet.md +700 -518
- package/dist/guides/ThemeProvider.md +65 -40
- package/dist/index.browser.js +5 -5
- package/dist/index.browser.js.map +4 -4
- package/dist/index.cjs +1906 -1690
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1404 -1180
- package/framer/index.js +1 -1
- package/package.json +34 -36
|
@@ -253,7 +253,7 @@ Used with interactive elements.
|
|
|
253
253
|
| `onClose` | `() => void` | - | Callback when tooltip should close |
|
|
254
254
|
| `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'neutral'` | Tooltip color scheme |
|
|
255
255
|
| `variant` | `'solid' \| 'soft' \| 'outlined' \| 'plain'` | `'solid'` | Visual style |
|
|
256
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | `'
|
|
256
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'sm'` | Tooltip size |
|
|
257
257
|
| `sx` | `SxProps` | - | Custom styles using the MUI system |
|
|
258
258
|
|
|
259
259
|
> **Note**: Tooltip also accepts all Joy UI Tooltip props and Framer Motion props.
|
|
@@ -43,51 +43,51 @@ 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
|
-
</>
|
|
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
|
+
</>
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
### Style Reference
|
|
@@ -112,11 +112,11 @@ Heading levels define page structure and hierarchy. They use the display font fa
|
|
|
112
112
|
|
|
113
113
|
```tsx
|
|
114
114
|
<>
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
</>
|
|
115
|
+
<Typography level="h1">h1 - Main page heading</Typography>
|
|
116
|
+
<Typography level="h2">h2 - Section heading</Typography>
|
|
117
|
+
<Typography level="h3">h3 - Subsection heading</Typography>
|
|
118
|
+
<Typography level="h4">h4 - Detail heading</Typography>
|
|
119
|
+
</>
|
|
120
120
|
```
|
|
121
121
|
|
|
122
122
|
```tsx
|
|
@@ -132,10 +132,10 @@ Title levels are used for UI labels, card titles, and other emphasized text that
|
|
|
132
132
|
|
|
133
133
|
```tsx
|
|
134
134
|
<>
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
</>
|
|
135
|
+
<Typography level="title-lg">title-lg - Large title</Typography>
|
|
136
|
+
<Typography level="title-md">title-md - Medium title</Typography>
|
|
137
|
+
<Typography level="title-sm">title-sm - Small title</Typography>
|
|
138
|
+
</>
|
|
139
139
|
```
|
|
140
140
|
|
|
141
141
|
```tsx
|
|
@@ -150,11 +150,11 @@ Body levels are used for readable content and descriptions. The default level `b
|
|
|
150
150
|
|
|
151
151
|
```tsx
|
|
152
152
|
<>
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
</>
|
|
153
|
+
<Typography level="body-lg">body-lg - Large body text</Typography>
|
|
154
|
+
<Typography level="body-md">body-md - Regular body text</Typography>
|
|
155
|
+
<Typography level="body-sm">body-sm - Small body text</Typography>
|
|
156
|
+
<Typography level="body-xs">body-xs - Extra small text</Typography>
|
|
157
|
+
</>
|
|
158
158
|
```
|
|
159
159
|
|
|
160
160
|
```tsx
|
|
@@ -210,12 +210,12 @@ Typography supports five semantic colors via the `color` prop. Use `textColor` t
|
|
|
210
210
|
|
|
211
211
|
```tsx
|
|
212
212
|
<>
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
</>
|
|
213
|
+
<Typography color="primary">Primary color</Typography>
|
|
214
|
+
<Typography color="neutral">Neutral color</Typography>
|
|
215
|
+
<Typography color="danger">Danger color</Typography>
|
|
216
|
+
<Typography color="success">Success color</Typography>
|
|
217
|
+
<Typography color="warning">Warning color</Typography>
|
|
218
|
+
</>
|
|
219
219
|
```
|
|
220
220
|
|
|
221
221
|
```tsx
|
|
@@ -235,16 +235,16 @@ Use the `component` prop to render Typography as a different HTML element or Rea
|
|
|
235
235
|
|
|
236
236
|
```tsx
|
|
237
237
|
<>
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
</>
|
|
238
|
+
<Typography level="h1" component="h2">
|
|
239
|
+
h1 style rendered as h2 tag
|
|
240
|
+
</Typography>
|
|
241
|
+
<Typography level="body-md" component="span">
|
|
242
|
+
body-md rendered as span
|
|
243
|
+
</Typography>
|
|
244
|
+
<Typography level="title-md" component="label">
|
|
245
|
+
title-md rendered as label
|
|
246
|
+
</Typography>
|
|
247
|
+
</>
|
|
248
248
|
```
|
|
249
249
|
|
|
250
250
|
```tsx
|
|
@@ -283,16 +283,12 @@ Use `startDecorator` and `endDecorator` to add icons or other elements before or
|
|
|
283
283
|
|
|
284
284
|
```tsx
|
|
285
285
|
<>
|
|
286
|
-
|
|
287
|
-
Text with
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
<Typography startDecorator={<InfoOutlined />} endDecorator={<ArrowForward />}>
|
|
293
|
-
Text with both decorators
|
|
294
|
-
</Typography>
|
|
295
|
-
</>
|
|
286
|
+
<Typography startDecorator={<InfoOutlined />}>Text with start decorator</Typography>
|
|
287
|
+
<Typography endDecorator={<ArrowForward />}>Text with end decorator</Typography>
|
|
288
|
+
<Typography startDecorator={<InfoOutlined />} endDecorator={<ArrowForward />}>
|
|
289
|
+
Text with both decorators
|
|
290
|
+
</Typography>
|
|
291
|
+
</>
|
|
296
292
|
```
|
|
297
293
|
|
|
298
294
|
```tsx
|
|
@@ -317,18 +313,20 @@ import ArrowForward from '@mui/icons-material/ArrowForward';
|
|
|
317
313
|
Use the `noWrap` prop to truncate overflowing text with an ellipsis. Pair it with a `maxWidth` to constrain the text width.
|
|
318
314
|
|
|
319
315
|
```tsx
|
|
320
|
-
<Typography
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
316
|
+
<Typography
|
|
317
|
+
noWrap
|
|
318
|
+
sx={{
|
|
319
|
+
maxWidth: 200
|
|
320
|
+
}}
|
|
321
|
+
>
|
|
322
|
+
This is a long text that will be truncated with an ellipsis when it exceeds the maximum width of
|
|
323
|
+
the container.
|
|
324
|
+
</Typography>
|
|
326
325
|
```
|
|
327
326
|
|
|
328
327
|
```tsx
|
|
329
328
|
<Typography noWrap sx={{ maxWidth: 200 }}>
|
|
330
|
-
This is a long text that will be truncated with an ellipsis when it exceeds
|
|
331
|
-
the maximum width.
|
|
329
|
+
This is a long text that will be truncated with an ellipsis when it exceeds the maximum width.
|
|
332
330
|
</Typography>
|
|
333
331
|
```
|
|
334
332
|
|
|
@@ -337,19 +335,21 @@ exceeds the maximum width of the container.
|
|
|
337
335
|
You can pass a responsive object to the `level` prop, or use `sx` to set responsive font sizes.
|
|
338
336
|
|
|
339
337
|
```tsx
|
|
340
|
-
{
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
</Typography
|
|
338
|
+
{
|
|
339
|
+
/* Responsive level */
|
|
340
|
+
}
|
|
341
|
+
<Typography level={{ xs: 'h3', sm: 'h2', md: 'h1' }}>Responsive Heading</Typography>;
|
|
344
342
|
|
|
345
|
-
{
|
|
343
|
+
{
|
|
344
|
+
/* Responsive font size via sx */
|
|
345
|
+
}
|
|
346
346
|
<Typography
|
|
347
347
|
sx={{
|
|
348
348
|
fontSize: { xs: '1rem', sm: '1.25rem', md: '1.5rem' },
|
|
349
349
|
}}
|
|
350
350
|
>
|
|
351
351
|
Responsive text
|
|
352
|
-
</Typography
|
|
352
|
+
</Typography>;
|
|
353
353
|
```
|
|
354
354
|
|
|
355
355
|
## Page Structure
|
|
@@ -367,17 +367,14 @@ function ArticlePage() {
|
|
|
367
367
|
</Typography>
|
|
368
368
|
|
|
369
369
|
<Typography level="body-md" sx={{ mb: 2 }}>
|
|
370
|
-
The main content of the article goes here. This text uses a readable size
|
|
371
|
-
and line spacing.
|
|
370
|
+
The main content of the article goes here. This text uses a readable size and line spacing.
|
|
372
371
|
</Typography>
|
|
373
372
|
|
|
374
373
|
<Typography level="h2" sx={{ mt: 4, mb: 2 }}>
|
|
375
374
|
Section Title
|
|
376
375
|
</Typography>
|
|
377
376
|
|
|
378
|
-
<Typography level="body-md">
|
|
379
|
-
The section content continues here.
|
|
380
|
-
</Typography>
|
|
377
|
+
<Typography level="body-md">The section content continues here.</Typography>
|
|
381
378
|
</article>
|
|
382
379
|
);
|
|
383
380
|
}
|
|
@@ -70,56 +70,66 @@ The most basic Alert usage.
|
|
|
70
70
|
You can distinguish message types through various colors.
|
|
71
71
|
|
|
72
72
|
```tsx
|
|
73
|
-
<div
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
<Alert {...props} color="
|
|
88
|
-
|
|
89
|
-
<
|
|
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
|
-
<Alert {...props} color="
|
|
117
|
-
<Alert {...props} color="
|
|
118
|
-
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
73
|
+
<div
|
|
74
|
+
style={{
|
|
75
|
+
display: "flex",
|
|
76
|
+
flexDirection: "column",
|
|
77
|
+
gap: "5px"
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
<div
|
|
81
|
+
style={{
|
|
82
|
+
display: "flex",
|
|
83
|
+
flexDirection: "column",
|
|
84
|
+
gap: "5px"
|
|
85
|
+
}}
|
|
86
|
+
>
|
|
87
|
+
<Alert {...props} color="primary" variant="plain" />
|
|
88
|
+
<Alert {...props} color="neutral" variant="plain" />
|
|
89
|
+
<Alert {...props} color="danger" variant="plain" />
|
|
90
|
+
<Alert {...props} color="success" variant="plain" />
|
|
91
|
+
<Alert {...props} color="warning" variant="plain" />
|
|
92
|
+
</div>
|
|
93
|
+
<div
|
|
94
|
+
style={{
|
|
95
|
+
display: "flex",
|
|
96
|
+
flexDirection: "column",
|
|
97
|
+
gap: "5px"
|
|
98
|
+
}}
|
|
99
|
+
>
|
|
100
|
+
<Alert {...props} color="primary" variant="soft" />
|
|
101
|
+
<Alert {...props} color="neutral" variant="soft" />
|
|
102
|
+
<Alert {...props} color="danger" variant="soft" />
|
|
103
|
+
<Alert {...props} color="success" variant="soft" />
|
|
104
|
+
<Alert {...props} color="warning" variant="soft" />
|
|
105
|
+
</div>
|
|
106
|
+
<div
|
|
107
|
+
style={{
|
|
108
|
+
display: "flex",
|
|
109
|
+
flexDirection: "column",
|
|
110
|
+
gap: "5px"
|
|
111
|
+
}}
|
|
112
|
+
>
|
|
113
|
+
<Alert {...props} color="primary" variant="solid" />
|
|
114
|
+
<Alert {...props} color="neutral" variant="solid" />
|
|
115
|
+
<Alert {...props} color="danger" variant="solid" />
|
|
116
|
+
<Alert {...props} color="success" variant="solid" />
|
|
117
|
+
<Alert {...props} color="warning" variant="solid" />
|
|
118
|
+
</div>
|
|
119
|
+
<div
|
|
120
|
+
style={{
|
|
121
|
+
display: "flex",
|
|
122
|
+
flexDirection: "column",
|
|
123
|
+
gap: "5px"
|
|
124
|
+
}}
|
|
125
|
+
>
|
|
126
|
+
<Alert {...props} color="primary" variant="outlined" />
|
|
127
|
+
<Alert {...props} color="neutral" variant="outlined" />
|
|
128
|
+
<Alert {...props} color="danger" variant="outlined" />
|
|
129
|
+
<Alert {...props} color="success" variant="outlined" />
|
|
130
|
+
<Alert {...props} color="warning" variant="outlined" />
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
123
133
|
```
|
|
124
134
|
|
|
125
135
|
- **primary**: General informational message
|
|
@@ -214,17 +224,9 @@ function LoginForm() {
|
|
|
214
224
|
/>
|
|
215
225
|
)}
|
|
216
226
|
|
|
217
|
-
{success &&
|
|
218
|
-
<Alert
|
|
219
|
-
color="success"
|
|
220
|
-
content="로그인이 완료되었습니다."
|
|
221
|
-
startDecorator={<CheckCircleIcon />}
|
|
222
|
-
/>
|
|
223
|
-
)}
|
|
227
|
+
{success && <Alert color="success" content="로그인이 완료되었습니다." startDecorator={<CheckCircleIcon />} />}
|
|
224
228
|
|
|
225
|
-
<form onSubmit={handleSubmit}>
|
|
226
|
-
{/* Form fields */}
|
|
227
|
-
</form>
|
|
229
|
+
<form onSubmit={handleSubmit}>{/* Form fields */}</form>
|
|
228
230
|
</Stack>
|
|
229
231
|
);
|
|
230
232
|
}
|
|
@@ -292,14 +294,18 @@ function DataProcessingStatus({ status, progress, onCancel, onRetry }) {
|
|
|
292
294
|
title: '데이터 처리 중',
|
|
293
295
|
content: `진행률: ${progress}%`,
|
|
294
296
|
startDecorator: <CircularProgress size="sm" />,
|
|
295
|
-
actions:
|
|
297
|
+
actions: (
|
|
298
|
+
<Button size="sm" onClick={onCancel}>
|
|
299
|
+
취소
|
|
300
|
+
</Button>
|
|
301
|
+
),
|
|
296
302
|
};
|
|
297
303
|
case 'completed':
|
|
298
304
|
return {
|
|
299
305
|
color: 'success',
|
|
300
306
|
title: '처리 완료',
|
|
301
307
|
content: '모든 데이터가 성공적으로 처리되었습니다.',
|
|
302
|
-
startDecorator: <CheckCircleIcon
|
|
308
|
+
startDecorator: <CheckCircleIcon />,
|
|
303
309
|
};
|
|
304
310
|
case 'failed':
|
|
305
311
|
return {
|
|
@@ -307,7 +313,11 @@ function DataProcessingStatus({ status, progress, onCancel, onRetry }) {
|
|
|
307
313
|
title: '처리 실패',
|
|
308
314
|
content: '데이터 처리 중 오류가 발생했습니다.',
|
|
309
315
|
startDecorator: <ErrorIcon />,
|
|
310
|
-
actions:
|
|
316
|
+
actions: (
|
|
317
|
+
<Button size="sm" onClick={onRetry}>
|
|
318
|
+
다시 시도
|
|
319
|
+
</Button>
|
|
320
|
+
),
|
|
311
321
|
};
|
|
312
322
|
default:
|
|
313
323
|
return null;
|
|
@@ -441,23 +451,19 @@ function DismissibleAlerts() {
|
|
|
441
451
|
]);
|
|
442
452
|
|
|
443
453
|
const dismissAlert = (id) => {
|
|
444
|
-
setAlerts(prev => prev.filter(alert => alert.id !== id));
|
|
454
|
+
setAlerts((prev) => prev.filter((alert) => alert.id !== id));
|
|
445
455
|
};
|
|
446
456
|
|
|
447
457
|
return (
|
|
448
458
|
<Stack spacing={2}>
|
|
449
|
-
{alerts.map(alert => (
|
|
459
|
+
{alerts.map((alert) => (
|
|
450
460
|
<Alert
|
|
451
461
|
key={alert.id}
|
|
452
462
|
color={getAlertColor(alert.type)}
|
|
453
463
|
content={alert.message}
|
|
454
464
|
startDecorator={getAlertIcon(alert.type)}
|
|
455
465
|
actions={
|
|
456
|
-
<IconButton
|
|
457
|
-
size="sm"
|
|
458
|
-
variant="plain"
|
|
459
|
-
onClick={() => dismissAlert(alert.id)}
|
|
460
|
-
>
|
|
466
|
+
<IconButton size="sm" variant="plain" onClick={() => dismissAlert(alert.id)}>
|
|
461
467
|
<CloseIcon />
|
|
462
468
|
</IconButton>
|
|
463
469
|
}
|
|
@@ -479,7 +485,7 @@ function DismissibleAlerts() {
|
|
|
479
485
|
| `actions` | `ReactNode` | - | Action buttons or elements displayed on the right |
|
|
480
486
|
| `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'primary'` | Alert color scheme |
|
|
481
487
|
| `variant` | `'solid' \| 'soft' \| 'outlined' \| 'plain'` | `'soft'` | Visual style |
|
|
482
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | `'
|
|
488
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'sm'` | Alert size (affects title/content typography levels) |
|
|
483
489
|
| `startDecorator` | `ReactNode` | - | Icon or element rendered before the content |
|
|
484
490
|
| `invertedColors` | `boolean` | `false` | Invert child component colors (auto `true` when `variant='solid'`) |
|
|
485
491
|
| `sx` | `SxProps` | - | Custom styles using the MUI system |
|
|
@@ -578,11 +584,7 @@ The title and content are structured appropriately for screen readers.
|
|
|
578
584
|
title="오류 발생"
|
|
579
585
|
content="입력하신 정보를 다시 확인해주세요."
|
|
580
586
|
startDecorator={<ErrorIcon aria-hidden="true" />}
|
|
581
|
-
actions={
|
|
582
|
-
<Button aria-label="오류 메시지 닫기">
|
|
583
|
-
닫기
|
|
584
|
-
</Button>
|
|
585
|
-
}
|
|
587
|
+
actions={<Button aria-label="오류 메시지 닫기">닫기</Button>}
|
|
586
588
|
/>
|
|
587
589
|
```
|
|
588
590
|
|
|
@@ -646,13 +648,7 @@ function AutoDismissAlert() {
|
|
|
646
648
|
|
|
647
649
|
if (!visible) return null;
|
|
648
650
|
|
|
649
|
-
return
|
|
650
|
-
<Alert
|
|
651
|
-
color="success"
|
|
652
|
-
content="저장이 완료되었습니다."
|
|
653
|
-
startDecorator={<CheckIcon />}
|
|
654
|
-
/>
|
|
655
|
-
);
|
|
651
|
+
return <Alert color="success" content="저장이 완료되었습니다." startDecorator={<CheckIcon />} />;
|
|
656
652
|
}
|
|
657
653
|
```
|
|
658
654
|
|
|
@@ -663,11 +659,9 @@ function AutoDismissAlert() {
|
|
|
663
659
|
2. **Memoization**: Consider memoizing complex Alert content.
|
|
664
660
|
|
|
665
661
|
```tsx
|
|
666
|
-
const alertContent = useMemo(() =>
|
|
667
|
-
<ComplexAlertContent data={data} />
|
|
668
|
-
), [data]);
|
|
662
|
+
const alertContent = useMemo(() => <ComplexAlertContent data={data} />, [data]);
|
|
669
663
|
|
|
670
|
-
<Alert content={alertContent}
|
|
664
|
+
<Alert content={alertContent} />;
|
|
671
665
|
```
|
|
672
666
|
|
|
673
667
|
3. **Batch handling**: Manage multiple Alerts efficiently.
|