@@ -4,6 +4,7 @@ import clsx from 'clsx';
44import { useRef , useState } from 'react' ;
55import { mergeProps , useButton , useDisclosure , useFocusRing } from 'react-aria' ;
66import { useDisclosureState } from 'react-stately' ;
7+ import { Section , SectionBody , SectionHeader , SectionHeaderContent } from './StaticSection' ;
78
89interface InteractiveSectionTab {
910 key : string ;
@@ -63,7 +64,7 @@ export function InteractiveSection(props: {
6364 const { isFocusVisible, focusProps } = useFocusRing ( ) ;
6465
6566 return (
66- < div
67+ < Section
6768 id = { id }
6869 className = { clsx (
6970 'openapi-section' ,
@@ -73,20 +74,15 @@ export function InteractiveSection(props: {
7374 ) }
7475 >
7576 { header ? (
76- < div
77+ < SectionHeader
7778 onClick = { ( ) => {
7879 if ( toggeable ) {
7980 state . toggle ( ) ;
8081 }
8182 } }
82- className = { clsx ( 'openapi-section-header' , ` ${ className } -header` ) }
83+ className = { className }
8384 >
84- < div
85- className = { clsx (
86- 'openapi-section-header-content' ,
87- `${ className } -header-content`
88- ) }
89- >
85+ < SectionHeaderContent className = { className } >
9086 { ( children || selectedTab ?. body ) && toggeable ? (
9187 < button
9288 { ...mergeProps ( buttonProps , focusProps ) }
@@ -102,7 +98,7 @@ export function InteractiveSection(props: {
10298 </ button >
10399 ) : null }
104100 { header }
105- </ div >
101+ </ SectionHeaderContent >
106102 < div
107103 className = { clsx (
108104 'openapi-section-header-controls' ,
@@ -133,23 +129,19 @@ export function InteractiveSection(props: {
133129 </ select >
134130 ) : null }
135131 </ div >
136- </ div >
132+ </ SectionHeader >
137133 ) : null }
138134 { ( ! toggeable || state . isExpanded ) && ( children || selectedTab ?. body ) ? (
139- < div
140- ref = { panelRef }
141- { ...panelProps }
142- className = { clsx ( 'openapi-section-body' , `${ className } -body` ) }
143- >
135+ < SectionBody ref = { panelRef } { ...panelProps } className = { className } >
144136 { children }
145137 { selectedTab ?. body }
146- </ div >
138+ </ SectionBody >
147139 ) : null }
148140 { overlay ? (
149141 < div className = { clsx ( 'openapi-section-overlay' , `${ className } -overlay` ) } >
150142 { overlay }
151143 </ div >
152144 ) : null }
153- </ div >
145+ </ Section >
154146 ) ;
155147}
0 commit comments