@ceed/cds 1.34.1 → 1.35.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 +12 -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 +106 -95
  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 +1059 -1032
  115. package/dist/index.d.ts +2 -1
  116. package/dist/index.js +705 -670
  117. package/framer/index.js +1 -1
  118. package/package.json +32 -35
@@ -44,14 +44,7 @@ import { Input } from '@ceed/cds';
44
44
  function MyComponent() {
45
45
  const [value, setValue] = useState('');
46
46
 
47
- return (
48
- <Input
49
- label="Name"
50
- placeholder="Enter your name"
51
- value={value}
52
- onChange={(e) => setValue(e.target.value)}
53
- />
54
- );
47
+ return <Input label="Name" placeholder="Enter your name" value={value} onChange={(e) => setValue(e.target.value)} />;
55
48
  }
56
49
  ```
57
50
 
@@ -61,11 +54,11 @@ Input supports four visual styles: `outlined` (default), `solid`, `soft`, and `p
61
54
 
62
55
  ```tsx
63
56
  <>
64
- <Input placeholder="Type in here…" variant="solid" />
65
- <Input placeholder="Type in here…" variant="soft" />
66
- <Input placeholder="Type in here…" variant="outlined" />
67
- <Input placeholder="Type in here…" variant="plain" />
68
- </>
57
+ <Input placeholder="Type in here…" variant="solid" />
58
+ <Input placeholder="Type in here…" variant="soft" />
59
+ <Input placeholder="Type in here…" variant="outlined" />
60
+ <Input placeholder="Type in here…" variant="plain" />
61
+ </>
69
62
  ```
70
63
 
71
64
  ## Sizes
@@ -74,10 +67,10 @@ Three sizes are available: `sm`, `md` (default), and `lg`.
74
67
 
75
68
  ```tsx
76
69
  <>
77
- <Input {...args} size="lg" />
78
- <Input {...args} size="md" />
79
- <Input {...args} size="sm" />
80
- </>
70
+ <Input {...args} size="lg" />
71
+ <Input {...args} size="md" />
72
+ <Input {...args} size="sm" />
73
+ </>
81
74
  ```
82
75
 
83
76
  ## Label and Helper Text
@@ -88,8 +81,8 @@ The `label` prop renders a form label above the input.
88
81
 
89
82
  ```tsx
90
83
  <>
91
- <Input placeholder="Type in here…" label="Label" />
92
- </>
84
+ <Input placeholder="Type in here…" label="Label" />
85
+ </>
93
86
  ```
94
87
 
95
88
  ### Helper Text
@@ -98,8 +91,8 @@ The `helperText` prop renders descriptive text below the input.
98
91
 
99
92
  ```tsx
100
93
  <>
101
- <Input placeholder="Type in here…" helperText="I'm helper text" />
102
- </>
94
+ <Input placeholder="Type in here…" helperText="I'm helper text" />
95
+ </>
103
96
  ```
104
97
 
105
98
  ## States
@@ -118,8 +111,8 @@ Set `error` to visually indicate a validation failure. Combine with `helperText`
118
111
 
119
112
  ```tsx
120
113
  <>
121
- <Input placeholder="Invalid input" label="label" error />
122
- </>
114
+ <Input placeholder="Invalid input" label="label" error />
115
+ </>
123
116
  ```
124
117
 
125
118
  ### Required
@@ -141,40 +134,66 @@ Use `startDecorator` and `endDecorator` to add icons, buttons, or other elements
141
134
 
142
135
  ```tsx
143
136
  <Stack spacing={3}>
144
- <Input placeholder="Amount" startDecorator={{
145
- dollar: '$',
146
- baht: '฿',
147
- yen: '¥'
148
- }[currency]} endDecorator={<React.Fragment>
149
- <Divider orientation="vertical" />
150
- <Select variant="plain" value={currency} options={[{
151
- value: 'dollar',
152
- label: 'US dollar'
153
- }, {
154
- value: 'baht',
155
- label: 'Thai baht'
156
- }, {
157
- value: 'yen',
158
- label: 'Japanese yen'
159
- }]} onChange={e => setCurrency(e.target.value!)} slotProps={{
160
- listbox: {
161
- variant: 'outlined'
162
- }
163
- }} sx={{
164
- mr: -1.5,
165
- '&:hover': {
166
- bgcolor: 'transparent'
167
- }
168
- }} />
169
- </React.Fragment>} sx={{
170
- width: 300
171
- }} />
172
- <Input placeholder="Your location" startDecorator={<Button variant="soft" color="neutral" startDecorator={<LocationOn />}>
173
- Locate
174
- </Button>} sx={{
175
- width: 300
176
- }} />
177
- </Stack>
137
+ <Input
138
+ placeholder="Amount"
139
+ startDecorator={
140
+ {
141
+ dollar: "$",
142
+ baht: "฿",
143
+ yen: "¥"
144
+ }[currency]
145
+ }
146
+ endDecorator={
147
+ <React.Fragment>
148
+ <Divider orientation="vertical" />
149
+ <Select
150
+ variant="plain"
151
+ value={currency}
152
+ options={[
153
+ {
154
+ value: "dollar",
155
+ label: "US dollar"
156
+ },
157
+ {
158
+ value: "baht",
159
+ label: "Thai baht"
160
+ },
161
+ {
162
+ value: "yen",
163
+ label: "Japanese yen"
164
+ }
165
+ ]}
166
+ onChange={(e) => setCurrency(e.target.value!)}
167
+ slotProps={{
168
+ listbox: {
169
+ variant: "outlined"
170
+ }
171
+ }}
172
+ sx={{
173
+ mr: -1.5,
174
+ "&:hover": {
175
+ bgcolor: "transparent"
176
+ }
177
+ }}
178
+ />
179
+ </React.Fragment>
180
+ }
181
+ sx={{
182
+ width: 300
183
+ }}
184
+ />
185
+ <Input
186
+ placeholder="Your location"
187
+ startDecorator={
188
+ <Button variant="soft" color="neutral" startDecorator={<LocationOn />}>
189
+ Locate
190
+ </Button>
191
+ }
192
+ sx={{
193
+ width: 300
194
+ }}
195
+ />
196
+ </Stack>
178
197
  ```
179
198
 
180
199
  When using `endDecorator` together with `enableClearable`, both elements are displayed side by side:
@@ -194,15 +213,12 @@ Set `enableClearable` to show a clear button when the input has a value. Clickin
194
213
 
195
214
  ```tsx
196
215
  <>
197
- <Input placeholder="Type in here…" label="Label" enableClearable />
198
- </>
216
+ <Input placeholder="Type in here…" label="Label" enableClearable />
217
+ </>
199
218
  ```
200
219
 
201
220
  ```tsx
202
- <Input
203
- enableClearable
204
- placeholder="Type something and clear it"
205
- />
221
+ <Input enableClearable placeholder="Type something and clear it" />
206
222
  ```
207
223
 
208
224
  ## Password Input
@@ -211,15 +227,27 @@ Setting `type="password"` creates a password field with an automatic visibility
211
227
 
212
228
  ```tsx
213
229
  <Stack spacing={3}>
214
- <Typography level="body-md">Default password input with toggle button:</Typography>
215
- <Input {...args} placeholder="Enter password" type="password" label="Password" />
230
+ <Typography level="body-md">Default password input with toggle button:</Typography>
231
+ <Input {...args} placeholder="Enter password" type="password" label="Password" />
216
232
 
217
- <Typography level="body-md">Disabled password input:</Typography>
218
- <Input {...args} placeholder="Enter password" type="password" label="Disabled Password" disabled />
233
+ <Typography level="body-md">Disabled password input:</Typography>
234
+ <Input
235
+ {...args}
236
+ placeholder="Enter password"
237
+ type="password"
238
+ label="Disabled Password"
239
+ disabled
240
+ />
219
241
 
220
- <Typography level="body-md">Password input with toggle button disabled:</Typography>
221
- <Input {...args} placeholder="Enter password" type="password" label="No Toggle" disableTogglePasswordButton />
222
- </Stack>
242
+ <Typography level="body-md">Password input with toggle button disabled:</Typography>
243
+ <Input
244
+ {...args}
245
+ placeholder="Enter password"
246
+ type="password"
247
+ label="No Toggle"
248
+ disableTogglePasswordButton
249
+ />
250
+ </Stack>
223
251
  ```
224
252
 
225
253
  ### Disabling the Password Toggle
@@ -236,12 +264,20 @@ Password inputs (`type="password"`) do not support custom `endDecorator` because
236
264
 
237
265
  ```tsx
238
266
  <Stack spacing={3}>
239
- <Typography level="body-md">When type="password", the endDecorator is not supported:</Typography>
240
- <Input {...args} placeholder="Enter password" type="password" label="Password with endDecorator (will show warning)" endDecorator={<Chip color="primary">Hi</Chip>} />
267
+ <Typography level="body-md">
268
+ When type="password", the endDecorator is not supported:
269
+ </Typography>
270
+ <Input
271
+ {...args}
272
+ placeholder="Enter password"
273
+ type="password"
274
+ label="Password with endDecorator (will show warning)"
275
+ endDecorator={<Chip color="primary">Hi</Chip>}
276
+ />
241
277
 
242
- <Typography level="body-md">The password toggle button takes precedence:</Typography>
243
- <Input {...args} placeholder="Enter password" type="password" label="Password" />
244
- </Stack>
278
+ <Typography level="body-md">The password toggle button takes precedence:</Typography>
279
+ <Input {...args} placeholder="Enter password" type="password" label="Password" />
280
+ </Stack>
245
281
  ```
246
282
 
247
283
  ## Form Control
@@ -250,9 +286,9 @@ Combining `label`, `helperText`, and `error` produces a complete form field.
250
286
 
251
287
  ```tsx
252
288
  <>
253
- <Input placeholder="Type in here..." helperText="I'm helper text" label="Label" />
254
- <Input placeholder="Invalid input" helperText="I'm helper text" label="Label" error />
255
- </>
289
+ <Input placeholder="Type in here..." helperText="I'm helper text" label="Label" />
290
+ <Input placeholder="Invalid input" helperText="I'm helper text" label="Label" error />
291
+ </>
256
292
  ```
257
293
 
258
294
  ```tsx
@@ -277,18 +313,20 @@ Use `value` and `onChange` for controlled behavior.
277
313
 
278
314
  ```tsx
279
315
  <>
280
- <Input placeholder="Type in here…" label="Label" enableClearable value={value} onChange={handleChange} />
281
- </>
316
+ <Input
317
+ placeholder="Type in here…"
318
+ label="Label"
319
+ enableClearable
320
+ value={value}
321
+ onChange={handleChange}
322
+ />
323
+ </>
282
324
  ```
283
325
 
284
326
  ```tsx
285
327
  const [value, setValue] = useState('');
286
328
 
287
- <Input
288
- value={value}
289
- onChange={(e) => setValue(e.target.value)}
290
- placeholder="Controlled input"
291
- />
329
+ <Input value={value} onChange={(e) => setValue(e.target.value)} placeholder="Controlled input" />;
292
330
  ```
293
331
 
294
332
  ### Uncontrolled
@@ -334,18 +372,8 @@ function LoginForm({ onSubmit }) {
334
372
  return (
335
373
  <form onSubmit={onSubmit}>
336
374
  <Stack spacing={2}>
337
- <Input
338
- label="Email"
339
- type="email"
340
- required
341
- placeholder="Enter your email"
342
- />
343
- <Input
344
- label="Password"
345
- type="password"
346
- required
347
- placeholder="Enter your password"
348
- />
375
+ <Input label="Email" type="email" required placeholder="Enter your email" />
376
+ <Input label="Password" type="password" required placeholder="Enter your password" />
349
377
  <Button type="submit">Sign In</Button>
350
378
  </Stack>
351
379
  </form>
@@ -365,7 +393,12 @@ function ValidatedForm() {
365
393
  const isValid = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
366
394
 
367
395
  return (
368
- <form onSubmit={(e) => { e.preventDefault(); setSubmitted(true); }}>
396
+ <form
397
+ onSubmit={(e) => {
398
+ e.preventDefault();
399
+ setSubmitted(true);
400
+ }}
401
+ >
369
402
  <Stack spacing={2}>
370
403
  <Input
371
404
  label="Email"
@@ -35,13 +35,7 @@ import { MonthPicker } from '@ceed/cds';
35
35
  function MonthForm() {
36
36
  const [month, setMonth] = useState('');
37
37
 
38
- return (
39
- <MonthPicker
40
- label="Select Month"
41
- value={month}
42
- onChange={(e) => setMonth(e.target.value)}
43
- />
44
- );
38
+ return <MonthPicker label="Select Month" value={month} onChange={(e) => setMonth(e.target.value)} />;
45
39
  }
46
40
  ```
47
41
 
@@ -56,10 +50,10 @@ MonthPicker supports three sizes (`sm`, `md`, `lg`) for different layouts and co
56
50
 
57
51
  ```tsx
58
52
  <Stack gap={2}>
59
- <MonthPicker size="sm" />
60
- <MonthPicker size="md" />
61
- <MonthPicker size="lg" />
62
- </Stack>
53
+ <MonthPicker size="sm" />
54
+ <MonthPicker size="md" />
55
+ <MonthPicker size="lg" />
56
+ </Stack>
63
57
  ```
64
58
 
65
59
  ## Form Field Features
@@ -157,17 +151,19 @@ The parent component manages the month state via the `value` and `onChange` prop
157
151
 
158
152
  ```tsx
159
153
  <Stack gap={2}>
160
- <MonthPicker {...args} value={value} onChange={e => setValue(e.target.value)} />
161
- <Button onClick={() => {
162
- const currentValue = new Date(value);
163
- currentValue.setMonth(currentValue.getMonth() + 1);
164
- const year = currentValue.getFullYear();
165
- const month = String(currentValue.getMonth() + 1).padStart(2, '0');
166
- setValue(`${year}/${month}/01`);
167
- }}>
168
- Next Month
169
- </Button>
170
- </Stack>
154
+ <MonthPicker {...args} value={value} onChange={(e) => setValue(e.target.value)} />
155
+ <Button
156
+ onClick={() => {
157
+ const currentValue = new Date(value);
158
+ currentValue.setMonth(currentValue.getMonth() + 1);
159
+ const year = currentValue.getFullYear();
160
+ const month = String(currentValue.getMonth() + 1).padStart(2, "0");
161
+ setValue(`${year}/${month}/01`);
162
+ }}
163
+ >
164
+ Next Month
165
+ </Button>
166
+ </Stack>
171
167
  ```
172
168
 
173
169
  ### Uncontrolled
@@ -190,13 +186,55 @@ The `format` prop determines the shape of the value emitted by `onChange`. Each
190
186
 
191
187
  ```tsx
192
188
  <Stack gap={2}>
193
- <MonthPicker {...args} value={value['YYYY.MM.DD']} label="YYYY.MM.DD" name="YYYY.MM.DD" format="YYYY.MM.DD" onChange={handleChange} />
194
- <MonthPicker {...args} value={value['YYYY/MM/DD']} label="YYYY/MM/DD" name="YYYY/MM/DD" format="YYYY/MM/DD" onChange={handleChange} />
195
- <MonthPicker {...args} value={value['MM/DD/YYYY']} label="MM/DD/YYYY" name="MM/DD/YYYY" format="MM/DD/YYYY" onChange={handleChange} />
196
- <MonthPicker {...args} value={value['YYYY-MM-DD']} label="YYYY-MM-DD" name="YYYY-MM-DD" format="YYYY-MM-DD" onChange={handleChange} />
197
- <MonthPicker {...args} value={value['DD/MM/YYYY']} label="DD/MM/YYYY" name="DD/MM/YYYY" format="DD/MM/YYYY" onChange={handleChange} />
198
- <MonthPicker {...args} value={value['DD.MM.YYYY']} label="DD.MM.YYYY" name="DD.MM.YYYY" format="DD.MM.YYYY" onChange={handleChange} />
199
- </Stack>
189
+ <MonthPicker
190
+ {...args}
191
+ value={value["YYYY.MM.DD"]}
192
+ label="YYYY.MM.DD"
193
+ name="YYYY.MM.DD"
194
+ format="YYYY.MM.DD"
195
+ onChange={handleChange}
196
+ />
197
+ <MonthPicker
198
+ {...args}
199
+ value={value["YYYY/MM/DD"]}
200
+ label="YYYY/MM/DD"
201
+ name="YYYY/MM/DD"
202
+ format="YYYY/MM/DD"
203
+ onChange={handleChange}
204
+ />
205
+ <MonthPicker
206
+ {...args}
207
+ value={value["MM/DD/YYYY"]}
208
+ label="MM/DD/YYYY"
209
+ name="MM/DD/YYYY"
210
+ format="MM/DD/YYYY"
211
+ onChange={handleChange}
212
+ />
213
+ <MonthPicker
214
+ {...args}
215
+ value={value["YYYY-MM-DD"]}
216
+ label="YYYY-MM-DD"
217
+ name="YYYY-MM-DD"
218
+ format="YYYY-MM-DD"
219
+ onChange={handleChange}
220
+ />
221
+ <MonthPicker
222
+ {...args}
223
+ value={value["DD/MM/YYYY"]}
224
+ label="DD/MM/YYYY"
225
+ name="DD/MM/YYYY"
226
+ format="DD/MM/YYYY"
227
+ onChange={handleChange}
228
+ />
229
+ <MonthPicker
230
+ {...args}
231
+ value={value["DD.MM.YYYY"]}
232
+ label="DD.MM.YYYY"
233
+ name="DD.MM.YYYY"
234
+ format="DD.MM.YYYY"
235
+ onChange={handleChange}
236
+ />
237
+ </Stack>
200
238
  ```
201
239
 
202
240
  ### Display Formats
@@ -205,43 +243,108 @@ The `displayFormat` prop controls what users see in the input field, independent
205
243
 
206
244
  ```tsx
207
245
  <Stack gap={2}>
208
- <MonthPicker {...args} value={value1} label="YYYY.MM" name="YYYY.MM" displayFormat="YYYY.MM" onChange={e => {
209
- setValue1(e.target.value);
210
- args.onChange?.(e);
211
- }} />
212
- <MonthPicker {...args} value={value2} label="YYYY/MM" name="YYYY/MM" displayFormat="YYYY/MM" onChange={e => {
213
- setValue2(e.target.value);
214
- args.onChange?.(e);
215
- }} />
216
- <MonthPicker {...args} value={value3} label="MM/YYYY" name="MM/YYYY" displayFormat="MM/YYYY" onChange={e => {
217
- setValue3(e.target.value);
218
- args.onChange?.(e);
219
- }} />
220
- <MonthPicker {...args} value={value4} label="YYYY-MM" name="YYYY-MM" displayFormat="YYYY-MM" onChange={e => {
221
- setValue4(e.target.value);
222
- args.onChange?.(e);
223
- }} />
224
- <MonthPicker {...args} value={value5} label="YYYY-MM-DD" name="YYYY-MM-DD" displayFormat="YYYY-MM-DD" onChange={e => {
225
- setValue5(e.target.value);
226
- args.onChange?.(e);
227
- }} />
228
- <MonthPicker {...args} value={value6} label="MMMM YYYY" name="MMMM YYYY" displayFormat="MMMM YYYY" onChange={e => {
229
- setValue6(e.target.value);
230
- args.onChange?.(e);
231
- }} />
232
- <MonthPicker {...args} value={value6} label="MMM YYYY" name="MMM YYYY" displayFormat="MMM YYYY" onChange={e => {
233
- setValue6(e.target.value);
234
- args.onChange?.(e);
235
- }} />
236
- <MonthPicker {...args} value={value6} label="MMM YYYY (en-US)" name="MMM YYYY (en-US)" displayFormat="MMM YYYY" locale="en-US" onChange={e => {
237
- setValue6(e.target.value);
238
- args.onChange?.(e);
239
- }} />
240
- <MonthPicker {...args} value={value6} label="MMM YYYY (ko-KR)" name="MMM YYYY (ko-KR)" displayFormat="MMM YYYY" locale="ko-KR" onChange={e => {
241
- setValue6(e.target.value);
242
- args.onChange?.(e);
243
- }} />
244
- </Stack>
246
+ <MonthPicker
247
+ {...args}
248
+ value={value1}
249
+ label="YYYY.MM"
250
+ name="YYYY.MM"
251
+ displayFormat="YYYY.MM"
252
+ onChange={(e) => {
253
+ setValue1(e.target.value);
254
+ args.onChange?.(e);
255
+ }}
256
+ />
257
+ <MonthPicker
258
+ {...args}
259
+ value={value2}
260
+ label="YYYY/MM"
261
+ name="YYYY/MM"
262
+ displayFormat="YYYY/MM"
263
+ onChange={(e) => {
264
+ setValue2(e.target.value);
265
+ args.onChange?.(e);
266
+ }}
267
+ />
268
+ <MonthPicker
269
+ {...args}
270
+ value={value3}
271
+ label="MM/YYYY"
272
+ name="MM/YYYY"
273
+ displayFormat="MM/YYYY"
274
+ onChange={(e) => {
275
+ setValue3(e.target.value);
276
+ args.onChange?.(e);
277
+ }}
278
+ />
279
+ <MonthPicker
280
+ {...args}
281
+ value={value4}
282
+ label="YYYY-MM"
283
+ name="YYYY-MM"
284
+ displayFormat="YYYY-MM"
285
+ onChange={(e) => {
286
+ setValue4(e.target.value);
287
+ args.onChange?.(e);
288
+ }}
289
+ />
290
+ <MonthPicker
291
+ {...args}
292
+ value={value5}
293
+ label="YYYY-MM-DD"
294
+ name="YYYY-MM-DD"
295
+ displayFormat="YYYY-MM-DD"
296
+ onChange={(e) => {
297
+ setValue5(e.target.value);
298
+ args.onChange?.(e);
299
+ }}
300
+ />
301
+ <MonthPicker
302
+ {...args}
303
+ value={value6}
304
+ label="MMMM YYYY"
305
+ name="MMMM YYYY"
306
+ displayFormat="MMMM YYYY"
307
+ onChange={(e) => {
308
+ setValue6(e.target.value);
309
+ args.onChange?.(e);
310
+ }}
311
+ />
312
+ <MonthPicker
313
+ {...args}
314
+ value={value6}
315
+ label="MMM YYYY"
316
+ name="MMM YYYY"
317
+ displayFormat="MMM YYYY"
318
+ onChange={(e) => {
319
+ setValue6(e.target.value);
320
+ args.onChange?.(e);
321
+ }}
322
+ />
323
+ <MonthPicker
324
+ {...args}
325
+ value={value6}
326
+ label="MMM YYYY (en-US)"
327
+ name="MMM YYYY (en-US)"
328
+ displayFormat="MMM YYYY"
329
+ locale="en-US"
330
+ onChange={(e) => {
331
+ setValue6(e.target.value);
332
+ args.onChange?.(e);
333
+ }}
334
+ />
335
+ <MonthPicker
336
+ {...args}
337
+ value={value6}
338
+ label="MMM YYYY (ko-KR)"
339
+ name="MMM YYYY (ko-KR)"
340
+ displayFormat="MMM YYYY"
341
+ locale="ko-KR"
342
+ onChange={(e) => {
343
+ setValue6(e.target.value);
344
+ args.onChange?.(e);
345
+ }}
346
+ />
347
+ </Stack>
245
348
  ```
246
349
 
247
350
  ### With Reset Button
@@ -249,15 +352,21 @@ The `displayFormat` prop controls what users see in the input field, independent
249
352
  A controlled example with an external reset button to clear the selected value.
250
353
 
251
354
  ```tsx
252
- <div style={{
253
- display: 'flex',
254
- gap: '10px'
255
- }}>
256
- <MonthPicker {...props} value={value} onChange={event => {
257
- setValue(event.target.value);
258
- }} />
259
- <Button onClick={() => setValue('')}>Reset</Button>
260
- </div>
355
+ <div
356
+ style={{
357
+ display: "flex",
358
+ gap: "10px"
359
+ }}
360
+ >
361
+ <MonthPicker
362
+ {...props}
363
+ value={value}
364
+ onChange={(event) => {
365
+ setValue(event.target.value);
366
+ }}
367
+ />
368
+ <Button onClick={() => setValue("")}>Reset</Button>
369
+ </div>
261
370
  ```
262
371
 
263
372
  ## Billing Period Selection
@@ -335,21 +444,14 @@ function CreditCardExpiry() {
335
444
 
336
445
  ```tsx
337
446
  // ✅ Good: Separate concerns
338
- <MonthPicker
339
- format="YYYY/MM/DD"
340
- displayFormat="MMMM YYYY"
341
- />
447
+ <MonthPicker format="YYYY/MM/DD" displayFormat="MMMM YYYY" />
342
448
  ```
343
449
 
344
450
  3. **Provide context with `helperText`**: Guide users on what they are selecting, especially when constraints are applied.
345
451
 
346
452
  ```tsx
347
453
  // ✅ Good: Clear guidance
348
- <MonthPicker
349
- label="Statement Month"
350
- helperText="Select the month for your account statement"
351
- disableFuture
352
- />
454
+ <MonthPicker label="Statement Month" helperText="Select the month for your account statement" disableFuture />
353
455
  ```
354
456
 
355
457
  4. **Set reasonable date constraints**: Use `minDate`, `maxDate`, `disableFuture`, or `disablePast` to prevent invalid selections at the UI level.