{ "$schema": "https://blode.co/ui/schema/registry-item.json", "name": "dialog", "title": "Dialog", "author": "Matthew Blode", "description": "A modal window that overlays the main content and requires user interaction.", "dependencies": ["@base-ui/react"], "registryDependencies": ["button"], "files": [ { "path": "ui/dialog.tsx", "content": "\"use client\";\n\nimport { Dialog as DialogPrimitive } from \"@base-ui/react/dialog\";\nimport { XIcon } from \"blode-icons-react\";\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"@/components/ui/button\";\n\nconst Dialog = ({ ...props }: DialogPrimitive.Root.Props) => (\n \n);\n\nconst DialogTrigger = ({\n asChild,\n children,\n ...props\n}: DialogPrimitive.Trigger.Props & {\n asChild?: boolean;\n}) => {\n if (asChild && React.isValidElement(children)) {\n return ;\n }\n\n return (\n \n {children}\n \n );\n};\n\nconst DialogPortal = ({ ...props }: DialogPrimitive.Portal.Props) => (\n \n);\n\nconst DialogClose = ({\n asChild,\n children,\n ...props\n}: DialogPrimitive.Close.Props & {\n asChild?: boolean;\n}) => {\n if (asChild && React.isValidElement(children)) {\n return ;\n }\n\n return (\n \n {children}\n \n );\n};\n\nconst DialogOverlay = ({ className, ...props }: DialogPrimitive.Backdrop.Props) => (\n \n);\n\nconst DialogContent = ({\n className,\n children,\n showCloseButton = true,\n ...props\n}: DialogPrimitive.Popup.Props & {\n showCloseButton?: boolean;\n}) => (\n \n \n \n {children}\n {showCloseButton && (\n \n \n Close\n \n )}\n \n \n);\n\nconst DialogHeader = ({ className, ...props }: React.ComponentProps<\"div\">) => (\n \n);\n\nconst DialogFooter = ({\n className,\n showCloseButton = false,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n showCloseButton?: boolean;\n}) => (\n \n {children}\n {showCloseButton && (\n }>Close\n )}\n \n);\n\nconst DialogTitle = ({\n className,\n ...props\n}: React.ComponentProps) => (\n \n);\n\nconst DialogDescription = ({\n className,\n ...props\n}: React.ComponentProps) => (\n \n);\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n", "type": "registry:ui", "target": "" } ], "type": "registry:ui" }