1- "use client"
1+ "use client" ;
22
3- import { useMemo } from "react"
4- import { cva , type VariantProps } from "class-variance-authority"
3+ import { useMemo } from "react" ;
4+ import { cva , type VariantProps } from "class-variance-authority" ;
55
6- import { cn } from "@/lib/utils"
7- import { Label } from "@/components/ui/label"
8- import { Separator } from "@/components/ui/separator"
6+ import { cn } from "@/lib/utils" ;
7+ import { Label } from "@/components/ui/label" ;
8+ import { Separator } from "@/components/ui/separator" ;
99
1010function FieldSet ( { className, ...props } : React . ComponentProps < "fieldset" > ) {
1111 return (
@@ -14,11 +14,11 @@ function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) {
1414 className = { cn (
1515 "flex flex-col gap-6" ,
1616 "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3" ,
17- className
17+ className ,
1818 ) }
1919 { ...props }
2020 />
21- )
21+ ) ;
2222}
2323
2424function FieldLegend ( {
@@ -34,11 +34,11 @@ function FieldLegend({
3434 "mb-3 font-medium" ,
3535 "data-[variant=legend]:text-base" ,
3636 "data-[variant=label]:text-sm" ,
37- className
37+ className ,
3838 ) }
3939 { ...props }
4040 />
41- )
41+ ) ;
4242}
4343
4444function FieldGroup ( { className, ...props } : React . ComponentProps < "div" > ) {
@@ -47,11 +47,11 @@ function FieldGroup({ className, ...props }: React.ComponentProps<"div">) {
4747 data-slot = "field-group"
4848 className = { cn (
4949 "group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4" ,
50- className
50+ className ,
5151 ) }
5252 { ...props }
5353 />
54- )
54+ ) ;
5555}
5656
5757const fieldVariants = cva (
@@ -75,8 +75,8 @@ const fieldVariants = cva(
7575 defaultVariants : {
7676 orientation : "vertical" ,
7777 } ,
78- }
79- )
78+ } ,
79+ ) ;
8080
8181function Field ( {
8282 className,
@@ -91,7 +91,7 @@ function Field({
9191 className = { cn ( fieldVariants ( { orientation } ) , className ) }
9292 { ...props }
9393 />
94- )
94+ ) ;
9595}
9696
9797function FieldContent ( { className, ...props } : React . ComponentProps < "div" > ) {
@@ -100,11 +100,11 @@ function FieldContent({ className, ...props }: React.ComponentProps<"div">) {
100100 data-slot = "field-content"
101101 className = { cn (
102102 "group/field-content flex flex-1 flex-col gap-1.5 leading-snug" ,
103- className
103+ className ,
104104 ) }
105105 { ...props }
106106 />
107- )
107+ ) ;
108108}
109109
110110function FieldLabel ( {
@@ -118,11 +118,11 @@ function FieldLabel({
118118 "group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50" ,
119119 "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4" ,
120120 "has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10" ,
121- className
121+ className ,
122122 ) }
123123 { ...props }
124124 />
125- )
125+ ) ;
126126}
127127
128128function FieldTitle ( { className, ...props } : React . ComponentProps < "div" > ) {
@@ -131,11 +131,11 @@ function FieldTitle({ className, ...props }: React.ComponentProps<"div">) {
131131 data-slot = "field-label"
132132 className = { cn (
133133 "flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50" ,
134- className
134+ className ,
135135 ) }
136136 { ...props }
137137 />
138- )
138+ ) ;
139139}
140140
141141function FieldDescription ( { className, ...props } : React . ComponentProps < "p" > ) {
@@ -146,27 +146,27 @@ function FieldDescription({ className, ...props }: React.ComponentProps<"p">) {
146146 "text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance" ,
147147 "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5" ,
148148 "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4" ,
149- className
149+ className ,
150150 ) }
151151 { ...props }
152152 />
153- )
153+ ) ;
154154}
155155
156156function FieldSeparator ( {
157157 children,
158158 className,
159159 ...props
160160} : React . ComponentProps < "div" > & {
161- children ?: React . ReactNode
161+ children ?: React . ReactNode ;
162162} ) {
163163 return (
164164 < div
165165 data-slot = "field-separator"
166166 data-content = { ! ! children }
167167 className = { cn (
168168 "relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2" ,
169- className
169+ className ,
170170 ) }
171171 { ...props }
172172 >
@@ -180,7 +180,7 @@ function FieldSeparator({
180180 </ span >
181181 ) }
182182 </ div >
183- )
183+ ) ;
184184}
185185
186186function FieldError ( {
@@ -189,33 +189,33 @@ function FieldError({
189189 errors,
190190 ...props
191191} : React . ComponentProps < "div" > & {
192- errors ?: Array < { message ?: string } | undefined >
192+ errors ?: Array < { message ?: string } | undefined > ;
193193} ) {
194194 const content = useMemo ( ( ) => {
195195 if ( children ) {
196- return children
196+ return children ;
197197 }
198198
199199 if ( ! errors ) {
200- return null
200+ return null ;
201201 }
202202
203203 if ( errors ?. length === 1 && errors [ 0 ] ?. message ) {
204- return errors [ 0 ] . message
204+ return errors [ 0 ] . message ;
205205 }
206206
207207 return (
208208 < ul className = "ml-4 flex list-disc flex-col gap-1" >
209209 { errors . map (
210210 ( error , index ) =>
211- error ?. message && < li key = { index } > { error . message } </ li >
211+ error ?. message && < li key = { index } > { error . message } </ li > ,
212212 ) }
213213 </ ul >
214- )
215- } , [ children , errors ] )
214+ ) ;
215+ } , [ children , errors ] ) ;
216216
217217 if ( ! content ) {
218- return null
218+ return null ;
219219 }
220220
221221 return (
@@ -227,7 +227,7 @@ function FieldError({
227227 >
228228 { content }
229229 </ div >
230- )
230+ ) ;
231231}
232232
233233export {
@@ -241,4 +241,4 @@ export {
241241 FieldSet ,
242242 FieldContent ,
243243 FieldTitle ,
244- }
244+ } ;
0 commit comments