Skip to content

Commit c4d4889

Browse files
Merge pull request #134 from linked-planet/dev
Dev
2 parents 1db6147 + 07cddd6 commit c4d4889

File tree

6 files changed

+45
-45
lines changed

6 files changed

+45
-45
lines changed

library/src/layouting/AppLayout.tsx

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -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>
File renamed without changes.

library/src/utils/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ export { isTimeType, isDateTimeType, isDateType }
2020
export * as DateUtils from "./DateUtils"
2121

2222
export * from "./ErrorHandler"
23+
24+
export * from "./GlobalState"

package-lock.json

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"highlight.js": "^11.11.1",
104104
"intl-messageformat": "^10.7.14",
105105
"lowlight": "^3.3.0",
106-
"lucide-react": "^0.482.0",
106+
"lucide-react": "^0.483.0",
107107
"mime-types": "^2.1.35",
108108
"motion": "^12.5.0",
109109
"react-awesome-slider": "^4.1.0",
@@ -130,7 +130,7 @@
130130
"@hello-pangea/dnd": "^18.0.1",
131131
"@monaco-editor/react": "^4.7.0",
132132
"@tailwindcss/vite": "^4.0.14",
133-
"@tanstack/react-query": "^5.68.0",
133+
"@tanstack/react-query": "^5.69.0",
134134
"@total-typescript/ts-reset": "^0.6.1",
135135
"@types/node": "^22.13.10",
136136
"@types/react": "^18.3.18",

showcase/src/components/showcase/wrapper/GlobalStateShowcase.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import ShowcaseWrapperItem, {
22
type ShowcaseProps,
33
} from "../../ShowCaseWrapperItem/ShowcaseWrapperItem"
4-
import { useGlobalState } from "@linked-planet/ui-kit-ts/GlobalState"
4+
import { useGlobalState } from "@linked-planet/ui-kit-ts"
55
import { Input, Label } from "@linked-planet/ui-kit-ts"
66

77
//#region global-state
@@ -99,7 +99,7 @@ export default function GlobalStateShowcase(props: ShowcaseProps) {
9999
packages={[
100100
{
101101
name: "@linked-planet/ui-kit-ts",
102-
url: "https://linked-planet.github.io/ui-kit-ts/single?component=GlobalState",
102+
url: "/ui-kit-ts/single?component=GlobalState",
103103
},
104104
]}
105105
examples={[

0 commit comments

Comments
 (0)