import { type HTMLAttributes, type ReactNode } from 'react'; import type { BrandMarkMotion } from '../_shared/brand-mark'; /** The form's one field. */ export declare const FORGOT_PASSWORD_FORM_FIELDS: readonly ["email"]; export type ForgotPasswordFormField = (typeof FORGOT_PASSWORD_FORM_FIELDS)[number]; /** What `onSubmit` receives once the email has passed its check. */ export interface ForgotPasswordFormValues { email: string; } /** The email to show when the form opens. */ export type ForgotPasswordFormInitialValues = Partial; /** Messages from the server, already translated: one for the email, * plus `form` for a message about the whole form, such as "too many * requests, try again later". */ export type ForgotPasswordFormErrors = Partial>; /** The host's own form field name, for a native form post. It is needed: * a field without a name is not posted. */ export type ForgotPasswordFormFieldNames = Record; export interface ForgotPasswordFormProps extends Omit, 'title' | 'onSubmit'> { /** Replaces the heading "Reset your password". Pass it translated. */ title?: string; /** * Replaces the line under the heading ("Enter the email linked to your * account and we will send a reset link."). Pass it translated. */ description?: string; /** * The heading's level. Default 1: this page usually has no other * heading. Pass 2 on a page that has its own `h1`. */ headingLevel?: 1 | 2 | 3; /** * Shows the Alfadocs mark above the heading, with the heading and its * line centred under it. Default true. */ showLogo?: boolean; /** How the mark arrives when the card opens. Default `assemble`. It * plays once and rests. */ logoMotion?: BrandMarkMotion; /** * Host content between the heading and the field, such as a notice. It * sits outside the form, so nothing in it is posted. */ children?: ReactNode; /** The email to show when the form opens. Read once. */ initialValues?: ForgotPasswordFormInitialValues; /** * Messages from the server, already translated. The email's message * shows on the field until the user changes it; `form` shows above the * field. When messages arrive, focus moves to the error summary at the * top of the form when the email has a message, or to the message * above the field when only that says something. * * Do not use a message to say that no account has the address: that * tells a stranger who has an account. Show `sent` for every address. */ errors?: ForgotPasswordFormErrors; /** * Shows the confirmation in place of the form: "Check your inbox". Set * it once the request has been accepted, whether or not an account * exists for the address. The confirmation says "if an account exists" * and never shows the address. */ sent?: boolean; /** * Adds "Back to sign in" under the card's content. A path on the same * site, or an address written in full. Anything else shows no link. */ loginHref?: string; /** Replaces the button's "Send reset link". Pass it translated. */ submitLabel?: string; /** * True while the host sends the email: the button shows a spinner and * a second submit is ignored. Set it inside `onSubmit`, before anything * is awaited: until it is true, a second press sends a second request. */ submitting?: boolean; /** For React hosts: called with the email once it has passed its * check. Not called when `fieldNames` is set. */ onSubmit?: (values: ForgotPasswordFormValues) => void; /** * For a native form post: the host's own field name, e.g. * `{ email: 'email' }`. When set, the input carries that name and the * browser posts the form. */ fieldNames?: ForgotPasswordFormFieldNames; /** * Where a native form post goes. Default: the current address. Only a * path, or an address on the page's own origin, is accepted: another * origin is never sent what the user typed, and the post then goes to * the current address. Does nothing without `fieldNames`. */ action?: string; /** * Extra hidden inputs posted with a native form, by name: a CSRF * token. Not used with `onSubmit`. A name that is also the one in * `fieldNames` is left out: the form's own field wins. */ hiddenFields?: Readonly>; } /** * The card that asks for a password reset link. Mount it on the * forgot-password page, inside `SignedOutFrame` or the host's own chrome. */ export declare const ForgotPasswordForm: import("react").ForwardRefExoticComponent>; //# sourceMappingURL=forgot-password-form.d.ts.map