{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "onboarding-wizard-form",
  "description": "Multi-step user onboarding wizard",
  "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/textarea.json",
    "https://formscn.space/r/label.json",
    "https://formscn.space/r/select.json",
    "https://formscn.space/r/checkbox.json"
  ],
  "files": [
    {
      "path": "src/registry/default/templates/onboarding-wizard-form.tsx",
      "content": "\"use client\";\n\nimport { useState } from \"react\";\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, CardFooter } from \"@/components/ui/card\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport { toast } from \"sonner\";\nimport { cn } from \"@/lib/utils\";\nimport { Progress } from \"@/components/ui/progress\";\nimport { Textarea } from \"@/components/ui/textarea\";\nimport {\n  Select,\n  SelectContent,\n  SelectItem,\n  SelectTrigger,\n  SelectValue,\n} from \"@/components/ui/select\";\nimport { Checkbox } from \"@/components/ui/checkbox\";\n\nconst formSchema = z.object({\n  email: z.string().email(\"Invalid email address\").min(1, \"Email Address is required\"),\n  password: z.string().min(1, \"Password is required\"),\n  fullName: z.string().min(1, \"Full Name is required\"),\n  bio: z.string().optional().or(z.literal(\"\")),\n  website: z.string().optional().or(z.literal(\"\")),\n  theme: z.enum([\"light\", \"dark\", \"system\"]),\n  notifications: z.boolean(),\n});\n\ntype FormValues = z.infer<typeof formSchema>;\n\nexport function OnboardingWizardForm() {\n  const [currentStep, setCurrentStep] = useState(0);\n  const steps = [\n  {\n    \"id\": \"account\",\n    \"title\": \"Account\",\n    \"description\": \"Create your secure account\",\n    \"fields\": [\n      \"email\",\n      \"password\"\n    ]\n  },\n  {\n    \"id\": \"profile\",\n    \"title\": \"Profile\",\n    \"description\": \"Tell us about yourself\",\n    \"fields\": [\n      \"fullName\",\n      \"bio\",\n      \"website\"\n    ]\n  },\n  {\n    \"id\": \"preferences\",\n    \"title\": \"Preferences\",\n    \"description\": \"Customize your experience\",\n    \"fields\": [\n      \"theme\",\n      \"notifications\"\n    ]\n  }\n];\n\n  const form = useForm<FormValues>({\n    resolver: zodResolver(formSchema),\n    defaultValues: {\n      email: \"\",\n      password: \"\",\n      fullName: \"\",\n      bio: \"\",\n      website: \"\",\n      theme: \"system\",\n      notifications: false,\n    },\n    mode: \"onChange\",\n  });\n\n  const onSubmit = async (data: FormValues) => {\n    console.log(\"Form submitted:\", data);\n    toast.success(\"Form submitted successfully!\");\n  };\n\n  const nextStep = async () => {\n    const fields = steps[currentStep].fields;\n    const output = await form.trigger(fields as any);\n    if (output) {\n      setCurrentStep((prev) => Math.min(prev + 1, steps.length - 1));\n    }\n  };\n\n  const prevStep = () => {\n    setCurrentStep((prev) => Math.max(prev - 1, 0));\n  };\n\n  return (\n    <Card className=\"w-full max-w-md mx-auto\">\n      <CardHeader>\n        <CardTitle>Onboarding Wizard</CardTitle>\n        <CardDescription>Multi-step user onboarding process</CardDescription>\n        \n        {/* Stepper */}\n        <div className=\"space-y-2 pt-2\">\n          <div className=\"flex items-center justify-between text-sm\">\n            <span className=\"font-medium text-muted-foreground\">\n              Step {currentStep + 1} of {steps.length}\n            </span>\n            <span className=\"font-medium\">\n              {steps[currentStep].title}\n            </span>\n          </div>\n          <Progress value={((currentStep + 1) / steps.length) * 100} className=\"h-2\" />\n        </div>\n        <div className=\"text-center text-sm font-medium text-muted-foreground pt-1\">\n          {steps[currentStep].title}\n        </div>\n      </CardHeader>\n      <CardContent>\n        <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-4\">\n          \n        {currentStep === 0 && (\n          <div className=\"space-y-4 animate-in fade-in-50 slide-in-from-right-5\">\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=\"password\">Password</Label>\n            <Input\n              id=\"password\"\n              type=\"password\"\n              placeholder=\"••••••••\"\n              {...form.register(\"password\")}\n            />\n            {form.formState.errors.password && (\n            <p className=\"text-sm text-destructive\">{form.formState.errors.password.message}</p>\n          )}\n          </div>\n          </div>\n        )}\n\n        {currentStep === 1 && (\n          <div className=\"space-y-4 animate-in fade-in-50 slide-in-from-right-5\">\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=\"bio\">Bio</Label>\n            <Textarea\n              id=\"bio\"\n              placeholder=\"I am a software engineer...\"\n              {...form.register(\"bio\")}\n            />\n            {form.formState.errors.bio && (\n            <p className=\"text-sm text-destructive\">{form.formState.errors.bio.message}</p>\n          )}\n          </div>\n\n          <div className=\"space-y-2\">\n            <Label htmlFor=\"website\">Website</Label>\n            <Input\n              id=\"website\"\n              type=\"url\"\n              placeholder=\"https://example.com\"\n              {...form.register(\"website\")}\n            />\n            {form.formState.errors.website && (\n            <p className=\"text-sm text-destructive\">{form.formState.errors.website.message}</p>\n          )}\n          </div>\n          </div>\n        )}\n\n        {currentStep === 2 && (\n          <div className=\"space-y-4 animate-in fade-in-50 slide-in-from-right-5\">\n                      <div className=\"space-y-2\">\n            <Label htmlFor=\"theme\">Theme Preference</Label>\n            <Controller\n              control={form.control}\n              name=\"theme\"\n              render={({ field }) => (\n                <Select onValueChange={field.onChange} defaultValue={field.value}>\n                  <SelectTrigger id=\"theme\">\n                    <SelectValue placeholder=\"Select an option\" />\n                  </SelectTrigger>\n                  <SelectContent>\n                    <SelectItem value=\"light\">Light</SelectItem>\n                    <SelectItem value=\"dark\">Dark</SelectItem>\n                    <SelectItem value=\"system\">System</SelectItem>\n                  </SelectContent>\n                </Select>\n              )}\n            />\n            {form.formState.errors.theme && (\n            <p className=\"text-sm text-destructive\">{form.formState.errors.theme.message}</p>\n          )}\n          </div>\n\n          <div className=\"flex items-center space-x-2\">\n            <Controller\n              control={form.control}\n              name=\"notifications\"\n              render={({ field }) => (\n                <Checkbox\n                  id=\"notifications\"\n                  checked={field.value}\n                  onCheckedChange={field.onChange}\n                />\n              )}\n            />\n            <Label htmlFor=\"notifications\" className=\"font-normal\">\n              Enable Email Notifications\n            </Label>\n            {form.formState.errors.notifications && (\n            <p className=\"text-sm text-destructive\">{form.formState.errors.notifications.message}</p>\n          )}\n          </div>\n          </div>\n        )}\n\n          <div className=\"flex justify-between pt-4\">\n            <Button \n              type=\"button\" \n              variant=\"outline\" \n              onClick={prevStep} \n              disabled={currentStep === 0}\n              className={cn(currentStep === 0 && \"invisible\")}\n            >\n              Back\n            </Button>\n            \n            {currentStep < steps.length - 1 ? (\n              <Button type=\"button\" onClick={nextStep}>\n                Next\n              </Button>\n            ) : (\n              <Button type=\"submit\">Submit</Button>\n            )}\n          </div>\n        </form>\n      </CardContent>\n    </Card>\n  );\n}\n",
      "type": "registry:block",
      "target": "components/forms/onboarding-wizard-form.tsx"
    }
  ],
  "type": "registry:block"
}