import * as React from 'react'; import { View } from 'react-native'; import type { ZestUIComponentProps } from '../../types'; /** * Groups a label, a control, and its description/error messages, wiring them * together for assistive technology and running validation. * Renders a ``. * * **Adapted from upstream, not a verbatim port.** React Native has no HTML * constraint validation (`ValidityState`) and no form submission, so the * `validity` object collapses to `valid` + `errors`, and `name`/`Form` * integration are dropped. `validate` — a function returning an error message, * a list of them, or `null` — is what drives validity. */ export declare function FieldRoot(componentProps: FieldRoot.Props): React.JSX.Element; export interface FieldRootState { /** * Whether the field is disabled. */ disabled: boolean; /** * Whether the control passed validation. `null` before it has run. */ valid: boolean | null; /** * Whether the control has been touched (blurred at least once). */ touched: boolean; /** * Whether the control's value has changed from its initial value. */ dirty: boolean; /** * Whether the control has a non-empty value. */ filled: boolean; /** * Whether the control is focused. */ focused: boolean; } export interface FieldRootProps extends ZestUIComponentProps { /** * A validation function. Return an error message, a list of them, or `null` * when the value is valid. */ validate?: ((value: unknown) => string | string[] | null) | undefined; /** * When validation runs: as the value changes, or when the control blurs. * @default 'onBlur' */ validationMode?: 'onBlur' | 'onChange' | undefined; /** * How long to wait, in milliseconds, before running `validate` after a change. * Only applies to `validationMode="onChange"`; a blur or a form submitting * validates immediately and cancels anything pending. * * `0` validates on every keystroke, which is fine for a cheap synchronous * check and wasteful for anything else. * @default 0 */ validationDebounceTime?: number | undefined; /** * The field's name. Used for identity and labelling; there is no form * submission in React Native. */ name?: string | undefined; /** * Whether the field is disabled. * @default false */ disabled?: boolean | undefined; /** * Forces the field into an invalid state, regardless of validation. */ invalid?: boolean | undefined; /** * Controls the `dirty` state. */ dirty?: boolean | undefined; /** * Controls the `touched` state. */ touched?: boolean | undefined; } export declare namespace FieldRoot { type State = FieldRootState; type Props = FieldRootProps; } //# sourceMappingURL=FieldRoot.d.ts.map