"use client" import { ComponentContainer } from "@/components/ui/component-container" import { Badge } from "@/components/ui/badge" import { Alert, AlertIcon, AlertContent, AlertTitle, AlertDescription } from "@/components/ui/alert-compound" import { semanticColors, type SemanticColorName } from "@/utils/semantic-colors" import { useTheme } from "next-themes" import { useState, useEffect } from "react" import { CheckCircleIcon, ExclamationTriangleIcon, XCircleIcon, InformationCircleIcon, MinusCircleIcon, } from "@heroicons/react/24/outline" const semanticIcons = { success: CheckCircleIcon, warning: ExclamationTriangleIcon, error: XCircleIcon, info: InformationCircleIcon, neutral: MinusCircleIcon, } const semanticDescriptions = { success: "Operation completed successfully", warning: "Please review before proceeding", error: "An error occurred during processing", info: "Additional information available", neutral: "Standard notification message", } export default function SemanticColorsSection() { const { theme, resolvedTheme } = useTheme() const [mounted, setMounted] = useState(false) const [currentTheme, setCurrentTheme] = useState<"light" | "dark">("light") // Handle mounting to avoid hydration mismatch useEffect(() => { setMounted(true) }, []) // Update current theme when theme changes or becomes available useEffect(() => { if (mounted) { // Determine the actual theme being used const actualTheme = resolvedTheme || theme // If we still don't have a theme, check the document class or default to light if (!actualTheme) { const isDarkMode = document.documentElement.classList.contains("dark") setCurrentTheme(isDarkMode ? "dark" : "light") } else { setCurrentTheme(actualTheme === "dark" ? "dark" : "light") } } }, [mounted, theme, resolvedTheme]) // Don't render until mounted to avoid hydration issues if (!mounted) { return (
) } const isDark = currentTheme === "dark" return (
{/* Color Palette Overview */}

Final Color Palette

{Object.entries(semanticColors).map(([name, color]) => { const colorName = name as SemanticColorName const themeColors = color[isDark ? "dark" : "light"] return (
{name}
{/* Background Color */}
Background
{/* Foreground Color */}
Foreground
{/* Border Color */}
{themeColors.background}
) })}
{/* Live Badge Examples */}

Semantic Badges in Action

{Object.keys(semanticColors).map((name) => { const colorName = name as SemanticColorName return ( {name.charAt(0).toUpperCase() + name.slice(1)} ) })}

Different Sizes

Small Success Medium Warning Large Error
{/* Live Alert Examples */}

Semantic Alerts in Action

{Object.keys(semanticColors).map((name) => { const colorName = name as SemanticColorName const Icon = semanticIcons[colorName] const variant = colorName === "error" ? "destructive" : colorName return ( } /> {name.charAt(0).toUpperCase() + name.slice(1)} Alert {semanticDescriptions[colorName]} This demonstrates the actual colors applied to alert components. ) })}
{/* Real-World Usage Examples */}

Real-World Usage

Deployment Status Live
Your application has been successfully deployed and is now accessible to users.
} /> Deployment Complete All services are running normally. Your application is live at https://your-app.com
System Health
API Database Cache
Monitor the real-time status of your application services.
} /> Performance Warning Database response times are elevated. Consider scaling your database resources.
User Notifications
3 New 12 Read
Recent activity and system notifications for your account.
} /> New Feature Available Advanced analytics dashboard is now available. Explore detailed insights about your application performance.
{/* Color Theory */}

Design Philosophy

Our semantic color palette is designed with bold, distinctive colors that embody the Percolate design language. Each color is carefully chosen to be{" "} modern, impactful, and memorable while maintaining excellent accessibility standards.

  • Success: Fresh lime and vibrant forest green convey growth and achievement
  • Warning: Golden cream and bold orange create urgency without alarm
  • Error: Soft rose and bold crimson communicate issues clearly
  • Info: Sky blue and royal blue inspire trust and clarity
  • Neutral: Cool gray and indigo provide balanced, professional messaging

All colors are optimized for both light and dark themes, ensuring consistent visual hierarchy and accessibility across all viewing conditions.

) }