@algorithm-shift/design-system 1.3.108 → 1.3.109
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.css +0 -6
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +15 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -34
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3693,11 +3693,9 @@ var valueFormatter = (value, format3, customFormatters = {}) => {
|
|
|
3693
3693
|
case "date":
|
|
3694
3694
|
return dayjs_setup_default(value).format(arg || "YYYY-MM-DD");
|
|
3695
3695
|
case "datetimenumber":
|
|
3696
|
-
|
|
3697
|
-
return parsed.format("YYYY-MM-DD hh:mm");
|
|
3696
|
+
return dayjs_setup_default(value).format("YYYY-MM-DD hh:mm");
|
|
3698
3697
|
case "datetime":
|
|
3699
|
-
|
|
3700
|
-
return formated.format("DD MMM YYYY hh:mm A");
|
|
3698
|
+
return dayjs_setup_default(value).format("DD MMM YYYY hh:mm A");
|
|
3701
3699
|
case "days":
|
|
3702
3700
|
return `${dayjs_setup_default().diff(dayjs_setup_default(value), "day")} days`;
|
|
3703
3701
|
case "months":
|
|
@@ -5545,29 +5543,6 @@ function TooltipTrigger({
|
|
|
5545
5543
|
}) {
|
|
5546
5544
|
return /* @__PURE__ */ jsx60(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
5547
5545
|
}
|
|
5548
|
-
function TooltipContent({
|
|
5549
|
-
className,
|
|
5550
|
-
sideOffset = 0,
|
|
5551
|
-
children,
|
|
5552
|
-
...props
|
|
5553
|
-
}) {
|
|
5554
|
-
return /* @__PURE__ */ jsx60(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs37(
|
|
5555
|
-
TooltipPrimitive.Content,
|
|
5556
|
-
{
|
|
5557
|
-
"data-slot": "tooltip-content",
|
|
5558
|
-
sideOffset,
|
|
5559
|
-
className: cn(
|
|
5560
|
-
"bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
|
|
5561
|
-
className
|
|
5562
|
-
),
|
|
5563
|
-
...props,
|
|
5564
|
-
children: [
|
|
5565
|
-
children,
|
|
5566
|
-
/* @__PURE__ */ jsx60(TooltipPrimitive.Arrow, { className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
5567
|
-
]
|
|
5568
|
-
}
|
|
5569
|
-
) });
|
|
5570
|
-
}
|
|
5571
5546
|
|
|
5572
5547
|
// src/components/Navigation/Stages/Stages.tsx
|
|
5573
5548
|
import { jsx as jsx61, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
@@ -5584,7 +5559,8 @@ var StagesComponent = ({
|
|
|
5584
5559
|
loading,
|
|
5585
5560
|
saving,
|
|
5586
5561
|
triggerOnClick = false,
|
|
5587
|
-
canvasMode = "desktop"
|
|
5562
|
+
canvasMode = "desktop",
|
|
5563
|
+
...props
|
|
5588
5564
|
}) => {
|
|
5589
5565
|
const [activeStage, setActiveStage] = useState13("");
|
|
5590
5566
|
const [isCompleted, setIsCompleted] = useState13(false);
|
|
@@ -5662,6 +5638,7 @@ var StagesComponent = ({
|
|
|
5662
5638
|
}, [currentStage, stages]);
|
|
5663
5639
|
const isAllStagesCompleted = isCompleted || activeRootStage?.[dataKey] === lastStage;
|
|
5664
5640
|
const disabled = isAllStagesCompleted || loading || saving;
|
|
5641
|
+
const primaryColor = props.primaryColor || "#12715b";
|
|
5665
5642
|
return /* @__PURE__ */ jsx61("div", { className, style, children: /* @__PURE__ */ jsxs38(
|
|
5666
5643
|
"div",
|
|
5667
5644
|
{
|
|
@@ -5699,16 +5676,19 @@ var StagesComponent = ({
|
|
|
5699
5676
|
const currentIndex = stages.findIndex((s) => s[dataKey] === activeStage);
|
|
5700
5677
|
const isCompletedStage = isAllStagesCompleted || index <= currentIndex;
|
|
5701
5678
|
const isActive = !isAllStagesCompleted && index === currentIndex;
|
|
5702
|
-
let stageColor =
|
|
5679
|
+
let stageColor = `text-[${primaryColor}] border-2 border-[${primaryColor}]`;
|
|
5680
|
+
let stageStyle = { borderColor: primaryColor, color: isActive ? "white" : primaryColor, backgroundColor: isActive ? primaryColor : "transparent" };
|
|
5703
5681
|
if (stage.hasOwnProperty("isSuccess") && stage.isSuccess === false) {
|
|
5704
|
-
stageColor =
|
|
5682
|
+
stageColor = `bg-red-50 text-red-700 border-2 border-red-700`;
|
|
5683
|
+
stageStyle = { borderColor: "red", color: "red", backgroundColor: "transparent" };
|
|
5705
5684
|
}
|
|
5706
5685
|
let stageLabel = stage[dataLabel];
|
|
5707
5686
|
if (stage[dataKey] !== activeChildStage?.[dataKey] && activeRootStage?.[dataKey] === stage[dataKey]) {
|
|
5708
5687
|
stageLabel = activeChildStage?.[dataLabel] || stageLabel;
|
|
5709
|
-
stageColor =
|
|
5688
|
+
stageColor = `text-[${primaryColor}] border-2 border-[${primaryColor}]`;
|
|
5710
5689
|
if (activeChildStage.hasOwnProperty("isSuccess") && activeChildStage.isSuccess === false) {
|
|
5711
5690
|
stageColor = "bg-red-50 text-red-700 border-2 border-red-700";
|
|
5691
|
+
stageStyle = { borderColor: "red", color: "red", backgroundColor: "transparent" };
|
|
5712
5692
|
}
|
|
5713
5693
|
}
|
|
5714
5694
|
const stageKey = typeof stage[dataKey] === "string" ? stage[dataKey] : JSON.stringify(stage[dataKey]);
|
|
@@ -5720,17 +5700,17 @@ var StagesComponent = ({
|
|
|
5720
5700
|
min-w-[70px] sm:min-w-[80px] w-full sm:w-auto px-3 sm:px-4 py-1.5 sm:py-2
|
|
5721
5701
|
rounded-full text-xs sm:text-sm font-medium transition-colors duration-200
|
|
5722
5702
|
whitespace-normal sm:whitespace-nowrap flex-shrink-0 max-w-[150px] text-ellipsis overflow-hidden
|
|
5723
|
-
${isActive ?
|
|
5703
|
+
${isActive ? `bg-[${primaryColor}] text-white shadow-md` : isCompletedStage ? stageColor : "bg-white border border-gray-200"}
|
|
5724
5704
|
${isMobile ? "flex-1 text-center py-2.5" : ""}
|
|
5725
5705
|
`,
|
|
5726
5706
|
onClick: () => {
|
|
5727
5707
|
if (isAllStagesCompleted) return;
|
|
5728
5708
|
onStageClick(stage[dataKey]);
|
|
5729
5709
|
},
|
|
5710
|
+
style: stageStyle,
|
|
5730
5711
|
children: stageLabel
|
|
5731
5712
|
}
|
|
5732
5713
|
) }),
|
|
5733
|
-
/* @__PURE__ */ jsx61(TooltipContent, { className: "max-w-[400px] p-3 text-xs text-muted-foreground space-y-2", children: /* @__PURE__ */ jsx61("span", { children: /* @__PURE__ */ jsx61("b", { children: stageLabel }) }) }),
|
|
5734
5714
|
!isMobile && index < stages.length - 1 && /* @__PURE__ */ jsx61("div", { className: "hidden sm:flex sm:flex-shrink-0 w-3 h-px bg-gray-300 sm:w-4" })
|
|
5735
5715
|
] }, stageKey) }, stageKey);
|
|
5736
5716
|
})
|
|
@@ -5747,12 +5727,13 @@ var StagesComponent = ({
|
|
|
5747
5727
|
"button",
|
|
5748
5728
|
{
|
|
5749
5729
|
className: `
|
|
5750
|
-
w-full lg:w-auto
|
|
5730
|
+
w-full lg:w-auto text-white px-4 lg:px-6 py-2.5
|
|
5751
5731
|
rounded-lg text-sm font-medium transition-colors duration-200
|
|
5752
5732
|
shadow-sm ${disabled ? "opacity-50 cursor-not-allowed" : "hover:shadow-md"}
|
|
5753
5733
|
`,
|
|
5754
5734
|
onClick: nextStage,
|
|
5755
5735
|
disabled,
|
|
5736
|
+
style: { backgroundColor: primaryColor },
|
|
5756
5737
|
children: saving ? "Updating..." : buttonText
|
|
5757
5738
|
}
|
|
5758
5739
|
)
|