"use client"; import * as React from "react"; import * as DialogPrimitive from "@radix-ui/react-dialog"; import { XIcon } from "lucide-react"; import { cn } from "@/lib/utils"; // Type-safe wrappers for Radix UI primitives (React 19 compatibility) const DialogContentPrimitive = DialogPrimitive.Content as React.ForwardRefExoticComponent< React.ComponentPropsWithoutRef & { children?: React.ReactNode; className?: string; } & React.RefAttributes >; const DialogClosePrimitive = DialogPrimitive.Close as React.ForwardRefExoticComponent< React.ComponentPropsWithoutRef & { children?: React.ReactNode; className?: string; } & React.RefAttributes >; const DialogTitlePrimitive = DialogPrimitive.Title as React.ForwardRefExoticComponent< React.ComponentPropsWithoutRef & { children?: React.ReactNode; className?: string; } & React.RefAttributes >; const DialogDescriptionPrimitive = DialogPrimitive.Description as React.ForwardRefExoticComponent< React.ComponentPropsWithoutRef & { children?: React.ReactNode; className?: string; title?: string; } & React.RefAttributes >; function Dialog({ ...props }: React.ComponentProps) { return ; } function DialogTrigger({ ...props }: React.ComponentProps) { return ; } function DialogPortal({ ...props }: React.ComponentProps) { return ; } function DialogClose({ ...props }: React.ComponentProps) { return ; } const DialogOverlayPrimitive = DialogPrimitive.Overlay as React.ForwardRefExoticComponent< React.ComponentPropsWithoutRef & { className?: string; } & React.RefAttributes >; function DialogOverlay({ className, ...props }: React.ComponentProps & { className?: string; }) { return ( ); } function DialogContent({ className, children, showCloseButton = true, compact = false, ...props }: React.ComponentProps & { showCloseButton?: boolean; compact?: boolean; }) { // Check if className contains a custom max-width const hasCustomMaxWidth = typeof className === "string" && className.includes("max-w-"); return ( {children} {showCloseButton && ( Close )} ); } function DialogHeader({ className, ...props }: React.ComponentProps<"div">) { return (
); } function DialogFooter({ className, ...props }: React.ComponentProps<"div">) { return (
); } function DialogTitle({ className, children, ...props }: React.ComponentProps & { children?: React.ReactNode; className?: string; }) { return ( {children} ); } function DialogDescription({ className, children, title, ...props }: React.ComponentProps & { children?: React.ReactNode; className?: string; title?: string; }) { return ( {children} ); } export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };