@djangocfg/layouts 1.4.27 → 1.4.28

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 (76) hide show
  1. package/package.json +5 -5
  2. package/src/auth/middlewares/index.ts +1 -1
  3. package/src/auth/middlewares/proxy.ts +10 -2
  4. package/src/layouts/index.ts +0 -3
  5. package/src/snippets/ContactForm/ContactPage.tsx +16 -3
  6. package/src/layouts/UILayout/README.md +0 -267
  7. package/src/layouts/UILayout/SUMMARY.md +0 -298
  8. package/src/layouts/UILayout/TOOLS_INTEGRATION.md +0 -216
  9. package/src/layouts/UILayout/components/AutoComponentDemo.tsx +0 -77
  10. package/src/layouts/UILayout/components/CategoryRenderer.tsx +0 -45
  11. package/src/layouts/UILayout/components/TailwindGuideRenderer.tsx +0 -138
  12. package/src/layouts/UILayout/components/index.ts +0 -15
  13. package/src/layouts/UILayout/components/layout/Header/CopyAIButton.tsx +0 -58
  14. package/src/layouts/UILayout/components/layout/Header/Header.tsx +0 -60
  15. package/src/layouts/UILayout/components/layout/Header/HeaderDesktop.tsx +0 -51
  16. package/src/layouts/UILayout/components/layout/Header/HeaderMobile.tsx +0 -71
  17. package/src/layouts/UILayout/components/layout/Header/TestValidationButton.tsx +0 -268
  18. package/src/layouts/UILayout/components/layout/Header/index.ts +0 -11
  19. package/src/layouts/UILayout/components/layout/MobileOverlay/MobileOverlay.tsx +0 -47
  20. package/src/layouts/UILayout/components/layout/MobileOverlay/index.ts +0 -6
  21. package/src/layouts/UILayout/components/layout/Sidebar/Sidebar.tsx +0 -95
  22. package/src/layouts/UILayout/components/layout/Sidebar/SidebarCategory.tsx +0 -54
  23. package/src/layouts/UILayout/components/layout/Sidebar/SidebarContent.tsx +0 -93
  24. package/src/layouts/UILayout/components/layout/Sidebar/SidebarFooter.tsx +0 -49
  25. package/src/layouts/UILayout/components/layout/Sidebar/index.ts +0 -9
  26. package/src/layouts/UILayout/components/layout/index.ts +0 -8
  27. package/src/layouts/UILayout/components/shared/Badge/CountBadge.tsx +0 -38
  28. package/src/layouts/UILayout/components/shared/Badge/index.ts +0 -5
  29. package/src/layouts/UILayout/components/shared/CodeBlock/CodeBlock.tsx +0 -48
  30. package/src/layouts/UILayout/components/shared/CodeBlock/CopyButton.tsx +0 -49
  31. package/src/layouts/UILayout/components/shared/CodeBlock/index.ts +0 -6
  32. package/src/layouts/UILayout/components/shared/Section/Section.tsx +0 -63
  33. package/src/layouts/UILayout/components/shared/Section/index.ts +0 -5
  34. package/src/layouts/UILayout/components/shared/index.ts +0 -8
  35. package/src/layouts/UILayout/config/ai-export.config.ts +0 -89
  36. package/src/layouts/UILayout/config/categories.config.tsx +0 -122
  37. package/src/layouts/UILayout/config/components/blocks.config.tsx +0 -239
  38. package/src/layouts/UILayout/config/components/data.config.tsx +0 -433
  39. package/src/layouts/UILayout/config/components/feedback.config.tsx +0 -290
  40. package/src/layouts/UILayout/config/components/forms.config.tsx +0 -996
  41. package/src/layouts/UILayout/config/components/hooks.config.tsx +0 -168
  42. package/src/layouts/UILayout/config/components/index.ts +0 -72
  43. package/src/layouts/UILayout/config/components/layout.config.tsx +0 -246
  44. package/src/layouts/UILayout/config/components/navigation.config.tsx +0 -352
  45. package/src/layouts/UILayout/config/components/overlay.config.tsx +0 -569
  46. package/src/layouts/UILayout/config/components/specialized.config.tsx +0 -400
  47. package/src/layouts/UILayout/config/components/tools.config.tsx +0 -234
  48. package/src/layouts/UILayout/config/components/types.ts +0 -14
  49. package/src/layouts/UILayout/config/index.ts +0 -42
  50. package/src/layouts/UILayout/config/tailwind.config.ts +0 -131
  51. package/src/layouts/UILayout/constants.ts +0 -23
  52. package/src/layouts/UILayout/context/ShowcaseContext.tsx +0 -81
  53. package/src/layouts/UILayout/context/index.ts +0 -1
  54. package/src/layouts/UILayout/core/UIGuideApp.client.tsx +0 -18
  55. package/src/layouts/UILayout/core/UIGuideApp.tsx +0 -33
  56. package/src/layouts/UILayout/core/UIGuideLanding.tsx +0 -172
  57. package/src/layouts/UILayout/core/UIGuideView.tsx +0 -61
  58. package/src/layouts/UILayout/core/UILayout.tsx +0 -125
  59. package/src/layouts/UILayout/core/UILayoutSidebar.tsx +0 -11
  60. package/src/layouts/UILayout/core/index.ts +0 -10
  61. package/src/layouts/UILayout/hooks/index.ts +0 -9
  62. package/src/layouts/UILayout/hooks/useAIExport.ts +0 -78
  63. package/src/layouts/UILayout/hooks/useCategoryNavigation.ts +0 -92
  64. package/src/layouts/UILayout/hooks/useComponentSearch.ts +0 -81
  65. package/src/layouts/UILayout/hooks/useSidebarState.ts +0 -36
  66. package/src/layouts/UILayout/index.ts +0 -160
  67. package/src/layouts/UILayout/types/component.ts +0 -45
  68. package/src/layouts/UILayout/types/index.ts +0 -23
  69. package/src/layouts/UILayout/types/layout.ts +0 -57
  70. package/src/layouts/UILayout/types/navigation.ts +0 -33
  71. package/src/layouts/UILayout/utils/ai-export/formatters.ts +0 -71
  72. package/src/layouts/UILayout/utils/ai-export/index.ts +0 -5
  73. package/src/layouts/UILayout/utils/component-helpers/filter.ts +0 -109
  74. package/src/layouts/UILayout/utils/component-helpers/index.ts +0 -6
  75. package/src/layouts/UILayout/utils/component-helpers/search.ts +0 -95
  76. package/src/layouts/UILayout/utils/index.ts +0 -6
@@ -1,239 +0,0 @@
1
- /**
2
- * Blocks Configuration
3
- */
4
-
5
- import React from 'react';
6
- import {
7
- Hero,
8
- SuperHero,
9
- FeatureSection,
10
- CTASection,
11
- NewsletterSection,
12
- StatsSection,
13
- TestimonialSection,
14
- } from '@djangocfg/ui/blocks';
15
- import { Sparkles, BookOpen, Zap, Shield, Code, Users, Building2, TrendingUp, Headphones } from 'lucide-react';
16
- import type { ComponentConfig } from './types';
17
-
18
- export const BLOCKS: ComponentConfig[] = [
19
- {
20
- name: 'Hero',
21
- category: 'blocks',
22
- description: 'Hero section with title, description, and CTAs',
23
- importPath: "import { Hero } from '@djangocfg/ui/blocks';",
24
- example: `<Hero
25
- title="Build Your Next Project"
26
- description="The best way to create modern web applications with React and TypeScript"
27
- primaryAction={{ label: "Get Started", href: "/docs" }}
28
- secondaryAction={{ label: "View Demo", href: "/demo" }}
29
- />`,
30
- preview: (
31
- <Hero
32
- title="Build Your Next Project"
33
- description="The best way to create modern web applications"
34
- primaryAction={{ label: "Get Started", href: "/docs" }}
35
- secondaryAction={{ label: "View Demo", href: "/demo" }}
36
- />
37
- ),
38
- },
39
- {
40
- name: 'SuperHero',
41
- category: 'blocks',
42
- description: 'Enhanced hero with badge, gradient title, features, and stats',
43
- importPath: "import { SuperHero } from '@djangocfg/ui/blocks';",
44
- example: `<SuperHero
45
- badge={{ icon: <Sparkles />, text: "New in v2.0" }}
46
- title="Next-Generation"
47
- titleGradient="Development Platform"
48
- subtitle="Build faster with our comprehensive UI library"
49
- features={[
50
- { icon: <span>⚛️</span>, text: "React 19" },
51
- { icon: <span>📘</span>, text: "TypeScript" },
52
- { icon: <span>🎨</span>, text: "Tailwind CSS 4" },
53
- { icon: <span>⚡</span>, text: "Lightning Fast" }
54
- ]}
55
- primaryAction={{ label: "Start Building", href: "/start" }}
56
- secondaryAction={{ label: "Learn More", href: "/docs", icon: <BookOpen /> }}
57
- stats={[
58
- { number: "56+", label: "Components" },
59
- { number: "7", label: "Blocks" },
60
- { number: "6", label: "Hooks" },
61
- { number: "100%", label: "Type Safe" }
62
- ]}
63
- backgroundVariant="waves"
64
- backgroundIntensity="medium"
65
- showBackgroundSwitcher={true}
66
- />`,
67
- preview: (
68
- <SuperHero
69
- badge={{ icon: <Sparkles className="w-4 h-4" />, text: "New in v2.0" }}
70
- title="Next-Generation"
71
- titleGradient="Development Platform"
72
- subtitle="Build faster with our comprehensive UI library"
73
- features={[
74
- { icon: <span>⚛️</span>, text: "React 19" },
75
- { icon: <span>📘</span>, text: "TypeScript" },
76
- { icon: <span>🎨</span>, text: "Tailwind CSS 4" },
77
- { icon: <span>⚡</span>, text: "Lightning Fast" },
78
- ]}
79
- primaryAction={{ label: "Start Building", href: "/start" }}
80
- secondaryAction={{ label: "Learn More", href: "/docs", icon: <BookOpen /> }}
81
- stats={[
82
- { number: "56+", label: "Components" },
83
- { number: "7", label: "Blocks" },
84
- { number: "6", label: "Hooks" },
85
- { number: "100%", label: "Type Safe" },
86
- ]}
87
- backgroundVariant="waves"
88
- backgroundIntensity="medium"
89
- showBackgroundSwitcher={true}
90
- />
91
- ),
92
- },
93
- {
94
- name: 'FeatureSection',
95
- category: 'blocks',
96
- description: 'Grid of features with icons and descriptions',
97
- importPath: "import { FeatureSection } from '@djangocfg/ui/blocks';",
98
- example: `<FeatureSection
99
- title="Everything You Need"
100
- subtitle="All the tools to build modern applications"
101
- features={[
102
- {
103
- icon: <Zap className="w-6 h-6" />,
104
- title: "Lightning Fast",
105
- description: "Optimized for performance"
106
- },
107
- {
108
- icon: <Shield className="w-6 h-6" />,
109
- title: "Secure",
110
- description: "Built with security in mind"
111
- }
112
- ]}
113
- />`,
114
- preview: (
115
- <FeatureSection
116
- title="Everything You Need"
117
- subtitle="All the tools to build modern applications"
118
- features={[
119
- {
120
- icon: <Zap className="w-6 h-6" />,
121
- title: "Lightning Fast",
122
- description: "Optimized for performance"
123
- },
124
- {
125
- icon: <Shield className="w-6 h-6" />,
126
- title: "Secure",
127
- description: "Built with security in mind"
128
- },
129
- {
130
- icon: <Code className="w-6 h-6" />,
131
- title: "Developer Friendly",
132
- description: "Great DX with TypeScript"
133
- }
134
- ]}
135
- />
136
- ),
137
- },
138
- {
139
- name: 'CTASection',
140
- category: 'blocks',
141
- description: 'Call-to-action section to drive conversions',
142
- importPath: "import { CTASection } from '@djangocfg/ui/blocks';",
143
- example: `<CTASection
144
- title="Ready to Get Started?"
145
- subtitle="Join thousands of developers building amazing products"
146
- primaryCTA={{ label: "Start Free Trial", href: "/signup" }}
147
- secondaryCTA={{ label: "Contact Sales", href: "/contact" }}
148
- />`,
149
- preview: (
150
- <CTASection
151
- title="Ready to Get Started?"
152
- subtitle="Join thousands of developers"
153
- primaryCTA={{ label: "Start Free Trial", href: "/signup" }}
154
- secondaryCTA={{ label: "Contact Sales", href: "/contact" }}
155
- />
156
- ),
157
- },
158
- {
159
- name: 'NewsletterSection',
160
- category: 'blocks',
161
- description: 'Email capture section for newsletters',
162
- importPath: "import { NewsletterSection } from '@djangocfg/ui/blocks';",
163
- example: `<NewsletterSection
164
- title="Stay Updated"
165
- description="Get the latest news delivered to your inbox"
166
- placeholder="Enter your email"
167
- buttonText="Subscribe"
168
- onSubmit={(email) => console.log(email)}
169
- />`,
170
- preview: (
171
- <NewsletterSection
172
- title="Stay Updated"
173
- description="Get the latest news delivered to your inbox"
174
- placeholder="Enter your email"
175
- buttonText="Subscribe"
176
- onSubmit={(email) => console.log('Subscribed:', email)}
177
- />
178
- ),
179
- },
180
- {
181
- name: 'StatsSection',
182
- category: 'blocks',
183
- description: 'Display key metrics and statistics',
184
- importPath: "import { StatsSection } from '@djangocfg/ui/blocks';",
185
- example: `<StatsSection
186
- title="Our Impact"
187
- stats={[
188
- { icon: <Users className="w-6 h-6" />, number: "10K+", label: "Active Users" },
189
- { icon: <Building2 className="w-6 h-6" />, number: "500+", label: "Companies" },
190
- { icon: <TrendingUp className="w-6 h-6" />, number: "99.9%", label: "Uptime" },
191
- { icon: <Headphones className="w-6 h-6" />, number: "24/7", label: "Support" }
192
- ]}
193
- />`,
194
- preview: (
195
- <StatsSection
196
- title="Our Impact"
197
- stats={[
198
- { icon: <Users className="w-6 h-6" />, number: "10K+", label: "Active Users" },
199
- { icon: <Building2 className="w-6 h-6" />, number: "500+", label: "Companies" },
200
- { icon: <TrendingUp className="w-6 h-6" />, number: "99.9%", label: "Uptime" },
201
- { icon: <Headphones className="w-6 h-6" />, number: "24/7", label: "Support" }
202
- ]}
203
- />
204
- ),
205
- },
206
- {
207
- name: 'TestimonialSection',
208
- category: 'blocks',
209
- description: 'Customer testimonials and reviews',
210
- importPath: "import { TestimonialSection } from '@djangocfg/ui/blocks';",
211
- example: `<TestimonialSection
212
- title="What Our Customers Say"
213
- testimonials={[{
214
- content: "This product changed how we work!",
215
- author: {
216
- name: "John Doe",
217
- title: "CEO",
218
- company: "Company"
219
- }
220
- }]}
221
- />`,
222
- preview: (
223
- <TestimonialSection
224
- title="What Our Customers Say"
225
- testimonials={[
226
- {
227
- content: "This product changed how we work. Highly recommended!",
228
- author: {
229
- name: "John Doe",
230
- title: "CEO",
231
- company: "Company",
232
- avatar: "/avatar.jpg"
233
- }
234
- }
235
- ]}
236
- />
237
- ),
238
- },
239
- ];
@@ -1,433 +0,0 @@
1
- /**
2
- * Data Display Components Configuration
3
- */
4
-
5
- import React from 'react';
6
- import {
7
- Table,
8
- TableBody,
9
- TableCaption,
10
- TableCell,
11
- TableHead,
12
- TableHeader,
13
- TableRow,
14
- Accordion,
15
- AccordionContent,
16
- AccordionItem,
17
- AccordionTrigger,
18
- Collapsible,
19
- CollapsibleContent,
20
- CollapsibleTrigger,
21
- Toggle,
22
- ToggleGroup,
23
- ToggleGroupItem,
24
- Calendar,
25
- Carousel,
26
- CarouselContent,
27
- CarouselItem,
28
- CarouselNext,
29
- CarouselPrevious,
30
- ChartContainer,
31
- ChartTooltip,
32
- ChartTooltipContent,
33
- ChartLegend,
34
- ChartLegendContent,
35
- } from '@djangocfg/ui';
36
- import type { ComponentConfig } from './types';
37
-
38
- export const DATA_COMPONENTS: ComponentConfig[] = [
39
- {
40
- name: 'Table',
41
- category: 'data',
42
- description: 'Responsive data table component',
43
- importPath: `import {
44
- Table,
45
- TableBody,
46
- TableCaption,
47
- TableCell,
48
- TableHead,
49
- TableHeader,
50
- TableRow,
51
- } from '@djangocfg/ui';`,
52
- example: `<Table>
53
- <TableCaption>A list of your recent invoices.</TableCaption>
54
- <TableHeader>
55
- <TableRow>
56
- <TableHead>Invoice</TableHead>
57
- <TableHead>Status</TableHead>
58
- <TableHead>Method</TableHead>
59
- <TableHead className="text-right">Amount</TableHead>
60
- </TableRow>
61
- </TableHeader>
62
- <TableBody>
63
- <TableRow>
64
- <TableCell className="font-medium">INV001</TableCell>
65
- <TableCell>Paid</TableCell>
66
- <TableCell>Credit Card</TableCell>
67
- <TableCell className="text-right">$250.00</TableCell>
68
- </TableRow>
69
- <TableRow>
70
- <TableCell className="font-medium">INV002</TableCell>
71
- <TableCell>Pending</TableCell>
72
- <TableCell>PayPal</TableCell>
73
- <TableCell className="text-right">$150.00</TableCell>
74
- </TableRow>
75
- </TableBody>
76
- </Table>`,
77
- preview: (
78
- <Table>
79
- <TableCaption>A list of your recent invoices.</TableCaption>
80
- <TableHeader>
81
- <TableRow>
82
- <TableHead>Invoice</TableHead>
83
- <TableHead>Status</TableHead>
84
- <TableHead>Method</TableHead>
85
- <TableHead className="text-right">Amount</TableHead>
86
- </TableRow>
87
- </TableHeader>
88
- <TableBody>
89
- <TableRow>
90
- <TableCell className="font-medium">INV001</TableCell>
91
- <TableCell>Paid</TableCell>
92
- <TableCell>Credit Card</TableCell>
93
- <TableCell className="text-right">$250.00</TableCell>
94
- </TableRow>
95
- <TableRow>
96
- <TableCell className="font-medium">INV002</TableCell>
97
- <TableCell>Pending</TableCell>
98
- <TableCell>PayPal</TableCell>
99
- <TableCell className="text-right">$150.00</TableCell>
100
- </TableRow>
101
- <TableRow>
102
- <TableCell className="font-medium">INV003</TableCell>
103
- <TableCell>Unpaid</TableCell>
104
- <TableCell>Bank Transfer</TableCell>
105
- <TableCell className="text-right">$350.00</TableCell>
106
- </TableRow>
107
- </TableBody>
108
- </Table>
109
- ),
110
- },
111
- {
112
- name: 'Accordion',
113
- category: 'data',
114
- description: 'Vertically stacked set of collapsible sections',
115
- importPath: `import {
116
- Accordion,
117
- AccordionContent,
118
- AccordionItem,
119
- AccordionTrigger,
120
- } from '@djangocfg/ui';`,
121
- example: `<Accordion type="single" collapsible className="w-full">
122
- <AccordionItem value="item-1">
123
- <AccordionTrigger>Is it accessible?</AccordionTrigger>
124
- <AccordionContent>
125
- Yes. It adheres to the WAI-ARIA design pattern.
126
- </AccordionContent>
127
- </AccordionItem>
128
- <AccordionItem value="item-2">
129
- <AccordionTrigger>Is it styled?</AccordionTrigger>
130
- <AccordionContent>
131
- Yes. It comes with default styles that matches the aesthetic.
132
- </AccordionContent>
133
- </AccordionItem>
134
- <AccordionItem value="item-3">
135
- <AccordionTrigger>Is it animated?</AccordionTrigger>
136
- <AccordionContent>
137
- Yes. It's animated by default, but you can disable it if you prefer.
138
- </AccordionContent>
139
- </AccordionItem>
140
- </Accordion>`,
141
- preview: (
142
- <Accordion type="single" collapsible className="w-full">
143
- <AccordionItem value="item-1">
144
- <AccordionTrigger>Is it accessible?</AccordionTrigger>
145
- <AccordionContent>
146
- Yes. It adheres to the WAI-ARIA design pattern.
147
- </AccordionContent>
148
- </AccordionItem>
149
- <AccordionItem value="item-2">
150
- <AccordionTrigger>Is it styled?</AccordionTrigger>
151
- <AccordionContent>
152
- Yes. It comes with default styles that matches the aesthetic.
153
- </AccordionContent>
154
- </AccordionItem>
155
- <AccordionItem value="item-3">
156
- <AccordionTrigger>Is it animated?</AccordionTrigger>
157
- <AccordionContent>
158
- Yes. It's animated by default, but you can disable it if you prefer.
159
- </AccordionContent>
160
- </AccordionItem>
161
- </Accordion>
162
- ),
163
- },
164
- {
165
- name: 'Collapsible',
166
- category: 'data',
167
- description: 'Simple collapsible content panel',
168
- importPath: `import {
169
- Collapsible,
170
- CollapsibleContent,
171
- CollapsibleTrigger,
172
- } from '@djangocfg/ui';`,
173
- example: `<Collapsible className="w-full max-w-md space-y-2">
174
- <CollapsibleTrigger className="flex items-center justify-between w-full p-4 bg-muted rounded-md">
175
- <span className="font-medium">Can I use this in my project?</span>
176
- <ChevronDown className="h-4 w-4" />
177
- </CollapsibleTrigger>
178
- <CollapsibleContent className="p-4 bg-muted/50 rounded-md">
179
- <p className="text-sm text-muted-foreground">
180
- Yes! This component is free to use in your projects.
181
- </p>
182
- </CollapsibleContent>
183
- </Collapsible>`,
184
- preview: (
185
- <Collapsible className="w-full max-w-md space-y-2">
186
- <CollapsibleTrigger className="flex items-center justify-between w-full p-4 bg-muted rounded-md">
187
- <span className="font-medium">Can I use this in my project?</span>
188
- <svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
189
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
190
- </svg>
191
- </CollapsibleTrigger>
192
- <CollapsibleContent className="p-4 bg-muted/50 rounded-md">
193
- <p className="text-sm text-muted-foreground">
194
- Yes! This component is free to use in your projects. It's built with
195
- Radix UI primitives and Tailwind CSS.
196
- </p>
197
- </CollapsibleContent>
198
- </Collapsible>
199
- ),
200
- },
201
- {
202
- name: 'Toggle',
203
- category: 'data',
204
- description: 'Two-state button for on/off interactions',
205
- importPath: `import { Toggle } from '@djangocfg/ui';`,
206
- example: `<div className="flex gap-2">
207
- <Toggle aria-label="Toggle bold">
208
- <Bold className="h-4 w-4" />
209
- </Toggle>
210
- <Toggle aria-label="Toggle italic">
211
- <Italic className="h-4 w-4" />
212
- </Toggle>
213
- <Toggle aria-label="Toggle underline">
214
- <Underline className="h-4 w-4" />
215
- </Toggle>
216
- </div>`,
217
- preview: (
218
- <div className="flex gap-2">
219
- <Toggle aria-label="Toggle bold">
220
- <svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
221
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 12h12M6 6h12M6 18h12" />
222
- </svg>
223
- </Toggle>
224
- <Toggle aria-label="Toggle italic">
225
- <svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
226
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4" />
227
- </svg>
228
- </Toggle>
229
- <Toggle aria-label="Toggle underline">
230
- <svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
231
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 12h.01M12 12h.01M18 12h.01" />
232
- </svg>
233
- </Toggle>
234
- </div>
235
- ),
236
- },
237
- {
238
- name: 'ToggleGroup',
239
- category: 'data',
240
- description: 'Group of toggle buttons with single or multiple selection',
241
- importPath: `import { ToggleGroup, ToggleGroupItem } from '@djangocfg/ui';`,
242
- example: `<div className="space-y-4">
243
- <div>
244
- <p className="text-sm font-medium mb-2">Single Selection</p>
245
- <ToggleGroup type="single">
246
- <ToggleGroupItem value="bold" aria-label="Toggle bold">
247
- <Bold className="h-4 w-4" />
248
- </ToggleGroupItem>
249
- <ToggleGroupItem value="italic" aria-label="Toggle italic">
250
- <Italic className="h-4 w-4" />
251
- </ToggleGroupItem>
252
- <ToggleGroupItem value="underline" aria-label="Toggle underline">
253
- <Underline className="h-4 w-4" />
254
- </ToggleGroupItem>
255
- </ToggleGroup>
256
- </div>
257
-
258
- <div>
259
- <p className="text-sm font-medium mb-2">Multiple Selection</p>
260
- <ToggleGroup type="multiple">
261
- <ToggleGroupItem value="bold" aria-label="Toggle bold">
262
- <Bold className="h-4 w-4" />
263
- </ToggleGroupItem>
264
- <ToggleGroupItem value="italic" aria-label="Toggle italic">
265
- <Italic className="h-4 w-4" />
266
- </ToggleGroupItem>
267
- <ToggleGroupItem value="underline" aria-label="Toggle underline">
268
- <Underline className="h-4 w-4" />
269
- </ToggleGroupItem>
270
- </ToggleGroup>
271
- </div>
272
- </div>`,
273
- preview: (
274
- <div className="space-y-4">
275
- <div>
276
- <p className="text-sm font-medium mb-2">Single Selection</p>
277
- <ToggleGroup type="single">
278
- <ToggleGroupItem value="bold" aria-label="Toggle bold">
279
- <svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
280
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 12h12" />
281
- </svg>
282
- </ToggleGroupItem>
283
- <ToggleGroupItem value="italic" aria-label="Toggle italic">
284
- <svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
285
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10 20l4-16" />
286
- </svg>
287
- </ToggleGroupItem>
288
- <ToggleGroupItem value="underline" aria-label="Toggle underline">
289
- <svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
290
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18h12" />
291
- </svg>
292
- </ToggleGroupItem>
293
- </ToggleGroup>
294
- </div>
295
-
296
- <div>
297
- <p className="text-sm font-medium mb-2">Multiple Selection</p>
298
- <ToggleGroup type="multiple">
299
- <ToggleGroupItem value="bold" aria-label="Toggle bold">
300
- <svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
301
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 12h12" />
302
- </svg>
303
- </ToggleGroupItem>
304
- <ToggleGroupItem value="italic" aria-label="Toggle italic">
305
- <svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
306
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10 20l4-16" />
307
- </svg>
308
- </ToggleGroupItem>
309
- <ToggleGroupItem value="underline" aria-label="Toggle underline">
310
- <svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
311
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18h12" />
312
- </svg>
313
- </ToggleGroupItem>
314
- </ToggleGroup>
315
- </div>
316
- </div>
317
- ),
318
- },
319
- {
320
- name: 'Calendar',
321
- category: 'data',
322
- description: 'Date picker calendar component',
323
- importPath: `import { Calendar } from '@djangocfg/ui';`,
324
- example: `<Calendar
325
- mode="single"
326
- selected={date}
327
- onSelect={setDate}
328
- className="rounded-md border"
329
- />`,
330
- preview: (
331
- <Calendar
332
- mode="single"
333
- className="rounded-md border"
334
- />
335
- ),
336
- },
337
- {
338
- name: 'Carousel',
339
- category: 'data',
340
- description: 'Image and content carousel with navigation',
341
- importPath: `import {
342
- Carousel,
343
- CarouselContent,
344
- CarouselItem,
345
- CarouselNext,
346
- CarouselPrevious,
347
- } from '@djangocfg/ui';`,
348
- example: `<Carousel className="w-full max-w-xs">
349
- <CarouselContent>
350
- <CarouselItem>
351
- <div className="p-6 border rounded-md">
352
- <span className="text-4xl font-semibold">1</span>
353
- </div>
354
- </CarouselItem>
355
- <CarouselItem>
356
- <div className="p-6 border rounded-md">
357
- <span className="text-4xl font-semibold">2</span>
358
- </div>
359
- </CarouselItem>
360
- <CarouselItem>
361
- <div className="p-6 border rounded-md">
362
- <span className="text-4xl font-semibold">3</span>
363
- </div>
364
- </CarouselItem>
365
- </CarouselContent>
366
- <CarouselPrevious />
367
- <CarouselNext />
368
- </Carousel>`,
369
- preview: (
370
- <Carousel className="w-full max-w-xs">
371
- <CarouselContent>
372
- {Array.from({ length: 5 }).map((_, index) => (
373
- <CarouselItem key={index}>
374
- <div className="p-6 border rounded-md bg-muted/50">
375
- <div className="flex aspect-square items-center justify-center">
376
- <span className="text-4xl font-semibold">{index + 1}</span>
377
- </div>
378
- </div>
379
- </CarouselItem>
380
- ))}
381
- </CarouselContent>
382
- <CarouselPrevious />
383
- <CarouselNext />
384
- </Carousel>
385
- ),
386
- },
387
- {
388
- name: 'Chart',
389
- category: 'data',
390
- description: 'Data visualization charts powered by Recharts',
391
- importPath: `import { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent } from '@djangocfg/ui';`,
392
- example: `import { Bar, BarChart, XAxis, YAxis } from 'recharts';
393
-
394
- const chartConfig = {
395
- sales: { label: "Sales", color: "hsl(var(--chart-1))" },
396
- profit: { label: "Profit", color: "hsl(var(--chart-2))" },
397
- };
398
-
399
- const chartData = [
400
- { month: "Jan", sales: 400, profit: 240 },
401
- { month: "Feb", sales: 300, profit: 180 },
402
- { month: "Mar", sales: 500, profit: 300 },
403
- ];
404
-
405
- <ChartContainer config={chartConfig} className="min-h-[200px] w-full">
406
- <BarChart data={chartData}>
407
- <XAxis dataKey="month" />
408
- <YAxis />
409
- <ChartTooltip content={<ChartTooltipContent />} />
410
- <ChartLegend content={<ChartLegendContent />} />
411
- <Bar dataKey="sales" fill="var(--color-sales)" />
412
- <Bar dataKey="profit" fill="var(--color-profit)" />
413
- </BarChart>
414
- </ChartContainer>`,
415
- preview: (
416
- <div className="p-6 border rounded-md bg-muted/50">
417
- <p className="text-sm text-muted-foreground mb-4">
418
- Chart components built on Recharts with:
419
- </p>
420
- <ul className="space-y-2 text-sm text-muted-foreground">
421
- <li>• Bar, Line, Area, Pie charts</li>
422
- <li>• Responsive container</li>
423
- <li>• Theme-aware colors</li>
424
- <li>• Tooltips and legends</li>
425
- <li>• Customizable styling</li>
426
- </ul>
427
- <p className="text-xs text-muted-foreground mt-4">
428
- See <strong>Recharts documentation</strong> for all chart types
429
- </p>
430
- </div>
431
- ),
432
- },
433
- ];