{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "product-form",
  "title": "Product Form",
  "description": "Product quantity and pricing form with number field variants.",
  "registryDependencies": [
    "@buzzform/number",
    "card",
    "sonner"
  ],
  "files": [
    {
      "path": "registry/shadcn/examples/product-form.tsx",
      "content": "\"use client\";\n\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  Card,\n  CardContent,\n  CardDescription,\n  CardHeader,\n  CardTitle,\n} from \"@/components/ui/card\";\n\n// Product quantity and pricing form\nconst productSchema = defineSchema({\n  fields: [\n    {\n      type: \"number\",\n      name: \"quantity\",\n      label: \"Quantity\",\n      required: true,\n      min: 1,\n      max: 100,\n      defaultValue: 1,\n    },\n    {\n      type: \"number\",\n      name: \"price\",\n      label: \"Price\",\n      required: true,\n      min: 0,\n      precision: 2,\n      ui: {\n        prefix: \"$\",\n        variant: \"plain\",\n        thousandSeparator: \",\",\n        hideSteppers: true,\n      },\n    },\n    {\n      type: \"number\",\n      name: \"discount\",\n      label: \"Discount\",\n      min: 0,\n      max: 100,\n      defaultValue: 0,\n      ui: {\n        suffix: \"%\",\n        variant: \"stacked\",\n        step: 5,\n      },\n    },\n  ],\n});\n\ntype ProductSchema = InferType<typeof productSchema.fields>;\n\nexport default function ProductFormCard() {\n  const handleSubmit = async ({ value }: { value: unknown }) => {\n    const data = value as ProductSchema;\n    await new Promise((resolve) => setTimeout(resolve, 500));\n    toast(\"Order calculated!\", {\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  };\n\n  return (\n    <Card className=\"w-full max-w-md\">\n      <CardHeader>\n        <CardTitle>Product Order</CardTitle>\n        <CardDescription>\n          Configure quantity, price, and discount.\n        </CardDescription>\n      </CardHeader>\n      <CardContent>\n        <Form schema={productSchema} onSubmit={handleSubmit}>\n          <FormContent className=\"space-y-4\">\n            <FormFields />\n            <FormSubmit className=\"w-full\">Calculate Total</FormSubmit>\n          </FormContent>\n        </Form>\n      </CardContent>\n    </Card>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/buzzform/examples/product-form.tsx"
    }
  ],
  "type": "registry:block"
}