UNPKG

@navinc/base-react-components

Version:
66 lines (65 loc) 2.15 kB
/// <reference types="react" /> declare type AddressType = { street1: string; street2?: string; city: string; state: string; zip: string; country?: string; }; declare type InputOptionType = { name: string; label: string; placeholder: string; }; declare type AddressInputs = Record<keyof AddressType, InputOptionType>; export declare type AddressAutocompleteProps = { /** Required accessibility legend for the fieldset. Use `hideLegend` prop if you don't want this shown. */ groupLabel?: string; /** Lists territories in the state select dropdown */ withTerritories?: boolean; /** Shows a disabled "Country" input */ withCountry?: boolean; /** Changes the spelling of the state options */ stateFormat?: 'long' | 'short'; className?: string; /** Object to override input name, label, and placeholder. Input `name` is associated to the key in the parent form values. */ addressInputs?: AddressInputs; /** Visually hides the fieldset legend. */ hideLegend?: boolean; }; export declare const defaultInputOptions: { street1: { name: string; label: string; placeholder: string; }; street2: { name: string; label: string; placeholder: string; }; city: { name: string; label: string; placeholder: string; }; state: { name: string; label: string; placeholder: string; }; zip: { name: string; label: string; placeholder: string; }; country: { name: string; label: string; placeholder: string; }; }; export declare const AddressAutocomplete: ({ groupLabel, withTerritories, withCountry, stateFormat, className, addressInputs, hideLegend, ...rest }: AddressAutocompleteProps) => JSX.Element; declare const _default: import("styled-components").StyledComponent<({ groupLabel, withTerritories, withCountry, stateFormat, className, addressInputs, hideLegend, ...rest }: AddressAutocompleteProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>; export default _default;