"use client" import * as React from "react" import { useEffect } from "react" import { usePreventScroll } from "@react-aria/overlays" import { cn } from "../../utils/cn" /** * Sizing and the two-column editor layout moved to `ModalV2` (`size` prop + * `ModalV2TwoColumn`), which is where the focus trap, Escape stacking and * keyboard-inset handling already live. The class-string constants this file * used to export were copied per call site and drifted; a component owns the * scroll model instead. What remains here is the compact legacy dialog used by * the confirm modals that have not moved yet. */ interface ModalProps { isOpen: boolean onClose: () => void children: React.ReactNode className?: string } interface ModalContentProps { children: React.ReactNode className?: string } interface ModalHeaderProps { children: React.ReactNode className?: string } interface ModalTitleProps { children: React.ReactNode className?: string } interface ModalFooterProps { children: React.ReactNode className?: string } /** @deprecated Use ModalV2 from './modal-v2' instead. */ const Modal = React.forwardRef( ({ isOpen, onClose, children, className }, ref) => { // Shared ref-counted scroll lock (react-aria) — restores prior styles on // release instead of clobbering to 'unset'. usePreventScroll({ isDisabled: !isOpen }) // Handle Escape key (document-level: top-of-stack semantics for modals) useEffect(() => { const handleKeyDown = (event: KeyboardEvent) => { if (event.key === 'Escape') { onClose() } } if (isOpen) { document.addEventListener('keydown', handleKeyDown) return () => document.removeEventListener('keydown', handleKeyDown) } }, [isOpen, onClose]) if (!isOpen) return null return (
) } ) Modal.displayName = "Modal" /** @deprecated Use ModalV2Content from './modal-v2' instead. */ const ModalContent = React.forwardRef( ({ children, className }, ref) => (
{children}
) ) ModalContent.displayName = "ModalContent" /** @deprecated Use ModalV2Header from './modal-v2' instead. */ const ModalHeader = React.forwardRef( ({ children, className }, ref) => (
{children}
) ) ModalHeader.displayName = "ModalHeader" /** @deprecated Use ModalV2Title from './modal-v2' instead. */ const ModalTitle = React.forwardRef( ({ children, className }, ref) => (

{children}

) ) ModalTitle.displayName = "ModalTitle" /** @deprecated Use ModalV2Footer from './modal-v2' instead. */ const ModalFooter = React.forwardRef( ({ children, className }, ref) => (
{children}
) ) ModalFooter.displayName = "ModalFooter" export { Modal, ModalContent, ModalFooter, ModalHeader, ModalTitle }