@djangocfg/layouts 2.1.259 → 2.1.261

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/layouts",
3
- "version": "2.1.259",
3
+ "version": "2.1.261",
4
4
  "description": "Simple, straightforward layout components for Next.js - import and use with props",
5
5
  "keywords": [
6
6
  "layouts",
@@ -74,14 +74,14 @@
74
74
  "check": "tsc --noEmit"
75
75
  },
76
76
  "peerDependencies": {
77
- "@djangocfg/api": "^2.1.259",
78
- "@djangocfg/centrifugo": "^2.1.259",
79
- "@djangocfg/i18n": "^2.1.259",
80
- "@djangocfg/monitor": "^2.1.259",
81
- "@djangocfg/debuger": "^2.1.259",
82
- "@djangocfg/ui-core": "^2.1.259",
83
- "@djangocfg/ui-nextjs": "^2.1.259",
84
- "@djangocfg/ui-tools": "^2.1.259",
77
+ "@djangocfg/api": "^2.1.261",
78
+ "@djangocfg/centrifugo": "^2.1.261",
79
+ "@djangocfg/i18n": "^2.1.261",
80
+ "@djangocfg/monitor": "^2.1.261",
81
+ "@djangocfg/debuger": "^2.1.261",
82
+ "@djangocfg/ui-core": "^2.1.261",
83
+ "@djangocfg/ui-nextjs": "^2.1.261",
84
+ "@djangocfg/ui-tools": "^2.1.261",
85
85
  "@hookform/resolvers": "^5.2.2",
86
86
  "consola": "^3.4.2",
87
87
  "lucide-react": "^0.545.0",
@@ -109,15 +109,15 @@
109
109
  "uuid": "^11.1.0"
110
110
  },
111
111
  "devDependencies": {
112
- "@djangocfg/api": "^2.1.259",
113
- "@djangocfg/i18n": "^2.1.259",
114
- "@djangocfg/centrifugo": "^2.1.259",
115
- "@djangocfg/monitor": "^2.1.259",
116
- "@djangocfg/debuger": "^2.1.259",
117
- "@djangocfg/typescript-config": "^2.1.259",
118
- "@djangocfg/ui-core": "^2.1.259",
119
- "@djangocfg/ui-nextjs": "^2.1.259",
120
- "@djangocfg/ui-tools": "^2.1.259",
112
+ "@djangocfg/api": "^2.1.261",
113
+ "@djangocfg/i18n": "^2.1.261",
114
+ "@djangocfg/centrifugo": "^2.1.261",
115
+ "@djangocfg/monitor": "^2.1.261",
116
+ "@djangocfg/debuger": "^2.1.261",
117
+ "@djangocfg/typescript-config": "^2.1.261",
118
+ "@djangocfg/ui-core": "^2.1.261",
119
+ "@djangocfg/ui-nextjs": "^2.1.261",
120
+ "@djangocfg/ui-tools": "^2.1.261",
121
121
  "@types/node": "^24.7.2",
122
122
  "@types/react": "^19.1.0",
123
123
  "@types/react-dom": "^19.1.0",
@@ -59,6 +59,8 @@ export interface SidebarConfig {
59
59
  }
60
60
 
61
61
  export interface HeaderConfig {
62
+ /** Custom header brand node (same idea as PublicNavbar `brand`). */
63
+ brand?: ReactNode;
62
64
  /** Shown next to the logo when the sidebar is expanded */
63
65
  title?: string;
64
66
  /**
@@ -32,15 +32,23 @@ export function PrivateContent({
32
32
  const mobileFabClearance =
33
33
  hasSidebar &&
34
34
  (isMobile && !openMobile
35
- ? 'max-md:pt-[max(3.75rem,calc(3rem+env(safe-area-inset-top,0px)))]'
36
- : 'max-md:pt-[max(4rem,calc(3.25rem+env(safe-area-inset-top,0px)))]');
35
+ ? 'max-md:pt-[max(4.25rem,calc(3.5rem+env(safe-area-inset-top,0px)))]'
36
+ : 'max-md:pt-[max(4.5rem,calc(3.75rem+env(safe-area-inset-top,0px)))]');
37
+
38
+ const contentTopPaddingClass =
39
+ padding === 'default'
40
+ ? hasSidebar
41
+ ? 'md:pt-6 lg:pt-8'
42
+ : 'pt-4 sm:pt-6 lg:pt-8'
43
+ : undefined;
37
44
 
38
45
  const scrollAreaClass = cn(
39
46
  'min-h-0 flex-1 overflow-y-auto',
40
47
  padding === 'default' && [
41
- 'pt-4 px-4 sm:pt-6 sm:px-6 lg:pt-8 lg:px-8',
48
+ 'px-4 sm:px-6 lg:px-8',
42
49
  'pb-[calc(1rem+env(safe-area-inset-bottom,0px))] sm:pb-[calc(1.5rem+env(safe-area-inset-bottom,0px))] lg:pb-[calc(2rem+env(safe-area-inset-bottom,0px))]',
43
50
  ],
51
+ contentTopPaddingClass,
44
52
  mobileFabClearance,
45
53
  );
46
54
 
@@ -114,6 +114,7 @@ export function PrivateSidebar({ sidebar, header, i18n, pathname: pathnameProp }
114
114
  }, [pathname, isMobile, setOpenMobile]);
115
115
  const brandTitle = header?.title?.trim() || 'Dashboard';
116
116
  const brandMonogram = (header?.brandLetter?.trim().charAt(0) || brandTitle.charAt(0) || 'D').toUpperCase();
117
+ const customBrand = header?.brand;
117
118
 
118
119
  const allItems = React.useMemo(
119
120
  () => sidebar.groups.flatMap((g) => g.items),
@@ -203,13 +204,28 @@ export function PrivateSidebar({ sidebar, header, i18n, pathname: pathnameProp }
203
204
 
204
205
  const expandedHeader = (
205
206
  <div className={headerRowClass}>
206
- <Link
207
- href={homeHref}
208
- className="flex min-w-0 flex-1 items-center gap-2 rounded-md py-0.5 outline-none ring-sidebar-ring focus-visible:ring-2"
209
- >
210
- <div className="flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-sidebar-primary">{brandMark}</div>
211
- <span className="truncate text-sm font-semibold tracking-tight text-sidebar-foreground">{brandTitle}</span>
212
- </Link>
207
+ <div className="min-w-0 flex-1">
208
+ {customBrand != null && customBrand !== false
209
+ ? typeof customBrand === 'string'
210
+ ? (
211
+ <Link
212
+ href={homeHref}
213
+ className="flex min-w-0 items-center gap-2 rounded-md py-0.5 outline-none ring-sidebar-ring focus-visible:ring-2"
214
+ >
215
+ <span className="truncate text-sm font-semibold tracking-tight text-sidebar-foreground">{customBrand}</span>
216
+ </Link>
217
+ )
218
+ : customBrand
219
+ : (
220
+ <Link
221
+ href={homeHref}
222
+ className="flex min-w-0 items-center gap-2 rounded-md py-0.5 outline-none ring-sidebar-ring focus-visible:ring-2"
223
+ >
224
+ <div className="flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-sidebar-primary">{brandMark}</div>
225
+ <span className="truncate text-sm font-semibold tracking-tight text-sidebar-foreground">{brandTitle}</span>
226
+ </Link>
227
+ )}
228
+ </div>
213
229
  {!isMobile && <SidebarTrigger className="shrink-0" aria-label="Collapse sidebar" />}
214
230
  </div>
215
231
  );
@@ -223,13 +239,28 @@ export function PrivateSidebar({ sidebar, header, i18n, pathname: pathnameProp }
223
239
  /** Mobile drawer: menu open/close only from the main column trigger — no duplicate toggle in the sheet. */
224
240
  const mobileHeader = (
225
241
  <div className="flex items-center gap-3">
226
- <Link
227
- href={homeHref}
228
- className="flex min-w-0 flex-1 items-center gap-3 rounded-md py-1 outline-none ring-sidebar-ring focus-visible:ring-2"
229
- >
230
- <div className="flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-sidebar-primary">{brandMark}</div>
231
- <span className="truncate text-sm font-semibold tracking-tight text-sidebar-foreground">{brandTitle}</span>
232
- </Link>
242
+ <div className="min-w-0 flex-1">
243
+ {customBrand != null && customBrand !== false
244
+ ? typeof customBrand === 'string'
245
+ ? (
246
+ <Link
247
+ href={homeHref}
248
+ className="flex min-w-0 items-center gap-3 rounded-md py-1 outline-none ring-sidebar-ring focus-visible:ring-2"
249
+ >
250
+ <span className="truncate text-sm font-semibold tracking-tight text-sidebar-foreground">{customBrand}</span>
251
+ </Link>
252
+ )
253
+ : customBrand
254
+ : (
255
+ <Link
256
+ href={homeHref}
257
+ className="flex min-w-0 items-center gap-3 rounded-md py-1 outline-none ring-sidebar-ring focus-visible:ring-2"
258
+ >
259
+ <div className="flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-sidebar-primary">{brandMark}</div>
260
+ <span className="truncate text-sm font-semibold tracking-tight text-sidebar-foreground">{brandTitle}</span>
261
+ </Link>
262
+ )}
263
+ </div>
233
264
  </div>
234
265
  );
235
266