@navinc/base-react-components
Version:
Nav's Pattern Library
19 lines (18 loc) • 1.06 kB
TypeScript
import { FocusEventHandler, ChangeEventHandler } from 'react';
import Input from '../input.js';
import { InferComponentProps } from '../types.js';
declare const createZipCodeValidator: ({ isRequired, requiredErrorMessage, minLengthErrorMessage, nineDigitLengthErrorMessage, }?: {
isRequired?: boolean | undefined;
requiredErrorMessage?: string | undefined;
minLengthErrorMessage?: string | undefined;
nineDigitLengthErrorMessage?: string | undefined;
}) => (zip: string) => [string] | void;
declare type ZipCodeInputProps = InferComponentProps<typeof Input> & Parameters<typeof createZipCodeValidator>[0] & {
name: string;
onBlur?: FocusEventHandler<HTMLInputElement>;
onChange?: ChangeEventHandler<HTMLInputElement>;
invalidOnTouched?: boolean;
restrictToFiveDigits?: boolean;
};
export declare const ZipCodeInput: ({ name, onBlur, onChange, invalidOnTouched, isRequired, requiredErrorMessage, minLengthErrorMessage, nineDigitLengthErrorMessage, restrictToFiveDigits, ...props }: ZipCodeInputProps) => JSX.Element;
export {};