import type React from 'react'; import type { Dialog as BaseDialog } from '@base-ui/react/dialog'; type FocusTarget = React.ComponentPropsWithoutRef['finalFocus']; export interface DialogProps { open?: boolean; onOpenChange?: (open: boolean) => void; onConfirm?: () => void; onCancel?: () => void; onClose?: () => void; title?: React.ReactNode; description?: React.ReactNode; content?: React.ReactNode; footer?: React.ReactNode; children?: React.ReactNode; confirmText?: React.ReactNode; cancelText?: React.ReactNode; confirmLoading?: boolean; confirmDisabled?: boolean; cancelDisabled?: boolean; showClose?: boolean; maskClosable?: boolean; escClosable?: boolean; appendTo?: HTMLElement | null; width?: number | string; className?: string; style?: React.CSSProperties; /** * Extra class name for the Dialog viewport (the full-screen container that * centers and pads the popup). Use this to customize the surrounding layout * from the outside, e.g. removing the default padding for a full-screen dialog. */ viewportClassName?: string; /** Inline style for the Dialog viewport. See `viewportClassName`. */ viewportStyle?: React.CSSProperties; /** * Determines the element to focus when the dialog is opened. * Passed through to Base UI `Dialog.Popup`. Defaults to Base UI behavior. */ initialFocus?: FocusTarget; /** * Determines the element to focus when the dialog is closed. * Pass `false` to disable the default return-focus behavior (e.g. when * the trigger is not a real focusable "opener" but an anchor element that * should not silently regain focus once the dialog closes). */ finalFocus?: FocusTarget; } export interface DialogOpenOptions extends Omit { onConfirm?: () => boolean | void | Promise; onCancel?: () => void; onClose?: () => void; }