@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.
- package/package.json +5 -5
- package/src/layouts/AppLayout/AppLayout.tsx +132 -28
- package/src/layouts/AppLayout/components/ErrorBoundary.tsx +99 -0
- package/src/layouts/AppLayout/components/PageProgress.tsx +28 -11
- package/src/layouts/AppLayout/components/index.ts +1 -0
- package/src/layouts/AppLayout/layouts/AuthLayout/AuthContext.tsx +1 -1
- package/src/layouts/AppLayout/layouts/AuthLayout/AuthHelp.tsx +5 -5
- package/src/layouts/AppLayout/layouts/AuthLayout/AuthLayout.tsx +2 -2
- package/src/layouts/AppLayout/layouts/AuthLayout/IdentifierForm.tsx +2 -2
- package/src/layouts/AppLayout/layouts/PrivateLayout/components/DashboardHeader.tsx +1 -1
- package/src/layouts/AppLayout/layouts/PublicLayout/components/Footer.tsx +1 -1
- package/src/layouts/AppLayout/layouts/PublicLayout/components/MobileMenu.tsx +53 -36
- package/src/layouts/AppLayout/layouts/PublicLayout/components/Navigation.tsx +64 -52
- package/src/layouts/AppLayout/types/config.ts +22 -0
- package/src/layouts/ErrorLayout/ErrorLayout.tsx +169 -0
- package/src/layouts/ErrorLayout/errorConfig.tsx +152 -0
- package/src/layouts/ErrorLayout/index.ts +8 -0
- package/src/layouts/UILayout/README.md +267 -0
- package/src/layouts/UILayout/REFACTORING.md +331 -0
- package/src/layouts/UILayout/UIGuideApp.tsx +18 -0
- package/src/layouts/UILayout/UIGuideLanding.tsx +198 -0
- package/src/layouts/UILayout/UIGuideView.tsx +61 -0
- package/src/layouts/UILayout/UILayout.tsx +122 -0
- package/src/layouts/UILayout/components/AutoComponentDemo.tsx +77 -0
- package/src/layouts/UILayout/components/CategoryRenderer.tsx +45 -0
- package/src/layouts/UILayout/components/Header.tsx +114 -0
- package/src/layouts/UILayout/components/MobileOverlay.tsx +33 -0
- package/src/layouts/UILayout/components/Sidebar.tsx +195 -0
- package/src/layouts/UILayout/components/TailwindGuideRenderer.tsx +138 -0
- package/src/layouts/UILayout/config/ai-export.config.ts +80 -0
- package/src/layouts/UILayout/config/categories.config.tsx +114 -0
- package/src/layouts/UILayout/config/components/blocks.config.tsx +233 -0
- package/src/layouts/UILayout/config/components/data.config.tsx +308 -0
- package/src/layouts/UILayout/config/components/feedback.config.tsx +246 -0
- package/src/layouts/UILayout/config/components/forms.config.tsx +171 -0
- package/src/layouts/UILayout/config/components/hooks.config.tsx +131 -0
- package/src/layouts/UILayout/config/components/index.ts +69 -0
- package/src/layouts/UILayout/config/components/layout.config.tsx +133 -0
- package/src/layouts/UILayout/config/components/navigation.config.tsx +244 -0
- package/src/layouts/UILayout/config/components/overlay.config.tsx +561 -0
- package/src/layouts/UILayout/config/components/specialized.config.tsx +125 -0
- package/src/layouts/UILayout/config/components/types.ts +14 -0
- package/src/layouts/UILayout/config/index.ts +42 -0
- package/src/layouts/UILayout/config/tailwind.config.ts +77 -0
- package/src/layouts/UILayout/constants.ts +23 -0
- package/src/layouts/UILayout/context/ShowcaseContext.tsx +53 -0
- package/src/layouts/UILayout/context/index.ts +1 -0
- package/src/layouts/UILayout/index.ts +64 -0
- package/src/layouts/UILayout/types.ts +13 -0
- package/src/layouts/index.ts +5 -1
- package/src/snippets/Chat/types.ts +3 -4
|
@@ -0,0 +1,233 @@
|
|
|
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 } 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
|
+
scrollIndicator={false}
|
|
64
|
+
/>`,
|
|
65
|
+
preview: (
|
|
66
|
+
<SuperHero
|
|
67
|
+
badge={{ icon: <Sparkles className="w-4 h-4" />, text: "New in v2.0" }}
|
|
68
|
+
title="Next-Generation"
|
|
69
|
+
titleGradient="Development Platform"
|
|
70
|
+
subtitle="Build faster with our comprehensive UI library"
|
|
71
|
+
features={[
|
|
72
|
+
{ icon: <span>⚛️</span>, text: "React 19" },
|
|
73
|
+
{ icon: <span>📘</span>, text: "TypeScript" },
|
|
74
|
+
{ icon: <span>🎨</span>, text: "Tailwind CSS 4" },
|
|
75
|
+
{ icon: <span>⚡</span>, text: "Lightning Fast" },
|
|
76
|
+
]}
|
|
77
|
+
primaryAction={{ label: "Start Building", href: "/start" }}
|
|
78
|
+
secondaryAction={{ label: "Learn More", href: "/docs", icon: <BookOpen /> }}
|
|
79
|
+
stats={[
|
|
80
|
+
{ number: "56+", label: "Components" },
|
|
81
|
+
{ number: "7", label: "Blocks" },
|
|
82
|
+
{ number: "6", label: "Hooks" },
|
|
83
|
+
{ number: "100%", label: "Type Safe" },
|
|
84
|
+
]}
|
|
85
|
+
scrollIndicator={false}
|
|
86
|
+
/>
|
|
87
|
+
),
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'FeatureSection',
|
|
91
|
+
category: 'blocks',
|
|
92
|
+
description: 'Grid of features with icons and descriptions',
|
|
93
|
+
importPath: "import { FeatureSection } from '@djangocfg/ui/blocks';",
|
|
94
|
+
example: `<FeatureSection
|
|
95
|
+
title="Everything You Need"
|
|
96
|
+
subtitle="All the tools to build modern applications"
|
|
97
|
+
features={[
|
|
98
|
+
{
|
|
99
|
+
icon: <Zap className="w-6 h-6" />,
|
|
100
|
+
title: "Lightning Fast",
|
|
101
|
+
description: "Optimized for performance"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
icon: <Shield className="w-6 h-6" />,
|
|
105
|
+
title: "Secure",
|
|
106
|
+
description: "Built with security in mind"
|
|
107
|
+
}
|
|
108
|
+
]}
|
|
109
|
+
/>`,
|
|
110
|
+
preview: (
|
|
111
|
+
<FeatureSection
|
|
112
|
+
title="Everything You Need"
|
|
113
|
+
subtitle="All the tools to build modern applications"
|
|
114
|
+
features={[
|
|
115
|
+
{
|
|
116
|
+
icon: <Zap className="w-6 h-6" />,
|
|
117
|
+
title: "Lightning Fast",
|
|
118
|
+
description: "Optimized for performance"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
icon: <Shield className="w-6 h-6" />,
|
|
122
|
+
title: "Secure",
|
|
123
|
+
description: "Built with security in mind"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
icon: <Code className="w-6 h-6" />,
|
|
127
|
+
title: "Developer Friendly",
|
|
128
|
+
description: "Great DX with TypeScript"
|
|
129
|
+
}
|
|
130
|
+
]}
|
|
131
|
+
/>
|
|
132
|
+
),
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'CTASection',
|
|
136
|
+
category: 'blocks',
|
|
137
|
+
description: 'Call-to-action section to drive conversions',
|
|
138
|
+
importPath: "import { CTASection } from '@djangocfg/ui/blocks';",
|
|
139
|
+
example: `<CTASection
|
|
140
|
+
title="Ready to Get Started?"
|
|
141
|
+
subtitle="Join thousands of developers building amazing products"
|
|
142
|
+
primaryCTA={{ label: "Start Free Trial", href: "/signup" }}
|
|
143
|
+
secondaryCTA={{ label: "Contact Sales", href: "/contact" }}
|
|
144
|
+
/>`,
|
|
145
|
+
preview: (
|
|
146
|
+
<CTASection
|
|
147
|
+
title="Ready to Get Started?"
|
|
148
|
+
subtitle="Join thousands of developers"
|
|
149
|
+
primaryCTA={{ label: "Start Free Trial", href: "/signup" }}
|
|
150
|
+
secondaryCTA={{ label: "Contact Sales", href: "/contact" }}
|
|
151
|
+
/>
|
|
152
|
+
),
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: 'NewsletterSection',
|
|
156
|
+
category: 'blocks',
|
|
157
|
+
description: 'Email capture section for newsletters',
|
|
158
|
+
importPath: "import { NewsletterSection } from '@djangocfg/ui/blocks';",
|
|
159
|
+
example: `<NewsletterSection
|
|
160
|
+
title="Stay Updated"
|
|
161
|
+
description="Get the latest news delivered to your inbox"
|
|
162
|
+
placeholder="Enter your email"
|
|
163
|
+
buttonText="Subscribe"
|
|
164
|
+
onSubmit={(email) => console.log(email)}
|
|
165
|
+
/>`,
|
|
166
|
+
preview: (
|
|
167
|
+
<NewsletterSection
|
|
168
|
+
title="Stay Updated"
|
|
169
|
+
description="Get the latest news delivered to your inbox"
|
|
170
|
+
placeholder="Enter your email"
|
|
171
|
+
buttonText="Subscribe"
|
|
172
|
+
onSubmit={(email) => console.log('Subscribed:', email)}
|
|
173
|
+
/>
|
|
174
|
+
),
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: 'StatsSection',
|
|
178
|
+
category: 'blocks',
|
|
179
|
+
description: 'Display key metrics and statistics',
|
|
180
|
+
importPath: "import { StatsSection } from '@djangocfg/ui/blocks';",
|
|
181
|
+
example: `<StatsSection
|
|
182
|
+
title="Our Impact"
|
|
183
|
+
stats={[
|
|
184
|
+
{ number: "10K+", label: "Active Users" },
|
|
185
|
+
{ number: "99.9%", label: "Uptime" }
|
|
186
|
+
]}
|
|
187
|
+
/>`,
|
|
188
|
+
preview: (
|
|
189
|
+
<StatsSection
|
|
190
|
+
title="Our Impact"
|
|
191
|
+
stats={[
|
|
192
|
+
{ number: "10K+", label: "Active Users" },
|
|
193
|
+
{ number: "500+", label: "Companies" },
|
|
194
|
+
{ number: "99.9%", label: "Uptime" },
|
|
195
|
+
{ number: "24/7", label: "Support" }
|
|
196
|
+
]}
|
|
197
|
+
/>
|
|
198
|
+
),
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: 'TestimonialSection',
|
|
202
|
+
category: 'blocks',
|
|
203
|
+
description: 'Customer testimonials and reviews',
|
|
204
|
+
importPath: "import { TestimonialSection } from '@djangocfg/ui/blocks';",
|
|
205
|
+
example: `<TestimonialSection
|
|
206
|
+
title="What Our Customers Say"
|
|
207
|
+
testimonials={[{
|
|
208
|
+
content: "This product changed how we work!",
|
|
209
|
+
author: {
|
|
210
|
+
name: "John Doe",
|
|
211
|
+
title: "CEO",
|
|
212
|
+
company: "Company"
|
|
213
|
+
}
|
|
214
|
+
}]}
|
|
215
|
+
/>`,
|
|
216
|
+
preview: (
|
|
217
|
+
<TestimonialSection
|
|
218
|
+
title="What Our Customers Say"
|
|
219
|
+
testimonials={[
|
|
220
|
+
{
|
|
221
|
+
content: "This product changed how we work. Highly recommended!",
|
|
222
|
+
author: {
|
|
223
|
+
name: "John Doe",
|
|
224
|
+
title: "CEO",
|
|
225
|
+
company: "Company",
|
|
226
|
+
avatar: "/avatar.jpg"
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
]}
|
|
230
|
+
/>
|
|
231
|
+
),
|
|
232
|
+
},
|
|
233
|
+
];
|
|
@@ -0,0 +1,308 @@
|
|
|
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
|
+
} from '@djangocfg/ui';
|
|
25
|
+
import type { ComponentConfig } from './types';
|
|
26
|
+
|
|
27
|
+
export const DATA_COMPONENTS: ComponentConfig[] = [
|
|
28
|
+
{
|
|
29
|
+
name: 'Table',
|
|
30
|
+
category: 'data',
|
|
31
|
+
description: 'Responsive data table component',
|
|
32
|
+
importPath: `import {
|
|
33
|
+
Table,
|
|
34
|
+
TableBody,
|
|
35
|
+
TableCaption,
|
|
36
|
+
TableCell,
|
|
37
|
+
TableHead,
|
|
38
|
+
TableHeader,
|
|
39
|
+
TableRow,
|
|
40
|
+
} from '@djangocfg/ui';`,
|
|
41
|
+
example: `<Table>
|
|
42
|
+
<TableCaption>A list of your recent invoices.</TableCaption>
|
|
43
|
+
<TableHeader>
|
|
44
|
+
<TableRow>
|
|
45
|
+
<TableHead>Invoice</TableHead>
|
|
46
|
+
<TableHead>Status</TableHead>
|
|
47
|
+
<TableHead>Method</TableHead>
|
|
48
|
+
<TableHead className="text-right">Amount</TableHead>
|
|
49
|
+
</TableRow>
|
|
50
|
+
</TableHeader>
|
|
51
|
+
<TableBody>
|
|
52
|
+
<TableRow>
|
|
53
|
+
<TableCell className="font-medium">INV001</TableCell>
|
|
54
|
+
<TableCell>Paid</TableCell>
|
|
55
|
+
<TableCell>Credit Card</TableCell>
|
|
56
|
+
<TableCell className="text-right">$250.00</TableCell>
|
|
57
|
+
</TableRow>
|
|
58
|
+
<TableRow>
|
|
59
|
+
<TableCell className="font-medium">INV002</TableCell>
|
|
60
|
+
<TableCell>Pending</TableCell>
|
|
61
|
+
<TableCell>PayPal</TableCell>
|
|
62
|
+
<TableCell className="text-right">$150.00</TableCell>
|
|
63
|
+
</TableRow>
|
|
64
|
+
</TableBody>
|
|
65
|
+
</Table>`,
|
|
66
|
+
preview: (
|
|
67
|
+
<Table>
|
|
68
|
+
<TableCaption>A list of your recent invoices.</TableCaption>
|
|
69
|
+
<TableHeader>
|
|
70
|
+
<TableRow>
|
|
71
|
+
<TableHead>Invoice</TableHead>
|
|
72
|
+
<TableHead>Status</TableHead>
|
|
73
|
+
<TableHead>Method</TableHead>
|
|
74
|
+
<TableHead className="text-right">Amount</TableHead>
|
|
75
|
+
</TableRow>
|
|
76
|
+
</TableHeader>
|
|
77
|
+
<TableBody>
|
|
78
|
+
<TableRow>
|
|
79
|
+
<TableCell className="font-medium">INV001</TableCell>
|
|
80
|
+
<TableCell>Paid</TableCell>
|
|
81
|
+
<TableCell>Credit Card</TableCell>
|
|
82
|
+
<TableCell className="text-right">$250.00</TableCell>
|
|
83
|
+
</TableRow>
|
|
84
|
+
<TableRow>
|
|
85
|
+
<TableCell className="font-medium">INV002</TableCell>
|
|
86
|
+
<TableCell>Pending</TableCell>
|
|
87
|
+
<TableCell>PayPal</TableCell>
|
|
88
|
+
<TableCell className="text-right">$150.00</TableCell>
|
|
89
|
+
</TableRow>
|
|
90
|
+
<TableRow>
|
|
91
|
+
<TableCell className="font-medium">INV003</TableCell>
|
|
92
|
+
<TableCell>Unpaid</TableCell>
|
|
93
|
+
<TableCell>Bank Transfer</TableCell>
|
|
94
|
+
<TableCell className="text-right">$350.00</TableCell>
|
|
95
|
+
</TableRow>
|
|
96
|
+
</TableBody>
|
|
97
|
+
</Table>
|
|
98
|
+
),
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'Accordion',
|
|
102
|
+
category: 'data',
|
|
103
|
+
description: 'Vertically stacked set of collapsible sections',
|
|
104
|
+
importPath: `import {
|
|
105
|
+
Accordion,
|
|
106
|
+
AccordionContent,
|
|
107
|
+
AccordionItem,
|
|
108
|
+
AccordionTrigger,
|
|
109
|
+
} from '@djangocfg/ui';`,
|
|
110
|
+
example: `<Accordion type="single" collapsible className="w-full">
|
|
111
|
+
<AccordionItem value="item-1">
|
|
112
|
+
<AccordionTrigger>Is it accessible?</AccordionTrigger>
|
|
113
|
+
<AccordionContent>
|
|
114
|
+
Yes. It adheres to the WAI-ARIA design pattern.
|
|
115
|
+
</AccordionContent>
|
|
116
|
+
</AccordionItem>
|
|
117
|
+
<AccordionItem value="item-2">
|
|
118
|
+
<AccordionTrigger>Is it styled?</AccordionTrigger>
|
|
119
|
+
<AccordionContent>
|
|
120
|
+
Yes. It comes with default styles that matches the aesthetic.
|
|
121
|
+
</AccordionContent>
|
|
122
|
+
</AccordionItem>
|
|
123
|
+
<AccordionItem value="item-3">
|
|
124
|
+
<AccordionTrigger>Is it animated?</AccordionTrigger>
|
|
125
|
+
<AccordionContent>
|
|
126
|
+
Yes. It's animated by default, but you can disable it if you prefer.
|
|
127
|
+
</AccordionContent>
|
|
128
|
+
</AccordionItem>
|
|
129
|
+
</Accordion>`,
|
|
130
|
+
preview: (
|
|
131
|
+
<Accordion type="single" collapsible className="w-full">
|
|
132
|
+
<AccordionItem value="item-1">
|
|
133
|
+
<AccordionTrigger>Is it accessible?</AccordionTrigger>
|
|
134
|
+
<AccordionContent>
|
|
135
|
+
Yes. It adheres to the WAI-ARIA design pattern.
|
|
136
|
+
</AccordionContent>
|
|
137
|
+
</AccordionItem>
|
|
138
|
+
<AccordionItem value="item-2">
|
|
139
|
+
<AccordionTrigger>Is it styled?</AccordionTrigger>
|
|
140
|
+
<AccordionContent>
|
|
141
|
+
Yes. It comes with default styles that matches the aesthetic.
|
|
142
|
+
</AccordionContent>
|
|
143
|
+
</AccordionItem>
|
|
144
|
+
<AccordionItem value="item-3">
|
|
145
|
+
<AccordionTrigger>Is it animated?</AccordionTrigger>
|
|
146
|
+
<AccordionContent>
|
|
147
|
+
Yes. It's animated by default, but you can disable it if you prefer.
|
|
148
|
+
</AccordionContent>
|
|
149
|
+
</AccordionItem>
|
|
150
|
+
</Accordion>
|
|
151
|
+
),
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: 'Collapsible',
|
|
155
|
+
category: 'data',
|
|
156
|
+
description: 'Simple collapsible content panel',
|
|
157
|
+
importPath: `import {
|
|
158
|
+
Collapsible,
|
|
159
|
+
CollapsibleContent,
|
|
160
|
+
CollapsibleTrigger,
|
|
161
|
+
} from '@djangocfg/ui';`,
|
|
162
|
+
example: `<Collapsible className="w-full max-w-md space-y-2">
|
|
163
|
+
<CollapsibleTrigger className="flex items-center justify-between w-full p-4 bg-muted rounded-md">
|
|
164
|
+
<span className="font-medium">Can I use this in my project?</span>
|
|
165
|
+
<ChevronDown className="h-4 w-4" />
|
|
166
|
+
</CollapsibleTrigger>
|
|
167
|
+
<CollapsibleContent className="p-4 bg-muted/50 rounded-md">
|
|
168
|
+
<p className="text-sm text-muted-foreground">
|
|
169
|
+
Yes! This component is free to use in your projects.
|
|
170
|
+
</p>
|
|
171
|
+
</CollapsibleContent>
|
|
172
|
+
</Collapsible>`,
|
|
173
|
+
preview: (
|
|
174
|
+
<Collapsible className="w-full max-w-md space-y-2">
|
|
175
|
+
<CollapsibleTrigger className="flex items-center justify-between w-full p-4 bg-muted rounded-md">
|
|
176
|
+
<span className="font-medium">Can I use this in my project?</span>
|
|
177
|
+
<svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
178
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
|
|
179
|
+
</svg>
|
|
180
|
+
</CollapsibleTrigger>
|
|
181
|
+
<CollapsibleContent className="p-4 bg-muted/50 rounded-md">
|
|
182
|
+
<p className="text-sm text-muted-foreground">
|
|
183
|
+
Yes! This component is free to use in your projects. It's built with
|
|
184
|
+
Radix UI primitives and Tailwind CSS.
|
|
185
|
+
</p>
|
|
186
|
+
</CollapsibleContent>
|
|
187
|
+
</Collapsible>
|
|
188
|
+
),
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: 'Toggle',
|
|
192
|
+
category: 'data',
|
|
193
|
+
description: 'Two-state button for on/off interactions',
|
|
194
|
+
importPath: `import { Toggle } from '@djangocfg/ui';`,
|
|
195
|
+
example: `<div className="flex gap-2">
|
|
196
|
+
<Toggle aria-label="Toggle bold">
|
|
197
|
+
<Bold className="h-4 w-4" />
|
|
198
|
+
</Toggle>
|
|
199
|
+
<Toggle aria-label="Toggle italic">
|
|
200
|
+
<Italic className="h-4 w-4" />
|
|
201
|
+
</Toggle>
|
|
202
|
+
<Toggle aria-label="Toggle underline">
|
|
203
|
+
<Underline className="h-4 w-4" />
|
|
204
|
+
</Toggle>
|
|
205
|
+
</div>`,
|
|
206
|
+
preview: (
|
|
207
|
+
<div className="flex gap-2">
|
|
208
|
+
<Toggle aria-label="Toggle bold">
|
|
209
|
+
<svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
210
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 12h12M6 6h12M6 18h12" />
|
|
211
|
+
</svg>
|
|
212
|
+
</Toggle>
|
|
213
|
+
<Toggle aria-label="Toggle italic">
|
|
214
|
+
<svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
215
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4" />
|
|
216
|
+
</svg>
|
|
217
|
+
</Toggle>
|
|
218
|
+
<Toggle aria-label="Toggle underline">
|
|
219
|
+
<svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
220
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 12h.01M12 12h.01M18 12h.01" />
|
|
221
|
+
</svg>
|
|
222
|
+
</Toggle>
|
|
223
|
+
</div>
|
|
224
|
+
),
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
name: 'ToggleGroup',
|
|
228
|
+
category: 'data',
|
|
229
|
+
description: 'Group of toggle buttons with single or multiple selection',
|
|
230
|
+
importPath: `import { ToggleGroup, ToggleGroupItem } from '@djangocfg/ui';`,
|
|
231
|
+
example: `<div className="space-y-4">
|
|
232
|
+
<div>
|
|
233
|
+
<p className="text-sm font-medium mb-2">Single Selection</p>
|
|
234
|
+
<ToggleGroup type="single">
|
|
235
|
+
<ToggleGroupItem value="bold" aria-label="Toggle bold">
|
|
236
|
+
<Bold className="h-4 w-4" />
|
|
237
|
+
</ToggleGroupItem>
|
|
238
|
+
<ToggleGroupItem value="italic" aria-label="Toggle italic">
|
|
239
|
+
<Italic className="h-4 w-4" />
|
|
240
|
+
</ToggleGroupItem>
|
|
241
|
+
<ToggleGroupItem value="underline" aria-label="Toggle underline">
|
|
242
|
+
<Underline className="h-4 w-4" />
|
|
243
|
+
</ToggleGroupItem>
|
|
244
|
+
</ToggleGroup>
|
|
245
|
+
</div>
|
|
246
|
+
|
|
247
|
+
<div>
|
|
248
|
+
<p className="text-sm font-medium mb-2">Multiple Selection</p>
|
|
249
|
+
<ToggleGroup type="multiple">
|
|
250
|
+
<ToggleGroupItem value="bold" aria-label="Toggle bold">
|
|
251
|
+
<Bold className="h-4 w-4" />
|
|
252
|
+
</ToggleGroupItem>
|
|
253
|
+
<ToggleGroupItem value="italic" aria-label="Toggle italic">
|
|
254
|
+
<Italic className="h-4 w-4" />
|
|
255
|
+
</ToggleGroupItem>
|
|
256
|
+
<ToggleGroupItem value="underline" aria-label="Toggle underline">
|
|
257
|
+
<Underline className="h-4 w-4" />
|
|
258
|
+
</ToggleGroupItem>
|
|
259
|
+
</ToggleGroup>
|
|
260
|
+
</div>
|
|
261
|
+
</div>`,
|
|
262
|
+
preview: (
|
|
263
|
+
<div className="space-y-4">
|
|
264
|
+
<div>
|
|
265
|
+
<p className="text-sm font-medium mb-2">Single Selection</p>
|
|
266
|
+
<ToggleGroup type="single">
|
|
267
|
+
<ToggleGroupItem value="bold" aria-label="Toggle bold">
|
|
268
|
+
<svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
269
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 12h12" />
|
|
270
|
+
</svg>
|
|
271
|
+
</ToggleGroupItem>
|
|
272
|
+
<ToggleGroupItem value="italic" aria-label="Toggle italic">
|
|
273
|
+
<svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
274
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10 20l4-16" />
|
|
275
|
+
</svg>
|
|
276
|
+
</ToggleGroupItem>
|
|
277
|
+
<ToggleGroupItem value="underline" aria-label="Toggle underline">
|
|
278
|
+
<svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
279
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18h12" />
|
|
280
|
+
</svg>
|
|
281
|
+
</ToggleGroupItem>
|
|
282
|
+
</ToggleGroup>
|
|
283
|
+
</div>
|
|
284
|
+
|
|
285
|
+
<div>
|
|
286
|
+
<p className="text-sm font-medium mb-2">Multiple Selection</p>
|
|
287
|
+
<ToggleGroup type="multiple">
|
|
288
|
+
<ToggleGroupItem value="bold" aria-label="Toggle bold">
|
|
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 12h12" />
|
|
291
|
+
</svg>
|
|
292
|
+
</ToggleGroupItem>
|
|
293
|
+
<ToggleGroupItem value="italic" aria-label="Toggle italic">
|
|
294
|
+
<svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
295
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10 20l4-16" />
|
|
296
|
+
</svg>
|
|
297
|
+
</ToggleGroupItem>
|
|
298
|
+
<ToggleGroupItem value="underline" aria-label="Toggle underline">
|
|
299
|
+
<svg className="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
300
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18h12" />
|
|
301
|
+
</svg>
|
|
302
|
+
</ToggleGroupItem>
|
|
303
|
+
</ToggleGroup>
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
),
|
|
307
|
+
},
|
|
308
|
+
];
|