From 66668d85d603c5841d755a6023aa1925559fc6d4 Mon Sep 17 00:00:00 2001 From: 苏向夜 Date: Wed, 25 Feb 2026 01:32:51 +0800 Subject: chore(workspace): replace legacy codes --- packages/ui-new/src/components/ui/field.tsx | 238 ---------------------------- 1 file changed, 238 deletions(-) delete mode 100644 packages/ui-new/src/components/ui/field.tsx (limited to 'packages/ui-new/src/components/ui/field.tsx') diff --git a/packages/ui-new/src/components/ui/field.tsx b/packages/ui-new/src/components/ui/field.tsx deleted file mode 100644 index ab9fb71..0000000 --- a/packages/ui-new/src/components/ui/field.tsx +++ /dev/null @@ -1,238 +0,0 @@ -import { cva, type VariantProps } from "class-variance-authority"; -import { useMemo } from "react"; -import { Label } from "@/components/ui/label"; -import { Separator } from "@/components/ui/separator"; -import { cn } from "@/lib/utils"; - -function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) { - return ( -
[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col", - className, - )} - {...props} - /> - ); -} - -function FieldLegend({ - className, - variant = "legend", - ...props -}: React.ComponentProps<"legend"> & { variant?: "legend" | "label" }) { - return ( - - ); -} - -function FieldGroup({ className, ...props }: React.ComponentProps<"div">) { - return ( -
- ); -} - -const fieldVariants = cva( - "data-[invalid=true]:text-destructive gap-2 group/field flex w-full", - { - variants: { - orientation: { - vertical: "flex-col *:w-full [&>.sr-only]:w-auto", - horizontal: - "flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px", - responsive: - "flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px", - }, - }, - defaultVariants: { - orientation: "vertical", - }, - }, -); - -function Field({ - className, - orientation = "vertical", - ...props -}: React.ComponentProps<"div"> & VariantProps) { - return ( -
- ); -} - -function FieldContent({ className, ...props }: React.ComponentProps<"div">) { - return ( -
- ); -} - -function FieldLabel({ - className, - ...props -}: React.ComponentProps) { - return ( -