{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dialog",
  "title": "Dialog",
  "description": "Astro modal parts for focused tasks, forms, and detail views.",
  "dependencies": [
    "@data-slot/dialog",
    "@lucide/astro",
    "cn"
  ],
  "registryDependencies": [
    "@gnostic/button",
    "@gnostic/scroll-area"
  ],
  "files": [
    {
      "path": "packages/ui/src/components/ui/dialog/dialog-close.astro",
      "content": "---\nimport type { ComponentProps } from \"astro/types\"\nimport X from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"cn\"\nimport { Button } from \"../button/index.ts\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { class: className, ...props } = Astro.props\n---\n\n<Button\n  aria-label=\"Close dialog\"\n  class={cn(\"relative\", className)}\n  data-slot=\"dialog-close\"\n  {...props}\n>\n  {/* Slot allows for custom icons/components with fallback X icon */}\n  <slot>\n    <X />\n  </slot>\n</Button>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/dialog/dialog-close.astro"
    },
    {
      "path": "packages/ui/src/components/ui/dialog/dialog-content.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\n\nimport { cn } from \"cn\"\nimport { Button } from \"../button/index.ts\"\nimport DialogOverlay from \"./dialog-overlay.astro\"\nimport DialogPortal from \"./dialog-portal.astro\"\nimport type { DialogContentProps } from \"./types.ts\"\n\ntype Props = HTMLAttributes<\"div\"> & DialogContentProps\n\nconst {\n  class: className,\n  showCloseButton = true,\n  style,\n  ...props\n} = Astro.props\n\n// The footer bleeds into the default padding. Keep caller padding overrides.\nconst padded = cn(\"p-6\", className).split(/\\s+/).includes(\"p-6\")\n---\n\n<DialogPortal>\n  <DialogOverlay />\n  <div\n    data-slot=\"dialog-content\"\n    data-dialog-padded={padded ? \"\" : undefined}\n    hidden\n    class={cn(\"font-sans text-popover-foreground bg-popover fixed top-1/2 left-1/2 z-50 flex w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col gap-6 rounded-2xl border p-6 text-sm shadow-lg/5 transition-[scale,opacity] duration-200 outline-none not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] has-data-[slot=dialog-panel]:min-h-0 has-data-[slot=dialog-panel]:gap-0 has-data-[slot=dialog-panel]:p-0 data-ending-style:scale-98 data-ending-style:opacity-0 data-starting-style:scale-98 data-starting-style:opacity-0 sm:max-w-lg dark:before:shadow-[0_-1px_--theme(--color-white/6%)] @container/dialog\", className)}\n    style={`z-index: calc(var(--dialog-content-stack-index, 0) * 2 + 101);${style ? ` ${style}` : \"\"}`}\n    {...props}\n  >\n    {showCloseButton && (\n      <Button\n        type=\"button\"\n        data-slot=\"dialog-close\"\n        data-dialog-dismiss\n        variant=\"ghost\"\n        size=\"icon-sm\"\n        class=\"absolute top-4 right-4\"\n      >\n        <XIcon />\n        <span class=\"sr-only\">Close</span>\n      </Button>\n    )}\n    <slot />\n  </div>\n</DialogPortal>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/dialog/dialog-content.astro"
    },
    {
      "path": "packages/ui/src/components/ui/dialog/dialog-description.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"p\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<p\n  data-slot=\"dialog-description\"\n  class={cn(\"text-muted-foreground text-sm\", className)}\n  {...props}\n>\n  <slot />\n</p>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/dialog/dialog-description.astro"
    },
    {
      "path": "packages/ui/src/components/ui/dialog/dialog-footer.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\nimport DialogClose from \"./dialog-close.astro\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n  showCloseButton?: boolean\n}\n\nconst { class: className, showCloseButton = false, ...props } = Astro.props\n---\n\n<div\n  data-slot=\"dialog-footer\"\n  class={cn(\"bg-muted/72 flex flex-col-reverse gap-2 border-t px-6 py-4 in-[[data-slot=dialog-content]:has([data-slot=dialog-panel])]:mx-0 in-[[data-slot=dialog-content]:has([data-slot=dialog-panel])]:mb-0 in-[[data-slot=dialog-content][data-dialog-padded]]:-mx-6 in-[[data-slot=dialog-content][data-dialog-padded]]:-mb-6 sm:flex-row sm:justify-end sm:rounded-b-[calc(var(--radius-2xl)-1px)]\", className)}\n  {...props}\n>\n  <slot />\n  {showCloseButton && <DialogClose variant=\"outline\">Close</DialogClose>}\n</div>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/dialog/dialog-footer.astro"
    },
    {
      "path": "packages/ui/src/components/ui/dialog/dialog-header.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"div\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<div\n  data-slot=\"dialog-header\"\n  class={cn(\"flex flex-col gap-2 in-[[data-slot=dialog-content]:has([data-slot=dialog-panel])]:p-6 in-[[data-slot=dialog-content]:has([data-slot=dialog-panel])]:pb-3\", className)}\n  {...props}\n>\n  <slot />\n</div>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/dialog/dialog-header.astro"
    },
    {
      "path": "packages/ui/src/components/ui/dialog/dialog-overlay.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"div\">\n\nconst { class: className, style: styleProp, ...props } = Astro.props\n\nconst style =\n  typeof styleProp === \"string\"\n    ? `z-index: calc(var(--dialog-overlay-stack-index, 0) * 2 + 100); ${styleProp}`\n    : {\n        \"z-index\": \"calc(var(--dialog-overlay-stack-index, 0) * 2 + 100)\",\n        ...(styleProp ? styleProp : {}),\n      }\n---\n\n<div\n  data-slot=\"dialog-overlay\"\n  hidden\n  class={cn(\"fixed inset-0 z-50 bg-black/32 backdrop-blur-sm transition-opacity duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0\", className)}\n  style={style}\n  {...props}\n>\n  <slot />\n</div>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/dialog/dialog-overlay.astro"
    },
    {
      "path": "packages/ui/src/components/ui/dialog/dialog-panel.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { ScrollArea } from \"../scroll-area/index.ts\"\n\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n  scrollFade?: boolean\n}\n\nconst { class: className, scrollFade = false, ...props } = Astro.props\n---\n\n<ScrollArea overscrollContain scrollFade={scrollFade}>\n  <div\n    class={cn(\n      \"p-6 in-[[data-slot=dialog-content]:has([data-slot=dialog-footer]:not(.border-t):not([data-slot=dialog-footer]))]:pb-1 in-[[data-slot=dialog-content]:has([data-slot=dialog-header])]:pt-1\",\n      className,\n    )}\n    data-slot=\"dialog-panel\"\n    {...props}\n  >\n    <slot />\n  </div>\n</ScrollArea>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/dialog/dialog-panel.astro"
    },
    {
      "path": "packages/ui/src/components/ui/dialog/dialog-portal.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"div\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<div data-slot=\"dialog-portal\" class={cn(className)} {...props}>\n  <slot />\n</div>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/dialog/dialog-portal.astro"
    },
    {
      "path": "packages/ui/src/components/ui/dialog/dialog-title.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"h2\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<h2\n  data-slot=\"dialog-title\"\n  class={cn(\"font-heading text-xl leading-none font-semibold\", className)}\n  {...props}\n>\n  <slot />\n</h2>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/dialog/dialog-title.astro"
    },
    {
      "path": "packages/ui/src/components/ui/dialog/dialog-trigger.astro",
      "content": "---\nimport type { ComponentProps } from \"astro/types\"\n\nimport { Button } from \"../button/index.ts\"\n\ntype Props = ComponentProps<typeof Button>\n\nconst { ...props } = Astro.props\n---\n\n<Button data-slot=\"dialog-trigger\" {...props}>\n  <slot />\n</Button>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/dialog/dialog-trigger.astro"
    },
    {
      "path": "packages/ui/src/components/ui/dialog/dialog.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport type { DialogOptions } from \"./types.ts\"\n\ntype Props = HTMLAttributes<\"div\"> & DialogOptions\n\nconst {\n  class: className,\n  defaultOpen,\n  closeOnClickOutside,\n  closeOnEscape,\n  lockScroll,\n  alertDialog,\n  ...props\n} = Astro.props\n---\n\n<div\n  data-slot=\"dialog\"\n  data-default-open={defaultOpen}\n  data-close-on-click-outside={closeOnClickOutside}\n  data-close-on-escape={closeOnEscape}\n  data-lock-scroll={lockScroll}\n  data-alert-dialog={alertDialog}\n  class={className}\n  {...props}\n>\n  <slot />\n</div>\n\n<script>\n  import { create } from \"@data-slot/dialog\"\n  import type { DialogController } from \"@data-slot/dialog\"\n\n  const controllers: DialogController[] = []\n  const initialize = () => controllers.push(...create())\n  initialize()\n  document.addEventListener(\"astro:page-load\", initialize)\n  document.addEventListener(\"astro:before-swap\", () => {\n    for (const controller of controllers) controller.destroy()\n    controllers.length = 0\n  })\n</script>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/dialog/dialog.astro"
    },
    {
      "path": "packages/ui/src/components/ui/dialog/index.ts",
      "content": "export { default as Dialog } from './dialog.astro'\nexport { default as DialogPortal } from './dialog-portal.astro'\nexport { default as DialogOverlay } from './dialog-overlay.astro'\nexport { default as DialogPopup } from './dialog-content.astro'\nexport { default as DialogContent } from './dialog-content.astro'\nexport { default as DialogTrigger } from './dialog-trigger.astro'\nexport { default as DialogHeader } from './dialog-header.astro'\nexport { default as DialogTitle } from './dialog-title.astro'\nexport { default as DialogDescription } from './dialog-description.astro'\nexport { default as DialogFooter } from './dialog-footer.astro'\nexport { default as DialogClose } from './dialog-close.astro'\nexport { default as DialogPanel } from './dialog-panel.astro'\nexport type { DialogOptions, DialogContentProps } from './types.ts'\n",
      "type": "registry:file",
      "target": "~/src/components/ui/dialog/index.ts"
    },
    {
      "path": "packages/ui/src/components/ui/dialog/types.ts",
      "content": "import type { DialogOptions as DialogOptionsType } from '@data-slot/dialog'\n\n/** Dialog configuration rendered as data attributes. */\nexport type DialogOptions = Pick<\n    DialogOptionsType,\n    | 'defaultOpen'\n    | 'closeOnClickOutside'\n    | 'closeOnEscape'\n    | 'lockScroll'\n    | 'alertDialog'\n>\n\n/** Close control for the dialog panel. */\nexport type DialogContentProps = {\n    /**\n     * Whether to show the close button in the top right corner of the dialog.\n     *\n     * @default true\n     */\n    showCloseButton?: boolean\n}\n",
      "type": "registry:file",
      "target": "~/src/components/ui/dialog/types.ts"
    }
  ],
  "meta": {
    "framework": "astro",
    "source": "@gnostic/ui",
    "testedDependencies": {
      "@data-slot/dialog": "^1.1.2",
      "@lucide/astro": "^1.68.0",
      "cn": "0.5.2"
    }
  },
  "docs": "https://ui.gnosticai.com/components/dialog",
  "categories": [
    "ui"
  ],
  "type": "registry:ui"
}
