import { ReactElement, ReactNode } from 'react'; import { ModalOverlayProps } from 'react-aria-components'; import { ButtonProps } from '../Button'; type DialogPassthrough = Omit; type DialogActionBase = Omit; export type DialogPrimaryAction = DialogActionBase & { /** * Confirm intent. `"danger"` is the critical Button for a destructive * confirm. Defaults to `"primary"`. */ variant?: "primary" | "danger"; }; export type DialogProps = DialogPassthrough & { /** * Header title and accessible name (`aria-labelledby`). Required — a modal * must be labeled. */ title: string; /** * Element that opens the dialog. Omit when driving `isOpen` / `onOpenChange` * yourself (menu item, event, etc.). */ trigger?: ReactElement; /** Scrollable body; header and footer stay pinned. */ content: ReactNode; /** * Footer confirm as {@link Button} props (`size` always `medium`). The * dialog closes after `onPress`; for async work that must keep the modal * open, control `isOpen` and treat `onOpenChange` as a request. Omit with * {@link DialogProps.secondaryAction} for a footerless (X-only) dialog. */ primaryAction?: DialogPrimaryAction; /** * Footer dismiss (e.g. Cancel): always `secondary` at `medium`, left of * confirm. Closes after `onPress`. Omit for a single-action footer. */ secondaryAction?: DialogActionBase; className?: string; }; export {};