@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,131 +0,0 @@
1
- /**
2
- * Tailwind CSS v4 Configuration & Guidelines
3
- * Documentation for Tailwind CSS v4 best practices
4
- */
5
-
6
- export interface TailwindGuide {
7
- version: string;
8
- keyChanges: string[];
9
- bestPractices: string[];
10
- migrationSteps: string[];
11
- examples: {
12
- title: string;
13
- description: string;
14
- code: string;
15
- }[];
16
- }
17
-
18
- export const TAILWIND_GUIDE: TailwindGuide = {
19
- version: "4.0",
20
-
21
- keyChanges: [
22
- "CSS-First Configuration: Theme is now defined using CSS custom properties in an @theme block instead of JavaScript",
23
- "New Import Syntax: Use @import \"tailwindcss\" instead of @tailwind directives",
24
- "Simplified PostCSS Setup: Use @tailwindcss/postcss plugin",
25
- "Performance Improvements: 10x faster build times, significantly smaller CSS bundles",
26
- "Modern Browser Support: Optimized for Safari 16.4+, Chrome 111+, Firefox 128+"
27
- ],
28
-
29
- bestPractices: [
30
- "Use standard Tailwind classes only: py-16 sm:py-20 md:py-24 lg:py-32",
31
- "Responsive patterns: px-4 sm:px-6 lg:px-8",
32
- "Container pattern: container max-w-7xl mx-auto",
33
- "IMPORTANT: Arbitrary values like h-[80px], z-[100] may NOT work in v4 - define tokens in @theme instead",
34
- "For fixed sizes: Use inline styles style={{ width: '80px', height: '80px' }} - always reliable",
35
- "Spacing utilities (h-20, p-4, etc.) require --spacing-* variables defined in @theme block",
36
- "Z-index utilities (z-50, z-100) require --z-* variables defined in @theme block",
37
- "OPACITY MODIFIERS: bg-background/80 does NOT work with HSL colors in v4! Use inline styles: style={{ backgroundColor: 'hsl(var(--background) / 0.8)' }}",
38
- "Border opacity: border-border/30 does NOT work - use style={{ borderColor: 'hsl(var(--border) / 0.3)' }}",
39
- "Import order is critical: theme variables MUST come before @import 'tailwindcss'",
40
- "Use aspect-square for maintaining 1:1 ratio (circles, squares)",
41
- "Use overflow-hidden with rounded-full for perfect circles",
42
- "Avoid custom utilities like: section-padding, animate-*, shadow-brand",
43
- "Mobile-first approach with breakpoints: sm: (640px), md: (768px), lg: (1024px), xl: (1280px)",
44
- "Use CSS variables: var(--color-primary), var(--font-family-sans)"
45
- ],
46
-
47
- migrationSteps: [
48
- "Update dependencies: npm install tailwindcss@latest postcss@latest",
49
- "Replace JavaScript config with CSS @theme block",
50
- "Update import directives: @import \"tailwindcss\"",
51
- "Configure PostCSS: use @tailwindcss/postcss plugin",
52
- "Test and refactor: remove custom utilities and use standard Tailwind classes"
53
- ],
54
-
55
- examples: [
56
- {
57
- title: "CSS-First Configuration",
58
- description: "Define theme using CSS custom properties",
59
- code: `@import "tailwindcss";
60
-
61
- @theme {
62
- --color-primary: #3b82f6;
63
- --color-secondary: #8b5cf6;
64
- --font-family-sans: ui-sans-serif, system-ui, sans-serif;
65
- --spacing-20: 5rem; /* Required for h-20, w-20 to work */
66
- }`
67
- },
68
- {
69
- title: "Responsive Spacing",
70
- description: "Mobile-first responsive padding and spacing",
71
- code: `<section className="py-16 sm:py-20 md:py-24 lg:py-32">
72
- <div className="container max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
73
- <h1 className="text-4xl sm:text-5xl md:text-6xl lg:text-7xl">
74
- Title
75
- </h1>
76
- </div>
77
- </section>`
78
- },
79
- {
80
- title: "Fixed Sizes with Inline Styles",
81
- description: "Most reliable way to set exact dimensions in v4",
82
- code: `<Avatar
83
- className="aspect-square rounded-full overflow-hidden ring-1 ring-foreground/20"
84
- style={{ width: '80px', height: '80px' }}
85
- >
86
- <AvatarImage src={avatar} alt="User" />
87
- </Avatar>`
88
- },
89
- {
90
- title: "Component Styling",
91
- description: "Standard Tailwind classes for components",
92
- code: `<button className="px-6 py-3 bg-primary text-primary-foreground rounded-md shadow-lg hover:shadow-xl transition-all duration-300">
93
- Click me
94
- </button>`
95
- },
96
- {
97
- title: "Z-Index Theme Tokens",
98
- description: "Define z-index values in @theme for z-50, z-100 to work",
99
- code: `@theme {
100
- --z-0: 0;
101
- --z-10: 10;
102
- --z-20: 20;
103
- --z-30: 30;
104
- --z-40: 40;
105
- --z-50: 50;
106
- --z-100: 100;
107
- --z-auto: auto;
108
- }
109
-
110
- /* Now z-50, z-100 classes work */
111
- <nav className="sticky top-0 z-100">...</nav>`
112
- },
113
- {
114
- title: "Opacity with HSL Colors (BROKEN in v4)",
115
- description: "bg-background/80 does NOT work with HSL - use inline styles",
116
- code: `/* ❌ BROKEN - does not work in Tailwind v4 */
117
- <nav className="bg-background/80 border-border/30">
118
-
119
- /* ✅ WORKING - use inline styles for opacity */
120
- <nav
121
- className="sticky top-0 z-100 backdrop-blur-xl"
122
- style={{
123
- backgroundColor: 'hsl(var(--background) / 0.8)',
124
- borderColor: 'hsl(var(--border) / 0.3)'
125
- }}
126
- >
127
- ...
128
- </nav>`
129
- }
130
- ]
131
- };
@@ -1,23 +0,0 @@
1
- /**
2
- * Constants for UILayout
3
- */
4
-
5
- export const MOBILE_BREAKPOINT = 768; // px
6
- export const SIDEBAR_WIDTH = 256; // px (w-64)
7
- export const HEADER_HEIGHT = 56; // px (h-14)
8
-
9
- export const ANIMATION_DURATION = {
10
- fast: 150,
11
- normal: 300,
12
- slow: 500,
13
- } as const;
14
-
15
- export const Z_INDEX = {
16
- sidebar: 30,
17
- overlay: 20,
18
- header: 40,
19
- dropdown: 50,
20
- } as const;
21
-
22
- export const DEFAULT_PROJECT_NAME = 'Django CFG UI';
23
- export const DEFAULT_DESCRIPTION = 'Explore our comprehensive collection of 56+ React components built with Radix UI and Tailwind CSS';
@@ -1,81 +0,0 @@
1
- /**
2
- * Showcase Context
3
- * Manages navigation state for UILayout with URL hash sync
4
- */
5
-
6
- 'use client';
7
-
8
- import React, { createContext, useContext, useState, useEffect, useCallback, ReactNode } from 'react';
9
-
10
- interface ShowcaseContextValue {
11
- currentCategory: string;
12
- setCurrentCategory: (category: string) => void;
13
- }
14
-
15
- const ShowcaseContext = createContext<ShowcaseContextValue | undefined>(undefined);
16
-
17
- interface ShowcaseProviderProps {
18
- children: ReactNode;
19
- defaultCategory?: string;
20
- }
21
-
22
- export function ShowcaseProvider({ children, defaultCategory = 'overview' }: ShowcaseProviderProps) {
23
- // Initialize from URL hash or default
24
- const [currentCategory, setCurrentCategoryState] = useState(() => {
25
- if (typeof window !== 'undefined') {
26
- const hash = window.location.hash.slice(1); // Remove #
27
- return hash || defaultCategory;
28
- }
29
- return defaultCategory;
30
- });
31
-
32
- // Update URL hash when category changes
33
- const setCurrentCategory = useCallback((category: string) => {
34
- setCurrentCategoryState(category);
35
- // Update URL hash without triggering navigation
36
- if (typeof window !== 'undefined') {
37
- const newUrl = category === defaultCategory
38
- ? window.location.pathname
39
- : `${window.location.pathname}#${category}`;
40
- window.history.replaceState(null, '', newUrl);
41
- }
42
- }, [defaultCategory]);
43
-
44
- // Listen for hash changes (back/forward browser buttons)
45
- useEffect(() => {
46
- const handleHashChange = () => {
47
- const hash = window.location.hash.slice(1);
48
- setCurrentCategoryState(hash || defaultCategory);
49
- };
50
-
51
- window.addEventListener('hashchange', handleHashChange);
52
- return () => window.removeEventListener('hashchange', handleHashChange);
53
- }, [defaultCategory]);
54
-
55
- // Handle initial hash on mount (for SSR hydration)
56
- useEffect(() => {
57
- const hash = window.location.hash.slice(1);
58
- if (hash && hash !== currentCategory) {
59
- setCurrentCategoryState(hash);
60
- }
61
- }, []);
62
-
63
- return (
64
- <ShowcaseContext.Provider
65
- value={{
66
- currentCategory,
67
- setCurrentCategory,
68
- }}
69
- >
70
- {children}
71
- </ShowcaseContext.Provider>
72
- );
73
- }
74
-
75
- export function useShowcase() {
76
- const context = useContext(ShowcaseContext);
77
- if (!context) {
78
- throw new Error('useShowcase must be used within ShowcaseProvider');
79
- }
80
- return context;
81
- }
@@ -1 +0,0 @@
1
- export { ShowcaseProvider, useShowcase } from './ShowcaseContext';
@@ -1,18 +0,0 @@
1
- /**
2
- * UI Guide App
3
- *
4
- * Complete UI Guide application with UILayout
5
- * Uses config-driven approach with context for navigation
6
- */
7
-
8
- 'use client';
9
-
10
- import React from 'react';
11
- import UIGuideView from './UIGuideView';
12
-
13
- export function UIGuideApp() {
14
- // UIGuideView now includes UIGuideLanding as 'overview' category
15
- // and uses ShowcaseProvider context for navigation
16
- // All component data comes from centralized config
17
- return <UIGuideView />;
18
- }
@@ -1,33 +0,0 @@
1
- /**
2
- * UI Guide App - Dynamic Import Wrapper
3
- *
4
- * Lazy loads the heavy UILayout library (~1.5MB with Mermaid, PrettyCode, etc.)
5
- * Only loads when UI documentation page is accessed
6
- */
7
-
8
- 'use client';
9
-
10
- import dynamic from 'next/dynamic';
11
- import React from 'react';
12
-
13
- // Dynamic import with loading state
14
- const UIGuideAppClient = dynamic(() => import('./UIGuideApp.client').then(mod => ({ default: mod.UIGuideApp })), {
15
- ssr: false,
16
- loading: () => (
17
- <div className="min-h-screen bg-background flex items-center justify-center">
18
- <div className="text-center space-y-4">
19
- <div className="flex justify-center">
20
- <div className="animate-spin rounded-full h-12 w-12 border-b-2 border-primary"></div>
21
- </div>
22
- <div className="space-y-2">
23
- <h2 className="text-xl font-semibold text-foreground">Loading UI Guide</h2>
24
- <p className="text-sm text-muted-foreground">Preparing component showcase...</p>
25
- </div>
26
- </div>
27
- </div>
28
- ),
29
- });
30
-
31
- export function UIGuideApp() {
32
- return <UIGuideAppClient />;
33
- }
@@ -1,172 +0,0 @@
1
- /**
2
- * UI Guide Landing Page
3
- *
4
- * Beautiful landing page for Django CFG UI Library
5
- * Uses ready blocks from @djangocfg/ui/blocks
6
- */
7
-
8
- 'use client';
9
-
10
- import React from 'react';
11
- import {
12
- Package,
13
- Sparkles,
14
- Zap,
15
- Shield,
16
- Palette,
17
- Code2,
18
- Blocks,
19
- Github,
20
- BookOpen,
21
- Layout,
22
- CheckCircle2,
23
- } from 'lucide-react';
24
- import {
25
- SuperHero,
26
- FeatureSection,
27
- StatsSection,
28
- CTASection,
29
- } from '@djangocfg/ui/blocks';
30
- import { useShowcase } from '../context';
31
-
32
- interface UIGuideLandingProps {
33
- githubUrl?: string;
34
- }
35
-
36
- export function UIGuideLanding({
37
- githubUrl = 'https://github.com'
38
- }: UIGuideLandingProps) {
39
- const { setCurrentCategory } = useShowcase();
40
-
41
- const handleBrowseComponents = () => {
42
- setCurrentCategory('forms');
43
- };
44
-
45
- const handleViewBlocks = () => {
46
- setCurrentCategory('blocks');
47
- };
48
- return (
49
- <div className="min-h-screen">
50
- {/* Hero Section using SuperHero block */}
51
- <SuperHero
52
- badge={{
53
- icon: <Sparkles className="w-4 h-4" />,
54
- text: "56+ Components · 7 Blocks · 11 Hooks"
55
- }}
56
- title="Django CFG"
57
- titleGradient="UI Library"
58
- subtitle="Modern React component library built with Next.js 15, Radix UI, and Tailwind CSS 4"
59
- features={[
60
- { icon: <span>⚛️</span>, text: "React 19" },
61
- { icon: <span>📘</span>, text: "TypeScript" },
62
- { icon: <span>🎨</span>, text: "Tailwind CSS 4" },
63
- { icon: <span>🌙</span>, text: "Dark Mode" },
64
- ]}
65
- primaryAction={{
66
- label: "Explore Components",
67
- onClick: handleBrowseComponents
68
- }}
69
- secondaryAction={{
70
- label: "View Blocks",
71
- onClick: handleViewBlocks,
72
- icon: <BookOpen className="w-5 h-5" />
73
- }}
74
- stats={[
75
- { number: "56+", label: "Components" },
76
- { number: "7", label: "Blocks" },
77
- { number: "11", label: "Hooks" },
78
- { number: "100%", label: "Type Safe" },
79
- ]}
80
- showBackgroundSwitcher={true}
81
- />
82
-
83
- {/* Features Section using FeatureSection block */}
84
- <FeatureSection
85
- title="Everything You Need"
86
- subtitle="A comprehensive component library with all the building blocks for modern web applications"
87
- columns={3}
88
- background="card"
89
- features={[
90
- {
91
- icon: <Package className="w-6 h-6" />,
92
- title: "56+ Components",
93
- description: "From basic buttons to complex data tables, we've got you covered with production-ready components",
94
- },
95
- {
96
- icon: <Blocks className="w-6 h-6" />,
97
- title: "Landing Page Blocks",
98
- description: "Pre-built sections like Hero, Features, CTA, Testimonials to ship landing pages faster",
99
- },
100
- {
101
- icon: <Zap className="w-6 h-6" />,
102
- title: "Lightning Fast",
103
- description: "Optimized for performance with React 19 and Next.js 15 for blazing fast user experiences",
104
- },
105
- {
106
- icon: <Shield className="w-6 h-6" />,
107
- title: "Fully Accessible",
108
- description: "Built on Radix UI primitives ensuring WCAG compliance and keyboard navigation support",
109
- },
110
- {
111
- icon: <Palette className="w-6 h-6" />,
112
- title: "Themeable",
113
- description: "Dark mode built-in with CSS variables. Customize colors, spacing, and typography easily",
114
- },
115
- {
116
- icon: <Code2 className="w-6 h-6" />,
117
- title: "TypeScript First",
118
- description: "Fully typed with TypeScript for better DX, autocomplete, and fewer runtime errors",
119
- },
120
- ]}
121
- />
122
-
123
- {/* Stats Section using StatsSection block */}
124
- <StatsSection
125
- title="Built for Scale"
126
- subtitle="Everything you need to build modern web applications"
127
- columns={4}
128
- stats={[
129
- {
130
- icon: <Layout className="w-6 h-6" />,
131
- number: "56+",
132
- label: "UI Components",
133
- description: "Production-ready",
134
- },
135
- {
136
- icon: <Blocks className="w-6 h-6" />,
137
- number: "7",
138
- label: "Landing Blocks",
139
- description: "Pre-built sections",
140
- },
141
- {
142
- icon: <Code2 className="w-6 h-6" />,
143
- number: "11",
144
- label: "React Hooks",
145
- description: "Custom utilities",
146
- },
147
- {
148
- icon: <CheckCircle2 className="w-6 h-6" />,
149
- number: "100%",
150
- label: "Type Safe",
151
- description: "Full TypeScript",
152
- },
153
- ]}
154
- />
155
-
156
- {/* CTA Section using CTASection block */}
157
- <CTASection
158
- title="Ready to Build Something Amazing?"
159
- subtitle="Start exploring our component library and ship your next project faster with pre-built, accessible components"
160
- primaryCTA={{
161
- label: "Browse Components",
162
- onClick: handleBrowseComponents
163
- }}
164
- secondaryCTA={{
165
- label: "View Blocks",
166
- onClick: handleViewBlocks
167
- }}
168
- background="gradient"
169
- />
170
- </div>
171
- );
172
- }
@@ -1,61 +0,0 @@
1
- /**
2
- * UI Guide View
3
- * Main view for showcasing all UI components from @djangocfg/ui package
4
- * Uses config-driven approach - all data comes from centralized config
5
- */
6
-
7
- 'use client';
8
-
9
- import React from 'react';
10
- import { UILayout } from './UILayout';
11
- import { CATEGORIES } from '../config';
12
- import { ShowcaseProvider, useShowcase } from '../context';
13
- import { UIGuideLanding } from './UIGuideLanding';
14
- import { CategoryRenderer } from '../components/CategoryRenderer';
15
- import { TailwindGuideRenderer } from '../components/TailwindGuideRenderer';
16
-
17
- function UIGuideContent() {
18
- const { currentCategory, setCurrentCategory } = useShowcase();
19
-
20
- // For overview, show landing page without layout
21
- if (currentCategory === 'overview') {
22
- return <UIGuideLanding />;
23
- }
24
-
25
- // Logo component
26
- const logo = (
27
- <div className="h-8 w-8 rounded-md bg-primary flex items-center justify-center text-primary-foreground font-bold text-sm">
28
- DC
29
- </div>
30
- );
31
-
32
- return (
33
- <UILayout
34
- title="UI Component Library"
35
- description="Explore our comprehensive collection of 56+ React components built with Radix UI and Tailwind CSS"
36
- categories={CATEGORIES}
37
- currentCategory={currentCategory}
38
- onCategoryChange={setCurrentCategory}
39
- logo={logo}
40
- projectName="Django CFG UI"
41
- >
42
- <div className="space-y-8">
43
- {/* Tailwind 4 Guide */}
44
- {currentCategory === 'tailwind4' && <TailwindGuideRenderer />}
45
-
46
- {/* All other categories use CategoryRenderer */}
47
- {currentCategory !== 'tailwind4' && (
48
- <CategoryRenderer categoryId={currentCategory} />
49
- )}
50
- </div>
51
- </UILayout>
52
- );
53
- }
54
-
55
- export default function UIGuideView() {
56
- return (
57
- <ShowcaseProvider defaultCategory="overview">
58
- <UIGuideContent />
59
- </ShowcaseProvider>
60
- );
61
- }
@@ -1,125 +0,0 @@
1
- /**
2
- * UILayout
3
- * Config-driven layout with left sidebar navigation
4
- *
5
- * Features:
6
- * - Desktop: Fixed left sidebar with category navigation
7
- * - Mobile: Collapsible sidebar via burger menu
8
- * - No header - designed to be used inside app layout with global navbar
9
- * - Type-safe: Full TypeScript support
10
- */
11
-
12
- 'use client';
13
-
14
- import React, { useState, useRef } from 'react';
15
- import { Menu, X } from 'lucide-react';
16
- import { Button, Sticky } from '@djangocfg/ui';
17
- import { useIsMobile } from '@djangocfg/ui';
18
- import { Sidebar } from '../components/layout/Sidebar';
19
- import { generateAIContext } from '../config';
20
- import type { UILayoutProps } from '../types';
21
-
22
-
23
- /**
24
- * UILayout - Layout component with left sidebar navigation
25
- * Designed to be used inside app layout (no competing header)
26
- *
27
- * @example
28
- * ```tsx
29
- * <UILayout
30
- * categories={CATEGORIES}
31
- * currentCategory={category}
32
- * onCategoryChange={setCategory}
33
- * >
34
- * <CategoryRenderer categoryId={category} />
35
- * </UILayout>
36
- * ```
37
- */
38
- export function UILayout({
39
- children,
40
- description,
41
- categories,
42
- currentCategory,
43
- onCategoryChange,
44
- }: UILayoutProps) {
45
- const [isSidebarOpen, setIsSidebarOpen] = useState(false);
46
- const isMobile = useIsMobile();
47
- const mainRef = useRef<HTMLElement>(null);
48
-
49
- const toggleSidebar = () => {
50
- setIsSidebarOpen(!isSidebarOpen);
51
- };
52
-
53
- const handleCategoryChange = (categoryId: string) => {
54
- onCategoryChange?.(categoryId);
55
- // Scroll to top when category changes
56
- // Try main element first, then window
57
- if (mainRef.current) {
58
- mainRef.current.scrollTo({ top: 0, behavior: 'smooth' });
59
- }
60
- window.scrollTo({ top: 0, behavior: 'smooth' });
61
- // Auto-close sidebar on mobile after selection
62
- if (isMobile) {
63
- setIsSidebarOpen(false);
64
- }
65
- };
66
-
67
- // Get current category name for mobile header
68
- const currentCategoryName = categories.find(c => c.id === currentCategory)?.label || 'Components';
69
-
70
- return (
71
- <div className="flex flex-col flex-1 bg-background isolate" style={{ zIndex: 0 }}>
72
- <div className="flex flex-1 relative">
73
- {/* Main Content */}
74
- <main ref={mainRef} className="flex-1 overflow-y-auto">
75
- <div className="max-w-7xl mx-auto p-6">
76
- {description && (
77
- <p className="text-sm text-muted-foreground mb-6">
78
- {description}
79
- </p>
80
- )}
81
- {children}
82
- </div>
83
- </main>
84
-
85
- {/* Sidebar - now on the right */}
86
- <Sidebar
87
- categories={categories}
88
- currentCategory={currentCategory}
89
- onCategoryChange={handleCategoryChange}
90
- isOpen={isSidebarOpen}
91
- onClose={() => setIsSidebarOpen(false)}
92
- onCopyForAI={generateAIContext}
93
- />
94
-
95
- </div>
96
-
97
- {/* Mobile Bottom Bar - sticky at bottom to avoid conflict with PublicLayout navbar */}
98
- {isMobile && (
99
- <Sticky
100
- bottom
101
- useNativeSticky
102
- offsetBottom={0}
103
- disableOnMobile={false}
104
- zIndex={30}
105
- className="flex items-center justify-between gap-3 px-4 py-3 border-t bg-background"
106
- >
107
- <span className="font-medium text-sm truncate">{currentCategoryName}</span>
108
- <Button
109
- variant="outline"
110
- size="icon"
111
- onClick={toggleSidebar}
112
- aria-label={isSidebarOpen ? "Close menu" : "Open menu"}
113
- className="shrink-0"
114
- >
115
- {isSidebarOpen ? (
116
- <X className="h-5 w-5" />
117
- ) : (
118
- <Menu className="h-5 w-5" />
119
- )}
120
- </Button>
121
- </Sticky>
122
- )}
123
- </div>
124
- );
125
- }
@@ -1,11 +0,0 @@
1
- /**
2
- * UILayoutSidebar
3
- * @deprecated Use UILayout instead - it now has sidebar navigation by default
4
- */
5
-
6
- import { UILayout } from './UILayout';
7
-
8
- /**
9
- * @deprecated Use UILayout instead
10
- */
11
- export const UILayoutSidebar = UILayout;
@@ -1,10 +0,0 @@
1
- /**
2
- * UILayout Core Components
3
- * Main layout components
4
- */
5
-
6
- export { UILayout } from './UILayout';
7
- export { UILayoutSidebar } from './UILayoutSidebar';
8
- export { UIGuideApp } from './UIGuideApp';
9
- export { default as UIGuideView } from './UIGuideView';
10
- export { UIGuideLanding } from './UIGuideLanding';
@@ -1,9 +0,0 @@
1
- /**
2
- * UILayout Hooks
3
- * Custom hooks for UILayout functionality
4
- */
5
-
6
- export { useAIExport } from './useAIExport';
7
- export { useCategoryNavigation } from './useCategoryNavigation';
8
- export { useComponentSearch } from './useComponentSearch';
9
- export { useSidebarState } from './useSidebarState';