import { ExtractStrict } from './utils'; export interface AutocompleteProps { /** * A hint as to the intended content of the field. * * When set to `on` (the default), this property indicates that the field should support * autofill, but you do not have any more semantic information on the intended * contents. * * When set to `off`, you are indicating that this field contains sensitive * information, or contents that are never saved, like one-time codes. * * Alternatively, you can provide value which describes the * specific data you would like to be entered into this field during autofill. * * @see Learn more about the set of {@link https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-detail-tokens|autocomplete values} supported in browsers. * * @default 'on' */ autocomplete?: AutocompleteField | `${AutocompleteSection} ${AutocompleteField}` | `${AutocompleteGroup} ${AutocompleteField}` | `${AutocompleteSection} ${AutocompleteGroup} ${AutocompleteField}` | 'on' | 'off'; } /** * The “section” scopes the autocomplete data that should be inserted * to a specific area of the page. * * Commonly used when there are multiple fields with the same autocomplete needs * in the same page. For example: 2 shipping address forms in the same page. */ export type AutocompleteSection = `section-${string}`; /** * The contact information group the autocomplete data should be sourced from. */ export type AutocompleteGroup = 'shipping' | 'billing'; /** * The contact information subgroup the autocomplete data should be sourced from. */ export type AutocompleteAddressGroup = 'fax' | 'home' | 'mobile' | 'pager'; export type AnyAutocompleteField = 'additional-name' | 'address-level1' | 'address-level2' | 'address-level3' | 'address-level4' | 'address-line1' | 'address-line2' | 'address-line3' | 'country-name' | 'country' | 'current-password' | 'email' | 'family-name' | 'given-name' | 'honorific-prefix' | 'honorific-suffix' | 'language' | 'name' | 'new-password' | 'nickname' | 'one-time-code' | 'organization-title' | 'organization' | 'photo' | 'postal-code' | 'sex' | 'street-address' | 'transaction-amount' | 'transaction-currency' | 'url' | 'username' | 'bday-day' | 'bday-month' | 'bday-year' | 'bday' | 'cc-additional-name' | 'cc-expiry-month' | 'cc-expiry-year' | 'cc-expiry' | 'cc-family-name' | 'cc-given-name' | 'cc-name' | 'cc-number' | 'cc-csc' | 'cc-type' | `${AutocompleteAddressGroup} email` | 'impp' | `${AutocompleteAddressGroup} impp` | 'tel' | 'tel-area-code' | 'tel-country-code' | 'tel-extension' | 'tel-local-prefix' | 'tel-local-suffix' | 'tel-local' | 'tel-national' | `${AutocompleteAddressGroup} tel` | `${AutocompleteAddressGroup} tel-area-code` | `${AutocompleteAddressGroup} tel-country-code` | `${AutocompleteAddressGroup} tel-extension` | `${AutocompleteAddressGroup} tel-local-prefix` | `${AutocompleteAddressGroup} tel-local-suffix` | `${AutocompleteAddressGroup} tel-local` | `${AutocompleteAddressGroup} tel-national`; export type TextAutocompleteField = ExtractStrict;