import React, { RefObject } from 'react'; import { IconProps } from '@components/Icon'; export interface TextFieldProps { /** Should the input be focused */ autoFocus?: boolean; /** Display the input label */ label?: string; /** Input element name */ name?: string; /** Input element placeholder text */ placeholder?: string; /** A helper text at the bottom of the input */ instruction?: string; /** The type of input field */ type?: 'email' | 'number' | 'password' | 'text' | 'tel' | 'url'; /** Value of the input */ value?: string; /** Whether or not the input is disabled */ disabled?: boolean; /** Whether or not the input is required */ required?: boolean; /** The input change event handler */ onChange?: (event: React.ChangeEvent) => void; /** An object with key as error message and value as predicate */ error?: Record; /** Max length of the input field */ maxLength?: number; /** Min length of the input field */ minLength?: number; /** Regex for matching pattern in the input field */ pattern?: string; /** Input title which is diplayed on hover and shows hints for invalid input when used with form validation */ title?: string; /** The name of the icon to add to the input field */ icon?: IconProps['name']; /** The input element ref */ inputRef?: RefObject; onBlur?: (event: React.FocusEvent) => void; onFocus?: (event: React.FocusEvent) => void; onKeyPress?: (event: React.KeyboardEvent) => void; } declare const TextField: ({ autoFocus, disabled, error, inputRef, instruction, label, maxLength, pattern, title, minLength, name, onBlur, onChange, onFocus, onKeyPress, placeholder, required, type, value, icon, ...other }: TextFieldProps & Omit, 'onChange' | 'onBlur' | 'onKeyPress' | 'onFocus'>) => JSX.Element; export default TextField;