From 2ef6e4162c26f47ee8f9944d46c308219ab9326f Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Thu, 2 Oct 2025 15:20:40 +0200 Subject: [PATCH] feat(ui): enhance dialog component with improved styling and optional close button - Add showCloseButton prop to DialogContent for conditional close button display - Improve overlay styling with better backdrop blur and opacity - Add explicit background color to dialog content - Reorganize imports for better code organization - Enhance accessibility with proper data-slot attributes - Improve visual consistency and user experience --- web/src/components/ui/dialog.tsx | 45 ++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/web/src/components/ui/dialog.tsx b/web/src/components/ui/dialog.tsx index 9fdda5c5..d9ccec91 100644 --- a/web/src/components/ui/dialog.tsx +++ b/web/src/components/ui/dialog.tsx @@ -1,8 +1,8 @@ "use client" +import * as React from "react" import * as DialogPrimitive from "@radix-ui/react-dialog" import { XIcon } from "lucide-react" -import * as React from "react" import { cn } from "@/lib/utils" @@ -38,7 +38,7 @@ function DialogOverlay({ ) { +}: React.ComponentProps & { + showCloseButton?: boolean +}) { return ( {children} - - - Close - + {showCloseButton && ( + + + Close + + )} ) @@ -122,15 +130,14 @@ function DialogDescription({ } export { - Dialog, - DialogClose, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogOverlay, - DialogPortal, - DialogTitle, - DialogTrigger + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogOverlay, + DialogPortal, + DialogTitle, + DialogTrigger, } -