@iowas/toolpad 1.0.1 → 1.0.2

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.
@@ -0,0 +1,201 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { Theme } from '@mui/material/styles';
4
+
5
+ /**
6
+ * @ignore - internal component.
7
+ */
8
+ interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
9
+ history?: 'auto' | 'push' | 'replace';
10
+ href: string;
11
+ }
12
+
13
+ interface LocaleText {
14
+ accountSignInLabel: string;
15
+ accountSignOutLabel: string;
16
+ accountPreviewIconButtonLabel: string;
17
+ accountPreviewTitle: string;
18
+ signInTitle: string | ((brandingTitle?: string) => string);
19
+ signInSubtitle: string;
20
+ providerSignInTitle: (provider: string) => string;
21
+ signInRememberMe: string;
22
+ email: string;
23
+ passkey: string;
24
+ username: string;
25
+ password: string;
26
+ or: string;
27
+ to: string;
28
+ with: string;
29
+ save: string;
30
+ cancel: string;
31
+ ok: string;
32
+ close: string;
33
+ delete: string;
34
+ alert: string;
35
+ confirm: string;
36
+ loading: string;
37
+ createNewButtonLabel: string;
38
+ reloadButtonLabel: string;
39
+ createLabel: string;
40
+ createSuccessMessage: string;
41
+ createErrorMessage: string;
42
+ editLabel: string;
43
+ editSuccessMessage: string;
44
+ editErrorMessage: string;
45
+ deleteLabel: string;
46
+ deleteConfirmTitle: string;
47
+ deleteConfirmMessage: string;
48
+ deleteConfirmLabel: string;
49
+ deleteCancelLabel: string;
50
+ deleteSuccessMessage: string;
51
+ deleteErrorMessage: string;
52
+ deletedItemMessage: string;
53
+ }
54
+ interface LocalizationProviderProps {
55
+ children?: React.ReactNode;
56
+ /**
57
+ * Locale for components texts
58
+ */
59
+ localeText?: Partial<LocaleText>;
60
+ }
61
+ declare const LocalizationContext: React.Context<Partial<LocaleText>>;
62
+ declare const LocalizationProvider: {
63
+ (props: LocalizationProviderProps): react_jsx_runtime.JSX.Element;
64
+ propTypes: any;
65
+ };
66
+
67
+ /**
68
+ *
69
+ * Demos:
70
+ *
71
+ * - [Sign-in Page](https://mui.com/toolpad/core/react-sign-in-page/)
72
+ *
73
+ * API:
74
+ *
75
+ * - [LocalizationProvider API](https://mui.com/toolpad/core/api/localization-provider)
76
+ */
77
+ declare function useLocaleText(): Partial<LocaleText>;
78
+
79
+ interface NavigateOptions {
80
+ history?: 'auto' | 'push' | 'replace';
81
+ }
82
+ interface Navigate {
83
+ (url: string | URL, options?: NavigateOptions): void;
84
+ }
85
+ /**
86
+ * Abstract router used by Toolpad components.
87
+ */
88
+ interface Router {
89
+ pathname: string;
90
+ searchParams: URLSearchParams;
91
+ navigate: Navigate;
92
+ Link?: React.ComponentType<LinkProps>;
93
+ }
94
+ interface Branding {
95
+ title?: string;
96
+ logo?: React.ReactNode;
97
+ homeUrl?: string;
98
+ }
99
+ interface NavigationPageItem {
100
+ kind?: 'page';
101
+ segment?: string;
102
+ title?: string;
103
+ icon?: React.ReactNode;
104
+ pattern?: string;
105
+ action?: React.ReactNode;
106
+ children?: Navigation;
107
+ }
108
+ interface NavigationSubheaderItem {
109
+ kind: 'header';
110
+ title: string;
111
+ }
112
+ interface NavigationDividerItem {
113
+ kind: 'divider';
114
+ }
115
+ type NavigationItem = NavigationPageItem | NavigationSubheaderItem | NavigationDividerItem;
116
+ type Navigation = NavigationItem[];
117
+ interface Session {
118
+ user?: {
119
+ id?: string | null;
120
+ name?: string | null;
121
+ image?: string | null;
122
+ email?: string | null;
123
+ };
124
+ }
125
+ interface Authentication {
126
+ signIn: () => void;
127
+ signOut: () => void;
128
+ }
129
+ declare const AuthenticationContext: React.Context<Authentication | null>;
130
+ declare const SessionContext: React.Context<Session | null>;
131
+ type AppTheme = Theme | {
132
+ light: Theme;
133
+ dark: Theme;
134
+ };
135
+ interface AppProviderProps {
136
+ /**
137
+ * The content of the app provider.
138
+ */
139
+ children: React.ReactNode;
140
+ /**
141
+ * [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.
142
+ * @default createDefaultTheme()
143
+ */
144
+ theme?: AppTheme;
145
+ /**
146
+ * Branding options for the app.
147
+ * @default null
148
+ */
149
+ branding?: Branding | null;
150
+ /**
151
+ * Navigation definition for the app. [Find out more](https://mui.com/toolpad/core/react-app-provider/#navigation).
152
+ * @default []
153
+ */
154
+ navigation?: Navigation;
155
+ /**
156
+ * Router implementation used inside Toolpad components.
157
+ * @default null
158
+ */
159
+ router?: Router;
160
+ /**
161
+ * Locale text for components
162
+ */
163
+ localeText?: Partial<LocaleText>;
164
+ /**
165
+ * Session info about the current user.
166
+ * @default null
167
+ */
168
+ session?: Session | null;
169
+ /**
170
+ * Authentication methods.
171
+ * @default null
172
+ */
173
+ authentication?: Authentication | null;
174
+ /**
175
+ * The window where the application is rendered.
176
+ * This is needed when rendering the app inside an iframe, for example.
177
+ * @default window
178
+ */
179
+ window?: Window;
180
+ /**
181
+ * The nonce to be used for inline scripts.
182
+ */
183
+ nonce?: string;
184
+ }
185
+ /**
186
+ *
187
+ * Demos:
188
+ *
189
+ * - [App Provider](https://mui.com/toolpad/core/react-app-provider/)
190
+ * - [Dashboard Layout](https://mui.com/toolpad/core/react-dashboard-layout/)
191
+ *
192
+ * API:
193
+ *
194
+ * - [AppProvider API](https://mui.com/toolpad/core/api/app-provider)
195
+ */
196
+ declare function AppProvider(props: AppProviderProps): react_jsx_runtime.JSX.Element;
197
+ declare namespace AppProvider {
198
+ var propTypes: any;
199
+ }
200
+
201
+ export { AppProvider as A, type Branding as B, type LocaleText as L, type Navigate as N, type Router as R, type Session as S, type AppProviderProps as a, type AppTheme as b, type Authentication as c, AuthenticationContext as d, LocalizationContext as e, LocalizationProvider as f, type LocalizationProviderProps as g, type NavigateOptions as h, type Navigation as i, type NavigationDividerItem as j, type NavigationItem as k, type NavigationPageItem as l, type NavigationSubheaderItem as m, SessionContext as n, useLocaleText as u };
@@ -0,0 +1,201 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { Theme } from '@mui/material/styles';
4
+
5
+ /**
6
+ * @ignore - internal component.
7
+ */
8
+ interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
9
+ history?: 'auto' | 'push' | 'replace';
10
+ href: string;
11
+ }
12
+
13
+ interface LocaleText {
14
+ accountSignInLabel: string;
15
+ accountSignOutLabel: string;
16
+ accountPreviewIconButtonLabel: string;
17
+ accountPreviewTitle: string;
18
+ signInTitle: string | ((brandingTitle?: string) => string);
19
+ signInSubtitle: string;
20
+ providerSignInTitle: (provider: string) => string;
21
+ signInRememberMe: string;
22
+ email: string;
23
+ passkey: string;
24
+ username: string;
25
+ password: string;
26
+ or: string;
27
+ to: string;
28
+ with: string;
29
+ save: string;
30
+ cancel: string;
31
+ ok: string;
32
+ close: string;
33
+ delete: string;
34
+ alert: string;
35
+ confirm: string;
36
+ loading: string;
37
+ createNewButtonLabel: string;
38
+ reloadButtonLabel: string;
39
+ createLabel: string;
40
+ createSuccessMessage: string;
41
+ createErrorMessage: string;
42
+ editLabel: string;
43
+ editSuccessMessage: string;
44
+ editErrorMessage: string;
45
+ deleteLabel: string;
46
+ deleteConfirmTitle: string;
47
+ deleteConfirmMessage: string;
48
+ deleteConfirmLabel: string;
49
+ deleteCancelLabel: string;
50
+ deleteSuccessMessage: string;
51
+ deleteErrorMessage: string;
52
+ deletedItemMessage: string;
53
+ }
54
+ interface LocalizationProviderProps {
55
+ children?: React.ReactNode;
56
+ /**
57
+ * Locale for components texts
58
+ */
59
+ localeText?: Partial<LocaleText>;
60
+ }
61
+ declare const LocalizationContext: React.Context<Partial<LocaleText>>;
62
+ declare const LocalizationProvider: {
63
+ (props: LocalizationProviderProps): react_jsx_runtime.JSX.Element;
64
+ propTypes: any;
65
+ };
66
+
67
+ /**
68
+ *
69
+ * Demos:
70
+ *
71
+ * - [Sign-in Page](https://mui.com/toolpad/core/react-sign-in-page/)
72
+ *
73
+ * API:
74
+ *
75
+ * - [LocalizationProvider API](https://mui.com/toolpad/core/api/localization-provider)
76
+ */
77
+ declare function useLocaleText(): Partial<LocaleText>;
78
+
79
+ interface NavigateOptions {
80
+ history?: 'auto' | 'push' | 'replace';
81
+ }
82
+ interface Navigate {
83
+ (url: string | URL, options?: NavigateOptions): void;
84
+ }
85
+ /**
86
+ * Abstract router used by Toolpad components.
87
+ */
88
+ interface Router {
89
+ pathname: string;
90
+ searchParams: URLSearchParams;
91
+ navigate: Navigate;
92
+ Link?: React.ComponentType<LinkProps>;
93
+ }
94
+ interface Branding {
95
+ title?: string;
96
+ logo?: React.ReactNode;
97
+ homeUrl?: string;
98
+ }
99
+ interface NavigationPageItem {
100
+ kind?: 'page';
101
+ segment?: string;
102
+ title?: string;
103
+ icon?: React.ReactNode;
104
+ pattern?: string;
105
+ action?: React.ReactNode;
106
+ children?: Navigation;
107
+ }
108
+ interface NavigationSubheaderItem {
109
+ kind: 'header';
110
+ title: string;
111
+ }
112
+ interface NavigationDividerItem {
113
+ kind: 'divider';
114
+ }
115
+ type NavigationItem = NavigationPageItem | NavigationSubheaderItem | NavigationDividerItem;
116
+ type Navigation = NavigationItem[];
117
+ interface Session {
118
+ user?: {
119
+ id?: string | null;
120
+ name?: string | null;
121
+ image?: string | null;
122
+ email?: string | null;
123
+ };
124
+ }
125
+ interface Authentication {
126
+ signIn: () => void;
127
+ signOut: () => void;
128
+ }
129
+ declare const AuthenticationContext: React.Context<Authentication | null>;
130
+ declare const SessionContext: React.Context<Session | null>;
131
+ type AppTheme = Theme | {
132
+ light: Theme;
133
+ dark: Theme;
134
+ };
135
+ interface AppProviderProps {
136
+ /**
137
+ * The content of the app provider.
138
+ */
139
+ children: React.ReactNode;
140
+ /**
141
+ * [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.
142
+ * @default createDefaultTheme()
143
+ */
144
+ theme?: AppTheme;
145
+ /**
146
+ * Branding options for the app.
147
+ * @default null
148
+ */
149
+ branding?: Branding | null;
150
+ /**
151
+ * Navigation definition for the app. [Find out more](https://mui.com/toolpad/core/react-app-provider/#navigation).
152
+ * @default []
153
+ */
154
+ navigation?: Navigation;
155
+ /**
156
+ * Router implementation used inside Toolpad components.
157
+ * @default null
158
+ */
159
+ router?: Router;
160
+ /**
161
+ * Locale text for components
162
+ */
163
+ localeText?: Partial<LocaleText>;
164
+ /**
165
+ * Session info about the current user.
166
+ * @default null
167
+ */
168
+ session?: Session | null;
169
+ /**
170
+ * Authentication methods.
171
+ * @default null
172
+ */
173
+ authentication?: Authentication | null;
174
+ /**
175
+ * The window where the application is rendered.
176
+ * This is needed when rendering the app inside an iframe, for example.
177
+ * @default window
178
+ */
179
+ window?: Window;
180
+ /**
181
+ * The nonce to be used for inline scripts.
182
+ */
183
+ nonce?: string;
184
+ }
185
+ /**
186
+ *
187
+ * Demos:
188
+ *
189
+ * - [App Provider](https://mui.com/toolpad/core/react-app-provider/)
190
+ * - [Dashboard Layout](https://mui.com/toolpad/core/react-dashboard-layout/)
191
+ *
192
+ * API:
193
+ *
194
+ * - [AppProvider API](https://mui.com/toolpad/core/api/app-provider)
195
+ */
196
+ declare function AppProvider(props: AppProviderProps): react_jsx_runtime.JSX.Element;
197
+ declare namespace AppProvider {
198
+ var propTypes: any;
199
+ }
200
+
201
+ export { AppProvider as A, type Branding as B, type LocaleText as L, type Navigate as N, type Router as R, type Session as S, type AppProviderProps as a, type AppTheme as b, type Authentication as c, AuthenticationContext as d, LocalizationContext as e, LocalizationProvider as f, type LocalizationProviderProps as g, type NavigateOptions as h, type Navigation as i, type NavigationDividerItem as j, type NavigationItem as k, type NavigationPageItem as l, type NavigationSubheaderItem as m, SessionContext as n, useLocaleText as u };
@@ -112,15 +112,6 @@ function createGlobalState(initialState) {
112
112
  };
113
113
  }
114
114
 
115
- // src/toolpad-utils/warnOnce.ts
116
- var history = /* @__PURE__ */ new Set();
117
- function warnOnce(msg) {
118
- if (!history.has(msg)) {
119
- history.add(msg);
120
- console.warn(msg);
121
- }
122
- }
123
-
124
115
  export {
125
116
  __spreadValues,
126
117
  __spreadProps,
@@ -130,6 +121,5 @@ export {
130
121
  createProvidedContext,
131
122
  useAssertedContext,
132
123
  useTraceUpdates,
133
- createGlobalState,
134
- warnOnce
124
+ createGlobalState
135
125
  };
@@ -0,0 +1,12 @@
1
+ // src/toolpad-utils/warnOnce.ts
2
+ var history = /* @__PURE__ */ new Set();
3
+ function warnOnce(msg) {
4
+ if (!history.has(msg)) {
5
+ history.add(msg);
6
+ console.warn(msg);
7
+ }
8
+ }
9
+
10
+ export {
11
+ warnOnce
12
+ };