{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "select-form",
  "registryDependencies": [
    "https://taki-ui.com/r/select.json"
  ],
  "files": [
    {
      "path": "registry/new-york/examples/select-form.tsx",
      "content": "\"use client\"\n\nimport Link from \"next/link\"\nimport { zodResolver } from \"@hookform/resolvers/zod\"\nimport { Controller, useForm } from \"react-hook-form\"\nimport { toast } from \"sonner\"\nimport { z } from \"zod\"\n\nimport { Button } from \"@/registry/new-york/ui/button\"\nimport {\n  Field,\n  FieldDescription,\n  FieldError,\n  FieldLabel,\n} from \"@/registry/new-york/ui/field\"\nimport { Select, SelectItem } from \"@/registry/new-york/ui/select\"\n\nconst FormSchema = z.object({\n  email: z\n    .string({\n      required_error: \"Please select an email to display.\",\n    })\n    .email(),\n})\n\nexport default function SelectForm() {\n  const form = useForm<z.infer<typeof FormSchema>>({\n    resolver: zodResolver(FormSchema),\n  })\n\n  function onSubmit(data: z.infer<typeof FormSchema>) {\n    toast(\"You submitted the following values\", {\n      description: (\n        <pre className=\"mt-2 w-[320px] rounded-md bg-neutral-950 p-4\">\n          <code className=\"text-white\">{JSON.stringify(data, null, 2)}</code>\n        </pre>\n      ),\n    })\n  }\n\n  return (\n    <form onSubmit={form.handleSubmit(onSubmit)} className=\"w-2/3 space-y-6\">\n      <Controller\n        control={form.control}\n        name=\"email\"\n        render={({ field, fieldState }) => (\n          <Field data-invalid={fieldState.invalid}>\n            <FieldLabel>Email</FieldLabel>\n            <Select\n              selectedKey={field.value}\n              onSelectionChange={(key) => field.onChange(key as string)}\n            >\n              <SelectItem id=\"m@example.com\">m@example.com</SelectItem>\n              <SelectItem id=\"m@google.com\">m@google.com</SelectItem>\n              <SelectItem id=\"m@support.com\">m@support.com</SelectItem>\n            </Select>\n            <FieldDescription>\n              You can manage email addresses in your{\" \"}\n              <Link href=\"/examples/forms\">email settings</Link>.\n            </FieldDescription>\n            {fieldState.invalid && <FieldError errors={[fieldState.error]} />}\n          </Field>\n        )}\n      />\n      <Button type=\"submit\">Submit</Button>\n    </form>\n  )\n}\n",
      "type": "registry:example"
    }
  ],
  "type": "registry:example"
}