// vita-ui.jsx — shared UI atoms for the Vita app (bubbles, rings, chips, controls)
function ProgressRing({ value = 0, size = 34, stroke = 3, color, track }) {
const r = (size - stroke) / 2;
const c = 2 * Math.PI * r;
const off = c * (1 - Math.max(0, Math.min(100, value)) / 100);
return (
);
}
function VitaDot({ t, size = 26, active = false }) {
return (
);
}
function MessageBubble({ m, t, latest }) {
const isVita = m.role === 'vita';
const p = t.paleta;
void latest;
return (
);
}
function StatePill({ phase, t, persona }) {
const map = {
idle: { label: 'Toca para hablar', dot: t.muted },
listening: { label: 'Te escucho…', dot: t.accent },
thinking: { label: 'Pensando…', dot: t.accent },
speaking: { label: 'Vita responde', dot: t.green },
};
const s = map[phase] || map.idle;
return (
{s.label}
);
}
function IconBtn({ children, onClick, t, active, title }) {
return (
);
}
function ProfileChip({ label, value, t }) {
const val = Array.isArray(value) ? value.join(', ') : value;
return (
);
}
Object.assign(window, { ProgressRing, VitaDot, MessageBubble, StatePill, IconBtn, ProfileChip });