UNPKG

579 BTypeScriptView Raw
1import { Context } from 'react';
2import { FormControlProps } from './FormControl';
3
4// shut off automatic exporting
5export {};
6
7type ContextFromPropsKey =
8 | 'disabled'
9 | 'error'
10 | 'fullWidth'
11 | 'hiddenLabel'
12 | 'margin'
13 | 'required'
14 | 'variant';
15
16export interface FormControlState extends Pick<FormControlProps, ContextFromPropsKey> {
17 adornedStart: boolean;
18 filled: boolean;
19 focused: boolean;
20 onBlur: () => void;
21 onEmpty: () => void;
22 onFilled: () => void;
23 onFocus: () => void;
24}
25
26export default function useFormControl(): FormControlState | undefined;