@djangocfg/layouts 2.1.274 → 2.1.276

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.
Files changed (40) hide show
  1. package/README.md +52 -180
  2. package/package.json +18 -18
  3. package/src/layouts/AppLayout/AppLayout.tsx +14 -14
  4. package/src/layouts/PublicLayout/README.md +144 -0
  5. package/src/layouts/PublicLayout/{components/PublicFooter/PublicFooter.tsx → footers/DefaultFooter/DefaultFooter.tsx} +14 -8
  6. package/src/layouts/PublicLayout/{components/PublicFooter → footers/DefaultFooter}/DjangoCFGLogo.tsx +0 -6
  7. package/src/layouts/PublicLayout/{components/PublicFooter → footers/DefaultFooter}/FooterBottom.tsx +0 -4
  8. package/src/layouts/PublicLayout/{components/PublicFooter → footers/DefaultFooter}/FooterMenuSections.tsx +0 -4
  9. package/src/layouts/PublicLayout/{components/PublicFooter → footers/DefaultFooter}/FooterProjectInfo.tsx +0 -4
  10. package/src/layouts/PublicLayout/{components/PublicFooter → footers/DefaultFooter}/FooterSocialLinks.tsx +0 -5
  11. package/src/layouts/PublicLayout/{components/PublicFooter → footers/DefaultFooter}/index.ts +2 -12
  12. package/src/layouts/PublicLayout/{components/PublicFooter → footers/DefaultFooter}/types.ts +21 -26
  13. package/src/layouts/PublicLayout/footers/index.ts +1 -0
  14. package/src/layouts/PublicLayout/hooks/index.ts +1 -0
  15. package/src/layouts/PublicLayout/hooks/useResponsiveOverflow.ts +140 -0
  16. package/src/layouts/PublicLayout/index.ts +22 -22
  17. package/src/layouts/PublicLayout/navbarTypes.ts +27 -4
  18. package/src/layouts/PublicLayout/navbars/FloatingNavbar/FloatingMobileDrawer.tsx +29 -0
  19. package/src/layouts/PublicLayout/navbars/FloatingNavbar/FloatingNavbar.tsx +117 -0
  20. package/src/layouts/PublicLayout/navbars/FloatingNavbar/index.ts +3 -0
  21. package/src/layouts/PublicLayout/navbars/FlushNavbar/FlushMobileDrawer.tsx +19 -0
  22. package/src/layouts/PublicLayout/navbars/FlushNavbar/FlushNavbar.tsx +112 -0
  23. package/src/layouts/PublicLayout/navbars/FlushNavbar/index.ts +3 -0
  24. package/src/layouts/PublicLayout/navbars/MinimalNavbar/MinimalMobileDrawer.tsx +19 -0
  25. package/src/layouts/PublicLayout/navbars/MinimalNavbar/MinimalNavbar.tsx +169 -0
  26. package/src/layouts/PublicLayout/navbars/MinimalNavbar/index.ts +3 -0
  27. package/src/layouts/PublicLayout/navbars/index.ts +3 -0
  28. package/src/layouts/PublicLayout/primitives/NavActionItem.tsx +94 -0
  29. package/src/layouts/PublicLayout/{components → primitives}/NavActions.tsx +26 -1
  30. package/src/layouts/PublicLayout/{components → primitives}/NavDesktopItems.tsx +100 -56
  31. package/src/layouts/PublicLayout/{components → primitives}/ThemeBrandMark.tsx +0 -8
  32. package/src/layouts/PublicLayout/primitives/index.ts +7 -0
  33. package/src/layouts/PublicLayout/shared/MobileDrawerShell.tsx +205 -0
  34. package/src/layouts/PublicLayout/shared/NavbarShell.tsx +295 -0
  35. package/src/layouts/PublicLayout/shared/index.ts +4 -0
  36. package/src/layouts/PublicLayout/components/PublicMobileDrawer.tsx +0 -211
  37. package/src/layouts/PublicLayout/components/PublicNavbar.tsx +0 -99
  38. package/src/layouts/PublicLayout/components/PublicNavigation.tsx +0 -287
  39. package/src/layouts/PublicLayout/components/index.ts +0 -11
  40. /package/src/layouts/PublicLayout/{components → primitives}/NavBrand.tsx +0 -0
@@ -31,11 +31,6 @@ export interface ThemeBrandMarkProps {
31
31
  'aria-label'?: string;
32
32
  }
33
33
 
34
- /**
35
- * Renders two branches; only one is visible. Same idea as pairing
36
- * `className="dark:hidden"` / `className="hidden dark:block"` on `<img>`, but works with
37
- * any node (SVG component, picture, etc.).
38
- */
39
34
  export function ThemeBrandMark({ light, dark, className, 'aria-label': ariaLabel }: ThemeBrandMarkProps) {
40
35
  return (
41
36
  <span
@@ -61,9 +56,6 @@ export interface ThemeBrandMarkImgProps {
61
56
  'aria-label'?: string;
62
57
  }
63
58
 
64
- /**
65
- * Convenience wrapper around {@link ThemeBrandMark} for the common “two raster/SVG URLs” case.
66
- */
67
59
  export function ThemeBrandMarkImg({
68
60
  srcLight,
69
61
  srcDark,
@@ -0,0 +1,7 @@
1
+ export { NavBrand } from './NavBrand';
2
+ export { NavActions } from './NavActions';
3
+ export { NavActionItem } from './NavActionItem';
4
+ export type { NavAction } from './NavActionItem';
5
+ export { NavDesktopItems } from './NavDesktopItems';
6
+ export { ThemeBrandMark, ThemeBrandMarkImg } from './ThemeBrandMark';
7
+ export type { ThemeBrandMarkProps, ThemeBrandMarkImgProps } from './ThemeBrandMark';
@@ -0,0 +1,205 @@
1
+ /**
2
+ * MobileDrawerShell — shared drawer body used by every navbar variant.
3
+ *
4
+ * Variants differ only in `panelClassName` (rounded/flush, shadow, border) and
5
+ * optional outer container class.
6
+ */
7
+
8
+ 'use client';
9
+
10
+ import { ArrowRight } from 'lucide-react';
11
+ import Link from 'next/link';
12
+ import React, { useMemo } from 'react';
13
+
14
+ import { useAuth } from '@djangocfg/api/auth';
15
+ import { useAppT } from '@djangocfg/i18n';
16
+ import { Button } from '@djangocfg/ui-core/components';
17
+ import { cn } from '@djangocfg/ui-core/lib';
18
+
19
+ import { usePathnameWithoutLocale } from '../../../hooks';
20
+ import { UserMenu } from '../../_components/UserMenu';
21
+ import { usePublicLayoutOptional } from '../context';
22
+ import { useMobileNavPanel } from '../hooks';
23
+
24
+ import type { NavigationItem, UserMenuConfig } from '../../types';
25
+
26
+ export interface MobileDrawerShellProps {
27
+ isOpen?: boolean;
28
+ onClose?: () => void;
29
+ navigation?: NavigationItem[];
30
+ userMenu?: UserMenuConfig;
31
+ /** Wrapper around the panel — controls horizontal padding / max width. */
32
+ outerClassName?: string;
33
+ /** Panel surface (bg, border, rounding, shadow). */
34
+ panelClassName?: string;
35
+ }
36
+
37
+ export function MobileDrawerShell(props: MobileDrawerShellProps) {
38
+ const context = usePublicLayoutOptional();
39
+ const mobileMenuOpen = props.isOpen ?? context?.mobileMenuOpen ?? false;
40
+ const closeMobileMenu = props.onClose ?? context?.closeMobileMenu ?? (() => {});
41
+ const navigation = props.navigation ?? [];
42
+ const userMenu = props.userMenu;
43
+
44
+ const { isAuthenticated, user } = useAuth();
45
+ const pathname = usePathnameWithoutLocale();
46
+ const t = useAppT();
47
+ const { mounted, visible } = useMobileNavPanel({
48
+ isOpen: mobileMenuOpen,
49
+ onClose: closeMobileMenu,
50
+ });
51
+
52
+ const labels = useMemo(() => ({
53
+ menu: t('layouts.navigation.menu'),
54
+ quickActions: 'Actions',
55
+ signIn: t('layouts.profile.login'),
56
+ }), [t]);
57
+
58
+ const mobileNavigation = useMemo(() => {
59
+ const hasHome = navigation.some((item) => item.href === '/');
60
+ if (hasHome) return navigation;
61
+ return [{ label: 'Home', href: '/' }, ...navigation];
62
+ }, [navigation]);
63
+
64
+ const isActivePath = (href: string) => {
65
+ if (href === '/') return pathname === '/';
66
+ return pathname === href || pathname.startsWith(`${href}/`);
67
+ };
68
+
69
+ if (!mounted) return null;
70
+
71
+ const hasSessionUser = Boolean(isAuthenticated && user);
72
+ const showSignInFooter = !hasSessionUser;
73
+
74
+ return (
75
+ <>
76
+ {mobileMenuOpen && (
77
+ <button
78
+ type="button"
79
+ aria-label={t('layouts.mobile.closeMenu')}
80
+ className="fixed inset-0 z-[998] lg:hidden bg-black/35 transition-opacity duration-200"
81
+ onClick={closeMobileMenu}
82
+ />
83
+ )}
84
+ <div
85
+ className={cn(
86
+ 'pointer-events-none fixed inset-x-0 z-1000 lg:hidden px-4 pb-3 sm:px-6 sm:pb-3 lg:px-8',
87
+ )}
88
+ style={{
89
+ top: 'var(--public-navbar-mobile-drawer-top, 5rem)',
90
+ bottom: 0,
91
+ }}
92
+ >
93
+ <div
94
+ className={cn(
95
+ 'mx-auto flex h-full min-h-0 max-h-full w-full flex-col overflow-hidden bg-background/72 backdrop-blur-[10px] dark:bg-card/80 transform-gpu will-change-transform transition-[transform,opacity] duration-[220ms] ease-out',
96
+ props.panelClassName,
97
+ props.outerClassName,
98
+ visible
99
+ ? 'pointer-events-auto opacity-100 translate-y-0 scale-100'
100
+ : 'pointer-events-none opacity-0 -translate-y-2 scale-[0.985]',
101
+ )}
102
+ style={{
103
+ maxHeight: 'min(var(--public-navbar-mobile-drawer-max-height, calc(100dvh - 5rem - 12px)), calc(100dvh - 12px))',
104
+ }}
105
+ >
106
+ <div className="flex-1 min-h-0 overflow-y-auto px-4 py-4 pb-10 space-y-5">
107
+ {hasSessionUser && (
108
+ <div className="px-2">
109
+ <h3 className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
110
+ {labels.quickActions}
111
+ </h3>
112
+ </div>
113
+ )}
114
+
115
+ {hasSessionUser && (
116
+ <UserMenu variant="mobile" groups={userMenu?.groups} authPath={userMenu?.authPath} i18n={userMenu?.i18n} />
117
+ )}
118
+
119
+ <div className="space-y-2">
120
+ <div className="px-2">
121
+ <h3 className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
122
+ {labels.menu}
123
+ </h3>
124
+ </div>
125
+ <div className="space-y-1">
126
+ {mobileNavigation.map((item) => {
127
+ const childItems = item.items ?? [];
128
+ const hasChildNav = childItems.length > 0;
129
+ const anyChildActive = hasChildNav && childItems.some((sub) => isActivePath(sub.href));
130
+ const parentPageActive = hasChildNav
131
+ ? isActivePath(item.href) && !anyChildActive
132
+ : isActivePath(item.href);
133
+ const parentOnlySectionOpen = hasChildNav && anyChildActive;
134
+ return (
135
+ <div key={item.href}>
136
+ <Link
137
+ href={item.href}
138
+ onClick={closeMobileMenu}
139
+ title={item.label}
140
+ className={cn(
141
+ 'block min-h-11 min-w-0 max-w-full rounded-full border-0 px-5 py-3 text-[15px] font-medium transition-colors ring-0 truncate',
142
+ 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/35',
143
+ parentPageActive
144
+ ? 'border-0 bg-accent font-semibold text-foreground shadow-sm dark:border dark:border-border dark:bg-muted dark:shadow-none'
145
+ : parentOnlySectionOpen
146
+ ? 'font-semibold text-foreground'
147
+ : 'text-foreground hover:bg-accent/60 hover:text-accent-foreground',
148
+ )}
149
+ >
150
+ {item.label}
151
+ </Link>
152
+ {hasChildNav && (
153
+ <div className="ml-3 mt-1.5 space-y-1 border-l border-border/40 pl-3">
154
+ {childItems.map((subItem) => {
155
+ const subActive = isActivePath(subItem.href);
156
+ return (
157
+ <Link
158
+ key={`${item.href}-${subItem.href}`}
159
+ href={subItem.href}
160
+ onClick={closeMobileMenu}
161
+ title={subItem.label}
162
+ className={cn(
163
+ 'flex min-h-11 min-w-0 max-w-full items-center rounded-full border-0 px-4 py-2.5 text-sm font-medium transition-colors ring-0 truncate',
164
+ 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/35',
165
+ subActive
166
+ ? 'border-0 bg-accent font-semibold text-foreground shadow-sm dark:border dark:border-border dark:bg-muted/90 dark:shadow-none'
167
+ : 'border-0 text-muted-foreground hover:bg-accent/55 hover:text-foreground',
168
+ )}
169
+ >
170
+ {subItem.label}
171
+ </Link>
172
+ );
173
+ })}
174
+ </div>
175
+ )}
176
+ </div>
177
+ );
178
+ })}
179
+ </div>
180
+ </div>
181
+ </div>
182
+
183
+ {showSignInFooter && (
184
+ <div className="shrink-0 border-t border-border/50 p-4">
185
+ <Link
186
+ href={userMenu?.authPath || '/auth'}
187
+ onClick={closeMobileMenu}
188
+ className="block"
189
+ >
190
+ <Button className="relative w-full justify-center rounded-full h-11 px-6 pr-12">
191
+ {labels.signIn}
192
+ <ArrowRight
193
+ className="pointer-events-none absolute right-4 top-1/2 h-4 w-4 -translate-y-1/2 shrink-0"
194
+ aria-hidden
195
+ />
196
+ </Button>
197
+ </Link>
198
+ </div>
199
+ )}
200
+ </div>
201
+ </div>
202
+ </>
203
+ );
204
+ }
205
+
@@ -0,0 +1,295 @@
1
+ /**
2
+ * NavbarShell — internal orchestrator shared by all public navbar variants.
3
+ *
4
+ * Handles the common layer each variant has to wire up anyway:
5
+ * - scroll behavior (hide on scroll, transparent → opaque)
6
+ * - desktop dropdown hover timers
7
+ * - viewport CSS vars (for the mobile drawer anchoring)
8
+ * - active-path detection
9
+ * - layout rows (default / brand-left / centered / split)
10
+ * - context registration (`setNavbarSurface`)
11
+ *
12
+ * Variants pass in their own chrome (outer positioning, shape, background) through
13
+ * class-building render callbacks, then stay thin (just pick defaults, export types).
14
+ */
15
+
16
+ 'use client';
17
+
18
+ import React, {
19
+ type ReactNode,
20
+ useEffect,
21
+ useLayoutEffect,
22
+ useMemo,
23
+ useRef,
24
+ } from 'react';
25
+
26
+ import { useAppT } from '@djangocfg/i18n';
27
+ import { useIsTabletOrBelow } from '@djangocfg/ui-core/hooks';
28
+ import { cn } from '@djangocfg/ui-core/lib';
29
+
30
+ import { usePathnameWithoutLocale } from '../../../hooks';
31
+ import { usePublicLayoutOptional } from '../context';
32
+ import {
33
+ useDropdownMenu,
34
+ useNavbarScroll,
35
+ useNavbarViewportVars,
36
+ } from '../hooks';
37
+ import type {
38
+ PublicDesktopDropdownRenderer,
39
+ PublicNavbarHeight,
40
+ PublicNavbarPosition,
41
+ PublicNavbarVariant,
42
+ PublicNavLayout,
43
+ } from '../navbarTypes';
44
+ import type { NavigationItem, UserMenuConfig } from '../../types';
45
+
46
+ import { NavActions } from '../primitives/NavActions';
47
+ import type { NavAction } from '../primitives/NavActionItem';
48
+ import { NavBrand } from '../primitives/NavBrand';
49
+ import { NavDesktopItems } from '../primitives/NavDesktopItems';
50
+
51
+ const heightCls: Record<PublicNavbarHeight, string> = {
52
+ sm: 'py-2',
53
+ md: 'py-3.5',
54
+ lg: 'py-5',
55
+ };
56
+
57
+ interface ShapeInputs {
58
+ /** true at scrollY >= threshold */
59
+ scrolled: boolean;
60
+ /** Matches `transparent` flag at the source. */
61
+ transparent: boolean;
62
+ }
63
+
64
+ export interface NavbarShellProps {
65
+ // ── Surface identity (reported to context) ────────────────────────────────
66
+ variant: PublicNavbarVariant;
67
+ position: PublicNavbarPosition;
68
+
69
+ // ── Content ───────────────────────────────────────────────────────────────
70
+ brand?: ReactNode;
71
+ brandHref?: string;
72
+ navigation?: NavigationItem[];
73
+ userMenu?: UserMenuConfig;
74
+ renderDesktopDropdown?: PublicDesktopDropdownRenderer;
75
+ /**
76
+ * Hard cap for how many items to try to fit on desktop. Useful when a
77
+ * consumer wants to force a compact primary row even if more would fit.
78
+ * Defaults to the full list length (let the responsive measurer decide).
79
+ */
80
+ desktopMaxPrimaryItems?: number;
81
+
82
+ // ── Layout ────────────────────────────────────────────────────────────────
83
+ navLayout?: PublicNavLayout;
84
+ navbarHeight?: PublicNavbarHeight;
85
+ /** Inner padding for the row container. */
86
+ innerPadding?: string;
87
+
88
+ // ── Scroll behavior ───────────────────────────────────────────────────────
89
+ hideNavOnScroll?: boolean;
90
+ transparent?: boolean;
91
+ transparentThreshold?: number;
92
+
93
+ // ── Chrome (per-variant) ──────────────────────────────────────────────────
94
+ /** Classes on the outer wrapper (fixed/sticky, top offset, outer x-padding). */
95
+ outerClassName?: string;
96
+ /** Classes for the `<nav>` element defining the shape (rounding, border, shadow). */
97
+ shapeClassName?: string;
98
+ /** Surface classes (bg, backdrop-blur). Driven by `shapeForState`. */
99
+ shapeForState?: (inputs: ShapeInputs) => string;
100
+
101
+ /**
102
+ * Replaces the default actions column (UserMenu + mobile-toggle).
103
+ * Variant owns the mobile toggle too. Receives helpers so it can build the
104
+ * right-hand side however it wants.
105
+ */
106
+ renderActions?: (ctx: NavbarActionsContext) => ReactNode;
107
+
108
+ // ── Default-actions slots (only used when `renderActions` is NOT provided) ─
109
+ /** Typed CTA pills (Book a demo / Get started / …) before UserMenu. */
110
+ actions?: NavAction[];
111
+ /** Arbitrary ReactNode between actions and UserMenu. */
112
+ actionsLeadingSlot?: ReactNode;
113
+ /** Arbitrary ReactNode after the mobile toggle. */
114
+ actionsTrailingSlot?: ReactNode;
115
+
116
+ // ── Props override (used by variants that proxy ctx differently) ──────────
117
+ mobileMenuOpen?: boolean;
118
+ onMobileMenuToggle?: () => void;
119
+ }
120
+
121
+ export interface NavbarActionsContext {
122
+ userMenu?: UserMenuConfig;
123
+ mobileMenuOpen: boolean;
124
+ toggleMobileMenu: () => void;
125
+ toggleMobileLabel: string;
126
+ navLayout: PublicNavLayout;
127
+ }
128
+
129
+ export function NavbarShell(props: NavbarShellProps) {
130
+ const context = usePublicLayoutOptional();
131
+
132
+ const {
133
+ variant,
134
+ position,
135
+ brand,
136
+ brandHref = '/',
137
+ navigation = [],
138
+ userMenu,
139
+ renderDesktopDropdown,
140
+ desktopMaxPrimaryItems: desktopMaxPrimaryItemsProp,
141
+ navLayout = 'default',
142
+ navbarHeight = 'md',
143
+ innerPadding = 'w-full pl-6 pr-3 sm:px-4 lg:px-6',
144
+ hideNavOnScroll = false,
145
+ transparent = false,
146
+ transparentThreshold = 40,
147
+ outerClassName,
148
+ shapeClassName,
149
+ shapeForState,
150
+ } = props;
151
+
152
+ const desktopMaxPrimaryItems = desktopMaxPrimaryItemsProp
153
+ ? Math.max(1, desktopMaxPrimaryItemsProp)
154
+ : undefined;
155
+ const mobileMenuOpen = props.mobileMenuOpen ?? context?.mobileMenuOpen ?? false;
156
+ const toggleMobileMenu = props.onMobileMenuToggle ?? context?.toggleMobileMenu ?? (() => {});
157
+
158
+ const navOuterRef = useRef<HTMLDivElement | null>(null);
159
+
160
+ const { hidden, scrolled } = useNavbarScroll({ hideNavOnScroll, transparent, transparentThreshold });
161
+ const dropdown = useDropdownMenu();
162
+ useNavbarViewportVars(navOuterRef, [position, variant, outerClassName, shapeClassName] as const);
163
+
164
+ const isTabletOrBelow = useIsTabletOrBelow();
165
+ const t = useAppT();
166
+ const pathname = usePathnameWithoutLocale();
167
+
168
+ // Close dropdowns when switching to mobile
169
+ useEffect(() => {
170
+ if (isTabletOrBelow) dropdown.closeDropdown();
171
+ }, [isTabletOrBelow, dropdown.closeDropdown]);
172
+
173
+ // Sync navbar surface into context
174
+ const setNavbarSurface = context?.setNavbarSurface;
175
+ useLayoutEffect(() => {
176
+ if (!setNavbarSurface) return;
177
+ setNavbarSurface({ variant, position });
178
+ return () => setNavbarSurface(null);
179
+ }, [setNavbarSurface, variant, position]);
180
+
181
+ const toggleMobileLabel = useMemo(() => t('layouts.navigation.toggleMobile'), [t]);
182
+
183
+ const isActivePath = useMemo(() => (href: string) => {
184
+ if (href === '/') return pathname === '/';
185
+ return pathname === href || pathname.startsWith(`${href}/`);
186
+ }, [pathname]);
187
+
188
+ const isGroupActive = useMemo(() => (item: NavigationItem): boolean => {
189
+ if (isActivePath(item.href)) return true;
190
+ return item.items?.some((sub) => isActivePath(sub.href)) ?? false;
191
+ }, [isActivePath]);
192
+
193
+ // Filter lone link duplicating brand (keeps full list in drawer)
194
+ const desktopNavItems = useMemo(
195
+ () => navigation.filter((item) => item.items?.length || item.href !== brandHref),
196
+ [navigation, brandHref],
197
+ );
198
+
199
+ const desktopItems = desktopNavItems;
200
+
201
+ const outerCls = cn(
202
+ outerClassName,
203
+ 'inset-x-0 z-50',
204
+ hideNavOnScroll && 'transition-transform duration-300 ease-in-out will-change-transform',
205
+ hideNavOnScroll && hidden && !mobileMenuOpen && '-translate-y-full',
206
+ );
207
+
208
+ const surfaceCls = shapeForState?.({ scrolled, transparent });
209
+
210
+ const brandNode = (
211
+ <div className="min-w-0 shrink-0 flex items-center">
212
+ <NavBrand brand={brand} brandHref={brandHref} />
213
+ </div>
214
+ );
215
+
216
+ const desktopNavNode = navLayout !== 'split' ? (
217
+ <NavDesktopItems
218
+ items={desktopItems}
219
+ maxVisible={desktopMaxPrimaryItems}
220
+ isActivePath={isActivePath}
221
+ isGroupActive={isGroupActive}
222
+ dropdown={dropdown}
223
+ renderDesktopDropdown={renderDesktopDropdown}
224
+ />
225
+ ) : null;
226
+
227
+ const actionsNode = props.renderActions ? (
228
+ props.renderActions({
229
+ userMenu,
230
+ mobileMenuOpen,
231
+ toggleMobileMenu,
232
+ toggleMobileLabel,
233
+ navLayout,
234
+ })
235
+ ) : (
236
+ <NavActions
237
+ userMenu={userMenu}
238
+ mobileMenuOpen={mobileMenuOpen}
239
+ onMobileMenuToggle={toggleMobileMenu}
240
+ toggleMobileLabel={toggleMobileLabel}
241
+ forceShowMobileTrigger={navLayout === 'split'}
242
+ actions={props.actions}
243
+ leadingSlot={props.actionsLeadingSlot}
244
+ trailingSlot={props.actionsTrailingSlot}
245
+ />
246
+ );
247
+
248
+ const h = heightCls[navbarHeight];
249
+
250
+ const row = (() => {
251
+ switch (navLayout) {
252
+ case 'brand-left':
253
+ return (
254
+ <div className={cn('flex items-center gap-4', h)}>
255
+ <div className="min-w-0 shrink-0 flex items-center">{brandNode}</div>
256
+ <div className="hidden isolate lg:flex min-w-0 flex-1 items-center gap-1">{desktopNavNode}</div>
257
+ <div className="flex shrink-0 items-center gap-4">{actionsNode}</div>
258
+ </div>
259
+ );
260
+ case 'centered':
261
+ return (
262
+ <div className={cn('flex items-center gap-4', h)}>
263
+ <div className="shrink-0">{brandNode}</div>
264
+ <div className="hidden isolate lg:flex min-w-0 flex-1 items-center justify-center gap-1">{desktopNavNode}</div>
265
+ <div className="flex shrink-0 items-center">{actionsNode}</div>
266
+ </div>
267
+ );
268
+ case 'split':
269
+ return (
270
+ <div className={cn('flex items-center justify-between', h)}>
271
+ {brandNode}
272
+ {actionsNode}
273
+ </div>
274
+ );
275
+ default:
276
+ return (
277
+ <div className={cn('flex items-center gap-4', h)}>
278
+ <div className="shrink-0">{brandNode}</div>
279
+ <div className="hidden isolate lg:flex min-w-0 flex-1 items-center justify-center gap-1">
280
+ {desktopNavNode}
281
+ </div>
282
+ <div className="flex shrink-0 items-center">{actionsNode}</div>
283
+ </div>
284
+ );
285
+ }
286
+ })();
287
+
288
+ return (
289
+ <div ref={navOuterRef} className={outerCls}>
290
+ <nav className={cn(shapeClassName, surfaceCls)}>
291
+ <div className={innerPadding}>{row}</div>
292
+ </nav>
293
+ </div>
294
+ );
295
+ }
@@ -0,0 +1,4 @@
1
+ export { NavbarShell } from './NavbarShell';
2
+ export type { NavbarShellProps, NavbarActionsContext } from './NavbarShell';
3
+ export { MobileDrawerShell } from './MobileDrawerShell';
4
+ export type { MobileDrawerShellProps } from './MobileDrawerShell';