) {
const cls = ["stc-pill", variant !== "default" && `stc-pill--${variant}`, className].filter(Boolean).join(" ");
return ;
}
export function SegmentedToggle({ options, value, onChange, label }: {
options: { value: string; label: string }[]; value: string; onChange: (v: string) => void; label: string;
}) {
return (
{options.map((o) => (
))}
);
}
export function ProgressBar({ value, dim, label }: { value: number; dim?: boolean; label: string }) {
const pct = Math.round(Math.min(1, Math.max(0, value)) * 100);
return (
);
}
export function FloatingActionBar({ children }: { children: ReactNode }) {
return {children}
;
}
export function monogram(title: string): string {
const words = title.trim().split(/\s+/).filter(Boolean);
const letters = words.length >= 2 ? [words[0]![0], words[1]![0]] : Array.from(words[0] ?? "?").slice(0, 2);
return letters.join("").toUpperCase();
}
export function CourseCover({ title, image, accent }: { title: string; image?: string; accent?: string }) {
const style = accent ? ({ "--cfg": accent } as CSSProperties) : undefined;
return (
{image ?

:
{monogram(title)}}
);
}