@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
@@ -6,23 +6,23 @@ The Modal component is a dialog overlay that appears on top of the main content,
6
6
 
7
7
  ```tsx
8
8
  <>
9
- <Button onClick={() => setOpen(true)}>Open Modal</Button>
10
- <Modal open={open} onClose={() => setOpen(false)}>
11
- <ModalDialog>
12
- <ModalClose />
13
- <DialogTitle>Modal Title</DialogTitle>
14
- <DialogContent>This is the modal content. You can place any content here.</DialogContent>
15
- <DialogActions>
16
- <Button variant="solid" onClick={() => setOpen(false)}>
17
- Confirm
18
- </Button>
19
- <Button variant="plain" color="neutral" onClick={() => setOpen(false)}>
20
- Cancel
21
- </Button>
22
- </DialogActions>
23
- </ModalDialog>
24
- </Modal>
25
- </>
9
+ <Button onClick={() => setOpen(true)}>Open Modal</Button>
10
+ <Modal open={open} onClose={() => setOpen(false)}>
11
+ <ModalDialog>
12
+ <ModalClose />
13
+ <DialogTitle>Modal Title</DialogTitle>
14
+ <DialogContent>This is the modal content. You can place any content here.</DialogContent>
15
+ <DialogActions>
16
+ <Button variant="solid" onClick={() => setOpen(false)}>
17
+ Confirm
18
+ </Button>
19
+ <Button variant="plain" color="neutral" onClick={() => setOpen(false)}>
20
+ Cancel
21
+ </Button>
22
+ </DialogActions>
23
+ </ModalDialog>
24
+ </Modal>
25
+ </>
26
26
  ```
27
27
 
28
28
  | Field | Description | Default |
@@ -94,31 +94,50 @@ The basic modal with a simple Sheet for custom layouts.
94
94
 
95
95
  ```tsx
96
96
  <>
97
- <Button onClick={() => setOpen(true)}>Open Basic Modal</Button>
98
- <Modal aria-labelledby="modal-title" aria-describedby="modal-desc" open={open} onClose={() => setOpen(false)} sx={{
99
- display: 'flex',
100
- justifyContent: 'center',
101
- alignItems: 'center'
102
- }}>
103
- <Sheet variant="outlined" sx={{
104
- maxWidth: 500,
105
- borderRadius: 'md',
106
- p: 3,
107
- boxShadow: 'lg'
108
- }}>
109
- <ModalClose variant="plain" sx={{
110
- m: 1
111
- }} />
112
- <Typography component="h2" id="modal-title" level="h4" textColor="inherit" fontWeight="lg" mb={2}>
113
- This is the modal title
114
- </Typography>
115
- <Typography id="modal-desc" textColor="text.tertiary">
116
- Make sure to use <code>aria-labelledby</code> on the modal dialog with an optional{' '}
117
- <code>aria-describedby</code> attribute.
118
- </Typography>
119
- </Sheet>
120
- </Modal>
121
- </>
97
+ <Button onClick={() => setOpen(true)}>Open Basic Modal</Button>
98
+ <Modal
99
+ aria-labelledby="modal-title"
100
+ aria-describedby="modal-desc"
101
+ open={open}
102
+ onClose={() => setOpen(false)}
103
+ sx={{
104
+ display: "flex",
105
+ justifyContent: "center",
106
+ alignItems: "center"
107
+ }}
108
+ >
109
+ <Sheet
110
+ variant="outlined"
111
+ sx={{
112
+ maxWidth: 500,
113
+ borderRadius: "md",
114
+ p: 3,
115
+ boxShadow: "lg"
116
+ }}
117
+ >
118
+ <ModalClose
119
+ variant="plain"
120
+ sx={{
121
+ m: 1
122
+ }}
123
+ />
124
+ <Typography
125
+ component="h2"
126
+ id="modal-title"
127
+ level="h4"
128
+ textColor="inherit"
129
+ fontWeight="lg"
130
+ mb={2}
131
+ >
132
+ This is the modal title
133
+ </Typography>
134
+ <Typography id="modal-desc" textColor="text.tertiary">
135
+ Make sure to use <code>aria-labelledby</code> on the modal dialog with an optional{" "}
136
+ <code>aria-describedby</code> attribute.
137
+ </Typography>
138
+ </Sheet>
139
+ </Modal>
140
+ </>
122
141
  ```
123
142
 
124
143
  ### Modal Dialog
@@ -127,33 +146,35 @@ Use ModalDialog for structured dialogs with title, content, and actions.
127
146
 
128
147
  ```tsx
129
148
  <>
130
- <Button onClick={() => setOpen(true)}>Open Form Modal</Button>
131
- <Modal open={open} onClose={() => setOpen(false)}>
132
- <ModalDialog>
133
- <ModalClose />
134
- <DialogTitle>Create new project</DialogTitle>
135
- <DialogContent>
136
- Fill in the information of the project.
137
- <form onSubmit={(event: React.FormEvent<HTMLFormElement>) => {
138
- event.preventDefault();
139
- setOpen(false);
140
- }}>
141
- <Stack spacing={4}>
142
- <FormControl>
143
- <FormLabel>Name</FormLabel>
144
- <Input required />
145
- </FormControl>
146
- <FormControl>
147
- <FormLabel>Description</FormLabel>
148
- <Input required />
149
- </FormControl>
150
- <Button type="submit">Submit</Button>
151
- </Stack>
152
- </form>
153
- </DialogContent>
154
- </ModalDialog>
155
- </Modal>
156
- </>
149
+ <Button onClick={() => setOpen(true)}>Open Form Modal</Button>
150
+ <Modal open={open} onClose={() => setOpen(false)}>
151
+ <ModalDialog>
152
+ <ModalClose />
153
+ <DialogTitle>Create new project</DialogTitle>
154
+ <DialogContent>
155
+ Fill in the information of the project.
156
+ <form
157
+ onSubmit={(event: React.FormEvent<HTMLFormElement>) => {
158
+ event.preventDefault();
159
+ setOpen(false);
160
+ }}
161
+ >
162
+ <Stack spacing={4}>
163
+ <FormControl>
164
+ <FormLabel>Name</FormLabel>
165
+ <Input required />
166
+ </FormControl>
167
+ <FormControl>
168
+ <FormLabel>Description</FormLabel>
169
+ <Input required />
170
+ </FormControl>
171
+ <Button type="submit">Submit</Button>
172
+ </Stack>
173
+ </form>
174
+ </DialogContent>
175
+ </ModalDialog>
176
+ </Modal>
177
+ </>
157
178
  ```
158
179
 
159
180
  ### Variants
@@ -164,60 +185,60 @@ Modal dialogs support different visual variants.
164
185
 
165
186
  ```tsx
166
187
  <>
167
- <Button onClick={() => setOpen(true)}>Plain Variant</Button>
168
- <Modal open={open} onClose={() => setOpen(false)}>
169
- <ModalDialog variant="plain">
170
- <ModalClose />
171
- <DialogTitle>Modal Dialog</DialogTitle>
172
- <DialogContent>This is a `plain` modal dialog.</DialogContent>
173
- </ModalDialog>
174
- </Modal>
175
- </>
188
+ <Button onClick={() => setOpen(true)}>Plain Variant</Button>
189
+ <Modal open={open} onClose={() => setOpen(false)}>
190
+ <ModalDialog variant="plain">
191
+ <ModalClose />
192
+ <DialogTitle>Modal Dialog</DialogTitle>
193
+ <DialogContent>This is a `plain` modal dialog.</DialogContent>
194
+ </ModalDialog>
195
+ </Modal>
196
+ </>
176
197
  ```
177
198
 
178
199
  #### Outlined Variant
179
200
 
180
201
  ```tsx
181
202
  <>
182
- <Button onClick={() => setOpen(true)}>Outlined Variant</Button>
183
- <Modal open={open} onClose={() => setOpen(false)}>
184
- <ModalDialog variant="outlined">
185
- <ModalClose />
186
- <DialogTitle>Modal Dialog</DialogTitle>
187
- <DialogContent>This is an `outlined` modal dialog.</DialogContent>
188
- </ModalDialog>
189
- </Modal>
190
- </>
203
+ <Button onClick={() => setOpen(true)}>Outlined Variant</Button>
204
+ <Modal open={open} onClose={() => setOpen(false)}>
205
+ <ModalDialog variant="outlined">
206
+ <ModalClose />
207
+ <DialogTitle>Modal Dialog</DialogTitle>
208
+ <DialogContent>This is an `outlined` modal dialog.</DialogContent>
209
+ </ModalDialog>
210
+ </Modal>
211
+ </>
191
212
  ```
192
213
 
193
214
  #### Soft Variant
194
215
 
195
216
  ```tsx
196
217
  <>
197
- <Button onClick={() => setOpen(true)}>Soft Variant</Button>
198
- <Modal open={open} onClose={() => setOpen(false)}>
199
- <ModalDialog variant="soft">
200
- <ModalClose />
201
- <DialogTitle>Modal Dialog</DialogTitle>
202
- <DialogContent>This is a `soft` modal dialog.</DialogContent>
203
- </ModalDialog>
204
- </Modal>
205
- </>
218
+ <Button onClick={() => setOpen(true)}>Soft Variant</Button>
219
+ <Modal open={open} onClose={() => setOpen(false)}>
220
+ <ModalDialog variant="soft">
221
+ <ModalClose />
222
+ <DialogTitle>Modal Dialog</DialogTitle>
223
+ <DialogContent>This is a `soft` modal dialog.</DialogContent>
224
+ </ModalDialog>
225
+ </Modal>
226
+ </>
206
227
  ```
207
228
 
208
229
  #### Solid Variant
209
230
 
210
231
  ```tsx
211
232
  <>
212
- <Button onClick={() => setOpen(true)}>Solid Variant</Button>
213
- <Modal open={open} onClose={() => setOpen(false)}>
214
- <ModalDialog variant="solid">
215
- <ModalClose />
216
- <DialogTitle>Modal Dialog</DialogTitle>
217
- <DialogContent>This is a `solid` modal dialog.</DialogContent>
218
- </ModalDialog>
219
- </Modal>
220
- </>
233
+ <Button onClick={() => setOpen(true)}>Solid Variant</Button>
234
+ <Modal open={open} onClose={() => setOpen(false)}>
235
+ <ModalDialog variant="solid">
236
+ <ModalClose />
237
+ <DialogTitle>Modal Dialog</DialogTitle>
238
+ <DialogContent>This is a `solid` modal dialog.</DialogContent>
239
+ </ModalDialog>
240
+ </Modal>
241
+ </>
221
242
  ```
222
243
 
223
244
  ### Alert Dialog
@@ -226,28 +247,28 @@ For critical confirmations that require explicit user decision.
226
247
 
227
248
  ```tsx
228
249
  <>
229
- <Button color="danger" onClick={() => setOpen(true)}>
230
- Delete Item
231
- </Button>
232
- <Modal open={open} onClose={() => setOpen(false)}>
233
- <ModalDialog variant="outlined" role="alertdialog">
234
- <DialogTitle>
235
- <WarningRoundedIcon />
236
- Confirmation
237
- </DialogTitle>
238
- <Divider />
239
- <DialogContent>Are you sure you want to discard all of your notes?</DialogContent>
240
- <DialogActions>
241
- <Button variant="solid" color="danger" onClick={() => setOpen(false)}>
242
- Discard notes
243
- </Button>
244
- <Button variant="plain" color="neutral" onClick={() => setOpen(false)}>
245
- Cancel
246
- </Button>
247
- </DialogActions>
248
- </ModalDialog>
249
- </Modal>
250
- </>
250
+ <Button color="danger" onClick={() => setOpen(true)}>
251
+ Delete Item
252
+ </Button>
253
+ <Modal open={open} onClose={() => setOpen(false)}>
254
+ <ModalDialog variant="outlined" role="alertdialog">
255
+ <DialogTitle>
256
+ <WarningRoundedIcon />
257
+ Confirmation
258
+ </DialogTitle>
259
+ <Divider />
260
+ <DialogContent>Are you sure you want to discard all of your notes?</DialogContent>
261
+ <DialogActions>
262
+ <Button variant="solid" color="danger" onClick={() => setOpen(false)}>
263
+ Discard notes
264
+ </Button>
265
+ <Button variant="plain" color="neutral" onClick={() => setOpen(false)}>
266
+ Cancel
267
+ </Button>
268
+ </DialogActions>
269
+ </ModalDialog>
270
+ </Modal>
271
+ </>
251
272
  ```
252
273
 
253
274
  ### Layouts
@@ -258,20 +279,20 @@ For complex content that requires maximum screen space.
258
279
 
259
280
  ```tsx
260
281
  <>
261
- <Button onClick={() => setOpen(true)}>Open Fullscreen Modal</Button>
262
- <Modal open={open} onClose={() => setOpen(false)}>
263
- <ModalDialog layout="fullscreen">
264
- <ModalClose />
265
- <DialogTitle>Fullscreen Modal</DialogTitle>
266
- <DialogContent>This modal takes up the entire screen.</DialogContent>
267
- <DialogActions>
268
- <Button variant="solid" onClick={() => setOpen(false)}>
269
- Save
270
- </Button>
271
- </DialogActions>
272
- </ModalDialog>
273
- </Modal>
274
- </>
282
+ <Button onClick={() => setOpen(true)}>Open Fullscreen Modal</Button>
283
+ <Modal open={open} onClose={() => setOpen(false)}>
284
+ <ModalDialog layout="fullscreen">
285
+ <ModalClose />
286
+ <DialogTitle>Fullscreen Modal</DialogTitle>
287
+ <DialogContent>This modal takes up the entire screen.</DialogContent>
288
+ <DialogActions>
289
+ <Button variant="solid" onClick={() => setOpen(false)}>
290
+ Save
291
+ </Button>
292
+ </DialogActions>
293
+ </ModalDialog>
294
+ </Modal>
295
+ </>
275
296
  ```
276
297
 
277
298
  ### Nested Modals
@@ -280,28 +301,30 @@ Modals can be stacked on top of each other when necessary.
280
301
 
281
302
  ```tsx
282
303
  <>
283
- <Button onClick={() => setFirstOpen(true)}>Open First Modal</Button>
284
- <Modal open={firstOpen} onClose={() => setFirstOpen(false)}>
285
- <ModalDialog>
286
- <ModalClose />
287
- <DialogTitle>First Modal</DialogTitle>
288
- <DialogContent>This is the first modal. Click the button below to open a nested modal.</DialogContent>
289
- <DialogActions>
290
- <Button onClick={() => setSecondOpen(true)}>Open Nested Modal</Button>
291
- </DialogActions>
292
- </ModalDialog>
293
- </Modal>
294
- <Modal open={secondOpen} onClose={() => setSecondOpen(false)}>
295
- <ModalDialog>
296
- <ModalClose />
297
- <DialogTitle>Nested Modal</DialogTitle>
298
- <DialogContent>This is a nested modal on top of the first one.</DialogContent>
299
- <DialogActions>
300
- <Button onClick={() => setSecondOpen(false)}>Close</Button>
301
- </DialogActions>
302
- </ModalDialog>
303
- </Modal>
304
- </>
304
+ <Button onClick={() => setFirstOpen(true)}>Open First Modal</Button>
305
+ <Modal open={firstOpen} onClose={() => setFirstOpen(false)}>
306
+ <ModalDialog>
307
+ <ModalClose />
308
+ <DialogTitle>First Modal</DialogTitle>
309
+ <DialogContent>
310
+ This is the first modal. Click the button below to open a nested modal.
311
+ </DialogContent>
312
+ <DialogActions>
313
+ <Button onClick={() => setSecondOpen(true)}>Open Nested Modal</Button>
314
+ </DialogActions>
315
+ </ModalDialog>
316
+ </Modal>
317
+ <Modal open={secondOpen} onClose={() => setSecondOpen(false)}>
318
+ <ModalDialog>
319
+ <ModalClose />
320
+ <DialogTitle>Nested Modal</DialogTitle>
321
+ <DialogContent>This is a nested modal on top of the first one.</DialogContent>
322
+ <DialogActions>
323
+ <Button onClick={() => setSecondOpen(false)}>Close</Button>
324
+ </DialogActions>
325
+ </ModalDialog>
326
+ </Modal>
327
+ </>
305
328
  ```
306
329
 
307
330
  ### ModalFrame
@@ -312,16 +335,16 @@ ModalFrame is a convenience component that automatically provides a title, close
312
335
 
313
336
  ```tsx
314
337
  <>
315
- <Button onClick={() => setOpen(true)}>Open ModalFrame</Button>
316
- <Modal open={open} onClose={() => setOpen(false)}>
317
- <ModalFrame title="ModalFrame Title" onClose={() => setOpen(false)}>
318
- <Typography>
319
- ModalFrame automatically composes ModalDialog, ModalClose, DialogTitle, and DialogContent. You only need
320
- to provide a title, onClose handler, and children.
321
- </Typography>
322
- </ModalFrame>
323
- </Modal>
324
- </>
338
+ <Button onClick={() => setOpen(true)}>Open ModalFrame</Button>
339
+ <Modal open={open} onClose={() => setOpen(false)}>
340
+ <ModalFrame title="ModalFrame Title" onClose={() => setOpen(false)}>
341
+ <Typography>
342
+ ModalFrame automatically composes ModalDialog, ModalClose, DialogTitle, and DialogContent.
343
+ You only need to provide a title, onClose handler, and children.
344
+ </Typography>
345
+ </ModalFrame>
346
+ </Modal>
347
+ </>
325
348
  ```
326
349
 
327
350
  #### titleStartDecorator
@@ -330,15 +353,20 @@ Display an icon or decorative element before the title.
330
353
 
331
354
  ```tsx
332
355
  <>
333
- <Button onClick={() => setOpen(true)}>With Decorator</Button>
334
- <Modal open={open} onClose={() => setOpen(false)}>
335
- <ModalFrame title="Details" titleStartDecorator={<InfoOutlinedIcon />} onClose={() => setOpen(false)}>
336
- <Typography>
337
- Use the <code>titleStartDecorator</code> prop to display an icon or element before the title.
338
- </Typography>
339
- </ModalFrame>
340
- </Modal>
341
- </>
356
+ <Button onClick={() => setOpen(true)}>With Decorator</Button>
357
+ <Modal open={open} onClose={() => setOpen(false)}>
358
+ <ModalFrame
359
+ title="Details"
360
+ titleStartDecorator={<InfoOutlinedIcon />}
361
+ onClose={() => setOpen(false)}
362
+ >
363
+ <Typography>
364
+ Use the <code>titleStartDecorator</code> prop to display an icon or element before the
365
+ title.
366
+ </Typography>
367
+ </ModalFrame>
368
+ </Modal>
369
+ </>
342
370
  ```
343
371
 
344
372
  #### Form Content
@@ -347,28 +375,30 @@ An inline form pattern where the submit button lives inside the content area.
347
375
 
348
376
  ```tsx
349
377
  <>
350
- <Button onClick={() => setOpen(true)}>Form in ModalFrame</Button>
351
- <Modal open={open} onClose={() => setOpen(false)}>
352
- <ModalFrame title="Create Project" onClose={() => setOpen(false)}>
353
- <form onSubmit={(event: React.FormEvent<HTMLFormElement>) => {
354
- event.preventDefault();
355
- setOpen(false);
356
- }}>
357
- <Stack spacing={2}>
358
- <FormControl>
359
- <FormLabel>Name</FormLabel>
360
- <Input required />
361
- </FormControl>
362
- <FormControl>
363
- <FormLabel>Description</FormLabel>
364
- <Input required />
365
- </FormControl>
366
- <Button type="submit">Submit</Button>
367
- </Stack>
368
- </form>
369
- </ModalFrame>
370
- </Modal>
371
- </>
378
+ <Button onClick={() => setOpen(true)}>Form in ModalFrame</Button>
379
+ <Modal open={open} onClose={() => setOpen(false)}>
380
+ <ModalFrame title="Create Project" onClose={() => setOpen(false)}>
381
+ <form
382
+ onSubmit={(event: React.FormEvent<HTMLFormElement>) => {
383
+ event.preventDefault();
384
+ setOpen(false);
385
+ }}
386
+ >
387
+ <Stack spacing={2}>
388
+ <FormControl>
389
+ <FormLabel>Name</FormLabel>
390
+ <Input required />
391
+ </FormControl>
392
+ <FormControl>
393
+ <FormLabel>Description</FormLabel>
394
+ <Input required />
395
+ </FormControl>
396
+ <Button type="submit">Submit</Button>
397
+ </Stack>
398
+ </form>
399
+ </ModalFrame>
400
+ </Modal>
401
+ </>
372
402
  ```
373
403
 
374
404
  #### Sizes
@@ -377,31 +407,31 @@ Compare sm / md / lg sizes side by side.
377
407
 
378
408
  ```tsx
379
409
  <Stack direction="row" spacing={2}>
380
- <Button size="sm" onClick={() => setOpenSm(true)}>
381
- Small
382
- </Button>
383
- <Button size="md" onClick={() => setOpenMd(true)}>
384
- Medium
385
- </Button>
386
- <Button size="lg" onClick={() => setOpenLg(true)}>
387
- Large
388
- </Button>
389
- <Modal open={openSm} onClose={() => setOpenSm(false)}>
390
- <ModalFrame title="Small ModalFrame" size="sm" onClose={() => setOpenSm(false)}>
391
- <Typography>This is a small ModalFrame.</Typography>
392
- </ModalFrame>
393
- </Modal>
394
- <Modal open={openMd} onClose={() => setOpenMd(false)}>
395
- <ModalFrame title="Medium ModalFrame" size="md" onClose={() => setOpenMd(false)}>
396
- <Typography>This is a medium ModalFrame.</Typography>
397
- </ModalFrame>
398
- </Modal>
399
- <Modal open={openLg} onClose={() => setOpenLg(false)}>
400
- <ModalFrame title="Large ModalFrame" size="lg" onClose={() => setOpenLg(false)}>
401
- <Typography>This is a large ModalFrame.</Typography>
402
- </ModalFrame>
403
- </Modal>
404
- </Stack>
410
+ <Button size="sm" onClick={() => setOpenSm(true)}>
411
+ Small
412
+ </Button>
413
+ <Button size="md" onClick={() => setOpenMd(true)}>
414
+ Medium
415
+ </Button>
416
+ <Button size="lg" onClick={() => setOpenLg(true)}>
417
+ Large
418
+ </Button>
419
+ <Modal open={openSm} onClose={() => setOpenSm(false)}>
420
+ <ModalFrame title="Small ModalFrame" size="sm" onClose={() => setOpenSm(false)}>
421
+ <Typography>This is a small ModalFrame.</Typography>
422
+ </ModalFrame>
423
+ </Modal>
424
+ <Modal open={openMd} onClose={() => setOpenMd(false)}>
425
+ <ModalFrame title="Medium ModalFrame" size="md" onClose={() => setOpenMd(false)}>
426
+ <Typography>This is a medium ModalFrame.</Typography>
427
+ </ModalFrame>
428
+ </Modal>
429
+ <Modal open={openLg} onClose={() => setOpenLg(false)}>
430
+ <ModalFrame title="Large ModalFrame" size="lg" onClose={() => setOpenLg(false)}>
431
+ <Typography>This is a large ModalFrame.</Typography>
432
+ </ModalFrame>
433
+ </Modal>
434
+ </Stack>
405
435
  ```
406
436
 
407
437
  #### Custom Content
@@ -410,30 +440,30 @@ A layout example suited for displaying detailed information.
410
440
 
411
441
  ```tsx
412
442
  <>
413
- <Button onClick={() => setOpen(true)}>Custom Content</Button>
414
- <Modal open={open} onClose={() => setOpen(false)}>
415
- <ModalFrame title="Order Details" onClose={() => setOpen(false)}>
416
- <Stack spacing={2}>
417
- <Box>
418
- <Typography level="title-sm">Order ID</Typography>
419
- <Typography level="body-sm">ORD-2024-00123</Typography>
420
- </Box>
421
- <Divider />
422
- <Box>
423
- <Typography level="title-sm">Customer</Typography>
424
- <Typography level="body-sm">John Doe</Typography>
425
- </Box>
426
- <Divider />
427
- <Box>
428
- <Typography level="title-sm">Status</Typography>
429
- <Typography level="body-sm" color="success">
430
- Completed
431
- </Typography>
432
- </Box>
433
- </Stack>
434
- </ModalFrame>
435
- </Modal>
436
- </>
443
+ <Button onClick={() => setOpen(true)}>Custom Content</Button>
444
+ <Modal open={open} onClose={() => setOpen(false)}>
445
+ <ModalFrame title="Order Details" onClose={() => setOpen(false)}>
446
+ <Stack spacing={2}>
447
+ <Box>
448
+ <Typography level="title-sm">Order ID</Typography>
449
+ <Typography level="body-sm">ORD-2024-00123</Typography>
450
+ </Box>
451
+ <Divider />
452
+ <Box>
453
+ <Typography level="title-sm">Customer</Typography>
454
+ <Typography level="body-sm">John Doe</Typography>
455
+ </Box>
456
+ <Divider />
457
+ <Box>
458
+ <Typography level="title-sm">Status</Typography>
459
+ <Typography level="body-sm" color="success">
460
+ Completed
461
+ </Typography>
462
+ </Box>
463
+ </Stack>
464
+ </ModalFrame>
465
+ </Modal>
466
+ </>
437
467
  ```
438
468
 
439
469
  #### Standalone
@@ -450,17 +480,19 @@ ModalFrame can be used without a Modal wrapper for embedding dialog-style layout
450
480
  > ModalFrame inherits its dimensions from `ModalDialog`, which normally receives sizing from the Modal overlay. Without these constraints, the component will not render with correct dimensions.
451
481
 
452
482
  ```tsx
453
- <Box sx={{
454
- position: 'relative',
455
- width: 480,
456
- height: 300
457
- }}>
458
- <ModalFrame title="Standalone ModalFrame" onClose={() => console.log('close')}>
459
- <Typography>
460
- ModalFrame used without Modal. The parent container must provide explicit width and height.
461
- </Typography>
462
- </ModalFrame>
463
- </Box>
483
+ <Box
484
+ sx={{
485
+ position: "relative",
486
+ width: 480,
487
+ height: 300
488
+ }}
489
+ >
490
+ <ModalFrame title="Standalone ModalFrame" onClose={() => console.log("close")}>
491
+ <Typography>
492
+ ModalFrame used without Modal. The parent container must provide explicit width and height.
493
+ </Typography>
494
+ </ModalFrame>
495
+ </Box>
464
496
  ```
465
497
 
466
498
  ## When to Use