diff --git a/ui/desktop/src/components/settings/app/ThemeColorEditor/Preview/ColorPreview.tsx b/ui/desktop/src/components/settings/app/ThemeColorEditor/Preview/ColorPreview.tsx index f5f2020865..1cc531368a 100644 --- a/ui/desktop/src/components/settings/app/ThemeColorEditor/Preview/ColorPreview.tsx +++ b/ui/desktop/src/components/settings/app/ThemeColorEditor/Preview/ColorPreview.tsx @@ -1,11 +1,13 @@ /** * ColorPreview Component * - * Shows live preview of how a selected color variable is used in the UI. - * Displays real component examples with the color applied. + * Shows 1:1 accurate previews of how a selected color variable is used in the actual Goose UI. + * Uses real component structures and class names from the app. */ import { ColorVariable } from '../types'; +import { Card, CardHeader, CardTitle, CardDescription, CardContent } from '../../../../ui/card'; +import { Button } from '../../../../ui/button'; interface ColorPreviewProps { variable: ColorVariable; @@ -34,28 +36,34 @@ export function ColorPreview({ variable, lightColor, darkColor, currentMode }: C }; return ( -
-
-

- {variable.label} -

-

- {variable.description} -

-
+
+ {/* Color Info Header */} +
+
-
- {currentColor} +
+

+ {variable.label} +

+

+ {variable.description} +

+
+ {currentColor} +
-
-

- Used In: +
+ + {/* Usage Examples */} +
+

+ Where This Color Appears:

{renderPreview()}
@@ -63,263 +71,364 @@ export function ColorPreview({ variable, lightColor, darkColor, currentMode }: C ); } -// Background color previews +// Background color previews - Using REAL Goose UI components function BackgroundPreview({ variable, color }: { variable: ColorVariable; color: string }) { const varName = variable.name; if (varName === 'color-background-primary') { return ( -
- -
-

- This is the primary background color used throughout the app. -

-

- It appears in the main chat area, settings panels, and most content areas. -

-
-
- - -
-
- AI -
-
+
+ +
+

- This is how AI messages appear on the primary background. + This is the main background color for the entire app. +

+

+ Used in: Chat area, main content, message list

- +
+ + + {/* Exact replica of GooseMessage component */} +
+
+
+
+

+ I'll help you with that! Let me check the files in your project. +

+
+
+
+ 2:45 PM +
+
+
+
+
+
); } if (varName === 'color-background-secondary') { return ( -
- -
-
-
Navigation
-
-
- Home -
-
- Chat -
-
- Settings +
+ + {/* Using actual Card component from ui/card.tsx */} + + + Appearance + Configure how goose appears on your system + + +
+
+

Menu bar icon

+

+ Show goose in the menu bar +

+
+
+
+ + +
+
Navigation
+
+
+ 💬 Chat +
+
+ 🔧 Settings +
+
+ 📦 Extensions +
- - - -
-

Settings Card

-

- Cards and panels use the secondary background for visual hierarchy. -

-
-
+
); } if (varName === 'color-background-tertiary') { return ( - -
-
-

- Tertiary background for nested panels and hover states. -

+ +
+

Hover over items:

+
+
+ Hovered item (tertiary background) +
+
+ Normal item +
- +
+ ); + } + + if (varName === 'color-background-inverse') { + return ( +
+ + + + + +
+ Selected item or active state +
+
+
); } if (varName === 'color-background-danger') { return ( - -
-

⚠️ Error

-

- This background is used for error messages and dangerous actions. -

+ +
+
+

⚠️ Error Message

+

+ Failed to load configuration file +

+
+
- +
); } if (varName === 'color-background-info') { return ( - +
-

ℹ️ Information

+

ℹ️ Tip

- This background is used for informational messages and tips. + You can use keyboard shortcuts to navigate faster

-
+ ); } return ( - +

Background color preview

-
+ ); } -// Text color previews +// Text color previews - Using REAL Goose UI patterns function TextPreview({ variable, color }: { variable: ColorVariable; color: string }) { const varName = variable.name; if (varName === 'color-text-primary') { return ( -
- -
-

Heading Text

-

- This is the main text color used for body content, headings, and primary information. -

-
- It appears in chat messages, settings descriptions, and all main content. +
+ +
+
+
+
+

+ I'll help you with that! Let me check the files in your project and make the necessary changes. +

+
+
- +
+ + + + + Settings Section + Primary text appears in headings and main content + + +
); } if (varName === 'color-text-secondary') { return ( - -
-

Main heading

-

- Secondary text is used for labels, captions, and less important information. -

-
- Status: - Active + + + + Menu bar icon + + Show goose in the menu bar + + + +
+
+

Setting Name

+

+ This is secondary text used for descriptions and labels +

+
+
+
+
+
+ ); + } + + if (varName === 'color-text-inverse') { + return ( + +
+ +
+

+ Text on dark/inverse backgrounds +

- +
); } if (varName === 'color-text-danger') { return ( - -
-

⚠️ Error Message

-

- This color is used for error messages, warnings, and destructive actions. -

- + +
+
+

⚠️ Error

+

+ Failed to load configuration file +

+
+
- +
); } if (varName === 'color-text-success') { return ( - -
+ +

✓ Success

-

- Used for success messages, confirmations, and positive feedback. +

+ Theme saved successfully!

- +
); } if (varName === 'color-text-warning') { return ( - -
+ +

⚡ Warning

-

- Used for warnings and caution messages. +

+ This action cannot be undone

- +
); } if (varName === 'color-text-info') { return ( - -
-

ℹ️ Information

-

- Used for informational messages and tips. + +

+

ℹ️ Tip

+

+ You can use keyboard shortcuts to navigate faster

- + ); } return ( - +

Sample text in this color

-
+ ); } -// Border color previews +// Border color previews - Using REAL Goose UI patterns function BorderPreview({ variable, color }: { variable: ColorVariable; color: string }) { const varName = variable.name; if (varName === 'color-border-primary') { return ( -
- -
-

Card with primary border

-
-
+
+ + + + Card Title + This card uses the primary border color + + +

Card content goes here

+
+
+
- + - + - -
-

Section 1

-
-

Section 2

+ +
+

Section Above

+
+

Section Below

- +
); } + if (varName === 'color-border-secondary') { + return ( + +
+
+

Hovered card border

+
+
+
+ ); + } + if (varName === 'color-border-danger') { return ( - -
+ +
-

Error state border

+

Error State

- +
+ ); + } + + if (varName === 'color-border-info') { + return ( + +
+

Info State

+
+
); } return ( - +

Element with this border color

-
+ ); } -// Ring (focus) color previews +// Ring (focus) color previews - Using REAL button focus styles function RingPreview({ variable, color }: { variable: ColorVariable; color: string }) { return ( -
- -
- - - -
-
+
+ + + - -

- The ring color appears when elements receive keyboard focus for accessibility. + + + + + +

+ The ring color appears when elements receive keyboard focus (Tab key navigation). + This is essential for accessibility and keyboard navigation.

-
+ +
+ ); +} + +// Helper components +function ExampleSection({ title, children }: { title: string; children: React.ReactNode }) { + return ( +
+
+
{title}
+
+ 1:1 Replica +
+
+
+ {children} +
); } -// Helper component for preview cards function PreviewCard({ title, children }: { title: string; children: React.ReactNode }) { return (