schema-components 1.29.0 → 2.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.
Files changed (90) hide show
  1. package/README.md +38 -16
  2. package/dist/core/adapter.d.mts +213 -3
  3. package/dist/core/adapter.mjs +1 -1
  4. package/dist/core/constraintHint.d.mts +15 -0
  5. package/dist/core/constraintHint.mjs +24 -0
  6. package/dist/core/constraints.d.mts +2 -2
  7. package/dist/core/constraints.mjs +1 -1
  8. package/dist/core/diagnostics.d.mts +1 -1
  9. package/dist/core/errors.d.mts +1 -1
  10. package/dist/core/fieldOrder.d.mts +1 -1
  11. package/dist/core/formats.d.mts +1 -1
  12. package/dist/core/idPath.d.mts +35 -5
  13. package/dist/core/idPath.mjs +79 -7
  14. package/dist/core/inferValue.d.mts +2 -0
  15. package/dist/core/inferValue.mjs +1 -0
  16. package/dist/core/limits.d.mts +1 -1
  17. package/dist/core/limits.mjs +5 -0
  18. package/dist/core/merge.d.mts +12 -1
  19. package/dist/core/merge.mjs +66 -3
  20. package/dist/core/normalise.d.mts +1 -1
  21. package/dist/core/normalise.mjs +1 -1
  22. package/dist/core/openapi30.mjs +1 -1
  23. package/dist/core/ref.d.mts +1 -1
  24. package/dist/core/refChain.d.mts +3 -4
  25. package/dist/core/refChain.mjs +2 -3
  26. package/dist/core/renderer.d.mts +199 -2
  27. package/dist/core/swagger2.d.mts +1 -1
  28. package/dist/core/swagger2.mjs +1 -1
  29. package/dist/core/typeInference.d.mts +3 -3
  30. package/dist/core/types.d.mts +1 -1
  31. package/dist/core/unionMatch.d.mts +1 -1
  32. package/dist/core/uri.d.mts +12 -4
  33. package/dist/core/uri.mjs +30 -4
  34. package/dist/core/walkBuilders.d.mts +18 -6
  35. package/dist/core/walkBuilders.mjs +3 -1
  36. package/dist/core/walker.d.mts +1 -1
  37. package/dist/core/walker.mjs +5 -0
  38. package/dist/{diagnostics-ByEzkjrA.d.mts → diagnostics-BTrm3O6J.d.mts} +1 -1
  39. package/dist/{errors-D8JndRwI.d.mts → errors-Dki7tji4.d.mts} +1 -1
  40. package/dist/html/a11y.d.mts +3 -7
  41. package/dist/html/a11y.mjs +1 -16
  42. package/dist/html/renderToHtml.d.mts +22 -9
  43. package/dist/html/renderToHtml.mjs +2 -1
  44. package/dist/html/renderToHtmlStream.d.mts +24 -11
  45. package/dist/html/renderToHtmlStream.mjs +2 -1
  46. package/dist/html/renderers.d.mts +2 -33
  47. package/dist/html/renderers.mjs +39 -91
  48. package/dist/html/streamRenderers.d.mts +3 -3
  49. package/dist/html/streamRenderers.mjs +13 -8
  50. package/dist/inferValue-PPXWJpbN.d.mts +77 -0
  51. package/dist/{limits-DswmqWuy.d.mts → limits-x4OiyJxh.d.mts} +5 -0
  52. package/dist/{normalise-Db1xaxgx.mjs → normalise-DB-Xtjmn.mjs} +43 -2
  53. package/dist/openapi/ApiCallbacks.d.mts +1 -1
  54. package/dist/openapi/ApiLinks.d.mts +1 -1
  55. package/dist/openapi/ApiResponseHeaders.d.mts +1 -1
  56. package/dist/openapi/ApiSecurity.d.mts +1 -1
  57. package/dist/openapi/ApiSecurity.mjs +21 -8
  58. package/dist/openapi/bundle.d.mts +31 -0
  59. package/dist/openapi/components.d.mts +41 -10
  60. package/dist/openapi/components.mjs +19 -13
  61. package/dist/openapi/parser.d.mts +13 -13
  62. package/dist/openapi/parser.mjs +12 -12
  63. package/dist/openapi/resolve.d.mts +38 -49
  64. package/dist/openapi/resolve.mjs +62 -56
  65. package/dist/react/SchemaComponent.d.mts +19 -95
  66. package/dist/react/SchemaComponent.mjs +12 -1
  67. package/dist/react/SchemaView.d.mts +11 -7
  68. package/dist/react/SchemaView.mjs +3 -1
  69. package/dist/react/a11y.d.mts +74 -7
  70. package/dist/react/a11y.mjs +67 -6
  71. package/dist/react/fieldPath.d.mts +16 -1
  72. package/dist/react/fieldPath.mjs +25 -1
  73. package/dist/react/fieldShell.d.mts +49 -0
  74. package/dist/react/fieldShell.mjs +37 -0
  75. package/dist/react/headless.d.mts +1 -1
  76. package/dist/react/headlessRenderers.d.mts +2 -2
  77. package/dist/react/headlessRenderers.mjs +123 -54
  78. package/dist/{ref-CPh8rKQ3.d.mts → ref-DdsbekXX.d.mts} +33 -1
  79. package/dist/themes/mantine.d.mts +36 -20
  80. package/dist/themes/mantine.mjs +179 -150
  81. package/dist/themes/mui.d.mts +47 -21
  82. package/dist/themes/mui.mjs +259 -222
  83. package/dist/themes/radix.d.mts +38 -23
  84. package/dist/themes/radix.mjs +208 -180
  85. package/dist/themes/shadcn.d.mts +6 -3
  86. package/dist/themes/shadcn.mjs +93 -93
  87. package/dist/{types-C2Ay1FEh.d.mts → types-BrYbjC7_.d.mts} +7 -0
  88. package/package.json +4 -1
  89. package/dist/adapter-DcWi4XXn.d.mts +0 -223
  90. package/dist/renderer-OaOz-n6-.d.mts +0 -185
@@ -1,187 +1,216 @@
1
1
  import { isObject } from "../core/guards.mjs";
2
2
  import { sortFieldsByOrder } from "../core/fieldOrder.mjs";
3
3
  import { inputId, toReactNode } from "../react/headlessRenderers.mjs";
4
- import { headlessResolver } from "../react/headless.mjs";
4
+ import { FieldShell } from "../react/fieldShell.mjs";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  //#region src/themes/mantine.tsx
7
7
  function getLabel(props) {
8
8
  if (typeof props.meta.description === "string") return props.meta.description;
9
9
  }
10
- let MantineTextInput = (props) => /* @__PURE__ */ jsx("input", { ...props });
11
- let MantineNumberInput = (props) => /* @__PURE__ */ jsx("input", {
12
- type: "number",
13
- ...props
14
- });
15
- let MantineSwitch = (props) => /* @__PURE__ */ jsx("input", {
16
- type: "checkbox",
17
- ...props
18
- });
19
- let MantineSelect = (props) => /* @__PURE__ */ jsx("select", { ...props });
20
- let MantineFieldset = (props) => /* @__PURE__ */ jsx("fieldset", { ...props });
21
- let MantineText = (props) => /* @__PURE__ */ jsx("span", { ...props });
22
- /**
23
- * Inject real Mantine element types into the resolver. Call once at
24
- * application startup before rendering any schema-driven component so
25
- * that {@link mantineResolver}'s renderers delegate to the supplied
26
- * Mantine primitives.
27
- *
28
- * `Text` is required so read-only scalars render as a styled Mantine
29
- * `<Text>` element instead of a bare `<span>`, matching the visual
30
- * weight of the editable variants.
31
- *
32
- * @group Themes
33
- */
34
- function registerMantineComponents(components) {
35
- MantineTextInput = components.TextInput;
36
- MantineNumberInput = components.NumberInput;
37
- MantineSwitch = components.Switch;
38
- MantineSelect = components.Select;
39
- MantineFieldset = components.Fieldset;
40
- MantineText = components.Text;
41
- }
42
- function renderStringInput(props) {
43
- const strValue = typeof props.value === "string" ? props.value : "";
44
- const label = getLabel(props);
45
- const id = inputId(props.path);
46
- if (props.readOnly) return /* @__PURE__ */ jsx(MantineText, {
47
- id,
48
- children: strValue || "—"
49
- });
50
- return /* @__PURE__ */ jsx(MantineTextInput, {
51
- id,
52
- label,
53
- value: props.writeOnly ? "" : strValue,
54
- onChange: (e) => {
55
- props.onChange(e.target.value);
56
- }
57
- });
58
- }
59
- function renderNumberInput(props) {
60
- const label = getLabel(props);
61
- const id = inputId(props.path);
62
- if (props.readOnly) {
63
- if (typeof props.value !== "number") return /* @__PURE__ */ jsx(MantineText, {
10
+ function makeRenderStringInput(components) {
11
+ const { TextInput, Text } = components;
12
+ return function renderStringInput(props) {
13
+ const strValue = typeof props.value === "string" ? props.value : "";
14
+ const label = getLabel(props);
15
+ const id = inputId(props.path);
16
+ if (props.readOnly) return /* @__PURE__ */ jsx(Text, {
64
17
  id,
65
- children: "—"
18
+ children: strValue || "—"
66
19
  });
67
- return /* @__PURE__ */ jsx(MantineText, {
68
- id,
69
- children: props.value.toLocaleString()
20
+ return /* @__PURE__ */ jsx(FieldShell, {
21
+ props,
22
+ inputId: id,
23
+ hideLabel: true,
24
+ children: (aria) => /* @__PURE__ */ jsx(TextInput, {
25
+ id,
26
+ label,
27
+ value: props.writeOnly ? "" : strValue,
28
+ onChange: (e) => {
29
+ props.onChange(e.target.value);
30
+ },
31
+ ...aria
32
+ })
70
33
  });
71
- }
72
- return /* @__PURE__ */ jsx(MantineNumberInput, {
73
- id,
74
- label,
75
- value: props.writeOnly ? void 0 : typeof props.value === "number" ? props.value : void 0,
76
- onChange: (v) => {
77
- if (typeof v === "number") props.onChange(v);
34
+ };
35
+ }
36
+ function makeRenderNumberInput(components) {
37
+ const { NumberInput, Text } = components;
38
+ return function renderNumberInput(props) {
39
+ const label = getLabel(props);
40
+ const id = inputId(props.path);
41
+ if (props.readOnly) {
42
+ if (typeof props.value !== "number") return /* @__PURE__ */ jsx(Text, {
43
+ id,
44
+ children: "—"
45
+ });
46
+ return /* @__PURE__ */ jsx(Text, {
47
+ id,
48
+ children: props.value.toLocaleString()
49
+ });
78
50
  }
79
- });
51
+ return /* @__PURE__ */ jsx(FieldShell, {
52
+ props,
53
+ inputId: id,
54
+ hideLabel: true,
55
+ children: (aria) => /* @__PURE__ */ jsx(NumberInput, {
56
+ id,
57
+ label,
58
+ value: props.writeOnly ? void 0 : typeof props.value === "number" ? props.value : void 0,
59
+ onChange: (v) => {
60
+ if (typeof v === "number") props.onChange(v);
61
+ },
62
+ ...aria
63
+ })
64
+ });
65
+ };
80
66
  }
81
- function renderBooleanInput(props) {
82
- const label = getLabel(props);
83
- const id = inputId(props.path);
84
- if (props.readOnly) {
85
- if (typeof props.value !== "boolean") return /* @__PURE__ */ jsx(MantineText, {
86
- id,
87
- children: ""
67
+ function makeRenderBooleanInput(components) {
68
+ const { Switch, Text } = components;
69
+ return function renderBooleanInput(props) {
70
+ const label = getLabel(props);
71
+ const id = inputId(props.path);
72
+ if (props.readOnly) {
73
+ if (typeof props.value !== "boolean") return /* @__PURE__ */ jsx(Text, {
74
+ id,
75
+ children: "—"
76
+ });
77
+ return /* @__PURE__ */ jsx(Text, {
78
+ id,
79
+ children: props.value ? "Yes" : "No"
80
+ });
81
+ }
82
+ return /* @__PURE__ */ jsx(FieldShell, {
83
+ props,
84
+ inputId: id,
85
+ hideLabel: true,
86
+ children: (aria) => /* @__PURE__ */ jsx(Switch, {
87
+ id,
88
+ label,
89
+ checked: props.writeOnly ? false : props.value === true,
90
+ onChange: (e) => {
91
+ props.onChange(e.target.checked);
92
+ },
93
+ ...aria
94
+ })
88
95
  });
89
- return /* @__PURE__ */ jsx(MantineText, {
96
+ };
97
+ }
98
+ function makeRenderEnumInput(components) {
99
+ const { Select, Text } = components;
100
+ return function renderEnumInput(props) {
101
+ const enumValue = typeof props.value === "string" ? props.value : "";
102
+ const label = getLabel(props);
103
+ const id = inputId(props.path);
104
+ if (props.readOnly) return /* @__PURE__ */ jsx(Text, {
90
105
  id,
91
- children: props.value ? "Yes" : "No"
106
+ children: enumValue || ""
92
107
  });
93
- }
94
- return /* @__PURE__ */ jsx(MantineSwitch, {
95
- id,
96
- label,
97
- checked: props.writeOnly ? false : props.value === true,
98
- onChange: (e) => {
99
- props.onChange(e.target.checked);
100
- }
101
- });
102
- }
103
- function renderEnumInput(props) {
104
- const enumValue = typeof props.value === "string" ? props.value : "";
105
- const label = getLabel(props);
106
- const id = inputId(props.path);
107
- if (props.readOnly) return /* @__PURE__ */ jsx(MantineText, {
108
- id,
109
- children: enumValue || "—"
110
- });
111
- const enumValues = props.tree.type === "enum" ? props.tree.enumValues : [];
112
- return /* @__PURE__ */ jsx(MantineSelect, {
113
- id,
114
- label,
115
- value: props.writeOnly ? null : enumValue || null,
116
- onChange: (v) => {
117
- if (typeof v === "string") props.onChange(v);
118
- },
119
- data: enumValues.map((v) => ({
120
- value: v,
121
- label: v
122
- }))
123
- });
108
+ const enumValues = props.tree.type === "enum" ? props.tree.enumValues : [];
109
+ return /* @__PURE__ */ jsx(FieldShell, {
110
+ props,
111
+ inputId: id,
112
+ hideLabel: true,
113
+ children: (aria) => /* @__PURE__ */ jsx(Select, {
114
+ id,
115
+ label,
116
+ value: props.writeOnly ? null : enumValue || null,
117
+ onChange: (v) => {
118
+ if (typeof v === "string") props.onChange(v);
119
+ },
120
+ data: enumValues.map((v) => ({
121
+ value: v,
122
+ label: v
123
+ })),
124
+ ...aria
125
+ })
126
+ });
127
+ };
124
128
  }
125
- function renderObjectContainer(props) {
126
- if (props.tree.type !== "object") return null;
127
- const fields = props.tree.fields;
128
- const obj = isObject(props.value) ? props.value : {};
129
- return /* @__PURE__ */ jsx(MantineFieldset, {
130
- legend: getLabel(props),
131
- children: sortFieldsByOrder(fields).filter(([, field]) => field.meta.visible !== false).map(([key, field]) => {
132
- const childValue = obj[key];
133
- const childOnChange = (v) => {
134
- const updated = {};
135
- for (const [k, val] of Object.entries(obj)) updated[k] = val;
136
- updated[key] = v;
137
- props.onChange(updated);
138
- };
139
- return /* @__PURE__ */ jsx("div", {
140
- style: { marginBottom: "0.5rem" },
141
- children: toReactNode(props.renderChild(field, childValue, childOnChange, key))
142
- }, key);
143
- })
144
- });
129
+ function makeRenderObjectContainer(components) {
130
+ const { Fieldset } = components;
131
+ return function renderObjectContainer(props) {
132
+ if (props.tree.type !== "object") return null;
133
+ const fields = props.tree.fields;
134
+ const obj = isObject(props.value) ? props.value : {};
135
+ return /* @__PURE__ */ jsx(Fieldset, {
136
+ legend: getLabel(props),
137
+ children: sortFieldsByOrder(fields).filter(([, field]) => field.meta.visible !== false).map(([key, field]) => {
138
+ const childValue = obj[key];
139
+ const childOnChange = (v) => {
140
+ const updated = {};
141
+ for (const [k, val] of Object.entries(obj)) updated[k] = val;
142
+ updated[key] = v;
143
+ props.onChange(updated);
144
+ };
145
+ return /* @__PURE__ */ jsx("div", {
146
+ style: { marginBottom: "0.5rem" },
147
+ children: toReactNode(props.renderChild(field, childValue, childOnChange, key))
148
+ }, key);
149
+ })
150
+ });
151
+ };
145
152
  }
146
- function buildResolver() {
147
- const resolver = {
148
- string: renderStringInput,
149
- number: renderNumberInput,
150
- boolean: renderBooleanInput,
151
- enum: renderEnumInput,
152
- object: renderObjectContainer
153
+ const STUB_COMPONENTS = {
154
+ TextInput: (props) => /* @__PURE__ */ jsx("input", { ...props }),
155
+ NumberInput: (props) => /* @__PURE__ */ jsx("input", {
156
+ type: "number",
157
+ ...props
158
+ }),
159
+ Switch: (props) => /* @__PURE__ */ jsx("input", {
160
+ type: "checkbox",
161
+ ...props
162
+ }),
163
+ Select: (props) => /* @__PURE__ */ jsx("select", { ...props }),
164
+ Fieldset: (props) => /* @__PURE__ */ jsx("fieldset", { ...props }),
165
+ Text: (props) => /* @__PURE__ */ jsx("span", { ...props })
166
+ };
167
+ /**
168
+ * Build a Mantine-flavoured {@link ComponentResolver} bound to the
169
+ * supplied element types. Each render function captures the supplied
170
+ * components in a closure so two consumers can build different
171
+ * resolvers from the same package without leaking element types
172
+ * through module-level mutable state.
173
+ *
174
+ * Returns only the keys this theme actually overrides. The runtime
175
+ * `mergeResolvers` call inside `<SchemaComponent>` / `<SchemaView>`
176
+ * fills unset keys from `headlessResolver`, so variants this adapter
177
+ * leaves unset (literal, union, discriminatedUnion, array, record,
178
+ * file, unknown, …) still render via the headless fallback.
179
+ *
180
+ * @group Themes
181
+ */
182
+ function createMantineResolver(components) {
183
+ return {
184
+ string: makeRenderStringInput(components),
185
+ number: makeRenderNumberInput(components),
186
+ boolean: makeRenderBooleanInput(components),
187
+ enum: makeRenderEnumInput(components),
188
+ object: makeRenderObjectContainer(components)
153
189
  };
154
- if (headlessResolver.literal !== void 0) resolver.literal = headlessResolver.literal;
155
- if (headlessResolver.union !== void 0) resolver.union = headlessResolver.union;
156
- if (headlessResolver.discriminatedUnion !== void 0) resolver.discriminatedUnion = headlessResolver.discriminatedUnion;
157
- if (headlessResolver.array !== void 0) resolver.array = headlessResolver.array;
158
- if (headlessResolver.record !== void 0) resolver.record = headlessResolver.record;
159
- if (headlessResolver.file !== void 0) resolver.file = headlessResolver.file;
160
- if (headlessResolver.unknown !== void 0) resolver.unknown = headlessResolver.unknown;
161
- return resolver;
162
190
  }
163
191
  /**
164
192
  * Component resolver mapping schema field types to Mantine primitives —
165
193
  * `TextInput`, `NumberInput`, `Switch`, `Select`, `Fieldset`, `Text`.
166
194
  *
167
- * Pass to `SchemaProvider` to render schema-driven UI through Mantine.
168
- * Requires `@mantine/core` installed in the consuming project and a
169
- * one-time call to {@link registerMantineComponents} to inject the
170
- * actual Mantine element types.
195
+ * Built against minimal HTML stubs so the resolver is usable without
196
+ * wiring up `@mantine/core` first production usage should call
197
+ * {@link createMantineResolver} with real Mantine element types.
171
198
  *
172
199
  * @group Themes
173
200
  * @example
174
201
  * ```tsx
175
202
  * import { TextInput, NumberInput, Switch, Select, Fieldset, Text } from "@mantine/core";
176
- * import { mantineResolver, registerMantineComponents } from "schema-components/themes/mantine";
203
+ * import { createMantineResolver } from "schema-components/themes/mantine";
177
204
  *
178
- * registerMantineComponents({ TextInput, NumberInput, Switch, Select, Fieldset, Text });
205
+ * const mantineResolver = createMantineResolver({
206
+ * TextInput, NumberInput, Switch, Select, Fieldset, Text,
207
+ * });
179
208
  *
180
209
  * <SchemaProvider resolver={mantineResolver}>
181
210
  * <SchemaComponent schema={userSchema} value={user} onChange={setUser} />
182
211
  * </SchemaProvider>
183
212
  * ```
184
213
  */
185
- const mantineResolver = buildResolver();
214
+ const mantineResolver = createMantineResolver(STUB_COMPONENTS);
186
215
  //#endregion
187
- export { mantineResolver, registerMantineComponents };
216
+ export { createMantineResolver, mantineResolver };
@@ -1,38 +1,64 @@
1
- import { r as ComponentResolver } from "../renderer-OaOz-n6-.mjs";
1
+ import { ComponentResolver } from "../core/renderer.mjs";
2
+ import { ElementType } from "react";
2
3
 
3
4
  //#region src/themes/mui.d.ts
4
5
  /**
5
- * Inject real MUI element types into the resolver. Call once at
6
- * application startup before rendering any schema-driven component so
7
- * that {@link muiResolver}'s renderers delegate to the supplied MUI
8
- * primitives.
6
+ * Element types the MUI resolver renders into. Every slot is the MUI
7
+ * component the corresponding render function expects to find at the
8
+ * call site; consumers wire these in once via `createMuiResolver` so
9
+ * the resolver can be used in SSR and multi-tenant contexts where two
10
+ * callers might inject different element types.
11
+ */
12
+ interface MuiComponents {
13
+ TextField: ElementType;
14
+ Checkbox: ElementType;
15
+ Typography: ElementType;
16
+ Box: ElementType;
17
+ MenuItem: ElementType;
18
+ FormControlLabel: ElementType;
19
+ }
20
+ /**
21
+ * Build a MUI-flavoured {@link ComponentResolver} bound to the supplied
22
+ * element types. Each render function captures the supplied components
23
+ * in a closure so two consumers can build different resolvers from the
24
+ * same package without leaking element types through module-level
25
+ * mutable state — making the adapter safe to use in SSR and multi-tenant
26
+ * environments.
27
+ *
28
+ * Returns only the keys this theme actually overrides. The runtime
29
+ * `mergeResolvers` call inside `<SchemaComponent>` / `<SchemaView>`
30
+ * fills any unset keys from `headlessResolver`, so consumers never see
31
+ * an unhandled field type even though this resolver leaves variants
32
+ * like `union`, `discriminatedUnion`, `record`, `file`, and `unknown`
33
+ * unset on purpose.
9
34
  *
10
35
  * @group Themes
11
36
  */
12
- declare function registerMuiComponents(components: {
13
- TextField: React.ElementType;
14
- Checkbox: React.ElementType;
15
- Typography: React.ElementType;
16
- Box: React.ElementType;
17
- MenuItem: React.ElementType;
18
- FormControlLabel: React.ElementType;
19
- }): void;
37
+ declare function createMuiResolver(components: MuiComponents): ComponentResolver;
20
38
  /**
21
39
  * Component resolver mapping schema field types to MUI (Material UI)
22
40
  * primitives — `TextField`, `Checkbox`, `Typography`, etc.
23
41
  *
24
- * Pass to `SchemaProvider` to render schema-driven UI through MUI.
25
- * Requires `@mui/material` installed in the consuming project and a
26
- * one-time call to {@link registerMuiComponents} to inject the actual
27
- * MUI element types.
42
+ * This default export is built against minimal HTML stubs so it is
43
+ * usable without wiring up `@mui/material` first handy for tests,
44
+ * stories, and tree-shaken bundles that want the resolver shape
45
+ * without the runtime dependency. For production usage call
46
+ * {@link createMuiResolver} with the real MUI element types.
28
47
  *
29
48
  * @group Themes
30
49
  * @example
31
50
  * ```tsx
32
- * import { TextField, Checkbox, Typography, Box, MenuItem, FormControlLabel } from "@mui/material";
33
- * import { muiResolver, registerMuiComponents } from "schema-components/themes/mui";
51
+ * import TextField from "@mui/material/TextField";
52
+ * import Checkbox from "@mui/material/Checkbox";
53
+ * import Typography from "@mui/material/Typography";
54
+ * import Box from "@mui/material/Box";
55
+ * import MenuItem from "@mui/material/MenuItem";
56
+ * import FormControlLabel from "@mui/material/FormControlLabel";
57
+ * import { createMuiResolver } from "schema-components/themes/mui";
34
58
  *
35
- * registerMuiComponents({ TextField, Checkbox, Typography, Box, MenuItem, FormControlLabel });
59
+ * const muiResolver = createMuiResolver({
60
+ * TextField, Checkbox, Typography, Box, MenuItem, FormControlLabel,
61
+ * });
36
62
  *
37
63
  * <SchemaProvider resolver={muiResolver}>
38
64
  * <SchemaComponent schema={userSchema} value={user} onChange={setUser} />
@@ -41,4 +67,4 @@ declare function registerMuiComponents(components: {
41
67
  */
42
68
  declare const muiResolver: ComponentResolver;
43
69
  //#endregion
44
- export { muiResolver, registerMuiComponents };
70
+ export { MuiComponents, createMuiResolver, muiResolver };