@ceed/cds 1.28.1 → 1.29.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/dist/Overview.md +5 -5
- package/dist/components/DatePicker/DatePicker.d.ts +10 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +10 -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 +84 -0
- package/dist/components/inputs/DateRangePicker.md +88 -0
- 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 +25 -0
- package/dist/components/inputs/MonthRangePicker.md +23 -0
- 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 +2 -2
- package/dist/index.browser.js.map +3 -3
- package/dist/index.cjs +173 -6
- package/dist/index.js +173 -6
- package/framer/index.js +1 -1
- package/package.json +1 -1
|
@@ -249,6 +249,23 @@ function UserProfile({ loading, user }: { loading: boolean; user?: User }) {
|
|
|
249
249
|
}
|
|
250
250
|
```
|
|
251
251
|
|
|
252
|
+
## Props and Customization
|
|
253
|
+
|
|
254
|
+
### Key Props
|
|
255
|
+
|
|
256
|
+
| Prop | Type | Default | Description |
|
|
257
|
+
| ----------- | ---------------------------------------------------------------- | ----------- | ---------------------------------------------- |
|
|
258
|
+
| `variant` | `'rectangular' \| 'circular' \| 'text' \| 'overlay' \| 'inline'` | `'overlay'` | Skeleton shape |
|
|
259
|
+
| `animation` | `'pulse' \| 'wave' \| false` | `'pulse'` | Animation type |
|
|
260
|
+
| `width` | `number \| string` | - | Skeleton width |
|
|
261
|
+
| `height` | `number \| string` | - | Skeleton height |
|
|
262
|
+
| `level` | Typography level | - | Matches text height for `text` variant |
|
|
263
|
+
| `loading` | `boolean` | `true` | When false, shows children instead of skeleton |
|
|
264
|
+
| `children` | `ReactNode` | - | Content to show when not loading |
|
|
265
|
+
| `sx` | `SxProps` | - | Custom styles |
|
|
266
|
+
|
|
267
|
+
> **Note**: Skeleton also accepts all Joy UI Skeleton props.
|
|
268
|
+
|
|
252
269
|
## Best Practices
|
|
253
270
|
|
|
254
271
|
1. **Match the final layout**: Skeleton placeholders should closely approximate the size and position of the real content to prevent layout shifts.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Introduction
|
|
4
4
|
|
|
5
|
-
Button
|
|
5
|
+
Button is the primary interactive element for triggering actions. Built on Joy UI's Button with Framer Motion animation support, it provides multiple visual variants, sizes, colors, loading states, and decorator slots. Use buttons for form submissions, navigation triggers, modal actions, and data operations.
|
|
6
6
|
|
|
7
7
|
```tsx
|
|
8
8
|
<>
|
|
@@ -26,7 +26,7 @@ Button 컴포넌트는 사용자가 클릭하여 특정 작업을 수행할 수
|
|
|
26
26
|
import { Button } from '@ceed/cds';
|
|
27
27
|
|
|
28
28
|
function MyComponent() {
|
|
29
|
-
return <Button onClick={() => console.log('
|
|
29
|
+
return <Button onClick={() => console.log('Clicked!')}>Click me</Button>;
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
|
@@ -34,7 +34,7 @@ function MyComponent() {
|
|
|
34
34
|
|
|
35
35
|
### Basic Usage
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
The most basic button usage.
|
|
38
38
|
|
|
39
39
|
```tsx
|
|
40
40
|
<>
|
|
@@ -46,7 +46,7 @@ function MyComponent() {
|
|
|
46
46
|
|
|
47
47
|
### Disabled State
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
A disabled button cannot be clicked and is visually dimmed.
|
|
50
50
|
|
|
51
51
|
```tsx
|
|
52
52
|
<>
|
|
@@ -67,7 +67,7 @@ function MyComponent() {
|
|
|
67
67
|
|
|
68
68
|
### Loading State
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
Shows a loading indicator during async operations. The button is automatically disabled while loading.
|
|
71
71
|
|
|
72
72
|
```tsx
|
|
73
73
|
<Button
|
|
@@ -84,7 +84,7 @@ function MyComponent() {
|
|
|
84
84
|
|
|
85
85
|
### Variants
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
Four visual styles are available to indicate action importance.
|
|
88
88
|
|
|
89
89
|
```tsx
|
|
90
90
|
<>
|
|
@@ -103,14 +103,14 @@ function MyComponent() {
|
|
|
103
103
|
</>
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
- **solid**:
|
|
107
|
-
- **soft**:
|
|
108
|
-
- **outlined**:
|
|
109
|
-
- **plain**:
|
|
106
|
+
- **solid**: High-emphasis primary actions (default)
|
|
107
|
+
- **soft**: Medium-emphasis secondary actions with a subtle background
|
|
108
|
+
- **outlined**: Low-emphasis actions with a border
|
|
109
|
+
- **plain**: Minimal actions with text only
|
|
110
110
|
|
|
111
111
|
### Sizes
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
Three sizes are available: `sm`, `md` (default), and `lg`.
|
|
114
114
|
|
|
115
115
|
```tsx
|
|
116
116
|
<>
|
|
@@ -126,13 +126,9 @@ function MyComponent() {
|
|
|
126
126
|
</>
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
-
- **sm**: 작은 크기 (제한된 공간에서 사용)
|
|
130
|
-
- **md**: 중간 크기 (기본값)
|
|
131
|
-
- **lg**: 큰 크기 (강조가 필요한 경우)
|
|
132
|
-
|
|
133
129
|
### Colors
|
|
134
130
|
|
|
135
|
-
|
|
131
|
+
Apply semantic colors to communicate intent.
|
|
136
132
|
|
|
137
133
|
```tsx
|
|
138
134
|
<>
|
|
@@ -154,15 +150,15 @@ function MyComponent() {
|
|
|
154
150
|
</>
|
|
155
151
|
```
|
|
156
152
|
|
|
157
|
-
- **primary**:
|
|
158
|
-
- **neutral**:
|
|
159
|
-
- **success**:
|
|
160
|
-
- **warning**:
|
|
161
|
-
- **danger**:
|
|
153
|
+
- **primary**: Main actions (default)
|
|
154
|
+
- **neutral**: Neutral actions
|
|
155
|
+
- **success**: Confirmation or positive actions
|
|
156
|
+
- **warning**: Caution-required actions
|
|
157
|
+
- **danger**: Destructive or irreversible actions
|
|
162
158
|
|
|
163
159
|
### Decorators
|
|
164
160
|
|
|
165
|
-
|
|
161
|
+
Add icons or other elements before or after the button text using `startDecorator` and `endDecorator`.
|
|
166
162
|
|
|
167
163
|
```tsx
|
|
168
164
|
<>
|
|
@@ -177,7 +173,7 @@ function MyComponent() {
|
|
|
177
173
|
|
|
178
174
|
### Loading Indicator
|
|
179
175
|
|
|
180
|
-
|
|
176
|
+
Customize the loading spinner with the `loadingIndicator` prop.
|
|
181
177
|
|
|
182
178
|
```tsx
|
|
183
179
|
<>
|
|
@@ -192,7 +188,7 @@ function MyComponent() {
|
|
|
192
188
|
|
|
193
189
|
### Loading Position
|
|
194
190
|
|
|
195
|
-
|
|
191
|
+
Control where the loading indicator appears with `loadingPosition`.
|
|
196
192
|
|
|
197
193
|
```tsx
|
|
198
194
|
<>
|
|
@@ -212,15 +208,15 @@ function MyComponent() {
|
|
|
212
208
|
```tsx
|
|
213
209
|
<form onSubmit={handleSubmit}>
|
|
214
210
|
<Stack spacing={2}>
|
|
215
|
-
<Input placeholder="
|
|
216
|
-
<Input placeholder="
|
|
211
|
+
<Input placeholder="Enter your name" />
|
|
212
|
+
<Input placeholder="Enter your email" />
|
|
217
213
|
|
|
218
214
|
<Stack direction="row" spacing={2} justifyContent="flex-end">
|
|
219
215
|
<Button variant="outlined" type="button" onClick={handleCancel}>
|
|
220
|
-
|
|
216
|
+
Cancel
|
|
221
217
|
</Button>
|
|
222
218
|
<Button type="submit" loading={isSubmitting}>
|
|
223
|
-
{isSubmitting ? '
|
|
219
|
+
{isSubmitting ? 'Saving...' : 'Save'}
|
|
224
220
|
</Button>
|
|
225
221
|
</Stack>
|
|
226
222
|
</Stack>
|
|
@@ -233,15 +229,15 @@ function MyComponent() {
|
|
|
233
229
|
<Modal open={open}>
|
|
234
230
|
<ModalDialog>
|
|
235
231
|
<ModalClose />
|
|
236
|
-
<DialogTitle
|
|
237
|
-
<DialogContent
|
|
232
|
+
<DialogTitle>Confirm Deletion</DialogTitle>
|
|
233
|
+
<DialogContent>Are you sure you want to delete this item? This action cannot be undone.</DialogContent>
|
|
238
234
|
|
|
239
235
|
<DialogActions>
|
|
240
236
|
<Button variant="outlined" onClick={handleClose}>
|
|
241
|
-
|
|
237
|
+
Cancel
|
|
242
238
|
</Button>
|
|
243
239
|
<Button color="danger" onClick={handleDelete}>
|
|
244
|
-
|
|
240
|
+
Delete
|
|
245
241
|
</Button>
|
|
246
242
|
</DialogActions>
|
|
247
243
|
</ModalDialog>
|
|
@@ -252,14 +248,14 @@ function MyComponent() {
|
|
|
252
248
|
|
|
253
249
|
```tsx
|
|
254
250
|
<Stack direction="row" spacing={2}>
|
|
255
|
-
<Button startDecorator={<AddIcon />}
|
|
251
|
+
<Button startDecorator={<AddIcon />}>Create New</Button>
|
|
256
252
|
|
|
257
253
|
<Button variant="outlined" startDecorator={<DownloadIcon />} onClick={handleDownload}>
|
|
258
|
-
|
|
254
|
+
Download
|
|
259
255
|
</Button>
|
|
260
256
|
|
|
261
257
|
<Button variant="soft" color="success" startDecorator={<ShareIcon />}>
|
|
262
|
-
|
|
258
|
+
Share
|
|
263
259
|
</Button>
|
|
264
260
|
</Stack>
|
|
265
261
|
```
|
|
@@ -274,9 +270,6 @@ function AsyncButton() {
|
|
|
274
270
|
setLoading(true);
|
|
275
271
|
try {
|
|
276
272
|
await api.processData();
|
|
277
|
-
// 성공 처리
|
|
278
|
-
} catch (error) {
|
|
279
|
-
// 에러 처리
|
|
280
273
|
} finally {
|
|
281
274
|
setLoading(false);
|
|
282
275
|
}
|
|
@@ -284,51 +277,84 @@ function AsyncButton() {
|
|
|
284
277
|
|
|
285
278
|
return (
|
|
286
279
|
<Button loading={loading} onClick={handleAsyncAction} startDecorator={<ProcessIcon />}>
|
|
287
|
-
|
|
280
|
+
Process Data
|
|
288
281
|
</Button>
|
|
289
282
|
);
|
|
290
283
|
}
|
|
291
284
|
```
|
|
292
285
|
|
|
293
|
-
|
|
286
|
+
## Props and Customization
|
|
287
|
+
|
|
288
|
+
### Key Props
|
|
289
|
+
|
|
290
|
+
| Prop | Type | Default | Description |
|
|
291
|
+
| ------------------ | -------------------------------------------------------------- | ---------------------- | ----------------------------------------------------------------- |
|
|
292
|
+
| `children` | `ReactNode` | - | Button content (text, icons, etc.) |
|
|
293
|
+
| `variant` | `'solid' \| 'soft' \| 'outlined' \| 'plain'` | `'solid'` | Visual style |
|
|
294
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Button size |
|
|
295
|
+
| `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'primary'` | Color scheme |
|
|
296
|
+
| `disabled` | `boolean` | `false` | Disables the button |
|
|
297
|
+
| `loading` | `boolean` | `false` | Shows a loading indicator and disables the button |
|
|
298
|
+
| `loadingIndicator` | `ReactNode` | `<CircularProgress />` | Custom loading indicator element |
|
|
299
|
+
| `loadingPosition` | `'start' \| 'end'` | `'start'` | Where the loading indicator appears |
|
|
300
|
+
| `startDecorator` | `ReactNode` | - | Content rendered before the button text |
|
|
301
|
+
| `endDecorator` | `ReactNode` | - | Content rendered after the button text |
|
|
302
|
+
| `fullWidth` | `boolean` | `false` | Stretches the button to fill its container width |
|
|
303
|
+
| `component` | `ElementType` | `'button'` | Root element type (polymorphic — can render as `a`, `Link`, etc.) |
|
|
304
|
+
| `type` | `'button' \| 'submit' \| 'reset'` | `'button'` | HTML button type attribute |
|
|
305
|
+
| `onClick` | `(event: MouseEvent) => void` | - | Click event handler |
|
|
306
|
+
| `sx` | `SxProps` | - | Custom styles using the MUI system |
|
|
307
|
+
|
|
308
|
+
> **Note**: Button also accepts all Joy UI Button props and Framer Motion props.
|
|
309
|
+
|
|
310
|
+
### Polymorphic Usage
|
|
311
|
+
|
|
312
|
+
Button supports the `component` prop to render as a different element:
|
|
294
313
|
|
|
295
314
|
```tsx
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
진행중
|
|
302
|
-
</Button>
|
|
303
|
-
<Button variant="outlined" size="sm">
|
|
304
|
-
완료
|
|
305
|
-
</Button>
|
|
306
|
-
</Stack>
|
|
315
|
+
// Render as an anchor tag
|
|
316
|
+
<Button component="a" href="/dashboard">Go to Dashboard</Button>
|
|
317
|
+
|
|
318
|
+
// Render as a React Router Link
|
|
319
|
+
<Button component={Link} to="/settings">Settings</Button>
|
|
307
320
|
```
|
|
308
321
|
|
|
309
322
|
## Best Practices
|
|
310
323
|
|
|
311
|
-
1.
|
|
324
|
+
1. **Choose the right variant for the action hierarchy**:
|
|
325
|
+
- Primary action: `solid`
|
|
326
|
+
- Secondary action: `outlined` or `soft`
|
|
327
|
+
- Tertiary/minimal action: `plain`
|
|
312
328
|
|
|
313
|
-
2.
|
|
314
|
-
-
|
|
315
|
-
-
|
|
316
|
-
-
|
|
329
|
+
2. **Use consistent color semantics**:
|
|
330
|
+
- Destructive actions: `danger`
|
|
331
|
+
- Confirmations: `success`
|
|
332
|
+
- Caution: `warning`
|
|
317
333
|
|
|
318
|
-
3.
|
|
319
|
-
- 위험한 작업: `danger`
|
|
320
|
-
- 성공/확인: `success`
|
|
321
|
-
- 주의 필요: `warning`
|
|
334
|
+
3. **Use clear, specific labels.** The button text should describe exactly what happens when clicked.
|
|
322
335
|
|
|
323
|
-
|
|
336
|
+
```tsx
|
|
337
|
+
// ✅ Good
|
|
338
|
+
<Button color="danger">Delete Account</Button>
|
|
324
339
|
|
|
325
|
-
|
|
340
|
+
// ❌ Bad
|
|
341
|
+
<Button color="danger">OK</Button>
|
|
342
|
+
```
|
|
326
343
|
|
|
327
|
-
|
|
344
|
+
4. **Show loading state during async operations** to provide user feedback.
|
|
328
345
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
346
|
+
```tsx
|
|
347
|
+
<Button loading={isSubmitting} type="submit">
|
|
348
|
+
Save Changes
|
|
349
|
+
</Button>
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
5. **Limit the number of primary buttons** in a view. Typically one `solid` primary button per section.
|
|
353
|
+
|
|
354
|
+
## Accessibility
|
|
333
355
|
|
|
334
|
-
|
|
356
|
+
- **Keyboard accessible**: Tab to focus, Space or Enter to activate.
|
|
357
|
+
- **Screen reader support**: Button text is announced as the accessible name.
|
|
358
|
+
- **Disabled state**: When `disabled`, the button is removed from the tab order.
|
|
359
|
+
- **Loading state**: When `loading`, the button is announced as disabled. Consider adding `aria-label` to describe the loading context if the loading indicator replaces the text.
|
|
360
|
+
- **Color contrast**: All color/variant combinations meet WCAG AA contrast ratios.
|
|
@@ -383,6 +383,23 @@ const [view, setView] = useState('list');
|
|
|
383
383
|
|
|
384
384
|
5. **Consider vertical orientation for narrow layouts.** On mobile or in sidebars, `orientation="vertical"` prevents horizontal overflow and improves usability.
|
|
385
385
|
|
|
386
|
+
## Props and Customization
|
|
387
|
+
|
|
388
|
+
### Key Props
|
|
389
|
+
|
|
390
|
+
| Prop | Type | Default | Description |
|
|
391
|
+
| ------------- | -------------------------------------------------------------- | -------------- | ----------------------------------- |
|
|
392
|
+
| `children` | `ReactNode` | - | Button elements inside the group |
|
|
393
|
+
| `variant` | `'solid' \| 'soft' \| 'outlined' \| 'plain'` | `'outlined'` | Visual style applied to all buttons |
|
|
394
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Size applied to all buttons |
|
|
395
|
+
| `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'neutral'` | Color applied to all buttons |
|
|
396
|
+
| `disabled` | `boolean` | `false` | Disables all buttons in the group |
|
|
397
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Layout direction |
|
|
398
|
+
| `spacing` | `number \| string` | `0` | Gap between buttons |
|
|
399
|
+
| `sx` | `SxProps` | - | Custom styles using the MUI system |
|
|
400
|
+
|
|
401
|
+
> **Note**: ButtonGroup accepts all Joy UI ButtonGroup props.
|
|
402
|
+
|
|
386
403
|
## Accessibility
|
|
387
404
|
|
|
388
405
|
- **Keyboard navigation**: All buttons within the group are focusable and navigable using the `Tab` key. Each button is a standard focusable element that responds to `Enter` and `Space`.
|