/** * Style Editor * Phase 7: Layout & Template System * Component for editing CSS styles and theme customization */ import React, { useState } from 'react'; import { CodeIcon, PaletteIcon, TypeIcon, SaveIcon, RefreshCwIcon } from '../../icons'; import { Card } from '../../ui/card'; import Button from '../../ui/button/Button'; import Label from '../../form/Label'; import TextArea from '../../form/input/TextArea'; import { useToast } from '../../ui/toast/ToastContainer'; export interface StyleSettings { customCSS?: string; colorPalette?: { primary: string; secondary: string; accent: string; background: string; text: string; }; typography?: { fontFamily: string; headingFont: string; fontSize: string; lineHeight: string; }; spacing?: { base: string; scale: string; }; } interface StyleEditorProps { styleSettings: StyleSettings; onChange: (settings: StyleSettings) => void; onSave?: () => void; onReset?: () => void; } export default function StyleEditor({ styleSettings, onChange, onSave, onReset }: StyleEditorProps) { const toast = useToast(); const [activeTab, setActiveTab] = useState<'css' | 'colors' | 'typography' | 'spacing'>('css'); const [customCSS, setCustomCSS] = useState(styleSettings.customCSS || ''); const updateSettings = (updates: Partial) => { onChange({ ...styleSettings, ...updates }); }; const handleCSSChange = (value: string) => { setCustomCSS(value); updateSettings({ customCSS: value }); }; const handleColorChange = (key: string, value: string) => { updateSettings({ colorPalette: { ...styleSettings.colorPalette, [key]: value, } as StyleSettings['colorPalette'], }); }; const handleTypographyChange = (key: string, value: string) => { updateSettings({ typography: { ...styleSettings.typography, [key]: value, } as StyleSettings['typography'], }); }; const handleSpacingChange = (key: string, value: string) => { updateSettings({ spacing: { ...styleSettings.spacing, [key]: value, } as StyleSettings['spacing'], }); }; return (

Style Editor

Customize CSS, colors, typography, and spacing

{onReset && ( )} {onSave && ( )}
{/* Tabs */}
{/* Custom CSS Tab */} {activeTab === 'css' && (