@algorithm-shift/design-system 1.2.962 → 1.2.963
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.js +16 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -30089,11 +30089,16 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30089
30089
|
return groupMenus(tabs);
|
|
30090
30090
|
}, [tabs, source, parentKey, menuNameKey, menuUrlKey]);
|
|
30091
30091
|
const baseClasses = "text-foreground p-2 text-center rounded-md transition-colors";
|
|
30092
|
-
const
|
|
30093
|
-
const
|
|
30092
|
+
const bgActiveColorFinal = bgActiveColor ? `bg-[${bgActiveColor}]` : "bg-white/10";
|
|
30093
|
+
const textActiveColorFinal = textActiveColor ? `text-[${textActiveColor}]` : "text-white";
|
|
30094
|
+
const activeClasses = `${bgActiveColorFinal} ${textActiveColorFinal}`;
|
|
30095
|
+
const hoverClasses = `${bgActiveColorFinal ? bgActiveColorFinal.replace("bg-", "hover:bg-") : "hover:bg-white/5"} ${textActiveColorFinal ? textActiveColorFinal.replace("text-", "hover:text-") : "hover:text-white"}`;
|
|
30094
30096
|
const isActive = (path) => {
|
|
30095
30097
|
if (!path) return false;
|
|
30096
|
-
const clean = (p) =>
|
|
30098
|
+
const clean = (p) => {
|
|
30099
|
+
while (p.endsWith("/")) p = p.slice(0, -1);
|
|
30100
|
+
return p;
|
|
30101
|
+
};
|
|
30097
30102
|
const current = clean(pathname || "");
|
|
30098
30103
|
const target = clean(path);
|
|
30099
30104
|
if (!current || !target) return false;
|
|
@@ -30134,6 +30139,11 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30134
30139
|
const renderDesktopTab = (tab, index) => {
|
|
30135
30140
|
const active = isActive(tab.url) || isParentActive(tab);
|
|
30136
30141
|
const finalClasses = [baseClasses, active ? activeClasses : hoverClasses, tab.className || ""].join(" ");
|
|
30142
|
+
const finalStyle = {
|
|
30143
|
+
...tab.style,
|
|
30144
|
+
backgroundColor: active && bgActiveColor ? bgActiveColor : void 0,
|
|
30145
|
+
color: active && textActiveColor ? textActiveColor : void 0
|
|
30146
|
+
};
|
|
30137
30147
|
if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
|
|
30138
30148
|
return /* @__PURE__ */ jsxs33(
|
|
30139
30149
|
DropdownMenu,
|
|
@@ -30152,6 +30162,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30152
30162
|
onMouseLeave: () => {
|
|
30153
30163
|
timeout = setTimeout(() => setOpenIndex(null), 150);
|
|
30154
30164
|
},
|
|
30165
|
+
style: finalStyle,
|
|
30155
30166
|
children: [
|
|
30156
30167
|
tab.header,
|
|
30157
30168
|
/* @__PURE__ */ jsx56(ChevronDown, { className: "h-4 w-4 opacity-80" })
|
|
@@ -30201,12 +30212,12 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30201
30212
|
href: tab.url,
|
|
30202
30213
|
target: tab.opens_in_new_tab ? "_blank" : "_self",
|
|
30203
30214
|
className: finalClasses,
|
|
30204
|
-
style:
|
|
30215
|
+
style: finalStyle,
|
|
30205
30216
|
onClick: (e) => handleBuilderExit(e, tab.url || "#"),
|
|
30206
30217
|
children: tab.header
|
|
30207
30218
|
},
|
|
30208
30219
|
index
|
|
30209
|
-
) : /* @__PURE__ */ jsx56("div", { className: finalClasses, style:
|
|
30220
|
+
) : /* @__PURE__ */ jsx56("div", { className: finalClasses, style: finalStyle, role: "button", tabIndex: 0, children: tab.header }, index);
|
|
30210
30221
|
};
|
|
30211
30222
|
const renderMobileMenu = () => /* @__PURE__ */ jsxs33(DropdownMenu, { children: [
|
|
30212
30223
|
/* @__PURE__ */ jsxs33(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
|