@thesage/ui 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{fontThemes-Bwf7_lFg.d.mts → fontThemes-Cum0S1DI.d.mts} +3 -3
- package/dist/{fontThemes-Bwf7_lFg.d.ts → fontThemes-Cum0S1DI.d.ts} +3 -3
- package/dist/{hooks-C8PrmIXy.d.mts → hooks-CobTQpCg.d.mts} +1 -1
- package/dist/{hooks-Ct9RBhg-.d.ts → hooks-DHPlUx3T.d.ts} +1 -1
- package/dist/hooks.d.mts +2 -2
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js.map +1 -1
- package/dist/hooks.mjs.map +1 -1
- package/dist/{index-CsnncHSm.d.mts → index-L8R3gyuQ.d.mts} +1 -1
- package/dist/{index-CsnncHSm.d.ts → index-L8R3gyuQ.d.ts} +1 -1
- package/dist/index.d.mts +145 -12
- package/dist/index.d.ts +145 -12
- package/dist/index.js +165 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +160 -24
- package/dist/index.mjs.map +1 -1
- package/dist/providers.js +10 -10
- package/dist/providers.js.map +1 -1
- package/dist/providers.mjs +10 -10
- package/dist/providers.mjs.map +1 -1
- package/dist/tokens.d.mts +9 -9
- package/dist/tokens.d.ts +9 -9
- package/dist/tokens.js +10 -10
- package/dist/tokens.js.map +1 -1
- package/dist/tokens.mjs +9 -9
- package/dist/tokens.mjs.map +1 -1
- package/package.json +7 -6
package/dist/providers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/providers.ts","../src/providers/ThemeProvider.tsx","../src/lib/store/theme.ts","../src/lib/store/customizer.ts","../../tokens/src/base.ts","../../tokens/src/studio.ts","../../tokens/src/sage.ts","../../tokens/src/volt.ts","../../tokens/src/typography.ts","../../tokens/src/syntax.ts","../../tokens/src/color-utils.ts","../../tokens/src/token-graph.ts","../src/lib/colors.ts"],"sourcesContent":["/**\n * Providers subpath export\n * Allows: import { ... } from '@thesage/ui/providers'\n */\n\n// Re-export all providers\nexport * from './providers/ThemeProvider';\n","'use client';\n\n/**\n * Theme Provider\n * Applies theme tokens as CSS variables and manages transitions\n */\n\nimport { useEffect, useState } from 'react';\nimport { useThemeStore } from '../lib/store/theme';\nimport { useCustomizer, type ColorPalette } from '../lib/store/customizer';\nimport { studioTokens, sageTokens, voltTokens, syntaxColors, codeColors } from '@thesage/tokens';\nimport type { ThemeName, ColorMode } from '@thesage/tokens';\n\n// Theme token map\nconst themeTokens = {\n studio: studioTokens,\n sage: sageTokens,\n volt: voltTokens,\n};\n\n// Font family map (CSS variables defined in layout)\nconst fontFamilies = {\n studio: {\n heading: 'var(--font-studio-heading)',\n body: 'var(--font-studio-body)',\n mono: 'var(--font-mono)',\n },\n sage: {\n sans: 'var(--font-sage-body)',\n serif: 'var(--font-sage-heading)',\n mono: 'var(--font-mono)',\n },\n volt: {\n sans: 'var(--font-volt-heading)',\n mono: 'var(--font-mono)',\n },\n};\n\n/**\n * Convert theme tokens to CSS variables\n */\nfunction getThemeVars(theme: ThemeName, mode: ColorMode): Record<string, string> {\n const tokens = themeTokens[theme];\n const colors = tokens[mode]?.colors as any;\n const effects = tokens[mode]?.effects as any;\n const fonts = fontFamilies[theme] as any;\n\n return {\n // Colors - Base\n '--color-background': colors?.background || '#ffffff',\n '--color-background-secondary': colors?.backgroundSecondary || colors?.background || '#fafafa',\n '--color-background-tertiary': colors?.backgroundTertiary || colors?.backgroundSecondary || colors?.background || '#f5f5f5',\n '--color-foreground': colors?.foreground || '#0a0a0a',\n '--color-primary': colors?.primary || '#0a0a0a',\n '--color-primary-foreground': colors?.primaryForeground || '#ffffff',\n '--color-secondary': colors?.secondary || '#f5f5f5',\n '--color-secondary-foreground': colors?.secondaryForeground || '#0a0a0a',\n '--color-accent': colors?.accent || colors?.primary || '#0070f3',\n '--color-accent-foreground': colors?.accentForeground || '#ffffff',\n '--color-success': colors?.success || '#00a86b',\n '--color-success-foreground': colors?.successForeground || '#ffffff',\n '--color-warning': colors?.warning || '#f59e0b',\n '--color-warning-foreground': colors?.warningForeground || '#ffffff',\n '--color-error': colors?.error || '#ef4444',\n '--color-error-foreground': colors?.errorForeground || '#ffffff',\n '--color-info': colors?.info || colors?.accent || '#0070f3',\n '--color-info-foreground': colors?.infoForeground || '#ffffff',\n '--color-glass': colors?.glass || 'rgba(255, 255, 255, 0.7)',\n '--color-glass-border': colors?.glassBorder || 'rgba(0, 0, 0, 0.1)',\n\n // Semantic color aliases (matching README examples)\n '--color-text-primary': colors?.foreground || '#0a0a0a',\n '--color-text-secondary': colors?.foregroundSecondary || '#525252',\n '--color-text-muted': colors?.foregroundTertiary || '#a3a3a3',\n '--color-surface': colors?.backgroundSecondary || colors?.background || '#fafafa',\n '--color-border': colors?.border || colors?.glassBorder || 'rgba(0, 0, 0, 0.1)',\n '--color-focus': colors?.accent || colors?.primary || '#0070f3',\n\n // Links and focus rings (can be overridden by derived tokens)\n '--color-link': colors?.link || colors?.primary || '#0a0a0a',\n '--color-ring': colors?.ring || colors?.primary || '#0a0a0a',\n\n // Interactive states\n '--color-hover': colors?.hover || colors?.backgroundSecondary || '#fafafa',\n '--color-active': colors?.active || colors?.backgroundTertiary || '#f0f0f0',\n '--color-link-hover': colors?.linkHover || colors?.primary || '#0a0a0a',\n '--color-link-hover-foreground': colors?.linkHoverForeground || colors?.background || '#ffffff',\n\n // Effects - Blur\n '--effect-blur-sm': effects?.blur?.sm || 'blur(4px)',\n '--effect-blur-md': effects?.blur?.md || 'blur(8px)',\n '--effect-blur-lg': effects?.blur?.lg || 'blur(16px)',\n '--effect-blur-xl': effects?.blur?.xl || effects?.blur?.lg || 'blur(24px)',\n\n // Effects - Shadow\n '--effect-shadow-sm': effects?.shadow?.sm || '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n '--effect-shadow-md': effects?.shadow?.md || effects?.shadow?.sm || '0 4px 6px -1px rgba(0, 0, 0, 0.1)',\n '--effect-shadow-lg': effects?.shadow?.lg || effects?.shadow?.md || effects?.shadow?.sm || '0 10px 15px -3px rgba(0, 0, 0, 0.1)',\n\n // Typography - Font Families\n '--font-heading': fonts?.heading || (theme === 'sage' && fonts?.serif ? fonts.serif : fonts?.sans) || 'var(--font-studio-heading)',\n '--font-body': fonts?.body || fonts?.sans || 'var(--font-studio-body)',\n '--font-mono': fonts?.mono || 'var(--font-studio-mono)',\n\n // Motion - These are accessed programmatically via tokens\n // but we can set defaults for CSS animations\n '--ease-default': tokens?.motion?.ease?.default || 'cubic-bezier(0.4, 0, 0.2, 1)',\n '--ease-spring': tokens?.motion?.ease?.spring || tokens?.motion?.ease?.default || 'cubic-bezier(0.16, 1, 0.3, 1)',\n\n // Syntax Highlighting - Based on VS Code Dark+ theme\n '--syntax-comment': mode === 'light' ? syntaxColors.light.comment : syntaxColors.dark.comment,\n '--syntax-keyword': mode === 'light' ? syntaxColors.light.keyword : syntaxColors.dark.keyword,\n '--syntax-function': mode === 'light' ? syntaxColors.light.function : syntaxColors.dark.function,\n '--syntax-string': mode === 'light' ? syntaxColors.light.string : syntaxColors.dark.string,\n '--syntax-number': mode === 'light' ? syntaxColors.light.number : syntaxColors.dark.number,\n '--syntax-boolean': mode === 'light' ? syntaxColors.light.boolean : syntaxColors.dark.boolean,\n '--syntax-operator': mode === 'light' ? syntaxColors.light.operator : syntaxColors.dark.operator,\n '--syntax-property': mode === 'light' ? syntaxColors.light.property : syntaxColors.dark.property,\n '--syntax-className': mode === 'light' ? syntaxColors.light.className : syntaxColors.dark.className,\n '--syntax-tag': mode === 'light' ? syntaxColors.light.tag : syntaxColors.dark.tag,\n '--syntax-attribute': mode === 'light' ? syntaxColors.light.attribute : syntaxColors.dark.attribute,\n '--syntax-variable': mode === 'light' ? syntaxColors.light.variable : syntaxColors.dark.variable,\n '--syntax-punctuation': mode === 'light' ? syntaxColors.light.punctuation : syntaxColors.dark.punctuation,\n '--syntax-plain': mode === 'light' ? syntaxColors.light.plain : syntaxColors.dark.plain,\n\n // Code Block Backgrounds and Borders - Accessible contrast (WCAG AA 4.5:1)\n '--code-block-bg': mode === 'light' ? codeColors.light.blockBackground : codeColors.dark.blockBackground,\n '--code-inline-bg': mode === 'light' ? codeColors.light.inlineBackground : codeColors.dark.inlineBackground,\n '--code-border': mode === 'light' ? codeColors.light.border : codeColors.dark.border,\n };\n}\n\n/**\n * Merge custom color palette with base theme tokens\n * This is where \"change once, ripple everywhere\" happens!\n */\nfunction mergeCustomColorTokens(\n baseTokens: Record<string, string>,\n customPalette: ColorPalette\n): Record<string, string> {\n return {\n ...baseTokens,\n\n // Override primary color\n '--color-primary': customPalette.primary,\n '--color-primary-foreground': customPalette.primaryForeground,\n\n // Apply color scale (for utilities like bg-primary/50)\n '--color-primary-50': customPalette.scale[50],\n '--color-primary-100': customPalette.scale[100],\n '--color-primary-200': customPalette.scale[200],\n '--color-primary-300': customPalette.scale[300],\n '--color-primary-400': customPalette.scale[400],\n '--color-primary-500': customPalette.scale[500],\n '--color-primary-600': customPalette.scale[600],\n '--color-primary-700': customPalette.scale[700],\n '--color-primary-800': customPalette.scale[800],\n '--color-primary-900': customPalette.scale[900],\n\n // Override secondary color if provided (advanced mode)\n ...(customPalette.secondary && {\n '--color-secondary': customPalette.secondary,\n '--color-secondary-foreground': customPalette.secondaryForeground || baseTokens['--color-secondary-foreground'],\n }),\n\n // Override accent color if provided (advanced mode)\n ...(customPalette.accent && {\n '--color-accent': customPalette.accent,\n '--color-accent-foreground': customPalette.accentForeground || baseTokens['--color-accent-foreground'],\n }),\n\n // Apply ALL derived tokens from dependency graph\n // This automatically updates:\n // - Links (--color-link, --color-link-hover)\n // - Focus rings (--color-ring)\n // - Charts (--chart-1, --chart-2, --chart-3, --chart-4, --chart-5)\n // - Buttons, badges, and any other dependent tokens\n ...customPalette.derivedTokens,\n };\n}\n\nexport function ThemeProvider({ children }: { children: React.ReactNode }) {\n const { theme, mode } = useThemeStore();\n // Use specific selector to get the exact palette for current theme/mode\n // This fixes the issue where full object subscription might miss updates or cause hydration issues\n const customPalette = useCustomizer((state) => state.customColors?.[theme]?.[mode]);\n\n const [isTransitioning, setIsTransitioning] = useState(false);\n const [mounted, setMounted] = useState(false);\n\n // Prevent hydration mismatch\n useEffect(() => {\n setMounted(true);\n }, []);\n\n // Apply theme variables with transition\n useEffect(() => {\n if (!mounted) return;\n\n // Start transition\n setIsTransitioning(true);\n\n // Apply theme vars to :root\n const root = document.documentElement;\n\n // 1. Get base theme tokens\n const baseTokens = getThemeVars(theme, mode);\n\n // 2. Custom palette is now derived directly from store selector\n\n // DEBUG: Log the values to diagnose mismatch\n console.log('[ThemeProvider] Update:', {\n theme,\n mode,\n hasCustomPalette: !!customPalette,\n customPrimary: customPalette?.primary,\n timestamp: new Date().toISOString()\n });\n\n // 3. Merge tokens (custom overrides base)\n const finalTokens = customPalette\n ? mergeCustomColorTokens(baseTokens, customPalette)\n : baseTokens;\n\n // Apply transition class\n root.classList.add('theme-transitioning');\n\n // Apply CSS variables IMMEDIATELY (no requestAnimationFrame delay)\n Object.entries(finalTokens).forEach(([key, value]) => {\n root.style.setProperty(key, value);\n });\n\n // Set data attributes for theme and mode\n root.setAttribute('data-theme', theme);\n root.setAttribute('data-mode', mode);\n root.setAttribute('data-custom-colors', customPalette ? 'active' : 'default');\n\n // Toggle 'dark' class for Tailwind dark: modifier support\n if (mode === 'dark') {\n root.classList.add('dark');\n } else {\n root.classList.remove('dark');\n }\n\n // End transition after animation completes\n const timeout = setTimeout(() => {\n root.classList.remove('theme-transitioning');\n setIsTransitioning(false);\n }, 400); // 400ms = 300ms transition + 100ms buffer\n\n return () => clearTimeout(timeout);\n }, [theme, mode, mounted, customPalette]);\n\n // Don't render children until mounted (prevents flash)\n if (!mounted) {\n return null;\n }\n\n return <>{children}</>;\n}\n","/**\n * Theme Store\n * Manages theme and color mode state with localStorage persistence\n */\n\nimport { create } from 'zustand';\nimport { persist } from 'zustand/middleware';\nimport type { ThemeName, ColorMode } from '@thesage/tokens';\n\n// Re-export types for convenience\nexport type { ThemeName, ColorMode };\n\ninterface ThemeState {\n // Current theme and mode\n theme: ThemeName;\n mode: ColorMode;\n\n // Actions\n setTheme: (theme: ThemeName) => void;\n setMode: (mode: ColorMode) => void;\n toggleMode: () => void;\n\n // Computed\n themeConfig: { name: ThemeName; mode: ColorMode };\n}\n\nexport const useThemeStore = create<ThemeState>()(\n persist(\n (set, get) => ({\n // Defaults\n theme: 'volt',\n mode: 'dark',\n\n // Actions\n setTheme: (theme) => set({ theme }),\n setMode: (mode) => set({ mode }),\n toggleMode: () =>\n set((state) => ({ mode: state.mode === 'light' ? 'dark' : 'light' })),\n\n // Computed\n get themeConfig() {\n const state = get();\n return { name: state.theme, mode: state.mode };\n },\n }),\n {\n name: 'ecosystem-theme',\n // Only persist theme and mode\n partialize: (state) => ({\n theme: state.theme,\n mode: state.mode,\n }),\n }\n )\n);\n","import { create } from 'zustand';\nimport { persist } from 'zustand/middleware';\nimport { computeDerivedTokens, type FontTheme } from '@thesage/tokens';\nimport {\n generateColorScale,\n getOptimalForeground,\n} from '../colors';\n\nexport type CustomizationMode = 'simple' | 'advanced';\n\nexport interface ColorPalette {\n /* Metadata */\n name?: string; // Name of the source palette\n description?: string; // Description of the source palette\n\n /* Colors */\n primary: string; // Base hex\n primaryForeground: string; // Calculated contrast\n secondary?: string; // Optional secondary color\n secondaryForeground?: string; // Calculated contrast\n accent?: string; // Optional accent color\n accentForeground?: string; // Calculated contrast\n scale: Record<number, string>; // 50-900 tints/shades\n derivedTokens: Record<string, string>; // Computed dependent tokens\n}\n\nexport interface SavedPalette {\n id: string; // Unique ID\n name: string; // User-defined name\n description: string; // Palette description\n primary: string; // Primary color hex\n accent: string; // Accent color hex\n secondary?: string; // Optional secondary color\n category: 'custom'; // Always 'custom' for user palettes\n wcagAA: boolean; // Calculated accessibility\n wcagAAA: boolean; // Calculated accessibility\n createdAt: number; // Timestamp\n mood: string[]; // Mood tags\n bestFor?: string[]; // Best use cases\n harmony?: string;\n rationale?: string;\n}\n\nexport interface SavedFontTheme extends FontTheme {\n id: string; // Unique ID (overrides FontTheme.id)\n createdAt: number; // Timestamp\n category: 'custom'; // Always 'custom' for user font themes\n}\n\nexport interface ColorCustomization {\n mode: CustomizationMode;\n palette: ColorPalette | null;\n}\n\nexport type ThemeName = 'studio' | 'sage' | 'volt';\nexport type ColorMode = 'light' | 'dark';\n\ninterface CustomizerState {\n // Motion settings\n motion: number; // 0-10\n prefersReducedMotion: boolean;\n\n // Color customization\n customizationMode: CustomizationMode;\n customColors: {\n [theme in ThemeName]?: {\n [mode in ColorMode]?: ColorPalette;\n };\n };\n\n // Saved custom palettes\n savedPalettes: SavedPalette[];\n\n // Font theme customization\n customFontThemes: {\n [theme in ThemeName]?: {\n [mode in ColorMode]?: FontTheme;\n };\n };\n\n // Saved custom font themes\n savedFontThemes: SavedFontTheme[];\n\n // Motion actions\n setMotion: (level: number) => void;\n setPrefersReducedMotion: (value: boolean) => void;\n\n // Color customization actions\n setCustomizationMode: (mode: CustomizationMode) => void;\n\n setCustomPrimaryColor: (\n theme: ThemeName,\n mode: ColorMode,\n hexColor: string\n ) => void;\n\n setCustomSecondaryColor: (\n theme: ThemeName,\n mode: ColorMode,\n hexColor: string\n ) => void;\n\n setCustomAccentColor: (\n theme: ThemeName,\n mode: ColorMode,\n hexColor: string\n ) => void;\n\n applyColorPalette: (\n theme: ThemeName,\n mode: ColorMode,\n colors: {\n primary: string;\n secondary?: string;\n accent?: string;\n name?: string;\n description?: string;\n }\n ) => void;\n\n resetCustomColors: (theme: ThemeName, mode?: ColorMode) => void;\n\n getActiveColorPalette: (theme: ThemeName, mode: ColorMode) => ColorPalette | null;\n\n // Saved palette actions\n savePalette: (palette: Omit<SavedPalette, 'id' | 'createdAt' | 'category'>) => void;\n updatePalette: (id: string, updates: Partial<SavedPalette>) => void;\n renamePalette: (id: string, newName: string) => void;\n deletePalette: (id: string) => void;\n reorderPalettes: (palettes: SavedPalette[]) => void;\n getSavedPalettes: () => SavedPalette[];\n\n // Font theme actions\n applyFontTheme: (\n theme: ThemeName,\n mode: ColorMode,\n fontTheme: FontTheme\n ) => void;\n\n resetCustomFonts: (theme: ThemeName, mode?: ColorMode) => void;\n\n getActiveFontTheme: (theme: ThemeName, mode: ColorMode) => FontTheme | null;\n\n // Saved font theme actions\n saveFontTheme: (fontTheme: Omit<SavedFontTheme, 'id' | 'createdAt' | 'category'>) => void;\n updateFontTheme: (id: string, updates: Partial<SavedFontTheme>) => void;\n renameFontTheme: (id: string, newName: string) => void;\n deleteFontTheme: (id: string) => void;\n reorderFontThemes: (fontThemes: SavedFontTheme[]) => void;\n getSavedFontThemes: () => SavedFontTheme[];\n}\n\nexport const useCustomizer = create<CustomizerState>()(\n persist(\n (set, get) => ({\n motion: 5,\n prefersReducedMotion: false,\n customizationMode: 'simple',\n customColors: {},\n savedPalettes: [],\n customFontThemes: {},\n savedFontThemes: [],\n\n setMotion: (level) => set({ motion: level }),\n setPrefersReducedMotion: (value) => set({ prefersReducedMotion: value }),\n setCustomizationMode: (mode) => set({ customizationMode: mode }),\n\n setCustomPrimaryColor: (theme, mode, hexColor) => {\n const state = get();\n const currentPalette = state.customColors[theme]?.[mode];\n\n // Generate complete color palette\n const scale = generateColorScale(hexColor);\n const primaryForeground = getOptimalForeground(hexColor);\n\n // Compute all derived tokens based on dependency graph\n const derivedTokens = computeDerivedTokens('--color-primary', hexColor, mode);\n\n // In simple mode, generate secondary/accent from primary\n const isSimple = state.customizationMode === 'simple';\n\n const palette: ColorPalette = {\n primary: hexColor,\n primaryForeground,\n secondary: isSimple ? undefined : currentPalette?.secondary,\n secondaryForeground: isSimple ? undefined : currentPalette?.secondaryForeground,\n accent: isSimple ? undefined : currentPalette?.accent,\n accentForeground: isSimple ? undefined : currentPalette?.accentForeground,\n scale,\n derivedTokens,\n };\n\n set((state) => ({\n customColors: {\n ...state.customColors,\n [theme]: {\n ...state.customColors[theme],\n [mode]: palette,\n },\n },\n }));\n },\n\n setCustomSecondaryColor: (theme, mode, hexColor) => {\n const state = get();\n const currentPalette = state.customColors[theme]?.[mode];\n\n if (!currentPalette) return;\n\n const secondaryForeground = getOptimalForeground(hexColor);\n const derivedTokens = computeDerivedTokens('--color-secondary', hexColor, mode);\n\n set((state) => ({\n customColors: {\n ...state.customColors,\n [theme]: {\n ...state.customColors[theme],\n [mode]: {\n ...currentPalette,\n secondary: hexColor,\n secondaryForeground,\n derivedTokens: {\n ...currentPalette.derivedTokens,\n ...derivedTokens,\n },\n },\n },\n },\n }));\n },\n\n setCustomAccentColor: (theme, mode, hexColor) => {\n const state = get();\n const currentPalette = state.customColors[theme]?.[mode];\n\n if (!currentPalette) return;\n\n const accentForeground = getOptimalForeground(hexColor);\n const derivedTokens = computeDerivedTokens('--color-accent', hexColor, mode);\n\n set((state) => ({\n customColors: {\n ...state.customColors,\n [theme]: {\n ...state.customColors[theme],\n [mode]: {\n ...currentPalette,\n accent: hexColor,\n accentForeground,\n derivedTokens: {\n ...currentPalette.derivedTokens,\n ...derivedTokens,\n },\n },\n },\n },\n }));\n },\n\n applyColorPalette: (theme, mode, colors: {\n primary: string;\n secondary?: string;\n accent?: string;\n name?: string;\n description?: string;\n }) => {\n // Generate complete color palette with all three colors in a single atomic update\n const scale = generateColorScale(colors.primary);\n const primaryForeground = getOptimalForeground(colors.primary);\n\n // Compute all derived tokens\n let derivedTokens = computeDerivedTokens('--color-primary', colors.primary, mode);\n\n // Add secondary color if provided\n let secondary = colors.secondary;\n let secondaryForeground = secondary ? getOptimalForeground(secondary) : undefined;\n if (secondary) {\n const secondaryDerived = computeDerivedTokens('--color-secondary', secondary, mode);\n derivedTokens = { ...derivedTokens, ...secondaryDerived };\n }\n\n // Add accent color if provided\n let accent = colors.accent;\n let accentForeground = accent ? getOptimalForeground(accent) : undefined;\n if (accent) {\n const accentDerived = computeDerivedTokens('--color-accent', accent, mode);\n derivedTokens = { ...derivedTokens, ...accentDerived };\n }\n\n const palette: ColorPalette = {\n name: colors.name,\n description: colors.description,\n primary: colors.primary,\n primaryForeground,\n secondary,\n secondaryForeground,\n accent,\n accentForeground,\n scale,\n derivedTokens,\n };\n\n set((state) => ({\n customColors: {\n ...state.customColors,\n [theme]: {\n ...state.customColors[theme],\n [mode]: palette,\n },\n },\n }));\n },\n\n resetCustomColors: (theme, mode) => {\n if (mode) {\n // Reset specific mode\n set((state) => ({\n customColors: {\n ...state.customColors,\n [theme]: {\n ...state.customColors[theme],\n [mode]: undefined,\n },\n },\n }));\n } else {\n // Reset entire theme\n set((state) => {\n const { [theme]: _, ...rest } = state.customColors;\n return { customColors: rest };\n });\n }\n },\n\n getActiveColorPalette: (theme, mode) => {\n return get().customColors[theme]?.[mode] || null;\n },\n\n // Saved palette management\n savePalette: (paletteData) => {\n const id = `custom-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;\n const newPalette: SavedPalette = {\n ...paletteData,\n id,\n category: 'custom',\n createdAt: Date.now(),\n };\n\n set((state) => ({\n savedPalettes: [...state.savedPalettes, newPalette],\n }));\n },\n\n updatePalette: (id, updates) => {\n set((state) => ({\n savedPalettes: state.savedPalettes.map((p) =>\n p.id === id ? { ...p, ...updates } : p\n ),\n }));\n },\n\n renamePalette: (id, newName) => {\n set((state) => ({\n savedPalettes: state.savedPalettes.map((p) =>\n p.id === id ? { ...p, name: newName } : p\n ),\n }));\n },\n\n deletePalette: (id) => {\n set((state) => ({\n savedPalettes: state.savedPalettes.filter((p) => p.id !== id),\n }));\n },\n\n reorderPalettes: (palettes) => {\n set({ savedPalettes: palettes });\n },\n\n getSavedPalettes: () => {\n return get().savedPalettes;\n },\n\n // Font theme management\n applyFontTheme: (theme, mode, fontTheme) => {\n set((state) => ({\n customFontThemes: {\n ...state.customFontThemes,\n [theme]: {\n ...state.customFontThemes[theme],\n [mode]: fontTheme,\n },\n },\n }));\n },\n\n resetCustomFonts: (theme, mode) => {\n if (mode) {\n // Reset specific mode\n set((state) => ({\n customFontThemes: {\n ...state.customFontThemes,\n [theme]: {\n ...state.customFontThemes[theme],\n [mode]: undefined,\n },\n },\n }));\n } else {\n // Reset entire theme\n set((state) => {\n const { [theme]: _, ...rest } = state.customFontThemes;\n return { customFontThemes: rest };\n });\n }\n },\n\n getActiveFontTheme: (theme, mode) => {\n return get().customFontThemes[theme]?.[mode] || null;\n },\n\n // Saved font theme management\n saveFontTheme: (fontThemeData) => {\n const id = `font-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;\n const newFontTheme: SavedFontTheme = {\n ...fontThemeData,\n id,\n category: 'custom',\n createdAt: Date.now(),\n isCustom: true,\n };\n\n set((state) => ({\n savedFontThemes: [...state.savedFontThemes, newFontTheme],\n }));\n },\n\n updateFontTheme: (id, updates) => {\n set((state) => ({\n savedFontThemes: state.savedFontThemes.map((ft) =>\n ft.id === id ? { ...ft, ...updates } : ft\n ),\n }));\n },\n\n renameFontTheme: (id, newName) => {\n set((state) => ({\n savedFontThemes: state.savedFontThemes.map((ft) =>\n ft.id === id ? { ...ft, name: newName } : ft\n ),\n }));\n },\n\n deleteFontTheme: (id) => {\n set((state) => ({\n savedFontThemes: state.savedFontThemes.filter((ft) => ft.id !== id),\n }));\n },\n\n reorderFontThemes: (fontThemes) => {\n set({ savedFontThemes: fontThemes });\n },\n\n getSavedFontThemes: () => {\n return get().savedFontThemes;\n },\n }),\n {\n name: 'ecosystem-customizer',\n version: 4,\n partialize: (state) => ({\n motion: state.motion,\n prefersReducedMotion: state.prefersReducedMotion,\n customizationMode: state.customizationMode,\n customColors: state.customColors,\n savedPalettes: state.savedPalettes,\n customFontThemes: state.customFontThemes,\n savedFontThemes: state.savedFontThemes,\n }),\n }\n )\n);\n","/**\n * Base Design Tokens\n * Shared across all themes (spacing, typography scales, motion)\n */\n\nexport const baseTokens = {\n /**\n * Spacing scale (based on 4px grid)\n */\n spacing: {\n '0': '0',\n '0.5': '0.125rem', // 2px\n '1': '0.25rem', // 4px\n '2': '0.5rem', // 8px\n '3': '0.75rem', // 12px\n '4': '1rem', // 16px\n '5': '1.25rem', // 20px\n '6': '1.5rem', // 24px\n '8': '2rem', // 32px\n '10': '2.5rem', // 40px\n '12': '3rem', // 48px\n '16': '4rem', // 64px\n '20': '5rem', // 80px\n '24': '6rem', // 96px\n '32': '8rem', // 128px\n },\n\n /**\n * Typography scales\n */\n fontSize: {\n 'xs': '0.75rem', // 12px\n 'sm': '0.875rem', // 14px\n 'base': '1rem', // 16px\n 'lg': '1.125rem', // 18px\n 'xl': '1.25rem', // 20px\n '2xl': '1.5rem', // 24px\n '3xl': '1.875rem', // 30px\n '4xl': '2.25rem', // 36px\n '5xl': '3rem', // 48px\n '6xl': '3.75rem', // 60px\n '7xl': '4.5rem', // 72px\n '8xl': '6rem', // 96px\n },\n\n fontWeight: {\n light: '300',\n normal: '400',\n medium: '500',\n semibold: '600',\n bold: '700',\n extrabold: '800',\n black: '900',\n },\n\n lineHeight: {\n none: '1',\n tight: '1.25',\n snug: '1.375',\n normal: '1.5',\n relaxed: '1.625',\n loose: '2',\n },\n\n /**\n * Border radius\n */\n borderRadius: {\n none: '0',\n sm: '0.125rem', // 2px\n DEFAULT: '0.25rem', // 4px\n md: '0.375rem', // 6px\n lg: '0.5rem', // 8px\n xl: '0.75rem', // 12px\n '2xl': '1rem', // 16px\n '3xl': '1.5rem', // 24px\n full: '9999px',\n },\n\n /**\n * Motion durations (base values - themes can override)\n */\n duration: {\n instant: '0ms',\n fast: '150ms',\n normal: '300ms',\n slow: '500ms',\n slower: '800ms',\n },\n\n /**\n * Easing curves (base values - themes can override)\n */\n ease: {\n linear: 'linear',\n in: 'cubic-bezier(0.4, 0, 1, 1)',\n out: 'cubic-bezier(0, 0, 0.2, 1)',\n inOut: 'cubic-bezier(0.4, 0, 0.2, 1)',\n },\n\n /**\n * Z-index scale\n */\n zIndex: {\n 'auto': 'auto',\n '0': '0',\n '10': '10',\n '20': '20',\n '30': '30',\n '40': '40',\n '50': '50',\n dropdown: '1000',\n sticky: '1020',\n fixed: '1030',\n modalBackdrop: '1040',\n modal: '1050',\n popover: '1060',\n tooltip: '1070',\n },\n\n /**\n * Focus ring configuration\n */\n focus: {\n width: '2px',\n offset: '2px',\n style: 'solid',\n },\n} as const;\n\nexport type BaseTokens = typeof baseTokens;\n\n/**\n * Semantic spacing aliases\n * Provides human-readable names matching the README documentation\n */\nexport const spacing = {\n xs: baseTokens.spacing['1'], // 4px — Tight internal padding\n sm: baseTokens.spacing['2'], // 8px — Default gap\n md: baseTokens.spacing['4'], // 16px — Section padding\n lg: baseTokens.spacing['6'], // 24px — Card padding\n xl: baseTokens.spacing['8'], // 32px — Section margins\n '2xl': baseTokens.spacing['12'], // 48px — Page sections\n '3xl': baseTokens.spacing['16'], // 64px — Major divisions\n} as const;\n\n/**\n * Semantic typography aliases\n */\nexport const typography = {\n fonts: {\n sans: 'var(--font-body)',\n serif: 'var(--font-heading)',\n mono: 'var(--font-mono)',\n },\n sizes: {\n xs: baseTokens.fontSize.xs, // 12px — Fine print\n sm: baseTokens.fontSize.sm, // 14px — Secondary text\n base: baseTokens.fontSize.base, // 16px — Body text\n lg: baseTokens.fontSize.lg, // 18px — Lead paragraphs\n xl: baseTokens.fontSize.xl, // 20px — Section headers\n '2xl': baseTokens.fontSize['2xl'], // 24px — Page headers\n '3xl': baseTokens.fontSize['3xl'], // 30px — Hero text\n },\n weights: {\n normal: baseTokens.fontWeight.normal, // 400\n medium: baseTokens.fontWeight.medium, // 500\n semibold: baseTokens.fontWeight.semibold, // 600\n bold: baseTokens.fontWeight.bold, // 700\n },\n leading: {\n tight: baseTokens.lineHeight.tight, // 1.25 — Headings\n normal: baseTokens.lineHeight.normal, // 1.5 — Body\n relaxed: baseTokens.lineHeight.relaxed, // 1.625 — Spacious reading\n },\n} as const;\n\n/**\n * Motion configuration\n */\nexport const motion = {\n duration: baseTokens.duration,\n easing: {\n default: baseTokens.ease.out, // Most transitions\n spring: 'cubic-bezier(0.16, 1, 0.3, 1)', // Playful interactions\n linear: baseTokens.ease.linear, // Progress indicators\n },\n} as const;\n","/**\n * Studio Theme Tokens\n * Professional, polished, balanced design\n * Inspiration: Framer, Vercel, Linear\n */\n\nexport const studioTokens = {\n light: {\n colors: {\n // Backgrounds\n background: '#ffffff',\n backgroundSecondary: '#fafafa',\n backgroundTertiary: '#f5f5f5',\n\n // Foregrounds\n foreground: '#0a0a0a',\n foregroundSecondary: '#525252',\n foregroundTertiary: '#a3a3a3',\n\n // Brand\n primary: '#0a0a0a',\n primaryForeground: '#ffffff',\n\n secondary: '#f5f5f5',\n secondaryForeground: '#0a0a0a',\n\n accent: '#0070f3',\n accentForeground: '#ffffff',\n\n // Borders\n border: '#d4d4d4',\n borderSubtle: '#f5f5f5',\n\n // States\n hover: '#fafafa',\n active: '#f0f0f0',\n\n // Link hover states\n linkHover: '#0a0a0a',\n linkHoverForeground: '#ffffff',\n\n // Semantic\n success: '#00a86b',\n successForeground: '#ffffff',\n\n warning: '#f59e0b',\n warningForeground: '#ffffff',\n\n error: '#ef4444',\n errorForeground: '#ffffff',\n\n info: '#0070f3',\n infoForeground: '#ffffff',\n\n // Component-specific colors\n card: '#ffffff',\n cardForeground: '#0a0a0a',\n\n popover: '#ffffff',\n popoverForeground: '#0a0a0a',\n\n muted: '#f5f5f5',\n mutedForeground: '#737373',\n\n destructive: '#ef4444',\n destructiveForeground: '#ffffff',\n\n input: '#d4d4d4',\n ring: '#0a0a0a',\n\n // Surface is used by various components\n surface: '#fafafa',\n\n // Glass effects\n glass: 'rgba(255, 255, 255, 0.7)',\n glassBorder: 'rgba(0, 0, 0, 0.1)',\n },\n\n effects: {\n blur: {\n sm: 'blur(4px)',\n md: 'blur(8px)',\n lg: 'blur(16px)',\n xl: 'blur(24px)',\n },\n\n shadow: {\n sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n md: '0 4px 6px -1px rgba(0, 0, 0, 0.1)',\n lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1)',\n xl: '0 20px 25px -5px rgba(0, 0, 0, 0.1)',\n '2xl': '0 25px 50px -12px rgba(0, 0, 0, 0.25)',\n },\n },\n },\n\n dark: {\n colors: {\n // Backgrounds\n background: '#000000',\n backgroundSecondary: '#171717',\n backgroundTertiary: '#262626',\n\n // Foregrounds\n foreground: '#fafafa',\n foregroundSecondary: '#a3a3a3',\n foregroundTertiary: '#858585',\n\n // Brand\n primary: '#ffffff',\n primaryForeground: '#0a0a0a',\n\n secondary: '#262626',\n secondaryForeground: '#fafafa',\n\n accent: '#0090ff',\n accentForeground: '#ffffff',\n\n // Borders\n border: '#404040',\n borderSubtle: '#1a1a1a',\n\n // States\n hover: '#1a1a1a',\n active: '#262626',\n\n // Link hover states\n linkHover: '#ffffff',\n linkHoverForeground: '#0a0a0a',\n\n // Semantic\n success: '#10b981',\n successForeground: '#ffffff',\n\n warning: '#f59e0b',\n warningForeground: '#ffffff',\n\n error: '#ef4444',\n errorForeground: '#ffffff',\n\n info: '#0090ff',\n infoForeground: '#ffffff',\n\n // Component-specific colors\n card: '#0a0a0a',\n cardForeground: '#fafafa',\n\n popover: '#0a0a0a',\n popoverForeground: '#fafafa',\n\n muted: '#262626',\n mutedForeground: '#a3a3a3',\n\n destructive: '#ef4444',\n destructiveForeground: '#ffffff',\n\n input: '#404040',\n ring: '#d4d4d4',\n\n // Surface is used by various components\n surface: '#171717',\n\n // Glass effects\n glass: 'rgba(0, 0, 0, 0.7)',\n glassBorder: 'rgba(255, 255, 255, 0.1)',\n },\n\n effects: {\n blur: {\n sm: 'blur(4px)',\n md: 'blur(8px)',\n lg: 'blur(16px)',\n xl: 'blur(24px)',\n },\n\n shadow: {\n sm: '0 1px 2px 0 rgba(0, 0, 0, 0.3)',\n md: '0 4px 6px -1px rgba(0, 0, 0, 0.5)',\n lg: '0 10px 15px -3px rgba(0, 0, 0, 0.6)',\n xl: '0 20px 25px -5px rgba(0, 0, 0, 0.7)',\n '2xl': '0 25px 50px -12px rgba(0, 0, 0, 0.8)',\n },\n },\n },\n\n /**\n * Motion personality for Studio theme\n */\n motion: {\n // Duration scales based on motion slider (0-10)\n getDuration: (intensity: number): string => {\n if (intensity === 0) return '0ms';\n // Linear scale: 150ms at intensity 1, 500ms at intensity 10\n const ms = 150 + (intensity - 1) * 40;\n return `${ms}ms`;\n },\n\n // Easing curves - smooth and professional\n ease: {\n default: 'cubic-bezier(0.4, 0, 0.2, 1)', // ease-in-out\n in: 'cubic-bezier(0.4, 0, 1, 1)',\n out: 'cubic-bezier(0, 0, 0.2, 1)',\n spring: 'cubic-bezier(0.16, 1, 0.3, 1)', // Smooth spring\n },\n },\n\n /**\n * Typography for Studio theme\n */\n typography: {\n heading: {\n fontFamily: 'var(--font-geist-sans)',\n fontWeight: '600',\n letterSpacing: '-0.02em',\n },\n\n body: {\n fontFamily: 'var(--font-geist-sans)',\n fontWeight: '400',\n letterSpacing: '0',\n },\n\n mono: {\n fontFamily: 'var(--font-geist-mono)',\n fontWeight: '400',\n letterSpacing: '0',\n },\n },\n} as const;\n\nexport type StudioTheme = typeof studioTokens;\n","/**\n * Sage Theme Tokens\n * Calm, organic, feminine/yin design\n * Muted earth tones, flowing animations\n */\n\nexport const sageTokens = {\n light: {\n colors: {\n // Warm, earthy backgrounds\n background: '#faf8f5',\n backgroundSecondary: '#f5f1eb',\n backgroundTertiary: '#ede8e0',\n\n // Warm neutrals for text\n foreground: '#2d2823',\n foregroundSecondary: '#5a524a',\n foregroundTertiary: '#8a7f72',\n\n // Muted sage green as primary\n primary: '#7a9b7f',\n primaryForeground: '#faf8f5',\n primaryHover: '#6a8b6f',\n\n // Secondary - warm stone\n secondary: '#ede8e0',\n secondaryForeground: '#2d2823',\n\n // Warm terracotta accent\n accent: '#c17a5f',\n accentForeground: '#faf8f5',\n accentHover: '#b16a4f',\n\n // Semantic colors with muted, organic tones\n success: '#6b8e6f',\n successForeground: '#faf8f5',\n\n warning: '#d4a574',\n warningForeground: '#2d2823',\n\n error: '#c17a5f',\n errorForeground: '#faf8f5',\n\n info: '#8b9dc3',\n infoForeground: '#faf8f5',\n\n // Borders - warm subtle\n border: '#e0d8cf',\n borderSubtle: '#ede8e0',\n\n // States\n hover: '#f5f1eb',\n active: '#ede8e0',\n\n // Link hover states - Muted sage green\n linkHover: '#7a9b7f',\n linkHoverForeground: '#faf8f5',\n\n // Soft glass effects\n glass: 'rgba(250, 248, 245, 0.85)',\n glassBorder: 'rgba(122, 155, 127, 0.15)',\n },\n effects: {\n blur: {\n sm: 'blur(6px)',\n md: 'blur(12px)',\n lg: 'blur(20px)',\n xl: 'blur(32px)',\n },\n shadow: {\n sm: '0 2px 4px 0 rgba(45, 40, 35, 0.06)',\n md: '0 4px 8px -2px rgba(45, 40, 35, 0.08)',\n lg: '0 8px 16px -4px rgba(45, 40, 35, 0.12)',\n xl: '0 16px 32px -8px rgba(45, 40, 35, 0.16)',\n '2xl': '0 24px 48px -12px rgba(45, 40, 35, 0.20)',\n },\n },\n },\n\n dark: {\n colors: {\n // Deep forest backgrounds\n background: '#1a1614',\n backgroundSecondary: '#252220',\n backgroundTertiary: '#2f2b28',\n\n // Warm light text\n foreground: '#f5f1eb',\n foregroundSecondary: '#c7bfb5',\n foregroundTertiary: '#8a7f72',\n\n // Brighter sage for dark mode\n primary: '#a8c5ad',\n primaryForeground: '#1a1614',\n primaryHover: '#b8d5bd',\n\n // Secondary - lighter warm stone\n secondary: '#2f2b28',\n secondaryForeground: '#f5f1eb',\n\n // Warm peachy accent for dark\n accent: '#e5a78a',\n accentForeground: '#1a1614',\n accentHover: '#f5b79a',\n\n // Semantic colors adjusted for dark\n success: '#95b89a',\n successForeground: '#1a1614',\n\n warning: '#e5c59a',\n warningForeground: '#1a1614',\n\n error: '#e5a78a',\n errorForeground: '#1a1614',\n\n info: '#a8b5d5',\n infoForeground: '#1a1614',\n\n // Borders\n border: '#3a3530',\n borderSubtle: '#2f2b28',\n\n // States\n hover: '#252220',\n active: '#2f2b28',\n\n // Link hover states - Brighter sage for dark mode\n linkHover: '#a8c5ad',\n linkHoverForeground: '#1a1614',\n\n // Dark glass effects\n glass: 'rgba(26, 22, 20, 0.85)',\n glassBorder: 'rgba(168, 197, 173, 0.2)',\n },\n effects: {\n blur: {\n sm: 'blur(6px)',\n md: 'blur(12px)',\n lg: 'blur(20px)',\n xl: 'blur(32px)',\n },\n shadow: {\n sm: '0 2px 4px 0 rgba(0, 0, 0, 0.3)',\n md: '0 4px 8px -2px rgba(0, 0, 0, 0.4)',\n lg: '0 8px 16px -4px rgba(0, 0, 0, 0.5)',\n xl: '0 16px 32px -8px rgba(0, 0, 0, 0.6)',\n '2xl': '0 24px 48px -12px rgba(0, 0, 0, 0.7)',\n },\n },\n },\n\n motion: {\n getDuration: (intensity: number): string => {\n if (intensity === 0) return '0ms';\n // Slower, more organic durations\n const ms = 300 + (intensity - 1) * 60;\n return `${ms}ms`;\n },\n\n ease: {\n default: 'cubic-bezier(0.33, 1, 0.68, 1)', // Organic, flowing\n in: 'cubic-bezier(0.4, 0, 1, 1)',\n out: 'cubic-bezier(0, 0, 0.2, 1)',\n spring: 'cubic-bezier(0.16, 1, 0.3, 1)',\n },\n },\n\n interactions: {\n hover: {\n overlayColor: 'var(--color-interaction-overlay)',\n opacity: 'var(--opacity-interaction-hover)',\n },\n active: {\n scale: 'var(--scale-interaction-active)',\n },\n focus: {\n ringColor: 'var(--color-interaction-focus-ring)',\n ringWidth: 'var(--width-interaction-focus-ring)',\n ringOffset: 'var(--width-interaction-focus-offset)',\n },\n disabled: {\n opacity: 'var(--opacity-interaction-disabled)',\n },\n },\n\n typography: {\n heading: {\n fontFamily: 'var(--font-sage-serif)', // Lora serif\n fontWeight: '600',\n letterSpacing: '-0.01em',\n },\n\n body: {\n fontFamily: 'var(--font-sage-sans)', // Instrument Sans\n fontWeight: '400',\n letterSpacing: '0',\n },\n\n mono: {\n fontFamily: 'var(--font-sage-mono)',\n fontWeight: '400',\n letterSpacing: '0',\n },\n },\n} as const;\n\nexport type SageTheme = typeof sageTokens;\n","/**\n * Volt Theme Tokens\n * Bold, electric, masculine/yang design\n * High-chroma colors, dynamic animations, cyberpunk aesthetic\n */\n\nexport const voltTokens = {\n light: {\n colors: {\n // Bright, punchy backgrounds\n background: '#ffffff',\n backgroundSecondary: '#f8f9fb',\n backgroundTertiary: '#f0f2f5',\n\n // Sharp contrast text\n foreground: '#0a0a0a',\n foregroundSecondary: '#4a4a4a',\n foregroundTertiary: '#8a8a8a',\n\n // Electric blue primary (WCAG AA compliant)\n primary: '#0066ff',\n primaryForeground: '#ffffff',\n primaryHover: '#0052cc',\n\n // Secondary - cool gray\n secondary: '#f0f2f5',\n secondaryForeground: '#0a0a0a',\n\n // Vibrant cyan accent\n accent: '#00d9ff',\n accentForeground: '#0a0a0a',\n accentHover: '#00c3e6',\n\n // Bold semantic colors\n success: '#00cc66',\n successForeground: '#ffffff',\n\n warning: '#ffaa00',\n warningForeground: '#0a0a0a',\n\n error: '#ff3366',\n errorForeground: '#ffffff',\n\n info: '#3399ff',\n infoForeground: '#ffffff',\n\n // Borders\n border: '#e0e4ea',\n borderSubtle: '#f0f2f5',\n\n // States\n hover: '#f8f9fb',\n active: '#f0f2f5',\n\n // Link hover states - Electric blue with high contrast\n linkHover: '#0066ff',\n linkHoverForeground: '#ffffff',\n\n // Crisp glass effects\n glass: 'rgba(255, 255, 255, 0.8)',\n glassBorder: 'rgba(0, 102, 255, 0.2)',\n },\n effects: {\n blur: {\n sm: 'blur(8px)',\n md: 'blur(16px)',\n lg: 'blur(32px)',\n xl: 'blur(48px)',\n },\n shadow: {\n sm: '0 0 8px rgba(0, 102, 255, 0.15)',\n md: '0 0 16px rgba(0, 102, 255, 0.2)',\n lg: '0 0 24px rgba(0, 102, 255, 0.25)',\n xl: '0 0 32px rgba(0, 102, 255, 0.3)',\n '2xl': '0 0 48px rgba(0, 102, 255, 0.4)',\n },\n },\n },\n\n dark: {\n colors: {\n // Pure black cyberpunk background\n background: '#000000',\n backgroundSecondary: '#0a0a0a',\n backgroundTertiary: '#141414',\n\n // Bright white text\n foreground: '#ffffff',\n foregroundSecondary: '#b3b3b3',\n foregroundTertiary: '#666666',\n\n // Neon blue primary\n primary: '#0099ff',\n primaryForeground: '#000000',\n primaryHover: '#00aaff',\n\n // Secondary - dark gray\n secondary: '#141414',\n secondaryForeground: '#ffffff',\n\n // Neon cyan accent\n accent: '#00ffff',\n accentForeground: '#000000',\n accentHover: '#33ffff',\n\n // Neon semantic colors\n success: '#00ff99',\n successForeground: '#000000',\n\n warning: '#ffcc00',\n warningForeground: '#000000',\n\n error: '#ff0066',\n errorForeground: '#ffffff',\n\n info: '#66ccff',\n infoForeground: '#000000',\n\n // Borders\n border: '#1a1a1a',\n borderSubtle: '#141414',\n\n // States\n hover: '#0a0a0a',\n active: '#141414',\n\n // Link hover states - Neon cyan (high luma)\n linkHover: '#00ffff',\n linkHoverForeground: '#000000',\n\n // Dark glass with glow\n glass: 'rgba(0, 0, 0, 0.8)',\n glassBorder: 'rgba(0, 153, 255, 0.3)',\n },\n effects: {\n blur: {\n sm: 'blur(8px)',\n md: 'blur(16px)',\n lg: 'blur(32px)',\n xl: 'blur(48px)',\n },\n shadow: {\n sm: '0 0 12px rgba(0, 153, 255, 0.4)',\n md: '0 0 20px rgba(0, 153, 255, 0.5)',\n lg: '0 0 32px rgba(0, 153, 255, 0.6)',\n xl: '0 0 48px rgba(0, 153, 255, 0.7)',\n '2xl': '0 0 64px rgba(0, 153, 255, 0.8)',\n },\n },\n },\n\n motion: {\n getDuration: (intensity: number): string => {\n if (intensity === 0) return '0ms';\n // Fast, snappy durations\n const ms = 100 + (intensity - 1) * 25;\n return `${ms}ms`;\n },\n\n ease: {\n default: 'cubic-bezier(0.16, 1, 0.3, 1)', // Snappy spring\n in: 'cubic-bezier(0.4, 0, 1, 1)',\n out: 'cubic-bezier(0, 0, 0.2, 1)',\n spring: 'cubic-bezier(0.68, -0.55, 0.27, 1.55)', // Bouncy\n },\n },\n\n typography: {\n heading: {\n fontFamily: 'var(--font-volt-sans)', // Space Grotesk\n fontWeight: '700', // Bold\n letterSpacing: '-0.03em',\n },\n\n body: {\n fontFamily: 'var(--font-volt-sans)',\n fontWeight: '400',\n letterSpacing: '0',\n },\n\n mono: {\n fontFamily: 'var(--font-volt-mono)', // Fira Code\n fontWeight: '400',\n letterSpacing: '0',\n },\n },\n} as const;\n\nexport type VoltTheme = typeof voltTokens;\n","/**\n * Typography Tokens\n *\n * Central typography system for the design system.\n * Defines font families, sizes, weights, line heights, and letter spacing.\n *\n * Architecture:\n * - Font families are theme-specific and loaded via Next.js font optimization\n * - Sizes, weights, etc. are universal across all themes\n * - Easily extensible for new themes/font sets\n *\n * Usage:\n * 1. Import in theme-specific apps to load fonts\n * 2. Reference via CSS variables (--font-*, --text-*, etc.)\n * 3. Add to Customizer for theme switching\n */\n\n// ============================================================================\n// FONT FAMILIES\n// ============================================================================\n\n/**\n * Font Family Definitions\n *\n * Each theme has its own font personality:\n * - Studio: Modern, geometric, professional\n * - Sage: Elegant, serif + sans combo\n * - Volt: Tech-forward, consistent throughout\n *\n * To add a new theme:\n * 1. Add entry to fontFamilies\n * 2. Load fonts in consuming app's layout\n * 3. Map to CSS variables in ThemeProvider\n */\nexport const fontFamilies = {\n studio: {\n heading: 'Outfit',\n body: 'Manrope',\n mono: 'Fira Code',\n description: 'Modern geometric sans-serif with clean readability',\n usage: {\n heading: 'Headlines, titles, emphasis',\n body: 'Paragraphs, UI text, readable content',\n mono: 'Code blocks, technical content',\n },\n },\n sage: {\n heading: 'Lora', // Serif for elegance\n body: 'Instrument Sans',\n serif: 'Lora', // Explicit serif reference\n sans: 'Instrument Sans', // Explicit sans reference\n mono: 'Fira Code',\n description: 'Elegant serif headings with modern sans body',\n usage: {\n heading: 'Elegant headings, article titles',\n body: 'Long-form content, UI text',\n serif: 'Pull quotes, emphasis',\n sans: 'UI elements, captions',\n mono: 'Code blocks, technical content',\n },\n },\n volt: {\n heading: 'Space Grotesk',\n body: 'Space Grotesk',\n sans: 'Space Grotesk',\n mono: 'Fira Code',\n description: 'Tech-forward, consistent geometric throughout',\n usage: {\n heading: 'All headlines',\n body: 'All body text (unified typography)',\n sans: 'All sans-serif needs',\n mono: 'Code blocks, technical content',\n },\n },\n} as const;\n\n/**\n * Type-safe theme names based on font families\n */\nexport type TypographyTheme = keyof typeof fontFamilies;\n\n/**\n * Font loading configuration for Next.js\n * Use this to load fonts in app layouts\n */\nexport const fontLoadingConfig = {\n studio: {\n heading: { family: 'Outfit', weights: ['300', '400', '500', '600', '700', '800'] },\n body: { family: 'Manrope', weights: ['300', '400', '500', '600', '700', '800'] },\n mono: { family: 'Fira Code', weights: ['400', '500', '600', '700'] },\n },\n sage: {\n heading: { family: 'Lora', weights: ['400', '500', '600', '700'] },\n body: { family: 'Instrument Sans', weights: ['400', '500', '600', '700'] },\n mono: { family: 'Fira Code', weights: ['400', '500', '600', '700'] },\n },\n volt: {\n heading: { family: 'Space Grotesk', weights: ['300', '400', '500', '600', '700'] },\n body: { family: 'Space Grotesk', weights: ['300', '400', '500', '600', '700'] },\n mono: { family: 'Fira Code', weights: ['400', '500', '600', '700'] },\n },\n} as const;\n\n// ============================================================================\n// FONT SIZES\n// ============================================================================\n\n/**\n * Font Size Scale\n *\n * Based on a modular scale for harmonious typography.\n * Mobile-first with responsive scaling.\n *\n * Naming convention:\n * - xs, sm, base, lg, xl, 2xl, etc. for body text\n * - Numeric for headings (aligns with h1-h6)\n */\nexport const fontSizes = {\n // Body text scale\n xs: { base: '0.75rem', mobile: '0.75rem' }, // 12px\n sm: { base: '0.875rem', mobile: '0.875rem' }, // 14px\n base: { base: '1rem', mobile: '1rem' }, // 16px\n lg: { base: '1.125rem', mobile: '1rem' }, // 18px / 16px mobile\n xl: { base: '1.25rem', mobile: '1.125rem' }, // 20px / 18px mobile\n '2xl': { base: '1.5rem', mobile: '1.25rem' }, // 24px / 20px mobile\n '3xl': { base: '1.875rem', mobile: '1.5rem' }, // 30px / 24px mobile\n\n // Heading scale (h6 → h1)\n '4xl': { base: '2.25rem', mobile: '1.875rem' }, // 36px / 30px - h3\n '5xl': { base: '3rem', mobile: '2.25rem' }, // 48px / 36px - h2\n '6xl': { base: '3.75rem', mobile: '2.5rem' }, // 60px / 40px - h1\n '7xl': { base: '4.5rem', mobile: '3rem' }, // 72px / 48px - Display\n '8xl': { base: '6rem', mobile: '3.75rem' }, // 96px / 60px - Hero\n '9xl': { base: '8rem', mobile: '4.5rem' }, // 128px / 72px - Ultra\n} as const;\n\n/**\n * Semantic font size mappings\n * Maps semantic names to scale values\n */\nexport const semanticSizes = {\n 'heading-1': 'hero',\n 'heading-2': '5xl',\n 'heading-3': '4xl',\n 'heading-4': '2xl',\n 'heading-5': 'xl',\n 'heading-6': 'lg',\n 'body-large': 'lg',\n 'body': 'base',\n 'body-small': 'sm',\n 'caption': 'xs',\n} as const;\n\n// ============================================================================\n// FONT WEIGHTS\n// ============================================================================\n\n/**\n * Font Weight Scale\n *\n * Standard numeric weights with semantic aliases.\n * Not all fonts support all weights - check font-specific availability.\n */\nexport const fontWeights = {\n thin: '100',\n extralight: '200',\n light: '300',\n normal: '400',\n medium: '500',\n semibold: '600',\n bold: '700',\n extrabold: '800',\n black: '900',\n} as const;\n\n/**\n * Semantic weight mappings\n */\nexport const semanticWeights = {\n heading: 'bold', // Default heading weight\n 'heading-light': 'semibold',\n 'heading-heavy': 'extrabold',\n body: 'normal', // Default body weight\n 'body-emphasis': 'medium',\n 'body-strong': 'semibold',\n caption: 'normal',\n} as const;\n\n// ============================================================================\n// LINE HEIGHTS\n// ============================================================================\n\n/**\n * Line Height Scale\n *\n * Unitless values for better scalability.\n * Tighter for headings, relaxed for body text.\n */\nexport const lineHeights = {\n none: '1',\n tight: '1.25',\n snug: '1.375',\n normal: '1.5',\n relaxed: '1.625',\n loose: '1.75',\n extraloose: '2',\n} as const;\n\n/**\n * Semantic line height mappings\n */\nexport const semanticLineHeights = {\n heading: 'tight',\n 'heading-display': 'none', // Very tight for large display text\n body: 'normal',\n 'body-relaxed': 'relaxed',\n caption: 'snug',\n} as const;\n\n// ============================================================================\n// LETTER SPACING\n// ============================================================================\n\n/**\n * Letter Spacing (Tracking) Scale\n *\n * In ems for scalability across font sizes.\n * Negative for headings, positive for small caps.\n */\nexport const letterSpacing = {\n tighter: '-0.05em',\n tight: '-0.025em',\n normal: '0',\n wide: '0.025em',\n wider: '0.05em',\n widest: '0.1em',\n} as const;\n\n/**\n * Semantic letter spacing mappings\n */\nexport const semanticLetterSpacing = {\n heading: 'tight',\n 'heading-display': 'tighter',\n body: 'normal',\n 'small-caps': 'wider',\n 'all-caps': 'widest',\n} as const;\n\n// ============================================================================\n// TYPE SCALE PRESETS\n// ============================================================================\n\n/**\n * Complete typography presets for common use cases\n * Combines size, weight, line-height, and letter-spacing\n *\n * Usage: Apply entire preset to a component\n */\nexport const typePresets = {\n 'display-large': {\n size: fontSizes['8xl'],\n weight: fontWeights.bold,\n lineHeight: lineHeights.none,\n letterSpacing: letterSpacing.tighter,\n description: 'Large hero text, landing pages',\n },\n 'display': {\n size: fontSizes['7xl'],\n weight: fontWeights.bold,\n lineHeight: lineHeights.tight,\n letterSpacing: letterSpacing.tight,\n description: 'Hero sections, major headings',\n },\n 'heading-1': {\n size: fontSizes['6xl'],\n weight: fontWeights.bold,\n lineHeight: lineHeights.tight,\n letterSpacing: letterSpacing.tight,\n description: 'Page titles, h1',\n },\n 'heading-2': {\n size: fontSizes['5xl'],\n weight: fontWeights.bold,\n lineHeight: lineHeights.tight,\n letterSpacing: letterSpacing.normal,\n description: 'Section titles, h2',\n },\n 'heading-3': {\n size: fontSizes['4xl'],\n weight: fontWeights.semibold,\n lineHeight: lineHeights.snug,\n letterSpacing: letterSpacing.normal,\n description: 'Subsection titles, h3',\n },\n 'heading-4': {\n size: fontSizes['2xl'],\n weight: fontWeights.semibold,\n lineHeight: lineHeights.snug,\n letterSpacing: letterSpacing.normal,\n description: 'Component titles, h4',\n },\n 'heading-5': {\n size: fontSizes.xl,\n weight: fontWeights.medium,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.normal,\n description: 'Small headings, h5',\n },\n 'heading-6': {\n size: fontSizes.lg,\n weight: fontWeights.medium,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.normal,\n description: 'Tiny headings, h6',\n },\n 'body-large': {\n size: fontSizes.lg,\n weight: fontWeights.normal,\n lineHeight: lineHeights.relaxed,\n letterSpacing: letterSpacing.normal,\n description: 'Lead paragraphs, intro text',\n },\n 'body': {\n size: fontSizes.base,\n weight: fontWeights.normal,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.normal,\n description: 'Default body text',\n },\n 'body-small': {\n size: fontSizes.sm,\n weight: fontWeights.normal,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.normal,\n description: 'Small body text, fine print',\n },\n 'caption': {\n size: fontSizes.xs,\n weight: fontWeights.normal,\n lineHeight: lineHeights.snug,\n letterSpacing: letterSpacing.wide,\n description: 'Captions, labels, metadata',\n },\n 'overline': {\n size: fontSizes.xs,\n weight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.widest,\n description: 'Eyebrows, categories, all-caps labels',\n },\n} as const;\n\n// ============================================================================\n// UTILITY FUNCTIONS\n// ============================================================================\n\n/**\n * Get CSS variable name for a font family\n */\nexport function getFontVariable(theme: TypographyTheme, type: 'heading' | 'body' | 'mono' | 'serif' | 'sans'): string {\n return `--font-${theme}-${type}`;\n}\n\n/**\n * Get all font family CSS variables for a theme\n */\nexport function getThemeFontVariables(theme: TypographyTheme): Record<string, string> {\n const fonts = fontFamilies[theme];\n const vars: Record<string, string> = {};\n\n Object.entries(fonts).forEach(([key, value]) => {\n if (typeof value === 'string') {\n vars[`--font-${theme}-${key}`] = value;\n }\n });\n\n return vars;\n}\n\n/**\n * Get responsive font size CSS\n */\nexport function getResponsiveFontSize(sizeKey: keyof typeof fontSizes): string {\n const size = fontSizes[sizeKey];\n return `font-size: ${size.mobile}; @media (min-width: 768px) { font-size: ${size.base}; }`;\n}\n\n// ============================================================================\n// EXPORTS\n// ============================================================================\n\n/**\n * Complete typography system export\n * Import this for access to entire typography token set\n *\n * Note: This is the comprehensive typography system with font families,\n * scales, presets, and utilities. For simple semantic aliases compatible\n * with existing code, use `typography` from './base'\n */\nexport const typographySystem = {\n families: fontFamilies,\n sizes: fontSizes,\n weights: fontWeights,\n lineHeights,\n letterSpacing,\n presets: typePresets,\n semantic: {\n sizes: semanticSizes,\n weights: semanticWeights,\n lineHeights: semanticLineHeights,\n letterSpacing: semanticLetterSpacing,\n },\n utils: {\n getFontVariable,\n getThemeFontVariables,\n getResponsiveFontSize,\n },\n} as const;\n\n/**\n * Type exports for TypeScript consumers\n */\nexport type FontSize = keyof typeof fontSizes;\nexport type FontWeight = keyof typeof fontWeights;\nexport type LineHeight = keyof typeof lineHeights;\nexport type LetterSpacing = keyof typeof letterSpacing;\nexport type TypePreset = keyof typeof typePresets;\n","/**\n * Syntax Highlighting Tokens\n * Based on VS Code Dark+ theme with light mode variants\n * Includes accessible background and border colors for code blocks\n */\n\nexport const syntaxColors = {\n light: {\n comment: '#22863a', // Green for comments\n keyword: '#8250df', // Purple for keywords (import, export, const, etc.)\n function: '#6639ba', // Purple for function names\n string: '#c1592a', // Orange for strings\n number: '#0a3069', // Blue for numbers\n boolean: '#0550ae', // Blue for booleans\n operator: '#1a1a1a', // Almost black for operators\n property: '#0550ae', // Blue for properties\n className: '#005cc5', // Blue for class names\n tag: '#005cc5', // Blue for HTML/JSX tags\n attribute: '#0550ae', // Blue for attributes\n variable: '#0550ae', // Blue for variables\n punctuation: '#57606a', // Gray for punctuation\n plain: '#1a1a1a', // Default text color\n },\n dark: {\n comment: '#6A9955', // Green for comments\n keyword: '#C586C0', // Purple for keywords (import, export, const, etc.)\n function: '#DCDCAA', // Yellow for function names\n string: '#CE9178', // Orange for strings\n number: '#B5CEA8', // Light green for numbers\n boolean: '#569CD6', // Blue for booleans\n operator: '#D4D4D4', // Light gray for operators\n property: '#9CDCFE', // Light blue for properties\n className: '#4EC9B0', // Cyan for class names\n tag: '#4EC9B0', // Cyan for HTML/JSX tags\n attribute: '#9CDCFE', // Light blue for attributes\n variable: '#9CDCFE', // Light blue for variables\n punctuation: '#808080', // Gray for punctuation\n plain: '#D4D4D4', // Default text color\n },\n} as const;\n\n/**\n * Code Block Background and Border Colors\n * Designed for optimal contrast and accessibility (WCAG AA 4.5:1)\n */\nexport const codeColors = {\n light: {\n // Block code background - cool gray for subtle distinction\n blockBackground: '#F8F9FA',\n // Inline code background - pale amber for warmth and visibility\n inlineBackground: '#FEF3E7',\n // Border color for definition and separation\n border: '#E1E4E8',\n },\n dark: {\n // Block code background - VS Code-inspired dark background\n blockBackground: '#1E1E1E',\n // Inline code background - slightly lighter for contrast\n inlineBackground: '#252525',\n // Border color for definition\n border: '#3D3D3D',\n },\n} as const;\n\nexport type SyntaxColorScheme = 'light' | 'dark';\nexport type SyntaxTokenType = keyof typeof syntaxColors.light;\n","/**\n * Color Transformation Utilities\n * Standalone utilities for the token system (no external dependencies)\n */\n\n/**\n * Convert hex to RGB\n */\nexport function hexToRgb(hex: string): { r: number; g: number; b: number } | null {\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result\n ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16),\n }\n : null;\n}\n\n/**\n * Convert hex to HSL\n */\nexport function hexToHSL(hex: string): { h: number; s: number; l: number } {\n const rgb = hexToRgb(hex);\n if (!rgb) return { h: 0, s: 0, l: 0 };\n\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h = 0, s = 0, l = (max + min) / 2;\n\n if (max !== min) {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n switch (max) {\n case r: h = ((g - b) / d + (g < b ? 6 : 0)) / 6; break;\n case g: h = ((b - r) / d + 2) / 6; break;\n case b: h = ((r - g) / d + 4) / 6; break;\n }\n }\n\n return {\n h: Math.round(h * 360),\n s: Math.round(s * 100),\n l: Math.round(l * 100),\n };\n}\n\n/**\n * Convert HSL to hex\n */\nexport function hslToHex(h: number, s: number, l: number): string {\n h = h / 360;\n s = s / 100;\n l = l / 100;\n\n let r, g, b;\n\n if (s === 0) {\n r = g = b = l;\n } else {\n const hue2rgb = (p: number, q: number, t: number) => {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1/6) return p + (q - p) * 6 * t;\n if (t < 1/2) return q;\n if (t < 2/3) return p + (q - p) * (2/3 - t) * 6;\n return p;\n };\n\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n\n r = hue2rgb(p, q, h + 1/3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1/3);\n }\n\n const toHex = (x: number) => {\n const hex = Math.round(x * 255).toString(16);\n return hex.length === 1 ? '0' + hex : hex;\n };\n\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\n/**\n * Adjust lightness of a hex color\n */\nexport function adjustLightness(hex: string, percent: number): string {\n const hsl = hexToHSL(hex);\n const newL = Math.max(0, Math.min(100, hsl.l + percent));\n return hslToHex(hsl.h, hsl.s, newL);\n}\n\n/**\n * Adjust saturation of a hex color\n */\nexport function adjustSaturation(hex: string, percent: number): string {\n const hsl = hexToHSL(hex);\n const newS = Math.max(0, Math.min(100, hsl.s + percent));\n return hslToHex(hsl.h, newS, hsl.l);\n}\n\n/**\n * Rotate hue of a hex color\n */\nexport function rotateHue(hex: string, degrees: number): string {\n const hsl = hexToHSL(hex);\n const newH = (hsl.h + degrees) % 360;\n return hslToHex(newH, hsl.s, hsl.l);\n}\n\n/**\n * Add opacity to a hex color (returns rgba CSS value)\n */\nexport function adjustOpacity(hex: string, opacity: number): string {\n const rgb = hexToRgb(hex);\n if (!rgb) return hex;\n return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${opacity})`;\n}\n\n/**\n * Calculate relative luminance (WCAG formula)\n */\nexport function getLuminance(r: number, g: number, b: number): number {\n const [rs, gs, bs] = [r, g, b].map((c) => {\n const srgb = c / 255;\n return srgb <= 0.03928 ? srgb / 12.92 : Math.pow((srgb + 0.055) / 1.055, 2.4);\n });\n return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;\n}\n\n/**\n * Calculate contrast ratio between two colors (WCAG formula)\n */\nexport function getContrastRatio(hex1: string, hex2: string): number {\n const rgb1 = hexToRgb(hex1);\n const rgb2 = hexToRgb(hex2);\n\n if (!rgb1 || !rgb2) return 0;\n\n const lum1 = getLuminance(rgb1.r, rgb1.g, rgb1.b);\n const lum2 = getLuminance(rgb2.r, rgb2.g, rgb2.b);\n\n const lighter = Math.max(lum1, lum2);\n const darker = Math.min(lum1, lum2);\n\n return (lighter + 0.05) / (darker + 0.05);\n}\n\n/**\n * Get optimal foreground color (white or black) for a background\n */\nexport function getOptimalForeground(\n bgHex: string,\n whiteHex: string = '#ffffff',\n blackHex: string = '#000000'\n): string {\n const whiteRatio = getContrastRatio(bgHex, whiteHex);\n const blackRatio = getContrastRatio(bgHex, blackHex);\n\n return whiteRatio > blackRatio ? whiteHex : blackHex;\n}\n","/**\n * Token Dependency Graph\n * Defines which tokens are computed from other tokens for \"change once, ripple everywhere\"\n */\n\nimport {\n adjustLightness,\n adjustSaturation,\n adjustOpacity,\n rotateHue,\n getOptimalForeground,\n} from './color-utils';\n\nexport type TokenDerivation = {\n source: string; // Which token it derives from\n transform: (sourceValue: string) => string; // How to compute it\n description: string; // Why this derivation exists\n};\n\n/**\n * Primary Color Derivations\n * These tokens automatically update when primary color changes\n */\nexport const primaryColorDerivations: Record<string, TokenDerivation> = {\n // Links use primary color\n '--color-link': {\n source: '--color-primary',\n transform: (primary) => primary,\n description: 'Links inherit primary brand color',\n },\n\n // Focus ring uses primary color\n '--color-ring': {\n source: '--color-primary',\n transform: (primary) => primary,\n description: 'Focus rings use primary for brand consistency',\n },\n\n // Link hover is slightly darker primary\n '--color-link-hover': {\n source: '--color-primary',\n transform: (primary) => adjustLightness(primary, -10),\n description: 'Link hover is 10% darker for visual feedback',\n },\n\n // Chart primary series\n '--chart-1': {\n source: '--color-primary',\n transform: (primary) => primary,\n description: 'First chart series uses primary',\n },\n\n // Chart secondary series (lighter tint)\n '--chart-2': {\n source: '--color-primary',\n transform: (primary) => adjustLightness(primary, 20),\n description: 'Second chart series is lighter tint of primary',\n },\n\n // Chart tertiary series (darker shade)\n '--chart-3': {\n source: '--color-primary',\n transform: (primary) => adjustLightness(primary, -15),\n description: 'Third chart series is darker shade of primary',\n },\n\n // Chart quaternary (desaturated primary)\n '--chart-4': {\n source: '--color-primary',\n transform: (primary) => adjustSaturation(primary, -30),\n description: 'Fourth chart series is muted primary',\n },\n\n // Chart quinary (complementary color)\n '--chart-5': {\n source: '--color-primary',\n transform: (primary) => rotateHue(primary, 180),\n description: 'Fifth chart series is complementary to primary',\n },\n};\n\n/**\n * Secondary Color Derivations\n * These derive from secondary color\n */\nexport const secondaryColorDerivations: Record<string, TokenDerivation> = {\n // Hover states\n '--color-hover': {\n source: '--color-secondary',\n transform: (secondary) => secondary,\n description: 'Hover backgrounds use secondary',\n },\n\n // Active states\n '--color-active': {\n source: '--color-secondary',\n transform: (secondary) => adjustLightness(secondary, -5),\n description: 'Active state is slightly darker secondary',\n },\n\n // Muted backgrounds\n '--color-muted': {\n source: '--color-secondary',\n transform: (secondary) => secondary,\n description: 'Muted sections use secondary color',\n },\n};\n\n/**\n * Accent Color Derivations\n * These derive from accent (used for highlights and CTAs)\n */\nexport const accentColorDerivations: Record<string, TokenDerivation> = {\n // Info semantic color uses accent\n '--color-info': {\n source: '--color-accent',\n transform: (accent) => accent,\n description: 'Info semantic color uses accent',\n },\n\n // Info foreground calculated for contrast\n '--color-info-foreground': {\n source: '--color-accent',\n transform: (accent) => getOptimalForeground(accent),\n description: 'Info foreground calculated for contrast',\n },\n};\n\n/**\n * Mode-Specific Derivations\n * These need different transforms for light vs dark mode\n */\nexport const modeSpecificDerivations: Record<string, {\n light: TokenDerivation;\n dark: TokenDerivation;\n}> = {\n '--color-primary-muted': {\n light: {\n source: '--color-primary',\n transform: (primary) => adjustLightness(primary, 40),\n description: 'Muted primary for light backgrounds',\n },\n dark: {\n source: '--color-primary',\n transform: (primary) => adjustLightness(primary, -20),\n description: 'Muted primary for dark backgrounds',\n },\n },\n\n '--color-primary-subtle': {\n light: {\n source: '--color-primary',\n transform: (primary) => adjustOpacity(primary, 0.1),\n description: 'Subtle primary background for light mode',\n },\n dark: {\n source: '--color-primary',\n transform: (primary) => adjustOpacity(primary, 0.2),\n description: 'Subtle primary background for dark mode',\n },\n },\n};\n\n/**\n * Complete dependency graph\n */\nexport const tokenDependencyGraph = {\n primary: primaryColorDerivations,\n secondary: secondaryColorDerivations,\n accent: accentColorDerivations,\n modeSpecific: modeSpecificDerivations,\n};\n\n/**\n * Get all tokens that depend on a source token\n */\nexport function getDependentTokens(sourceToken: string): string[] {\n const dependents: string[] = [];\n\n Object.entries(primaryColorDerivations).forEach(([token, config]) => {\n if (config.source === sourceToken) {\n dependents.push(token);\n }\n });\n\n Object.entries(secondaryColorDerivations).forEach(([token, config]) => {\n if (config.source === sourceToken) {\n dependents.push(token);\n }\n });\n\n Object.entries(accentColorDerivations).forEach(([token, config]) => {\n if (config.source === sourceToken) {\n dependents.push(token);\n }\n });\n\n return dependents;\n}\n\n/**\n * Compute all derived tokens from a source\n */\nexport function computeDerivedTokens(\n sourceToken: string,\n sourceValue: string,\n mode: 'light' | 'dark'\n): Record<string, string> {\n const derived: Record<string, string> = {};\n\n // Compute from primary derivations\n Object.entries(primaryColorDerivations).forEach(([token, config]) => {\n if (config.source === sourceToken) {\n derived[token] = config.transform(sourceValue);\n }\n });\n\n // Compute from secondary derivations\n Object.entries(secondaryColorDerivations).forEach(([token, config]) => {\n if (config.source === sourceToken) {\n derived[token] = config.transform(sourceValue);\n }\n });\n\n // Compute from accent derivations\n Object.entries(accentColorDerivations).forEach(([token, config]) => {\n if (config.source === sourceToken) {\n derived[token] = config.transform(sourceValue);\n }\n });\n\n // Compute mode-specific derivations\n Object.entries(modeSpecificDerivations).forEach(([token, configs]) => {\n const config = configs[mode];\n if (config.source === sourceToken) {\n derived[token] = config.transform(sourceValue);\n }\n });\n\n return derived;\n}\n","/**\n * Semantic Color Utilities\n *\n * Helper functions for working with the design system's color tokens\n * and CSS variables.\n */\n\n/**\n * Color token categories\n */\nexport const colorTokens = {\n // Background colors\n background: 'var(--color-background)',\n backgroundSecondary: 'var(--color-background-secondary)',\n backgroundTertiary: 'var(--color-background-tertiary)',\n surface: 'var(--color-surface)',\n\n // Foreground/Text colors\n foreground: 'var(--color-foreground)',\n foregroundSecondary: 'var(--color-foreground-secondary)',\n foregroundTertiary: 'var(--color-foreground-tertiary)',\n textPrimary: 'var(--color-text-primary)',\n textSecondary: 'var(--color-text-secondary)',\n textMuted: 'var(--color-text-muted)',\n\n // Brand colors\n primary: 'var(--color-primary)',\n primaryForeground: 'var(--color-primary-foreground)',\n secondary: 'var(--color-secondary)',\n secondaryForeground: 'var(--color-secondary-foreground)',\n accent: 'var(--color-accent)',\n accentForeground: 'var(--color-accent-foreground)',\n\n // Semantic colors\n success: 'var(--color-success)',\n successForeground: 'var(--color-success-foreground)',\n warning: 'var(--color-warning)',\n warningForeground: 'var(--color-warning-foreground)',\n error: 'var(--color-error)',\n errorForeground: 'var(--color-error-foreground)',\n info: 'var(--color-info)',\n infoForeground: 'var(--color-info-foreground)',\n\n // Borders\n border: 'var(--color-border)',\n borderSubtle: 'var(--color-border-subtle)',\n\n // Interactive states\n hover: 'var(--color-hover)',\n active: 'var(--color-active)',\n focus: 'var(--color-focus)',\n\n // Links\n link: 'var(--color-link)',\n linkHover: 'var(--color-link-hover)',\n linkHoverForeground: 'var(--color-link-hover-foreground)',\n} as const;\n\n/**\n * Get CSS variable value from computed styles\n *\n * @param variableName - CSS variable name (with or without --)\n * @param element - Element to get computed style from (defaults to document.documentElement)\n * @returns The computed value of the CSS variable\n *\n * @example\n * ```ts\n * const primaryColor = getCSSVariable('--color-primary');\n * // Returns: '#0066ff' (or whatever the current theme's primary color is)\n * ```\n */\nexport function getCSSVariable(\n variableName: string,\n element: HTMLElement = document.documentElement\n): string {\n const name = variableName.startsWith('--') ? variableName : `--${variableName}`;\n return getComputedStyle(element).getPropertyValue(name).trim();\n}\n\n/**\n * Set CSS variable value\n *\n * @param variableName - CSS variable name (with or without --)\n * @param value - Value to set\n * @param element - Element to set the variable on (defaults to document.documentElement)\n *\n * @example\n * ```ts\n * setCSSVariable('--color-primary', '#ff0000');\n * ```\n */\nexport function setCSSVariable(\n variableName: string,\n value: string,\n element: HTMLElement = document.documentElement\n): void {\n const name = variableName.startsWith('--') ? variableName : `--${variableName}`;\n element.style.setProperty(name, value);\n}\n\n/**\n * Get contrasting foreground color for a background color\n *\n * @param backgroundToken - Background color token name (without 'var()')\n * @returns The appropriate foreground color token\n *\n * @example\n * ```ts\n * const foreground = getForegroundColor('--color-primary');\n * // Returns: 'var(--color-primary-foreground)'\n * ```\n */\nexport function getForegroundColor(backgroundToken: string): string {\n // Remove var() wrapper if present\n const token = backgroundToken.replace(/var\\(|\\)/g, '');\n\n // Map background tokens to their foreground pairs\n const foregroundMap: Record<string, string> = {\n '--color-primary': 'var(--color-primary-foreground)',\n '--color-secondary': 'var(--color-secondary-foreground)',\n '--color-accent': 'var(--color-accent-foreground)',\n '--color-success': 'var(--color-success-foreground)',\n '--color-warning': 'var(--color-warning-foreground)',\n '--color-error': 'var(--color-error-foreground)',\n '--color-info': 'var(--color-info-foreground)',\n '--color-background': 'var(--color-foreground)',\n '--color-surface': 'var(--color-text-primary)',\n };\n\n return foregroundMap[token] || 'var(--color-text-primary)';\n}\n\n/**\n * Semantic color groups for different use cases\n */\nexport const semanticColors = {\n /**\n * Status colors for indicating states\n */\n status: {\n success: {\n bg: colorTokens.success,\n fg: colorTokens.successForeground,\n },\n warning: {\n bg: colorTokens.warning,\n fg: colorTokens.warningForeground,\n },\n error: {\n bg: colorTokens.error,\n fg: colorTokens.errorForeground,\n },\n info: {\n bg: colorTokens.info,\n fg: colorTokens.infoForeground,\n },\n },\n\n /**\n * Brand colors for primary UI elements\n */\n brand: {\n primary: {\n bg: colorTokens.primary,\n fg: colorTokens.primaryForeground,\n },\n secondary: {\n bg: colorTokens.secondary,\n fg: colorTokens.secondaryForeground,\n },\n accent: {\n bg: colorTokens.accent,\n fg: colorTokens.accentForeground,\n },\n },\n\n /**\n * Interactive state colors\n */\n interactive: {\n default: {\n bg: colorTokens.background,\n fg: colorTokens.foreground,\n },\n hover: {\n bg: colorTokens.hover,\n fg: colorTokens.foreground,\n },\n active: {\n bg: colorTokens.active,\n fg: colorTokens.foreground,\n },\n focus: {\n border: colorTokens.focus,\n },\n },\n} as const;\n\n/**\n * Helper to create color pairs (background + foreground)\n *\n * @param type - Semantic color type\n * @returns Object with bg and fg (and optionally border)\n *\n * @example\n * ```tsx\n * const errorColors = getSemanticColorPair('error');\n * <div style={{\n * backgroundColor: errorColors.bg,\n * color: errorColors.fg\n * }}>\n * Error message\n * </div>\n * ```\n */\nexport function getSemanticColorPair(\n type: 'success' | 'warning' | 'error' | 'info' | 'primary' | 'secondary' | 'accent'\n): { bg: string; fg: string } {\n if (type === 'primary' || type === 'secondary' || type === 'accent') {\n return semanticColors.brand[type];\n }\n return semanticColors.status[type];\n}\n\n/**\n * Convert hex color to RGB values\n *\n * @param hex - Hex color string (with or without #)\n * @returns Object with r, g, b values (0-255)\n *\n * @example\n * ```ts\n * const rgb = hexToRgb('#0066ff');\n * // Returns: { r: 0, g: 102, b: 255 }\n * ```\n */\nexport function hexToRgb(hex: string): { r: number; g: number; b: number } | null {\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result\n ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16),\n }\n : null;\n}\n\n/**\n * Calculate relative luminance of a color (WCAG formula)\n *\n * @param r - Red value (0-255)\n * @param g - Green value (0-255)\n * @param b - Blue value (0-255)\n * @returns Relative luminance (0-1)\n */\nexport function getLuminance(r: number, g: number, b: number): number {\n const [rs, gs, bs] = [r, g, b].map((c) => {\n const srgb = c / 255;\n return srgb <= 0.03928 ? srgb / 12.92 : Math.pow((srgb + 0.055) / 1.055, 2.4);\n });\n return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;\n}\n\n/**\n * Calculate contrast ratio between two colors (WCAG formula)\n *\n * @param hex1 - First color (hex)\n * @param hex2 - Second color (hex)\n * @returns Contrast ratio (1-21)\n *\n * @example\n * ```ts\n * const ratio = getContrastRatio('#ffffff', '#000000');\n * // Returns: 21 (maximum contrast)\n * ```\n */\nexport function getContrastRatio(hex1: string, hex2: string): number {\n const rgb1 = hexToRgb(hex1);\n const rgb2 = hexToRgb(hex2);\n\n if (!rgb1 || !rgb2) return 0;\n\n const lum1 = getLuminance(rgb1.r, rgb1.g, rgb1.b);\n const lum2 = getLuminance(rgb2.r, rgb2.g, rgb2.b);\n\n const lighter = Math.max(lum1, lum2);\n const darker = Math.min(lum1, lum2);\n\n return (lighter + 0.05) / (darker + 0.05);\n}\n\n/**\n * Check if color pair meets WCAG AA contrast requirements\n *\n * @param foreground - Foreground color (hex)\n * @param background - Background color (hex)\n * @param level - WCAG level ('AA' or 'AAA')\n * @param size - Text size ('normal' or 'large')\n * @returns true if contrast ratio meets requirements\n *\n * @example\n * ```ts\n * const isAccessible = meetsContrastRequirements('#000000', '#ffffff', 'AA', 'normal');\n * // Returns: true\n * ```\n */\nexport function meetsContrastRequirements(\n foreground: string,\n background: string,\n level: 'AA' | 'AAA' = 'AA',\n size: 'normal' | 'large' = 'normal'\n): boolean {\n const ratio = getContrastRatio(foreground, background);\n\n const requirements = {\n AA: { normal: 4.5, large: 3 },\n AAA: { normal: 7, large: 4.5 },\n };\n\n return ratio >= requirements[level][size];\n}\n\n/**\n * Convert hex to HSL for manipulation\n */\nexport function hexToHSL(hex: string): { h: number; s: number; l: number } {\n const rgb = hexToRgb(hex);\n if (!rgb) return { h: 0, s: 0, l: 0 };\n\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h = 0, s = 0, l = (max + min) / 2;\n\n if (max !== min) {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n switch (max) {\n case r: h = ((g - b) / d + (g < b ? 6 : 0)) / 6; break;\n case g: h = ((b - r) / d + 2) / 6; break;\n case b: h = ((r - g) / d + 4) / 6; break;\n }\n }\n\n return {\n h: Math.round(h * 360),\n s: Math.round(s * 100),\n l: Math.round(l * 100),\n };\n}\n\n/**\n * Convert HSL to hex\n */\nexport function hslToHex(h: number, s: number, l: number): string {\n h = h / 360;\n s = s / 100;\n l = l / 100;\n\n let r, g, b;\n\n if (s === 0) {\n r = g = b = l;\n } else {\n const hue2rgb = (p: number, q: number, t: number) => {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1/6) return p + (q - p) * 6 * t;\n if (t < 1/2) return q;\n if (t < 2/3) return p + (q - p) * (2/3 - t) * 6;\n return p;\n };\n\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n\n r = hue2rgb(p, q, h + 1/3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1/3);\n }\n\n const toHex = (x: number) => {\n const hex = Math.round(x * 255).toString(16);\n return hex.length === 1 ? '0' + hex : hex;\n };\n\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\n/**\n * Adjust lightness of a hex color\n * @param hex - Input color\n * @param percent - Amount to adjust (-100 to 100)\n */\nexport function adjustLightness(hex: string, percent: number): string {\n const hsl = hexToHSL(hex);\n const newL = Math.max(0, Math.min(100, hsl.l + percent));\n return hslToHex(hsl.h, hsl.s, newL);\n}\n\n/**\n * Adjust saturation of a hex color\n * @param hex - Input color\n * @param percent - Amount to adjust (-100 to 100)\n */\nexport function adjustSaturation(hex: string, percent: number): string {\n const hsl = hexToHSL(hex);\n const newS = Math.max(0, Math.min(100, hsl.s + percent));\n return hslToHex(hsl.h, newS, hsl.l);\n}\n\n/**\n * Rotate hue of a hex color\n * @param hex - Input color\n * @param degrees - Degrees to rotate (0-360)\n */\nexport function rotateHue(hex: string, degrees: number): string {\n const hsl = hexToHSL(hex);\n const newH = (hsl.h + degrees) % 360;\n return hslToHex(newH, hsl.s, hsl.l);\n}\n\n/**\n * Add opacity to a hex color (returns rgba CSS value)\n * @param hex - Input color\n * @param opacity - Opacity (0-1)\n */\nexport function adjustOpacity(hex: string, opacity: number): string {\n const rgb = hexToRgb(hex);\n if (!rgb) return hex;\n return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${opacity})`;\n}\n\n/**\n * Get optimal foreground color (white or black) for a background\n * Uses WCAG contrast formula\n */\nexport function getOptimalForeground(\n bgHex: string,\n whiteHex: string = '#ffffff',\n blackHex: string = '#000000'\n): string {\n const whiteRatio = getContrastRatio(bgHex, whiteHex);\n const blackRatio = getContrastRatio(bgHex, blackHex);\n\n return whiteRatio > blackRatio ? whiteHex : blackHex;\n}\n\n/**\n * Generate a complete tint/shade scale (like Tailwind)\n * Returns 50, 100, 200, ..., 900 variants\n */\nexport function generateColorScale(baseHex: string): Record<number, string> {\n const hsl = hexToHSL(baseHex);\n\n return {\n 50: hslToHex(hsl.h, Math.max(hsl.s - 10, 20), 95),\n 100: hslToHex(hsl.h, Math.max(hsl.s - 5, 30), 90),\n 200: hslToHex(hsl.h, hsl.s, 80),\n 300: hslToHex(hsl.h, hsl.s, 70),\n 400: hslToHex(hsl.h, hsl.s, 60),\n 500: baseHex, // Base color\n 600: hslToHex(hsl.h, Math.min(hsl.s + 5, 100), 45),\n 700: hslToHex(hsl.h, Math.min(hsl.s + 10, 100), 35),\n 800: hslToHex(hsl.h, Math.min(hsl.s + 15, 100), 25),\n 900: hslToHex(hsl.h, Math.min(hsl.s + 20, 100), 15),\n };\n}\n\n/**\n * Color utilities for common operations\n */\nexport const colorUtils = {\n getCSSVariable,\n setCSSVariable,\n getForegroundColor,\n getSemanticColorPair,\n hexToRgb,\n hexToHSL,\n hslToHex,\n adjustLightness,\n adjustSaturation,\n rotateHue,\n adjustOpacity,\n getOptimalForeground,\n generateColorScale,\n getContrastRatio,\n meetsContrastRequirements,\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOA,mBAAoC;;;ACFpC,qBAAuB;AACvB,wBAAwB;AAoBjB,IAAM,oBAAgB,uBAAmB;AAAA,MAC9C;AAAA,IACE,CAAC,KAAK,SAAS;AAAA;AAAA,MAEb,OAAO;AAAA,MACP,MAAM;AAAA;AAAA,MAGN,UAAU,CAAC,UAAU,IAAI,EAAE,MAAM,CAAC;AAAA,MAClC,SAAS,CAAC,SAAS,IAAI,EAAE,KAAK,CAAC;AAAA,MAC/B,YAAY,MACV,IAAI,CAAC,WAAW,EAAE,MAAM,MAAM,SAAS,UAAU,SAAS,QAAQ,EAAE;AAAA;AAAA,MAGtE,IAAI,cAAc;AAChB,cAAM,QAAQ,IAAI;AAClB,eAAO,EAAE,MAAM,MAAM,OAAO,MAAM,MAAM,KAAK;AAAA,MAC/C;AAAA,IACF;AAAA,IACA;AAAA,MACE,MAAM;AAAA;AAAA,MAEN,YAAY,CAAC,WAAW;AAAA,QACtB,OAAO,MAAM;AAAA,QACb,MAAM,MAAM;AAAA,MACd;AAAA,IACF;AAAA,EACF;AACF;;;ACtDA,IAAAA,kBAAuB;AACvB,IAAAC,qBAAwB;;;ACIjB,IAAM,aAAa;AAAA;AAAA;AAAA;AAAA,EAIxB,SAAS;AAAA,IACP,KAAK;AAAA,IACL,OAAO;AAAA;AAAA,IACP,KAAK;AAAA;AAAA,IACL,KAAK;AAAA;AAAA,IACL,KAAK;AAAA;AAAA,IACL,KAAK;AAAA;AAAA,IACL,KAAK;AAAA;AAAA,IACL,KAAK;AAAA;AAAA,IACL,KAAK;AAAA;AAAA,IACL,MAAM;AAAA;AAAA,IACN,MAAM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a,aAAa,IAAI;AACnC,SAAK,aAAa,sBAAsB,gBAAgB,WAAW,SAAS;AAG5E,QAAI,SAAS,QAAQ;AACnB,WAAK,UAAU,IAAI,MAAM;AAAA,IAC3B,OAAO;AACL,WAAK,UAAU,OAAO,MAAM;AAAA,IAC9B;AAGA,UAAM,UAAU,WAAW,MAAM;AAC/B,WAAK,UAAU,OAAO,qBAAqB;AAC3C,yBAAmB,KAAK;AAAA,IAC1B,GAAG,GAAG;AAEN,WAAO,MAAM,aAAa,OAAO;AAAA,EACnC,GAAG,CAAC,OAAO,MAAM,SAAS,aAAa,CAAC;AAGxC,MAAI,CAAC,SAAS;AACZ,WAAO;AAAA,EACT;AAEA,SAAO,2EAAG,UAAS;AACrB;","names":["import_zustand","import_middleware","p","q","hexToRgb","getLuminance","getContrastRatio","hexToHSL","hexToRgb","hslToHex","p","q","getOptimalForeground","getContrastRatio","hexToHSL","hslToHex","getOptimalForeground","state","baseTokens"]}
|
|
1
|
+
{"version":3,"sources":["../src/providers.ts","../src/providers/ThemeProvider.tsx","../src/lib/store/theme.ts","../src/lib/store/customizer.ts","../../tokens/src/base.ts","../../tokens/src/studio.ts","../../tokens/src/terra.ts","../../tokens/src/volt.ts","../../tokens/src/typography.ts","../../tokens/src/syntax.ts","../../tokens/src/color-utils.ts","../../tokens/src/token-graph.ts","../src/lib/colors.ts"],"sourcesContent":["/**\n * Providers subpath export\n * Allows: import { ... } from '@thesage/ui/providers'\n */\n\n// Re-export all providers\nexport * from './providers/ThemeProvider';\n","'use client';\n\n/**\n * Theme Provider\n * Applies theme tokens as CSS variables and manages transitions\n */\n\nimport { useEffect, useState } from 'react';\nimport { useThemeStore } from '../lib/store/theme';\nimport { useCustomizer, type ColorPalette } from '../lib/store/customizer';\nimport { studioTokens, terraTokens, voltTokens, syntaxColors, codeColors } from '@thesage/tokens';\nimport type { ThemeName, ColorMode } from '@thesage/tokens';\n\n// Theme token map\nconst themeTokens = {\n studio: studioTokens,\n terra: terraTokens,\n volt: voltTokens,\n};\n\n// Font family map (CSS variables defined in layout)\nconst fontFamilies = {\n studio: {\n heading: 'var(--font-studio-heading)',\n body: 'var(--font-studio-body)',\n mono: 'var(--font-mono)',\n },\n terra: {\n sans: 'var(--font-terra-body)',\n serif: 'var(--font-terra-heading)',\n mono: 'var(--font-mono)',\n },\n volt: {\n sans: 'var(--font-volt-heading)',\n mono: 'var(--font-mono)',\n },\n};\n\n/**\n * Convert theme tokens to CSS variables\n */\nfunction getThemeVars(theme: ThemeName, mode: ColorMode): Record<string, string> {\n const tokens = themeTokens[theme];\n const colors = tokens[mode]?.colors as any;\n const effects = tokens[mode]?.effects as any;\n const fonts = fontFamilies[theme] as any;\n\n return {\n // Colors - Base\n '--color-background': colors?.background || '#ffffff',\n '--color-background-secondary': colors?.backgroundSecondary || colors?.background || '#fafafa',\n '--color-background-tertiary': colors?.backgroundTertiary || colors?.backgroundSecondary || colors?.background || '#f5f5f5',\n '--color-foreground': colors?.foreground || '#0a0a0a',\n '--color-primary': colors?.primary || '#0a0a0a',\n '--color-primary-foreground': colors?.primaryForeground || '#ffffff',\n '--color-secondary': colors?.secondary || '#f5f5f5',\n '--color-secondary-foreground': colors?.secondaryForeground || '#0a0a0a',\n '--color-accent': colors?.accent || colors?.primary || '#0070f3',\n '--color-accent-foreground': colors?.accentForeground || '#ffffff',\n '--color-success': colors?.success || '#00a86b',\n '--color-success-foreground': colors?.successForeground || '#ffffff',\n '--color-warning': colors?.warning || '#f59e0b',\n '--color-warning-foreground': colors?.warningForeground || '#ffffff',\n '--color-error': colors?.error || '#ef4444',\n '--color-error-foreground': colors?.errorForeground || '#ffffff',\n '--color-info': colors?.info || colors?.accent || '#0070f3',\n '--color-info-foreground': colors?.infoForeground || '#ffffff',\n '--color-glass': colors?.glass || 'rgba(255, 255, 255, 0.7)',\n '--color-glass-border': colors?.glassBorder || 'rgba(0, 0, 0, 0.1)',\n\n // Semantic color aliases (matching README examples)\n '--color-text-primary': colors?.foreground || '#0a0a0a',\n '--color-text-secondary': colors?.foregroundSecondary || '#525252',\n '--color-text-muted': colors?.foregroundTertiary || '#a3a3a3',\n '--color-surface': colors?.backgroundSecondary || colors?.background || '#fafafa',\n '--color-border': colors?.border || colors?.glassBorder || 'rgba(0, 0, 0, 0.1)',\n '--color-focus': colors?.accent || colors?.primary || '#0070f3',\n\n // Links and focus rings (can be overridden by derived tokens)\n '--color-link': colors?.link || colors?.primary || '#0a0a0a',\n '--color-ring': colors?.ring || colors?.primary || '#0a0a0a',\n\n // Interactive states\n '--color-hover': colors?.hover || colors?.backgroundSecondary || '#fafafa',\n '--color-active': colors?.active || colors?.backgroundTertiary || '#f0f0f0',\n '--color-link-hover': colors?.linkHover || colors?.primary || '#0a0a0a',\n '--color-link-hover-foreground': colors?.linkHoverForeground || colors?.background || '#ffffff',\n\n // Effects - Blur\n '--effect-blur-sm': effects?.blur?.sm || 'blur(4px)',\n '--effect-blur-md': effects?.blur?.md || 'blur(8px)',\n '--effect-blur-lg': effects?.blur?.lg || 'blur(16px)',\n '--effect-blur-xl': effects?.blur?.xl || effects?.blur?.lg || 'blur(24px)',\n\n // Effects - Shadow\n '--effect-shadow-sm': effects?.shadow?.sm || '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n '--effect-shadow-md': effects?.shadow?.md || effects?.shadow?.sm || '0 4px 6px -1px rgba(0, 0, 0, 0.1)',\n '--effect-shadow-lg': effects?.shadow?.lg || effects?.shadow?.md || effects?.shadow?.sm || '0 10px 15px -3px rgba(0, 0, 0, 0.1)',\n\n // Typography - Font Families\n '--font-heading': fonts?.heading || (theme === 'terra' && fonts?.serif ? fonts.serif : fonts?.sans) || 'var(--font-studio-heading)',\n '--font-body': fonts?.body || fonts?.sans || 'var(--font-studio-body)',\n '--font-mono': fonts?.mono || 'var(--font-studio-mono)',\n\n // Motion - These are accessed programmatically via tokens\n // but we can set defaults for CSS animations\n '--ease-default': tokens?.motion?.ease?.default || 'cubic-bezier(0.4, 0, 0.2, 1)',\n '--ease-spring': tokens?.motion?.ease?.spring || tokens?.motion?.ease?.default || 'cubic-bezier(0.16, 1, 0.3, 1)',\n\n // Syntax Highlighting - Based on VS Code Dark+ theme\n '--syntax-comment': mode === 'light' ? syntaxColors.light.comment : syntaxColors.dark.comment,\n '--syntax-keyword': mode === 'light' ? syntaxColors.light.keyword : syntaxColors.dark.keyword,\n '--syntax-function': mode === 'light' ? syntaxColors.light.function : syntaxColors.dark.function,\n '--syntax-string': mode === 'light' ? syntaxColors.light.string : syntaxColors.dark.string,\n '--syntax-number': mode === 'light' ? syntaxColors.light.number : syntaxColors.dark.number,\n '--syntax-boolean': mode === 'light' ? syntaxColors.light.boolean : syntaxColors.dark.boolean,\n '--syntax-operator': mode === 'light' ? syntaxColors.light.operator : syntaxColors.dark.operator,\n '--syntax-property': mode === 'light' ? syntaxColors.light.property : syntaxColors.dark.property,\n '--syntax-className': mode === 'light' ? syntaxColors.light.className : syntaxColors.dark.className,\n '--syntax-tag': mode === 'light' ? syntaxColors.light.tag : syntaxColors.dark.tag,\n '--syntax-attribute': mode === 'light' ? syntaxColors.light.attribute : syntaxColors.dark.attribute,\n '--syntax-variable': mode === 'light' ? syntaxColors.light.variable : syntaxColors.dark.variable,\n '--syntax-punctuation': mode === 'light' ? syntaxColors.light.punctuation : syntaxColors.dark.punctuation,\n '--syntax-plain': mode === 'light' ? syntaxColors.light.plain : syntaxColors.dark.plain,\n\n // Code Block Backgrounds and Borders - Accessible contrast (WCAG AA 4.5:1)\n '--code-block-bg': mode === 'light' ? codeColors.light.blockBackground : codeColors.dark.blockBackground,\n '--code-inline-bg': mode === 'light' ? codeColors.light.inlineBackground : codeColors.dark.inlineBackground,\n '--code-border': mode === 'light' ? codeColors.light.border : codeColors.dark.border,\n };\n}\n\n/**\n * Merge custom color palette with base theme tokens\n * This is where \"change once, ripple everywhere\" happens!\n */\nfunction mergeCustomColorTokens(\n baseTokens: Record<string, string>,\n customPalette: ColorPalette\n): Record<string, string> {\n return {\n ...baseTokens,\n\n // Override primary color\n '--color-primary': customPalette.primary,\n '--color-primary-foreground': customPalette.primaryForeground,\n\n // Apply color scale (for utilities like bg-primary/50)\n '--color-primary-50': customPalette.scale[50],\n '--color-primary-100': customPalette.scale[100],\n '--color-primary-200': customPalette.scale[200],\n '--color-primary-300': customPalette.scale[300],\n '--color-primary-400': customPalette.scale[400],\n '--color-primary-500': customPalette.scale[500],\n '--color-primary-600': customPalette.scale[600],\n '--color-primary-700': customPalette.scale[700],\n '--color-primary-800': customPalette.scale[800],\n '--color-primary-900': customPalette.scale[900],\n\n // Override secondary color if provided (advanced mode)\n ...(customPalette.secondary && {\n '--color-secondary': customPalette.secondary,\n '--color-secondary-foreground': customPalette.secondaryForeground || baseTokens['--color-secondary-foreground'],\n }),\n\n // Override accent color if provided (advanced mode)\n ...(customPalette.accent && {\n '--color-accent': customPalette.accent,\n '--color-accent-foreground': customPalette.accentForeground || baseTokens['--color-accent-foreground'],\n }),\n\n // Apply ALL derived tokens from dependency graph\n // This automatically updates:\n // - Links (--color-link, --color-link-hover)\n // - Focus rings (--color-ring)\n // - Charts (--chart-1, --chart-2, --chart-3, --chart-4, --chart-5)\n // - Buttons, badges, and any other dependent tokens\n ...customPalette.derivedTokens,\n };\n}\n\nexport function ThemeProvider({ children }: { children: React.ReactNode }) {\n const { theme, mode } = useThemeStore();\n // Use specific selector to get the exact palette for current theme/mode\n // This fixes the issue where full object subscription might miss updates or cause hydration issues\n const customPalette = useCustomizer((state) => state.customColors?.[theme]?.[mode]);\n\n const [isTransitioning, setIsTransitioning] = useState(false);\n const [mounted, setMounted] = useState(false);\n\n // Prevent hydration mismatch\n useEffect(() => {\n setMounted(true);\n }, []);\n\n // Apply theme variables with transition\n useEffect(() => {\n if (!mounted) return;\n\n // Start transition\n setIsTransitioning(true);\n\n // Apply theme vars to :root\n const root = document.documentElement;\n\n // 1. Get base theme tokens\n const baseTokens = getThemeVars(theme, mode);\n\n // 2. Custom palette is now derived directly from store selector\n\n // DEBUG: Log the values to diagnose mismatch\n console.log('[ThemeProvider] Update:', {\n theme,\n mode,\n hasCustomPalette: !!customPalette,\n customPrimary: customPalette?.primary,\n timestamp: new Date().toISOString()\n });\n\n // 3. Merge tokens (custom overrides base)\n const finalTokens = customPalette\n ? mergeCustomColorTokens(baseTokens, customPalette)\n : baseTokens;\n\n // Apply transition class\n root.classList.add('theme-transitioning');\n\n // Apply CSS variables IMMEDIATELY (no requestAnimationFrame delay)\n Object.entries(finalTokens).forEach(([key, value]) => {\n root.style.setProperty(key, value);\n });\n\n // Set data attributes for theme and mode\n root.setAttribute('data-theme', theme);\n root.setAttribute('data-mode', mode);\n root.setAttribute('data-custom-colors', customPalette ? 'active' : 'default');\n\n // Toggle 'dark' class for Tailwind dark: modifier support\n if (mode === 'dark') {\n root.classList.add('dark');\n } else {\n root.classList.remove('dark');\n }\n\n // End transition after animation completes\n const timeout = setTimeout(() => {\n root.classList.remove('theme-transitioning');\n setIsTransitioning(false);\n }, 400); // 400ms = 300ms transition + 100ms buffer\n\n return () => clearTimeout(timeout);\n }, [theme, mode, mounted, customPalette]);\n\n // Don't render children until mounted (prevents flash)\n if (!mounted) {\n return null;\n }\n\n return <>{children}</>;\n}\n","/**\n * Theme Store\n * Manages theme and color mode state with localStorage persistence\n */\n\nimport { create } from 'zustand';\nimport { persist } from 'zustand/middleware';\nimport type { ThemeName, ColorMode } from '@thesage/tokens';\n\n// Re-export types for convenience\nexport type { ThemeName, ColorMode };\n\ninterface ThemeState {\n // Current theme and mode\n theme: ThemeName;\n mode: ColorMode;\n\n // Actions\n setTheme: (theme: ThemeName) => void;\n setMode: (mode: ColorMode) => void;\n toggleMode: () => void;\n\n // Computed\n themeConfig: { name: ThemeName; mode: ColorMode };\n}\n\nexport const useThemeStore = create<ThemeState>()(\n persist(\n (set, get) => ({\n // Defaults\n theme: 'volt',\n mode: 'dark',\n\n // Actions\n setTheme: (theme) => set({ theme }),\n setMode: (mode) => set({ mode }),\n toggleMode: () =>\n set((state) => ({ mode: state.mode === 'light' ? 'dark' : 'light' })),\n\n // Computed\n get themeConfig() {\n const state = get();\n return { name: state.theme, mode: state.mode };\n },\n }),\n {\n name: 'ecosystem-theme',\n // Only persist theme and mode\n partialize: (state) => ({\n theme: state.theme,\n mode: state.mode,\n }),\n }\n )\n);\n","import { create } from 'zustand';\nimport { persist } from 'zustand/middleware';\nimport { computeDerivedTokens, type FontTheme } from '@thesage/tokens';\nimport {\n generateColorScale,\n getOptimalForeground,\n} from '../colors';\n\nexport type CustomizationMode = 'simple' | 'advanced';\n\nexport interface ColorPalette {\n /* Metadata */\n name?: string; // Name of the source palette\n description?: string; // Description of the source palette\n\n /* Colors */\n primary: string; // Base hex\n primaryForeground: string; // Calculated contrast\n secondary?: string; // Optional secondary color\n secondaryForeground?: string; // Calculated contrast\n accent?: string; // Optional accent color\n accentForeground?: string; // Calculated contrast\n scale: Record<number, string>; // 50-900 tints/shades\n derivedTokens: Record<string, string>; // Computed dependent tokens\n}\n\nexport interface SavedPalette {\n id: string; // Unique ID\n name: string; // User-defined name\n description: string; // Palette description\n primary: string; // Primary color hex\n accent: string; // Accent color hex\n secondary?: string; // Optional secondary color\n category: 'custom'; // Always 'custom' for user palettes\n wcagAA: boolean; // Calculated accessibility\n wcagAAA: boolean; // Calculated accessibility\n createdAt: number; // Timestamp\n mood: string[]; // Mood tags\n bestFor?: string[]; // Best use cases\n harmony?: string;\n rationale?: string;\n}\n\nexport interface SavedFontTheme extends FontTheme {\n id: string; // Unique ID (overrides FontTheme.id)\n createdAt: number; // Timestamp\n category: 'custom'; // Always 'custom' for user font themes\n}\n\nexport interface ColorCustomization {\n mode: CustomizationMode;\n palette: ColorPalette | null;\n}\n\nexport type ThemeName = 'studio' | 'terra' | 'volt';\nexport type ColorMode = 'light' | 'dark';\n\ninterface CustomizerState {\n // Motion settings\n motion: number; // 0-10\n prefersReducedMotion: boolean;\n\n // Color customization\n customizationMode: CustomizationMode;\n customColors: {\n [theme in ThemeName]?: {\n [mode in ColorMode]?: ColorPalette;\n };\n };\n\n // Saved custom palettes\n savedPalettes: SavedPalette[];\n\n // Font theme customization\n customFontThemes: {\n [theme in ThemeName]?: {\n [mode in ColorMode]?: FontTheme;\n };\n };\n\n // Saved custom font themes\n savedFontThemes: SavedFontTheme[];\n\n // Motion actions\n setMotion: (level: number) => void;\n setPrefersReducedMotion: (value: boolean) => void;\n\n // Color customization actions\n setCustomizationMode: (mode: CustomizationMode) => void;\n\n setCustomPrimaryColor: (\n theme: ThemeName,\n mode: ColorMode,\n hexColor: string\n ) => void;\n\n setCustomSecondaryColor: (\n theme: ThemeName,\n mode: ColorMode,\n hexColor: string\n ) => void;\n\n setCustomAccentColor: (\n theme: ThemeName,\n mode: ColorMode,\n hexColor: string\n ) => void;\n\n applyColorPalette: (\n theme: ThemeName,\n mode: ColorMode,\n colors: {\n primary: string;\n secondary?: string;\n accent?: string;\n name?: string;\n description?: string;\n }\n ) => void;\n\n resetCustomColors: (theme: ThemeName, mode?: ColorMode) => void;\n\n getActiveColorPalette: (theme: ThemeName, mode: ColorMode) => ColorPalette | null;\n\n // Saved palette actions\n savePalette: (palette: Omit<SavedPalette, 'id' | 'createdAt' | 'category'>) => void;\n updatePalette: (id: string, updates: Partial<SavedPalette>) => void;\n renamePalette: (id: string, newName: string) => void;\n deletePalette: (id: string) => void;\n reorderPalettes: (palettes: SavedPalette[]) => void;\n getSavedPalettes: () => SavedPalette[];\n\n // Font theme actions\n applyFontTheme: (\n theme: ThemeName,\n mode: ColorMode,\n fontTheme: FontTheme\n ) => void;\n\n resetCustomFonts: (theme: ThemeName, mode?: ColorMode) => void;\n\n getActiveFontTheme: (theme: ThemeName, mode: ColorMode) => FontTheme | null;\n\n // Saved font theme actions\n saveFontTheme: (fontTheme: Omit<SavedFontTheme, 'id' | 'createdAt' | 'category'>) => void;\n updateFontTheme: (id: string, updates: Partial<SavedFontTheme>) => void;\n renameFontTheme: (id: string, newName: string) => void;\n deleteFontTheme: (id: string) => void;\n reorderFontThemes: (fontThemes: SavedFontTheme[]) => void;\n getSavedFontThemes: () => SavedFontTheme[];\n}\n\nexport const useCustomizer = create<CustomizerState>()(\n persist(\n (set, get) => ({\n motion: 5,\n prefersReducedMotion: false,\n customizationMode: 'simple',\n customColors: {},\n savedPalettes: [],\n customFontThemes: {},\n savedFontThemes: [],\n\n setMotion: (level) => set({ motion: level }),\n setPrefersReducedMotion: (value) => set({ prefersReducedMotion: value }),\n setCustomizationMode: (mode) => set({ customizationMode: mode }),\n\n setCustomPrimaryColor: (theme, mode, hexColor) => {\n const state = get();\n const currentPalette = state.customColors[theme]?.[mode];\n\n // Generate complete color palette\n const scale = generateColorScale(hexColor);\n const primaryForeground = getOptimalForeground(hexColor);\n\n // Compute all derived tokens based on dependency graph\n const derivedTokens = computeDerivedTokens('--color-primary', hexColor, mode);\n\n // In simple mode, generate secondary/accent from primary\n const isSimple = state.customizationMode === 'simple';\n\n const palette: ColorPalette = {\n primary: hexColor,\n primaryForeground,\n secondary: isSimple ? undefined : currentPalette?.secondary,\n secondaryForeground: isSimple ? undefined : currentPalette?.secondaryForeground,\n accent: isSimple ? undefined : currentPalette?.accent,\n accentForeground: isSimple ? undefined : currentPalette?.accentForeground,\n scale,\n derivedTokens,\n };\n\n set((state) => ({\n customColors: {\n ...state.customColors,\n [theme]: {\n ...state.customColors[theme],\n [mode]: palette,\n },\n },\n }));\n },\n\n setCustomSecondaryColor: (theme, mode, hexColor) => {\n const state = get();\n const currentPalette = state.customColors[theme]?.[mode];\n\n if (!currentPalette) return;\n\n const secondaryForeground = getOptimalForeground(hexColor);\n const derivedTokens = computeDerivedTokens('--color-secondary', hexColor, mode);\n\n set((state) => ({\n customColors: {\n ...state.customColors,\n [theme]: {\n ...state.customColors[theme],\n [mode]: {\n ...currentPalette,\n secondary: hexColor,\n secondaryForeground,\n derivedTokens: {\n ...currentPalette.derivedTokens,\n ...derivedTokens,\n },\n },\n },\n },\n }));\n },\n\n setCustomAccentColor: (theme, mode, hexColor) => {\n const state = get();\n const currentPalette = state.customColors[theme]?.[mode];\n\n if (!currentPalette) return;\n\n const accentForeground = getOptimalForeground(hexColor);\n const derivedTokens = computeDerivedTokens('--color-accent', hexColor, mode);\n\n set((state) => ({\n customColors: {\n ...state.customColors,\n [theme]: {\n ...state.customColors[theme],\n [mode]: {\n ...currentPalette,\n accent: hexColor,\n accentForeground,\n derivedTokens: {\n ...currentPalette.derivedTokens,\n ...derivedTokens,\n },\n },\n },\n },\n }));\n },\n\n applyColorPalette: (theme, mode, colors: {\n primary: string;\n secondary?: string;\n accent?: string;\n name?: string;\n description?: string;\n }) => {\n // Generate complete color palette with all three colors in a single atomic update\n const scale = generateColorScale(colors.primary);\n const primaryForeground = getOptimalForeground(colors.primary);\n\n // Compute all derived tokens\n let derivedTokens = computeDerivedTokens('--color-primary', colors.primary, mode);\n\n // Add secondary color if provided\n let secondary = colors.secondary;\n let secondaryForeground = secondary ? getOptimalForeground(secondary) : undefined;\n if (secondary) {\n const secondaryDerived = computeDerivedTokens('--color-secondary', secondary, mode);\n derivedTokens = { ...derivedTokens, ...secondaryDerived };\n }\n\n // Add accent color if provided\n let accent = colors.accent;\n let accentForeground = accent ? getOptimalForeground(accent) : undefined;\n if (accent) {\n const accentDerived = computeDerivedTokens('--color-accent', accent, mode);\n derivedTokens = { ...derivedTokens, ...accentDerived };\n }\n\n const palette: ColorPalette = {\n name: colors.name,\n description: colors.description,\n primary: colors.primary,\n primaryForeground,\n secondary,\n secondaryForeground,\n accent,\n accentForeground,\n scale,\n derivedTokens,\n };\n\n set((state) => ({\n customColors: {\n ...state.customColors,\n [theme]: {\n ...state.customColors[theme],\n [mode]: palette,\n },\n },\n }));\n },\n\n resetCustomColors: (theme, mode) => {\n if (mode) {\n // Reset specific mode\n set((state) => ({\n customColors: {\n ...state.customColors,\n [theme]: {\n ...state.customColors[theme],\n [mode]: undefined,\n },\n },\n }));\n } else {\n // Reset entire theme\n set((state) => {\n const { [theme]: _, ...rest } = state.customColors;\n return { customColors: rest };\n });\n }\n },\n\n getActiveColorPalette: (theme, mode) => {\n return get().customColors[theme]?.[mode] || null;\n },\n\n // Saved palette management\n savePalette: (paletteData) => {\n const id = `custom-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;\n const newPalette: SavedPalette = {\n ...paletteData,\n id,\n category: 'custom',\n createdAt: Date.now(),\n };\n\n set((state) => ({\n savedPalettes: [...state.savedPalettes, newPalette],\n }));\n },\n\n updatePalette: (id, updates) => {\n set((state) => ({\n savedPalettes: state.savedPalettes.map((p) =>\n p.id === id ? { ...p, ...updates } : p\n ),\n }));\n },\n\n renamePalette: (id, newName) => {\n set((state) => ({\n savedPalettes: state.savedPalettes.map((p) =>\n p.id === id ? { ...p, name: newName } : p\n ),\n }));\n },\n\n deletePalette: (id) => {\n set((state) => ({\n savedPalettes: state.savedPalettes.filter((p) => p.id !== id),\n }));\n },\n\n reorderPalettes: (palettes) => {\n set({ savedPalettes: palettes });\n },\n\n getSavedPalettes: () => {\n return get().savedPalettes;\n },\n\n // Font theme management\n applyFontTheme: (theme, mode, fontTheme) => {\n set((state) => ({\n customFontThemes: {\n ...state.customFontThemes,\n [theme]: {\n ...state.customFontThemes[theme],\n [mode]: fontTheme,\n },\n },\n }));\n },\n\n resetCustomFonts: (theme, mode) => {\n if (mode) {\n // Reset specific mode\n set((state) => ({\n customFontThemes: {\n ...state.customFontThemes,\n [theme]: {\n ...state.customFontThemes[theme],\n [mode]: undefined,\n },\n },\n }));\n } else {\n // Reset entire theme\n set((state) => {\n const { [theme]: _, ...rest } = state.customFontThemes;\n return { customFontThemes: rest };\n });\n }\n },\n\n getActiveFontTheme: (theme, mode) => {\n return get().customFontThemes[theme]?.[mode] || null;\n },\n\n // Saved font theme management\n saveFontTheme: (fontThemeData) => {\n const id = `font-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;\n const newFontTheme: SavedFontTheme = {\n ...fontThemeData,\n id,\n category: 'custom',\n createdAt: Date.now(),\n isCustom: true,\n };\n\n set((state) => ({\n savedFontThemes: [...state.savedFontThemes, newFontTheme],\n }));\n },\n\n updateFontTheme: (id, updates) => {\n set((state) => ({\n savedFontThemes: state.savedFontThemes.map((ft) =>\n ft.id === id ? { ...ft, ...updates } : ft\n ),\n }));\n },\n\n renameFontTheme: (id, newName) => {\n set((state) => ({\n savedFontThemes: state.savedFontThemes.map((ft) =>\n ft.id === id ? { ...ft, name: newName } : ft\n ),\n }));\n },\n\n deleteFontTheme: (id) => {\n set((state) => ({\n savedFontThemes: state.savedFontThemes.filter((ft) => ft.id !== id),\n }));\n },\n\n reorderFontThemes: (fontThemes) => {\n set({ savedFontThemes: fontThemes });\n },\n\n getSavedFontThemes: () => {\n return get().savedFontThemes;\n },\n }),\n {\n name: 'ecosystem-customizer',\n version: 4,\n partialize: (state) => ({\n motion: state.motion,\n prefersReducedMotion: state.prefersReducedMotion,\n customizationMode: state.customizationMode,\n customColors: state.customColors,\n savedPalettes: state.savedPalettes,\n customFontThemes: state.customFontThemes,\n savedFontThemes: state.savedFontThemes,\n }),\n }\n )\n);\n","/**\n * Base Design Tokens\n * Shared across all themes (spacing, typography scales, motion)\n */\n\nexport const baseTokens = {\n /**\n * Spacing scale (based on 4px grid)\n */\n spacing: {\n '0': '0',\n '0.5': '0.125rem', // 2px\n '1': '0.25rem', // 4px\n '2': '0.5rem', // 8px\n '3': '0.75rem', // 12px\n '4': '1rem', // 16px\n '5': '1.25rem', // 20px\n '6': '1.5rem', // 24px\n '8': '2rem', // 32px\n '10': '2.5rem', // 40px\n '12': '3rem', // 48px\n '16': '4rem', // 64px\n '20': '5rem', // 80px\n '24': '6rem', // 96px\n '32': '8rem', // 128px\n },\n\n /**\n * Typography scales\n */\n fontSize: {\n 'xs': '0.75rem', // 12px\n 'sm': '0.875rem', // 14px\n 'base': '1rem', // 16px\n 'lg': '1.125rem', // 18px\n 'xl': '1.25rem', // 20px\n '2xl': '1.5rem', // 24px\n '3xl': '1.875rem', // 30px\n '4xl': '2.25rem', // 36px\n '5xl': '3rem', // 48px\n '6xl': '3.75rem', // 60px\n '7xl': '4.5rem', // 72px\n '8xl': '6rem', // 96px\n },\n\n fontWeight: {\n light: '300',\n normal: '400',\n medium: '500',\n semibold: '600',\n bold: '700',\n extrabold: '800',\n black: '900',\n },\n\n lineHeight: {\n none: '1',\n tight: '1.25',\n snug: '1.375',\n normal: '1.5',\n relaxed: '1.625',\n loose: '2',\n },\n\n /**\n * Border radius\n */\n borderRadius: {\n none: '0',\n sm: '0.125rem', // 2px\n DEFAULT: '0.25rem', // 4px\n md: '0.375rem', // 6px\n lg: '0.5rem', // 8px\n xl: '0.75rem', // 12px\n '2xl': '1rem', // 16px\n '3xl': '1.5rem', // 24px\n full: '9999px',\n },\n\n /**\n * Motion durations (base values - themes can override)\n */\n duration: {\n instant: '0ms',\n fast: '150ms',\n normal: '300ms',\n slow: '500ms',\n slower: '800ms',\n },\n\n /**\n * Easing curves (base values - themes can override)\n */\n ease: {\n linear: 'linear',\n in: 'cubic-bezier(0.4, 0, 1, 1)',\n out: 'cubic-bezier(0, 0, 0.2, 1)',\n inOut: 'cubic-bezier(0.4, 0, 0.2, 1)',\n },\n\n /**\n * Z-index scale\n */\n zIndex: {\n 'auto': 'auto',\n '0': '0',\n '10': '10',\n '20': '20',\n '30': '30',\n '40': '40',\n '50': '50',\n dropdown: '1000',\n sticky: '1020',\n fixed: '1030',\n modalBackdrop: '1040',\n modal: '1050',\n popover: '1060',\n tooltip: '1070',\n },\n\n /**\n * Focus ring configuration\n */\n focus: {\n width: '2px',\n offset: '2px',\n style: 'solid',\n },\n} as const;\n\nexport type BaseTokens = typeof baseTokens;\n\n/**\n * Semantic spacing aliases\n * Provides human-readable names matching the README documentation\n */\nexport const spacing = {\n xs: baseTokens.spacing['1'], // 4px — Tight internal padding\n sm: baseTokens.spacing['2'], // 8px — Default gap\n md: baseTokens.spacing['4'], // 16px — Section padding\n lg: baseTokens.spacing['6'], // 24px — Card padding\n xl: baseTokens.spacing['8'], // 32px — Section margins\n '2xl': baseTokens.spacing['12'], // 48px — Page sections\n '3xl': baseTokens.spacing['16'], // 64px — Major divisions\n} as const;\n\n/**\n * Semantic typography aliases\n */\nexport const typography = {\n fonts: {\n sans: 'var(--font-body)',\n serif: 'var(--font-heading)',\n mono: 'var(--font-mono)',\n },\n sizes: {\n xs: baseTokens.fontSize.xs, // 12px — Fine print\n sm: baseTokens.fontSize.sm, // 14px — Secondary text\n base: baseTokens.fontSize.base, // 16px — Body text\n lg: baseTokens.fontSize.lg, // 18px — Lead paragraphs\n xl: baseTokens.fontSize.xl, // 20px — Section headers\n '2xl': baseTokens.fontSize['2xl'], // 24px — Page headers\n '3xl': baseTokens.fontSize['3xl'], // 30px — Hero text\n },\n weights: {\n normal: baseTokens.fontWeight.normal, // 400\n medium: baseTokens.fontWeight.medium, // 500\n semibold: baseTokens.fontWeight.semibold, // 600\n bold: baseTokens.fontWeight.bold, // 700\n },\n leading: {\n tight: baseTokens.lineHeight.tight, // 1.25 — Headings\n normal: baseTokens.lineHeight.normal, // 1.5 — Body\n relaxed: baseTokens.lineHeight.relaxed, // 1.625 — Spacious reading\n },\n} as const;\n\n/**\n * Motion configuration\n */\nexport const motion = {\n duration: baseTokens.duration,\n easing: {\n default: baseTokens.ease.out, // Most transitions\n spring: 'cubic-bezier(0.16, 1, 0.3, 1)', // Playful interactions\n linear: baseTokens.ease.linear, // Progress indicators\n },\n} as const;\n","/**\n * Studio Theme Tokens\n * Professional, polished, balanced design\n * Inspiration: Framer, Vercel, Linear\n */\n\nexport const studioTokens = {\n light: {\n colors: {\n // Backgrounds\n background: '#ffffff',\n backgroundSecondary: '#fafafa',\n backgroundTertiary: '#f5f5f5',\n\n // Foregrounds\n foreground: '#0a0a0a',\n foregroundSecondary: '#525252',\n foregroundTertiary: '#a3a3a3',\n\n // Brand\n primary: '#0a0a0a',\n primaryForeground: '#ffffff',\n\n secondary: '#f5f5f5',\n secondaryForeground: '#0a0a0a',\n\n accent: '#0070f3',\n accentForeground: '#ffffff',\n\n // Borders\n border: '#d4d4d4',\n borderSubtle: '#f5f5f5',\n\n // States\n hover: '#fafafa',\n active: '#f0f0f0',\n\n // Link hover states\n linkHover: '#0a0a0a',\n linkHoverForeground: '#ffffff',\n\n // Semantic\n success: '#00a86b',\n successForeground: '#ffffff',\n\n warning: '#f59e0b',\n warningForeground: '#ffffff',\n\n error: '#ef4444',\n errorForeground: '#ffffff',\n\n info: '#0070f3',\n infoForeground: '#ffffff',\n\n // Component-specific colors\n card: '#ffffff',\n cardForeground: '#0a0a0a',\n\n popover: '#ffffff',\n popoverForeground: '#0a0a0a',\n\n muted: '#f5f5f5',\n mutedForeground: '#737373',\n\n destructive: '#ef4444',\n destructiveForeground: '#ffffff',\n\n input: '#d4d4d4',\n ring: '#0a0a0a',\n\n // Surface is used by various components\n surface: '#fafafa',\n\n // Glass effects\n glass: 'rgba(255, 255, 255, 0.7)',\n glassBorder: 'rgba(0, 0, 0, 0.1)',\n },\n\n effects: {\n blur: {\n sm: 'blur(4px)',\n md: 'blur(8px)',\n lg: 'blur(16px)',\n xl: 'blur(24px)',\n },\n\n shadow: {\n sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n md: '0 4px 6px -1px rgba(0, 0, 0, 0.1)',\n lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1)',\n xl: '0 20px 25px -5px rgba(0, 0, 0, 0.1)',\n '2xl': '0 25px 50px -12px rgba(0, 0, 0, 0.25)',\n },\n },\n },\n\n dark: {\n colors: {\n // Backgrounds\n background: '#000000',\n backgroundSecondary: '#171717',\n backgroundTertiary: '#262626',\n\n // Foregrounds\n foreground: '#fafafa',\n foregroundSecondary: '#a3a3a3',\n foregroundTertiary: '#858585',\n\n // Brand\n primary: '#ffffff',\n primaryForeground: '#0a0a0a',\n\n secondary: '#262626',\n secondaryForeground: '#fafafa',\n\n accent: '#0090ff',\n accentForeground: '#ffffff',\n\n // Borders\n border: '#404040',\n borderSubtle: '#1a1a1a',\n\n // States\n hover: '#1a1a1a',\n active: '#262626',\n\n // Link hover states\n linkHover: '#ffffff',\n linkHoverForeground: '#0a0a0a',\n\n // Semantic\n success: '#10b981',\n successForeground: '#ffffff',\n\n warning: '#f59e0b',\n warningForeground: '#ffffff',\n\n error: '#ef4444',\n errorForeground: '#ffffff',\n\n info: '#0090ff',\n infoForeground: '#ffffff',\n\n // Component-specific colors\n card: '#0a0a0a',\n cardForeground: '#fafafa',\n\n popover: '#0a0a0a',\n popoverForeground: '#fafafa',\n\n muted: '#262626',\n mutedForeground: '#a3a3a3',\n\n destructive: '#ef4444',\n destructiveForeground: '#ffffff',\n\n input: '#404040',\n ring: '#d4d4d4',\n\n // Surface is used by various components\n surface: '#171717',\n\n // Glass effects\n glass: 'rgba(0, 0, 0, 0.7)',\n glassBorder: 'rgba(255, 255, 255, 0.1)',\n },\n\n effects: {\n blur: {\n sm: 'blur(4px)',\n md: 'blur(8px)',\n lg: 'blur(16px)',\n xl: 'blur(24px)',\n },\n\n shadow: {\n sm: '0 1px 2px 0 rgba(0, 0, 0, 0.3)',\n md: '0 4px 6px -1px rgba(0, 0, 0, 0.5)',\n lg: '0 10px 15px -3px rgba(0, 0, 0, 0.6)',\n xl: '0 20px 25px -5px rgba(0, 0, 0, 0.7)',\n '2xl': '0 25px 50px -12px rgba(0, 0, 0, 0.8)',\n },\n },\n },\n\n /**\n * Motion personality for Studio theme\n */\n motion: {\n // Duration scales based on motion slider (0-10)\n getDuration: (intensity: number): string => {\n if (intensity === 0) return '0ms';\n // Linear scale: 150ms at intensity 1, 500ms at intensity 10\n const ms = 150 + (intensity - 1) * 40;\n return `${ms}ms`;\n },\n\n // Easing curves - smooth and professional\n ease: {\n default: 'cubic-bezier(0.4, 0, 0.2, 1)', // ease-in-out\n in: 'cubic-bezier(0.4, 0, 1, 1)',\n out: 'cubic-bezier(0, 0, 0.2, 1)',\n spring: 'cubic-bezier(0.16, 1, 0.3, 1)', // Smooth spring\n },\n },\n\n /**\n * Typography for Studio theme\n */\n typography: {\n heading: {\n fontFamily: 'var(--font-geist-sans)',\n fontWeight: '600',\n letterSpacing: '-0.02em',\n },\n\n body: {\n fontFamily: 'var(--font-geist-sans)',\n fontWeight: '400',\n letterSpacing: '0',\n },\n\n mono: {\n fontFamily: 'var(--font-geist-mono)',\n fontWeight: '400',\n letterSpacing: '0',\n },\n },\n} as const;\n\nexport type StudioTheme = typeof studioTokens;\n","/**\n * Terra Theme Tokens\n * Calm, organic, feminine/yin design\n * Muted earth tones, flowing animations\n */\n\nexport const terraTokens = {\n light: {\n colors: {\n // Warm, earthy backgrounds\n background: '#faf8f5',\n backgroundSecondary: '#f5f1eb',\n backgroundTertiary: '#ede8e0',\n\n // Warm neutrals for text\n foreground: '#2d2823',\n foregroundSecondary: '#5a524a',\n foregroundTertiary: '#8a7f72',\n\n // Muted sage green as primary\n primary: '#7a9b7f',\n primaryForeground: '#faf8f5',\n primaryHover: '#6a8b6f',\n\n // Secondary - warm stone\n secondary: '#ede8e0',\n secondaryForeground: '#2d2823',\n\n // Warm terracotta accent\n accent: '#c17a5f',\n accentForeground: '#faf8f5',\n accentHover: '#b16a4f',\n\n // Semantic colors with muted, organic tones\n success: '#6b8e6f',\n successForeground: '#faf8f5',\n\n warning: '#d4a574',\n warningForeground: '#2d2823',\n\n error: '#c17a5f',\n errorForeground: '#faf8f5',\n\n info: '#8b9dc3',\n infoForeground: '#faf8f5',\n\n // Borders - warm subtle\n border: '#e0d8cf',\n borderSubtle: '#ede8e0',\n\n // States\n hover: '#f5f1eb',\n active: '#ede8e0',\n\n // Link hover states - Muted sage green\n linkHover: '#7a9b7f',\n linkHoverForeground: '#faf8f5',\n\n // Soft glass effects\n glass: 'rgba(250, 248, 245, 0.85)',\n glassBorder: 'rgba(122, 155, 127, 0.15)',\n },\n effects: {\n blur: {\n sm: 'blur(6px)',\n md: 'blur(12px)',\n lg: 'blur(20px)',\n xl: 'blur(32px)',\n },\n shadow: {\n sm: '0 2px 4px 0 rgba(45, 40, 35, 0.06)',\n md: '0 4px 8px -2px rgba(45, 40, 35, 0.08)',\n lg: '0 8px 16px -4px rgba(45, 40, 35, 0.12)',\n xl: '0 16px 32px -8px rgba(45, 40, 35, 0.16)',\n '2xl': '0 24px 48px -12px rgba(45, 40, 35, 0.20)',\n },\n },\n },\n\n dark: {\n colors: {\n // Deep forest backgrounds\n background: '#1a1614',\n backgroundSecondary: '#252220',\n backgroundTertiary: '#2f2b28',\n\n // Warm light text\n foreground: '#f5f1eb',\n foregroundSecondary: '#c7bfb5',\n foregroundTertiary: '#8a7f72',\n\n // Brighter sage for dark mode\n primary: '#a8c5ad',\n primaryForeground: '#1a1614',\n primaryHover: '#b8d5bd',\n\n // Secondary - lighter warm stone\n secondary: '#2f2b28',\n secondaryForeground: '#f5f1eb',\n\n // Warm peachy accent for dark\n accent: '#e5a78a',\n accentForeground: '#1a1614',\n accentHover: '#f5b79a',\n\n // Semantic colors adjusted for dark\n success: '#95b89a',\n successForeground: '#1a1614',\n\n warning: '#e5c59a',\n warningForeground: '#1a1614',\n\n error: '#e5a78a',\n errorForeground: '#1a1614',\n\n info: '#a8b5d5',\n infoForeground: '#1a1614',\n\n // Borders\n border: '#3a3530',\n borderSubtle: '#2f2b28',\n\n // States\n hover: '#252220',\n active: '#2f2b28',\n\n // Link hover states - Brighter sage for dark mode\n linkHover: '#a8c5ad',\n linkHoverForeground: '#1a1614',\n\n // Dark glass effects\n glass: 'rgba(26, 22, 20, 0.85)',\n glassBorder: 'rgba(168, 197, 173, 0.2)',\n },\n effects: {\n blur: {\n sm: 'blur(6px)',\n md: 'blur(12px)',\n lg: 'blur(20px)',\n xl: 'blur(32px)',\n },\n shadow: {\n sm: '0 2px 4px 0 rgba(0, 0, 0, 0.3)',\n md: '0 4px 8px -2px rgba(0, 0, 0, 0.4)',\n lg: '0 8px 16px -4px rgba(0, 0, 0, 0.5)',\n xl: '0 16px 32px -8px rgba(0, 0, 0, 0.6)',\n '2xl': '0 24px 48px -12px rgba(0, 0, 0, 0.7)',\n },\n },\n },\n\n motion: {\n getDuration: (intensity: number): string => {\n if (intensity === 0) return '0ms';\n // Slower, more organic durations\n const ms = 300 + (intensity - 1) * 60;\n return `${ms}ms`;\n },\n\n ease: {\n default: 'cubic-bezier(0.33, 1, 0.68, 1)', // Organic, flowing\n in: 'cubic-bezier(0.4, 0, 1, 1)',\n out: 'cubic-bezier(0, 0, 0.2, 1)',\n spring: 'cubic-bezier(0.16, 1, 0.3, 1)',\n },\n },\n\n interactions: {\n hover: {\n overlayColor: 'var(--color-interaction-overlay)',\n opacity: 'var(--opacity-interaction-hover)',\n },\n active: {\n scale: 'var(--scale-interaction-active)',\n },\n focus: {\n ringColor: 'var(--color-interaction-focus-ring)',\n ringWidth: 'var(--width-interaction-focus-ring)',\n ringOffset: 'var(--width-interaction-focus-offset)',\n },\n disabled: {\n opacity: 'var(--opacity-interaction-disabled)',\n },\n },\n\n typography: {\n heading: {\n fontFamily: 'var(--font-terra-serif)', // Lora serif\n fontWeight: '600',\n letterSpacing: '-0.01em',\n },\n\n body: {\n fontFamily: 'var(--font-terra-sans)', // Instrument Sans\n fontWeight: '400',\n letterSpacing: '0',\n },\n\n mono: {\n fontFamily: 'var(--font-terra-mono)',\n fontWeight: '400',\n letterSpacing: '0',\n },\n },\n} as const;\n\nexport type TerraTheme = typeof terraTokens;\n","/**\n * Volt Theme Tokens\n * Bold, electric, masculine/yang design\n * High-chroma colors, dynamic animations, cyberpunk aesthetic\n */\n\nexport const voltTokens = {\n light: {\n colors: {\n // Bright, punchy backgrounds\n background: '#ffffff',\n backgroundSecondary: '#f8f9fb',\n backgroundTertiary: '#f0f2f5',\n\n // Sharp contrast text\n foreground: '#0a0a0a',\n foregroundSecondary: '#4a4a4a',\n foregroundTertiary: '#8a8a8a',\n\n // Electric blue primary (WCAG AA compliant)\n primary: '#0066ff',\n primaryForeground: '#ffffff',\n primaryHover: '#0052cc',\n\n // Secondary - cool gray\n secondary: '#f0f2f5',\n secondaryForeground: '#0a0a0a',\n\n // Vibrant cyan accent\n accent: '#00d9ff',\n accentForeground: '#0a0a0a',\n accentHover: '#00c3e6',\n\n // Bold semantic colors\n success: '#00cc66',\n successForeground: '#ffffff',\n\n warning: '#ffaa00',\n warningForeground: '#0a0a0a',\n\n error: '#ff3366',\n errorForeground: '#ffffff',\n\n info: '#3399ff',\n infoForeground: '#ffffff',\n\n // Borders\n border: '#e0e4ea',\n borderSubtle: '#f0f2f5',\n\n // States\n hover: '#f8f9fb',\n active: '#f0f2f5',\n\n // Link hover states - Electric blue with high contrast\n linkHover: '#0066ff',\n linkHoverForeground: '#ffffff',\n\n // Crisp glass effects\n glass: 'rgba(255, 255, 255, 0.8)',\n glassBorder: 'rgba(0, 102, 255, 0.2)',\n },\n effects: {\n blur: {\n sm: 'blur(8px)',\n md: 'blur(16px)',\n lg: 'blur(32px)',\n xl: 'blur(48px)',\n },\n shadow: {\n sm: '0 0 8px rgba(0, 102, 255, 0.15)',\n md: '0 0 16px rgba(0, 102, 255, 0.2)',\n lg: '0 0 24px rgba(0, 102, 255, 0.25)',\n xl: '0 0 32px rgba(0, 102, 255, 0.3)',\n '2xl': '0 0 48px rgba(0, 102, 255, 0.4)',\n },\n },\n },\n\n dark: {\n colors: {\n // Pure black cyberpunk background\n background: '#000000',\n backgroundSecondary: '#0a0a0a',\n backgroundTertiary: '#141414',\n\n // Bright white text\n foreground: '#ffffff',\n foregroundSecondary: '#b3b3b3',\n foregroundTertiary: '#666666',\n\n // Neon blue primary\n primary: '#0099ff',\n primaryForeground: '#000000',\n primaryHover: '#00aaff',\n\n // Secondary - dark gray\n secondary: '#141414',\n secondaryForeground: '#ffffff',\n\n // Neon cyan accent\n accent: '#00ffff',\n accentForeground: '#000000',\n accentHover: '#33ffff',\n\n // Neon semantic colors\n success: '#00ff99',\n successForeground: '#000000',\n\n warning: '#ffcc00',\n warningForeground: '#000000',\n\n error: '#ff0066',\n errorForeground: '#ffffff',\n\n info: '#66ccff',\n infoForeground: '#000000',\n\n // Borders\n border: '#1a1a1a',\n borderSubtle: '#141414',\n\n // States\n hover: '#0a0a0a',\n active: '#141414',\n\n // Link hover states - Neon cyan (high luma)\n linkHover: '#00ffff',\n linkHoverForeground: '#000000',\n\n // Dark glass with glow\n glass: 'rgba(0, 0, 0, 0.8)',\n glassBorder: 'rgba(0, 153, 255, 0.3)',\n },\n effects: {\n blur: {\n sm: 'blur(8px)',\n md: 'blur(16px)',\n lg: 'blur(32px)',\n xl: 'blur(48px)',\n },\n shadow: {\n sm: '0 0 12px rgba(0, 153, 255, 0.4)',\n md: '0 0 20px rgba(0, 153, 255, 0.5)',\n lg: '0 0 32px rgba(0, 153, 255, 0.6)',\n xl: '0 0 48px rgba(0, 153, 255, 0.7)',\n '2xl': '0 0 64px rgba(0, 153, 255, 0.8)',\n },\n },\n },\n\n motion: {\n getDuration: (intensity: number): string => {\n if (intensity === 0) return '0ms';\n // Fast, snappy durations\n const ms = 100 + (intensity - 1) * 25;\n return `${ms}ms`;\n },\n\n ease: {\n default: 'cubic-bezier(0.16, 1, 0.3, 1)', // Snappy spring\n in: 'cubic-bezier(0.4, 0, 1, 1)',\n out: 'cubic-bezier(0, 0, 0.2, 1)',\n spring: 'cubic-bezier(0.68, -0.55, 0.27, 1.55)', // Bouncy\n },\n },\n\n typography: {\n heading: {\n fontFamily: 'var(--font-volt-sans)', // Space Grotesk\n fontWeight: '700', // Bold\n letterSpacing: '-0.03em',\n },\n\n body: {\n fontFamily: 'var(--font-volt-sans)',\n fontWeight: '400',\n letterSpacing: '0',\n },\n\n mono: {\n fontFamily: 'var(--font-volt-mono)', // Fira Code\n fontWeight: '400',\n letterSpacing: '0',\n },\n },\n} as const;\n\nexport type VoltTheme = typeof voltTokens;\n","/**\n * Typography Tokens\n *\n * Central typography system for the design system.\n * Defines font families, sizes, weights, line heights, and letter spacing.\n *\n * Architecture:\n * - Font families are theme-specific and loaded via Next.js font optimization\n * - Sizes, weights, etc. are universal across all themes\n * - Easily extensible for new themes/font sets\n *\n * Usage:\n * 1. Import in theme-specific apps to load fonts\n * 2. Reference via CSS variables (--font-*, --text-*, etc.)\n * 3. Add to Customizer for theme switching\n */\n\n// ============================================================================\n// FONT FAMILIES\n// ============================================================================\n\n/**\n * Font Family Definitions\n *\n * Each theme has its own font personality:\n * - Studio: Modern, geometric, professional\n * - Sage: Elegant, serif + sans combo\n * - Volt: Tech-forward, consistent throughout\n *\n * To add a new theme:\n * 1. Add entry to fontFamilies\n * 2. Load fonts in consuming app's layout\n * 3. Map to CSS variables in ThemeProvider\n */\nexport const fontFamilies = {\n studio: {\n heading: 'Outfit',\n body: 'Manrope',\n mono: 'Fira Code',\n description: 'Modern geometric sans-serif with clean readability',\n usage: {\n heading: 'Headlines, titles, emphasis',\n body: 'Paragraphs, UI text, readable content',\n mono: 'Code blocks, technical content',\n },\n },\n terra: {\n heading: 'Lora', // Serif for elegance\n body: 'Instrument Sans',\n serif: 'Lora', // Explicit serif reference\n sans: 'Instrument Sans', // Explicit sans reference\n mono: 'Fira Code',\n description: 'Elegant serif headings with modern sans body',\n usage: {\n heading: 'Elegant headings, article titles',\n body: 'Long-form content, UI text',\n serif: 'Pull quotes, emphasis',\n sans: 'UI elements, captions',\n mono: 'Code blocks, technical content',\n },\n },\n volt: {\n heading: 'Space Grotesk',\n body: 'Space Grotesk',\n sans: 'Space Grotesk',\n mono: 'Fira Code',\n description: 'Tech-forward, consistent geometric throughout',\n usage: {\n heading: 'All headlines',\n body: 'All body text (unified typography)',\n sans: 'All sans-serif needs',\n mono: 'Code blocks, technical content',\n },\n },\n} as const;\n\n/**\n * Type-safe theme names based on font families\n */\nexport type TypographyTheme = keyof typeof fontFamilies;\n\n/**\n * Font loading configuration for Next.js\n * Use this to load fonts in app layouts\n */\nexport const fontLoadingConfig = {\n studio: {\n heading: { family: 'Outfit', weights: ['300', '400', '500', '600', '700', '800'] },\n body: { family: 'Manrope', weights: ['300', '400', '500', '600', '700', '800'] },\n mono: { family: 'Fira Code', weights: ['400', '500', '600', '700'] },\n },\n terra: {\n heading: { family: 'Lora', weights: ['400', '500', '600', '700'] },\n body: { family: 'Instrument Sans', weights: ['400', '500', '600', '700'] },\n mono: { family: 'Fira Code', weights: ['400', '500', '600', '700'] },\n },\n volt: {\n heading: { family: 'Space Grotesk', weights: ['300', '400', '500', '600', '700'] },\n body: { family: 'Space Grotesk', weights: ['300', '400', '500', '600', '700'] },\n mono: { family: 'Fira Code', weights: ['400', '500', '600', '700'] },\n },\n} as const;\n\n// ============================================================================\n// FONT SIZES\n// ============================================================================\n\n/**\n * Font Size Scale\n *\n * Based on a modular scale for harmonious typography.\n * Mobile-first with responsive scaling.\n *\n * Naming convention:\n * - xs, sm, base, lg, xl, 2xl, etc. for body text\n * - Numeric for headings (aligns with h1-h6)\n */\nexport const fontSizes = {\n // Body text scale\n xs: { base: '0.75rem', mobile: '0.75rem' }, // 12px\n sm: { base: '0.875rem', mobile: '0.875rem' }, // 14px\n base: { base: '1rem', mobile: '1rem' }, // 16px\n lg: { base: '1.125rem', mobile: '1rem' }, // 18px / 16px mobile\n xl: { base: '1.25rem', mobile: '1.125rem' }, // 20px / 18px mobile\n '2xl': { base: '1.5rem', mobile: '1.25rem' }, // 24px / 20px mobile\n '3xl': { base: '1.875rem', mobile: '1.5rem' }, // 30px / 24px mobile\n\n // Heading scale (h6 → h1)\n '4xl': { base: '2.25rem', mobile: '1.875rem' }, // 36px / 30px - h3\n '5xl': { base: '3rem', mobile: '2.25rem' }, // 48px / 36px - h2\n '6xl': { base: '3.75rem', mobile: '2.5rem' }, // 60px / 40px - h1\n '7xl': { base: '4.5rem', mobile: '3rem' }, // 72px / 48px - Display\n '8xl': { base: '6rem', mobile: '3.75rem' }, // 96px / 60px - Hero\n '9xl': { base: '8rem', mobile: '4.5rem' }, // 128px / 72px - Ultra\n} as const;\n\n/**\n * Semantic font size mappings\n * Maps semantic names to scale values\n */\nexport const semanticSizes = {\n 'heading-1': 'hero',\n 'heading-2': '5xl',\n 'heading-3': '4xl',\n 'heading-4': '2xl',\n 'heading-5': 'xl',\n 'heading-6': 'lg',\n 'body-large': 'lg',\n 'body': 'base',\n 'body-small': 'sm',\n 'caption': 'xs',\n} as const;\n\n// ============================================================================\n// FONT WEIGHTS\n// ============================================================================\n\n/**\n * Font Weight Scale\n *\n * Standard numeric weights with semantic aliases.\n * Not all fonts support all weights - check font-specific availability.\n */\nexport const fontWeights = {\n thin: '100',\n extralight: '200',\n light: '300',\n normal: '400',\n medium: '500',\n semibold: '600',\n bold: '700',\n extrabold: '800',\n black: '900',\n} as const;\n\n/**\n * Semantic weight mappings\n */\nexport const semanticWeights = {\n heading: 'bold', // Default heading weight\n 'heading-light': 'semibold',\n 'heading-heavy': 'extrabold',\n body: 'normal', // Default body weight\n 'body-emphasis': 'medium',\n 'body-strong': 'semibold',\n caption: 'normal',\n} as const;\n\n// ============================================================================\n// LINE HEIGHTS\n// ============================================================================\n\n/**\n * Line Height Scale\n *\n * Unitless values for better scalability.\n * Tighter for headings, relaxed for body text.\n */\nexport const lineHeights = {\n none: '1',\n tight: '1.25',\n snug: '1.375',\n normal: '1.5',\n relaxed: '1.625',\n loose: '1.75',\n extraloose: '2',\n} as const;\n\n/**\n * Semantic line height mappings\n */\nexport const semanticLineHeights = {\n heading: 'tight',\n 'heading-display': 'none', // Very tight for large display text\n body: 'normal',\n 'body-relaxed': 'relaxed',\n caption: 'snug',\n} as const;\n\n// ============================================================================\n// LETTER SPACING\n// ============================================================================\n\n/**\n * Letter Spacing (Tracking) Scale\n *\n * In ems for scalability across font sizes.\n * Negative for headings, positive for small caps.\n */\nexport const letterSpacing = {\n tighter: '-0.05em',\n tight: '-0.025em',\n normal: '0',\n wide: '0.025em',\n wider: '0.05em',\n widest: '0.1em',\n} as const;\n\n/**\n * Semantic letter spacing mappings\n */\nexport const semanticLetterSpacing = {\n heading: 'tight',\n 'heading-display': 'tighter',\n body: 'normal',\n 'small-caps': 'wider',\n 'all-caps': 'widest',\n} as const;\n\n// ============================================================================\n// TYPE SCALE PRESETS\n// ============================================================================\n\n/**\n * Complete typography presets for common use cases\n * Combines size, weight, line-height, and letter-spacing\n *\n * Usage: Apply entire preset to a component\n */\nexport const typePresets = {\n 'display-large': {\n size: fontSizes['8xl'],\n weight: fontWeights.bold,\n lineHeight: lineHeights.none,\n letterSpacing: letterSpacing.tighter,\n description: 'Large hero text, landing pages',\n },\n 'display': {\n size: fontSizes['7xl'],\n weight: fontWeights.bold,\n lineHeight: lineHeights.tight,\n letterSpacing: letterSpacing.tight,\n description: 'Hero sections, major headings',\n },\n 'heading-1': {\n size: fontSizes['6xl'],\n weight: fontWeights.bold,\n lineHeight: lineHeights.tight,\n letterSpacing: letterSpacing.tight,\n description: 'Page titles, h1',\n },\n 'heading-2': {\n size: fontSizes['5xl'],\n weight: fontWeights.bold,\n lineHeight: lineHeights.tight,\n letterSpacing: letterSpacing.normal,\n description: 'Section titles, h2',\n },\n 'heading-3': {\n size: fontSizes['4xl'],\n weight: fontWeights.semibold,\n lineHeight: lineHeights.snug,\n letterSpacing: letterSpacing.normal,\n description: 'Subsection titles, h3',\n },\n 'heading-4': {\n size: fontSizes['2xl'],\n weight: fontWeights.semibold,\n lineHeight: lineHeights.snug,\n letterSpacing: letterSpacing.normal,\n description: 'Component titles, h4',\n },\n 'heading-5': {\n size: fontSizes.xl,\n weight: fontWeights.medium,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.normal,\n description: 'Small headings, h5',\n },\n 'heading-6': {\n size: fontSizes.lg,\n weight: fontWeights.medium,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.normal,\n description: 'Tiny headings, h6',\n },\n 'body-large': {\n size: fontSizes.lg,\n weight: fontWeights.normal,\n lineHeight: lineHeights.relaxed,\n letterSpacing: letterSpacing.normal,\n description: 'Lead paragraphs, intro text',\n },\n 'body': {\n size: fontSizes.base,\n weight: fontWeights.normal,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.normal,\n description: 'Default body text',\n },\n 'body-small': {\n size: fontSizes.sm,\n weight: fontWeights.normal,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.normal,\n description: 'Small body text, fine print',\n },\n 'caption': {\n size: fontSizes.xs,\n weight: fontWeights.normal,\n lineHeight: lineHeights.snug,\n letterSpacing: letterSpacing.wide,\n description: 'Captions, labels, metadata',\n },\n 'overline': {\n size: fontSizes.xs,\n weight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n letterSpacing: letterSpacing.widest,\n description: 'Eyebrows, categories, all-caps labels',\n },\n} as const;\n\n// ============================================================================\n// UTILITY FUNCTIONS\n// ============================================================================\n\n/**\n * Get CSS variable name for a font family\n */\nexport function getFontVariable(theme: TypographyTheme, type: 'heading' | 'body' | 'mono' | 'serif' | 'sans'): string {\n return `--font-${theme}-${type}`;\n}\n\n/**\n * Get all font family CSS variables for a theme\n */\nexport function getThemeFontVariables(theme: TypographyTheme): Record<string, string> {\n const fonts = fontFamilies[theme];\n const vars: Record<string, string> = {};\n\n Object.entries(fonts).forEach(([key, value]) => {\n if (typeof value === 'string') {\n vars[`--font-${theme}-${key}`] = value;\n }\n });\n\n return vars;\n}\n\n/**\n * Get responsive font size CSS\n */\nexport function getResponsiveFontSize(sizeKey: keyof typeof fontSizes): string {\n const size = fontSizes[sizeKey];\n return `font-size: ${size.mobile}; @media (min-width: 768px) { font-size: ${size.base}; }`;\n}\n\n// ============================================================================\n// EXPORTS\n// ============================================================================\n\n/**\n * Complete typography system export\n * Import this for access to entire typography token set\n *\n * Note: This is the comprehensive typography system with font families,\n * scales, presets, and utilities. For simple semantic aliases compatible\n * with existing code, use `typography` from './base'\n */\nexport const typographySystem = {\n families: fontFamilies,\n sizes: fontSizes,\n weights: fontWeights,\n lineHeights,\n letterSpacing,\n presets: typePresets,\n semantic: {\n sizes: semanticSizes,\n weights: semanticWeights,\n lineHeights: semanticLineHeights,\n letterSpacing: semanticLetterSpacing,\n },\n utils: {\n getFontVariable,\n getThemeFontVariables,\n getResponsiveFontSize,\n },\n} as const;\n\n/**\n * Type exports for TypeScript consumers\n */\nexport type FontSize = keyof typeof fontSizes;\nexport type FontWeight = keyof typeof fontWeights;\nexport type LineHeight = keyof typeof lineHeights;\nexport type LetterSpacing = keyof typeof letterSpacing;\nexport type TypePreset = keyof typeof typePresets;\n","/**\n * Syntax Highlighting Tokens\n * Based on VS Code Dark+ theme with light mode variants\n * Includes accessible background and border colors for code blocks\n */\n\nexport const syntaxColors = {\n light: {\n comment: '#22863a', // Green for comments\n keyword: '#8250df', // Purple for keywords (import, export, const, etc.)\n function: '#6639ba', // Purple for function names\n string: '#c1592a', // Orange for strings\n number: '#0a3069', // Blue for numbers\n boolean: '#0550ae', // Blue for booleans\n operator: '#1a1a1a', // Almost black for operators\n property: '#0550ae', // Blue for properties\n className: '#005cc5', // Blue for class names\n tag: '#005cc5', // Blue for HTML/JSX tags\n attribute: '#0550ae', // Blue for attributes\n variable: '#0550ae', // Blue for variables\n punctuation: '#57606a', // Gray for punctuation\n plain: '#1a1a1a', // Default text color\n },\n dark: {\n comment: '#6A9955', // Green for comments\n keyword: '#C586C0', // Purple for keywords (import, export, const, etc.)\n function: '#DCDCAA', // Yellow for function names\n string: '#CE9178', // Orange for strings\n number: '#B5CEA8', // Light green for numbers\n boolean: '#569CD6', // Blue for booleans\n operator: '#D4D4D4', // Light gray for operators\n property: '#9CDCFE', // Light blue for properties\n className: '#4EC9B0', // Cyan for class names\n tag: '#4EC9B0', // Cyan for HTML/JSX tags\n attribute: '#9CDCFE', // Light blue for attributes\n variable: '#9CDCFE', // Light blue for variables\n punctuation: '#808080', // Gray for punctuation\n plain: '#D4D4D4', // Default text color\n },\n} as const;\n\n/**\n * Code Block Background and Border Colors\n * Designed for optimal contrast and accessibility (WCAG AA 4.5:1)\n */\nexport const codeColors = {\n light: {\n // Block code background - cool gray for subtle distinction\n blockBackground: '#F8F9FA',\n // Inline code background - pale amber for warmth and visibility\n inlineBackground: '#FEF3E7',\n // Border color for definition and separation\n border: '#E1E4E8',\n },\n dark: {\n // Block code background - VS Code-inspired dark background\n blockBackground: '#1E1E1E',\n // Inline code background - slightly lighter for contrast\n inlineBackground: '#252525',\n // Border color for definition\n border: '#3D3D3D',\n },\n} as const;\n\nexport type SyntaxColorScheme = 'light' | 'dark';\nexport type SyntaxTokenType = keyof typeof syntaxColors.light;\n","/**\n * Color Transformation Utilities\n * Standalone utilities for the token system (no external dependencies)\n */\n\n/**\n * Convert hex to RGB\n */\nexport function hexToRgb(hex: string): { r: number; g: number; b: number } | null {\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result\n ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16),\n }\n : null;\n}\n\n/**\n * Convert hex to HSL\n */\nexport function hexToHSL(hex: string): { h: number; s: number; l: number } {\n const rgb = hexToRgb(hex);\n if (!rgb) return { h: 0, s: 0, l: 0 };\n\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h = 0, s = 0, l = (max + min) / 2;\n\n if (max !== min) {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n switch (max) {\n case r: h = ((g - b) / d + (g < b ? 6 : 0)) / 6; break;\n case g: h = ((b - r) / d + 2) / 6; break;\n case b: h = ((r - g) / d + 4) / 6; break;\n }\n }\n\n return {\n h: Math.round(h * 360),\n s: Math.round(s * 100),\n l: Math.round(l * 100),\n };\n}\n\n/**\n * Convert HSL to hex\n */\nexport function hslToHex(h: number, s: number, l: number): string {\n h = h / 360;\n s = s / 100;\n l = l / 100;\n\n let r, g, b;\n\n if (s === 0) {\n r = g = b = l;\n } else {\n const hue2rgb = (p: number, q: number, t: number) => {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1/6) return p + (q - p) * 6 * t;\n if (t < 1/2) return q;\n if (t < 2/3) return p + (q - p) * (2/3 - t) * 6;\n return p;\n };\n\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n\n r = hue2rgb(p, q, h + 1/3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1/3);\n }\n\n const toHex = (x: number) => {\n const hex = Math.round(x * 255).toString(16);\n return hex.length === 1 ? '0' + hex : hex;\n };\n\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\n/**\n * Adjust lightness of a hex color\n */\nexport function adjustLightness(hex: string, percent: number): string {\n const hsl = hexToHSL(hex);\n const newL = Math.max(0, Math.min(100, hsl.l + percent));\n return hslToHex(hsl.h, hsl.s, newL);\n}\n\n/**\n * Adjust saturation of a hex color\n */\nexport function adjustSaturation(hex: string, percent: number): string {\n const hsl = hexToHSL(hex);\n const newS = Math.max(0, Math.min(100, hsl.s + percent));\n return hslToHex(hsl.h, newS, hsl.l);\n}\n\n/**\n * Rotate hue of a hex color\n */\nexport function rotateHue(hex: string, degrees: number): string {\n const hsl = hexToHSL(hex);\n const newH = (hsl.h + degrees) % 360;\n return hslToHex(newH, hsl.s, hsl.l);\n}\n\n/**\n * Add opacity to a hex color (returns rgba CSS value)\n */\nexport function adjustOpacity(hex: string, opacity: number): string {\n const rgb = hexToRgb(hex);\n if (!rgb) return hex;\n return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${opacity})`;\n}\n\n/**\n * Calculate relative luminance (WCAG formula)\n */\nexport function getLuminance(r: number, g: number, b: number): number {\n const [rs, gs, bs] = [r, g, b].map((c) => {\n const srgb = c / 255;\n return srgb <= 0.03928 ? srgb / 12.92 : Math.pow((srgb + 0.055) / 1.055, 2.4);\n });\n return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;\n}\n\n/**\n * Calculate contrast ratio between two colors (WCAG formula)\n */\nexport function getContrastRatio(hex1: string, hex2: string): number {\n const rgb1 = hexToRgb(hex1);\n const rgb2 = hexToRgb(hex2);\n\n if (!rgb1 || !rgb2) return 0;\n\n const lum1 = getLuminance(rgb1.r, rgb1.g, rgb1.b);\n const lum2 = getLuminance(rgb2.r, rgb2.g, rgb2.b);\n\n const lighter = Math.max(lum1, lum2);\n const darker = Math.min(lum1, lum2);\n\n return (lighter + 0.05) / (darker + 0.05);\n}\n\n/**\n * Get optimal foreground color (white or black) for a background\n */\nexport function getOptimalForeground(\n bgHex: string,\n whiteHex: string = '#ffffff',\n blackHex: string = '#000000'\n): string {\n const whiteRatio = getContrastRatio(bgHex, whiteHex);\n const blackRatio = getContrastRatio(bgHex, blackHex);\n\n return whiteRatio > blackRatio ? whiteHex : blackHex;\n}\n","/**\n * Token Dependency Graph\n * Defines which tokens are computed from other tokens for \"change once, ripple everywhere\"\n */\n\nimport {\n adjustLightness,\n adjustSaturation,\n adjustOpacity,\n rotateHue,\n getOptimalForeground,\n} from './color-utils';\n\nexport type TokenDerivation = {\n source: string; // Which token it derives from\n transform: (sourceValue: string) => string; // How to compute it\n description: string; // Why this derivation exists\n};\n\n/**\n * Primary Color Derivations\n * These tokens automatically update when primary color changes\n */\nexport const primaryColorDerivations: Record<string, TokenDerivation> = {\n // Links use primary color\n '--color-link': {\n source: '--color-primary',\n transform: (primary) => primary,\n description: 'Links inherit primary brand color',\n },\n\n // Focus ring uses primary color\n '--color-ring': {\n source: '--color-primary',\n transform: (primary) => primary,\n description: 'Focus rings use primary for brand consistency',\n },\n\n // Link hover is slightly darker primary\n '--color-link-hover': {\n source: '--color-primary',\n transform: (primary) => adjustLightness(primary, -10),\n description: 'Link hover is 10% darker for visual feedback',\n },\n\n // Chart primary series\n '--chart-1': {\n source: '--color-primary',\n transform: (primary) => primary,\n description: 'First chart series uses primary',\n },\n\n // Chart secondary series (lighter tint)\n '--chart-2': {\n source: '--color-primary',\n transform: (primary) => adjustLightness(primary, 20),\n description: 'Second chart series is lighter tint of primary',\n },\n\n // Chart tertiary series (darker shade)\n '--chart-3': {\n source: '--color-primary',\n transform: (primary) => adjustLightness(primary, -15),\n description: 'Third chart series is darker shade of primary',\n },\n\n // Chart quaternary (desaturated primary)\n '--chart-4': {\n source: '--color-primary',\n transform: (primary) => adjustSaturation(primary, -30),\n description: 'Fourth chart series is muted primary',\n },\n\n // Chart quinary (complementary color)\n '--chart-5': {\n source: '--color-primary',\n transform: (primary) => rotateHue(primary, 180),\n description: 'Fifth chart series is complementary to primary',\n },\n};\n\n/**\n * Secondary Color Derivations\n * These derive from secondary color\n */\nexport const secondaryColorDerivations: Record<string, TokenDerivation> = {\n // Hover states\n '--color-hover': {\n source: '--color-secondary',\n transform: (secondary) => secondary,\n description: 'Hover backgrounds use secondary',\n },\n\n // Active states\n '--color-active': {\n source: '--color-secondary',\n transform: (secondary) => adjustLightness(secondary, -5),\n description: 'Active state is slightly darker secondary',\n },\n\n // Muted backgrounds\n '--color-muted': {\n source: '--color-secondary',\n transform: (secondary) => secondary,\n description: 'Muted sections use secondary color',\n },\n};\n\n/**\n * Accent Color Derivations\n * These derive from accent (used for highlights and CTAs)\n */\nexport const accentColorDerivations: Record<string, TokenDerivation> = {\n // Info semantic color uses accent\n '--color-info': {\n source: '--color-accent',\n transform: (accent) => accent,\n description: 'Info semantic color uses accent',\n },\n\n // Info foreground calculated for contrast\n '--color-info-foreground': {\n source: '--color-accent',\n transform: (accent) => getOptimalForeground(accent),\n description: 'Info foreground calculated for contrast',\n },\n};\n\n/**\n * Mode-Specific Derivations\n * These need different transforms for light vs dark mode\n */\nexport const modeSpecificDerivations: Record<string, {\n light: TokenDerivation;\n dark: TokenDerivation;\n}> = {\n '--color-primary-muted': {\n light: {\n source: '--color-primary',\n transform: (primary) => adjustLightness(primary, 40),\n description: 'Muted primary for light backgrounds',\n },\n dark: {\n source: '--color-primary',\n transform: (primary) => adjustLightness(primary, -20),\n description: 'Muted primary for dark backgrounds',\n },\n },\n\n '--color-primary-subtle': {\n light: {\n source: '--color-primary',\n transform: (primary) => adjustOpacity(primary, 0.1),\n description: 'Subtle primary background for light mode',\n },\n dark: {\n source: '--color-primary',\n transform: (primary) => adjustOpacity(primary, 0.2),\n description: 'Subtle primary background for dark mode',\n },\n },\n};\n\n/**\n * Complete dependency graph\n */\nexport const tokenDependencyGraph = {\n primary: primaryColorDerivations,\n secondary: secondaryColorDerivations,\n accent: accentColorDerivations,\n modeSpecific: modeSpecificDerivations,\n};\n\n/**\n * Get all tokens that depend on a source token\n */\nexport function getDependentTokens(sourceToken: string): string[] {\n const dependents: string[] = [];\n\n Object.entries(primaryColorDerivations).forEach(([token, config]) => {\n if (config.source === sourceToken) {\n dependents.push(token);\n }\n });\n\n Object.entries(secondaryColorDerivations).forEach(([token, config]) => {\n if (config.source === sourceToken) {\n dependents.push(token);\n }\n });\n\n Object.entries(accentColorDerivations).forEach(([token, config]) => {\n if (config.source === sourceToken) {\n dependents.push(token);\n }\n });\n\n return dependents;\n}\n\n/**\n * Compute all derived tokens from a source\n */\nexport function computeDerivedTokens(\n sourceToken: string,\n sourceValue: string,\n mode: 'light' | 'dark'\n): Record<string, string> {\n const derived: Record<string, string> = {};\n\n // Compute from primary derivations\n Object.entries(primaryColorDerivations).forEach(([token, config]) => {\n if (config.source === sourceToken) {\n derived[token] = config.transform(sourceValue);\n }\n });\n\n // Compute from secondary derivations\n Object.entries(secondaryColorDerivations).forEach(([token, config]) => {\n if (config.source === sourceToken) {\n derived[token] = config.transform(sourceValue);\n }\n });\n\n // Compute from accent derivations\n Object.entries(accentColorDerivations).forEach(([token, config]) => {\n if (config.source === sourceToken) {\n derived[token] = config.transform(sourceValue);\n }\n });\n\n // Compute mode-specific derivations\n Object.entries(modeSpecificDerivations).forEach(([token, configs]) => {\n const config = configs[mode];\n if (config.source === sourceToken) {\n derived[token] = config.transform(sourceValue);\n }\n });\n\n return derived;\n}\n","/**\n * Semantic Color Utilities\n *\n * Helper functions for working with the design system's color tokens\n * and CSS variables.\n */\n\n/**\n * Color token categories\n */\nexport const colorTokens = {\n // Background colors\n background: 'var(--color-background)',\n backgroundSecondary: 'var(--color-background-secondary)',\n backgroundTertiary: 'var(--color-background-tertiary)',\n surface: 'var(--color-surface)',\n\n // Foreground/Text colors\n foreground: 'var(--color-foreground)',\n foregroundSecondary: 'var(--color-foreground-secondary)',\n foregroundTertiary: 'var(--color-foreground-tertiary)',\n textPrimary: 'var(--color-text-primary)',\n textSecondary: 'var(--color-text-secondary)',\n textMuted: 'var(--color-text-muted)',\n\n // Brand colors\n primary: 'var(--color-primary)',\n primaryForeground: 'var(--color-primary-foreground)',\n secondary: 'var(--color-secondary)',\n secondaryForeground: 'var(--color-secondary-foreground)',\n accent: 'var(--color-accent)',\n accentForeground: 'var(--color-accent-foreground)',\n\n // Semantic colors\n success: 'var(--color-success)',\n successForeground: 'var(--color-success-foreground)',\n warning: 'var(--color-warning)',\n warningForeground: 'var(--color-warning-foreground)',\n error: 'var(--color-error)',\n errorForeground: 'var(--color-error-foreground)',\n info: 'var(--color-info)',\n infoForeground: 'var(--color-info-foreground)',\n\n // Borders\n border: 'var(--color-border)',\n borderSubtle: 'var(--color-border-subtle)',\n\n // Interactive states\n hover: 'var(--color-hover)',\n active: 'var(--color-active)',\n focus: 'var(--color-focus)',\n\n // Links\n link: 'var(--color-link)',\n linkHover: 'var(--color-link-hover)',\n linkHoverForeground: 'var(--color-link-hover-foreground)',\n} as const;\n\n/**\n * Get CSS variable value from computed styles\n *\n * @param variableName - CSS variable name (with or without --)\n * @param element - Element to get computed style from (defaults to document.documentElement)\n * @returns The computed value of the CSS variable\n *\n * @example\n * ```ts\n * const primaryColor = getCSSVariable('--color-primary');\n * // Returns: '#0066ff' (or whatever the current theme's primary color is)\n * ```\n */\nexport function getCSSVariable(\n variableName: string,\n element: HTMLElement = document.documentElement\n): string {\n const name = variableName.startsWith('--') ? variableName : `--${variableName}`;\n return getComputedStyle(element).getPropertyValue(name).trim();\n}\n\n/**\n * Set CSS variable value\n *\n * @param variableName - CSS variable name (with or without --)\n * @param value - Value to set\n * @param element - Element to set the variable on (defaults to document.documentElement)\n *\n * @example\n * ```ts\n * setCSSVariable('--color-primary', '#ff0000');\n * ```\n */\nexport function setCSSVariable(\n variableName: string,\n value: string,\n element: HTMLElement = document.documentElement\n): void {\n const name = variableName.startsWith('--') ? variableName : `--${variableName}`;\n element.style.setProperty(name, value);\n}\n\n/**\n * Get contrasting foreground color for a background color\n *\n * @param backgroundToken - Background color token name (without 'var()')\n * @returns The appropriate foreground color token\n *\n * @example\n * ```ts\n * const foreground = getForegroundColor('--color-primary');\n * // Returns: 'var(--color-primary-foreground)'\n * ```\n */\nexport function getForegroundColor(backgroundToken: string): string {\n // Remove var() wrapper if present\n const token = backgroundToken.replace(/var\\(|\\)/g, '');\n\n // Map background tokens to their foreground pairs\n const foregroundMap: Record<string, string> = {\n '--color-primary': 'var(--color-primary-foreground)',\n '--color-secondary': 'var(--color-secondary-foreground)',\n '--color-accent': 'var(--color-accent-foreground)',\n '--color-success': 'var(--color-success-foreground)',\n '--color-warning': 'var(--color-warning-foreground)',\n '--color-error': 'var(--color-error-foreground)',\n '--color-info': 'var(--color-info-foreground)',\n '--color-background': 'var(--color-foreground)',\n '--color-surface': 'var(--color-text-primary)',\n };\n\n return foregroundMap[token] || 'var(--color-text-primary)';\n}\n\n/**\n * Semantic color groups for different use cases\n */\nexport const semanticColors = {\n /**\n * Status colors for indicating states\n */\n status: {\n success: {\n bg: colorTokens.success,\n fg: colorTokens.successForeground,\n },\n warning: {\n bg: colorTokens.warning,\n fg: colorTokens.warningForeground,\n },\n error: {\n bg: colorTokens.error,\n fg: colorTokens.errorForeground,\n },\n info: {\n bg: colorTokens.info,\n fg: colorTokens.infoForeground,\n },\n },\n\n /**\n * Brand colors for primary UI elements\n */\n brand: {\n primary: {\n bg: colorTokens.primary,\n fg: colorTokens.primaryForeground,\n },\n secondary: {\n bg: colorTokens.secondary,\n fg: colorTokens.secondaryForeground,\n },\n accent: {\n bg: colorTokens.accent,\n fg: colorTokens.accentForeground,\n },\n },\n\n /**\n * Interactive state colors\n */\n interactive: {\n default: {\n bg: colorTokens.background,\n fg: colorTokens.foreground,\n },\n hover: {\n bg: colorTokens.hover,\n fg: colorTokens.foreground,\n },\n active: {\n bg: colorTokens.active,\n fg: colorTokens.foreground,\n },\n focus: {\n border: colorTokens.focus,\n },\n },\n} as const;\n\n/**\n * Helper to create color pairs (background + foreground)\n *\n * @param type - Semantic color type\n * @returns Object with bg and fg (and optionally border)\n *\n * @example\n * ```tsx\n * const errorColors = getSemanticColorPair('error');\n * <div style={{\n * backgroundColor: errorColors.bg,\n * color: errorColors.fg\n * }}>\n * Error message\n * </div>\n * ```\n */\nexport function getSemanticColorPair(\n type: 'success' | 'warning' | 'error' | 'info' | 'primary' | 'secondary' | 'accent'\n): { bg: string; fg: string } {\n if (type === 'primary' || type === 'secondary' || type === 'accent') {\n return semanticColors.brand[type];\n }\n return semanticColors.status[type];\n}\n\n/**\n * Convert hex color to RGB values\n *\n * @param hex - Hex color string (with or without #)\n * @returns Object with r, g, b values (0-255)\n *\n * @example\n * ```ts\n * const rgb = hexToRgb('#0066ff');\n * // Returns: { r: 0, g: 102, b: 255 }\n * ```\n */\nexport function hexToRgb(hex: string): { r: number; g: number; b: number } | null {\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result\n ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16),\n }\n : null;\n}\n\n/**\n * Calculate relative luminance of a color (WCAG formula)\n *\n * @param r - Red value (0-255)\n * @param g - Green value (0-255)\n * @param b - Blue value (0-255)\n * @returns Relative luminance (0-1)\n */\nexport function getLuminance(r: number, g: number, b: number): number {\n const [rs, gs, bs] = [r, g, b].map((c) => {\n const srgb = c / 255;\n return srgb <= 0.03928 ? srgb / 12.92 : Math.pow((srgb + 0.055) / 1.055, 2.4);\n });\n return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;\n}\n\n/**\n * Calculate contrast ratio between two colors (WCAG formula)\n *\n * @param hex1 - First color (hex)\n * @param hex2 - Second color (hex)\n * @returns Contrast ratio (1-21)\n *\n * @example\n * ```ts\n * const ratio = getContrastRatio('#ffffff', '#000000');\n * // Returns: 21 (maximum contrast)\n * ```\n */\nexport function getContrastRatio(hex1: string, hex2: string): number {\n const rgb1 = hexToRgb(hex1);\n const rgb2 = hexToRgb(hex2);\n\n if (!rgb1 || !rgb2) return 0;\n\n const lum1 = getLuminance(rgb1.r, rgb1.g, rgb1.b);\n const lum2 = getLuminance(rgb2.r, rgb2.g, rgb2.b);\n\n const lighter = Math.max(lum1, lum2);\n const darker = Math.min(lum1, lum2);\n\n return (lighter + 0.05) / (darker + 0.05);\n}\n\n/**\n * Check if color pair meets WCAG AA contrast requirements\n *\n * @param foreground - Foreground color (hex)\n * @param background - Background color (hex)\n * @param level - WCAG level ('AA' or 'AAA')\n * @param size - Text size ('normal' or 'large')\n * @returns true if contrast ratio meets requirements\n *\n * @example\n * ```ts\n * const isAccessible = meetsContrastRequirements('#000000', '#ffffff', 'AA', 'normal');\n * // Returns: true\n * ```\n */\nexport function meetsContrastRequirements(\n foreground: string,\n background: string,\n level: 'AA' | 'AAA' = 'AA',\n size: 'normal' | 'large' = 'normal'\n): boolean {\n const ratio = getContrastRatio(foreground, background);\n\n const requirements = {\n AA: { normal: 4.5, large: 3 },\n AAA: { normal: 7, large: 4.5 },\n };\n\n return ratio >= requirements[level][size];\n}\n\n/**\n * Convert hex to HSL for manipulation\n */\nexport function hexToHSL(hex: string): { h: number; s: number; l: number } {\n const rgb = hexToRgb(hex);\n if (!rgb) return { h: 0, s: 0, l: 0 };\n\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h = 0, s = 0, l = (max + min) / 2;\n\n if (max !== min) {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n switch (max) {\n case r: h = ((g - b) / d + (g < b ? 6 : 0)) / 6; break;\n case g: h = ((b - r) / d + 2) / 6; break;\n case b: h = ((r - g) / d + 4) / 6; break;\n }\n }\n\n return {\n h: Math.round(h * 360),\n s: Math.round(s * 100),\n l: Math.round(l * 100),\n };\n}\n\n/**\n * Convert HSL to hex\n */\nexport function hslToHex(h: number, s: number, l: number): string {\n h = h / 360;\n s = s / 100;\n l = l / 100;\n\n let r, g, b;\n\n if (s === 0) {\n r = g = b = l;\n } else {\n const hue2rgb = (p: number, q: number, t: number) => {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1/6) return p + (q - p) * 6 * t;\n if (t < 1/2) return q;\n if (t < 2/3) return p + (q - p) * (2/3 - t) * 6;\n return p;\n };\n\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n\n r = hue2rgb(p, q, h + 1/3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1/3);\n }\n\n const toHex = (x: number) => {\n const hex = Math.round(x * 255).toString(16);\n return hex.length === 1 ? '0' + hex : hex;\n };\n\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\n/**\n * Adjust lightness of a hex color\n * @param hex - Input color\n * @param percent - Amount to adjust (-100 to 100)\n */\nexport function adjustLightness(hex: string, percent: number): string {\n const hsl = hexToHSL(hex);\n const newL = Math.max(0, Math.min(100, hsl.l + percent));\n return hslToHex(hsl.h, hsl.s, newL);\n}\n\n/**\n * Adjust saturation of a hex color\n * @param hex - Input color\n * @param percent - Amount to adjust (-100 to 100)\n */\nexport function adjustSaturation(hex: string, percent: number): string {\n const hsl = hexToHSL(hex);\n const newS = Math.max(0, Math.min(100, hsl.s + percent));\n return hslToHex(hsl.h, newS, hsl.l);\n}\n\n/**\n * Rotate hue of a hex color\n * @param hex - Input color\n * @param degrees - Degrees to rotate (0-360)\n */\nexport function rotateHue(hex: string, degrees: number): string {\n const hsl = hexToHSL(hex);\n const newH = (hsl.h + degrees) % 360;\n return hslToHex(newH, hsl.s, hsl.l);\n}\n\n/**\n * Add opacity to a hex color (returns rgba CSS value)\n * @param hex - Input color\n * @param opacity - Opacity (0-1)\n */\nexport function adjustOpacity(hex: string, opacity: number): string {\n const rgb = hexToRgb(hex);\n if (!rgb) return hex;\n return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${opacity})`;\n}\n\n/**\n * Get optimal foreground color (white or black) for a background\n * Uses WCAG contrast formula\n */\nexport function getOptimalForeground(\n bgHex: string,\n whiteHex: string = '#ffffff',\n blackHex: string = '#000000'\n): string {\n const whiteRatio = getContrastRatio(bgHex, whiteHex);\n const blackRatio = getContrastRatio(bgHex, blackHex);\n\n return whiteRatio > blackRatio ? whiteHex : blackHex;\n}\n\n/**\n * Generate a complete tint/shade scale (like Tailwind)\n * Returns 50, 100, 200, ..., 900 variants\n */\nexport function generateColorScale(baseHex: string): Record<number, string> {\n const hsl = hexToHSL(baseHex);\n\n return {\n 50: hslToHex(hsl.h, Math.max(hsl.s - 10, 20), 95),\n 100: hslToHex(hsl.h, Math.max(hsl.s - 5, 30), 90),\n 200: hslToHex(hsl.h, hsl.s, 80),\n 300: hslToHex(hsl.h, hsl.s, 70),\n 400: hslToHex(hsl.h, hsl.s, 60),\n 500: baseHex, // Base color\n 600: hslToHex(hsl.h, Math.min(hsl.s + 5, 100), 45),\n 700: hslToHex(hsl.h, Math.min(hsl.s + 10, 100), 35),\n 800: hslToHex(hsl.h, Math.min(hsl.s + 15, 100), 25),\n 900: hslToHex(hsl.h, Math.min(hsl.s + 20, 100), 15),\n };\n}\n\n/**\n * Color utilities for common operations\n */\nexport const colorUtils = {\n getCSSVariable,\n setCSSVariable,\n getForegroundColor,\n getSemanticColorPair,\n hexToRgb,\n hexToHSL,\n hslToHex,\n adjustLightness,\n adjustSaturation,\n rotateHue,\n adjustOpacity,\n getOptimalForeground,\n generateColorScale,\n getContrastRatio,\n meetsContrastRequirements,\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOA,mBAAoC;;;ACFpC,qBAAuB;AACvB,wBAAwB;AAoBjB,IAAM,oBAAgB,uBAAmB;AAAA,MAC9C;AAAA,IACE,CAAC,KAAK,SAAS;AAAA;AAAA,MAEb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GxC,MAAI,CAAC,SAAS;AACZ,WAAO;AAAA,EACT;AAEA,SAAO,2EAAG,UAAS;AACrB;","names":["import_zustand","import_middleware","p","q","hexToRgb","getLuminance","getContrastRatio","hexToHSL","hexToRgb","hslToHex","p","q","getOptimalForeground","getContrastRatio","hexToHSL","hslToHex","getOptimalForeground","state","baseTokens"]}
|