mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-14 10:34:06 +02:00
Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: James Brunton <[email protected]> Co-authored-by: Reece Browne <[email protected]> Co-authored-by: ConnorYoh <[email protected]> Co-authored-by: Reece <[email protected]> Co-authored-by: EthanHealy01 <[email protected]> Co-authored-by: Ludy <[email protected]>
41 lines
925 B
TypeScript
41 lines
925 B
TypeScript
import type { ReactNode } from "react";
|
|
import "@shared/components/IconBadge.css";
|
|
|
|
export type IconBadgeAccent = "blue" | "purple" | "green" | "amber" | "red";
|
|
|
|
export interface IconBadgeProps {
|
|
children: ReactNode;
|
|
/** Tone tint. Defaults to blue. */
|
|
accent?: IconBadgeAccent;
|
|
size?: "sm" | "md";
|
|
className?: string;
|
|
}
|
|
|
|
/**
|
|
* A glyph in a rounded, tone-tinted square — the recurring "category icon box"
|
|
* motif used by panel headers, summaries and list leads. Centralises the tint
|
|
* so every consumer shares one treatment.
|
|
*/
|
|
export function IconBadge({
|
|
children,
|
|
accent = "blue",
|
|
size = "md",
|
|
className,
|
|
}: IconBadgeProps) {
|
|
return (
|
|
<span
|
|
className={[
|
|
"sui-iconbadge",
|
|
`sui-iconbadge--${accent}`,
|
|
`sui-iconbadge--${size}`,
|
|
className ?? "",
|
|
]
|
|
.filter(Boolean)
|
|
.join(" ")}
|
|
aria-hidden
|
|
>
|
|
{children}
|
|
</span>
|
|
);
|
|
}
|