@navinc/base-react-components
Version:
Nav's Pattern Library
67 lines (66 loc) • 2.04 kB
TypeScript
/// <reference types="react" />
type AddressType = {
street1: string;
street2?: string;
city: string;
state: string;
zip: string;
country?: string;
};
type InputOptionType = {
name: string;
label: string;
placeholder: string;
};
type AddressInputs = Record<keyof AddressType, InputOptionType>;
export 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;
/** adds classname and data attribute to redact PII data */
isPrivate?: 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: import("styled-components").StyledComponent<({ groupLabel, withTerritories, withCountry, stateFormat, className, addressInputs, hideLegend, isPrivate, ...rest }: AddressAutocompleteProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
export {};