@ceed/ads 1.23.3 → 1.23.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/data-display/Badge.md +71 -39
- package/dist/components/data-display/InfoSign.md +74 -98
- package/dist/components/data-display/Typography.md +310 -61
- package/dist/components/feedback/CircularProgress.md +257 -0
- package/dist/components/feedback/Skeleton.md +280 -0
- package/dist/components/feedback/llms.txt +2 -0
- package/dist/components/inputs/ButtonGroup.md +115 -106
- package/dist/components/inputs/Calendar.md +98 -459
- package/dist/components/inputs/CurrencyInput.md +181 -8
- package/dist/components/inputs/DatePicker.md +108 -436
- package/dist/components/inputs/DateRangePicker.md +130 -496
- package/dist/components/inputs/FilterMenu.md +169 -19
- package/dist/components/inputs/FilterableCheckboxGroup.md +119 -24
- package/dist/components/inputs/FormControl.md +368 -0
- package/dist/components/inputs/IconButton.md +137 -88
- package/dist/components/inputs/MonthPicker.md +95 -427
- package/dist/components/inputs/MonthRangePicker.md +89 -471
- package/dist/components/inputs/PercentageInput.md +183 -19
- package/dist/components/inputs/RadioButton.md +163 -35
- package/dist/components/inputs/RadioList.md +241 -0
- package/dist/components/inputs/RadioTileGroup.md +146 -62
- package/dist/components/inputs/Select.md +219 -328
- package/dist/components/inputs/Slider.md +334 -0
- package/dist/components/inputs/Switch.md +136 -376
- package/dist/components/inputs/Textarea.md +209 -11
- package/dist/components/inputs/Uploader/Uploader.md +145 -66
- package/dist/components/inputs/llms.txt +3 -0
- package/dist/components/navigation/Breadcrumbs.md +80 -322
- package/dist/components/navigation/Dropdown.md +92 -221
- package/dist/components/navigation/IconMenuButton.md +40 -502
- package/dist/components/navigation/InsetDrawer.md +68 -738
- package/dist/components/navigation/Link.md +39 -298
- package/dist/components/navigation/Menu.md +92 -285
- package/dist/components/navigation/MenuButton.md +55 -448
- package/dist/components/navigation/Pagination.md +47 -338
- package/dist/components/navigation/ProfileMenu.md +45 -268
- package/dist/components/navigation/Stepper.md +160 -28
- package/dist/components/navigation/Tabs.md +57 -316
- package/dist/components/surfaces/Sheet.md +150 -333
- package/dist/guides/ThemeProvider.md +116 -0
- package/dist/guides/llms.txt +9 -0
- package/dist/llms.txt +8 -0
- package/package.json +1 -1
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Introduction
|
|
4
4
|
|
|
5
|
-
IconButton
|
|
5
|
+
IconButton is a compact, icon-only button component designed for actions where a visual symbol alone is sufficient to communicate meaning. It is ideal for toolbars, table row actions, card headers, navigation bars, and any context where space efficiency is critical.
|
|
6
|
+
|
|
7
|
+
Because IconButton omits visible text, it relies entirely on the icon's clarity and supplementary accessibility attributes to convey its purpose. Always pair it with `aria-label` or a Tooltip to ensure all users can understand the button's function.
|
|
6
8
|
|
|
7
9
|
```tsx
|
|
8
10
|
<IconButton {...args} />
|
|
@@ -22,56 +24,26 @@ IconButton 컴포넌트는 아이콘만으로 구성된 버튼입니다. 공간
|
|
|
22
24
|
```tsx
|
|
23
25
|
import { IconButton } from '@ceed/ads';
|
|
24
26
|
import AddIcon from '@mui/icons-material/Add';
|
|
27
|
+
import DeleteIcon from '@mui/icons-material/Delete';
|
|
25
28
|
|
|
26
29
|
function MyComponent() {
|
|
27
30
|
return (
|
|
28
|
-
<div>
|
|
29
|
-
<IconButton onClick={
|
|
31
|
+
<div style={{ display: 'flex', gap: '0.5rem' }}>
|
|
32
|
+
<IconButton aria-label="Add item" onClick={handleAdd}>
|
|
30
33
|
<AddIcon />
|
|
31
34
|
</IconButton>
|
|
32
35
|
|
|
33
|
-
<IconButton color="danger" onClick={
|
|
36
|
+
<IconButton color="danger" aria-label="Delete item" onClick={handleDelete}>
|
|
34
37
|
<DeleteIcon />
|
|
35
38
|
</IconButton>
|
|
36
|
-
|
|
37
|
-
<IconButton disabled>
|
|
38
|
-
<EditIcon />
|
|
39
|
-
</IconButton>
|
|
40
39
|
</div>
|
|
41
40
|
);
|
|
42
41
|
}
|
|
43
42
|
```
|
|
44
43
|
|
|
45
|
-
##
|
|
46
|
-
|
|
47
|
-
### Basic Usage
|
|
48
|
-
|
|
49
|
-
기본적인 IconButton 사용법입니다.
|
|
50
|
-
|
|
51
|
-
```tsx
|
|
52
|
-
<div style={{
|
|
53
|
-
display: 'flex',
|
|
54
|
-
gap: '1rem',
|
|
55
|
-
alignItems: 'center'
|
|
56
|
-
}}>
|
|
57
|
-
<IconButton>
|
|
58
|
-
<Add />
|
|
59
|
-
</IconButton>
|
|
60
|
-
<IconButton>
|
|
61
|
-
<Edit />
|
|
62
|
-
</IconButton>
|
|
63
|
-
<IconButton>
|
|
64
|
-
<Delete />
|
|
65
|
-
</IconButton>
|
|
66
|
-
<IconButton>
|
|
67
|
-
<Settings />
|
|
68
|
-
</IconButton>
|
|
69
|
-
</div>
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Colors
|
|
44
|
+
## Colors
|
|
73
45
|
|
|
74
|
-
|
|
46
|
+
IconButton supports five semantic colors: `primary` (default), `neutral`, `danger`, `success`, and `warning`. Choose a color that reflects the nature of the action.
|
|
75
47
|
|
|
76
48
|
```tsx
|
|
77
49
|
<div style={{
|
|
@@ -97,9 +69,9 @@ function MyComponent() {
|
|
|
97
69
|
</div>
|
|
98
70
|
```
|
|
99
71
|
|
|
100
|
-
|
|
72
|
+
## Variants
|
|
101
73
|
|
|
102
|
-
|
|
74
|
+
Four visual variants are available: `solid` (filled background), `soft` (tinted background), `outlined` (border only), and `plain` (no background). Use `outlined` or `plain` for secondary actions, and `solid` for primary or high-emphasis actions.
|
|
103
75
|
|
|
104
76
|
```tsx
|
|
105
77
|
<div style={{
|
|
@@ -122,9 +94,9 @@ function MyComponent() {
|
|
|
122
94
|
</div>
|
|
123
95
|
```
|
|
124
96
|
|
|
125
|
-
|
|
97
|
+
## Sizes
|
|
126
98
|
|
|
127
|
-
|
|
99
|
+
The `size` prop controls the button dimensions. Available sizes are `sm`, `md` (default), and `lg`. Ensure touch targets meet the minimum 44px recommended size for touch interfaces.
|
|
128
100
|
|
|
129
101
|
```tsx
|
|
130
102
|
<div style={{
|
|
@@ -144,9 +116,9 @@ function MyComponent() {
|
|
|
144
116
|
</div>
|
|
145
117
|
```
|
|
146
118
|
|
|
147
|
-
|
|
119
|
+
## States
|
|
148
120
|
|
|
149
|
-
|
|
121
|
+
IconButton supports multiple interactive states including normal, disabled, and loading. Use `disabled` to prevent interaction and `loading` to indicate an in-progress async operation.
|
|
150
122
|
|
|
151
123
|
```tsx
|
|
152
124
|
<div style={{
|
|
@@ -202,9 +174,9 @@ function MyComponent() {
|
|
|
202
174
|
</div>
|
|
203
175
|
```
|
|
204
176
|
|
|
205
|
-
|
|
177
|
+
## With Badge
|
|
206
178
|
|
|
207
|
-
Badge
|
|
179
|
+
Combine IconButton with Badge to display notification counts, status indicators, or unread markers alongside the button.
|
|
208
180
|
|
|
209
181
|
```tsx
|
|
210
182
|
<div style={{
|
|
@@ -230,9 +202,9 @@ Badge와 함께 사용하여 알림 수나 상태를 표시할 수 있습니다.
|
|
|
230
202
|
</div>
|
|
231
203
|
```
|
|
232
204
|
|
|
233
|
-
|
|
205
|
+
## With Tooltip
|
|
234
206
|
|
|
235
|
-
Tooltip
|
|
207
|
+
Wrap IconButton in a Tooltip to provide a text description on hover. This is especially important for icon-only buttons since the icon alone may not be self-explanatory for all users.
|
|
236
208
|
|
|
237
209
|
```tsx
|
|
238
210
|
<div style={{
|
|
@@ -263,9 +235,40 @@ Tooltip과 함께 사용하여 버튼의 기능을 설명할 수 있습니다.
|
|
|
263
235
|
</div>
|
|
264
236
|
```
|
|
265
237
|
|
|
266
|
-
|
|
238
|
+
## Circular Variants
|
|
239
|
+
|
|
240
|
+
IconButton renders as a circular shape by default, making it visually distinct from rectangular text buttons and well-suited for floating action buttons and compact action rows.
|
|
241
|
+
|
|
242
|
+
```tsx
|
|
243
|
+
<div style={{
|
|
244
|
+
display: 'flex',
|
|
245
|
+
gap: '2rem',
|
|
246
|
+
alignItems: 'center'
|
|
247
|
+
}}>
|
|
248
|
+
<div>
|
|
249
|
+
<h4>Default</h4>
|
|
250
|
+
<div style={{
|
|
251
|
+
display: 'flex',
|
|
252
|
+
gap: '1rem',
|
|
253
|
+
alignItems: 'center'
|
|
254
|
+
}}>
|
|
255
|
+
<IconButton>
|
|
256
|
+
<Add />
|
|
257
|
+
</IconButton>
|
|
258
|
+
<IconButton variant="outlined">
|
|
259
|
+
<Edit />
|
|
260
|
+
</IconButton>
|
|
261
|
+
<IconButton variant="soft">
|
|
262
|
+
<Delete />
|
|
263
|
+
</IconButton>
|
|
264
|
+
</div>
|
|
265
|
+
</div>
|
|
266
|
+
</div>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## Action Buttons
|
|
267
270
|
|
|
268
|
-
|
|
271
|
+
A practical example of IconButton used for common CRUD operations with distinct colors signaling the nature of each action.
|
|
269
272
|
|
|
270
273
|
```tsx
|
|
271
274
|
<div style={{
|
|
@@ -293,69 +296,115 @@ Tooltip과 함께 사용하여 버튼의 기능을 설명할 수 있습니다.
|
|
|
293
296
|
|
|
294
297
|
## Common Use Cases
|
|
295
298
|
|
|
296
|
-
###
|
|
299
|
+
### Table Row Actions
|
|
297
300
|
|
|
298
301
|
```tsx
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
302
|
+
import { IconButton, Tooltip } from '@ceed/ads';
|
|
303
|
+
import EditIcon from '@mui/icons-material/Edit';
|
|
304
|
+
import DeleteIcon from '@mui/icons-material/Delete';
|
|
305
|
+
import VisibilityIcon from '@mui/icons-material/Visibility';
|
|
306
|
+
|
|
307
|
+
function RowActions({ onView, onEdit, onDelete }) {
|
|
308
|
+
return (
|
|
309
|
+
<div style={{ display: 'flex', gap: '0.25rem' }}>
|
|
310
|
+
<Tooltip title="View details">
|
|
311
|
+
<IconButton size="sm" variant="plain" color="neutral" onClick={onView}>
|
|
312
|
+
<VisibilityIcon />
|
|
313
|
+
</IconButton>
|
|
314
|
+
</Tooltip>
|
|
315
|
+
<Tooltip title="Edit">
|
|
316
|
+
<IconButton size="sm" variant="plain" color="neutral" onClick={onEdit}>
|
|
317
|
+
<EditIcon />
|
|
318
|
+
</IconButton>
|
|
319
|
+
</Tooltip>
|
|
320
|
+
<Tooltip title="Delete">
|
|
321
|
+
<IconButton size="sm" variant="plain" color="danger" onClick={onDelete}>
|
|
322
|
+
<DeleteIcon />
|
|
323
|
+
</IconButton>
|
|
324
|
+
</Tooltip>
|
|
325
|
+
</div>
|
|
326
|
+
);
|
|
327
|
+
}
|
|
310
328
|
```
|
|
311
329
|
|
|
312
|
-
###
|
|
330
|
+
### Dialog Close Button
|
|
313
331
|
|
|
314
332
|
```tsx
|
|
315
|
-
|
|
316
|
-
|
|
333
|
+
import CloseIcon from '@mui/icons-material/Close';
|
|
334
|
+
|
|
335
|
+
<IconButton
|
|
336
|
+
variant="plain"
|
|
337
|
+
color="neutral"
|
|
338
|
+
size="sm"
|
|
339
|
+
aria-label="Close dialog"
|
|
340
|
+
onClick={onClose}
|
|
341
|
+
sx={{ position: 'absolute', top: 8, right: 8 }}
|
|
342
|
+
>
|
|
343
|
+
<CloseIcon />
|
|
317
344
|
</IconButton>
|
|
318
345
|
```
|
|
319
346
|
|
|
320
|
-
###
|
|
347
|
+
### Navigation Back Button
|
|
321
348
|
|
|
322
349
|
```tsx
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
350
|
+
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
|
|
351
|
+
|
|
352
|
+
<IconButton
|
|
353
|
+
variant="outlined"
|
|
354
|
+
color="neutral"
|
|
355
|
+
aria-label="Go back"
|
|
356
|
+
onClick={() => router.back()}
|
|
357
|
+
>
|
|
358
|
+
<ArrowBackIcon />
|
|
328
359
|
</IconButton>
|
|
329
360
|
```
|
|
330
361
|
|
|
331
|
-
|
|
362
|
+
## Best Practices
|
|
363
|
+
|
|
364
|
+
1. **Always provide an accessible label.** Since there is no visible text, use `aria-label` or wrap with a Tooltip to describe the action.
|
|
332
365
|
|
|
333
366
|
```tsx
|
|
334
|
-
|
|
335
|
-
|
|
367
|
+
// ✅ Accessible icon button
|
|
368
|
+
<IconButton aria-label="Delete item" color="danger">
|
|
369
|
+
<DeleteIcon />
|
|
336
370
|
</IconButton>
|
|
337
|
-
|
|
338
|
-
|
|
371
|
+
|
|
372
|
+
// ❌ No accessible label
|
|
373
|
+
<IconButton color="danger">
|
|
374
|
+
<DeleteIcon />
|
|
339
375
|
</IconButton>
|
|
340
376
|
```
|
|
341
377
|
|
|
342
|
-
|
|
378
|
+
2. **Use semantic colors to convey intent.** Match the color to the action's nature: `danger` for destructive actions, `success` for confirmations, `neutral` for general-purpose actions.
|
|
343
379
|
|
|
344
|
-
|
|
380
|
+
```tsx
|
|
381
|
+
// ✅ Color matches the action
|
|
382
|
+
<IconButton color="danger" aria-label="Delete">
|
|
383
|
+
<DeleteIcon />
|
|
384
|
+
</IconButton>
|
|
345
385
|
|
|
346
|
-
|
|
386
|
+
// ❌ Misleading color
|
|
387
|
+
<IconButton color="success" aria-label="Delete">
|
|
388
|
+
<DeleteIcon />
|
|
389
|
+
</IconButton>
|
|
390
|
+
```
|
|
347
391
|
|
|
348
|
-
3.
|
|
349
|
-
|
|
350
|
-
|
|
392
|
+
3. **Use the `loading` prop for async operations.** This prevents double-clicks and provides visual feedback during network requests or processing.
|
|
393
|
+
|
|
394
|
+
```tsx
|
|
395
|
+
// ✅ Shows loading spinner during async action
|
|
396
|
+
<IconButton loading={isSaving} aria-label="Save" onClick={handleSave}>
|
|
397
|
+
<SaveIcon />
|
|
398
|
+
</IconButton>
|
|
399
|
+
```
|
|
351
400
|
|
|
352
|
-
4.
|
|
401
|
+
4. **Prefer universally recognized icons.** Choose icons that are widely understood (e.g., trash can for delete, pencil for edit, plus for add). Avoid ambiguous symbols without a Tooltip.
|
|
353
402
|
|
|
354
|
-
5.
|
|
355
|
-
- 빨간색(danger): 삭제, 취소 등의 위험한 액션
|
|
356
|
-
- 초록색(success): 저장, 승인 등의 긍정적인 액션
|
|
357
|
-
- 회색(neutral): 일반적인 액션
|
|
403
|
+
5. **Maintain consistent sizing within the same context.** Use the same `size` and `variant` for all IconButtons in a toolbar or action group to keep the interface clean and predictable.
|
|
358
404
|
|
|
359
|
-
|
|
405
|
+
## Accessibility
|
|
360
406
|
|
|
361
|
-
|
|
407
|
+
- **`aria-label` is essential**: Every IconButton must have either an `aria-label`, `aria-labelledby`, or a wrapping Tooltip with `title` to provide a text alternative for screen readers.
|
|
408
|
+
- **Keyboard interaction**: IconButton is focusable via `Tab` and can be activated with `Enter` or `Space`. Focus indicators are displayed by default.
|
|
409
|
+
- **Disabled state**: When `disabled` is set, the button receives `aria-disabled="true"` and becomes non-interactive. It remains visible in the DOM for screen readers to announce.
|
|
410
|
+
- **Touch targets**: Ensure the rendered button is at least 44x44 pixels for touch accessibility. The `sm` size may need additional padding in touch-heavy interfaces.
|