import type { JSX, ValidComponent } from "@solidjs/web"; import { type FieldRootState, type FieldValidateFn, type FieldValidationMode, type FieldValidityData } from "../../internals/field-context.js"; import { type MaybeAccessor } from "../../internals/maybe-accessor.js"; import type { BaseUIComponentProps } from "../../internals/types.js"; export type { FieldRootState, FieldValidityData }; export interface FieldRootProps extends BaseUIComponentProps<"div", FieldRootState> { /** Tag/component to render. Defaults to `"div"`. */ as?: ValidComponent; /** * Whether the component should ignore user interaction. * Takes precedence over the `disabled` prop on the `` component. * @default false */ disabled?: MaybeAccessor; /** * Identifies the field when a form is submitted. * Takes precedence over the `name` prop on the `` component. */ name?: MaybeAccessor; /** * A function for custom validation. Return a string or an array of strings * with the error message(s) if the value is invalid, or `null` if the value * is valid. Asynchronous functions are supported, but they do not prevent * form submission when using `validationMode="onSubmit"`. */ validate?: FieldValidateFn | undefined; /** * Determines when the field should be validated. * * - `onSubmit`: triggers validation when the form is submitted, and * re-validates on change after submission. * - `onBlur`: triggers validation when the control loses focus. * - `onChange`: triggers validation on every change to the control value. * * @default 'onSubmit' */ validationMode?: MaybeAccessor; /** * How long to wait between `validate` callbacks if `validationMode="onChange"` * is used. Specified in milliseconds. * @default 0 */ validationDebounceTime?: MaybeAccessor; /** * Whether the field is invalid. Useful when the field state is controlled * by an external library. */ invalid?: MaybeAccessor; /** * Whether the field's value has been changed from its initial value. * Useful when the field state is controlled externally. */ dirty?: MaybeAccessor; /** * Whether the field has been touched. Useful when the field state is * controlled externally. */ touched?: MaybeAccessor; } /** * Groups all parts of the field. Renders a `
` element. * * Thin structural adapter over `createField` — composes the primitive and * bridges its api into the `FieldContext` shape that the descendant parts * (``, ``, etc.) consume. Also renders a * `` so label/control can discover each other without * manual id plumbing, and a `` so description/error * elements can contribute their ids to the control's `aria-describedby`. */ export declare function FieldRoot(props: FieldRootProps): JSX.Element; //# sourceMappingURL=field-root.d.ts.map