{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "extends": "none",
  "name": "dialog",
  "title": "dialog",
  "description": "dialog",
  "dependencies": [
    "@heroicons/react",
    "react-aria-components",
    "tailwind-merge"
  ],
  "registryDependencies": [
    "https://intentui.com/r/primitive",
    "https://intentui.com/r/button"
  ],
  "files": [
    {
      "path": "src/components/ui/dialog.tsx",
      "content": "'use client'\n\nimport { XMarkIcon } from '@heroicons/react/24/solid'\nimport { Button as PrimitiveButton } from 'react-aria-components/Button'\nimport { Dialog as PrimitiveDialog } from 'react-aria-components/Dialog'\nimport { Heading, type HeadingProps } from 'react-aria-components/Heading'\nimport type { TextProps } from 'react-aria-components/Text'\nimport { twMerge } from 'tailwind-merge'\nimport { cx } from '@/lib/primitive'\nimport { Button, type ButtonProps } from './button'\n\nconst Dialog = ({\n  role = 'dialog',\n  className,\n  ...props\n}: React.ComponentProps<typeof PrimitiveDialog>) => {\n  return (\n    <PrimitiveDialog\n      data-slot=\"dialog\"\n      role={role}\n      className={twMerge(\n        'peer/dialog group/dialog relative flex max-h-[calc(var(--visual-viewport-height)-var(--visual-viewport-vertical-padding))] flex-col overflow-hidden outline-hidden [--gutter:--spacing(6)] sm:[--gutter:--spacing(8)]',\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nconst DialogTrigger = ({ className, ...props }: ButtonProps) => (\n  <PrimitiveButton className={cx('cursor-pointer', className)} {...props} />\n)\n\ninterface DialogHeaderProps extends Omit<React.ComponentProps<'div'>, 'title'> {\n  title?: string\n  description?: string\n}\n\nconst DialogHeader = ({ className, ...props }: DialogHeaderProps) => {\n  return (\n    <div\n      data-slot=\"dialog-header\"\n      className={twMerge(\n        'relative space-y-1 p-(--gutter) pb-[calc(var(--gutter)---spacing(3))]',\n        className\n      )}\n    >\n      {props.title && <DialogTitle>{props.title}</DialogTitle>}\n      {props.description && <DialogDescription>{props.description}</DialogDescription>}\n      {!props.title && typeof props.children === 'string' ? (\n        <DialogTitle>{props.children}</DialogTitle>\n      ) : (\n        props.children\n      )}\n    </div>\n  )\n}\n\ninterface DialogTitleProps extends HeadingProps {\n  ref?: React.Ref<HTMLHeadingElement>\n}\nconst DialogTitle = ({ className, ref, ...props }: DialogTitleProps) => (\n  <Heading\n    slot=\"title\"\n    ref={ref}\n    className={twMerge('text-balance font-semibold text-fg text-lg/6 sm:text-base/6', className)}\n    {...props}\n  />\n)\n\ninterface DialogDescriptionProps extends TextProps {\n  ref?: React.Ref<HTMLDivElement>\n}\nconst DialogDescription = ({ className, ref, ...props }: DialogDescriptionProps) => (\n  <p\n    data-slot=\"description\"\n    className={twMerge(\n      'text-pretty text-base/6 text-muted-fg group-disabled:opacity-50 sm:text-sm/6',\n      className\n    )}\n    ref={ref}\n    {...props}\n  />\n)\n\ninterface DialogBodyProps extends React.ComponentProps<'div'> {}\nconst DialogBody = ({ className, ...props }: DialogBodyProps) => (\n  <div\n    data-slot=\"dialog-body\"\n    className={twMerge(\n      'isolate flex min-h-0 flex-1 flex-col overflow-auto px-(--gutter) py-1',\n      '**:data-[slot=dialog-footer]:px-0 **:data-[slot=dialog-footer]:pt-0',\n      className\n    )}\n    {...props}\n  />\n)\n\ninterface DialogFooterProps extends React.ComponentProps<'div'> {}\nconst DialogFooter = ({ className, ...props }: DialogFooterProps) => {\n  return (\n    <div\n      data-slot=\"dialog-footer\"\n      className={twMerge(\n        'isolate mt-auto flex flex-col-reverse justify-end gap-3 p-(--gutter) pt-[calc(var(--gutter)---spacing(2))] group-not-has-data-[slot=dialog-body]/dialog:pt-0 group-not-has-data-[slot=dialog-body]/popover:pt-0 sm:flex-row',\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nconst DialogClose = ({ intent = 'plain', ref, ...props }: ButtonProps) => {\n  return <Button slot=\"close\" ref={ref} intent={intent} {...props} />\n}\n\ninterface CloseButtonIndicatorProps extends Omit<ButtonProps, 'children'> {\n  className?: string\n  isDismissable?: boolean | undefined\n}\n\nconst DialogCloseIcon = ({ className, ...props }: CloseButtonIndicatorProps) => {\n  return props.isDismissable ? (\n    <PrimitiveButton\n      slot=\"close\"\n      className={cx(\n        'close absolute end-1 top-1 z-50 grid size-8 place-content-center rounded-xl hover:bg-secondary focus:bg-secondary focus:outline-hidden focus-visible:ring-1 focus-visible:ring-primary sm:end-2 sm:top-2 sm:size-7 sm:rounded-md',\n        className\n      )}\n    >\n      <XMarkIcon className=\"size-4\" />\n    </PrimitiveButton>\n  ) : null\n}\n\nexport type {\n  CloseButtonIndicatorProps,\n  DialogBodyProps,\n  DialogDescriptionProps,\n  DialogFooterProps,\n  DialogHeaderProps,\n  DialogTitleProps,\n}\nexport {\n  Dialog,\n  DialogBody,\n  DialogClose,\n  DialogCloseIcon,\n  DialogDescription,\n  DialogFooter,\n  DialogHeader,\n  DialogTitle,\n  DialogTrigger,\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}