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.

style: loading animation

Brad Barbine400843c8235
diff --git a/apps/academy/app/routes/_auth+/callback.tsx b/apps/academy/app/routes/_auth+/callback.tsx
index 6118eca0ac..fd3d9b04b2 100644
--- a/apps/academy/app/routes/_auth+/callback.tsx
+++ b/apps/academy/app/routes/_auth+/callback.tsx
@@ -20,6 +20,7 @@ import {
AlertDescription,
AlertTitle,
Button,
+ LoadingBars,
VStack
} from "@carbon/react";
import { useEffect, useRef, useState } from "react";
@@ -175,27 +176,7 @@ export default function AuthCallback() {
</VStack>
</div>
) : (
- <div className="flex items-end justify-center gap-1.5 h-8">
- {[0, 1, 2, 3, 4].map((i) => (
- <div
- key={i}
- className="w-1.5 rounded-sm bg-primary"
- style={{
- animationName: "loading-bars",
- animationDuration: "1.2s",
- animationTimingFunction: "ease-in-out",
- animationIterationCount: "infinite",
- animationDelay: `${i * 0.1}s`
- }}
- />
- ))}
- <style>
- {`@keyframes loading-bars {
- 0%, 100% { height: 8px; opacity: 0.3; }
- 50% { height: 32px; opacity: 1; }
- }`}
- </style>
- </div>
+ <LoadingBars />
)}
</div>
);
diff --git a/apps/erp/app/routes/_public+/callback.tsx b/apps/erp/app/routes/_public+/callback.tsx
index f3ae928902..11c54a086b 100644
--- a/apps/erp/app/routes/_public+/callback.tsx
+++ b/apps/erp/app/routes/_public+/callback.tsx
@@ -16,7 +16,13 @@ import {
} from "@carbon/auth/session.server";
import { getUserByEmail } from "@carbon/auth/users.server";
import { validator } from "@carbon/form";
-import { Alert, AlertDescription, AlertTitle, VStack } from "@carbon/react";
+import {
+ Alert,
+ AlertDescription,
+ AlertTitle,
+ LoadingBars,
+ VStack
+} from "@carbon/react";
import { Trans } from "@lingui/react/macro";
import { useEffect, useRef, useState } from "react";
import { LuTriangleAlert } from "react-icons/lu";
@@ -179,27 +185,7 @@ export default function AuthCallback() {
</VStack>
</div>
) : (
- <div className="flex items-end justify-center gap-1.5 h-8">
- {[0, 1, 2, 3, 4].map((i) => (
- <div
- key={i}
- className="w-1.5 rounded-sm bg-primary"
- style={{
- animationName: "loading-bars",
- animationDuration: "1.2s",
- animationTimingFunction: "ease-in-out",
- animationIterationCount: "infinite",
- animationDelay: `${i * 0.1}s`
- }}
- />
- ))}
- <style>
- {`@keyframes loading-bars {
- 0%, 100% { height: 8px; opacity: 0.3; }
- 50% { height: 32px; opacity: 1; }
- }`}
- </style>
- </div>
+ <LoadingBars />
)}
</div>
);
diff --git a/apps/mes/app/routes/_public+/callback.tsx b/apps/mes/app/routes/_public+/callback.tsx
index af60e12ad3..5ba85d6ef2 100644
--- a/apps/mes/app/routes/_public+/callback.tsx
+++ b/apps/mes/app/routes/_public+/callback.tsx
@@ -20,6 +20,7 @@ import {
AlertDescription,
AlertTitle,
Button,
+ LoadingBars,
VStack
} from "@carbon/react";
import { Trans } from "@lingui/react/macro";
@@ -170,27 +171,7 @@ export default function AuthCallback() {
</VStack>
</div>
) : (
- <div className="flex items-end justify-center gap-1.5 h-8">
- {[0, 1, 2, 3, 4].map((i) => (
- <div
- key={i}
- className="w-1.5 rounded-sm bg-primary"
- style={{
- animationName: "loading-bars",
- animationDuration: "1.2s",
- animationTimingFunction: "ease-in-out",
- animationIterationCount: "infinite",
- animationDelay: `${i * 0.1}s`
- }}
- />
- ))}
- <style>
- {`@keyframes loading-bars {
- 0%, 100% { height: 8px; opacity: 0.3; }
- 50% { height: 32px; opacity: 1; }
- }`}
- </style>
- </div>
+ <LoadingBars />
)}
</div>
);
diff --git a/apps/starter/app/routes/_public+/callback.tsx b/apps/starter/app/routes/_public+/callback.tsx
index fa6d428da3..72edb4d15b 100644
--- a/apps/starter/app/routes/_public+/callback.tsx
+++ b/apps/starter/app/routes/_public+/callback.tsx
@@ -20,6 +20,7 @@ import {
AlertDescription,
AlertTitle,
Button,
+ LoadingBars,
VStack
} from "@carbon/react";
import { useEffect, useRef, useState } from "react";
@@ -180,27 +181,7 @@ export default function AuthCallback() {
</VStack>
</div>
) : (
- <div className="flex items-end justify-center gap-1.5 h-8">
- {[0, 1, 2, 3, 4].map((i) => (
- <div
- key={i}
- className="w-1.5 rounded-sm bg-primary"
- style={{
- animationName: "loading-bars",
- animationDuration: "1.2s",
- animationTimingFunction: "ease-in-out",
- animationIterationCount: "infinite",
- animationDelay: `${i * 0.1}s`
- }}
- />
- ))}
- <style>
- {`@keyframes loading-bars {
- 0%, 100% { height: 8px; opacity: 0.3; }
- 50% { height: 32px; opacity: 1; }
- }`}
- </style>
- </div>
+ <LoadingBars />
)}
</div>
);
diff --git a/packages/react/src/LoadingBars.tsx b/packages/react/src/LoadingBars.tsx
new file mode 100644
index 0000000000..b3c1de2a95
--- /dev/null
+++ b/packages/react/src/LoadingBars.tsx
@@ -0,0 +1,25 @@
+export function LoadingBars() {
+ return (
+ <div className="flex items-end justify-center gap-1 h-8">
+ {[0, 1, 2, 3, 4].map((i) => (
+ <div
+ key={i}
+ className="w-2 rounded-xs bg-primary"
+ style={{
+ animationName: "loading-bars",
+ animationDuration: "1.2s",
+ animationTimingFunction: "ease-in-out",
+ animationIterationCount: "infinite",
+ animationDelay: `${i * 0.1}s`
+ }}
+ />
+ ))}
+ <style>
+ {`@keyframes loading-bars {
+ 0%, 100% { height: 8px; opacity: 0.3; }
+ 50% { height: 32px; opacity: 1; }
+ }`}
+ </style>
+ </div>
+ );
+}
diff --git a/packages/react/src/index.tsx b/packages/react/src/index.tsx
index 69c6181829..c6a4591132 100644
--- a/packages/react/src/index.tsx
+++ b/packages/react/src/index.tsx
@@ -173,6 +173,7 @@ import {
import { Kbd } from "./Kbd";
import { Label } from "./Label";
import { Loading } from "./Loading";
+import { LoadingBars } from "./LoadingBars";
import {
Menu,
MenuCheckboxItem,
@@ -464,6 +465,7 @@ export {
Kbd,
Label,
Loading,
+ LoadingBars,
Menu,
MenuCheckboxItem,
MenuGroup,