@optifye/dashboard-core 6.10.38 → 6.10.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -58422,7 +58422,7 @@ var LineCard = ({
58422
58422
  supervisors
58423
58423
  }) => {
58424
58424
  const isUptimeLine = (line.monitoring_mode ?? "output") === "uptime";
58425
- React26__namespace.default.useMemo(() => {
58425
+ const isOnTrack = React26__namespace.default.useMemo(() => {
58426
58426
  if (!kpis) return null;
58427
58427
  return kpis.efficiency.value > 90;
58428
58428
  }, [kpis]);
@@ -58435,67 +58435,73 @@ var LineCard = ({
58435
58435
  onClick: () => onClick(kpis),
58436
58436
  className: "relative bg-white border border-gray-200/80 shadow-sm hover:shadow-lg \n rounded-xl p-4 sm:p-5 md:p-6 transition-all duration-200 cursor-pointer \n hover:scale-[1.01] active:scale-[0.99] group",
58437
58437
  children: [
58438
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-4 sm:mb-5 md:mb-6", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap items-start gap-2 sm:gap-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
58439
- /* @__PURE__ */ jsxRuntime.jsx(
58440
- FittingTitle,
58441
- {
58442
- title: line.line_name,
58443
- className: "text-[10px] sm:text-xs md:text-sm"
58444
- }
58445
- ),
58446
- supervisorEnabled && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-4", children: [
58447
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] font-semibold text-gray-400 uppercase tracking-wider mb-1.5", children: "Assigned To" }),
58448
- supervisors && supervisors.length > 0 ? supervisors.length === 1 ? (
58449
- // Single supervisor - just avatar with tooltip
58450
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-12 h-12 rounded-full bg-white border border-gray-100 shadow-sm flex-shrink-0 group/avatar hover:scale-110 transition-transform", children: [
58451
- supervisors[0].profilePhotoUrl ? /* @__PURE__ */ jsxRuntime.jsx(
58452
- "img",
58453
- {
58454
- src: supervisors[0].profilePhotoUrl,
58455
- alt: supervisors[0].displayName,
58456
- className: "w-full h-full object-cover rounded-full"
58457
- }
58458
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center bg-gray-50 text-base font-bold text-gray-500 uppercase rounded-full", children: getInitials(supervisors[0].displayName) }),
58459
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-gray-900 text-white text-[10px] font-medium rounded shadow-lg opacity-0 group-hover/avatar:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-20", children: [
58460
- supervisors[0].displayName,
58461
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-full left-1/2 -translate-x-1/2 -mt-[1px] border-4 border-transparent border-t-gray-900" })
58438
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-4 sm:mb-5 md:mb-6", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-start gap-2 sm:gap-3", children: [
58439
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
58440
+ /* @__PURE__ */ jsxRuntime.jsx(
58441
+ FittingTitle,
58442
+ {
58443
+ title: line.line_name,
58444
+ className: "text-[10px] sm:text-xs md:text-sm"
58445
+ }
58446
+ ),
58447
+ supervisorEnabled && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-4", children: [
58448
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] font-semibold text-gray-400 uppercase tracking-wider mb-1.5", children: "Assigned To" }),
58449
+ supervisors && supervisors.length > 0 ? supervisors.length === 1 ? (
58450
+ // Single supervisor - just avatar with tooltip
58451
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-12 h-12 rounded-full bg-white border border-gray-100 shadow-sm flex-shrink-0 group/avatar hover:scale-110 transition-transform", children: [
58452
+ supervisors[0].profilePhotoUrl ? /* @__PURE__ */ jsxRuntime.jsx(
58453
+ "img",
58454
+ {
58455
+ src: supervisors[0].profilePhotoUrl,
58456
+ alt: supervisors[0].displayName,
58457
+ className: "w-full h-full object-cover rounded-full"
58458
+ }
58459
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center bg-gray-50 text-base font-bold text-gray-500 uppercase rounded-full", children: getInitials(supervisors[0].displayName) }),
58460
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-gray-900 text-white text-[10px] font-medium rounded shadow-lg opacity-0 group-hover/avatar:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-20", children: [
58461
+ supervisors[0].displayName,
58462
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-full left-1/2 -translate-x-1/2 -mt-[1px] border-4 border-transparent border-t-gray-900" })
58463
+ ] })
58462
58464
  ] })
58463
- ] })
58464
- ) : (
58465
- // Multiple supervisors - overlapping avatars
58466
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex -space-x-4 py-1", children: [
58467
- supervisors.slice(0, 3).map((supervisor) => /* @__PURE__ */ jsxRuntime.jsxs(
58468
- "div",
58469
- {
58470
- className: "relative inline-block w-12 h-12 rounded-full ring-2 ring-white bg-white shadow-sm z-0 hover:z-10 transition-all hover:scale-110 group/avatar",
58471
- children: [
58472
- supervisor.profilePhotoUrl ? /* @__PURE__ */ jsxRuntime.jsx(
58473
- "img",
58474
- {
58475
- src: supervisor.profilePhotoUrl,
58476
- alt: supervisor.displayName,
58477
- className: "w-full h-full object-cover rounded-full"
58478
- }
58479
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center bg-gray-100 text-sm font-bold text-gray-600 uppercase rounded-full", children: getInitials(supervisor.displayName) }),
58480
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-gray-900 text-white text-[10px] font-medium rounded shadow-lg opacity-0 group-hover/avatar:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-20", children: [
58481
- supervisor.displayName,
58482
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-full left-1/2 -translate-x-1/2 -mt-[1px] border-4 border-transparent border-t-gray-900" })
58483
- ] })
58484
- ]
58485
- },
58486
- supervisor.userId
58487
- )),
58488
- supervisors.length > 3 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inline-flex w-12 h-12 rounded-full ring-2 ring-white bg-gray-100 items-center justify-center text-sm font-medium text-gray-600 z-0", children: [
58489
- "+",
58490
- supervisors.length - 3
58465
+ ) : (
58466
+ // Multiple supervisors - overlapping avatars
58467
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex -space-x-4 py-1", children: [
58468
+ supervisors.slice(0, 3).map((supervisor) => /* @__PURE__ */ jsxRuntime.jsxs(
58469
+ "div",
58470
+ {
58471
+ className: "relative inline-block w-12 h-12 rounded-full ring-2 ring-white bg-white shadow-sm z-0 hover:z-10 transition-all hover:scale-110 group/avatar",
58472
+ children: [
58473
+ supervisor.profilePhotoUrl ? /* @__PURE__ */ jsxRuntime.jsx(
58474
+ "img",
58475
+ {
58476
+ src: supervisor.profilePhotoUrl,
58477
+ alt: supervisor.displayName,
58478
+ className: "w-full h-full object-cover rounded-full"
58479
+ }
58480
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center bg-gray-100 text-sm font-bold text-gray-600 uppercase rounded-full", children: getInitials(supervisor.displayName) }),
58481
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-gray-900 text-white text-[10px] font-medium rounded shadow-lg opacity-0 group-hover/avatar:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-20", children: [
58482
+ supervisor.displayName,
58483
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-full left-1/2 -translate-x-1/2 -mt-[1px] border-4 border-transparent border-t-gray-900" })
58484
+ ] })
58485
+ ]
58486
+ },
58487
+ supervisor.userId
58488
+ )),
58489
+ supervisors.length > 3 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inline-flex w-12 h-12 rounded-full ring-2 ring-white bg-gray-100 items-center justify-center text-sm font-medium text-gray-600 z-0", children: [
58490
+ "+",
58491
+ supervisors.length - 3
58492
+ ] })
58491
58493
  ] })
58494
+ ) : /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-gray-600", children: [
58495
+ "Supervisor: ",
58496
+ supervisorName || "Unassigned"
58492
58497
  ] })
58493
- ) : /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-gray-600", children: [
58494
- "Supervisor: ",
58495
- supervisorName || "Unassigned"
58496
58498
  ] })
58499
+ ] }),
58500
+ !isUptimeLine && kpis && isOnTrack !== null && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex items-center gap-1.5 px-2.5 sm:px-3 py-1 sm:py-1.5 rounded-full text-xs font-medium flex-shrink-0 ${isOnTrack ? "bg-emerald-100 text-emerald-700 border border-emerald-200" : "bg-red-100 text-red-700 border border-red-200"}`, style: { minWidth: "fit-content" }, children: [
58501
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-2 h-2 rounded-full ${isOnTrack ? "bg-emerald-500" : "bg-red-500"} animate-pulse` }),
58502
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: isOnTrack ? "On Track" : "Behind" })
58497
58503
  ] })
58498
- ] }) }) }),
58504
+ ] }) }),
58499
58505
  isLoading && !kpis && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
58500
58506
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "animate-pulse", children: [
58501
58507
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 bg-gray-200 rounded w-1/3 mb-2" }),
package/dist/index.mjs CHANGED
@@ -58393,7 +58393,7 @@ var LineCard = ({
58393
58393
  supervisors
58394
58394
  }) => {
58395
58395
  const isUptimeLine = (line.monitoring_mode ?? "output") === "uptime";
58396
- React26__default.useMemo(() => {
58396
+ const isOnTrack = React26__default.useMemo(() => {
58397
58397
  if (!kpis) return null;
58398
58398
  return kpis.efficiency.value > 90;
58399
58399
  }, [kpis]);
@@ -58406,67 +58406,73 @@ var LineCard = ({
58406
58406
  onClick: () => onClick(kpis),
58407
58407
  className: "relative bg-white border border-gray-200/80 shadow-sm hover:shadow-lg \n rounded-xl p-4 sm:p-5 md:p-6 transition-all duration-200 cursor-pointer \n hover:scale-[1.01] active:scale-[0.99] group",
58408
58408
  children: [
58409
- /* @__PURE__ */ jsx("div", { className: "mb-4 sm:mb-5 md:mb-6", children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-start gap-2 sm:gap-3", children: /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
58410
- /* @__PURE__ */ jsx(
58411
- FittingTitle,
58412
- {
58413
- title: line.line_name,
58414
- className: "text-[10px] sm:text-xs md:text-sm"
58415
- }
58416
- ),
58417
- supervisorEnabled && /* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
58418
- /* @__PURE__ */ jsx("p", { className: "text-[10px] font-semibold text-gray-400 uppercase tracking-wider mb-1.5", children: "Assigned To" }),
58419
- supervisors && supervisors.length > 0 ? supervisors.length === 1 ? (
58420
- // Single supervisor - just avatar with tooltip
58421
- /* @__PURE__ */ jsxs("div", { className: "relative w-12 h-12 rounded-full bg-white border border-gray-100 shadow-sm flex-shrink-0 group/avatar hover:scale-110 transition-transform", children: [
58422
- supervisors[0].profilePhotoUrl ? /* @__PURE__ */ jsx(
58423
- "img",
58424
- {
58425
- src: supervisors[0].profilePhotoUrl,
58426
- alt: supervisors[0].displayName,
58427
- className: "w-full h-full object-cover rounded-full"
58428
- }
58429
- ) : /* @__PURE__ */ jsx("div", { className: "w-full h-full flex items-center justify-center bg-gray-50 text-base font-bold text-gray-500 uppercase rounded-full", children: getInitials(supervisors[0].displayName) }),
58430
- /* @__PURE__ */ jsxs("div", { className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-gray-900 text-white text-[10px] font-medium rounded shadow-lg opacity-0 group-hover/avatar:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-20", children: [
58431
- supervisors[0].displayName,
58432
- /* @__PURE__ */ jsx("div", { className: "absolute top-full left-1/2 -translate-x-1/2 -mt-[1px] border-4 border-transparent border-t-gray-900" })
58409
+ /* @__PURE__ */ jsx("div", { className: "mb-4 sm:mb-5 md:mb-6", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-start gap-2 sm:gap-3", children: [
58410
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
58411
+ /* @__PURE__ */ jsx(
58412
+ FittingTitle,
58413
+ {
58414
+ title: line.line_name,
58415
+ className: "text-[10px] sm:text-xs md:text-sm"
58416
+ }
58417
+ ),
58418
+ supervisorEnabled && /* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
58419
+ /* @__PURE__ */ jsx("p", { className: "text-[10px] font-semibold text-gray-400 uppercase tracking-wider mb-1.5", children: "Assigned To" }),
58420
+ supervisors && supervisors.length > 0 ? supervisors.length === 1 ? (
58421
+ // Single supervisor - just avatar with tooltip
58422
+ /* @__PURE__ */ jsxs("div", { className: "relative w-12 h-12 rounded-full bg-white border border-gray-100 shadow-sm flex-shrink-0 group/avatar hover:scale-110 transition-transform", children: [
58423
+ supervisors[0].profilePhotoUrl ? /* @__PURE__ */ jsx(
58424
+ "img",
58425
+ {
58426
+ src: supervisors[0].profilePhotoUrl,
58427
+ alt: supervisors[0].displayName,
58428
+ className: "w-full h-full object-cover rounded-full"
58429
+ }
58430
+ ) : /* @__PURE__ */ jsx("div", { className: "w-full h-full flex items-center justify-center bg-gray-50 text-base font-bold text-gray-500 uppercase rounded-full", children: getInitials(supervisors[0].displayName) }),
58431
+ /* @__PURE__ */ jsxs("div", { className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-gray-900 text-white text-[10px] font-medium rounded shadow-lg opacity-0 group-hover/avatar:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-20", children: [
58432
+ supervisors[0].displayName,
58433
+ /* @__PURE__ */ jsx("div", { className: "absolute top-full left-1/2 -translate-x-1/2 -mt-[1px] border-4 border-transparent border-t-gray-900" })
58434
+ ] })
58433
58435
  ] })
58434
- ] })
58435
- ) : (
58436
- // Multiple supervisors - overlapping avatars
58437
- /* @__PURE__ */ jsxs("div", { className: "flex -space-x-4 py-1", children: [
58438
- supervisors.slice(0, 3).map((supervisor) => /* @__PURE__ */ jsxs(
58439
- "div",
58440
- {
58441
- className: "relative inline-block w-12 h-12 rounded-full ring-2 ring-white bg-white shadow-sm z-0 hover:z-10 transition-all hover:scale-110 group/avatar",
58442
- children: [
58443
- supervisor.profilePhotoUrl ? /* @__PURE__ */ jsx(
58444
- "img",
58445
- {
58446
- src: supervisor.profilePhotoUrl,
58447
- alt: supervisor.displayName,
58448
- className: "w-full h-full object-cover rounded-full"
58449
- }
58450
- ) : /* @__PURE__ */ jsx("div", { className: "w-full h-full flex items-center justify-center bg-gray-100 text-sm font-bold text-gray-600 uppercase rounded-full", children: getInitials(supervisor.displayName) }),
58451
- /* @__PURE__ */ jsxs("div", { className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-gray-900 text-white text-[10px] font-medium rounded shadow-lg opacity-0 group-hover/avatar:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-20", children: [
58452
- supervisor.displayName,
58453
- /* @__PURE__ */ jsx("div", { className: "absolute top-full left-1/2 -translate-x-1/2 -mt-[1px] border-4 border-transparent border-t-gray-900" })
58454
- ] })
58455
- ]
58456
- },
58457
- supervisor.userId
58458
- )),
58459
- supervisors.length > 3 && /* @__PURE__ */ jsxs("div", { className: "inline-flex w-12 h-12 rounded-full ring-2 ring-white bg-gray-100 items-center justify-center text-sm font-medium text-gray-600 z-0", children: [
58460
- "+",
58461
- supervisors.length - 3
58436
+ ) : (
58437
+ // Multiple supervisors - overlapping avatars
58438
+ /* @__PURE__ */ jsxs("div", { className: "flex -space-x-4 py-1", children: [
58439
+ supervisors.slice(0, 3).map((supervisor) => /* @__PURE__ */ jsxs(
58440
+ "div",
58441
+ {
58442
+ className: "relative inline-block w-12 h-12 rounded-full ring-2 ring-white bg-white shadow-sm z-0 hover:z-10 transition-all hover:scale-110 group/avatar",
58443
+ children: [
58444
+ supervisor.profilePhotoUrl ? /* @__PURE__ */ jsx(
58445
+ "img",
58446
+ {
58447
+ src: supervisor.profilePhotoUrl,
58448
+ alt: supervisor.displayName,
58449
+ className: "w-full h-full object-cover rounded-full"
58450
+ }
58451
+ ) : /* @__PURE__ */ jsx("div", { className: "w-full h-full flex items-center justify-center bg-gray-100 text-sm font-bold text-gray-600 uppercase rounded-full", children: getInitials(supervisor.displayName) }),
58452
+ /* @__PURE__ */ jsxs("div", { className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-gray-900 text-white text-[10px] font-medium rounded shadow-lg opacity-0 group-hover/avatar:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-20", children: [
58453
+ supervisor.displayName,
58454
+ /* @__PURE__ */ jsx("div", { className: "absolute top-full left-1/2 -translate-x-1/2 -mt-[1px] border-4 border-transparent border-t-gray-900" })
58455
+ ] })
58456
+ ]
58457
+ },
58458
+ supervisor.userId
58459
+ )),
58460
+ supervisors.length > 3 && /* @__PURE__ */ jsxs("div", { className: "inline-flex w-12 h-12 rounded-full ring-2 ring-white bg-gray-100 items-center justify-center text-sm font-medium text-gray-600 z-0", children: [
58461
+ "+",
58462
+ supervisors.length - 3
58463
+ ] })
58462
58464
  ] })
58465
+ ) : /* @__PURE__ */ jsxs("p", { className: "text-sm text-gray-600", children: [
58466
+ "Supervisor: ",
58467
+ supervisorName || "Unassigned"
58463
58468
  ] })
58464
- ) : /* @__PURE__ */ jsxs("p", { className: "text-sm text-gray-600", children: [
58465
- "Supervisor: ",
58466
- supervisorName || "Unassigned"
58467
58469
  ] })
58470
+ ] }),
58471
+ !isUptimeLine && kpis && isOnTrack !== null && /* @__PURE__ */ jsxs("div", { className: `flex items-center gap-1.5 px-2.5 sm:px-3 py-1 sm:py-1.5 rounded-full text-xs font-medium flex-shrink-0 ${isOnTrack ? "bg-emerald-100 text-emerald-700 border border-emerald-200" : "bg-red-100 text-red-700 border border-red-200"}`, style: { minWidth: "fit-content" }, children: [
58472
+ /* @__PURE__ */ jsx("div", { className: `w-2 h-2 rounded-full ${isOnTrack ? "bg-emerald-500" : "bg-red-500"} animate-pulse` }),
58473
+ /* @__PURE__ */ jsx("span", { children: isOnTrack ? "On Track" : "Behind" })
58468
58474
  ] })
58469
- ] }) }) }),
58475
+ ] }) }),
58470
58476
  isLoading && !kpis && /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
58471
58477
  /* @__PURE__ */ jsxs("div", { className: "animate-pulse", children: [
58472
58478
  /* @__PURE__ */ jsx("div", { className: "h-4 bg-gray-200 rounded w-1/3 mb-2" }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optifye/dashboard-core",
3
- "version": "6.10.38",
3
+ "version": "6.10.39",
4
4
  "description": "Reusable UI & logic for Optifye dashboard",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",