import type { ReactNode, Ref } from "react"; export interface ContentOverlayProps { /** * Content to be passed into the overlay */ readonly children: ReactNode; /** * Title of overlay, appears in the header next to the close button. */ readonly title?: string; /** * Optional accessibilityLabel describing the overlay. * This will read out when the overlay is opened. * @default "Close {title} modal" */ readonly accessibilityLabel?: string; /** * Force overlay height to fill the screen. * Width not impacted. * @default false */ readonly fullScreen?: boolean; /** * Display the dismiss button in the header of the overlay. * @default false */ readonly showDismiss?: boolean; /** * If false, hides the handle and turns off dragging. * @default true */ readonly isDraggable?: boolean; /** * If true, automatically adjusts the overlay height to the content height. * This will disable the ability to drag the overlay to fullscreen when * `isDraggable` is true. * @default false */ readonly adjustToContentHeight?: boolean; /** * Allows taps to be registered behind keyboard if enabled * @default false */ readonly keyboardShouldPersistTaps?: boolean; /** * Enables scrolling in the content body of overlay */ readonly scrollEnabled?: boolean; /** * Set the background color of the modal window * @default "surface" */ readonly modalBackgroundColor?: ModalBackgroundColor; /** * Callback that is called when the overlay is closed. */ readonly onClose?: () => void; /** * Callback that is called when the overlay is opened. */ readonly onOpen?: () => void; /** * Callback that is called between overlay is closed and when the "x" button is pressed */ readonly onBeforeExit?: () => void; /** * Whether panning down on the content area closes the sheet. Set false to prevent the sheet from being closed by panning down. * Defaults to the resolved draggable state. */ readonly enablePanDownToClose?: boolean; /** * When `true`, `onBeforeExit` intercepts the dismiss button and back press * but does not disable drag. Drag-to-dismiss bypasses `onBeforeExit`. * @default false */ readonly allowDragWithBeforeExit?: boolean; /** * Whether pan on the content area drags the sheet. Set `false` to let * nested scrollables own the gesture. Defaults to the resolved draggable * state. */ readonly enableContentPanningGesture?: boolean; /** * Explicit snap points for the overlay (percentages or pixel values). * When provided, `adjustToContentHeight` is ignored and the sheet snaps * to these positions instead of the measured content height. */ readonly snapPoints?: (string | number)[]; /** * Boolean to show a disabled state * @default false */ readonly loading?: boolean; /** * Ref to the content overlay component. */ readonly ref?: Ref; } export type ModalBackgroundColor = "surface" | "background"; export type ContentOverlayRef = | { open?: () => void; close?: () => void; } | undefined;