diff --git a/apps/v4/public/r/registries.json b/apps/v4/public/r/registries.json index 81feea0656..5b9399f934 100644 --- a/apps/v4/public/r/registries.json +++ b/apps/v4/public/r/registries.json @@ -760,5 +760,11 @@ "homepage": "https://sona-ui.vercel.app", "url": "https://sona-ui.vercel.app/r/{name}.json", "description": "A modern UI component library built with React and TailwindCSS to help you build beautiful and accessible web applications faster." + }, + { + "name": "@soundcn", + "homepage": "https://soundcn.xyz", + "url": "https://soundcn.xyz/r/{name}.json", + "description": "Large collection of game, interface, retro, and voice sound effects for web applications" } -] +] \ No newline at end of file diff --git a/apps/v4/public/r/styles/new-york-v4/form-rhf-checkbox.json b/apps/v4/public/r/styles/new-york-v4/form-rhf-checkbox.json index 31eb304414..faf4ff9a50 100644 --- a/apps/v4/public/r/styles/new-york-v4/form-rhf-checkbox.json +++ b/apps/v4/public/r/styles/new-york-v4/form-rhf-checkbox.json @@ -15,7 +15,7 @@ "files": [ { "path": "registry/new-york-v4/examples/form-rhf-checkbox.tsx", - "content": "\"use client\"\n\nimport * as React from \"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 { Button } from \"@/registry/new-york-v4/ui/button\"\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/registry/new-york-v4/ui/card\"\nimport { Checkbox } from \"@/registry/new-york-v4/ui/checkbox\"\nimport {\n Field,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLabel,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n} from \"@/registry/new-york-v4/ui/field\"\n\nconst tasks = [\n {\n id: \"push\",\n label: \"Push notifications\",\n },\n {\n id: \"email\",\n label: \"Email notifications\",\n },\n] as const\n\nconst formSchema = z.object({\n responses: z.boolean(),\n tasks: z\n .array(z.string())\n .min(1, \"Please select at least one notification type.\")\n .refine(\n (value) => value.every((task) => tasks.some((t) => t.id === task)),\n {\n message: \"Invalid notification type selected.\",\n }\n ),\n})\n\nexport default function FormRhfCheckbox() {\n const form = useForm>({\n resolver: zodResolver(formSchema),\n defaultValues: {\n responses: true,\n tasks: [],\n },\n })\n\n function onSubmit(data: z.infer) {\n toast(\"You submitted the following values:\", {\n description: (\n
\n          {JSON.stringify(data, null, 2)}\n        
\n ),\n position: \"bottom-right\",\n classNames: {\n content: \"flex flex-col gap-2\",\n },\n style: {\n \"--border-radius\": \"calc(var(--radius) + 4px)\",\n } as React.CSSProperties,\n })\n }\n\n return (\n \n \n Notifications\n Manage your notification preferences.\n \n \n
\n \n (\n
\n Responses\n \n Get notified for requests that take time, like research or\n image generation.\n \n \n \n \n \n Push notifications\n \n \n \n {fieldState.invalid && (\n \n )}\n
\n )}\n />\n \n (\n
\n Tasks\n \n Get notified when tasks you've created have updates.\n \n \n {tasks.map((task) => (\n \n {\n const newValue = checked\n ? [...field.value, task.id]\n : field.value.filter((value) => value !== task.id)\n field.onChange(newValue)\n }}\n />\n \n {task.label}\n \n \n ))}\n \n {fieldState.invalid && (\n \n )}\n
\n )}\n />\n
\n
\n
\n \n \n \n \n \n \n
\n )\n}\n", + "content": "\"use client\"\n\nimport * as React from \"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 { Button } from \"@/registry/new-york-v4/ui/button\"\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/registry/new-york-v4/ui/card\"\nimport { Checkbox } from \"@/registry/new-york-v4/ui/checkbox\"\nimport {\n Field,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLabel,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n} from \"@/registry/new-york-v4/ui/field\"\n\nconst tasks = [\n {\n id: \"push\",\n label: \"Push notifications\",\n },\n {\n id: \"email\",\n label: \"Email notifications\",\n },\n] as const\n\nconst formSchema = z.object({\n responses: z.boolean(),\n tasks: z\n .array(z.string())\n .min(1, \"Please select at least one notification type.\")\n .refine(\n (value) => value.every((task) => tasks.some((t) => t.id === task)),\n {\n message: \"Invalid notification type selected.\",\n }\n ),\n})\n\nexport default function FormRhfCheckbox() {\n const form = useForm>({\n resolver: zodResolver(formSchema),\n defaultValues: {\n responses: true,\n tasks: [],\n },\n })\n\n function onSubmit(data: z.infer) {\n toast(\"You submitted the following values:\", {\n description: (\n
\n          {JSON.stringify(data, null, 2)}\n        
\n ),\n position: \"bottom-right\",\n classNames: {\n content: \"flex flex-col gap-2\",\n },\n style: {\n \"--border-radius\": \"calc(var(--radius) + 4px)\",\n } as React.CSSProperties,\n })\n }\n\n return (\n \n \n Notifications\n Manage your notification preferences.\n \n \n
\n \n (\n
\n
\n Responses\n \n Get notified for requests that take time, like research or\n image generation.\n \n \n \n \n \n Push notifications\n \n \n \n
\n {fieldState.invalid && (\n \n )}\n
\n )}\n />\n \n (\n \n
\n Tasks\n \n Get notified when tasks you've created have updates.\n \n \n {tasks.map((task) => (\n \n {\n const newValue = checked\n ? [...field.value, task.id]\n : field.value.filter(\n (value) => value !== task.id\n )\n field.onChange(newValue)\n }}\n />\n \n {task.label}\n \n \n ))}\n \n
\n {fieldState.invalid && (\n \n )}\n
\n )}\n />\n
\n
\n
\n \n \n \n \n \n \n
\n )\n}\n", "type": "registry:example" } ], diff --git a/apps/v4/public/r/styles/new-york-v4/form-tanstack-checkbox.json b/apps/v4/public/r/styles/new-york-v4/form-tanstack-checkbox.json index 4bb6d1e95e..c8958babc3 100644 --- a/apps/v4/public/r/styles/new-york-v4/form-tanstack-checkbox.json +++ b/apps/v4/public/r/styles/new-york-v4/form-tanstack-checkbox.json @@ -14,7 +14,7 @@ "files": [ { "path": "registry/new-york-v4/examples/form-tanstack-checkbox.tsx", - "content": "/* eslint-disable react/no-children-prop */\n\"use client\"\n\nimport { useForm } from \"@tanstack/react-form\"\nimport { toast } from \"sonner\"\nimport * as z from \"zod\"\n\nimport { Button } from \"@/registry/new-york-v4/ui/button\"\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/registry/new-york-v4/ui/card\"\nimport { Checkbox } from \"@/registry/new-york-v4/ui/checkbox\"\nimport {\n Field,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLabel,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n} from \"@/registry/new-york-v4/ui/field\"\n\nconst tasks = [\n {\n id: \"push\",\n label: \"Push notifications\",\n },\n {\n id: \"email\",\n label: \"Email notifications\",\n },\n] as const\n\nconst formSchema = z.object({\n responses: z.boolean(),\n tasks: z\n .array(z.string())\n .min(1, \"Please select at least one notification type.\")\n .refine(\n (value) => value.every((task) => tasks.some((t) => t.id === task)),\n {\n message: \"Invalid notification type selected.\",\n }\n ),\n})\n\nexport default function FormTanstackCheckbox() {\n const form = useForm({\n defaultValues: {\n responses: true,\n tasks: [] as string[],\n },\n validators: {\n onSubmit: formSchema,\n },\n onSubmit: async ({ value }) => {\n toast(\"You submitted the following values:\", {\n description: (\n
\n            {JSON.stringify(value, null, 2)}\n          
\n ),\n position: \"bottom-right\",\n classNames: {\n content: \"flex flex-col gap-2\",\n },\n style: {\n \"--border-radius\": \"calc(var(--radius) + 4px)\",\n } as React.CSSProperties,\n })\n },\n })\n\n return (\n \n \n Notifications\n Manage your notification preferences.\n \n \n {\n e.preventDefault()\n form.handleSubmit()\n }}\n >\n \n {\n const isInvalid =\n field.state.meta.isTouched && !field.state.meta.isValid\n return (\n
\n Responses\n \n Get notified for requests that take time, like research or\n image generation.\n \n \n \n \n field.handleChange(checked === true)\n }\n disabled\n />\n \n Push notifications\n \n \n \n {isInvalid && (\n \n )}\n
\n )\n }}\n />\n \n {\n const isInvalid =\n field.state.meta.isTouched && !field.state.meta.isValid\n return (\n
\n Tasks\n \n Get notified when tasks you've created have updates.\n \n \n {tasks.map((task) => (\n \n {\n if (checked) {\n field.pushValue(task.id)\n } else {\n const index = field.state.value.indexOf(task.id)\n if (index > -1) {\n field.removeValue(index)\n }\n }\n }}\n />\n \n {task.label}\n \n \n ))}\n \n {isInvalid && (\n \n )}\n
\n )\n }}\n />\n
\n \n
\n \n \n \n \n \n \n
\n )\n}\n", + "content": "/* eslint-disable react/no-children-prop */\n\"use client\"\n\nimport { useForm } from \"@tanstack/react-form\"\nimport { toast } from \"sonner\"\nimport * as z from \"zod\"\n\nimport { Button } from \"@/registry/new-york-v4/ui/button\"\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/registry/new-york-v4/ui/card\"\nimport { Checkbox } from \"@/registry/new-york-v4/ui/checkbox\"\nimport {\n Field,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLabel,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n} from \"@/registry/new-york-v4/ui/field\"\n\nconst tasks = [\n {\n id: \"push\",\n label: \"Push notifications\",\n },\n {\n id: \"email\",\n label: \"Email notifications\",\n },\n] as const\n\nconst formSchema = z.object({\n responses: z.boolean(),\n tasks: z\n .array(z.string())\n .min(1, \"Please select at least one notification type.\")\n .refine(\n (value) => value.every((task) => tasks.some((t) => t.id === task)),\n {\n message: \"Invalid notification type selected.\",\n }\n ),\n})\n\nexport default function FormTanstackCheckbox() {\n const form = useForm({\n defaultValues: {\n responses: true,\n tasks: [] as string[],\n },\n validators: {\n onSubmit: formSchema,\n },\n onSubmit: async ({ value }) => {\n toast(\"You submitted the following values:\", {\n description: (\n
\n            {JSON.stringify(value, null, 2)}\n          
\n ),\n position: \"bottom-right\",\n classNames: {\n content: \"flex flex-col gap-2\",\n },\n style: {\n \"--border-radius\": \"calc(var(--radius) + 4px)\",\n } as React.CSSProperties,\n })\n },\n })\n\n return (\n \n \n Notifications\n Manage your notification preferences.\n \n \n {\n e.preventDefault()\n form.handleSubmit()\n }}\n >\n \n {\n const isInvalid =\n field.state.meta.isTouched && !field.state.meta.isValid\n return (\n
\n
\n Responses\n \n Get notified for requests that take time, like research\n or image generation.\n \n \n \n \n field.handleChange(checked === true)\n }\n disabled\n />\n \n Push notifications\n \n \n \n
\n {isInvalid && (\n \n )}\n
\n )\n }}\n />\n \n {\n const isInvalid =\n field.state.meta.isTouched && !field.state.meta.isValid\n return (\n \n
\n Tasks\n \n Get notified when tasks you've created have\n updates.\n \n \n {tasks.map((task) => (\n \n {\n if (checked) {\n field.pushValue(task.id)\n } else {\n const index = field.state.value.indexOf(\n task.id\n )\n if (index > -1) {\n field.removeValue(index)\n }\n }\n }}\n />\n \n {task.label}\n \n \n ))}\n \n
\n {isInvalid && (\n \n )}\n
\n )\n }}\n />\n
\n \n
\n \n \n \n \n \n \n
\n )\n}\n", "type": "registry:example" } ], diff --git a/apps/v4/registry/directory.json b/apps/v4/registry/directory.json index bbbc04896f..cc1b97e237 100644 --- a/apps/v4/registry/directory.json +++ b/apps/v4/registry/directory.json @@ -887,5 +887,12 @@ "url": "https://sona-ui.vercel.app/r/{name}.json", "description": "A modern UI component library built with React and TailwindCSS to help you build beautiful and accessible web applications faster.", "logo": " " + }, + { + "name": "@soundcn", + "homepage": "https://soundcn.xyz", + "url": "https://soundcn.xyz/r/{name}.json", + "description": "Large collection of game, interface, retro, and voice sound effects for web applications", + "logo": "" } ]