@djangocfg/layouts 2.1.102 → 2.1.104
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 +33 -37
- package/src/components/RedirectPage/RedirectPage.tsx +2 -2
- package/src/components/core/ClientOnly.tsx +1 -1
- package/src/components/errors/ErrorLayout.tsx +1 -1
- package/src/components/errors/ErrorsTracker/components/ErrorButtons.tsx +1 -1
- package/src/components/index.ts +2 -0
- package/src/index.ts +2 -0
- package/src/layouts/AuthLayout/components/AuthHelp.tsx +1 -1
- package/src/layouts/AuthLayout/components/AuthSuccess.tsx +1 -1
- package/src/layouts/AuthLayout/components/IdentifierForm.tsx +1 -1
- package/src/layouts/AuthLayout/components/OTPForm.tsx +1 -1
- package/src/layouts/AuthLayout/components/TwoFactorForm.tsx +1 -1
- package/src/layouts/AuthLayout/components/TwoFactorSetup.tsx +1 -1
- package/src/layouts/AuthLayout/components/oauth/OAuthCallback.tsx +1 -1
- package/src/layouts/AuthLayout/components/oauth/OAuthProviders.tsx +1 -1
- package/src/layouts/PrivateLayout/PrivateLayout.tsx +3 -2
- package/src/layouts/PrivateLayout/components/PrivateHeader.tsx +2 -2
- package/src/layouts/ProfileLayout/ProfileLayout.tsx +1 -1
- package/src/layouts/ProfileLayout/__tests__/TwoFactorSection.test.tsx +1 -1
- package/src/layouts/ProfileLayout/components/AvatarSection.tsx +1 -1
- package/src/layouts/ProfileLayout/components/DeleteAccountSection.tsx +1 -1
- package/src/layouts/ProfileLayout/components/ProfileForm.tsx +1 -1
- package/src/layouts/ProfileLayout/components/TwoFactorSection.tsx +1 -1
- package/src/layouts/PublicLayout/components/PublicFooter/PublicFooter.tsx +1 -1
- package/src/layouts/PublicLayout/components/PublicMobileDrawer.tsx +1 -1
- package/src/layouts/PublicLayout/components/PublicNavigation.tsx +2 -2
- package/src/layouts/_components/UserMenu.tsx +1 -1
- package/src/layouts/index.ts +2 -0
- package/src/pages/index.ts +2 -0
- package/src/pages/legal/LegalPage.tsx +1 -1
- package/src/snippets/AuthDialog/AuthDialog.tsx +3 -2
- package/src/snippets/McpChat/components/AIChatWidget.tsx +1 -1
- package/src/snippets/McpChat/components/AskAIButton.tsx +1 -1
- package/src/snippets/McpChat/components/ChatMessages.tsx +1 -1
- package/src/snippets/McpChat/components/ChatPanel.tsx +1 -1
- package/src/snippets/McpChat/components/ChatSidebar.tsx +1 -1
- package/src/snippets/McpChat/components/ChatWidget.tsx +1 -1
- package/src/snippets/McpChat/components/MessageBubble.tsx +1 -1
- package/src/snippets/McpChat/components/MessageInput.tsx +1 -1
- package/src/snippets/McpChat/context/AIChatContext.tsx +1 -1
- package/src/snippets/McpChat/context/ChatContext.tsx +1 -1
- package/src/snippets/McpChat/hooks/useChatLayout.ts +1 -1
- package/src/snippets/PWAInstall/components/A2HSHint.tsx +0 -1
- package/src/snippets/PWAInstall/components/DesktopGuide.tsx +1 -1
- package/src/snippets/PWAInstall/components/IOSGuide.tsx +1 -1
- package/src/snippets/PWAInstall/components/IOSGuideDrawer.tsx +1 -1
- package/src/snippets/PWAInstall/components/IOSGuideModal.tsx +1 -1
- package/src/snippets/PWAInstall/hooks/useInstallPrompt.ts +2 -2
- package/src/snippets/PushNotifications/components/PushPrompt.tsx +1 -1
- package/src/snippets/index.ts +1 -0
- package/dist/AIChatWidget-LUPM7S2O.mjs +0 -1644
- package/dist/AIChatWidget-LUPM7S2O.mjs.map +0 -1
- package/dist/AIChatWidget-O23TJJ7C.mjs +0 -3
- package/dist/AIChatWidget-O23TJJ7C.mjs.map +0 -1
- package/dist/chunk-53YKWR6F.mjs +0 -6
- package/dist/chunk-53YKWR6F.mjs.map +0 -1
- package/dist/chunk-EI7TDN2G.mjs +0 -1652
- package/dist/chunk-EI7TDN2G.mjs.map +0 -1
- package/dist/components.cjs +0 -925
- package/dist/components.cjs.map +0 -1
- package/dist/components.d.mts +0 -583
- package/dist/components.d.ts +0 -583
- package/dist/components.mjs +0 -879
- package/dist/components.mjs.map +0 -1
- package/dist/index.cjs +0 -7573
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.mts +0 -2376
- package/dist/index.d.ts +0 -2376
- package/dist/index.mjs +0 -5673
- package/dist/index.mjs.map +0 -1
- package/dist/layouts.cjs +0 -6530
- package/dist/layouts.cjs.map +0 -1
- package/dist/layouts.d.mts +0 -748
- package/dist/layouts.d.ts +0 -748
- package/dist/layouts.mjs +0 -4741
- package/dist/layouts.mjs.map +0 -1
- package/dist/pages.cjs +0 -178
- package/dist/pages.cjs.map +0 -1
- package/dist/pages.d.mts +0 -57
- package/dist/pages.d.ts +0 -57
- package/dist/pages.mjs +0 -168
- package/dist/pages.mjs.map +0 -1
- package/dist/snippets.cjs +0 -3793
- package/dist/snippets.cjs.map +0 -1
- package/dist/snippets.d.mts +0 -1192
- package/dist/snippets.d.ts +0 -1192
- package/dist/snippets.mjs +0 -3738
- package/dist/snippets.mjs.map +0 -1
- package/dist/utils.cjs +0 -34
- package/dist/utils.cjs.map +0 -1
- package/dist/utils.d.mts +0 -40
- package/dist/utils.d.ts +0 -40
- package/dist/utils.mjs +0 -25
- package/dist/utils.mjs.map +0 -1
package/dist/layouts.d.mts
DELETED
|
@@ -1,748 +0,0 @@
|
|
|
1
|
-
import React, { ErrorInfo, ReactNode } from 'react';
|
|
2
|
-
import { LucideIcon } from 'lucide-react';
|
|
3
|
-
import { AuthConfig, AuthLayoutProps, AuthFormContextType, AuthHelpProps } from '@djangocfg/api/auth';
|
|
4
|
-
export { AuthChannel, AuthFormContextType, AuthFormState, AuthHelpProps, AuthLayoutConfig, AuthLayoutProps, AuthStep } from '@djangocfg/api/auth';
|
|
5
|
-
import { ZodError } from 'zod';
|
|
6
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Provider Configuration Types
|
|
10
|
-
*
|
|
11
|
-
* Configuration types for layout providers (theme, SWR, MCP chat, Centrifugo)
|
|
12
|
-
* Note: Analytics, PWA, Push, and Error types are defined in their respective modules
|
|
13
|
-
*/
|
|
14
|
-
interface ThemeConfig {
|
|
15
|
-
defaultTheme?: 'light' | 'dark' | 'system';
|
|
16
|
-
storageKey?: string;
|
|
17
|
-
}
|
|
18
|
-
interface SWRConfigOptions {
|
|
19
|
-
revalidateOnFocus?: boolean;
|
|
20
|
-
revalidateOnReconnect?: boolean;
|
|
21
|
-
dedupingInterval?: number;
|
|
22
|
-
}
|
|
23
|
-
interface McpChatConfig {
|
|
24
|
-
/** Enable MCP chat widget */
|
|
25
|
-
enabled?: boolean;
|
|
26
|
-
/** API endpoint for chat */
|
|
27
|
-
apiEndpoint?: string;
|
|
28
|
-
/** Chat widget title */
|
|
29
|
-
title?: string;
|
|
30
|
-
/** Input placeholder */
|
|
31
|
-
placeholder?: string;
|
|
32
|
-
/** Greeting message */
|
|
33
|
-
greeting?: string;
|
|
34
|
-
/** Widget position */
|
|
35
|
-
position?: 'bottom-right' | 'bottom-left';
|
|
36
|
-
/** Widget variant */
|
|
37
|
-
variant?: 'default' | 'minimal';
|
|
38
|
-
/** Enable streaming responses */
|
|
39
|
-
enableStreaming?: boolean;
|
|
40
|
-
/** Auto-detect environment (dev/prod) */
|
|
41
|
-
autoDetectEnvironment?: boolean;
|
|
42
|
-
/** Custom class name */
|
|
43
|
-
className?: string;
|
|
44
|
-
}
|
|
45
|
-
interface CentrifugoConfig {
|
|
46
|
-
/** Enable Centrifugo (default: true) */
|
|
47
|
-
enabled?: boolean;
|
|
48
|
-
/** Auto-connect on mount (default: false) */
|
|
49
|
-
autoConnect?: boolean;
|
|
50
|
-
/** Centrifugo server URL */
|
|
51
|
-
url?: string;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Analytics Configuration Types
|
|
56
|
-
*
|
|
57
|
-
* Configuration for Google Analytics integration
|
|
58
|
-
*/
|
|
59
|
-
interface AnalyticsConfig {
|
|
60
|
-
/** Google Analytics tracking ID (e.g., 'G-XXXXXXXXXX') */
|
|
61
|
-
googleTrackingId?: string;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* PWA Install Configuration Types
|
|
66
|
-
*
|
|
67
|
-
* Configuration for Progressive Web App installation features
|
|
68
|
-
*/
|
|
69
|
-
interface PwaInstallConfig {
|
|
70
|
-
/** Enable PWA installation features */
|
|
71
|
-
enabled?: boolean;
|
|
72
|
-
/** Show A2HS (Add to Home Screen) hint (enabled by default when enabled is true) */
|
|
73
|
-
showInstallHint?: boolean;
|
|
74
|
-
/** Number of days before re-showing dismissed hint (null = never show again) */
|
|
75
|
-
resetAfterDays?: number | null;
|
|
76
|
-
/** Delay before showing hint (ms) */
|
|
77
|
-
delayMs?: number;
|
|
78
|
-
/** App logo URL to display in hint */
|
|
79
|
-
logo?: string;
|
|
80
|
-
/**
|
|
81
|
-
* Resume last page when opening PWA
|
|
82
|
-
* When enabled, saves current pathname on navigation and restores it on PWA launch
|
|
83
|
-
* @default false
|
|
84
|
-
*/
|
|
85
|
-
resumeLastPage?: boolean;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Push Notifications Configuration Types
|
|
90
|
-
*
|
|
91
|
-
* Configuration for Web Push Notifications with VAPID authentication
|
|
92
|
-
*/
|
|
93
|
-
interface PushNotificationsConfig {
|
|
94
|
-
/** Enable push notifications */
|
|
95
|
-
enabled?: boolean;
|
|
96
|
-
/** VAPID public key for push notifications (required when enabled) */
|
|
97
|
-
vapidPublicKey: string;
|
|
98
|
-
/** API endpoint for subscription (default: '/api/push/subscribe') */
|
|
99
|
-
subscribeEndpoint?: string;
|
|
100
|
-
/** Only show push prompt if PWA is installed (default: true) */
|
|
101
|
-
requirePWA?: boolean;
|
|
102
|
-
/** Delay before showing push prompt after PWA install (ms) */
|
|
103
|
-
delayMs?: number;
|
|
104
|
-
/** Number of days before re-showing dismissed push prompt */
|
|
105
|
-
resetAfterDays?: number;
|
|
106
|
-
/** Auto-subscribe on mount if permission already granted */
|
|
107
|
-
autoSubscribe?: boolean;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Error Tracking Types
|
|
112
|
-
*
|
|
113
|
-
* Common types for all error tracking functionality
|
|
114
|
-
*/
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Base error detail from CustomEvent
|
|
118
|
-
*/
|
|
119
|
-
interface BaseErrorDetail {
|
|
120
|
-
/** Timestamp of the error */
|
|
121
|
-
timestamp: Date;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Validation error detail (from zod-validation-error event)
|
|
125
|
-
*/
|
|
126
|
-
interface ValidationErrorDetail extends BaseErrorDetail {
|
|
127
|
-
type: 'validation';
|
|
128
|
-
/** Operation/function name that failed validation */
|
|
129
|
-
operation: string;
|
|
130
|
-
/** API endpoint path */
|
|
131
|
-
path: string;
|
|
132
|
-
/** HTTP method */
|
|
133
|
-
method: string;
|
|
134
|
-
/** Zod validation error */
|
|
135
|
-
error: ZodError;
|
|
136
|
-
/** Raw response data that failed validation */
|
|
137
|
-
response: any;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* CORS error detail (from cors-error event)
|
|
141
|
-
*/
|
|
142
|
-
interface CORSErrorDetail extends BaseErrorDetail {
|
|
143
|
-
type: 'cors';
|
|
144
|
-
/** API endpoint that was blocked */
|
|
145
|
-
url: string;
|
|
146
|
-
/** HTTP method */
|
|
147
|
-
method: string;
|
|
148
|
-
/** Error message */
|
|
149
|
-
error: string;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Network error detail (from network-error event)
|
|
153
|
-
*/
|
|
154
|
-
interface NetworkErrorDetail extends BaseErrorDetail {
|
|
155
|
-
type: 'network';
|
|
156
|
-
/** API endpoint that failed */
|
|
157
|
-
url: string;
|
|
158
|
-
/** HTTP method */
|
|
159
|
-
method: string;
|
|
160
|
-
/** Error message */
|
|
161
|
-
error: string;
|
|
162
|
-
/** Status code if available */
|
|
163
|
-
statusCode?: number;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Centrifugo error detail (from centrifugo-error event)
|
|
167
|
-
*/
|
|
168
|
-
interface CentrifugoErrorDetail extends BaseErrorDetail {
|
|
169
|
-
type: 'centrifugo';
|
|
170
|
-
/** RPC method that failed */
|
|
171
|
-
method: string;
|
|
172
|
-
/** Error message */
|
|
173
|
-
error: string;
|
|
174
|
-
/** Error code from Centrifugo */
|
|
175
|
-
code?: number;
|
|
176
|
-
/** Additional data sent with the request */
|
|
177
|
-
data?: any;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Union type of all error details
|
|
181
|
-
*/
|
|
182
|
-
type ErrorDetail = ValidationErrorDetail | CORSErrorDetail | NetworkErrorDetail | CentrifugoErrorDetail;
|
|
183
|
-
/**
|
|
184
|
-
* Configuration for specific error type
|
|
185
|
-
*/
|
|
186
|
-
interface ErrorTypeConfig {
|
|
187
|
-
/**
|
|
188
|
-
* Enable tracking for this error type
|
|
189
|
-
* @default true
|
|
190
|
-
*/
|
|
191
|
-
enabled?: boolean;
|
|
192
|
-
/**
|
|
193
|
-
* Show toast notifications
|
|
194
|
-
* @default true
|
|
195
|
-
*/
|
|
196
|
-
showToast?: boolean;
|
|
197
|
-
/**
|
|
198
|
-
* Maximum number of errors to keep in history
|
|
199
|
-
* @default 50
|
|
200
|
-
*/
|
|
201
|
-
maxErrors?: number;
|
|
202
|
-
/**
|
|
203
|
-
* Toast duration in milliseconds (0 = no auto-dismiss)
|
|
204
|
-
* @default 8000 for validation, 0 for cors/network
|
|
205
|
-
*/
|
|
206
|
-
duration?: number;
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Validation error specific config
|
|
210
|
-
*/
|
|
211
|
-
interface ValidationErrorConfig extends ErrorTypeConfig {
|
|
212
|
-
/**
|
|
213
|
-
* Show operation name in toast
|
|
214
|
-
* @default true
|
|
215
|
-
*/
|
|
216
|
-
showOperation?: boolean;
|
|
217
|
-
/**
|
|
218
|
-
* Show endpoint path in toast
|
|
219
|
-
* @default true
|
|
220
|
-
*/
|
|
221
|
-
showPath?: boolean;
|
|
222
|
-
/**
|
|
223
|
-
* Show error count in toast
|
|
224
|
-
* @default true
|
|
225
|
-
*/
|
|
226
|
-
showErrorCount?: boolean;
|
|
227
|
-
/**
|
|
228
|
-
* Maximum number of issues to show in toast
|
|
229
|
-
* @default 3
|
|
230
|
-
*/
|
|
231
|
-
maxIssuesInToast?: number;
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* CORS error specific config
|
|
235
|
-
*/
|
|
236
|
-
interface CORSErrorConfig extends ErrorTypeConfig {
|
|
237
|
-
/**
|
|
238
|
-
* Show full URL in toast
|
|
239
|
-
* @default true
|
|
240
|
-
*/
|
|
241
|
-
showUrl?: boolean;
|
|
242
|
-
/**
|
|
243
|
-
* Show HTTP method in toast
|
|
244
|
-
* @default true
|
|
245
|
-
*/
|
|
246
|
-
showMethod?: boolean;
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Network error specific config
|
|
250
|
-
*/
|
|
251
|
-
interface NetworkErrorConfig extends ErrorTypeConfig {
|
|
252
|
-
/**
|
|
253
|
-
* Show full URL in toast
|
|
254
|
-
* @default true
|
|
255
|
-
*/
|
|
256
|
-
showUrl?: boolean;
|
|
257
|
-
/**
|
|
258
|
-
* Show HTTP method in toast
|
|
259
|
-
* @default true
|
|
260
|
-
*/
|
|
261
|
-
showMethod?: boolean;
|
|
262
|
-
/**
|
|
263
|
-
* Show status code in toast
|
|
264
|
-
* @default true
|
|
265
|
-
*/
|
|
266
|
-
showStatusCode?: boolean;
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Centrifugo error specific config
|
|
270
|
-
*/
|
|
271
|
-
interface CentrifugoErrorConfig extends ErrorTypeConfig {
|
|
272
|
-
/**
|
|
273
|
-
* Show RPC method in toast
|
|
274
|
-
* @default true
|
|
275
|
-
*/
|
|
276
|
-
showMethod?: boolean;
|
|
277
|
-
/**
|
|
278
|
-
* Show error code in toast
|
|
279
|
-
* @default true
|
|
280
|
-
*/
|
|
281
|
-
showCode?: boolean;
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
* Complete error tracking configuration
|
|
285
|
-
*/
|
|
286
|
-
interface ErrorTrackingConfig {
|
|
287
|
-
/**
|
|
288
|
-
* Validation error tracking configuration
|
|
289
|
-
*/
|
|
290
|
-
validation?: ValidationErrorConfig;
|
|
291
|
-
/**
|
|
292
|
-
* CORS error tracking configuration
|
|
293
|
-
*/
|
|
294
|
-
cors?: CORSErrorConfig;
|
|
295
|
-
/**
|
|
296
|
-
* Network error tracking configuration
|
|
297
|
-
*/
|
|
298
|
-
network?: NetworkErrorConfig;
|
|
299
|
-
/**
|
|
300
|
-
* Centrifugo error tracking configuration
|
|
301
|
-
*/
|
|
302
|
-
centrifugo?: CentrifugoErrorConfig;
|
|
303
|
-
/**
|
|
304
|
-
* Custom error handler (called before toast for all errors)
|
|
305
|
-
* Return false to prevent default toast notification
|
|
306
|
-
*/
|
|
307
|
-
onError?: (error: ErrorDetail) => boolean | void;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
* Error Handling Configuration Types
|
|
312
|
-
*
|
|
313
|
-
* Configuration types for ErrorTrackingProvider and ErrorBoundary
|
|
314
|
-
*/
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* Error Boundary Configuration
|
|
318
|
-
*
|
|
319
|
-
* Configuration for React ErrorBoundary component
|
|
320
|
-
*/
|
|
321
|
-
interface ErrorBoundaryConfig {
|
|
322
|
-
/** Enable error boundary (default: true) */
|
|
323
|
-
enabled?: boolean;
|
|
324
|
-
/** Support email to display in error UI */
|
|
325
|
-
supportEmail?: string;
|
|
326
|
-
/** Custom error handler called when error is caught */
|
|
327
|
-
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* UI Component Types
|
|
332
|
-
*
|
|
333
|
-
* Types for layout UI components (navigation, footer, user menu)
|
|
334
|
-
*/
|
|
335
|
-
|
|
336
|
-
interface NavigationItem {
|
|
337
|
-
label: string;
|
|
338
|
-
href: string;
|
|
339
|
-
icon?: LucideIcon | string;
|
|
340
|
-
badge?: string | number;
|
|
341
|
-
external?: boolean;
|
|
342
|
-
}
|
|
343
|
-
interface NavigationSection {
|
|
344
|
-
title?: string;
|
|
345
|
-
items: NavigationItem[];
|
|
346
|
-
}
|
|
347
|
-
interface FooterLink$1 {
|
|
348
|
-
label: string;
|
|
349
|
-
path: string;
|
|
350
|
-
external?: boolean;
|
|
351
|
-
}
|
|
352
|
-
interface FooterMenuSection$1 {
|
|
353
|
-
title: string;
|
|
354
|
-
items: FooterLink$1[];
|
|
355
|
-
}
|
|
356
|
-
interface FooterSocialLinks$1 {
|
|
357
|
-
github?: string;
|
|
358
|
-
linkedin?: string;
|
|
359
|
-
twitter?: string;
|
|
360
|
-
telegram?: string;
|
|
361
|
-
youtube?: string;
|
|
362
|
-
facebook?: string;
|
|
363
|
-
instagram?: string;
|
|
364
|
-
whatsapp?: string;
|
|
365
|
-
email?: string;
|
|
366
|
-
}
|
|
367
|
-
interface FooterConfig {
|
|
368
|
-
siteName?: string;
|
|
369
|
-
description?: string;
|
|
370
|
-
logo?: string;
|
|
371
|
-
badge?: {
|
|
372
|
-
icon: LucideIcon;
|
|
373
|
-
text: string;
|
|
374
|
-
};
|
|
375
|
-
socialLinks?: FooterSocialLinks$1;
|
|
376
|
-
links?: FooterLink$1[];
|
|
377
|
-
menuSections?: FooterMenuSection$1[];
|
|
378
|
-
copyright?: string;
|
|
379
|
-
credits?: {
|
|
380
|
-
text: string;
|
|
381
|
-
url?: string;
|
|
382
|
-
};
|
|
383
|
-
variant?: 'full' | 'simple';
|
|
384
|
-
}
|
|
385
|
-
interface UserMenuItem {
|
|
386
|
-
/** Menu item label */
|
|
387
|
-
label: string;
|
|
388
|
-
/** Link href (optional if onClick is provided) */
|
|
389
|
-
href?: string;
|
|
390
|
-
/** Icon component */
|
|
391
|
-
icon?: LucideIcon;
|
|
392
|
-
/** Visual variant */
|
|
393
|
-
variant?: 'default' | 'destructive';
|
|
394
|
-
/** Click handler (optional if href is provided) */
|
|
395
|
-
onClick?: () => void;
|
|
396
|
-
/** Open link in new tab */
|
|
397
|
-
external?: boolean;
|
|
398
|
-
}
|
|
399
|
-
interface UserMenuGroup {
|
|
400
|
-
/** Optional group title (renders DropdownMenuLabel) */
|
|
401
|
-
title?: string;
|
|
402
|
-
/** Menu items in this group */
|
|
403
|
-
items: UserMenuItem[];
|
|
404
|
-
}
|
|
405
|
-
interface UserMenuConfig {
|
|
406
|
-
/** Menu groups for authenticated users */
|
|
407
|
-
groups?: UserMenuGroup[];
|
|
408
|
-
/** Auth page path (for sign in button) */
|
|
409
|
-
authPath?: string;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
/**
|
|
413
|
-
* Base Layout Types
|
|
414
|
-
*
|
|
415
|
-
* Core layout configuration that combines all provider configs
|
|
416
|
-
*/
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* Base Layout Props
|
|
420
|
-
*
|
|
421
|
-
* Core configuration for BaseApp component.
|
|
422
|
-
* All provider configs are imported from their respective modules.
|
|
423
|
-
*/
|
|
424
|
-
interface BaseLayoutProps {
|
|
425
|
-
children: ReactNode;
|
|
426
|
-
/** Theme configuration */
|
|
427
|
-
theme?: ThemeConfig;
|
|
428
|
-
/** Auth configuration */
|
|
429
|
-
auth?: AuthConfig;
|
|
430
|
-
/** Analytics configuration (from snippets/Analytics) */
|
|
431
|
-
analytics?: AnalyticsConfig;
|
|
432
|
-
/** Centrifugo configuration */
|
|
433
|
-
centrifugo?: CentrifugoConfig;
|
|
434
|
-
/** Error tracking configuration (from components/errors) */
|
|
435
|
-
errorTracking?: ErrorTrackingConfig;
|
|
436
|
-
/** SWR configuration */
|
|
437
|
-
swr?: SWRConfigOptions;
|
|
438
|
-
/** Error boundary configuration (from components/errors, enabled by default) */
|
|
439
|
-
errorBoundary?: ErrorBoundaryConfig;
|
|
440
|
-
/** MCP chat configuration */
|
|
441
|
-
mcpChat?: McpChatConfig;
|
|
442
|
-
/** PWA Install configuration (from snippets/PWAInstall) */
|
|
443
|
-
pwaInstall?: PwaInstallConfig;
|
|
444
|
-
/** Push Notifications configuration (from snippets/PushNotifications) */
|
|
445
|
-
pushNotifications?: PushNotificationsConfig;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
interface UserMenuProps {
|
|
449
|
-
/** Display variant */
|
|
450
|
-
variant?: 'desktop' | 'mobile';
|
|
451
|
-
/** Menu groups for authenticated users */
|
|
452
|
-
groups?: UserMenuGroup[];
|
|
453
|
-
/** Auth page path (for sign in button) */
|
|
454
|
-
authPath?: string;
|
|
455
|
-
}
|
|
456
|
-
declare function UserMenu({ variant, groups, authPath, }: UserMenuProps): react_jsx_runtime.JSX.Element;
|
|
457
|
-
|
|
458
|
-
type LayoutMode = 'public' | 'private' | 'admin';
|
|
459
|
-
interface AppLayoutProps {
|
|
460
|
-
children: ReactNode;
|
|
461
|
-
/** Public layout component with enabled paths */
|
|
462
|
-
publicLayout?: {
|
|
463
|
-
component: React.ComponentType<{
|
|
464
|
-
children: ReactNode;
|
|
465
|
-
}>;
|
|
466
|
-
enabledPath?: string | string[];
|
|
467
|
-
};
|
|
468
|
-
/** Private layout component with enabled paths */
|
|
469
|
-
privateLayout?: {
|
|
470
|
-
component: React.ComponentType<{
|
|
471
|
-
children: ReactNode;
|
|
472
|
-
}>;
|
|
473
|
-
enabledPath?: string | string[];
|
|
474
|
-
};
|
|
475
|
-
/** Admin layout component with enabled paths */
|
|
476
|
-
adminLayout?: {
|
|
477
|
-
component: React.ComponentType<{
|
|
478
|
-
children: ReactNode;
|
|
479
|
-
}>;
|
|
480
|
-
enabledPath?: string | string[];
|
|
481
|
-
};
|
|
482
|
-
/**
|
|
483
|
-
* Paths that render without any layout wrapper (fullscreen pages)
|
|
484
|
-
* Providers (auth, theme, etc.) are still applied, only layout is skipped
|
|
485
|
-
* Useful for: fullscreen terminal, embed pages, print views
|
|
486
|
-
*/
|
|
487
|
-
noLayoutPaths?: string | string[];
|
|
488
|
-
/** Theme configuration */
|
|
489
|
-
theme?: ThemeConfig;
|
|
490
|
-
/** Auth configuration */
|
|
491
|
-
auth?: AuthConfig;
|
|
492
|
-
/** Analytics configuration */
|
|
493
|
-
analytics?: AnalyticsConfig;
|
|
494
|
-
/** Centrifugo configuration */
|
|
495
|
-
centrifugo?: CentrifugoConfig;
|
|
496
|
-
/** Error tracking configuration */
|
|
497
|
-
errorTracking?: ErrorTrackingConfig;
|
|
498
|
-
/** SWR configuration */
|
|
499
|
-
swr?: SWRConfigOptions;
|
|
500
|
-
/** Error boundary configuration */
|
|
501
|
-
errorBoundary?: ErrorBoundaryConfig;
|
|
502
|
-
/** MCP Chat configuration */
|
|
503
|
-
mcpChat?: McpChatConfig;
|
|
504
|
-
/** PWA Install configuration */
|
|
505
|
-
pwaInstall?: PwaInstallConfig;
|
|
506
|
-
/** Push Notifications configuration */
|
|
507
|
-
pushNotifications?: PushNotificationsConfig;
|
|
508
|
-
}
|
|
509
|
-
/**
|
|
510
|
-
* AppLayout - Main Component with All Providers
|
|
511
|
-
*/
|
|
512
|
-
declare function AppLayout(props: AppLayoutProps): react_jsx_runtime.JSX.Element;
|
|
513
|
-
|
|
514
|
-
type BaseAppProps = BaseLayoutProps;
|
|
515
|
-
/**
|
|
516
|
-
* BaseApp - Core providers wrapper for any React/Next.js app
|
|
517
|
-
*
|
|
518
|
-
* Includes: ThemeProvider, TooltipProvider, SWRConfig, AuthProvider, AnalyticsProvider,
|
|
519
|
-
* CentrifugoProvider, PwaProvider, PushProvider, ErrorTrackingProvider,
|
|
520
|
-
* ErrorBoundary (optional), MCP Chat (optional)
|
|
521
|
-
* Also renders global Toaster and PageProgress components
|
|
522
|
-
*/
|
|
523
|
-
declare function BaseApp({ children, theme, auth, analytics, centrifugo, errorTracking, errorBoundary, swr, mcpChat, pwaInstall, pushNotifications, }: BaseAppProps): react_jsx_runtime.JSX.Element;
|
|
524
|
-
|
|
525
|
-
interface PublicLayoutProps {
|
|
526
|
-
children: ReactNode;
|
|
527
|
-
/** Logo path or URL */
|
|
528
|
-
logo?: string;
|
|
529
|
-
/** Site name */
|
|
530
|
-
siteName?: string;
|
|
531
|
-
/** Navigation items */
|
|
532
|
-
navigation?: NavigationItem[];
|
|
533
|
-
/** User menu configuration (optional, uses useAuth() for authentication state) */
|
|
534
|
-
userMenu?: UserMenuConfig;
|
|
535
|
-
}
|
|
536
|
-
declare function PublicLayout({ children, logo, siteName, navigation, userMenu, }: PublicLayoutProps): react_jsx_runtime.JSX.Element;
|
|
537
|
-
|
|
538
|
-
/**
|
|
539
|
-
* Public Footer Types
|
|
540
|
-
*/
|
|
541
|
-
|
|
542
|
-
interface FooterLink {
|
|
543
|
-
label: string;
|
|
544
|
-
path: string;
|
|
545
|
-
external?: boolean;
|
|
546
|
-
}
|
|
547
|
-
interface FooterMenuSection {
|
|
548
|
-
title: string;
|
|
549
|
-
items: FooterLink[];
|
|
550
|
-
}
|
|
551
|
-
interface FooterSocialLinks {
|
|
552
|
-
github?: string;
|
|
553
|
-
linkedin?: string;
|
|
554
|
-
twitter?: string;
|
|
555
|
-
telegram?: string;
|
|
556
|
-
youtube?: string;
|
|
557
|
-
facebook?: string;
|
|
558
|
-
instagram?: string;
|
|
559
|
-
whatsapp?: string;
|
|
560
|
-
email?: string;
|
|
561
|
-
}
|
|
562
|
-
interface PublicFooterProps {
|
|
563
|
-
/** Project name */
|
|
564
|
-
siteName: string;
|
|
565
|
-
/** Project description */
|
|
566
|
-
description?: string;
|
|
567
|
-
/** Logo path or URL */
|
|
568
|
-
logo?: string;
|
|
569
|
-
/** Optional badge */
|
|
570
|
-
badge?: {
|
|
571
|
-
icon: LucideIcon;
|
|
572
|
-
text: string;
|
|
573
|
-
};
|
|
574
|
-
/** Social media links */
|
|
575
|
-
socialLinks?: FooterSocialLinks;
|
|
576
|
-
/** Quick links (bottom bar) */
|
|
577
|
-
links?: FooterLink[];
|
|
578
|
-
/** Footer menu sections (desktop grid) */
|
|
579
|
-
menuSections?: FooterMenuSection[];
|
|
580
|
-
/** Copyright text (auto-generated if not provided) */
|
|
581
|
-
copyright?: string;
|
|
582
|
-
/** Credits */
|
|
583
|
-
credits?: {
|
|
584
|
-
text: string;
|
|
585
|
-
url?: string;
|
|
586
|
-
};
|
|
587
|
-
/** Variant: full (with all sections) or simple (minimal) */
|
|
588
|
-
variant?: 'full' | 'simple';
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
declare function PublicFooter({ siteName, description, logo, badge, socialLinks, links, menuSections, copyright: copyrightProp, credits: creditsProp, variant, }: PublicFooterProps): react_jsx_runtime.JSX.Element;
|
|
592
|
-
|
|
593
|
-
interface FooterProjectInfoProps {
|
|
594
|
-
siteName: string;
|
|
595
|
-
description?: string;
|
|
596
|
-
logo?: string;
|
|
597
|
-
badge?: {
|
|
598
|
-
icon: LucideIcon;
|
|
599
|
-
text: string;
|
|
600
|
-
};
|
|
601
|
-
socialLinks?: FooterSocialLinks;
|
|
602
|
-
variant?: 'mobile' | 'desktop';
|
|
603
|
-
}
|
|
604
|
-
declare function FooterProjectInfo({ siteName, description, logo, badge, socialLinks, variant, }: FooterProjectInfoProps): react_jsx_runtime.JSX.Element;
|
|
605
|
-
|
|
606
|
-
interface FooterMenuSectionsProps {
|
|
607
|
-
menuSections: FooterMenuSection[];
|
|
608
|
-
}
|
|
609
|
-
declare function FooterMenuSections({ menuSections }: FooterMenuSectionsProps): react_jsx_runtime.JSX.Element;
|
|
610
|
-
|
|
611
|
-
interface FooterBottomProps {
|
|
612
|
-
copyright: string;
|
|
613
|
-
credits?: {
|
|
614
|
-
text: string;
|
|
615
|
-
url?: string;
|
|
616
|
-
};
|
|
617
|
-
links?: FooterLink[];
|
|
618
|
-
variant?: 'mobile' | 'desktop';
|
|
619
|
-
}
|
|
620
|
-
declare function FooterBottom({ copyright, credits, links, variant, }: FooterBottomProps): react_jsx_runtime.JSX.Element;
|
|
621
|
-
|
|
622
|
-
interface FooterSocialLinksProps {
|
|
623
|
-
socialLinks?: FooterSocialLinks;
|
|
624
|
-
className?: string;
|
|
625
|
-
iconClassName?: string;
|
|
626
|
-
}
|
|
627
|
-
declare function FooterSocialLinksComponent({ socialLinks, className, iconClassName, }: FooterSocialLinksProps): react_jsx_runtime.JSX.Element;
|
|
628
|
-
|
|
629
|
-
/**
|
|
630
|
-
* DjangoCFG Logo Component
|
|
631
|
-
*
|
|
632
|
-
* Default SVG logo for DjangoCFG
|
|
633
|
-
*/
|
|
634
|
-
interface DjangoCFGLogoProps {
|
|
635
|
-
className?: string;
|
|
636
|
-
size?: number;
|
|
637
|
-
}
|
|
638
|
-
declare function DjangoCFGLogo({ className, size }: DjangoCFGLogoProps): react_jsx_runtime.JSX.Element;
|
|
639
|
-
|
|
640
|
-
interface SidebarItem {
|
|
641
|
-
label: string;
|
|
642
|
-
href: string;
|
|
643
|
-
icon?: string | LucideIcon;
|
|
644
|
-
badge?: string | number;
|
|
645
|
-
}
|
|
646
|
-
interface SidebarConfig {
|
|
647
|
-
items: SidebarItem[];
|
|
648
|
-
homeHref?: string;
|
|
649
|
-
}
|
|
650
|
-
interface HeaderConfig {
|
|
651
|
-
title?: string;
|
|
652
|
-
/** User menu groups */
|
|
653
|
-
groups?: UserMenuConfig['groups'];
|
|
654
|
-
/** Auth page path (for sign in button) */
|
|
655
|
-
authPath?: string;
|
|
656
|
-
}
|
|
657
|
-
interface PrivateLayoutProps {
|
|
658
|
-
children: ReactNode;
|
|
659
|
-
/** Sidebar configuration */
|
|
660
|
-
sidebar?: SidebarConfig;
|
|
661
|
-
/** Header configuration */
|
|
662
|
-
header?: HeaderConfig;
|
|
663
|
-
/** Content padding */
|
|
664
|
-
contentPadding?: 'none' | 'default';
|
|
665
|
-
}
|
|
666
|
-
declare function PrivateLayout({ children, sidebar, header, contentPadding, }: PrivateLayoutProps): react_jsx_runtime.JSX.Element;
|
|
667
|
-
|
|
668
|
-
/**
|
|
669
|
-
* Auth Layout
|
|
670
|
-
*
|
|
671
|
-
* Layout for authentication pages with OTP (email/phone), OAuth (GitHub), and 2FA support.
|
|
672
|
-
* Supports multi-step authentication flow: identifier → OTP → 2FA (if enabled)
|
|
673
|
-
*/
|
|
674
|
-
|
|
675
|
-
declare const AuthLayout: React.FC<AuthLayoutProps>;
|
|
676
|
-
|
|
677
|
-
declare const AuthFormProvider: React.FC<AuthLayoutProps>;
|
|
678
|
-
declare const useAuthFormContext: () => AuthFormContextType;
|
|
679
|
-
|
|
680
|
-
declare const IdentifierForm: React.FC;
|
|
681
|
-
|
|
682
|
-
declare const OTPForm: React.FC;
|
|
683
|
-
|
|
684
|
-
declare const AuthHelp: React.FC<AuthHelpProps>;
|
|
685
|
-
|
|
686
|
-
/**
|
|
687
|
-
* OAuth Providers Component
|
|
688
|
-
*
|
|
689
|
-
* Shows OAuth login buttons (GitHub, etc.) when enabled.
|
|
690
|
-
*/
|
|
691
|
-
declare const OAuthProviders: React.FC;
|
|
692
|
-
|
|
693
|
-
interface OAuthCallbackProps {
|
|
694
|
-
onSuccess?: (user: any, isNewUser: boolean, provider: string) => void;
|
|
695
|
-
onError?: (error: string) => void;
|
|
696
|
-
redirectUrl?: string;
|
|
697
|
-
}
|
|
698
|
-
/**
|
|
699
|
-
* OAuth Callback Handler Component
|
|
700
|
-
*
|
|
701
|
-
* Processes OAuth callback from providers (GitHub, etc.).
|
|
702
|
-
* Reads code, state, and provider from URL params and exchanges for tokens.
|
|
703
|
-
*
|
|
704
|
-
* Usage:
|
|
705
|
-
* Place this component on your /auth page to handle OAuth callbacks.
|
|
706
|
-
*
|
|
707
|
-
* @example
|
|
708
|
-
* ```tsx
|
|
709
|
-
* // app/auth/page.tsx
|
|
710
|
-
* import { OAuthCallback, AuthLayout } from '@djangocfg/layouts';
|
|
711
|
-
*
|
|
712
|
-
* export default function AuthPage() {
|
|
713
|
-
* return (
|
|
714
|
-
* <>
|
|
715
|
-
* <OAuthCallback
|
|
716
|
-
* onSuccess={(user) => console.log('OAuth success:', user)}
|
|
717
|
-
* onError={(error) => console.error('OAuth error:', error)}
|
|
718
|
-
* />
|
|
719
|
-
* <AuthLayout enableGithubAuth>
|
|
720
|
-
* {/* Your auth content *\/}
|
|
721
|
-
* </AuthLayout>
|
|
722
|
-
* </>
|
|
723
|
-
* );
|
|
724
|
-
* }
|
|
725
|
-
* ```
|
|
726
|
-
*/
|
|
727
|
-
declare const OAuthCallback: React.FC<OAuthCallbackProps>;
|
|
728
|
-
|
|
729
|
-
interface AdminLayoutProps extends PrivateLayoutProps {
|
|
730
|
-
children: ReactNode;
|
|
731
|
-
}
|
|
732
|
-
/**
|
|
733
|
-
* Admin Layout Component
|
|
734
|
-
*
|
|
735
|
-
* Wrapper around PrivateLayout with admin-specific defaults
|
|
736
|
-
* Same API as PrivateLayout - just a convenience export
|
|
737
|
-
*/
|
|
738
|
-
declare function AdminLayout(props: AdminLayoutProps): react_jsx_runtime.JSX.Element;
|
|
739
|
-
|
|
740
|
-
interface ProfileLayoutProps {
|
|
741
|
-
onUnauthenticated?: () => void;
|
|
742
|
-
title?: string;
|
|
743
|
-
enable2FA?: boolean;
|
|
744
|
-
enableDeleteAccount?: boolean;
|
|
745
|
-
}
|
|
746
|
-
declare const ProfileLayout: React.FC<ProfileLayoutProps>;
|
|
747
|
-
|
|
748
|
-
export { AdminLayout, type AdminLayoutProps, type AnalyticsConfig, AppLayout, type AppLayoutProps, AuthFormProvider, AuthHelp, AuthLayout, BaseApp, type BaseAppProps, type BaseLayoutProps, type CORSErrorConfig, type CentrifugoConfig, DjangoCFGLogo, type ErrorBoundaryConfig, type ErrorTrackingConfig, FooterBottom, type FooterConfig, type FooterLink$1 as FooterLink, type FooterMenuSection$1 as FooterMenuSection, FooterMenuSections, FooterProjectInfo, type FooterSocialLinks$1 as FooterSocialLinks, FooterSocialLinksComponent, type HeaderConfig, IdentifierForm, type LayoutMode, type McpChatConfig, type NavigationItem, type NavigationSection, type NetworkErrorConfig, OAuthCallback, type OAuthCallbackProps, OAuthProviders, OTPForm, PrivateLayout, type PrivateLayoutProps, ProfileLayout, PublicFooter, type PublicFooterProps, PublicLayout, type PublicLayoutProps, type PushNotificationsConfig, type PwaInstallConfig, type SWRConfigOptions, type SidebarConfig, type SidebarItem, type ThemeConfig, UserMenu, type UserMenuConfig, type UserMenuGroup, type UserMenuItem, type UserMenuProps, type ValidationErrorConfig, useAuthFormContext };
|