@iowas/toolpad 1.0.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/README.md +57 -0
- package/dist/AppProvider-CIyOzZv_.d.mts +201 -0
- package/dist/AppProvider-CIyOzZv_.d.ts +201 -0
- package/dist/chunk-3JWXE2JW.mjs +125 -0
- package/dist/chunk-CENJI4RY.mjs +26 -0
- package/dist/chunk-F6JD4MSY.mjs +12 -0
- package/dist/chunk-LUTZBKSG.mjs +710 -0
- package/dist/chunk-UNVYOWC2.mjs +44 -0
- package/dist/chunk-ZXM3V5SD.mjs +2325 -0
- package/dist/core.d.mts +995 -0
- package/dist/core.d.ts +995 -0
- package/dist/core.js +3111 -0
- package/dist/core.mjs +72 -0
- package/dist/index.d.mts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +3271 -0
- package/dist/index.mjs +112 -0
- package/dist/nextjs.d.mts +8 -0
- package/dist/nextjs.d.ts +8 -0
- package/dist/nextjs.js +858 -0
- package/dist/nextjs.mjs +106 -0
- package/dist/utils.d.mts +98 -0
- package/dist/utils.d.ts +98 -0
- package/dist/utils.js +218 -0
- package/dist/utils.mjs +44 -0
- package/package.json +87 -0
package/dist/core.d.ts
ADDED
|
@@ -0,0 +1,995 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import Button, { ButtonProps } from '@mui/material/Button';
|
|
4
|
+
import Popover, { PopoverProps } from '@mui/material/Popover';
|
|
5
|
+
import Stack, { StackProps } from '@mui/material/Stack';
|
|
6
|
+
import { AvatarProps } from '@mui/material/Avatar';
|
|
7
|
+
import { SxProps } from '@mui/material/styles';
|
|
8
|
+
import { IconButtonProps } from '@mui/material/IconButton';
|
|
9
|
+
import { BoxProps } from '@mui/material/Box';
|
|
10
|
+
import { B as Branding, i as Navigation, l as NavigationPageItem } from './AppProvider-CIyOzZv_.js';
|
|
11
|
+
export { A as AppProvider, a as AppProviderProps, b as AppTheme, c as Authentication, d as AuthenticationContext, L as LocaleText, e as LocalizationContext, f as LocalizationProvider, g as LocalizationProviderProps, N as Navigate, h as NavigateOptions, j as NavigationDividerItem, k as NavigationItem, m as NavigationSubheaderItem, R as Router, S as Session, n as SessionContext, u as useLocaleText } from './AppProvider-CIyOzZv_.js';
|
|
12
|
+
import { ContainerProps } from '@mui/material/Container';
|
|
13
|
+
import { SxProps as SxProps$1, SnackbarProps } from '@mui/material';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* Demos:
|
|
18
|
+
*
|
|
19
|
+
* - [Account](https://mui.com/toolpad/core/react-account/)
|
|
20
|
+
*
|
|
21
|
+
* API:
|
|
22
|
+
*
|
|
23
|
+
* - [SignInButton API](https://mui.com/toolpad/core/api/sign-in-button)
|
|
24
|
+
*/
|
|
25
|
+
declare function SignInButton(props: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
26
|
+
declare namespace SignInButton {
|
|
27
|
+
var propTypes: any;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
type AccountPreviewVariant = 'condensed' | 'expanded';
|
|
31
|
+
interface AccountPreviewSlots {
|
|
32
|
+
/**
|
|
33
|
+
* The component used for the Avatar
|
|
34
|
+
* @default Avatar
|
|
35
|
+
*/
|
|
36
|
+
avatar?: React.ElementType;
|
|
37
|
+
/**
|
|
38
|
+
* The component used for the overflow icon button in the expanded variant
|
|
39
|
+
* @default IconButton
|
|
40
|
+
*/
|
|
41
|
+
moreIconButton?: React.ElementType;
|
|
42
|
+
/**
|
|
43
|
+
* The component used for the avatar icon button in the condensed variant
|
|
44
|
+
* @default IconButton
|
|
45
|
+
*/
|
|
46
|
+
avatarIconButton?: React.ElementType;
|
|
47
|
+
}
|
|
48
|
+
interface AccountPreviewProps {
|
|
49
|
+
/**
|
|
50
|
+
* The components used for each slot inside.
|
|
51
|
+
*/
|
|
52
|
+
slots?: AccountPreviewSlots;
|
|
53
|
+
/**
|
|
54
|
+
* The props used for each slot inside.
|
|
55
|
+
*/
|
|
56
|
+
slotProps?: {
|
|
57
|
+
avatar?: AvatarProps;
|
|
58
|
+
moreIconButton?: IconButtonProps;
|
|
59
|
+
avatarIconButton?: IconButtonProps;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* The type of account details to display.
|
|
63
|
+
* @property {'condensed'} condensed - Shows only the user's avatar.
|
|
64
|
+
* @property {'expanded'} expanded - Displays the user's avatar, name, and email if available.
|
|
65
|
+
* @default 'condensed'
|
|
66
|
+
*/
|
|
67
|
+
variant?: AccountPreviewVariant;
|
|
68
|
+
/**
|
|
69
|
+
* The handler used when the preview is expanded
|
|
70
|
+
*/
|
|
71
|
+
handleClick?: React.MouseEventHandler<HTMLElement>;
|
|
72
|
+
/**
|
|
73
|
+
* The state of the Account popover
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
open?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* The prop used to customize the styling of the preview
|
|
79
|
+
*/
|
|
80
|
+
sx?: SxProps;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The AccountPreview component displays user account information.
|
|
84
|
+
*
|
|
85
|
+
* Demos:
|
|
86
|
+
*
|
|
87
|
+
* - [Account](https://mui.com/toolpad/core/react-account/)
|
|
88
|
+
*
|
|
89
|
+
* API:
|
|
90
|
+
*
|
|
91
|
+
* - [AccountPreview API](https://mui.com/toolpad/core/api/account-preview)
|
|
92
|
+
*/
|
|
93
|
+
declare function AccountPreview(props: AccountPreviewProps): react_jsx_runtime.JSX.Element | null;
|
|
94
|
+
declare namespace AccountPreview {
|
|
95
|
+
var propTypes: any;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
interface AccountLocaleText {
|
|
99
|
+
accountSignInLabel: string;
|
|
100
|
+
accountSignOutLabel: string;
|
|
101
|
+
accountPreviewIconButtonLabel: string;
|
|
102
|
+
accountPreviewTitle: string;
|
|
103
|
+
}
|
|
104
|
+
interface AccountSlots {
|
|
105
|
+
/**
|
|
106
|
+
* The component used for the account preview
|
|
107
|
+
* @default AccountPreview
|
|
108
|
+
*/
|
|
109
|
+
preview?: React.JSXElementConstructor<AccountPreviewProps>;
|
|
110
|
+
/**
|
|
111
|
+
* The component used for the account popover menu
|
|
112
|
+
* @default Popover
|
|
113
|
+
*/
|
|
114
|
+
popover?: React.JSXElementConstructor<PopoverProps>;
|
|
115
|
+
/**
|
|
116
|
+
* The component used for the content of account popover
|
|
117
|
+
* @default Stack
|
|
118
|
+
*/
|
|
119
|
+
popoverContent?: React.JSXElementConstructor<StackProps>;
|
|
120
|
+
/**
|
|
121
|
+
* The component used for the sign in button.
|
|
122
|
+
* @default Button
|
|
123
|
+
*/
|
|
124
|
+
signInButton?: React.JSXElementConstructor<ButtonProps>;
|
|
125
|
+
/**
|
|
126
|
+
* The component used for the sign out button.
|
|
127
|
+
* @default Button
|
|
128
|
+
*/
|
|
129
|
+
signOutButton?: React.JSXElementConstructor<ButtonProps>;
|
|
130
|
+
}
|
|
131
|
+
interface AccountProps {
|
|
132
|
+
/**
|
|
133
|
+
* The components used for each slot inside.
|
|
134
|
+
*/
|
|
135
|
+
slots?: AccountSlots;
|
|
136
|
+
/**
|
|
137
|
+
* The props used for each slot inside.
|
|
138
|
+
*/
|
|
139
|
+
slotProps?: {
|
|
140
|
+
preview?: AccountPreviewProps;
|
|
141
|
+
popover?: Omit<React.ComponentProps<typeof Popover>, 'open'>;
|
|
142
|
+
popoverContent?: React.ComponentProps<typeof Stack>;
|
|
143
|
+
signInButton?: React.ComponentProps<typeof SignInButton>;
|
|
144
|
+
signOutButton?: React.ComponentProps<typeof Button>;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* The labels for the account component.
|
|
148
|
+
*/
|
|
149
|
+
localeText?: Partial<AccountLocaleText>;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
*
|
|
153
|
+
* Demos:
|
|
154
|
+
*
|
|
155
|
+
* - [Account](https://mui.com/toolpad/core/react-account/)
|
|
156
|
+
* - [Dashboard Layout](https://mui.com/toolpad/core/react-dashboard-layout/)
|
|
157
|
+
* - [Sign-in Page](https://mui.com/toolpad/core/react-sign-in-page/)
|
|
158
|
+
*
|
|
159
|
+
* API:
|
|
160
|
+
*
|
|
161
|
+
* - [Account API](https://mui.com/toolpad/core/api/account)
|
|
162
|
+
*/
|
|
163
|
+
declare function Account(props: AccountProps): react_jsx_runtime.JSX.Element | null;
|
|
164
|
+
declare namespace Account {
|
|
165
|
+
var propTypes: any;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
interface AccountPopoverHeaderProps extends StackProps {
|
|
169
|
+
children?: React.ReactNode;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
*
|
|
173
|
+
* Demos:
|
|
174
|
+
*
|
|
175
|
+
* - [Account](https://mui.com/toolpad/core/react-account/)
|
|
176
|
+
*
|
|
177
|
+
* API:
|
|
178
|
+
*
|
|
179
|
+
* - [AccountPopoverHeader API](https://mui.com/toolpad/core/api/account-popover-header)
|
|
180
|
+
*/
|
|
181
|
+
declare function AccountPopoverHeader(props: AccountPopoverHeaderProps): react_jsx_runtime.JSX.Element;
|
|
182
|
+
declare namespace AccountPopoverHeader {
|
|
183
|
+
var propTypes: any;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
interface AccountPopoverFooterProps extends BoxProps {
|
|
187
|
+
children?: React.ReactNode;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
*
|
|
191
|
+
* Demos:
|
|
192
|
+
*
|
|
193
|
+
* - [Account](https://mui.com/toolpad/core/react-account/)
|
|
194
|
+
*
|
|
195
|
+
* API:
|
|
196
|
+
*
|
|
197
|
+
* - [AccountPopoverFooter API](https://mui.com/toolpad/core/api/account-popover-footer)
|
|
198
|
+
*/
|
|
199
|
+
declare function AccountPopoverFooter(props: AccountPopoverFooterProps): react_jsx_runtime.JSX.Element;
|
|
200
|
+
declare namespace AccountPopoverFooter {
|
|
201
|
+
var propTypes: any;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
type SignOutButtonProps = ButtonProps;
|
|
205
|
+
/**
|
|
206
|
+
*
|
|
207
|
+
* Demos:
|
|
208
|
+
*
|
|
209
|
+
* - [Account](https://mui.com/toolpad/core/react-account/)
|
|
210
|
+
*
|
|
211
|
+
* API:
|
|
212
|
+
*
|
|
213
|
+
* - [SignOutButton API](https://mui.com/toolpad/core/api/sign-out-button)
|
|
214
|
+
*/
|
|
215
|
+
declare function SignOutButton(props: SignOutButtonProps): react_jsx_runtime.JSX.Element;
|
|
216
|
+
declare namespace SignOutButton {
|
|
217
|
+
var propTypes: any;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
interface AppTitleProps {
|
|
221
|
+
branding?: Branding;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
interface DashboardHeaderSlotProps {
|
|
225
|
+
appTitle?: AppTitleProps;
|
|
226
|
+
toolbarActions?: {};
|
|
227
|
+
toolbarAccount?: AccountProps;
|
|
228
|
+
}
|
|
229
|
+
interface DashboardHeaderSlots {
|
|
230
|
+
/**
|
|
231
|
+
* The component used for the app title section.
|
|
232
|
+
* @default Link
|
|
233
|
+
* @see [DashboardLayout#slots](https://mui.com/toolpad/core/react-dashboard-layout/#slots)
|
|
234
|
+
*/
|
|
235
|
+
appTitle?: React.ElementType;
|
|
236
|
+
/**
|
|
237
|
+
* The toolbar actions component to be used.
|
|
238
|
+
* @default ToolbarActions
|
|
239
|
+
* @see [DashboardLayout#slots](https://mui.com/toolpad/core/react-dashboard-layout/#slots)
|
|
240
|
+
*/
|
|
241
|
+
toolbarActions?: React.JSXElementConstructor<{}>;
|
|
242
|
+
/**
|
|
243
|
+
* The toolbar account component to be used.
|
|
244
|
+
* @default Account
|
|
245
|
+
* @deprecated Place your custom component on the right in the `toolbarActions` slot instead.
|
|
246
|
+
* @see [DashboardLayout#slots](https://mui.com/toolpad/core/react-dashboard-layout/#slots)
|
|
247
|
+
*/
|
|
248
|
+
toolbarAccount?: React.JSXElementConstructor<AccountProps>;
|
|
249
|
+
}
|
|
250
|
+
interface DashboardHeaderProps {
|
|
251
|
+
/**
|
|
252
|
+
* Branding options for the header.
|
|
253
|
+
* @default null
|
|
254
|
+
*/
|
|
255
|
+
branding?: Branding | null;
|
|
256
|
+
/**
|
|
257
|
+
* If `true`, show menu button as if menu is expanded, otherwise show it as if menu is collapsed.
|
|
258
|
+
*/
|
|
259
|
+
menuOpen: boolean;
|
|
260
|
+
/**
|
|
261
|
+
* Callback fired when the menu button is clicked.
|
|
262
|
+
*/
|
|
263
|
+
onToggleMenu: (open: boolean) => void;
|
|
264
|
+
/**
|
|
265
|
+
* Whether the menu icon should always be hidden.
|
|
266
|
+
* @default false
|
|
267
|
+
*/
|
|
268
|
+
hideMenuButton?: boolean;
|
|
269
|
+
/**
|
|
270
|
+
* The components used for each slot inside.
|
|
271
|
+
* @default {}
|
|
272
|
+
*/
|
|
273
|
+
slots?: DashboardHeaderSlots;
|
|
274
|
+
/**
|
|
275
|
+
* The props used for each slot inside.
|
|
276
|
+
* @default {}
|
|
277
|
+
*/
|
|
278
|
+
slotProps?: DashboardHeaderSlotProps;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
*
|
|
282
|
+
* Demos:
|
|
283
|
+
*
|
|
284
|
+
* - [Dashboard Layout](https://mui.com/toolpad/core/react-dashboard-layout/)
|
|
285
|
+
*
|
|
286
|
+
* API:
|
|
287
|
+
*
|
|
288
|
+
* - [DashboardHeader API](https://mui.com/toolpad/core/api/dashboard-header)
|
|
289
|
+
*/
|
|
290
|
+
declare function DashboardHeader(props: DashboardHeaderProps): react_jsx_runtime.JSX.Element;
|
|
291
|
+
declare namespace DashboardHeader {
|
|
292
|
+
var propTypes: any;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
interface SidebarFooterProps {
|
|
296
|
+
mini: boolean;
|
|
297
|
+
}
|
|
298
|
+
interface DashboardLayoutSlotProps {
|
|
299
|
+
appTitle?: DashboardHeaderSlotProps['appTitle'];
|
|
300
|
+
toolbarActions?: DashboardHeaderSlotProps['toolbarActions'];
|
|
301
|
+
toolbarAccount?: DashboardHeaderSlotProps['toolbarAccount'];
|
|
302
|
+
sidebarFooter?: SidebarFooterProps;
|
|
303
|
+
header?: DashboardHeaderProps;
|
|
304
|
+
}
|
|
305
|
+
interface DashboardLayoutSlots {
|
|
306
|
+
/**
|
|
307
|
+
* The component used for the app title section in the layout header.
|
|
308
|
+
* @default Link
|
|
309
|
+
* @see [DashboardLayout#slots](https://mui.com/toolpad/core/react-dashboard-layout/#slots)
|
|
310
|
+
*/
|
|
311
|
+
appTitle?: React.ElementType;
|
|
312
|
+
/**
|
|
313
|
+
* The toolbar actions component used in the layout header.
|
|
314
|
+
* @default ToolbarActions
|
|
315
|
+
* @see [DashboardLayout#slots](https://mui.com/toolpad/core/react-dashboard-layout/#slots)
|
|
316
|
+
*/
|
|
317
|
+
toolbarActions?: React.JSXElementConstructor<{}>;
|
|
318
|
+
/**
|
|
319
|
+
* The toolbar account component used in the layout header.
|
|
320
|
+
* @default Account
|
|
321
|
+
* @deprecated Place your custom component on the right in the `toolbarActions` slot instead.
|
|
322
|
+
* @see [DashboardLayout#slots](https://mui.com/toolpad/core/react-dashboard-layout/#slots)
|
|
323
|
+
*/
|
|
324
|
+
toolbarAccount?: React.JSXElementConstructor<AccountProps>;
|
|
325
|
+
/**
|
|
326
|
+
* The component used for the layout header.
|
|
327
|
+
* @default DashboardHeader
|
|
328
|
+
*/
|
|
329
|
+
header?: React.JSXElementConstructor<DashboardHeaderProps>;
|
|
330
|
+
/**
|
|
331
|
+
* Optional footer component used in the layout sidebar.
|
|
332
|
+
* @default null
|
|
333
|
+
*/
|
|
334
|
+
sidebarFooter?: React.JSXElementConstructor<SidebarFooterProps>;
|
|
335
|
+
}
|
|
336
|
+
interface DashboardLayoutProps {
|
|
337
|
+
/**
|
|
338
|
+
* The content of the dashboard.
|
|
339
|
+
*/
|
|
340
|
+
children: React.ReactNode;
|
|
341
|
+
/**
|
|
342
|
+
* Branding options for the dashboard.
|
|
343
|
+
* @default null
|
|
344
|
+
*/
|
|
345
|
+
branding?: Branding | null;
|
|
346
|
+
/**
|
|
347
|
+
* Navigation definition for the dashboard. [Find out more](https://mui.com/toolpad/core/react-dashboard-layout/#navigation).
|
|
348
|
+
* @default []
|
|
349
|
+
* @deprecated Set the navigation in the [AppProvider](https://mui.com/toolpad/core/react-app-provider/#navigation) instead.
|
|
350
|
+
*/
|
|
351
|
+
navigation?: Navigation;
|
|
352
|
+
/**
|
|
353
|
+
* Whether the sidebar should start collapsed in desktop size screens.
|
|
354
|
+
* @default false
|
|
355
|
+
*/
|
|
356
|
+
defaultSidebarCollapsed?: boolean;
|
|
357
|
+
/**
|
|
358
|
+
* Whether the sidebar should not be collapsible to a mini variant in desktop and tablet viewports.
|
|
359
|
+
* @default false
|
|
360
|
+
*/
|
|
361
|
+
disableCollapsibleSidebar?: boolean;
|
|
362
|
+
/**
|
|
363
|
+
* Whether the navigation bar and menu icon should be hidden.
|
|
364
|
+
* @default false
|
|
365
|
+
*/
|
|
366
|
+
hideNavigation?: boolean;
|
|
367
|
+
/**
|
|
368
|
+
* Width of the sidebar when expanded.
|
|
369
|
+
* @default 320
|
|
370
|
+
*/
|
|
371
|
+
sidebarExpandedWidth?: number | string;
|
|
372
|
+
/**
|
|
373
|
+
* Render each page item.
|
|
374
|
+
*
|
|
375
|
+
* @param {NavigationPageItem} item
|
|
376
|
+
* @param {{ mini: boolean }} params
|
|
377
|
+
* @returns {ReactNode}
|
|
378
|
+
*/
|
|
379
|
+
renderPageItem?: (item: NavigationPageItem, params: {
|
|
380
|
+
mini: boolean;
|
|
381
|
+
}) => React.ReactNode;
|
|
382
|
+
/**
|
|
383
|
+
* The components used for each slot inside.
|
|
384
|
+
* @default {}
|
|
385
|
+
*/
|
|
386
|
+
slots?: DashboardLayoutSlots;
|
|
387
|
+
/**
|
|
388
|
+
* The props used for each slot inside.
|
|
389
|
+
* @default {}
|
|
390
|
+
*/
|
|
391
|
+
slotProps?: DashboardLayoutSlotProps;
|
|
392
|
+
/**
|
|
393
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
394
|
+
*/
|
|
395
|
+
sx?: SxProps;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
*
|
|
399
|
+
* Demos:
|
|
400
|
+
*
|
|
401
|
+
* - [Dashboard Layout](https://mui.com/toolpad/core/react-dashboard-layout/)
|
|
402
|
+
*
|
|
403
|
+
* API:
|
|
404
|
+
*
|
|
405
|
+
* - [DashboardLayout API](https://mui.com/toolpad/core/api/dashboard-layout)
|
|
406
|
+
*/
|
|
407
|
+
declare function DashboardLayout(props: DashboardLayoutProps): react_jsx_runtime.JSX.Element;
|
|
408
|
+
declare namespace DashboardLayout {
|
|
409
|
+
var propTypes: any;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
interface DashboardSidebarPageItemProps {
|
|
413
|
+
/**
|
|
414
|
+
* Navigation page item definition.
|
|
415
|
+
*/
|
|
416
|
+
item: NavigationPageItem;
|
|
417
|
+
/**
|
|
418
|
+
* Link `href` for when the item is rendered as a link.
|
|
419
|
+
* @default getItemPath(navigationContext, item)
|
|
420
|
+
*/
|
|
421
|
+
href?: string;
|
|
422
|
+
/**
|
|
423
|
+
* The component used to render the item as a link.
|
|
424
|
+
* @default Link
|
|
425
|
+
*/
|
|
426
|
+
LinkComponent?: React.ElementType;
|
|
427
|
+
/**
|
|
428
|
+
* If `true`, expands any nested navigation in the item, otherwise collapse it.
|
|
429
|
+
* @default false
|
|
430
|
+
*/
|
|
431
|
+
expanded?: boolean;
|
|
432
|
+
/**
|
|
433
|
+
* Use to apply selected styling.
|
|
434
|
+
* @default false
|
|
435
|
+
*/
|
|
436
|
+
selected?: boolean;
|
|
437
|
+
/**
|
|
438
|
+
* If `true`, the item is disabled.
|
|
439
|
+
* @default false
|
|
440
|
+
*/
|
|
441
|
+
disabled?: boolean;
|
|
442
|
+
}
|
|
443
|
+
interface DashboardSidebarPageItemContextProps extends Partial<DashboardSidebarPageItemProps> {
|
|
444
|
+
id: string;
|
|
445
|
+
onClick: (itemId: string, item: NavigationPageItem) => void;
|
|
446
|
+
isMini?: boolean;
|
|
447
|
+
isSidebarFullyExpanded?: boolean;
|
|
448
|
+
isSidebarFullyCollapsed?: boolean;
|
|
449
|
+
renderNestedNavigation: (subNavigation: Navigation) => React.ReactNode;
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
*
|
|
453
|
+
* Demos:
|
|
454
|
+
*
|
|
455
|
+
* - [Dashboard Layout](https://mui.com/toolpad/core/react-dashboard-layout/)
|
|
456
|
+
*
|
|
457
|
+
* API:
|
|
458
|
+
*
|
|
459
|
+
* - [DashboardSidebarPageItem API](https://mui.com/toolpad/core/api/dashboard-sidebar-page-item)
|
|
460
|
+
*/
|
|
461
|
+
declare function DashboardSidebarPageItem(props: DashboardSidebarPageItemProps): react_jsx_runtime.JSX.Element;
|
|
462
|
+
declare namespace DashboardSidebarPageItem {
|
|
463
|
+
var propTypes: any;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
*
|
|
468
|
+
* Demos:
|
|
469
|
+
*
|
|
470
|
+
* - [Dashboard Layout](https://mui.com/toolpad/core/react-dashboard-layout/)
|
|
471
|
+
*
|
|
472
|
+
* API:
|
|
473
|
+
*
|
|
474
|
+
* - [ThemeSwitcher API](https://mui.com/toolpad/core/api/theme-switcher)
|
|
475
|
+
*/
|
|
476
|
+
declare function ThemeSwitcher(): react_jsx_runtime.JSX.Element | null;
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
*
|
|
480
|
+
* Demos:
|
|
481
|
+
*
|
|
482
|
+
* - [Dashboard Layout](https://mui.com/toolpad/core/react-dashboard-layout/)
|
|
483
|
+
*
|
|
484
|
+
* API:
|
|
485
|
+
*
|
|
486
|
+
* - [ToolbarActions API](https://mui.com/toolpad/core/api/toolbar-actions)
|
|
487
|
+
*/
|
|
488
|
+
declare function ToolbarActions(): react_jsx_runtime.JSX.Element;
|
|
489
|
+
|
|
490
|
+
declare const _default: {
|
|
491
|
+
components: {
|
|
492
|
+
MuiLocalizationProvider: {
|
|
493
|
+
defaultProps: {
|
|
494
|
+
localeText: {
|
|
495
|
+
accountSignInLabel?: string | undefined;
|
|
496
|
+
accountSignOutLabel?: string | undefined;
|
|
497
|
+
accountPreviewIconButtonLabel?: string | undefined;
|
|
498
|
+
accountPreviewTitle?: string | undefined;
|
|
499
|
+
signInTitle?: string | ((brandingTitle?: string) => string) | undefined;
|
|
500
|
+
signInSubtitle?: string | undefined;
|
|
501
|
+
providerSignInTitle?: ((provider: string) => string) | undefined;
|
|
502
|
+
signInRememberMe?: string | undefined;
|
|
503
|
+
email?: string | undefined;
|
|
504
|
+
passkey?: string | undefined;
|
|
505
|
+
username?: string | undefined;
|
|
506
|
+
password?: string | undefined;
|
|
507
|
+
or?: string | undefined;
|
|
508
|
+
to?: string | undefined;
|
|
509
|
+
with?: string | undefined;
|
|
510
|
+
save?: string | undefined;
|
|
511
|
+
cancel?: string | undefined;
|
|
512
|
+
ok?: string | undefined;
|
|
513
|
+
close?: string | undefined;
|
|
514
|
+
delete?: string | undefined;
|
|
515
|
+
alert?: string | undefined;
|
|
516
|
+
confirm?: string | undefined;
|
|
517
|
+
loading?: string | undefined;
|
|
518
|
+
createNewButtonLabel?: string | undefined;
|
|
519
|
+
reloadButtonLabel?: string | undefined;
|
|
520
|
+
createLabel?: string | undefined;
|
|
521
|
+
createSuccessMessage?: string | undefined;
|
|
522
|
+
createErrorMessage?: string | undefined;
|
|
523
|
+
editLabel?: string | undefined;
|
|
524
|
+
editSuccessMessage?: string | undefined;
|
|
525
|
+
editErrorMessage?: string | undefined;
|
|
526
|
+
deleteLabel?: string | undefined;
|
|
527
|
+
deleteConfirmTitle?: string | undefined;
|
|
528
|
+
deleteConfirmMessage?: string | undefined;
|
|
529
|
+
deleteConfirmLabel?: string | undefined;
|
|
530
|
+
deleteCancelLabel?: string | undefined;
|
|
531
|
+
deleteSuccessMessage?: string | undefined;
|
|
532
|
+
deleteErrorMessage?: string | undefined;
|
|
533
|
+
deletedItemMessage?: string | undefined;
|
|
534
|
+
};
|
|
535
|
+
};
|
|
536
|
+
};
|
|
537
|
+
};
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
interface PageHeaderToolbarProps {
|
|
541
|
+
children?: React.ReactNode;
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
*
|
|
545
|
+
* Demos:
|
|
546
|
+
*
|
|
547
|
+
* - [Page Container](https://mui.com/toolpad/core/react-page-container/)
|
|
548
|
+
*
|
|
549
|
+
* API:
|
|
550
|
+
*
|
|
551
|
+
* - [PageHeaderToolbar API](https://mui.com/toolpad/core/api/page-header-toolbar)
|
|
552
|
+
*/
|
|
553
|
+
declare function PageHeaderToolbar(props: PageHeaderToolbarProps): react_jsx_runtime.JSX.Element;
|
|
554
|
+
declare namespace PageHeaderToolbar {
|
|
555
|
+
var propTypes: any;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
interface PageHeaderSlotProps {
|
|
559
|
+
toolbar: PageHeaderToolbarProps;
|
|
560
|
+
}
|
|
561
|
+
interface PageHeaderSlots {
|
|
562
|
+
/**
|
|
563
|
+
* The component that renders the actions toolbar.
|
|
564
|
+
* @default PageHeaderToolbar
|
|
565
|
+
*/
|
|
566
|
+
toolbar: React.ElementType;
|
|
567
|
+
}
|
|
568
|
+
interface PageHeaderProps {
|
|
569
|
+
/**
|
|
570
|
+
* The title of the page. Leave blank to use the active page title.
|
|
571
|
+
*/
|
|
572
|
+
title?: string;
|
|
573
|
+
/**
|
|
574
|
+
* The breadcrumbs of the page. Leave blank to use the active page breadcrumbs.
|
|
575
|
+
*/
|
|
576
|
+
breadcrumbs?: Breadcrumb[];
|
|
577
|
+
/**
|
|
578
|
+
* The components used for each slot inside.
|
|
579
|
+
*/
|
|
580
|
+
slots?: PageHeaderSlots;
|
|
581
|
+
/**
|
|
582
|
+
* The props used for each slot inside.
|
|
583
|
+
*/
|
|
584
|
+
slotProps?: PageHeaderSlotProps;
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* A header component to provide a title and breadcrumbs for your pages.
|
|
588
|
+
*
|
|
589
|
+
* Demos:
|
|
590
|
+
*
|
|
591
|
+
* - [Page Container](https://mui.com/toolpad/core/react-page-container/)
|
|
592
|
+
*
|
|
593
|
+
* API:
|
|
594
|
+
*
|
|
595
|
+
* - [PageHeader API](https://mui.com/toolpad/core/api/page-header)
|
|
596
|
+
*/
|
|
597
|
+
declare function PageHeader(props: PageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
598
|
+
declare namespace PageHeader {
|
|
599
|
+
var propTypes: any;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
interface Breadcrumb {
|
|
603
|
+
/**
|
|
604
|
+
* The title of the breadcrumb segment.
|
|
605
|
+
*/
|
|
606
|
+
title: string;
|
|
607
|
+
/**
|
|
608
|
+
* The path the breadcrumb links to.
|
|
609
|
+
*/
|
|
610
|
+
path?: string;
|
|
611
|
+
}
|
|
612
|
+
interface PageContainerSlotProps {
|
|
613
|
+
header: PageHeaderProps;
|
|
614
|
+
}
|
|
615
|
+
interface PageContainerSlots {
|
|
616
|
+
/**
|
|
617
|
+
* The component that renders the page header.
|
|
618
|
+
* @default PageHeader
|
|
619
|
+
*/
|
|
620
|
+
header: React.ElementType;
|
|
621
|
+
}
|
|
622
|
+
interface PageContainerProps extends ContainerProps {
|
|
623
|
+
children?: React.ReactNode;
|
|
624
|
+
/**
|
|
625
|
+
* The title of the page. Leave blank to use the active page title.
|
|
626
|
+
*/
|
|
627
|
+
title?: string;
|
|
628
|
+
/**
|
|
629
|
+
* The breadcrumbs of the page. Leave blank to use the active page breadcrumbs.
|
|
630
|
+
*/
|
|
631
|
+
breadcrumbs?: Breadcrumb[];
|
|
632
|
+
/**
|
|
633
|
+
* The components used for each slot inside.
|
|
634
|
+
*/
|
|
635
|
+
slots?: PageContainerSlots;
|
|
636
|
+
/**
|
|
637
|
+
* The props used for each slot inside.
|
|
638
|
+
*/
|
|
639
|
+
slotProps?: PageContainerSlotProps;
|
|
640
|
+
/**
|
|
641
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
642
|
+
*/
|
|
643
|
+
sx?: SxProps$1;
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* A container component to provide a title and breadcrumbs for your pages.
|
|
647
|
+
*
|
|
648
|
+
* Demos:
|
|
649
|
+
*
|
|
650
|
+
* - [Page Container](https://mui.com/toolpad/core/react-page-container/)
|
|
651
|
+
*
|
|
652
|
+
* API:
|
|
653
|
+
*
|
|
654
|
+
* - [PageContainer API](https://mui.com/toolpad/core/api/page-container)
|
|
655
|
+
*/
|
|
656
|
+
declare function PageContainer(props: PageContainerProps): react_jsx_runtime.JSX.Element;
|
|
657
|
+
declare namespace PageContainer {
|
|
658
|
+
var propTypes: any;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* A codec that can encode and decode values of type V to and from strings.
|
|
663
|
+
* @typeParam V The type of values that can be encoded and decoded.
|
|
664
|
+
*/
|
|
665
|
+
interface Codec<V> {
|
|
666
|
+
/**
|
|
667
|
+
* Decodes a string value into a value of type V.
|
|
668
|
+
* @param value The value to decode.
|
|
669
|
+
* @returns The decoded value.
|
|
670
|
+
*/
|
|
671
|
+
parse: (value: string) => V;
|
|
672
|
+
/**
|
|
673
|
+
* Encodes a value of type V into a string.
|
|
674
|
+
* @param value The value to encode.
|
|
675
|
+
* @returns The encoded value.
|
|
676
|
+
*/
|
|
677
|
+
stringify: (value: V) => string;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
type StorageStateInitializer<T> = () => T | null;
|
|
681
|
+
type UseStorageStateHookResult<T> = [
|
|
682
|
+
T | null,
|
|
683
|
+
React.Dispatch<React.SetStateAction<T | null>>
|
|
684
|
+
];
|
|
685
|
+
declare function useStorageStateServer<T = string>(): UseStorageStateHookResult<T>;
|
|
686
|
+
interface DefaultStorageStateoptions<T = string> {
|
|
687
|
+
codec?: Codec<T>;
|
|
688
|
+
}
|
|
689
|
+
interface StorageStateOptions<T> extends DefaultStorageStateoptions<T> {
|
|
690
|
+
codec: Codec<T>;
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* Sync state to local storage so that it persists through a page refresh. Usage is
|
|
694
|
+
* similar to useState except we pass in a storage key so that we can default
|
|
695
|
+
* to that value on page load instead of the specified initial value.
|
|
696
|
+
*
|
|
697
|
+
* Since the storage API isn't available in server-rendering environments, we
|
|
698
|
+
* return null during SSR and hydration.
|
|
699
|
+
*/
|
|
700
|
+
declare function useStorageState(area: Storage, key: string | null, initializer?: string | null | StorageStateInitializer<string>, options?: DefaultStorageStateoptions): UseStorageStateHookResult<string>;
|
|
701
|
+
declare function useStorageState<T>(area: Storage, key: string | null, initializer: T | null | StorageStateInitializer<T>, options: StorageStateOptions<T>): UseStorageStateHookResult<T>;
|
|
702
|
+
interface UseStorageState {
|
|
703
|
+
/**
|
|
704
|
+
* Sync state to local or session storage so that it persists through a page refresh. Usage is
|
|
705
|
+
* similar to useState except we pass in a storage key that uniquely identifies the value.
|
|
706
|
+
* @param key The key to use for storing the value in local or session storage.
|
|
707
|
+
* @param initializer The initial value to use if the key is not present in storage.
|
|
708
|
+
* @param options Additional options for the storage state.
|
|
709
|
+
*/
|
|
710
|
+
(key: string | null, initializer?: string | null | StorageStateInitializer<string>, options?: DefaultStorageStateoptions): UseStorageStateHookResult<string>;
|
|
711
|
+
/**
|
|
712
|
+
* Sync state to local or session storage so that it persists through a page refresh. Usage is
|
|
713
|
+
* similar to useState except we pass in a storage key that uniquely identifies the value.
|
|
714
|
+
* @param key The key to use for storing the value in local or session storage.
|
|
715
|
+
* @param initializer The initial value to use if the key is not present in storage.
|
|
716
|
+
* @param options Additional options for the storage state.
|
|
717
|
+
*/
|
|
718
|
+
<T>(key: string | null, initializer: T | null | StorageStateInitializer<T>, options: StorageStateOptions<T>): UseStorageStateHookResult<T>;
|
|
719
|
+
/**
|
|
720
|
+
* Sync state to local or session storage so that it persists through a page refresh. Usage is
|
|
721
|
+
* similar to useState except we pass in a storage key that uniquely identifies the value.
|
|
722
|
+
* @param key The key to use for storing the value in local or session storage.
|
|
723
|
+
* @param initializer The initial value to use if the key is not present in storage.
|
|
724
|
+
* @param options Additional options for the storage state.
|
|
725
|
+
*/
|
|
726
|
+
<T>(key: string | null, initializer?: T | null | StorageStateInitializer<T>, options?: StorageStateOptions<T>): UseStorageStateHookResult<T>;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
interface ActivePage {
|
|
730
|
+
title: string;
|
|
731
|
+
path: string;
|
|
732
|
+
breadcrumbs: Breadcrumb[];
|
|
733
|
+
}
|
|
734
|
+
declare function useActivePage(): ActivePage | null;
|
|
735
|
+
|
|
736
|
+
interface OpenDialogOptions<R> {
|
|
737
|
+
/**
|
|
738
|
+
* A function that is called before closing the dialog closes. The dialog
|
|
739
|
+
* stays open as long as the returned promise is not resolved. Use this if
|
|
740
|
+
* you want to perform an async action on close and show a loading state.
|
|
741
|
+
*
|
|
742
|
+
* @param result The result that the dialog will return after closing.
|
|
743
|
+
* @returns A promise that resolves when the dialog can be closed.
|
|
744
|
+
*/
|
|
745
|
+
onClose?: (result: R) => Promise<void>;
|
|
746
|
+
}
|
|
747
|
+
interface AlertOptions extends OpenDialogOptions<void> {
|
|
748
|
+
/**
|
|
749
|
+
* A title for the dialog. Defaults to `'Alert'`.
|
|
750
|
+
*/
|
|
751
|
+
title?: React.ReactNode;
|
|
752
|
+
/**
|
|
753
|
+
* The text to show in the "Ok" button. Defaults to `'Ok'`.
|
|
754
|
+
*/
|
|
755
|
+
okText?: React.ReactNode;
|
|
756
|
+
}
|
|
757
|
+
interface ConfirmOptions extends OpenDialogOptions<boolean> {
|
|
758
|
+
/**
|
|
759
|
+
* A title for the dialog. Defaults to `'Confirm'`.
|
|
760
|
+
*/
|
|
761
|
+
title?: React.ReactNode;
|
|
762
|
+
/**
|
|
763
|
+
* The text to show in the "Ok" button. Defaults to `'Ok'`.
|
|
764
|
+
*/
|
|
765
|
+
okText?: React.ReactNode;
|
|
766
|
+
/**
|
|
767
|
+
* Denotes the purpose of the dialog. This will affect the color of the
|
|
768
|
+
* "Ok" button. Defaults to `undefined`.
|
|
769
|
+
*/
|
|
770
|
+
severity?: 'error' | 'info' | 'success' | 'warning';
|
|
771
|
+
/**
|
|
772
|
+
* The text to show in the "Cancel" button. Defaults to `'Cancel'`.
|
|
773
|
+
*/
|
|
774
|
+
cancelText?: React.ReactNode;
|
|
775
|
+
}
|
|
776
|
+
interface PromptOptions extends OpenDialogOptions<string | null> {
|
|
777
|
+
/**
|
|
778
|
+
* A title for the dialog. Defaults to `'Prompt'`.
|
|
779
|
+
*/
|
|
780
|
+
title?: React.ReactNode;
|
|
781
|
+
/**
|
|
782
|
+
* The text to show in the "Ok" button. Defaults to `'Ok'`.
|
|
783
|
+
*/
|
|
784
|
+
okText?: React.ReactNode;
|
|
785
|
+
/**
|
|
786
|
+
* The text to show in the "Cancel" button. Defaults to `'Cancel'`.
|
|
787
|
+
*/
|
|
788
|
+
cancelText?: React.ReactNode;
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* The props that are passed to a dialog component.
|
|
792
|
+
*/
|
|
793
|
+
interface DialogProps<P = undefined, R = void> {
|
|
794
|
+
/**
|
|
795
|
+
* The payload that was passed when the dialog was opened.
|
|
796
|
+
*/
|
|
797
|
+
payload: P;
|
|
798
|
+
/**
|
|
799
|
+
* Whether the dialog is open.
|
|
800
|
+
*/
|
|
801
|
+
open: boolean;
|
|
802
|
+
/**
|
|
803
|
+
* A function to call when the dialog should be closed. If the dialog has a return
|
|
804
|
+
* value, it should be passed as an argument to this function. You should use the promise
|
|
805
|
+
* that is returned to show a loading state while the dialog is performing async actions
|
|
806
|
+
* on close.
|
|
807
|
+
* @param result The result to return from the dialog.
|
|
808
|
+
* @returns A promise that resolves when the dialog can be fully closed.
|
|
809
|
+
*/
|
|
810
|
+
onClose: (result: R) => Promise<void>;
|
|
811
|
+
}
|
|
812
|
+
interface OpenAlertDialog {
|
|
813
|
+
/**
|
|
814
|
+
* Open an alert dialog. Returns a promise that resolves when the user
|
|
815
|
+
* closes the dialog.
|
|
816
|
+
*
|
|
817
|
+
* @param msg The message to show in the dialog.
|
|
818
|
+
* @param options Additional options for the dialog.
|
|
819
|
+
* @returns A promise that resolves when the dialog is closed.
|
|
820
|
+
*/
|
|
821
|
+
(msg: React.ReactNode, options?: AlertOptions): Promise<void>;
|
|
822
|
+
}
|
|
823
|
+
interface OpenConfirmDialog {
|
|
824
|
+
/**
|
|
825
|
+
* Open a confirmation dialog. Returns a promise that resolves to true if
|
|
826
|
+
* the user confirms, false if the user cancels.
|
|
827
|
+
*
|
|
828
|
+
* @param msg The message to show in the dialog.
|
|
829
|
+
* @param options Additional options for the dialog.
|
|
830
|
+
* @returns A promise that resolves to true if the user confirms, false if the user cancels.
|
|
831
|
+
*/
|
|
832
|
+
(msg: React.ReactNode, options?: ConfirmOptions): Promise<boolean>;
|
|
833
|
+
}
|
|
834
|
+
interface OpenPromptDialog {
|
|
835
|
+
/**
|
|
836
|
+
* Open a prompt dialog to request user input. Returns a promise that resolves to the input
|
|
837
|
+
* if the user confirms, null if the user cancels.
|
|
838
|
+
*
|
|
839
|
+
* @param msg The message to show in the dialog.
|
|
840
|
+
* @param options Additional options for the dialog.
|
|
841
|
+
* @returns A promise that resolves to the user input if the user confirms, null if the user cancels.
|
|
842
|
+
*/
|
|
843
|
+
(msg: React.ReactNode, options?: PromptOptions): Promise<string | null>;
|
|
844
|
+
}
|
|
845
|
+
type DialogComponent<P, R> = React.ComponentType<DialogProps<P, R>>;
|
|
846
|
+
interface OpenDialog {
|
|
847
|
+
/**
|
|
848
|
+
* Open a dialog without payload.
|
|
849
|
+
* @param Component The dialog component to open.
|
|
850
|
+
* @param options Additional options for the dialog.
|
|
851
|
+
*/
|
|
852
|
+
<P extends undefined, R>(Component: DialogComponent<P, R>, payload?: P, options?: OpenDialogOptions<R>): Promise<R>;
|
|
853
|
+
/**
|
|
854
|
+
* Open a dialog and pass a payload.
|
|
855
|
+
* @param Component The dialog component to open.
|
|
856
|
+
* @param payload The payload to pass to the dialog.
|
|
857
|
+
* @param options Additional options for the dialog.
|
|
858
|
+
*/
|
|
859
|
+
<P, R>(Component: DialogComponent<P, R>, payload: P, options?: OpenDialogOptions<R>): Promise<R>;
|
|
860
|
+
}
|
|
861
|
+
interface CloseDialog {
|
|
862
|
+
/**
|
|
863
|
+
* Close a dialog and return a result.
|
|
864
|
+
* @param dialog The dialog to close. The promise returned by `open`.
|
|
865
|
+
* @param result The result to return from the dialog.
|
|
866
|
+
* @returns A promise that resolves when the dialog is fully closed.
|
|
867
|
+
*/
|
|
868
|
+
<R>(dialog: Promise<R>, result: R): Promise<R>;
|
|
869
|
+
}
|
|
870
|
+
interface DialogHook {
|
|
871
|
+
alert: OpenAlertDialog;
|
|
872
|
+
confirm: OpenConfirmDialog;
|
|
873
|
+
prompt: OpenPromptDialog;
|
|
874
|
+
open: OpenDialog;
|
|
875
|
+
close: CloseDialog;
|
|
876
|
+
}
|
|
877
|
+
interface AlertDialogPayload extends AlertOptions {
|
|
878
|
+
msg: React.ReactNode;
|
|
879
|
+
}
|
|
880
|
+
interface AlertDialogProps extends DialogProps<AlertDialogPayload, void> {
|
|
881
|
+
}
|
|
882
|
+
declare function AlertDialog({ open, payload, onClose }: AlertDialogProps): react_jsx_runtime.JSX.Element;
|
|
883
|
+
interface ConfirmDialogPayload extends ConfirmOptions {
|
|
884
|
+
msg: React.ReactNode;
|
|
885
|
+
}
|
|
886
|
+
interface ConfirmDialogProps extends DialogProps<ConfirmDialogPayload, boolean> {
|
|
887
|
+
}
|
|
888
|
+
declare function ConfirmDialog({ open, payload, onClose }: ConfirmDialogProps): react_jsx_runtime.JSX.Element;
|
|
889
|
+
interface PromptDialogPayload extends PromptOptions {
|
|
890
|
+
msg: React.ReactNode;
|
|
891
|
+
}
|
|
892
|
+
interface PromptDialogProps extends DialogProps<PromptDialogPayload, string | null> {
|
|
893
|
+
}
|
|
894
|
+
declare function PromptDialog({ open, payload, onClose }: PromptDialogProps): react_jsx_runtime.JSX.Element;
|
|
895
|
+
declare function useDialogs(): DialogHook;
|
|
896
|
+
|
|
897
|
+
interface DialogProviderProps {
|
|
898
|
+
children?: React.ReactNode;
|
|
899
|
+
unmountAfter?: number;
|
|
900
|
+
}
|
|
901
|
+
/**
|
|
902
|
+
* Provider for Dialog stacks. The subtree of this component can use the `useDialogs` hook to
|
|
903
|
+
* access the dialogs API. The dialogs are rendered in the order they are requested.
|
|
904
|
+
*
|
|
905
|
+
* Demos:
|
|
906
|
+
*
|
|
907
|
+
* - [useDialogs](https://mui.com/toolpad/core/react-use-dialogs/)
|
|
908
|
+
*
|
|
909
|
+
* API:
|
|
910
|
+
*
|
|
911
|
+
* - [DialogsProvider API](https://mui.com/toolpad/core/api/dialogs-provider)
|
|
912
|
+
*/
|
|
913
|
+
declare function DialogsProvider(props: DialogProviderProps): react_jsx_runtime.JSX.Element;
|
|
914
|
+
|
|
915
|
+
declare const useLocalStorageState: UseStorageState;
|
|
916
|
+
|
|
917
|
+
interface ShowNotificationOptions {
|
|
918
|
+
/**
|
|
919
|
+
* The key to use for deduping notifications. If not provided, a unique key will be generated.
|
|
920
|
+
*/
|
|
921
|
+
key?: string;
|
|
922
|
+
/**
|
|
923
|
+
* The severity of the notification. When provided, the snackbar will show an alert with the
|
|
924
|
+
* specified severity.
|
|
925
|
+
*/
|
|
926
|
+
severity?: 'info' | 'warning' | 'error' | 'success';
|
|
927
|
+
/**
|
|
928
|
+
* The duration in milliseconds after which the notification will automatically close.
|
|
929
|
+
*/
|
|
930
|
+
autoHideDuration?: number;
|
|
931
|
+
/**
|
|
932
|
+
* The text to display on the action button.
|
|
933
|
+
*/
|
|
934
|
+
actionText?: React.ReactNode;
|
|
935
|
+
/**
|
|
936
|
+
* The callback to call when the action button is clicked.
|
|
937
|
+
*/
|
|
938
|
+
onAction?: () => void;
|
|
939
|
+
}
|
|
940
|
+
interface ShowNotification {
|
|
941
|
+
/**
|
|
942
|
+
* Show a snackbar in the application.
|
|
943
|
+
*
|
|
944
|
+
* @param message The message to display in the snackbar.
|
|
945
|
+
* @param options Options for the snackbar.
|
|
946
|
+
* @returns The key that represents the notification. Useful for programmatically
|
|
947
|
+
* closing it.
|
|
948
|
+
*/
|
|
949
|
+
(message: React.ReactNode, options?: ShowNotificationOptions): string;
|
|
950
|
+
}
|
|
951
|
+
interface CloseNotification {
|
|
952
|
+
/**
|
|
953
|
+
* Close a snackbar in the application.
|
|
954
|
+
*
|
|
955
|
+
* @param key The key of the notification to close.
|
|
956
|
+
*/
|
|
957
|
+
(key: string): void;
|
|
958
|
+
}
|
|
959
|
+
interface UseNotifications {
|
|
960
|
+
show: ShowNotification;
|
|
961
|
+
close: CloseNotification;
|
|
962
|
+
}
|
|
963
|
+
declare function useNotifications(): UseNotifications;
|
|
964
|
+
|
|
965
|
+
interface NotificationsProviderSlotProps {
|
|
966
|
+
snackbar: SnackbarProps;
|
|
967
|
+
}
|
|
968
|
+
interface NotificationsProviderSlots {
|
|
969
|
+
/**
|
|
970
|
+
* The component that renders the snackbar.
|
|
971
|
+
* @default Snackbar
|
|
972
|
+
*/
|
|
973
|
+
snackbar: React.ElementType;
|
|
974
|
+
}
|
|
975
|
+
interface NotificationsProviderProps {
|
|
976
|
+
children?: React.ReactNode;
|
|
977
|
+
slots?: Partial<NotificationsProviderSlots>;
|
|
978
|
+
slotProps?: Partial<NotificationsProviderSlotProps>;
|
|
979
|
+
}
|
|
980
|
+
/**
|
|
981
|
+
* Provider for Notifications. The subtree of this component can use the `useNotifications` hook to
|
|
982
|
+
* access the notifications API. The notifications are shown in the same order they are requested.
|
|
983
|
+
*
|
|
984
|
+
* Demos:
|
|
985
|
+
*
|
|
986
|
+
* - [Sign-in Page](https://mui.com/toolpad/core/react-sign-in-page/)
|
|
987
|
+
* - [useNotifications](https://mui.com/toolpad/core/react-use-notifications/)
|
|
988
|
+
*
|
|
989
|
+
* API:
|
|
990
|
+
*
|
|
991
|
+
* - [NotificationsProvider API](https://mui.com/toolpad/core/api/notifications-provider)
|
|
992
|
+
*/
|
|
993
|
+
declare function NotificationsProvider(props: NotificationsProviderProps): react_jsx_runtime.JSX.Element;
|
|
994
|
+
|
|
995
|
+
export { Account, AccountPopoverFooter, type AccountPopoverFooterProps, AccountPopoverHeader, type AccountPopoverHeaderProps, AccountPreview, type AccountPreviewProps, type AccountPreviewSlots, type AccountPreviewVariant, type AccountProps, type AccountSlots, type ActivePage, AlertDialog, type AlertDialogPayload, type AlertDialogProps, type AlertOptions, Branding, type Breadcrumb, type CloseDialog, type CloseNotification, ConfirmDialog, type ConfirmDialogPayload, type ConfirmDialogProps, type ConfirmOptions, DashboardHeader, type DashboardHeaderProps, type DashboardHeaderSlotProps, type DashboardHeaderSlots, DashboardLayout, type DashboardLayoutProps, type DashboardLayoutSlotProps, type DashboardLayoutSlots, DashboardSidebarPageItem, type DashboardSidebarPageItemContextProps, type DashboardSidebarPageItemProps, type DefaultStorageStateoptions, type DialogComponent, type DialogHook, type DialogProps, type DialogProviderProps, DialogsProvider, Navigation, NavigationPageItem, NotificationsProvider, type NotificationsProviderProps, type NotificationsProviderSlotProps, type NotificationsProviderSlots, type OpenAlertDialog, type OpenConfirmDialog, type OpenDialog, type OpenDialogOptions, type OpenPromptDialog, PageContainer, type PageContainerProps, type PageContainerSlotProps, type PageContainerSlots, PageHeader, type PageHeaderProps, type PageHeaderSlotProps, type PageHeaderSlots, PageHeaderToolbar, type PageHeaderToolbarProps, PromptDialog, type PromptDialogPayload, type PromptDialogProps, type PromptOptions, type ShowNotification, type ShowNotificationOptions, type SidebarFooterProps, SignInButton, SignOutButton, type SignOutButtonProps, type StorageStateInitializer, type StorageStateOptions, ThemeSwitcher, ToolbarActions, type UseStorageState, type UseStorageStateHookResult, _default as en, useActivePage, useDialogs, useLocalStorageState, useNotifications, useStorageState, useStorageStateServer };
|