@claralight-design/abweb-navbar 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NavHeader.module.css +19 -0
- package/NavHeader.tsx +32 -1
- package/package.json +1 -1
package/NavHeader.module.css
CHANGED
|
@@ -101,6 +101,17 @@
|
|
|
101
101
|
min-width: 0;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
.leftContentDesktop,
|
|
105
|
+
.leftContentMobile {
|
|
106
|
+
display: inline-flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
min-width: 0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.leftContentMobile {
|
|
112
|
+
display: none;
|
|
113
|
+
}
|
|
114
|
+
|
|
104
115
|
.brandName {
|
|
105
116
|
color: var(--color-text);
|
|
106
117
|
font-size: 16px;
|
|
@@ -442,6 +453,14 @@
|
|
|
442
453
|
.dividingLine {
|
|
443
454
|
display: none;
|
|
444
455
|
}
|
|
456
|
+
|
|
457
|
+
.leftContentDesktop {
|
|
458
|
+
display: none;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.leftContentMobile {
|
|
462
|
+
display: inline-flex;
|
|
463
|
+
}
|
|
445
464
|
}
|
|
446
465
|
|
|
447
466
|
@media (prefers-reduced-motion: reduce) {
|
package/NavHeader.tsx
CHANGED
|
@@ -32,6 +32,8 @@ export type NavHeaderProps = {
|
|
|
32
32
|
navItems?: NavHeaderItem[]
|
|
33
33
|
leftPadding?: number | string
|
|
34
34
|
leftSlot?: React.ReactNode
|
|
35
|
+
leftSlotDesktop?: React.ReactNode
|
|
36
|
+
leftSlotMobile?: React.ReactNode
|
|
35
37
|
logo?: React.ReactNode
|
|
36
38
|
brandName?: string
|
|
37
39
|
homeHref?: string
|
|
@@ -178,6 +180,8 @@ const NavHeader: React.FC<NavHeaderProps> = ({
|
|
|
178
180
|
navItems = [],
|
|
179
181
|
leftPadding = 0,
|
|
180
182
|
leftSlot,
|
|
183
|
+
leftSlotDesktop,
|
|
184
|
+
leftSlotMobile,
|
|
181
185
|
logo,
|
|
182
186
|
brandName = 'Brand',
|
|
183
187
|
homeHref = '/',
|
|
@@ -195,6 +199,8 @@ const NavHeader: React.FC<NavHeaderProps> = ({
|
|
|
195
199
|
const resolvedLogoAriaLabel = logoAriaLabel ?? brandName
|
|
196
200
|
const resolvedLeftPadding =
|
|
197
201
|
typeof leftPadding === 'number' ? `${leftPadding}px` : leftPadding
|
|
202
|
+
const hasResponsiveLeftSlot =
|
|
203
|
+
leftSlotDesktop !== undefined || leftSlotMobile !== undefined
|
|
198
204
|
|
|
199
205
|
const brandContent = logo ?? <span className={styles.brandName}>{brandName}</span>
|
|
200
206
|
|
|
@@ -309,7 +315,32 @@ const NavHeader: React.FC<NavHeaderProps> = ({
|
|
|
309
315
|
</div>
|
|
310
316
|
)}
|
|
311
317
|
<div className={cx(styles.column, styles.left)}>
|
|
312
|
-
{
|
|
318
|
+
{hasResponsiveLeftSlot ? (
|
|
319
|
+
<>
|
|
320
|
+
{leftSlotDesktop !== undefined && (
|
|
321
|
+
<div
|
|
322
|
+
className={cx(
|
|
323
|
+
styles.leftContent,
|
|
324
|
+
styles.leftContentDesktop
|
|
325
|
+
)}
|
|
326
|
+
>
|
|
327
|
+
{leftSlotDesktop}
|
|
328
|
+
</div>
|
|
329
|
+
)}
|
|
330
|
+
{leftSlotMobile !== undefined && (
|
|
331
|
+
<div
|
|
332
|
+
className={cx(
|
|
333
|
+
styles.leftContent,
|
|
334
|
+
styles.leftContentMobile
|
|
335
|
+
)}
|
|
336
|
+
>
|
|
337
|
+
{leftSlotMobile}
|
|
338
|
+
</div>
|
|
339
|
+
)}
|
|
340
|
+
</>
|
|
341
|
+
) : (
|
|
342
|
+
leftSlot && <div className={styles.leftContent}>{leftSlot}</div>
|
|
343
|
+
)}
|
|
313
344
|
</div>
|
|
314
345
|
|
|
315
346
|
<div className={styles.centerColumn}>
|