import { type HTMLAttributes, type ReactNode } from 'react';
/** One problem in the summary. */
export interface ErrorSummaryItem {
/** What is wrong, already translated: the same words as the field's own
* message, so the two read as one. */
message: string;
/**
* The field's label, for a message that does not name its field, such
* as "This field is required.": the item then reads "First name: This
* field is required.". Pass it translated. Leave it out when the
* message already says which field it is about.
*/
label?: string;
/**
* Where the item's link leads: the `id` of the control, or of the
* element around it, such as the `FormField`. For an element that cannot
* take focus itself, the link moves focus to the control its label
* names, else to the first control inside it. Without a `targetId` the
* message shows as plain text: use that for a problem that belongs to no
* single field.
*/
targetId?: string;
/** The field's name, emitted as `data-error-field` on the item. */
field?: string;
}
export interface ErrorSummaryProps extends Omit, 'title'> {
/** The problems, in the order their fields appear. Nothing renders while
* the list is empty. */
errors: readonly ErrorSummaryItem[];
/** Replaces the heading "There is a problem". Pass it translated. */
title?: string;
/** A line between the heading and the list. Pass it translated. */
description?: ReactNode;
/** The heading's level: one below the heading of the form it sits in.
* Default 2. */
headingLevel?: 2 | 3 | 4 | 5 | 6;
/**
* Ids of other text read with the summary when it takes focus, after the
* description and before the list: a message about the whole form that
* shows outside the summary, say. Keep that message quiet (no live
* region) while the summary shows, or the two are read over each other.
*/
'aria-describedby'?: string;
}
/**
* Lists every problem with a form after a refused submit, at the top of
* the form. Move focus to it (its ref) each time a submit is refused.
*/
export declare const ErrorSummary: import("react").ForwardRefExoticComponent>;
//# sourceMappingURL=error-summary.d.ts.map