@ceed/cds 1.34.0 → 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.
- package/dist/components/Accordions/Accordions.d.ts +1 -0
- package/dist/components/Alert/Alert.d.ts +5 -5
- package/dist/components/Autocomplete/Autocomplete.d.ts +2 -2
- package/dist/components/Avatar/Avatar.d.ts +7 -17
- package/dist/components/Box/Box.d.ts +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +6 -5
- package/dist/components/Button/Button.d.ts +3 -2
- package/dist/components/Calendar/Calendar.d.ts +1 -0
- package/dist/components/Card/Card.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/Chip/Chip.d.ts +1 -0
- package/dist/components/Container/Container.d.ts +6 -1
- package/dist/components/CurrencyInput/CurrencyInput.d.ts +1 -1
- package/dist/components/DialogActions/DialogActions.d.ts +1 -0
- package/dist/components/DialogContent/DialogContent.d.ts +1 -0
- package/dist/components/DialogFrame/DialogFrame.d.ts +1 -1
- package/dist/components/DialogTitle/DialogTitle.d.ts +1 -0
- package/dist/components/Divider/Divider.d.ts +1 -0
- package/dist/components/Drawer/Drawer.d.ts +1 -0
- package/dist/components/Dropdown/Dropdown.d.ts +28 -1
- package/dist/components/FormControl/FormControl.d.ts +1 -0
- package/dist/components/FormHelperText/FormHelperText.d.ts +1 -0
- package/dist/components/FormLabel/FormLabel.d.ts +1 -0
- package/dist/components/Grid/Grid.d.ts +1 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -2
- package/dist/components/IconMenuButton/IconMenuButton.d.ts +7 -6
- package/dist/components/InfoSign/InfoSign.d.ts +3 -2
- package/dist/components/Input/Input.d.ts +8 -22
- package/dist/components/InsetDrawer/InsetDrawer.d.ts +1 -0
- package/dist/components/Markdown/Markdown.d.ts +9 -24
- package/dist/components/Menu/Menu.d.ts +2 -1
- package/dist/components/MenuButton/MenuButton.d.ts +10 -8
- package/dist/components/Modal/Modal.d.ts +4 -2
- package/dist/components/NavigationGroup/NavigationGroup.d.ts +3 -2
- package/dist/components/NavigationItem/NavigationItem.d.ts +3 -2
- package/dist/components/Navigator/Navigator.d.ts +5 -4
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/Radio/Radio.d.ts +1 -0
- package/dist/components/RadioList/RadioList.d.ts +3 -2
- package/dist/components/SearchBar/SearchBar.d.ts +6 -5
- package/dist/components/SearchBar/index.d.ts +3 -2
- package/dist/components/Select/Select.d.ts +12 -10
- package/dist/components/Sheet/Sheet.d.ts +1 -0
- package/dist/components/Stack/Stack.d.ts +1 -0
- package/dist/components/Stepper/Stepper.d.ts +2 -1
- package/dist/components/Switch/Switch.d.ts +1 -0
- package/dist/components/Table/Table.d.ts +7 -5
- package/dist/components/Tabs/Tabs.d.ts +1 -0
- package/dist/components/Textarea/Textarea.d.ts +8 -20
- package/dist/components/Tooltip/Tooltip.d.ts +1 -0
- package/dist/components/Typography/Typography.d.ts +1 -0
- package/dist/components/Uploader/Uploader.d.ts +18 -17
- package/dist/components/data-display/Avatar.md +60 -72
- package/dist/components/data-display/Badge.md +197 -181
- package/dist/components/data-display/Chip.md +164 -142
- package/dist/components/data-display/DataTable.md +843 -338
- package/dist/components/data-display/InfoSign.md +1 -3
- package/dist/components/data-display/Markdown.md +93 -125
- package/dist/components/data-display/Table.md +1453 -1007
- package/dist/components/data-display/Typography.md +113 -116
- package/dist/components/feedback/Alert.md +80 -86
- package/dist/components/feedback/CircularProgress.md +32 -36
- package/dist/components/feedback/Dialog.md +25 -17
- package/dist/components/feedback/Modal.md +296 -264
- package/dist/components/feedback/Skeleton.md +125 -89
- package/dist/components/index.d.ts +63 -4
- package/dist/components/inputs/Autocomplete.md +191 -95
- package/dist/components/inputs/Button.md +83 -83
- package/dist/components/inputs/ButtonGroup.md +195 -185
- package/dist/components/inputs/Calendar.md +25 -28
- package/dist/components/inputs/Checkbox.md +11 -29
- package/dist/components/inputs/CurrencyInput.md +4 -4
- package/dist/components/inputs/DatePicker.md +229 -110
- package/dist/components/inputs/DateRangePicker.md +248 -137
- package/dist/components/inputs/FilterableCheckboxGroup.md +115 -55
- package/dist/components/inputs/FormControl.md +75 -69
- package/dist/components/inputs/IconButton.md +229 -205
- package/dist/components/inputs/Input.md +131 -98
- package/dist/components/inputs/MonthPicker.md +186 -84
- package/dist/components/inputs/MonthRangePicker.md +73 -49
- package/dist/components/inputs/PercentageInput.md +15 -31
- package/dist/components/inputs/RadioButton.md +320 -256
- package/dist/components/inputs/RadioList.md +66 -50
- package/dist/components/inputs/RadioTileGroup.md +287 -170
- package/dist/components/inputs/SearchBar.md +154 -55
- package/dist/components/inputs/Select.md +106 -95
- package/dist/components/inputs/Slider.md +153 -102
- package/dist/components/inputs/Switch.md +193 -138
- package/dist/components/inputs/Textarea.md +15 -20
- package/dist/components/inputs/Uploader/Uploader.md +68 -39
- package/dist/components/layout/Box.md +841 -662
- package/dist/components/layout/Container.md +3 -11
- package/dist/components/layout/Grid.md +480 -394
- package/dist/components/layout/Stack.md +739 -566
- package/dist/components/navigation/Breadcrumbs.md +4 -4
- package/dist/components/navigation/Drawer.md +34 -25
- package/dist/components/navigation/Dropdown.md +745 -408
- package/dist/components/navigation/IconMenuButton.md +14 -6
- package/dist/components/navigation/InsetDrawer.md +8 -13
- package/dist/components/navigation/Link.md +1 -2
- package/dist/components/navigation/Menu.md +623 -502
- package/dist/components/navigation/MenuButton.md +18 -10
- package/dist/components/navigation/NavigationGroup.md +19 -50
- package/dist/components/navigation/NavigationItem.md +6 -6
- package/dist/components/navigation/Navigator.md +26 -28
- package/dist/components/navigation/Pagination.md +86 -75
- package/dist/components/navigation/Stepper.md +2 -12
- package/dist/components/navigation/Tabs.md +48 -36
- package/dist/components/surfaces/Accordions.md +89 -172
- package/dist/components/surfaces/Card.md +1094 -709
- package/dist/components/surfaces/Divider.md +562 -412
- package/dist/components/surfaces/Sheet.md +700 -518
- package/dist/guides/ThemeProvider.md +8 -8
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +4 -4
- package/dist/index.cjs +1079 -1052
- package/dist/index.d.ts +2 -1
- package/dist/index.js +725 -690
- package/framer/index.js +1 -1
- 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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
<
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
</
|
|
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
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
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
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
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
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
<
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
<
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
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
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
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
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
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
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
<
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
</
|
|
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
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
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
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
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
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
ModalFrame
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
</
|
|
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
|