{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dialog",
  "type": "registry:ui",
  "dependencies": [
    "@kobalte/core"
  ],
  "registryDependencies": [
    "@gc-solid/button"
  ],
  "files": [
    {
      "path": "ui/dialog.tsx",
      "content": "import type { Component, ComponentProps, JSX, ParentComponent, ValidComponent } from \"solid-js\"\nimport { mergeProps, Show, splitProps } from \"solid-js\"\n\nimport * as DialogPrimitive from \"@kobalte/core/dialog\"\nimport type { PolymorphicProps } from \"@kobalte/core/polymorphic\"\nimport { X } from \"lucide-solid\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\nconst Dialog: Component<DialogPrimitive.DialogRootProps> = (props) => (\n  <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n)\n\nconst DialogTrigger: ParentComponent<DialogPrimitive.DialogTriggerProps> = (props) => (\n  <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n)\n\nconst DialogClose = <T extends ValidComponent = \"button\">(\n  props: PolymorphicProps<T, DialogPrimitive.DialogCloseButtonProps<T>>\n) => <DialogPrimitive.CloseButton data-slot=\"dialog-close\" {...props} />\n\nconst DialogPortal: Component<DialogPrimitive.DialogPortalProps> = (props) => {\n  return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\ntype DialogOverlayProps<T extends ValidComponent = \"div\"> =\n  DialogPrimitive.DialogOverlayProps<T> & { class?: string | undefined }\n\nconst DialogOverlay = <T extends ValidComponent = \"div\">(\n  props: PolymorphicProps<T, DialogOverlayProps<T>>\n) => {\n  const [local, others] = splitProps(props as DialogOverlayProps, [\"class\"])\n  return (\n    <DialogPrimitive.Overlay\n      class={cn(\"cn-dialog-overlay fixed inset-0 isolate z-50\", local.class)}\n      data-slot=\"dialog-overlay\"\n      {...others}\n    />\n  )\n}\n\ntype DialogContentProps<T extends ValidComponent = \"div\"> =\n  DialogPrimitive.DialogContentProps<T> & {\n    class?: string | undefined\n    children?: JSX.Element\n    showCloseButton?: boolean\n  }\n\nconst DialogContent = <T extends ValidComponent = \"div\">(\n  rawProps: PolymorphicProps<T, DialogContentProps<T>>\n) => {\n  const props = mergeProps({ showCloseButton: true }, rawProps)\n  const [local, others] = splitProps(props as DialogContentProps, [\n    \"class\",\n    \"children\",\n    \"showCloseButton\"\n  ])\n  return (\n    <DialogPortal>\n      <DialogOverlay />\n      <DialogPrimitive.Content\n        class={cn(\n          \"cn-dialog-content -translate-x-1/2 -translate-y-1/2 fixed top-1/2 left-1/2 z-50 w-full\",\n          local.class\n        )}\n        data-slot=\"dialog-content\"\n        {...others}\n      >\n        {local.children}\n        <Show when={local.showCloseButton}>\n          <DialogPrimitive.CloseButton\n            as={Button}\n            class=\"cn-dialog-close\"\n            data-slot=\"dialog-close\"\n            size=\"icon\"\n            variant=\"ghost\"\n          >\n            <X />\n            <span class=\"sr-only\">Close</span>\n          </DialogPrimitive.CloseButton>\n        </Show>\n      </DialogPrimitive.Content>\n    </DialogPortal>\n  )\n}\n\nconst DialogHeader: Component<ComponentProps<\"div\">> = (props) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return (\n    <div\n      class={cn(\"cn-dialog-header flex flex-col\", local.class)}\n      data-slot=\"dialog-header\"\n      {...others}\n    />\n  )\n}\n\nconst DialogFooter: Component<ComponentProps<\"div\">> = (props) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return (\n    <div\n      class={cn(\n        \"cn-dialog-footer flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n        local.class\n      )}\n      data-slot=\"dialog-footer\"\n      {...others}\n    />\n  )\n}\n\ntype DialogTitleProps<T extends ValidComponent = \"h2\"> = DialogPrimitive.DialogTitleProps<T> & {\n  class?: string | undefined\n}\n\nconst DialogTitle = <T extends ValidComponent = \"h2\">(\n  props: PolymorphicProps<T, DialogTitleProps<T>>\n) => {\n  const [local, others] = splitProps(props as DialogTitleProps, [\"class\"])\n  return (\n    <DialogPrimitive.Title\n      class={cn(\"cn-dialog-title\", local.class)}\n      data-slot=\"dialog-title\"\n      {...others}\n    />\n  )\n}\n\ntype DialogDescriptionProps<T extends ValidComponent = \"p\"> =\n  DialogPrimitive.DialogDescriptionProps<T> & {\n    class?: string | undefined\n  }\n\nconst DialogDescription = <T extends ValidComponent = \"p\">(\n  props: PolymorphicProps<T, DialogDescriptionProps<T>>\n) => {\n  const [local, others] = splitProps(props as DialogDescriptionProps, [\"class\"])\n  return (\n    <DialogPrimitive.Description\n      class={cn(\"cn-dialog-description\", local.class)}\n      data-slot=\"dialog-description\"\n      {...others}\n    />\n  )\n}\n\nexport {\n  Dialog,\n  DialogTrigger,\n  DialogClose,\n  DialogContent,\n  DialogHeader,\n  DialogFooter,\n  DialogTitle,\n  DialogDescription\n}\n",
      "type": "registry:ui"
    }
  ]
}