import { default as React } from 'react'; import { FieldValues, FieldPath } from 'react-hook-form'; import { default as IFieldProps } from './IFieldProps'; /** * Field — context provider with optional react-hook-form integration. * * **Composition mode** (no `name` prop): renders a `flex flex-col gap` wrapper * and provides an empty FieldContext. Layout is fully user-controlled via * `` or `` inside children. * * **Form integration mode** (`name` prop provided): wires RHF state into * FieldContext so descendants can consume it at any nesting depth: * - `` auto-receives `htmlFor={name}` from context * - `` auto-injects `field` props + `id` + `error` into the wrapped control * * @param props {@link IFieldProps} * @returns The Field context provider with layout wrapper * * @example * ```tsx * // Basic composition * * Name on Card * * * * * Enter your name as it appears on your card * * * ``` * * @example * ```tsx * // Form integration via FormProvider context *
* * Email Address * * *
* ``` * * @example * ```tsx * // Horizontal layout — label centers with input regardless of description/error below * * * Username * * Choose a unique username * * * ``` * * @example * ```tsx * // Grid alignment — user composes with Grid/GridCell * * * Email * * * * * * ``` * * @example * ```tsx * // Deep nesting — compound pattern works at any depth * * * Email *
* *
*
*
* ``` * * @example * ```tsx * // Custom render prop — full control, wrapped in FormControl (form integration) * ( * * )} /> * ``` * */ declare const Field: { = FieldPath>({ children, columnSpan, name, control, render, orientation, isLoading, }: IFieldProps): React.ReactElement; displayName: string; }; export default Field;