@storybook/design-system
Version:
Storybook design system
37 lines • 1.4 kB
TypeScript
import React from 'react';
interface FormErrorFieldProps {
onMouseEnter: () => void;
onMouseLeave: () => void;
onFocus: () => void;
onBlur: () => void;
error: (value: string) => string | void;
suppressErrorMessage: boolean;
}
interface GetFormErrorFieldPropsArgs {
id: string;
validate: (value: string) => string | void;
}
export interface GetErrorArgs extends GetFormErrorFieldPropsArgs {
value: string;
}
export interface FormErrorStateChildrenArgs {
onSubmit: Function;
getFormErrorFieldProps: (args: GetFormErrorFieldPropsArgs) => FormErrorFieldProps;
}
export interface FormErrorStateProps {
onSubmit: Function;
children: (args: FormErrorStateChildrenArgs) => JSX.Element;
suppressErrorMessages?: boolean;
}
export interface PureFormErrorStateProps extends FormErrorStateProps {
primaryFieldId: string;
onMouseEnter: (id: string) => void;
onMouseLeave: (id: string) => void;
onFocus: (id: string) => void;
onBlur: (id: string) => void;
getError: (args: GetErrorArgs) => void;
}
export declare const PureFormErrorState: ({ children, suppressErrorMessages, onSubmit, onMouseEnter, onMouseLeave, onBlur, onFocus, getError, primaryFieldId, }: PureFormErrorStateProps) => JSX.Element;
export declare const FormErrorState: React.FunctionComponent<FormErrorStateProps>;
export {};
//# sourceMappingURL=FormErrorState.d.ts.map