@@ -69,13 +69,12 @@ function Container({
6969 children,
7070 className,
7171 style,
72- testId,
7372 useBanner = false ,
73+ ...props
7474} : {
7575 children : React . ReactNode
7676 className ?: string
7777 style ?: React . CSSProperties
78- testId ?: string
7978 useBanner ?: boolean
8079} ) {
8180 return (
@@ -85,7 +84,6 @@ function Container({
8584 className ,
8685 ) }
8786 data-layout-container = "true"
88- data-testid = { testId }
8987 style = { {
9088 gridTemplateAreas : useBanner
9189 ? `
@@ -107,6 +105,7 @@ function Container({
107105 : `calc(100dvh - var(${ bannerHeightVar } , 0px))` ,
108106 ...style ,
109107 } }
108+ { ...props }
110109 >
111110 { children }
112111 </ div >
@@ -120,11 +119,10 @@ function Banner({
120119 children,
121120 className,
122121 style,
123- testId,
124122 sticky,
125123 height,
124+ ...props
126125} : React . ComponentPropsWithRef < "div" > & {
127- testId ?: string
128126 sticky ?: boolean
129127 height ?: number | string
130128} ) {
@@ -152,7 +150,6 @@ function Banner({
152150 className ,
153151 ) }
154152 data-layout-banner = "true"
155- data-testid = { testId }
156153 style = { {
157154 height : `var(${ bannerHeightVar } , min-content)` ,
158155 gridArea : "banner" ,
@@ -165,6 +162,7 @@ function Banner({
165162 : undefined,*/
166163 ...style ,
167164 } }
165+ { ...props }
168166 >
169167 { children }
170168 </ div >
@@ -178,11 +176,10 @@ function TopNavigation({
178176 children,
179177 className,
180178 style,
181- testId,
182179 height,
183180 sticky,
181+ ...props
184182} : React . ComponentPropsWithRef < "header" > & {
185- testId ?: string
186183 height ?: number | string
187184 sticky ?: boolean
188185} ) {
@@ -194,15 +191,18 @@ function TopNavigation({
194191 const heightVal =
195192 typeof height === "number" ? `${ height } px` : height
196193 root . style . setProperty ( topNavigationHeightVar , heightVal )
197- //root.style.setProperty("--_topNavigationHeight", heightVal)
198- } else {
199- const h = localRef . current ?. clientHeight
200- if ( h ) {
201- root . style . setProperty ( topNavigationHeightVar , `${ h } px` )
202- }
203194 }
204195 } , [ height ] )
205196
197+ // set the height to the local ref height if it is not already set, this is to prevent the height from being set to 0
198+ const root = document . documentElement
199+ const h = localRef . current ?. clientHeight
200+ const currVal = root . style . getPropertyValue ( topNavigationHeightVar )
201+ if ( h && currVal !== `${ h } px` ) {
202+ root . style . setProperty ( topNavigationHeightVar , `${ h } px` )
203+ }
204+ //
205+
206206 return (
207207 < header
208208 ref = { localRef }
@@ -211,7 +211,6 @@ function TopNavigation({
211211 className ,
212212 ) }
213213 data-layout-top-navigation = "true"
214- data-testid = { testId }
215214 style = { {
216215 height : `var(${ topNavigationHeightVar } , min-content)` ,
217216 gridArea : "top-navigation" ,
@@ -221,6 +220,7 @@ function TopNavigation({
221220 insetInlineStart: "var(--leftPanelWidth, auto)",*/
222221 ...style ,
223222 } }
223+ { ...props }
224224 >
225225 { children }
226226 </ header >
@@ -236,6 +236,7 @@ function LeftPanel({
236236 style,
237237 sticky,
238238 width = 128 ,
239+ ...props
239240} : React . ComponentPropsWithRef < "aside" > & {
240241 sticky ?: boolean
241242 width ?: number
@@ -257,6 +258,7 @@ function LeftPanel({
257258 gridArea : "left-panel" ,
258259 ...style ,
259260 } }
261+ { ...props }
260262 >
261263 { children }
262264 </ aside >
@@ -270,11 +272,10 @@ function RightPanel({
270272 children,
271273 className,
272274 style,
273- testId,
274275 sticky,
275276 width = 128 ,
277+ ...props
276278} : React . ComponentPropsWithRef < "aside" > & {
277- testId ?: string
278279 sticky ?: boolean
279280 width ?: number
280281} ) {
@@ -290,12 +291,12 @@ function RightPanel({
290291 className ,
291292 ) }
292293 data-layout-right-panel = "true"
293- data-testid = { testId }
294294 style = { {
295295 width : `var(${ rightPanelWidthVar } , 0px)` ,
296296 gridArea : "right-panel" ,
297297 ...style ,
298298 } }
299+ { ...props }
299300 >
300301 { children }
301302 </ aside >
@@ -306,24 +307,22 @@ function Content({
306307 children,
307308 className,
308309 style,
309- testId,
310- } : React . ComponentPropsWithRef < "section" > & {
311- testId ?: string
312- } ) {
310+ ...props
311+ } : React . ComponentPropsWithRef < "section" > ) {
313312 return (
314313 < section
315314 className = { twMerge (
316315 "relative grid size-full min-h-0 overflow-hidden" ,
317316 className ,
318317 ) }
319318 data-layout-content = "true"
320- data-testid = { testId }
321319 style = { {
322320 gridArea : "content" ,
323321 gridTemplateAreas : '"left-sidebar main right-sidebar"' ,
324322 gridTemplateColumns : "auto 1fr auto" ,
325323 ...style ,
326324 } }
325+ { ...props }
327326 >
328327 { children }
329328 </ section >
@@ -334,10 +333,9 @@ function Main({
334333 children,
335334 className,
336335 style,
337- testId,
338336 fixedHeight,
337+ ...props
339338} : React . ComponentPropsWithRef < "main" > & {
340- testId ?: string
341339 fixedHeight ?: boolean
342340} ) {
343341 return (
@@ -347,7 +345,6 @@ function Main({
347345 className ,
348346 ) }
349347 data-layout-main = "true"
350- data-testid = { testId }
351348 style = { {
352349 gridArea : "main" ,
353350 height : fixedHeight
@@ -356,6 +353,7 @@ function Main({
356353 overflow : fixedHeight ? "hidden" : undefined ,
357354 ...style ,
358355 } }
356+ { ...props }
359357 >
360358 { children }
361359 </ main >
0 commit comments