@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.js
CHANGED
|
@@ -30178,11 +30178,16 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30178
30178
|
return groupMenus(tabs);
|
|
30179
30179
|
}, [tabs, source, parentKey, menuNameKey, menuUrlKey]);
|
|
30180
30180
|
const baseClasses = "text-foreground p-2 text-center rounded-md transition-colors";
|
|
30181
|
-
const
|
|
30182
|
-
const
|
|
30181
|
+
const bgActiveColorFinal = bgActiveColor ? `bg-[${bgActiveColor}]` : "bg-white/10";
|
|
30182
|
+
const textActiveColorFinal = textActiveColor ? `text-[${textActiveColor}]` : "text-white";
|
|
30183
|
+
const activeClasses = `${bgActiveColorFinal} ${textActiveColorFinal}`;
|
|
30184
|
+
const hoverClasses = `${bgActiveColorFinal ? bgActiveColorFinal.replace("bg-", "hover:bg-") : "hover:bg-white/5"} ${textActiveColorFinal ? textActiveColorFinal.replace("text-", "hover:text-") : "hover:text-white"}`;
|
|
30183
30185
|
const isActive = (path) => {
|
|
30184
30186
|
if (!path) return false;
|
|
30185
|
-
const clean = (p) =>
|
|
30187
|
+
const clean = (p) => {
|
|
30188
|
+
while (p.endsWith("/")) p = p.slice(0, -1);
|
|
30189
|
+
return p;
|
|
30190
|
+
};
|
|
30186
30191
|
const current = clean(pathname || "");
|
|
30187
30192
|
const target = clean(path);
|
|
30188
30193
|
if (!current || !target) return false;
|
|
@@ -30223,6 +30228,11 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30223
30228
|
const renderDesktopTab = (tab, index) => {
|
|
30224
30229
|
const active = isActive(tab.url) || isParentActive(tab);
|
|
30225
30230
|
const finalClasses = [baseClasses, active ? activeClasses : hoverClasses, tab.className || ""].join(" ");
|
|
30231
|
+
const finalStyle = {
|
|
30232
|
+
...tab.style,
|
|
30233
|
+
backgroundColor: active && bgActiveColor ? bgActiveColor : void 0,
|
|
30234
|
+
color: active && textActiveColor ? textActiveColor : void 0
|
|
30235
|
+
};
|
|
30226
30236
|
if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
|
|
30227
30237
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
30228
30238
|
DropdownMenu,
|
|
@@ -30241,6 +30251,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30241
30251
|
onMouseLeave: () => {
|
|
30242
30252
|
timeout = setTimeout(() => setOpenIndex(null), 150);
|
|
30243
30253
|
},
|
|
30254
|
+
style: finalStyle,
|
|
30244
30255
|
children: [
|
|
30245
30256
|
tab.header,
|
|
30246
30257
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ChevronDown, { className: "h-4 w-4 opacity-80" })
|
|
@@ -30290,12 +30301,12 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
|
|
|
30290
30301
|
href: tab.url,
|
|
30291
30302
|
target: tab.opens_in_new_tab ? "_blank" : "_self",
|
|
30292
30303
|
className: finalClasses,
|
|
30293
|
-
style:
|
|
30304
|
+
style: finalStyle,
|
|
30294
30305
|
onClick: (e) => handleBuilderExit(e, tab.url || "#"),
|
|
30295
30306
|
children: tab.header
|
|
30296
30307
|
},
|
|
30297
30308
|
index
|
|
30298
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: finalClasses, style:
|
|
30309
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: finalClasses, style: finalStyle, role: "button", tabIndex: 0, children: tab.header }, index);
|
|
30299
30310
|
};
|
|
30300
30311
|
const renderMobileMenu = () => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DropdownMenu, { children: [
|
|
30301
30312
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
|