@ceed/cds 1.22.2 → 1.22.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.
Files changed (46) hide show
  1. package/dist/components/data-display/InfoSign.md +74 -91
  2. package/dist/components/data-display/Typography.md +363 -63
  3. package/dist/components/feedback/CircularProgress.md +257 -0
  4. package/dist/components/feedback/Dialog.md +8 -4
  5. package/dist/components/feedback/Modal.md +7 -3
  6. package/dist/components/feedback/Skeleton.md +280 -0
  7. package/dist/components/feedback/llms.txt +2 -0
  8. package/dist/components/inputs/ButtonGroup.md +115 -104
  9. package/dist/components/inputs/CurrencyInput.md +181 -8
  10. package/dist/components/inputs/DatePicker.md +108 -436
  11. package/dist/components/inputs/DateRangePicker.md +130 -496
  12. package/dist/components/inputs/FilterableCheckboxGroup.md +141 -20
  13. package/dist/components/inputs/FormControl.md +368 -0
  14. package/dist/components/inputs/IconButton.md +137 -88
  15. package/dist/components/inputs/Input.md +203 -77
  16. package/dist/components/inputs/MonthPicker.md +95 -427
  17. package/dist/components/inputs/MonthRangePicker.md +89 -471
  18. package/dist/components/inputs/PercentageInput.md +183 -19
  19. package/dist/components/inputs/RadioButton.md +163 -35
  20. package/dist/components/inputs/RadioList.md +241 -0
  21. package/dist/components/inputs/RadioTileGroup.md +146 -62
  22. package/dist/components/inputs/Select.md +219 -328
  23. package/dist/components/inputs/Slider.md +334 -0
  24. package/dist/components/inputs/Switch.md +143 -376
  25. package/dist/components/inputs/Textarea.md +209 -11
  26. package/dist/components/inputs/Uploader/Uploader.md +145 -66
  27. package/dist/components/inputs/llms.txt +3 -0
  28. package/dist/components/navigation/Breadcrumbs.md +57 -308
  29. package/dist/components/navigation/Drawer.md +180 -0
  30. package/dist/components/navigation/Dropdown.md +98 -215
  31. package/dist/components/navigation/IconMenuButton.md +40 -502
  32. package/dist/components/navigation/InsetDrawer.md +281 -650
  33. package/dist/components/navigation/Link.md +31 -348
  34. package/dist/components/navigation/Menu.md +92 -285
  35. package/dist/components/navigation/MenuButton.md +55 -448
  36. package/dist/components/navigation/Pagination.md +47 -338
  37. package/dist/components/navigation/Stepper.md +160 -28
  38. package/dist/components/navigation/Tabs.md +57 -316
  39. package/dist/components/surfaces/Accordions.md +49 -804
  40. package/dist/components/surfaces/Card.md +97 -157
  41. package/dist/components/surfaces/Divider.md +83 -234
  42. package/dist/components/surfaces/Sheet.md +152 -327
  43. package/dist/guides/ThemeProvider.md +89 -0
  44. package/dist/guides/llms.txt +9 -0
  45. package/dist/llms.txt +8 -0
  46. package/package.json +1 -1
@@ -1,11 +1,10 @@
1
1
  # Input
2
2
 
3
- Input 컴포넌트는 사용자로부터 텍스트 입력을 받기 위한 기본 컴포넌트입니다. 다양한 스타일, 크기 및 기능을 지원합니다.
3
+ ## Introduction
4
4
 
5
- > 💡 **Form 구성 내장 prop 사용을 권장합니다**
6
- >
7
- > 컴포넌트는 `label`, `helperText` 등의 Form 요소를 자체적으로 지원합니다.
8
- > Form을 구성할 때 Typography로 별도의 label이나 helperText를 만드는 대신, 컴포넌트의 내장 prop을 사용하세요.
5
+ The Input component is a fundamental form element for capturing text input from users. It supports various visual styles, sizes, and states to accommodate different use cases across forms, search fields, and data entry interfaces.
6
+
7
+ Input comes with built-in form integration features such as labels, helper text, error states, and clearable functionality. It also provides specialized behavior for password fields with an automatic visibility toggle.
9
8
 
10
9
  ```tsx
11
10
  <Input />
@@ -34,17 +33,52 @@ Input 컴포넌트는 사용자로부터 텍스트 입력을 받기 위한 기
34
33
  | sx | — | — |
35
34
  | className | — | — |
36
35
 
37
- ## 기본형
36
+ > **Use built-in form props**
37
+ >
38
+ > This component natively supports `label`, `helperText`, `error`, and `required` props.
39
+ > When building forms, use these built-in props instead of manually composing labels and helper text with Typography or FormControl.
40
+ >
41
+ > ```tsx
42
+ > // Recommended: use built-in props
43
+ > <Input label="Email" helperText="We'll never share your email." error={!isValid} />
44
+ >
45
+ > // Not recommended: manual composition with Typography
46
+ > <FormControl>
47
+ > <Typography component="label">Email</Typography>
48
+ > <Input />
49
+ > <Typography level="body-xs">We'll never share your email.</Typography>
50
+ > </FormControl>
51
+ > ```
38
52
 
39
- Input의 기본 형태입니다. 사용자의 텍스트 입력을 받는 단일 라인 필드입니다.
53
+ ## Usage
54
+
55
+ ```tsx
56
+ import { Input } from '@ceed/cds';
57
+
58
+ function MyComponent() {
59
+ return (
60
+ <Input
61
+ label="Username"
62
+ placeholder="Enter your username"
63
+ helperText="Must be at least 3 characters"
64
+ />
65
+ );
66
+ }
67
+ ```
68
+
69
+ ## Examples
70
+
71
+ ### Basic Input
72
+
73
+ The default Input renders a single-line text field. Without any additional props, it uses the `outlined` variant at `md` size.
40
74
 
41
75
  ```tsx
42
76
  <Input />
43
77
  ```
44
78
 
45
- ## 변형(Variants)
79
+ ### Variants
46
80
 
47
- Input 가지 변형을 지원합니다: `solid`, `soft`, `outlined`, `plain`
81
+ Input supports four visual variants: `solid`, `soft`, `outlined`, and `plain`. Use `outlined` (default) for most form contexts, and `soft` or `plain` for inline or subtle placements.
48
82
 
49
83
  ```tsx
50
84
  <>
@@ -55,9 +89,9 @@ Input은 네 가지 변형을 지원합니다: `solid`, `soft`, `outlined`, `pla
55
89
  </>
56
90
  ```
57
91
 
58
- ## 크기(Sizes)
92
+ ### Sizes
59
93
 
60
- Input 가지 크기를 지원합니다: `sm`, `md`, `lg`
94
+ Input comes in three sizes: `sm`, `md`, and `lg`. Choose a size that fits the surrounding UI density.
61
95
 
62
96
  ```tsx
63
97
  <>
@@ -67,13 +101,11 @@ Input은 세 가지 크기를 지원합니다: `sm`, `md`, `lg`
67
101
  </>
68
102
  ```
69
103
 
70
- ## 레이블 도움말 텍스트
104
+ ## Label and Helper Text
71
105
 
72
- Input 컴포넌트에 `label`과 `helperText` 속성을 추가하여 사용자에게 추가 정보를 제공할 수 있습니다.
106
+ ### Label
73
107
 
74
- ### 레이블(Label)
75
-
76
- `label` 속성을 사용하여 Input 위에 레이블을 표시할 수 있습니다.
108
+ Use the `label` prop to display a label above the Input. This is the recommended way to associate a label with the input field.
77
109
 
78
110
  ```tsx
79
111
  <>
@@ -81,9 +113,9 @@ Input 컴포넌트에 `label`과 `helperText` 속성을 추가하여 사용자
81
113
  </>
82
114
  ```
83
115
 
84
- ### 도움말 텍스트(Helper Text)
116
+ ### Helper Text
85
117
 
86
- `helperText` 속성을 사용하여 Input 아래에 추가 정보를 제공할 수 있습니다.
118
+ Use the `helperText` prop to provide additional guidance below the Input.
87
119
 
88
120
  ```tsx
89
121
  <>
@@ -91,19 +123,19 @@ Input 컴포넌트에 `label`과 `helperText` 속성을 추가하여 사용자
91
123
  </>
92
124
  ```
93
125
 
94
- ## 상태(States)
126
+ ## States
95
127
 
96
- ### 비활성화(Disabled)
128
+ ### Disabled
97
129
 
98
- `disabled` 속성을 사용하여 Input을 비활성화할 있습니다.
130
+ Set `disabled` to prevent user interaction. Disabled inputs are visually dimmed and do not receive focus.
99
131
 
100
132
  ```tsx
101
133
  <Input disabled />
102
134
  ```
103
135
 
104
- ### 오류 상태(Error)
136
+ ### Error
105
137
 
106
- `error` 속성을 사용하여 오류 상태를 표시할 있습니다.
138
+ Set `error` to indicate a validation failure. Combine with `helperText` to explain the error.
107
139
 
108
140
  ```tsx
109
141
  <>
@@ -111,9 +143,9 @@ Input 컴포넌트에 `label`과 `helperText` 속성을 추가하여 사용자
111
143
  </>
112
144
  ```
113
145
 
114
- ### 필수 값(Required)
146
+ ### Required
115
147
 
116
- `required` 속성을 사용하여 필수 입력 필드임을 표시할 있습니다.
148
+ Set `required` to mark the field as mandatory. This adds a visual indicator to the label.
117
149
 
118
150
  ```tsx
119
151
  <Input
@@ -124,9 +156,20 @@ Input 컴포넌트에 `label`과 `helperText` 속성을 추가하여 사용자
124
156
  />
125
157
  ```
126
158
 
127
- ## 장식자(Decorators)
159
+ ## Form Control
160
+
161
+ Combine `label`, `helperText`, and `error` props to build a complete form control. This is the recommended pattern for form fields.
162
+
163
+ ```tsx
164
+ <>
165
+ <Input placeholder="Type in here..." helperText="I'm helper text" label="Label" />
166
+ <Input placeholder="Invalid input" helperText="I'm helper text" label="Label" error />
167
+ </>
168
+ ```
169
+
170
+ ## Decorators
128
171
 
129
- Input 컴포넌트는 `startDecorator`와 `endDecorator` 속성을 통해 입력 필드의 시작과 부분에 아이콘, 버튼 또는 기타 요소를 추가할 있습니다.
172
+ Use `startDecorator` and `endDecorator` to place icons, buttons, or other elements at the start and end of the input field.
130
173
 
131
174
  ```tsx
132
175
  <Stack spacing={3}>
@@ -166,7 +209,7 @@ width: 300
166
209
  </Stack>
167
210
  ```
168
211
 
169
- `endDecorator`와 `enableClearable`을 함께 사용하면 다음과 같습니다:
212
+ When using `endDecorator` together with `enableClearable`, the clear button is placed before the end decorator:
170
213
 
171
214
  ```tsx
172
215
  <Input
@@ -177,9 +220,9 @@ width: 300
177
220
  />
178
221
  ```
179
222
 
180
- ## 지울 수 있는 입력(Clearable Input)
223
+ ## Clearable Input
181
224
 
182
- `enableClearable` 속성을 사용하여 Input에 내용을 지울 있는 버튼을 추가할 있습니다.
225
+ Set `enableClearable` to show a clear button when the input has a value. Clicking the button clears the input and returns focus to the field.
183
226
 
184
227
  ```tsx
185
228
  <>
@@ -187,9 +230,9 @@ width: 300
187
230
  </>
188
231
  ```
189
232
 
190
- ## 비밀번호 입력(Password Input)
233
+ ## Password Input
191
234
 
192
- `type="password"` 속성을 사용하면 비밀번호 입력 필드가 생성되며, 자동으로 비밀번호 표시/숨김 토글 버튼이 추가됩니다.
235
+ Setting `type="password"` automatically adds a visibility toggle button, allowing users to reveal or hide their password.
193
236
 
194
237
  ```tsx
195
238
  <Stack spacing={3}>
@@ -204,26 +247,9 @@ width: 300
204
247
  </Stack>
205
248
  ```
206
249
 
207
- ### 비밀번호 토글 비활성화
250
+ ### Password Limitations
208
251
 
209
- 비밀번호 입력 필드의 토글 버튼은 `disableTogglePasswordButton` 속성을 사용하여 비활성화할 있습니다.
210
-
211
- ```tsx
212
- <Stack spacing={3}>
213
- <Typography level="body-md">Default password input with toggle button:</Typography>
214
- <Input {...args} placeholder="Enter password" type="password" label="Password" />
215
-
216
- <Typography level="body-md">Disabled password input:</Typography>
217
- <Input {...args} placeholder="Enter password" type="password" label="Disabled Password" disabled />
218
-
219
- <Typography level="body-md">Password input with toggle button disabled:</Typography>
220
- <Input {...args} placeholder="Enter password" type="password" label="No Toggle" disableTogglePasswordButton />
221
- </Stack>
222
- ```
223
-
224
- ### 비밀번호 입력의 제한 사항
225
-
226
- 비밀번호 입력 필드(`type="password"`)에서는 `endDecorator`를 사용할 수 없습니다. 이는 비밀번호 토글 버튼이 해당 위치를 차지하기 때문입니다.
252
+ When `type="password"` is used, the `endDecorator` prop is not supported because the password toggle button occupies that position.
227
253
 
228
254
  ```tsx
229
255
  <Stack spacing={3}>
@@ -235,54 +261,154 @@ width: 300
235
261
  </Stack>
236
262
  ```
237
263
 
238
- ## 컨트롤(Form Control)
264
+ ## State Management
265
+
266
+ ### Controlled Component
239
267
 
240
- Input 컴포넌트는 `label`, `helperText`, `error` 속성을 조합하여 완전한 컨트롤을 구성할 있습니다.
268
+ Use `value` and `onChange` to manage the input state externally. This is useful when you need to synchronize the value with other components or perform validation on change.
241
269
 
242
270
  ```tsx
243
271
  <>
244
- <Input placeholder="Type in here..." helperText="I'm helper text" label="Label" />
245
- <Input placeholder="Invalid input" helperText="I'm helper text" label="Label" error />
272
+ <Input placeholder="Type in here" label="Label" enableClearable value={value} onChange={handleChange} />
246
273
  </>
247
274
  ```
248
275
 
249
- ## 상태 관리
276
+ ### Uncontrolled Component
277
+
278
+ Use `defaultValue` for simpler cases where you do not need to track the value in state. The input manages its own value internally.
250
279
 
251
- ### 제어 컴포넌트(Controlled Component)
280
+ ```tsx
281
+ <Input defaultValue="Initial text" placeholder="Type in here..." />
282
+ ```
252
283
 
253
- Input은 React의 제어 컴포넌트로 사용할 수 있습니다. `value`와 `onChange` 속성을 사용하여 상태를 관리합니다.
284
+ ## Common Use Cases
285
+
286
+ ### Login Form
254
287
 
255
288
  ```tsx
256
- <>
257
- <Input placeholder="Type in here…" label="Label" enableClearable value={value} onChange={handleChange} />
258
- </>
289
+ function LoginForm() {
290
+ const [email, setEmail] = useState('');
291
+ const [password, setPassword] = useState('');
292
+
293
+ return (
294
+ <Stack spacing={2}>
295
+ <Input
296
+ label="Email"
297
+ type="email"
298
+ placeholder="you@example.com"
299
+ required
300
+ value={email}
301
+ onChange={(e) => setEmail(e.target.value)}
302
+ />
303
+ <Input
304
+ label="Password"
305
+ type="password"
306
+ placeholder="Enter your password"
307
+ required
308
+ value={password}
309
+ onChange={(e) => setPassword(e.target.value)}
310
+ />
311
+ <Button type="submit">Sign In</Button>
312
+ </Stack>
313
+ );
314
+ }
259
315
  ```
260
316
 
261
- ### 비제어 컴포넌트(Uncontrolled Component)
317
+ ### Search Field with Clear
262
318
 
263
- `defaultValue` 속성을 사용하여 비제어 컴포넌트로도 사용 가능합니다.
319
+ ```tsx
320
+ function SearchField({ onSearch }) {
321
+ const [query, setQuery] = useState('');
322
+
323
+ return (
324
+ <Input
325
+ placeholder="Search..."
326
+ startDecorator={<SearchIcon />}
327
+ enableClearable
328
+ value={query}
329
+ onChange={(e) => {
330
+ setQuery(e.target.value);
331
+ onSearch(e.target.value);
332
+ }}
333
+ />
334
+ );
335
+ }
336
+ ```
264
337
 
265
- ## 접근성(Accessibility)
338
+ ### Form with Validation
266
339
 
267
- Input 컴포넌트는 웹 접근성 표준을 준수합니다:
340
+ ```tsx
341
+ function ProfileForm() {
342
+ const [name, setName] = useState('');
343
+ const [submitted, setSubmitted] = useState(false);
344
+ const hasError = submitted && name.trim().length === 0;
345
+
346
+ return (
347
+ <Stack spacing={2}>
348
+ <Input
349
+ label="Full Name"
350
+ required
351
+ placeholder="John Doe"
352
+ value={name}
353
+ onChange={(e) => setName(e.target.value)}
354
+ error={hasError}
355
+ helperText={hasError ? 'Name is required' : 'Enter your legal name'}
356
+ />
357
+ <Button onClick={() => setSubmitted(true)}>Save</Button>
358
+ </Stack>
359
+ );
360
+ }
361
+ ```
268
362
 
269
- - 적절한 레이블과 연결되어 있습니다.
270
- - 키보드 탐색이 가능합니다.
271
- - 오류 상태는 시각적으로 명확하게 표시됩니다.
363
+ ## Best Practices
272
364
 
273
- ## 테스팅(Testing)
365
+ 1. **Always provide a label**: Every input should have a visible label so users understand what to enter.
274
366
 
275
- ### Testing Library 참고사항
367
+ ```tsx
368
+ // ✅ Good: clear label
369
+ <Input label="Email address" placeholder="you@example.com" />
370
+
371
+ // ❌ Bad: placeholder only, no label
372
+ <Input placeholder="Email address" />
373
+ ```
374
+
375
+ 2. **Use helper text for guidance, error text for problems**: Provide contextual help via `helperText`, and switch to error messaging when validation fails.
376
+
377
+ ```tsx
378
+ // ✅ Good: helpful context + error state
379
+ <Input
380
+ label="Password"
381
+ type="password"
382
+ helperText={hasError ? 'Must be at least 8 characters' : 'Choose a strong password'}
383
+ error={hasError}
384
+ />
276
385
 
277
- - `type="password"` 속성을 가진 Input을 Testing Library로 찾을 때는 항상 `textbox` 역할(role)로 찾아야 합니다.
278
- - 이는 ARIA 명세에 따라 `password` 입력이 특별한 role을 갖지 않고 기본적으로 `textbox` role을 사용하기 때문입니다.
386
+ // Bad: no guidance at all
387
+ <Input label="Password" type="password" />
388
+ ```
389
+
390
+ 3. **Choose the right input type**: Use `type` to match the expected data (e.g., `email`, `tel`, `password`, `number`). This enables appropriate browser behavior and mobile keyboards.
279
391
 
280
392
  ```tsx
281
- // 비밀번호 입력 필드를 찾는 예시
282
- const passwordInput = screen.getByRole('textbox', { name: /비밀번호/i });
393
+ // Good: appropriate type for email
394
+ <Input label="Email" type="email" />
395
+
396
+ // ❌ Bad: generic text type for email
397
+ <Input label="Email" type="text" />
283
398
  ```
284
399
 
285
- **참고 이슈:**
400
+ 4. **Use `enableClearable` for search and filter inputs**: Allow users to quickly reset their input in search and filter contexts.
401
+
402
+ 5. **Use built-in form props instead of manual composition**: Prefer `label`, `helperText`, `error`, and `required` props over wrapping with FormControl and Typography. This ensures consistent spacing, accessibility, and error handling.
286
403
 
287
- - [W3C ARIA: Should there be a role=password?](https://github.com/w3c/aria/issues/935)
288
- - [Testing Library: How to find password inputs](https://github.com/testing-library/dom-testing-library/issues/567)
404
+ ## Accessibility
405
+
406
+ - **Label association**: The `label` prop automatically creates a properly associated `<label>` element. If you cannot use the `label` prop, provide an `aria-label` or `aria-labelledby` attribute.
407
+ - **Error announcement**: When `error` is set, the error state is conveyed to assistive technologies via `aria-invalid`. Combine with descriptive `helperText` so screen readers can announce the error message.
408
+ - **Keyboard interaction**: Input supports standard keyboard behavior. The clear button and password toggle are focusable and can be activated with Enter or Space.
409
+ - **Testing note**: When using Testing Library, find a `type="password"` input using the `textbox` role, as ARIA does not define a separate `password` role.
410
+
411
+ ```tsx
412
+ // Finding a password input in tests
413
+ const passwordInput = screen.getByRole('textbox', { name: /password/i });
414
+ ```