"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" import { useDialogFocus } from "@/components/ui/use-dialog-focus" function Dialog({ ...props }: React.ComponentProps) { 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, onOpenAutoFocus, onCloseAutoFocus, ...props }: React.ComponentProps & { showCloseButton?: boolean }) { const focus = useDialogFocus() return ( { focus.onOpenAutoFocus(); onOpenAutoFocus?.(event) }} onCloseAutoFocus={event => { onCloseAutoFocus?.(event); if (!event.defaultPrevented) focus.onCloseAutoFocus(event) }} className={cn( "fixed top-1/2 left-1/2 z-50 block w-full max-w-[calc(100%-2rem)] max-h-[calc(100dvh-2rem)] overflow-y-auto -translate-x-1/2 -translate-y-1/2 space-y-4 rounded-lg border bg-background p-6 shadow-lg duration-200 sm:max-w-lg", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", className )} {...props} > {children} {showCloseButton && ( Schließen )} ) } function DialogHeader({ className, ...props }: React.ComponentProps<"div">) { return (
) } /** Scrollbarer Mittelteil für lange Dialoge – hebt das Padding des Contents auf. */ function DialogBody({ 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, DialogBody, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, }