{
  "$schema": "https://blode.co/ui/schema/registry-item.json",
  "name": "prompt",
  "title": "Prompt",
  "author": "Matthew Blode",
  "description": "A confirmation dialog that asks the user for input before proceeding.",
  "dependencies": ["@base-ui/react"],
  "registryDependencies": ["button"],
  "files": [
    {
      "path": "ui/prompt.tsx",
      "content": "\"use client\";\n\nimport { AlertDialog as AlertDialogPrimitive } from \"@base-ui/react/alert-dialog\";\nimport { isValidElement } from \"react\";\nimport type { ComponentProps, HTMLAttributes } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"@/components/ui/button\";\n\n/**\n * This component is based on the [Base UI Alert Dialog](https://base-ui.com/react/components/alert-dialog) primitives.\n */\nconst { Root } = AlertDialogPrimitive;\n\nconst Trigger = ({\n  asChild,\n  children,\n  ...props\n}: AlertDialogPrimitive.Trigger.Props & {\n  asChild?: boolean;\n}) => {\n  if (asChild && isValidElement(children)) {\n    return <AlertDialogPrimitive.Trigger render={children} {...props} />;\n  }\n\n  return <AlertDialogPrimitive.Trigger {...props}>{children}</AlertDialogPrimitive.Trigger>;\n};\n\nconst Portal = ({ ...props }: AlertDialogPrimitive.Portal.Props) => (\n  <AlertDialogPrimitive.Portal {...props} />\n);\n\nconst Overlay = ({ className, ...props }: ComponentProps<typeof AlertDialogPrimitive.Backdrop>) => (\n  <AlertDialogPrimitive.Backdrop\n    className={cn(\n      \"data-closed:fade-out-0 data-open:fade-in-0 fixed inset-0 z-110 bg-overlay backdrop-blur-[10px] data-closed:animate-out data-open:animate-in data-closed:duration-300 data-open:duration-500 motion-reduce:transition-none\",\n      className,\n    )}\n    {...props}\n  />\n);\n\nconst Title = ({ className, ...props }: ComponentProps<typeof AlertDialogPrimitive.Title>) => (\n  <AlertDialogPrimitive.Title className={cn(\"font-semibold text-lg\", className)} {...props} />\n);\n\nconst Content = ({ className, ...props }: ComponentProps<typeof AlertDialogPrimitive.Popup>) => (\n  <Portal>\n    <Overlay />\n    <AlertDialogPrimitive.Popup\n      className={cn(\n        \"data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 fixed top-[50%] left-[50%] z-110 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-2xl border bg-background p-4 shadow-lg duration-200 data-closed:animate-out data-open:animate-in md:w-full\",\n        className,\n      )}\n      {...props}\n    />\n  </Portal>\n);\n\nconst Description = ({\n  className,\n  ...props\n}: ComponentProps<typeof AlertDialogPrimitive.Description>) => (\n  <AlertDialogPrimitive.Description className={cn(className)} {...props} />\n);\n\nconst Action = ({\n  className,\n  children,\n  ...props\n}: Omit<ComponentProps<typeof AlertDialogPrimitive.Close>, \"render\">) => (\n  <AlertDialogPrimitive.Close\n    className={cn(className)}\n    render={<Button variant=\"destructive\">{children}</Button>}\n    {...props}\n  />\n);\n\nconst Cancel = ({\n  className,\n  children,\n  ...props\n}: Omit<ComponentProps<typeof AlertDialogPrimitive.Close>, \"render\">) => (\n  <AlertDialogPrimitive.Close\n    className={cn(className)}\n    render={<Button variant=\"secondary\">{children}</Button>}\n    {...props}\n  />\n);\n\n/**\n * This component is based on the `div` element and supports all of its props\n */\nconst Header = ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => (\n  <div className={cn(\"flex flex-col space-y-2 text-center\", className)} {...props} />\n);\n\n/**\n * This component is based on the `div` element and supports all of its props\n */\nconst Footer = ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => (\n  <div\n    className={cn(\"mt-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\", className)}\n    {...props}\n  />\n);\n\nconst Prompt = Object.assign(Root, {\n  Action,\n  Cancel,\n  Content,\n  Description,\n  Footer,\n  Header,\n  Title,\n  Trigger,\n});\n\nexport { Prompt };\n",
      "type": "registry:ui",
      "target": ""
    }
  ],
  "type": "registry:ui"
}
