@algorithm-shift/design-system 1.2.88 → 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.d.mts CHANGED
@@ -145,6 +145,7 @@ interface StagesProps extends ElementProps {
145
145
  currentStage?: string;
146
146
  dataKey?: string;
147
147
  dataLabel?: string;
148
+ loading?: boolean;
148
149
  }
149
150
 
150
151
  type ButtonProps = ElementProps & React.ComponentProps<"button"> & {
@@ -377,7 +378,7 @@ declare const CustomPagination: ({ totalPages, currentPage, onPageChange, maxVis
377
378
 
378
379
  declare const Tabs: ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder, source, parentKey, menuNameKey, menuUrlKey, loading }: TabsProps) => react_jsx_runtime.JSX.Element;
379
380
 
380
- declare const StagesComponent: ({ stages, isShowBtn, buttonText, className, style, onStageChange, currentStage, dataKey, dataLabel }: StagesProps) => react_jsx_runtime.JSX.Element;
381
+ declare const StagesComponent: ({ stages, isShowBtn, buttonText, className, style, onStageChange, currentStage, dataKey, dataLabel, loading }: StagesProps) => react_jsx_runtime.JSX.Element;
381
382
 
382
383
  declare const Spacer: ({ className, style }: ElementProps) => react_jsx_runtime.JSX.Element;
383
384
 
package/dist/index.d.ts CHANGED
@@ -145,6 +145,7 @@ interface StagesProps extends ElementProps {
145
145
  currentStage?: string;
146
146
  dataKey?: string;
147
147
  dataLabel?: string;
148
+ loading?: boolean;
148
149
  }
149
150
 
150
151
  type ButtonProps = ElementProps & React.ComponentProps<"button"> & {
@@ -377,7 +378,7 @@ declare const CustomPagination: ({ totalPages, currentPage, onPageChange, maxVis
377
378
 
378
379
  declare const Tabs: ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder, source, parentKey, menuNameKey, menuUrlKey, loading }: TabsProps) => react_jsx_runtime.JSX.Element;
379
380
 
380
- declare const StagesComponent: ({ stages, isShowBtn, buttonText, className, style, onStageChange, currentStage, dataKey, dataLabel }: StagesProps) => react_jsx_runtime.JSX.Element;
381
+ declare const StagesComponent: ({ stages, isShowBtn, buttonText, className, style, onStageChange, currentStage, dataKey, dataLabel, loading }: StagesProps) => react_jsx_runtime.JSX.Element;
381
382
 
382
383
  declare const Spacer: ({ className, style }: ElementProps) => react_jsx_runtime.JSX.Element;
383
384
 
package/dist/index.js CHANGED
@@ -30128,7 +30128,7 @@ var Tabs_default = Tabs;
30128
30128
  // src/components/Navigation/Stages/Stages.tsx
30129
30129
  var import_react30 = __toESM(require("react"));
30130
30130
  var import_jsx_runtime58 = require("react/jsx-runtime");
30131
- var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStageChange, currentStage, dataKey = "key", dataLabel = "header" }) => {
30131
+ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStageChange, currentStage, dataKey = "key", dataLabel = "header", loading }) => {
30132
30132
  const [activeStage, setActiveStage] = (0, import_react30.useState)(currentStage || (stages && stages.length > 0 ? stages[0].key : null));
30133
30133
  const nextStage = () => {
30134
30134
  if (!stages || stages.length === 0) return;
@@ -30148,7 +30148,16 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
30148
30148
  const isAllStagesCompleted = activeStage === lastStage;
30149
30149
  return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
30150
30150
  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
30151
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => {
30151
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: loading ? Array(6).fill(null).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
30152
+ "button",
30153
+ {
30154
+ className: `
30155
+ min-w-[80px] min-h-[35px] px-4 py-2 rounded-full text-sm font-medium transition-colors duration-200 whitespace-nowrap
30156
+ text-gray-700 hover:bg-gray-100 border border-gray-200 bg-gray-100 animate-pulse`,
30157
+ disabled: true
30158
+ },
30159
+ index
30160
+ )) : stages?.length > 0 && stages?.map((stage, index) => {
30152
30161
  const currentIndex = stages.findIndex((s) => s[dataKey] === activeStage);
30153
30162
  const isCompleted = isAllStagesCompleted || index < currentIndex;
30154
30163
  const isActive = !isAllStagesCompleted && index === currentIndex;
@@ -30157,7 +30166,7 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
30157
30166
  "button",
30158
30167
  {
30159
30168
  className: `
30160
- min-w-[120px] px-4 py-2 rounded-full text-sm font-medium transition-colors duration-200 whitespace-nowrap
30169
+ min-w-[80px] px-4 py-2 rounded-full text-sm font-medium transition-colors duration-200 whitespace-nowrap
30161
30170
  ${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"}`,
30162
30171
  onClick: () => {
30163
30172
  if (isAllStagesCompleted) return;