import type { ReactNode, RefObject } from "react"; export type DialogSize = "full" | "lg" | "md" | "sm" | "xl"; export type DialogProps = { /** * The scrolling body. Optional: a confirm dialog whose question is * its `heading` and whose answers are its `footer` has no body, and * the old chrome `Modal` (which extended ``'s DOM props) * allowed that — `Dialog` keeps it. */ children?: ReactNode; className?: string; /** The footer row. Buttons, usually. */ footer?: ReactNode; heading: string; headingLevel?: 2 | 3 | 4; /** * Escape and a backdrop press both close. Off for the one honest * case — a destructive confirm the user has to answer. */ /** * Which element takes the caret when the dialog opens. * * A dialog wrapping a form wants its first field, not the Close * button the focus manager would otherwise pick — and a consumer * cannot fix that from outside, because focusing in its own * effect races the manager and loses. Docket's capture dialog is * the case: every keystroke landed on "Close". */ initialFocus?: RefObject; isDismissable?: boolean; isVisible: boolean; /** * Every route out lands here: the close button, Escape, a backdrop * press. Wire it to a `useVisibility()`'s `hide`. */ onClose: () => void; size?: DialogSize; }; /** * `Modal` plus the chrome — heading, a Close button, a scrolling body, * an optional footer, and five sizes. This is what `Modal` *was* * before the M8 rebuild renamed it: a dialog is one kind of modal, so * it takes the specific name and hands the generic one back to the * base layer. * * Everything modal — the portal, the scrim, Escape and outside-press * dismiss, the focus trap, the scroll lock, the stacking — is `Modal`'s * (via `OverlayPanel`), so this component is just the box's contents * and the size class it wants that box to be. `SIZE_CLASS` is composed * over `Modal`'s default surface, which is why `full` carries * `rounded-none` to square off the base's `rounded-lg` at the viewport * edge. * * ### The accessible name * * `heading` is required and is a string, not a `ReactNode`. It names * both the visible header and — through `aria-labelledby` on the * modal — the dialog itself. A dialog with no name is announced as * "dialog" and nothing else, which is what every hand-rolled modal in * the inventory does. */ export declare const Dialog: ({ children, className, footer, heading, headingLevel, initialFocus, isDismissable, isVisible, onClose, size, }: DialogProps) => ReactNode; //# sourceMappingURL=Dialog.d.ts.map