/** * Shared constants and pure helpers for `` / `
` validity. * * Mirrors Base UI React's * `packages/react/src/internals/field-constants/constants.ts` and * `packages/react/src/field/utils/getCombinedFieldValidityData.ts`, kept in * one module so the solid port can import everything from a single path. */ /** * Validity snapshot for a field. Mirrors the HTML `ValidityState` surface, * plus Base UI's `valid` overall flag (tri-state: `true`/`false`/`null` * meaning "not yet validated"). */ export interface FieldValidityState { badInput: boolean; customError: boolean; patternMismatch: boolean; rangeOverflow: boolean; rangeUnderflow: boolean; stepMismatch: boolean; tooLong: boolean; tooShort: boolean; typeMismatch: boolean; valid: boolean | null; valueMissing: boolean; } export declare const DEFAULT_VALIDITY_STATE: FieldValidityState; /** * Entire payload we keep per-field: the last-seen value, the initial value, * the computed validity state and the flat error list (both the canonical * first error and the full array of errors emitted by `validate`). */ export interface FieldValidityData { state: FieldValidityState; errors: string[]; error: string; value: unknown; initialValue: unknown; } export declare const DEFAULT_FIELD_STATE_ATTRIBUTES: { readonly valid: boolean | null; readonly touched: false; readonly dirty: false; readonly filled: false; readonly focused: false; }; export interface FieldRootState { disabled: boolean; valid: boolean | null; touched: boolean; dirty: boolean; filled: boolean; focused: boolean; } export declare const DEFAULT_FIELD_ROOT_STATE: FieldRootState; export type FieldValidationMode = "onBlur" | "onChange" | "onSubmit"; /** * `data-*` projection for the validity portion of the field state. The * `valid` slot is tri-state (`true`/`false`/`null`): the `null` case means * "not yet validated" and MUST not emit any attribute, so nothing can lean * on `data-valid=""` until a commit has landed. */ export declare const fieldValidityMapping: { readonly valid: (value: boolean | null) => Record | null; }; /** * Merge a field's internally-tracked validity with the externally-supplied * `invalid` prop. A field is considered valid only if both agree — external * `invalid=true` forces an invalid state regardless of the client-side check. */ export declare function getCombinedFieldValidityData(validityData: FieldValidityData, invalid: boolean | undefined): FieldValidityData; /** * Pure factory for a blank `FieldValidityData`. Mirrors the constant object * React uses as the context default, but fresh each call so mutable code * paths can't alias the shared instance. */ export declare function createDefaultValidityData(initialValue?: unknown): FieldValidityData; //# sourceMappingURL=field-constants.d.ts.map