/** * @license * Copyright 2026 Aglyn LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { type DialogProps } from '@mui/material/Dialog'; import type { SxProps, Theme } from '@mui/material/styles'; import type { KeyboardEvent, ReactNode } from 'react'; import { type LightboxAppearance } from './lightbox-appearance'; /** Why the dialog was asked to close. */ export type LightboxCloseReason = 'escapeKeyDown' | 'backdropClick' | 'closeButton'; /** The appearance every lightbox takes when an element sets none. */ export declare const DEFAULT_LIGHTBOX_APPEARANCE: LightboxAppearance; export interface LightboxDialogProps { open: boolean; onClose: () => void; /** The dialog's accessible name. Required: an unnamed dialog is a defect. */ label: string; /** The close control's accessible name. */ closeLabel?: string; appearance?: LightboxAppearance; /** * A chance to refuse one close: return `true` to keep the dialog open. The * Video uses it so `Escape` in full screen leaves full screen first. */ interceptClose?: (reason: LightboxCloseReason) => boolean; onKeyDown?: (event: KeyboardEvent) => void; /** * `false` when the content draws its own {@link LightboxCloseButton} — the * Video does, inside the frame that goes full screen. */ closeButton?: boolean; /** The frame's width rule when the appearance names no max width. */ maxWidth?: DialogProps['maxWidth']; fullWidth?: boolean; /** Extra styles for the paper — the Video's black ground, for one. */ paperSx?: SxProps; /** Extra styles for the close control. */ closeButtonSx?: SxProps; children?: ReactNode; } /** `prefers-reduced-motion` — the transitions drop to nothing under it. */ export declare function useLightboxReducedMotion(): boolean; export interface LightboxCloseButtonProps { onClick: () => void; label: string; appearance?: LightboxAppearance; sx?: SxProps; } /** The close control: the same one in every lightbox, styled by appearance. */ export declare function LightboxCloseButton(props: LightboxCloseButtonProps): import("react").JSX.Element; export declare namespace LightboxCloseButton { var displayName: string; } /** * The dialog. Mounted by a caller once armed; renders nothing while closed. */ export declare function LightboxDialog(props: LightboxDialogProps): import("react").JSX.Element; export declare namespace LightboxDialog { var displayName: string; } /** The frame's inner box, for content that wants the paper's full height. */ export declare function LightboxFrame(props: { children?: ReactNode; sx?: SxProps; }): import("react").JSX.Element; export default LightboxDialog;