{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"shadcn-studio/form-07","type":"registry:component","title":"Form 7","description":"Form with select dropdown components for option selection","dependencies":["@hookform/resolvers","lucide-react","react-hook-form","sonner","zod@3.25.76"],"registryDependencies":["alert","button","field","select"],"files":[{"path":"src/registry/new-york/components/form/form-07.tsx","content":"'use client'\n\nimport * as React from 'react'\n\nimport { CheckCheckIcon } from 'lucide-react'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { Controller, useForm } from 'react-hook-form'\nimport { toast } from 'sonner'\nimport * as z from 'zod'\n\nimport { Alert, AlertTitle } from '@/registry/new-york/ui/alert'\nimport { Button } from '@/registry/new-york/ui/button'\nimport { Field, FieldDescription, FieldError, FieldLabel } from '@/registry/new-york/ui/field'\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/registry/new-york/ui/select'\n\n// Define the form schema\nconst formSchema = z.object({\n  email: z\n    .string({\n      required_error: 'Please select an email.'\n    })\n    .email()\n})\n\ntype FormValues = z.infer<typeof formSchema>\n\nconst SelectFormDemo = () => {\n  const form = useForm<FormValues>({\n    resolver: zodResolver(formSchema),\n    defaultValues: {\n      email: undefined\n    }\n  })\n\n  function onSubmit() {\n    toast.custom(() => (\n      <Alert className='border-green-600 text-green-600 sm:w-110 dark:border-green-400 dark:text-green-400'>\n        <CheckCheckIcon />\n        <AlertTitle>Your account has been recovered</AlertTitle>\n      </Alert>\n    ))\n  }\n\n  return (\n    <form onSubmit={form.handleSubmit(onSubmit)} className='w-full max-w-xs space-y-6'>\n      <Controller\n        name='email'\n        control={form.control}\n        render={({ field, fieldState }) => (\n          <Field data-invalid={fieldState.invalid}>\n            <FieldLabel htmlFor='email'>Email</FieldLabel>\n            <Select name={field.name} value={field.value} onValueChange={field.onChange}>\n              <SelectTrigger id='email' className='w-full' aria-invalid={fieldState.invalid}>\n                <SelectValue placeholder='Enter your registered email' />\n              </SelectTrigger>\n              <SelectContent>\n                <SelectItem value='m@example.com'>user1@gmail.com</SelectItem>\n                <SelectItem value='m@google.com'>user007@gmail.com</SelectItem>\n                <SelectItem value='m@support.com'>user69@outlook.com</SelectItem>\n              </SelectContent>\n            </Select>\n            <FieldDescription>Recover Your Account</FieldDescription>\n            {fieldState.invalid && <FieldError errors={[fieldState.error]} />}\n          </Field>\n        )}\n      />\n      <Button type='submit'>Recover</Button>\n    </form>\n  )\n}\n\nexport default SelectFormDemo\n","type":"registry:component","target":"components/shadcn-studio/form/form-07.tsx"}]}