@navinc/base-react-components
Version:
Nav's Pattern Library
72 lines (71 loc) • 6.61 kB
TypeScript
import { ChangeEvent, ChangeEventHandler, FocusEventHandler } from 'react';
import { Select } from '../select.js';
import { InferComponentProps } from '../types.js';
type FormatType = 'long' | 'short';
type StateSelectProps = {
onBlur?: FocusEventHandler<HTMLSelectElement>;
onChange?: ChangeEventHandler<HTMLSelectElement>;
invalidOnTouched?: boolean;
format?: FormatType;
withTerritories?: boolean;
isRequired?: boolean;
} & InferComponentProps<typeof Select>;
export declare const getStates: (format: FormatType, withTerritories?: boolean) => {
label: "WA" | "AL" | "AK" | "AZ" | "AR" | "CA" | "CO" | "CT" | "DE" | "FL" | "GA" | "HI" | "ID" | "IL" | "IN" | "IA" | "KS" | "KY" | "LA" | "ME" | "MD" | "MA" | "MI" | "MN" | "MS" | "MO" | "MT" | "NE" | "NV" | "NH" | "NJ" | "NM" | "NY" | "NC" | "ND" | "OH" | "OK" | "OR" | "PA" | "RI" | "SC" | "SD" | "TN" | "TX" | "UT" | "VT" | "VA" | "WV" | "WI" | "WY" | "Alabama" | "Alaska" | "AS" | "American Samoa" | "Arizona" | "Arkansas" | "California" | "Colorado" | "Connecticut" | "Delaware" | "District of Columbia" | "Florida" | "Georgia" | "Guam" | "Hawaii" | "Idaho" | "Illinois" | "Indiana" | "Iowa" | "Kansas" | "Kentucky" | "Louisiana" | "Maine" | "Marshall Islands" | "Maryland" | "Massachusetts" | "Michigan" | "Micronesia" | "Minnesota" | "Mississippi" | "Missouri" | "Montana" | "Nebraska" | "Nevada" | "New Hampshire" | "New Jersey" | "New Mexico" | "New York" | "North Carolina" | "North Dakota" | "Northern Mariana Islands" | "Ohio" | "Oklahoma" | "Oregon" | "Palau" | "Pennsylvania" | "Puerto Rico" | "Rhode Island" | "South Carolina" | "South Dakota" | "Tennessee" | "Texas" | "U.S. Virgin Islands" | "Utah" | "Vermont" | "Virginia" | "Washington" | "West Virginia" | "Wisconsin" | "Wyoming" | "DC" | "GU" | "MH" | "FM" | "MP" | "PW" | "PR" | "VI";
value: "WA" | "AL" | "AK" | "AZ" | "AR" | "CA" | "CO" | "CT" | "DE" | "FL" | "GA" | "HI" | "ID" | "IL" | "IN" | "IA" | "KS" | "KY" | "LA" | "ME" | "MD" | "MA" | "MI" | "MN" | "MS" | "MO" | "MT" | "NE" | "NV" | "NH" | "NJ" | "NM" | "NY" | "NC" | "ND" | "OH" | "OK" | "OR" | "PA" | "RI" | "SC" | "SD" | "TN" | "TX" | "UT" | "VT" | "VA" | "WV" | "WI" | "WY" | "AS" | "DC" | "GU" | "MH" | "FM" | "MP" | "PW" | "PR" | "VI";
}[];
/**
* A default state select drowpdown component to render a list of states and territories (optional) in either abbr format or fully spelled out
*
* @deprecated This component is deprecated and will be removed in a future release. Avoid using it in new code.
*/
export declare const StateSelect: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<{
onBlur?: FocusEventHandler<HTMLSelectElement>;
onChange?: ChangeEventHandler<HTMLSelectElement>;
invalidOnTouched?: boolean;
format?: FormatType;
withTerritories?: boolean;
isRequired?: boolean;
} & InferComponentProps<import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<InferComponentProps<import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components/dist/types.js").Substitute<import("styled-components/dist/types.js").Substitute<import("styled-components/dist/types.js").Substitute<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;
}> & import("styled-components/dist/types.js").BaseObject, import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>>, import("styled-components/dist/types.js").BaseObject>, import("styled-components/dist/types.js").BaseObject>> & string>, "onChange" | "checked"> & {
label?: string;
hasSpaceForErrors?: boolean;
helperText?: string;
isInvalid?: boolean;
options?: (string | {
label: string;
value: string;
disabled?: boolean;
})[];
value?: string;
required?: boolean;
errors?: Array<string>;
lede?: string;
onChange?: (event: ChangeEvent<HTMLSelectElement>) => void;
placeholder?: string;
isPrivate?: boolean;
}, never>> & string & Omit<{
({ className, label, hasSpaceForErrors, helperText, isInvalid, options, value, required, errors, lede, onChange, placeholder, isPrivate, ...props }: Omit<InferComponentProps<import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components/dist/types.js").Substitute<import("styled-components/dist/types.js").Substitute<import("styled-components/dist/types.js").Substitute<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;
}> & import("styled-components/dist/types.js").BaseObject, import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>>, import("styled-components/dist/types.js").BaseObject>, import("styled-components/dist/types.js").BaseObject>> & string>, "onChange" | "checked"> & {
label?: string;
hasSpaceForErrors?: boolean;
helperText?: string;
isInvalid?: boolean;
options?: (string | {
label: string;
value: string;
disabled?: boolean;
})[];
value?: string;
required?: boolean;
errors?: Array<string>;
lede?: string;
onChange?: (event: ChangeEvent<HTMLSelectElement>) => void;
placeholder?: string;
isPrivate?: boolean;
}): import("react/jsx-runtime").JSX.Element;
displayName: string;
}, keyof import("react").Component<any, {}, any>>>, never>> & string & Omit<({ name, label, onChange, invalidOnTouched, format, withTerritories, isRequired, onBlur, ...props }: StateSelectProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>;
export {};