UNPKG

@spark-web/field

Version:

--- title: Field isExperimentalPackage: false ---

16 lines (15 loc) 674 B
/// <reference types="react" /> export declare type FieldState = { disabled: boolean; invalid: boolean; }; export declare type InputPropsDerivedFromField = { 'aria-describedby'?: string; 'aria-invalid': true | undefined; id: string; }; export declare type FieldContextType = [FieldState, InputPropsDerivedFromField]; export declare const FieldContext: import("react").Context<FieldContextType | null>; export declare const FieldContextProvider: import("react").Provider<FieldContextType | null>; export declare const FIELD_CONTEXT_ERROR_MESSAGE = "Input components must be inside a `Field`."; export declare function useFieldContext(): FieldContextType;