--- inclusion: always --- # RPA Vision V3 Design System Rules This document provides comprehensive design system guidelines for integrating Figma designs with the RPA Vision V3 codebase using the Figma MCP integration. ## Project Architecture Overview RPA Vision V3 is a multi-component system with distinct UI frameworks: - **Visual Workflow Builder**: React + TypeScript + Material-UI frontend - **Web Dashboard**: Flask + HTML/CSS/JavaScript with custom styling - **Desktop GUI**: PyQt5 Python application - **Agent V0**: Cross-platform capture tool with PyQt5 UI - **Server API**: Flask-based REST API with minimal UI ## Design Token Definitions ### Color System **Primary Colors:** - Primary Blue: `#1976d2` (Material-UI primary) - Secondary Pink: `#dc004e` (Material-UI secondary) - Success Green: `#22c55e` - Warning Orange: `#f59e0b` - Error Red: `#ef4444` **Background Colors:** - Dark Background: `#0f172a` (Dashboard primary) - Card Background: `#1e293b` (Dashboard cards) - Border Color: `#334155` - Text Primary: `#e2e8f0` - Text Secondary: `#94a3b8` - Text Muted: `#64748b` **PyQt5 Colors:** - Background: `#1e1e1e` (Dark theme) - Text: `#d4d4d4` - Success: `#4CAF50` - Accent: `#2196f3` ### Typography Scale **Web (Material-UI + Custom):** - Headers: `'Segoe UI', Tahoma, Geneva, Verdana, sans-serif` - Body: Material-UI default typography - Monospace: `monospace` (for logs and code) **PyQt5:** - Default system fonts with size variations - Monospace for technical displays ### Spacing System **Web Spacing (px):** - xs: 4px - sm: 8px - md: 12px - lg: 16px - xl: 20px - xxl: 24px - xxxl: 30px **Component Spacing:** - Card padding: 20px - Button padding: 10px 20px - Input padding: 12px - Grid gaps: 15px-20px ## Component Library Structure ### React Components Location ``` visual_workflow_builder/frontend/src/components/ ├── Canvas/ # Main workflow canvas ├── Palette/ # Tool palette ├── PropertiesPanel/ # Node properties editor ├── TemplateSelector/ # Workflow templates ├── AnalyticsDashboard/ # Analytics display ├── DocumentationTab/ # Interactive documentation ├── ExecutionPanel/ # Workflow execution controls ├── KeyboardShortcuts/ # Keyboard shortcuts help └── [Other components]/ ``` ### Component Architecture - **Material-UI based**: Primary component library - **Custom CSS modules**: Component-specific styling in `.css` files - **Hooks pattern**: Custom hooks for state management (`useWorkflow`, `useSelection`, etc.) - **TypeScript interfaces**: Defined in `src/types/` ### PyQt5 Components Location ``` gui/ ├── main_window.py # Main application window ├── components/ # Reusable UI components └── orchestrator.py # Business logic integration ``` ## Styling Approach ### React/TypeScript (Visual Workflow Builder) **Primary Method**: Material-UI with custom CSS modules ```typescript // Component structure import { Box, Button, Typography } from '@mui/material'; import './ComponentName.css'; // Theme usage const theme = createTheme({ palette: { primary: { main: '#1976d2' }, secondary: { main: '#dc004e' } } }); ``` **CSS Modules Pattern**: ```css /* Component.css */ .component-container { background: #1e293b; border-radius: 12px; padding: 20px; border: 1px solid #334155; } .component-title { color: #e2e8f0; margin-bottom: 15px; } ``` ### Flask Dashboard (Web Dashboard) **Method**: Inline CSS with utility classes ```html ``` ### PyQt5 (Desktop GUI) **Method**: Inline StyleSheet strings ```python # PyQt5 styling widget.setStyleSheet(""" QWidget { background: #1e1e1e; color: #d4d4d4; font-family: monospace; } QPushButton { background: #4CAF50; color: white; padding: 10px; font-size: 14px; border-radius: 4px; } """) ``` ## Asset Management ### Icons - **Material-UI Icons**: `@mui/icons-material` for React components - **Emoji Icons**: Used extensively in dashboard (🚀, 📊, ⚡, etc.) - **Unicode Symbols**: For PyQt5 components (▶, ⏸, ⏹) ### Images and Screenshots ``` data/ ├── screenshots/ # Runtime captured screenshots ├── training/ # Training data assets └── [other data]/ ``` ### Asset Optimization - **No CDN**: Local asset serving - **Webpack bundling**: For React frontend - **Flask static serving**: For dashboard assets ## Responsive Design Implementation ### React Components ```typescript // Material-UI responsive breakpoints const useStyles = makeStyles((theme) => ({ container: { [theme.breakpoints.down('md')]: { padding: theme.spacing(1), }, [theme.breakpoints.up('lg')]: { padding: theme.spacing(3), }, }, })); ``` ### Dashboard CSS ```css /* Responsive grid */ .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; } @media (max-width: 768px) { .grid { grid-template-columns: 1fr; } .react-flow__minimap { display: none; } } ``` ## Figma Integration Guidelines ### Design-to-Code Mapping **When using Figma MCP tools:** 1. **Replace Tailwind with Material-UI**: ```typescript // Figma output (Tailwind)