@djangocfg/layouts 2.1.366 → 2.1.367

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.366",
3
+ "version": "2.1.367",
4
4
  "description": "Simple, straightforward layout components for Next.js - import and use with props",
5
5
  "keywords": [
6
6
  "layouts",
@@ -84,13 +84,13 @@
84
84
  "check": "tsc --noEmit"
85
85
  },
86
86
  "peerDependencies": {
87
- "@djangocfg/api": "^2.1.366",
88
- "@djangocfg/centrifugo": "^2.1.366",
89
- "@djangocfg/debuger": "^2.1.366",
90
- "@djangocfg/i18n": "^2.1.366",
91
- "@djangocfg/monitor": "^2.1.366",
92
- "@djangocfg/ui-core": "^2.1.366",
93
- "@djangocfg/ui-nextjs": "^2.1.366",
87
+ "@djangocfg/api": "^2.1.367",
88
+ "@djangocfg/centrifugo": "^2.1.367",
89
+ "@djangocfg/debuger": "^2.1.367",
90
+ "@djangocfg/i18n": "^2.1.367",
91
+ "@djangocfg/monitor": "^2.1.367",
92
+ "@djangocfg/ui-core": "^2.1.367",
93
+ "@djangocfg/ui-nextjs": "^2.1.367",
94
94
  "@hookform/resolvers": "^5.2.2",
95
95
  "consola": "^3.4.2",
96
96
  "lucide-react": "^0.545.0",
@@ -121,15 +121,15 @@
121
121
  "uuid": "^11.1.0"
122
122
  },
123
123
  "devDependencies": {
124
- "@djangocfg/api": "^2.1.366",
125
- "@djangocfg/centrifugo": "^2.1.366",
126
- "@djangocfg/debuger": "^2.1.366",
127
- "@djangocfg/i18n": "^2.1.366",
128
- "@djangocfg/monitor": "^2.1.366",
129
- "@djangocfg/typescript-config": "^2.1.366",
130
- "@djangocfg/ui-core": "^2.1.366",
131
- "@djangocfg/ui-nextjs": "^2.1.366",
132
- "@djangocfg/ui-tools": "^2.1.366",
124
+ "@djangocfg/api": "^2.1.367",
125
+ "@djangocfg/centrifugo": "^2.1.367",
126
+ "@djangocfg/debuger": "^2.1.367",
127
+ "@djangocfg/i18n": "^2.1.367",
128
+ "@djangocfg/monitor": "^2.1.367",
129
+ "@djangocfg/typescript-config": "^2.1.367",
130
+ "@djangocfg/ui-core": "^2.1.367",
131
+ "@djangocfg/ui-nextjs": "^2.1.367",
132
+ "@djangocfg/ui-tools": "^2.1.367",
133
133
  "@types/node": "^24.7.2",
134
134
  "@types/react": "^19.1.0",
135
135
  "@types/react-dom": "^19.1.0",
@@ -93,6 +93,10 @@ export function BaseApp({
93
93
  debug,
94
94
  i18n,
95
95
  }: BaseAppProps) {
96
+ // auth=false disables AuthProvider entirely (public apps with no login)
97
+ const authEnabled = auth !== false;
98
+ const authConfig = auth === false ? undefined : auth;
99
+
96
100
  // ErrorBoundary is enabled by default
97
101
  const enableErrorBoundary = errorBoundary?.enabled !== false;
98
102
 
@@ -139,7 +143,7 @@ export function BaseApp({
139
143
  dedupingInterval: swr?.dedupingInterval ?? 2000,
140
144
  }}
141
145
  >
142
- <AuthProvider config={auth}>
146
+ <AuthProvider config={authEnabled ? authConfig : undefined} enabled={authEnabled}>
143
147
  <AnalyticsProvider trackingId={analytics?.googleTrackingId}>
144
148
  <CentrifugoProvider
145
149
  enabled={centrifugoEnabled}
@@ -188,8 +192,8 @@ export function BaseApp({
188
192
  <PWAPageResumeManager enabled={true} />
189
193
  )}
190
194
 
191
- {/* Auth Dialog - global auth prompt */}
192
- <AuthDialog authPath={auth?.routes?.auth} />
195
+ {/* Auth Dialog - only when auth is enabled */}
196
+ {authEnabled && <AuthDialog authPath={authConfig?.routes?.auth} />}
193
197
 
194
198
  {/* Debug Panel — auto in dev, ?debug=1 in prod, disable with debug={{ enabled: false }} */}
195
199
  {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
@@ -65,6 +65,8 @@ export interface UserMenuProps {
65
65
  groups?: UserMenuGroup[];
66
66
  /** Auth page path (for sign in button) */
67
67
  authPath?: string;
68
+ /** Disable the sign-in button (guest state, auth not available) */
69
+ disableAuth?: boolean;
68
70
  /**
69
71
  * Language switching inside this menu (desktop: submenu; mobile: button row).
70
72
  * Prefer this over nesting `<LocaleSwitcher />` in the same dropdown — nested menus close each other.
@@ -76,6 +78,7 @@ export function UserMenu({
76
78
  variant = 'desktop',
77
79
  groups,
78
80
  authPath = '/auth',
81
+ disableAuth = false,
79
82
  i18n,
80
83
  }: UserMenuProps) {
81
84
  const { user, isAuthenticated } = useAuth();
@@ -144,6 +147,13 @@ export function UserMenu({
144
147
  </div>
145
148
  );
146
149
  }
150
+ if (disableAuth) {
151
+ return (
152
+ <Button variant="default" size="sm" className="rounded-full px-5" disabled>
153
+ {labels.signIn}
154
+ </Button>
155
+ );
156
+ }
147
157
  return (
148
158
  <Link href={authPath}>
149
159
  <Button variant="default" size="sm" className="rounded-full px-5">
@@ -44,8 +44,8 @@ export interface BaseLayoutProps {
44
44
  /** Theme configuration */
45
45
  theme?: ThemeConfig;
46
46
 
47
- /** Auth configuration */
48
- auth?: AuthConfig;
47
+ /** Auth configuration. Pass `false` to disable AuthProvider entirely (public apps). */
48
+ auth?: AuthConfig | false;
49
49
 
50
50
  /** Analytics configuration (from snippets/Analytics) */
51
51
  analytics?: AnalyticsConfig;