@ceed/cds 1.28.0 → 1.29.0-next.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.
Files changed (65) hide show
  1. package/dist/components/CurrencyInput/CurrencyInput.d.ts +1 -1
  2. package/dist/components/CurrencyInput/hooks/use-currency-setting.d.ts +2 -2
  3. package/dist/components/DataTable/hooks.d.ts +2 -1
  4. package/dist/components/DataTable/utils.d.ts +1 -0
  5. package/dist/components/SearchBar/SearchBar.d.ts +21 -0
  6. package/dist/components/SearchBar/index.d.ts +3 -0
  7. package/dist/components/data-display/DataTable.md +1 -1
  8. package/dist/components/data-display/InfoSign.md +91 -74
  9. package/dist/components/data-display/Typography.md +94 -411
  10. package/dist/components/feedback/Dialog.md +62 -76
  11. package/dist/components/feedback/Modal.md +138 -430
  12. package/dist/components/feedback/llms.txt +0 -2
  13. package/dist/components/index.d.ts +2 -1
  14. package/dist/components/inputs/Autocomplete.md +107 -356
  15. package/dist/components/inputs/ButtonGroup.md +104 -115
  16. package/dist/components/inputs/CurrencyInput.md +5 -183
  17. package/dist/components/inputs/DatePicker.md +431 -108
  18. package/dist/components/inputs/DateRangePicker.md +492 -131
  19. package/dist/components/inputs/FilterableCheckboxGroup.md +19 -145
  20. package/dist/components/inputs/IconButton.md +88 -137
  21. package/dist/components/inputs/Input.md +73 -204
  22. package/dist/components/inputs/MonthPicker.md +422 -95
  23. package/dist/components/inputs/MonthRangePicker.md +466 -89
  24. package/dist/components/inputs/PercentageInput.md +16 -185
  25. package/dist/components/inputs/RadioButton.md +35 -163
  26. package/dist/components/inputs/SearchBar.md +44 -0
  27. package/dist/components/inputs/Select.md +326 -222
  28. package/dist/components/inputs/Switch.md +376 -143
  29. package/dist/components/inputs/Textarea.md +10 -213
  30. package/dist/components/inputs/Uploader/Uploader.md +66 -145
  31. package/dist/components/inputs/llms.txt +1 -4
  32. package/dist/components/navigation/Breadcrumbs.md +308 -57
  33. package/dist/components/navigation/Drawer.md +0 -180
  34. package/dist/components/navigation/Dropdown.md +215 -98
  35. package/dist/components/navigation/IconMenuButton.md +502 -40
  36. package/dist/components/navigation/InsetDrawer.md +650 -281
  37. package/dist/components/navigation/Link.md +348 -31
  38. package/dist/components/navigation/Menu.md +285 -92
  39. package/dist/components/navigation/MenuButton.md +448 -55
  40. package/dist/components/navigation/Pagination.md +338 -47
  41. package/dist/components/navigation/Stepper.md +28 -160
  42. package/dist/components/navigation/Tabs.md +316 -57
  43. package/dist/components/surfaces/Accordions.md +804 -49
  44. package/dist/components/surfaces/Card.md +157 -97
  45. package/dist/components/surfaces/Divider.md +234 -83
  46. package/dist/components/surfaces/Sheet.md +328 -153
  47. package/dist/index.cjs +435 -577
  48. package/dist/index.d.ts +1 -1
  49. package/dist/index.js +424 -510
  50. package/dist/llms.txt +1 -9
  51. package/framer/index.js +1 -1
  52. package/package.json +17 -22
  53. package/dist/chunks/rehype-accent-FZRUD7VI.js +0 -39
  54. package/dist/components/RadioTileGroup/RadioTileGroup.d.ts +0 -56
  55. package/dist/components/RadioTileGroup/index.d.ts +0 -3
  56. package/dist/components/feedback/CircularProgress.md +0 -257
  57. package/dist/components/feedback/Skeleton.md +0 -280
  58. package/dist/components/inputs/FormControl.md +0 -361
  59. package/dist/components/inputs/RadioList.md +0 -241
  60. package/dist/components/inputs/RadioTileGroup.md +0 -507
  61. package/dist/components/inputs/Slider.md +0 -334
  62. package/dist/guides/ThemeProvider.md +0 -89
  63. package/dist/guides/llms.txt +0 -9
  64. package/dist/index.browser.js +0 -224
  65. package/dist/index.browser.js.map +0 -7
@@ -1,241 +0,0 @@
1
- # RadioList
2
-
3
- ## Introduction
4
-
5
- RadioList is a convenience component that renders a group of radio buttons from a data array. It wraps RadioGroup and Radio internally, providing a simpler API for the common pattern of rendering a list of options. Pass an array of `{ label, value }` items and the component handles the rest.
6
-
7
- ```tsx
8
- <RadioList
9
- items={defaultItems}
10
- defaultValue="option1"
11
- />
12
- ```
13
-
14
- | Field | Description | Default |
15
- | ----------- | ----------- | ------- |
16
- | size | — | — |
17
- | color | — | — |
18
- | orientation | — | — |
19
- | disabled | — | — |
20
-
21
- ## Usage
22
-
23
- ```tsx
24
- import { RadioList } from '@ceed/cds';
25
-
26
- function MyComponent() {
27
- return (
28
- <RadioList
29
- items={[
30
- { label: 'Small', value: 'sm' },
31
- { label: 'Medium', value: 'md' },
32
- { label: 'Large', value: 'lg' },
33
- ]}
34
- defaultValue="md"
35
- />
36
- );
37
- }
38
- ```
39
-
40
- ## Basic List
41
-
42
- A simple radio list with three options and a default selection.
43
-
44
- ```tsx
45
- <RadioList items={[{
46
- label: 'Small',
47
- value: 'sm'
48
- }, {
49
- label: 'Medium',
50
- value: 'md'
51
- }, {
52
- label: 'Large',
53
- value: 'lg'
54
- }]} defaultValue="md" />
55
- ```
56
-
57
- ## Controlled
58
-
59
- Use `value` and `onChange` for controlled state management.
60
-
61
- ```tsx
62
- <Stack gap={2}>
63
- <Typography level="body-sm">Selected: {value}</Typography>
64
- <RadioList items={defaultItems} value={value} onChange={e => setValue((e.target as HTMLInputElement).value)} />
65
- </Stack>
66
- ```
67
-
68
- ```tsx
69
- function ControlledExample() {
70
- const [value, setValue] = React.useState('option1');
71
- return (
72
- <RadioList
73
- items={items}
74
- value={value}
75
- onChange={(e) => setValue((e.target as HTMLInputElement).value)}
76
- />
77
- );
78
- }
79
- ```
80
-
81
- ## With Default Value
82
-
83
- Use `defaultValue` for uncontrolled usage with an initial selection.
84
-
85
- ```tsx
86
- <RadioList items={defaultItems} defaultValue="option2" />
87
- ```
88
-
89
- ## Disabled
90
-
91
- Set `disabled` to prevent all radio buttons from being interacted with.
92
-
93
- ```tsx
94
- <RadioList items={defaultItems} defaultValue="option1" disabled />
95
- ```
96
-
97
- ## Horizontal Layout
98
-
99
- Set `orientation="horizontal"` to display options in a row.
100
-
101
- ```tsx
102
- <RadioList items={defaultItems} defaultValue="option1" orientation="horizontal" />
103
- ```
104
-
105
- ```tsx
106
- <RadioList
107
- items={items}
108
- defaultValue="option1"
109
- orientation="horizontal"
110
- />
111
- ```
112
-
113
- ## Sizes
114
-
115
- RadioList supports `sm`, `md` (default), and `lg` sizes. The size is applied to all radio buttons in the group.
116
-
117
- ```tsx
118
- <Stack gap={3}>
119
- <Box>
120
- <Typography level="body-sm" sx={{
121
- mb: 1
122
- }}>Small</Typography>
123
- <RadioList items={defaultItems} defaultValue="option1" size="sm" />
124
- </Box>
125
- <Box>
126
- <Typography level="body-sm" sx={{
127
- mb: 1
128
- }}>Medium</Typography>
129
- <RadioList items={defaultItems} defaultValue="option1" size="md" />
130
- </Box>
131
- <Box>
132
- <Typography level="body-sm" sx={{
133
- mb: 1
134
- }}>Large</Typography>
135
- <RadioList items={defaultItems} defaultValue="option1" size="lg" />
136
- </Box>
137
- </Stack>
138
- ```
139
-
140
- ## Colors
141
-
142
- Five semantic colors are available via the `color` prop.
143
-
144
- ```tsx
145
- <Stack gap={3}>
146
- <RadioList items={defaultItems} defaultValue="option1" color="primary" />
147
- <RadioList items={defaultItems} defaultValue="option1" color="neutral" />
148
- <RadioList items={defaultItems} defaultValue="option1" color="danger" />
149
- <RadioList items={defaultItems} defaultValue="option1" color="success" />
150
- <RadioList items={defaultItems} defaultValue="option1" color="warning" />
151
- </Stack>
152
- ```
153
-
154
- ## Common Use Cases
155
-
156
- ### Settings Selection
157
-
158
- ```tsx
159
- function LanguageSetting() {
160
- const [language, setLanguage] = React.useState('en');
161
-
162
- return (
163
- <FormControl>
164
- <FormLabel>Language</FormLabel>
165
- <RadioList
166
- items={[
167
- { label: 'English', value: 'en' },
168
- { label: '한국어', value: 'ko' },
169
- { label: '日本語', value: 'ja' },
170
- ]}
171
- value={language}
172
- onChange={(e) => setLanguage((e.target as HTMLInputElement).value)}
173
- />
174
- </FormControl>
175
- );
176
- }
177
- ```
178
-
179
- ### Survey Options
180
-
181
- ```tsx
182
- function SatisfactionSurvey() {
183
- return (
184
- <FormControl>
185
- <FormLabel>How satisfied are you?</FormLabel>
186
- <RadioList
187
- orientation="horizontal"
188
- items={[
189
- { label: 'Very Unsatisfied', value: '1' },
190
- { label: 'Unsatisfied', value: '2' },
191
- { label: 'Neutral', value: '3' },
192
- { label: 'Satisfied', value: '4' },
193
- { label: 'Very Satisfied', value: '5' },
194
- ]}
195
- />
196
- </FormControl>
197
- );
198
- }
199
- ```
200
-
201
- ### Dynamic Options from API
202
-
203
- ```tsx
204
- function RoleSelector({ roles }: { roles: { id: string; name: string }[] }) {
205
- return (
206
- <RadioList
207
- items={roles.map((role) => ({
208
- label: role.name,
209
- value: role.id,
210
- }))}
211
- />
212
- );
213
- }
214
- ```
215
-
216
- ## Best Practices
217
-
218
- 1. **Use for mutually exclusive choices**: RadioList is for selecting exactly one option from a set. For multiple selections, use Checkbox or FilterableCheckboxGroup.
219
-
220
- ```tsx
221
- // ✅ Mutually exclusive — only one role allowed
222
- <RadioList items={roles} />
223
-
224
- // ❌ Multiple selections needed — use Checkbox instead
225
- <RadioList items={permissions} />
226
- ```
227
-
228
- 2. **Provide a default value**: Pre-select the most common or recommended option to reduce user effort.
229
-
230
- 3. **Keep labels concise**: Radio button labels should be short and scannable. Use descriptions elsewhere if more context is needed.
231
-
232
- 4. **Limit visible options**: For more than 7 options, consider using a Select dropdown instead to save space.
233
-
234
- 5. **Use horizontal layout sparingly**: Horizontal orientation works well for 2–4 short options. For longer lists, vertical is more readable.
235
-
236
- ## Accessibility
237
-
238
- - RadioList renders a `<RadioGroup>` with `role="radiogroup"`, and each option is a `<Radio>` with `role="radio"`.
239
- - Keyboard navigation: Arrow keys move between options, Space selects the focused option.
240
- - Wrap in a FormControl with FormLabel to provide an accessible group label.
241
- - The `disabled` prop sets `aria-disabled` on all radio buttons in the group.