// Shared UI components and utilities const { useState, useEffect, useMemo, useRef, useCallback, createContext, useContext, Fragment } = React; // ---------- Icon helper (Lucide via font) ---------- const Icon = ({ name, size = 16, style, className = '' }) => ( ); // ---------- Button ---------- const Btn = ({ kind = 'primary', size = 'md', icon, iconRight, children, onClick, disabled, type = 'button', style, full }) => { const base = { display: 'inline-flex', alignItems: 'center', justifyContent: 'center', gap: 8, fontWeight: 500, letterSpacing: '-0.005em', borderRadius: 999, transition: 'all .15s ease', cursor: disabled ? 'not-allowed' : 'pointer', opacity: disabled ? 0.5 : 1, whiteSpace: 'nowrap', border: '1px solid transparent', width: full ? '100%' : 'auto', }; const sizes = { sm: { padding: '6px 12px', fontSize: 13 }, md: { padding: '10px 18px', fontSize: 14 }, lg: { padding: '14px 24px', fontSize: 15 }, }; const kinds = { primary: { background: 'var(--accent)', color: 'white' }, dark: { background: 'var(--green-deep)', color: '#F5EEDE' }, ghost: { background: 'transparent', color: 'var(--ink)', border: '1px solid #dcd5c5' }, ghostDark: { background: 'transparent', color: '#F5EEDE', border: '1px solid rgba(245,238,222,0.3)' }, soft: { background: 'rgba(232,93,47,0.12)', color: 'var(--accent)' }, link: { background: 'transparent', color: 'var(--accent)', padding: 0 }, }; return ( ); }; // ---------- Badge / pill ---------- const Pill = ({ tone = 'neutral', children, icon, style }) => { const tones = { neutral: { bg: '#EFEADA', fg: '#5a5544' }, green: { bg: 'rgba(46,92,66,0.12)', fg: 'var(--green)' }, orange: { bg: 'rgba(232,93,47,0.14)', fg: '#B8431F' }, blue: { bg: 'rgba(27,73,101,0.1)', fg: '#1B4965' }, warn: { bg: '#F8E7C8', fg: '#8A5A1C' }, red: { bg: '#F7D9D1', fg: '#9A3318' }, white: { bg: 'rgba(255,255,255,0.9)', fg: 'var(--ink)' }, dark: { bg: 'rgba(26,31,28,0.88)', fg: '#fff' }, }; const t = tones[tone] || tones.neutral; return ( {icon && } {children} ); }; // ---------- Text input ---------- const Input = ({ label, value, onChange, placeholder, type = 'text', hint, required, suffix, prefix, style }) => ( ); const Textarea = ({ label, value, onChange, placeholder, rows = 4, hint, required, style }) => (