/* ============================================================
gp-atoms.jsx — shared UI primitives (OverMont / zinc vocabulary)
============================================================ */
var { useState, useEffect, useRef, useMemo } = React;
// uppercase mono micro-label
function Label({ children, color = "var(--fg-3)", style }) {
return {children};
}
function Mono({ children, color = "var(--fg)", size = 12, weight = 400, style }) {
return {children};
}
// status pill — winner / survivor / rejected / verified / flagged / regime
const PILL = {
winner: { fg: "var(--emerald)", bg: "color-mix(in oklab, var(--emerald) 16%, transparent)" },
survivor: { fg: "var(--info)", bg: "color-mix(in oklab, var(--info) 16%, transparent)" },
rejected: { fg: "var(--rose)", bg: "color-mix(in oklab, var(--rose) 14%, transparent)" },
verified: { fg: "var(--emerald)", bg: "color-mix(in oklab, var(--emerald) 15%, transparent)" },
flagged: { fg: "var(--rose)", bg: "color-mix(in oklab, var(--rose) 15%, transparent)" },
neutral: { fg: "var(--fg-2)", bg: "var(--bg-2)" },
accent: { fg: "var(--cyan)", bg: "color-mix(in oklab, var(--cyan) 13%, transparent)" },
warn: { fg: "var(--amber)", bg: "color-mix(in oklab, var(--amber) 14%, transparent)" },
};
function Pill({ kind = "neutral", children, dot = false, style }) {
const m = PILL[kind] || PILL.neutral;
return (
{dot && }
{children}
);
}
// verification dot — emerald (verified) / rose (flagged)
function VerdictDot({ verdict, size = 7, pulse = false }) {
const color = verdict === "VERIFIED" ? "var(--emerald)" : "var(--rose)";
return ;
}
// pass/fail glyph
function CheckMark({ pass, size = 13 }) {
return (
{pass ? "✓" : "✕"}
);
}
// param chip k=v, with optional diff highlight
function ParamChip({ k, v, changed = false, highlight = false }) {
return (
{k}
{v}
);
}
// metric value, colored by sign for returns/dd
function MetricVal({ metricKey, value, size = 12, weight = 500 }) {
const m = window.GP.verify.metricByKey(metricKey);
let color = "var(--fg)";
if (metricKey === "total_return") color = value > 0 ? "var(--emerald)" : "var(--rose)";
if (metricKey === "max_drawdown") color = "var(--rose)";
if (metricKey === "win_rate_frac") color = "var(--fg)";
return