@ceed/cds 1.34.1 → 1.36.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 (118) hide show
  1. package/dist/components/Accordions/Accordions.d.ts +1 -0
  2. package/dist/components/Alert/Alert.d.ts +5 -5
  3. package/dist/components/Autocomplete/Autocomplete.d.ts +2 -2
  4. package/dist/components/Avatar/Avatar.d.ts +7 -17
  5. package/dist/components/Box/Box.d.ts +1 -0
  6. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +6 -5
  7. package/dist/components/Button/Button.d.ts +3 -2
  8. package/dist/components/Calendar/Calendar.d.ts +1 -0
  9. package/dist/components/Card/Card.d.ts +1 -0
  10. package/dist/components/Checkbox/Checkbox.d.ts +1 -0
  11. package/dist/components/Chip/Chip.d.ts +1 -0
  12. package/dist/components/Container/Container.d.ts +6 -1
  13. package/dist/components/CurrencyInput/CurrencyInput.d.ts +1 -1
  14. package/dist/components/DialogActions/DialogActions.d.ts +1 -0
  15. package/dist/components/DialogContent/DialogContent.d.ts +1 -0
  16. package/dist/components/DialogFrame/DialogFrame.d.ts +1 -1
  17. package/dist/components/DialogTitle/DialogTitle.d.ts +1 -0
  18. package/dist/components/Divider/Divider.d.ts +1 -0
  19. package/dist/components/Drawer/Drawer.d.ts +1 -0
  20. package/dist/components/Dropdown/Dropdown.d.ts +28 -1
  21. package/dist/components/FormControl/FormControl.d.ts +1 -0
  22. package/dist/components/FormHelperText/FormHelperText.d.ts +1 -0
  23. package/dist/components/FormLabel/FormLabel.d.ts +1 -0
  24. package/dist/components/Grid/Grid.d.ts +1 -0
  25. package/dist/components/IconButton/IconButton.d.ts +3 -2
  26. package/dist/components/IconMenuButton/IconMenuButton.d.ts +7 -6
  27. package/dist/components/InfoSign/InfoSign.d.ts +3 -2
  28. package/dist/components/Input/Input.d.ts +8 -22
  29. package/dist/components/InsetDrawer/InsetDrawer.d.ts +1 -0
  30. package/dist/components/Markdown/Markdown.d.ts +9 -24
  31. package/dist/components/Menu/Menu.d.ts +2 -1
  32. package/dist/components/MenuButton/MenuButton.d.ts +10 -8
  33. package/dist/components/Modal/Modal.d.ts +4 -2
  34. package/dist/components/NavigationGroup/NavigationGroup.d.ts +3 -2
  35. package/dist/components/NavigationItem/NavigationItem.d.ts +3 -2
  36. package/dist/components/Navigator/Navigator.d.ts +5 -4
  37. package/dist/components/Pagination/Pagination.d.ts +1 -1
  38. package/dist/components/Radio/Radio.d.ts +1 -0
  39. package/dist/components/RadioList/RadioList.d.ts +3 -2
  40. package/dist/components/Select/Select.d.ts +20 -10
  41. package/dist/components/Sheet/Sheet.d.ts +1 -0
  42. package/dist/components/Stack/Stack.d.ts +1 -0
  43. package/dist/components/Stepper/Stepper.d.ts +2 -1
  44. package/dist/components/Switch/Switch.d.ts +1 -0
  45. package/dist/components/Table/Table.d.ts +7 -5
  46. package/dist/components/Tabs/Tabs.d.ts +1 -0
  47. package/dist/components/Textarea/Textarea.d.ts +8 -20
  48. package/dist/components/Tooltip/Tooltip.d.ts +1 -0
  49. package/dist/components/Typography/Typography.d.ts +1 -0
  50. package/dist/components/Uploader/Uploader.d.ts +18 -17
  51. package/dist/components/data-display/Avatar.md +60 -72
  52. package/dist/components/data-display/Badge.md +197 -181
  53. package/dist/components/data-display/Chip.md +164 -142
  54. package/dist/components/data-display/DataTable.md +843 -338
  55. package/dist/components/data-display/InfoSign.md +1 -3
  56. package/dist/components/data-display/Markdown.md +93 -125
  57. package/dist/components/data-display/Table.md +1453 -1007
  58. package/dist/components/data-display/Typography.md +113 -116
  59. package/dist/components/feedback/Alert.md +80 -86
  60. package/dist/components/feedback/CircularProgress.md +32 -36
  61. package/dist/components/feedback/Dialog.md +25 -17
  62. package/dist/components/feedback/Modal.md +296 -264
  63. package/dist/components/feedback/Skeleton.md +125 -89
  64. package/dist/components/index.d.ts +62 -2
  65. package/dist/components/inputs/Autocomplete.md +191 -95
  66. package/dist/components/inputs/Button.md +83 -83
  67. package/dist/components/inputs/ButtonGroup.md +195 -185
  68. package/dist/components/inputs/Calendar.md +25 -28
  69. package/dist/components/inputs/Checkbox.md +11 -29
  70. package/dist/components/inputs/CurrencyInput.md +4 -4
  71. package/dist/components/inputs/DatePicker.md +229 -110
  72. package/dist/components/inputs/DateRangePicker.md +248 -137
  73. package/dist/components/inputs/FilterableCheckboxGroup.md +115 -55
  74. package/dist/components/inputs/FormControl.md +75 -69
  75. package/dist/components/inputs/IconButton.md +229 -205
  76. package/dist/components/inputs/Input.md +131 -98
  77. package/dist/components/inputs/MonthPicker.md +186 -84
  78. package/dist/components/inputs/MonthRangePicker.md +73 -49
  79. package/dist/components/inputs/PercentageInput.md +15 -31
  80. package/dist/components/inputs/RadioButton.md +320 -256
  81. package/dist/components/inputs/RadioList.md +66 -50
  82. package/dist/components/inputs/RadioTileGroup.md +287 -170
  83. package/dist/components/inputs/SearchBar.md +82 -60
  84. package/dist/components/inputs/Select.md +184 -120
  85. package/dist/components/inputs/Slider.md +153 -102
  86. package/dist/components/inputs/Switch.md +193 -138
  87. package/dist/components/inputs/Textarea.md +15 -20
  88. package/dist/components/inputs/Uploader/Uploader.md +68 -39
  89. package/dist/components/layout/Box.md +841 -662
  90. package/dist/components/layout/Container.md +3 -11
  91. package/dist/components/layout/Grid.md +480 -394
  92. package/dist/components/layout/Stack.md +739 -566
  93. package/dist/components/navigation/Breadcrumbs.md +4 -4
  94. package/dist/components/navigation/Drawer.md +34 -25
  95. package/dist/components/navigation/Dropdown.md +745 -408
  96. package/dist/components/navigation/IconMenuButton.md +14 -6
  97. package/dist/components/navigation/InsetDrawer.md +8 -13
  98. package/dist/components/navigation/Link.md +1 -2
  99. package/dist/components/navigation/Menu.md +623 -502
  100. package/dist/components/navigation/MenuButton.md +18 -10
  101. package/dist/components/navigation/NavigationGroup.md +19 -50
  102. package/dist/components/navigation/NavigationItem.md +6 -6
  103. package/dist/components/navigation/Navigator.md +26 -28
  104. package/dist/components/navigation/Pagination.md +86 -75
  105. package/dist/components/navigation/Stepper.md +2 -12
  106. package/dist/components/navigation/Tabs.md +48 -36
  107. package/dist/components/surfaces/Accordions.md +89 -172
  108. package/dist/components/surfaces/Card.md +1094 -709
  109. package/dist/components/surfaces/Divider.md +562 -412
  110. package/dist/components/surfaces/Sheet.md +700 -518
  111. package/dist/guides/ThemeProvider.md +8 -8
  112. package/dist/index.browser.js +4 -4
  113. package/dist/index.browser.js.map +4 -4
  114. package/dist/index.cjs +1074 -1033
  115. package/dist/index.d.ts +2 -1
  116. package/dist/index.js +720 -671
  117. package/framer/index.js +1 -1
  118. package/package.json +32 -35
@@ -8,10 +8,10 @@ By applying shared props like `color`, `variant`, `size`, and `orientation` at t
8
8
 
9
9
  ```tsx
10
10
  <ButtonGroup {...args}>
11
- <Button>첫번째</Button>
12
- <Button>두번째</Button>
13
- <Button>세번째</Button>
14
- </ButtonGroup>
11
+ <Button>첫번째</Button>
12
+ <Button>두번째</Button>
13
+ <Button>세번째</Button>
14
+ </ButtonGroup>
15
15
  ```
16
16
 
17
17
  | Field | Description | Default |
@@ -43,41 +43,43 @@ function MyComponent() {
43
43
  Apply a unified color theme to all buttons in the group using the `color` prop. Available colors are `primary`, `neutral`, `danger`, `success`, and `warning`.
44
44
 
45
45
  ```tsx
46
- <div style={{
47
- display: 'flex',
48
- gap: '1rem',
49
- flexDirection: 'column'
50
- }}>
51
- <ButtonGroup color="primary">
52
- <Button>Primary</Button>
53
- <Button>Button</Button>
54
- <Button>Group</Button>
55
- </ButtonGroup>
46
+ <div
47
+ style={{
48
+ display: "flex",
49
+ gap: "1rem",
50
+ flexDirection: "column"
51
+ }}
52
+ >
53
+ <ButtonGroup color="primary">
54
+ <Button>Primary</Button>
55
+ <Button>Button</Button>
56
+ <Button>Group</Button>
57
+ </ButtonGroup>
56
58
 
57
- <ButtonGroup color="neutral">
58
- <Button>Neutral</Button>
59
- <Button>Button</Button>
60
- <Button>Group</Button>
61
- </ButtonGroup>
59
+ <ButtonGroup color="neutral">
60
+ <Button>Neutral</Button>
61
+ <Button>Button</Button>
62
+ <Button>Group</Button>
63
+ </ButtonGroup>
62
64
 
63
- <ButtonGroup color="danger">
64
- <Button>Danger</Button>
65
- <Button>Button</Button>
66
- <Button>Group</Button>
67
- </ButtonGroup>
65
+ <ButtonGroup color="danger">
66
+ <Button>Danger</Button>
67
+ <Button>Button</Button>
68
+ <Button>Group</Button>
69
+ </ButtonGroup>
68
70
 
69
- <ButtonGroup color="success">
70
- <Button>Success</Button>
71
- <Button>Button</Button>
72
- <Button>Group</Button>
73
- </ButtonGroup>
71
+ <ButtonGroup color="success">
72
+ <Button>Success</Button>
73
+ <Button>Button</Button>
74
+ <Button>Group</Button>
75
+ </ButtonGroup>
74
76
 
75
- <ButtonGroup color="warning">
76
- <Button>Warning</Button>
77
- <Button>Button</Button>
78
- <Button>Group</Button>
79
- </ButtonGroup>
80
- </div>
77
+ <ButtonGroup color="warning">
78
+ <Button>Warning</Button>
79
+ <Button>Button</Button>
80
+ <Button>Group</Button>
81
+ </ButtonGroup>
82
+ </div>
81
83
  ```
82
84
 
83
85
  ## Variants
@@ -85,35 +87,37 @@ Apply a unified color theme to all buttons in the group using the `color` prop.
85
87
  ButtonGroup supports four visual variants: `solid`, `soft`, `outlined`, and `plain`. The variant prop propagates to all child buttons, ensuring a consistent look.
86
88
 
87
89
  ```tsx
88
- <div style={{
89
- display: 'flex',
90
- gap: '1rem',
91
- flexDirection: 'column'
92
- }}>
93
- <ButtonGroup variant="solid">
94
- <Button>Solid</Button>
95
- <Button>Button</Button>
96
- <Button>Group</Button>
97
- </ButtonGroup>
90
+ <div
91
+ style={{
92
+ display: "flex",
93
+ gap: "1rem",
94
+ flexDirection: "column"
95
+ }}
96
+ >
97
+ <ButtonGroup variant="solid">
98
+ <Button>Solid</Button>
99
+ <Button>Button</Button>
100
+ <Button>Group</Button>
101
+ </ButtonGroup>
98
102
 
99
- <ButtonGroup variant="soft">
100
- <Button>Soft</Button>
101
- <Button>Button</Button>
102
- <Button>Group</Button>
103
- </ButtonGroup>
103
+ <ButtonGroup variant="soft">
104
+ <Button>Soft</Button>
105
+ <Button>Button</Button>
106
+ <Button>Group</Button>
107
+ </ButtonGroup>
104
108
 
105
- <ButtonGroup variant="outlined">
106
- <Button>Outlined</Button>
107
- <Button>Button</Button>
108
- <Button>Group</Button>
109
- </ButtonGroup>
109
+ <ButtonGroup variant="outlined">
110
+ <Button>Outlined</Button>
111
+ <Button>Button</Button>
112
+ <Button>Group</Button>
113
+ </ButtonGroup>
110
114
 
111
- <ButtonGroup variant="plain">
112
- <Button>Plain</Button>
113
- <Button>Button</Button>
114
- <Button>Group</Button>
115
- </ButtonGroup>
116
- </div>
115
+ <ButtonGroup variant="plain">
116
+ <Button>Plain</Button>
117
+ <Button>Button</Button>
118
+ <Button>Group</Button>
119
+ </ButtonGroup>
120
+ </div>
117
121
  ```
118
122
 
119
123
  ## Sizes
@@ -121,30 +125,32 @@ ButtonGroup supports four visual variants: `solid`, `soft`, `outlined`, and `pla
121
125
  Control the size of all buttons in the group with the `size` prop. Available sizes are `sm`, `md` (default), and `lg`.
122
126
 
123
127
  ```tsx
124
- <div style={{
125
- display: 'flex',
126
- gap: '1rem',
127
- flexDirection: 'column',
128
- alignItems: 'flex-start'
129
- }}>
130
- <ButtonGroup size="sm">
131
- <Button>Small</Button>
132
- <Button>Button</Button>
133
- <Button>Group</Button>
134
- </ButtonGroup>
128
+ <div
129
+ style={{
130
+ display: "flex",
131
+ gap: "1rem",
132
+ flexDirection: "column",
133
+ alignItems: "flex-start"
134
+ }}
135
+ >
136
+ <ButtonGroup size="sm">
137
+ <Button>Small</Button>
138
+ <Button>Button</Button>
139
+ <Button>Group</Button>
140
+ </ButtonGroup>
135
141
 
136
- <ButtonGroup size="md">
137
- <Button>Medium</Button>
138
- <Button>Button</Button>
139
- <Button>Group</Button>
140
- </ButtonGroup>
142
+ <ButtonGroup size="md">
143
+ <Button>Medium</Button>
144
+ <Button>Button</Button>
145
+ <Button>Group</Button>
146
+ </ButtonGroup>
141
147
 
142
- <ButtonGroup size="lg">
143
- <Button>Large</Button>
144
- <Button>Button</Button>
145
- <Button>Group</Button>
146
- </ButtonGroup>
147
- </div>
148
+ <ButtonGroup size="lg">
149
+ <Button>Large</Button>
150
+ <Button>Button</Button>
151
+ <Button>Group</Button>
152
+ </ButtonGroup>
153
+ </div>
148
154
  ```
149
155
 
150
156
  ## Orientations
@@ -152,29 +158,31 @@ Control the size of all buttons in the group with the `size` prop. Available siz
152
158
  Buttons can be arranged horizontally (default) or vertically. Use `orientation="vertical"` for stacked layouts such as side panels or narrow containers.
153
159
 
154
160
  ```tsx
155
- <div style={{
156
- display: 'flex',
157
- gap: '2rem',
158
- alignItems: 'flex-start'
159
- }}>
160
- <div>
161
- <h4>Horizontal</h4>
162
- <ButtonGroup orientation="horizontal">
163
- <Button>첫번째</Button>
164
- <Button>두번째</Button>
165
- <Button>세번째</Button>
166
- </ButtonGroup>
167
- </div>
168
-
169
- <div>
170
- <h4>Vertical</h4>
171
- <ButtonGroup orientation="vertical">
172
- <Button>첫번째</Button>
173
- <Button>두번째</Button>
174
- <Button>세번째</Button>
175
- </ButtonGroup>
176
- </div>
177
- </div>
161
+ <div
162
+ style={{
163
+ display: "flex",
164
+ gap: "2rem",
165
+ alignItems: "flex-start"
166
+ }}
167
+ >
168
+ <div>
169
+ <h4>Horizontal</h4>
170
+ <ButtonGroup orientation="horizontal">
171
+ <Button>첫번째</Button>
172
+ <Button>두번째</Button>
173
+ <Button>세번째</Button>
174
+ </ButtonGroup>
175
+ </div>
176
+
177
+ <div>
178
+ <h4>Vertical</h4>
179
+ <ButtonGroup orientation="vertical">
180
+ <Button>첫번째</Button>
181
+ <Button>두번째</Button>
182
+ <Button>세번째</Button>
183
+ </ButtonGroup>
184
+ </div>
185
+ </div>
178
186
  ```
179
187
 
180
188
  ## With Icons
@@ -182,23 +190,25 @@ Buttons can be arranged horizontally (default) or vertically. Use `orientation="
182
190
  Combine text labels with icons using the `startDecorator` prop on individual buttons for a richer, more descriptive interface.
183
191
 
184
192
  ```tsx
185
- <div style={{
186
- display: 'flex',
187
- gap: '2rem',
188
- flexDirection: 'column'
189
- }}>
190
- <ButtonGroup>
191
- <Button startDecorator={<Add />}>추가</Button>
192
- <Button startDecorator={<Edit />}>편집</Button>
193
- <Button startDecorator={<Delete />}>삭제</Button>
194
- </ButtonGroup>
193
+ <div
194
+ style={{
195
+ display: "flex",
196
+ gap: "2rem",
197
+ flexDirection: "column"
198
+ }}
199
+ >
200
+ <ButtonGroup>
201
+ <Button startDecorator={<Add />}>추가</Button>
202
+ <Button startDecorator={<Edit />}>편집</Button>
203
+ <Button startDecorator={<Delete />}>삭제</Button>
204
+ </ButtonGroup>
195
205
 
196
- <ButtonGroup variant="outlined">
197
- <Button startDecorator={<Save />} />
198
- <Button startDecorator={<Share />} />
199
- <Button startDecorator={<Edit />} />
200
- </ButtonGroup>
201
- </div>
206
+ <ButtonGroup variant="outlined">
207
+ <Button startDecorator={<Save />} />
208
+ <Button startDecorator={<Share />} />
209
+ <Button startDecorator={<Edit />} />
210
+ </ButtonGroup>
211
+ </div>
202
212
  ```
203
213
 
204
214
  ## States
@@ -206,38 +216,40 @@ Combine text labels with icons using the `startDecorator` prop on individual but
206
216
  ButtonGroup supports disabled states at the group level (affecting all children) or on individual buttons for mixed-state scenarios.
207
217
 
208
218
  ```tsx
209
- <div style={{
210
- display: 'flex',
211
- gap: '2rem',
212
- flexDirection: 'column'
213
- }}>
214
- <div>
215
- <h4>Normal</h4>
216
- <ButtonGroup>
217
- <Button>첫번째</Button>
218
- <Button>두번째</Button>
219
- <Button>세번째</Button>
220
- </ButtonGroup>
221
- </div>
222
-
223
- <div>
224
- <h4>Disabled</h4>
225
- <ButtonGroup disabled>
226
- <Button>첫번째</Button>
227
- <Button>두번째</Button>
228
- <Button>세번째</Button>
229
- </ButtonGroup>
230
- </div>
231
-
232
- <div>
233
- <h4>Mixed States</h4>
234
- <ButtonGroup>
235
- <Button>활성</Button>
236
- <Button disabled>비활성</Button>
237
- <Button>활성</Button>
238
- </ButtonGroup>
239
- </div>
240
- </div>
219
+ <div
220
+ style={{
221
+ display: "flex",
222
+ gap: "2rem",
223
+ flexDirection: "column"
224
+ }}
225
+ >
226
+ <div>
227
+ <h4>Normal</h4>
228
+ <ButtonGroup>
229
+ <Button>첫번째</Button>
230
+ <Button>두번째</Button>
231
+ <Button>세번째</Button>
232
+ </ButtonGroup>
233
+ </div>
234
+
235
+ <div>
236
+ <h4>Disabled</h4>
237
+ <ButtonGroup disabled>
238
+ <Button>첫번째</Button>
239
+ <Button>두번째</Button>
240
+ <Button>세번째</Button>
241
+ </ButtonGroup>
242
+ </div>
243
+
244
+ <div>
245
+ <h4>Mixed States</h4>
246
+ <ButtonGroup>
247
+ <Button>활성</Button>
248
+ <Button disabled>비활성</Button>
249
+ <Button>활성</Button>
250
+ </ButtonGroup>
251
+ </div>
252
+ </div>
241
253
  ```
242
254
 
243
255
  ## Toggle Group
@@ -246,20 +258,29 @@ By dynamically switching the `variant` prop on individual buttons based on selec
246
258
 
247
259
  ```tsx
248
260
  <div>
249
- <h4>Toggle Group (Alignment)</h4>
250
- <ButtonGroup variant="outlined">
251
- <Button variant={selected === 'left' ? 'solid' : 'outlined'} onClick={() => setSelected('left')}>
252
- 왼쪽 정렬
253
- </Button>
254
- <Button variant={selected === 'center' ? 'solid' : 'outlined'} onClick={() => setSelected('center')}>
255
- 가운데 정렬
256
- </Button>
257
- <Button variant={selected === 'right' ? 'solid' : 'outlined'} onClick={() => setSelected('right')}>
258
- 오른쪽 정렬
259
- </Button>
260
- </ButtonGroup>
261
- <p>선택된 정렬: {selected}</p>
262
- </div>
261
+ <h4>Toggle Group (Alignment)</h4>
262
+ <ButtonGroup variant="outlined">
263
+ <Button
264
+ variant={selected === "left" ? "solid" : "outlined"}
265
+ onClick={() => setSelected("left")}
266
+ >
267
+ 왼쪽 정렬
268
+ </Button>
269
+ <Button
270
+ variant={selected === "center" ? "solid" : "outlined"}
271
+ onClick={() => setSelected("center")}
272
+ >
273
+ 가운데 정렬
274
+ </Button>
275
+ <Button
276
+ variant={selected === "right" ? "solid" : "outlined"}
277
+ onClick={() => setSelected("right")}
278
+ >
279
+ 오른쪽 정렬
280
+ </Button>
281
+ </ButtonGroup>
282
+ <p>선택된 정렬: {selected}</p>
283
+ </div>
263
284
  ```
264
285
 
265
286
  ## Common Use Cases
@@ -276,7 +297,7 @@ import RedoIcon from '@mui/icons-material/Redo';
276
297
  <Button startDecorator={<SaveIcon />}>Save</Button>
277
298
  <Button startDecorator={<UndoIcon />}>Undo</Button>
278
299
  <Button startDecorator={<RedoIcon />}>Redo</Button>
279
- </ButtonGroup>
300
+ </ButtonGroup>;
280
301
  ```
281
302
 
282
303
  ### View Switcher
@@ -285,25 +306,16 @@ import RedoIcon from '@mui/icons-material/Redo';
285
306
  const [view, setView] = useState('list');
286
307
 
287
308
  <ButtonGroup variant="outlined" color="neutral">
288
- <Button
289
- variant={view === 'list' ? 'solid' : 'outlined'}
290
- onClick={() => setView('list')}
291
- >
309
+ <Button variant={view === 'list' ? 'solid' : 'outlined'} onClick={() => setView('list')}>
292
310
  List
293
311
  </Button>
294
- <Button
295
- variant={view === 'grid' ? 'solid' : 'outlined'}
296
- onClick={() => setView('grid')}
297
- >
312
+ <Button variant={view === 'grid' ? 'solid' : 'outlined'} onClick={() => setView('grid')}>
298
313
  Grid
299
314
  </Button>
300
- <Button
301
- variant={view === 'card' ? 'solid' : 'outlined'}
302
- onClick={() => setView('card')}
303
- >
315
+ <Button variant={view === 'card' ? 'solid' : 'outlined'} onClick={() => setView('card')}>
304
316
  Card
305
317
  </Button>
306
- </ButtonGroup>
318
+ </ButtonGroup>;
307
319
  ```
308
320
 
309
321
  ### Pagination Controls
@@ -314,9 +326,7 @@ const [view, setView] = useState('list');
314
326
  Previous
315
327
  </Button>
316
328
  <Button disabled>{page}</Button>
317
- <Button onClick={() => setPage(page + 1)}>
318
- Next
319
- </Button>
329
+ <Button onClick={() => setPage(page + 1)}>Next</Button>
320
330
  </ButtonGroup>
321
331
  ```
322
332
 
@@ -29,12 +29,7 @@ import { useState } from 'react';
29
29
  function DateSelector() {
30
30
  const [date, setDate] = useState<Date | null>(null);
31
31
 
32
- return (
33
- <Calendar
34
- value={date ? [date, undefined] : undefined}
35
- onChange={(dates) => setDate(dates[0] || null)}
36
- />
37
- );
32
+ return <Calendar value={date ? [date, undefined] : undefined} onChange={(dates) => setDate(dates[0] || null)} />;
38
33
  }
39
34
  ```
40
35
 
@@ -96,7 +91,11 @@ Show only the month grid for month-level navigation and selection.
96
91
  Enable both month and day views with navigation between them, giving users the flexibility to zoom in and out of the calendar.
97
92
 
98
93
  ```tsx
99
- <Calendar views={['month', 'day']} rangeSelection defaultValue={[new Date(2024, 2, 1), new Date(2024, 2, 20)]} />
94
+ <Calendar
95
+ views={["month", "day"]}
96
+ rangeSelection
97
+ defaultValue={[new Date(2024, 2, 1), new Date(2024, 2, 20)]}
98
+ />
100
99
  ```
101
100
 
102
101
  ### Month Selection
@@ -154,7 +153,7 @@ Use the `shouldDisableDate` callback to implement arbitrary disabling logic, suc
154
153
  Combine `shouldDisableDate` with `disablePast` to apply multiple restrictions simultaneously.
155
154
 
156
155
  ```tsx
157
- <Calendar shouldDisableDate={date => [0, 6].includes(date.getDay())} disablePast />
156
+ <Calendar shouldDisableDate={(date) => [0, 6].includes(date.getDay())} disablePast />
158
157
  ```
159
158
 
160
159
  ### Complex Date Restrictions
@@ -162,7 +161,13 @@ Combine `shouldDisableDate` with `disablePast` to apply multiple restrictions si
162
161
  Disable weekends, past dates, and limit selection to one week ahead by combining all restriction options.
163
162
 
164
163
  ```tsx
165
- <Calendar shouldDisableDate={date => [0, 6].includes(date.getDay()) || date.getTime() >= new Date().getTime() + 7 * 24 * 60 * 60 * 1000} disablePast />
164
+ <Calendar
165
+ shouldDisableDate={(date) =>
166
+ [0, 6].includes(date.getDay()) ||
167
+ date.getTime() >= new Date().getTime() + 7 * 24 * 60 * 60 * 1000
168
+ }
169
+ disablePast
170
+ />
166
171
  ```
167
172
 
168
173
  ## Common Use Cases
@@ -181,10 +186,7 @@ function CalendarWidget() {
181
186
  <Typography level="title-md" sx={{ mb: 2 }}>
182
187
  Select a Date
183
188
  </Typography>
184
- <Calendar
185
- value={[selectedDate, undefined]}
186
- onChange={(dates) => dates[0] && setSelectedDate(dates[0])}
187
- />
189
+ <Calendar value={[selectedDate, undefined]} onChange={(dates) => dates[0] && setSelectedDate(dates[0])} />
188
190
  <Typography level="body-sm" sx={{ mt: 2 }}>
189
191
  Selected: {selectedDate.toLocaleDateString()}
190
192
  </Typography>
@@ -199,19 +201,14 @@ function CalendarWidget() {
199
201
  function BookingCalendar({ blockedDates }) {
200
202
  const [selectedDate, setSelectedDate] = useState<Date | null>(null);
201
203
 
202
- const blockedSet = useMemo(
203
- () => new Set(blockedDates.map((d) => d.toDateString())),
204
- [blockedDates]
205
- );
204
+ const blockedSet = useMemo(() => new Set(blockedDates.map((d) => d.toDateString())), [blockedDates]);
206
205
 
207
206
  return (
208
207
  <Calendar
209
208
  value={selectedDate ? [selectedDate, undefined] : undefined}
210
209
  onChange={(dates) => setSelectedDate(dates[0] || null)}
211
210
  disablePast
212
- shouldDisableDate={(date) =>
213
- [0, 6].includes(date.getDay()) || blockedSet.has(date.toDateString())
214
- }
211
+ shouldDisableDate={(date) => [0, 6].includes(date.getDay()) || blockedSet.has(date.toDateString())}
215
212
  />
216
213
  );
217
214
  }
@@ -221,10 +218,7 @@ function BookingCalendar({ blockedDates }) {
221
218
 
222
219
  ```tsx
223
220
  function DateRangeSelector({ onRangeSelect }) {
224
- const [range, setRange] = useState<[Date | undefined, Date | undefined]>([
225
- undefined,
226
- undefined,
227
- ]);
221
+ const [range, setRange] = useState<[Date | undefined, Date | undefined]>([undefined, undefined]);
228
222
 
229
223
  const dayCount = useMemo(() => {
230
224
  if (!range[0] || !range[1]) return 0;
@@ -284,12 +278,15 @@ function DateRangeSelector({ onRangeSelect }) {
284
278
 
285
279
  ```tsx
286
280
  // ✅ Memoized disable function
287
- const shouldDisableDate = useCallback((date: Date) => {
288
- return [0, 6].includes(date.getDay()) || holidays.has(date.toDateString());
289
- }, [holidays]);
281
+ const shouldDisableDate = useCallback(
282
+ (date: Date) => {
283
+ return [0, 6].includes(date.getDay()) || holidays.has(date.toDateString());
284
+ },
285
+ [holidays],
286
+ );
290
287
 
291
288
  // ❌ Inline function recreated every render
292
- <Calendar shouldDisableDate={(date) => expensiveCheck(date)} />
289
+ <Calendar shouldDisableDate={(date) => expensiveCheck(date)} />;
293
290
  ```
294
291
 
295
292
  4. **Always use Date objects, not strings.** Calendar expects native `Date` objects for `value`, `defaultValue`, `minDate`, and `maxDate`.
@@ -25,13 +25,7 @@ import { Checkbox } from '@ceed/cds';
25
25
  function MyComponent() {
26
26
  const [checked, setChecked] = useState(false);
27
27
 
28
- return (
29
- <Checkbox
30
- label="I agree"
31
- checked={checked}
32
- onChange={(e) => setChecked(e.target.checked)}
33
- />
34
- );
28
+ return <Checkbox label="I agree" checked={checked} onChange={(e) => setChecked(e.target.checked)} />;
35
29
  }
36
30
  ```
37
31
 
@@ -91,11 +85,7 @@ Apply semantic colors to communicate meaning.
91
85
  Represents a partially selected state, commonly used in "select all" patterns where some but not all children are selected.
92
86
 
93
87
  ```tsx
94
- <Checkbox
95
- label="Partially selected"
96
- indeterminate
97
- onChange={handleChange}
98
- />
88
+ <Checkbox label="Partially selected" indeterminate onChange={handleChange} />
99
89
  ```
100
90
 
101
91
  ### Disabled
@@ -136,10 +126,8 @@ function TermsForm() {
136
126
  marketing: false,
137
127
  });
138
128
 
139
- const handleChange = (key: keyof typeof agreements) => (
140
- event: React.ChangeEvent<HTMLInputElement>
141
- ) => {
142
- setAgreements(prev => ({ ...prev, [key]: event.target.checked }));
129
+ const handleChange = (key: keyof typeof agreements) => (event: React.ChangeEvent<HTMLInputElement>) => {
130
+ setAgreements((prev) => ({ ...prev, [key]: event.target.checked }));
143
131
  };
144
132
 
145
133
  return (
@@ -200,18 +188,16 @@ function SelectAllExample() {
200
188
  { id: 4, name: 'Item 4', selected: false },
201
189
  ]);
202
190
 
203
- const selectedCount = items.filter(item => item.selected).length;
191
+ const selectedCount = items.filter((item) => item.selected).length;
204
192
  const isAllSelected = selectedCount === items.length;
205
193
  const isIndeterminate = selectedCount > 0 && selectedCount < items.length;
206
194
 
207
195
  const handleSelectAll = (event: React.ChangeEvent<HTMLInputElement>) => {
208
- setItems(prev => prev.map(item => ({ ...item, selected: event.target.checked })));
196
+ setItems((prev) => prev.map((item) => ({ ...item, selected: event.target.checked })));
209
197
  };
210
198
 
211
199
  const handleItemToggle = (id: number) => {
212
- setItems(prev => prev.map(item =>
213
- item.id === id ? { ...item, selected: !item.selected } : item
214
- ));
200
+ setItems((prev) => prev.map((item) => (item.id === id ? { ...item, selected: !item.selected } : item)));
215
201
  };
216
202
 
217
203
  return (
@@ -228,7 +214,7 @@ function SelectAllExample() {
228
214
  <Divider />
229
215
 
230
216
  <Stack spacing={1} sx={{ pl: 2 }}>
231
- {items.map(item => (
217
+ {items.map((item) => (
232
218
  <Checkbox
233
219
  key={item.id}
234
220
  label={item.name}
@@ -251,14 +237,10 @@ function ProductFilter() {
251
237
  categories: [] as string[],
252
238
  });
253
239
 
254
- const handleCategoryChange = (category: string) => (
255
- event: React.ChangeEvent<HTMLInputElement>
256
- ) => {
257
- setFilters(prev => ({
240
+ const handleCategoryChange = (category: string) => (event: React.ChangeEvent<HTMLInputElement>) => {
241
+ setFilters((prev) => ({
258
242
  ...prev,
259
- categories: event.target.checked
260
- ? [...prev.categories, category]
261
- : prev.categories.filter(c => c !== category)
243
+ categories: event.target.checked ? [...prev.categories, category] : prev.categories.filter((c) => c !== category),
262
244
  }));
263
245
  };
264
246