@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.
@@ -0,0 +1,106 @@
1
+ import {
2
+ AppProvider
3
+ } from "./chunk-LUTZBKSG.mjs";
4
+ import {
5
+ asArray
6
+ } from "./chunk-UNVYOWC2.mjs";
7
+ import {
8
+ __objRest,
9
+ __spreadValues
10
+ } from "./chunk-3JWXE2JW.mjs";
11
+
12
+ // src/toolpad-core/nextjs/NextAppProvider.tsx
13
+ import { useRouter as useRouter3 } from "next/compat/router.js";
14
+
15
+ // src/toolpad-core/nextjs/NextAppProviderApp.tsx
16
+ import * as React from "react";
17
+ import NextLink from "next/link.js";
18
+ import { usePathname, useSearchParams, useRouter } from "next/navigation.js";
19
+ import { jsx } from "react/jsx-runtime";
20
+ var Link = React.forwardRef((props, ref) => {
21
+ const _a = props, { href, history } = _a, rest = __objRest(_a, ["href", "history"]);
22
+ return /* @__PURE__ */ jsx(NextLink, __spreadValues({ ref, href, replace: history === "replace" }, rest));
23
+ });
24
+ function NextAppProviderApp(props) {
25
+ const pathname = usePathname();
26
+ const searchParams = useSearchParams();
27
+ const { push, replace } = useRouter();
28
+ const navigate = React.useCallback(
29
+ (url, { history = "auto" } = {}) => {
30
+ if (history === "auto" || history === "push") {
31
+ return push(String(url));
32
+ }
33
+ if (history === "replace") {
34
+ return replace(String(url));
35
+ }
36
+ throw new Error(`Invalid history option: ${history}`);
37
+ },
38
+ [push, replace]
39
+ );
40
+ const routerImpl = React.useMemo(
41
+ () => ({
42
+ pathname,
43
+ searchParams,
44
+ navigate,
45
+ Link
46
+ }),
47
+ [pathname, navigate, searchParams]
48
+ );
49
+ return /* @__PURE__ */ jsx(AppProvider, __spreadValues({ router: routerImpl }, props));
50
+ }
51
+
52
+ // src/toolpad-core/nextjs/NextAppProviderPages.tsx
53
+ import * as React2 from "react";
54
+ import NextLink2 from "next/link.js";
55
+ import { useRouter as useRouter2 } from "next/router.js";
56
+ import { jsx as jsx2 } from "react/jsx-runtime";
57
+ var Link2 = React2.forwardRef((props, ref) => {
58
+ const _a = props, { href, history } = _a, rest = __objRest(_a, ["href", "history"]);
59
+ return /* @__PURE__ */ jsx2(NextLink2, __spreadValues({ ref, href, replace: history === "replace" }, rest));
60
+ });
61
+ function NextAppProviderPages(props) {
62
+ const { push, replace, asPath, query } = useRouter2();
63
+ const search = React2.useMemo(() => {
64
+ const params = new URLSearchParams();
65
+ Object.entries(query != null ? query : {}).forEach(([key, value]) => {
66
+ asArray(value != null ? value : []).forEach((v) => {
67
+ params.append(key, v);
68
+ });
69
+ });
70
+ return params.toString();
71
+ }, [query]);
72
+ const searchParams = React2.useMemo(() => new URLSearchParams(search), [search]);
73
+ const navigate = React2.useCallback(
74
+ (url, { history = "auto" } = {}) => {
75
+ if (history === "auto" || history === "push") {
76
+ return push(String(url));
77
+ }
78
+ if (history === "replace") {
79
+ return replace(String(url));
80
+ }
81
+ throw new Error(`Invalid history option: ${history}`);
82
+ },
83
+ [push, replace]
84
+ );
85
+ const routerImpl = React2.useMemo(
86
+ () => ({
87
+ pathname: asPath.split("?")[0],
88
+ searchParams,
89
+ navigate,
90
+ Link: Link2
91
+ }),
92
+ [asPath, navigate, searchParams]
93
+ );
94
+ return /* @__PURE__ */ jsx2(AppProvider, __spreadValues({ router: routerImpl }, props));
95
+ }
96
+
97
+ // src/toolpad-core/nextjs/NextAppProvider.tsx
98
+ import { jsx as jsx3 } from "react/jsx-runtime";
99
+ function NextAppProvider(props) {
100
+ const router = useRouter3();
101
+ const AppProvider2 = router ? NextAppProviderPages : NextAppProviderApp;
102
+ return /* @__PURE__ */ jsx3(AppProvider2, __spreadValues({}, props));
103
+ }
104
+ export {
105
+ NextAppProvider
106
+ };
@@ -0,0 +1,98 @@
1
+ import * as React from 'react';
2
+
3
+ declare function asArray<T>(maybeArray: T | T[]): T[];
4
+ type PropertiesOf<P> = Extract<keyof P, string>;
5
+ type Require<T, K extends keyof T> = T & {
6
+ [P in K]-?: T[P];
7
+ };
8
+ type Ensure<U, K extends PropertyKey> = K extends keyof U ? Require<U, K> : U & Record<K, unknown>;
9
+ /**
10
+ * Type aware version of Object.prototype.hasOwnProperty.
11
+ * See https://fettblog.eu/typescript-hasownproperty/
12
+ */
13
+ declare function hasOwnProperty<X extends {}, Y extends PropertyKey>(obj: X, prop: Y): obj is Ensure<X, Y>;
14
+ /**
15
+ * Maps `obj` to a new object. The `mapper` function receives an entry array of key and value and
16
+ * is allowed to manipulate both. It can also return `null` to omit a property from the result.
17
+ */
18
+ declare function mapProperties<P, L extends PropertyKey, U>(obj: P, mapper: <K extends PropertiesOf<P>>(old: [K, P[K]]) => [L, U] | null): Record<L, U>;
19
+ /**
20
+ * Maps an objects' property keys. The result is a new object with the mapped keys, but the same values.
21
+ */
22
+ declare function mapKeys<U>(obj: Record<string, U>, mapper: (old: string) => string): Record<string, U>;
23
+ /**
24
+ * Maps an objects' property values. The result is a new object with the same keys, but mapped values.
25
+ */
26
+ declare function mapValues<P, V>(obj: P, mapper: (old: P[PropertiesOf<P>], key: PropertiesOf<P>) => V): Record<PropertiesOf<P>, V>;
27
+ /**
28
+ * Filters an objects' property values. Similar to `array.filter` but for objects. The result is a new
29
+ * object with all the properties removed for which `filter` returned `false`.
30
+ */
31
+ declare function filterValues<K extends PropertyKey, P, Q extends P>(obj: Record<K, P>, filter: (old: P) => old is Q): Record<K, Q>;
32
+ declare function filterValues<P>(obj: P, filter: (old: P[keyof P]) => boolean): Partial<P>;
33
+ declare function filterValues<U>(obj: Record<string, U>, filter: (old: U) => boolean): Record<string, U>;
34
+ /**
35
+ * Filters an objects' property keys. Similar to `array.filter` but for objects. The result is a new
36
+ * object with all the properties removed for which `filter` returned `false`.
37
+ */
38
+ declare function filterKeys<P>(obj: P, filter: (old: keyof P) => boolean): Partial<P>;
39
+ declare function filterKeys<U>(obj: Record<string, U>, filter: (old: string) => boolean): Record<string, U>;
40
+ /**
41
+ * Compares the properties of two objects. Returns `true` if all properties are strictly equal, `false`
42
+ * otherwise.
43
+ * Pass a subset of properties to only compare those.
44
+ */
45
+ declare function equalProperties<P extends object>(obj1: P, obj2: P, subset?: (keyof P)[]): boolean;
46
+
47
+ /**
48
+ * Like `Array.prototype.join`, but for React nodes.
49
+ */
50
+ declare function interleave(items: React.ReactNode[], separator: React.ReactNode): React.ReactNode;
51
+ /**
52
+ * Consume a context but throw when used outside of a provider.
53
+ */
54
+ declare function useNonNullableContext<T>(context: React.Context<T>, name?: string): NonNullable<T>;
55
+ /**
56
+ * Context that throws when used outside of a provider.
57
+ */
58
+ declare function createProvidedContext<T>(name?: string): [() => T, React.ComponentType<React.ProviderProps<T>>];
59
+ declare function useAssertedContext<T>(context: React.Context<T | undefined>): T;
60
+ /**
61
+ * Debugging tool that logs updates to props.
62
+ */
63
+ declare function useTraceUpdates<P extends object>(prefix: string, props: P): void;
64
+ /**
65
+ * Create a shared state to be used across the application. Returns a useState hook that
66
+ * is synchronized on the same state between all instances where it is called.
67
+ */
68
+ declare function createGlobalState<T>(initialState: T): {
69
+ getState: () => T;
70
+ setState: (newState: T | ((oldValue: T) => T)) => void;
71
+ useValue: () => T;
72
+ useState: () => [T, React.Dispatch<React.SetStateAction<T>>];
73
+ subscribe: (cb: (state: T) => void) => () => void;
74
+ };
75
+
76
+ /**
77
+ * A utility with shortcuts to manipulate boolean values.
78
+ */
79
+ declare function useBoolean(initialValue: boolean): {
80
+ value: boolean;
81
+ setValue: React.Dispatch<React.SetStateAction<boolean>>;
82
+ toggle: () => void;
83
+ setTrue: () => void;
84
+ setFalse: () => void;
85
+ };
86
+
87
+ /**
88
+ * Sets the current document title.
89
+ */
90
+ declare function usePageTitle(title: string): void;
91
+
92
+ /**
93
+ * Warns only once for a specific message.
94
+ * @param msg The message to warn.
95
+ */
96
+ declare function warnOnce(msg: string): void;
97
+
98
+ export { asArray, createGlobalState, createProvidedContext, equalProperties, filterKeys, filterValues, hasOwnProperty, interleave, mapKeys, mapProperties, mapValues, useAssertedContext, useBoolean, useNonNullableContext, usePageTitle, useTraceUpdates, warnOnce };
@@ -0,0 +1,98 @@
1
+ import * as React from 'react';
2
+
3
+ declare function asArray<T>(maybeArray: T | T[]): T[];
4
+ type PropertiesOf<P> = Extract<keyof P, string>;
5
+ type Require<T, K extends keyof T> = T & {
6
+ [P in K]-?: T[P];
7
+ };
8
+ type Ensure<U, K extends PropertyKey> = K extends keyof U ? Require<U, K> : U & Record<K, unknown>;
9
+ /**
10
+ * Type aware version of Object.prototype.hasOwnProperty.
11
+ * See https://fettblog.eu/typescript-hasownproperty/
12
+ */
13
+ declare function hasOwnProperty<X extends {}, Y extends PropertyKey>(obj: X, prop: Y): obj is Ensure<X, Y>;
14
+ /**
15
+ * Maps `obj` to a new object. The `mapper` function receives an entry array of key and value and
16
+ * is allowed to manipulate both. It can also return `null` to omit a property from the result.
17
+ */
18
+ declare function mapProperties<P, L extends PropertyKey, U>(obj: P, mapper: <K extends PropertiesOf<P>>(old: [K, P[K]]) => [L, U] | null): Record<L, U>;
19
+ /**
20
+ * Maps an objects' property keys. The result is a new object with the mapped keys, but the same values.
21
+ */
22
+ declare function mapKeys<U>(obj: Record<string, U>, mapper: (old: string) => string): Record<string, U>;
23
+ /**
24
+ * Maps an objects' property values. The result is a new object with the same keys, but mapped values.
25
+ */
26
+ declare function mapValues<P, V>(obj: P, mapper: (old: P[PropertiesOf<P>], key: PropertiesOf<P>) => V): Record<PropertiesOf<P>, V>;
27
+ /**
28
+ * Filters an objects' property values. Similar to `array.filter` but for objects. The result is a new
29
+ * object with all the properties removed for which `filter` returned `false`.
30
+ */
31
+ declare function filterValues<K extends PropertyKey, P, Q extends P>(obj: Record<K, P>, filter: (old: P) => old is Q): Record<K, Q>;
32
+ declare function filterValues<P>(obj: P, filter: (old: P[keyof P]) => boolean): Partial<P>;
33
+ declare function filterValues<U>(obj: Record<string, U>, filter: (old: U) => boolean): Record<string, U>;
34
+ /**
35
+ * Filters an objects' property keys. Similar to `array.filter` but for objects. The result is a new
36
+ * object with all the properties removed for which `filter` returned `false`.
37
+ */
38
+ declare function filterKeys<P>(obj: P, filter: (old: keyof P) => boolean): Partial<P>;
39
+ declare function filterKeys<U>(obj: Record<string, U>, filter: (old: string) => boolean): Record<string, U>;
40
+ /**
41
+ * Compares the properties of two objects. Returns `true` if all properties are strictly equal, `false`
42
+ * otherwise.
43
+ * Pass a subset of properties to only compare those.
44
+ */
45
+ declare function equalProperties<P extends object>(obj1: P, obj2: P, subset?: (keyof P)[]): boolean;
46
+
47
+ /**
48
+ * Like `Array.prototype.join`, but for React nodes.
49
+ */
50
+ declare function interleave(items: React.ReactNode[], separator: React.ReactNode): React.ReactNode;
51
+ /**
52
+ * Consume a context but throw when used outside of a provider.
53
+ */
54
+ declare function useNonNullableContext<T>(context: React.Context<T>, name?: string): NonNullable<T>;
55
+ /**
56
+ * Context that throws when used outside of a provider.
57
+ */
58
+ declare function createProvidedContext<T>(name?: string): [() => T, React.ComponentType<React.ProviderProps<T>>];
59
+ declare function useAssertedContext<T>(context: React.Context<T | undefined>): T;
60
+ /**
61
+ * Debugging tool that logs updates to props.
62
+ */
63
+ declare function useTraceUpdates<P extends object>(prefix: string, props: P): void;
64
+ /**
65
+ * Create a shared state to be used across the application. Returns a useState hook that
66
+ * is synchronized on the same state between all instances where it is called.
67
+ */
68
+ declare function createGlobalState<T>(initialState: T): {
69
+ getState: () => T;
70
+ setState: (newState: T | ((oldValue: T) => T)) => void;
71
+ useValue: () => T;
72
+ useState: () => [T, React.Dispatch<React.SetStateAction<T>>];
73
+ subscribe: (cb: (state: T) => void) => () => void;
74
+ };
75
+
76
+ /**
77
+ * A utility with shortcuts to manipulate boolean values.
78
+ */
79
+ declare function useBoolean(initialValue: boolean): {
80
+ value: boolean;
81
+ setValue: React.Dispatch<React.SetStateAction<boolean>>;
82
+ toggle: () => void;
83
+ setTrue: () => void;
84
+ setFalse: () => void;
85
+ };
86
+
87
+ /**
88
+ * Sets the current document title.
89
+ */
90
+ declare function usePageTitle(title: string): void;
91
+
92
+ /**
93
+ * Warns only once for a specific message.
94
+ * @param msg The message to warn.
95
+ */
96
+ declare function warnOnce(msg: string): void;
97
+
98
+ export { asArray, createGlobalState, createProvidedContext, equalProperties, filterKeys, filterValues, hasOwnProperty, interleave, mapKeys, mapProperties, mapValues, useAssertedContext, useBoolean, useNonNullableContext, usePageTitle, useTraceUpdates, warnOnce };
package/dist/utils.js ADDED
@@ -0,0 +1,218 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/utils.ts
31
+ var utils_exports = {};
32
+ __export(utils_exports, {
33
+ asArray: () => asArray,
34
+ createGlobalState: () => createGlobalState,
35
+ createProvidedContext: () => createProvidedContext,
36
+ equalProperties: () => equalProperties,
37
+ filterKeys: () => filterKeys,
38
+ filterValues: () => filterValues,
39
+ hasOwnProperty: () => hasOwnProperty,
40
+ interleave: () => interleave,
41
+ mapKeys: () => mapKeys,
42
+ mapProperties: () => mapProperties,
43
+ mapValues: () => mapValues,
44
+ useAssertedContext: () => useAssertedContext,
45
+ useBoolean: () => useBoolean,
46
+ useNonNullableContext: () => useNonNullableContext,
47
+ usePageTitle: () => usePageTitle,
48
+ useTraceUpdates: () => useTraceUpdates,
49
+ warnOnce: () => warnOnce
50
+ });
51
+ module.exports = __toCommonJS(utils_exports);
52
+
53
+ // src/toolpad-utils/collections.ts
54
+ function asArray(maybeArray) {
55
+ return Array.isArray(maybeArray) ? maybeArray : [maybeArray];
56
+ }
57
+ function hasOwnProperty(obj, prop) {
58
+ return obj.hasOwnProperty(prop);
59
+ }
60
+ function mapProperties(obj, mapper) {
61
+ return Object.fromEntries(
62
+ Object.entries(obj).flatMap((entry) => {
63
+ const mapped = mapper(entry);
64
+ return mapped ? [mapped] : [];
65
+ })
66
+ );
67
+ }
68
+ function mapKeys(obj, mapper) {
69
+ return mapProperties(obj, ([key, value]) => [mapper(key), value]);
70
+ }
71
+ function mapValues(obj, mapper) {
72
+ return mapProperties(obj, ([key, value]) => [key, mapper(value, key)]);
73
+ }
74
+ function filterValues(obj, filter) {
75
+ return mapProperties(obj, ([key, value]) => filter(value) ? [key, value] : null);
76
+ }
77
+ function filterKeys(obj, filter) {
78
+ return mapProperties(obj, ([key, value]) => filter(key) ? [key, value] : null);
79
+ }
80
+ function equalProperties(obj1, obj2, subset) {
81
+ const keysToCheck = new Set(
82
+ subset != null ? subset : [...Object.keys(obj1), ...Object.keys(obj2)]
83
+ );
84
+ return Array.from(keysToCheck).every((key) => Object.is(obj1[key], obj2[key]));
85
+ }
86
+
87
+ // src/toolpad-utils/react.tsx
88
+ var React = __toESM(require("react"));
89
+ var ReactIs = __toESM(require("react-is"));
90
+ var import_jsx_runtime = require("react/jsx-runtime");
91
+ function interleave(items, separator) {
92
+ const result = [];
93
+ for (let i = 0; i < items.length; i += 1) {
94
+ if (i > 0) {
95
+ if (ReactIs.isElement(separator)) {
96
+ result.push(React.cloneElement(separator, { key: `separator-${i}` }));
97
+ } else {
98
+ result.push(separator);
99
+ }
100
+ }
101
+ const item = items[i];
102
+ result.push(item);
103
+ }
104
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(React.Fragment, { children: result });
105
+ }
106
+ function useNonNullableContext(context, name) {
107
+ const maybeContext = React.useContext(context);
108
+ if (maybeContext === null || maybeContext === void 0) {
109
+ throw new Error(`context "${name}" was used without a Provider`);
110
+ }
111
+ return maybeContext;
112
+ }
113
+ function createProvidedContext(name) {
114
+ const context = React.createContext(void 0);
115
+ const useContext2 = () => useNonNullableContext(context, name);
116
+ return [useContext2, context.Provider];
117
+ }
118
+ function useAssertedContext(context) {
119
+ const value = React.useContext(context);
120
+ if (value === void 0) {
121
+ throw new Error("context was used without a Provider");
122
+ }
123
+ return value;
124
+ }
125
+ function useTraceUpdates(prefix, props) {
126
+ const prev = React.useRef(props);
127
+ React.useEffect(() => {
128
+ const changedProps = {};
129
+ for (const key of Object.keys(props)) {
130
+ if (!Object.is(prev.current[key], props[key])) {
131
+ changedProps[key] = props[key];
132
+ }
133
+ }
134
+ if (Object.keys(changedProps).length > 0) {
135
+ console.log(`${prefix} changed props:`, changedProps);
136
+ }
137
+ prev.current = props;
138
+ });
139
+ }
140
+ function createGlobalState(initialState) {
141
+ let state = initialState;
142
+ const listeners = [];
143
+ const subscribe = (cb) => {
144
+ listeners.push(cb);
145
+ return () => {
146
+ const index = listeners.indexOf(cb);
147
+ listeners.splice(index, 1);
148
+ };
149
+ };
150
+ const getState = () => state;
151
+ const setState = (newState) => {
152
+ state = typeof newState === "function" ? newState(state) : newState;
153
+ listeners.forEach((cb) => cb(state));
154
+ };
155
+ const useValue = () => React.useSyncExternalStore(subscribe, getState, getState);
156
+ const useState2 = () => {
157
+ const value = useValue();
158
+ return [value, setState];
159
+ };
160
+ return {
161
+ getState,
162
+ setState,
163
+ useValue,
164
+ useState: useState2,
165
+ subscribe
166
+ };
167
+ }
168
+
169
+ // src/toolpad-utils/hooks/useBoolean.ts
170
+ var React2 = __toESM(require("react"));
171
+ function useBoolean(initialValue) {
172
+ const [value, setValue] = React2.useState(initialValue);
173
+ const toggle = React2.useCallback(() => setValue((existing) => !existing), []);
174
+ const setTrue = React2.useCallback(() => setValue(true), []);
175
+ const setFalse = React2.useCallback(() => setValue(false), []);
176
+ return { value, setValue, toggle, setTrue, setFalse };
177
+ }
178
+
179
+ // src/toolpad-utils/hooks/usePageTitle.ts
180
+ var React3 = __toESM(require("react"));
181
+ function usePageTitle(title) {
182
+ React3.useEffect(() => {
183
+ const original = document.title;
184
+ document.title = title;
185
+ return () => {
186
+ document.title = original;
187
+ };
188
+ }, [title]);
189
+ }
190
+
191
+ // src/toolpad-utils/warnOnce.ts
192
+ var history = /* @__PURE__ */ new Set();
193
+ function warnOnce(msg) {
194
+ if (!history.has(msg)) {
195
+ history.add(msg);
196
+ console.warn(msg);
197
+ }
198
+ }
199
+ // Annotate the CommonJS export names for ESM import in node:
200
+ 0 && (module.exports = {
201
+ asArray,
202
+ createGlobalState,
203
+ createProvidedContext,
204
+ equalProperties,
205
+ filterKeys,
206
+ filterValues,
207
+ hasOwnProperty,
208
+ interleave,
209
+ mapKeys,
210
+ mapProperties,
211
+ mapValues,
212
+ useAssertedContext,
213
+ useBoolean,
214
+ useNonNullableContext,
215
+ usePageTitle,
216
+ useTraceUpdates,
217
+ warnOnce
218
+ });
package/dist/utils.mjs ADDED
@@ -0,0 +1,44 @@
1
+ import {
2
+ useBoolean,
3
+ usePageTitle
4
+ } from "./chunk-CENJI4RY.mjs";
5
+ import {
6
+ warnOnce
7
+ } from "./chunk-F6JD4MSY.mjs";
8
+ import {
9
+ asArray,
10
+ equalProperties,
11
+ filterKeys,
12
+ filterValues,
13
+ hasOwnProperty,
14
+ mapKeys,
15
+ mapProperties,
16
+ mapValues
17
+ } from "./chunk-UNVYOWC2.mjs";
18
+ import {
19
+ createGlobalState,
20
+ createProvidedContext,
21
+ interleave,
22
+ useAssertedContext,
23
+ useNonNullableContext,
24
+ useTraceUpdates
25
+ } from "./chunk-3JWXE2JW.mjs";
26
+ export {
27
+ asArray,
28
+ createGlobalState,
29
+ createProvidedContext,
30
+ equalProperties,
31
+ filterKeys,
32
+ filterValues,
33
+ hasOwnProperty,
34
+ interleave,
35
+ mapKeys,
36
+ mapProperties,
37
+ mapValues,
38
+ useAssertedContext,
39
+ useBoolean,
40
+ useNonNullableContext,
41
+ usePageTitle,
42
+ useTraceUpdates,
43
+ warnOnce
44
+ };
package/package.json ADDED
@@ -0,0 +1,87 @@
1
+ {
2
+ "name": "@iowas/toolpad",
3
+ "version": "1.0.0",
4
+ "description": "Custom mui-toolpad",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "files": [
9
+ "dist",
10
+ "README.md"
11
+ ],
12
+ "sideEffects": false,
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.mjs",
17
+ "require": "./dist/index.js"
18
+ },
19
+ "./core": {
20
+ "types": "./dist/core.d.ts",
21
+ "import": "./dist/core.mjs",
22
+ "require": "./dist/core.js"
23
+ },
24
+ "./utils": {
25
+ "types": "./dist/utils.d.ts",
26
+ "import": "./dist/utils.mjs",
27
+ "require": "./dist/utils.js"
28
+ },
29
+ "./nextjs": {
30
+ "types": "./dist/nextjs.d.ts",
31
+ "import": "./dist/nextjs.mjs",
32
+ "require": "./dist/nextjs.js"
33
+ }
34
+ },
35
+ "dependencies": {
36
+ "invariant": "2.2.4",
37
+ "path-to-regexp": "8.4.1",
38
+ "prop-types": "15.8.1",
39
+ "react-is": "^19.2.4"
40
+ },
41
+ "peerDependencies": {
42
+ "@emotion/cache": "^11.14.0",
43
+ "@emotion/react": "^11.14.0",
44
+ "@emotion/styled": "^11.14.1",
45
+ "@mui/icons-material": "^7.3.9",
46
+ "@mui/material": "^7.3.9",
47
+ "@mui/material-nextjs": "^7.3.9",
48
+ "@mui/utils": "^7.3.9",
49
+ "next": "^16.2.2",
50
+ "react": "^19.2.4",
51
+ "react-dom": "^19.2.4"
52
+ },
53
+ "peerDependenciesMeta": {
54
+ "next": {
55
+ "optional": true
56
+ },
57
+ "@mui/material-nextjs": {
58
+ "optional": true
59
+ }
60
+ },
61
+ "devDependencies": {
62
+ "@eslint/js": "^9.39.4",
63
+ "@types/invariant": "^2.2.37",
64
+ "@types/node": "^25.5.0",
65
+ "@types/prop-types": "^15.7.15",
66
+ "@types/react": "^19.2.14",
67
+ "@types/react-is": "^19.2.0",
68
+ "@types/react-dom": "^19.2.3",
69
+ "eslint": "^9.39.4",
70
+ "eslint-config-next": "^16.2.2",
71
+ "husky": "^9.1.7",
72
+ "lint-staged": "^16.4.0",
73
+ "prettier": "3.8.1",
74
+ "pretty-quick": "^4.2.2",
75
+ "tsup": "^8.5.0",
76
+ "typescript": "^6.0.2"
77
+ },
78
+ "publishConfig": {
79
+ "access": "public"
80
+ },
81
+ "keywords": [],
82
+ "author": "Peter Kudela",
83
+ "scripts": {
84
+ "build": "tsup src/index.ts src/core.ts src/utils.ts src/nextjs.ts --format esm,cjs --dts --clean --out-dir dist --tsconfig tsconfig.build.json",
85
+ "test": "echo \"No tests configured\""
86
+ }
87
+ }