@bothub-chat/ui
Version:
Bothub UI Components
40 lines (39 loc) • 1.59 kB
TypeScript
import React from 'react';
import { TextFieldStyled } from './styled';
import { TextFieldType, Variant } from './types';
export type TextFieldValueChangeEventHandler = (value: string) => unknown;
export interface TextFieldProps extends Omit<React.ComponentProps<typeof TextFieldStyled>, 'onChange' | 'onFocus' | 'onBlur' | 'onMouseEnter' | 'onMouseLeave' | '$fullWidth' | '$disabled' | 'autoFocus'> {
label?: string | boolean | React.ReactNode;
placeholder?: string;
value?: string;
defaultValue?: string;
error?: string | boolean;
fullWidth?: boolean;
startIcon?: React.ReactNode;
endIcon?: React.ReactNode;
name?: string;
type?: TextFieldType;
disabled?: boolean;
skeleton?: boolean;
readonly?: boolean;
variant?: Variant;
autoFocus?: boolean;
autoComplete?: React.ComponentProps<'input'>['autoComplete'];
inputStyles?: React.CSSProperties;
clearable?: boolean;
bigClearButton?: boolean;
onChange?: React.ChangeEventHandler<HTMLInputElement>;
onFocus?: React.FocusEventHandler<HTMLInputElement>;
onBlur?: React.FocusEventHandler<HTMLInputElement>;
onMouseEnter?: React.MouseEventHandler<HTMLInputElement>;
onMouseLeave?: React.MouseEventHandler<HTMLInputElement>;
onValueChange?: TextFieldValueChangeEventHandler;
onClearButtonClick?: () => void;
'aria-label'?: string;
clearAriaLabel?: string;
showPasswordAriaLabel?: string;
hidePasswordAriaLabel?: string;
}
export declare const TextField: React.FC<TextFieldProps>;
export * from './types';
export * from './styled';