@djangocfg/layouts 1.4.27 → 1.4.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/package.json +8 -8
  2. package/src/auth/context/AuthContext.tsx +4 -1
  3. package/src/auth/hooks/index.ts +2 -0
  4. package/src/auth/hooks/useAuthForm.ts +2 -0
  5. package/src/auth/hooks/useAuthGuard.ts +2 -0
  6. package/src/auth/hooks/useAutoAuth.ts +16 -11
  7. package/src/auth/hooks/useLocalStorage.ts +2 -0
  8. package/src/auth/hooks/useProfileCache.ts +2 -0
  9. package/src/auth/hooks/useSessionStorage.ts +2 -0
  10. package/src/auth/middlewares/index.ts +1 -1
  11. package/src/auth/middlewares/proxy.ts +10 -2
  12. package/src/layouts/AppLayout/AppLayout.tsx +9 -7
  13. package/src/layouts/AppLayout/components/ErrorBoundary.tsx +6 -3
  14. package/src/layouts/AppLayout/components/PageProgress.tsx +2 -0
  15. package/src/layouts/AppLayout/components/Seo.tsx +2 -0
  16. package/src/layouts/AppLayout/components/UpdateNotifier/UpdateNotifier.tsx +3 -2
  17. package/src/layouts/AppLayout/hooks/index.ts +2 -0
  18. package/src/layouts/AppLayout/hooks/useNavigation.ts +3 -1
  19. package/src/layouts/AppLayout/layouts/AdminLayout/AdminLayout.tsx +1 -0
  20. package/src/layouts/AppLayout/layouts/AuthLayout/AuthContext.tsx +2 -0
  21. package/src/layouts/AppLayout/layouts/AuthLayout/IdentifierForm.tsx +2 -0
  22. package/src/layouts/AppLayout/layouts/AuthLayout/OTPForm.tsx +4 -0
  23. package/src/layouts/AppLayout/layouts/AuthLayout/index.ts +2 -0
  24. package/src/layouts/AppLayout/layouts/PrivateLayout/PrivateLayout.tsx +1 -0
  25. package/src/layouts/AppLayout/providers/CoreProviders.tsx +1 -0
  26. package/src/layouts/PaymentsLayout/PaymentsLayout.tsx +1 -0
  27. package/src/layouts/PaymentsLayout/components/CreatePaymentDialog.tsx +1 -0
  28. package/src/layouts/PaymentsLayout/events.ts +2 -0
  29. package/src/layouts/ProfileLayout/ProfileLayout.tsx +1 -0
  30. package/src/layouts/ProfileLayout/components/ProfileForm.tsx +1 -0
  31. package/src/layouts/SimpleLayout/SimpleLayout.tsx +72 -0
  32. package/src/layouts/SimpleLayout/index.ts +3 -0
  33. package/src/layouts/SupportLayout/SupportLayout.tsx +1 -0
  34. package/src/layouts/SupportLayout/components/CreateTicketDialog.tsx +1 -0
  35. package/src/layouts/SupportLayout/components/TicketList.tsx +6 -5
  36. package/src/layouts/SupportLayout/events.ts +2 -0
  37. package/src/layouts/index.ts +1 -3
  38. package/src/snippets/AuthDialog/useAuthDialog.ts +2 -0
  39. package/src/snippets/Chat/components/MessageList.tsx +12 -11
  40. package/src/snippets/Chat/index.tsx +1 -0
  41. package/src/snippets/ContactForm/ContactForm.tsx +7 -2
  42. package/src/snippets/ContactForm/ContactPage.tsx +16 -3
  43. package/src/snippets/VideoPlayer/README.md +35 -0
  44. package/src/snippets/VideoPlayer/VideoControls.tsx +13 -9
  45. package/src/snippets/VideoPlayer/VideoPlayer.tsx +159 -25
  46. package/src/snippets/VideoPlayer/index.ts +1 -1
  47. package/src/validation/utils/curl-generator.ts +5 -1
  48. package/src/layouts/UILayout/README.md +0 -267
  49. package/src/layouts/UILayout/SUMMARY.md +0 -298
  50. package/src/layouts/UILayout/TOOLS_INTEGRATION.md +0 -216
  51. package/src/layouts/UILayout/components/AutoComponentDemo.tsx +0 -77
  52. package/src/layouts/UILayout/components/CategoryRenderer.tsx +0 -45
  53. package/src/layouts/UILayout/components/TailwindGuideRenderer.tsx +0 -138
  54. package/src/layouts/UILayout/components/index.ts +0 -15
  55. package/src/layouts/UILayout/components/layout/Header/CopyAIButton.tsx +0 -58
  56. package/src/layouts/UILayout/components/layout/Header/Header.tsx +0 -60
  57. package/src/layouts/UILayout/components/layout/Header/HeaderDesktop.tsx +0 -51
  58. package/src/layouts/UILayout/components/layout/Header/HeaderMobile.tsx +0 -71
  59. package/src/layouts/UILayout/components/layout/Header/TestValidationButton.tsx +0 -268
  60. package/src/layouts/UILayout/components/layout/Header/index.ts +0 -11
  61. package/src/layouts/UILayout/components/layout/MobileOverlay/MobileOverlay.tsx +0 -47
  62. package/src/layouts/UILayout/components/layout/MobileOverlay/index.ts +0 -6
  63. package/src/layouts/UILayout/components/layout/Sidebar/Sidebar.tsx +0 -95
  64. package/src/layouts/UILayout/components/layout/Sidebar/SidebarCategory.tsx +0 -54
  65. package/src/layouts/UILayout/components/layout/Sidebar/SidebarContent.tsx +0 -93
  66. package/src/layouts/UILayout/components/layout/Sidebar/SidebarFooter.tsx +0 -49
  67. package/src/layouts/UILayout/components/layout/Sidebar/index.ts +0 -9
  68. package/src/layouts/UILayout/components/layout/index.ts +0 -8
  69. package/src/layouts/UILayout/components/shared/Badge/CountBadge.tsx +0 -38
  70. package/src/layouts/UILayout/components/shared/Badge/index.ts +0 -5
  71. package/src/layouts/UILayout/components/shared/CodeBlock/CodeBlock.tsx +0 -48
  72. package/src/layouts/UILayout/components/shared/CodeBlock/CopyButton.tsx +0 -49
  73. package/src/layouts/UILayout/components/shared/CodeBlock/index.ts +0 -6
  74. package/src/layouts/UILayout/components/shared/Section/Section.tsx +0 -63
  75. package/src/layouts/UILayout/components/shared/Section/index.ts +0 -5
  76. package/src/layouts/UILayout/components/shared/index.ts +0 -8
  77. package/src/layouts/UILayout/config/ai-export.config.ts +0 -89
  78. package/src/layouts/UILayout/config/categories.config.tsx +0 -122
  79. package/src/layouts/UILayout/config/components/blocks.config.tsx +0 -239
  80. package/src/layouts/UILayout/config/components/data.config.tsx +0 -433
  81. package/src/layouts/UILayout/config/components/feedback.config.tsx +0 -290
  82. package/src/layouts/UILayout/config/components/forms.config.tsx +0 -996
  83. package/src/layouts/UILayout/config/components/hooks.config.tsx +0 -168
  84. package/src/layouts/UILayout/config/components/index.ts +0 -72
  85. package/src/layouts/UILayout/config/components/layout.config.tsx +0 -246
  86. package/src/layouts/UILayout/config/components/navigation.config.tsx +0 -352
  87. package/src/layouts/UILayout/config/components/overlay.config.tsx +0 -569
  88. package/src/layouts/UILayout/config/components/specialized.config.tsx +0 -400
  89. package/src/layouts/UILayout/config/components/tools.config.tsx +0 -234
  90. package/src/layouts/UILayout/config/components/types.ts +0 -14
  91. package/src/layouts/UILayout/config/index.ts +0 -42
  92. package/src/layouts/UILayout/config/tailwind.config.ts +0 -131
  93. package/src/layouts/UILayout/constants.ts +0 -23
  94. package/src/layouts/UILayout/context/ShowcaseContext.tsx +0 -81
  95. package/src/layouts/UILayout/context/index.ts +0 -1
  96. package/src/layouts/UILayout/core/UIGuideApp.client.tsx +0 -18
  97. package/src/layouts/UILayout/core/UIGuideApp.tsx +0 -33
  98. package/src/layouts/UILayout/core/UIGuideLanding.tsx +0 -172
  99. package/src/layouts/UILayout/core/UIGuideView.tsx +0 -61
  100. package/src/layouts/UILayout/core/UILayout.tsx +0 -125
  101. package/src/layouts/UILayout/core/UILayoutSidebar.tsx +0 -11
  102. package/src/layouts/UILayout/core/index.ts +0 -10
  103. package/src/layouts/UILayout/hooks/index.ts +0 -9
  104. package/src/layouts/UILayout/hooks/useAIExport.ts +0 -78
  105. package/src/layouts/UILayout/hooks/useCategoryNavigation.ts +0 -92
  106. package/src/layouts/UILayout/hooks/useComponentSearch.ts +0 -81
  107. package/src/layouts/UILayout/hooks/useSidebarState.ts +0 -36
  108. package/src/layouts/UILayout/index.ts +0 -160
  109. package/src/layouts/UILayout/types/component.ts +0 -45
  110. package/src/layouts/UILayout/types/index.ts +0 -23
  111. package/src/layouts/UILayout/types/layout.ts +0 -57
  112. package/src/layouts/UILayout/types/navigation.ts +0 -33
  113. package/src/layouts/UILayout/utils/ai-export/formatters.ts +0 -71
  114. package/src/layouts/UILayout/utils/ai-export/index.ts +0 -5
  115. package/src/layouts/UILayout/utils/component-helpers/filter.ts +0 -109
  116. package/src/layouts/UILayout/utils/component-helpers/index.ts +0 -6
  117. package/src/layouts/UILayout/utils/component-helpers/search.ts +0 -95
  118. package/src/layouts/UILayout/utils/index.ts +0 -6
@@ -1,168 +0,0 @@
1
- /**
2
- * Hooks Configuration
3
- */
4
-
5
- import React from 'react';
6
- import type { ComponentConfig } from './types';
7
-
8
- export const HOOKS: ComponentConfig[] = [
9
- {
10
- name: 'useMediaQuery',
11
- category: 'hooks',
12
- description: 'Responsive media query hook',
13
- importPath: "import { useMediaQuery } from '@djangocfg/ui';",
14
- example: `const isMobile = useMediaQuery('(max-width: 768px)');
15
- const isDesktop = useMediaQuery('(min-width: 1024px)');
16
-
17
- return isMobile ? <MobileView /> : <DesktopView />;`,
18
- preview: (
19
- <div className="p-4 border rounded-md">
20
- <code className="text-sm">
21
- useMediaQuery('(max-width: 768px)')
22
- </code>
23
- <p className="mt-2 text-sm text-muted-foreground">
24
- Returns boolean based on media query match
25
- </p>
26
- </div>
27
- ),
28
- },
29
- {
30
- name: 'useTheme',
31
- category: 'hooks',
32
- description: 'Theme management hook',
33
- importPath: "import { useTheme } from '@djangocfg/ui';",
34
- example: `const theme = useTheme(); // Returns 'light' | 'dark'
35
-
36
- // Toggle theme manually
37
- document.documentElement.classList.toggle('dark');`,
38
- preview: (
39
- <div className="p-4 border rounded-md">
40
- <code className="text-sm">
41
- const theme = useTheme();
42
- </code>
43
- <p className="mt-2 text-sm text-muted-foreground">
44
- Returns current theme: 'light' | 'dark'
45
- </p>
46
- </div>
47
- ),
48
- },
49
- {
50
- name: 'useCopy',
51
- category: 'hooks',
52
- description: 'Copy to clipboard hook',
53
- importPath: "import { useCopy } from '@djangocfg/ui';",
54
- example: `const { copyToClipboard } = useCopy();
55
- const [copied, setCopied] = useState(false);
56
-
57
- const handleCopy = async () => {
58
- await copyToClipboard('text to copy');
59
- setCopied(true);
60
- };`,
61
- preview: (
62
- <div className="p-4 border rounded-md">
63
- <code className="text-sm">
64
- copyToClipboard(text)
65
- </code>
66
- <p className="mt-2 text-sm text-muted-foreground">
67
- Copy text to clipboard programmatically
68
- </p>
69
- </div>
70
- ),
71
- },
72
- {
73
- name: 'useCountdown',
74
- category: 'hooks',
75
- description: 'Countdown timer hook',
76
- importPath: "import { useCountdown } from '@djangocfg/ui';",
77
- example: `const targetDate = new Date('2025-12-31').toISOString();
78
- const countdown = useCountdown(targetDate);
79
-
80
- // Returns: { days, hours, minutes, seconds, isExpired }`,
81
- preview: (
82
- <div className="p-4 border rounded-md">
83
- <code className="text-sm">
84
- useCountdown(isoDateString)
85
- </code>
86
- <p className="mt-2 text-sm text-muted-foreground">
87
- Returns countdown object with days, hours, minutes, seconds
88
- </p>
89
- </div>
90
- ),
91
- },
92
- {
93
- name: 'useDebounce',
94
- category: 'hooks',
95
- description: 'Debounce value changes to reduce API calls and improve performance. Perfect for search inputs and form fields.',
96
- importPath: "import { useDebounce } from '@djangocfg/ui';",
97
- example: `// Basic search debouncing
98
- const [search, setSearch] = useState('');
99
- const debouncedSearch = useDebounce(search, 300); // Default 300ms
100
-
101
- useEffect(() => {
102
- if (debouncedSearch) {
103
- // API call only fires 300ms after user stops typing
104
- fetchResults(debouncedSearch);
105
- }
106
- }, [debouncedSearch]);
107
-
108
- // With MultiSelectPro (has built-in search)
109
- const [searchValue, setSearchValue] = useState('');
110
- const debouncedSearchValue = useDebounce(searchValue, 500);
111
-
112
- useEffect(() => {
113
- // Fetch options from API with debounced search
114
- if (debouncedSearchValue) {
115
- fetchOptions(debouncedSearchValue);
116
- }
117
- }, [debouncedSearchValue]);
118
-
119
- <MultiSelectPro
120
- options={filteredOptions}
121
- onValueChange={setSelected}
122
- placeholder="Search and select..."
123
- searchable={true}
124
- // ... other props
125
- />`,
126
- preview: (
127
- <div className="p-4 border rounded-md">
128
- <code className="text-sm">
129
- const debouncedValue = useDebounce(value, delay);
130
- </code>
131
- <div className="mt-3 space-y-2 text-sm text-muted-foreground">
132
- <p><strong>Parameters:</strong></p>
133
- <ul className="list-disc list-inside space-y-1 ml-2">
134
- <li><code>value</code>: Any value to debounce</li>
135
- <li><code>delay</code>: Delay in milliseconds (default: 300ms)</li>
136
- </ul>
137
- <p className="mt-2"><strong>Returns:</strong> Debounced value</p>
138
- <p className="mt-2"><strong>Use Cases:</strong></p>
139
- <ul className="list-disc list-inside space-y-1 ml-2">
140
- <li>Search inputs (reduce API calls)</li>
141
- <li>Form validation</li>
142
- <li>Auto-save functionality</li>
143
- <li>Scroll/resize event handlers</li>
144
- </ul>
145
- </div>
146
- </div>
147
- ),
148
- },
149
- {
150
- name: 'useIsMobile',
151
- category: 'hooks',
152
- description: 'Check if device is mobile',
153
- importPath: "import { useIsMobile } from '@djangocfg/ui';",
154
- example: `const isMobile = useIsMobile(); // Boolean
155
-
156
- return isMobile ? <MobileMenu /> : <DesktopMenu />;`,
157
- preview: (
158
- <div className="p-4 border rounded-md">
159
- <code className="text-sm">
160
- const isMobile = useIsMobile();
161
- </code>
162
- <p className="mt-2 text-sm text-muted-foreground">
163
- Returns true if viewport width {'<'} 768px
164
- </p>
165
- </div>
166
- ),
167
- },
168
- ];
@@ -1,72 +0,0 @@
1
- /**
2
- * Components Configuration Index
3
- * Aggregates all component configs from separate files
4
- */
5
-
6
- export type { ComponentConfig } from './types';
7
- export { FORM_COMPONENTS } from './forms.config';
8
- export { LAYOUT_COMPONENTS } from './layout.config';
9
- export { NAVIGATION_COMPONENTS } from './navigation.config';
10
- export { OVERLAY_COMPONENTS } from './overlay.config';
11
- export { FEEDBACK_COMPONENTS } from './feedback.config';
12
- export { DATA_COMPONENTS } from './data.config';
13
- export { SPECIALIZED_COMPONENTS } from './specialized.config';
14
- export { TOOLS_COMPONENTS } from './tools.config';
15
- export { BLOCKS } from './blocks.config';
16
- export { HOOKS } from './hooks.config';
17
-
18
- import { FORM_COMPONENTS } from './forms.config';
19
- import { LAYOUT_COMPONENTS } from './layout.config';
20
- import { NAVIGATION_COMPONENTS } from './navigation.config';
21
- import { OVERLAY_COMPONENTS } from './overlay.config';
22
- import { FEEDBACK_COMPONENTS } from './feedback.config';
23
- import { DATA_COMPONENTS } from './data.config';
24
- import { SPECIALIZED_COMPONENTS } from './specialized.config';
25
- import { TOOLS_COMPONENTS } from './tools.config';
26
- import { BLOCKS } from './blocks.config';
27
- import { HOOKS } from './hooks.config';
28
- import type { ComponentConfig } from './types';
29
-
30
- /**
31
- * All components aggregated from category configs
32
- */
33
- export const COMPONENTS_CONFIG: ComponentConfig[] = [
34
- ...FORM_COMPONENTS,
35
- ...LAYOUT_COMPONENTS,
36
- ...NAVIGATION_COMPONENTS,
37
- ...OVERLAY_COMPONENTS,
38
- ...FEEDBACK_COMPONENTS,
39
- ...DATA_COMPONENTS,
40
- ...SPECIALIZED_COMPONENTS,
41
- ...TOOLS_COMPONENTS,
42
- ...BLOCKS,
43
- ...HOOKS,
44
- ];
45
-
46
- /**
47
- * Get components by category
48
- */
49
- export function getComponentsByCategory(category: string): ComponentConfig[] {
50
- return COMPONENTS_CONFIG.filter(comp => comp.category === category);
51
- }
52
-
53
- /**
54
- * Get component by name
55
- */
56
- export function getComponentByName(name: string): ComponentConfig | undefined {
57
- return COMPONENTS_CONFIG.find(comp => comp.name === name);
58
- }
59
-
60
- /**
61
- * Get all categories
62
- */
63
- export function getAllCategories(): string[] {
64
- return [...new Set(COMPONENTS_CONFIG.map(comp => comp.category))];
65
- }
66
-
67
- /**
68
- * Get component count by category
69
- */
70
- export function getComponentCount(category: string): number {
71
- return COMPONENTS_CONFIG.filter(comp => comp.category === category).length;
72
- }
@@ -1,246 +0,0 @@
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
- ScrollArea,
19
- ScrollBar,
20
- ResizableHandle,
21
- ResizablePanel,
22
- ResizablePanelGroup,
23
- Section,
24
- SectionHeader,
25
- } from '@djangocfg/ui';
26
- import type { ComponentConfig } from './types';
27
-
28
- export const LAYOUT_COMPONENTS: ComponentConfig[] = [
29
- {
30
- name: 'Card',
31
- category: 'layout',
32
- description: 'Container with header, content, and footer sections',
33
- importPath: "import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from '@djangocfg/ui';",
34
- example: `<Card>
35
- <CardHeader>
36
- <CardTitle>Card Title</CardTitle>
37
- <CardDescription>Card description goes here</CardDescription>
38
- </CardHeader>
39
- <CardContent>
40
- <p>This is the main content of the card.</p>
41
- </CardContent>
42
- <CardFooter>
43
- <Button>Action</Button>
44
- </CardFooter>
45
- </Card>`,
46
- preview: (
47
- <Card className="max-w-sm">
48
- <CardHeader>
49
- <CardTitle>Card Title</CardTitle>
50
- <CardDescription>Card description goes here</CardDescription>
51
- </CardHeader>
52
- <CardContent>
53
- <p>This is the main content of the card.</p>
54
- </CardContent>
55
- <CardFooter>
56
- <Button>Action</Button>
57
- </CardFooter>
58
- </Card>
59
- ),
60
- },
61
- {
62
- name: 'Separator',
63
- category: 'layout',
64
- description: 'Visual divider between sections',
65
- importPath: "import { Separator } from '@djangocfg/ui';",
66
- example: `<div>
67
- <p>Section 1</p>
68
- <Separator className="my-4" />
69
- <p>Section 2</p>
70
- </div>`,
71
- preview: (
72
- <div>
73
- <p>Section 1</p>
74
- <Separator className="my-4" />
75
- <p>Section 2</p>
76
- </div>
77
- ),
78
- },
79
- {
80
- name: 'Skeleton',
81
- category: 'layout',
82
- description: 'Loading placeholder animation',
83
- importPath: "import { Skeleton } from '@djangocfg/ui';",
84
- example: `<div className="space-y-3">
85
- <Skeleton className="w-full h-12" />
86
- <Skeleton className="w-3/4 h-8" />
87
- <Skeleton className="w-1/2 h-8" />
88
- </div>`,
89
- preview: (
90
- <div className="space-y-3 max-w-sm">
91
- <Skeleton className="w-full h-12" />
92
- <Skeleton className="w-3/4 h-8" />
93
- <Skeleton className="w-1/2 h-8" />
94
- </div>
95
- ),
96
- },
97
- {
98
- name: 'AspectRatio',
99
- category: 'layout',
100
- description: 'Maintain aspect ratio for content',
101
- importPath: "import { AspectRatio } from '@djangocfg/ui';",
102
- example: `<AspectRatio ratio={16/9} className="bg-muted">
103
- <img src="/demo.jpg" alt="Demo" className="object-cover rounded-md" />
104
- </AspectRatio>`,
105
- preview: (
106
- <AspectRatio ratio={16/9} className="bg-muted rounded-md max-w-sm">
107
- <div className="flex items-center justify-center h-full text-muted-foreground">
108
- 16:9 Aspect Ratio
109
- </div>
110
- </AspectRatio>
111
- ),
112
- },
113
- {
114
- name: 'Sticky',
115
- category: 'layout',
116
- description: 'Make content sticky on scroll with configurable behavior',
117
- importPath: "import { Sticky } from '@djangocfg/ui';",
118
- example: `// Top sticky with react-sticky-box (respects parent container)
119
- <Sticky offsetTop={56} offsetBottom={0} zIndex={10}>
120
- <nav className="bg-background border p-4">
121
- Sticky Navigation
122
- </nav>
123
- </Sticky>
124
-
125
- // Bottom sticky with native CSS sticky
126
- <Sticky bottom useNativeSticky offsetBottom={0} zIndex={30}>
127
- <footer className="bg-background border-t p-4">
128
- Sticky Footer
129
- </footer>
130
- </Sticky>
131
-
132
- // Props:
133
- // - offsetTop: number (default: 0) - top offset in pixels
134
- // - offsetBottom: number (default: 0) - bottom offset in pixels
135
- // - bottom: boolean (default: false) - stick to bottom instead of top
136
- // - disabled: boolean (default: false) - disable sticking
137
- // - disableOnMobile: boolean (default: true) - disable on mobile
138
- // - useNativeSticky: boolean (default: false) - use CSS sticky instead of react-sticky-box
139
- // - zIndex: number (default: 10) - z-index value
140
- // - debug: boolean (default: false) - enable debug logging`,
141
- preview: (
142
- <div className="h-[300px] overflow-auto border rounded-md relative">
143
- <Sticky offsetTop={0} disableOnMobile={false} zIndex={10}>
144
- <div className="bg-primary text-primary-foreground p-3 text-center font-semibold shadow-md">
145
- Sticky Header (scroll to see effect)
146
- </div>
147
- </Sticky>
148
- <div className="p-4 space-y-3">
149
- {[...Array(20)].map((_, i) => (
150
- <p key={i} className="text-sm">
151
- Content line {i + 1} - Scroll down to see the sticky header in action
152
- </p>
153
- ))}
154
- </div>
155
- </div>
156
- ),
157
- },
158
- {
159
- name: 'ScrollArea',
160
- category: 'layout',
161
- description: 'Custom scrollable area with styled scrollbar',
162
- importPath: "import { ScrollArea, ScrollBar } from '@djangocfg/ui';",
163
- example: `<ScrollArea className="h-[200px] w-[350px] rounded-md border p-4">
164
- <div className="space-y-4">
165
- {Array.from({ length: 20 }).map((_, i) => (
166
- <div key={i} className="text-sm">
167
- Content item {i + 1}
168
- </div>
169
- ))}
170
- </div>
171
- <ScrollBar orientation="vertical" />
172
- </ScrollArea>`,
173
- preview: (
174
- <ScrollArea className="h-[200px] w-[350px] rounded-md border p-4">
175
- <div className="space-y-4">
176
- {Array.from({ length: 20 }).map((_, i) => (
177
- <div key={i} className="text-sm">
178
- Content item {i + 1} - Scroll to see more content
179
- </div>
180
- ))}
181
- </div>
182
- <ScrollBar orientation="vertical" />
183
- </ScrollArea>
184
- ),
185
- },
186
- {
187
- name: 'Resizable',
188
- category: 'layout',
189
- description: 'Resizable panel layout with draggable handles',
190
- importPath: "import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '@djangocfg/ui';",
191
- example: `<ResizablePanelGroup direction="horizontal" className="max-w-md rounded-lg border">
192
- <ResizablePanel defaultSize={50}>
193
- <div className="flex h-[200px] items-center justify-center p-6">
194
- <span className="font-semibold">Panel One</span>
195
- </div>
196
- </ResizablePanel>
197
- <ResizableHandle />
198
- <ResizablePanel defaultSize={50}>
199
- <div className="flex h-[200px] items-center justify-center p-6">
200
- <span className="font-semibold">Panel Two</span>
201
- </div>
202
- </ResizablePanel>
203
- </ResizablePanelGroup>`,
204
- preview: (
205
- <ResizablePanelGroup direction="horizontal" className="max-w-md rounded-lg border">
206
- <ResizablePanel defaultSize={50}>
207
- <div className="flex h-[200px] items-center justify-center p-6">
208
- <span className="font-semibold">Panel One</span>
209
- </div>
210
- </ResizablePanel>
211
- <ResizableHandle />
212
- <ResizablePanel defaultSize={50}>
213
- <div className="flex h-[200px] items-center justify-center p-6">
214
- <span className="font-semibold">Panel Two</span>
215
- </div>
216
- </ResizablePanel>
217
- </ResizablePanelGroup>
218
- ),
219
- },
220
- {
221
- name: 'Section',
222
- category: 'layout',
223
- description: 'Semantic section container with header',
224
- importPath: "import { Section, SectionHeader } from '@djangocfg/ui';",
225
- example: `<Section>
226
- <SectionHeader
227
- title="Section Title"
228
- description="Section description goes here"
229
- />
230
- <div className="p-4">
231
- Section content goes here...
232
- </div>
233
- </Section>`,
234
- preview: (
235
- <Section>
236
- <SectionHeader
237
- title="Section Title"
238
- subtitle="Section description goes here"
239
- />
240
- <div className="p-4 border-t">
241
- <p className="text-sm">Section content goes here...</p>
242
- </div>
243
- </Section>
244
- ),
245
- },
246
- ];