import { type InputProps } from '@hanzo/gui'; import { type ReactNode } from 'react'; export type FieldProps = Omit & { /** * What a person typed. * * Declared here rather than inherited. The engine's `InputProps` omits both of * these — it is written for two platforms and a change event is a web thing — * so a caller inherited nothing and the parameter widened to `any` without a * word from the compiler. This is a web surface; the event carries the * element, and the element is what every caller reads. */ onChange?: (e: React.ChangeEvent) => void; /** The same thing, already unwrapped, for a caller that wants the text. */ onChangeText?: (text: string) => void; /** What this control is for, read out with it. */ label: ReactNode; /** What a person needs to know before answering. Tied to the control, so a * screen reader reads it with the field rather than stranding it beside. */ help?: ReactNode; /** What is wrong with the answer. Saying so is also saying it is invalid. */ error?: ReactNode; /** * The word drawn beside the label for a question that may be left blank. * * The word itself and not a flag, because the word belongs to whoever has the * catalogue: this package ships no copy, and a boolean here would put an * English string in a component that cannot know the reader's language. It is * asked for rather than derived from `required`, because the mark is a claim * about a form — a screen where nothing is required marks nothing, and * `!required` would mark everything. */ optional?: ReactNode; /** Wrong without a sentence about it — a pattern the answer fails, say. */ invalid?: boolean; /** * The label names the control and is not drawn. * * For a control whose place on the screen already says what it does — the * field on a tab row narrows the list beside it — where a label above would be * a second heading in a row of headings. It is the label that goes, not the * naming: the element is still there, still bound, and still what a screen * reader reads out. There is no prop here that leaves a control nameless. */ unseen?: boolean; }; export declare function Field({ label, help, error, optional, invalid, unseen, id, disabled, readOnly, 'aria-describedby': elsewhere, ...rest }: FieldProps): import("react").JSX.Element; //# sourceMappingURL=field.d.ts.map