'use client'; import * as React from 'react'; import { Dialog as DialogPrimitive, DialogBackdrop as DialogBackdropPrimitive, DialogPanel as DialogPanelPrimitive, DialogTitle as DialogTitlePrimitive, Description as DialogDescriptionPrimitive, type DialogProps as DialogPrimitiveProps, type DialogBackdropProps as DialogBackdropPrimitiveProps, type DialogPanelProps as DialogPanelPrimitiveProps, type DialogTitleProps as DialogTitlePrimitiveProps, CloseButton, } from '@headlessui/react'; import { motion, AnimatePresence, type Transition, type HTMLMotionProps, } from 'motion/react'; import { cn } from '@workspace/ui/lib/utils'; import { X } from 'lucide-react'; type DialogProps = Omit< DialogPrimitiveProps, 'static' > & { className?: string; as?: TTag; }; function Dialog({ className, ...props }: DialogProps) { return ( {props?.open && ( )} ); } type DialogBackdropProps = DialogBackdropPrimitiveProps & { className?: string; as?: TTag; }; function DialogBackdrop( props: DialogBackdropProps, ) { const { className, as = motion.div, ...rest } = props; return ( ); } type FlipDirection = 'top' | 'bottom' | 'left' | 'right'; type DialogPanelProps = Omit, 'transition'> & Omit, 'children'> & { from?: FlipDirection; transition?: Transition; as?: TTag; }; function DialogPanel( props: DialogPanelProps, ) { const { children, className, as = motion.div, from = 'top', transition = { type: 'spring', stiffness: 150, damping: 25 }, ...rest } = props; const initialRotation = from === 'top' || from === 'left' ? '20deg' : '-20deg'; const isVertical = from === 'top' || from === 'bottom'; const rotateAxis = isVertical ? 'rotateX' : 'rotateY'; return ( {(bag) => ( <> {typeof children === 'function' ? children(bag) : children} Close )} ); } type DialogHeaderProps = React.ComponentProps & { as?: TTag; }; function DialogHeader({ className, as: Component = 'div', ...props }: DialogHeaderProps) { return ( ); } type DialogFooterProps = React.ComponentProps & { as?: TTag; }; function DialogFooter({ className, as: Component = 'div', ...props }: DialogFooterProps) { return ( ); } type DialogTitleProps = DialogTitlePrimitiveProps & { className?: string; as?: TTag; }; function DialogTitle({ className, ...props }: DialogTitleProps) { return ( ); } type DialogDescriptionProps = React.ComponentProps> & { className?: string; as?: TTag; }; function DialogDescription({ className, ...props }: DialogDescriptionProps) { return ( ); } export { Dialog, DialogBackdrop, DialogPanel, DialogTitle, DialogDescription, DialogHeader, DialogFooter, type DialogProps, type DialogBackdropProps, type DialogPanelProps, type DialogTitleProps, type DialogDescriptionProps, type DialogHeaderProps, type DialogFooterProps, };