@algorithm-shift/design-system 1.3.108 → 1.3.110
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.d.mts
CHANGED
|
@@ -168,6 +168,7 @@ interface StagesProps extends ElementProps {
|
|
|
168
168
|
triggerOnClick?: boolean;
|
|
169
169
|
saving?: boolean;
|
|
170
170
|
canvasMode?: 'desktop' | 'tablet' | 'mobile' | 'app';
|
|
171
|
+
primaryColor?: string
|
|
171
172
|
}
|
|
172
173
|
|
|
173
174
|
type ButtonProps = ElementProps & React.ComponentProps<"button"> & {
|
|
@@ -494,7 +495,7 @@ declare const HistoryTimeline: ({ title, className, loading, titleKey, descripti
|
|
|
494
495
|
|
|
495
496
|
declare const Tabs: ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder, source, parentKey, menuNameKey, menuUrlKey, loading, bgActiveColor, textActiveColor }: TabsProps) => react_jsx_runtime.JSX.Element;
|
|
496
497
|
|
|
497
|
-
declare const StagesComponent: ({ stages, isShowBtn, buttonText, className, style, onStageChange, currentStage, dataKey, dataLabel, loading, saving, triggerOnClick, canvasMode }: StagesProps) => react_jsx_runtime.JSX.Element;
|
|
498
|
+
declare const StagesComponent: ({ stages, isShowBtn, buttonText, className, style, onStageChange, currentStage, dataKey, dataLabel, loading, saving, triggerOnClick, canvasMode, ...props }: StagesProps) => react_jsx_runtime.JSX.Element;
|
|
498
499
|
|
|
499
500
|
declare const Spacer: ({ className, style }: ElementProps) => react_jsx_runtime.JSX.Element;
|
|
500
501
|
|
package/dist/index.d.ts
CHANGED
|
@@ -168,6 +168,7 @@ interface StagesProps extends ElementProps {
|
|
|
168
168
|
triggerOnClick?: boolean;
|
|
169
169
|
saving?: boolean;
|
|
170
170
|
canvasMode?: 'desktop' | 'tablet' | 'mobile' | 'app';
|
|
171
|
+
primaryColor?: string
|
|
171
172
|
}
|
|
172
173
|
|
|
173
174
|
type ButtonProps = ElementProps & React.ComponentProps<"button"> & {
|
|
@@ -494,7 +495,7 @@ declare const HistoryTimeline: ({ title, className, loading, titleKey, descripti
|
|
|
494
495
|
|
|
495
496
|
declare const Tabs: ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder, source, parentKey, menuNameKey, menuUrlKey, loading, bgActiveColor, textActiveColor }: TabsProps) => react_jsx_runtime.JSX.Element;
|
|
496
497
|
|
|
497
|
-
declare const StagesComponent: ({ stages, isShowBtn, buttonText, className, style, onStageChange, currentStage, dataKey, dataLabel, loading, saving, triggerOnClick, canvasMode }: StagesProps) => react_jsx_runtime.JSX.Element;
|
|
498
|
+
declare const StagesComponent: ({ stages, isShowBtn, buttonText, className, style, onStageChange, currentStage, dataKey, dataLabel, loading, saving, triggerOnClick, canvasMode, ...props }: StagesProps) => react_jsx_runtime.JSX.Element;
|
|
498
499
|
|
|
499
500
|
declare const Spacer: ({ className, style }: ElementProps) => react_jsx_runtime.JSX.Element;
|
|
500
501
|
|
package/dist/index.js
CHANGED
|
@@ -3781,11 +3781,9 @@ var valueFormatter = (value, format3, customFormatters = {}) => {
|
|
|
3781
3781
|
case "date":
|
|
3782
3782
|
return dayjs_setup_default(value).format(arg || "YYYY-MM-DD");
|
|
3783
3783
|
case "datetimenumber":
|
|
3784
|
-
|
|
3785
|
-
return parsed.format("YYYY-MM-DD hh:mm");
|
|
3784
|
+
return dayjs_setup_default(value).format("YYYY-MM-DD hh:mm");
|
|
3786
3785
|
case "datetime":
|
|
3787
|
-
|
|
3788
|
-
return formated.format("DD MMM YYYY hh:mm A");
|
|
3786
|
+
return dayjs_setup_default(value).format("DD MMM YYYY hh:mm A");
|
|
3789
3787
|
case "days":
|
|
3790
3788
|
return `${dayjs_setup_default().diff(dayjs_setup_default(value), "day")} days`;
|
|
3791
3789
|
case "months":
|
|
@@ -5629,29 +5627,6 @@ function TooltipTrigger({
|
|
|
5629
5627
|
}) {
|
|
5630
5628
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
5631
5629
|
}
|
|
5632
|
-
function TooltipContent({
|
|
5633
|
-
className,
|
|
5634
|
-
sideOffset = 0,
|
|
5635
|
-
children,
|
|
5636
|
-
...props
|
|
5637
|
-
}) {
|
|
5638
|
-
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
5639
|
-
TooltipPrimitive.Content,
|
|
5640
|
-
{
|
|
5641
|
-
"data-slot": "tooltip-content",
|
|
5642
|
-
sideOffset,
|
|
5643
|
-
className: cn(
|
|
5644
|
-
"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",
|
|
5645
|
-
className
|
|
5646
|
-
),
|
|
5647
|
-
...props,
|
|
5648
|
-
children: [
|
|
5649
|
-
children,
|
|
5650
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TooltipPrimitive.Arrow, { className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
5651
|
-
]
|
|
5652
|
-
}
|
|
5653
|
-
) });
|
|
5654
|
-
}
|
|
5655
5630
|
|
|
5656
5631
|
// src/components/Navigation/Stages/Stages.tsx
|
|
5657
5632
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
@@ -5668,7 +5643,8 @@ var StagesComponent = ({
|
|
|
5668
5643
|
loading,
|
|
5669
5644
|
saving,
|
|
5670
5645
|
triggerOnClick = false,
|
|
5671
|
-
canvasMode = "desktop"
|
|
5646
|
+
canvasMode = "desktop",
|
|
5647
|
+
...props
|
|
5672
5648
|
}) => {
|
|
5673
5649
|
const [activeStage, setActiveStage] = (0, import_react34.useState)("");
|
|
5674
5650
|
const [isCompleted, setIsCompleted] = (0, import_react34.useState)(false);
|
|
@@ -5746,6 +5722,7 @@ var StagesComponent = ({
|
|
|
5746
5722
|
}, [currentStage, stages]);
|
|
5747
5723
|
const isAllStagesCompleted = isCompleted || activeRootStage?.[dataKey] === lastStage;
|
|
5748
5724
|
const disabled = isAllStagesCompleted || loading || saving;
|
|
5725
|
+
const primaryColor = props.primaryColor || "#12715b";
|
|
5749
5726
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
5750
5727
|
"div",
|
|
5751
5728
|
{
|
|
@@ -5783,16 +5760,19 @@ var StagesComponent = ({
|
|
|
5783
5760
|
const currentIndex = stages.findIndex((s) => s[dataKey] === activeStage);
|
|
5784
5761
|
const isCompletedStage = isAllStagesCompleted || index <= currentIndex;
|
|
5785
5762
|
const isActive = !isAllStagesCompleted && index === currentIndex;
|
|
5786
|
-
let stageColor =
|
|
5763
|
+
let stageColor = `text-[${primaryColor}] border-2 border-[${primaryColor}]`;
|
|
5764
|
+
let stageStyle = { borderColor: primaryColor, color: isActive ? "white" : primaryColor, backgroundColor: isActive ? primaryColor : "transparent" };
|
|
5787
5765
|
if (stage.hasOwnProperty("isSuccess") && stage.isSuccess === false) {
|
|
5788
|
-
stageColor =
|
|
5766
|
+
stageColor = `bg-red-50 text-red-700 border-2 border-red-700`;
|
|
5767
|
+
stageStyle = { borderColor: "red", color: "red", backgroundColor: "transparent" };
|
|
5789
5768
|
}
|
|
5790
5769
|
let stageLabel = stage[dataLabel];
|
|
5791
5770
|
if (stage[dataKey] !== activeChildStage?.[dataKey] && activeRootStage?.[dataKey] === stage[dataKey]) {
|
|
5792
5771
|
stageLabel = activeChildStage?.[dataLabel] || stageLabel;
|
|
5793
|
-
stageColor =
|
|
5772
|
+
stageColor = `text-[${primaryColor}] border-2 border-[${primaryColor}]`;
|
|
5794
5773
|
if (activeChildStage.hasOwnProperty("isSuccess") && activeChildStage.isSuccess === false) {
|
|
5795
5774
|
stageColor = "bg-red-50 text-red-700 border-2 border-red-700";
|
|
5775
|
+
stageStyle = { borderColor: "red", color: "red", backgroundColor: "transparent" };
|
|
5796
5776
|
}
|
|
5797
5777
|
}
|
|
5798
5778
|
const stageKey = typeof stage[dataKey] === "string" ? stage[dataKey] : JSON.stringify(stage[dataKey]);
|
|
@@ -5804,17 +5784,17 @@ var StagesComponent = ({
|
|
|
5804
5784
|
min-w-[70px] sm:min-w-[80px] w-full sm:w-auto px-3 sm:px-4 py-1.5 sm:py-2
|
|
5805
5785
|
rounded-full text-xs sm:text-sm font-medium transition-colors duration-200
|
|
5806
5786
|
whitespace-normal sm:whitespace-nowrap flex-shrink-0 max-w-[150px] text-ellipsis overflow-hidden
|
|
5807
|
-
${isActive ?
|
|
5787
|
+
${isActive ? `bg-[${primaryColor}] text-white shadow-md` : isCompletedStage ? stageColor : "bg-white border border-gray-200"}
|
|
5808
5788
|
${isMobile ? "flex-1 text-center py-2.5" : ""}
|
|
5809
5789
|
`,
|
|
5810
5790
|
onClick: () => {
|
|
5811
5791
|
if (isAllStagesCompleted) return;
|
|
5812
5792
|
onStageClick(stage[dataKey]);
|
|
5813
5793
|
},
|
|
5794
|
+
style: stageStyle,
|
|
5814
5795
|
children: stageLabel
|
|
5815
5796
|
}
|
|
5816
5797
|
) }),
|
|
5817
|
-
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(TooltipContent, { className: "max-w-[400px] p-3 text-xs text-muted-foreground space-y-2", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("b", { children: stageLabel }) }) }),
|
|
5818
5798
|
!isMobile && index < stages.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "hidden sm:flex sm:flex-shrink-0 w-3 h-px bg-gray-300 sm:w-4" })
|
|
5819
5799
|
] }, stageKey) }, stageKey);
|
|
5820
5800
|
})
|
|
@@ -5831,12 +5811,13 @@ var StagesComponent = ({
|
|
|
5831
5811
|
"button",
|
|
5832
5812
|
{
|
|
5833
5813
|
className: `
|
|
5834
|
-
w-full lg:w-auto
|
|
5814
|
+
w-full lg:w-auto text-white px-4 lg:px-6 py-2.5
|
|
5835
5815
|
rounded-lg text-sm font-medium transition-colors duration-200
|
|
5836
5816
|
shadow-sm ${disabled ? "opacity-50 cursor-not-allowed" : "hover:shadow-md"}
|
|
5837
5817
|
`,
|
|
5838
5818
|
onClick: nextStage,
|
|
5839
5819
|
disabled,
|
|
5820
|
+
style: { backgroundColor: primaryColor },
|
|
5840
5821
|
children: saving ? "Updating..." : buttonText
|
|
5841
5822
|
}
|
|
5842
5823
|
)
|