@ceed/cds 1.24.1-next.3 → 1.25.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.
Files changed (63) hide show
  1. package/dist/chunks/rehype-accent-FZRUD7VI.js +39 -0
  2. package/dist/components/CurrencyInput/CurrencyInput.d.ts +1 -1
  3. package/dist/components/CurrencyInput/hooks/use-currency-setting.d.ts +2 -2
  4. package/dist/components/DataTable/components.d.ts +2 -1
  5. package/dist/components/DataTable/styled.d.ts +3 -1
  6. package/dist/components/DataTable/types.d.ts +1 -0
  7. package/dist/components/RadioTileGroup/RadioTileGroup.d.ts +56 -0
  8. package/dist/components/RadioTileGroup/index.d.ts +3 -0
  9. package/dist/components/data-display/DataTable.md +77 -1
  10. package/dist/components/data-display/InfoSign.md +74 -91
  11. package/dist/components/data-display/Typography.md +411 -94
  12. package/dist/components/feedback/CircularProgress.md +257 -0
  13. package/dist/components/feedback/Dialog.md +76 -62
  14. package/dist/components/feedback/Modal.md +430 -138
  15. package/dist/components/feedback/Skeleton.md +280 -0
  16. package/dist/components/feedback/llms.txt +2 -0
  17. package/dist/components/index.d.ts +1 -0
  18. package/dist/components/inputs/Autocomplete.md +356 -107
  19. package/dist/components/inputs/ButtonGroup.md +115 -104
  20. package/dist/components/inputs/CurrencyInput.md +183 -5
  21. package/dist/components/inputs/DatePicker.md +108 -431
  22. package/dist/components/inputs/DateRangePicker.md +131 -492
  23. package/dist/components/inputs/FilterableCheckboxGroup.md +145 -19
  24. package/dist/components/inputs/FormControl.md +361 -0
  25. package/dist/components/inputs/IconButton.md +137 -88
  26. package/dist/components/inputs/Input.md +204 -73
  27. package/dist/components/inputs/MonthPicker.md +95 -422
  28. package/dist/components/inputs/MonthRangePicker.md +89 -466
  29. package/dist/components/inputs/PercentageInput.md +185 -16
  30. package/dist/components/inputs/RadioButton.md +163 -35
  31. package/dist/components/inputs/RadioList.md +241 -0
  32. package/dist/components/inputs/RadioTileGroup.md +507 -0
  33. package/dist/components/inputs/Select.md +222 -326
  34. package/dist/components/inputs/Slider.md +334 -0
  35. package/dist/components/inputs/Switch.md +143 -376
  36. package/dist/components/inputs/Textarea.md +213 -10
  37. package/dist/components/inputs/Uploader/Uploader.md +145 -66
  38. package/dist/components/inputs/llms.txt +4 -0
  39. package/dist/components/navigation/Breadcrumbs.md +57 -308
  40. package/dist/components/navigation/Drawer.md +180 -0
  41. package/dist/components/navigation/Dropdown.md +98 -215
  42. package/dist/components/navigation/IconMenuButton.md +40 -502
  43. package/dist/components/navigation/InsetDrawer.md +281 -650
  44. package/dist/components/navigation/Link.md +31 -348
  45. package/dist/components/navigation/Menu.md +92 -285
  46. package/dist/components/navigation/MenuButton.md +55 -448
  47. package/dist/components/navigation/Pagination.md +47 -338
  48. package/dist/components/navigation/Stepper.md +160 -28
  49. package/dist/components/navigation/Tabs.md +57 -316
  50. package/dist/components/surfaces/Accordions.md +49 -804
  51. package/dist/components/surfaces/Card.md +97 -157
  52. package/dist/components/surfaces/Divider.md +83 -234
  53. package/dist/components/surfaces/Sheet.md +153 -328
  54. package/dist/guides/ThemeProvider.md +89 -0
  55. package/dist/guides/llms.txt +9 -0
  56. package/dist/index.browser.js +224 -0
  57. package/dist/index.browser.js.map +7 -0
  58. package/dist/index.cjs +648 -390
  59. package/dist/index.d.ts +1 -1
  60. package/dist/index.js +563 -361
  61. package/dist/llms.txt +9 -0
  62. package/framer/index.js +1 -163
  63. package/package.json +22 -17
@@ -1,6 +1,10 @@
1
1
  # Input
2
2
 
3
- Input 컴포넌트는 사용자로부터 텍스트 입력을 받기 위한 기본 컴포넌트입니다. 다양한 스타일, 크기 및 기능을 지원합니다.
3
+ ## Introduction
4
+
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.
4
8
 
5
9
  ```tsx
6
10
  <Input />
@@ -29,17 +33,52 @@ Input 컴포넌트는 사용자로부터 텍스트 입력을 받기 위한 기
29
33
  | sx | — | — |
30
34
  | className | — | — |
31
35
 
32
- ## 기본형
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
+ > ```
52
+
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
33
70
 
34
- Input의 기본 형태입니다. 사용자의 텍스트 입력을 받는 단일 라인 필드입니다.
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.
35
74
 
36
75
  ```tsx
37
76
  <Input />
38
77
  ```
39
78
 
40
- ## 변형(Variants)
79
+ ### Variants
41
80
 
42
- 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.
43
82
 
44
83
  ```tsx
45
84
  <>
@@ -50,9 +89,9 @@ Input은 네 가지 변형을 지원합니다: `solid`, `soft`, `outlined`, `pla
50
89
  </>
51
90
  ```
52
91
 
53
- ## 크기(Sizes)
92
+ ### Sizes
54
93
 
55
- Input 가지 크기를 지원합니다: `sm`, `md`, `lg`
94
+ Input comes in three sizes: `sm`, `md`, and `lg`. Choose a size that fits the surrounding UI density.
56
95
 
57
96
  ```tsx
58
97
  <>
@@ -62,13 +101,11 @@ Input은 세 가지 크기를 지원합니다: `sm`, `md`, `lg`
62
101
  </>
63
102
  ```
64
103
 
65
- ## 레이블 도움말 텍스트
66
-
67
- Input 컴포넌트에 `label`과 `helperText` 속성을 추가하여 사용자에게 추가 정보를 제공할 수 있습니다.
104
+ ## Label and Helper Text
68
105
 
69
- ### 레이블(Label)
106
+ ### Label
70
107
 
71
- `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.
72
109
 
73
110
  ```tsx
74
111
  <>
@@ -76,9 +113,9 @@ Input 컴포넌트에 `label`과 `helperText` 속성을 추가하여 사용자
76
113
  </>
77
114
  ```
78
115
 
79
- ### 도움말 텍스트(Helper Text)
116
+ ### Helper Text
80
117
 
81
- `helperText` 속성을 사용하여 Input 아래에 추가 정보를 제공할 수 있습니다.
118
+ Use the `helperText` prop to provide additional guidance below the Input.
82
119
 
83
120
  ```tsx
84
121
  <>
@@ -86,19 +123,19 @@ Input 컴포넌트에 `label`과 `helperText` 속성을 추가하여 사용자
86
123
  </>
87
124
  ```
88
125
 
89
- ## 상태(States)
126
+ ## States
90
127
 
91
- ### 비활성화(Disabled)
128
+ ### Disabled
92
129
 
93
- `disabled` 속성을 사용하여 Input을 비활성화할 있습니다.
130
+ Set `disabled` to prevent user interaction. Disabled inputs are visually dimmed and do not receive focus.
94
131
 
95
132
  ```tsx
96
133
  <Input disabled />
97
134
  ```
98
135
 
99
- ### 오류 상태(Error)
136
+ ### Error
100
137
 
101
- `error` 속성을 사용하여 오류 상태를 표시할 있습니다.
138
+ Set `error` to indicate a validation failure. Combine with `helperText` to explain the error.
102
139
 
103
140
  ```tsx
104
141
  <>
@@ -106,9 +143,9 @@ Input 컴포넌트에 `label`과 `helperText` 속성을 추가하여 사용자
106
143
  </>
107
144
  ```
108
145
 
109
- ### 필수 값(Required)
146
+ ### Required
110
147
 
111
- `required` 속성을 사용하여 필수 입력 필드임을 표시할 있습니다.
148
+ Set `required` to mark the field as mandatory. This adds a visual indicator to the label.
112
149
 
113
150
  ```tsx
114
151
  <Input
@@ -119,9 +156,20 @@ Input 컴포넌트에 `label`과 `helperText` 속성을 추가하여 사용자
119
156
  />
120
157
  ```
121
158
 
122
- ## 장식자(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
123
171
 
124
- Input 컴포넌트는 `startDecorator`와 `endDecorator` 속성을 통해 입력 필드의 시작과 부분에 아이콘, 버튼 또는 기타 요소를 추가할 있습니다.
172
+ Use `startDecorator` and `endDecorator` to place icons, buttons, or other elements at the start and end of the input field.
125
173
 
126
174
  ```tsx
127
175
  <Stack spacing={3}>
@@ -161,7 +209,7 @@ width: 300
161
209
  </Stack>
162
210
  ```
163
211
 
164
- `endDecorator`와 `enableClearable`을 함께 사용하면 다음과 같습니다:
212
+ When using `endDecorator` together with `enableClearable`, the clear button is placed before the end decorator:
165
213
 
166
214
  ```tsx
167
215
  <Input
@@ -172,9 +220,9 @@ width: 300
172
220
  />
173
221
  ```
174
222
 
175
- ## 지울 수 있는 입력(Clearable Input)
223
+ ## Clearable Input
176
224
 
177
- `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.
178
226
 
179
227
  ```tsx
180
228
  <>
@@ -182,26 +230,9 @@ width: 300
182
230
  </>
183
231
  ```
184
232
 
185
- ## 비밀번호 입력(Password Input)
186
-
187
- `type="password"` 속성을 사용하면 비밀번호 입력 필드가 생성되며, 자동으로 비밀번호 표시/숨김 토글 버튼이 추가됩니다.
188
-
189
- ```tsx
190
- <Stack spacing={3}>
191
- <Typography level="body-md">Default password input with toggle button:</Typography>
192
- <Input {...args} placeholder="Enter password" type="password" label="Password" />
193
-
194
- <Typography level="body-md">Disabled password input:</Typography>
195
- <Input {...args} placeholder="Enter password" type="password" label="Disabled Password" disabled />
196
-
197
- <Typography level="body-md">Password input with toggle button disabled:</Typography>
198
- <Input {...args} placeholder="Enter password" type="password" label="No Toggle" disableTogglePasswordButton />
199
- </Stack>
200
- ```
201
-
202
- ### 비밀번호 토글 비활성화
233
+ ## Password Input
203
234
 
204
- 비밀번호 입력 필드의 토글 버튼은 `disableTogglePasswordButton` 속성을 사용하여 비활성화할 있습니다.
235
+ Setting `type="password"` automatically adds a visibility toggle button, allowing users to reveal or hide their password.
205
236
 
206
237
  ```tsx
207
238
  <Stack spacing={3}>
@@ -216,9 +247,9 @@ width: 300
216
247
  </Stack>
217
248
  ```
218
249
 
219
- ### 비밀번호 입력의 제한 사항
250
+ ### Password Limitations
220
251
 
221
- 비밀번호 입력 필드(`type="password"`)에서는 `endDecorator`를 사용할 없습니다. 이는 비밀번호 토글 버튼이 해당 위치를 차지하기 때문입니다.
252
+ When `type="password"` is used, the `endDecorator` prop is not supported because the password toggle button occupies that position.
222
253
 
223
254
  ```tsx
224
255
  <Stack spacing={3}>
@@ -230,54 +261,154 @@ width: 300
230
261
  </Stack>
231
262
  ```
232
263
 
233
- ## 컨트롤(Form Control)
264
+ ## State Management
234
265
 
235
- Input 컴포넌트는 `label`, `helperText`, `error` 속성을 조합하여 완전한 폼 컨트롤을 구성할 수 있습니다.
266
+ ### Controlled Component
267
+
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.
236
269
 
237
270
  ```tsx
238
271
  <>
239
- <Input placeholder="Type in here..." helperText="I'm helper text" label="Label" />
240
- <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} />
241
273
  </>
242
274
  ```
243
275
 
244
- ## 상태 관리
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.
279
+
280
+ ```tsx
281
+ <Input defaultValue="Initial text" placeholder="Type in here..." />
282
+ ```
245
283
 
246
- ### 제어 컴포넌트(Controlled Component)
284
+ ## Common Use Cases
247
285
 
248
- Input은 React의 제어 컴포넌트로 사용할 수 있습니다. `value`와 `onChange` 속성을 사용하여 상태를 관리합니다.
286
+ ### Login Form
249
287
 
250
288
  ```tsx
251
- <>
252
- <Input placeholder="Type in here…" label="Label" enableClearable value={value} onChange={handleChange} />
253
- </>
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
+ }
254
315
  ```
255
316
 
256
- ### 비제어 컴포넌트(Uncontrolled Component)
317
+ ### Search Field with Clear
257
318
 
258
- `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
+ ```
259
337
 
260
- ## 접근성(Accessibility)
338
+ ### Form with Validation
261
339
 
262
- 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
+ ```
263
362
 
264
- - 적절한 레이블과 연결되어 있습니다.
265
- - 키보드 탐색이 가능합니다.
266
- - 오류 상태는 시각적으로 명확하게 표시됩니다.
363
+ ## Best Practices
267
364
 
268
- ## 테스팅(Testing)
365
+ 1. **Always provide a label**: Every input should have a visible label so users understand what to enter.
269
366
 
270
- ### Testing Library 참고사항
367
+ ```tsx
368
+ // ✅ Good: clear label
369
+ <Input label="Email address" placeholder="you@example.com" />
271
370
 
272
- - `type="password"` 속성을 가진 Input을 Testing Library로 찾을 때는 항상 `textbox` 역할(role)로 찾아야 합니다.
273
- - 이는 ARIA 명세에 따라 `password` 입력이 특별한 role을 갖지 않고 기본적으로 `textbox` role을 사용하기 때문입니다.
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.
274
376
 
275
377
  ```tsx
276
- // 비밀번호 입력 필드를 찾는 예시
277
- const passwordInput = screen.getByRole('textbox', { name: /비밀번호/i });
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
+ />
385
+
386
+ // ❌ Bad: no guidance at all
387
+ <Input label="Password" type="password" />
278
388
  ```
279
389
 
280
- **참고 이슈:**
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.
391
+
392
+ ```tsx
393
+ // ✅ Good: appropriate type for email
394
+ <Input label="Email" type="email" />
281
395
 
282
- - [W3C ARIA: Should there be a role=password?](https://github.com/w3c/aria/issues/935)
283
- - [Testing Library: How to find password inputs](https://github.com/testing-library/dom-testing-library/issues/567)
396
+ // Bad: generic text type for email
397
+ <Input label="Email" type="text" />
398
+ ```
399
+
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.
403
+
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
+ ```