@@ -10,33 +10,29 @@ const AccordionItem = React.forwardRef<
1010 React . ElementRef < typeof AccordionPrimitive . Item > ,
1111 React . ComponentPropsWithoutRef < typeof AccordionPrimitive . Item >
1212> ( ( { className, ...props } , ref ) => (
13- < AccordionPrimitive . Item ref = { ref } className = { cn ( "group/accordion" , className ) } { ...props } />
13+ < AccordionPrimitive . Item ref = { ref } className = { className } { ...props } />
1414) )
1515AccordionItem . displayName = "AccordionItem"
1616
17- type TAccordionTriggerProps = React . ComponentPropsWithoutRef < typeof AccordionPrimitive . Trigger > & {
18- customTrigger ?: React . ReactNode
19- }
20-
2117const AccordionTrigger = React . forwardRef <
2218 React . ElementRef < typeof AccordionPrimitive . Trigger > ,
23- TAccordionTriggerProps
24- > ( ( { className, children, customTrigger , ...props } , ref ) => (
25- < AccordionPrimitive . Trigger
26- ref = { ref }
27- className = { cn (
28- "group/accordion flex cursor-pointer items-center justify-between bg-transparent p-2 transition-all [&[aria-expanded=true]>svg]:rotate-180" ,
29- className
30- ) }
31- { ... props } >
32- { children }
33- { customTrigger ?? (
19+ React . ComponentPropsWithoutRef < typeof AccordionPrimitive . Trigger >
20+ > ( ( { className, children, ...props } , ref ) => (
21+ < AccordionPrimitive . Header >
22+ < AccordionPrimitive . Trigger
23+ ref = { ref }
24+ className = { cn (
25+ "group/accordion flex cursor-pointer items-center justify-between bg-transparent p-2 transition-all [&[aria-expanded=true]>svg]:rotate-180" ,
26+ className
27+ ) }
28+ { ... props } >
29+ { children }
3430 < DownOutlined
3531 className = "transition-transform
36- duration-200 ease-in-out *:size-3 group-aria-[expanded=true]/accordion:rotate-180"
32+ duration-200 ease-in-out *:size-3 group-aria-[expanded=true]/accordion:rotate-180"
3733 />
38- ) }
39- </ AccordionPrimitive . Trigger >
34+ </ AccordionPrimitive . Trigger >
35+ </ AccordionPrimitive . Header >
4036) )
4137AccordionTrigger . displayName = AccordionPrimitive . Trigger . displayName
4238
@@ -46,7 +42,7 @@ const AccordionContent = React.forwardRef<
4642> ( ( { className, children, ...props } , ref ) => (
4743 < AccordionPrimitive . Content
4844 ref = { ref }
49- className = "w-full overflow-hidden transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
45+ className = "overflow-hidden transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
5046 { ...props } >
5147 < div className = { cn ( "" , className ) } > { children } </ div >
5248 </ AccordionPrimitive . Content >
0 commit comments