@etsoo/toolpad 1.0.8 → 1.0.10

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.
@@ -60,7 +60,4 @@ export interface AccountProps {
60
60
  * - [Account API](https://mui.com/toolpad/core/api/account)
61
61
  */
62
62
  declare function Account(props: AccountProps): import("react/jsx-runtime").JSX.Element | null;
63
- declare namespace Account {
64
- var propTypes: any;
65
- }
66
63
  export { Account };
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import PropTypes from "prop-types";
4
3
  import Popover from "@mui/material/Popover";
5
4
  import Divider from "@mui/material/Divider";
6
5
  import Stack from "@mui/material/Stack";
@@ -64,44 +63,4 @@ function Account(props) {
64
63
  ...slotProps?.popover?.slotProps
65
64
  }, children: slots?.popoverContent ? (_jsx(slots.popoverContent, { ...slotProps?.popoverContent })) : (_jsxs(Stack, { direction: "column", ...slotProps?.popoverContent, children: [_jsx(AccountPopoverHeader, { children: _jsx(AccountPreview, { variant: "expanded" }) }), _jsx(Divider, {}), _jsx(AccountPopoverFooter, { children: _jsx(SignOutButton, { ...slotProps?.signOutButton }) })] })) }))] }));
66
65
  }
67
- Account.propTypes /* remove-proptypes */ = {
68
- // ┌────────────────────────────── Warning ──────────────────────────────┐
69
- // │ These PropTypes are generated from the TypeScript type definitions. │
70
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
71
- // └─────────────────────────────────────────────────────────────────────┘
72
- /**
73
- * The props used for each slot inside.
74
- */
75
- slotProps: PropTypes.shape({
76
- popover: PropTypes.object,
77
- popoverContent: PropTypes.object,
78
- preview: PropTypes.shape({
79
- handleClick: PropTypes.func,
80
- open: PropTypes.bool,
81
- slotProps: PropTypes.shape({
82
- avatar: PropTypes.object,
83
- avatarIconButton: PropTypes.object,
84
- moreIconButton: PropTypes.object
85
- }),
86
- slots: PropTypes.shape({
87
- avatar: PropTypes.elementType,
88
- avatarIconButton: PropTypes.elementType,
89
- moreIconButton: PropTypes.elementType
90
- }),
91
- variant: PropTypes.oneOf(["condensed", "expanded"])
92
- }),
93
- signInButton: PropTypes.object,
94
- signOutButton: PropTypes.object
95
- }),
96
- /**
97
- * The components used for each slot inside.
98
- */
99
- slots: PropTypes.shape({
100
- popover: PropTypes.elementType,
101
- popoverContent: PropTypes.elementType,
102
- preview: PropTypes.elementType,
103
- signInButton: PropTypes.elementType,
104
- signOutButton: PropTypes.elementType
105
- })
106
- };
107
66
  export { Account };
@@ -61,7 +61,4 @@ export interface AccountPreviewProps {
61
61
  * - [AccountPreview API](https://mui.com/toolpad/core/api/account-preview)
62
62
  */
63
63
  declare function AccountPreview(props: AccountPreviewProps): import("react/jsx-runtime").JSX.Element | null;
64
- declare namespace AccountPreview {
65
- var propTypes: any;
66
- }
67
64
  export { AccountPreview };
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import PropTypes from "prop-types";
4
3
  import Avatar from "@mui/material/Avatar";
5
4
  import Typography from "@mui/material/Typography";
6
5
  import Tooltip from "@mui/material/Tooltip";
@@ -56,40 +55,4 @@ function AccountPreview(props) {
56
55
  }
57
56
  return (_jsx(Tooltip, { title: session.user.name ?? "Account", children: slots?.avatarIconButton ? (_jsx(slots.avatarIconButton, {})) : (_jsx(IconButton, { onClick: handleClick, "aria-label": localeText.accountIconButtonAriaLabel, size: "small", "aria-controls": open ? "account-menu" : undefined, "aria-haspopup": "true", "aria-expanded": open ? "true" : undefined, ...slotProps?.avatarIconButton, children: avatarContent })) }));
58
57
  }
59
- AccountPreview.propTypes /* remove-proptypes */ = {
60
- // ┌────────────────────────────── Warning ──────────────────────────────┐
61
- // │ These PropTypes are generated from the TypeScript type definitions. │
62
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
63
- // └─────────────────────────────────────────────────────────────────────┘
64
- /**
65
- * The handler used when the preview is expanded
66
- */
67
- handleClick: PropTypes.func,
68
- /**
69
- * The state of the Account popover
70
- * @default false
71
- */
72
- open: PropTypes.bool,
73
- /**
74
- * The props used for each slot inside.
75
- */
76
- slotProps: PropTypes.shape({
77
- avatar: PropTypes.object,
78
- avatarIconButton: PropTypes.object,
79
- moreIconButton: PropTypes.object
80
- }),
81
- /**
82
- * The components used for each slot inside.
83
- */
84
- slots: PropTypes.shape({
85
- avatar: PropTypes.elementType
86
- }),
87
- /**
88
- * The type of account details to display.
89
- * @property {'condensed'} condensed - Shows only the user's avatar.
90
- * @property {'expanded'} expanded - Displays the user's avatar, name, and email if available.
91
- * @default 'condensed'
92
- */
93
- variant: PropTypes.oneOf(["condensed", "expanded"])
94
- };
95
58
  export { AccountPreview };
@@ -16,7 +16,7 @@ export interface Router {
16
16
  navigate: Navigate;
17
17
  }
18
18
  export interface Branding {
19
- title?: string | React.ReactNode | [string, (handler: React.MouseEvent<HTMLSpanElement>) => void];
19
+ title?: React.ReactNode | [string, (handler: React.MouseEvent<HTMLSpanElement>) => void];
20
20
  logo?: React.ReactNode;
21
21
  }
22
22
  export interface NavigationPageItem {
@@ -11,7 +11,4 @@ import { AppProviderProps } from "./AppProvider";
11
11
  * - [AppProvider API](https://mui.com/toolpad/core/api/app-provider)
12
12
  */
13
13
  declare function AppProvider(props: AppProviderProps): import("react/jsx-runtime").JSX.Element;
14
- declare namespace AppProvider {
15
- var propTypes: any;
16
- }
17
14
  export { AppProvider };
@@ -1,6 +1,5 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import PropTypes from "prop-types";
4
3
  import { BrandingContext, NavigationContext, RouterContext, WindowContext } from "../shared/context";
5
4
  import { AppThemeProvider } from "./AppThemeProvider";
6
5
  import { createTheme as createMuiTheme } from "@mui/material/styles";
@@ -29,93 +28,4 @@ function AppProvider(props) {
29
28
  const { children, theme = createTheme(), branding = null, localeText, navigation = [], router = null, authentication = null, session = null, window: appWindow } = props;
30
29
  return (_jsx(WindowContext.Provider, { value: appWindow, children: _jsx(AuthenticationContext.Provider, { value: authentication, children: _jsx(SessionContext.Provider, { value: session, children: _jsx(RouterContext.Provider, { value: router, children: _jsx(AppThemeProvider, { theme: theme, window: appWindow, children: _jsx(LocaleProvider, { localeText: localeText, children: _jsx(BrandingContext.Provider, { value: branding, children: _jsx(NavigationContext.Provider, { value: navigation, children: children }) }) }) }) }) }) }) }));
31
30
  }
32
- AppProvider.propTypes /* remove-proptypes */ = {
33
- // ┌────────────────────────────── Warning ──────────────────────────────┐
34
- // │ These PropTypes are generated from the TypeScript type definitions. │
35
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
36
- // └─────────────────────────────────────────────────────────────────────┘
37
- /**
38
- * Authentication methods.
39
- * @default null
40
- */
41
- authentication: PropTypes.shape({
42
- signIn: PropTypes.func.isRequired,
43
- signOut: PropTypes.func.isRequired
44
- }),
45
- /**
46
- * Branding options for the app.
47
- * @default null
48
- */
49
- branding: PropTypes.shape({
50
- logo: PropTypes.node,
51
- title: PropTypes.string
52
- }),
53
- /**
54
- * The content of the app provider.
55
- */
56
- children: PropTypes.node,
57
- /**
58
- * Navigation definition for the app.
59
- * @default []
60
- */
61
- navigation: PropTypes.arrayOf(PropTypes.oneOfType([
62
- PropTypes.shape({
63
- action: PropTypes.node,
64
- children: PropTypes.arrayOf(PropTypes.oneOfType([
65
- PropTypes.object,
66
- PropTypes.shape({
67
- kind: PropTypes.oneOf(["header"]).isRequired,
68
- title: PropTypes.string.isRequired
69
- }),
70
- PropTypes.shape({
71
- kind: PropTypes.oneOf(["divider"]).isRequired
72
- })
73
- ]).isRequired),
74
- icon: PropTypes.node,
75
- kind: PropTypes.oneOf(["page"]),
76
- pattern: PropTypes.string,
77
- segment: PropTypes.string,
78
- title: PropTypes.string
79
- }),
80
- PropTypes.shape({
81
- kind: PropTypes.oneOf(["header"]).isRequired,
82
- title: PropTypes.string.isRequired
83
- }),
84
- PropTypes.shape({
85
- kind: PropTypes.oneOf(["divider"]).isRequired
86
- })
87
- ]).isRequired),
88
- /**
89
- * Router implementation used inside Toolpad components.
90
- * @default null
91
- */
92
- router: PropTypes.shape({
93
- navigate: PropTypes.func.isRequired,
94
- pathname: PropTypes.string.isRequired,
95
- searchParams: PropTypes.instanceOf(URLSearchParams).isRequired
96
- }),
97
- /**
98
- * Session info about the current user.
99
- * @default null
100
- */
101
- session: PropTypes.shape({
102
- user: PropTypes.shape({
103
- email: PropTypes.string,
104
- id: PropTypes.string,
105
- image: PropTypes.string,
106
- name: PropTypes.string
107
- })
108
- }),
109
- /**
110
- * [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.
111
- * @default createTheme()
112
- */
113
- theme: PropTypes.object,
114
- /**
115
- * The window where the application is rendered.
116
- * This is needed when rendering the app inside an iframe, for example.
117
- * @default window
118
- */
119
- window: PropTypes.object
120
- };
121
31
  export { AppProvider };
@@ -88,7 +88,4 @@ export interface DashboardLayoutProps {
88
88
  * - [DashboardLayout API](https://mui.com/toolpad/core/api/dashboard-layout)
89
89
  */
90
90
  declare function DashboardLayout(props: DashboardLayoutProps): import("react/jsx-runtime").JSX.Element;
91
- declare namespace DashboardLayout {
92
- var propTypes: any;
93
- }
94
91
  export { DashboardLayout };
@@ -1,7 +1,6 @@
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 PropTypes from "prop-types";
5
4
  import { styled, useTheme } from "@mui/material";
6
5
  import MuiAppBar from "@mui/material/AppBar";
7
6
  import Box from "@mui/material/Box";
@@ -191,85 +190,4 @@ function DashboardLayout(props) {
191
190
  overflow: "auto"
192
191
  }, children: children })] })] }));
193
192
  }
194
- DashboardLayout.propTypes /* remove-proptypes */ = {
195
- // ┌────────────────────────────── Warning ──────────────────────────────┐
196
- // │ These PropTypes are generated from the TypeScript type definitions. │
197
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
198
- // └─────────────────────────────────────────────────────────────────────┘
199
- /**
200
- * The content of the dashboard.
201
- */
202
- children: PropTypes.node,
203
- /**
204
- * Whether the sidebar should start collapsed in desktop size screens.
205
- * @default false
206
- */
207
- defaultSidebarCollapsed: PropTypes.bool,
208
- /**
209
- * Whether the sidebar should not be collapsible to a mini variant in desktop and tablet viewports.
210
- * @default false
211
- */
212
- disableCollapsibleSidebar: PropTypes.bool,
213
- /**
214
- * Whether the navigation bar and menu icon should be hidden
215
- * @default false
216
- */
217
- hideNavigation: PropTypes.bool,
218
- /**
219
- * Width of the sidebar when expanded.
220
- * @default 320
221
- */
222
- sidebarExpandedWidth: PropTypes.oneOfType([
223
- PropTypes.number,
224
- PropTypes.string
225
- ]),
226
- /**
227
- * The props used for each slot inside.
228
- * @default {}
229
- */
230
- slotProps: PropTypes.shape({
231
- sidebarFooter: PropTypes.shape({
232
- mini: PropTypes.bool.isRequired
233
- }),
234
- toolbarAccount: PropTypes.shape({
235
- localeText: PropTypes.shape({
236
- iconButtonAriaLabel: PropTypes.string,
237
- signInLabel: PropTypes.string,
238
- signOutLabel: PropTypes.string
239
- }),
240
- slotProps: PropTypes.shape({
241
- popover: PropTypes.object,
242
- popoverContent: PropTypes.object,
243
- preview: PropTypes.object,
244
- signInButton: PropTypes.object,
245
- signOutButton: PropTypes.object
246
- }),
247
- slots: PropTypes.shape({
248
- popover: PropTypes.elementType,
249
- popoverContent: PropTypes.elementType,
250
- preview: PropTypes.elementType,
251
- signInButton: PropTypes.elementType,
252
- signOutButton: PropTypes.elementType
253
- })
254
- }),
255
- toolbarActions: PropTypes.object
256
- }),
257
- /**
258
- * The components used for each slot inside.
259
- * @default {}
260
- */
261
- slots: PropTypes.shape({
262
- sidebarFooter: PropTypes.elementType,
263
- toolbarAccount: PropTypes.elementType,
264
- toolbarActions: PropTypes.elementType
265
- }),
266
- /**
267
- * The system prop that allows defining system overrides as well as additional CSS styles.
268
- */
269
- sx: PropTypes.oneOfType([
270
- PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])),
271
- PropTypes.func,
272
- PropTypes.object
273
- ])
274
- };
275
193
  export { DashboardLayout };
@@ -1 +1,2 @@
1
- export declare function TitleBar(): import("react/jsx-runtime").JSX.Element;
1
+ import React from "react";
2
+ export declare function TitleBar(): number | bigint | boolean | Iterable<React.ReactNode> | Promise<React.AwaitedReactNode> | import("react/jsx-runtime").JSX.Element | undefined;
@@ -17,9 +17,9 @@ export function TitleBar() {
17
17
  const branding = React.useContext(BrandingContext);
18
18
  // Application title
19
19
  const title = branding?.title;
20
- const titleUI = React.useMemo(() => {
20
+ const [titleUI, hasLink] = React.useMemo(() => {
21
21
  if (title == null)
22
- return;
22
+ return [undefined, true];
23
23
  if (typeof title === "string" || Array.isArray(title)) {
24
24
  let titleString;
25
25
  let clickHandler;
@@ -30,14 +30,22 @@ export function TitleBar() {
30
30
  else {
31
31
  titleString = title;
32
32
  }
33
- return (_jsx(Typography, { variant: "h6", sx: {
34
- color: (theme.vars ?? theme).palette.primary.main,
35
- fontWeight: "700",
36
- ml: 0.5,
37
- whiteSpace: "nowrap"
38
- }, onClick: clickHandler == null ? undefined : (e) => clickHandler(e), children: titleString }));
33
+ return [
34
+ _jsx(Typography, { variant: "h6", sx: {
35
+ color: (theme.vars ?? theme).palette.primary.main,
36
+ fontWeight: "700",
37
+ ml: 0.5,
38
+ whiteSpace: "nowrap"
39
+ }, onClick: clickHandler == null ? undefined : (e) => clickHandler(e), children: titleString }),
40
+ true
41
+ ];
39
42
  }
40
- return title;
43
+ return [title, false];
41
44
  }, [title]);
42
- return (_jsx(Link, { href: "/", style: { color: "inherit", textDecoration: "none" }, children: _jsxs(Stack, { direction: "row", alignItems: "center", children: [branding?.logo && _jsx(LogoContainer, { children: branding.logo }), titleUI] }) }));
45
+ if (hasLink) {
46
+ return (_jsx(Link, { href: "/", style: { color: "inherit", textDecoration: "none" }, children: _jsxs(Stack, { direction: "row", alignItems: "center", children: [branding?.logo && _jsx(LogoContainer, { children: branding.logo }), titleUI] }) }));
47
+ }
48
+ else {
49
+ return titleUI;
50
+ }
43
51
  }
@@ -56,7 +56,4 @@ export interface PageContainerProps extends ContainerProps {
56
56
  * - [PageContainer API](https://mui.com/toolpad/core/api/page-container)
57
57
  */
58
58
  declare function PageContainer(props: PageContainerProps): import("react/jsx-runtime").JSX.Element;
59
- declare namespace PageContainer {
60
- var propTypes: any;
61
- }
62
59
  export { PageContainer };
@@ -1,6 +1,5 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import PropTypes from "prop-types";
4
3
  import Breadcrumbs from "@mui/material/Breadcrumbs";
5
4
  import Container from "@mui/material/Container";
6
5
  import Link from "@mui/material/Link";
@@ -48,39 +47,4 @@ function PageContainer(props) {
48
47
  })
49
48
  : null }), _jsxs(PageContentHeader, { children: [title ? _jsx(Typography, { variant: "h4", children: title }) : null, _jsx(ToolbarComponent, { ...toolbarSlotProps })] })] }), _jsx("div", { children: children })] }) }));
50
49
  }
51
- PageContainer.propTypes /* remove-proptypes */ = {
52
- // ┌────────────────────────────── Warning ──────────────────────────────┐
53
- // │ These PropTypes are generated from the TypeScript type definitions. │
54
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
55
- // └─────────────────────────────────────────────────────────────────────┘
56
- /**
57
- * The breadcrumbs of the page. Leave blank to use the active page breadcrumbs.
58
- */
59
- breadcrumbs: PropTypes.arrayOf(PropTypes.shape({
60
- path: PropTypes.string.isRequired,
61
- title: PropTypes.string.isRequired
62
- })),
63
- /**
64
- * @ignore
65
- */
66
- children: PropTypes.node,
67
- /**
68
- * The props used for each slot inside.
69
- */
70
- slotProps: PropTypes.shape({
71
- toolbar: PropTypes.shape({
72
- children: PropTypes.node
73
- }).isRequired
74
- }),
75
- /**
76
- * The components used for each slot inside.
77
- */
78
- slots: PropTypes.shape({
79
- toolbar: PropTypes.elementType
80
- }),
81
- /**
82
- * The title of the page. Leave blank to use the active page title.
83
- */
84
- title: PropTypes.string
85
- };
86
50
  export { PageContainer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/toolpad",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "author": "ETSOO",
5
5
  "description": "Dashboard framework extention based on Toolpad Core",
6
6
  "main": "build/index.js",
@@ -50,7 +50,6 @@
50
50
  "@mui/utils": "6.3.1",
51
51
  "invariant": "2.2.4",
52
52
  "path-to-regexp": "6.3.0",
53
- "prop-types": "15.8.1",
54
53
  "react": "^18.3.1"
55
54
  },
56
55
  "overrides": {
@@ -62,7 +61,6 @@
62
61
  "@testing-library/jest-dom": "^6.6.3",
63
62
  "@testing-library/react": "^16.1.0",
64
63
  "@types/invariant": "2.2.37",
65
- "@types/prop-types": "15.7.14",
66
64
  "@types/react": "18.3.12",
67
65
  "@types/react-dom": "18.3.1",
68
66
  "@vitejs/plugin-react": "4.3.4",
@@ -1,5 +1,4 @@
1
1
  import * as React from "react";
2
- import PropTypes from "prop-types";
3
2
  import Button from "@mui/material/Button";
4
3
  import Popover from "@mui/material/Popover";
5
4
  import Divider from "@mui/material/Divider";
@@ -164,45 +163,4 @@ function Account(props: AccountProps) {
164
163
  );
165
164
  }
166
165
 
167
- Account.propTypes /* remove-proptypes */ = {
168
- // ┌────────────────────────────── Warning ──────────────────────────────┐
169
- // │ These PropTypes are generated from the TypeScript type definitions. │
170
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
171
- // └─────────────────────────────────────────────────────────────────────┘
172
- /**
173
- * The props used for each slot inside.
174
- */
175
- slotProps: PropTypes.shape({
176
- popover: PropTypes.object,
177
- popoverContent: PropTypes.object,
178
- preview: PropTypes.shape({
179
- handleClick: PropTypes.func,
180
- open: PropTypes.bool,
181
- slotProps: PropTypes.shape({
182
- avatar: PropTypes.object,
183
- avatarIconButton: PropTypes.object,
184
- moreIconButton: PropTypes.object
185
- }),
186
- slots: PropTypes.shape({
187
- avatar: PropTypes.elementType,
188
- avatarIconButton: PropTypes.elementType,
189
- moreIconButton: PropTypes.elementType
190
- }),
191
- variant: PropTypes.oneOf(["condensed", "expanded"])
192
- }),
193
- signInButton: PropTypes.object,
194
- signOutButton: PropTypes.object
195
- }),
196
- /**
197
- * The components used for each slot inside.
198
- */
199
- slots: PropTypes.shape({
200
- popover: PropTypes.elementType,
201
- popoverContent: PropTypes.elementType,
202
- preview: PropTypes.elementType,
203
- signInButton: PropTypes.elementType,
204
- signOutButton: PropTypes.elementType
205
- })
206
- } as any;
207
-
208
166
  export { Account };
@@ -1,5 +1,4 @@
1
1
  import * as React from "react";
2
- import PropTypes from "prop-types";
3
2
  import Avatar, { AvatarProps } from "@mui/material/Avatar";
4
3
  import Typography from "@mui/material/Typography";
5
4
  import Tooltip from "@mui/material/Tooltip";
@@ -172,41 +171,4 @@ function AccountPreview(props: AccountPreviewProps) {
172
171
  );
173
172
  }
174
173
 
175
- AccountPreview.propTypes /* remove-proptypes */ = {
176
- // ┌────────────────────────────── Warning ──────────────────────────────┐
177
- // │ These PropTypes are generated from the TypeScript type definitions. │
178
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
179
- // └─────────────────────────────────────────────────────────────────────┘
180
- /**
181
- * The handler used when the preview is expanded
182
- */
183
- handleClick: PropTypes.func,
184
- /**
185
- * The state of the Account popover
186
- * @default false
187
- */
188
- open: PropTypes.bool,
189
- /**
190
- * The props used for each slot inside.
191
- */
192
- slotProps: PropTypes.shape({
193
- avatar: PropTypes.object,
194
- avatarIconButton: PropTypes.object,
195
- moreIconButton: PropTypes.object
196
- }),
197
- /**
198
- * The components used for each slot inside.
199
- */
200
- slots: PropTypes.shape({
201
- avatar: PropTypes.elementType
202
- }),
203
- /**
204
- * The type of account details to display.
205
- * @property {'condensed'} condensed - Shows only the user's avatar.
206
- * @property {'expanded'} expanded - Displays the user's avatar, name, and email if available.
207
- * @default 'condensed'
208
- */
209
- variant: PropTypes.oneOf(["condensed", "expanded"])
210
- } as any;
211
-
212
174
  export { AccountPreview };
@@ -22,7 +22,6 @@ export interface Router {
22
22
 
23
23
  export interface Branding {
24
24
  title?:
25
- | string
26
25
  | React.ReactNode
27
26
  | [string, (handler: React.MouseEvent<HTMLSpanElement>) => void];
28
27
  logo?: React.ReactNode;
@@ -1,5 +1,4 @@
1
1
  "use client";
2
- import PropTypes from "prop-types";
3
2
  import {
4
3
  BrandingContext,
5
4
  NavigationContext,
@@ -69,98 +68,4 @@ function AppProvider(props: AppProviderProps) {
69
68
  );
70
69
  }
71
70
 
72
- AppProvider.propTypes /* remove-proptypes */ = {
73
- // ┌────────────────────────────── Warning ──────────────────────────────┐
74
- // │ These PropTypes are generated from the TypeScript type definitions. │
75
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
76
- // └─────────────────────────────────────────────────────────────────────┘
77
- /**
78
- * Authentication methods.
79
- * @default null
80
- */
81
- authentication: PropTypes.shape({
82
- signIn: PropTypes.func.isRequired,
83
- signOut: PropTypes.func.isRequired
84
- }),
85
- /**
86
- * Branding options for the app.
87
- * @default null
88
- */
89
- branding: PropTypes.shape({
90
- logo: PropTypes.node,
91
- title: PropTypes.string
92
- }),
93
- /**
94
- * The content of the app provider.
95
- */
96
- children: PropTypes.node,
97
- /**
98
- * Navigation definition for the app.
99
- * @default []
100
- */
101
- navigation: PropTypes.arrayOf(
102
- PropTypes.oneOfType([
103
- PropTypes.shape({
104
- action: PropTypes.node,
105
- children: PropTypes.arrayOf(
106
- PropTypes.oneOfType([
107
- PropTypes.object,
108
- PropTypes.shape({
109
- kind: PropTypes.oneOf(["header"]).isRequired,
110
- title: PropTypes.string.isRequired
111
- }),
112
- PropTypes.shape({
113
- kind: PropTypes.oneOf(["divider"]).isRequired
114
- })
115
- ]).isRequired
116
- ),
117
- icon: PropTypes.node,
118
- kind: PropTypes.oneOf(["page"]),
119
- pattern: PropTypes.string,
120
- segment: PropTypes.string,
121
- title: PropTypes.string
122
- }),
123
- PropTypes.shape({
124
- kind: PropTypes.oneOf(["header"]).isRequired,
125
- title: PropTypes.string.isRequired
126
- }),
127
- PropTypes.shape({
128
- kind: PropTypes.oneOf(["divider"]).isRequired
129
- })
130
- ]).isRequired
131
- ),
132
- /**
133
- * Router implementation used inside Toolpad components.
134
- * @default null
135
- */
136
- router: PropTypes.shape({
137
- navigate: PropTypes.func.isRequired,
138
- pathname: PropTypes.string.isRequired,
139
- searchParams: PropTypes.instanceOf(URLSearchParams).isRequired
140
- }),
141
- /**
142
- * Session info about the current user.
143
- * @default null
144
- */
145
- session: PropTypes.shape({
146
- user: PropTypes.shape({
147
- email: PropTypes.string,
148
- id: PropTypes.string,
149
- image: PropTypes.string,
150
- name: PropTypes.string
151
- })
152
- }),
153
- /**
154
- * [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.
155
- * @default createTheme()
156
- */
157
- theme: PropTypes.object,
158
- /**
159
- * The window where the application is rendered.
160
- * This is needed when rendering the app inside an iframe, for example.
161
- * @default window
162
- */
163
- window: PropTypes.object
164
- } as any;
165
-
166
71
  export { AppProvider };
@@ -1,6 +1,5 @@
1
1
  "use client";
2
2
  import * as React from "react";
3
- import PropTypes from "prop-types";
4
3
  import { styled, useTheme, type Theme, SxProps } from "@mui/material";
5
4
  import MuiAppBar from "@mui/material/AppBar";
6
5
  import Box from "@mui/material/Box";
@@ -9,12 +8,10 @@ import IconButton from "@mui/material/IconButton";
9
8
  import Stack from "@mui/material/Stack";
10
9
  import Toolbar from "@mui/material/Toolbar";
11
10
  import Tooltip from "@mui/material/Tooltip";
12
- import Typography from "@mui/material/Typography";
13
11
  import useMediaQuery from "@mui/material/useMediaQuery";
14
12
  import type {} from "@mui/material/themeCssVarsAugmentation";
15
13
  import MenuIcon from "@mui/icons-material/Menu";
16
14
  import MenuOpenIcon from "@mui/icons-material/MenuOpen";
17
- import { Link } from "../shared/Link";
18
15
  import { NavigationContext, WindowContext } from "../shared/context";
19
16
  import { Account, type AccountProps } from "../Account";
20
17
  import { DashboardSidebarSubNavigation } from "./DashboardSidebarSubNavigation";
@@ -456,88 +453,4 @@ function DashboardLayout(props: DashboardLayoutProps) {
456
453
  );
457
454
  }
458
455
 
459
- DashboardLayout.propTypes /* remove-proptypes */ = {
460
- // ┌────────────────────────────── Warning ──────────────────────────────┐
461
- // │ These PropTypes are generated from the TypeScript type definitions. │
462
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
463
- // └─────────────────────────────────────────────────────────────────────┘
464
- /**
465
- * The content of the dashboard.
466
- */
467
- children: PropTypes.node,
468
- /**
469
- * Whether the sidebar should start collapsed in desktop size screens.
470
- * @default false
471
- */
472
- defaultSidebarCollapsed: PropTypes.bool,
473
- /**
474
- * Whether the sidebar should not be collapsible to a mini variant in desktop and tablet viewports.
475
- * @default false
476
- */
477
- disableCollapsibleSidebar: PropTypes.bool,
478
- /**
479
- * Whether the navigation bar and menu icon should be hidden
480
- * @default false
481
- */
482
- hideNavigation: PropTypes.bool,
483
- /**
484
- * Width of the sidebar when expanded.
485
- * @default 320
486
- */
487
- sidebarExpandedWidth: PropTypes.oneOfType([
488
- PropTypes.number,
489
- PropTypes.string
490
- ]),
491
- /**
492
- * The props used for each slot inside.
493
- * @default {}
494
- */
495
- slotProps: PropTypes.shape({
496
- sidebarFooter: PropTypes.shape({
497
- mini: PropTypes.bool.isRequired
498
- }),
499
- toolbarAccount: PropTypes.shape({
500
- localeText: PropTypes.shape({
501
- iconButtonAriaLabel: PropTypes.string,
502
- signInLabel: PropTypes.string,
503
- signOutLabel: PropTypes.string
504
- }),
505
- slotProps: PropTypes.shape({
506
- popover: PropTypes.object,
507
- popoverContent: PropTypes.object,
508
- preview: PropTypes.object,
509
- signInButton: PropTypes.object,
510
- signOutButton: PropTypes.object
511
- }),
512
- slots: PropTypes.shape({
513
- popover: PropTypes.elementType,
514
- popoverContent: PropTypes.elementType,
515
- preview: PropTypes.elementType,
516
- signInButton: PropTypes.elementType,
517
- signOutButton: PropTypes.elementType
518
- })
519
- }),
520
- toolbarActions: PropTypes.object
521
- }),
522
- /**
523
- * The components used for each slot inside.
524
- * @default {}
525
- */
526
- slots: PropTypes.shape({
527
- sidebarFooter: PropTypes.elementType,
528
- toolbarAccount: PropTypes.elementType,
529
- toolbarActions: PropTypes.elementType
530
- }),
531
- /**
532
- * The system prop that allows defining system overrides as well as additional CSS styles.
533
- */
534
- sx: PropTypes.oneOfType([
535
- PropTypes.arrayOf(
536
- PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])
537
- ),
538
- PropTypes.func,
539
- PropTypes.object
540
- ])
541
- } as any;
542
-
543
456
  export { DashboardLayout };
@@ -20,8 +20,8 @@ export function TitleBar() {
20
20
 
21
21
  // Application title
22
22
  const title = branding?.title;
23
- const titleUI = React.useMemo(() => {
24
- if (title == null) return;
23
+ const [titleUI, hasLink] = React.useMemo(() => {
24
+ if (title == null) return [undefined, true];
25
25
 
26
26
  if (typeof title === "string" || Array.isArray(title)) {
27
27
  let titleString: string;
@@ -34,7 +34,7 @@ export function TitleBar() {
34
34
  } else {
35
35
  titleString = title;
36
36
  }
37
- return (
37
+ return [
38
38
  <Typography
39
39
  variant="h6"
40
40
  sx={{
@@ -46,19 +46,24 @@ export function TitleBar() {
46
46
  onClick={clickHandler == null ? undefined : (e) => clickHandler(e)}
47
47
  >
48
48
  {titleString}
49
- </Typography>
50
- );
49
+ </Typography>,
50
+ true
51
+ ];
51
52
  }
52
53
 
53
- return title;
54
+ return [title, false];
54
55
  }, [title]);
55
56
 
56
- return (
57
- <Link href="/" style={{ color: "inherit", textDecoration: "none" }}>
58
- <Stack direction="row" alignItems="center">
59
- {branding?.logo && <LogoContainer>{branding.logo}</LogoContainer>}
60
- {titleUI}
61
- </Stack>
62
- </Link>
63
- );
57
+ if (hasLink) {
58
+ return (
59
+ <Link href="/" style={{ color: "inherit", textDecoration: "none" }}>
60
+ <Stack direction="row" alignItems="center">
61
+ {branding?.logo && <LogoContainer>{branding.logo}</LogoContainer>}
62
+ {titleUI}
63
+ </Stack>
64
+ </Link>
65
+ );
66
+ } else {
67
+ return titleUI;
68
+ }
64
69
  }
@@ -1,6 +1,5 @@
1
1
  "use client";
2
2
  import * as React from "react";
3
- import PropTypes from "prop-types";
4
3
  import Breadcrumbs from "@mui/material/Breadcrumbs";
5
4
  import Container, { ContainerProps } from "@mui/material/Container";
6
5
  import Link from "@mui/material/Link";
@@ -137,42 +136,4 @@ function PageContainer(props: PageContainerProps) {
137
136
  );
138
137
  }
139
138
 
140
- PageContainer.propTypes /* remove-proptypes */ = {
141
- // ┌────────────────────────────── Warning ──────────────────────────────┐
142
- // │ These PropTypes are generated from the TypeScript type definitions. │
143
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
144
- // └─────────────────────────────────────────────────────────────────────┘
145
- /**
146
- * The breadcrumbs of the page. Leave blank to use the active page breadcrumbs.
147
- */
148
- breadcrumbs: PropTypes.arrayOf(
149
- PropTypes.shape({
150
- path: PropTypes.string.isRequired,
151
- title: PropTypes.string.isRequired
152
- })
153
- ),
154
- /**
155
- * @ignore
156
- */
157
- children: PropTypes.node,
158
- /**
159
- * The props used for each slot inside.
160
- */
161
- slotProps: PropTypes.shape({
162
- toolbar: PropTypes.shape({
163
- children: PropTypes.node
164
- }).isRequired
165
- }),
166
- /**
167
- * The components used for each slot inside.
168
- */
169
- slots: PropTypes.shape({
170
- toolbar: PropTypes.elementType
171
- }),
172
- /**
173
- * The title of the page. Leave blank to use the active page title.
174
- */
175
- title: PropTypes.string
176
- } as any;
177
-
178
139
  export { PageContainer };