UNPKG

@navinc/base-react-components

Version:
17 lines (16 loc) 916 B
import { ChangeEventHandler, FocusEventHandler } from 'react'; import Input from '../input.js'; import { InferComponentProps } from '../types.js'; export declare const createPhoneNumberValidator: ({ isRequired, requiredErrorMessage, lengthErrorMessage, }?: { isRequired?: boolean | undefined; requiredErrorMessage?: string | undefined; lengthErrorMessage?: string | undefined; }) => (phoneNumber: string) => [string] | void; declare type PhoneNumberInputProps = InferComponentProps<typeof Input> & Parameters<typeof createPhoneNumberValidator>[0] & { name: string; onBlur?: FocusEventHandler<HTMLInputElement>; onChange?: ChangeEventHandler<HTMLInputElement>; invalidOnTouched?: boolean; }; declare const PhoneNumberInput: ({ name, isRequired, onBlur, onChange, requiredErrorMessage, lengthErrorMessage, ...props }: PhoneNumberInputProps) => JSX.Element; export default PhoneNumberInput;