@algorithm-shift/design-system 1.2.77 → 1.2.79
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 +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +58 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +64 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3481,7 +3481,7 @@ __export(lucide_react_exports, {
|
|
|
3481
3481
|
LucideMailX: () => MailX,
|
|
3482
3482
|
LucideMailbox: () => Mailbox,
|
|
3483
3483
|
LucideMails: () => Mails,
|
|
3484
|
-
LucideMap: () =>
|
|
3484
|
+
LucideMap: () => Map2,
|
|
3485
3485
|
LucideMapMinus: () => MapMinus,
|
|
3486
3486
|
LucideMapPin: () => MapPin,
|
|
3487
3487
|
LucideMapPinCheck: () => MapPinCheck,
|
|
@@ -4317,8 +4317,8 @@ __export(lucide_react_exports, {
|
|
|
4317
4317
|
MailboxIcon: () => Mailbox,
|
|
4318
4318
|
Mails: () => Mails,
|
|
4319
4319
|
MailsIcon: () => Mails,
|
|
4320
|
-
Map: () =>
|
|
4321
|
-
MapIcon: () =>
|
|
4320
|
+
Map: () => Map2,
|
|
4321
|
+
MapIcon: () => Map2,
|
|
4322
4322
|
MapMinus: () => MapMinus,
|
|
4323
4323
|
MapMinusIcon: () => MapMinus,
|
|
4324
4324
|
MapPin: () => MapPin,
|
|
@@ -6853,7 +6853,7 @@ __export(icons_exports, {
|
|
|
6853
6853
|
MailX: () => MailX,
|
|
6854
6854
|
Mailbox: () => Mailbox,
|
|
6855
6855
|
Mails: () => Mails,
|
|
6856
|
-
Map: () =>
|
|
6856
|
+
Map: () => Map2,
|
|
6857
6857
|
MapMinus: () => MapMinus,
|
|
6858
6858
|
MapPin: () => MapPin,
|
|
6859
6859
|
MapPinCheck: () => MapPinCheck,
|
|
@@ -18466,7 +18466,7 @@ var __iconNode933 = [
|
|
|
18466
18466
|
["path", { d: "M15 5.764v15", key: "1pn4in" }],
|
|
18467
18467
|
["path", { d: "M9 3.236v15", key: "1uimfh" }]
|
|
18468
18468
|
];
|
|
18469
|
-
var
|
|
18469
|
+
var Map2 = createLucideIcon("map", __iconNode933);
|
|
18470
18470
|
|
|
18471
18471
|
// node_modules/lucide-react/dist/esm/icons/mars-stroke.js
|
|
18472
18472
|
var __iconNode934 = [
|
|
@@ -29277,12 +29277,48 @@ var CustomPagination = ({
|
|
|
29277
29277
|
var Pagination_default = CustomPagination;
|
|
29278
29278
|
|
|
29279
29279
|
// src/components/Navigation/Tabs/Tabs.tsx
|
|
29280
|
+
import { useCallback as useCallback2, useMemo as useMemo5, useState as useState6 } from "react";
|
|
29280
29281
|
import Link5 from "next/link";
|
|
29281
29282
|
import { useRouter } from "next/navigation";
|
|
29282
|
-
import { useCallback as useCallback2, useState as useState6 } from "react";
|
|
29283
29283
|
import { Fragment as Fragment19, jsx as jsx55, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
29284
|
-
var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = true }) => {
|
|
29285
|
-
|
|
29284
|
+
var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = true, source, parentKey, menuNameKey, menuUrlKey, loading }) => {
|
|
29285
|
+
function groupMenus(menus = []) {
|
|
29286
|
+
const menuMap = /* @__PURE__ */ new Map();
|
|
29287
|
+
menus.forEach((menu) => {
|
|
29288
|
+
menuMap.set(menu.menu_id, {
|
|
29289
|
+
...menu,
|
|
29290
|
+
url: menu[menuUrlKey || "url"],
|
|
29291
|
+
header: menu[menuNameKey || "name"],
|
|
29292
|
+
isDropDown: false,
|
|
29293
|
+
children: []
|
|
29294
|
+
});
|
|
29295
|
+
});
|
|
29296
|
+
const rootMenus = [];
|
|
29297
|
+
menus.forEach((menu) => {
|
|
29298
|
+
if (menu[parentKey || "parentId"]) {
|
|
29299
|
+
const parent = menuMap.get(menu[parentKey || "parentId"]);
|
|
29300
|
+
if (parent) {
|
|
29301
|
+
parent.children.push(menuMap.get(menu.menu_id));
|
|
29302
|
+
}
|
|
29303
|
+
} else {
|
|
29304
|
+
rootMenus.push(menuMap.get(menu.menu_id));
|
|
29305
|
+
}
|
|
29306
|
+
});
|
|
29307
|
+
const sortMenus = (list) => list.sort((a, b) => (a.sort_order || 0) - (b.sort_order || 0)).map((menu) => {
|
|
29308
|
+
const sortedChildren = sortMenus(menu.children || []);
|
|
29309
|
+
return {
|
|
29310
|
+
...menu,
|
|
29311
|
+
children: sortedChildren,
|
|
29312
|
+
isDropDown: sortedChildren.length > 0
|
|
29313
|
+
};
|
|
29314
|
+
});
|
|
29315
|
+
return sortMenus(rootMenus);
|
|
29316
|
+
}
|
|
29317
|
+
const rawTabs = useMemo5(() => {
|
|
29318
|
+
if (!Array.isArray(tabs)) return [];
|
|
29319
|
+
if (source === "manual") return Array.isArray(tabs) ? tabs : [];
|
|
29320
|
+
return groupMenus(tabs);
|
|
29321
|
+
}, [tabs, source, parentKey, menuNameKey, menuUrlKey]);
|
|
29286
29322
|
const baseClasses = "text-[12px] text-foreground p-2 text-center rounded-md transition-colors";
|
|
29287
29323
|
const activeClasses = "bg-white/10 text-white";
|
|
29288
29324
|
const hoverClasses = "hover:bg-white/5";
|
|
@@ -29323,14 +29359,22 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29323
29359
|
align: "start",
|
|
29324
29360
|
sideOffset: 6,
|
|
29325
29361
|
className: "z-50 min-w-[160px] rounded-md border border-gray-200 bg-white p-1 shadow-lg",
|
|
29326
|
-
children: tab.children.map((item) => /* @__PURE__ */ jsx55(
|
|
29362
|
+
children: tab.children.map((item, index2) => /* @__PURE__ */ jsx55(
|
|
29327
29363
|
DropdownMenuItem,
|
|
29328
29364
|
{
|
|
29329
29365
|
asChild: true,
|
|
29330
29366
|
className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100 focus:bg-gray-100",
|
|
29331
|
-
children: /* @__PURE__ */ jsx55(
|
|
29367
|
+
children: /* @__PURE__ */ jsx55(
|
|
29368
|
+
Link5,
|
|
29369
|
+
{
|
|
29370
|
+
href: item.url || "#",
|
|
29371
|
+
target: item.opens_in_new_tab ? "_blank" : "_self",
|
|
29372
|
+
onClick: (e) => handleBuilderExit(e, item.url || "#"),
|
|
29373
|
+
children: item.header
|
|
29374
|
+
}
|
|
29375
|
+
)
|
|
29332
29376
|
},
|
|
29333
|
-
item.id
|
|
29377
|
+
item.id || index2
|
|
29334
29378
|
))
|
|
29335
29379
|
}
|
|
29336
29380
|
)
|
|
@@ -29340,6 +29384,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29340
29384
|
Link5,
|
|
29341
29385
|
{
|
|
29342
29386
|
href: tab.url,
|
|
29387
|
+
target: tab.opens_in_new_tab ? "_blank" : "_self",
|
|
29343
29388
|
className: finalClasses,
|
|
29344
29389
|
style: tab.style,
|
|
29345
29390
|
onClick: (e) => handleBuilderExit(e, tab.url || "#"),
|
|
@@ -29364,14 +29409,14 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
29364
29409
|
if (hasChildren) {
|
|
29365
29410
|
return /* @__PURE__ */ jsxs32(DropdownMenuSub, { children: [
|
|
29366
29411
|
/* @__PURE__ */ jsx55(DropdownMenuSubTrigger, { className: "flex items-center justify-between cursor-pointer rounded-sm px-3 py-2 text-[13px] text-foreground hover:text-foreground", children: tab.header }),
|
|
29367
|
-
/* @__PURE__ */ jsx55(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item) => /* @__PURE__ */ jsx55(
|
|
29412
|
+
/* @__PURE__ */ jsx55(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item, index) => /* @__PURE__ */ jsx55(
|
|
29368
29413
|
DropdownMenuItem,
|
|
29369
29414
|
{
|
|
29370
29415
|
asChild: true,
|
|
29371
29416
|
className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100",
|
|
29372
29417
|
children: /* @__PURE__ */ jsx55(Link5, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
|
|
29373
29418
|
},
|
|
29374
|
-
item.id
|
|
29419
|
+
item.id || index
|
|
29375
29420
|
)) })
|
|
29376
29421
|
] }, i);
|
|
29377
29422
|
}
|
|
@@ -29514,7 +29559,7 @@ import Link6 from "next/link";
|
|
|
29514
29559
|
import Image3 from "next/image";
|
|
29515
29560
|
import { useRouter as useRouter2 } from "next/navigation";
|
|
29516
29561
|
import { DropdownMenuSeparator } from "@radix-ui/react-dropdown-menu";
|
|
29517
|
-
import { useCallback as useCallback3, useMemo as
|
|
29562
|
+
import { useCallback as useCallback3, useMemo as useMemo6, useState as useState7 } from "react";
|
|
29518
29563
|
import { Fragment as Fragment20, jsx as jsx62, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
29519
29564
|
function Navbar({
|
|
29520
29565
|
style,
|
|
@@ -29553,7 +29598,7 @@ function Navbar({
|
|
|
29553
29598
|
router.push(pendingUrl);
|
|
29554
29599
|
}
|
|
29555
29600
|
};
|
|
29556
|
-
const formatedMenu =
|
|
29601
|
+
const formatedMenu = useMemo6(() => {
|
|
29557
29602
|
if (source === "state" && navList && navList.length) {
|
|
29558
29603
|
return navList.map((i) => ({ ...i, header: i.name || "Menu" }));
|
|
29559
29604
|
}
|
|
@@ -29731,7 +29776,7 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
|
|
|
29731
29776
|
var BarChart_default = React12.memo(ChartComponent);
|
|
29732
29777
|
|
|
29733
29778
|
// src/components/Chart/PieChart.tsx
|
|
29734
|
-
import React13, { useEffect as useEffect23, useMemo as
|
|
29779
|
+
import React13, { useEffect as useEffect23, useMemo as useMemo7, useState as useState8 } from "react";
|
|
29735
29780
|
import {
|
|
29736
29781
|
PieChart,
|
|
29737
29782
|
Pie,
|
|
@@ -29760,18 +29805,18 @@ var DonutChart = ({ className, style, loading, ...props }) => {
|
|
|
29760
29805
|
const showLegends = props.showLegends ?? true;
|
|
29761
29806
|
const labelType = props.labelType || "inside";
|
|
29762
29807
|
const canvasMode = props.canvasMode;
|
|
29763
|
-
const data =
|
|
29808
|
+
const data = useMemo7(() => {
|
|
29764
29809
|
if (!Array.isArray(props.data)) return [];
|
|
29765
29810
|
return props.data.map((item) => ({ ...item, color: getRandomColor() }));
|
|
29766
29811
|
}, [props.data]);
|
|
29767
|
-
const total =
|
|
29812
|
+
const total = useMemo7(() => data.reduce((sum, d) => sum + d.value, 0), [data]);
|
|
29768
29813
|
const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
|
|
29769
29814
|
const [mounted, setMounted] = useState8(false);
|
|
29770
29815
|
useEffect23(() => {
|
|
29771
29816
|
const timeout = setTimeout(() => setMounted(true), 100);
|
|
29772
29817
|
return () => clearTimeout(timeout);
|
|
29773
29818
|
}, []);
|
|
29774
|
-
const renderLegends =
|
|
29819
|
+
const renderLegends = useMemo7(() => {
|
|
29775
29820
|
if (!showLegends) return null;
|
|
29776
29821
|
return /* @__PURE__ */ jsx64(Fragment21, { children: data.map((d) => /* @__PURE__ */ jsxs38(
|
|
29777
29822
|
"div",
|