{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ecommerce-checkout-form",
  "description": "Checkout form with shipping and payment details",
  "dependencies": [
    "react-hook-form",
    "@hookform/resolvers",
    "zod",
    "sonner"
  ],
  "registryDependencies": [
    "https://formscn.space/r/button.json",
    "https://formscn.space/r/card.json",
    "https://formscn.space/r/input.json",
    "https://formscn.space/r/label.json",
    "https://formscn.space/r/radio-group.json"
  ],
  "files": [
    {
      "path": "src/registry/default/templates/ecommerce-checkout-form.tsx",
      "content": "\"use client\";\n\nimport { useForm, Controller } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport * as z from \"zod\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"@/components/ui/card\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport { toast } from \"sonner\";\nimport { RadioGroup, RadioGroupItem } from \"@/components/ui/radio-group\";\n\nconst formSchema = z.object({\n  fullName: z.string().min(2, \"Full name is required\"),\n  email: z.string().email(\"Invalid email\"),\n  address: z.string().min(5, \"Address is required\"),\n  city: z.string().min(2, \"City is required\"),\n  zipCode: z.string().min(4, \"ZIP code is required\"),\n  paymentMethod: z.enum([\"credit_card\", \"paypal\", \"apple_pay\"]),\n});\n\ntype FormValues = z.infer<typeof formSchema>;\n\nexport function EcommerceCheckoutForm() {\n  const form = useForm<FormValues>({\n    resolver: zodResolver(formSchema),\n    defaultValues: {\n      fullName: \"\",\n      email: \"\",\n      address: \"\",\n      city: \"\",\n      zipCode: \"\",\n      paymentMethod: \"credit_card\",\n    },\n  });\n\n  const onSubmit = async (data: FormValues) => {\n    console.log(\"Form submitted:\", data);\n    toast.success(\"Form submitted successfully!\");\n  };\n\n  return (\n    <Card className=\"w-full max-w-md mx-auto\">\n      <CardHeader>\n        <CardTitle>Checkout</CardTitle>\n        <CardDescription>Checkout form with shipping and payment details</CardDescription>\n      </CardHeader>\n      <CardContent>\n        <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-4\">\n          <div className=\"space-y-2\">\n            <Label htmlFor=\"fullName\">Full Name</Label>\n            <Input\n              id=\"fullName\"\n              type=\"text\"\n              placeholder=\"John Doe\"\n              {...form.register(\"fullName\")}\n            />\n            {form.formState.errors.fullName && (\n            <p className=\"text-sm text-destructive\">{form.formState.errors.fullName.message}</p>\n          )}\n          </div>\n\n          <div className=\"space-y-2\">\n            <Label htmlFor=\"email\">Email Address</Label>\n            <Input\n              id=\"email\"\n              type=\"email\"\n              placeholder=\"john@example.com\"\n              {...form.register(\"email\")}\n            />\n            {form.formState.errors.email && (\n            <p className=\"text-sm text-destructive\">{form.formState.errors.email.message}</p>\n          )}\n          </div>\n\n          <div className=\"space-y-2\">\n            <Label htmlFor=\"address\">Shipping Address</Label>\n            <Input\n              id=\"address\"\n              type=\"text\"\n              placeholder=\"123 Main St\"\n              {...form.register(\"address\")}\n            />\n            {form.formState.errors.address && (\n            <p className=\"text-sm text-destructive\">{form.formState.errors.address.message}</p>\n          )}\n          </div>\n\n          <div className=\"space-y-2\">\n            <Label htmlFor=\"city\">City</Label>\n            <Input\n              id=\"city\"\n              type=\"text\"\n              placeholder=\"New York\"\n              {...form.register(\"city\")}\n            />\n            {form.formState.errors.city && (\n            <p className=\"text-sm text-destructive\">{form.formState.errors.city.message}</p>\n          )}\n          </div>\n\n          <div className=\"space-y-2\">\n            <Label htmlFor=\"zipCode\">ZIP Code</Label>\n            <Input\n              id=\"zipCode\"\n              type=\"text\"\n              placeholder=\"10001\"\n              {...form.register(\"zipCode\")}\n            />\n            {form.formState.errors.zipCode && (\n            <p className=\"text-sm text-destructive\">{form.formState.errors.zipCode.message}</p>\n          )}\n          </div>\n\n          <div className=\"space-y-2\">\n            <Label>Payment Method</Label>\n            <Controller\n              control={form.control}\n              name=\"paymentMethod\"\n              render={({ field }) => (\n                <RadioGroup\n                  onValueChange={field.onChange}\n                  defaultValue={field.value}\n                  className=\"flex flex-col space-y-1\"\n                >\n                  <div className=\"flex items-center space-x-2\">\n                    <RadioGroupItem value=\"credit_card\" id=\"paymentMethod-credit_card\" />\n                    <Label htmlFor=\"paymentMethod-credit_card\">Credit Card</Label>\n                  </div>\n                  <div className=\"flex items-center space-x-2\">\n                    <RadioGroupItem value=\"paypal\" id=\"paymentMethod-paypal\" />\n                    <Label htmlFor=\"paymentMethod-paypal\">PayPal</Label>\n                  </div>\n                  <div className=\"flex items-center space-x-2\">\n                    <RadioGroupItem value=\"apple_pay\" id=\"paymentMethod-apple_pay\" />\n                    <Label htmlFor=\"paymentMethod-apple_pay\">Apple Pay</Label>\n                  </div>\n                </RadioGroup>\n              )}\n            />\n            {form.formState.errors.paymentMethod && (\n            <p className=\"text-sm text-destructive\">{form.formState.errors.paymentMethod.message}</p>\n          )}\n          </div>\n\n          <Button type=\"submit\" className=\"w-full\">Submit</Button>\n        </form>\n      </CardContent>\n    </Card>\n  );\n}\n",
      "type": "registry:block",
      "target": "components/forms/ecommerce-checkout-form.tsx"
    }
  ],
  "type": "registry:block"
}