import React, { type ComponentProps, type ComponentType, type PropsWithChildren } from 'react'; export type ModalCloseEvent = KeyboardEvent | React.KeyboardEvent | React.MouseEvent; export type ModalCloseSource = 'overlay' | 'button' | 'escape'; export type ModalInitialFocusStrategy = 'dialog' | 'firstElement'; export type ModalProps = { /** Whether the modal is open. */ open: boolean; /** Class applied to the modal root div. */ className?: string; /** Stable ID for this modal instance. Generated when omitted. */ dialogId?: string; /** * Props forwarded to the dialog surface div. `className` is merged; `onKeyDown` runs first, and * `preventDefault()` in it skips the built-in Escape and Enter handling. */ dialogRootProps?: Omit, 'aria-label' | 'aria-labelledby' | 'aria-describedby' | 'role'>; /** Accessible label for the modal dialog. Ignored when aria-labelledby is provided. */ 'aria-label'?: string; /** ID of the element that labels the modal dialog. */ 'aria-labelledby'?: string; /** ID of the element that describes the modal dialog. */ 'aria-describedby'?: string; /** ARIA role for the modal dialog surface. */ role?: 'alertdialog' | 'dialog'; /** * Whether the dialog surface (`'dialog'`) or its first focusable descendant (`'firstElement'`) * receives initial focus. Defaults to `'firstElement'`. */ initialFocusStrategy?: ModalInitialFocusStrategy; /** * Returns the element to focus initially. It overrides `initialFocusStrategy`, and the dialog * surface is focused when it returns `null`. */ getInitialFocusElement?: (dialogElement: HTMLDivElement) => HTMLElement | null; /** Close button component rendered on the overlay when provided. */ CloseButtonOnOverlay?: ComponentType>; /** * Called when the modal closes itself (overlay click, close button, Escape or the modal * context's `close`), not when `open` turns false. */ onClose?: (event: ModalCloseEvent) => void; /** Called before closing; return `false` to prevent closing and `onClose`. */ onCloseAttempt?: (source: ModalCloseSource, event: ModalCloseEvent) => boolean; }; export declare const GlobalModal: ({ "aria-describedby": ariaDescribedby, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, children, className, CloseButtonOnOverlay, dialogId, dialogRootProps, getInitialFocusElement, initialFocusStrategy, onClose, onCloseAttempt, open, role, }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element | null; //# sourceMappingURL=GlobalModal.d.ts.map