@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,400 +0,0 @@
1
- /**
2
- * Specialized Components Configuration
3
- */
4
-
5
- import React from 'react';
6
- import {
7
- Button,
8
- ButtonGroup,
9
- Empty,
10
- EmptyHeader,
11
- EmptyTitle,
12
- EmptyDescription,
13
- EmptyContent,
14
- EmptyMedia,
15
- Spinner,
16
- Kbd,
17
- TokenIcon,
18
- Toaster,
19
- InputGroup,
20
- Item,
21
- } from '@djangocfg/ui';
22
- import type { ComponentConfig } from './types';
23
-
24
- export const SPECIALIZED_COMPONENTS: ComponentConfig[] = [
25
- {
26
- name: 'Sidebar',
27
- category: 'specialized',
28
- description: 'Full-featured sidebar navigation component (23KB) with collapsible groups, icons, and Next.js router support',
29
- importPath: `import {
30
- Sidebar,
31
- SidebarContent,
32
- SidebarGroup,
33
- SidebarGroupLabel,
34
- SidebarGroupContent,
35
- SidebarMenu,
36
- SidebarMenuItem,
37
- SidebarMenuButton,
38
- SidebarMenuSub,
39
- SidebarMenuSubButton,
40
- SidebarMenuSubItem,
41
- } from '@djangocfg/ui';`,
42
- example: `// SidebarMenuButton with href automatically uses Next.js Link
43
- <Sidebar>
44
- <SidebarContent>
45
- <SidebarGroup>
46
- <SidebarGroupLabel>Main</SidebarGroupLabel>
47
- <SidebarGroupContent>
48
- <SidebarMenu>
49
- <SidebarMenuItem>
50
- <SidebarMenuButton href="/" isActive tooltip="Dashboard">
51
- <HomeIcon />
52
- <span>Dashboard</span>
53
- </SidebarMenuButton>
54
- </SidebarMenuItem>
55
- <SidebarMenuItem>
56
- <SidebarMenuButton href="/users" tooltip="Users">
57
- <UsersIcon />
58
- <span>Users</span>
59
- </SidebarMenuButton>
60
- </SidebarMenuItem>
61
- </SidebarMenu>
62
- </SidebarGroupContent>
63
- </SidebarGroup>
64
-
65
- <SidebarGroup>
66
- <SidebarGroupLabel>Settings</SidebarGroupLabel>
67
- <SidebarGroupContent>
68
- <SidebarMenu>
69
- <SidebarMenuItem>
70
- <SidebarMenuButton href="/settings">
71
- <SettingsIcon />
72
- <span>Preferences</span>
73
- </SidebarMenuButton>
74
- {/* Submenu items also support href */}
75
- <SidebarMenuSub>
76
- <SidebarMenuSubItem>
77
- <SidebarMenuSubButton href="/settings/profile">
78
- Profile
79
- </SidebarMenuSubButton>
80
- </SidebarMenuSubItem>
81
- </SidebarMenuSub>
82
- </SidebarMenuItem>
83
- </SidebarMenu>
84
- </SidebarGroupContent>
85
- </SidebarGroup>
86
- </SidebarContent>
87
- </Sidebar>`,
88
- preview: (
89
- <div className="p-6 border rounded-md bg-muted/50">
90
- <p className="text-sm text-muted-foreground mb-4">
91
- The Sidebar component is a comprehensive navigation solution with:
92
- </p>
93
- <ul className="space-y-2 text-sm text-muted-foreground">
94
- <li>• Collapsible menu groups</li>
95
- <li>• Icon support with lucide-react</li>
96
- <li>• Active state management</li>
97
- <li>• Responsive design (mobile drawer)</li>
98
- <li>• Keyboard navigation</li>
99
- <li>• 23KB bundle size</li>
100
- </ul>
101
- <p className="text-xs text-muted-foreground mt-4">
102
- See <strong>DashboardLayout</strong> in the UI Guide for full implementation example
103
- </p>
104
- </div>
105
- ),
106
- },
107
- {
108
- name: 'ImageWithFallback',
109
- category: 'specialized',
110
- description: 'Enhanced image component with loading states and fallback support',
111
- importPath: `import { ImageWithFallback } from '@djangocfg/ui';`,
112
- example: `<div className="space-y-4">
113
- {/* Successful load */}
114
- <ImageWithFallback
115
- src="/images/example.jpg"
116
- alt="Example image"
117
- width={300}
118
- height={200}
119
- className="rounded-md"
120
- />
121
-
122
- {/* With fallback */}
123
- <ImageWithFallback
124
- src="/invalid-image.jpg"
125
- alt="Image with fallback"
126
- fallbackSrc="/images/placeholder.jpg"
127
- width={300}
128
- height={200}
129
- className="rounded-md"
130
- />
131
-
132
- {/* Custom loading state */}
133
- <ImageWithFallback
134
- src="/large-image.jpg"
135
- alt="Loading example"
136
- width={300}
137
- height={200}
138
- className="rounded-md"
139
- loadingComponent={
140
- <div className="flex items-center justify-center h-full">
141
- <Spinner />
142
- </div>
143
- }
144
- />
145
- </div>`,
146
- preview: (
147
- <div className="space-y-4">
148
- <p className="text-sm text-muted-foreground">
149
- Features:
150
- </p>
151
- <ul className="space-y-2 text-sm text-muted-foreground">
152
- <li>• Automatic fallback on load error</li>
153
- <li>• Custom loading states</li>
154
- <li>• Built on Next.js Image component</li>
155
- <li>• Preserves aspect ratio</li>
156
- <li>• Optimized performance</li>
157
- </ul>
158
- <div className="p-4 border rounded-md bg-muted/30">
159
- <p className="text-xs font-mono text-muted-foreground">
160
- Image loading states: loading → loaded | error → fallback
161
- </p>
162
- </div>
163
- </div>
164
- ),
165
- },
166
- {
167
- name: 'ButtonGroup',
168
- category: 'specialized',
169
- description: 'Group buttons together with shared borders',
170
- importPath: `import { ButtonGroup, Button } from '@djangocfg/ui';`,
171
- example: `<ButtonGroup orientation="horizontal">
172
- <Button variant="outline">Left</Button>
173
- <Button variant="outline">Center</Button>
174
- <Button variant="outline">Right</Button>
175
- </ButtonGroup>`,
176
- preview: (
177
- <div className="space-y-4">
178
- <ButtonGroup orientation="horizontal">
179
- <Button variant="outline">Left</Button>
180
- <Button variant="outline">Center</Button>
181
- <Button variant="outline">Right</Button>
182
- </ButtonGroup>
183
- <ButtonGroup orientation="vertical">
184
- <Button variant="outline">Top</Button>
185
- <Button variant="outline">Middle</Button>
186
- <Button variant="outline">Bottom</Button>
187
- </ButtonGroup>
188
- </div>
189
- ),
190
- },
191
- {
192
- name: 'Empty',
193
- category: 'specialized',
194
- description: 'Empty state component for no data scenarios',
195
- importPath: `import { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia } from '@djangocfg/ui';`,
196
- example: `<Empty>
197
- <EmptyHeader>
198
- <EmptyMedia>
199
- <svg>...</svg>
200
- </EmptyMedia>
201
- <EmptyTitle>No results found</EmptyTitle>
202
- <EmptyDescription>
203
- Try adjusting your search or filter to find what you're looking for.
204
- </EmptyDescription>
205
- </EmptyHeader>
206
- <EmptyContent>
207
- <Button>Clear filters</Button>
208
- </EmptyContent>
209
- </Empty>`,
210
- preview: (
211
- <Empty className="border">
212
- <EmptyHeader>
213
- <EmptyMedia variant="icon">
214
- <svg className="size-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
215
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4" />
216
- </svg>
217
- </EmptyMedia>
218
- <EmptyTitle>No results found</EmptyTitle>
219
- <EmptyDescription>
220
- Try adjusting your search or filter to find what you're looking for.
221
- </EmptyDescription>
222
- </EmptyHeader>
223
- <EmptyContent>
224
- <Button>Clear filters</Button>
225
- </EmptyContent>
226
- </Empty>
227
- ),
228
- },
229
- {
230
- name: 'Spinner',
231
- category: 'specialized',
232
- description: 'Loading spinner indicator',
233
- importPath: `import { Spinner } from '@djangocfg/ui';`,
234
- example: `<div className="flex gap-4 items-center">
235
- <Spinner />
236
- <Spinner className="size-6" />
237
- <Spinner className="size-8" />
238
- </div>`,
239
- preview: (
240
- <div className="flex gap-4 items-center">
241
- <Spinner />
242
- <Spinner className="size-6" />
243
- <Spinner className="size-8" />
244
- </div>
245
- ),
246
- },
247
- {
248
- name: 'Kbd',
249
- category: 'specialized',
250
- description: 'Keyboard key display component',
251
- importPath: `import { Kbd } from '@djangocfg/ui';`,
252
- example: `<div className="flex gap-2">
253
- <Kbd>⌘</Kbd>
254
- <Kbd>K</Kbd>
255
- </div>`,
256
- preview: (
257
- <div className="space-y-4">
258
- <div className="flex gap-2 items-center">
259
- <span className="text-sm">Press</span>
260
- <Kbd>⌘</Kbd>
261
- <Kbd>K</Kbd>
262
- <span className="text-sm">to open</span>
263
- </div>
264
- <div className="flex gap-2 items-center">
265
- <span className="text-sm">Press</span>
266
- <Kbd>Ctrl</Kbd>
267
- <span className="text-sm">+</span>
268
- <Kbd>C</Kbd>
269
- <span className="text-sm">to copy</span>
270
- </div>
271
- </div>
272
- ),
273
- },
274
- {
275
- name: 'TokenIcon',
276
- category: 'specialized',
277
- description: 'Cryptocurrency token icon component',
278
- importPath: `import { TokenIcon } from '@djangocfg/ui';`,
279
- example: `<div className="flex gap-4">
280
- <TokenIcon symbol="btc" size={32} />
281
- <TokenIcon symbol="eth" size={32} />
282
- <TokenIcon symbol="usdt" size={32} />
283
- </div>`,
284
- preview: (
285
- <div className="flex gap-4 items-center">
286
- <TokenIcon symbol="btc" size={32} />
287
- <TokenIcon symbol="eth" size={32} />
288
- <TokenIcon symbol="usdt" size={32} />
289
- <TokenIcon symbol="bnb" size={32} />
290
- </div>
291
- ),
292
- },
293
- {
294
- name: 'Sonner (Toaster)',
295
- category: 'specialized',
296
- description: 'Toast notifications powered by Sonner library',
297
- importPath: `import { Toaster } from '@djangocfg/ui';
298
- import { toast } from 'sonner';`,
299
- example: `// Add Toaster to your app layout
300
- <Toaster />
301
-
302
- // Then use toast anywhere in your app
303
- toast.success('Operation completed!');
304
- toast.error('Something went wrong');
305
- toast.info('New message received');
306
- toast.promise(
307
- fetchData(),
308
- {
309
- loading: 'Loading...',
310
- success: 'Data loaded!',
311
- error: 'Failed to load',
312
- }
313
- );`,
314
- preview: (
315
- <div className="p-6 border rounded-md bg-muted/50">
316
- <p className="text-sm text-muted-foreground mb-4">
317
- Sonner is a powerful toast notification system with:
318
- </p>
319
- <ul className="space-y-2 text-sm text-muted-foreground">
320
- <li>• Promise-based toasts</li>
321
- <li>• Multiple variants (success, error, info, warning)</li>
322
- <li>• Custom duration and position</li>
323
- <li>• Action buttons support</li>
324
- <li>• Dark mode support</li>
325
- </ul>
326
- <p className="text-xs text-muted-foreground mt-4">
327
- See <strong>sonner</strong> documentation for API details
328
- </p>
329
- </div>
330
- ),
331
- },
332
- {
333
- name: 'InputGroup',
334
- category: 'specialized',
335
- description: 'Enhanced input with prefix/suffix addons',
336
- importPath: `import { InputGroup, Input } from '@djangocfg/ui';`,
337
- example: `<InputGroup>
338
- <InputGroupAddon align="inline-start">
339
- <SearchIcon className="size-4" />
340
- </InputGroupAddon>
341
- <Input placeholder="Search..." />
342
- <InputGroupAddon align="inline-end">
343
- <Kbd>⌘K</Kbd>
344
- </InputGroupAddon>
345
- </InputGroup>`,
346
- preview: (
347
- <div className="p-6 border rounded-md bg-muted/50 space-y-4">
348
- <p className="text-sm text-muted-foreground">
349
- InputGroup allows you to add prefixes and suffixes to inputs:
350
- </p>
351
- <ul className="space-y-2 text-sm text-muted-foreground">
352
- <li>• Icons and text addons</li>
353
- <li>• Button addons</li>
354
- <li>• Keyboard shortcuts display</li>
355
- <li>• Currency and units</li>
356
- <li>• Inline and block alignment</li>
357
- </ul>
358
- <InputGroup className="max-w-sm">
359
- <div className="px-3 text-sm text-muted-foreground">$</div>
360
- <input type="text" placeholder="0.00" className="flex-1 bg-transparent border-0 outline-none px-2" />
361
- <div className="px-3 text-sm text-muted-foreground">USD</div>
362
- </InputGroup>
363
- </div>
364
- ),
365
- },
366
- {
367
- name: 'Item',
368
- category: 'specialized',
369
- description: 'List item component with variants and layouts',
370
- importPath: `import { Item, ItemGroup } from '@djangocfg/ui';`,
371
- example: `<ItemGroup>
372
- <Item variant="outline" size="default">
373
- <ItemIcon>
374
- <FileIcon />
375
- </ItemIcon>
376
- <ItemContent>
377
- <ItemTitle>Document.pdf</ItemTitle>
378
- <ItemDescription>Updated 2 hours ago</ItemDescription>
379
- </ItemContent>
380
- <ItemAction>
381
- <Button variant="ghost" size="sm">View</Button>
382
- </ItemAction>
383
- </Item>
384
- </ItemGroup>`,
385
- preview: (
386
- <div className="p-6 border rounded-md bg-muted/50">
387
- <p className="text-sm text-muted-foreground mb-4">
388
- Item component for building lists with:
389
- </p>
390
- <ul className="space-y-2 text-sm text-muted-foreground">
391
- <li>• Multiple variants (default, outline, muted)</li>
392
- <li>• Icon, content, and action slots</li>
393
- <li>• Flexible layouts</li>
394
- <li>• Separator support</li>
395
- <li>• Perfect for file lists, notifications, etc.</li>
396
- </ul>
397
- </div>
398
- ),
399
- },
400
- ];
@@ -1,234 +0,0 @@
1
- /**
2
- * Developer Tools Components Configuration
3
- */
4
-
5
- import React from 'react';
6
- import { JsonTree, PrettyCode, Mermaid, LottiePlayer } from '@djangocfg/ui';
7
- import type { ComponentConfig } from './types';
8
-
9
- // Sample data for demos
10
- const sampleJsonData = {
11
- user: {
12
- id: 1,
13
- name: "John Doe",
14
- email: "john@example.com",
15
- profile: {
16
- bio: "Software engineer",
17
- location: "San Francisco",
18
- interests: ["coding", "music", "travel"]
19
- },
20
- posts: [
21
- { id: 1, title: "First Post", views: 120 },
22
- { id: 2, title: "Second Post", views: 89 }
23
- ]
24
- },
25
- settings: {
26
- theme: "dark",
27
- notifications: true,
28
- language: "en"
29
- }
30
- };
31
-
32
- const samplePythonCode = `def fibonacci(n):
33
- """Calculate the nth Fibonacci number."""
34
- if n <= 1:
35
- return n
36
- return fibonacci(n - 1) + fibonacci(n - 2)
37
-
38
- # Example usage
39
- result = fibonacci(10)
40
- print(f"The 10th Fibonacci number is: {result}")`;
41
-
42
- const sampleMermaidChart = `graph TD
43
- A[Start] --> B{Is it?}
44
- B -->|Yes| C[OK]
45
- C --> D[Rethink]
46
- D --> B
47
- B ---->|No| E[End]`;
48
-
49
- export const TOOLS_COMPONENTS: ComponentConfig[] = [
50
- {
51
- name: 'JsonTree',
52
- category: 'tools',
53
- description: 'Interactive JSON tree viewer with expand/collapse, search, and export functionality',
54
- importPath: `import { JsonTree } from '@djangocfg/ui';`,
55
- example: `<JsonTree
56
- title="User Data"
57
- data={{
58
- user: {
59
- id: 1,
60
- name: "John Doe",
61
- email: "john@example.com",
62
- profile: {
63
- bio: "Software engineer",
64
- interests: ["coding", "music"]
65
- }
66
- }
67
- }}
68
- config={{
69
- maxAutoExpandDepth: 2,
70
- showCollectionInfo: true,
71
- showExpandControls: true,
72
- showActionButtons: true,
73
- }}
74
- />`,
75
- preview: (
76
- <div className="h-[500px]">
77
- <JsonTree
78
- title="User Data"
79
- data={sampleJsonData}
80
- config={{
81
- maxAutoExpandDepth: 2,
82
- showCollectionInfo: true,
83
- showExpandControls: true,
84
- showActionButtons: true,
85
- }}
86
- />
87
- </div>
88
- ),
89
- },
90
- {
91
- name: 'PrettyCode',
92
- category: 'tools',
93
- description: 'Syntax-highlighted code display with automatic language detection and theme support',
94
- importPath: `import { PrettyCode } from '@djangocfg/ui';`,
95
- example: `// Code as string
96
- <PrettyCode
97
- data={pythonCode}
98
- language="python"
99
- />
100
-
101
- // JSON object (auto-formatted)
102
- <PrettyCode
103
- data={{ user: "John", age: 30 }}
104
- language="json"
105
- />
106
-
107
- // Inline code
108
- <PrettyCode
109
- data="const x = 42;"
110
- language="javascript"
111
- inline
112
- />`,
113
- preview: (
114
- <div className="space-y-4">
115
- {/* Block code example */}
116
- <div className="h-[300px]">
117
- <PrettyCode
118
- data={samplePythonCode}
119
- language="python"
120
- />
121
- </div>
122
-
123
- {/* Inline code example */}
124
- <div className="p-4 border rounded-md bg-muted/50">
125
- <p className="text-sm text-muted-foreground mb-2">
126
- Inline code example:
127
- </p>
128
- <div className="flex items-center gap-2">
129
- <span className="text-sm">Run</span>
130
- <PrettyCode
131
- data="npm install @djangocfg/ui"
132
- language="bash"
133
- inline
134
- />
135
- <span className="text-sm">to install</span>
136
- </div>
137
- </div>
138
- </div>
139
- ),
140
- },
141
- {
142
- name: 'Mermaid',
143
- category: 'tools',
144
- description: 'Interactive Mermaid diagram renderer with fullscreen view and theme support',
145
- importPath: `import { Mermaid } from '@djangocfg/ui';`,
146
- example: `<Mermaid
147
- chart={\`
148
- graph TD
149
- A[Start] --> B{Is it?}
150
- B -->|Yes| C[OK]
151
- C --> D[Rethink]
152
- D --> B
153
- B -->|No| E[End]
154
- \`}
155
- />
156
-
157
- // Sequence diagram
158
- <Mermaid
159
- chart={\`
160
- sequenceDiagram
161
- participant A as Alice
162
- participant B as Bob
163
- A->>B: Hello Bob!
164
- B->>A: Hello Alice!
165
- \`}
166
- />
167
-
168
- // Flowchart
169
- <Mermaid
170
- chart={\`
171
- flowchart LR
172
- A[Hard edge] -->|Link text| B(Round edge)
173
- B --> C{Decision}
174
- C -->|One| D[Result one]
175
- C -->|Two| E[Result two]
176
- \`}
177
- />`,
178
- preview: (
179
- <div className="space-y-4">
180
- <Mermaid chart={sampleMermaidChart} />
181
-
182
- <div className="p-4 border rounded-md bg-muted/50">
183
- <p className="text-sm text-muted-foreground mb-2">
184
- Supported diagram types:
185
- </p>
186
- <ul className="space-y-1 text-sm text-muted-foreground">
187
- <li>• Flowchart / Graph</li>
188
- <li>• Sequence diagram</li>
189
- <li>• Class diagram</li>
190
- <li>• State diagram</li>
191
- <li>• Entity Relationship diagram</li>
192
- <li>• User Journey</li>
193
- <li>• Gantt chart</li>
194
- <li>• Pie chart</li>
195
- <li>• Git graph</li>
196
- </ul>
197
- <p className="text-xs text-muted-foreground mt-3">
198
- Click on diagram to view in fullscreen mode
199
- </p>
200
- </div>
201
- </div>
202
- ),
203
- },
204
- {
205
- name: 'LottiePlayer',
206
- category: 'tools',
207
- description: 'Lottie animation player with size presets and playback controls',
208
- importPath: `import { LottiePlayer } from '@djangocfg/ui';`,
209
- example: `<LottiePlayer
210
- src="https://lottie.host/embed/a0eb3923-2f93-4a2e-9c91-3e0b0f6f3b3e/WHJEbMDJLn.json"
211
- size="md"
212
- autoplay
213
- loop
214
- />
215
-
216
- // Custom size and speed
217
- <LottiePlayer
218
- src={animationData}
219
- width={300}
220
- height={300}
221
- speed={1.5}
222
- />`,
223
- preview: (
224
- <div className="flex items-center justify-center p-8">
225
- <LottiePlayer
226
- src="https://lottie.host/embed/a0eb3923-2f93-4a2e-9c91-3e0b0f6f3b3e/WHJEbMDJLn.json"
227
- size="md"
228
- autoplay
229
- loop
230
- />
231
- </div>
232
- ),
233
- },
234
- ];
@@ -1,14 +0,0 @@
1
- /**
2
- * Component Configuration Types
3
- */
4
-
5
- import React from 'react';
6
-
7
- export interface ComponentConfig {
8
- name: string;
9
- category: string;
10
- description: string;
11
- importPath: string;
12
- example: string;
13
- preview: React.ReactNode;
14
- }
@@ -1,42 +0,0 @@
1
- /**
2
- * Configuration Module Exports
3
- * Single source of truth for all UI documentation
4
- */
5
-
6
- // Components configuration
7
- export {
8
- COMPONENTS_CONFIG,
9
- FORM_COMPONENTS,
10
- LAYOUT_COMPONENTS,
11
- NAVIGATION_COMPONENTS,
12
- OVERLAY_COMPONENTS,
13
- FEEDBACK_COMPONENTS,
14
- DATA_COMPONENTS,
15
- SPECIALIZED_COMPONENTS,
16
- BLOCKS,
17
- HOOKS,
18
- getComponentsByCategory,
19
- getComponentByName,
20
- getAllCategories,
21
- getComponentCount,
22
- } from './components';
23
- export type { ComponentConfig } from './components';
24
-
25
- // Categories configuration
26
- export {
27
- CATEGORIES,
28
- getCategoryById,
29
- getTotalComponentCount,
30
- } from './categories.config';
31
- export type { ComponentCategory } from './categories.config';
32
-
33
- // Tailwind configuration
34
- export { TAILWIND_GUIDE } from './tailwind.config';
35
- export type { TailwindGuide } from './tailwind.config';
36
-
37
- // AI Export configuration
38
- export {
39
- UI_LIBRARY_CONFIG,
40
- generateAIContext,
41
- } from './ai-export.config';
42
- export type { UILibraryConfig } from './ai-export.config';