// Dateora — shared UI primitives (Button, Input, Card, Icon) // Themed via the `t` (theme) prop passed in from DateoraApp. const Btn = ({ t, variant = 'primary', size = 'md', children, onClick, style = {}, full, type = 'button' }) => { const pad = size === 'lg' ? '16px 28px' : size === 'sm' ? '8px 14px' : '12px 22px'; const fs = size === 'lg' ? 17 : size === 'sm' ? 13 : 15; const base = { border: '1px solid transparent', borderRadius: t.radius, padding: pad, fontSize: fs, fontWeight: 600, fontFamily: t.fontBody, cursor: 'pointer', transition: 'all .15s ease', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', gap: 8, letterSpacing: t.id === 'studio' ? '-0.01em' : '0', width: full ? '100%' : 'auto', lineHeight: 1.2, whiteSpace: 'nowrap', }; const variants = { primary: { background: t.accent, color: t.accentInk, borderColor: t.accent }, secondary: { background: 'transparent', color: t.ink, borderColor: t.borderStrong }, ghost: { background: 'transparent', color: t.muted, borderColor: 'transparent' }, dark: { background: t.ink, color: t.bg, borderColor: t.ink }, }; const [hover, setHover] = React.useState(false); const hoverStyle = hover && variant === 'primary' ? { background: t.accentHover, borderColor: t.accentHover } : hover && variant === 'secondary' ? { background: t.surface2 } : hover && variant === 'ghost' ? { color: t.ink } : {}; return ( ); }; const Field = ({ t, label, value, onChange, type = 'text', placeholder, hint }) => { const [focus, setFocus] = React.useState(false); return ( ); }; const Eyebrow = ({ t, children, style = {} }) => (
{children}
); const Display = ({ t, children, size = 56, style = {} }) => (
{children}
); const Wordmark = ({ t, size = 18 }) => { if (t.id === 'mentor') { return (
{t.wordmark} {t.brandSub}
); } if (t.id === 'editorial') { return (
{t.wordmark}
); } return (
D {t.wordmark}
); }; // Icon set — small, all 18×18 stroke=1.6 unless noted const Icon = { chat: () => , history: () => , user: () => , logout: () => , mic: () => , send: () => , back: () => , check: () => , trash: () => , lock: () => , spark: () => , }; Object.assign(window, { Btn, Field, Eyebrow, Display, Wordmark, Icon });