From 7df1007a5b76d8e839a48fdf3ed92d2d52082456 Mon Sep 17 00:00:00 2001 From: kevinmitch14 <55989505+kevinmitch14@users.noreply.github.com> Date: Sun, 28 Jan 2024 05:47:45 -0300 Subject: [PATCH] refactor: update zod import (#2466) --- apps/www/app/examples/forms/account/account-form.tsx | 2 +- apps/www/app/examples/forms/appearance/appearance-form.tsx | 2 +- apps/www/app/examples/forms/display/display-form.tsx | 2 +- .../app/examples/forms/notifications/notifications-form.tsx | 2 +- apps/www/app/examples/forms/profile-form.tsx | 2 +- apps/www/content/docs/components/form.mdx | 6 +++--- apps/www/lib/validations/log.ts | 2 +- apps/www/lib/validations/og.ts | 2 +- apps/www/registry/default/example/calendar-form.tsx | 2 +- .../registry/default/example/calendar-react-hook-form.tsx | 2 +- .../www/registry/default/example/checkbox-form-multiple.tsx | 2 +- apps/www/registry/default/example/checkbox-form-single.tsx | 2 +- apps/www/registry/default/example/combobox-form.tsx | 2 +- apps/www/registry/default/example/date-picker-form.tsx | 2 +- apps/www/registry/default/example/input-form.tsx | 2 +- apps/www/registry/default/example/radio-group-form.tsx | 2 +- apps/www/registry/default/example/select-form.tsx | 2 +- apps/www/registry/default/example/switch-form.tsx | 2 +- apps/www/registry/default/example/textarea-form.tsx | 2 +- apps/www/registry/new-york/example/calendar-form.tsx | 2 +- .../registry/new-york/example/checkbox-form-multiple.tsx | 2 +- apps/www/registry/new-york/example/checkbox-form-single.tsx | 2 +- apps/www/registry/new-york/example/combobox-form.tsx | 2 +- apps/www/registry/new-york/example/date-picker-form.tsx | 2 +- apps/www/registry/new-york/example/input-form.tsx | 2 +- apps/www/registry/new-york/example/radio-group-form.tsx | 2 +- apps/www/registry/new-york/example/select-form.tsx | 2 +- apps/www/registry/new-york/example/switch-form.tsx | 2 +- apps/www/registry/new-york/example/textarea-form.tsx | 2 +- apps/www/registry/schema.ts | 2 +- 30 files changed, 32 insertions(+), 32 deletions(-) diff --git a/apps/www/app/examples/forms/account/account-form.tsx b/apps/www/app/examples/forms/account/account-form.tsx index 1f21b7fdd20..16f8c856252 100644 --- a/apps/www/app/examples/forms/account/account-form.tsx +++ b/apps/www/app/examples/forms/account/account-form.tsx @@ -4,7 +4,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { CalendarIcon, CaretSortIcon, CheckIcon } from "@radix-ui/react-icons" import { format } from "date-fns" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { cn } from "@/lib/utils" import { Button } from "@/registry/new-york/ui/button" diff --git a/apps/www/app/examples/forms/appearance/appearance-form.tsx b/apps/www/app/examples/forms/appearance/appearance-form.tsx index b1ee3e2e381..b37dc721633 100644 --- a/apps/www/app/examples/forms/appearance/appearance-form.tsx +++ b/apps/www/app/examples/forms/appearance/appearance-form.tsx @@ -3,7 +3,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { ChevronDownIcon } from "@radix-ui/react-icons" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { cn } from "@/lib/utils" import { Button, buttonVariants } from "@/registry/new-york/ui/button" diff --git a/apps/www/app/examples/forms/display/display-form.tsx b/apps/www/app/examples/forms/display/display-form.tsx index d6a28335530..2912c87ff03 100644 --- a/apps/www/app/examples/forms/display/display-form.tsx +++ b/apps/www/app/examples/forms/display/display-form.tsx @@ -2,7 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { Button } from "@/registry/new-york/ui/button" import { Checkbox } from "@/registry/new-york/ui/checkbox" diff --git a/apps/www/app/examples/forms/notifications/notifications-form.tsx b/apps/www/app/examples/forms/notifications/notifications-form.tsx index b016fb6b809..cb7d80ecca0 100644 --- a/apps/www/app/examples/forms/notifications/notifications-form.tsx +++ b/apps/www/app/examples/forms/notifications/notifications-form.tsx @@ -3,7 +3,7 @@ import Link from "next/link" import { zodResolver } from "@hookform/resolvers/zod" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { Button } from "@/registry/new-york/ui/button" import { Checkbox } from "@/registry/new-york/ui/checkbox" diff --git a/apps/www/app/examples/forms/profile-form.tsx b/apps/www/app/examples/forms/profile-form.tsx index b6d54fcba19..46b55547b5f 100644 --- a/apps/www/app/examples/forms/profile-form.tsx +++ b/apps/www/app/examples/forms/profile-form.tsx @@ -3,7 +3,7 @@ import Link from "next/link" import { zodResolver } from "@hookform/resolvers/zod" import { useFieldArray, useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { cn } from "@/lib/utils" import { Button } from "@/registry/new-york/ui/button" diff --git a/apps/www/content/docs/components/form.mdx b/apps/www/content/docs/components/form.mdx index 9aba507792c..1d5fa94d1cb 100644 --- a/apps/www/content/docs/components/form.mdx +++ b/apps/www/content/docs/components/form.mdx @@ -128,7 +128,7 @@ Define the shape of your form using a Zod schema. You can read more about using ```tsx showLineNumbers {3,5-7} "use client" -import * as z from "zod" +import { z } from "zod" const formSchema = z.object({ username: z.string().min(2).max(50), @@ -144,7 +144,7 @@ Use the `useForm` hook from `react-hook-form` to create a form. import { zodResolver } from "@hookform/resolvers/zod" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" const formSchema = z.object({ username: z.string().min(2, { @@ -181,7 +181,7 @@ We can now use the `
` components to build our form. import { zodResolver } from "@hookform/resolvers/zod" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { Button } from "@/components/ui/button" import { diff --git a/apps/www/lib/validations/log.ts b/apps/www/lib/validations/log.ts index 40d2866b6b6..776f58239db 100644 --- a/apps/www/lib/validations/log.ts +++ b/apps/www/lib/validations/log.ts @@ -1,4 +1,4 @@ -import * as z from "zod" +import { z } from "zod" export const logSchema = z.object({ event: z.enum(["copy_primitive"]), diff --git a/apps/www/lib/validations/og.ts b/apps/www/lib/validations/og.ts index bc246f82b24..c7ac7eb95cf 100644 --- a/apps/www/lib/validations/og.ts +++ b/apps/www/lib/validations/og.ts @@ -1,4 +1,4 @@ -import * as z from "zod" +import { z } from "zod" export const ogImageSchema = z.object({ heading: z.string(), diff --git a/apps/www/registry/default/example/calendar-form.tsx b/apps/www/registry/default/example/calendar-form.tsx index 16f45db36b1..3fec57d8313 100644 --- a/apps/www/registry/default/example/calendar-form.tsx +++ b/apps/www/registry/default/example/calendar-form.tsx @@ -4,7 +4,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { format } from "date-fns" import { CalendarIcon } from "lucide-react" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { cn } from "@/lib/utils" import { Button } from "@/registry/default/ui/button" diff --git a/apps/www/registry/default/example/calendar-react-hook-form.tsx b/apps/www/registry/default/example/calendar-react-hook-form.tsx index 16f45db36b1..3fec57d8313 100644 --- a/apps/www/registry/default/example/calendar-react-hook-form.tsx +++ b/apps/www/registry/default/example/calendar-react-hook-form.tsx @@ -4,7 +4,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { format } from "date-fns" import { CalendarIcon } from "lucide-react" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { cn } from "@/lib/utils" import { Button } from "@/registry/default/ui/button" diff --git a/apps/www/registry/default/example/checkbox-form-multiple.tsx b/apps/www/registry/default/example/checkbox-form-multiple.tsx index b1dcff2fe17..b89ba5d12e5 100644 --- a/apps/www/registry/default/example/checkbox-form-multiple.tsx +++ b/apps/www/registry/default/example/checkbox-form-multiple.tsx @@ -2,7 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { Button } from "@/registry/default/ui/button" import { Checkbox } from "@/registry/default/ui/checkbox" diff --git a/apps/www/registry/default/example/checkbox-form-single.tsx b/apps/www/registry/default/example/checkbox-form-single.tsx index 8c527c6c7e3..95f0b7f8f48 100644 --- a/apps/www/registry/default/example/checkbox-form-single.tsx +++ b/apps/www/registry/default/example/checkbox-form-single.tsx @@ -3,7 +3,7 @@ import Link from "next/link" import { zodResolver } from "@hookform/resolvers/zod" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { Button } from "@/registry/default/ui/button" import { Checkbox } from "@/registry/default/ui/checkbox" diff --git a/apps/www/registry/default/example/combobox-form.tsx b/apps/www/registry/default/example/combobox-form.tsx index df6a0b0194e..24f9b00c742 100644 --- a/apps/www/registry/default/example/combobox-form.tsx +++ b/apps/www/registry/default/example/combobox-form.tsx @@ -3,7 +3,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { Check, ChevronsUpDown } from "lucide-react" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { cn } from "@/lib/utils" import { Button } from "@/registry/default/ui/button" diff --git a/apps/www/registry/default/example/date-picker-form.tsx b/apps/www/registry/default/example/date-picker-form.tsx index c547d3f5a5b..c54442546ee 100644 --- a/apps/www/registry/default/example/date-picker-form.tsx +++ b/apps/www/registry/default/example/date-picker-form.tsx @@ -4,7 +4,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { format } from "date-fns" import { CalendarIcon } from "lucide-react" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { cn } from "@/lib/utils" import { Button } from "@/registry/default/ui/button" diff --git a/apps/www/registry/default/example/input-form.tsx b/apps/www/registry/default/example/input-form.tsx index 1ea1bb7b3c4..da69bbfb996 100644 --- a/apps/www/registry/default/example/input-form.tsx +++ b/apps/www/registry/default/example/input-form.tsx @@ -2,7 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { Button } from "@/registry/default/ui/button" import { diff --git a/apps/www/registry/default/example/radio-group-form.tsx b/apps/www/registry/default/example/radio-group-form.tsx index 163bfb65b14..5d35613e643 100644 --- a/apps/www/registry/default/example/radio-group-form.tsx +++ b/apps/www/registry/default/example/radio-group-form.tsx @@ -2,7 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { Button } from "@/registry/default/ui/button" import { diff --git a/apps/www/registry/default/example/select-form.tsx b/apps/www/registry/default/example/select-form.tsx index 4389b9fd6e8..ee66c876a73 100644 --- a/apps/www/registry/default/example/select-form.tsx +++ b/apps/www/registry/default/example/select-form.tsx @@ -3,7 +3,7 @@ import Link from "next/link" import { zodResolver } from "@hookform/resolvers/zod" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { Button } from "@/registry/default/ui/button" import { diff --git a/apps/www/registry/default/example/switch-form.tsx b/apps/www/registry/default/example/switch-form.tsx index ee06a5772be..2e61fada8e5 100644 --- a/apps/www/registry/default/example/switch-form.tsx +++ b/apps/www/registry/default/example/switch-form.tsx @@ -2,7 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { Button } from "@/registry/default/ui/button" import { diff --git a/apps/www/registry/default/example/textarea-form.tsx b/apps/www/registry/default/example/textarea-form.tsx index be39ca86c64..3e2f148ee72 100644 --- a/apps/www/registry/default/example/textarea-form.tsx +++ b/apps/www/registry/default/example/textarea-form.tsx @@ -2,7 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { Button } from "@/registry/default/ui/button" import { diff --git a/apps/www/registry/new-york/example/calendar-form.tsx b/apps/www/registry/new-york/example/calendar-form.tsx index e769ca99d5a..5e39667f5c6 100644 --- a/apps/www/registry/new-york/example/calendar-form.tsx +++ b/apps/www/registry/new-york/example/calendar-form.tsx @@ -4,7 +4,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { CalendarIcon } from "@radix-ui/react-icons" import { format } from "date-fns" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { cn } from "@/lib/utils" import { Button } from "@/registry/new-york/ui/button" diff --git a/apps/www/registry/new-york/example/checkbox-form-multiple.tsx b/apps/www/registry/new-york/example/checkbox-form-multiple.tsx index a036ea53b65..d56a5ece54a 100644 --- a/apps/www/registry/new-york/example/checkbox-form-multiple.tsx +++ b/apps/www/registry/new-york/example/checkbox-form-multiple.tsx @@ -2,7 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { Button } from "@/registry/new-york/ui/button" import { Checkbox } from "@/registry/new-york/ui/checkbox" diff --git a/apps/www/registry/new-york/example/checkbox-form-single.tsx b/apps/www/registry/new-york/example/checkbox-form-single.tsx index f8ecc1bbed9..886d3600c91 100644 --- a/apps/www/registry/new-york/example/checkbox-form-single.tsx +++ b/apps/www/registry/new-york/example/checkbox-form-single.tsx @@ -3,7 +3,7 @@ import Link from "next/link" import { zodResolver } from "@hookform/resolvers/zod" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { Button } from "@/registry/new-york/ui/button" import { Checkbox } from "@/registry/new-york/ui/checkbox" diff --git a/apps/www/registry/new-york/example/combobox-form.tsx b/apps/www/registry/new-york/example/combobox-form.tsx index fdff7e2087d..d62fb3d2c1e 100644 --- a/apps/www/registry/new-york/example/combobox-form.tsx +++ b/apps/www/registry/new-york/example/combobox-form.tsx @@ -3,7 +3,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { CaretSortIcon, CheckIcon } from "@radix-ui/react-icons" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { cn } from "@/lib/utils" import { Button } from "@/registry/new-york/ui/button" diff --git a/apps/www/registry/new-york/example/date-picker-form.tsx b/apps/www/registry/new-york/example/date-picker-form.tsx index 29d229a0a7a..0b27f9f67ea 100644 --- a/apps/www/registry/new-york/example/date-picker-form.tsx +++ b/apps/www/registry/new-york/example/date-picker-form.tsx @@ -4,7 +4,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { CalendarIcon } from "@radix-ui/react-icons" import { format } from "date-fns" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { cn } from "@/lib/utils" import { Button } from "@/registry/new-york/ui/button" diff --git a/apps/www/registry/new-york/example/input-form.tsx b/apps/www/registry/new-york/example/input-form.tsx index 4be9df22364..a3df4bb38a6 100644 --- a/apps/www/registry/new-york/example/input-form.tsx +++ b/apps/www/registry/new-york/example/input-form.tsx @@ -2,7 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { Button } from "@/registry/new-york/ui/button" import { diff --git a/apps/www/registry/new-york/example/radio-group-form.tsx b/apps/www/registry/new-york/example/radio-group-form.tsx index dc5e02ab3f5..585e21de536 100644 --- a/apps/www/registry/new-york/example/radio-group-form.tsx +++ b/apps/www/registry/new-york/example/radio-group-form.tsx @@ -2,7 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { Button } from "@/registry/new-york/ui/button" import { diff --git a/apps/www/registry/new-york/example/select-form.tsx b/apps/www/registry/new-york/example/select-form.tsx index c4807f0d291..227a32b9c65 100644 --- a/apps/www/registry/new-york/example/select-form.tsx +++ b/apps/www/registry/new-york/example/select-form.tsx @@ -3,7 +3,7 @@ import Link from "next/link" import { zodResolver } from "@hookform/resolvers/zod" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { Button } from "@/registry/new-york/ui/button" import { diff --git a/apps/www/registry/new-york/example/switch-form.tsx b/apps/www/registry/new-york/example/switch-form.tsx index 99c3e91b3ae..ea1f9b9f3c5 100644 --- a/apps/www/registry/new-york/example/switch-form.tsx +++ b/apps/www/registry/new-york/example/switch-form.tsx @@ -2,7 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { Button } from "@/registry/new-york/ui/button" import { diff --git a/apps/www/registry/new-york/example/textarea-form.tsx b/apps/www/registry/new-york/example/textarea-form.tsx index b56d1246b49..3aca0cf452d 100644 --- a/apps/www/registry/new-york/example/textarea-form.tsx +++ b/apps/www/registry/new-york/example/textarea-form.tsx @@ -2,7 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { useForm } from "react-hook-form" -import * as z from "zod" +import { z } from "zod" import { Button } from "@/registry/new-york/ui/button" import { diff --git a/apps/www/registry/schema.ts b/apps/www/registry/schema.ts index 5101dcc4551..a92903aef92 100644 --- a/apps/www/registry/schema.ts +++ b/apps/www/registry/schema.ts @@ -1,4 +1,4 @@ -import * as z from "zod" +import { z } from "zod" export const registrySchema = z.array( z.object({