UNPKG

@navinc/base-react-components

Version:
67 lines (66 loc) 5.32 kB
import { FocusEventHandler, ChangeEventHandler } from 'react'; import { Input } from '../input.js'; import { InferComponentProps } from '../types.js'; declare const createZipCodeValidator: ({ isRequired, label, requiredErrorMessage, minLengthErrorMessage, nineDigitLengthErrorMessage, }?: { isRequired?: boolean | undefined; label?: string | undefined; requiredErrorMessage?: string | undefined; minLengthErrorMessage?: string | undefined; nineDigitLengthErrorMessage?: string | undefined; }) => (zip: string) => [string] | void; type ZipCodeInputProps = InferComponentProps<typeof Input> & Parameters<typeof createZipCodeValidator>[0] & { name: string; onBlur?: FocusEventHandler<HTMLInputElement>; onChange?: ChangeEventHandler<HTMLInputElement>; invalidOnTouched?: boolean; restrictToFiveDigits?: boolean; }; /** * @deprecated This component is deprecated and will be removed in a future release. Avoid using it in new code. */ export declare const ZipCodeInput: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<InferComponentProps<import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<{ label?: string; hasSpaceForErrors?: boolean; helperIcon?: import("../index.js").IconName; helperLinkAction?: import("react").MouseEventHandler<HTMLDivElement>; helperText?: string; isStatic?: boolean; errors?: string[]; lede?: import("react").ReactNode; touched?: boolean; childrenBeforeErrors?: import("react").ReactNode; innerRef?: import("react").MutableRefObject<HTMLInputElement | null>; tooltipText?: string; isPrivate?: boolean; } & InferComponentProps<import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components/dist/types.js").Substitute<(import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement>) | (Omit<import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<import("react").Component<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, any, any>>), { isInvalid?: boolean; }>> & (string & (Omit<import("react").ComponentClass<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, any>, keyof import("react").Component<any, {}, any>> | Omit<import("react").FunctionComponent<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>>, keyof import("react").Component<any, {}, any>>))>, never>> & string & Omit<({ autoFocus, children, className, label, hasSpaceForErrors, helperIcon, helperLinkAction, helperText, isInvalid, isStatic, value, required, type, errors, lede, touched, placeholder, childrenBeforeErrors, innerRef, tooltipText, isPrivate, ...props }: { label?: string; hasSpaceForErrors?: boolean; helperIcon?: import("../index.js").IconName; helperLinkAction?: import("react").MouseEventHandler<HTMLDivElement>; helperText?: string; isStatic?: boolean; errors?: string[]; lede?: import("react").ReactNode; touched?: boolean; childrenBeforeErrors?: import("react").ReactNode; innerRef?: import("react").MutableRefObject<HTMLInputElement | null>; tooltipText?: string; isPrivate?: boolean; } & InferComponentProps<import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components/dist/types.js").Substitute<(import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement>) | (Omit<import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<import("react").Component<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, any, any>>), { isInvalid?: boolean; }>> & (string & (Omit<import("react").ComponentClass<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, any>, keyof import("react").Component<any, {}, any>> | Omit<import("react").FunctionComponent<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>>, keyof import("react").Component<any, {}, any>>))>) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>> & { isRequired?: boolean | undefined; label?: string | undefined; requiredErrorMessage?: string | undefined; minLengthErrorMessage?: string | undefined; nineDigitLengthErrorMessage?: string | undefined; } & { name: string; onBlur?: FocusEventHandler<HTMLInputElement>; onChange?: ChangeEventHandler<HTMLInputElement>; invalidOnTouched?: boolean; restrictToFiveDigits?: boolean; }, never>> & string & Omit<({ name, label, onBlur, onChange, invalidOnTouched, isRequired, requiredErrorMessage, minLengthErrorMessage, nineDigitLengthErrorMessage, restrictToFiveDigits, ...props }: ZipCodeInputProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>; export {};