@djangocfg/layouts 2.1.23 → 2.1.26
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/package.json +5 -5
- package/src/layouts/AdminLayout/AdminLayout.tsx +10 -1
- package/src/layouts/PrivateLayout/PrivateLayout.tsx +13 -3
- package/src/layouts/PrivateLayout/components/PrivateHeader.tsx +1 -1
- package/src/layouts/ProfileLayout/ProfileLayout.tsx +1 -0
- package/src/layouts/PublicLayout/PublicLayout.tsx +8 -1
- package/src/layouts/PublicLayout/components/PublicMobileDrawer.tsx +9 -15
- package/src/layouts/PublicLayout/components/PublicNavigation.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/layouts",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.26",
|
|
4
4
|
"description": "Simple, straightforward layout components for Next.js - import and use with props",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"layouts",
|
|
@@ -92,9 +92,9 @@
|
|
|
92
92
|
"check": "tsc --noEmit"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
|
-
"@djangocfg/api": "^2.1.
|
|
96
|
-
"@djangocfg/centrifugo": "^2.1.
|
|
97
|
-
"@djangocfg/ui-nextjs": "^2.1.
|
|
95
|
+
"@djangocfg/api": "^2.1.26",
|
|
96
|
+
"@djangocfg/centrifugo": "^2.1.26",
|
|
97
|
+
"@djangocfg/ui-nextjs": "^2.1.26",
|
|
98
98
|
"@hookform/resolvers": "^5.2.0",
|
|
99
99
|
"consola": "^3.4.2",
|
|
100
100
|
"lucide-react": "^0.545.0",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"uuid": "^11.1.0"
|
|
115
115
|
},
|
|
116
116
|
"devDependencies": {
|
|
117
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
117
|
+
"@djangocfg/typescript-config": "^2.1.26",
|
|
118
118
|
"@types/node": "^24.7.2",
|
|
119
119
|
"@types/react": "^19.1.0",
|
|
120
120
|
"@types/react-dom": "^19.1.0",
|
|
@@ -17,7 +17,16 @@
|
|
|
17
17
|
* }}
|
|
18
18
|
* header={{
|
|
19
19
|
* title: 'Admin Dashboard',
|
|
20
|
-
*
|
|
20
|
+
* groups: [
|
|
21
|
+
* {
|
|
22
|
+
* title: 'Admin',
|
|
23
|
+
* items: [
|
|
24
|
+
* { label: 'Profile', href: '/profile' },
|
|
25
|
+
* { label: 'Settings', href: '/settings' }
|
|
26
|
+
* ]
|
|
27
|
+
* }
|
|
28
|
+
* ],
|
|
29
|
+
* authPath: '/auth'
|
|
21
30
|
* }}
|
|
22
31
|
* >
|
|
23
32
|
* {children}
|
|
@@ -24,7 +24,16 @@
|
|
|
24
24
|
* }}
|
|
25
25
|
* header={{
|
|
26
26
|
* title: 'Dashboard',
|
|
27
|
-
*
|
|
27
|
+
* groups: [
|
|
28
|
+
* {
|
|
29
|
+
* title: 'Account',
|
|
30
|
+
* items: [
|
|
31
|
+
* { label: 'Profile', href: '/profile' },
|
|
32
|
+
* { label: 'Settings', href: '/settings' }
|
|
33
|
+
* ]
|
|
34
|
+
* }
|
|
35
|
+
* ],
|
|
36
|
+
* authPath: '/auth'
|
|
28
37
|
* }}
|
|
29
38
|
* >
|
|
30
39
|
* {children}
|
|
@@ -58,9 +67,10 @@ export interface SidebarConfig {
|
|
|
58
67
|
|
|
59
68
|
export interface HeaderConfig {
|
|
60
69
|
title?: string;
|
|
61
|
-
/**
|
|
62
|
-
profilePath?: string;
|
|
70
|
+
/** User menu groups */
|
|
63
71
|
groups?: UserMenuConfig['groups'];
|
|
72
|
+
/** Auth page path (for sign in button) */
|
|
73
|
+
authPath?: string;
|
|
64
74
|
}
|
|
65
75
|
|
|
66
76
|
export interface PrivateLayoutProps {
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
|
|
29
29
|
'use client';
|
|
30
30
|
|
|
31
|
-
import { ReactNode, useState } from 'react';
|
|
31
|
+
import { ReactNode, useState, useEffect } from 'react';
|
|
32
|
+
import { usePathname } from 'next/navigation';
|
|
32
33
|
import type { NavigationItem, UserMenuConfig } from '../shared/types';
|
|
33
34
|
import {
|
|
34
35
|
PublicNavigation,
|
|
@@ -55,6 +56,12 @@ export function PublicLayout({
|
|
|
55
56
|
userMenu,
|
|
56
57
|
}: PublicLayoutProps) {
|
|
57
58
|
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
|
59
|
+
const pathname = usePathname();
|
|
60
|
+
|
|
61
|
+
// Close mobile menu on route change
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
setMobileMenuOpen(false);
|
|
64
|
+
}, [pathname]);
|
|
58
65
|
|
|
59
66
|
return (
|
|
60
67
|
<div className="min-h-screen flex flex-col">
|
|
@@ -41,10 +41,6 @@ export function PublicMobileDrawer({
|
|
|
41
41
|
}: PublicMobileDrawerProps) {
|
|
42
42
|
const { isAuthenticated } = useAuth();
|
|
43
43
|
|
|
44
|
-
const handleNavigate = () => {
|
|
45
|
-
onClose();
|
|
46
|
-
};
|
|
47
|
-
|
|
48
44
|
return (
|
|
49
45
|
<Drawer open={isOpen} onOpenChange={(open) => !open && onClose()} direction="right">
|
|
50
46
|
<DrawerContent direction="right" className="w-80 lg:hidden">
|
|
@@ -55,7 +51,7 @@ export function PublicMobileDrawer({
|
|
|
55
51
|
<img
|
|
56
52
|
src={logo}
|
|
57
53
|
alt={`${siteName} Logo`}
|
|
58
|
-
className="h-
|
|
54
|
+
className="h-6 w-auto object-contain"
|
|
59
55
|
/>
|
|
60
56
|
)}
|
|
61
57
|
<DrawerTitle className="text-lg font-bold text-foreground">
|
|
@@ -70,12 +66,6 @@ export function PublicMobileDrawer({
|
|
|
70
66
|
|
|
71
67
|
{/* Scrollable Content */}
|
|
72
68
|
<div className="flex-1 overflow-y-auto p-4 space-y-6">
|
|
73
|
-
{/* Theme Toggle */}
|
|
74
|
-
<div className="flex items-center justify-between px-4 py-3 border-b border-border/30">
|
|
75
|
-
<span className="text-sm font-medium text-foreground">Theme</span>
|
|
76
|
-
<ThemeToggle />
|
|
77
|
-
</div>
|
|
78
|
-
|
|
79
69
|
{/* User Menu */}
|
|
80
70
|
<UserMenu
|
|
81
71
|
variant="mobile"
|
|
@@ -84,7 +74,7 @@ export function PublicMobileDrawer({
|
|
|
84
74
|
/>
|
|
85
75
|
|
|
86
76
|
{/* Navigation Items */}
|
|
87
|
-
<div className="space-y-3">
|
|
77
|
+
<div className="space-y-3 pt-3">
|
|
88
78
|
<h3 className="px-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground">
|
|
89
79
|
Menu
|
|
90
80
|
</h3>
|
|
@@ -94,16 +84,20 @@ export function PublicMobileDrawer({
|
|
|
94
84
|
key={item.href}
|
|
95
85
|
href={item.href}
|
|
96
86
|
className="block px-4 py-3 rounded-sm text-base font-medium transition-colors text-foreground hover:bg-accent hover:text-accent-foreground"
|
|
97
|
-
onClick={handleNavigate}
|
|
98
87
|
>
|
|
99
88
|
{item.label}
|
|
100
89
|
</Link>
|
|
101
90
|
))}
|
|
102
91
|
</div>
|
|
103
92
|
</div>
|
|
93
|
+
</div>
|
|
104
94
|
|
|
105
|
-
|
|
106
|
-
|
|
95
|
+
{/* Theme Toggle - Fixed at bottom */}
|
|
96
|
+
<div className="border-t border-border/30 p-4">
|
|
97
|
+
<div className="flex items-center justify-between px-4 py-3">
|
|
98
|
+
<span className="text-sm font-medium text-foreground">Theme</span>
|
|
99
|
+
<ThemeToggle />
|
|
100
|
+
</div>
|
|
107
101
|
</div>
|
|
108
102
|
</DrawerContent>
|
|
109
103
|
</Drawer>
|
|
@@ -42,7 +42,7 @@ export function PublicNavigation({
|
|
|
42
42
|
{/* Logo */}
|
|
43
43
|
<Link href="/" className="flex items-center gap-2">
|
|
44
44
|
{logo && (
|
|
45
|
-
<img src={logo} alt={siteName} className="h-
|
|
45
|
+
<img src={logo} alt={siteName} className="h-6 w-auto object-contain" />
|
|
46
46
|
)}
|
|
47
47
|
<span className="font-bold text-lg">{siteName}</span>
|
|
48
48
|
</Link>
|