From a6a80ad0059a1ae65569ddb719d2cd374cf75ee1 Mon Sep 17 00:00:00 2001 From: alorig <220087330+alorig@users.noreply.github.com> Date: Tue, 18 Nov 2025 05:52:10 +0500 Subject: [PATCH] phase 6 ,7,9 --- PHASE-5-7-9-VERIFICATION-REPORT.md | 241 +++++++++++ ...d_site_structure_generation_prompt_type.py | 31 ++ backend/igny8_core/modules/system/models.py | 1 + frontend/src/components/shared/README.md | 239 ++++++++++- .../src/components/shared/blocks/CTABlock.tsx | 76 ++++ .../shared/blocks/ContactFormBlock.tsx | 83 ++++ .../shared/blocks/ImageGalleryBlock.tsx | 66 +++ .../shared/blocks/ProductsBlock.tsx | 58 +++ .../components/shared/blocks/QuoteBlock.tsx | 53 +++ .../shared/blocks/ServicesBlock.tsx | 45 ++ .../shared/blocks/TestimonialsBlock.tsx | 67 +++ .../components/shared/blocks/TextBlock.tsx | 35 ++ .../components/shared/blocks/VideoBlock.tsx | 55 +++ .../src/components/shared/blocks/index.ts | 19 +- .../components/shared/layouts/BlogLayout.tsx | 35 ++ .../shared/layouts/CorporateLayout.tsx | 31 ++ .../shared/layouts/EcommerceLayout.tsx | 31 ++ .../shared/layouts/MagazineLayout.tsx | 31 ++ .../shared/layouts/PortfolioLayout.tsx | 25 ++ .../src/components/shared/layouts/index.ts | 11 +- .../shared/templates/BlogTemplate.tsx | 29 ++ .../shared/templates/BusinessTemplate.tsx | 42 ++ .../shared/templates/EcommerceTemplate.tsx | 36 ++ .../shared/templates/PortfolioTemplate.tsx | 36 ++ .../src/components/shared/templates/index.ts | 9 +- frontend/src/pages/Sites/Dashboard.tsx | 304 +++++++++++++ frontend/src/pages/Sites/List.tsx | 405 ++++++++++++++++++ frontend/src/pages/Thinker/Prompts.tsx | 88 ++++ 28 files changed, 2173 insertions(+), 9 deletions(-) create mode 100644 PHASE-5-7-9-VERIFICATION-REPORT.md create mode 100644 backend/igny8_core/modules/system/migrations/0008_add_site_structure_generation_prompt_type.py create mode 100644 frontend/src/components/shared/blocks/CTABlock.tsx create mode 100644 frontend/src/components/shared/blocks/ContactFormBlock.tsx create mode 100644 frontend/src/components/shared/blocks/ImageGalleryBlock.tsx create mode 100644 frontend/src/components/shared/blocks/ProductsBlock.tsx create mode 100644 frontend/src/components/shared/blocks/QuoteBlock.tsx create mode 100644 frontend/src/components/shared/blocks/ServicesBlock.tsx create mode 100644 frontend/src/components/shared/blocks/TestimonialsBlock.tsx create mode 100644 frontend/src/components/shared/blocks/TextBlock.tsx create mode 100644 frontend/src/components/shared/blocks/VideoBlock.tsx create mode 100644 frontend/src/components/shared/layouts/BlogLayout.tsx create mode 100644 frontend/src/components/shared/layouts/CorporateLayout.tsx create mode 100644 frontend/src/components/shared/layouts/EcommerceLayout.tsx create mode 100644 frontend/src/components/shared/layouts/MagazineLayout.tsx create mode 100644 frontend/src/components/shared/layouts/PortfolioLayout.tsx create mode 100644 frontend/src/components/shared/templates/BlogTemplate.tsx create mode 100644 frontend/src/components/shared/templates/BusinessTemplate.tsx create mode 100644 frontend/src/components/shared/templates/EcommerceTemplate.tsx create mode 100644 frontend/src/components/shared/templates/PortfolioTemplate.tsx create mode 100644 frontend/src/pages/Sites/Dashboard.tsx create mode 100644 frontend/src/pages/Sites/List.tsx diff --git a/PHASE-5-7-9-VERIFICATION-REPORT.md b/PHASE-5-7-9-VERIFICATION-REPORT.md new file mode 100644 index 00000000..7c21c4e5 --- /dev/null +++ b/PHASE-5-7-9-VERIFICATION-REPORT.md @@ -0,0 +1,241 @@ +# PHASE 5-7-9 VERIFICATION REPORT +**Date**: Generated automatically +**Document**: `PHASE-5-7-9-SITES-RENDERER-INTEGRATION-UI.md` + +## SUMMARY + +**Overall Completion**: ~75% Complete + +### ✅ COMPLETED SECTIONS + +#### Phase 5: Sites Renderer & Bulk Generation (80% Complete) +- ✅ **Sites Container**: Docker Compose configured (`igny8_sites` service) +- ✅ **Sites Renderer Frontend**: Complete (`sites/src/`) +- ✅ **PublisherService**: Implemented with multi-destination support +- ✅ **SitesRendererAdapter**: Implemented +- ✅ **DeploymentService**: Implemented +- ✅ **PublishingRecord Model**: Implemented +- ✅ **DeploymentRecord Model**: Implemented +- ✅ **Publisher ViewSet**: Implemented with endpoints +- ✅ **Layout Renderer**: Implemented (`sites/src/utils/layoutRenderer.tsx`) +- ✅ **Template System**: Implemented (`sites/src/utils/templateEngine.tsx`) +- ✅ **File Access Integration**: Implemented (`sites/src/utils/fileAccess.ts`) +- ✅ **Site Definition Loader**: Implemented (`sites/src/loaders/loadSiteDefinition.ts`) + +**MISSING**: +- ❌ **Bulk Page Generation**: `bulk_generate_pages()` method not found in `PageGenerationService` +- ❌ **Bulk Generation API**: `generate_all_pages` action not found in `SiteBlueprintViewSet` +- ❌ **Bulk Generation UI**: "Generate All Pages" button not implemented in Site Builder +- ❌ **Page Selection UI**: Checkbox selection for pages not implemented +- ❌ **Progress Tracking**: Bulk generation progress tracking not implemented + +#### Phase 6: Site Integration & Multi-Destination Publishing (95% Complete) +- ✅ **SiteIntegration Model**: Implemented with all required fields +- ✅ **IntegrationService**: Implemented with CRUD operations +- ✅ **SyncService**: Implemented for two-way sync +- ✅ **ContentSyncService**: Implemented +- ✅ **BaseAdapter**: Implemented as abstract base class +- ✅ **WordPressAdapter**: Implemented +- ✅ **SitesRendererAdapter**: Implemented +- ✅ **ShopifyAdapter**: Implemented (skeleton) +- ✅ **PublisherService Multi-Destination**: Extended with `publish_to_multiple_destinations()` +- ✅ **Site Model Extensions**: `site_type` and `hosting_type` fields added +- ✅ **Integration ViewSet**: Implemented with all endpoints +- ✅ **Integration UI**: Updated with `SiteIntegrationsSection` +- ✅ **Publishing Settings UI**: Created (`frontend/src/pages/Settings/Publishing.tsx`) +- ✅ **PublishingRules Component**: Created +- ✅ **Site Management Dashboard (Core)**: Implemented (`Manage.tsx`) +- ✅ **Writer UI Integration**: Site Builder tasks filtering implemented + +**MISSING**: +- ❌ **Site Content Editor (Core)**: `Editor.tsx` exists but may need enhancement +- ❌ **Post Editor**: Not found (`PostEditor.tsx`) +- ❌ **Page Manager (Core)**: `PageManager.tsx` exists but may need enhancement +- ❌ **Site Settings (Core)**: `Settings.tsx` exists but may need enhancement + +#### Phase 7: UI Components & Prompt Management (70% Complete) +- ✅ **Component Library Structure**: Complete (12 blocks, 7 layouts, 6 templates) +- ✅ **All Block Components**: All 12 blocks implemented +- ✅ **All Layout Components**: All 7 layouts implemented +- ✅ **All Template Components**: All 6 templates implemented +- ✅ **Component Documentation**: README.md updated +- ✅ **Prompt Management UI**: Complete + - ✅ Backend: `site_structure_generation` added to `AIPrompt.PROMPT_TYPE_CHOICES` + - ✅ Migration: Created + - ✅ Frontend: Added to `PROMPT_TYPES` + - ✅ Site Builder section: Added to Prompts page + - ✅ Prompt editor: Implemented with variable documentation +- ✅ **Site List View**: Implemented with filters (`List.tsx`) +- ✅ **Site Dashboard (Advanced)**: Implemented (`Dashboard.tsx`) + +**MISSING**: +- ❌ **Site Content Manager (Advanced)**: Not found (`Content.tsx`) +- ❌ **Post Editor (Advanced)**: Not found (`PostEditor.tsx`) +- ❌ **Page Manager (Advanced)**: `PageManager.tsx` exists but may need drag-drop, bulk actions +- ❌ **Site Settings (Advanced + SEO)**: `Settings.tsx` exists but may need SEO features +- ❌ **Site Preview**: Not found (`Preview.tsx`) +- ❌ **Layout Selector Component**: Not found (`LayoutSelector.tsx`) +- ❌ **Template Library Component**: Not found (`TemplateLibrary.tsx`) +- ❌ **Layout Preview Component**: Not found (`LayoutPreview.tsx`) +- ❌ **Template Customizer Component**: Not found (`TemplateCustomizer.tsx`) +- ❌ **Style Editor Component**: Not found (`StyleEditor.tsx`) +- ❌ **CMS Theme System**: Not found (`frontend/src/styles/cms/`) +- ❌ **Style Presets**: Not found +- ❌ **Color Schemes**: Not found +- ❌ **Typography System**: Not found +- ❌ **Component Styles**: Not found +- ❌ **Component Tests**: Not found +- ❌ **Component Storybook**: Not found (optional) + +--- + +## DETAILED CHECKLIST + +### Phase 5: Sites Renderer & Bulk Generation + +#### Backend Tasks +- [x] Create PublisherService +- [x] Create SitesRendererAdapter +- [x] Create DeploymentService +- [x] Create PublishingRecord model +- [x] Create DeploymentRecord model +- [x] Create Publisher ViewSet +- [ ] Add `bulk_generate_pages()` to PageGenerationService +- [ ] Add `create_tasks_for_pages()` to PageGenerationService +- [ ] Add `generate_all_pages` action to SiteBlueprintViewSet +- [ ] Add `create_tasks` action to SiteBlueprintViewSet +- [x] Database migrations + +#### Frontend Tasks +- [x] Create Sites container in docker-compose +- [x] Create sites renderer frontend +- [x] Create site definition loader +- [x] Create layout renderer +- [x] Create template system +- [x] Import shared components +- [x] Integrate file access +- [ ] Add "Generate All Pages" button to Site Builder +- [ ] Add page selection UI +- [ ] Add progress tracking +- [ ] Add bulk generation API methods + +### Phase 6: Site Integration & Multi-Destination Publishing + +#### Backend Tasks +- [x] Create SiteIntegration model +- [x] Create IntegrationService +- [x] Create SyncService +- [x] Create ContentSyncService +- [x] Create BaseAdapter +- [x] Refactor WordPressAdapter (implemented as new adapter) +- [x] Create SitesRendererAdapter +- [x] Create ShopifyAdapter (skeleton) +- [x] Extend PublisherService for multi-destination +- [x] Extend Site model (site_type, hosting_type) +- [x] Create Integration ViewSet +- [x] Database migrations + +#### Frontend Tasks +- [x] Update Integration Settings page +- [x] Create Publishing Settings page +- [x] Create Site Management Dashboard (core) +- [x] Create Site Content Editor (core) - exists but may need enhancement +- [x] Create Page Manager (core) - exists but may need enhancement +- [x] Create Site Settings (core) - exists but may need enhancement +- [x] Create PlatformSelector component +- [x] Create IntegrationStatus component +- [x] Create PublishingRules component +- [x] Update Writer UI for Site Builder tasks + +### Phase 7: UI Components & Prompt Management + +#### Backend Tasks +- [x] Add site_structure_generation to AIPrompt.PROMPT_TYPE_CHOICES +- [x] Create migration for new prompt type + +#### Frontend Tasks +- [x] Complete component library (blocks, layouts, templates) +- [x] Add site_structure_generation to PROMPT_TYPES +- [x] Add "Site Builder" section to Prompts page +- [x] Add prompt editor for site structure generation +- [x] Create Site List View +- [x] Create Site Dashboard (advanced) +- [ ] Create Site Content Manager (advanced) +- [ ] Create Post Editor (advanced) +- [ ] Create Page Manager (advanced) - exists but may need enhancement +- [ ] Create Site Settings (advanced + SEO) - exists but may need enhancement +- [ ] Create Site Preview +- [ ] Create Layout Selector +- [ ] Create Template Library +- [ ] Create Layout Preview +- [ ] Create Template Customizer +- [ ] Create Style Editor +- [ ] Create CMS Theme System +- [ ] Create Style Presets +- [ ] Create Color Schemes +- [ ] Create Typography System +- [ ] Create Component Styles +- [ ] Write component tests +- [ ] Write component documentation (README exists, but may need expansion) + +--- + +## CRITICAL MISSING FEATURES + +### High Priority +1. **Bulk Page Generation** (Phase 5) + - Backend: `bulk_generate_pages()` method + - Backend: `create_tasks_for_pages()` method + - Backend: API endpoints for bulk generation + - Frontend: UI for bulk generation in Site Builder + +2. **Advanced Site Management** (Phase 7) + - Site Content Manager with search/filters + - Post Editor (full-featured) + - Site Preview (live preview with iframe) + - Advanced Page Manager (drag-drop, bulk actions) + - Advanced Site Settings (SEO, meta tags, Open Graph, schema) + +### Medium Priority +3. **Layout & Template System UI** (Phase 7) + - Layout Selector component + - Template Library component + - Layout Preview component + - Template Customizer component + - Style Editor component + +4. **CMS Styling System** (Phase 7) + - Theme system + - Style presets + - Color schemes + - Typography system + - Component styles + +### Low Priority +5. **Testing & Documentation** (Phase 7) + - Component tests + - Component Storybook (optional) + - Expanded component documentation + +--- + +## RECOMMENDATIONS + +1. **Complete Bulk Generation** (Phase 5): This is a core feature for Site Builder workflow +2. **Enhance Existing Components**: Review `Editor.tsx`, `PageManager.tsx`, `Settings.tsx` to ensure they meet "advanced" requirements +3. **Implement Site Preview**: Critical for user experience +4. **Add CMS Styling System**: Important for customization capabilities +5. **Create Layout/Template UI Components**: Needed for user-friendly site building + +--- + +## CONCLUSION + +The implementation is **~75% complete** with core infrastructure in place. The main gaps are: +- Bulk page generation functionality (Phase 5) +- Advanced site management features (Phase 7) +- Layout/template UI components (Phase 7) +- CMS styling system (Phase 7) + +Most backend infrastructure is complete. The remaining work is primarily frontend UI components and advanced features. + diff --git a/backend/igny8_core/modules/system/migrations/0008_add_site_structure_generation_prompt_type.py b/backend/igny8_core/modules/system/migrations/0008_add_site_structure_generation_prompt_type.py new file mode 100644 index 00000000..12aa7257 --- /dev/null +++ b/backend/igny8_core/modules/system/migrations/0008_add_site_structure_generation_prompt_type.py @@ -0,0 +1,31 @@ +# Generated manually for Phase 7: Prompt Management UI + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('system', '0007_add_module_enable_settings'), + ] + + operations = [ + migrations.AlterField( + model_name='aiprompt', + name='prompt_type', + field=models.CharField( + choices=[ + ('clustering', 'Clustering'), + ('ideas', 'Ideas Generation'), + ('content_generation', 'Content Generation'), + ('image_prompt_extraction', 'Image Prompt Extraction'), + ('image_prompt_template', 'Image Prompt Template'), + ('negative_prompt', 'Negative Prompt'), + ('site_structure_generation', 'Site Structure Generation'), + ], + db_index=True, + max_length=50 + ), + ), + ] + diff --git a/backend/igny8_core/modules/system/models.py b/backend/igny8_core/modules/system/models.py index 2d21480d..106e0e84 100644 --- a/backend/igny8_core/modules/system/models.py +++ b/backend/igny8_core/modules/system/models.py @@ -20,6 +20,7 @@ class AIPrompt(AccountBaseModel): ('image_prompt_extraction', 'Image Prompt Extraction'), ('image_prompt_template', 'Image Prompt Template'), ('negative_prompt', 'Negative Prompt'), + ('site_structure_generation', 'Site Structure Generation'), # Phase 7: Site Builder prompts ] prompt_type = models.CharField(max_length=50, choices=PROMPT_TYPE_CHOICES, db_index=True) diff --git a/frontend/src/components/shared/README.md b/frontend/src/components/shared/README.md index 6fe400ee..a7626cfb 100644 --- a/frontend/src/components/shared/README.md +++ b/frontend/src/components/shared/README.md @@ -15,10 +15,41 @@ These components are designed to be framework-agnostic where possible, but curre ``` shared/ -├── blocks/ # Content blocks (HeroBlock, FeatureGridBlock, StatsPanel) -├── layouts/ # Page layouts (DefaultLayout, MinimalLayout) -├── templates/ # Full page templates (MarketingTemplate, LandingTemplate) -└── index.ts # Barrel exports +├── blocks/ # Content blocks (12 total) +│ ├── HeroBlock.tsx +│ ├── FeatureGridBlock.tsx +│ ├── StatsPanel.tsx +│ ├── ServicesBlock.tsx +│ ├── ProductsBlock.tsx +│ ├── TestimonialsBlock.tsx +│ ├── ContactFormBlock.tsx +│ ├── CTABlock.tsx +│ ├── ImageGalleryBlock.tsx +│ ├── VideoBlock.tsx +│ ├── TextBlock.tsx +│ ├── QuoteBlock.tsx +│ ├── blocks.css +│ └── index.ts +├── layouts/ # Page layouts (7 total) +│ ├── DefaultLayout.tsx +│ ├── MinimalLayout.tsx +│ ├── MagazineLayout.tsx +│ ├── EcommerceLayout.tsx +│ ├── PortfolioLayout.tsx +│ ├── BlogLayout.tsx +│ ├── CorporateLayout.tsx +│ ├── layouts.css +│ └── index.ts +├── templates/ # Full page templates (6 total) +│ ├── MarketingTemplate.tsx +│ ├── LandingTemplate.tsx +│ ├── BlogTemplate.tsx +│ ├── BusinessTemplate.tsx +│ ├── PortfolioTemplate.tsx +│ ├── EcommerceTemplate.tsx +│ └── index.ts +├── index.ts # Barrel exports +└── README.md # This file ``` ## Usage @@ -102,6 +133,108 @@ Statistics display component. /> ``` +#### `ServicesBlock` +Display services or offerings in a grid layout. + +**Props:** +- `title?: string` - Section title +- `subtitle?: string` - Section subtitle +- `services: Array<{ title: string; description: string; icon?: ReactNode; imageUrl?: string }>` - Service items +- `columns?: 2 | 3 | 4` - Number of columns +- `variant?: 'default' | 'card' | 'minimal'` - Display variant + +#### `ProductsBlock` +Display products in a grid or list layout. + +**Props:** +- `title?: string` - Section title +- `subtitle?: string` - Section subtitle +- `products: Array<{ name: string; description?: string; price?: string; imageUrl?: string; ctaLabel?: string }>` - Product items +- `columns?: 2 | 3 | 4` - Number of columns +- `variant?: 'grid' | 'list' | 'carousel'` - Display variant + +#### `TestimonialsBlock` +Display customer testimonials with ratings and author info. + +**Props:** +- `title?: string` - Section title +- `subtitle?: string` - Section subtitle +- `testimonials: Array<{ quote: string; author: string; role?: string; company?: string; avatarUrl?: string; rating?: number }>` - Testimonial items +- `columns?: 1 | 2 | 3` - Number of columns +- `variant?: 'default' | 'card' | 'minimal'` - Display variant + +#### `ContactFormBlock` +Contact form with customizable fields. + +**Props:** +- `title?: string` - Form title +- `subtitle?: string` - Form subtitle +- `fields?: Array<{ name: string; label: string; type: 'text' | 'email' | 'tel' | 'textarea'; required?: boolean; placeholder?: string }>` - Form fields +- `submitLabel?: string` - Submit button label +- `onSubmit?: (data: Record) => void` - Submit handler + +#### `CTABlock` +Call-to-action section with primary and secondary actions. + +**Props:** +- `title: string` - CTA title +- `subtitle?: string` - CTA subtitle +- `primaryCtaLabel?: string` - Primary button label +- `primaryCtaLink?: string` - Primary button link +- `onPrimaryCtaClick?: () => void` - Primary button click handler +- `secondaryCtaLabel?: string` - Secondary button label +- `secondaryCtaLink?: string` - Secondary button link +- `onSecondaryCtaClick?: () => void` - Secondary button click handler +- `backgroundImage?: string` - Background image URL +- `variant?: 'default' | 'centered' | 'split'` - Layout variant + +#### `ImageGalleryBlock` +Image gallery with grid, masonry, or carousel layout. + +**Props:** +- `title?: string` - Gallery title +- `subtitle?: string` - Gallery subtitle +- `images: Array<{ url: string; alt?: string; caption?: string; thumbnailUrl?: string }>` - Image items +- `columns?: 2 | 3 | 4` - Number of columns +- `variant?: 'grid' | 'masonry' | 'carousel'` - Display variant +- `lightbox?: boolean` - Enable lightbox on click + +#### `VideoBlock` +Video player component supporting both video URLs and embed codes. + +**Props:** +- `title?: string` - Video title +- `subtitle?: string` - Video subtitle +- `videoUrl?: string` - Video file URL +- `embedCode?: string` - HTML embed code (e.g., YouTube iframe) +- `thumbnailUrl?: string` - Video thumbnail/poster +- `autoplay?: boolean` - Autoplay video +- `controls?: boolean` - Show video controls +- `loop?: boolean` - Loop video +- `muted?: boolean` - Mute video +- `variant?: 'default' | 'fullwidth' | 'centered'` - Layout variant + +#### `TextBlock` +Simple text content block with customizable alignment and width. + +**Props:** +- `title?: string` - Block title +- `content: string | ReactNode` - Text content (HTML string or React nodes) +- `align?: 'left' | 'center' | 'right' | 'justify'` - Text alignment +- `variant?: 'default' | 'narrow' | 'wide' | 'fullwidth'` - Width variant + +#### `QuoteBlock` +Quote/testimonial block with author information. + +**Props:** +- `quote: string` - Quote text +- `author?: string` - Author name +- `role?: string` - Author role +- `company?: string` - Author company +- `avatarUrl?: string` - Author avatar image +- `variant?: 'default' | 'large' | 'minimal' | 'card'` - Display variant +- `align?: 'left' | 'center' | 'right'` - Text alignment + ### Layouts #### `DefaultLayout` @@ -125,15 +258,64 @@ Minimal layout for focused content pages. **Props:** - `children: ReactNode` - Page content -- `maxWidth?: string` - Maximum content width +- `background?: 'light' | 'dark'` - Background color **Example:** ```tsx - + ``` +#### `MagazineLayout` +Magazine-style layout with featured section and sidebar. + +**Props:** +- `header?: ReactNode` - Page header +- `featured?: ReactNode` - Featured content section +- `sidebar?: ReactNode` - Sidebar content +- `mainContent: ReactNode` - Main content area +- `footer?: ReactNode` - Page footer + +#### `EcommerceLayout` +E-commerce layout with navigation and product sidebar. + +**Props:** +- `header?: ReactNode` - Page header +- `navigation?: ReactNode` - Navigation menu +- `sidebar?: ReactNode` - Sidebar (filters, categories) +- `mainContent: ReactNode` - Main content (products) +- `footer?: ReactNode` - Page footer + +#### `PortfolioLayout` +Portfolio layout optimized for showcasing work. + +**Props:** +- `header?: ReactNode` - Page header +- `mainContent: ReactNode` - Main content (gallery, projects) +- `footer?: ReactNode` - Page footer +- `fullWidth?: boolean` - Full-width layout option + +#### `BlogLayout` +Blog layout with optional sidebar (left or right). + +**Props:** +- `header?: ReactNode` - Page header +- `sidebar?: ReactNode` - Sidebar content +- `mainContent: ReactNode` - Main content (blog posts) +- `footer?: ReactNode` - Page footer +- `sidebarPosition?: 'left' | 'right'` - Sidebar position + +#### `CorporateLayout` +Corporate/business layout with navigation and structured sections. + +**Props:** +- `header?: ReactNode` - Page header +- `navigation?: ReactNode` - Navigation menu +- `mainContent: ReactNode` - Main content +- `footer?: ReactNode` - Page footer +- `sidebar?: ReactNode` - Optional sidebar + ### Templates #### `MarketingTemplate` @@ -169,6 +351,51 @@ Landing page template optimized for conversions. **Props:** - Similar to `MarketingTemplate` with additional conversion-focused sections +#### `BlogTemplate` +Blog page template with posts and sidebar. + +**Props:** +- `header?: ReactNode` - Page header +- `sidebar?: ReactNode` - Sidebar content +- `posts: ReactNode` - Blog posts content +- `footer?: ReactNode` - Page footer +- `sidebarPosition?: 'left' | 'right'` - Sidebar position + +#### `BusinessTemplate` +Business/corporate page template. + +**Props:** +- `header?: ReactNode` - Page header +- `navigation?: ReactNode` - Navigation menu +- `hero?: ReactNode` - Hero section +- `features?: ReactNode` - Features section +- `services?: ReactNode` - Services section +- `testimonials?: ReactNode` - Testimonials section +- `cta?: ReactNode` - Call-to-action section +- `footer?: ReactNode` - Page footer + +#### `PortfolioTemplate` +Portfolio showcase template. + +**Props:** +- `header?: ReactNode` - Page header +- `gallery?: ReactNode` - Portfolio gallery +- `about?: ReactNode` - About section +- `contact?: ReactNode` - Contact section +- `footer?: ReactNode` - Page footer +- `fullWidth?: boolean` - Full-width layout + +#### `EcommerceTemplate` +E-commerce store template. + +**Props:** +- `header?: ReactNode` - Page header +- `navigation?: ReactNode` - Navigation menu +- `sidebar?: ReactNode` - Sidebar (filters) +- `products?: ReactNode` - Products grid +- `featured?: ReactNode` - Featured products +- `footer?: ReactNode` - Page footer + ## Styling Components use CSS modules and shared CSS files: diff --git a/frontend/src/components/shared/blocks/CTABlock.tsx b/frontend/src/components/shared/blocks/CTABlock.tsx new file mode 100644 index 00000000..8a0cf05b --- /dev/null +++ b/frontend/src/components/shared/blocks/CTABlock.tsx @@ -0,0 +1,76 @@ +import type { ReactNode } from 'react'; +import './blocks.css'; + +export interface CTABlockProps { + title: string; + subtitle?: string; + primaryCtaLabel?: string; + primaryCtaLink?: string; + onPrimaryCtaClick?: () => void; + secondaryCtaLabel?: string; + secondaryCtaLink?: string; + onSecondaryCtaClick?: () => void; + backgroundImage?: string; + variant?: 'default' | 'centered' | 'split'; + children?: ReactNode; +} + +export function CTABlock({ + title, + subtitle, + primaryCtaLabel, + primaryCtaLink, + onPrimaryCtaClick, + secondaryCtaLabel, + secondaryCtaLink, + onSecondaryCtaClick, + backgroundImage, + variant = 'default', + children +}: CTABlockProps) { + return ( +
+
+

{title}

+ {subtitle &&

{subtitle}

} + {children &&
{children}
} +
+ {primaryCtaLabel && ( + primaryCtaLink ? ( + + {primaryCtaLabel} + + ) : ( + + ) + )} + {secondaryCtaLabel && ( + secondaryCtaLink ? ( + + {secondaryCtaLabel} + + ) : ( + + ) + )} +
+
+
+ ); +} + diff --git a/frontend/src/components/shared/blocks/ContactFormBlock.tsx b/frontend/src/components/shared/blocks/ContactFormBlock.tsx new file mode 100644 index 00000000..5e46f472 --- /dev/null +++ b/frontend/src/components/shared/blocks/ContactFormBlock.tsx @@ -0,0 +1,83 @@ +import { useState } from 'react'; +import './blocks.css'; + +export interface ContactFormBlockProps { + title?: string; + subtitle?: string; + fields?: Array<{ + name: string; + label: string; + type: 'text' | 'email' | 'tel' | 'textarea'; + required?: boolean; + placeholder?: string; + }>; + submitLabel?: string; + onSubmit?: (data: Record) => void; +} + +export function ContactFormBlock({ + title, + subtitle, + fields = [ + { name: 'name', label: 'Name', type: 'text', required: true }, + { name: 'email', label: 'Email', type: 'email', required: true }, + { name: 'message', label: 'Message', type: 'textarea', required: true }, + ], + submitLabel = 'Submit', + onSubmit +}: ContactFormBlockProps) { + const [formData, setFormData] = useState>({}); + + const handleChange = (name: string, value: string) => { + setFormData(prev => ({ ...prev, [name]: value })); + }; + + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); + onSubmit?.(formData); + }; + + return ( +
+ {title &&

{title}

} + {subtitle &&

{subtitle}

} +
+ {fields.map((field) => ( +
+ + {field.type === 'textarea' ? ( +