'use client'; import * as React from 'react'; import { XIcon } from '@/icons'; import { Dialog as DialogPrimitive } from 'radix-ui'; import { cn } from '@/lib/utils'; import { focusRing, iconSizing } from '@/lib/cva-presets'; export type DialogProps = React.ComponentProps; export interface DialogContentProps extends React.ComponentProps { /** Show the X in the top-right corner. Keep it unless the dialog is blocking. */ showCloseButton?: boolean; } /** * Modal dialog. Traps focus, closes on Escape, and returns focus to the * trigger on close. * * `DialogTitle` is required — Radix warns without one because screen readers * have nothing to announce. Wrap it in `` if the * design has no visible heading. */ function Dialog(props: DialogProps) { return ; } function DialogTrigger(props: React.ComponentProps) { return ; } function DialogPortal(props: React.ComponentProps) { return ; } function DialogClose(props: React.ComponentProps) { return ; } function DialogOverlay({ className, ...props }: React.ComponentProps) { return ( ); } function DialogContent({ className, children, showCloseButton = true, ...props }: DialogContentProps) { return ( {children} {showCloseButton && ( Close )} ); } function DialogHeader({ className, ...props }: React.ComponentProps<'div'>) { return (
); } function DialogFooter({ className, ...props }: React.ComponentProps<'div'>) { return (
); } function DialogTitle({ className, ...props }: React.ComponentProps) { return ( ); } function DialogDescription({ className, ...props }: React.ComponentProps) { return ( ); } export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };