@schema-engine/forms-react 0.0.0-stage → 0.5.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 (165) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +87 -2
  3. package/dist/chunk-5XCNXEJB.js +19 -0
  4. package/dist/chunk-5XCNXEJB.js.map +7 -0
  5. package/dist/chunk-6RI4LMM6.js +19 -0
  6. package/dist/chunk-6RI4LMM6.js.map +7 -0
  7. package/dist/chunk-7QNWPTT7.js +20 -0
  8. package/dist/chunk-7QNWPTT7.js.map +7 -0
  9. package/dist/chunk-7RUFT6EJ.js +39 -0
  10. package/dist/chunk-7RUFT6EJ.js.map +7 -0
  11. package/dist/chunk-AALIXTCD.js +56 -0
  12. package/dist/chunk-AALIXTCD.js.map +7 -0
  13. package/dist/chunk-CPJMN2IH.js +128 -0
  14. package/dist/chunk-CPJMN2IH.js.map +7 -0
  15. package/dist/chunk-DTJ64NZQ.js +142 -0
  16. package/dist/chunk-DTJ64NZQ.js.map +7 -0
  17. package/dist/chunk-EYDB6NR6.js +9 -0
  18. package/dist/chunk-EYDB6NR6.js.map +7 -0
  19. package/dist/chunk-GH2QO3WC.js +11 -0
  20. package/dist/chunk-GH2QO3WC.js.map +7 -0
  21. package/dist/chunk-H25SUEJE.js +8 -0
  22. package/dist/chunk-H25SUEJE.js.map +7 -0
  23. package/dist/chunk-HT43MPKW.js +0 -0
  24. package/dist/chunk-HT43MPKW.js.map +7 -0
  25. package/dist/chunk-IHX6VMAQ.js +0 -0
  26. package/dist/chunk-IHX6VMAQ.js.map +7 -0
  27. package/dist/chunk-ISDPSORR.js +265 -0
  28. package/dist/chunk-ISDPSORR.js.map +7 -0
  29. package/dist/chunk-IXRV3YCF.js +36 -0
  30. package/dist/chunk-IXRV3YCF.js.map +7 -0
  31. package/dist/chunk-K3LLWGXU.js +30 -0
  32. package/dist/chunk-K3LLWGXU.js.map +7 -0
  33. package/dist/chunk-K66J2V73.js +108 -0
  34. package/dist/chunk-K66J2V73.js.map +7 -0
  35. package/dist/chunk-KG6Q7MNI.js +51 -0
  36. package/dist/chunk-KG6Q7MNI.js.map +7 -0
  37. package/dist/chunk-MBN4WIAC.js +41 -0
  38. package/dist/chunk-MBN4WIAC.js.map +7 -0
  39. package/dist/chunk-NDFV5AQW.js +39 -0
  40. package/dist/chunk-NDFV5AQW.js.map +7 -0
  41. package/dist/chunk-QUZN42PL.js +128 -0
  42. package/dist/chunk-QUZN42PL.js.map +7 -0
  43. package/dist/chunk-SED35QJC.js +78 -0
  44. package/dist/chunk-SED35QJC.js.map +7 -0
  45. package/dist/chunk-ULKJHK3P.js +6 -0
  46. package/dist/chunk-ULKJHK3P.js.map +7 -0
  47. package/dist/chunk-USRF3EEE.js +122 -0
  48. package/dist/chunk-USRF3EEE.js.map +7 -0
  49. package/dist/chunk-WFRWVH4X.js +44 -0
  50. package/dist/chunk-WFRWVH4X.js.map +7 -0
  51. package/dist/chunk-WOTW7A2I.js +7 -0
  52. package/dist/chunk-WOTW7A2I.js.map +7 -0
  53. package/dist/chunk-WRJWSEL7.js +98 -0
  54. package/dist/chunk-WRJWSEL7.js.map +7 -0
  55. package/dist/chunk-XWHP2AGG.js +7 -0
  56. package/dist/chunk-XWHP2AGG.js.map +7 -0
  57. package/dist/chunk-ZWEYALBG.js +25 -0
  58. package/dist/chunk-ZWEYALBG.js.map +7 -0
  59. package/dist/components/form-debugger/form-debugger.css +374 -0
  60. package/dist/components/form-debugger/form-debugger.css.map +7 -0
  61. package/dist/components/form-debugger/form-debugger.d.ts +23 -0
  62. package/dist/components/form-debugger/form-debugger.js +17 -0
  63. package/dist/components/form-debugger/form-debugger.js.map +7 -0
  64. package/dist/components/form-debugger/index.css +374 -0
  65. package/dist/components/form-debugger/index.css.map +7 -0
  66. package/dist/components/form-debugger/index.d.ts +2 -0
  67. package/dist/components/form-debugger/index.js +17 -0
  68. package/dist/components/form-debugger/index.js.map +7 -0
  69. package/dist/components/form-engine-provider.d.ts +7 -0
  70. package/dist/components/form-engine-provider.js +7 -0
  71. package/dist/components/form-engine-provider.js.map +7 -0
  72. package/dist/components/form-provider.d.ts +23 -0
  73. package/dist/components/form-provider.js +13 -0
  74. package/dist/components/form-provider.js.map +7 -0
  75. package/dist/components/index.d.ts +4 -0
  76. package/dist/components/index.js +43 -0
  77. package/dist/components/index.js.map +7 -0
  78. package/dist/components/internals/element-error.d.ts +9 -0
  79. package/dist/components/internals/element-error.js +6 -0
  80. package/dist/components/internals/element-error.js.map +7 -0
  81. package/dist/components/internals/field-renderer.d.ts +26 -0
  82. package/dist/components/internals/field-renderer.js +24 -0
  83. package/dist/components/internals/field-renderer.js.map +7 -0
  84. package/dist/components/internals/form-elements.d.ts +20 -0
  85. package/dist/components/internals/form-elements.js +25 -0
  86. package/dist/components/internals/form-elements.js.map +7 -0
  87. package/dist/components/internals/form-renderer.d.ts +28 -0
  88. package/dist/components/internals/form-renderer.js +31 -0
  89. package/dist/components/internals/form-renderer.js.map +7 -0
  90. package/dist/components/internals/recipe-renderer.d.ts +10 -0
  91. package/dist/components/internals/recipe-renderer.js +17 -0
  92. package/dist/components/internals/recipe-renderer.js.map +7 -0
  93. package/dist/components/provider.d.ts +18 -0
  94. package/dist/components/provider.js +8 -0
  95. package/dist/components/provider.js.map +7 -0
  96. package/dist/contexts/field-constraint-context.d.ts +15 -0
  97. package/dist/contexts/field-constraint-context.js +6 -0
  98. package/dist/contexts/field-constraint-context.js.map +7 -0
  99. package/dist/contexts/index.d.ts +2 -0
  100. package/dist/contexts/index.js +6 -0
  101. package/dist/contexts/index.js.map +7 -0
  102. package/dist/contexts/view-context.d.ts +14 -0
  103. package/dist/contexts/view-context.js +16 -0
  104. package/dist/contexts/view-context.js.map +7 -0
  105. package/dist/global.css +8 -0
  106. package/dist/hooks/field-text.d.ts +6 -0
  107. package/dist/hooks/field-text.js +6 -0
  108. package/dist/hooks/field-text.js.map +7 -0
  109. package/dist/hooks/form-state/context.d.ts +27 -0
  110. package/dist/hooks/form-state/context.js +10 -0
  111. package/dist/hooks/form-state/context.js.map +7 -0
  112. package/dist/hooks/form-state/field-registry.d.ts +60 -0
  113. package/dist/hooks/form-state/field-registry.js +9 -0
  114. package/dist/hooks/form-state/field-registry.js.map +7 -0
  115. package/dist/hooks/form-state/index.d.ts +8 -0
  116. package/dist/hooks/form-state/index.js +27 -0
  117. package/dist/hooks/form-state/index.js.map +7 -0
  118. package/dist/hooks/form-state/native-control.d.ts +39 -0
  119. package/dist/hooks/form-state/native-control.js +17 -0
  120. package/dist/hooks/form-state/native-control.js.map +7 -0
  121. package/dist/hooks/form-state/types.d.ts +191 -0
  122. package/dist/hooks/form-state/types.js +0 -0
  123. package/dist/hooks/form-state/types.js.map +7 -0
  124. package/dist/hooks/form-state/use-field-array.d.ts +12 -0
  125. package/dist/hooks/form-state/use-field-array.js +7 -0
  126. package/dist/hooks/form-state/use-field-array.js.map +7 -0
  127. package/dist/hooks/form-state/use-form-context.d.ts +10 -0
  128. package/dist/hooks/form-state/use-form-context.js +7 -0
  129. package/dist/hooks/form-state/use-form-context.js.map +7 -0
  130. package/dist/hooks/form-state/use-form-field.d.ts +24 -0
  131. package/dist/hooks/form-state/use-form-field.js +11 -0
  132. package/dist/hooks/form-state/use-form-field.js.map +7 -0
  133. package/dist/hooks/form-state/use-watch.d.ts +12 -0
  134. package/dist/hooks/form-state/use-watch.js +7 -0
  135. package/dist/hooks/form-state/use-watch.js.map +7 -0
  136. package/dist/hooks/index.d.ts +7 -0
  137. package/dist/hooks/index.js +78 -0
  138. package/dist/hooks/index.js.map +7 -0
  139. package/dist/hooks/is-element-required.d.ts +5 -0
  140. package/dist/hooks/is-element-required.js +6 -0
  141. package/dist/hooks/is-element-required.js.map +7 -0
  142. package/dist/hooks/use-debounce.d.ts +14 -0
  143. package/dist/hooks/use-debounce.js +8 -0
  144. package/dist/hooks/use-debounce.js.map +7 -0
  145. package/dist/hooks/use-field.d.ts +44 -0
  146. package/dist/hooks/use-field.js +16 -0
  147. package/dist/hooks/use-field.js.map +7 -0
  148. package/dist/hooks/use-form-context.d.ts +63 -0
  149. package/dist/hooks/use-form-context.js +18 -0
  150. package/dist/hooks/use-form-context.js.map +7 -0
  151. package/dist/hooks/use-mobile.d.ts +9 -0
  152. package/dist/hooks/use-mobile.js +6 -0
  153. package/dist/hooks/use-mobile.js.map +7 -0
  154. package/dist/index.d.ts +2 -0
  155. package/dist/index.js +43 -0
  156. package/dist/index.js.map +7 -0
  157. package/dist/lib/logger.d.ts +2 -0
  158. package/dist/lib/object-identity.d.ts +6 -0
  159. package/dist/primitives.d.ts +28 -0
  160. package/dist/primitives.js +37 -0
  161. package/dist/primitives.js.map +7 -0
  162. package/package.json +139 -3
  163. package/skill/SKILL.md +79 -0
  164. package/skill/reference/forms-react-widgets.md +222 -0
  165. package/skill/reference/forms-react.md +92 -0
@@ -0,0 +1,44 @@
1
+ import {
2
+ FieldHostContext
3
+ } from "./chunk-WOTW7A2I.js";
4
+ import {
5
+ useLayoutThemeId
6
+ } from "./chunk-AALIXTCD.js";
7
+
8
+ // src/hooks/use-field.ts
9
+ import { useContext } from "react";
10
+ import {
11
+ GRID_ITEM_CLASS,
12
+ getAppearanceAttributes,
13
+ getGridItemVariables
14
+ } from "@schema-engine/layout";
15
+ function useFieldAppearanceAttributes() {
16
+ return getAppearanceAttributes(useContext(FieldHostContext)?.appearance);
17
+ }
18
+ function useFieldClassName() {
19
+ return useContext(FieldHostContext)?.className;
20
+ }
21
+ function useFieldHost(grid, style) {
22
+ const themeId = useLayoutThemeId();
23
+ const appearance = useFieldAppearanceAttributes();
24
+ const className = useFieldClassName();
25
+ return {
26
+ className: ["se-form-field", GRID_ITEM_CLASS, className].filter(Boolean).join(" "),
27
+ "data-se-theme": themeId,
28
+ style: { ...getGridItemVariables(grid), ...style },
29
+ ...appearance
30
+ };
31
+ }
32
+ function combineHandlers(controllerHandler, propsHandler) {
33
+ return (value) => {
34
+ controllerHandler(value);
35
+ propsHandler?.(value);
36
+ };
37
+ }
38
+
39
+ export {
40
+ useFieldAppearanceAttributes,
41
+ useFieldClassName,
42
+ useFieldHost,
43
+ combineHandlers
44
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/hooks/use-field.ts"],
4
+ "sourcesContent": ["import type React from 'react';\nimport { useContext } from 'react';\nimport {\n\tGRID_ITEM_CLASS,\n\tgetAppearanceAttributes,\n\tgetGridItemVariables,\n\ttype ElementGridConfig,\n} from '@schema-engine/layout';\nimport { FieldHostContext } from '@/contexts/field-constraint-context';\nimport { useLayoutThemeId } from '@/hooks/use-form-context';\n\nexport interface FieldHostProps {\n\tclassName: string;\n\t'data-se-theme': string;\n\tstyle: React.CSSProperties;\n\t[appearanceAttribute: `data-se-${string}`]: string;\n}\n\n/**\n * `data-se-<axis>` attributes for the element `FormElement` is rendering.\n *\n * @remarks\n * Spread onto the field's host element. `FieldGroupRoot` and {@link useFieldHost} already do; call it\n * for a host built by hand. Empty outside a `FormElement` or for an element with no appearance.\n */\nexport function useFieldAppearanceAttributes(): Record<string, string> {\n\treturn getAppearanceAttributes(useContext(FieldHostContext)?.appearance);\n}\n\n/**\n * The authored `className` of the element `FormElement` is rendering, for its field host.\n *\n * @remarks `FieldGroupRoot` and {@link useFieldHost} already apply it. The host is the element that\n * carries the field's `style` and `data-se-*` attributes, in both renderers.\n */\nexport function useFieldClassName(): string | undefined {\n\treturn useContext(FieldHostContext)?.className;\n}\n\n/**\n * Host attributes that put an element on the form grid.\n *\n * @remarks\n * Any element can sit on the grid, not only inputs. `useFormField`\n * returns the grid variables as `containerStyles` for fields bound to a config; a content or decoration element that\n * renders its own container calls this directly and spreads the result:\n *\n * ```tsx\n * <div {...useFieldHost(config.grid, config.style)}>\u2026</div>\n * ```\n *\n * Without it an element ignores its `grid` config entirely \u2014 placement and\n * `marginBlockStart`/`marginBlockEnd` alike \u2014 because the generated stylesheet\n * matches on `.se-grid-item` scoped by the owning engine's theme id.\n */\nexport function useFieldHost(grid?: ElementGridConfig, style?: React.CSSProperties): FieldHostProps {\n\tconst themeId = useLayoutThemeId();\n\tconst appearance = useFieldAppearanceAttributes();\n\tconst className = useFieldClassName();\n\n\treturn {\n\t\tclassName: ['se-form-field', GRID_ITEM_CLASS, className].filter(Boolean).join(' '),\n\t\t'data-se-theme': themeId,\n\t\tstyle: { ...getGridItemVariables(grid), ...style },\n\t\t...appearance,\n\t};\n}\n\n/**\n * Combines handlers from props with controller handlers\n */\nexport function combineHandlers<T>(controllerHandler: (value: T) => void, propsHandler?: (value: T) => void) {\n\treturn (value: T) => {\n\t\tcontrollerHandler(value);\n\t\tpropsHandler?.(value);\n\t};\n}\n"],
5
+ "mappings": ";;;;;;;;AACA,SAAS,kBAAkB;AAC3B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OAEM;AAkBA,SAAS,+BAAuD;AACtE,SAAO,wBAAwB,WAAW,gBAAgB,GAAG,UAAU;AACxE;AAQO,SAAS,oBAAwC;AACvD,SAAO,WAAW,gBAAgB,GAAG;AACtC;AAkBO,SAAS,aAAa,MAA0B,OAA6C;AACnG,QAAM,UAAU,iBAAiB;AACjC,QAAM,aAAa,6BAA6B;AAChD,QAAM,YAAY,kBAAkB;AAEpC,SAAO;AAAA,IACN,WAAW,CAAC,iBAAiB,iBAAiB,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,IACjF,iBAAiB;AAAA,IACjB,OAAO,EAAE,GAAG,qBAAqB,IAAI,GAAG,GAAG,MAAM;AAAA,IACjD,GAAG;AAAA,EACJ;AACD;AAKO,SAAS,gBAAmB,mBAAuC,cAAmC;AAC5G,SAAO,CAAC,UAAa;AACpB,sBAAkB,KAAK;AACvB,mBAAe,KAAK;AAAA,EACrB;AACD;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ // src/contexts/field-constraint-context.ts
2
+ import { createContext } from "react";
3
+ var FieldHostContext = createContext(void 0);
4
+
5
+ export {
6
+ FieldHostContext
7
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/contexts/field-constraint-context.ts"],
4
+ "sourcesContent": ["import { createContext } from 'react';\nimport type { AppearanceSelection } from '@schema-engine/layout';\n\n/**\n * What a field host takes from the element `FormElement` is rendering.\n *\n * @remarks\n * Field hosts (`FieldGroupRoot`, `useFieldHost`) read it through `useFieldAppearanceAttributes` and\n * `useFieldClassName`, so a registry component does not thread `appearance` or `className` into its\n * host by hand. A nested element's own `FormElement` provides its own value, so a container's\n * appearance and class never reach its children's hosts.\n */\nexport interface FieldHostConfig {\n\tappearance?: AppearanceSelection;\n\tclassName?: string;\n}\n\nexport const FieldHostContext = createContext<FieldHostConfig | undefined>(undefined);\n"],
5
+ "mappings": ";AAAA,SAAS,qBAAqB;AAiBvB,IAAM,mBAAmB,cAA2C,MAAS;",
6
+ "names": []
7
+ }
@@ -0,0 +1,98 @@
1
+ import {
2
+ createFieldRegistry
3
+ } from "./chunk-USRF3EEE.js";
4
+ import {
5
+ useFormEngine
6
+ } from "./chunk-AALIXTCD.js";
7
+ import {
8
+ FormStateContext
9
+ } from "./chunk-ZWEYALBG.js";
10
+
11
+ // src/components/form-provider.tsx
12
+ import { useEffect, useMemo, useRef, useState } from "react";
13
+ import { getAppearanceAttributes } from "@schema-engine/layout";
14
+ import {
15
+ createFormRuntime,
16
+ defaultNavigate
17
+ } from "@schema-engine/forms";
18
+
19
+ // src/lib/object-identity.ts
20
+ var identities = /* @__PURE__ */ new WeakMap();
21
+ var nextIdentity = 0;
22
+ function getObjectIdentity(value) {
23
+ const existing = identities.get(value);
24
+ if (existing !== void 0) return existing;
25
+ const identity = nextIdentity++;
26
+ identities.set(value, identity);
27
+ return identity;
28
+ }
29
+
30
+ // src/components/form-provider.tsx
31
+ import { jsx } from "react/jsx-runtime";
32
+ function FormInstance({
33
+ config,
34
+ defaultValues,
35
+ children,
36
+ onSubmit,
37
+ onChange,
38
+ onAction,
39
+ onActionResults,
40
+ navigate,
41
+ formatIssue
42
+ }) {
43
+ const { engine } = useFormEngine();
44
+ const runtimeConfig = config;
45
+ const callbacks = useRef({ onSubmit, onChange, onAction, onActionResults, navigate });
46
+ useEffect(() => {
47
+ callbacks.current = { onSubmit, onChange, onAction, onActionResults, navigate };
48
+ }, [onSubmit, onChange, onAction, onActionResults, navigate]);
49
+ const [{ runtime, fields }] = useState(() => {
50
+ let registry;
51
+ const created = createFormRuntime({
52
+ engine,
53
+ config,
54
+ defaults: defaultValues,
55
+ host: { focus: (paths) => registry?.focusFirst(paths) },
56
+ onSubmit: (data, helpers) => callbacks.current.onSubmit?.(data, helpers),
57
+ onChange: (data) => callbacks.current.onChange?.(data),
58
+ onAction: (action, data) => callbacks.current.onAction?.(action, data),
59
+ onActionResults: (results, trigger) => callbacks.current.onActionResults?.(results, trigger),
60
+ navigate: (url) => (callbacks.current.navigate ?? defaultNavigate)(url)
61
+ });
62
+ registry = createFieldRegistry(created.container);
63
+ return { runtime: created, fields: registry };
64
+ });
65
+ useEffect(() => runtime.mount(), [runtime]);
66
+ const resolvedFormatIssue = formatIssue ?? engine.getIssueFormatter();
67
+ const formState = useMemo(
68
+ () => ({ container: runtime.container, formatIssue: resolvedFormatIssue, fields, runtime }),
69
+ [runtime, resolvedFormatIssue, fields]
70
+ );
71
+ return /* @__PURE__ */ jsx(FormStateContext.Provider, { value: formState, children: /* @__PURE__ */ jsx(
72
+ "form",
73
+ {
74
+ onSubmit: (event) => {
75
+ event.preventDefault();
76
+ void runtime.submit();
77
+ },
78
+ onReset: (event) => {
79
+ event.preventDefault();
80
+ runtime.container.reset();
81
+ },
82
+ className: runtimeConfig.className,
83
+ style: runtimeConfig.style,
84
+ "data-se-theme": engine.getLayout().id,
85
+ ...getAppearanceAttributes(runtimeConfig.appearance),
86
+ noValidate: true,
87
+ children
88
+ }
89
+ ) });
90
+ }
91
+ function FormProvider(props) {
92
+ const { engine } = useFormEngine();
93
+ return /* @__PURE__ */ jsx(FormInstance, { ...props }, `${getObjectIdentity(props.config)}:${getObjectIdentity(engine)}`);
94
+ }
95
+
96
+ export {
97
+ FormProvider
98
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/components/form-provider.tsx", "../src/lib/object-identity.ts"],
4
+ "sourcesContent": ["import { useEffect, useMemo, useRef, useState } from 'react';\nimport { getAppearanceAttributes } from '@schema-engine/layout';\nimport {\n\ttype EngineOutputMaps,\n\tcreateFormRuntime,\n\tdefaultNavigate,\n\ttype FormConfigView,\n\ttype FormValues,\n} from '@schema-engine/forms';\nimport { getObjectIdentity } from '@/lib/object-identity';\nimport { FormStateContext, type FormStateContextValue } from '@/hooks/form-state/context';\nimport { createFieldRegistry, type FieldRegistry } from '@/hooks/form-state/field-registry';\nimport type { FormProviderAction, FormProviderProps } from '@/hooks/form-state/types';\nimport { useFormEngine } from '@/hooks/use-form-context';\n\n/** @remarks The form instance of one normalized config and one engine: the runtime, and the container it builds, are created once, from both. */\nfunction FormInstance<TOutputs extends EngineOutputMaps, TValues extends FormValues>({\n\tconfig,\n\tdefaultValues,\n\tchildren,\n\tonSubmit,\n\tonChange,\n\tonAction,\n\tonActionResults,\n\tnavigate,\n\tformatIssue,\n}: FormProviderProps<TOutputs, TValues>) {\n\tconst { engine } = useFormEngine();\n\tconst runtimeConfig: FormConfigView = config;\n\n\tconst callbacks = useRef({ onSubmit, onChange, onAction, onActionResults, navigate });\n\tuseEffect(() => {\n\t\tcallbacks.current = { onSubmit, onChange, onAction, onActionResults, navigate };\n\t}, [onSubmit, onChange, onAction, onActionResults, navigate]);\n\n\tconst [{ runtime, fields }] = useState(() => {\n\t\tlet registry: FieldRegistry | undefined;\n\t\tconst created = createFormRuntime<FormProviderAction<TOutputs>, TValues>({\n\t\t\tengine,\n\t\t\tconfig,\n\t\t\tdefaults: defaultValues,\n\t\t\thost: { focus: (paths) => registry?.focusFirst(paths) },\n\t\t\tonSubmit: (data, helpers) => callbacks.current.onSubmit?.(data, helpers),\n\t\t\tonChange: (data) => callbacks.current.onChange?.(data),\n\t\t\tonAction: (action, data) => callbacks.current.onAction?.(action, data),\n\t\t\tonActionResults: (results, trigger) => callbacks.current.onActionResults?.(results, trigger),\n\t\t\tnavigate: (url) => (callbacks.current.navigate ?? defaultNavigate)(url),\n\t\t});\n\t\tregistry = createFieldRegistry(created.container);\n\t\treturn { runtime: created, fields: registry };\n\t});\n\tuseEffect(() => runtime.mount(), [runtime]);\n\n\tconst resolvedFormatIssue = formatIssue ?? engine.getIssueFormatter();\n\tconst formState = useMemo<FormStateContextValue>(\n\t\t() => ({ container: runtime.container, formatIssue: resolvedFormatIssue, fields, runtime }),\n\t\t[runtime, resolvedFormatIssue, fields],\n\t);\n\n\treturn (\n\t\t<FormStateContext.Provider value={formState}>\n\t\t\t<form\n\t\t\t\tonSubmit={(event) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tvoid runtime.submit();\n\t\t\t\t}}\n\t\t\t\tonReset={(event) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\truntime.container.reset();\n\t\t\t\t}}\n\t\t\t\tclassName={runtimeConfig.className}\n\t\t\t\tstyle={runtimeConfig.style}\n\t\t\t\tdata-se-theme={engine.getLayout().id}\n\t\t\t\t{...getAppearanceAttributes(runtimeConfig.appearance)}\n\t\t\t\tnoValidate\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</form>\n\t\t</FormStateContext.Provider>\n\t);\n}\n\n/**\n * Creates the form's runtime, and the state container it owns, and renders the `<form>` around its children.\n *\n * @remarks\n * The runtime is one instance of the lifecycle: the container (the only form state) plus the submission, the\n * wizard steps and every action dispatch. It is created from the normalized config, the engine, the defaults\n * and the config's `validationMode`, `reValidateMode`, `navigation` and `payload`, and lives as long as the\n * identities of the config and the engine do: a new normalized config or engine starts a fresh instance\n * with its defaults and step state, whichever component renders the provider. `defaultValues` are read when the\n * instance starts. The callbacks may change on every render: the runtime calls the latest. The hooks under the\n * provider read the runtime and the container with `useSyncExternalStore`.\n *\n * The form is submitted by `onSubmit` and never by a React 19 `<form action>`: React resets the uncontrolled\n * fields of a form after an action, which would erase text the container still holds. Submitting before the\n * last step of a wizard acts as Next. A native reset button is the same: the browser would put the controls back\n * to their `defaultValue` attributes behind the container, so the form handles `reset` itself, restoring the\n * defaults through the container, whose write-back updates the controls; and since a reset bumps the container's\n * `generation`, the runtime returns to the first step and an idle submission with it. The one formatter of the\n * form is `formatIssue`, else the engine's.\n */\nexport function FormProvider<\n\tTOutputs extends EngineOutputMaps = EngineOutputMaps,\n\tTValues extends FormValues = FormValues,\n>(props: FormProviderProps<TOutputs, TValues>) {\n\tconst { engine } = useFormEngine();\n\treturn <FormInstance key={`${getObjectIdentity(props.config)}:${getObjectIdentity(engine)}`} {...props} />;\n}\n", "const identities = new WeakMap<object, number>();\nlet nextIdentity = 0;\n\n/**\n * A number that names an object for as long as it lives, to use as a React `key`.\n *\n * @remarks A form instance lives as long as the identities of its normalized config and its engine do not change.\n */\nexport function getObjectIdentity(value: object): number {\n\tconst existing = identities.get(value);\n\tif (existing !== undefined) return existing;\n\tconst identity = nextIdentity++;\n\tidentities.set(value, identity);\n\treturn identity;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAAA,SAAS,WAAW,SAAS,QAAQ,gBAAgB;AACrD,SAAS,+BAA+B;AACxC;AAAA,EAEC;AAAA,EACA;AAAA,OAGM;;;ACRP,IAAM,aAAa,oBAAI,QAAwB;AAC/C,IAAI,eAAe;AAOZ,SAAS,kBAAkB,OAAuB;AACxD,QAAM,WAAW,WAAW,IAAI,KAAK;AACrC,MAAI,aAAa,OAAW,QAAO;AACnC,QAAM,WAAW;AACjB,aAAW,IAAI,OAAO,QAAQ;AAC9B,SAAO;AACR;;;AD+CG;AA7CH,SAAS,aAA4E;AAAA,EACpF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAyC;AACxC,QAAM,EAAE,OAAO,IAAI,cAAc;AACjC,QAAM,gBAAgC;AAEtC,QAAM,YAAY,OAAO,EAAE,UAAU,UAAU,UAAU,iBAAiB,SAAS,CAAC;AACpF,YAAU,MAAM;AACf,cAAU,UAAU,EAAE,UAAU,UAAU,UAAU,iBAAiB,SAAS;AAAA,EAC/E,GAAG,CAAC,UAAU,UAAU,UAAU,iBAAiB,QAAQ,CAAC;AAE5D,QAAM,CAAC,EAAE,SAAS,OAAO,CAAC,IAAI,SAAS,MAAM;AAC5C,QAAI;AACJ,UAAM,UAAU,kBAAyD;AAAA,MACxE;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV,MAAM,EAAE,OAAO,CAAC,UAAU,UAAU,WAAW,KAAK,EAAE;AAAA,MACtD,UAAU,CAAC,MAAM,YAAY,UAAU,QAAQ,WAAW,MAAM,OAAO;AAAA,MACvE,UAAU,CAAC,SAAS,UAAU,QAAQ,WAAW,IAAI;AAAA,MACrD,UAAU,CAAC,QAAQ,SAAS,UAAU,QAAQ,WAAW,QAAQ,IAAI;AAAA,MACrE,iBAAiB,CAAC,SAAS,YAAY,UAAU,QAAQ,kBAAkB,SAAS,OAAO;AAAA,MAC3F,UAAU,CAAC,SAAS,UAAU,QAAQ,YAAY,iBAAiB,GAAG;AAAA,IACvE,CAAC;AACD,eAAW,oBAAoB,QAAQ,SAAS;AAChD,WAAO,EAAE,SAAS,SAAS,QAAQ,SAAS;AAAA,EAC7C,CAAC;AACD,YAAU,MAAM,QAAQ,MAAM,GAAG,CAAC,OAAO,CAAC;AAE1C,QAAM,sBAAsB,eAAe,OAAO,kBAAkB;AACpE,QAAM,YAAY;AAAA,IACjB,OAAO,EAAE,WAAW,QAAQ,WAAW,aAAa,qBAAqB,QAAQ,QAAQ;AAAA,IACzF,CAAC,SAAS,qBAAqB,MAAM;AAAA,EACtC;AAEA,SACC,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,WACjC;AAAA,IAAC;AAAA;AAAA,MACA,UAAU,CAAC,UAAU;AACpB,cAAM,eAAe;AACrB,aAAK,QAAQ,OAAO;AAAA,MACrB;AAAA,MACA,SAAS,CAAC,UAAU;AACnB,cAAM,eAAe;AACrB,gBAAQ,UAAU,MAAM;AAAA,MACzB;AAAA,MACA,WAAW,cAAc;AAAA,MACzB,OAAO,cAAc;AAAA,MACrB,iBAAe,OAAO,UAAU,EAAE;AAAA,MACjC,GAAG,wBAAwB,cAAc,UAAU;AAAA,MACpD,YAAU;AAAA,MAET;AAAA;AAAA,EACF,GACD;AAEF;AAsBO,SAAS,aAGd,OAA6C;AAC9C,QAAM,EAAE,OAAO,IAAI,cAAc;AACjC,SAAO,oBAAC,gBAAsF,GAAG,SAAvE,GAAG,kBAAkB,MAAM,MAAM,CAAC,IAAI,kBAAkB,MAAM,CAAC,EAAe;AACzG;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ // src/lib/logger.ts
2
+ import { Logger } from "@ecopages/logger";
3
+ var logger = new Logger("[schema-engine/forms-react]");
4
+
5
+ export {
6
+ logger
7
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/lib/logger.ts"],
4
+ "sourcesContent": ["import { Logger } from '@ecopages/logger';\n\nexport const logger = new Logger('[schema-engine/forms-react]');\n"],
5
+ "mappings": ";AAAA,SAAS,cAAc;AAEhB,IAAM,SAAS,IAAI,OAAO,6BAA6B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,25 @@
1
+ // src/hooks/form-state/context.ts
2
+ import { createContext, useCallback, useContext, useSyncExternalStore } from "react";
3
+ var FormStateContext = createContext(null);
4
+ function useFormStateContext() {
5
+ const context = useContext(FormStateContext);
6
+ if (!context) {
7
+ throw new Error("Form hooks must be used within a FormProvider or a FormRenderer");
8
+ }
9
+ return context;
10
+ }
11
+ function useContainerSelector(selector) {
12
+ const { container } = useFormStateContext();
13
+ const subscribe = useCallback((listener) => container.subscribe(listener), [container]);
14
+ return useSyncExternalStore(
15
+ subscribe,
16
+ () => selector(container.getSnapshot()),
17
+ () => selector(container.getServerSnapshot())
18
+ );
19
+ }
20
+
21
+ export {
22
+ FormStateContext,
23
+ useFormStateContext,
24
+ useContainerSelector
25
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/hooks/form-state/context.ts"],
4
+ "sourcesContent": ["import { createContext, useCallback, useContext, useSyncExternalStore } from 'react';\nimport type { FormIssueFormatter, FormStateContainer, FormStateSnapshot } from '@schema-engine/forms/state-container';\nimport type { FormRuntime } from '@schema-engine/forms';\nimport type { FieldRegistry } from './field-registry';\n\n/**\n * What a form instance provides to the hooks under it.\n *\n * @remarks The container is the only form state. The rest is what React adds around it: the issue text, the controls to focus and the runtime that owns the submission and the steps.\n */\nexport interface FormStateContextValue {\n\treadonly container: FormStateContainer;\n\treadonly formatIssue: FormIssueFormatter | undefined;\n\treadonly fields: FieldRegistry;\n\t/** The lifecycle around the container: submission, steps and every action; its `container` is the one above. */\n\treadonly runtime: FormRuntime;\n}\n\nexport const FormStateContext = createContext<FormStateContextValue | null>(null);\n\nexport function useFormStateContext(): FormStateContextValue {\n\tconst context = useContext(FormStateContext);\n\tif (!context) {\n\t\tthrow new Error('Form hooks must be used within a FormProvider or a FormRenderer');\n\t}\n\treturn context;\n}\n\n/**\n * Reads a pure selector of the container's snapshot and re-renders when its result changes.\n *\n * @remarks\n * The selectors of `@schema-engine/forms/state-container` return the same object while what they read is\n * unchanged, so `useSyncExternalStore` compares results by reference. A selector that builds a new result on\n * each call must be memoized by the caller. The first render, on the server and while hydrating, reads the\n * container's server snapshot, so both render the same.\n */\nexport function useContainerSelector<T>(selector: (snapshot: FormStateSnapshot) => T): T {\n\tconst { container } = useFormStateContext();\n\tconst subscribe = useCallback((listener: () => void) => container.subscribe(listener), [container]);\n\treturn useSyncExternalStore(\n\t\tsubscribe,\n\t\t() => selector(container.getSnapshot()),\n\t\t() => selector(container.getServerSnapshot()),\n\t);\n}\n"],
5
+ "mappings": ";AAAA,SAAS,eAAe,aAAa,YAAY,4BAA4B;AAkBtE,IAAM,mBAAmB,cAA4C,IAAI;AAEzE,SAAS,sBAA6C;AAC5D,QAAM,UAAU,WAAW,gBAAgB;AAC3C,MAAI,CAAC,SAAS;AACb,UAAM,IAAI,MAAM,iEAAiE;AAAA,EAClF;AACA,SAAO;AACR;AAWO,SAAS,qBAAwB,UAAiD;AACxF,QAAM,EAAE,UAAU,IAAI,oBAAoB;AAC1C,QAAM,YAAY,YAAY,CAAC,aAAyB,UAAU,UAAU,QAAQ,GAAG,CAAC,SAAS,CAAC;AAClG,SAAO;AAAA,IACN;AAAA,IACA,MAAM,SAAS,UAAU,YAAY,CAAC;AAAA,IACtC,MAAM,SAAS,UAAU,kBAAkB,CAAC;AAAA,EAC7C;AACD;",
6
+ "names": []
7
+ }
@@ -0,0 +1,374 @@
1
+ /* src/components/form-debugger/form-debugger.css */
2
+ @layer properties;
3
+ .form-debugger {
4
+ position: relative;
5
+ width: 100%;
6
+ }
7
+ .form-debugger__widget {
8
+ position: fixed;
9
+ z-index: 9999;
10
+ transition-property: all;
11
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(0.4, 0, 0.2, 1)));
12
+ transition-duration: var(--tw-duration, var(--default-transition-duration, 150ms));
13
+ --tw-duration: 300ms;
14
+ transition-duration: 300ms;
15
+ --tw-ease: var(--ease-out, cubic-bezier(0, 0, 0.2, 1));
16
+ transition-timing-function: var(--ease-out, cubic-bezier(0, 0, 0.2, 1));
17
+ bottom: 1.5rem;
18
+ right: 1.5rem;
19
+ }
20
+ .form-debugger__widget--expanded {
21
+ max-height: min(48rem, calc(100vh - 4rem));
22
+ width: min(28rem, calc(100vw - 2rem));
23
+ bottom: 1rem;
24
+ right: 1rem;
25
+ }
26
+ .form-debugger__fab {
27
+ display: flex;
28
+ height: calc(var(--spacing, 0.25rem) * 14);
29
+ width: calc(var(--spacing, 0.25rem) * 14);
30
+ align-items: center;
31
+ justify-content: center;
32
+ border-radius: calc(infinity * 1px);
33
+ --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
34
+ box-shadow:
35
+ var(--tw-inset-shadow),
36
+ var(--tw-inset-ring-shadow),
37
+ var(--tw-ring-offset-shadow),
38
+ var(--tw-ring-shadow),
39
+ var(--tw-shadow);
40
+ transition-property: all;
41
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(0.4, 0, 0.2, 1)));
42
+ transition-duration: var(--tw-duration, var(--default-transition-duration, 150ms));
43
+ --tw-duration: 200ms;
44
+ transition-duration: 200ms;
45
+ }
46
+ @media (hover: hover) {
47
+ .form-debugger__fab:hover {
48
+ --tw-scale-x: 110%;
49
+ --tw-scale-y: 110%;
50
+ --tw-scale-z: 110%;
51
+ scale: var(--tw-scale-x) var(--tw-scale-y);
52
+ }
53
+ }
54
+ .form-debugger__fab:active {
55
+ --tw-scale-x: 95%;
56
+ --tw-scale-y: 95%;
57
+ --tw-scale-z: 95%;
58
+ scale: var(--tw-scale-x) var(--tw-scale-y);
59
+ }
60
+ .form-debugger__fab {
61
+ background: var(--primary);
62
+ color: var(--primary-foreground);
63
+ box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
64
+ }
65
+ .form-debugger__panel {
66
+ display: flex;
67
+ flex-direction: column;
68
+ overflow: hidden;
69
+ border-radius: var(--radius-2xl, 1rem);
70
+ border-style: var(--tw-border-style);
71
+ border-width: 1px;
72
+ background-color: var(--card);
73
+ color: var(--card-foreground);
74
+ box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
75
+ max-height: calc(100vh - 4rem);
76
+ }
77
+ .form-debugger__header {
78
+ display: flex;
79
+ align-items: center;
80
+ justify-content: space-between;
81
+ border-bottom-style: var(--tw-border-style);
82
+ border-bottom-width: 1px;
83
+ padding-inline: calc(var(--spacing, 0.25rem) * 4);
84
+ padding-block: calc(var(--spacing, 0.25rem) * 3);
85
+ }
86
+ .form-debugger__header-title {
87
+ font-size: var(--text-sm, 0.875rem);
88
+ line-height: var(--tw-leading, var(--text-sm--line-height, calc(1.25 / 0.875)));
89
+ --tw-font-weight: var(--font-weight-semibold, 600);
90
+ font-weight: var(--font-weight-semibold, 600);
91
+ }
92
+ .form-debugger__header-subtitle {
93
+ font-size: var(--text-xs, 0.75rem);
94
+ line-height: var(--tw-leading, var(--text-xs--line-height, calc(1 / 0.75)));
95
+ color: var(--muted-foreground);
96
+ }
97
+ .form-debugger__close-button {
98
+ border-radius: calc(var(--radius) - 2px);
99
+ padding: var(--spacing, 0.25rem);
100
+ color: var(--muted-foreground);
101
+ }
102
+ @media (hover: hover) {
103
+ .form-debugger__close-button:hover {
104
+ background-color: var(--muted);
105
+ }
106
+ }
107
+ @media (hover: hover) {
108
+ .form-debugger__close-button:hover {
109
+ color: var(--foreground);
110
+ }
111
+ }
112
+ .form-debugger__content {
113
+ display: flex;
114
+ flex-direction: column;
115
+ gap: calc(var(--spacing, 0.25rem) * 4);
116
+ overflow-y: auto;
117
+ padding: calc(var(--spacing, 0.25rem) * 4);
118
+ max-height: calc(100vh - 12rem);
119
+ }
120
+ .form-debugger__section-title {
121
+ font-size: var(--text-xs, 0.75rem);
122
+ line-height: var(--tw-leading, var(--text-xs--line-height, calc(1 / 0.75)));
123
+ --tw-font-weight: var(--font-weight-medium, 500);
124
+ font-weight: var(--font-weight-medium, 500);
125
+ --tw-tracking: var(--tracking-wide, 0.025em);
126
+ letter-spacing: var(--tracking-wide, 0.025em);
127
+ color: var(--muted-foreground);
128
+ text-transform: uppercase;
129
+ }
130
+ .form-debugger__timeline {
131
+ display: flex;
132
+ flex-direction: column;
133
+ gap: calc(var(--spacing, 0.25rem) * 2);
134
+ }
135
+ .form-debugger__timeline-item {
136
+ display: flex;
137
+ gap: calc(var(--spacing, 0.25rem) * 3);
138
+ border-radius: var(--radius);
139
+ border-style: var(--tw-border-style);
140
+ border-width: 1px;
141
+ padding: calc(var(--spacing, 0.25rem) * 2);
142
+ font-size: var(--text-sm, 0.875rem);
143
+ line-height: var(--tw-leading, var(--text-sm--line-height, calc(1.25 / 0.875)));
144
+ }
145
+ .form-debugger__timeline-item--active {
146
+ border-color: var(--primary);
147
+ background-color: var(--primary);
148
+ }
149
+ @supports (color: color-mix(in lab, red, red)) {
150
+ .form-debugger__timeline-item--active {
151
+ background-color: color-mix(in oklab, var(--primary) 5%, transparent);
152
+ }
153
+ }
154
+ .form-debugger__timeline-meta {
155
+ margin-top: var(--spacing, 0.25rem);
156
+ display: flex;
157
+ flex-wrap: wrap;
158
+ gap: var(--spacing, 0.25rem);
159
+ }
160
+ .form-debugger__badge {
161
+ display: inline-flex;
162
+ border-radius: 0.25rem;
163
+ padding-inline: calc(var(--spacing, 0.25rem) * 1.5);
164
+ padding-block: calc(var(--spacing, 0.25rem) * 0.5);
165
+ font-size: 10px;
166
+ --tw-font-weight: var(--font-weight-medium, 500);
167
+ font-weight: var(--font-weight-medium, 500);
168
+ }
169
+ .form-debugger__badge--valid {
170
+ background-color: var(--color-green-100, oklch(96.2% 0.044 156.743));
171
+ color: var(--color-green-800, oklch(44.8% 0.119 151.328));
172
+ }
173
+ .form-debugger__badge--valid:is(.dark *) {
174
+ background-color: color-mix(in srgb, oklch(39.3% 0.095 152.535) 30%, transparent);
175
+ }
176
+ @supports (color: color-mix(in lab, red, red)) {
177
+ .form-debugger__badge--valid:is(.dark *) {
178
+ background-color: color-mix(in oklab, var(--color-green-900, oklch(39.3% 0.095 152.535)) 30%, transparent);
179
+ }
180
+ }
181
+ .form-debugger__badge--valid:is(.dark *) {
182
+ color: var(--color-green-400, oklch(79.2% 0.209 151.711));
183
+ }
184
+ .form-debugger__badge--invalid {
185
+ background-color: var(--color-red-100, oklch(93.6% 0.032 17.717));
186
+ color: var(--color-red-800, oklch(44.4% 0.177 26.899));
187
+ }
188
+ .form-debugger__badge--invalid:is(.dark *) {
189
+ background-color: color-mix(in srgb, oklch(39.6% 0.141 25.723) 30%, transparent);
190
+ }
191
+ @supports (color: color-mix(in lab, red, red)) {
192
+ .form-debugger__badge--invalid:is(.dark *) {
193
+ background-color: color-mix(in oklab, var(--color-red-900, oklch(39.6% 0.141 25.723)) 30%, transparent);
194
+ }
195
+ }
196
+ .form-debugger__badge--invalid:is(.dark *) {
197
+ color: var(--color-red-400, oklch(70.4% 0.191 22.216));
198
+ }
199
+ .form-debugger__badge--visited {
200
+ background-color: var(--muted);
201
+ color: var(--muted-foreground);
202
+ }
203
+ .form-debugger__detail-row {
204
+ display: flex;
205
+ justify-content: space-between;
206
+ gap: calc(var(--spacing, 0.25rem) * 2);
207
+ font-size: var(--text-xs, 0.75rem);
208
+ line-height: var(--tw-leading, var(--text-xs--line-height, calc(1 / 0.75)));
209
+ }
210
+ .form-debugger__detail-label {
211
+ color: var(--muted-foreground);
212
+ }
213
+ .form-debugger__detail-value {
214
+ text-align: right;
215
+ font-family: "Fira Code", monospace;
216
+ word-break: break-all;
217
+ }
218
+ .form-debugger__nav {
219
+ display: flex;
220
+ flex-wrap: wrap;
221
+ align-items: center;
222
+ justify-content: space-between;
223
+ gap: calc(var(--spacing, 0.25rem) * 2);
224
+ border-top-style: var(--tw-border-style);
225
+ border-top-width: 1px;
226
+ padding: calc(var(--spacing, 0.25rem) * 3);
227
+ }
228
+ .form-debugger__nav-dots {
229
+ display: flex;
230
+ flex-wrap: wrap;
231
+ gap: var(--spacing, 0.25rem);
232
+ }
233
+ .form-debugger__nav-dot {
234
+ height: calc(var(--spacing, 0.25rem) * 2);
235
+ width: calc(var(--spacing, 0.25rem) * 2);
236
+ border-radius: calc(infinity * 1px);
237
+ background-color: var(--muted);
238
+ transition-property:
239
+ color,
240
+ background-color,
241
+ border-color,
242
+ outline-color,
243
+ text-decoration-color,
244
+ fill,
245
+ stroke,
246
+ --tw-gradient-from,
247
+ --tw-gradient-via,
248
+ --tw-gradient-to;
249
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(0.4, 0, 0.2, 1)));
250
+ transition-duration: var(--tw-duration, var(--default-transition-duration, 150ms));
251
+ }
252
+ .form-debugger__nav-dot--active {
253
+ --tw-scale-x: 125%;
254
+ --tw-scale-y: 125%;
255
+ --tw-scale-z: 125%;
256
+ scale: var(--tw-scale-x) var(--tw-scale-y);
257
+ background-color: var(--primary);
258
+ }
259
+ .form-debugger__nav-dot--completed {
260
+ background-color: var(--primary);
261
+ }
262
+ @supports (color: color-mix(in lab, red, red)) {
263
+ .form-debugger__nav-dot--completed {
264
+ background-color: color-mix(in oklab, var(--primary) 60%, transparent);
265
+ }
266
+ }
267
+ .form-debugger__nav-dot--disabled {
268
+ cursor: not-allowed;
269
+ opacity: 40%;
270
+ }
271
+ .form-debugger__nav-button {
272
+ display: inline-flex;
273
+ align-items: center;
274
+ gap: var(--spacing, 0.25rem);
275
+ border-radius: calc(var(--radius) - 2px);
276
+ border-style: var(--tw-border-style);
277
+ border-width: 1px;
278
+ padding-inline: calc(var(--spacing, 0.25rem) * 2);
279
+ padding-block: var(--spacing, 0.25rem);
280
+ font-size: var(--text-xs, 0.75rem);
281
+ line-height: var(--tw-leading, var(--text-xs--line-height, calc(1 / 0.75)));
282
+ }
283
+ .form-debugger__nav-button:disabled {
284
+ opacity: 50%;
285
+ }
286
+ .form-debugger__pre {
287
+ margin-top: calc(var(--spacing, 0.25rem) * 2);
288
+ max-height: calc(var(--spacing, 0.25rem) * 40);
289
+ overflow: auto;
290
+ border-radius: calc(var(--radius) - 2px);
291
+ background-color: var(--muted);
292
+ padding: calc(var(--spacing, 0.25rem) * 2);
293
+ font-family: "Fira Code", monospace;
294
+ font-size: 10px;
295
+ }
296
+ .form-debugger__progress {
297
+ margin-top: 0.25rem;
298
+ height: 0.5rem;
299
+ width: 100%;
300
+ overflow: hidden;
301
+ border-radius: 9999px;
302
+ background: var(--muted);
303
+ }
304
+ .form-debugger__progress-fill {
305
+ height: 100%;
306
+ background: var(--primary);
307
+ transition: width 0.15s;
308
+ }
309
+ .form-debugger__step-title {
310
+ font-weight: 500;
311
+ }
312
+ .form-debugger__step-description {
313
+ font-size: 0.75rem;
314
+ color: var(--muted-foreground);
315
+ }
316
+ .form-debugger__details {
317
+ margin-top: 0.5rem;
318
+ display: grid;
319
+ gap: 0.25rem;
320
+ }
321
+ @property --tw-duration { syntax: "*"; inherits: false; }
322
+ @property --tw-ease { syntax: "*"; inherits: false; }
323
+ @property --tw-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
324
+ @property --tw-shadow-color { syntax: "*"; inherits: false; }
325
+ @property --tw-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }
326
+ @property --tw-inset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
327
+ @property --tw-inset-shadow-color { syntax: "*"; inherits: false; }
328
+ @property --tw-inset-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }
329
+ @property --tw-ring-color { syntax: "*"; inherits: false; }
330
+ @property --tw-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
331
+ @property --tw-inset-ring-color { syntax: "*"; inherits: false; }
332
+ @property --tw-inset-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
333
+ @property --tw-ring-inset { syntax: "*"; inherits: false; }
334
+ @property --tw-ring-offset-width { syntax: "<length>"; inherits: false; initial-value: 0px; }
335
+ @property --tw-ring-offset-color { syntax: "*"; inherits: false; initial-value: #fff; }
336
+ @property --tw-ring-offset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
337
+ @property --tw-scale-x { syntax: "*"; inherits: false; initial-value: 1; }
338
+ @property --tw-scale-y { syntax: "*"; inherits: false; initial-value: 1; }
339
+ @property --tw-scale-z { syntax: "*"; inherits: false; initial-value: 1; }
340
+ @property --tw-border-style { syntax: "*"; inherits: false; initial-value: solid; }
341
+ @property --tw-font-weight { syntax: "*"; inherits: false; }
342
+ @property --tw-tracking { syntax: "*"; inherits: false; }
343
+ @layer properties {
344
+ @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
345
+ *,
346
+ ::before,
347
+ ::after,
348
+ ::backdrop {
349
+ --tw-duration: initial;
350
+ --tw-ease: initial;
351
+ --tw-shadow: 0 0 #0000;
352
+ --tw-shadow-color: initial;
353
+ --tw-shadow-alpha: 100%;
354
+ --tw-inset-shadow: 0 0 #0000;
355
+ --tw-inset-shadow-color: initial;
356
+ --tw-inset-shadow-alpha: 100%;
357
+ --tw-ring-color: initial;
358
+ --tw-ring-shadow: 0 0 #0000;
359
+ --tw-inset-ring-color: initial;
360
+ --tw-inset-ring-shadow: 0 0 #0000;
361
+ --tw-ring-inset: initial;
362
+ --tw-ring-offset-width: 0px;
363
+ --tw-ring-offset-color: #fff;
364
+ --tw-ring-offset-shadow: 0 0 #0000;
365
+ --tw-scale-x: 1;
366
+ --tw-scale-y: 1;
367
+ --tw-scale-z: 1;
368
+ --tw-border-style: solid;
369
+ --tw-font-weight: initial;
370
+ --tw-tracking: initial;
371
+ }
372
+ }
373
+ }
374
+ /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */