import { CSSProperties, ReactNode } from 'react'; import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types.js'; import { Presentation } from '../configProvider/presentation.types.js'; export type ModalSlots = 'container' | 'backdrop' | 'modal' | 'header' | 'title' | 'closeButton' | 'body' | 'footer'; /** Text Modal renders of its own, for translating it. */ export interface ModalLabels { /** Close button, read out by screen readers. */ close?: string; } export interface ModalProps extends Omit, 'title'> { children?: React.ReactNode; /** Heading in the header. Its text becomes the dialog's accessible name, unless `aria-label` is passed. */ title?: ReactNode; isOpen?: boolean; onClose?: () => void; /** Applied to the modal panel itself */ className?: string; style?: CSSProperties; /** Pinned below the scrolling body, so action buttons stay visible however long the content * is. Nothing is rendered when omitted. */ footer?: React.ReactNode; hideHeader?: boolean; /** Close on Escape while this is the topmost overlay. Default `true`. */ closeOnEscape?: boolean; /** Present as a bottom sheet, always or only on a small touch screen. `Presentation.Default` * (or omitting this) is the ordinary centred dialog. */ presentation?: Presentation; classNames?: SlotClassNames; styles?: SlotStyles; /** Overrides the text Modal renders of its own. Merged per key. */ labels?: ModalLabels; }