/** * `Field` — the label + description + error wrapper every form control sits in. * It owns one generated id and publishes it (plus the description/error ids and * the invalid flag) through a context; a nested control reads them via * `useFieldControl` and spreads them, so the label's `htmlFor`, the control's * `aria-describedby`, and its `aria-invalid` stay wired without the caller * threading ids by hand. */ import type { CSSProperties, ReactNode } from 'react'; /** The a11y wiring a form control spreads onto its element. */ export interface FieldControlProps { readonly id: string | undefined; readonly 'aria-describedby': string | undefined; readonly 'aria-invalid': true | undefined; } /** * Read the enclosing Field's wiring. * * `id` and `aria-describedby` are `undefined` both when there is no Field AND * inside a group `Field`: a group has no single element to carry them, and the * group container itself already carries the name and the description. Only * `aria-invalid` still crosses that boundary, because `role="group"` does not * support it (ARIA 1.2), so the control is the sole place an errored group can * expose its invalid state. */ export declare function useFieldControl(): FieldControlProps; export interface FieldProps { readonly label: string; readonly description?: string; readonly error?: string; readonly children: ReactNode; readonly style?: CSSProperties; /** APPENDED to `tai-field` rather than replacing it, so the field keeps its paint. */ readonly className?: string; /** * Set when the wrapped control is a GROUP rather than one labelable element — * a `RadioGroup`, a set of checkboxes, any `role="radiogroup"`/`role="group"` * panel. * * `