diff --git a/packages/rdx-ui/package.json b/packages/rdx-ui/package.json index beb6ebf2..fe20a15e 100644 --- a/packages/rdx-ui/package.json +++ b/packages/rdx-ui/package.json @@ -47,7 +47,6 @@ "@dnd-kit/modifiers": "^9.0.0", "@dnd-kit/sortable": "^10.0.0", "@dnd-kit/utilities": "^3.2.2", - "@radix-ui/react-tabs": "^1.1.13", "@repo/i18next": "workspace:*", "@repo/shadcn-ui": "workspace:*", "@tanstack/react-table": "^8.21.3", diff --git a/packages/rdx-ui/src/components/dynamics-tabs.tsx b/packages/rdx-ui/src/components/dynamics-tabs.tsx index 13e8bdf2..20ac4b4b 100644 --- a/packages/rdx-ui/src/components/dynamics-tabs.tsx +++ b/packages/rdx-ui/src/components/dynamics-tabs.tsx @@ -1,10 +1,8 @@ "use client"; -import * as TabsPrimitive from "@radix-ui/react-tabs"; -import * as React from "react"; - import { cn } from "@repo/shadcn-ui/lib/utils"; import { cva } from "class-variance-authority"; +import type * as React from "react"; const DynamicTabsListVariants = cva("inline-flex items-center justify-center", { variants: { @@ -46,8 +44,8 @@ const DynamicTabsTriggerVariants = cva( function DynamicTabs({ className, ...props }: React.ComponentProps) { return ( ); @@ -62,8 +60,8 @@ function DynamicTabsList({ }: React.ComponentProps) { return ( ); @@ -78,8 +76,8 @@ function DynamicTabsTrigger({ }: React.ComponentProps) { return ( ); @@ -91,11 +89,11 @@ function DynamicTabsContent({ }: React.ComponentProps) { return ( ); diff --git a/packages/shadcn-ui/package.json b/packages/shadcn-ui/package.json index 4b9ea817..8f5f52ec 100644 --- a/packages/shadcn-ui/package.json +++ b/packages/shadcn-ui/package.json @@ -44,30 +44,6 @@ "@fontsource-variable/geist": "^5.2.8", "@fontsource-variable/geist-mono": "^5.2.7", "@hookform/resolvers": "^5.2.2", - "@radix-ui/react-accordion": "^1.2.12", - "@radix-ui/react-alert-dialog": "^1.1.15", - "@radix-ui/react-aspect-ratio": "^1.1.8", - "@radix-ui/react-avatar": "^1.1.11", - "@radix-ui/react-checkbox": "^1.3.3", - "@radix-ui/react-collapsible": "^1.1.12", - "@radix-ui/react-context-menu": "^2.2.16", - "@radix-ui/react-dialog": "^1.1.15", - "@radix-ui/react-dropdown-menu": "^2.1.16", - "@radix-ui/react-hover-card": "^1.1.15", - "@radix-ui/react-label": "^2.1.8", - "@radix-ui/react-menubar": "^1.1.16", - "@radix-ui/react-navigation-menu": "^1.2.14", - "@radix-ui/react-popover": "^1.1.15", - "@radix-ui/react-progress": "^1.1.8", - "@radix-ui/react-radio-group": "^1.3.8", - "@radix-ui/react-scroll-area": "^1.2.10", - "@radix-ui/react-select": "^2.2.6", - "@radix-ui/react-separator": "^1.1.8", - "@radix-ui/react-slider": "^1.3.6", - "@radix-ui/react-slot": "^1.2.4", - "@radix-ui/react-switch": "^1.2.6", - "@radix-ui/react-tabs": "^1.1.13", - "@radix-ui/react-tooltip": "^1.2.8", "add": "^2.0.6", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", diff --git a/packages/shadcn-ui/src/components/form.tsx b/packages/shadcn-ui/src/components/form.tsx index 4440513d..67805372 100644 --- a/packages/shadcn-ui/src/components/form.tsx +++ b/packages/shadcn-ui/src/components/form.tsx @@ -1,34 +1,31 @@ -"use client" +"use client"; -import * as React from "react" -import * as LabelPrimitive from "@radix-ui/react-label" -import { Slot } from "@radix-ui/react-slot" +import { Label } from "@repo/shadcn-ui/components/label"; +import { cn } from "@repo/shadcn-ui/lib/utils"; +import * as React from "react"; import { Controller, - FormProvider, - useFormContext, type ControllerProps, type FieldPath, type FieldValues, -} from "react-hook-form" + FormProvider, + useFormContext, +} from "react-hook-form"; -import { cn } from "@repo/shadcn-ui/lib/utils" -import { Label } from "@repo/shadcn-ui/components/label" - -const Form = FormProvider +const Form = FormProvider; type FormFieldContextValue< TFieldValues extends FieldValues = FieldValues, - TName extends FieldPath = FieldPath + TName extends FieldPath = FieldPath, > = { - name: TName -} + name: TName; +}; -const FormFieldContext = React.createContext(null) +const FormFieldContext = React.createContext(null); const FormField = < TFieldValues extends FieldValues = FieldValues, - TName extends FieldPath = FieldPath + TName extends FieldPath = FieldPath, >({ ...props }: ControllerProps) => { @@ -36,25 +33,25 @@ const FormField = < - ) -} + ); +}; const useFormField = () => { - const fieldContext = React.useContext(FormFieldContext) - const itemContext = React.useContext(FormItemContext) - const { getFieldState, formState } = useFormContext() + const fieldContext = React.useContext(FormFieldContext); + const itemContext = React.useContext(FormItemContext); + const { getFieldState, formState } = useFormContext(); if (!fieldContext) { - throw new Error("useFormField should be used within ") + throw new Error("useFormField should be used within "); } if (!itemContext) { - throw new Error("useFormField should be used within ") + throw new Error("useFormField should be used within "); } - const fieldState = getFieldState(fieldContext.name, formState) + const fieldState = getFieldState(fieldContext.name, formState); - const { id } = itemContext + const { id } = itemContext; return { id, @@ -63,116 +60,111 @@ const useFormField = () => { formDescriptionId: `${id}-form-item-description`, formMessageId: `${id}-form-item-message`, ...fieldState, - } -} + }; +}; type FormItemContextValue = { - id: string -} + id: string; +}; -const FormItemContext = React.createContext(null) +const FormItemContext = React.createContext(null); -const FormItem = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => { - const id = React.useId() +const FormItem = React.forwardRef>( + ({ className, ...props }, ref) => { + const id = React.useId(); - return ( - -
- - ) -}) -FormItem.displayName = "FormItem" + return ( + +
+ + ); + } +); +FormItem.displayName = "FormItem"; const FormLabel = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => { - const { error, formItemId } = useFormField() + const { error, formItemId } = useFormField(); return (