// ui.jsx — shared UI primitives for the Boost Claimer prototype
const Btn = ({ children, kind = "default", sm, lg, block, onClick, disabled, type, style, ...rest }) => (
);
const Pill = ({ children, kind, dot, style }) => (
{dot && }
{children}
);
const Field = ({ label, hint, error, children }) => (
{label &&
}
{children}
{(hint || error) &&
{error || hint}
}
);
const Input = React.forwardRef(({ error, ...rest }, ref) => (
));
const Select = ({ options, ...rest }) => (
);
const Card = ({ children, accent, glow, lift, flat, style, className, ...rest }) => (
{children}
);
const Stat = ({ k, n, d, down }) => (
);
const Steps = ({ items, current = 0 }) => (
{items.map((label, i) => (
{i < current ? "✓" : i + 1}
{label}
{i < items.length - 1 && }
))}
);
const Toast = ({ children, kind }) => (
{children}
);
// Tiny inline icons
const Icon = ({ name, size = 16, style }) => {
const s = size;
const stroke = "currentColor";
const props = { width: s, height: s, viewBox: "0 0 24 24", fill: "none", stroke, strokeWidth: 1.8, strokeLinecap: "round", strokeLinejoin: "round", style };
switch (name) {
case "check": return ;
case "arrow": return ;
case "left": return ;
case "lock": return ;
case "bolt": return ;
case "cloud": return ;
case "puzzle": return ;
case "spark": return ;
case "x": return ;
case "shield": return ;
case "code": return ;
case "user": return ;
case "rocket": return ;
case "play": return ;
case "pause": return ;
case "refresh": return ;
case "copy": return ;
case "external":return ;
case "tg": return ;
case "mail": return ;
case "key": return ;
case "gauge": return ;
case "settings":return ;
case "users": return ;
case "chart": return ;
case "credit": return ;
case "globe": return ;
default: return null;
}
};
// Browser glyphs (small, recognizable)
const Browser = ({ name, size = 28 }) => {
const s = size;
if (name === "chrome") return (
);
if (name === "brave") return (
);
if (name === "firefox") return (
);
if (name === "safari") return (
);
return null;
};
// platform logos (small wordmarks)
const Platform = ({ name }) => {
const map = {
stake_com: { label: "Stake.com", color: "#5a8bff" },
stake_us: { label: "Stake.us", color: "#ff6a5a" },
shuffle: { label: "Shuffle", color: "#a78bfa" },
thrill: { label: "Thrill", color: "#fbbf24" },
};
const p = map[name] || map.stake_com;
return (
{p.label}
);
};
Object.assign(window, {
Btn, Pill, Field, Input, Select, Card, Stat, Steps, Toast, Icon, Browser, Platform,
});