// ─── Shared UI primitives ──────────────────────────────────────────────────── const C = {}; C.Badge = ({ color = 'blue', children }) => { const colors = { green: { bg: 'rgba(52,211,153,0.12)', text: '#34d399', dot: '#34d399' }, amber: { bg: 'rgba(251,191,36,0.12)', text: '#fbbf24', dot: '#fbbf24' }, red: { bg: 'rgba(248,113,113,0.12)', text: '#f87171', dot: '#f87171' }, blue: { bg: 'rgba(90,126,245,0.12)', text: '#5a7ef5', dot: '#5a7ef5' }, purple: { bg: 'rgba(167,139,250,0.12)', text: '#a78bfa', dot: '#a78bfa' }, gray: { bg: 'rgba(120,128,148,0.12)', text: '#7b849a', dot: '#7b849a' }, }; const c = colors[color] || colors.gray; return ( {children} ); }; C.Btn = ({ variant = 'primary', size = 'md', children, onClick, disabled, style: s }) => { const base = { display: 'inline-flex', alignItems: 'center', gap: 6, border: 'none', cursor: disabled ? 'default' : 'pointer', fontFamily: 'inherit', fontWeight: 600, borderRadius: 8, transition: 'opacity 0.15s, background 0.15s', opacity: disabled ? 0.45 : 1, outline: 'none', ...(size === 'sm' ? { fontSize: 12, padding: '5px 12px' } : { fontSize: 13, padding: '8px 16px' }), }; const variants = { primary: { background: '#5a7ef5', color: '#fff' }, ghost: { background: 'rgba(255,255,255,0.05)', color: '#e8eaef', border: '1px solid rgba(255,255,255,0.08)' }, danger: { background: 'rgba(248,113,113,0.15)', color: '#f87171', border: '1px solid rgba(248,113,113,0.2)' }, success: { background: 'rgba(52,211,153,0.15)', color: '#34d399', border: '1px solid rgba(52,211,153,0.2)' }, }; return ( ); }; C.Input = ({ label, value, onChange, type = 'text', placeholder, mono, rows, hint, style: s, disabled }) => (
{label && } {rows ? (