@platformbuilders/fluid-react
Version:
Builders React for Fluid Design System
29 lines (28 loc) • 1.12 kB
TypeScript
import { ChangeEvent, FC, FocusEvent, InputHTMLAttributes, MouseEvent, ReactNode } from 'react';
import Icons from '../Icons';
type IconsType = keyof typeof Icons;
type VariantProps = {
variant?: 'default' | 'outlined';
};
export type TextInputType = InputHTMLAttributes<HTMLInputElement> & VariantProps & {
style?: any;
textInputStyle?: any;
maskOptions?: any;
label?: string;
message?: string;
error?: string;
name: string;
id: string;
maxLength?: number;
value: string;
autoFocus?: boolean;
iconRight?: IconsType | Exclude<ReactNode, string | IconsType>;
iconLeft?: IconsType;
onClickIconRight?: (event: MouseEvent<HTMLElement>) => void;
onClickIconLeft?: (event: MouseEvent<HTMLElement>) => void;
onChange: (e: Partial<ChangeEvent<any>>) => void;
onBlur?: (e: FocusEvent<HTMLInputElement | HTMLTextAreaElement> | ChangeEvent<HTMLDivElement>) => void;
onFocus?: ((e: FocusEvent<HTMLInputElement | HTMLTextAreaElement> | ChangeEvent<HTMLDivElement>) => void) | undefined;
};
declare const TextInput: FC<TextInputType>;
export default TextInput;