File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 1
1
import * as React from "react"
2
+ import { cva , type VariantProps } from "class-variance-authority"
2
3
3
4
import { cn } from "@/lib/utils/cn"
4
5
6
+ const variants = cva ( "w-full scroll-mt-20" , {
7
+ variants : {
8
+ variant : {
9
+ responsiveFlex : "flex flex-col gap-8 md:flex-row lg:gap-16" ,
10
+ normal : "" ,
11
+ } ,
12
+ } ,
13
+ defaultVariants : {
14
+ variant : "normal" ,
15
+ } ,
16
+ } )
17
+
5
18
const Section = React . forwardRef <
6
19
HTMLDivElement ,
7
- React . HTMLAttributes < HTMLDivElement >
8
- > ( ( { className, ...props } , ref ) => (
20
+ React . HTMLAttributes < HTMLDivElement > & VariantProps < typeof variants >
21
+ > ( ( { className, variant , ...props } , ref ) => (
9
22
< section
10
23
ref = { ref }
11
- className = { cn ( "flex flex-col gap-8 md:flex-row lg:gap-16" , className ) }
24
+ className = { cn ( variants ( { variant , className } ) ) }
12
25
{ ...props }
13
26
/>
14
27
) )
You can’t perform that action at this time.
0 commit comments