@djangocfg/layouts 1.0.6 → 1.2.0

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 (51) hide show
  1. package/package.json +5 -5
  2. package/src/layouts/AppLayout/AppLayout.tsx +132 -28
  3. package/src/layouts/AppLayout/components/ErrorBoundary.tsx +99 -0
  4. package/src/layouts/AppLayout/components/PageProgress.tsx +28 -11
  5. package/src/layouts/AppLayout/components/index.ts +1 -0
  6. package/src/layouts/AppLayout/layouts/AuthLayout/AuthContext.tsx +1 -1
  7. package/src/layouts/AppLayout/layouts/AuthLayout/AuthHelp.tsx +5 -5
  8. package/src/layouts/AppLayout/layouts/AuthLayout/AuthLayout.tsx +2 -2
  9. package/src/layouts/AppLayout/layouts/AuthLayout/IdentifierForm.tsx +2 -2
  10. package/src/layouts/AppLayout/layouts/PrivateLayout/components/DashboardHeader.tsx +1 -1
  11. package/src/layouts/AppLayout/layouts/PublicLayout/components/Footer.tsx +1 -1
  12. package/src/layouts/AppLayout/layouts/PublicLayout/components/MobileMenu.tsx +53 -36
  13. package/src/layouts/AppLayout/layouts/PublicLayout/components/Navigation.tsx +64 -52
  14. package/src/layouts/AppLayout/types/config.ts +22 -0
  15. package/src/layouts/ErrorLayout/ErrorLayout.tsx +169 -0
  16. package/src/layouts/ErrorLayout/errorConfig.tsx +152 -0
  17. package/src/layouts/ErrorLayout/index.ts +8 -0
  18. package/src/layouts/UILayout/README.md +267 -0
  19. package/src/layouts/UILayout/REFACTORING.md +331 -0
  20. package/src/layouts/UILayout/UIGuideApp.tsx +18 -0
  21. package/src/layouts/UILayout/UIGuideLanding.tsx +198 -0
  22. package/src/layouts/UILayout/UIGuideView.tsx +61 -0
  23. package/src/layouts/UILayout/UILayout.tsx +122 -0
  24. package/src/layouts/UILayout/components/AutoComponentDemo.tsx +77 -0
  25. package/src/layouts/UILayout/components/CategoryRenderer.tsx +45 -0
  26. package/src/layouts/UILayout/components/Header.tsx +114 -0
  27. package/src/layouts/UILayout/components/MobileOverlay.tsx +33 -0
  28. package/src/layouts/UILayout/components/Sidebar.tsx +195 -0
  29. package/src/layouts/UILayout/components/TailwindGuideRenderer.tsx +138 -0
  30. package/src/layouts/UILayout/config/ai-export.config.ts +80 -0
  31. package/src/layouts/UILayout/config/categories.config.tsx +114 -0
  32. package/src/layouts/UILayout/config/components/blocks.config.tsx +233 -0
  33. package/src/layouts/UILayout/config/components/data.config.tsx +308 -0
  34. package/src/layouts/UILayout/config/components/feedback.config.tsx +246 -0
  35. package/src/layouts/UILayout/config/components/forms.config.tsx +171 -0
  36. package/src/layouts/UILayout/config/components/hooks.config.tsx +131 -0
  37. package/src/layouts/UILayout/config/components/index.ts +69 -0
  38. package/src/layouts/UILayout/config/components/layout.config.tsx +133 -0
  39. package/src/layouts/UILayout/config/components/navigation.config.tsx +244 -0
  40. package/src/layouts/UILayout/config/components/overlay.config.tsx +561 -0
  41. package/src/layouts/UILayout/config/components/specialized.config.tsx +125 -0
  42. package/src/layouts/UILayout/config/components/types.ts +14 -0
  43. package/src/layouts/UILayout/config/index.ts +42 -0
  44. package/src/layouts/UILayout/config/tailwind.config.ts +77 -0
  45. package/src/layouts/UILayout/constants.ts +23 -0
  46. package/src/layouts/UILayout/context/ShowcaseContext.tsx +53 -0
  47. package/src/layouts/UILayout/context/index.ts +1 -0
  48. package/src/layouts/UILayout/index.ts +64 -0
  49. package/src/layouts/UILayout/types.ts +13 -0
  50. package/src/layouts/index.ts +5 -1
  51. package/src/snippets/Chat/types.ts +3 -4
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Layout Components Configuration
3
+ */
4
+
5
+ import React from 'react';
6
+ import {
7
+ Button,
8
+ Card,
9
+ CardHeader,
10
+ CardTitle,
11
+ CardDescription,
12
+ CardContent,
13
+ CardFooter,
14
+ Separator,
15
+ Skeleton,
16
+ AspectRatio,
17
+ Sticky,
18
+ } from '@djangocfg/ui';
19
+ import type { ComponentConfig } from './types';
20
+
21
+ export const LAYOUT_COMPONENTS: ComponentConfig[] = [
22
+ {
23
+ name: 'Card',
24
+ category: 'layout',
25
+ description: 'Container with header, content, and footer sections',
26
+ importPath: "import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from '@djangocfg/ui';",
27
+ example: `<Card>
28
+ <CardHeader>
29
+ <CardTitle>Card Title</CardTitle>
30
+ <CardDescription>Card description goes here</CardDescription>
31
+ </CardHeader>
32
+ <CardContent>
33
+ <p>This is the main content of the card.</p>
34
+ </CardContent>
35
+ <CardFooter>
36
+ <Button>Action</Button>
37
+ </CardFooter>
38
+ </Card>`,
39
+ preview: (
40
+ <Card className="max-w-sm">
41
+ <CardHeader>
42
+ <CardTitle>Card Title</CardTitle>
43
+ <CardDescription>Card description goes here</CardDescription>
44
+ </CardHeader>
45
+ <CardContent>
46
+ <p>This is the main content of the card.</p>
47
+ </CardContent>
48
+ <CardFooter>
49
+ <Button>Action</Button>
50
+ </CardFooter>
51
+ </Card>
52
+ ),
53
+ },
54
+ {
55
+ name: 'Separator',
56
+ category: 'layout',
57
+ description: 'Visual divider between sections',
58
+ importPath: "import { Separator } from '@djangocfg/ui';",
59
+ example: `<div>
60
+ <p>Section 1</p>
61
+ <Separator className="my-4" />
62
+ <p>Section 2</p>
63
+ </div>`,
64
+ preview: (
65
+ <div>
66
+ <p>Section 1</p>
67
+ <Separator className="my-4" />
68
+ <p>Section 2</p>
69
+ </div>
70
+ ),
71
+ },
72
+ {
73
+ name: 'Skeleton',
74
+ category: 'layout',
75
+ description: 'Loading placeholder animation',
76
+ importPath: "import { Skeleton } from '@djangocfg/ui';",
77
+ example: `<div className="space-y-3">
78
+ <Skeleton className="w-full h-12" />
79
+ <Skeleton className="w-3/4 h-8" />
80
+ <Skeleton className="w-1/2 h-8" />
81
+ </div>`,
82
+ preview: (
83
+ <div className="space-y-3 max-w-sm">
84
+ <Skeleton className="w-full h-12" />
85
+ <Skeleton className="w-3/4 h-8" />
86
+ <Skeleton className="w-1/2 h-8" />
87
+ </div>
88
+ ),
89
+ },
90
+ {
91
+ name: 'AspectRatio',
92
+ category: 'layout',
93
+ description: 'Maintain aspect ratio for content',
94
+ importPath: "import { AspectRatio } from '@djangocfg/ui';",
95
+ example: `<AspectRatio ratio={16/9} className="bg-muted">
96
+ <img src="/demo.jpg" alt="Demo" className="object-cover rounded-md" />
97
+ </AspectRatio>`,
98
+ preview: (
99
+ <AspectRatio ratio={16/9} className="bg-muted rounded-md max-w-sm">
100
+ <div className="flex items-center justify-center h-full text-muted-foreground">
101
+ 16:9 Aspect Ratio
102
+ </div>
103
+ </AspectRatio>
104
+ ),
105
+ },
106
+ {
107
+ name: 'Sticky',
108
+ category: 'layout',
109
+ description: 'Make content sticky on scroll',
110
+ importPath: "import { Sticky } from '@djangocfg/ui';",
111
+ example: `<Sticky offsetTop={0} disableOnMobile={false}>
112
+ <nav className="bg-background border p-4">
113
+ Sticky Navigation
114
+ </nav>
115
+ </Sticky>`,
116
+ preview: (
117
+ <div className="h-[300px] overflow-auto border rounded-md relative">
118
+ <Sticky offsetTop={0} disableOnMobile={false}>
119
+ <div className="bg-primary text-primary-foreground p-3 text-center font-semibold shadow-md">
120
+ Sticky Header (scroll to see effect)
121
+ </div>
122
+ </Sticky>
123
+ <div className="p-4 space-y-3">
124
+ {[...Array(20)].map((_, i) => (
125
+ <p key={i} className="text-sm">
126
+ Content line {i + 1} - Scroll down to see the sticky header in action
127
+ </p>
128
+ ))}
129
+ </div>
130
+ </div>
131
+ ),
132
+ },
133
+ ];
@@ -0,0 +1,244 @@
1
+ /**
2
+ * Navigation Components Configuration
3
+ */
4
+
5
+ import React from 'react';
6
+ import {
7
+ NavigationMenu,
8
+ NavigationMenuContent,
9
+ NavigationMenuItem,
10
+ NavigationMenuLink,
11
+ NavigationMenuList,
12
+ NavigationMenuTrigger,
13
+ Breadcrumb,
14
+ BreadcrumbItem,
15
+ BreadcrumbLink,
16
+ BreadcrumbList,
17
+ BreadcrumbPage,
18
+ BreadcrumbSeparator,
19
+ Tabs,
20
+ TabsContent,
21
+ TabsList,
22
+ TabsTrigger,
23
+ Pagination,
24
+ PaginationContent,
25
+ PaginationEllipsis,
26
+ PaginationItem,
27
+ PaginationLink,
28
+ PaginationNext,
29
+ PaginationPrevious,
30
+ } from '@djangocfg/ui';
31
+ import type { ComponentConfig } from './types';
32
+
33
+ export const NAVIGATION_COMPONENTS: ComponentConfig[] = [
34
+ {
35
+ name: 'NavigationMenu',
36
+ category: 'navigation',
37
+ description: 'Accessible navigation menu with dropdown support',
38
+ importPath: `import {
39
+ NavigationMenu,
40
+ NavigationMenuContent,
41
+ NavigationMenuItem,
42
+ NavigationMenuLink,
43
+ NavigationMenuList,
44
+ NavigationMenuTrigger,
45
+ } from '@djangocfg/ui';`,
46
+ example: `<NavigationMenu>
47
+ <NavigationMenuList>
48
+ <NavigationMenuItem>
49
+ <NavigationMenuTrigger>Getting started</NavigationMenuTrigger>
50
+ <NavigationMenuContent>
51
+ <ul className="grid gap-3 p-6 md:w-[400px]">
52
+ <li>
53
+ <NavigationMenuLink href="/">
54
+ <div className="text-sm font-medium">Welcome</div>
55
+ <p className="text-sm text-muted-foreground">
56
+ Get started with our components
57
+ </p>
58
+ </NavigationMenuLink>
59
+ </li>
60
+ </ul>
61
+ </NavigationMenuContent>
62
+ </NavigationMenuItem>
63
+ <NavigationMenuItem>
64
+ <NavigationMenuLink href="/docs">
65
+ Documentation
66
+ </NavigationMenuLink>
67
+ </NavigationMenuItem>
68
+ </NavigationMenuList>
69
+ </NavigationMenu>`,
70
+ preview: (
71
+ <NavigationMenu>
72
+ <NavigationMenuList>
73
+ <NavigationMenuItem>
74
+ <NavigationMenuTrigger>Getting started</NavigationMenuTrigger>
75
+ <NavigationMenuContent>
76
+ <ul className="grid gap-3 p-6 md:w-[400px]">
77
+ <li>
78
+ <NavigationMenuLink asChild>
79
+ <a href="/" className="block select-none space-y-1 rounded-md p-3 no-underline outline-none hover:bg-accent">
80
+ <div className="text-sm font-medium">Welcome</div>
81
+ <p className="text-sm text-muted-foreground">
82
+ Get started with our components
83
+ </p>
84
+ </a>
85
+ </NavigationMenuLink>
86
+ </li>
87
+ </ul>
88
+ </NavigationMenuContent>
89
+ </NavigationMenuItem>
90
+ <NavigationMenuItem>
91
+ <NavigationMenuLink href="/docs">
92
+ Documentation
93
+ </NavigationMenuLink>
94
+ </NavigationMenuItem>
95
+ </NavigationMenuList>
96
+ </NavigationMenu>
97
+ ),
98
+ },
99
+ {
100
+ name: 'Breadcrumb',
101
+ category: 'navigation',
102
+ description: 'Navigation breadcrumbs showing current page hierarchy',
103
+ importPath: `import {
104
+ Breadcrumb,
105
+ BreadcrumbItem,
106
+ BreadcrumbLink,
107
+ BreadcrumbList,
108
+ BreadcrumbPage,
109
+ BreadcrumbSeparator,
110
+ } from '@djangocfg/ui';`,
111
+ example: `<Breadcrumb>
112
+ <BreadcrumbList>
113
+ <BreadcrumbItem>
114
+ <BreadcrumbLink href="/">Home</BreadcrumbLink>
115
+ </BreadcrumbItem>
116
+ <BreadcrumbSeparator />
117
+ <BreadcrumbItem>
118
+ <BreadcrumbLink href="/components">Components</BreadcrumbLink>
119
+ </BreadcrumbItem>
120
+ <BreadcrumbSeparator />
121
+ <BreadcrumbItem>
122
+ <BreadcrumbPage>Breadcrumb</BreadcrumbPage>
123
+ </BreadcrumbItem>
124
+ </BreadcrumbList>
125
+ </Breadcrumb>`,
126
+ preview: (
127
+ <Breadcrumb>
128
+ <BreadcrumbList>
129
+ <BreadcrumbItem>
130
+ <BreadcrumbLink href="/">Home</BreadcrumbLink>
131
+ </BreadcrumbItem>
132
+ <BreadcrumbSeparator />
133
+ <BreadcrumbItem>
134
+ <BreadcrumbLink href="/components">Components</BreadcrumbLink>
135
+ </BreadcrumbItem>
136
+ <BreadcrumbSeparator />
137
+ <BreadcrumbItem>
138
+ <BreadcrumbPage>Breadcrumb</BreadcrumbPage>
139
+ </BreadcrumbItem>
140
+ </BreadcrumbList>
141
+ </Breadcrumb>
142
+ ),
143
+ },
144
+ {
145
+ name: 'Tabs',
146
+ category: 'navigation',
147
+ description: 'Tab navigation for switching between different views',
148
+ importPath: `import { Tabs, TabsContent, TabsList, TabsTrigger } from '@djangocfg/ui';`,
149
+ example: `<Tabs defaultValue="account" className="w-[400px]">
150
+ <TabsList className="grid w-full grid-cols-2">
151
+ <TabsTrigger value="account">Account</TabsTrigger>
152
+ <TabsTrigger value="password">Password</TabsTrigger>
153
+ </TabsList>
154
+ <TabsContent value="account">
155
+ <div className="p-4 border rounded-md">
156
+ <p className="text-sm">Make changes to your account here.</p>
157
+ </div>
158
+ </TabsContent>
159
+ <TabsContent value="password">
160
+ <div className="p-4 border rounded-md">
161
+ <p className="text-sm">Change your password here.</p>
162
+ </div>
163
+ </TabsContent>
164
+ </Tabs>`,
165
+ preview: (
166
+ <Tabs defaultValue="account" className="w-[400px]">
167
+ <TabsList className="grid w-full grid-cols-2">
168
+ <TabsTrigger value="account">Account</TabsTrigger>
169
+ <TabsTrigger value="password">Password</TabsTrigger>
170
+ </TabsList>
171
+ <TabsContent value="account">
172
+ <div className="p-4 border rounded-md">
173
+ <p className="text-sm">Make changes to your account here.</p>
174
+ </div>
175
+ </TabsContent>
176
+ <TabsContent value="password">
177
+ <div className="p-4 border rounded-md">
178
+ <p className="text-sm">Change your password here.</p>
179
+ </div>
180
+ </TabsContent>
181
+ </Tabs>
182
+ ),
183
+ },
184
+ {
185
+ name: 'Pagination',
186
+ category: 'navigation',
187
+ description: 'Page navigation with previous/next controls',
188
+ importPath: `import {
189
+ Pagination,
190
+ PaginationContent,
191
+ PaginationEllipsis,
192
+ PaginationItem,
193
+ PaginationLink,
194
+ PaginationNext,
195
+ PaginationPrevious,
196
+ } from '@djangocfg/ui';`,
197
+ example: `<Pagination>
198
+ <PaginationContent>
199
+ <PaginationItem>
200
+ <PaginationPrevious href="#" />
201
+ </PaginationItem>
202
+ <PaginationItem>
203
+ <PaginationLink href="#" isActive>1</PaginationLink>
204
+ </PaginationItem>
205
+ <PaginationItem>
206
+ <PaginationLink href="#">2</PaginationLink>
207
+ </PaginationItem>
208
+ <PaginationItem>
209
+ <PaginationLink href="#">3</PaginationLink>
210
+ </PaginationItem>
211
+ <PaginationItem>
212
+ <PaginationEllipsis />
213
+ </PaginationItem>
214
+ <PaginationItem>
215
+ <PaginationNext href="#" />
216
+ </PaginationItem>
217
+ </PaginationContent>
218
+ </Pagination>`,
219
+ preview: (
220
+ <Pagination>
221
+ <PaginationContent>
222
+ <PaginationItem>
223
+ <PaginationPrevious href="#" />
224
+ </PaginationItem>
225
+ <PaginationItem>
226
+ <PaginationLink href="#" isActive>1</PaginationLink>
227
+ </PaginationItem>
228
+ <PaginationItem>
229
+ <PaginationLink href="#">2</PaginationLink>
230
+ </PaginationItem>
231
+ <PaginationItem>
232
+ <PaginationLink href="#">3</PaginationLink>
233
+ </PaginationItem>
234
+ <PaginationItem>
235
+ <PaginationEllipsis />
236
+ </PaginationItem>
237
+ <PaginationItem>
238
+ <PaginationNext href="#" />
239
+ </PaginationItem>
240
+ </PaginationContent>
241
+ </Pagination>
242
+ ),
243
+ },
244
+ ];