[data-slot=field-group]]:gap-4",
48 | className
49 | )}
50 | {...props}
51 | />
52 | )
53 | }
54 |
55 | const fieldVariants = cva(
56 | "group/field data-[invalid=true]:text-destructive flex w-full gap-3",
57 | {
58 | variants: {
59 | orientation: {
60 | vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
61 | horizontal: [
62 | "flex-row items-center",
63 | "[&>[data-slot=field-label]]:flex-auto",
64 | "has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px has-[>[data-slot=field-content]]:items-start",
65 | ],
66 | responsive: [
67 | "@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto flex-col [&>*]:w-full [&>.sr-only]:w-auto",
68 | "@md/field-group:[&>[data-slot=field-label]]:flex-auto",
69 | "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
70 | ],
71 | },
72 | },
73 | defaultVariants: {
74 | orientation: "vertical",
75 | },
76 | }
77 | )
78 |
79 | function Field({
80 | className,
81 | orientation = "vertical",
82 | ...props
83 | }: React.ComponentProps<"div"> & VariantProps
) {
84 | return (
85 |
92 | )
93 | }
94 |
95 | function FieldContent({ className, ...props }: React.ComponentProps<"div">) {
96 | return (
97 |
105 | )
106 | }
107 |
108 | function FieldLabel({
109 | className,
110 | ...props
111 | }: React.ComponentProps) {
112 | return (
113 |