// uRAGE Web Configurator — Tokens, Logo, Icons, atomic components const UR = { // colors resolved as CSS var refs (works everywhere) acc: 'var(--ur-acc)', accDim: 'var(--ur-acc-dim)', accHi: 'var(--ur-acc-hi)', accGlow: 'var(--ur-acc-glow)', accInk: 'var(--ur-acc-ink)', cyan: 'var(--ur-cyan)', cyanDim: 'var(--ur-cyan-dim)', cyanGlow: 'var(--ur-cyan-glow)', bg0: 'var(--ur-bg-0)', bg1: 'var(--ur-bg-1)', bg2: 'var(--ur-bg-2)', bg3: 'var(--ur-bg-3)', bg4: 'var(--ur-bg-4)', line: 'var(--ur-line)', lineSoft: 'var(--ur-line-soft)', lineStrong: 'var(--ur-line-strong)', ink: 'var(--ur-ink)', ink2: 'var(--ur-ink-2)', ink3: 'var(--ur-ink-3)', ink4: 'var(--ur-ink-4)', ok: 'oklch(0.78 0.20 150)', warn: 'oklch(0.78 0.16 75)', err: 'oklch(0.68 0.22 25)', mono: '"JetBrains Mono", monospace', sans: '"Inter", sans-serif', }; // ---------- uRage Logo (uses the original PNG on transparent bg) ---------- const URageLogo = ({ size = 28, mono = false, showTag = true }) => { // Original logo aspect is ~1024×626 → 1.635:1. On a dark background the white // logo shows through cleanly; keep it as-is (no filter tinting). `mono` is // accepted for API compatibility but ignored — the logo already reads as-is. const cyan = mono ? UR.ink : UR.cyan; const height = size; const width = size * 1.635; return (
uRage {showTag && ( U-Center )}
); }; // ---------- Icons (Lucide-style, inline SVG) ---------- const Ic = { keyboard: (p) => , mouse: (p) => , headset: (p) => , gamepad: (p) => , home: (p) => , cloud: (p) => , download: (p) => , settings: (p) => , help: (p) => , bell: (p) => , user: (p) => , usb: (p) => , wifi: (p) => , battery: (p) => , chevD: (p) => , chevR: (p) => , chevL: (p) => , arrowR: (p) => , check: (p) => , x: (p) => , plus: (p) => , minus: (p) => , play: (p) => , pause: (p) => , save: (p) => , copy: (p) => , reset: (p) => , bolt: (p) => , droplet: (p) => , eye: (p) => , layers: (p) => , cpu: (p) => , refresh: (p) => , heart: (p) => , star: (p) => , search: (p) => , circle: (p) => , wave: (p) => , mic: (p) => , vol: (p) => , target: (p) => , history: (p) => , info: (p) => , dots: (p) => , wallet: (p) => , shield: (p) => , usbC: (p) => , }; // ---------- Button ---------- const Btn = ({ variant = 'primary', size = 'md', icon, iconRight, children, block, style, active, ...rest }) => { const sizes = { xs: { h: 26, px: 10, fs: 11, gap: 5, r: 5 }, sm: { h: 30, px: 12, fs: 12, gap: 6, r: 6 }, md: { h: 36, px: 14, fs: 13, gap: 7, r: 6 }, lg: { h: 44, px: 20, fs: 14, gap: 8, r: 8 }, }[size]; const variants = { primary: { bg: UR.acc, color: UR.accInk, border: 'transparent', shadow: 'var(--fm-acc-shadow)', fw: 600 }, secondary: { bg: UR.bg3, color: UR.ink, border: UR.line, fw: 500 }, ghost: { bg: 'transparent', color: UR.ink, border: UR.line, fw: 500 }, subtle: { bg: 'transparent', color: UR.ink2, border: 'transparent', fw: 500 }, danger: { bg: 'transparent', color: UR.err, border: `oklch(0.68 0.22 25 / 0.5)`, fw: 500 }, outline: { bg: 'transparent', color: UR.acc, border: UR.acc, fw: 600 }, }[variant]; const activeStyle = active ? { background: UR.bg3, color: UR.ink } : {}; return ( ); }; // ---------- Badge ---------- const Badge = ({ tone = 'default', size = 'md', children, dot, style }) => { const tones = { default: { bg: UR.bg3, color: UR.ink2, border: UR.line }, acc: { bg: `oklch(0.62 0.24 300 / 0.15)`, color: UR.acc, border: `oklch(0.62 0.24 300 / 0.4)` }, cyan: { bg: `oklch(0.78 0.15 200 / 0.15)`, color: UR.cyan, border: `oklch(0.78 0.15 200 / 0.4)` }, ok: { bg: `oklch(0.78 0.20 150 / 0.14)`, color: UR.ok, border: `oklch(0.78 0.20 150 / 0.4)` }, warn: { bg: `oklch(0.78 0.16 75 / 0.14)`, color: UR.warn, border: `oklch(0.78 0.16 75 / 0.35)` }, err: { bg: `oklch(0.68 0.22 25 / 0.14)`, color: UR.err, border: `oklch(0.68 0.22 25 / 0.35)` }, }[tone]; const sz = size === 'sm' ? { h: 18, px: 6, fs: 9 } : size === 'lg' ? { h: 26, px: 10, fs: 11 } : { h: 22, px: 8, fs: 10 }; return ( {dot && } {children} ); }; // ---------- Section label §NN / TITLE ---------- const SecLabel = ({ num, children, tone = 'default' }) => ( {num && §{num}} {num && /} {children} ); // ---------- Divider ---------- const Divider = ({ vertical, style }) => (
); // ---------- KPI Small (device stats) ---------- const Stat = ({ label, value, sub, tone }) => (
{String(label).toUpperCase()}
{value}
{sub &&
{sub}
}
); // ---------- Slider (labeled) ---------- const Slider = ({ label, value, min = 0, max = 100, step = 1, onChange, unit, suffixLabel, hint, mono = true, valueColor }) => (
{label && (
{label} {value}{unit && {unit}}
)} onChange(Number(e.target.value))} /> {(hint || suffixLabel) && (
{hint || ''} {suffixLabel || ''}
)}
); // ---------- Toggle ---------- const Toggle = ({ checked, onChange, size = 'md' }) => { const w = size === 'sm' ? 30 : 38; const h = size === 'sm' ? 16 : 20; const kn = h - 4; return ( ); }; // ---------- Card ---------- const Card = ({ title, subtitle, right, section, children, style, padding = 20, tone = 'default' }) => (
{(title || right || section) && (
{section &&
{section}
} {title &&
{title}
} {subtitle &&
{subtitle}
}
{right}
)} {children &&
{children}
}
); // ---------- Sparkline ---------- const Spark = ({ data, w = 96, h = 28, color }) => { const max = Math.max(...data), min = Math.min(...data); const range = max - min || 1; const step = w / (data.length - 1); const pts = data.map((v, i) => `${i * step},${h - ((v - min) / range) * (h - 4) - 2}`).join(' '); const c = color || 'var(--ur-acc)'; return ( ); }; // ---------- Expose to window ---------- Object.assign(window, { UR, URageLogo, Ic, Btn, Badge, SecLabel, Divider, Stat, Slider, Toggle, Card, Spark });