{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "quick-add",
  "title": "Quick Add Popover",
  "description": "A small form inside a popover for quickly adding items.",
  "registryDependencies": [
    "@buzzform/text",
    "@buzzform/select",
    "popover",
    "button",
    "sonner"
  ],
  "files": [
    {
      "path": "registry/shadcn/examples/quick-add.tsx",
      "content": "\"use client\";\n\nimport { useState } from \"react\";\nimport { toast } from \"sonner\";\nimport { defineSchema, type InferType } from \"@buildnbuzz/form-react\";\nimport {\n  Form,\n  FormContent,\n  FormFields,\n  FormSubmit,\n} from \"@/registry/shadcn/form\";\nimport {\n  Popover,\n  PopoverContent,\n  PopoverTrigger,\n} from \"@/components/ui/popover\";\nimport { Button } from \"@/components/ui/button\";\n\n// Quick add schema for popover - lightweight, single purpose\nconst quickAddSchema = defineSchema({\n  fields: [\n    {\n      type: \"text\",\n      name: \"title\",\n      label: \"Title\",\n      placeholder: \"e.g., Buy groceries\",\n      required: true,\n    },\n    {\n      type: \"select\",\n      name: \"priority\",\n      label: \"Priority\",\n      options: [\n        { value: \"low\", label: \"Low\" },\n        { value: \"medium\", label: \"Medium\" },\n        { value: \"high\", label: \"High\" },\n      ],\n      defaultValue: \"medium\",\n    },\n  ],\n});\n\ntype QuickAddSchema = InferType<typeof quickAddSchema.fields>;\n\nexport default function QuickAddPopover() {\n  const [open, setOpen] = useState(false);\n\n  const handleSubmit = async ({ value }: { value: unknown }) => {\n    const data = value as QuickAddSchema;\n    await new Promise((resolve) => setTimeout(resolve, 500));\n    toast(\"Task added!\", {\n      description: (\n        <pre className=\"mt-2 max-h-48 overflow-auto rounded-md bg-muted text-muted-foreground p-3 text-xs\">\n          <code>{JSON.stringify(data, null, 2)}</code>\n        </pre>\n      ),\n    });\n    setOpen(false);\n  };\n\n  return (\n    <Popover open={open} onOpenChange={setOpen}>\n      <PopoverTrigger render={<Button variant=\"outline\" size=\"sm\" />}>\n        + Quick Add\n      </PopoverTrigger>\n      <PopoverContent className=\"w-72\" align=\"start\">\n        <div className=\"space-y-3\">\n          <div>\n            <h4 className=\"font-medium text-sm\">Add Task</h4>\n            <p className=\"text-xs text-muted-foreground\">\n              Quickly add a new task to your list\n            </p>\n          </div>\n          <Form schema={quickAddSchema} onSubmit={handleSubmit}>\n            <FormContent className=\"space-y-3\">\n              <FormFields />\n              <FormSubmit size=\"sm\" className=\"w-full\">\n                Add Task\n              </FormSubmit>\n            </FormContent>\n          </Form>\n        </div>\n      </PopoverContent>\n    </Popover>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/buzzform/examples/quick-add.tsx"
    }
  ],
  "type": "registry:block"
}