import { type ComponentProps } from 'react'; import { type ModalCloseReason } from '../core/modal.js'; /** * Unstyled Carbon `Modal` on the native `` + showModal() (top layer, inert page, focus trap, * Esc, focus return), the behaviour of the styled Modal without a single class. Controlled: * `onClose(reason)` reports `Close`, Esc, an outside click or a `
`; set `open` * to false to close (or don't, to keep it). First focus as Carbon: an `autoFocus` control, else the * first control in `Body`, else the first in `Footer`, else `Close`; an `alert` starts on the least * destructive footer action (one whose `data-kind` is not primary / danger). A `Body` that * overflows becomes a focusable region named by the `Title` (`data-scrollable`). The page doesn't * scroll while it is open. Over other overlays one Esc closes only the topmost (core/overlay.ts), and a * vetoed close (`open` left true) stays vetoed however often Esc is pressed. * * ```tsx * setOpen(false)}> * Delete file? * × * It can't be restored. * * * ``` */ export type { ModalCloseReason }; export interface RootProps extends Omit, 'open' | 'onClose' | 'role'> { open: boolean; onClose?: (reason: ModalCloseReason) => void; /** `role="alertdialog"` for confirmations that interrupt; `Body` becomes the description. */ alert?: boolean; /** A click on the backdrop asks to close (`'backdrop'`). Carbon: only a passive modal (no footer actions). */ closeOnOutsideClick?: boolean; } export declare function Root({ open, onClose, alert, closeOnOutsideClick, children, ref, ...rest }: Readonly): import("react").JSX.Element; /** The heading that names the dialog. */ export declare function Title({ id, children, ...rest }: Readonly>): import("react").JSX.Element; /** The content; focusable (and named by the title) while it overflows, so the keyboard can scroll it. */ export declare function Body({ id, ref, ...rest }: Readonly>): import("react").JSX.Element; /** The action buttons; an alert focuses the least destructive one first. */ export declare function Footer({ ref, ...rest }: Readonly>): import("react").JSX.Element; /** Asks to close (`'close-button'`); give it an `aria-label`. */ export declare function Close({ ref, ...rest }: Readonly, 'type'>>): import("react").JSX.Element;