@ceed/ads 1.30.0 → 1.31.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 +85 -74
- package/dist/components/data-display/Badge.md +23 -5
- package/dist/components/data-display/Chip.md +49 -35
- package/dist/components/data-display/DataTable.md +93 -0
- package/dist/components/data-display/InfoSign.md +15 -5
- package/dist/components/data-display/Markdown.md +22 -26
- package/dist/components/data-display/Table.md +63 -53
- package/dist/components/data-display/Tooltip.md +70 -58
- package/dist/components/data-display/Typography.md +28 -11
- package/dist/components/feedback/Alert.md +86 -74
- package/dist/components/feedback/CircularProgress.md +20 -5
- package/dist/components/feedback/Dialog.md +8 -12
- package/dist/components/feedback/Modal.md +12 -16
- package/dist/components/feedback/Skeleton.md +20 -5
- package/dist/components/inputs/Autocomplete.md +8 -10
- package/dist/components/inputs/Button.md +107 -87
- package/dist/components/inputs/ButtonGroup.md +20 -5
- package/dist/components/inputs/Calendar.md +25 -5
- package/dist/components/inputs/Checkbox.md +171 -450
- package/dist/components/inputs/CurrencyInput.md +25 -5
- package/dist/components/inputs/DatePicker.md +59 -5
- package/dist/components/inputs/DateRangePicker.md +46 -5
- package/dist/components/inputs/FilterMenu.md +85 -9
- package/dist/components/inputs/FilterableCheckboxGroup.md +23 -8
- package/dist/components/inputs/FormControl.md +34 -6
- package/dist/components/inputs/IconButton.md +21 -5
- package/dist/components/inputs/Input.md +254 -68
- package/dist/components/inputs/MonthPicker.md +59 -5
- package/dist/components/inputs/MonthRangePicker.md +44 -5
- package/dist/components/inputs/PercentageInput.md +28 -5
- package/dist/components/inputs/RadioButton.md +26 -5
- package/dist/components/inputs/RadioList.md +23 -6
- package/dist/components/inputs/RadioTileGroup.md +40 -8
- package/dist/components/inputs/Select.md +59 -5
- package/dist/components/inputs/Slider.md +26 -5
- package/dist/components/inputs/Switch.md +23 -5
- package/dist/components/inputs/Textarea.md +27 -5
- package/dist/components/inputs/Uploader/Uploader.md +24 -5
- package/dist/components/layout/Box.md +66 -58
- package/dist/components/layout/Container.md +9 -13
- package/dist/components/layout/Grid.md +91 -75
- package/dist/components/layout/Stack.md +85 -70
- package/dist/components/navigation/Breadcrumbs.md +23 -14
- package/dist/components/navigation/Dropdown.md +29 -20
- package/dist/components/navigation/IconMenuButton.md +24 -11
- package/dist/components/navigation/InsetDrawer.md +16 -5
- package/dist/components/navigation/Link.md +30 -14
- package/dist/components/navigation/Menu.md +33 -20
- package/dist/components/navigation/MenuButton.md +26 -12
- package/dist/components/navigation/NavigationGroup.md +7 -11
- package/dist/components/navigation/NavigationItem.md +8 -12
- package/dist/components/navigation/Navigator.md +5 -9
- package/dist/components/navigation/Pagination.md +21 -12
- package/dist/components/navigation/ProfileMenu.md +17 -5
- package/dist/components/navigation/Stepper.md +18 -5
- package/dist/components/navigation/Tabs.md +37 -14
- package/dist/components/surfaces/Accordions.md +12 -16
- package/dist/components/surfaces/Card.md +59 -47
- package/dist/components/surfaces/Divider.md +70 -61
- package/dist/components/surfaces/Sheet.md +18 -5
- 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
|
@@ -352,9 +352,7 @@ You can pass a responsive object to the `level` prop, or use `sx` to set respons
|
|
|
352
352
|
</Typography>
|
|
353
353
|
```
|
|
354
354
|
|
|
355
|
-
##
|
|
356
|
-
|
|
357
|
-
### Page Structure
|
|
355
|
+
## Page Structure
|
|
358
356
|
|
|
359
357
|
```tsx
|
|
360
358
|
function ArticlePage() {
|
|
@@ -385,7 +383,7 @@ function ArticlePage() {
|
|
|
385
383
|
}
|
|
386
384
|
```
|
|
387
385
|
|
|
388
|
-
|
|
386
|
+
## Card Content
|
|
389
387
|
|
|
390
388
|
```tsx
|
|
391
389
|
<Card>
|
|
@@ -409,7 +407,7 @@ function ArticlePage() {
|
|
|
409
407
|
</Card>
|
|
410
408
|
```
|
|
411
409
|
|
|
412
|
-
|
|
410
|
+
## Form Labels and Help Text
|
|
413
411
|
|
|
414
412
|
```tsx
|
|
415
413
|
<Stack spacing={2}>
|
|
@@ -437,14 +435,14 @@ function ArticlePage() {
|
|
|
437
435
|
|
|
438
436
|
> 💡 **Tip: Use built-in form props instead**
|
|
439
437
|
>
|
|
440
|
-
> Input, Select, Textarea, DatePicker
|
|
441
|
-
>
|
|
438
|
+
> Input-family components such as Input, Select, Textarea, and DatePicker support `label` and `helperText` props natively.
|
|
439
|
+
> When building forms, it is recommended to use each component's built-in props rather than creating labels and helper text manually with Typography.
|
|
442
440
|
>
|
|
443
441
|
> ```tsx
|
|
444
|
-
> // ✅ Recommended:
|
|
442
|
+
> // ✅ Recommended: use the component's built-in props
|
|
445
443
|
> <Input label="Username" helperText="Please enter your real name." />
|
|
446
444
|
>
|
|
447
|
-
> // ❌ Not recommended:
|
|
445
|
+
> // ❌ Not recommended: manually composing with Typography
|
|
448
446
|
> <FormControl>
|
|
449
447
|
> <Typography level="title-sm" component="label">Username</Typography>
|
|
450
448
|
> <Input placeholder="Enter your name" />
|
|
@@ -452,7 +450,7 @@ function ArticlePage() {
|
|
|
452
450
|
> </FormControl>
|
|
453
451
|
> ```
|
|
454
452
|
|
|
455
|
-
|
|
453
|
+
## Status and Indicators
|
|
456
454
|
|
|
457
455
|
```tsx
|
|
458
456
|
<Stack spacing={2}>
|
|
@@ -472,7 +470,7 @@ function ArticlePage() {
|
|
|
472
470
|
</Stack>
|
|
473
471
|
```
|
|
474
472
|
|
|
475
|
-
|
|
473
|
+
## List Content
|
|
476
474
|
|
|
477
475
|
```tsx
|
|
478
476
|
<Stack spacing={1}>
|
|
@@ -497,6 +495,25 @@ function ArticlePage() {
|
|
|
497
495
|
</Stack>
|
|
498
496
|
```
|
|
499
497
|
|
|
498
|
+
## Props and Customization
|
|
499
|
+
|
|
500
|
+
### Key Props
|
|
501
|
+
|
|
502
|
+
| Prop | Type | Default | Description |
|
|
503
|
+
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------- | ----------- | ------------------------------------------------- |
|
|
504
|
+
| `children` | `ReactNode` | - | Text content |
|
|
505
|
+
| `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) |
|
|
506
|
+
| `component` | `ElementType` | auto | Override the root element type |
|
|
507
|
+
| `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'neutral'` | Color scheme |
|
|
508
|
+
| `variant` | `'solid' \| 'soft' \| 'outlined' \| 'plain'` | - | Visual style (optional) |
|
|
509
|
+
| `noWrap` | `boolean` | `false` | Truncate text with ellipsis |
|
|
510
|
+
| `startDecorator` | `ReactNode` | - | Content before the text |
|
|
511
|
+
| `endDecorator` | `ReactNode` | - | Content after the text |
|
|
512
|
+
| `textColor` | `string` | - | Direct text color override |
|
|
513
|
+
| `sx` | `SxProps` | - | Custom styles |
|
|
514
|
+
|
|
515
|
+
> **Note**: Typography also accepts all Joy UI Typography props.
|
|
516
|
+
|
|
500
517
|
## Best Practices
|
|
501
518
|
|
|
502
519
|
1. **Semantic Structure**: Use heading levels in order (`h1` → `h2` → `h3`) to create a clear document hierarchy.
|
|
@@ -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/ads';
|
|
|
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="오류 발생"
|
|
@@ -54,11 +54,9 @@ function MyComponent() {
|
|
|
54
54
|
}
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
##
|
|
57
|
+
## Basic Usage
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
가장 기본적인 Alert 사용법입니다.
|
|
59
|
+
The most basic Alert usage.
|
|
62
60
|
|
|
63
61
|
```tsx
|
|
64
62
|
<Alert
|
|
@@ -67,9 +65,9 @@ function MyComponent() {
|
|
|
67
65
|
/>
|
|
68
66
|
```
|
|
69
67
|
|
|
70
|
-
|
|
68
|
+
## Alert Colors
|
|
71
69
|
|
|
72
|
-
|
|
70
|
+
You can distinguish message types through various colors.
|
|
73
71
|
|
|
74
72
|
```tsx
|
|
75
73
|
<div style={{
|
|
@@ -124,15 +122,15 @@ function MyComponent() {
|
|
|
124
122
|
</div>
|
|
125
123
|
```
|
|
126
124
|
|
|
127
|
-
- **primary**:
|
|
128
|
-
- **success**:
|
|
129
|
-
- **warning**:
|
|
130
|
-
- **danger**:
|
|
131
|
-
- **neutral**:
|
|
125
|
+
- **primary**: General informational message
|
|
126
|
+
- **success**: Success or completion message
|
|
127
|
+
- **warning**: Caution or warning message
|
|
128
|
+
- **danger**: Error or risk message
|
|
129
|
+
- **neutral**: Neutral message
|
|
132
130
|
|
|
133
|
-
|
|
131
|
+
## Alert with Start Decorator
|
|
134
132
|
|
|
135
|
-
|
|
133
|
+
You can add an icon or another element before the message.
|
|
136
134
|
|
|
137
135
|
```tsx
|
|
138
136
|
<Alert
|
|
@@ -142,9 +140,9 @@ function MyComponent() {
|
|
|
142
140
|
/>
|
|
143
141
|
```
|
|
144
142
|
|
|
145
|
-
|
|
143
|
+
## Alert with Title
|
|
146
144
|
|
|
147
|
-
|
|
145
|
+
You can structure the message by adding a title.
|
|
148
146
|
|
|
149
147
|
```tsx
|
|
150
148
|
<Alert
|
|
@@ -154,9 +152,9 @@ function MyComponent() {
|
|
|
154
152
|
/>
|
|
155
153
|
```
|
|
156
154
|
|
|
157
|
-
|
|
155
|
+
## Alert with Actions
|
|
158
156
|
|
|
159
|
-
|
|
157
|
+
You can add actions the user can take.
|
|
160
158
|
|
|
161
159
|
```tsx
|
|
162
160
|
<Alert
|
|
@@ -166,9 +164,9 @@ function MyComponent() {
|
|
|
166
164
|
/>
|
|
167
165
|
```
|
|
168
166
|
|
|
169
|
-
|
|
167
|
+
## Complete Alert Example
|
|
170
168
|
|
|
171
|
-
|
|
169
|
+
A complete Alert containing all elements.
|
|
172
170
|
|
|
173
171
|
```tsx
|
|
174
172
|
<Alert
|
|
@@ -180,11 +178,9 @@ function MyComponent() {
|
|
|
180
178
|
/>
|
|
181
179
|
```
|
|
182
180
|
|
|
183
|
-
##
|
|
184
|
-
|
|
185
|
-
### Form Validation
|
|
181
|
+
## Alert for Form Validation
|
|
186
182
|
|
|
187
|
-
|
|
183
|
+
Used to display form validation results.
|
|
188
184
|
|
|
189
185
|
```tsx
|
|
190
186
|
function LoginForm() {
|
|
@@ -227,16 +223,16 @@ function LoginForm() {
|
|
|
227
223
|
)}
|
|
228
224
|
|
|
229
225
|
<form onSubmit={handleSubmit}>
|
|
230
|
-
{/*
|
|
226
|
+
{/* Form fields */}
|
|
231
227
|
</form>
|
|
232
228
|
</Stack>
|
|
233
229
|
);
|
|
234
230
|
}
|
|
235
231
|
```
|
|
236
232
|
|
|
237
|
-
|
|
233
|
+
## Alert for System Notifications
|
|
238
234
|
|
|
239
|
-
|
|
235
|
+
Used to display system status or notifications.
|
|
240
236
|
|
|
241
237
|
```tsx
|
|
242
238
|
function SystemStatus() {
|
|
@@ -282,9 +278,9 @@ function SystemStatus() {
|
|
|
282
278
|
}
|
|
283
279
|
```
|
|
284
280
|
|
|
285
|
-
|
|
281
|
+
## Alert for Data Processing Status
|
|
286
282
|
|
|
287
|
-
|
|
283
|
+
Used to display data processing status.
|
|
288
284
|
|
|
289
285
|
```tsx
|
|
290
286
|
function DataProcessingStatus({ status, progress, onCancel, onRetry }) {
|
|
@@ -324,9 +320,9 @@ function DataProcessingStatus({ status, progress, onCancel, onRetry }) {
|
|
|
324
320
|
}
|
|
325
321
|
```
|
|
326
322
|
|
|
327
|
-
|
|
323
|
+
## Alert for Feature Announcements
|
|
328
324
|
|
|
329
|
-
|
|
325
|
+
Used to display new feature announcements or important notices.
|
|
330
326
|
|
|
331
327
|
```tsx
|
|
332
328
|
function FeatureAnnouncement() {
|
|
@@ -355,9 +351,9 @@ function FeatureAnnouncement() {
|
|
|
355
351
|
}
|
|
356
352
|
```
|
|
357
353
|
|
|
358
|
-
|
|
354
|
+
## Alert for Permission Requests
|
|
359
355
|
|
|
360
|
-
|
|
356
|
+
Used to guide permission requests or settings changes.
|
|
361
357
|
|
|
362
358
|
```tsx
|
|
363
359
|
function PermissionAlert() {
|
|
@@ -396,9 +392,9 @@ function PermissionAlert() {
|
|
|
396
392
|
}
|
|
397
393
|
```
|
|
398
394
|
|
|
399
|
-
|
|
395
|
+
## Inline Alert Messages
|
|
400
396
|
|
|
401
|
-
|
|
397
|
+
Messages displayed inline within form fields or specific sections.
|
|
402
398
|
|
|
403
399
|
```tsx
|
|
404
400
|
function InlineMessages() {
|
|
@@ -432,9 +428,9 @@ function InlineMessages() {
|
|
|
432
428
|
}
|
|
433
429
|
```
|
|
434
430
|
|
|
435
|
-
|
|
431
|
+
## Dismissible Alert
|
|
436
432
|
|
|
437
|
-
|
|
433
|
+
An implementation example of Alerts that users can dismiss.
|
|
438
434
|
|
|
439
435
|
```tsx
|
|
440
436
|
function DismissibleAlerts() {
|
|
@@ -474,15 +470,31 @@ function DismissibleAlerts() {
|
|
|
474
470
|
|
|
475
471
|
## Props and Customization
|
|
476
472
|
|
|
477
|
-
###
|
|
473
|
+
### Key Props
|
|
474
|
+
|
|
475
|
+
| Prop | Type | Default | Description |
|
|
476
|
+
| ---------------- | -------------------------------------------------------------- | ----------- | ------------------------------------------------------------------ |
|
|
477
|
+
| `content` | `ReactNode` | (required) | Alert message content |
|
|
478
|
+
| `title` | `string` | - | Optional title displayed above the content |
|
|
479
|
+
| `actions` | `ReactNode` | - | Action buttons or elements displayed on the right |
|
|
480
|
+
| `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'primary'` | Alert color scheme |
|
|
481
|
+
| `variant` | `'solid' \| 'soft' \| 'outlined' \| 'plain'` | `'soft'` | Visual style |
|
|
482
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Alert size (affects title/content typography levels) |
|
|
483
|
+
| `startDecorator` | `ReactNode` | - | Icon or element rendered before the content |
|
|
484
|
+
| `invertedColors` | `boolean` | `false` | Invert child component colors (auto `true` when `variant='solid'`) |
|
|
485
|
+
| `sx` | `SxProps` | - | Custom styles using the MUI system |
|
|
486
|
+
|
|
487
|
+
> **Note**: Alert also accepts all Joy UI Alert props and Framer Motion props.
|
|
488
|
+
|
|
489
|
+
## Alert Content Types
|
|
478
490
|
|
|
479
|
-
Alert
|
|
491
|
+
Alert supports various forms of content.
|
|
480
492
|
|
|
481
493
|
```tsx
|
|
482
|
-
//
|
|
494
|
+
// Plain text
|
|
483
495
|
<Alert content="간단한 메시지" />
|
|
484
496
|
|
|
485
|
-
// React
|
|
497
|
+
// React element
|
|
486
498
|
<Alert
|
|
487
499
|
content={
|
|
488
500
|
<div>
|
|
@@ -492,16 +504,16 @@ Alert는 다양한 형태의 콘텐츠를 지원합니다.
|
|
|
492
504
|
}
|
|
493
505
|
/>
|
|
494
506
|
|
|
495
|
-
//
|
|
507
|
+
// Separate title and content
|
|
496
508
|
<Alert
|
|
497
509
|
title="업데이트 완료"
|
|
498
510
|
content="애플리케이션이 최신 버전으로 업데이트되었습니다."
|
|
499
511
|
/>
|
|
500
512
|
```
|
|
501
513
|
|
|
502
|
-
|
|
514
|
+
## Alert Variants
|
|
503
515
|
|
|
504
|
-
|
|
516
|
+
Provides various visual styles.
|
|
505
517
|
|
|
506
518
|
```tsx
|
|
507
519
|
<Stack spacing={2}>
|
|
@@ -512,9 +524,9 @@ Alert는 다양한 형태의 콘텐츠를 지원합니다.
|
|
|
512
524
|
</Stack>
|
|
513
525
|
```
|
|
514
526
|
|
|
515
|
-
|
|
527
|
+
## Alert Sizes
|
|
516
528
|
|
|
517
|
-
|
|
529
|
+
You can adjust the Alert size.
|
|
518
530
|
|
|
519
531
|
```tsx
|
|
520
532
|
<Stack spacing={2}>
|
|
@@ -524,9 +536,9 @@ Alert의 크기를 조절할 수 있습니다.
|
|
|
524
536
|
</Stack>
|
|
525
537
|
```
|
|
526
538
|
|
|
527
|
-
|
|
539
|
+
## Alert Custom Styling
|
|
528
540
|
|
|
529
|
-
|
|
541
|
+
You can apply custom styles using the `sx` prop.
|
|
530
542
|
|
|
531
543
|
```tsx
|
|
532
544
|
<Alert
|
|
@@ -544,22 +556,22 @@ sx prop을 사용해 커스텀 스타일을 적용할 수 있습니다.
|
|
|
544
556
|
|
|
545
557
|
## Accessibility
|
|
546
558
|
|
|
547
|
-
Alert
|
|
559
|
+
The Alert component provides the following accessibility features:
|
|
548
560
|
|
|
549
|
-
### ARIA
|
|
561
|
+
### ARIA Attributes
|
|
550
562
|
|
|
551
|
-
|
|
563
|
+
Appropriate ARIA attributes are applied automatically.
|
|
552
564
|
|
|
553
|
-
- `role="alert"`:
|
|
554
|
-
- `aria-live="polite"`:
|
|
565
|
+
- `role="alert"`: For important messages that should be announced to the user immediately
|
|
566
|
+
- `aria-live="polite"`: For less urgent messages
|
|
555
567
|
|
|
556
|
-
###
|
|
568
|
+
### Keyboard Navigation
|
|
557
569
|
|
|
558
|
-
Alert
|
|
570
|
+
Action buttons inside an Alert can be navigated by keyboard.
|
|
559
571
|
|
|
560
|
-
###
|
|
572
|
+
### Screen Reader Support
|
|
561
573
|
|
|
562
|
-
|
|
574
|
+
The title and content are structured appropriately for screen readers.
|
|
563
575
|
|
|
564
576
|
```tsx
|
|
565
577
|
<Alert
|
|
@@ -576,33 +588,33 @@ Alert 내의 액션 버튼들은 키보드로 탐색 가능합니다.
|
|
|
576
588
|
|
|
577
589
|
## Best Practices
|
|
578
590
|
|
|
579
|
-
1.
|
|
591
|
+
1. **Use appropriate colors**: Use colors that match the nature of the message.
|
|
580
592
|
|
|
581
593
|
```tsx
|
|
582
|
-
// ✅
|
|
594
|
+
// ✅ Good example
|
|
583
595
|
<Alert color="success" content="저장 완료" />
|
|
584
596
|
<Alert color="danger" content="오류 발생" />
|
|
585
597
|
<Alert color="warning" content="주의 필요" />
|
|
586
598
|
|
|
587
|
-
// ❌
|
|
588
|
-
<Alert color="success" content="오류 발생" /> //
|
|
599
|
+
// ❌ Bad example
|
|
600
|
+
<Alert color="success" content="오류 발생" /> // Incorrect color
|
|
589
601
|
```
|
|
590
602
|
|
|
591
|
-
2.
|
|
603
|
+
2. **Clear messaging**: Write clear messages that are easy for users to understand.
|
|
592
604
|
|
|
593
605
|
```tsx
|
|
594
|
-
// ✅
|
|
606
|
+
// ✅ Clear message
|
|
595
607
|
<Alert
|
|
596
608
|
color="danger"
|
|
597
609
|
title="업로드 실패"
|
|
598
610
|
content="파일이 너무 큽니다. 10MB 이하의 파일을 선택해주세요."
|
|
599
611
|
/>
|
|
600
612
|
|
|
601
|
-
// ❌
|
|
613
|
+
// ❌ Vague message
|
|
602
614
|
<Alert content="오류가 발생했습니다." />
|
|
603
615
|
```
|
|
604
616
|
|
|
605
|
-
3.
|
|
617
|
+
3. **Appropriate actions**: Provide the next step the user can take.
|
|
606
618
|
|
|
607
619
|
```tsx
|
|
608
620
|
<Alert
|
|
@@ -616,9 +628,9 @@ Alert 내의 액션 버튼들은 키보드로 탐색 가능합니다.
|
|
|
616
628
|
/>
|
|
617
629
|
```
|
|
618
630
|
|
|
619
|
-
4.
|
|
631
|
+
4. **Avoid overuse**: Do not show too many Alerts at the same time.
|
|
620
632
|
|
|
621
|
-
5.
|
|
633
|
+
5. **Auto-dismiss**: Implement temporary messages so they dismiss automatically.
|
|
622
634
|
|
|
623
635
|
```tsx
|
|
624
636
|
function AutoDismissAlert() {
|
|
@@ -646,9 +658,9 @@ function AutoDismissAlert() {
|
|
|
646
658
|
|
|
647
659
|
## Performance Considerations
|
|
648
660
|
|
|
649
|
-
1.
|
|
661
|
+
1. **Conditional rendering**: Render Alerts only when needed.
|
|
650
662
|
|
|
651
|
-
2.
|
|
663
|
+
2. **Memoization**: Consider memoizing complex Alert content.
|
|
652
664
|
|
|
653
665
|
```tsx
|
|
654
666
|
const alertContent = useMemo(() => (
|
|
@@ -658,6 +670,6 @@ const alertContent = useMemo(() => (
|
|
|
658
670
|
<Alert content={alertContent} />
|
|
659
671
|
```
|
|
660
672
|
|
|
661
|
-
3.
|
|
673
|
+
3. **Batch handling**: Manage multiple Alerts efficiently.
|
|
662
674
|
|
|
663
|
-
Alert
|
|
675
|
+
Alert is a core component for communicating with users. With appropriate colors, clear messaging, and useful actions, it can provide an excellent user experience.
|
|
@@ -166,9 +166,7 @@ Control the stroke thickness of the progress ring with the `thickness` prop.
|
|
|
166
166
|
<CircularProgress thickness={8} />
|
|
167
167
|
```
|
|
168
168
|
|
|
169
|
-
##
|
|
170
|
-
|
|
171
|
-
### Data Fetching Indicator
|
|
169
|
+
## CircularProgress Data Fetching Indicator
|
|
172
170
|
|
|
173
171
|
```tsx
|
|
174
172
|
function DataLoader() {
|
|
@@ -194,7 +192,7 @@ function DataLoader() {
|
|
|
194
192
|
}
|
|
195
193
|
```
|
|
196
194
|
|
|
197
|
-
|
|
195
|
+
## CircularProgress File Upload Progress
|
|
198
196
|
|
|
199
197
|
```tsx
|
|
200
198
|
function FileUpload({ progress }: { progress: number }) {
|
|
@@ -209,7 +207,7 @@ function FileUpload({ progress }: { progress: number }) {
|
|
|
209
207
|
}
|
|
210
208
|
```
|
|
211
209
|
|
|
212
|
-
|
|
210
|
+
## CircularProgress Inline Loading Button
|
|
213
211
|
|
|
214
212
|
```tsx
|
|
215
213
|
function SubmitButton({ isSubmitting }: { isSubmitting: boolean }) {
|
|
@@ -226,6 +224,23 @@ function SubmitButton({ isSubmitting }: { isSubmitting: boolean }) {
|
|
|
226
224
|
}
|
|
227
225
|
```
|
|
228
226
|
|
|
227
|
+
## Props and Customization
|
|
228
|
+
|
|
229
|
+
### Key Props
|
|
230
|
+
|
|
231
|
+
| Prop | Type | Default | Description |
|
|
232
|
+
| ------------- | -------------------------------------------------------------- | ----------- | -------------------------------------------- |
|
|
233
|
+
| `determinate` | `boolean` | `false` | Show determinate progress (requires `value`) |
|
|
234
|
+
| `value` | `number` | - | Progress value (0-100) for determinate mode |
|
|
235
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Progress indicator size |
|
|
236
|
+
| `variant` | `'solid' \| 'soft' \| 'outlined' \| 'plain'` | `'soft'` | Visual style |
|
|
237
|
+
| `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'primary'` | Color scheme |
|
|
238
|
+
| `thickness` | `number` | - | Stroke width of the circle |
|
|
239
|
+
| `children` | `ReactNode` | - | Content rendered in the center |
|
|
240
|
+
| `sx` | `SxProps` | - | Custom styles |
|
|
241
|
+
|
|
242
|
+
> **Note**: CircularProgress also accepts all Joy UI CircularProgress props.
|
|
243
|
+
|
|
229
244
|
## Best Practices
|
|
230
245
|
|
|
231
246
|
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.
|
|
@@ -54,9 +54,7 @@ function ConfirmationDialog({ open, onClose, onConfirm }) {
|
|
|
54
54
|
}
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
##
|
|
58
|
-
|
|
59
|
-
### Playground
|
|
57
|
+
## Basic Usage
|
|
60
58
|
|
|
61
59
|
Interactive example with title, content, and action buttons.
|
|
62
60
|
|
|
@@ -68,7 +66,7 @@ Interactive example with title, content, and action buttons.
|
|
|
68
66
|
/>
|
|
69
67
|
```
|
|
70
68
|
|
|
71
|
-
|
|
69
|
+
## Fullscreen Dialog
|
|
72
70
|
|
|
73
71
|
Fullscreen mode for complex content or mobile views.
|
|
74
72
|
|
|
@@ -81,7 +79,7 @@ Fullscreen mode for complex content or mobile views.
|
|
|
81
79
|
/>
|
|
82
80
|
```
|
|
83
81
|
|
|
84
|
-
|
|
82
|
+
## Dialog with Input and KeyDown
|
|
85
83
|
|
|
86
84
|
Dialog with form inputs and keyboard event handling.
|
|
87
85
|
|
|
@@ -92,7 +90,7 @@ Dialog Content
|
|
|
92
90
|
</DialogFrame>
|
|
93
91
|
```
|
|
94
92
|
|
|
95
|
-
|
|
93
|
+
## Standalone DialogFrame
|
|
96
94
|
|
|
97
95
|
DialogFrame can be used without a Modal wrapper for embedding dialog-style layouts directly within a page.
|
|
98
96
|
|
|
@@ -165,9 +163,7 @@ function EmbeddedDialog() {
|
|
|
165
163
|
- **Frequent interactions**: Don't interrupt common workflows
|
|
166
164
|
- **Large content**: Use a page or InsetDrawer for lengthy content
|
|
167
165
|
|
|
168
|
-
##
|
|
169
|
-
|
|
170
|
-
### Delete Confirmation
|
|
166
|
+
## Delete Confirmation Dialog
|
|
171
167
|
|
|
172
168
|
```tsx
|
|
173
169
|
function DeleteConfirmation({ itemName, open, onClose, onDelete }) {
|
|
@@ -198,7 +194,7 @@ function DeleteConfirmation({ itemName, open, onClose, onDelete }) {
|
|
|
198
194
|
}
|
|
199
195
|
```
|
|
200
196
|
|
|
201
|
-
|
|
197
|
+
## Form Dialog
|
|
202
198
|
|
|
203
199
|
```tsx
|
|
204
200
|
function QuickAddDialog({ open, onClose, onSubmit }) {
|
|
@@ -243,7 +239,7 @@ function QuickAddDialog({ open, onClose, onSubmit }) {
|
|
|
243
239
|
}
|
|
244
240
|
```
|
|
245
241
|
|
|
246
|
-
|
|
242
|
+
## Unsaved Changes Dialog
|
|
247
243
|
|
|
248
244
|
```tsx
|
|
249
245
|
function UnsavedChangesDialog({ open, onClose, onDiscard, onSave }) {
|
|
@@ -322,7 +318,7 @@ function TermsDialog({ open, onClose, onAccept }) {
|
|
|
322
318
|
}
|
|
323
319
|
```
|
|
324
320
|
|
|
325
|
-
|
|
321
|
+
## Loading State Dialog
|
|
326
322
|
|
|
327
323
|
```tsx
|
|
328
324
|
function ProcessingDialog({ open, status, onClose }) {
|