@etsoo/toolpad 1.0.12 → 1.0.13

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 (260) hide show
  1. package/babel.config.json +11 -0
  2. package/build/cjs/Account/Account.js +104 -0
  3. package/build/cjs/Account/Account.test.js +40 -0
  4. package/build/cjs/Account/AccountPopoverFooter.js +18 -0
  5. package/build/cjs/Account/AccountPopoverHeader.js +12 -0
  6. package/build/cjs/Account/AccountPreview.js +96 -0
  7. package/build/cjs/Account/AccountPreview.test.js +52 -0
  8. package/build/cjs/Account/SignInButton.js +56 -0
  9. package/build/cjs/Account/SignOutButton.js +58 -0
  10. package/build/cjs/Account/index.js +22 -0
  11. package/build/cjs/AppProvider/AppProvider.js +40 -0
  12. package/build/cjs/AppProvider/AppProvider.test.js +18 -0
  13. package/build/cjs/AppProvider/AppProviderComponent.js +33 -0
  14. package/build/cjs/AppProvider/AppThemeProvider.js +111 -0
  15. package/build/cjs/AppProvider/index.js +17 -0
  16. package/build/cjs/DashboardLayout/DashboardLayout.js +230 -0
  17. package/build/cjs/DashboardLayout/DashboardLayout.test.js +296 -0
  18. package/build/cjs/DashboardLayout/DashboardSidebarSubNavigation.js +185 -0
  19. package/build/cjs/DashboardLayout/ThemeSwitcher.js +84 -0
  20. package/build/cjs/DashboardLayout/TitleBar.d.ts +2 -0
  21. package/build/cjs/DashboardLayout/TitleBar.js +57 -0
  22. package/build/cjs/DashboardLayout/ToolbarActions.js +11 -0
  23. package/build/cjs/DashboardLayout/index.js +19 -0
  24. package/build/cjs/DashboardLayout/utils.js +20 -0
  25. package/build/{PageContainer → cjs/PageContainer}/PageContainer.d.ts +4 -0
  26. package/build/cjs/PageContainer/PageContainer.js +133 -0
  27. package/build/cjs/PageContainer/PageContainer.test.js +128 -0
  28. package/build/cjs/PageContainer/PageContainerToolbar.js +26 -0
  29. package/build/cjs/PageContainer/PageContainerToolbar.test.js +15 -0
  30. package/build/cjs/PageContainer/index.js +18 -0
  31. package/build/cjs/index.js +24 -0
  32. package/build/cjs/nextjs/AppProvider.js +18 -0
  33. package/build/cjs/nextjs/AppProvider.test.js +71 -0
  34. package/build/cjs/nextjs/AppProviderNextApp.js +63 -0
  35. package/build/cjs/nextjs/AppProviderNextPages.js +73 -0
  36. package/build/cjs/nextjs/index.js +17 -0
  37. package/build/cjs/persistence/codec.js +60 -0
  38. package/build/cjs/persistence/index.js +17 -0
  39. package/build/cjs/persistence/useStorageState.js +153 -0
  40. package/build/cjs/persistence/useStorageState.test.js +63 -0
  41. package/build/cjs/react-router-dom/AppProvider.js +64 -0
  42. package/build/cjs/react-router-dom/AppProvider.test.js +14 -0
  43. package/build/cjs/react-router-dom/index.js +17 -0
  44. package/build/cjs/shared/Link.js +55 -0
  45. package/build/cjs/shared/components.js +30 -0
  46. package/build/cjs/shared/context.js +46 -0
  47. package/build/cjs/shared/locales/LocaleContext.js +71 -0
  48. package/build/cjs/shared/navigation.js +151 -0
  49. package/build/cjs/useActivePage/index.js +17 -0
  50. package/build/cjs/useActivePage/useActivePage.js +83 -0
  51. package/build/cjs/useLocalStorageState/index.js +17 -0
  52. package/build/cjs/useLocalStorageState/useLocalStorageState.js +17 -0
  53. package/build/cjs/useSessionStorageState/index.js +17 -0
  54. package/build/cjs/useSessionStorageState/useSessionStorageState.js +17 -0
  55. package/build/cjs/utils/collections.js +53 -0
  56. package/build/cjs/utils/describeConformance.js +6 -0
  57. package/build/cjs/utils/events.js +58 -0
  58. package/build/cjs/utils/hooks/index.js +10 -0
  59. package/build/cjs/utils/hooks/useBoolean.js +47 -0
  60. package/build/cjs/utils/hooks/useDebounced.js +64 -0
  61. package/build/cjs/utils/hooks/useDebouncedHandler.js +77 -0
  62. package/build/cjs/utils/hooks/useLatest.js +44 -0
  63. package/build/cjs/utils/hooks/usePageTitle.js +49 -0
  64. package/build/cjs/utils/hooks/useSsr.js +52 -0
  65. package/build/cjs/utils/hooks/useStorageState.js +86 -0
  66. package/build/cjs/utils/warnOnce.js +14 -0
  67. package/build/mjs/Account/Account.d.ts +63 -0
  68. package/build/mjs/Account/Account.test.d.ts +1 -0
  69. package/build/mjs/Account/AccountPopoverFooter.d.ts +6 -0
  70. package/build/mjs/Account/AccountPopoverHeader.d.ts +6 -0
  71. package/build/mjs/Account/AccountPreview.d.ts +64 -0
  72. package/build/mjs/Account/AccountPreview.test.d.ts +1 -0
  73. package/build/mjs/Account/SignInButton.d.ts +2 -0
  74. package/build/mjs/Account/SignOutButton.d.ts +3 -0
  75. package/build/mjs/Account/index.js +6 -0
  76. package/build/mjs/AppProvider/AppProvider.d.ts +105 -0
  77. package/build/mjs/AppProvider/AppProvider.test.d.ts +4 -0
  78. package/build/mjs/AppProvider/AppProviderComponent.d.ts +14 -0
  79. package/build/mjs/AppProvider/AppThemeProvider.d.ts +12 -0
  80. package/build/mjs/DashboardLayout/DashboardLayout.d.ts +91 -0
  81. package/build/{DashboardLayout → mjs/DashboardLayout}/DashboardLayout.js +9 -10
  82. package/build/mjs/DashboardLayout/DashboardLayout.test.d.ts +1 -0
  83. package/build/mjs/DashboardLayout/DashboardSidebarSubNavigation.d.ts +16 -0
  84. package/build/mjs/DashboardLayout/ThemeSwitcher.d.ts +5 -0
  85. package/build/mjs/DashboardLayout/TitleBar.d.ts +2 -0
  86. package/build/mjs/DashboardLayout/ToolbarActions.d.ts +5 -0
  87. package/build/mjs/DashboardLayout/index.d.ts +2 -0
  88. package/build/mjs/DashboardLayout/utils.d.ts +8 -0
  89. package/build/mjs/PageContainer/PageContainer.d.ts +61 -0
  90. package/build/{PageContainer → mjs/PageContainer}/PageContainer.js +8 -4
  91. package/build/mjs/PageContainer/PageContainer.test.d.ts +1 -0
  92. package/build/mjs/PageContainer/PageContainerToolbar.d.ts +16 -0
  93. package/build/mjs/PageContainer/PageContainerToolbar.test.d.ts +1 -0
  94. package/build/mjs/PageContainer/index.js +2 -0
  95. package/build/mjs/index.js +8 -0
  96. package/build/mjs/nextjs/AppProvider.d.ts +6 -0
  97. package/build/mjs/nextjs/AppProvider.test.d.ts +1 -0
  98. package/build/mjs/nextjs/AppProviderNextApp.d.ts +5 -0
  99. package/build/mjs/nextjs/AppProviderNextPages.d.ts +5 -0
  100. package/build/mjs/nextjs/index.js +1 -0
  101. package/build/mjs/persistence/codec.d.ts +47 -0
  102. package/build/mjs/persistence/index.js +1 -0
  103. package/build/mjs/persistence/useStorageState.d.ts +50 -0
  104. package/build/mjs/persistence/useStorageState.test.d.ts +1 -0
  105. package/build/mjs/react-router-dom/AppProvider.d.ts +6 -0
  106. package/build/mjs/react-router-dom/AppProvider.test.d.ts +1 -0
  107. package/build/mjs/react-router-dom/index.d.ts +1 -0
  108. package/build/mjs/react-router-dom/index.js +1 -0
  109. package/build/mjs/shared/Link.d.ts +8 -0
  110. package/build/mjs/shared/components.d.ts +5 -0
  111. package/build/mjs/shared/context.d.ts +12 -0
  112. package/build/mjs/shared/locales/LocaleContext.d.ts +56 -0
  113. package/build/mjs/shared/navigation.d.ts +16 -0
  114. package/build/mjs/useActivePage/index.js +1 -0
  115. package/build/mjs/useActivePage/useActivePage.d.ts +8 -0
  116. package/build/mjs/useLocalStorageState/index.js +1 -0
  117. package/build/mjs/useLocalStorageState/useLocalStorageState.d.ts +2 -0
  118. package/build/mjs/useSessionStorageState/index.js +1 -0
  119. package/build/mjs/useSessionStorageState/useSessionStorageState.d.ts +2 -0
  120. package/build/mjs/utils/collections.d.ts +44 -0
  121. package/build/mjs/utils/describeConformance.d.ts +7 -0
  122. package/build/mjs/utils/events.d.ts +27 -0
  123. package/build/mjs/utils/hooks/index.js +2 -0
  124. package/build/mjs/utils/hooks/useBoolean.d.ts +11 -0
  125. package/build/mjs/utils/hooks/useDebounced.d.ts +8 -0
  126. package/build/mjs/utils/hooks/useDebouncedHandler.d.ts +12 -0
  127. package/build/mjs/utils/hooks/useLatest.d.ts +6 -0
  128. package/build/mjs/utils/hooks/usePageTitle.d.ts +4 -0
  129. package/build/mjs/utils/hooks/useSsr.d.ts +4 -0
  130. package/build/mjs/utils/hooks/useStorageState.d.ts +10 -0
  131. package/build/mjs/utils/warnOnce.d.ts +5 -0
  132. package/package.json +33 -23
  133. package/src/DashboardLayout/DashboardLayout.tsx +13 -12
  134. package/src/PageContainer/PageContainer.tsx +12 -4
  135. package/tsconfig.cjs.json +20 -0
  136. package/tsconfig.json +2 -2
  137. package/build/DashboardLayout/TitleBar.d.ts +0 -2
  138. /package/build/{Account → cjs/Account}/Account.d.ts +0 -0
  139. /package/build/{Account → cjs/Account}/Account.test.d.ts +0 -0
  140. /package/build/{Account → cjs/Account}/AccountPopoverFooter.d.ts +0 -0
  141. /package/build/{Account → cjs/Account}/AccountPopoverHeader.d.ts +0 -0
  142. /package/build/{Account → cjs/Account}/AccountPreview.d.ts +0 -0
  143. /package/build/{Account → cjs/Account}/AccountPreview.test.d.ts +0 -0
  144. /package/build/{Account → cjs/Account}/SignInButton.d.ts +0 -0
  145. /package/build/{Account → cjs/Account}/SignOutButton.d.ts +0 -0
  146. /package/build/{Account → cjs/Account}/index.d.ts +0 -0
  147. /package/build/{AppProvider → cjs/AppProvider}/AppProvider.d.ts +0 -0
  148. /package/build/{AppProvider → cjs/AppProvider}/AppProvider.test.d.ts +0 -0
  149. /package/build/{AppProvider → cjs/AppProvider}/AppProviderComponent.d.ts +0 -0
  150. /package/build/{AppProvider → cjs/AppProvider}/AppThemeProvider.d.ts +0 -0
  151. /package/build/{AppProvider → cjs/AppProvider}/index.d.ts +0 -0
  152. /package/build/{DashboardLayout → cjs/DashboardLayout}/DashboardLayout.d.ts +0 -0
  153. /package/build/{DashboardLayout → cjs/DashboardLayout}/DashboardLayout.test.d.ts +0 -0
  154. /package/build/{DashboardLayout → cjs/DashboardLayout}/DashboardSidebarSubNavigation.d.ts +0 -0
  155. /package/build/{DashboardLayout → cjs/DashboardLayout}/ThemeSwitcher.d.ts +0 -0
  156. /package/build/{DashboardLayout → cjs/DashboardLayout}/ToolbarActions.d.ts +0 -0
  157. /package/build/{DashboardLayout → cjs/DashboardLayout}/index.d.ts +0 -0
  158. /package/build/{DashboardLayout → cjs/DashboardLayout}/utils.d.ts +0 -0
  159. /package/build/{PageContainer → cjs/PageContainer}/PageContainer.test.d.ts +0 -0
  160. /package/build/{PageContainer → cjs/PageContainer}/PageContainerToolbar.d.ts +0 -0
  161. /package/build/{PageContainer → cjs/PageContainer}/PageContainerToolbar.test.d.ts +0 -0
  162. /package/build/{PageContainer → cjs/PageContainer}/index.d.ts +0 -0
  163. /package/build/{index.d.ts → cjs/index.d.ts} +0 -0
  164. /package/build/{nextjs → cjs/nextjs}/AppProvider.d.ts +0 -0
  165. /package/build/{nextjs → cjs/nextjs}/AppProvider.test.d.ts +0 -0
  166. /package/build/{nextjs → cjs/nextjs}/AppProviderNextApp.d.ts +0 -0
  167. /package/build/{nextjs → cjs/nextjs}/AppProviderNextPages.d.ts +0 -0
  168. /package/build/{nextjs → cjs/nextjs}/index.d.ts +0 -0
  169. /package/build/{persistence → cjs/persistence}/codec.d.ts +0 -0
  170. /package/build/{persistence → cjs/persistence}/index.d.ts +0 -0
  171. /package/build/{persistence → cjs/persistence}/useStorageState.d.ts +0 -0
  172. /package/build/{persistence → cjs/persistence}/useStorageState.test.d.ts +0 -0
  173. /package/build/{react-router-dom → cjs/react-router-dom}/AppProvider.d.ts +0 -0
  174. /package/build/{react-router-dom → cjs/react-router-dom}/AppProvider.test.d.ts +0 -0
  175. /package/build/{react-router-dom → cjs/react-router-dom}/index.d.ts +0 -0
  176. /package/build/{shared → cjs/shared}/Link.d.ts +0 -0
  177. /package/build/{shared → cjs/shared}/components.d.ts +0 -0
  178. /package/build/{shared → cjs/shared}/context.d.ts +0 -0
  179. /package/build/{shared → cjs/shared}/locales/LocaleContext.d.ts +0 -0
  180. /package/build/{shared → cjs/shared}/navigation.d.ts +0 -0
  181. /package/build/{useActivePage → cjs/useActivePage}/index.d.ts +0 -0
  182. /package/build/{useActivePage → cjs/useActivePage}/useActivePage.d.ts +0 -0
  183. /package/build/{useLocalStorageState → cjs/useLocalStorageState}/index.d.ts +0 -0
  184. /package/build/{useLocalStorageState → cjs/useLocalStorageState}/useLocalStorageState.d.ts +0 -0
  185. /package/build/{useSessionStorageState → cjs/useSessionStorageState}/index.d.ts +0 -0
  186. /package/build/{useSessionStorageState → cjs/useSessionStorageState}/useSessionStorageState.d.ts +0 -0
  187. /package/build/{utils → cjs/utils}/collections.d.ts +0 -0
  188. /package/build/{utils → cjs/utils}/describeConformance.d.ts +0 -0
  189. /package/build/{utils → cjs/utils}/events.d.ts +0 -0
  190. /package/build/{utils → cjs/utils}/hooks/index.d.ts +0 -0
  191. /package/build/{utils → cjs/utils}/hooks/useBoolean.d.ts +0 -0
  192. /package/build/{utils → cjs/utils}/hooks/useDebounced.d.ts +0 -0
  193. /package/build/{utils → cjs/utils}/hooks/useDebouncedHandler.d.ts +0 -0
  194. /package/build/{utils → cjs/utils}/hooks/useLatest.d.ts +0 -0
  195. /package/build/{utils → cjs/utils}/hooks/usePageTitle.d.ts +0 -0
  196. /package/build/{utils → cjs/utils}/hooks/useSsr.d.ts +0 -0
  197. /package/build/{utils → cjs/utils}/hooks/useStorageState.d.ts +0 -0
  198. /package/build/{utils → cjs/utils}/warnOnce.d.ts +0 -0
  199. /package/build/{Account → mjs/Account}/Account.js +0 -0
  200. /package/build/{Account → mjs/Account}/Account.test.js +0 -0
  201. /package/build/{Account → mjs/Account}/AccountPopoverFooter.js +0 -0
  202. /package/build/{Account → mjs/Account}/AccountPopoverHeader.js +0 -0
  203. /package/build/{Account → mjs/Account}/AccountPreview.js +0 -0
  204. /package/build/{Account → mjs/Account}/AccountPreview.test.js +0 -0
  205. /package/build/{Account → mjs/Account}/SignInButton.js +0 -0
  206. /package/build/{Account → mjs/Account}/SignOutButton.js +0 -0
  207. /package/build/{Account/index.js → mjs/Account/index.d.ts} +0 -0
  208. /package/build/{AppProvider → mjs/AppProvider}/AppProvider.js +0 -0
  209. /package/build/{AppProvider → mjs/AppProvider}/AppProvider.test.js +0 -0
  210. /package/build/{AppProvider → mjs/AppProvider}/AppProviderComponent.js +0 -0
  211. /package/build/{AppProvider → mjs/AppProvider}/AppThemeProvider.js +0 -0
  212. /package/build/{AppProvider/index.js → mjs/AppProvider/index.d.ts} +0 -0
  213. /package/build/{nextjs → mjs/AppProvider}/index.js +0 -0
  214. /package/build/{DashboardLayout → mjs/DashboardLayout}/DashboardLayout.test.js +0 -0
  215. /package/build/{DashboardLayout → mjs/DashboardLayout}/DashboardSidebarSubNavigation.js +0 -0
  216. /package/build/{DashboardLayout → mjs/DashboardLayout}/ThemeSwitcher.js +0 -0
  217. /package/build/{DashboardLayout → mjs/DashboardLayout}/TitleBar.js +0 -0
  218. /package/build/{DashboardLayout → mjs/DashboardLayout}/ToolbarActions.js +0 -0
  219. /package/build/{DashboardLayout → mjs/DashboardLayout}/index.js +0 -0
  220. /package/build/{DashboardLayout → mjs/DashboardLayout}/utils.js +0 -0
  221. /package/build/{PageContainer → mjs/PageContainer}/PageContainer.test.js +0 -0
  222. /package/build/{PageContainer → mjs/PageContainer}/PageContainerToolbar.js +0 -0
  223. /package/build/{PageContainer → mjs/PageContainer}/PageContainerToolbar.test.js +0 -0
  224. /package/build/{PageContainer/index.js → mjs/PageContainer/index.d.ts} +0 -0
  225. /package/build/{index.js → mjs/index.d.ts} +0 -0
  226. /package/build/{nextjs → mjs/nextjs}/AppProvider.js +0 -0
  227. /package/build/{nextjs → mjs/nextjs}/AppProvider.test.js +0 -0
  228. /package/build/{nextjs → mjs/nextjs}/AppProviderNextApp.js +0 -0
  229. /package/build/{nextjs → mjs/nextjs}/AppProviderNextPages.js +0 -0
  230. /package/build/{react-router-dom/index.js → mjs/nextjs/index.d.ts} +0 -0
  231. /package/build/{persistence → mjs/persistence}/codec.js +0 -0
  232. /package/build/{persistence/index.js → mjs/persistence/index.d.ts} +0 -0
  233. /package/build/{persistence → mjs/persistence}/useStorageState.js +0 -0
  234. /package/build/{persistence → mjs/persistence}/useStorageState.test.js +0 -0
  235. /package/build/{react-router-dom → mjs/react-router-dom}/AppProvider.js +0 -0
  236. /package/build/{react-router-dom → mjs/react-router-dom}/AppProvider.test.js +0 -0
  237. /package/build/{shared → mjs/shared}/Link.js +0 -0
  238. /package/build/{shared → mjs/shared}/components.js +0 -0
  239. /package/build/{shared → mjs/shared}/context.js +0 -0
  240. /package/build/{shared → mjs/shared}/locales/LocaleContext.js +0 -0
  241. /package/build/{shared → mjs/shared}/navigation.js +0 -0
  242. /package/build/{useActivePage/index.js → mjs/useActivePage/index.d.ts} +0 -0
  243. /package/build/{useActivePage → mjs/useActivePage}/useActivePage.js +0 -0
  244. /package/build/{useLocalStorageState/index.js → mjs/useLocalStorageState/index.d.ts} +0 -0
  245. /package/build/{useLocalStorageState → mjs/useLocalStorageState}/useLocalStorageState.js +0 -0
  246. /package/build/{useSessionStorageState/index.js → mjs/useSessionStorageState/index.d.ts} +0 -0
  247. /package/build/{useSessionStorageState → mjs/useSessionStorageState}/useSessionStorageState.js +0 -0
  248. /package/build/{utils → mjs/utils}/collections.js +0 -0
  249. /package/build/{utils → mjs/utils}/describeConformance.js +0 -0
  250. /package/build/{utils → mjs/utils}/events.js +0 -0
  251. /package/build/{utils/hooks/index.js → mjs/utils/hooks/index.d.ts} +0 -0
  252. /package/build/{utils → mjs/utils}/hooks/useBoolean.js +0 -0
  253. /package/build/{utils → mjs/utils}/hooks/useDebounced.js +0 -0
  254. /package/build/{utils → mjs/utils}/hooks/useDebouncedHandler.js +0 -0
  255. /package/build/{utils → mjs/utils}/hooks/useLatest.js +0 -0
  256. /package/build/{utils → mjs/utils}/hooks/usePageTitle.js +0 -0
  257. /package/build/{utils → mjs/utils}/hooks/useSsr.js +0 -0
  258. /package/build/{utils → mjs/utils}/hooks/useStorageState.js +0 -0
  259. /package/build/{utils → mjs/utils}/warnOnce.js +0 -0
  260. /package/{vite.config.ts → vite.config.mts} +0 -0
@@ -0,0 +1,64 @@
1
+ import * as React from "react";
2
+ import { AvatarProps } from "@mui/material/Avatar";
3
+ import { IconButtonProps } from "@mui/material/IconButton";
4
+ export type AccountPreviewVariant = "condensed" | "expanded";
5
+ export interface AccountPreviewSlots {
6
+ /**
7
+ * The component used for the Avatar
8
+ * @default Avatar
9
+ */
10
+ avatar?: React.ElementType;
11
+ /**
12
+ * The component used for the overflow icon button in the expanded variant
13
+ * @default IconButton
14
+ */
15
+ moreIconButton?: React.ElementType;
16
+ /**
17
+ * The component used for the avatar icon button in the condensed variant
18
+ * @default IconButton
19
+ */
20
+ avatarIconButton?: React.ElementType;
21
+ }
22
+ export interface AccountPreviewProps {
23
+ /**
24
+ * The components used for each slot inside.
25
+ */
26
+ slots?: AccountPreviewSlots;
27
+ /**
28
+ * The props used for each slot inside.
29
+ */
30
+ slotProps?: {
31
+ avatar?: AvatarProps;
32
+ moreIconButton?: IconButtonProps;
33
+ avatarIconButton?: IconButtonProps;
34
+ };
35
+ /**
36
+ * The type of account details to display.
37
+ * @property {'condensed'} condensed - Shows only the user's avatar.
38
+ * @property {'expanded'} expanded - Displays the user's avatar, name, and email if available.
39
+ * @default 'condensed'
40
+ */
41
+ variant?: AccountPreviewVariant;
42
+ /**
43
+ * The handler used when the preview is expanded
44
+ */
45
+ handleClick?: React.MouseEventHandler<HTMLElement>;
46
+ /**
47
+ * The state of the Account popover
48
+ * @default false
49
+ */
50
+ open?: boolean;
51
+ }
52
+ /**
53
+ * The AccountPreview component displays user account information.
54
+ *
55
+ * Demos:
56
+ *
57
+ * - [Account](https://mui.com/toolpad/core/react-account/)
58
+ *
59
+ * API:
60
+ *
61
+ * - [AccountPreview API](https://mui.com/toolpad/core/api/account-preview)
62
+ */
63
+ declare function AccountPreview(props: AccountPreviewProps): import("react/jsx-runtime").JSX.Element | null;
64
+ export { AccountPreview };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { ButtonProps } from "@mui/material/Button";
2
+ export declare function SignInButton(props: ButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { ButtonProps } from "@mui/material/Button";
2
+ export type SignOutButtonProps = ButtonProps;
3
+ export declare function SignOutButton(props: SignOutButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ export * from "./Account";
2
+ export * from "./AccountPreview";
3
+ export * from "./AccountPopoverHeader";
4
+ export * from "./AccountPopoverFooter";
5
+ export * from "./SignOutButton";
6
+ export * from "./SignInButton";
@@ -0,0 +1,105 @@
1
+ import * as React from "react";
2
+ import { Theme } from "@mui/material/styles";
3
+ import { LocaleContextType } from "../shared/locales/LocaleContext";
4
+ export interface NavigateOptions {
5
+ history?: "auto" | "push" | "replace";
6
+ }
7
+ export interface Navigate {
8
+ (url: string | URL, options?: NavigateOptions): void;
9
+ }
10
+ /**
11
+ * Abstract router used by Toolpad components.
12
+ */
13
+ export interface Router {
14
+ pathname: string;
15
+ searchParams: URLSearchParams;
16
+ navigate: Navigate;
17
+ }
18
+ export interface Branding {
19
+ title?: React.ReactNode | [string, (handler: React.MouseEvent<HTMLSpanElement>) => void];
20
+ logo?: React.ReactNode;
21
+ }
22
+ export interface NavigationPageItem {
23
+ kind?: "page";
24
+ segment?: string;
25
+ title?: string;
26
+ icon?: React.ReactNode;
27
+ pattern?: string;
28
+ action?: React.ReactNode;
29
+ children?: Navigation;
30
+ subs?: string[];
31
+ }
32
+ export interface NavigationSubheaderItem {
33
+ kind: "header";
34
+ title: string;
35
+ }
36
+ export interface NavigationDividerItem {
37
+ kind: "divider";
38
+ }
39
+ export type NavigationItem = NavigationPageItem | NavigationSubheaderItem | NavigationDividerItem;
40
+ export type Navigation = NavigationItem[];
41
+ export interface Session {
42
+ user?: {
43
+ id?: string | null;
44
+ name?: string | null;
45
+ latinName?: string | null;
46
+ image?: string | null;
47
+ email?: string | null;
48
+ };
49
+ }
50
+ export interface Authentication {
51
+ signIn: () => void;
52
+ signOut: () => void;
53
+ }
54
+ export declare const AuthenticationContext: React.Context<Authentication | null>;
55
+ export declare const SessionContext: React.Context<Session | null>;
56
+ export type AppTheme = Theme | {
57
+ light: Theme;
58
+ dark: Theme;
59
+ };
60
+ export interface AppProviderProps {
61
+ /**
62
+ * The content of the app provider.
63
+ */
64
+ children: React.ReactNode;
65
+ /**
66
+ * [Theme or themes](https://mui.com/toolpad/core/react-app-provider/#theming) to be used by the app in light/dark mode. A [CSS variables theme](https://mui.com/material-ui/customization/css-theme-variables/overview/) is recommended.
67
+ * @default createTheme()
68
+ */
69
+ theme?: AppTheme;
70
+ /**
71
+ * Branding options for the app.
72
+ * @default null
73
+ */
74
+ branding?: Branding | null;
75
+ /**
76
+ * The labels for the component.
77
+ */
78
+ localeText?: Partial<LocaleContextType>;
79
+ /**
80
+ * Navigation definition for the app.
81
+ * @default []
82
+ */
83
+ navigation?: Navigation;
84
+ /**
85
+ * Router implementation used inside Toolpad components.
86
+ * @default null
87
+ */
88
+ router?: Router;
89
+ /**
90
+ * Session info about the current user.
91
+ * @default null
92
+ */
93
+ session?: Session | null;
94
+ /**
95
+ * Authentication methods.
96
+ * @default null
97
+ */
98
+ authentication?: Authentication | null;
99
+ /**
100
+ * The window where the application is rendered.
101
+ * This is needed when rendering the app inside an iframe, for example.
102
+ * @default window
103
+ */
104
+ window?: Window;
105
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @vitest-environment jsdom
3
+ */
4
+ export {};
@@ -0,0 +1,14 @@
1
+ import { AppProviderProps } from "./AppProvider";
2
+ /**
3
+ *
4
+ * Demos:
5
+ *
6
+ * - [App Provider](https://mui.com/toolpad/core/react-app-provider/)
7
+ * - [Dashboard Layout](https://mui.com/toolpad/core/react-dashboard-layout/)
8
+ *
9
+ * API:
10
+ *
11
+ * - [AppProvider API](https://mui.com/toolpad/core/api/app-provider)
12
+ */
13
+ declare function AppProvider(props: AppProviderProps): import("react/jsx-runtime").JSX.Element;
14
+ export { AppProvider };
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import type { AppTheme } from "./AppProvider";
3
+ interface AppThemeProviderProps {
4
+ children: React.ReactNode;
5
+ theme: AppTheme;
6
+ window?: Window;
7
+ }
8
+ /**
9
+ * @ignore - internal component.
10
+ */
11
+ declare function AppThemeProvider(props: AppThemeProviderProps): import("react/jsx-runtime").JSX.Element;
12
+ export { AppThemeProvider };
@@ -0,0 +1,91 @@
1
+ import * as React from "react";
2
+ import { type Theme, SxProps } from "@mui/material";
3
+ import { type AccountProps } from "../Account";
4
+ export interface SidebarFooterProps {
5
+ mini: boolean;
6
+ }
7
+ export interface DashboardLayoutSlotProps {
8
+ titlebar?: {};
9
+ toolbarActions?: {};
10
+ toolbarAccount?: AccountProps;
11
+ sidebarFooter?: SidebarFooterProps;
12
+ }
13
+ export interface DashboardLayoutSlots {
14
+ /**
15
+ * The title bar component used in the layout header.
16
+ * @default TitleBar
17
+ */
18
+ titlebar?: React.JSXElementConstructor<{}>;
19
+ /**
20
+ * The toolbar actions component used in the layout header.
21
+ * @default ToolbarActions
22
+ */
23
+ toolbarActions?: React.JSXElementConstructor<{}>;
24
+ /**
25
+ * The toolbar account component used in the layout header.
26
+ * @default Account
27
+ */
28
+ toolbarAccount?: React.JSXElementConstructor<AccountProps>;
29
+ /**
30
+ * Optional footer component used in the layout sidebar.
31
+ * @default null
32
+ */
33
+ sidebarFooter?: React.JSXElementConstructor<SidebarFooterProps>;
34
+ }
35
+ export interface DashboardLayoutProps {
36
+ /**
37
+ * The content of the dashboard.
38
+ */
39
+ children: React.ReactNode;
40
+ /**
41
+ * Whether the sidebar should not be collapsible to a mini variant in desktop and tablet viewports.
42
+ * @default false
43
+ */
44
+ disableCollapsibleSidebar?: boolean;
45
+ /**
46
+ * Whether the sidebar should start collapsed in desktop size screens.
47
+ * @default false
48
+ */
49
+ defaultSidebarCollapsed?: boolean;
50
+ /**
51
+ * Whether the navigation bar and menu icon should be hidden
52
+ * @default false
53
+ */
54
+ hideNavigation?: boolean;
55
+ /**
56
+ * Whether the theme switcher should be shown in the toolbar.
57
+ * @default false
58
+ */
59
+ showThemeSwitcher?: boolean;
60
+ /**
61
+ * Width of the sidebar when expanded.
62
+ * @default 320
63
+ */
64
+ sidebarExpandedWidth?: number | string;
65
+ /**
66
+ * The components used for each slot inside.
67
+ * @default {}
68
+ */
69
+ slots?: DashboardLayoutSlots;
70
+ /**
71
+ * The props used for each slot inside.
72
+ * @default {}
73
+ */
74
+ slotProps?: DashboardLayoutSlotProps;
75
+ /**
76
+ * The system prop that allows defining system overrides as well as additional CSS styles.
77
+ */
78
+ sx?: SxProps<Theme>;
79
+ }
80
+ /**
81
+ *
82
+ * Demos:
83
+ *
84
+ * - [Dashboard Layout](https://mui.com/toolpad/core/react-dashboard-layout/)
85
+ *
86
+ * API:
87
+ *
88
+ * - [DashboardLayout API](https://mui.com/toolpad/core/api/dashboard-layout)
89
+ */
90
+ declare function DashboardLayout(props: DashboardLayoutProps): import("react/jsx-runtime").JSX.Element;
91
+ export { DashboardLayout };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
- import { styled, useTheme } from "@mui/material";
4
+ import { useTheme } from "@mui/material";
5
5
  import MuiAppBar from "@mui/material/AppBar";
6
6
  import Box from "@mui/material/Box";
7
7
  import Drawer from "@mui/material/Drawer";
@@ -20,14 +20,6 @@ import { ThemeSwitcher } from "./ThemeSwitcher";
20
20
  import { getDrawerSxTransitionMixin, getDrawerWidthTransitionMixin } from "./utils";
21
21
  import { TitleBar } from "./TitleBar";
22
22
  import { useLocaleText } from "../shared/locales/LocaleContext";
23
- const AppBar = styled(MuiAppBar)(({ theme }) => ({
24
- borderWidth: 0,
25
- borderBottomWidth: 1,
26
- borderStyle: "solid",
27
- borderColor: (theme.vars ?? theme).palette.divider,
28
- boxShadow: "none",
29
- zIndex: theme.zIndex.drawer + 1
30
- }));
31
23
  /**
32
24
  *
33
25
  * Demos:
@@ -147,7 +139,14 @@ function DashboardLayout(props) {
147
139
  height: "100vh",
148
140
  width: "100vw",
149
141
  ...sx
150
- }, children: [_jsx(AppBar, { color: "inherit", position: "absolute", children: _jsxs(Toolbar, { sx: { backgroundColor: "inherit", mx: { xs: -0.75, sm: -1.5 } }, children: [!hideNavigation ? (_jsxs(React.Fragment, { children: [_jsx(Box, { sx: {
142
+ }, children: [_jsx(MuiAppBar, { color: "inherit", position: "absolute", sx: (theme) => ({
143
+ borderWidth: 0,
144
+ borderBottomWidth: 1,
145
+ borderStyle: "solid",
146
+ borderColor: theme.palette.divider,
147
+ boxShadow: "none",
148
+ zIndex: theme.zIndex.drawer + 1
149
+ }), children: _jsxs(Toolbar, { sx: { backgroundColor: "inherit", mx: { xs: -0.75, sm: -1.5 } }, children: [!hideNavigation ? (_jsxs(React.Fragment, { children: [_jsx(Box, { sx: {
151
150
  mr: { sm: disableCollapsibleSidebar ? 0 : 1 },
152
151
  display: { md: "none" }
153
152
  }, children: getMenuIcon(isMobileNavigationExpanded) }), _jsx(Box, { sx: {
@@ -0,0 +1 @@
1
+ import "@testing-library/jest-dom/vitest";
@@ -0,0 +1,16 @@
1
+ import type { Navigation } from "../AppProvider";
2
+ interface DashboardSidebarSubNavigationProps {
3
+ subNavigation: Navigation;
4
+ basePath?: string;
5
+ depth?: number;
6
+ onLinkClick: () => void;
7
+ isMini?: boolean;
8
+ isFullyExpanded?: boolean;
9
+ hasDrawerTransitions?: boolean;
10
+ selectedItemId: string;
11
+ }
12
+ /**
13
+ * @ignore - internal component.
14
+ */
15
+ declare function DashboardSidebarSubNavigation({ subNavigation, basePath, depth, onLinkClick, isMini, isFullyExpanded, hasDrawerTransitions, selectedItemId }: DashboardSidebarSubNavigationProps): import("react/jsx-runtime").JSX.Element;
16
+ export { DashboardSidebarSubNavigation };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @ignore - internal component.
3
+ */
4
+ declare function ThemeSwitcher(): import("react/jsx-runtime").JSX.Element | null;
5
+ export { ThemeSwitcher };
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare function TitleBar(): number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | undefined;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @ignore - internal component.
3
+ */
4
+ declare function ToolbarActions(): null;
5
+ export { ToolbarActions };
@@ -0,0 +1,2 @@
1
+ export * from "./DashboardLayout";
2
+ export * from "./ToolbarActions";
@@ -0,0 +1,8 @@
1
+ import type { Theme } from "@mui/material";
2
+ export declare function getDrawerSxTransitionMixin(isExpanded: boolean, property: string): {
3
+ transition: (theme: Theme) => string;
4
+ };
5
+ export declare function getDrawerWidthTransitionMixin(isExpanded: boolean): {
6
+ overflowX: string;
7
+ transition: (theme: Theme) => string;
8
+ };
@@ -0,0 +1,61 @@
1
+ import * as React from "react";
2
+ import { ContainerProps } from "@mui/material/Container";
3
+ import { PageContainerToolbarProps } from "./PageContainerToolbar";
4
+ export interface PageContainerSlotProps {
5
+ toolbar: PageContainerToolbarProps;
6
+ }
7
+ export interface PageContainerSlots {
8
+ /**
9
+ * The component that renders the actions toolbar.
10
+ * @default Snackbar
11
+ */
12
+ toolbar: React.ElementType;
13
+ }
14
+ export interface Breadcrumb {
15
+ /**
16
+ * The title of the breadcrumb segment.
17
+ */
18
+ title: string;
19
+ /**
20
+ * The path the breadcrumb links to.
21
+ */
22
+ path: string;
23
+ }
24
+ export type PageData = {
25
+ title?: string;
26
+ page?: string;
27
+ breadcrumbs?: Breadcrumb[];
28
+ };
29
+ type PageDataAction = PageData | true;
30
+ export declare const PageDataContext: React.Context<{
31
+ state: PageData;
32
+ dispatch: React.Dispatch<PageDataAction>;
33
+ }>;
34
+ export declare function PageDataContextProvider(props: React.PropsWithChildren<PageData>): import("react/jsx-runtime").JSX.Element;
35
+ export type PageContainerProps = React.PropsWithChildren<ContainerProps & {
36
+ /**
37
+ * The default title of the page.
38
+ */
39
+ defaultTitle?: string;
40
+ /**
41
+ * The components used for each slot inside.
42
+ */
43
+ slots?: PageContainerSlots;
44
+ /**
45
+ * The props used for each slot inside.
46
+ */
47
+ slotProps?: PageContainerSlotProps;
48
+ }>;
49
+ /**
50
+ * A container component to provide a title and breadcrumbs for your pages.
51
+ *
52
+ * Demos:
53
+ *
54
+ * - [Page Container](https://mui.com/toolpad/core/react-page-container/)
55
+ *
56
+ * API:
57
+ *
58
+ * - [PageContainer API](https://mui.com/toolpad/core/api/page-container)
59
+ */
60
+ declare function PageContainer(props: PageContainerProps): import("react/jsx-runtime").JSX.Element;
61
+ export { PageContainer };
@@ -35,9 +35,13 @@ function reducer(state, action) {
35
35
  }
36
36
  export function PageDataContextProvider(props) {
37
37
  // Destruct
38
- const { title, breadcrumbs, ...rest } = props;
38
+ const { title, page, breadcrumbs, ...rest } = props;
39
39
  // useReducer hook to manage state with our reducer function and initial state
40
- const [state, dispatch] = React.useReducer(reducer, { title, breadcrumbs });
40
+ const [state, dispatch] = React.useReducer(reducer, {
41
+ title,
42
+ page,
43
+ breadcrumbs
44
+ });
41
45
  // Provide the state and dispatch function to the context value
42
46
  return _jsx(PageDataContext.Provider, { value: { state, dispatch }, ...rest });
43
47
  }
@@ -53,7 +57,7 @@ export function PageDataContextProvider(props) {
53
57
  * - [PageContainer API](https://mui.com/toolpad/core/api/page-container)
54
58
  */
55
59
  function PageContainer(props) {
56
- const { children, slots, slotProps, ...rest } = props;
60
+ const { children, defaultTitle, slots, slotProps, ...rest } = props;
57
61
  const loaded = React.useRef(false);
58
62
  const { state, dispatch } = React.useContext(PageDataContext);
59
63
  const activePage = useActivePage();
@@ -66,7 +70,7 @@ function PageContainer(props) {
66
70
  }
67
71
  }, [activePage?.sourcePath]);
68
72
  let resolvedBreadcrumbs = state.breadcrumbs ?? activePage?.breadcrumbs ?? [];
69
- const title = state.title ?? activePage?.title ?? "";
73
+ const title = state.title ?? defaultTitle ?? activePage?.title ?? "";
70
74
  if (state.page) {
71
75
  resolvedBreadcrumbs = [
72
76
  ...resolvedBreadcrumbs,
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+ export interface PageContainerToolbarProps {
3
+ children?: React.ReactNode;
4
+ }
5
+ /**
6
+ *
7
+ * Demos:
8
+ *
9
+ * - [Page Container](https://mui.com/toolpad/core/react-page-container/)
10
+ *
11
+ * API:
12
+ *
13
+ * - [PageContainerToolbar API](https://mui.com/toolpad/core/api/page-container-toolbar)
14
+ */
15
+ declare function PageContainerToolbar(props: PageContainerToolbarProps): import("react/jsx-runtime").JSX.Element;
16
+ export { PageContainerToolbar };
@@ -0,0 +1,2 @@
1
+ export * from "./PageContainer";
2
+ export * from "./PageContainerToolbar";
@@ -0,0 +1,8 @@
1
+ export * from "./AppProvider";
2
+ export * from "./DashboardLayout";
3
+ export * from "./Account";
4
+ export * from "./PageContainer";
5
+ export * from "./useActivePage";
6
+ export * from "./useLocalStorageState";
7
+ export * from "./useSessionStorageState";
8
+ export * from "./persistence/codec";
@@ -0,0 +1,6 @@
1
+ import type { AppProviderProps } from "../AppProvider";
2
+ /**
3
+ * @ignore - internal component.
4
+ */
5
+ declare function AppProvider(props: AppProviderProps): import("react/jsx-runtime").JSX.Element;
6
+ export { AppProvider };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { AppProviderProps } from "../AppProvider";
2
+ /**
3
+ * @ignore - internal component.
4
+ */
5
+ export declare function AppProviderNextApp(props: AppProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import type { AppProviderProps } from "../AppProvider";
2
+ /**
3
+ * @ignore - internal component.
4
+ */
5
+ export declare function AppProviderNextPages(props: AppProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./AppProvider";
@@ -0,0 +1,47 @@
1
+ /**
2
+ * A codec that can encode and decode values of type V to and from strings.
3
+ * @typeParam V The type of values that can be encoded and decoded.
4
+ */
5
+ export interface Codec<V> {
6
+ /**
7
+ * Decodes a string value into a value of type V.
8
+ * @param value The value to decode.
9
+ * @returns The decoded value.
10
+ */
11
+ parse: (value: string) => V;
12
+ /**
13
+ * Encodes a value of type V into a string.
14
+ * @param value The value to encode.
15
+ * @returns The encoded value.
16
+ */
17
+ stringify: (value: V) => string;
18
+ }
19
+ /**
20
+ * A codec that can encode and decode Date objects to and from strings.
21
+ */
22
+ export declare const CODEC_DATE: Codec<Date>;
23
+ /**
24
+ * A codec that can encode and decode Date objects to and from strings, but only the date part.
25
+ */
26
+ export declare const CODEC_DATE_ONLY: Codec<Date>;
27
+ /**
28
+ * A codec that can encode and decode numbers to and from strings.
29
+ */
30
+ export declare const CODEC_NUMBER: Codec<number>;
31
+ /**
32
+ * A codec that can encode and decode boolean values to and from strings.
33
+ */
34
+ export declare const CODE_BOOLEAN: Codec<boolean>;
35
+ /**
36
+ * A codec that can encode and decode JSON values to and from strings.
37
+ */
38
+ export declare const CODEC_JSON: Codec<unknown>;
39
+ /**
40
+ * A codec that can encode and decode JSON values to and from strings.
41
+ * If the JSON value is invalid, parsing will fail.
42
+ */
43
+ export declare const CODEC_JSON_STRICT: Codec<unknown>;
44
+ /**
45
+ * A codec that can encode and decode strings to and from strings.
46
+ */
47
+ export declare const CODEC_STRING: Codec<string>;
@@ -0,0 +1 @@
1
+ export * from "./useStorageState";