@ceed/cds 1.24.1-next.3 → 1.26.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 (65) 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/hooks.d.ts +1 -1
  6. package/dist/components/DataTable/styled.d.ts +3 -1
  7. package/dist/components/DataTable/types.d.ts +11 -0
  8. package/dist/components/DataTable/utils.d.ts +2 -2
  9. package/dist/components/RadioTileGroup/RadioTileGroup.d.ts +56 -0
  10. package/dist/components/RadioTileGroup/index.d.ts +3 -0
  11. package/dist/components/data-display/DataTable.md +177 -1
  12. package/dist/components/data-display/InfoSign.md +74 -91
  13. package/dist/components/data-display/Typography.md +411 -94
  14. package/dist/components/feedback/CircularProgress.md +257 -0
  15. package/dist/components/feedback/Dialog.md +76 -62
  16. package/dist/components/feedback/Modal.md +430 -138
  17. package/dist/components/feedback/Skeleton.md +280 -0
  18. package/dist/components/feedback/llms.txt +2 -0
  19. package/dist/components/index.d.ts +1 -0
  20. package/dist/components/inputs/Autocomplete.md +356 -107
  21. package/dist/components/inputs/ButtonGroup.md +115 -104
  22. package/dist/components/inputs/CurrencyInput.md +183 -5
  23. package/dist/components/inputs/DatePicker.md +108 -431
  24. package/dist/components/inputs/DateRangePicker.md +131 -492
  25. package/dist/components/inputs/FilterableCheckboxGroup.md +145 -19
  26. package/dist/components/inputs/FormControl.md +361 -0
  27. package/dist/components/inputs/IconButton.md +137 -88
  28. package/dist/components/inputs/Input.md +204 -73
  29. package/dist/components/inputs/MonthPicker.md +95 -422
  30. package/dist/components/inputs/MonthRangePicker.md +89 -466
  31. package/dist/components/inputs/PercentageInput.md +185 -16
  32. package/dist/components/inputs/RadioButton.md +163 -35
  33. package/dist/components/inputs/RadioList.md +241 -0
  34. package/dist/components/inputs/RadioTileGroup.md +507 -0
  35. package/dist/components/inputs/Select.md +222 -326
  36. package/dist/components/inputs/Slider.md +334 -0
  37. package/dist/components/inputs/Switch.md +143 -376
  38. package/dist/components/inputs/Textarea.md +213 -10
  39. package/dist/components/inputs/Uploader/Uploader.md +145 -66
  40. package/dist/components/inputs/llms.txt +4 -0
  41. package/dist/components/navigation/Breadcrumbs.md +57 -308
  42. package/dist/components/navigation/Drawer.md +180 -0
  43. package/dist/components/navigation/Dropdown.md +98 -215
  44. package/dist/components/navigation/IconMenuButton.md +40 -502
  45. package/dist/components/navigation/InsetDrawer.md +281 -650
  46. package/dist/components/navigation/Link.md +31 -348
  47. package/dist/components/navigation/Menu.md +92 -285
  48. package/dist/components/navigation/MenuButton.md +55 -448
  49. package/dist/components/navigation/Pagination.md +47 -338
  50. package/dist/components/navigation/Stepper.md +160 -28
  51. package/dist/components/navigation/Tabs.md +57 -316
  52. package/dist/components/surfaces/Accordions.md +49 -804
  53. package/dist/components/surfaces/Card.md +97 -157
  54. package/dist/components/surfaces/Divider.md +83 -234
  55. package/dist/components/surfaces/Sheet.md +153 -328
  56. package/dist/guides/ThemeProvider.md +89 -0
  57. package/dist/guides/llms.txt +9 -0
  58. package/dist/index.browser.js +224 -0
  59. package/dist/index.browser.js.map +7 -0
  60. package/dist/index.cjs +726 -425
  61. package/dist/index.d.ts +1 -1
  62. package/dist/index.js +641 -396
  63. package/dist/llms.txt +9 -0
  64. package/framer/index.js +1 -163
  65. package/package.json +22 -17
@@ -0,0 +1,334 @@
1
+ # Slider
2
+
3
+ ## Introduction
4
+
5
+ The Slider component allows users to select a value or a range of values along a track. It is based on Joy UI's Slider and is useful for settings that require selecting from a continuous or discrete range, such as volume, brightness, price ranges, or percentage values.
6
+
7
+ ```tsx
8
+ <Slider
9
+ defaultValue={40}
10
+ sx={{
11
+ width: 300
12
+ }}
13
+ />
14
+ ```
15
+
16
+ | Field | Description | Default |
17
+ | ----------------- | ----------- | ------- |
18
+ | size | — | — |
19
+ | color | — | — |
20
+ | variant | — | — |
21
+ | disabled | — | — |
22
+ | orientation | — | — |
23
+ | valueLabelDisplay | — | — |
24
+ | min | — | — |
25
+ | max | — | — |
26
+ | step | — | — |
27
+
28
+ ## Usage
29
+
30
+ ```tsx
31
+ import { Slider } from '@ceed/cds';
32
+
33
+ function MyComponent() {
34
+ return <Slider defaultValue={40} />;
35
+ }
36
+ ```
37
+
38
+ ## Sizes
39
+
40
+ Slider supports three sizes: `sm`, `md` (default), and `lg`.
41
+
42
+ ```tsx
43
+ <Stack gap={3} sx={{
44
+ width: 300
45
+ }}>
46
+ <Box>
47
+ <Typography level="body-sm" sx={{
48
+ mb: 1
49
+ }}>Small</Typography>
50
+ <Slider size="sm" defaultValue={30} />
51
+ </Box>
52
+ <Box>
53
+ <Typography level="body-sm" sx={{
54
+ mb: 1
55
+ }}>Medium</Typography>
56
+ <Slider size="md" defaultValue={50} />
57
+ </Box>
58
+ <Box>
59
+ <Typography level="body-sm" sx={{
60
+ mb: 1
61
+ }}>Large</Typography>
62
+ <Slider size="lg" defaultValue={70} />
63
+ </Box>
64
+ </Stack>
65
+ ```
66
+
67
+ ```tsx
68
+ <Slider size="sm" defaultValue={30} />
69
+ <Slider size="md" defaultValue={50} />
70
+ <Slider size="lg" defaultValue={70} />
71
+ ```
72
+
73
+ ## Colors
74
+
75
+ Five semantic colors are available via the `color` prop.
76
+
77
+ ```tsx
78
+ <Stack gap={3} sx={{
79
+ width: 300
80
+ }}>
81
+ <Slider color="primary" defaultValue={40} />
82
+ <Slider color="neutral" defaultValue={40} />
83
+ <Slider color="danger" defaultValue={40} />
84
+ <Slider color="success" defaultValue={40} />
85
+ <Slider color="warning" defaultValue={40} />
86
+ </Stack>
87
+ ```
88
+
89
+ ## Variants
90
+
91
+ Four visual variants are supported: `solid`, `soft` (default), `outlined`, and `plain`.
92
+
93
+ ```tsx
94
+ <Stack gap={3} sx={{
95
+ width: 300
96
+ }}>
97
+ <Slider variant="solid" defaultValue={40} />
98
+ <Slider variant="soft" defaultValue={40} />
99
+ <Slider variant="outlined" defaultValue={40} />
100
+ <Slider variant="plain" defaultValue={40} />
101
+ </Stack>
102
+ ```
103
+
104
+ ## Range Slider
105
+
106
+ Pass an array of two values to `defaultValue` (or `value`) to create a range slider with two thumbs.
107
+
108
+ ```tsx
109
+ <Box sx={{
110
+ width: 300
111
+ }}>
112
+ <Slider defaultValue={[20, 60]} />
113
+ </Box>
114
+ ```
115
+
116
+ ```tsx
117
+ <Slider defaultValue={[20, 60]} />
118
+ ```
119
+
120
+ ## With Marks
121
+
122
+ Use the `marks` prop to display labeled marks along the track.
123
+
124
+ ```tsx
125
+ <Box sx={{
126
+ width: 300
127
+ }}>
128
+ <Slider defaultValue={50} marks={[{
129
+ value: 0,
130
+ label: '0'
131
+ }, {
132
+ value: 25,
133
+ label: '25'
134
+ }, {
135
+ value: 50,
136
+ label: '50'
137
+ }, {
138
+ value: 75,
139
+ label: '75'
140
+ }, {
141
+ value: 100,
142
+ label: '100'
143
+ }]} />
144
+ </Box>
145
+ ```
146
+
147
+ ```tsx
148
+ <Slider
149
+ defaultValue={50}
150
+ marks={[
151
+ { value: 0, label: '0' },
152
+ { value: 25, label: '25' },
153
+ { value: 50, label: '50' },
154
+ { value: 75, label: '75' },
155
+ { value: 100, label: '100' },
156
+ ]}
157
+ />
158
+ ```
159
+
160
+ ## Steps
161
+
162
+ Set the `step` prop to control the increment between values. Use `marks={true}` to show a mark at each step.
163
+
164
+ ```tsx
165
+ <Box sx={{
166
+ width: 300
167
+ }}>
168
+ <Slider defaultValue={30} step={10} marks min={0} max={100} />
169
+ </Box>
170
+ ```
171
+
172
+ ```tsx
173
+ <Slider defaultValue={30} step={10} marks min={0} max={100} />
174
+ ```
175
+
176
+ ## Vertical Orientation
177
+
178
+ Set `orientation="vertical"` to render a vertical slider. Ensure the container has a defined height.
179
+
180
+ ```tsx
181
+ <Box sx={{
182
+ height: 200
183
+ }}>
184
+ <Slider orientation="vertical" defaultValue={40} />
185
+ </Box>
186
+ ```
187
+
188
+ ```tsx
189
+ <Box sx={{ height: 200 }}>
190
+ <Slider orientation="vertical" defaultValue={40} />
191
+ </Box>
192
+ ```
193
+
194
+ ## Value Label
195
+
196
+ Control the value label tooltip display with `valueLabelDisplay`. Options: `on` (always visible), `auto` (on hover/focus), and `off` (hidden).
197
+
198
+ ```tsx
199
+ <Stack gap={4} sx={{
200
+ width: 300,
201
+ pt: 4
202
+ }}>
203
+ <Box>
204
+ <Typography level="body-sm" sx={{
205
+ mb: 2
206
+ }}>Always on</Typography>
207
+ <Slider defaultValue={40} valueLabelDisplay="on" />
208
+ </Box>
209
+ <Box>
210
+ <Typography level="body-sm" sx={{
211
+ mb: 1
212
+ }}>Auto (on hover)</Typography>
213
+ <Slider defaultValue={60} valueLabelDisplay="auto" />
214
+ </Box>
215
+ </Stack>
216
+ ```
217
+
218
+ ```tsx
219
+ <Slider defaultValue={40} valueLabelDisplay="on" />
220
+ <Slider defaultValue={60} valueLabelDisplay="auto" />
221
+ ```
222
+
223
+ ## Disabled
224
+
225
+ Set `disabled` to prevent user interaction.
226
+
227
+ ```tsx
228
+ <Box sx={{
229
+ width: 300
230
+ }}>
231
+ <Slider defaultValue={40} disabled />
232
+ </Box>
233
+ ```
234
+
235
+ ## Common Use Cases
236
+
237
+ ### Controlled Slider
238
+
239
+ ```tsx
240
+ function VolumeControl() {
241
+ const [volume, setVolume] = React.useState(50);
242
+
243
+ return (
244
+ <Stack gap={1}>
245
+ <Typography level="body-sm">Volume: {volume}%</Typography>
246
+ <Slider
247
+ value={volume}
248
+ onChange={(_, newValue) => setVolume(newValue as number)}
249
+ min={0}
250
+ max={100}
251
+ />
252
+ </Stack>
253
+ );
254
+ }
255
+ ```
256
+
257
+ ### Price Range Filter
258
+
259
+ ```tsx
260
+ function PriceRangeFilter() {
261
+ const [range, setRange] = React.useState([20, 80]);
262
+
263
+ return (
264
+ <Stack gap={1}>
265
+ <Typography level="body-sm">
266
+ Price: ${range[0]} — ${range[1]}
267
+ </Typography>
268
+ <Slider
269
+ value={range}
270
+ onChange={(_, newValue) => setRange(newValue as number[])}
271
+ min={0}
272
+ max={200}
273
+ valueLabelDisplay="auto"
274
+ valueLabelFormat={(value) => `$${value}`}
275
+ />
276
+ </Stack>
277
+ );
278
+ }
279
+ ```
280
+
281
+ ### Temperature Setting
282
+
283
+ ```tsx
284
+ function TemperatureSetting() {
285
+ return (
286
+ <Slider
287
+ defaultValue={22}
288
+ min={16}
289
+ max={30}
290
+ step={0.5}
291
+ marks={[
292
+ { value: 16, label: '16°C' },
293
+ { value: 22, label: '22°C' },
294
+ { value: 30, label: '30°C' },
295
+ ]}
296
+ valueLabelDisplay="auto"
297
+ valueLabelFormat={(value) => `${value}°C`}
298
+ />
299
+ );
300
+ }
301
+ ```
302
+
303
+ ## Best Practices
304
+
305
+ 1. **Always set `min` and `max`**: Provide explicit bounds so users understand the valid range.
306
+
307
+ 2. **Use marks for discrete values**: When the slider has meaningful steps, display marks with labels.
308
+
309
+ ```tsx
310
+ // ✅ Clear discrete steps
311
+ <Slider step={25} marks={[
312
+ { value: 0, label: 'Off' },
313
+ { value: 25, label: 'Low' },
314
+ { value: 50, label: 'Mid' },
315
+ { value: 75, label: 'High' },
316
+ { value: 100, label: 'Max' },
317
+ ]} />
318
+
319
+ // ❌ Unlabeled discrete steps — user cannot tell what values mean
320
+ <Slider step={25} />
321
+ ```
322
+
323
+ 3. **Show the current value**: For precise selections, use `valueLabelDisplay="on"` or display the value in nearby text.
324
+
325
+ 4. **Use range sliders for bounds**: When users need to define a range (min–max), pass an array value instead of two separate sliders.
326
+
327
+ 5. **Set a reasonable `step`**: For large ranges (0–1000), use a step > 1 to prevent overwhelming precision. For small ranges (0–1), use decimal steps.
328
+
329
+ ## Accessibility
330
+
331
+ - Slider renders with `role="slider"` and appropriate `aria-valuemin`, `aria-valuemax`, and `aria-valuenow` attributes.
332
+ - Keyboard support: Arrow keys increment/decrement by one step; Home/End jump to min/max.
333
+ - Add an `aria-label` or visible label to describe what the slider controls (e.g., `aria-label="Volume"`).
334
+ - For range sliders, each thumb has independent ARIA attributes for screen reader navigation.