@algorithm-shift/design-system 1.2.90 → 1.2.91
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/client.js +0 -1
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +0 -1
- package/dist/client.mjs.map +1 -1
- package/dist/index.css +8 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +60 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +60 -30
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -29954,6 +29954,7 @@ var import_link5 = __toESM(require("next/link"));
|
|
|
29954
29954
|
var import_navigation3 = require("next/navigation");
|
|
29955
29955
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
29956
29956
|
var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = false, source, parentKey, menuNameKey, menuUrlKey, loading }) => {
|
|
29957
|
+
const [openIndex, setOpenIndex] = (0, import_react29.useState)(null);
|
|
29957
29958
|
function groupMenus(menus = []) {
|
|
29958
29959
|
const menuMap = /* @__PURE__ */ new Map();
|
|
29959
29960
|
menus.forEach((menu) => {
|
|
@@ -30017,40 +30018,69 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30017
30018
|
router.push(pendingUrl);
|
|
30018
30019
|
}
|
|
30019
30020
|
};
|
|
30021
|
+
let timeout;
|
|
30020
30022
|
const renderDesktopTab = (tab, index) => {
|
|
30021
30023
|
const finalClasses = [baseClasses, isActive(tab.url) ? activeClasses : hoverClasses, tab.className || ""].join(" ");
|
|
30022
30024
|
if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
|
|
30023
|
-
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
30024
|
-
|
|
30025
|
-
|
|
30026
|
-
|
|
30027
|
-
|
|
30028
|
-
|
|
30029
|
-
|
|
30030
|
-
|
|
30031
|
-
|
|
30032
|
-
|
|
30033
|
-
|
|
30034
|
-
|
|
30035
|
-
|
|
30025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
30026
|
+
DropdownMenu,
|
|
30027
|
+
{
|
|
30028
|
+
open: openIndex === index,
|
|
30029
|
+
onOpenChange: (open) => setOpenIndex(open ? index : null),
|
|
30030
|
+
children: [
|
|
30031
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
30032
|
+
DropdownMenuTrigger,
|
|
30033
|
+
{
|
|
30034
|
+
className: `${finalClasses} inline-flex items-center gap-1`,
|
|
30035
|
+
onMouseEnter: () => {
|
|
30036
|
+
clearTimeout(timeout);
|
|
30037
|
+
setOpenIndex(index);
|
|
30038
|
+
},
|
|
30039
|
+
onMouseLeave: () => {
|
|
30040
|
+
timeout = setTimeout(() => setOpenIndex(null), 150);
|
|
30041
|
+
},
|
|
30042
|
+
children: [
|
|
30043
|
+
tab.header,
|
|
30044
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ChevronDown, { className: "h-4 w-4 opacity-80" })
|
|
30045
|
+
]
|
|
30046
|
+
}
|
|
30047
|
+
),
|
|
30048
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
30049
|
+
DropdownMenuContent,
|
|
30036
30050
|
{
|
|
30037
|
-
|
|
30038
|
-
|
|
30039
|
-
|
|
30040
|
-
|
|
30051
|
+
align: "start",
|
|
30052
|
+
sideOffset: 6,
|
|
30053
|
+
className: "z-50 min-w-[200px] max-h-80 rounded-md border border-gray-200 bg-white p-1 shadow-lg",
|
|
30054
|
+
onMouseEnter: () => {
|
|
30055
|
+
clearTimeout(timeout);
|
|
30056
|
+
setOpenIndex(index);
|
|
30057
|
+
},
|
|
30058
|
+
onMouseLeave: () => {
|
|
30059
|
+
timeout = setTimeout(() => setOpenIndex(null), 150);
|
|
30060
|
+
},
|
|
30061
|
+
children: tab.children.map((item, index2) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
30062
|
+
DropdownMenuItem,
|
|
30041
30063
|
{
|
|
30042
|
-
|
|
30043
|
-
|
|
30044
|
-
|
|
30045
|
-
|
|
30046
|
-
|
|
30047
|
-
|
|
30048
|
-
|
|
30049
|
-
|
|
30050
|
-
|
|
30051
|
-
|
|
30052
|
-
|
|
30053
|
-
|
|
30064
|
+
asChild: true,
|
|
30065
|
+
className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100 focus:bg-gray-100",
|
|
30066
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
30067
|
+
import_link5.default,
|
|
30068
|
+
{
|
|
30069
|
+
href: item.url || "#",
|
|
30070
|
+
target: item.opens_in_new_tab ? "_blank" : "_self",
|
|
30071
|
+
onClick: (e) => handleBuilderExit(e, item.url || "#"),
|
|
30072
|
+
children: item.header
|
|
30073
|
+
}
|
|
30074
|
+
)
|
|
30075
|
+
},
|
|
30076
|
+
item.id || index2
|
|
30077
|
+
))
|
|
30078
|
+
}
|
|
30079
|
+
)
|
|
30080
|
+
]
|
|
30081
|
+
},
|
|
30082
|
+
index
|
|
30083
|
+
);
|
|
30054
30084
|
}
|
|
30055
30085
|
return tab.url ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
30056
30086
|
import_link5.default,
|
|
@@ -30108,7 +30138,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30108
30138
|
const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
|
|
30109
30139
|
const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
|
|
30110
30140
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
30111
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className, style, children: [
|
|
30141
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: cn("min-h-10", className), style, children: [
|
|
30112
30142
|
forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
|
|
30113
30143
|
forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { children: renderMobileMenu() }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex md:hidden", children: renderMobileMenu() })
|
|
30114
30144
|
] }),
|