import React from 'react'; import type { AriaTextFieldProps } from 'react-aria'; export type PasswordInputSize = 'sm' | 'md' | 'lg'; type PasswordInputDOMProps = Omit, keyof AriaTextFieldProps | 'size' | 'type' | 'disabled' | 'autoCapitalize' | 'spellCheck'>; export interface PasswordInputProps extends Omit, PasswordInputDOMProps { /** Input's sizes: Small, Medium, Large. */ size?: PasswordInputSize; /** * Default `current-password`. Pass `new-password` on a sign-up or change * form, so a password manager offers to generate one instead of filling * the old. */ autoComplete?: 'current-password' | 'new-password' | 'off'; /** Controlled: whether the password is shown. */ isRevealed?: boolean; /** Uncontrolled: whether it starts shown. Default false. */ defaultRevealed?: boolean; onRevealedChange?: (isRevealed: boolean) => void; /** * The toggle's name. It does not change with the state — `aria-pressed` * says whether it is on. Default "Show password". */ revealLabel?: string; /** Announced when the password is shown. Default "Password shown". */ shownMessage?: string; /** Announced when it is hidden again. Default "Password hidden". */ hiddenMessage?: string; /** Class names for the control box (`.ion-input`). */ className?: string; /** Class names for the `.ion-field` wrapper when a label or helper is shown. */ wrapperClassName?: string; } /** * PasswordInput — a password field with a way to see what was typed. * * THE TOGGLE IS A TOGGLE. Its name stays "Show password" and `aria-pressed` * says whether it is on, which is how a screen reader expects a toggle to * behave: a name that flips to "Hide password" reads as a different button. * A polite status beside it also says "Password shown" or "Password hidden" * when it changes, because some screen readers do not read a changed pressed * state aloud. It is a real tab stop, not the clear button's skipped one: it * has no keyboard shortcut to stand in for it. * * WHAT A SHOWN PASSWORD MUST NOT DO * * Go to a spellchecker. A shown password is `type="text"`, and browsers * spellcheck text fields, some by sending them to a server. Spellcheck, * autocorrect and autocapitalise are off whatever the state. * * Be submitted shown. A password manager recognises a login by its * `type="password"` field when the form is submitted; a shown one is not * offered for saving. Submitting the form hides it first. * * The box IS Input's — the same `.ion-input` classes as SearchField and * NumberInput — so a password field under an email field matches it. */ export declare const PasswordInput: React.ForwardRefExoticComponent>; export {}; //# sourceMappingURL=PasswordInput.d.ts.map