1- import * as React from " react" ;
2- import { AccordionPanelProps } from " ./types" ;
3- import { clsx } from " clsx" ;
4- import { accordionPanelStyle , panelHeight } from " ./style.css" ;
5- import { useAccordionContext } from " ./AccordionContext" ;
6- import { useEffect , useRef , useState } from " react" ;
7- import { assignInlineVars } from " @vanilla-extract/dynamic" ;
1+ import * as React from ' react' ;
2+ import { AccordionPanelProps } from ' ./types' ;
3+ import { clsx } from ' clsx' ;
4+ import { accordionPanelStyle , panelHeight } from ' ./style.css' ;
5+ import { useAccordionContext } from ' ./AccordionContext' ;
6+ import { useEffect , useRef , useState } from ' react' ;
7+ import { assignInlineVars } from ' @vanilla-extract/dynamic' ;
88
9- const AccordionPanel = ( props : AccordionPanelProps , ref : React . Ref < HTMLDivElement > ) => {
10- const { itemName = "" , children, className, style, ...rest } = props ;
9+ const AccordionPanel = (
10+ props : AccordionPanelProps ,
11+ ref : React . Ref < HTMLDivElement > ,
12+ ) => {
13+ const { itemName = '' , children, className, style, ...rest } = props ;
1114 const innerRef = useRef < HTMLDivElement > ( null ) ;
1215
1316 const { activeItems } = useAccordionContext ( ) ;
@@ -18,7 +21,7 @@ const AccordionPanel = (props: AccordionPanelProps, ref: React.Ref<HTMLDivElemen
1821 if ( ! innerRef . current ) return ;
1922
2023 setCurrentPanelHeight (
21- isActive ? `${ innerRef . current . clientHeight } px` : "0" ,
24+ isActive ? `${ innerRef . current . clientHeight } px` : '0' ,
2225 ) ;
2326 } , [ isActive , activeItems ] ) ;
2427
@@ -30,7 +33,8 @@ const AccordionPanel = (props: AccordionPanelProps, ref: React.Ref<HTMLDivElemen
3033 data-action-item = { isActive }
3134 style = { {
3235 ...assignInlineVars ( {
33- [ panelHeight ] : currentPanelHeight ?? `$innerRef.current.clientHeight}px` ,
36+ [ panelHeight ] :
37+ currentPanelHeight ?? `$innerRef.current.clientHeight}px` ,
3438 } ) ,
3539 ...style ,
3640 } }
@@ -40,7 +44,7 @@ const AccordionPanel = (props: AccordionPanelProps, ref: React.Ref<HTMLDivElemen
4044 </ div >
4145 </ div >
4246 ) ;
43- }
47+ } ;
4448
4549const _AccordionPanel = React . forwardRef ( AccordionPanel ) ;
4650export { _AccordionPanel as AccordionPanel } ;
0 commit comments