@aglyn/shared-ui-jsx-forms 1.0.0-beta.143

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 (150) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +7 -0
  3. package/package.json +52 -0
  4. package/src/index.d.ts +17 -0
  5. package/src/index.js +18 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/components/color-picker-tokens.d.ts +135 -0
  8. package/src/lib/components/color-picker-tokens.js +431 -0
  9. package/src/lib/components/color-picker-tokens.js.map +1 -0
  10. package/src/lib/components/color-picker.component.d.ts +64 -0
  11. package/src/lib/components/color-picker.component.js +322 -0
  12. package/src/lib/components/color-picker.component.js.map +1 -0
  13. package/src/lib/components/create-artifact-drawer.component.d.ts +100 -0
  14. package/src/lib/components/create-artifact-drawer.component.js +184 -0
  15. package/src/lib/components/create-artifact-drawer.component.js.map +1 -0
  16. package/src/lib/components/grid-form-template.component.d.ts +21 -0
  17. package/src/lib/components/grid-form-template.component.js +81 -0
  18. package/src/lib/components/grid-form-template.component.js.map +1 -0
  19. package/src/lib/components/icon-select.component.d.ts +52 -0
  20. package/src/lib/components/icon-select.component.js +453 -0
  21. package/src/lib/components/icon-select.component.js.map +1 -0
  22. package/src/lib/components/select.component.d.ts +58 -0
  23. package/src/lib/components/select.component.js +107 -0
  24. package/src/lib/components/select.component.js.map +1 -0
  25. package/src/lib/components/switch.component.d.ts +38 -0
  26. package/src/lib/components/switch.component.js +76 -0
  27. package/src/lib/components/switch.component.js.map +1 -0
  28. package/src/lib/components/text-field.component.d.ts +45 -0
  29. package/src/lib/components/text-field.component.js +77 -0
  30. package/src/lib/components/text-field.component.js.map +1 -0
  31. package/src/lib/components/textarea.component.d.ts +45 -0
  32. package/src/lib/components/textarea.component.js +61 -0
  33. package/src/lib/components/textarea.component.js.map +1 -0
  34. package/src/lib/components/toggle-button.component.d.ts +27 -0
  35. package/src/lib/components/toggle-button.component.js +116 -0
  36. package/src/lib/components/toggle-button.component.js.map +1 -0
  37. package/src/lib/constants/component-mappers.d.ts +42 -0
  38. package/src/lib/constants/component-mappers.js +70 -0
  39. package/src/lib/constants/component-mappers.js.map +1 -0
  40. package/src/lib/constants/dynamic-fields.d.ts +45 -0
  41. package/src/lib/constants/dynamic-fields.js +65 -0
  42. package/src/lib/constants/dynamic-fields.js.map +1 -0
  43. package/src/lib/constants/field-configurations.d.ts +53 -0
  44. package/src/lib/constants/field-configurations.js +121 -0
  45. package/src/lib/constants/field-configurations.js.map +1 -0
  46. package/src/lib/constants/flags.d.ts +72 -0
  47. package/src/lib/constants/flags.js +69 -0
  48. package/src/lib/constants/flags.js.map +1 -0
  49. package/src/lib/hocs/with-grid-item.d.ts +25 -0
  50. package/src/lib/hocs/with-grid-item.js +48 -0
  51. package/src/lib/hocs/with-grid-item.js.map +1 -0
  52. package/src/lib/jsx-forms.d.ts +41 -0
  53. package/src/lib/jsx-forms.js +42 -0
  54. package/src/lib/jsx-forms.js.map +1 -0
  55. package/src/lib/mapper/breakpoint-span.d.ts +73 -0
  56. package/src/lib/mapper/breakpoint-span.js +346 -0
  57. package/src/lib/mapper/breakpoint-span.js.map +1 -0
  58. package/src/lib/mapper/checkbox.d.ts +43 -0
  59. package/src/lib/mapper/checkbox.js +111 -0
  60. package/src/lib/mapper/checkbox.js.map +1 -0
  61. package/src/lib/mapper/css-border.d.ts +113 -0
  62. package/src/lib/mapper/css-border.js +410 -0
  63. package/src/lib/mapper/css-border.js.map +1 -0
  64. package/src/lib/mapper/css-dimension.d.ts +89 -0
  65. package/src/lib/mapper/css-dimension.js +327 -0
  66. package/src/lib/mapper/css-dimension.js.map +1 -0
  67. package/src/lib/mapper/css-gradient.d.ts +110 -0
  68. package/src/lib/mapper/css-gradient.js +720 -0
  69. package/src/lib/mapper/css-gradient.js.map +1 -0
  70. package/src/lib/mapper/data-table.d.ts +23 -0
  71. package/src/lib/mapper/data-table.js +296 -0
  72. package/src/lib/mapper/data-table.js.map +1 -0
  73. package/src/lib/mapper/date-picker.d.ts +26 -0
  74. package/src/lib/mapper/date-picker.js +69 -0
  75. package/src/lib/mapper/date-picker.js.map +1 -0
  76. package/src/lib/mapper/dual-list-select.d.ts +115 -0
  77. package/src/lib/mapper/dual-list-select.js +353 -0
  78. package/src/lib/mapper/dual-list-select.js.map +1 -0
  79. package/src/lib/mapper/field-array.d.ts +71 -0
  80. package/src/lib/mapper/field-array.js +326 -0
  81. package/src/lib/mapper/field-array.js.map +1 -0
  82. package/src/lib/mapper/form-field-grid.d.ts +155 -0
  83. package/src/lib/mapper/form-field-grid.js +194 -0
  84. package/src/lib/mapper/form-field-grid.js.map +1 -0
  85. package/src/lib/mapper/index.d.ts +50 -0
  86. package/src/lib/mapper/index.js +49 -0
  87. package/src/lib/mapper/index.js.map +1 -0
  88. package/src/lib/mapper/multiple-choice-list.d.ts +32 -0
  89. package/src/lib/mapper/multiple-choice-list.js +105 -0
  90. package/src/lib/mapper/multiple-choice-list.js.map +1 -0
  91. package/src/lib/mapper/plain-text.d.ts +31 -0
  92. package/src/lib/mapper/plain-text.js +48 -0
  93. package/src/lib/mapper/plain-text.js.map +1 -0
  94. package/src/lib/mapper/preset-choice.d.ts +106 -0
  95. package/src/lib/mapper/preset-choice.js +267 -0
  96. package/src/lib/mapper/preset-choice.js.map +1 -0
  97. package/src/lib/mapper/radio.d.ts +40 -0
  98. package/src/lib/mapper/radio.js +122 -0
  99. package/src/lib/mapper/radio.js.map +1 -0
  100. package/src/lib/mapper/select.d.ts +60 -0
  101. package/src/lib/mapper/select.js +203 -0
  102. package/src/lib/mapper/select.js.map +1 -0
  103. package/src/lib/mapper/slider.d.ts +45 -0
  104. package/src/lib/mapper/slider.js +119 -0
  105. package/src/lib/mapper/slider.js.map +1 -0
  106. package/src/lib/mapper/stored-field-value.d.ts +23 -0
  107. package/src/lib/mapper/stored-field-value.js +29 -0
  108. package/src/lib/mapper/stored-field-value.js.map +1 -0
  109. package/src/lib/mapper/sub-form.d.ts +39 -0
  110. package/src/lib/mapper/sub-form.js +108 -0
  111. package/src/lib/mapper/sub-form.js.map +1 -0
  112. package/src/lib/mapper/switch.d.ts +47 -0
  113. package/src/lib/mapper/switch.js +93 -0
  114. package/src/lib/mapper/switch.js.map +1 -0
  115. package/src/lib/mapper/tabs.d.ts +34 -0
  116. package/src/lib/mapper/tabs.js +64 -0
  117. package/src/lib/mapper/tabs.js.map +1 -0
  118. package/src/lib/mapper/text-field.d.ts +33 -0
  119. package/src/lib/mapper/text-field.js +88 -0
  120. package/src/lib/mapper/text-field.js.map +1 -0
  121. package/src/lib/mapper/textarea.d.ts +31 -0
  122. package/src/lib/mapper/textarea.js +68 -0
  123. package/src/lib/mapper/textarea.js.map +1 -0
  124. package/src/lib/mapper/theme-scale.d.ts +79 -0
  125. package/src/lib/mapper/theme-scale.js +162 -0
  126. package/src/lib/mapper/theme-scale.js.map +1 -0
  127. package/src/lib/mapper/time-picker.d.ts +26 -0
  128. package/src/lib/mapper/time-picker.js +69 -0
  129. package/src/lib/mapper/time-picker.js.map +1 -0
  130. package/src/lib/mapper/types.d.ts +43 -0
  131. package/src/lib/mapper/types.js +22 -0
  132. package/src/lib/mapper/types.js.map +1 -0
  133. package/src/lib/mapper/validation-error.d.ts +24 -0
  134. package/src/lib/mapper/validation-error.js +24 -0
  135. package/src/lib/mapper/validation-error.js.map +1 -0
  136. package/src/lib/mapper/wizard.d.ts +21 -0
  137. package/src/lib/mapper/wizard.js +203 -0
  138. package/src/lib/mapper/wizard.js.map +1 -0
  139. package/src/lib/types.d.ts +19 -0
  140. package/src/lib/types.js +18 -0
  141. package/src/lib/types.js.map +1 -0
  142. package/src/lib/utils/option-is-equal-to-value.d.ts +20 -0
  143. package/src/lib/utils/option-is-equal-to-value.js +21 -0
  144. package/src/lib/utils/option-is-equal-to-value.js.map +1 -0
  145. package/src/lib/utils/validation-message.d.ts +22 -0
  146. package/src/lib/utils/validation-message.js +24 -0
  147. package/src/lib/utils/validation-message.js.map +1 -0
  148. package/src/lib/vendor/data-driven-forms.d.ts +33 -0
  149. package/src/lib/vendor/data-driven-forms.js +29 -0
  150. package/src/lib/vendor/data-driven-forms.js.map +1 -0
@@ -0,0 +1,79 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { type FormFieldGridProps } from './form-field-grid';
18
+ import type { BaseFieldProps } from './types';
19
+ /**
20
+ * ThemeScale (AGL-2486): a field that offers the THEME's own scale for a
21
+ * property while still accepting any raw CSS value.
22
+ *
23
+ * Font Size, Font Weight and Z-Index shipped as free text and a bare select
24
+ * of magic numbers, with no connection to the theme at all — so a heading
25
+ * styled here was pinned to `32px` while every heading the theme renders
26
+ * moved with `typography.h4`, and a sticky bar was given `1300` next to a
27
+ * modal the theme puts at exactly 1300. Colour has had theme references
28
+ * since AGL-588; these three had none.
29
+ *
30
+ * **The stored value is a theme token PATH, not a resolved number.** MUI's
31
+ * sx system declares `fontSize` and `fontWeight` with `themeKey:
32
+ * 'typography'` and `zIndex` with `themeKey: 'zIndex'`, so `h4.fontSize`,
33
+ * `fontWeightBold` and `appBar` are resolved against the ACTIVE theme at
34
+ * render — exactly the way `color: 'primary.main'` already is. Storing the
35
+ * resolved `2.125rem` instead would have been simpler and wrong for the same
36
+ * reason a flattened colour is wrong: it stops following the theme, so a
37
+ * type-scale change silently leaves this element behind.
38
+ *
39
+ * Free text is a first-class answer, not a fallback: `18px`, `1.25rem`,
40
+ * `700` and `1400` are all legitimate, and an author who wants an exact
41
+ * value must not have to fight a select to get one. Hence a `freeSolo`
42
+ * combo box rather than two controls — one box that suggests the scale and
43
+ * accepts anything.
44
+ */
45
+ /** One entry of a theme scale the field offers. */
46
+ export interface ThemeScaleOption {
47
+ /** The value STORED — a theme token path (`h4.fontSize`, `appBar`). */
48
+ value: string;
49
+ /** The author's name for it (`Heading 4`, `App bar`). */
50
+ label: string;
51
+ /** What it resolves to in this theme today (`2.125rem`, `1100`). */
52
+ hint?: string;
53
+ }
54
+ export interface ThemeScaleProps extends BaseFieldProps {
55
+ /** The theme scale offered; an empty list leaves a plain text box. */
56
+ scaleOptions?: ThemeScaleOption[];
57
+ placeholder?: string;
58
+ /** Offer the reset-to-unset affordance (AGL-2486). */
59
+ clearable?: boolean;
60
+ FormFieldGridProps?: FormFieldGridProps;
61
+ }
62
+ /** The text a stored value shows. Numbers are values too (`zIndex: 1400`). */
63
+ export declare const themeScaleValueToText: (value: unknown) => string;
64
+ /**
65
+ * Whether an option should be offered for what the author has typed.
66
+ *
67
+ * Matches the token path, the friendly label AND the resolved hint, so
68
+ * `bold` finds `fontWeightBold`, `700` finds it too (that is what it
69
+ * resolves to), and `modal` finds the z-index layer. A text that already IS
70
+ * an option's value shows the WHOLE scale rather than the one entry it
71
+ * matches — otherwise picking a token would leave the author unable to see
72
+ * the neighbours to switch to.
73
+ */
74
+ export declare const filterThemeScaleOptions: (options: ThemeScaleOption[], text: string) => ThemeScaleOption[];
75
+ export declare const ThemeScaleField: {
76
+ (props: ThemeScaleProps): import("react").JSX.Element;
77
+ displayName: string;
78
+ };
79
+ export default ThemeScaleField;
@@ -0,0 +1,162 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ /**
5
+ * @license
6
+ * Copyright 2026 Aglyn LLC
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */ import { Autocomplete, Box, TextField as MuiTextField, Typography } from "@mui/material";
20
+ import { useCallback, useMemo } from "react";
21
+ import { useFieldApi } from "../vendor/data-driven-forms.js";
22
+ import FormFieldGrid, { buildFieldClear } from "./form-field-grid.js";
23
+ import { validationError } from "./validation-error.js";
24
+ /** The text a stored value shows. Numbers are values too (`zIndex: 1400`). */ export const themeScaleValueToText = (value)=>{
25
+ if (value === undefined || value === null) return '';
26
+ if (typeof value === 'number') return Number.isFinite(value) ? `${value}` : '';
27
+ return `${value}`;
28
+ };
29
+ /**
30
+ * Whether an option should be offered for what the author has typed.
31
+ *
32
+ * Matches the token path, the friendly label AND the resolved hint, so
33
+ * `bold` finds `fontWeightBold`, `700` finds it too (that is what it
34
+ * resolves to), and `modal` finds the z-index layer. A text that already IS
35
+ * an option's value shows the WHOLE scale rather than the one entry it
36
+ * matches — otherwise picking a token would leave the author unable to see
37
+ * the neighbours to switch to.
38
+ */ export const filterThemeScaleOptions = (options, text)=>{
39
+ const query = `${text != null ? text : ''}`.trim().toLowerCase();
40
+ if (!query) return options;
41
+ if (options.some((option)=>option.value.toLowerCase() === query)) {
42
+ return options;
43
+ }
44
+ return options.filter((option)=>[
45
+ option.value,
46
+ option.label,
47
+ option.hint
48
+ ].filter((part)=>typeof part === 'string' && part !== '').some((part)=>`${part}`.toLowerCase().includes(query)));
49
+ };
50
+ export const ThemeScaleField = (props)=>{
51
+ const _useFieldApi = useFieldApi(props), { input, isReadOnly, isDisabled, isRequired, label, placeholder, helperText, description, validateOnMount, meta, help, scaleOptions = [], clearable, FormFieldGridProps = {}, // Leftovers from a schema that used to declare these as TEXT_FIELDs;
52
+ // they must never reach the DOM.
53
+ inputProps: _inputProps, InputProps: _InputProps, multiline: _multiline, type: _type, options: _options } = _useFieldApi, rest = _object_without_properties_loose(_useFieldApi, [
54
+ "input",
55
+ "isReadOnly",
56
+ "isDisabled",
57
+ "isRequired",
58
+ "label",
59
+ "placeholder",
60
+ "helperText",
61
+ "description",
62
+ "validateOnMount",
63
+ "meta",
64
+ "help",
65
+ "scaleOptions",
66
+ "clearable",
67
+ "FormFieldGridProps",
68
+ "inputProps",
69
+ "InputProps",
70
+ "multiline",
71
+ "type",
72
+ "options"
73
+ ]);
74
+ const invalid = validationError(meta, validateOnMount);
75
+ const text = themeScaleValueToText(input.value);
76
+ const commit = useCallback((next)=>{
77
+ input.onChange(next);
78
+ }, [
79
+ input
80
+ ]);
81
+ const clear = buildFieldClear({
82
+ clearable,
83
+ label,
84
+ hasValue: text !== '',
85
+ locked: Boolean(isDisabled || isReadOnly),
86
+ onClear: ()=>commit('')
87
+ });
88
+ const filterOptions = useCallback((options, state)=>filterThemeScaleOptions(options, state.inputValue), []);
89
+ // The token the current value names, so the helper text can say what it
90
+ // resolves to — the one thing a token path cannot say for itself.
91
+ const activeOption = useMemo(()=>scaleOptions.find((option)=>option.value === text), [
92
+ scaleOptions,
93
+ text
94
+ ]);
95
+ return /*#__PURE__*/ _jsx(FormFieldGrid, _extends({
96
+ help: help,
97
+ clear: clear
98
+ }, FormFieldGridProps, {
99
+ children: /*#__PURE__*/ _jsx(Autocomplete, _extends({
100
+ freeSolo: true,
101
+ disableClearable: true,
102
+ fullWidth: true,
103
+ size: "small",
104
+ disabled: Boolean(isDisabled),
105
+ readOnly: Boolean(isReadOnly),
106
+ options: scaleOptions,
107
+ filterOptions: filterOptions,
108
+ inputValue: text,
109
+ // `onInputChange` rather than `onChange`: it fires for BOTH a typed
110
+ // value and a picked option, so a raw `18px` and a `h4.fontSize`
111
+ // travel the same path and cannot commit differently.
112
+ onInputChange: (_event, next)=>commit(next != null ? next : ''),
113
+ getOptionLabel: (option)=>typeof option === 'string' ? option : option.value,
114
+ renderOption: (optionProps, option)=>{
115
+ const { key } = optionProps, liProps = _object_without_properties_loose(optionProps, [
116
+ "key"
117
+ ]);
118
+ return /*#__PURE__*/ _jsx(Box, _extends({
119
+ component: "li"
120
+ }, liProps, {
121
+ children: /*#__PURE__*/ _jsxs(Box, {
122
+ sx: {
123
+ display: 'flex',
124
+ width: '100%',
125
+ gap: 1
126
+ },
127
+ children: [
128
+ /*#__PURE__*/ _jsx(Typography, {
129
+ variant: "body2",
130
+ noWrap: true,
131
+ sx: {
132
+ flexGrow: 1
133
+ },
134
+ children: option.label
135
+ }),
136
+ option.hint ? /*#__PURE__*/ _jsx(Typography, {
137
+ variant: "caption",
138
+ color: "text.secondary",
139
+ noWrap: true,
140
+ children: option.hint
141
+ }) : null
142
+ ]
143
+ })
144
+ }), option.value);
145
+ },
146
+ renderInput: (params)=>/*#__PURE__*/ _jsx(MuiTextField, _extends({}, params, {
147
+ label: label,
148
+ margin: "dense",
149
+ required: Boolean(isRequired),
150
+ error: Boolean(invalid),
151
+ placeholder: placeholder,
152
+ helperText: invalid || (meta.touched || validateOnMount) && meta.warning || // Naming the resolved value is what makes the token readable:
153
+ // `h4.fontSize` means nothing until it says `2.125rem`.
154
+ ((activeOption == null ? void 0 : activeOption.hint) ? `${activeOption.label} — ${activeOption.hint}` : undefined) || helperText || description
155
+ }))
156
+ }, rest))
157
+ }));
158
+ };
159
+ ThemeScaleField.displayName = 'AglynThemeScaleField';
160
+ export default ThemeScaleField;
161
+
162
+ //# sourceMappingURL=theme-scale.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/ui/jsx-forms/src/lib/mapper/theme-scale.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Autocomplete,\n Box,\n TextField as MuiTextField,\n Typography,\n} from '@mui/material'\nimport { useCallback, useMemo } from 'react'\n\nimport { useFieldApi } from '../vendor/data-driven-forms'\nimport FormFieldGrid, {\n buildFieldClear,\n type FormFieldGridProps,\n} from './form-field-grid'\nimport type { BaseFieldProps } from './types'\nimport { type ExtendedFieldMeta, validationError } from './validation-error'\n\n/**\n * ThemeScale (AGL-2486): a field that offers the THEME's own scale for a\n * property while still accepting any raw CSS value.\n *\n * Font Size, Font Weight and Z-Index shipped as free text and a bare select\n * of magic numbers, with no connection to the theme at all — so a heading\n * styled here was pinned to `32px` while every heading the theme renders\n * moved with `typography.h4`, and a sticky bar was given `1300` next to a\n * modal the theme puts at exactly 1300. Colour has had theme references\n * since AGL-588; these three had none.\n *\n * **The stored value is a theme token PATH, not a resolved number.** MUI's\n * sx system declares `fontSize` and `fontWeight` with `themeKey:\n * 'typography'` and `zIndex` with `themeKey: 'zIndex'`, so `h4.fontSize`,\n * `fontWeightBold` and `appBar` are resolved against the ACTIVE theme at\n * render — exactly the way `color: 'primary.main'` already is. Storing the\n * resolved `2.125rem` instead would have been simpler and wrong for the same\n * reason a flattened colour is wrong: it stops following the theme, so a\n * type-scale change silently leaves this element behind.\n *\n * Free text is a first-class answer, not a fallback: `18px`, `1.25rem`,\n * `700` and `1400` are all legitimate, and an author who wants an exact\n * value must not have to fight a select to get one. Hence a `freeSolo`\n * combo box rather than two controls — one box that suggests the scale and\n * accepts anything.\n */\n\n/** One entry of a theme scale the field offers. */\nexport interface ThemeScaleOption {\n /** The value STORED — a theme token path (`h4.fontSize`, `appBar`). */\n value: string\n /** The author's name for it (`Heading 4`, `App bar`). */\n label: string\n /** What it resolves to in this theme today (`2.125rem`, `1100`). */\n hint?: string\n}\n\nexport interface ThemeScaleProps extends BaseFieldProps {\n /** The theme scale offered; an empty list leaves a plain text box. */\n scaleOptions?: ThemeScaleOption[]\n placeholder?: string\n /** Offer the reset-to-unset affordance (AGL-2486). */\n clearable?: boolean\n FormFieldGridProps?: FormFieldGridProps\n}\n\n/** The text a stored value shows. Numbers are values too (`zIndex: 1400`). */\nexport const themeScaleValueToText = (value: unknown): string => {\n if (value === undefined || value === null) return ''\n if (typeof value === 'number') return Number.isFinite(value) ? `${value}` : ''\n return `${value}`\n}\n\n/**\n * Whether an option should be offered for what the author has typed.\n *\n * Matches the token path, the friendly label AND the resolved hint, so\n * `bold` finds `fontWeightBold`, `700` finds it too (that is what it\n * resolves to), and `modal` finds the z-index layer. A text that already IS\n * an option's value shows the WHOLE scale rather than the one entry it\n * matches — otherwise picking a token would leave the author unable to see\n * the neighbours to switch to.\n */\nexport const filterThemeScaleOptions = (\n options: ThemeScaleOption[],\n text: string,\n): ThemeScaleOption[] => {\n const query = `${text ?? ''}`.trim().toLowerCase()\n if (!query) return options\n if (options.some((option) => option.value.toLowerCase() === query)) {\n return options\n }\n return options.filter((option) =>\n [option.value, option.label, option.hint]\n .filter((part) => typeof part === 'string' && part !== '')\n .some((part) => `${part}`.toLowerCase().includes(query)),\n )\n}\n\nexport const ThemeScaleField = (props: ThemeScaleProps) => {\n const {\n input,\n isReadOnly,\n isDisabled,\n isRequired,\n label,\n placeholder,\n helperText,\n description,\n validateOnMount,\n meta,\n help,\n scaleOptions = [],\n clearable,\n FormFieldGridProps = {},\n // Leftovers from a schema that used to declare these as TEXT_FIELDs;\n // they must never reach the DOM.\n inputProps: _inputProps,\n InputProps: _InputProps,\n multiline: _multiline,\n type: _type,\n options: _options,\n ...rest\n } = useFieldApi(props)\n\n const invalid = validationError(meta as ExtendedFieldMeta, validateOnMount)\n const text = themeScaleValueToText(input.value)\n\n const commit = useCallback(\n (next: string) => {\n input.onChange(next)\n },\n [input],\n )\n\n const clear = buildFieldClear({\n clearable,\n label,\n hasValue: text !== '',\n locked: Boolean(isDisabled || isReadOnly),\n onClear: () => commit(''),\n })\n\n const filterOptions = useCallback(\n (options: ThemeScaleOption[], state: { inputValue: string }) =>\n filterThemeScaleOptions(options, state.inputValue),\n [],\n )\n\n // The token the current value names, so the helper text can say what it\n // resolves to — the one thing a token path cannot say for itself.\n const activeOption = useMemo(\n () => scaleOptions.find((option) => option.value === text),\n [scaleOptions, text],\n )\n\n return (\n <FormFieldGrid help={help} clear={clear} {...FormFieldGridProps}>\n <Autocomplete<ThemeScaleOption, false, true, true>\n freeSolo\n disableClearable\n fullWidth\n size=\"small\"\n disabled={Boolean(isDisabled)}\n readOnly={Boolean(isReadOnly)}\n options={scaleOptions}\n filterOptions={filterOptions}\n inputValue={text}\n // `onInputChange` rather than `onChange`: it fires for BOTH a typed\n // value and a picked option, so a raw `18px` and a `h4.fontSize`\n // travel the same path and cannot commit differently.\n onInputChange={(_event, next) => commit(next ?? '')}\n getOptionLabel={(option) =>\n typeof option === 'string' ? option : option.value\n }\n renderOption={(optionProps, option) => {\n const { key, ...liProps } = optionProps as typeof optionProps & {\n key?: string\n }\n return (\n <Box component=\"li\" key={option.value} {...liProps}>\n <Box sx={{ display: 'flex', width: '100%', gap: 1 }}>\n <Typography variant=\"body2\" noWrap sx={{ flexGrow: 1 }}>\n {option.label}\n </Typography>\n {option.hint ? (\n <Typography variant=\"caption\" color=\"text.secondary\" noWrap>\n {option.hint}\n </Typography>\n ) : null}\n </Box>\n </Box>\n )\n }}\n renderInput={(params) => (\n <MuiTextField\n {...params}\n label={label}\n margin=\"dense\"\n required={Boolean(isRequired)}\n error={Boolean(invalid)}\n placeholder={placeholder}\n helperText={\n invalid ||\n ((meta.touched || validateOnMount) && meta.warning) ||\n // Naming the resolved value is what makes the token readable:\n // `h4.fontSize` means nothing until it says `2.125rem`.\n (activeOption?.hint\n ? `${activeOption.label} — ${activeOption.hint}`\n : undefined) ||\n helperText ||\n description\n }\n />\n )}\n {...rest}\n />\n </FormFieldGrid>\n )\n}\nThemeScaleField.displayName = 'AglynThemeScaleField'\n\nexport default ThemeScaleField\n"],"names":["Autocomplete","Box","TextField","MuiTextField","Typography","useCallback","useMemo","useFieldApi","FormFieldGrid","buildFieldClear","validationError","themeScaleValueToText","value","undefined","Number","isFinite","filterThemeScaleOptions","options","text","query","trim","toLowerCase","some","option","filter","label","hint","part","includes","ThemeScaleField","props","input","isReadOnly","isDisabled","isRequired","placeholder","helperText","description","validateOnMount","meta","help","scaleOptions","clearable","FormFieldGridProps","inputProps","_inputProps","InputProps","_InputProps","multiline","_multiline","type","_type","_options","rest","invalid","commit","next","onChange","clear","hasValue","locked","Boolean","onClear","filterOptions","state","inputValue","activeOption","find","freeSolo","disableClearable","fullWidth","size","disabled","readOnly","onInputChange","_event","getOptionLabel","renderOption","optionProps","key","liProps","component","sx","display","width","gap","variant","noWrap","flexGrow","color","renderInput","params","margin","required","error","touched","warning","displayName"],"mappings":"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"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { type TimePickerProps as MuiTimePickerProps } from '@mui/x-date-pickers';
18
+ import { type FormFieldGridProps } from './form-field-grid';
19
+ import type { BaseFieldProps } from './types';
20
+ export interface TimePickerProps extends BaseFieldProps {
21
+ placeholder?: string;
22
+ FormFieldGridProps?: FormFieldGridProps;
23
+ TimePickerProps?: Omit<MuiTimePickerProps, 'value' | 'onChange' | 'disabled' | 'readOnly'>;
24
+ }
25
+ export declare const TimePicker: (props: TimePickerProps) => import("react").JSX.Element;
26
+ export default TimePicker;
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /**
17
+ * Ported from `@data-driven-forms/mui-component-mapper` (Apache-2.0) and
18
+ * updated for the current @mui/x-date-pickers slots API.
19
+ */ import { _ as _extends } from "@swc/helpers/_/_extends";
20
+ import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
21
+ import { jsx as _jsx } from "react/jsx-runtime";
22
+ import { TimePicker as MuiTimePicker } from "@mui/x-date-pickers";
23
+ import { useFieldApi } from "../vendor/data-driven-forms.js";
24
+ import FormFieldGrid from "./form-field-grid.js";
25
+ import { validationError } from "./validation-error.js";
26
+ export const TimePicker = (props)=>{
27
+ const _useFieldApi = useFieldApi(props), { input, isReadOnly, isDisabled, placeholder, isRequired, label, helperText, description, validateOnMount, meta, help, FormFieldGridProps = {}, TimePickerProps = {} } = _useFieldApi, rest = _object_without_properties_loose(_useFieldApi, [
28
+ "input",
29
+ "isReadOnly",
30
+ "isDisabled",
31
+ "placeholder",
32
+ "isRequired",
33
+ "label",
34
+ "helperText",
35
+ "description",
36
+ "validateOnMount",
37
+ "meta",
38
+ "help",
39
+ "FormFieldGridProps",
40
+ "TimePickerProps"
41
+ ]);
42
+ const invalid = validationError(meta, validateOnMount);
43
+ return /*#__PURE__*/ _jsx(FormFieldGrid, _extends({
44
+ help: help
45
+ }, FormFieldGridProps, {
46
+ children: /*#__PURE__*/ _jsx(MuiTimePicker, _extends({
47
+ slotProps: {
48
+ textField: {
49
+ fullWidth: true,
50
+ margin: 'normal',
51
+ label,
52
+ helperText: invalid || (meta.touched || validateOnMount) && meta.warning || helperText || description,
53
+ placeholder,
54
+ required: isRequired,
55
+ error: !!invalid,
56
+ onBlur: input.onBlur,
57
+ onFocus: input.onFocus
58
+ }
59
+ },
60
+ readOnly: isReadOnly,
61
+ disabled: isDisabled || isReadOnly
62
+ }, input, {
63
+ value: input.value || null
64
+ }, TimePickerProps, rest))
65
+ }));
66
+ };
67
+ export default TimePicker;
68
+
69
+ //# sourceMappingURL=time-picker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/ui/jsx-forms/src/lib/mapper/time-picker.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Ported from `@data-driven-forms/mui-component-mapper` (Apache-2.0) and\n * updated for the current @mui/x-date-pickers slots API.\n */\n\nimport type { TextFieldProps } from '@mui/material'\n\nimport {\n TimePicker as MuiTimePicker,\n type TimePickerProps as MuiTimePickerProps,\n} from '@mui/x-date-pickers'\n\nimport { useFieldApi } from '../vendor/data-driven-forms'\nimport FormFieldGrid, { type FormFieldGridProps } from './form-field-grid'\nimport type { BaseFieldProps } from './types'\nimport { type ExtendedFieldMeta, validationError } from './validation-error'\n\nexport interface TimePickerProps extends BaseFieldProps {\n placeholder?: string\n FormFieldGridProps?: FormFieldGridProps\n TimePickerProps?: Omit<\n MuiTimePickerProps,\n 'value' | 'onChange' | 'disabled' | 'readOnly'\n >\n}\n\nexport const TimePicker = (props: TimePickerProps) => {\n const {\n input,\n isReadOnly,\n isDisabled,\n placeholder,\n isRequired,\n label,\n helperText,\n description,\n validateOnMount,\n meta,\n help,\n FormFieldGridProps = {},\n TimePickerProps = {},\n ...rest\n } = useFieldApi(props)\n\n const invalid = validationError(meta as ExtendedFieldMeta, validateOnMount)\n\n return (\n <FormFieldGrid help={help} {...FormFieldGridProps}>\n <MuiTimePicker\n slotProps={{\n textField: {\n fullWidth: true,\n margin: 'normal',\n label,\n helperText:\n invalid ||\n ((meta.touched || validateOnMount) && meta.warning) ||\n helperText ||\n description,\n placeholder,\n required: isRequired,\n error: !!invalid,\n onBlur: input.onBlur,\n onFocus: input.onFocus,\n } as TextFieldProps,\n }}\n readOnly={isReadOnly}\n disabled={isDisabled || isReadOnly}\n {...input}\n value={input.value || null}\n {...TimePickerProps}\n {...rest}\n />\n </FormFieldGrid>\n )\n}\n\nexport default TimePicker\n"],"names":["TimePicker","MuiTimePicker","useFieldApi","FormFieldGrid","validationError","props","input","isReadOnly","isDisabled","placeholder","isRequired","label","helperText","description","validateOnMount","meta","help","FormFieldGridProps","TimePickerProps","rest","invalid","slotProps","textField","fullWidth","margin","touched","warning","required","error","onBlur","onFocus","readOnly","disabled","value"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;CAGC;;;AAID,SACEA,cAAcC,aAAa,QAEtB,sBAAqB;AAE5B,SAASC,WAAW,QAAQ,iCAA6B;AACzD,OAAOC,mBAAgD,uBAAmB;AAE1E,SAAiCC,eAAe,QAAQ,wBAAoB;AAW5E,OAAO,MAAMJ,aAAa,CAACK;IACzB,MAeIH,eAAAA,YAAYG,QAfV,EACJC,KAAK,EACLC,UAAU,EACVC,UAAU,EACVC,WAAW,EACXC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,WAAW,EACXC,eAAe,EACfC,IAAI,EACJC,IAAI,EACJC,qBAAqB,CAAC,CAAC,EACvBC,kBAAkB,CAAC,CAAC,EAErB,GAAGhB,cADCiB,wCACDjB;;;;;;;;;;;;;;;IAEJ,MAAMkB,UAAUhB,gBAAgBW,MAA2BD;IAE3D,qBACE,KAACX;QAAca,MAAMA;OAAUC;kBAC7B,cAAA,KAAChB;YACCoB,WAAW;gBACTC,WAAW;oBACTC,WAAW;oBACXC,QAAQ;oBACRb;oBACAC,YACEQ,WACC,AAACL,CAAAA,KAAKU,OAAO,IAAIX,eAAc,KAAMC,KAAKW,OAAO,IAClDd,cACAC;oBACFJ;oBACAkB,UAAUjB;oBACVkB,OAAO,CAAC,CAACR;oBACTS,QAAQvB,MAAMuB,MAAM;oBACpBC,SAASxB,MAAMwB,OAAO;gBACxB;YACF;YACAC,UAAUxB;YACVyB,UAAUxB,cAAcD;WACpBD;YACJ2B,OAAO3B,MAAM2B,KAAK,IAAI;WAClBf,iBACAC;;AAIZ,EAAC;AAED,eAAenB,WAAU"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type { HelpTipContent } from '@aglyn/shared-ui-jsx';
18
+ import type { ReactNode } from 'react';
19
+ export type OptionValue = string | number | boolean | null | undefined;
20
+ export interface SelectOption<T = OptionValue> {
21
+ value: T;
22
+ label: ReactNode;
23
+ [key: string]: unknown;
24
+ }
25
+ export type SelectValue<T = OptionValue> = T | SelectOption<T> | (T | SelectOption<T>)[] | null;
26
+ /**
27
+ * Common schema-driven field props resolved through `useFieldApi`. The
28
+ * renderer passes arbitrary extra props from the field schema, hence the
29
+ * index signature (mirrors upstream mui-component-mapper typings).
30
+ */
31
+ export interface BaseFieldProps {
32
+ name: string;
33
+ label?: ReactNode;
34
+ helperText?: ReactNode;
35
+ description?: ReactNode;
36
+ isRequired?: boolean;
37
+ isDisabled?: boolean;
38
+ isReadOnly?: boolean;
39
+ validateOnMount?: boolean;
40
+ /** Contextual help tooltip rendered at the field's top-right (AGL-601). */
41
+ help?: HelpTipContent;
42
+ [key: string]: any;
43
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /**
17
+ * Common schema-driven field props resolved through `useFieldApi`. The
18
+ * renderer passes arbitrary extra props from the field schema, hence the
19
+ * index signature (mirrors upstream mui-component-mapper typings).
20
+ */ export { };
21
+
22
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/ui/jsx-forms/src/lib/mapper/types.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { HelpTipContent } from '@aglyn/shared-ui-jsx'\nimport type { ReactNode } from 'react'\n\nexport type OptionValue = string | number | boolean | null | undefined\n\nexport interface SelectOption<T = OptionValue> {\n value: T\n label: ReactNode\n [key: string]: unknown\n}\n\nexport type SelectValue<T = OptionValue> =\n | T\n | SelectOption<T>\n | (T | SelectOption<T>)[]\n | null\n\n/**\n * Common schema-driven field props resolved through `useFieldApi`. The\n * renderer passes arbitrary extra props from the field schema, hence the\n * index signature (mirrors upstream mui-component-mapper typings).\n */\nexport interface BaseFieldProps {\n name: string\n label?: ReactNode\n helperText?: ReactNode\n description?: ReactNode\n isRequired?: boolean\n isDisabled?: boolean\n isReadOnly?: boolean\n validateOnMount?: boolean\n /** Contextual help tooltip rendered at the field's top-right (AGL-601). */\n help?: HelpTipContent\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAmBD;;;;CAIC,GACD,WAaC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export interface ExtendedFieldMeta extends Record<string, unknown> {
18
+ error?: string;
19
+ submitError?: string;
20
+ touched?: boolean;
21
+ warning?: any;
22
+ }
23
+ export declare const validationError: (meta: ExtendedFieldMeta, validateOnMount?: boolean) => string | false | undefined;
24
+ export default validationError;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ export const validationError = (meta, validateOnMount)=>{
17
+ if (validateOnMount) {
18
+ return meta.error || meta.submitError;
19
+ }
20
+ return meta.touched ? meta.error || meta.submitError : false;
21
+ };
22
+ export default validationError;
23
+
24
+ //# sourceMappingURL=validation-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/shared/ui/jsx-forms/src/lib/mapper/validation-error.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface ExtendedFieldMeta extends Record<string, unknown> {\n error?: string\n submitError?: string\n touched?: boolean\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n warning?: any\n}\n\nexport const validationError = (\n meta: ExtendedFieldMeta,\n validateOnMount?: boolean,\n): string | false | undefined => {\n if (validateOnMount) {\n return meta.error || meta.submitError\n }\n\n return meta.touched ? meta.error || meta.submitError : false\n}\n\nexport default validationError\n"],"names":["validationError","meta","validateOnMount","error","submitError","touched"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAUD,OAAO,MAAMA,kBAAkB,CAC7BC,MACAC;IAEA,IAAIA,iBAAiB;QACnB,OAAOD,KAAKE,KAAK,IAAIF,KAAKG,WAAW;IACvC;IAEA,OAAOH,KAAKI,OAAO,GAAGJ,KAAKE,KAAK,IAAIF,KAAKG,WAAW,GAAG;AACzD,EAAC;AAED,eAAeJ,gBAAe"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export interface WizardProps {
18
+ [key: string]: any;
19
+ }
20
+ export declare const Wizard: (props: WizardProps) => import("react").JSX.Element;
21
+ export default Wizard;