{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "wheel-picker-block-02", "type": "registry:block", "dependencies": [ "react-hook-form", "@hookform/resolvers", "zod" ], "registryDependencies": [ "@ncdai/wheel-picker", "form", "button", "sonner" ], "files": [ { "path": "src/registry/examples/wheel-picker-form-demo.tsx", "content": "\"use client\";\n\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport type { SubmitHandler } from \"react-hook-form\";\nimport { useForm } from \"react-hook-form\";\nimport { toast } from \"sonner\";\nimport { z } from \"zod\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n Form,\n FormControl,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from \"@/components/ui/form\";\nimport type { WheelPickerOption } from \"@/registry/wheel-picker\";\nimport { WheelPicker, WheelPickerWrapper } from \"@/registry/wheel-picker\";\n\nconst formSchema = z.object({\n framework: z.string(),\n});\n\ntype FormSchema = z.infer;\n\nconst options: WheelPickerOption[] = [\n {\n label: \"Next.js\",\n value: \"nextjs\",\n },\n {\n label: \"Vite\",\n value: \"vite\",\n },\n {\n label: \"Laravel\",\n value: \"laravel\",\n },\n {\n label: \"React Router\",\n value: \"react-router\",\n },\n {\n label: \"Astro\",\n value: \"astro\",\n },\n {\n label: \"TanStack Start\",\n value: \"tanstack-start\",\n },\n {\n label: \"TanStack Router\",\n value: \"tanstack-router\",\n },\n {\n label: \"Gatsby\",\n value: \"gatsby\",\n },\n];\n\nexport default function WheelPickerFormDemo() {\n const form = useForm({\n resolver: zodResolver(formSchema),\n defaultValues: {\n framework: \"react-router\",\n },\n });\n\n const onSubmit: SubmitHandler = (values) => {\n toast(\"You submitted the following values:\", {\n description: (\n
\n          {JSON.stringify(values, null, 2)}\n        
\n ),\n });\n };\n\n return (\n
\n \n (\n \n Framework\n\n \n \n \n \n \n\n \n \n )}\n />\n\n
\n \n
\n \n \n );\n}\n", "type": "registry:component" } ] }