/** Form module prop types — react-hook-form + Zod 4 only. */ import type * as React from "react"; import type { FieldArray, FieldArrayPath, FieldErrors, FieldPath, FieldValues, UseFormProps, UseFormReturn } from "react-hook-form"; import type { z } from "zod"; import type { BreakpointProp, DensityProp, DisabledProp, ErrorBagProp, ErrorProp, FormLayoutProp, HelperProp, IdProp, LabelProp, RequiredProp, WidthProp } from "../vocabulary/index.js"; /** Schema passed to useZodForm — must be Zod 4 object schema. */ export type ZodSchemaProp = T; /** Options for useZodForm (resolver injected automatically). */ export type UseZodFormOptionsProp = Omit, "resolver">; /** Return type of useZodForm. */ export type UseZodFormReturnProp = UseFormReturn; /** * Framework-agnostic form-state adapter — decouples `FormRoot`/`FormFieldControl` from any single * form library. The DS ships the built-in react-hook-form path (`form`), and an adapter lets a * SERVER-driven form library plug into the same auto-binding: Inertia's `useForm` * (`@godxjp/ui/inertia`), formik, or TanStack Form. */ export interface FormStateAdapter { /** Current value of the field `name` (dotted paths allowed if the underlying store supports them). */ getValue(name: string): unknown; /** Write `value` back to the field `name` (e.g. Inertia's `setData(name, value)`). */ setValue(name: string, value: unknown): void; /** Server/validation error message for `name`, or undefined when the field is valid. */ getError(name: string): string | undefined; /** True while a submit is in flight (e.g. Inertia's `processing`) — drives submit-button loading. */ isSubmitting: boolean; /** Optional blur handler (e.g. touch-tracking); called with the field name. */ onBlur?(name: string): void; getValues?(): unknown; /** * Restore the store's initial values (e.g. Inertia's `form.reset()`). `FormRoot` calls it for a * native `