{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "dialog",
"dependencies": [
"react-aria-components",
"class-variance-authority",
"lucide-react"
],
"registryDependencies": [
"@seamless/utils",
"@seamless/button"
],
"files": [
{
"path": "src/components/ui/dialog.tsx",
"content": "import type * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { XIcon } from \"lucide-react\"\nimport {\n Heading,\n ModalOverlay as ModalOverlayPrimitive,\n Modal as ModalPrimitive,\n Dialog as DialogPrimitive,\n DialogTrigger as DialogTriggerPrimitive,\n type ModalOverlayProps as ModalOverlayPrimitiveProps,\n type DialogTriggerProps as DialogTriggerPrimitiveProps,\n} from \"react-aria-components\"\n\nimport { cn, type Composed } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\nfunction DialogTrigger({ ...props }: DialogTriggerPrimitiveProps) {\n return \n}\n\nconst dialogVariants = cva(\n \"relative flex max-h-full w-full flex-col rounded-[14px] border border-border bg-popover bg-clip-padding text-sm text-popover-foreground shadow-float transition duration-300 ease-brand data-entering:translate-y-4 data-entering:opacity-0 data-exiting:translate-y-4 data-exiting:opacity-0\",\n {\n variants: {\n size: {\n sm: \"sm:max-w-sm\",\n md: \"sm:max-w-md\",\n lg: \"sm:max-w-lg\",\n xl: \"sm:max-w-2xl\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n }\n)\n\ntype DialogProps = Composed &\n VariantProps & {\n children: React.ReactNode\n showCloseButton?: boolean\n }\n\n/**\n * NOTE: the layered sibling of Sheet — same backdrop, same curve, same elevation, centred instead of\n * anchored. A Sheet is for a surface you work IN; a Dialog is for one decision you make and dismiss.\n *\n * CONSTRAINT: one at a time. Two stacked modals leave no way back to the first, and the POC's world\n * allows exactly one layer above the page.\n */\nfunction Dialog({\n className,\n children,\n size = \"md\",\n showCloseButton = true,\n ...props\n}: DialogProps) {\n return (\n \n \n \n {children}\n {showCloseButton && (\n \n \n Close\n \n )}\n \n \n \n )\n}\n\nfunction DialogClose({\n className,\n variant = \"outline\",\n size = \"default\",\n ...props\n}: React.ComponentProps) {\n return (\n \n )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: Omit, \"slot\">) {\n return (\n \n )\n}\n\nfunction DialogDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return (\n \n )\n}\n\n/** CONSTRAINT: the body owns the scroll — the header and footer stay put while a long form moves. */\nfunction DialogBody({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\n/** NOTE: the decision sits at the end of the reading order and at the end of the box. */\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nexport {\n Dialog,\n DialogBody,\n DialogClose,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n dialogVariants,\n type DialogProps,\n}\n",
"type": "registry:ui"
}
],
"type": "registry:ui"
}