Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

feat: add pulsing dot component to shared library

Brad Barbinb028770ba50e
diff --git a/packages/react/src/PulsingDot.tsx b/packages/react/src/PulsingDot.tsx
new file mode 100644
index 0000000000..478f727c0f
--- /dev/null
+++ b/packages/react/src/PulsingDot.tsx
@@ -0,0 +1,21 @@
+import type { ComponentProps } from "react";
+import { cn } from "./utils/cn";
+
+export function PulsingDot({
+ inactive,
+ className,
+ ...props
+}: ComponentProps<"span"> & { inactive?: boolean }) {
+ if (inactive) {
+ return <span className="w-2 h-2 bg-muted rounded-full mt-2 bg-red-500" />;
+ }
+
+ return (
+ <span className={cn("relative flex h-2 w-2 mt-2", className)} {...props}>
+ <span
+ className={`absolute h-full w-full animate-ping rounded-full border border-emerald-500 opacity-100 duration-1000`}
+ />
+ <span className={`h-2 w-2 rounded-full bg-emerald-500`} />
+ </span>
+ );
+}