@@ -10,7 +10,11 @@ const AccordionItem = React.forwardRef<
10
10
React . ElementRef < typeof AccordionPrimitive . Item > ,
11
11
React . ComponentPropsWithoutRef < typeof AccordionPrimitive . Item >
12
12
> ( ( { className, ...props } , ref ) => (
13
- < AccordionPrimitive . Item ref = { ref } className = { className } { ...props } />
13
+ < AccordionPrimitive . Item
14
+ ref = { ref }
15
+ className = { className }
16
+ { ...props }
17
+ />
14
18
) )
15
19
AccordionItem . displayName = "AccordionItem"
16
20
@@ -21,11 +25,14 @@ const AccordionTrigger = React.forwardRef<
21
25
< AccordionPrimitive . Header className = "flex" >
22
26
< AccordionPrimitive . Trigger
23
27
ref = { ref }
24
- className = { cn ( "accordion-trigger" , className ) }
28
+ className = { cn (
29
+ "flex flex-1 items-center justify-between gap-2 px-2 py-2 font-medium transition-all hover:bg-background-highlight hover:text-primary-hover focus-visible:outline-1 focus-visible:-outline-offset-1 focus-visible:outline-primary-hover md:px-4 [&[data-state=open]>svg]:-rotate-90 [&[data-state=open]]:bg-background-highlight [&[data-state=open]]:text-primary-high-contrast" ,
30
+ className
31
+ ) }
25
32
{ ...props }
26
33
>
27
34
{ children }
28
- < MdChevronRight className = "accordion-indicator " />
35
+ < MdChevronRight className = "size-[1em] shrink-0 text-2xl transition-transform duration-200 " />
29
36
</ AccordionPrimitive . Trigger >
30
37
</ AccordionPrimitive . Header >
31
38
) )
@@ -37,7 +44,7 @@ const AccordionContent = React.forwardRef<
37
44
> ( ( { className, children, ...props } , ref ) => (
38
45
< AccordionPrimitive . Content
39
46
ref = { ref }
40
- className = { " accordion-content" }
47
+ className = "overflow-hidden text-sm transition-all data-[state=closed]:animate- accordion-up data-[state=open]:animate-accordion-down"
41
48
{ ...props }
42
49
>
43
50
< div className = { cn ( "p-2 md:p-4" , className ) } > { children } </ div >
@@ -46,4 +53,4 @@ const AccordionContent = React.forwardRef<
46
53
47
54
AccordionContent . displayName = AccordionPrimitive . Content . displayName
48
55
49
- export { Accordion , AccordionContent , AccordionItem , AccordionTrigger }
56
+ export { Accordion , AccordionContent , AccordionItem , AccordionTrigger }
0 commit comments