import { type ReactNode, type RefObject } from "react"; import { type IAccessibilityConfigBase } from "../../typings/accessibility.js"; interface IUiDialogContext { titleId: string; descriptionId: string; /** * Called by `UiDialogBody` from `useLayoutEffect` on mount; returns a * cleanup to call on unmount. The modal counts mounted bodies so * `aria-describedby` is set when at least one body is rendered and * cleared when the last one unmounts. */ registerBody: () => () => void; /** The size of the header (title and close button) */ size: UiModalDialogSize; } /** * @internal */ export declare function useUiDialogContext(): IUiDialogContext | null; /** * The size of the dialog's header: its title and close button. * * @internal */ export type UiModalDialogSize = "default" | "large"; /** * @internal */ export interface IUiModalDialogProps { /** Dialog content composed by the caller — typically `UiDialogHeader`, * an optional `UiDialogBody`, and `UiDialogFooter`. */ children: ReactNode; /** Confirmation styling adds a border and emphasizes the title and body. */ variant?: "default" | "confirmation"; /** Whether the modal is shown. */ isOpen: boolean; /** * Whether a press on the backdrop dismisses the modal. Defaults to `false` * so a stray click cannot discard what the user typed; dialogs that hold no * user input can opt in. */ closeOnOutsideClick?: boolean; /** Fires when the user dismisses via Esc, backdrop press, or `onClose` from inside. */ onClose: () => void; /** Card width in px. Defaults to 540. Ignored when `isFullscreen` is set. */ width?: number; /** The size of the header: its title and close button. Ignored when `isFullscreen` is set. */ size?: UiModalDialogSize; /** Initial keyboard focus target. Defaults to the first tabbable element. */ initialFocus?: RefObject; /** * Overrides for the dialog landmark's accessible name. Usually unnecessary — * the landmark auto-wires `aria-labelledby` to the `UiDialogHeader` title * via context. For headerless dialogs, pass `ariaLabel`; to point at an * external title, pass `ariaLabelledBy`. */ accessibilityConfig?: Pick & { /** Use alertdialog for confirmations that require an immediate response. */ role?: "dialog" | "alertdialog"; }; /** Test id forwarded to the overlay element. */ dataTestId?: string; /** Id of the dialog element, e.g. for the `aria-controls` of the button that opens it. */ id?: string; /** Whether the dialog fills the viewport instead of showing as a card, e.g. on mobile. */ isFullscreen?: boolean; } /** * Modal dialog — portal, dimmed backdrop, card chrome (radius, shadow, fill, * padding), focus management, Esc dismiss, and the dialog landmark * (`role="dialog"`, `aria-modal="true"`). Compose `UiDialogHeader`, * an optional `UiDialogBody`, and `UiDialogFooter` as children. * * @internal */ export declare function UiModalDialog({ children, variant, isOpen, onClose, width, size, initialFocus, closeOnOutsideClick, accessibilityConfig, dataTestId, id, isFullscreen, }: IUiModalDialogProps): import("react/jsx-runtime").JSX.Element | null; export {}; //# sourceMappingURL=UiModalDialog.d.ts.map