// Shared UI primitives for SONARA registration prototype
const Icons = window.SonaraIcons;
function Logo() {
return (
Sonara
);
}
function BrandStepper({ stepIndex }) {
const steps = [
{ label: "Account", desc: "Crea il tuo accesso" },
{ label: "Ruolo", desc: "Chi sei?" },
{ label: "Profilo", desc: "Le info chiave" },
{ label: "Verifica", desc: "Conferma email" },
{ label: "Pronto", desc: "Inizia su SONARA" },
];
return (
{steps.map((s, i) => {
const status = i < stepIndex ? "done" : i === stepIndex ? "active" : "";
return (
{i < stepIndex ? : i + 1}
{s.label}
{s.desc}
);
})}
);
}
function BrandPanel({ stepIndex }) {
return (
);
}
function ProgressBar({ stepIndex, totalSteps = 5, label }) {
const pct = Math.min(100, ((stepIndex + 1) / totalSteps) * 100);
return (
{label || `Step ${stepIndex + 1} di ${totalSteps}`}
{Math.round(pct)}%
);
}
function Eyebrow({ children }) {
return {children}
;
}
function Field({ label, optional, hint, children }) {
return (
{label && (
)}
{children}
{hint &&
{hint}
}
);
}
function Checkbox({ checked, onChange, children }) {
return (
onChange(!checked)}>
{checked && }
{children}
);
}
function ChipMulti({ options, value, onChange, max }) {
const toggle = (opt) => {
if (value.includes(opt)) onChange(value.filter((v) => v !== opt));
else if (!max || value.length < max) onChange([...value, opt]);
};
return (
{options.map((opt) => (
))}
);
}
function Trust() {
return (
Accesso anticipato gratuito
Nessuna carta richiesta
Cancella quando vuoi
);
}
// Google / Apple inline brand glyphs
const GoogleGlyph = ({ size = 20 }) => (
);
const AppleGlyph = ({ size = 20 }) => (
);
Object.assign(window, {
Logo, BrandStepper, BrandPanel, ProgressBar,
Eyebrow, Field, Checkbox, ChipMulti, Trust,
GoogleGlyph, AppleGlyph,
});