@ceed/cds 1.29.0 → 1.30.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/Overview.md +5 -5
- package/dist/components/Calendar/utils/index.d.ts +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +4 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +4 -0
- package/dist/components/MonthRangePicker/MonthRangePicker.d.ts +8 -0
- package/dist/components/data-display/Avatar.md +110 -69
- package/dist/components/data-display/Badge.md +91 -39
- package/dist/components/data-display/Chip.md +49 -20
- package/dist/components/data-display/DataTable.md +93 -0
- package/dist/components/data-display/InfoSign.md +12 -0
- package/dist/components/data-display/Table.md +72 -55
- package/dist/components/data-display/Tooltip.md +40 -40
- package/dist/components/data-display/Typography.md +53 -70
- package/dist/components/feedback/Alert.md +88 -72
- package/dist/components/feedback/CircularProgress.md +17 -0
- package/dist/components/feedback/Skeleton.md +17 -0
- package/dist/components/inputs/Button.md +94 -68
- package/dist/components/inputs/ButtonGroup.md +17 -0
- package/dist/components/inputs/Calendar.md +118 -457
- package/dist/components/inputs/Checkbox.md +185 -430
- package/dist/components/inputs/CurrencyInput.md +22 -0
- package/dist/components/inputs/DatePicker.md +59 -5
- package/dist/components/inputs/DateRangePicker.md +46 -5
- package/dist/components/inputs/FilterableCheckboxGroup.md +20 -3
- package/dist/components/inputs/FormControl.md +32 -2
- package/dist/components/inputs/IconButton.md +18 -0
- package/dist/components/inputs/Input.md +198 -136
- package/dist/components/inputs/MonthPicker.md +59 -5
- package/dist/components/inputs/MonthRangePicker.md +44 -5
- package/dist/components/inputs/PercentageInput.md +25 -0
- package/dist/components/inputs/RadioButton.md +23 -0
- package/dist/components/inputs/RadioList.md +20 -1
- package/dist/components/inputs/RadioTileGroup.md +37 -3
- package/dist/components/inputs/Select.md +56 -0
- package/dist/components/inputs/Slider.md +23 -0
- package/dist/components/inputs/Switch.md +20 -0
- package/dist/components/inputs/Textarea.md +32 -8
- package/dist/components/inputs/Uploader/Uploader.md +21 -0
- package/dist/components/layout/Box.md +52 -41
- package/dist/components/layout/Grid.md +87 -81
- package/dist/components/layout/Stack.md +88 -68
- package/dist/components/navigation/Breadcrumbs.md +57 -46
- package/dist/components/navigation/Drawer.md +17 -0
- package/dist/components/navigation/Dropdown.md +13 -0
- package/dist/components/navigation/IconMenuButton.md +17 -0
- package/dist/components/navigation/InsetDrawer.md +130 -292
- package/dist/components/navigation/Link.md +78 -0
- package/dist/components/navigation/Menu.md +17 -0
- package/dist/components/navigation/MenuButton.md +18 -0
- package/dist/components/navigation/Pagination.md +13 -0
- package/dist/components/navigation/Stepper.md +15 -0
- package/dist/components/navigation/Tabs.md +27 -0
- package/dist/components/surfaces/Accordions.md +804 -49
- package/dist/components/surfaces/Card.md +173 -97
- package/dist/components/surfaces/Divider.md +246 -82
- package/dist/components/surfaces/Sheet.md +15 -0
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +3 -3
- package/dist/index.cjs +99 -39
- package/dist/index.js +99 -39
- package/framer/index.js +1 -1
- package/package.json +1 -1
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
The Typography component is a core component for displaying text. It is based on Joy UI Typography and provides a variety of text levels and styles. You can apply consistent typography across all text elements such as headings, body text, and labels.
|
|
6
6
|
|
|
7
|
-
CDS extends the default typography system with **marketing levels** (`marketing-lg`, `marketing-md`, `marketing-sm`) for landing pages and promotional content, and uses **Poppins** as the display font family.
|
|
8
|
-
|
|
9
7
|
```tsx
|
|
10
8
|
<Typography children="Typography" />
|
|
11
9
|
```
|
|
@@ -37,12 +35,11 @@ function MyComponent() {
|
|
|
37
35
|
|
|
38
36
|
### Overview
|
|
39
37
|
|
|
40
|
-
Typography levels are divided into
|
|
38
|
+
Typography levels are divided into three groups: **Headings**, **Titles**, and **Body**. The default level is `body-md`.
|
|
41
39
|
|
|
42
|
-
- **Headings** (`h1`–`h4`): Used for page and section headings. Uses the display font family (
|
|
40
|
+
- **Headings** (`h1`–`h4`): Used for page and section headings. Uses the display font family (Inter).
|
|
43
41
|
- **Titles** (`title-lg`, `title-md`, `title-sm`): Used for UI labels, card titles, and emphasized text. Uses the body font family (Inter).
|
|
44
42
|
- **Body** (`body-lg`, `body-md`, `body-sm`, `body-xs`): Used for readable content and descriptions. Uses the body font family (Inter).
|
|
45
|
-
- **Marketing** (`marketing-lg`, `marketing-md`, `marketing-sm`): Used for landing pages, hero banners, and promotional content. Uses the display font family (Poppins).
|
|
46
43
|
|
|
47
44
|
```tsx
|
|
48
45
|
<>
|
|
@@ -107,26 +104,23 @@ Typography levels are divided into four groups: **Headings**, **Titles**, **Body
|
|
|
107
104
|
|
|
108
105
|
### Style Reference
|
|
109
106
|
|
|
110
|
-
| Level
|
|
111
|
-
|
|
|
112
|
-
| h1
|
|
113
|
-
| h2
|
|
114
|
-
| h3
|
|
115
|
-
| h4
|
|
116
|
-
| title-lg
|
|
117
|
-
| title-md
|
|
118
|
-
| title-sm
|
|
119
|
-
| body-lg
|
|
120
|
-
| body-md
|
|
121
|
-
| body-sm
|
|
122
|
-
| body-xs
|
|
123
|
-
| marketing-lg | display (Poppins) | 2.625rem (42px) | 600 (SemiBold) | 1.333 | -0.025em | text.primary | `<div>` |
|
|
124
|
-
| marketing-md | display (Poppins) | 2rem (32px) | 600 (SemiBold) | 1.333 | -0.025em | text.primary | `<div>` |
|
|
125
|
-
| marketing-sm | display (Poppins) | 1.5rem (24px) | 500 (Medium) | 1.333 | -0.025em | text.primary | `<div>` |
|
|
107
|
+
| Level | Font Family | Font Size | Font Weight | Line Height | Letter Spacing | Default Color | HTML Tag |
|
|
108
|
+
| -------- | --------------- | --------------- | -------------- | ----------- | -------------- | -------------- | -------- |
|
|
109
|
+
| h1 | display (Inter) | 2.25rem (36px) | 700 (Bold) | 1.333 | -0.025em | text.primary | `<h1>` |
|
|
110
|
+
| h2 | display (Inter) | 1.875rem (30px) | 700 (Bold) | 1.333 | -0.025em | text.primary | `<h2>` |
|
|
111
|
+
| h3 | display (Inter) | 1.5rem (24px) | 600 (SemiBold) | 1.333 | -0.025em | text.primary | `<h3>` |
|
|
112
|
+
| h4 | display (Inter) | 1.25rem (20px) | 600 (SemiBold) | 1.5 | -0.025em | text.primary | `<h4>` |
|
|
113
|
+
| title-lg | body (Inter) | 1.125rem (18px) | 600 (SemiBold) | 1.333 | - | text.primary | `<p>` |
|
|
114
|
+
| title-md | body (Inter) | 1rem (16px) | 500 (Medium) | 1.5 | - | text.primary | `<p>` |
|
|
115
|
+
| title-sm | body (Inter) | 0.875rem (14px) | 500 (Medium) | 1.429 | - | text.primary | `<p>` |
|
|
116
|
+
| body-lg | body (Inter) | 1.125rem (18px) | inherit | 1.5 | - | text.secondary | `<p>` |
|
|
117
|
+
| body-md | body (Inter) | 1rem (16px) | inherit | 1.5 | - | text.secondary | `<p>` |
|
|
118
|
+
| body-sm | body (Inter) | 0.875rem (14px) | inherit | 1.5 | - | text.tertiary | `<p>` |
|
|
119
|
+
| body-xs | body (Inter) | 0.75rem (12px) | 500 (Medium) | 1.5 | - | text.tertiary | `<span>` |
|
|
126
120
|
|
|
127
121
|
### Headings
|
|
128
122
|
|
|
129
|
-
Heading levels define page structure and hierarchy.
|
|
123
|
+
Heading levels define page structure and hierarchy. They use the display font family with heavier weights for visual prominence.
|
|
130
124
|
|
|
131
125
|
```tsx
|
|
132
126
|
<>
|
|
@@ -182,30 +176,6 @@ Body levels are used for readable content and descriptions. The default level `b
|
|
|
182
176
|
<Typography level="body-xs">Extra small text</Typography>
|
|
183
177
|
```
|
|
184
178
|
|
|
185
|
-
### Marketing Levels
|
|
186
|
-
|
|
187
|
-
Marketing levels are designed for landing pages, hero banners, and promotional content. They use the **Poppins** display font family for a distinctive marketing look.
|
|
188
|
-
|
|
189
|
-
```tsx
|
|
190
|
-
<>
|
|
191
|
-
<Typography level="marketing-lg">
|
|
192
|
-
marketing-lg - Large marketing text
|
|
193
|
-
</Typography>
|
|
194
|
-
<Typography level="marketing-md">
|
|
195
|
-
marketing-md - Medium marketing text
|
|
196
|
-
</Typography>
|
|
197
|
-
<Typography level="marketing-sm">
|
|
198
|
-
marketing-sm - Small marketing text
|
|
199
|
-
</Typography>
|
|
200
|
-
</>
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
```tsx
|
|
204
|
-
<Typography level="marketing-lg">Large marketing text</Typography>
|
|
205
|
-
<Typography level="marketing-md">Medium marketing text</Typography>
|
|
206
|
-
<Typography level="marketing-sm">Small marketing text</Typography>
|
|
207
|
-
```
|
|
208
|
-
|
|
209
179
|
## Design Token Reference
|
|
210
180
|
|
|
211
181
|
### Font Size Scale
|
|
@@ -243,7 +213,7 @@ Marketing levels are designed for landing pages, hero banners, and promotional c
|
|
|
243
213
|
### Font Families
|
|
244
214
|
|
|
245
215
|
- **body**: `"Inter"`, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif
|
|
246
|
-
- **display**: `"
|
|
216
|
+
- **display**: `"Inter"`, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif
|
|
247
217
|
- **code**: `"Source Code Pro"`, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace
|
|
248
218
|
|
|
249
219
|
## Colors
|
|
@@ -305,22 +275,19 @@ Use the `component` prop to render Typography as a different HTML element or Rea
|
|
|
305
275
|
|
|
306
276
|
**Default HTML tag mapping:**
|
|
307
277
|
|
|
308
|
-
| Level
|
|
309
|
-
|
|
|
310
|
-
| h1
|
|
311
|
-
| h2
|
|
312
|
-
| h3
|
|
313
|
-
| h4
|
|
314
|
-
| title-lg
|
|
315
|
-
| title-md
|
|
316
|
-
| title-sm
|
|
317
|
-
| body-lg
|
|
318
|
-
| body-md
|
|
319
|
-
| body-sm
|
|
320
|
-
| body-xs
|
|
321
|
-
| marketing-lg | `<div>` |
|
|
322
|
-
| marketing-md | `<div>` |
|
|
323
|
-
| marketing-sm | `<div>` |
|
|
278
|
+
| Level | Default HTML Tag |
|
|
279
|
+
| -------- | ---------------- |
|
|
280
|
+
| h1 | `<h1>` |
|
|
281
|
+
| h2 | `<h2>` |
|
|
282
|
+
| h3 | `<h3>` |
|
|
283
|
+
| h4 | `<h4>` |
|
|
284
|
+
| title-lg | `<p>` |
|
|
285
|
+
| title-md | `<p>` |
|
|
286
|
+
| title-sm | `<p>` |
|
|
287
|
+
| body-lg | `<p>` |
|
|
288
|
+
| body-md | `<p>` |
|
|
289
|
+
| body-sm | `<p>` |
|
|
290
|
+
| body-xs | `<span>` |
|
|
324
291
|
|
|
325
292
|
## Decorators
|
|
326
293
|
|
|
@@ -482,14 +449,14 @@ function ArticlePage() {
|
|
|
482
449
|
|
|
483
450
|
> 💡 **Tip: Use built-in form props instead**
|
|
484
451
|
>
|
|
485
|
-
> Input, Select, Textarea, DatePicker
|
|
486
|
-
>
|
|
452
|
+
> Input-family components such as Input, Select, Textarea, and DatePicker support `label` and `helperText` props natively.
|
|
453
|
+
> When building forms, it is recommended to use each component's built-in props rather than creating labels and helper text manually with Typography.
|
|
487
454
|
>
|
|
488
455
|
> ```tsx
|
|
489
|
-
> // ✅ Recommended:
|
|
456
|
+
> // ✅ Recommended: use the component's built-in props
|
|
490
457
|
> <Input label="Username" helperText="Please enter your real name." />
|
|
491
458
|
>
|
|
492
|
-
> // ❌ Not recommended:
|
|
459
|
+
> // ❌ Not recommended: manually composing with Typography
|
|
493
460
|
> <FormControl>
|
|
494
461
|
> <Typography level="title-sm" component="label">Username</Typography>
|
|
495
462
|
> <Input placeholder="Enter your name" />
|
|
@@ -542,6 +509,25 @@ function ArticlePage() {
|
|
|
542
509
|
</Stack>
|
|
543
510
|
```
|
|
544
511
|
|
|
512
|
+
## Props and Customization
|
|
513
|
+
|
|
514
|
+
### Key Props
|
|
515
|
+
|
|
516
|
+
| Prop | Type | Default | Description |
|
|
517
|
+
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------- | ----------- | ------------------------------------------------- |
|
|
518
|
+
| `children` | `ReactNode` | - | Text content |
|
|
519
|
+
| `level` | `'h1' \| 'h2' \| 'h3' \| 'h4' \| 'title-lg' \| 'title-md' \| 'title-sm' \| 'body-lg' \| 'body-md' \| 'body-sm' \| 'body-xs'` | `'body-md'` | Typography level (maps to semantic HTML elements) |
|
|
520
|
+
| `component` | `ElementType` | auto | Override the root element type |
|
|
521
|
+
| `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'neutral'` | Color scheme |
|
|
522
|
+
| `variant` | `'solid' \| 'soft' \| 'outlined' \| 'plain'` | - | Visual style (optional) |
|
|
523
|
+
| `noWrap` | `boolean` | `false` | Truncate text with ellipsis |
|
|
524
|
+
| `startDecorator` | `ReactNode` | - | Content before the text |
|
|
525
|
+
| `endDecorator` | `ReactNode` | - | Content after the text |
|
|
526
|
+
| `textColor` | `string` | - | Direct text color override |
|
|
527
|
+
| `sx` | `SxProps` | - | Custom styles |
|
|
528
|
+
|
|
529
|
+
> **Note**: Typography also accepts all Joy UI Typography props.
|
|
530
|
+
|
|
545
531
|
## Best Practices
|
|
546
532
|
|
|
547
533
|
1. **Semantic Structure**: Use heading levels in order (`h1` → `h2` → `h3`) to create a clear document hierarchy.
|
|
@@ -567,7 +553,6 @@ function ArticlePage() {
|
|
|
567
553
|
- **Headings** (`h1`–`h4`): Use for document structure and section titles.
|
|
568
554
|
- **Titles** (`title-lg/md/sm`): Use for UI labels, card headers, and emphasized text.
|
|
569
555
|
- **Body** (`body-lg/md/sm/xs`): Use for content, descriptions, and supporting text.
|
|
570
|
-
- **Marketing** (`marketing-lg/md/sm`): Use exclusively for marketing and landing pages — not for general UI.
|
|
571
556
|
|
|
572
557
|
6. **Avoid inline style overrides**: Prefer the `level` prop over `sx` for font sizing. Use `level` for consistent design tokens.
|
|
573
558
|
|
|
@@ -575,8 +560,6 @@ function ArticlePage() {
|
|
|
575
560
|
|
|
576
561
|
8. **Use `body-xs` sparingly**: Reserve `body-xs` (12px) for auxiliary information such as timestamps, counters, and footnotes — not for primary content.
|
|
577
562
|
|
|
578
|
-
9. **Marketing vs Heading levels**: Marketing levels are intended for landing pages and promotional content only. For standard application UI, use heading and title levels instead. Be aware that `h1`–`h4` and `marketing-*` levels use the Poppins display font, while `title-*` and `body-*` use Inter.
|
|
579
|
-
|
|
580
563
|
## Accessibility
|
|
581
564
|
|
|
582
565
|
- Use sequential heading levels (`h1` → `h2` → `h3`). Do not skip levels.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Introduction
|
|
4
4
|
|
|
5
|
-
Alert
|
|
5
|
+
The Alert component is a feedback component used to communicate important information, success messages, warnings, errors, and more to users. It is based on Joy UI Alert and uses a variety of colors and variants to visually distinguish the importance and nature of a message. It is used to clearly communicate system notifications, form validation results, task completion states, and similar feedback.
|
|
6
6
|
|
|
7
7
|
```tsx
|
|
8
8
|
<Alert
|
|
@@ -30,10 +30,10 @@ import { Alert } from '@ceed/cds';
|
|
|
30
30
|
function MyComponent() {
|
|
31
31
|
return (
|
|
32
32
|
<div>
|
|
33
|
-
{/*
|
|
33
|
+
{/* Basic alert */}
|
|
34
34
|
<Alert content="이것은 기본 알림입니다." />
|
|
35
35
|
|
|
36
|
-
{/*
|
|
36
|
+
{/* Success message */}
|
|
37
37
|
<Alert
|
|
38
38
|
color="success"
|
|
39
39
|
title="저장 완료"
|
|
@@ -41,7 +41,7 @@ function MyComponent() {
|
|
|
41
41
|
startDecorator={<CheckCircleIcon />}
|
|
42
42
|
/>
|
|
43
43
|
|
|
44
|
-
{/*
|
|
44
|
+
{/* Error message */}
|
|
45
45
|
<Alert
|
|
46
46
|
color="danger"
|
|
47
47
|
title="오류 발생"
|
|
@@ -58,7 +58,7 @@ function MyComponent() {
|
|
|
58
58
|
|
|
59
59
|
### Basic Usage
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
The most basic Alert usage.
|
|
62
62
|
|
|
63
63
|
```tsx
|
|
64
64
|
<Alert
|
|
@@ -69,7 +69,7 @@ function MyComponent() {
|
|
|
69
69
|
|
|
70
70
|
### Colors
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
You can distinguish message types through various colors.
|
|
73
73
|
|
|
74
74
|
```tsx
|
|
75
75
|
<div style={{
|
|
@@ -124,15 +124,15 @@ function MyComponent() {
|
|
|
124
124
|
</div>
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
-
- **primary**:
|
|
128
|
-
- **success**:
|
|
129
|
-
- **warning**:
|
|
130
|
-
- **danger**:
|
|
131
|
-
- **neutral**:
|
|
127
|
+
- **primary**: General informational message
|
|
128
|
+
- **success**: Success or completion message
|
|
129
|
+
- **warning**: Caution or warning message
|
|
130
|
+
- **danger**: Error or risk message
|
|
131
|
+
- **neutral**: Neutral message
|
|
132
132
|
|
|
133
133
|
### With Start Decorator
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
You can add an icon or another element before the message.
|
|
136
136
|
|
|
137
137
|
```tsx
|
|
138
138
|
<Alert
|
|
@@ -144,7 +144,7 @@ function MyComponent() {
|
|
|
144
144
|
|
|
145
145
|
### With Title
|
|
146
146
|
|
|
147
|
-
|
|
147
|
+
You can structure the message by adding a title.
|
|
148
148
|
|
|
149
149
|
```tsx
|
|
150
150
|
<Alert
|
|
@@ -156,7 +156,7 @@ function MyComponent() {
|
|
|
156
156
|
|
|
157
157
|
### With Actions
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
You can add actions the user can take.
|
|
160
160
|
|
|
161
161
|
```tsx
|
|
162
162
|
<Alert
|
|
@@ -168,7 +168,7 @@ function MyComponent() {
|
|
|
168
168
|
|
|
169
169
|
### Complete Alert
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
A complete Alert containing all elements.
|
|
172
172
|
|
|
173
173
|
```tsx
|
|
174
174
|
<Alert
|
|
@@ -184,7 +184,7 @@ function MyComponent() {
|
|
|
184
184
|
|
|
185
185
|
### Form Validation
|
|
186
186
|
|
|
187
|
-
|
|
187
|
+
Used to display form validation results.
|
|
188
188
|
|
|
189
189
|
```tsx
|
|
190
190
|
function LoginForm() {
|
|
@@ -218,9 +218,17 @@ function LoginForm() {
|
|
|
218
218
|
/>
|
|
219
219
|
)}
|
|
220
220
|
|
|
221
|
-
{success &&
|
|
221
|
+
{success && (
|
|
222
|
+
<Alert
|
|
223
|
+
color="success"
|
|
224
|
+
content="로그인이 완료되었습니다."
|
|
225
|
+
startDecorator={<CheckCircleIcon />}
|
|
226
|
+
/>
|
|
227
|
+
)}
|
|
222
228
|
|
|
223
|
-
<form onSubmit={handleSubmit}>
|
|
229
|
+
<form onSubmit={handleSubmit}>
|
|
230
|
+
{/* Form fields */}
|
|
231
|
+
</form>
|
|
224
232
|
</Stack>
|
|
225
233
|
);
|
|
226
234
|
}
|
|
@@ -228,7 +236,7 @@ function LoginForm() {
|
|
|
228
236
|
|
|
229
237
|
### System Notifications
|
|
230
238
|
|
|
231
|
-
|
|
239
|
+
Used to display system status or notifications.
|
|
232
240
|
|
|
233
241
|
```tsx
|
|
234
242
|
function SystemStatus() {
|
|
@@ -276,7 +284,7 @@ function SystemStatus() {
|
|
|
276
284
|
|
|
277
285
|
### Data Processing Status
|
|
278
286
|
|
|
279
|
-
|
|
287
|
+
Used to display data processing status.
|
|
280
288
|
|
|
281
289
|
```tsx
|
|
282
290
|
function DataProcessingStatus({ status, progress, onCancel, onRetry }) {
|
|
@@ -288,18 +296,14 @@ function DataProcessingStatus({ status, progress, onCancel, onRetry }) {
|
|
|
288
296
|
title: '데이터 처리 중',
|
|
289
297
|
content: `진행률: ${progress}%`,
|
|
290
298
|
startDecorator: <CircularProgress size="sm" />,
|
|
291
|
-
actions:
|
|
292
|
-
<Button size="sm" onClick={onCancel}>
|
|
293
|
-
취소
|
|
294
|
-
</Button>
|
|
295
|
-
),
|
|
299
|
+
actions: <Button size="sm" onClick={onCancel}>취소</Button>
|
|
296
300
|
};
|
|
297
301
|
case 'completed':
|
|
298
302
|
return {
|
|
299
303
|
color: 'success',
|
|
300
304
|
title: '처리 완료',
|
|
301
305
|
content: '모든 데이터가 성공적으로 처리되었습니다.',
|
|
302
|
-
startDecorator: <CheckCircleIcon
|
|
306
|
+
startDecorator: <CheckCircleIcon />
|
|
303
307
|
};
|
|
304
308
|
case 'failed':
|
|
305
309
|
return {
|
|
@@ -307,11 +311,7 @@ function DataProcessingStatus({ status, progress, onCancel, onRetry }) {
|
|
|
307
311
|
title: '처리 실패',
|
|
308
312
|
content: '데이터 처리 중 오류가 발생했습니다.',
|
|
309
313
|
startDecorator: <ErrorIcon />,
|
|
310
|
-
actions:
|
|
311
|
-
<Button size="sm" onClick={onRetry}>
|
|
312
|
-
다시 시도
|
|
313
|
-
</Button>
|
|
314
|
-
),
|
|
314
|
+
actions: <Button size="sm" onClick={onRetry}>다시 시도</Button>
|
|
315
315
|
};
|
|
316
316
|
default:
|
|
317
317
|
return null;
|
|
@@ -326,7 +326,7 @@ function DataProcessingStatus({ status, progress, onCancel, onRetry }) {
|
|
|
326
326
|
|
|
327
327
|
### Feature Announcements
|
|
328
328
|
|
|
329
|
-
|
|
329
|
+
Used to display new feature announcements or important notices.
|
|
330
330
|
|
|
331
331
|
```tsx
|
|
332
332
|
function FeatureAnnouncement() {
|
|
@@ -357,7 +357,7 @@ function FeatureAnnouncement() {
|
|
|
357
357
|
|
|
358
358
|
### Permission Requests
|
|
359
359
|
|
|
360
|
-
|
|
360
|
+
Used to guide permission requests or settings changes.
|
|
361
361
|
|
|
362
362
|
```tsx
|
|
363
363
|
function PermissionAlert() {
|
|
@@ -398,7 +398,7 @@ function PermissionAlert() {
|
|
|
398
398
|
|
|
399
399
|
### Inline Messages
|
|
400
400
|
|
|
401
|
-
|
|
401
|
+
Messages displayed inline within form fields or specific sections.
|
|
402
402
|
|
|
403
403
|
```tsx
|
|
404
404
|
function InlineMessages() {
|
|
@@ -434,7 +434,7 @@ function InlineMessages() {
|
|
|
434
434
|
|
|
435
435
|
### Dismissible Alerts
|
|
436
436
|
|
|
437
|
-
|
|
437
|
+
An implementation example of Alerts that users can dismiss.
|
|
438
438
|
|
|
439
439
|
```tsx
|
|
440
440
|
function DismissibleAlerts() {
|
|
@@ -445,19 +445,23 @@ function DismissibleAlerts() {
|
|
|
445
445
|
]);
|
|
446
446
|
|
|
447
447
|
const dismissAlert = (id) => {
|
|
448
|
-
setAlerts(
|
|
448
|
+
setAlerts(prev => prev.filter(alert => alert.id !== id));
|
|
449
449
|
};
|
|
450
450
|
|
|
451
451
|
return (
|
|
452
452
|
<Stack spacing={2}>
|
|
453
|
-
{alerts.map(
|
|
453
|
+
{alerts.map(alert => (
|
|
454
454
|
<Alert
|
|
455
455
|
key={alert.id}
|
|
456
456
|
color={getAlertColor(alert.type)}
|
|
457
457
|
content={alert.message}
|
|
458
458
|
startDecorator={getAlertIcon(alert.type)}
|
|
459
459
|
actions={
|
|
460
|
-
<IconButton
|
|
460
|
+
<IconButton
|
|
461
|
+
size="sm"
|
|
462
|
+
variant="plain"
|
|
463
|
+
onClick={() => dismissAlert(alert.id)}
|
|
464
|
+
>
|
|
461
465
|
<CloseIcon />
|
|
462
466
|
</IconButton>
|
|
463
467
|
}
|
|
@@ -472,13 +476,13 @@ function DismissibleAlerts() {
|
|
|
472
476
|
|
|
473
477
|
### Content Types
|
|
474
478
|
|
|
475
|
-
Alert
|
|
479
|
+
Alert supports various forms of content.
|
|
476
480
|
|
|
477
481
|
```tsx
|
|
478
|
-
//
|
|
482
|
+
// Plain text
|
|
479
483
|
<Alert content="간단한 메시지" />
|
|
480
484
|
|
|
481
|
-
// React
|
|
485
|
+
// React element
|
|
482
486
|
<Alert
|
|
483
487
|
content={
|
|
484
488
|
<div>
|
|
@@ -488,7 +492,7 @@ Alert는 다양한 형태의 콘텐츠를 지원합니다.
|
|
|
488
492
|
}
|
|
489
493
|
/>
|
|
490
494
|
|
|
491
|
-
//
|
|
495
|
+
// Separate title and content
|
|
492
496
|
<Alert
|
|
493
497
|
title="업데이트 완료"
|
|
494
498
|
content="애플리케이션이 최신 버전으로 업데이트되었습니다."
|
|
@@ -497,7 +501,7 @@ Alert는 다양한 형태의 콘텐츠를 지원합니다.
|
|
|
497
501
|
|
|
498
502
|
### Variants
|
|
499
503
|
|
|
500
|
-
|
|
504
|
+
Provides various visual styles.
|
|
501
505
|
|
|
502
506
|
```tsx
|
|
503
507
|
<Stack spacing={2}>
|
|
@@ -510,7 +514,7 @@ Alert는 다양한 형태의 콘텐츠를 지원합니다.
|
|
|
510
514
|
|
|
511
515
|
### Sizes
|
|
512
516
|
|
|
513
|
-
|
|
517
|
+
You can adjust the Alert size.
|
|
514
518
|
|
|
515
519
|
```tsx
|
|
516
520
|
<Stack spacing={2}>
|
|
@@ -522,7 +526,7 @@ Alert의 크기를 조절할 수 있습니다.
|
|
|
522
526
|
|
|
523
527
|
### Custom Styling
|
|
524
528
|
|
|
525
|
-
|
|
529
|
+
You can apply custom styles using the `sx` prop.
|
|
526
530
|
|
|
527
531
|
```tsx
|
|
528
532
|
<Alert
|
|
@@ -540,61 +544,65 @@ sx prop을 사용해 커스텀 스타일을 적용할 수 있습니다.
|
|
|
540
544
|
|
|
541
545
|
## Accessibility
|
|
542
546
|
|
|
543
|
-
Alert
|
|
547
|
+
The Alert component provides the following accessibility features:
|
|
544
548
|
|
|
545
|
-
### ARIA
|
|
549
|
+
### ARIA Attributes
|
|
546
550
|
|
|
547
|
-
|
|
551
|
+
Appropriate ARIA attributes are applied automatically.
|
|
548
552
|
|
|
549
|
-
- `role="alert"`:
|
|
550
|
-
- `aria-live="polite"`:
|
|
553
|
+
- `role="alert"`: For important messages that should be announced to the user immediately
|
|
554
|
+
- `aria-live="polite"`: For less urgent messages
|
|
551
555
|
|
|
552
|
-
###
|
|
556
|
+
### Keyboard Navigation
|
|
553
557
|
|
|
554
|
-
Alert
|
|
558
|
+
Action buttons inside an Alert can be navigated by keyboard.
|
|
555
559
|
|
|
556
|
-
###
|
|
560
|
+
### Screen Reader Support
|
|
557
561
|
|
|
558
|
-
|
|
562
|
+
The title and content are structured appropriately for screen readers.
|
|
559
563
|
|
|
560
564
|
```tsx
|
|
561
565
|
<Alert
|
|
562
566
|
title="오류 발생"
|
|
563
567
|
content="입력하신 정보를 다시 확인해주세요."
|
|
564
568
|
startDecorator={<ErrorIcon aria-hidden="true" />}
|
|
565
|
-
actions={
|
|
569
|
+
actions={
|
|
570
|
+
<Button aria-label="오류 메시지 닫기">
|
|
571
|
+
닫기
|
|
572
|
+
</Button>
|
|
573
|
+
}
|
|
566
574
|
/>
|
|
567
575
|
```
|
|
568
576
|
|
|
569
577
|
## Best Practices
|
|
570
578
|
|
|
571
|
-
1.
|
|
579
|
+
1. **Use appropriate colors**: Use colors that match the nature of the message.
|
|
572
580
|
|
|
573
581
|
```tsx
|
|
574
|
-
// ✅
|
|
582
|
+
// ✅ Good example
|
|
575
583
|
<Alert color="success" content="저장 완료" />
|
|
576
584
|
<Alert color="danger" content="오류 발생" />
|
|
577
585
|
<Alert color="warning" content="주의 필요" />
|
|
578
586
|
|
|
579
|
-
// ❌
|
|
580
|
-
<Alert color="success" content="오류 발생" /> //
|
|
587
|
+
// ❌ Bad example
|
|
588
|
+
<Alert color="success" content="오류 발생" /> // Incorrect color
|
|
581
589
|
```
|
|
582
590
|
|
|
583
|
-
2.
|
|
591
|
+
2. **Clear messaging**: Write clear messages that are easy for users to understand.
|
|
584
592
|
|
|
585
593
|
```tsx
|
|
586
|
-
// ✅
|
|
594
|
+
// ✅ Clear message
|
|
587
595
|
<Alert
|
|
588
596
|
color="danger"
|
|
589
597
|
title="업로드 실패"
|
|
590
598
|
content="파일이 너무 큽니다. 10MB 이하의 파일을 선택해주세요."
|
|
591
599
|
/>
|
|
592
600
|
|
|
593
|
-
// ❌
|
|
601
|
+
// ❌ Vague message
|
|
594
602
|
<Alert content="오류가 발생했습니다." />
|
|
595
603
|
```
|
|
596
604
|
|
|
597
|
-
3.
|
|
605
|
+
3. **Appropriate actions**: Provide the next step the user can take.
|
|
598
606
|
|
|
599
607
|
```tsx
|
|
600
608
|
<Alert
|
|
@@ -608,9 +616,9 @@ Alert 내의 액션 버튼들은 키보드로 탐색 가능합니다.
|
|
|
608
616
|
/>
|
|
609
617
|
```
|
|
610
618
|
|
|
611
|
-
4.
|
|
619
|
+
4. **Avoid overuse**: Do not show too many Alerts at the same time.
|
|
612
620
|
|
|
613
|
-
5.
|
|
621
|
+
5. **Auto-dismiss**: Implement temporary messages so they dismiss automatically.
|
|
614
622
|
|
|
615
623
|
```tsx
|
|
616
624
|
function AutoDismissAlert() {
|
|
@@ -626,22 +634,30 @@ function AutoDismissAlert() {
|
|
|
626
634
|
|
|
627
635
|
if (!visible) return null;
|
|
628
636
|
|
|
629
|
-
return
|
|
637
|
+
return (
|
|
638
|
+
<Alert
|
|
639
|
+
color="success"
|
|
640
|
+
content="저장이 완료되었습니다."
|
|
641
|
+
startDecorator={<CheckIcon />}
|
|
642
|
+
/>
|
|
643
|
+
);
|
|
630
644
|
}
|
|
631
645
|
```
|
|
632
646
|
|
|
633
647
|
## Performance Considerations
|
|
634
648
|
|
|
635
|
-
1.
|
|
649
|
+
1. **Conditional rendering**: Render Alerts only when needed.
|
|
636
650
|
|
|
637
|
-
2.
|
|
651
|
+
2. **Memoization**: Consider memoizing complex Alert content.
|
|
638
652
|
|
|
639
653
|
```tsx
|
|
640
|
-
const alertContent = useMemo(() =>
|
|
654
|
+
const alertContent = useMemo(() => (
|
|
655
|
+
<ComplexAlertContent data={data} />
|
|
656
|
+
), [data]);
|
|
641
657
|
|
|
642
|
-
<Alert content={alertContent}
|
|
658
|
+
<Alert content={alertContent} />
|
|
643
659
|
```
|
|
644
660
|
|
|
645
|
-
3.
|
|
661
|
+
3. **Batch handling**: Manage multiple Alerts efficiently.
|
|
646
662
|
|
|
647
|
-
Alert
|
|
663
|
+
Alert is a core component for communicating with users. With appropriate colors, clear messaging, and useful actions, it can provide an excellent user experience.
|
|
@@ -226,6 +226,23 @@ function SubmitButton({ isSubmitting }: { isSubmitting: boolean }) {
|
|
|
226
226
|
}
|
|
227
227
|
```
|
|
228
228
|
|
|
229
|
+
## Props and Customization
|
|
230
|
+
|
|
231
|
+
### Key Props
|
|
232
|
+
|
|
233
|
+
| Prop | Type | Default | Description |
|
|
234
|
+
| ------------- | -------------------------------------------------------------- | ----------- | -------------------------------------------- |
|
|
235
|
+
| `determinate` | `boolean` | `false` | Show determinate progress (requires `value`) |
|
|
236
|
+
| `value` | `number` | - | Progress value (0-100) for determinate mode |
|
|
237
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Progress indicator size |
|
|
238
|
+
| `variant` | `'solid' \| 'soft' \| 'outlined' \| 'plain'` | `'soft'` | Visual style |
|
|
239
|
+
| `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'primary'` | Color scheme |
|
|
240
|
+
| `thickness` | `number` | - | Stroke width of the circle |
|
|
241
|
+
| `children` | `ReactNode` | - | Content rendered in the center |
|
|
242
|
+
| `sx` | `SxProps` | - | Custom styles |
|
|
243
|
+
|
|
244
|
+
> **Note**: CircularProgress also accepts all Joy UI CircularProgress props.
|
|
245
|
+
|
|
229
246
|
## Best Practices
|
|
230
247
|
|
|
231
248
|
1. **Use indeterminate for unknown durations**: When you cannot estimate progress, use the default spinning mode. Switch to determinate only when you can track actual progress.
|