@algorithm-shift/design-system 1.2.87 → 1.2.89
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 +20 -12
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +38 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +44 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -30035,29 +30035,53 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30035
30035
|
var Tabs_default = Tabs;
|
|
30036
30036
|
|
|
30037
30037
|
// src/components/Navigation/Stages/Stages.tsx
|
|
30038
|
-
import React10 from "react";
|
|
30038
|
+
import React10, { useState as useState9 } from "react";
|
|
30039
30039
|
import { jsx as jsx58, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
30040
|
-
var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStageChange, currentStage }) => {
|
|
30040
|
+
var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStageChange, currentStage, dataKey = "key", dataLabel = "header", loading }) => {
|
|
30041
|
+
const [activeStage, setActiveStage] = useState9(currentStage || (stages && stages.length > 0 ? stages[0].key : null));
|
|
30042
|
+
const nextStage = () => {
|
|
30043
|
+
if (!stages || stages.length === 0) return;
|
|
30044
|
+
const currentIndex = stages.findIndex((stage) => stage[dataKey] === activeStage);
|
|
30045
|
+
if (currentIndex < stages.length - 1) {
|
|
30046
|
+
const newStage = stages[currentIndex + 1];
|
|
30047
|
+
setActiveStage(newStage[dataKey]);
|
|
30048
|
+
onStageChange?.(newStage[dataKey]);
|
|
30049
|
+
}
|
|
30050
|
+
};
|
|
30051
|
+
const lastStage = stages && stages.length > 0 ? stages[stages.length - 1][dataKey] : null;
|
|
30052
|
+
const onStageClick = (stageKey) => {
|
|
30053
|
+
if (!stageKey || stageKey === activeStage || activeStage === lastStage) return;
|
|
30054
|
+
setActiveStage(stageKey);
|
|
30055
|
+
onStageChange?.(stageKey);
|
|
30056
|
+
};
|
|
30057
|
+
const isAllStagesCompleted = activeStage === lastStage;
|
|
30041
30058
|
return /* @__PURE__ */ jsx58("div", { className, style, children: /* @__PURE__ */ jsxs35("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
|
|
30042
30059
|
/* @__PURE__ */ jsx58("div", { className: "flex items-center", children: /* @__PURE__ */ jsx58("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ jsx58("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx58("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
|
|
30043
|
-
/* @__PURE__ */ jsx58("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children:
|
|
30044
|
-
|
|
30045
|
-
|
|
30046
|
-
|
|
30047
|
-
|
|
30060
|
+
/* @__PURE__ */ jsx58("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: loading ? Array(6).fill(null).map((_, index) => /* @__PURE__ */ jsx58(
|
|
30061
|
+
"button",
|
|
30062
|
+
{
|
|
30063
|
+
className: `
|
|
30064
|
+
min-w-[80px] min-h-[35px] px-4 py-2 rounded-full text-sm font-medium transition-colors duration-200 whitespace-nowrap
|
|
30065
|
+
text-gray-700 hover:bg-gray-100 border border-gray-200 bg-gray-100 animate-pulse`,
|
|
30066
|
+
disabled: true
|
|
30067
|
+
},
|
|
30068
|
+
index
|
|
30069
|
+
)) : stages?.length > 0 && stages?.map((stage, index) => {
|
|
30070
|
+
const currentIndex = stages.findIndex((s) => s[dataKey] === activeStage);
|
|
30071
|
+
const isCompleted = isAllStagesCompleted || index < currentIndex;
|
|
30072
|
+
const isActive = !isAllStagesCompleted && index === currentIndex;
|
|
30048
30073
|
return /* @__PURE__ */ jsxs35(React10.Fragment, { children: [
|
|
30049
30074
|
/* @__PURE__ */ jsx58(
|
|
30050
30075
|
"button",
|
|
30051
30076
|
{
|
|
30052
30077
|
className: `
|
|
30053
|
-
min-w-[
|
|
30054
|
-
${isActive ? "bg-
|
|
30078
|
+
min-w-[80px] px-4 py-2 rounded-full text-sm font-medium transition-colors duration-200 whitespace-nowrap
|
|
30079
|
+
${isActive ? "bg-green-700 text-white shadow-md" : isCompleted ? "bg-green-50 text-green-700 border border-green-700" : "bg-white text-gray-700 hover:bg-gray-100 border border-gray-200"}`,
|
|
30055
30080
|
onClick: () => {
|
|
30056
|
-
if (
|
|
30057
|
-
|
|
30058
|
-
}
|
|
30081
|
+
if (isAllStagesCompleted) return;
|
|
30082
|
+
onStageClick(stage[dataKey]);
|
|
30059
30083
|
},
|
|
30060
|
-
children: stage
|
|
30084
|
+
children: stage[dataLabel]
|
|
30061
30085
|
}
|
|
30062
30086
|
),
|
|
30063
30087
|
index < stages.length - 1 && /* @__PURE__ */ jsx58("div", { className: "flex-shrink-0 w-3 h-px bg-gray-300" })
|
|
@@ -30066,9 +30090,9 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
|
|
|
30066
30090
|
isShowBtn && /* @__PURE__ */ jsx58("div", { className: "flex items-center", children: /* @__PURE__ */ jsx58(
|
|
30067
30091
|
"button",
|
|
30068
30092
|
{
|
|
30069
|
-
className: "bg-
|
|
30093
|
+
className: "bg-green-700 text-white px-6 py-2 rounded-lg text-sm font-medium transition-colors duration-200 shadow-sm",
|
|
30070
30094
|
onClick: () => {
|
|
30071
|
-
|
|
30095
|
+
nextStage();
|
|
30072
30096
|
},
|
|
30073
30097
|
children: buttonText
|
|
30074
30098
|
}
|
|
@@ -30136,7 +30160,7 @@ import Link6 from "next/link";
|
|
|
30136
30160
|
import Image4 from "next/image";
|
|
30137
30161
|
import { useRouter as useRouter2 } from "next/navigation";
|
|
30138
30162
|
import { DropdownMenuSeparator } from "@radix-ui/react-dropdown-menu";
|
|
30139
|
-
import { useCallback as useCallback4, useMemo as useMemo5, useState as
|
|
30163
|
+
import { useCallback as useCallback4, useMemo as useMemo5, useState as useState10 } from "react";
|
|
30140
30164
|
import { Fragment as Fragment22, jsx as jsx64, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
30141
30165
|
function Navbar({
|
|
30142
30166
|
style,
|
|
@@ -30157,8 +30181,8 @@ function Navbar({
|
|
|
30157
30181
|
}) {
|
|
30158
30182
|
const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
|
|
30159
30183
|
const router = useRouter2();
|
|
30160
|
-
const [showExitDialog, setShowExitDialog] =
|
|
30161
|
-
const [pendingUrl, setPendingUrl] =
|
|
30184
|
+
const [showExitDialog, setShowExitDialog] = useState10(false);
|
|
30185
|
+
const [pendingUrl, setPendingUrl] = useState10(null);
|
|
30162
30186
|
const handleBuilderExit = useCallback4(
|
|
30163
30187
|
(e, url) => {
|
|
30164
30188
|
if (isBuilder) {
|
|
@@ -30353,7 +30377,7 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
|
|
|
30353
30377
|
var BarChart_default = React12.memo(ChartComponent);
|
|
30354
30378
|
|
|
30355
30379
|
// src/components/Chart/PieChart.tsx
|
|
30356
|
-
import React13, { useEffect as useEffect25, useMemo as useMemo6, useState as
|
|
30380
|
+
import React13, { useEffect as useEffect25, useMemo as useMemo6, useState as useState11 } from "react";
|
|
30357
30381
|
import {
|
|
30358
30382
|
PieChart,
|
|
30359
30383
|
Pie,
|
|
@@ -30388,7 +30412,7 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
30388
30412
|
}, [props.data]);
|
|
30389
30413
|
const total = useMemo6(() => data.reduce((sum, d) => sum + d.value, 0), [data]);
|
|
30390
30414
|
const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
|
|
30391
|
-
const [mounted, setMounted] =
|
|
30415
|
+
const [mounted, setMounted] = useState11(false);
|
|
30392
30416
|
useEffect25(() => {
|
|
30393
30417
|
const timeout = setTimeout(() => setMounted(true), 100);
|
|
30394
30418
|
return () => clearTimeout(timeout);
|