@flanksource/clicky-ui
Version:
Flanksource Clicky UI — React component library built on shadcn/ui with light/dark and density theming.
39 lines (38 loc) • 1.01 kB
JavaScript
import { jsxs, jsx } from "react/jsx-runtime";
import { cn } from "../../lib/utils.js";
const DOT_COLOR = {
success: "bg-emerald-500",
error: "bg-rose-500",
warning: "bg-amber-500",
info: "bg-sky-500"
};
const DOT_SIZE = {
xs: "h-1.5 w-1.5",
sm: "h-2 w-2",
md: "h-2.5 w-2.5"
};
function StatusDot({ status, size = "sm", label, title, className }) {
const tooltip = title ?? label ?? status;
return /* @__PURE__ */ jsxs(
"span",
{
className: cn("inline-flex items-center gap-1.5 align-middle", className),
title: tooltip,
children: [
/* @__PURE__ */ jsx(
"span",
{
role: "img",
"aria-label": label ?? status,
className: cn("inline-block shrink-0 rounded-full", DOT_COLOR[status], DOT_SIZE[size])
}
),
label && /* @__PURE__ */ jsx("span", { className: "truncate text-xs", children: label })
]
}
);
}
export {
StatusDot
};
//# sourceMappingURL=StatusDot.js.map