import { invoke } from '@tauri-apps/api/core'; import { createSignal } from 'solid-js'; const colorSwatches = [ { name: 'Primary', class: 'bg-primary' }, { name: 'Primary Light', class: 'bg-primary-light' }, { name: 'Primary Dark', class: 'bg-primary-dark' }, { name: 'Secondary', class: 'bg-secondary' }, { name: 'Secondary Light', class: 'bg-secondary-light' }, { name: 'Secondary Dark', class: 'bg-secondary-dark' }, { name: 'Error', class: 'bg-error' }, { name: 'Warning', class: 'bg-warning' }, { name: 'Success', class: 'bg-success' }, { name: 'Surface', class: 'bg-surface' }, { name: 'Surface Raised', class: 'bg-surface-raised' }, { name: 'Background', class: 'bg-background' }, { name: 'Border', class: 'bg-border' }, ]; const typeSizes = [ { label: 'xs / 12px', token: 'var(--hh-text-xs)' }, { label: 'sm / 14px', token: 'var(--hh-text-sm)' }, { label: 'base / 16px', token: 'var(--hh-text-base)' }, { label: 'lg / 18px', token: 'var(--hh-text-lg)' }, { label: 'xl / 20px', token: 'var(--hh-text-xl)' }, { label: '2xl / 24px', token: 'var(--hh-text-2xl)' }, { label: '3xl / 32px', token: 'var(--hh-text-3xl)' }, { label: '4xl / 40px', token: 'var(--hh-text-4xl)' }, ]; const glowStates = [ { label: 'Default', intensity: 'var(--hh-glow-intensity-default)', blur: 'var(--hh-glow-blur-md)' }, { label: 'Focus', intensity: 'var(--hh-glow-intensity-focus)', blur: 'var(--hh-glow-blur-lg)' }, { label: 'Hover', intensity: 'var(--hh-glow-intensity-hover)', blur: 'var(--hh-glow-blur-lg)' }, { label: 'Active', intensity: 'var(--hh-glow-intensity-active)', blur: 'var(--hh-glow-blur-xl)' }, ]; const surfaceTiers = [ { label: 'Opaque', token: 'var(--hh-surface-opaque)' }, { label: 'Translucent', token: 'var(--hh-surface-translucent)' }, { label: 'Glass', token: 'var(--hh-surface-glass)' }, { label: 'Ghost', token: 'var(--hh-surface-ghost)' }, ]; export function ThemeDemo() { const [themeInput, setThemeInput] = createSignal(''); const [themeError, setThemeError] = createSignal(''); const [currentTheme, setCurrentTheme] = createSignal( document.documentElement.dataset.theme || 'cyberpunk' ); const applyTheme = async (name: string) => { try { setThemeError(''); const validated = await invoke('set_theme', { theme: name }); document.documentElement.dataset.theme = validated; setCurrentTheme(validated); } catch (err) { setThemeError(String(err)); } }; const resetTheme = () => applyTheme('cyberpunk'); const tryTheme = () => { const name = themeInput().trim(); if (name) applyTheme(name); }; return (

Theme System

{/* === 1. Color Palette === */}

Color Palette

{colorSwatches.map((swatch) => (
{swatch.name}
))} {/* Text color swatch (special - shows text samples) */}
Text Muted Dim
Text
{/* === 2. Glow Effects === */}

Glow Effects

{glowStates.map((state) => (
{state.label}
{state.label}
))}
{/* === 3. Surface Transparency === */}

Surface Transparency

{surfaceTiers.map((tier) => (
{tier.label}
{tier.label}
))}
{/* === 4. Typography Scale === */}

Typography Scale

{/* Left column: Fira Code (mono) */}

Fira Code (mono)

{typeSizes.map((size) => (
{size.label} HoloHue System Online
))}
{/* Right column: Share Tech (display) */}

Share Tech (display)

{typeSizes.map((size) => (
{size.label} HoloHue System Online
))}
{/* === 5. Theme Switch Control === */}

Theme Switch

Active theme: {currentTheme()}
setThemeInput(e.currentTarget.value)} onKeyDown={(e) => { if (e.key === 'Enter') tryTheme(); }} class="hh-input" />
{themeError() && (
{themeError()}
)}
); }