diff options
Diffstat (limited to 'apps/web/components/ui/form.tsx')
| -rw-r--r-- | apps/web/components/ui/form.tsx | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/apps/web/components/ui/form.tsx b/apps/web/components/ui/form.tsx index e62e10e9..20ce3c4b 100644 --- a/apps/web/components/ui/form.tsx +++ b/apps/web/components/ui/form.tsx @@ -1,26 +1,19 @@ +import type * as LabelPrimitive from "@radix-ui/react-label"; +import type { ControllerProps, FieldPath, FieldValues } from "react-hook-form"; import * as React from "react"; -import * as LabelPrimitive from "@radix-ui/react-label"; -import { Slot } from "@radix-ui/react-slot"; -import { - Controller, - ControllerProps, - FieldPath, - FieldValues, - FormProvider, - useFormContext, -} from "react-hook-form"; - -import { cn } from "@/lib/utils"; import { Label } from "@/components/ui/label"; +import { cn } from "@/lib/utils"; +import { Slot } from "@radix-ui/react-slot"; +import { Controller, FormProvider, useFormContext } from "react-hook-form"; const Form = FormProvider; -type FormFieldContextValue< +interface FormFieldContextValue< TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, -> = { +> { name: TName; -}; +} const FormFieldContext = React.createContext<FormFieldContextValue>( {} as FormFieldContextValue, @@ -62,9 +55,9 @@ const useFormField = () => { }; }; -type FormItemContextValue = { +interface FormItemContextValue { id: string; -}; +} const FormItemContext = React.createContext<FormItemContextValue>( {} as FormItemContextValue, @@ -134,7 +127,7 @@ const FormDescription = React.forwardRef< <p ref={ref} id={formDescriptionId} - className={cn("text-muted-foreground text-sm", className)} + className={cn("text-sm text-muted-foreground", className)} {...props} /> ); @@ -156,7 +149,7 @@ const FormMessage = React.forwardRef< <p ref={ref} id={formMessageId} - className={cn("text-destructive text-sm font-medium", className)} + className={cn("text-sm font-medium text-destructive", className)} {...props} > {body} |
