@djangocfg/layouts 1.4.27 → 1.4.29

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 (118) hide show
  1. package/package.json +8 -8
  2. package/src/auth/context/AuthContext.tsx +4 -1
  3. package/src/auth/hooks/index.ts +2 -0
  4. package/src/auth/hooks/useAuthForm.ts +2 -0
  5. package/src/auth/hooks/useAuthGuard.ts +2 -0
  6. package/src/auth/hooks/useAutoAuth.ts +16 -11
  7. package/src/auth/hooks/useLocalStorage.ts +2 -0
  8. package/src/auth/hooks/useProfileCache.ts +2 -0
  9. package/src/auth/hooks/useSessionStorage.ts +2 -0
  10. package/src/auth/middlewares/index.ts +1 -1
  11. package/src/auth/middlewares/proxy.ts +10 -2
  12. package/src/layouts/AppLayout/AppLayout.tsx +9 -7
  13. package/src/layouts/AppLayout/components/ErrorBoundary.tsx +6 -3
  14. package/src/layouts/AppLayout/components/PageProgress.tsx +2 -0
  15. package/src/layouts/AppLayout/components/Seo.tsx +2 -0
  16. package/src/layouts/AppLayout/components/UpdateNotifier/UpdateNotifier.tsx +3 -2
  17. package/src/layouts/AppLayout/hooks/index.ts +2 -0
  18. package/src/layouts/AppLayout/hooks/useNavigation.ts +3 -1
  19. package/src/layouts/AppLayout/layouts/AdminLayout/AdminLayout.tsx +1 -0
  20. package/src/layouts/AppLayout/layouts/AuthLayout/AuthContext.tsx +2 -0
  21. package/src/layouts/AppLayout/layouts/AuthLayout/IdentifierForm.tsx +2 -0
  22. package/src/layouts/AppLayout/layouts/AuthLayout/OTPForm.tsx +4 -0
  23. package/src/layouts/AppLayout/layouts/AuthLayout/index.ts +2 -0
  24. package/src/layouts/AppLayout/layouts/PrivateLayout/PrivateLayout.tsx +1 -0
  25. package/src/layouts/AppLayout/providers/CoreProviders.tsx +1 -0
  26. package/src/layouts/PaymentsLayout/PaymentsLayout.tsx +1 -0
  27. package/src/layouts/PaymentsLayout/components/CreatePaymentDialog.tsx +1 -0
  28. package/src/layouts/PaymentsLayout/events.ts +2 -0
  29. package/src/layouts/ProfileLayout/ProfileLayout.tsx +1 -0
  30. package/src/layouts/ProfileLayout/components/ProfileForm.tsx +1 -0
  31. package/src/layouts/SimpleLayout/SimpleLayout.tsx +72 -0
  32. package/src/layouts/SimpleLayout/index.ts +3 -0
  33. package/src/layouts/SupportLayout/SupportLayout.tsx +1 -0
  34. package/src/layouts/SupportLayout/components/CreateTicketDialog.tsx +1 -0
  35. package/src/layouts/SupportLayout/components/TicketList.tsx +6 -5
  36. package/src/layouts/SupportLayout/events.ts +2 -0
  37. package/src/layouts/index.ts +1 -3
  38. package/src/snippets/AuthDialog/useAuthDialog.ts +2 -0
  39. package/src/snippets/Chat/components/MessageList.tsx +12 -11
  40. package/src/snippets/Chat/index.tsx +1 -0
  41. package/src/snippets/ContactForm/ContactForm.tsx +7 -2
  42. package/src/snippets/ContactForm/ContactPage.tsx +16 -3
  43. package/src/snippets/VideoPlayer/README.md +35 -0
  44. package/src/snippets/VideoPlayer/VideoControls.tsx +13 -9
  45. package/src/snippets/VideoPlayer/VideoPlayer.tsx +159 -25
  46. package/src/snippets/VideoPlayer/index.ts +1 -1
  47. package/src/validation/utils/curl-generator.ts +5 -1
  48. package/src/layouts/UILayout/README.md +0 -267
  49. package/src/layouts/UILayout/SUMMARY.md +0 -298
  50. package/src/layouts/UILayout/TOOLS_INTEGRATION.md +0 -216
  51. package/src/layouts/UILayout/components/AutoComponentDemo.tsx +0 -77
  52. package/src/layouts/UILayout/components/CategoryRenderer.tsx +0 -45
  53. package/src/layouts/UILayout/components/TailwindGuideRenderer.tsx +0 -138
  54. package/src/layouts/UILayout/components/index.ts +0 -15
  55. package/src/layouts/UILayout/components/layout/Header/CopyAIButton.tsx +0 -58
  56. package/src/layouts/UILayout/components/layout/Header/Header.tsx +0 -60
  57. package/src/layouts/UILayout/components/layout/Header/HeaderDesktop.tsx +0 -51
  58. package/src/layouts/UILayout/components/layout/Header/HeaderMobile.tsx +0 -71
  59. package/src/layouts/UILayout/components/layout/Header/TestValidationButton.tsx +0 -268
  60. package/src/layouts/UILayout/components/layout/Header/index.ts +0 -11
  61. package/src/layouts/UILayout/components/layout/MobileOverlay/MobileOverlay.tsx +0 -47
  62. package/src/layouts/UILayout/components/layout/MobileOverlay/index.ts +0 -6
  63. package/src/layouts/UILayout/components/layout/Sidebar/Sidebar.tsx +0 -95
  64. package/src/layouts/UILayout/components/layout/Sidebar/SidebarCategory.tsx +0 -54
  65. package/src/layouts/UILayout/components/layout/Sidebar/SidebarContent.tsx +0 -93
  66. package/src/layouts/UILayout/components/layout/Sidebar/SidebarFooter.tsx +0 -49
  67. package/src/layouts/UILayout/components/layout/Sidebar/index.ts +0 -9
  68. package/src/layouts/UILayout/components/layout/index.ts +0 -8
  69. package/src/layouts/UILayout/components/shared/Badge/CountBadge.tsx +0 -38
  70. package/src/layouts/UILayout/components/shared/Badge/index.ts +0 -5
  71. package/src/layouts/UILayout/components/shared/CodeBlock/CodeBlock.tsx +0 -48
  72. package/src/layouts/UILayout/components/shared/CodeBlock/CopyButton.tsx +0 -49
  73. package/src/layouts/UILayout/components/shared/CodeBlock/index.ts +0 -6
  74. package/src/layouts/UILayout/components/shared/Section/Section.tsx +0 -63
  75. package/src/layouts/UILayout/components/shared/Section/index.ts +0 -5
  76. package/src/layouts/UILayout/components/shared/index.ts +0 -8
  77. package/src/layouts/UILayout/config/ai-export.config.ts +0 -89
  78. package/src/layouts/UILayout/config/categories.config.tsx +0 -122
  79. package/src/layouts/UILayout/config/components/blocks.config.tsx +0 -239
  80. package/src/layouts/UILayout/config/components/data.config.tsx +0 -433
  81. package/src/layouts/UILayout/config/components/feedback.config.tsx +0 -290
  82. package/src/layouts/UILayout/config/components/forms.config.tsx +0 -996
  83. package/src/layouts/UILayout/config/components/hooks.config.tsx +0 -168
  84. package/src/layouts/UILayout/config/components/index.ts +0 -72
  85. package/src/layouts/UILayout/config/components/layout.config.tsx +0 -246
  86. package/src/layouts/UILayout/config/components/navigation.config.tsx +0 -352
  87. package/src/layouts/UILayout/config/components/overlay.config.tsx +0 -569
  88. package/src/layouts/UILayout/config/components/specialized.config.tsx +0 -400
  89. package/src/layouts/UILayout/config/components/tools.config.tsx +0 -234
  90. package/src/layouts/UILayout/config/components/types.ts +0 -14
  91. package/src/layouts/UILayout/config/index.ts +0 -42
  92. package/src/layouts/UILayout/config/tailwind.config.ts +0 -131
  93. package/src/layouts/UILayout/constants.ts +0 -23
  94. package/src/layouts/UILayout/context/ShowcaseContext.tsx +0 -81
  95. package/src/layouts/UILayout/context/index.ts +0 -1
  96. package/src/layouts/UILayout/core/UIGuideApp.client.tsx +0 -18
  97. package/src/layouts/UILayout/core/UIGuideApp.tsx +0 -33
  98. package/src/layouts/UILayout/core/UIGuideLanding.tsx +0 -172
  99. package/src/layouts/UILayout/core/UIGuideView.tsx +0 -61
  100. package/src/layouts/UILayout/core/UILayout.tsx +0 -125
  101. package/src/layouts/UILayout/core/UILayoutSidebar.tsx +0 -11
  102. package/src/layouts/UILayout/core/index.ts +0 -10
  103. package/src/layouts/UILayout/hooks/index.ts +0 -9
  104. package/src/layouts/UILayout/hooks/useAIExport.ts +0 -78
  105. package/src/layouts/UILayout/hooks/useCategoryNavigation.ts +0 -92
  106. package/src/layouts/UILayout/hooks/useComponentSearch.ts +0 -81
  107. package/src/layouts/UILayout/hooks/useSidebarState.ts +0 -36
  108. package/src/layouts/UILayout/index.ts +0 -160
  109. package/src/layouts/UILayout/types/component.ts +0 -45
  110. package/src/layouts/UILayout/types/index.ts +0 -23
  111. package/src/layouts/UILayout/types/layout.ts +0 -57
  112. package/src/layouts/UILayout/types/navigation.ts +0 -33
  113. package/src/layouts/UILayout/utils/ai-export/formatters.ts +0 -71
  114. package/src/layouts/UILayout/utils/ai-export/index.ts +0 -5
  115. package/src/layouts/UILayout/utils/component-helpers/filter.ts +0 -109
  116. package/src/layouts/UILayout/utils/component-helpers/index.ts +0 -6
  117. package/src/layouts/UILayout/utils/component-helpers/search.ts +0 -95
  118. package/src/layouts/UILayout/utils/index.ts +0 -6
@@ -1,290 +0,0 @@
1
- /**
2
- * Feedback Components Configuration
3
- */
4
-
5
- import React from 'react';
6
- import {
7
- Alert,
8
- AlertDescription,
9
- AlertTitle,
10
- Progress,
11
- Badge,
12
- Avatar,
13
- AvatarFallback,
14
- AvatarImage,
15
- Button,
16
- useToast,
17
- Toaster,
18
- } from '@djangocfg/ui';
19
- import type { ComponentConfig } from './types';
20
-
21
- // Toast Preview Component
22
- function ToastPreview() {
23
- const { toast } = useToast();
24
-
25
- return (
26
- <div className="p-4 border rounded-md bg-muted/30">
27
- <p className="text-sm text-muted-foreground mb-3">
28
- Toast is a hook-based component. Click buttons to trigger toasts:
29
- </p>
30
- <div className="space-x-2">
31
- <Button
32
- onClick={() => {
33
- toast({
34
- title: "Success!",
35
- description: "Your changes have been saved.",
36
- });
37
- }}
38
- >
39
- Show Toast
40
- </Button>
41
- <Button
42
- variant="destructive"
43
- onClick={() => {
44
- toast({
45
- variant: "destructive",
46
- title: "Error!",
47
- description: "Something went wrong.",
48
- });
49
- }}
50
- >
51
- Show Error Toast
52
- </Button>
53
- </div>
54
- <p className="text-xs text-muted-foreground mt-3">
55
- ✓ Toaster is globally available via AppLayout
56
- </p>
57
- </div>
58
- );
59
- }
60
-
61
- export const FEEDBACK_COMPONENTS: ComponentConfig[] = [
62
- {
63
- name: 'Toast',
64
- category: 'feedback',
65
- description: 'Toast notifications for user feedback',
66
- importPath: `import { useToast, Button } from '@djangocfg/ui';`,
67
- example: `function Component() {
68
- const { toast } = useToast();
69
-
70
- return (
71
- <div className="space-x-2">
72
- <Button
73
- onClick={() => {
74
- toast({
75
- title: "Success!",
76
- description: "Your changes have been saved.",
77
- });
78
- }}
79
- >
80
- Show Toast
81
- </Button>
82
- <Button
83
- variant="destructive"
84
- onClick={() => {
85
- toast({
86
- variant: "destructive",
87
- title: "Error!",
88
- description: "Something went wrong.",
89
- });
90
- }}
91
- >
92
- Show Error Toast
93
- </Button>
94
- </div>
95
- );
96
- }`,
97
- preview: <ToastPreview />,
98
- },
99
- {
100
- name: 'Alert',
101
- category: 'feedback',
102
- description: 'Alert messages for important information',
103
- importPath: `import { Alert, AlertDescription, AlertTitle } from '@djangocfg/ui';`,
104
- example: `<div className="space-y-4">
105
- <Alert>
106
- <AlertTitle>Heads up!</AlertTitle>
107
- <AlertDescription>
108
- You can add components to your app using the cli.
109
- </AlertDescription>
110
- </Alert>
111
-
112
- <Alert variant="destructive">
113
- <AlertTitle>Error</AlertTitle>
114
- <AlertDescription>
115
- Your session has expired. Please log in again.
116
- </AlertDescription>
117
- </Alert>
118
- </div>`,
119
- preview: (
120
- <div className="space-y-4">
121
- <Alert>
122
- <AlertTitle>Heads up!</AlertTitle>
123
- <AlertDescription>
124
- You can add components to your app using the cli.
125
- </AlertDescription>
126
- </Alert>
127
-
128
- <Alert variant="destructive">
129
- <AlertTitle>Error</AlertTitle>
130
- <AlertDescription>
131
- Your session has expired. Please log in again.
132
- </AlertDescription>
133
- </Alert>
134
- </div>
135
- ),
136
- },
137
- {
138
- name: 'Progress',
139
- category: 'feedback',
140
- description: 'Progress bar for showing completion status',
141
- importPath: `import { Progress } from '@djangocfg/ui';`,
142
- example: `<div className="space-y-4 max-w-md">
143
- <div>
144
- <div className="flex justify-between mb-2">
145
- <span className="text-sm">25%</span>
146
- </div>
147
- <Progress value={25} />
148
- </div>
149
-
150
- <div>
151
- <div className="flex justify-between mb-2">
152
- <span className="text-sm">50%</span>
153
- </div>
154
- <Progress value={50} />
155
- </div>
156
-
157
- <div>
158
- <div className="flex justify-between mb-2">
159
- <span className="text-sm">75%</span>
160
- </div>
161
- <Progress value={75} />
162
- </div>
163
- </div>`,
164
- preview: (
165
- <div className="space-y-4 max-w-md">
166
- <div>
167
- <div className="flex justify-between mb-2">
168
- <span className="text-sm">25%</span>
169
- </div>
170
- <Progress value={25} />
171
- </div>
172
-
173
- <div>
174
- <div className="flex justify-between mb-2">
175
- <span className="text-sm">50%</span>
176
- </div>
177
- <Progress value={50} />
178
- </div>
179
-
180
- <div>
181
- <div className="flex justify-between mb-2">
182
- <span className="text-sm">75%</span>
183
- </div>
184
- <Progress value={75} />
185
- </div>
186
- </div>
187
- ),
188
- },
189
- {
190
- name: 'Badge',
191
- category: 'feedback',
192
- description: 'Status badges for labels and categories',
193
- importPath: `import { Badge } from '@djangocfg/ui';`,
194
- example: `<div className="flex gap-2 flex-wrap">
195
- <Badge>Default</Badge>
196
- <Badge variant="secondary">Secondary</Badge>
197
- <Badge variant="destructive">Destructive</Badge>
198
- <Badge variant="outline">Outline</Badge>
199
- </div>`,
200
- preview: (
201
- <div className="flex gap-2 flex-wrap">
202
- <Badge>Default</Badge>
203
- <Badge variant="secondary">Secondary</Badge>
204
- <Badge variant="destructive">Destructive</Badge>
205
- <Badge variant="outline">Outline</Badge>
206
- </div>
207
- ),
208
- },
209
- {
210
- name: 'Avatar',
211
- category: 'feedback',
212
- description: 'User avatar with fallback support',
213
- importPath: `import { Avatar, AvatarFallback, AvatarImage } from '@djangocfg/ui';`,
214
- example: `<div className="flex gap-4">
215
- <Avatar>
216
- <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
217
- <AvatarFallback>CN</AvatarFallback>
218
- </Avatar>
219
-
220
- <Avatar>
221
- <AvatarImage src="/nonexistent.png" alt="@user" />
222
- <AvatarFallback>JD</AvatarFallback>
223
- </Avatar>
224
-
225
- <Avatar>
226
- <AvatarFallback>AB</AvatarFallback>
227
- </Avatar>
228
- </div>`,
229
- preview: (
230
- <div className="flex gap-4">
231
- <Avatar>
232
- <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
233
- <AvatarFallback>CN</AvatarFallback>
234
- </Avatar>
235
-
236
- <Avatar>
237
- <AvatarImage src="/nonexistent.png" alt="@user" />
238
- <AvatarFallback>JD</AvatarFallback>
239
- </Avatar>
240
-
241
- <Avatar>
242
- <AvatarFallback>AB</AvatarFallback>
243
- </Avatar>
244
- </div>
245
- ),
246
- },
247
- {
248
- name: 'Toaster',
249
- category: 'feedback',
250
- description: 'Global toast notification container (works with Toast component)',
251
- importPath: `import { Toaster, useToast } from '@djangocfg/ui';`,
252
- example: `// Add Toaster once in your app layout
253
- <Toaster />
254
-
255
- // Then use the useToast hook anywhere
256
- function MyComponent() {
257
- const { toast } = useToast();
258
-
259
- return (
260
- <Button
261
- onClick={() => {
262
- toast({
263
- title: "Scheduled: Catch up",
264
- description: "Friday, February 10, 2023 at 5:57 PM",
265
- });
266
- }}
267
- >
268
- Show Toast
269
- </Button>
270
- );
271
- }`,
272
- preview: (
273
- <div className="p-6 border rounded-md bg-muted/50">
274
- <p className="text-sm text-muted-foreground mb-4">
275
- Toaster is the global container for Toast notifications:
276
- </p>
277
- <ul className="space-y-2 text-sm text-muted-foreground">
278
- <li>• Add once to your app layout</li>
279
- <li>• Use with useToast hook</li>
280
- <li>• Manages toast queue and positioning</li>
281
- <li>• Accessible and keyboard navigable</li>
282
- <li>• Works with Toast component</li>
283
- </ul>
284
- <p className="text-xs text-muted-foreground mt-4">
285
- ℹ️ Different from Sonner - this is the built-in Toast system
286
- </p>
287
- </div>
288
- ),
289
- },
290
- ];