@ceed/ads 1.23.2 → 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/Dialog.md +8 -4
- package/dist/components/feedback/Modal.md +7 -3
- 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
|
-
Badge
|
|
5
|
+
Badge is a small visual indicator that overlays another UI element to display a count, status, or label. It is commonly used to show unread notification counts, online/offline status indicators, and "NEW" labels on menu items or navigation elements. The Badge wraps a child component (such as an icon button or avatar) and positions itself in the top-right corner by default.
|
|
6
|
+
|
|
7
|
+
Badge supports multiple colors, variants, and sizes for flexible visual customization. It also provides utility features like a `max` prop for truncating large numbers (e.g., "99+"), a `showZero` prop for controlling zero-count visibility, and a dot-only mode when no `badgeContent` is provided.
|
|
6
8
|
|
|
7
9
|
```tsx
|
|
8
10
|
<Badge {...args}>
|
|
@@ -26,7 +28,7 @@ Badge 컴포넌트는 다른 UI 요소 위에 작은 카운트, 상태, 또는
|
|
|
26
28
|
|
|
27
29
|
```tsx
|
|
28
30
|
import { Badge, IconButton } from '@ceed/ads';
|
|
29
|
-
import
|
|
31
|
+
import NotificationsIcon from '@mui/icons-material/Notifications';
|
|
30
32
|
|
|
31
33
|
function MyComponent() {
|
|
32
34
|
return (
|
|
@@ -39,11 +41,9 @@ function MyComponent() {
|
|
|
39
41
|
}
|
|
40
42
|
```
|
|
41
43
|
|
|
42
|
-
##
|
|
43
|
-
|
|
44
|
-
### Basic Usage
|
|
44
|
+
## Basic
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
Basic Badge usage showing numeric counts, max overflow, and text content.
|
|
47
47
|
|
|
48
48
|
```tsx
|
|
49
49
|
<div style={{
|
|
@@ -70,9 +70,9 @@ function MyComponent() {
|
|
|
70
70
|
</div>
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
## Colors
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
Apply semantic colors to convey the badge's meaning: `primary` for general counts, `danger` for urgent notifications, `success` for online status, and `warning` for attention items.
|
|
76
76
|
|
|
77
77
|
```tsx
|
|
78
78
|
<div style={{
|
|
@@ -111,9 +111,9 @@ function MyComponent() {
|
|
|
111
111
|
</div>
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
## Variants
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
Four style variants are available: `solid` (filled), `soft` (subtle background), `outlined` (border only), and `plain` (minimal).
|
|
117
117
|
|
|
118
118
|
```tsx
|
|
119
119
|
<div style={{
|
|
@@ -146,9 +146,9 @@ function MyComponent() {
|
|
|
146
146
|
</div>
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
## Sizes
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
Three sizes -- `sm`, `md`, and `lg` -- allow the badge to scale proportionally with its wrapped element.
|
|
152
152
|
|
|
153
153
|
```tsx
|
|
154
154
|
<div style={{
|
|
@@ -176,9 +176,9 @@ function MyComponent() {
|
|
|
176
176
|
</div>
|
|
177
177
|
```
|
|
178
178
|
|
|
179
|
-
|
|
179
|
+
## With Avatar
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
Badge pairs naturally with Avatar to indicate user status (e.g., notification count or online indicator).
|
|
182
182
|
|
|
183
183
|
```tsx
|
|
184
184
|
<div style={{
|
|
@@ -195,9 +195,9 @@ function MyComponent() {
|
|
|
195
195
|
</div>
|
|
196
196
|
```
|
|
197
197
|
|
|
198
|
-
|
|
198
|
+
## Dot Badge
|
|
199
199
|
|
|
200
|
-
|
|
200
|
+
When no `badgeContent` is provided, Badge renders as a small dot. This is useful for simple presence or status indicators without a specific count.
|
|
201
201
|
|
|
202
202
|
```tsx
|
|
203
203
|
<div style={{
|
|
@@ -216,9 +216,9 @@ function MyComponent() {
|
|
|
216
216
|
</div>
|
|
217
217
|
```
|
|
218
218
|
|
|
219
|
-
|
|
219
|
+
## Max Count
|
|
220
220
|
|
|
221
|
-
|
|
221
|
+
Use the `max` prop to cap the displayed number. When `badgeContent` exceeds `max`, it renders as "max+" (e.g., "99+").
|
|
222
222
|
|
|
223
223
|
```tsx
|
|
224
224
|
<div style={{
|
|
@@ -245,9 +245,9 @@ function MyComponent() {
|
|
|
245
245
|
</div>
|
|
246
246
|
```
|
|
247
247
|
|
|
248
|
-
|
|
248
|
+
## Show Zero
|
|
249
249
|
|
|
250
|
-
|
|
250
|
+
By default, Badge hides when `badgeContent` is `0`. Use the `showZero` prop to force it to remain visible.
|
|
251
251
|
|
|
252
252
|
```tsx
|
|
253
253
|
<div style={{
|
|
@@ -276,40 +276,72 @@ function MyComponent() {
|
|
|
276
276
|
|
|
277
277
|
## Common Use Cases
|
|
278
278
|
|
|
279
|
-
### Notification
|
|
279
|
+
### Notification Bell
|
|
280
280
|
|
|
281
281
|
```tsx
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
282
|
+
import { Badge, IconButton } from '@ceed/ads';
|
|
283
|
+
import NotificationsIcon from '@mui/icons-material/Notifications';
|
|
284
|
+
|
|
285
|
+
function NotificationBell({ unreadCount }) {
|
|
286
|
+
return (
|
|
287
|
+
<Badge badgeContent={unreadCount} max={99} color="danger">
|
|
288
|
+
<IconButton aria-label={`${unreadCount} unread notifications`}>
|
|
289
|
+
<NotificationsIcon />
|
|
290
|
+
</IconButton>
|
|
291
|
+
</Badge>
|
|
292
|
+
);
|
|
293
|
+
}
|
|
287
294
|
```
|
|
288
295
|
|
|
289
|
-
### Status
|
|
296
|
+
### Online Status on Avatar
|
|
290
297
|
|
|
291
298
|
```tsx
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
299
|
+
import { Badge, Avatar } from '@ceed/ads';
|
|
300
|
+
|
|
301
|
+
function UserAvatar({ name, avatarUrl, isOnline }) {
|
|
302
|
+
return (
|
|
303
|
+
<Badge
|
|
304
|
+
color={isOnline ? 'success' : 'neutral'}
|
|
305
|
+
variant="solid"
|
|
306
|
+
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
|
|
307
|
+
>
|
|
308
|
+
<Avatar src={avatarUrl} alt={name} />
|
|
309
|
+
</Badge>
|
|
310
|
+
);
|
|
311
|
+
}
|
|
295
312
|
```
|
|
296
313
|
|
|
297
|
-
### New
|
|
314
|
+
### New Feature Label
|
|
298
315
|
|
|
299
316
|
```tsx
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
317
|
+
import { Badge, Button } from '@ceed/ads';
|
|
318
|
+
|
|
319
|
+
function FeatureButton() {
|
|
320
|
+
return (
|
|
321
|
+
<Badge badgeContent="NEW" color="warning" size="sm">
|
|
322
|
+
<Button variant="outlined">Analytics</Button>
|
|
323
|
+
</Badge>
|
|
324
|
+
);
|
|
325
|
+
}
|
|
303
326
|
```
|
|
304
327
|
|
|
305
328
|
## Best Practices
|
|
306
329
|
|
|
307
|
-
|
|
330
|
+
- **Use semantic colors consistently.** Reserve `danger` for urgent notifications, `success` for positive status (e.g., online), `warning` for attention-needed items, and `primary` for neutral counts.
|
|
331
|
+
- ✔ `color="danger"` for unread message count
|
|
332
|
+
- ✘ `color="primary"` for critical alert count
|
|
333
|
+
|
|
334
|
+
- **Set a `max` value for numeric badges.** Avoid displaying very large numbers like "1,247" in a tiny badge. Use `max={99}` or `max={999}` to keep the badge compact and readable.
|
|
335
|
+
|
|
336
|
+
- **Keep badge content short.** Badges work best with numbers (1-3 digits) or very short text ("NEW", "HOT"). Long text will overflow and look broken.
|
|
308
337
|
|
|
309
|
-
|
|
338
|
+
- **Use dot badges for binary states.** When the specific count does not matter (e.g., "has unread items" vs. "12 unread items"), use a dot badge by omitting `badgeContent`.
|
|
310
339
|
|
|
311
|
-
|
|
340
|
+
- **Do not badge everything.** Only add badges to elements where the count or status information is genuinely useful. Overuse diminishes their attention-grabbing effect.
|
|
312
341
|
|
|
313
|
-
|
|
342
|
+
## Accessibility
|
|
314
343
|
|
|
315
|
-
|
|
344
|
+
- Badge automatically applies `aria-label` or equivalent attributes so screen readers can announce the badge content alongside the wrapped element.
|
|
345
|
+
- When using Badge on an IconButton, always provide an `aria-label` on the IconButton that includes the badge context (e.g., `aria-label="5 unread notifications"`).
|
|
346
|
+
- Avoid relying solely on color to convey badge meaning. Pair colored badges with icons, text, or positional context so color-blind users can also interpret the status.
|
|
347
|
+
- Dot badges (without `badgeContent`) should have an accessible label on the parent element that describes the status (e.g., "User is online").
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Introduction
|
|
4
4
|
|
|
5
|
-
InfoSign
|
|
5
|
+
InfoSign is a compact tooltip-trigger component that displays a small question-mark icon. When users hover over or focus on the icon, a tooltip appears with supplementary information. It is designed to provide contextual help without cluttering the interface -- ideal for explaining form fields, settings options, table column headers, and complex metrics.
|
|
6
|
+
|
|
7
|
+
The component accepts a `message` prop for the tooltip content and a `placement` prop to control where the tooltip appears relative to the icon. InfoSign keeps the main UI clean while ensuring that detailed guidance is always one interaction away.
|
|
6
8
|
|
|
7
9
|
```tsx
|
|
8
10
|
<InfoSign
|
|
@@ -22,23 +24,19 @@ import { InfoSign } from '@ceed/ads';
|
|
|
22
24
|
|
|
23
25
|
function MyComponent() {
|
|
24
26
|
return (
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</label>
|
|
32
|
-
</div>
|
|
27
|
+
<label>
|
|
28
|
+
Complex Setting
|
|
29
|
+
<InfoSign
|
|
30
|
+
message="This setting affects overall system performance. Consult an administrator before making changes."
|
|
31
|
+
/>
|
|
32
|
+
</label>
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
##
|
|
38
|
-
|
|
39
|
-
### Basic Usage
|
|
37
|
+
## Basic
|
|
40
38
|
|
|
41
|
-
|
|
39
|
+
The default InfoSign displays a question-mark icon that reveals a tooltip on hover or focus.
|
|
42
40
|
|
|
43
41
|
```tsx
|
|
44
42
|
<InfoSign
|
|
@@ -52,109 +50,87 @@ function MyComponent() {
|
|
|
52
50
|
### Form Field Help
|
|
53
51
|
|
|
54
52
|
```tsx
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
비밀번호 복잡도
|
|
58
|
-
<InfoSign
|
|
59
|
-
message="비밀번호는 최소 8자 이상이며, 대문자, 소문자, 숫자, 특수문자를 포함해야 합니다."
|
|
60
|
-
placement="top"
|
|
61
|
-
/>
|
|
62
|
-
</FormLabel>
|
|
63
|
-
<Input type="password" />
|
|
64
|
-
</FormControl>
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### Settings Explanation
|
|
53
|
+
import { InfoSign } from '@ceed/ads';
|
|
54
|
+
import { FormControl, FormLabel, Input } from '@ceed/ads';
|
|
68
55
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
56
|
+
function PasswordField() {
|
|
57
|
+
return (
|
|
58
|
+
<FormControl>
|
|
59
|
+
<FormLabel>
|
|
60
|
+
Password
|
|
61
|
+
<InfoSign
|
|
62
|
+
message="Must be at least 8 characters and include uppercase, lowercase, number, and special character."
|
|
63
|
+
placement="top"
|
|
64
|
+
/>
|
|
65
|
+
</FormLabel>
|
|
66
|
+
<Input type="password" />
|
|
67
|
+
</FormControl>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
82
70
|
```
|
|
83
71
|
|
|
84
|
-
###
|
|
72
|
+
### Table Column Header
|
|
85
73
|
|
|
86
74
|
```tsx
|
|
87
|
-
|
|
88
|
-
<CardContent>
|
|
89
|
-
<Typography level="title-md">
|
|
90
|
-
처리량 지표
|
|
91
|
-
<InfoSign
|
|
92
|
-
message="처리량은 최근 24시간 동안의 평균 요청 수를 나타냅니다. 이 값이 높을수록 시스템이 더 많은 작업을 처리하고 있다는 의미입니다."
|
|
93
|
-
placement="bottom"
|
|
94
|
-
/>
|
|
95
|
-
</Typography>
|
|
96
|
-
<Typography level="h2">1,234 req/min</Typography>
|
|
97
|
-
</CardContent>
|
|
98
|
-
</Card>
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### Table Header Help
|
|
75
|
+
import { InfoSign } from '@ceed/ads';
|
|
102
76
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
77
|
+
function TableHeader() {
|
|
78
|
+
return (
|
|
79
|
+
<thead>
|
|
80
|
+
<tr>
|
|
81
|
+
<th>
|
|
82
|
+
User ID
|
|
83
|
+
<InfoSign message="Auto-generated unique identifier assigned by the system." />
|
|
84
|
+
</th>
|
|
85
|
+
<th>
|
|
86
|
+
Last Activity
|
|
87
|
+
<InfoSign message="The most recent login or action timestamp for this user." />
|
|
88
|
+
</th>
|
|
89
|
+
<th>Status</th>
|
|
90
|
+
</tr>
|
|
91
|
+
</thead>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
119
94
|
```
|
|
120
95
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
### placement
|
|
124
|
-
|
|
125
|
-
툴팁이 나타나는 위치를 설정할 수 있습니다.
|
|
96
|
+
### Dashboard Metric Explanation
|
|
126
97
|
|
|
127
98
|
```tsx
|
|
128
|
-
|
|
129
|
-
<InfoSign placement="bottom" message="아래쪽에 표시" />
|
|
130
|
-
<InfoSign placement="left" message="왼쪽에 표시" />
|
|
131
|
-
<InfoSign placement="right" message="오른쪽에 표시" />
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### message
|
|
135
|
-
|
|
136
|
-
표시할 메시지 내용입니다. 긴 텍스트도 지원합니다.
|
|
99
|
+
import { InfoSign, Typography, Stack } from '@ceed/ads';
|
|
137
100
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
101
|
+
function MetricCard() {
|
|
102
|
+
return (
|
|
103
|
+
<Stack spacing={1}>
|
|
104
|
+
<Typography level="title-md">
|
|
105
|
+
Throughput
|
|
106
|
+
<InfoSign
|
|
107
|
+
message="Average requests per minute over the last 24 hours. Higher values indicate greater system load."
|
|
108
|
+
placement="right"
|
|
109
|
+
/>
|
|
110
|
+
</Typography>
|
|
111
|
+
<Typography level="h2">1,234 req/min</Typography>
|
|
112
|
+
</Stack>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
142
115
|
```
|
|
143
116
|
|
|
144
117
|
## Best Practices
|
|
145
118
|
|
|
146
|
-
1
|
|
119
|
+
- **Keep messages concise.** Tooltip messages should be 1-2 sentences that quickly answer "what does this mean?" Avoid paragraphs of text.
|
|
120
|
+
- ✔ "Maximum file size per upload. Files exceeding this limit will be rejected."
|
|
121
|
+
- ✘ A multi-paragraph explanation with examples and edge cases
|
|
147
122
|
|
|
148
|
-
|
|
123
|
+
- **Place InfoSign directly adjacent to the element it explains.** Position it immediately after a label or header text so users can easily associate the help icon with the relevant field.
|
|
149
124
|
|
|
150
|
-
|
|
125
|
+
- **Do not overuse InfoSign.** Adding a help icon to every single field creates visual noise and suggests the interface itself is too confusing. Reserve it for genuinely complex or ambiguous items.
|
|
151
126
|
|
|
152
|
-
|
|
127
|
+
- **Choose placement that avoids overlap.** Use `placement="top"` or `placement="right"` for fields near the bottom of a viewport, and `placement="bottom"` for elements near the top.
|
|
153
128
|
|
|
154
|
-
|
|
129
|
+
- **Use InfoSign for supplementary information only.** Critical instructions or warnings should be displayed inline (e.g., with FormHelperText or Alert), not hidden behind a tooltip.
|
|
155
130
|
|
|
156
|
-
|
|
157
|
-
- 스크린 리더가 메시지 내용을 읽을 수 있습니다
|
|
158
|
-
- ARIA 라벨이 자동으로 적용됩니다
|
|
131
|
+
## Accessibility
|
|
159
132
|
|
|
160
|
-
InfoSign
|
|
133
|
+
- InfoSign is keyboard-focusable, allowing users to trigger the tooltip using **Tab** navigation without requiring a mouse.
|
|
134
|
+
- The tooltip content is announced by screen readers when the InfoSign receives focus, thanks to built-in ARIA attributes.
|
|
135
|
+
- The question-mark icon serves as a universally recognized visual cue for "more information," making it intuitive for all users.
|
|
136
|
+
- Ensure that the `message` text provides the same information available through other channels -- do not make the tooltip the only way to learn critical information.
|