@ceed/ads 1.35.1 → 1.37.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 (122) hide show
  1. package/README.md +85 -95
  2. package/dist/components/Accordions/Accordions.d.ts +1 -0
  3. package/dist/components/Alert/Alert.d.ts +5 -5
  4. package/dist/components/Autocomplete/Autocomplete.d.ts +2 -2
  5. package/dist/components/Avatar/Avatar.d.ts +7 -17
  6. package/dist/components/Box/Box.d.ts +1 -0
  7. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +6 -5
  8. package/dist/components/Button/Button.d.ts +3 -2
  9. package/dist/components/Calendar/Calendar.d.ts +1 -0
  10. package/dist/components/Card/Card.d.ts +1 -0
  11. package/dist/components/Checkbox/Checkbox.d.ts +1 -0
  12. package/dist/components/Chip/Chip.d.ts +1 -0
  13. package/dist/components/Container/Container.d.ts +6 -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/Dropdown/Dropdown.d.ts +28 -1
  20. package/dist/components/FilterMenu/components/MonthRange.d.ts +11 -0
  21. package/dist/components/FilterMenu/types.d.ts +5 -1
  22. package/dist/components/FormControl/FormControl.d.ts +1 -0
  23. package/dist/components/FormHelperText/FormHelperText.d.ts +1 -0
  24. package/dist/components/FormLabel/FormLabel.d.ts +1 -0
  25. package/dist/components/Grid/Grid.d.ts +1 -0
  26. package/dist/components/IconButton/IconButton.d.ts +3 -2
  27. package/dist/components/IconMenuButton/IconMenuButton.d.ts +7 -6
  28. package/dist/components/InfoSign/InfoSign.d.ts +3 -2
  29. package/dist/components/Input/Input.d.ts +8 -22
  30. package/dist/components/InsetDrawer/InsetDrawer.d.ts +1 -0
  31. package/dist/components/Markdown/Markdown.d.ts +9 -24
  32. package/dist/components/Menu/Menu.d.ts +2 -1
  33. package/dist/components/MenuButton/MenuButton.d.ts +10 -8
  34. package/dist/components/Modal/Modal.d.ts +4 -2
  35. package/dist/components/NavigationGroup/NavigationGroup.d.ts +3 -2
  36. package/dist/components/NavigationItem/NavigationItem.d.ts +3 -2
  37. package/dist/components/Navigator/Navigator.d.ts +5 -4
  38. package/dist/components/Pagination/Pagination.d.ts +1 -1
  39. package/dist/components/ProfileMenu/ProfileMenu.d.ts +2 -2
  40. package/dist/components/Radio/Radio.d.ts +1 -0
  41. package/dist/components/RadioList/RadioList.d.ts +3 -2
  42. package/dist/components/Select/Select.d.ts +20 -10
  43. package/dist/components/Sheet/Sheet.d.ts +1 -0
  44. package/dist/components/Stack/Stack.d.ts +1 -0
  45. package/dist/components/Stepper/Stepper.d.ts +2 -1
  46. package/dist/components/Switch/Switch.d.ts +1 -0
  47. package/dist/components/Table/Table.d.ts +7 -5
  48. package/dist/components/Tabs/Tabs.d.ts +1 -0
  49. package/dist/components/Textarea/Textarea.d.ts +8 -20
  50. package/dist/components/ThemeProvider/ThemeProvider.d.ts +4 -2
  51. package/dist/components/Tooltip/Tooltip.d.ts +1 -0
  52. package/dist/components/Typography/Typography.d.ts +1 -0
  53. package/dist/components/Uploader/Uploader.d.ts +18 -17
  54. package/dist/components/data-display/Avatar.md +60 -72
  55. package/dist/components/data-display/Badge.md +197 -181
  56. package/dist/components/data-display/Chip.md +164 -142
  57. package/dist/components/data-display/DataTable.md +843 -338
  58. package/dist/components/data-display/InfoSign.md +1 -3
  59. package/dist/components/data-display/Markdown.md +93 -125
  60. package/dist/components/data-display/Table.md +1453 -1007
  61. package/dist/components/data-display/Typography.md +101 -104
  62. package/dist/components/feedback/Alert.md +80 -86
  63. package/dist/components/feedback/CircularProgress.md +32 -36
  64. package/dist/components/feedback/Dialog.md +25 -17
  65. package/dist/components/feedback/Modal.md +296 -265
  66. package/dist/components/feedback/Skeleton.md +125 -89
  67. package/dist/components/index.d.ts +60 -1
  68. package/dist/components/inputs/Autocomplete.md +191 -95
  69. package/dist/components/inputs/Button.md +83 -83
  70. package/dist/components/inputs/ButtonGroup.md +195 -185
  71. package/dist/components/inputs/Calendar.md +25 -28
  72. package/dist/components/inputs/Checkbox.md +11 -29
  73. package/dist/components/inputs/CurrencyInput.md +4 -4
  74. package/dist/components/inputs/DatePicker.md +229 -110
  75. package/dist/components/inputs/DateRangePicker.md +248 -137
  76. package/dist/components/inputs/FilterMenu.md +138 -8
  77. package/dist/components/inputs/FilterableCheckboxGroup.md +115 -55
  78. package/dist/components/inputs/FormControl.md +75 -69
  79. package/dist/components/inputs/IconButton.md +229 -205
  80. package/dist/components/inputs/Input.md +131 -98
  81. package/dist/components/inputs/MonthPicker.md +186 -84
  82. package/dist/components/inputs/MonthRangePicker.md +73 -49
  83. package/dist/components/inputs/PercentageInput.md +15 -31
  84. package/dist/components/inputs/RadioButton.md +320 -256
  85. package/dist/components/inputs/RadioList.md +66 -50
  86. package/dist/components/inputs/RadioTileGroup.md +287 -170
  87. package/dist/components/inputs/SearchBar.md +82 -60
  88. package/dist/components/inputs/Select.md +181 -115
  89. package/dist/components/inputs/Slider.md +153 -102
  90. package/dist/components/inputs/Switch.md +193 -138
  91. package/dist/components/inputs/Textarea.md +15 -20
  92. package/dist/components/inputs/Uploader/Uploader.md +68 -39
  93. package/dist/components/layout/Box.md +841 -662
  94. package/dist/components/layout/Container.md +3 -11
  95. package/dist/components/layout/Grid.md +480 -394
  96. package/dist/components/layout/Stack.md +739 -566
  97. package/dist/components/navigation/Breadcrumbs.md +182 -116
  98. package/dist/components/navigation/Dropdown.md +732 -391
  99. package/dist/components/navigation/IconMenuButton.md +14 -6
  100. package/dist/components/navigation/InsetDrawer.md +550 -378
  101. package/dist/components/navigation/Link.md +104 -94
  102. package/dist/components/navigation/Menu.md +623 -502
  103. package/dist/components/navigation/MenuButton.md +18 -10
  104. package/dist/components/navigation/NavigationGroup.md +19 -50
  105. package/dist/components/navigation/NavigationItem.md +6 -6
  106. package/dist/components/navigation/Navigator.md +26 -28
  107. package/dist/components/navigation/Pagination.md +86 -75
  108. package/dist/components/navigation/ProfileMenu.md +65 -43
  109. package/dist/components/navigation/Stepper.md +2 -12
  110. package/dist/components/navigation/Tabs.md +209 -183
  111. package/dist/components/surfaces/Accordions.md +89 -172
  112. package/dist/components/surfaces/Card.md +1094 -709
  113. package/dist/components/surfaces/Divider.md +562 -412
  114. package/dist/components/surfaces/Sheet.md +700 -518
  115. package/dist/guides/ThemeProvider.md +65 -40
  116. package/dist/index.browser.js +4 -4
  117. package/dist/index.browser.js.map +4 -4
  118. package/dist/index.cjs +1655 -1548
  119. package/dist/index.d.ts +1 -1
  120. package/dist/index.js +1314 -1199
  121. package/framer/index.js +1 -1
  122. 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 |
@@ -92,31 +92,50 @@ The basic modal with a simple Sheet for custom layouts.
92
92
 
93
93
  ```tsx
94
94
  <>
95
- <Button onClick={() => setOpen(true)}>Open Basic Modal</Button>
96
- <Modal aria-labelledby="modal-title" aria-describedby="modal-desc" open={open} onClose={() => setOpen(false)} sx={{
97
- display: 'flex',
98
- justifyContent: 'center',
99
- alignItems: 'center'
100
- }}>
101
- <Sheet variant="outlined" sx={{
102
- maxWidth: 500,
103
- borderRadius: 'md',
104
- p: 3,
105
- boxShadow: 'lg'
106
- }}>
107
- <ModalClose variant="plain" sx={{
108
- m: 1
109
- }} />
110
- <Typography component="h2" id="modal-title" level="h4" textColor="inherit" fontWeight="lg" mb={2}>
111
- This is the modal title
112
- </Typography>
113
- <Typography id="modal-desc" textColor="text.tertiary">
114
- Make sure to use <code>aria-labelledby</code> on the modal dialog with an optional{' '}
115
- <code>aria-describedby</code> attribute.
116
- </Typography>
117
- </Sheet>
118
- </Modal>
119
- </>
95
+ <Button onClick={() => setOpen(true)}>Open Basic Modal</Button>
96
+ <Modal
97
+ aria-labelledby="modal-title"
98
+ aria-describedby="modal-desc"
99
+ open={open}
100
+ onClose={() => setOpen(false)}
101
+ sx={{
102
+ display: "flex",
103
+ justifyContent: "center",
104
+ alignItems: "center"
105
+ }}
106
+ >
107
+ <Sheet
108
+ variant="outlined"
109
+ sx={{
110
+ maxWidth: 500,
111
+ borderRadius: "md",
112
+ p: 3,
113
+ boxShadow: "lg"
114
+ }}
115
+ >
116
+ <ModalClose
117
+ variant="plain"
118
+ sx={{
119
+ m: 1
120
+ }}
121
+ />
122
+ <Typography
123
+ component="h2"
124
+ id="modal-title"
125
+ level="h4"
126
+ textColor="inherit"
127
+ fontWeight="lg"
128
+ mb={2}
129
+ >
130
+ This is the modal title
131
+ </Typography>
132
+ <Typography id="modal-desc" textColor="text.tertiary">
133
+ Make sure to use <code>aria-labelledby</code> on the modal dialog with an optional{" "}
134
+ <code>aria-describedby</code> attribute.
135
+ </Typography>
136
+ </Sheet>
137
+ </Modal>
138
+ </>
120
139
  ```
121
140
 
122
141
  ## Modal Dialog
@@ -125,33 +144,35 @@ Use ModalDialog for structured dialogs with title, content, and actions.
125
144
 
126
145
  ```tsx
127
146
  <>
128
- <Button onClick={() => setOpen(true)}>Open Form Modal</Button>
129
- <Modal open={open} onClose={() => setOpen(false)}>
130
- <ModalDialog>
131
- <ModalClose />
132
- <DialogTitle>Create new project</DialogTitle>
133
- <DialogContent>
134
- Fill in the information of the project.
135
- <form onSubmit={(event: React.FormEvent<HTMLFormElement>) => {
136
- event.preventDefault();
137
- setOpen(false);
138
- }}>
139
- <Stack spacing={4}>
140
- <FormControl>
141
- <FormLabel>Name</FormLabel>
142
- <Input required />
143
- </FormControl>
144
- <FormControl>
145
- <FormLabel>Description</FormLabel>
146
- <Input required />
147
- </FormControl>
148
- <Button type="submit">Submit</Button>
149
- </Stack>
150
- </form>
151
- </DialogContent>
152
- </ModalDialog>
153
- </Modal>
154
- </>
147
+ <Button onClick={() => setOpen(true)}>Open Form Modal</Button>
148
+ <Modal open={open} onClose={() => setOpen(false)}>
149
+ <ModalDialog>
150
+ <ModalClose />
151
+ <DialogTitle>Create new project</DialogTitle>
152
+ <DialogContent>
153
+ Fill in the information of the project.
154
+ <form
155
+ onSubmit={(event: React.FormEvent<HTMLFormElement>) => {
156
+ event.preventDefault();
157
+ setOpen(false);
158
+ }}
159
+ >
160
+ <Stack spacing={4}>
161
+ <FormControl>
162
+ <FormLabel>Name</FormLabel>
163
+ <Input required />
164
+ </FormControl>
165
+ <FormControl>
166
+ <FormLabel>Description</FormLabel>
167
+ <Input required />
168
+ </FormControl>
169
+ <Button type="submit">Submit</Button>
170
+ </Stack>
171
+ </form>
172
+ </DialogContent>
173
+ </ModalDialog>
174
+ </Modal>
175
+ </>
155
176
  ```
156
177
 
157
178
  ## Modal Dialog Variants
@@ -162,60 +183,60 @@ Modal dialogs support different visual variants.
162
183
 
163
184
  ```tsx
164
185
  <>
165
- <Button onClick={() => setOpen(true)}>Plain Variant</Button>
166
- <Modal open={open} onClose={() => setOpen(false)}>
167
- <ModalDialog variant="plain">
168
- <ModalClose />
169
- <DialogTitle>Modal Dialog</DialogTitle>
170
- <DialogContent>This is a `plain` modal dialog.</DialogContent>
171
- </ModalDialog>
172
- </Modal>
173
- </>
186
+ <Button onClick={() => setOpen(true)}>Plain Variant</Button>
187
+ <Modal open={open} onClose={() => setOpen(false)}>
188
+ <ModalDialog variant="plain">
189
+ <ModalClose />
190
+ <DialogTitle>Modal Dialog</DialogTitle>
191
+ <DialogContent>This is a `plain` modal dialog.</DialogContent>
192
+ </ModalDialog>
193
+ </Modal>
194
+ </>
174
195
  ```
175
196
 
176
197
  #### Outlined Variant
177
198
 
178
199
  ```tsx
179
200
  <>
180
- <Button onClick={() => setOpen(true)}>Outlined Variant</Button>
181
- <Modal open={open} onClose={() => setOpen(false)}>
182
- <ModalDialog variant="outlined">
183
- <ModalClose />
184
- <DialogTitle>Modal Dialog</DialogTitle>
185
- <DialogContent>This is an `outlined` modal dialog.</DialogContent>
186
- </ModalDialog>
187
- </Modal>
188
- </>
201
+ <Button onClick={() => setOpen(true)}>Outlined Variant</Button>
202
+ <Modal open={open} onClose={() => setOpen(false)}>
203
+ <ModalDialog variant="outlined">
204
+ <ModalClose />
205
+ <DialogTitle>Modal Dialog</DialogTitle>
206
+ <DialogContent>This is an `outlined` modal dialog.</DialogContent>
207
+ </ModalDialog>
208
+ </Modal>
209
+ </>
189
210
  ```
190
211
 
191
212
  #### Soft Variant
192
213
 
193
214
  ```tsx
194
215
  <>
195
- <Button onClick={() => setOpen(true)}>Soft Variant</Button>
196
- <Modal open={open} onClose={() => setOpen(false)}>
197
- <ModalDialog variant="soft">
198
- <ModalClose />
199
- <DialogTitle>Modal Dialog</DialogTitle>
200
- <DialogContent>This is a `soft` modal dialog.</DialogContent>
201
- </ModalDialog>
202
- </Modal>
203
- </>
216
+ <Button onClick={() => setOpen(true)}>Soft Variant</Button>
217
+ <Modal open={open} onClose={() => setOpen(false)}>
218
+ <ModalDialog variant="soft">
219
+ <ModalClose />
220
+ <DialogTitle>Modal Dialog</DialogTitle>
221
+ <DialogContent>This is a `soft` modal dialog.</DialogContent>
222
+ </ModalDialog>
223
+ </Modal>
224
+ </>
204
225
  ```
205
226
 
206
227
  #### Solid Variant
207
228
 
208
229
  ```tsx
209
230
  <>
210
- <Button onClick={() => setOpen(true)}>Solid Variant</Button>
211
- <Modal open={open} onClose={() => setOpen(false)}>
212
- <ModalDialog variant="solid">
213
- <ModalClose />
214
- <DialogTitle>Modal Dialog</DialogTitle>
215
- <DialogContent>This is a `solid` modal dialog.</DialogContent>
216
- </ModalDialog>
217
- </Modal>
218
- </>
231
+ <Button onClick={() => setOpen(true)}>Solid Variant</Button>
232
+ <Modal open={open} onClose={() => setOpen(false)}>
233
+ <ModalDialog variant="solid">
234
+ <ModalClose />
235
+ <DialogTitle>Modal Dialog</DialogTitle>
236
+ <DialogContent>This is a `solid` modal dialog.</DialogContent>
237
+ </ModalDialog>
238
+ </Modal>
239
+ </>
219
240
  ```
220
241
 
221
242
  ## Alert Dialog
@@ -224,28 +245,28 @@ For critical confirmations that require explicit user decision.
224
245
 
225
246
  ```tsx
226
247
  <>
227
- <Button color="danger" onClick={() => setOpen(true)}>
228
- Delete Item
229
- </Button>
230
- <Modal open={open} onClose={() => setOpen(false)}>
231
- <ModalDialog variant="outlined" role="alertdialog">
232
- <DialogTitle>
233
- <WarningRoundedIcon />
234
- Confirmation
235
- </DialogTitle>
236
- <Divider />
237
- <DialogContent>Are you sure you want to discard all of your notes?</DialogContent>
238
- <DialogActions>
239
- <Button variant="solid" color="danger" onClick={() => setOpen(false)}>
240
- Discard notes
241
- </Button>
242
- <Button variant="plain" color="neutral" onClick={() => setOpen(false)}>
243
- Cancel
244
- </Button>
245
- </DialogActions>
246
- </ModalDialog>
247
- </Modal>
248
- </>
248
+ <Button color="danger" onClick={() => setOpen(true)}>
249
+ Delete Item
250
+ </Button>
251
+ <Modal open={open} onClose={() => setOpen(false)}>
252
+ <ModalDialog variant="outlined" role="alertdialog">
253
+ <DialogTitle>
254
+ <WarningRoundedIcon />
255
+ Confirmation
256
+ </DialogTitle>
257
+ <Divider />
258
+ <DialogContent>Are you sure you want to discard all of your notes?</DialogContent>
259
+ <DialogActions>
260
+ <Button variant="solid" color="danger" onClick={() => setOpen(false)}>
261
+ Discard notes
262
+ </Button>
263
+ <Button variant="plain" color="neutral" onClick={() => setOpen(false)}>
264
+ Cancel
265
+ </Button>
266
+ </DialogActions>
267
+ </ModalDialog>
268
+ </Modal>
269
+ </>
249
270
  ```
250
271
 
251
272
  ## Modal Layouts
@@ -256,20 +277,20 @@ For complex content that requires maximum screen space.
256
277
 
257
278
  ```tsx
258
279
  <>
259
- <Button onClick={() => setOpen(true)}>Open Fullscreen Modal</Button>
260
- <Modal open={open} onClose={() => setOpen(false)}>
261
- <ModalDialog layout="fullscreen">
262
- <ModalClose />
263
- <DialogTitle>Fullscreen Modal</DialogTitle>
264
- <DialogContent>This modal takes up the entire screen.</DialogContent>
265
- <DialogActions>
266
- <Button variant="solid" onClick={() => setOpen(false)}>
267
- Save
268
- </Button>
269
- </DialogActions>
270
- </ModalDialog>
271
- </Modal>
272
- </>
280
+ <Button onClick={() => setOpen(true)}>Open Fullscreen Modal</Button>
281
+ <Modal open={open} onClose={() => setOpen(false)}>
282
+ <ModalDialog layout="fullscreen">
283
+ <ModalClose />
284
+ <DialogTitle>Fullscreen Modal</DialogTitle>
285
+ <DialogContent>This modal takes up the entire screen.</DialogContent>
286
+ <DialogActions>
287
+ <Button variant="solid" onClick={() => setOpen(false)}>
288
+ Save
289
+ </Button>
290
+ </DialogActions>
291
+ </ModalDialog>
292
+ </Modal>
293
+ </>
273
294
  ```
274
295
 
275
296
  ## Nested Modals
@@ -278,28 +299,30 @@ Modals can be stacked on top of each other when necessary.
278
299
 
279
300
  ```tsx
280
301
  <>
281
- <Button onClick={() => setFirstOpen(true)}>Open First Modal</Button>
282
- <Modal open={firstOpen} onClose={() => setFirstOpen(false)}>
283
- <ModalDialog>
284
- <ModalClose />
285
- <DialogTitle>First Modal</DialogTitle>
286
- <DialogContent>This is the first modal. Click the button below to open a nested modal.</DialogContent>
287
- <DialogActions>
288
- <Button onClick={() => setSecondOpen(true)}>Open Nested Modal</Button>
289
- </DialogActions>
290
- </ModalDialog>
291
- </Modal>
292
- <Modal open={secondOpen} onClose={() => setSecondOpen(false)}>
293
- <ModalDialog>
294
- <ModalClose />
295
- <DialogTitle>Nested Modal</DialogTitle>
296
- <DialogContent>This is a nested modal on top of the first one.</DialogContent>
297
- <DialogActions>
298
- <Button onClick={() => setSecondOpen(false)}>Close</Button>
299
- </DialogActions>
300
- </ModalDialog>
301
- </Modal>
302
- </>
302
+ <Button onClick={() => setFirstOpen(true)}>Open First Modal</Button>
303
+ <Modal open={firstOpen} onClose={() => setFirstOpen(false)}>
304
+ <ModalDialog>
305
+ <ModalClose />
306
+ <DialogTitle>First Modal</DialogTitle>
307
+ <DialogContent>
308
+ This is the first modal. Click the button below to open a nested modal.
309
+ </DialogContent>
310
+ <DialogActions>
311
+ <Button onClick={() => setSecondOpen(true)}>Open Nested Modal</Button>
312
+ </DialogActions>
313
+ </ModalDialog>
314
+ </Modal>
315
+ <Modal open={secondOpen} onClose={() => setSecondOpen(false)}>
316
+ <ModalDialog>
317
+ <ModalClose />
318
+ <DialogTitle>Nested Modal</DialogTitle>
319
+ <DialogContent>This is a nested modal on top of the first one.</DialogContent>
320
+ <DialogActions>
321
+ <Button onClick={() => setSecondOpen(false)}>Close</Button>
322
+ </DialogActions>
323
+ </ModalDialog>
324
+ </Modal>
325
+ </>
303
326
  ```
304
327
 
305
328
  ## ModalFrame Examples
@@ -310,16 +333,16 @@ ModalFrame is a convenience component that automatically provides a title, close
310
333
 
311
334
  ```tsx
312
335
  <>
313
- <Button onClick={() => setOpen(true)}>Open ModalFrame</Button>
314
- <Modal open={open} onClose={() => setOpen(false)}>
315
- <ModalFrame title="ModalFrame Title" onClose={() => setOpen(false)}>
316
- <Typography>
317
- ModalFrame automatically composes ModalDialog, ModalClose, DialogTitle, and DialogContent. You only need
318
- to provide a title, onClose handler, and children.
319
- </Typography>
320
- </ModalFrame>
321
- </Modal>
322
- </>
336
+ <Button onClick={() => setOpen(true)}>Open ModalFrame</Button>
337
+ <Modal open={open} onClose={() => setOpen(false)}>
338
+ <ModalFrame title="ModalFrame Title" onClose={() => setOpen(false)}>
339
+ <Typography>
340
+ ModalFrame automatically composes ModalDialog, ModalClose, DialogTitle, and DialogContent.
341
+ You only need to provide a title, onClose handler, and children.
342
+ </Typography>
343
+ </ModalFrame>
344
+ </Modal>
345
+ </>
323
346
  ```
324
347
 
325
348
  #### titleStartDecorator
@@ -328,15 +351,20 @@ Display an icon or decorative element before the title.
328
351
 
329
352
  ```tsx
330
353
  <>
331
- <Button onClick={() => setOpen(true)}>With Decorator</Button>
332
- <Modal open={open} onClose={() => setOpen(false)}>
333
- <ModalFrame title="Details" titleStartDecorator={<InfoOutlinedIcon />} onClose={() => setOpen(false)}>
334
- <Typography>
335
- Use the <code>titleStartDecorator</code> prop to display an icon or element before the title.
336
- </Typography>
337
- </ModalFrame>
338
- </Modal>
339
- </>
354
+ <Button onClick={() => setOpen(true)}>With Decorator</Button>
355
+ <Modal open={open} onClose={() => setOpen(false)}>
356
+ <ModalFrame
357
+ title="Details"
358
+ titleStartDecorator={<InfoOutlinedIcon />}
359
+ onClose={() => setOpen(false)}
360
+ >
361
+ <Typography>
362
+ Use the <code>titleStartDecorator</code> prop to display an icon or element before the
363
+ title.
364
+ </Typography>
365
+ </ModalFrame>
366
+ </Modal>
367
+ </>
340
368
  ```
341
369
 
342
370
  #### Form Content
@@ -345,28 +373,30 @@ An inline form pattern where the submit button lives inside the content area.
345
373
 
346
374
  ```tsx
347
375
  <>
348
- <Button onClick={() => setOpen(true)}>Form in ModalFrame</Button>
349
- <Modal open={open} onClose={() => setOpen(false)}>
350
- <ModalFrame title="Create Project" onClose={() => setOpen(false)}>
351
- <form onSubmit={(event: React.FormEvent<HTMLFormElement>) => {
352
- event.preventDefault();
353
- setOpen(false);
354
- }}>
355
- <Stack spacing={2}>
356
- <FormControl>
357
- <FormLabel>Name</FormLabel>
358
- <Input required />
359
- </FormControl>
360
- <FormControl>
361
- <FormLabel>Description</FormLabel>
362
- <Input required />
363
- </FormControl>
364
- <Button type="submit">Submit</Button>
365
- </Stack>
366
- </form>
367
- </ModalFrame>
368
- </Modal>
369
- </>
376
+ <Button onClick={() => setOpen(true)}>Form in ModalFrame</Button>
377
+ <Modal open={open} onClose={() => setOpen(false)}>
378
+ <ModalFrame title="Create Project" onClose={() => setOpen(false)}>
379
+ <form
380
+ onSubmit={(event: React.FormEvent<HTMLFormElement>) => {
381
+ event.preventDefault();
382
+ setOpen(false);
383
+ }}
384
+ >
385
+ <Stack spacing={2}>
386
+ <FormControl>
387
+ <FormLabel>Name</FormLabel>
388
+ <Input required />
389
+ </FormControl>
390
+ <FormControl>
391
+ <FormLabel>Description</FormLabel>
392
+ <Input required />
393
+ </FormControl>
394
+ <Button type="submit">Submit</Button>
395
+ </Stack>
396
+ </form>
397
+ </ModalFrame>
398
+ </Modal>
399
+ </>
370
400
  ```
371
401
 
372
402
  #### Sizes
@@ -375,31 +405,31 @@ Compare sm / md / lg sizes side by side.
375
405
 
376
406
  ```tsx
377
407
  <Stack direction="row" spacing={2}>
378
- <Button size="sm" onClick={() => setOpenSm(true)}>
379
- Small
380
- </Button>
381
- <Button size="md" onClick={() => setOpenMd(true)}>
382
- Medium
383
- </Button>
384
- <Button size="lg" onClick={() => setOpenLg(true)}>
385
- Large
386
- </Button>
387
- <Modal open={openSm} onClose={() => setOpenSm(false)}>
388
- <ModalFrame title="Small ModalFrame" size="sm" onClose={() => setOpenSm(false)}>
389
- <Typography>This is a small ModalFrame.</Typography>
390
- </ModalFrame>
391
- </Modal>
392
- <Modal open={openMd} onClose={() => setOpenMd(false)}>
393
- <ModalFrame title="Medium ModalFrame" size="md" onClose={() => setOpenMd(false)}>
394
- <Typography>This is a medium ModalFrame.</Typography>
395
- </ModalFrame>
396
- </Modal>
397
- <Modal open={openLg} onClose={() => setOpenLg(false)}>
398
- <ModalFrame title="Large ModalFrame" size="lg" onClose={() => setOpenLg(false)}>
399
- <Typography>This is a large ModalFrame.</Typography>
400
- </ModalFrame>
401
- </Modal>
402
- </Stack>
408
+ <Button size="sm" onClick={() => setOpenSm(true)}>
409
+ Small
410
+ </Button>
411
+ <Button size="md" onClick={() => setOpenMd(true)}>
412
+ Medium
413
+ </Button>
414
+ <Button size="lg" onClick={() => setOpenLg(true)}>
415
+ Large
416
+ </Button>
417
+ <Modal open={openSm} onClose={() => setOpenSm(false)}>
418
+ <ModalFrame title="Small ModalFrame" size="sm" onClose={() => setOpenSm(false)}>
419
+ <Typography>This is a small ModalFrame.</Typography>
420
+ </ModalFrame>
421
+ </Modal>
422
+ <Modal open={openMd} onClose={() => setOpenMd(false)}>
423
+ <ModalFrame title="Medium ModalFrame" size="md" onClose={() => setOpenMd(false)}>
424
+ <Typography>This is a medium ModalFrame.</Typography>
425
+ </ModalFrame>
426
+ </Modal>
427
+ <Modal open={openLg} onClose={() => setOpenLg(false)}>
428
+ <ModalFrame title="Large ModalFrame" size="lg" onClose={() => setOpenLg(false)}>
429
+ <Typography>This is a large ModalFrame.</Typography>
430
+ </ModalFrame>
431
+ </Modal>
432
+ </Stack>
403
433
  ```
404
434
 
405
435
  #### Custom Content
@@ -408,30 +438,30 @@ A layout example suited for displaying detailed information.
408
438
 
409
439
  ```tsx
410
440
  <>
411
- <Button onClick={() => setOpen(true)}>Custom Content</Button>
412
- <Modal open={open} onClose={() => setOpen(false)}>
413
- <ModalFrame title="Order Details" onClose={() => setOpen(false)}>
414
- <Stack spacing={2}>
415
- <Box>
416
- <Typography level="title-sm">Order ID</Typography>
417
- <Typography level="body-sm">ORD-2024-00123</Typography>
418
- </Box>
419
- <Divider />
420
- <Box>
421
- <Typography level="title-sm">Customer</Typography>
422
- <Typography level="body-sm">John Doe</Typography>
423
- </Box>
424
- <Divider />
425
- <Box>
426
- <Typography level="title-sm">Status</Typography>
427
- <Typography level="body-sm" color="success">
428
- Completed
429
- </Typography>
430
- </Box>
431
- </Stack>
432
- </ModalFrame>
433
- </Modal>
434
- </>
441
+ <Button onClick={() => setOpen(true)}>Custom Content</Button>
442
+ <Modal open={open} onClose={() => setOpen(false)}>
443
+ <ModalFrame title="Order Details" onClose={() => setOpen(false)}>
444
+ <Stack spacing={2}>
445
+ <Box>
446
+ <Typography level="title-sm">Order ID</Typography>
447
+ <Typography level="body-sm">ORD-2024-00123</Typography>
448
+ </Box>
449
+ <Divider />
450
+ <Box>
451
+ <Typography level="title-sm">Customer</Typography>
452
+ <Typography level="body-sm">John Doe</Typography>
453
+ </Box>
454
+ <Divider />
455
+ <Box>
456
+ <Typography level="title-sm">Status</Typography>
457
+ <Typography level="body-sm" color="success">
458
+ Completed
459
+ </Typography>
460
+ </Box>
461
+ </Stack>
462
+ </ModalFrame>
463
+ </Modal>
464
+ </>
435
465
  ```
436
466
 
437
467
  #### Standalone
@@ -448,18 +478,19 @@ ModalFrame can be used without a Modal wrapper for embedding dialog-style layout
448
478
  > 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.
449
479
 
450
480
  ```tsx
451
- <Box sx={{
452
- position: 'relative',
453
- width: 480,
454
- height: 300
455
- }}>
456
- <ModalFrame title="Standalone ModalFrame" onClose={() => console.log('close')}>
457
- <Typography>
458
- ModalFrame used without Modal. The parent container must provide
459
- explicit width and height.
460
- </Typography>
461
- </ModalFrame>
462
- </Box>
481
+ <Box
482
+ sx={{
483
+ position: "relative",
484
+ width: 480,
485
+ height: 300
486
+ }}
487
+ >
488
+ <ModalFrame title="Standalone ModalFrame" onClose={() => console.log("close")}>
489
+ <Typography>
490
+ ModalFrame used without Modal. The parent container must provide explicit width and height.
491
+ </Typography>
492
+ </ModalFrame>
493
+ </Box>
463
494
  ```
464
495
 
465
496
  ## When to Use