@beweco/aurora-ui 0.6.12 → 0.6.18

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.cjs.js CHANGED
@@ -3234,8 +3234,15 @@ var MenuComponent = React.memo(function Menu(_a) {
3234
3234
  t.notDefinedLabel;
3235
3235
  var userRole = (typeof (userInfo === null || userInfo === void 0 ? void 0 : userInfo.role) === "string" && userInfo.role.trim()) ||
3236
3236
  t.notDefinedLabel;
3237
- var helpTitle = (typeof (helpButton === null || helpButton === void 0 ? void 0 : helpButton.title) === "string" && helpButton.title.trim()) ||
3238
- t.notDefinedLabel;
3237
+ var helpSection = React.useMemo(function () {
3238
+ if (helpButton == null)
3239
+ return null;
3240
+ var title = typeof helpButton.title === "string" ? helpButton.title.trim() : "";
3241
+ var redirect = typeof helpButton.redirect === "string" ? helpButton.redirect.trim() : "";
3242
+ if (!title || !redirect)
3243
+ return null;
3244
+ return { title: title, redirect: redirect };
3245
+ }, [helpButton]);
3239
3246
  var hasValidLogo = typeof (commerceInfo === null || commerceInfo === void 0 ? void 0 : commerceInfo.logo) === "string" &&
3240
3247
  commerceInfo.logo.trim() !== "" &&
3241
3248
  !logoError;
@@ -3257,11 +3264,9 @@ var MenuComponent = React.memo(function Menu(_a) {
3257
3264
  setIsCollapsed(function (prev) { return !prev; });
3258
3265
  }, []);
3259
3266
  var handleHelpClick = React.useCallback(function () {
3260
- var _a;
3261
- var url = (_a = helpButton === null || helpButton === void 0 ? void 0 : helpButton.redirect) === null || _a === void 0 ? void 0 : _a.trim();
3262
- if (url)
3263
- window.open(url, "_blank");
3264
- }, [helpButton]);
3267
+ if (helpSection)
3268
+ window.open(helpSection.redirect, "_blank");
3269
+ }, [helpSection]);
3265
3270
  // Menú lateral: al seleccionar ítem/sub-ítem cerrar en móvil. No hacer nada si es una sección (solo título).
3266
3271
  var handleMenuSelect = React.useCallback(function (key, href) {
3267
3272
  var _a;
@@ -3391,7 +3396,7 @@ var MenuComponent = React.memo(function Menu(_a) {
3391
3396
  flexDirection: isCollapsed ? "column-reverse" : "row",
3392
3397
  }, children: [jsxRuntime.jsxs("div", { className: "flex flex-row items-center justify-center ".concat(isCollapsed ? "gap-0" : "gap-2"), children: [jsxRuntime.jsx("div", { className: "flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden rounded-full bg-foreground text-background", children: hasValidLogo ? (jsxRuntime.jsx("img", { src: commerceInfo.logo, alt: "".concat(t.logoAlt, " ").concat(commerceName), className: "h-full w-full object-cover", onError: function () { return setLogoError(true); } })) : (jsxRuntime.jsx(IconComponent, { icon: "solar:buildings-2-outline", size: "sm", className: "shrink-0", "aria-hidden": true })) }), jsxRuntime.jsx("span", { className: "collapsible-item text-small font-bold truncate min-w-0", children: commerceName })] }), jsxRuntime.jsxs("div", { className: "flex items-center", children: [jsxRuntime.jsx(IconComponent, { icon: "material-symbols-light:close", size: "lg", className: "cursor-pointer block sm:hidden", onClick: handleSidebarClose }), jsxRuntime.jsx(IconComponent, { icon: isCollapsed
3393
3398
  ? "solar:alt-arrow-right-outline"
3394
- : "solar:alt-arrow-left-outline", size: "lg", className: "hidden sm:block cursor-pointer", onClick: handleCollapseToggle })] })] }), jsxRuntime.jsx(react.Spacer, { y: 6 }), jsxRuntime.jsxs("div", { className: "content__menu--user ".concat(isCollapsed ? "gap-0" : "gap-3"), children: [jsxRuntime.jsx(react.Avatar, { size: "md", src: ((_b = userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) === null || _b === void 0 ? void 0 : _b.trim()) || undefined, color: !((_c = userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) === null || _c === void 0 ? void 0 : _c.trim()) ? "warning" : "default", name: userName, className: "shrink-0" }), jsxRuntime.jsxs("div", { className: "collapsible-item flex min-w-0 flex-col overflow-hidden", children: [jsxRuntime.jsx("p", { className: "text-small font-medium text-default-900 truncate", children: userName }), jsxRuntime.jsx("p", { className: "text-tiny text-default-400 truncate", children: userRole })] })] }), jsxRuntime.jsxs("div", { className: "".concat(!isCollapsed ? "flex-1" : "h-full", " min-h-0 py-6 relative"), children: [!isCollapsed && showScrollArrows && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [scrollState.canScrollUp && (jsxRuntime.jsx("button", { type: "button", "aria-label": t.scrollUpAriaLabel, className: "menu-scroll-arrow menu-scroll-arrow--up", onClick: handleScrollUp, children: jsxRuntime.jsx(IconComponent, { icon: "solar:alt-arrow-up-outline", size: "lg", "aria-hidden": true }) })), scrollState.canScrollDown && (jsxRuntime.jsx("button", { type: "button", "aria-label": t.scrollDownAriaLabel, className: "menu-scroll-arrow menu-scroll-arrow--down", onClick: handleScrollDown, children: jsxRuntime.jsx(IconComponent, { icon: "solar:alt-arrow-down-outline", size: "lg", "aria-hidden": true }) }))] })), jsxRuntime.jsx("div", { ref: scrollContainerRef, className: "h-full overflow-y-auto pr-6 -mr-6 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none] select-none ".concat(isDraggingScroll ? "cursor-grabbing" : ""), onMouseDown: handleScrollAreaMouseDown, children: jsxRuntime.jsx(MenuNavList, { defaultSelectedKey: selectedKey, items: menuItems.items, isCollapsed: isCollapsed, onSelect: handleMenuSelect }, selectedKey) })] }), jsxRuntime.jsx("div", { className: "mt-auto flex flex-col justify-center items-center", children: jsxRuntime.jsx(react.Button, { fullWidth: true, className: " text-default-500 data-[hover=true]:text-default-600", startContent: jsxRuntime.jsx(IconComponent, { className: "text-default-500", icon: "solar:info-circle-line-duotone", size: "md" }), variant: "light", onPress: handleHelpClick, isIconOnly: isCollapsed, children: !isCollapsed && (jsxRuntime.jsx("span", { className: "collapsible-item truncate", children: helpTitle })) }) })] }) })] }));
3399
+ : "solar:alt-arrow-left-outline", size: "lg", className: "hidden sm:block cursor-pointer", onClick: handleCollapseToggle })] })] }), jsxRuntime.jsx(react.Spacer, { y: 6 }), jsxRuntime.jsxs("div", { className: "content__menu--user ".concat(isCollapsed ? "gap-0" : "gap-3"), children: [jsxRuntime.jsx(react.Avatar, { size: "md", src: ((_b = userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) === null || _b === void 0 ? void 0 : _b.trim()) || undefined, color: !((_c = userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) === null || _c === void 0 ? void 0 : _c.trim()) ? "warning" : "default", name: userName, className: "shrink-0" }), jsxRuntime.jsxs("div", { className: "collapsible-item flex min-w-0 flex-col overflow-hidden", children: [jsxRuntime.jsx("p", { className: "text-small font-medium text-default-900 truncate", children: userName }), jsxRuntime.jsx("p", { className: "text-tiny text-default-400 truncate", children: userRole })] })] }), jsxRuntime.jsxs("div", { className: "".concat(!isCollapsed ? "flex-1" : "h-full", " min-h-0 py-6 relative"), children: [!isCollapsed && showScrollArrows && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [scrollState.canScrollUp && (jsxRuntime.jsx("button", { type: "button", "aria-label": t.scrollUpAriaLabel, className: "menu-scroll-arrow menu-scroll-arrow--up", onClick: handleScrollUp, children: jsxRuntime.jsx(IconComponent, { icon: "solar:alt-arrow-up-outline", size: "lg", "aria-hidden": true }) })), scrollState.canScrollDown && (jsxRuntime.jsx("button", { type: "button", "aria-label": t.scrollDownAriaLabel, className: "menu-scroll-arrow menu-scroll-arrow--down", onClick: handleScrollDown, children: jsxRuntime.jsx(IconComponent, { icon: "solar:alt-arrow-down-outline", size: "lg", "aria-hidden": true }) }))] })), jsxRuntime.jsx("div", { ref: scrollContainerRef, className: "h-full overflow-y-auto pr-6 -mr-6 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none] select-none ".concat(isDraggingScroll ? "cursor-grabbing" : ""), onMouseDown: handleScrollAreaMouseDown, children: jsxRuntime.jsx(MenuNavList, { defaultSelectedKey: selectedKey, items: menuItems.items, isCollapsed: isCollapsed, onSelect: handleMenuSelect }, selectedKey) })] }), helpSection ? (jsxRuntime.jsx("div", { className: "mt-auto flex flex-col justify-center items-center", children: jsxRuntime.jsx(react.Button, { fullWidth: true, className: " text-default-500 data-[hover=true]:text-default-600", startContent: jsxRuntime.jsx(IconComponent, { className: "text-default-500", icon: "solar:info-circle-line-duotone", size: "md" }), variant: "light", onPress: handleHelpClick, isIconOnly: isCollapsed, children: !isCollapsed && (jsxRuntime.jsx("span", { className: "collapsible-item truncate", children: helpSection.title })) }) })) : null] }) })] }));
3395
3400
  });
3396
3401
 
3397
3402
  var StepIndicator = function (_a) {
@@ -7008,7 +7013,157 @@ var ModalContent = react.ModalContent;
7008
7013
 
7009
7014
  var ModalHeader = react.ModalHeader;
7010
7015
 
7011
- var ModalBody = react.ModalBody;
7016
+ var ModalBody = React.forwardRef(function (props, forwardedRef) {
7017
+ var nodeRef = React.useRef(null);
7018
+ var callbackRef = React.useCallback(function (node) {
7019
+ nodeRef.current = node;
7020
+ if (forwardedRef) {
7021
+ if (typeof forwardedRef === "function")
7022
+ forwardedRef(node);
7023
+ else
7024
+ forwardedRef.current = node;
7025
+ }
7026
+ }, [forwardedRef]);
7027
+ React.useEffect(function () {
7028
+ var node = nodeRef.current;
7029
+ if (!node)
7030
+ return;
7031
+ var parent = node.parentElement;
7032
+ if (!parent)
7033
+ return;
7034
+ // Hide native scrollbar
7035
+ node.style.scrollbarWidth = "none";
7036
+ // Parent needs relative positioning for the track
7037
+ var parentPos = window.getComputedStyle(parent).position;
7038
+ if (parentPos === "static") {
7039
+ parent.style.position = "relative";
7040
+ }
7041
+ // Create track — placed on the PARENT so it doesn't scroll
7042
+ var track = document.createElement("div");
7043
+ track.setAttribute("data-auraui-scrollbar", "track");
7044
+ Object.assign(track.style, {
7045
+ position: "absolute",
7046
+ right: "20px",
7047
+ width: "6px",
7048
+ zIndex: "10",
7049
+ cursor: "pointer",
7050
+ });
7051
+ // Create thumb
7052
+ var thumb = document.createElement("div");
7053
+ thumb.setAttribute("data-auraui-scrollbar", "thumb");
7054
+ Object.assign(thumb.style, {
7055
+ width: "6px",
7056
+ borderRadius: "3px",
7057
+ backgroundColor: "rgba(255,255,255,0.28)",
7058
+ cursor: "grab",
7059
+ });
7060
+ track.appendChild(thumb);
7061
+ parent.appendChild(track);
7062
+ // --- Scroll position update ---
7063
+ var trackHeight = 0;
7064
+ var thumbH = 0;
7065
+ var update = function () {
7066
+ var scrollTop = node.scrollTop, scrollHeight = node.scrollHeight, clientHeight = node.clientHeight;
7067
+ var hasOverflow = scrollHeight > clientHeight;
7068
+ if (!hasOverflow) {
7069
+ track.style.display = "none";
7070
+ return;
7071
+ }
7072
+ track.style.display = "block";
7073
+ var nodeRect = node.getBoundingClientRect();
7074
+ var parentRect = parent.getBoundingClientRect();
7075
+ var trackTop = nodeRect.top - parentRect.top;
7076
+ trackHeight = nodeRect.height;
7077
+ track.style.top = "".concat(trackTop, "px");
7078
+ track.style.height = "".concat(trackHeight, "px");
7079
+ var ratio = clientHeight / scrollHeight;
7080
+ thumbH = Math.max(ratio * trackHeight, 30);
7081
+ var maxScroll = scrollHeight - clientHeight;
7082
+ var thumbTop = maxScroll > 0
7083
+ ? (scrollTop / maxScroll) * (trackHeight - thumbH)
7084
+ : 0;
7085
+ thumb.style.height = "".concat(thumbH, "px");
7086
+ thumb.style.marginTop = "".concat(thumbTop, "px");
7087
+ };
7088
+ node.addEventListener("scroll", update, { passive: true });
7089
+ var ro = new ResizeObserver(update);
7090
+ ro.observe(node);
7091
+ requestAnimationFrame(update);
7092
+ // --- Drag support ---
7093
+ var isDragging = false;
7094
+ var startY = 0;
7095
+ var startScrollTop = 0;
7096
+ var getIsDark = function () {
7097
+ return document.documentElement.classList.contains("dark") ||
7098
+ document.documentElement.getAttribute("data-theme") === "dark" ||
7099
+ document.body.classList.contains("dark");
7100
+ };
7101
+ var onMouseDown = function (e) {
7102
+ e.preventDefault();
7103
+ e.stopPropagation();
7104
+ isDragging = true;
7105
+ startY = e.clientY;
7106
+ startScrollTop = node.scrollTop;
7107
+ thumb.style.cursor = "grabbing";
7108
+ thumb.style.backgroundColor = getIsDark()
7109
+ ? "rgba(255,255,255,0.45)"
7110
+ : "rgba(0,0,0,0.55)";
7111
+ document.addEventListener("mousemove", onMouseMove);
7112
+ document.addEventListener("mouseup", onMouseUp);
7113
+ };
7114
+ var onMouseMove = function (e) {
7115
+ if (!isDragging)
7116
+ return;
7117
+ e.preventDefault();
7118
+ var deltaY = e.clientY - startY;
7119
+ var maxScroll = node.scrollHeight - node.clientHeight;
7120
+ var scrollDelta = (deltaY / (trackHeight - thumbH)) * maxScroll;
7121
+ node.scrollTop = startScrollTop + scrollDelta;
7122
+ };
7123
+ var onMouseUp = function () {
7124
+ isDragging = false;
7125
+ thumb.style.cursor = "grab";
7126
+ detectTheme(); // Reset thumb color
7127
+ document.removeEventListener("mousemove", onMouseMove);
7128
+ document.removeEventListener("mouseup", onMouseUp);
7129
+ };
7130
+ // Click on track to jump
7131
+ var onTrackClick = function (e) {
7132
+ if (e.target === thumb)
7133
+ return;
7134
+ var trackRect = track.getBoundingClientRect();
7135
+ var clickRatio = (e.clientY - trackRect.top) / trackHeight;
7136
+ node.scrollTop =
7137
+ clickRatio * (node.scrollHeight - node.clientHeight);
7138
+ };
7139
+ thumb.addEventListener("mousedown", onMouseDown);
7140
+ track.addEventListener("click", onTrackClick);
7141
+ // --- Theme detection ---
7142
+ var detectTheme = function () {
7143
+ if (isDragging)
7144
+ return;
7145
+ thumb.style.backgroundColor = getIsDark()
7146
+ ? "rgba(255,255,255,0.28)"
7147
+ : "rgba(0,0,0,0.4)";
7148
+ };
7149
+ detectTheme();
7150
+ var mo = new MutationObserver(detectTheme);
7151
+ mo.observe(document.documentElement, {
7152
+ attributes: true,
7153
+ attributeFilter: ["class", "data-theme", "style"],
7154
+ });
7155
+ return function () {
7156
+ node.removeEventListener("scroll", update);
7157
+ ro.disconnect();
7158
+ mo.disconnect();
7159
+ document.removeEventListener("mousemove", onMouseMove);
7160
+ document.removeEventListener("mouseup", onMouseUp);
7161
+ track.remove();
7162
+ };
7163
+ }, []);
7164
+ return (jsxRuntime.jsx(react.ModalBody, __assign({ ref: callbackRef }, props)));
7165
+ });
7166
+ ModalBody.displayName = "ModalBody";
7012
7167
 
7013
7168
  var ModalFooter = react.ModalFooter;
7014
7169
 
package/dist/index.esm.js CHANGED
@@ -3235,8 +3235,15 @@ var MenuComponent = React.memo(function Menu(_a) {
3235
3235
  t.notDefinedLabel;
3236
3236
  var userRole = (typeof (userInfo === null || userInfo === void 0 ? void 0 : userInfo.role) === "string" && userInfo.role.trim()) ||
3237
3237
  t.notDefinedLabel;
3238
- var helpTitle = (typeof (helpButton === null || helpButton === void 0 ? void 0 : helpButton.title) === "string" && helpButton.title.trim()) ||
3239
- t.notDefinedLabel;
3238
+ var helpSection = useMemo(function () {
3239
+ if (helpButton == null)
3240
+ return null;
3241
+ var title = typeof helpButton.title === "string" ? helpButton.title.trim() : "";
3242
+ var redirect = typeof helpButton.redirect === "string" ? helpButton.redirect.trim() : "";
3243
+ if (!title || !redirect)
3244
+ return null;
3245
+ return { title: title, redirect: redirect };
3246
+ }, [helpButton]);
3240
3247
  var hasValidLogo = typeof (commerceInfo === null || commerceInfo === void 0 ? void 0 : commerceInfo.logo) === "string" &&
3241
3248
  commerceInfo.logo.trim() !== "" &&
3242
3249
  !logoError;
@@ -3258,11 +3265,9 @@ var MenuComponent = React.memo(function Menu(_a) {
3258
3265
  setIsCollapsed(function (prev) { return !prev; });
3259
3266
  }, []);
3260
3267
  var handleHelpClick = useCallback(function () {
3261
- var _a;
3262
- var url = (_a = helpButton === null || helpButton === void 0 ? void 0 : helpButton.redirect) === null || _a === void 0 ? void 0 : _a.trim();
3263
- if (url)
3264
- window.open(url, "_blank");
3265
- }, [helpButton]);
3268
+ if (helpSection)
3269
+ window.open(helpSection.redirect, "_blank");
3270
+ }, [helpSection]);
3266
3271
  // Menú lateral: al seleccionar ítem/sub-ítem cerrar en móvil. No hacer nada si es una sección (solo título).
3267
3272
  var handleMenuSelect = useCallback(function (key, href) {
3268
3273
  var _a;
@@ -3392,7 +3397,7 @@ var MenuComponent = React.memo(function Menu(_a) {
3392
3397
  flexDirection: isCollapsed ? "column-reverse" : "row",
3393
3398
  }, children: [jsxs("div", { className: "flex flex-row items-center justify-center ".concat(isCollapsed ? "gap-0" : "gap-2"), children: [jsx("div", { className: "flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden rounded-full bg-foreground text-background", children: hasValidLogo ? (jsx("img", { src: commerceInfo.logo, alt: "".concat(t.logoAlt, " ").concat(commerceName), className: "h-full w-full object-cover", onError: function () { return setLogoError(true); } })) : (jsx(IconComponent, { icon: "solar:buildings-2-outline", size: "sm", className: "shrink-0", "aria-hidden": true })) }), jsx("span", { className: "collapsible-item text-small font-bold truncate min-w-0", children: commerceName })] }), jsxs("div", { className: "flex items-center", children: [jsx(IconComponent, { icon: "material-symbols-light:close", size: "lg", className: "cursor-pointer block sm:hidden", onClick: handleSidebarClose }), jsx(IconComponent, { icon: isCollapsed
3394
3399
  ? "solar:alt-arrow-right-outline"
3395
- : "solar:alt-arrow-left-outline", size: "lg", className: "hidden sm:block cursor-pointer", onClick: handleCollapseToggle })] })] }), jsx(Spacer, { y: 6 }), jsxs("div", { className: "content__menu--user ".concat(isCollapsed ? "gap-0" : "gap-3"), children: [jsx(Avatar, { size: "md", src: ((_b = userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) === null || _b === void 0 ? void 0 : _b.trim()) || undefined, color: !((_c = userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) === null || _c === void 0 ? void 0 : _c.trim()) ? "warning" : "default", name: userName, className: "shrink-0" }), jsxs("div", { className: "collapsible-item flex min-w-0 flex-col overflow-hidden", children: [jsx("p", { className: "text-small font-medium text-default-900 truncate", children: userName }), jsx("p", { className: "text-tiny text-default-400 truncate", children: userRole })] })] }), jsxs("div", { className: "".concat(!isCollapsed ? "flex-1" : "h-full", " min-h-0 py-6 relative"), children: [!isCollapsed && showScrollArrows && (jsxs(Fragment, { children: [scrollState.canScrollUp && (jsx("button", { type: "button", "aria-label": t.scrollUpAriaLabel, className: "menu-scroll-arrow menu-scroll-arrow--up", onClick: handleScrollUp, children: jsx(IconComponent, { icon: "solar:alt-arrow-up-outline", size: "lg", "aria-hidden": true }) })), scrollState.canScrollDown && (jsx("button", { type: "button", "aria-label": t.scrollDownAriaLabel, className: "menu-scroll-arrow menu-scroll-arrow--down", onClick: handleScrollDown, children: jsx(IconComponent, { icon: "solar:alt-arrow-down-outline", size: "lg", "aria-hidden": true }) }))] })), jsx("div", { ref: scrollContainerRef, className: "h-full overflow-y-auto pr-6 -mr-6 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none] select-none ".concat(isDraggingScroll ? "cursor-grabbing" : ""), onMouseDown: handleScrollAreaMouseDown, children: jsx(MenuNavList, { defaultSelectedKey: selectedKey, items: menuItems.items, isCollapsed: isCollapsed, onSelect: handleMenuSelect }, selectedKey) })] }), jsx("div", { className: "mt-auto flex flex-col justify-center items-center", children: jsx(Button$1, { fullWidth: true, className: " text-default-500 data-[hover=true]:text-default-600", startContent: jsx(IconComponent, { className: "text-default-500", icon: "solar:info-circle-line-duotone", size: "md" }), variant: "light", onPress: handleHelpClick, isIconOnly: isCollapsed, children: !isCollapsed && (jsx("span", { className: "collapsible-item truncate", children: helpTitle })) }) })] }) })] }));
3400
+ : "solar:alt-arrow-left-outline", size: "lg", className: "hidden sm:block cursor-pointer", onClick: handleCollapseToggle })] })] }), jsx(Spacer, { y: 6 }), jsxs("div", { className: "content__menu--user ".concat(isCollapsed ? "gap-0" : "gap-3"), children: [jsx(Avatar, { size: "md", src: ((_b = userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) === null || _b === void 0 ? void 0 : _b.trim()) || undefined, color: !((_c = userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) === null || _c === void 0 ? void 0 : _c.trim()) ? "warning" : "default", name: userName, className: "shrink-0" }), jsxs("div", { className: "collapsible-item flex min-w-0 flex-col overflow-hidden", children: [jsx("p", { className: "text-small font-medium text-default-900 truncate", children: userName }), jsx("p", { className: "text-tiny text-default-400 truncate", children: userRole })] })] }), jsxs("div", { className: "".concat(!isCollapsed ? "flex-1" : "h-full", " min-h-0 py-6 relative"), children: [!isCollapsed && showScrollArrows && (jsxs(Fragment, { children: [scrollState.canScrollUp && (jsx("button", { type: "button", "aria-label": t.scrollUpAriaLabel, className: "menu-scroll-arrow menu-scroll-arrow--up", onClick: handleScrollUp, children: jsx(IconComponent, { icon: "solar:alt-arrow-up-outline", size: "lg", "aria-hidden": true }) })), scrollState.canScrollDown && (jsx("button", { type: "button", "aria-label": t.scrollDownAriaLabel, className: "menu-scroll-arrow menu-scroll-arrow--down", onClick: handleScrollDown, children: jsx(IconComponent, { icon: "solar:alt-arrow-down-outline", size: "lg", "aria-hidden": true }) }))] })), jsx("div", { ref: scrollContainerRef, className: "h-full overflow-y-auto pr-6 -mr-6 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none] select-none ".concat(isDraggingScroll ? "cursor-grabbing" : ""), onMouseDown: handleScrollAreaMouseDown, children: jsx(MenuNavList, { defaultSelectedKey: selectedKey, items: menuItems.items, isCollapsed: isCollapsed, onSelect: handleMenuSelect }, selectedKey) })] }), helpSection ? (jsx("div", { className: "mt-auto flex flex-col justify-center items-center", children: jsx(Button$1, { fullWidth: true, className: " text-default-500 data-[hover=true]:text-default-600", startContent: jsx(IconComponent, { className: "text-default-500", icon: "solar:info-circle-line-duotone", size: "md" }), variant: "light", onPress: handleHelpClick, isIconOnly: isCollapsed, children: !isCollapsed && (jsx("span", { className: "collapsible-item truncate", children: helpSection.title })) }) })) : null] }) })] }));
3396
3401
  });
3397
3402
 
3398
3403
  var StepIndicator = function (_a) {
@@ -7009,7 +7014,157 @@ var ModalContent = ModalContent$1;
7009
7014
 
7010
7015
  var ModalHeader = ModalHeader$1;
7011
7016
 
7012
- var ModalBody = ModalBody$1;
7017
+ var ModalBody = forwardRef(function (props, forwardedRef) {
7018
+ var nodeRef = useRef(null);
7019
+ var callbackRef = useCallback(function (node) {
7020
+ nodeRef.current = node;
7021
+ if (forwardedRef) {
7022
+ if (typeof forwardedRef === "function")
7023
+ forwardedRef(node);
7024
+ else
7025
+ forwardedRef.current = node;
7026
+ }
7027
+ }, [forwardedRef]);
7028
+ useEffect(function () {
7029
+ var node = nodeRef.current;
7030
+ if (!node)
7031
+ return;
7032
+ var parent = node.parentElement;
7033
+ if (!parent)
7034
+ return;
7035
+ // Hide native scrollbar
7036
+ node.style.scrollbarWidth = "none";
7037
+ // Parent needs relative positioning for the track
7038
+ var parentPos = window.getComputedStyle(parent).position;
7039
+ if (parentPos === "static") {
7040
+ parent.style.position = "relative";
7041
+ }
7042
+ // Create track — placed on the PARENT so it doesn't scroll
7043
+ var track = document.createElement("div");
7044
+ track.setAttribute("data-auraui-scrollbar", "track");
7045
+ Object.assign(track.style, {
7046
+ position: "absolute",
7047
+ right: "20px",
7048
+ width: "6px",
7049
+ zIndex: "10",
7050
+ cursor: "pointer",
7051
+ });
7052
+ // Create thumb
7053
+ var thumb = document.createElement("div");
7054
+ thumb.setAttribute("data-auraui-scrollbar", "thumb");
7055
+ Object.assign(thumb.style, {
7056
+ width: "6px",
7057
+ borderRadius: "3px",
7058
+ backgroundColor: "rgba(255,255,255,0.28)",
7059
+ cursor: "grab",
7060
+ });
7061
+ track.appendChild(thumb);
7062
+ parent.appendChild(track);
7063
+ // --- Scroll position update ---
7064
+ var trackHeight = 0;
7065
+ var thumbH = 0;
7066
+ var update = function () {
7067
+ var scrollTop = node.scrollTop, scrollHeight = node.scrollHeight, clientHeight = node.clientHeight;
7068
+ var hasOverflow = scrollHeight > clientHeight;
7069
+ if (!hasOverflow) {
7070
+ track.style.display = "none";
7071
+ return;
7072
+ }
7073
+ track.style.display = "block";
7074
+ var nodeRect = node.getBoundingClientRect();
7075
+ var parentRect = parent.getBoundingClientRect();
7076
+ var trackTop = nodeRect.top - parentRect.top;
7077
+ trackHeight = nodeRect.height;
7078
+ track.style.top = "".concat(trackTop, "px");
7079
+ track.style.height = "".concat(trackHeight, "px");
7080
+ var ratio = clientHeight / scrollHeight;
7081
+ thumbH = Math.max(ratio * trackHeight, 30);
7082
+ var maxScroll = scrollHeight - clientHeight;
7083
+ var thumbTop = maxScroll > 0
7084
+ ? (scrollTop / maxScroll) * (trackHeight - thumbH)
7085
+ : 0;
7086
+ thumb.style.height = "".concat(thumbH, "px");
7087
+ thumb.style.marginTop = "".concat(thumbTop, "px");
7088
+ };
7089
+ node.addEventListener("scroll", update, { passive: true });
7090
+ var ro = new ResizeObserver(update);
7091
+ ro.observe(node);
7092
+ requestAnimationFrame(update);
7093
+ // --- Drag support ---
7094
+ var isDragging = false;
7095
+ var startY = 0;
7096
+ var startScrollTop = 0;
7097
+ var getIsDark = function () {
7098
+ return document.documentElement.classList.contains("dark") ||
7099
+ document.documentElement.getAttribute("data-theme") === "dark" ||
7100
+ document.body.classList.contains("dark");
7101
+ };
7102
+ var onMouseDown = function (e) {
7103
+ e.preventDefault();
7104
+ e.stopPropagation();
7105
+ isDragging = true;
7106
+ startY = e.clientY;
7107
+ startScrollTop = node.scrollTop;
7108
+ thumb.style.cursor = "grabbing";
7109
+ thumb.style.backgroundColor = getIsDark()
7110
+ ? "rgba(255,255,255,0.45)"
7111
+ : "rgba(0,0,0,0.55)";
7112
+ document.addEventListener("mousemove", onMouseMove);
7113
+ document.addEventListener("mouseup", onMouseUp);
7114
+ };
7115
+ var onMouseMove = function (e) {
7116
+ if (!isDragging)
7117
+ return;
7118
+ e.preventDefault();
7119
+ var deltaY = e.clientY - startY;
7120
+ var maxScroll = node.scrollHeight - node.clientHeight;
7121
+ var scrollDelta = (deltaY / (trackHeight - thumbH)) * maxScroll;
7122
+ node.scrollTop = startScrollTop + scrollDelta;
7123
+ };
7124
+ var onMouseUp = function () {
7125
+ isDragging = false;
7126
+ thumb.style.cursor = "grab";
7127
+ detectTheme(); // Reset thumb color
7128
+ document.removeEventListener("mousemove", onMouseMove);
7129
+ document.removeEventListener("mouseup", onMouseUp);
7130
+ };
7131
+ // Click on track to jump
7132
+ var onTrackClick = function (e) {
7133
+ if (e.target === thumb)
7134
+ return;
7135
+ var trackRect = track.getBoundingClientRect();
7136
+ var clickRatio = (e.clientY - trackRect.top) / trackHeight;
7137
+ node.scrollTop =
7138
+ clickRatio * (node.scrollHeight - node.clientHeight);
7139
+ };
7140
+ thumb.addEventListener("mousedown", onMouseDown);
7141
+ track.addEventListener("click", onTrackClick);
7142
+ // --- Theme detection ---
7143
+ var detectTheme = function () {
7144
+ if (isDragging)
7145
+ return;
7146
+ thumb.style.backgroundColor = getIsDark()
7147
+ ? "rgba(255,255,255,0.28)"
7148
+ : "rgba(0,0,0,0.4)";
7149
+ };
7150
+ detectTheme();
7151
+ var mo = new MutationObserver(detectTheme);
7152
+ mo.observe(document.documentElement, {
7153
+ attributes: true,
7154
+ attributeFilter: ["class", "data-theme", "style"],
7155
+ });
7156
+ return function () {
7157
+ node.removeEventListener("scroll", update);
7158
+ ro.disconnect();
7159
+ mo.disconnect();
7160
+ document.removeEventListener("mousemove", onMouseMove);
7161
+ document.removeEventListener("mouseup", onMouseUp);
7162
+ track.remove();
7163
+ };
7164
+ }, []);
7165
+ return (jsx(ModalBody$1, __assign({ ref: callbackRef }, props)));
7166
+ });
7167
+ ModalBody.displayName = "ModalBody";
7013
7168
 
7014
7169
  var ModalFooter = ModalFooter$1;
7015
7170
 
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,aAAa,CAAC;AAIrB,OAAO,KAAK,EACX,kBAAkB,EAElB,MAAM,cAAc,CAAC;AAgBtB;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA0YtD,CAAC"}
1
+ {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,aAAa,CAAC;AAIrB,OAAO,KAAK,EACX,kBAAkB,EAElB,MAAM,cAAc,CAAC;AAgBtB;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAkZtD,CAAC"}
@@ -29,7 +29,11 @@ export interface MenuComponentProps {
29
29
  name: string;
30
30
  role: string;
31
31
  };
32
- helpButton: {
32
+ /**
33
+ * Botón de ayuda al pie del sidebar. Si se omite, o si `title` / `redirect` están vacíos
34
+ * tras quitar espacios, no se renderiza la sección (útil con controles tipo objeto en Storybook).
35
+ */
36
+ helpButton?: {
33
37
  title: string;
34
38
  redirect: string;
35
39
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.types.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/Menu.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAEnF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACvC,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,6DAA6D;IAC7D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8FAA8F;IAC9F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4EAA4E;IAC5E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,2EAA2E;IAC3E,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,WAAW,kBAAkB;IAClC,YAAY,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACb,CAAC;IACF,QAAQ,EAAE;QACT,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACb,CAAC;IACF,UAAU,EAAE;QACX,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,SAAS,EAAE;QACV,KAAK,EAAE,eAAe,EAAE,CAAC;QACzB;;;WAGG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,8FAA8F;QAC9F,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB;;;WAGG;QACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,WAAW,KAAK,IAAI,CAAC;KAClF,CAAC;IACF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,YAAY,CAAC,EAAE,yBAAyB,CAAC;CACzC"}
1
+ {"version":3,"file":"Menu.types.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/Menu.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAEnF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACvC,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,6DAA6D;IAC7D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8FAA8F;IAC9F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4EAA4E;IAC5E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,2EAA2E;IAC3E,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,WAAW,kBAAkB;IAClC,YAAY,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACb,CAAC;IACF,QAAQ,EAAE;QACT,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACb,CAAC;IACF;;;OAGG;IACH,UAAU,CAAC,EAAE;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,SAAS,EAAE;QACV,KAAK,EAAE,eAAe,EAAE,CAAC;QACzB;;;WAGG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,8FAA8F;QAC9F,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB;;;WAGG;QACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,WAAW,KAAK,IAAI,CAAC;KAClF,CAAC;IACF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,YAAY,CAAC,EAAE,yBAAyB,CAAC;CACzC"}
@@ -1,3 +1,7 @@
1
- declare const ModalBody: import("@heroui/react").InternalForwardRefRenderFunction<"div", import("@heroui/react").ModalBodyProps, never>;
1
+ declare const ModalBody: import("react").ForwardRefExoticComponent<((import("@heroui/react").OmitCommonProps<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof import("@heroui/react").ModalBodyProps> & import("@heroui/react").ModalBodyProps & {
2
+ as?: import("@heroui/react").As<any> | undefined;
3
+ }) | Omit<import("@heroui/react").OmitCommonProps<Omit<Omit<any, "ref">, never>, keyof import("@heroui/react").ModalBodyProps> & import("@heroui/react").ModalBodyProps & {
4
+ as?: import("@heroui/react").As<any> | undefined;
5
+ }, "ref">) & import("react").RefAttributes<HTMLElement>>;
2
6
  export default ModalBody;
3
7
  //# sourceMappingURL=ModalBody.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModalBody.d.ts","sourceRoot":"","sources":["../../../../../src/components/modal/_internal/ModalBody.tsx"],"names":[],"mappings":"AAEA,QAAA,MAAM,SAAS,gHAAkB,CAAC;AAElC,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"ModalBody.d.ts","sourceRoot":"","sources":["../../../../../src/components/modal/_internal/ModalBody.tsx"],"names":[],"mappings":"AAYA,QAAA,MAAM,SAAS;;;;wDAqLd,CAAC;AAIF,eAAe,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beweco/aurora-ui",
3
- "version": "0.6.12",
3
+ "version": "0.6.18",
4
4
  "description": "Bewe Aurora UI Component Library",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",
@@ -12,6 +12,9 @@
12
12
  "sideEffects": false,
13
13
  "author": "Bewe",
14
14
  "license": "MIT",
15
+ "engines": {
16
+ "node": ">=24.0.0"
17
+ },
15
18
  "publishConfig": {
16
19
  "access": "restricted"
17
20
  },
@@ -31,7 +34,9 @@
31
34
  "format": "biome format --write",
32
35
  "storybook": "storybook dev --port 6006",
33
36
  "chromatic": "npx chromatic --project-token=chpt_a33f7fd2ebb3349",
34
- "prepare": "husky"
37
+ "prepare": "husky",
38
+ "publish:with-env": "dotenv -e .env -- npm publish --access public",
39
+ "npm:whoami": "dotenv -e .env -- npm whoami"
35
40
  },
36
41
  "dependencies": {
37
42
  "@heroui/react": "2.7.11",
@@ -56,6 +61,7 @@
56
61
  },
57
62
  "devDependencies": {
58
63
  "@biomejs/biome": "^1.9.4",
64
+ "@internationalized/date": "^3.8.2",
59
65
  "@rollup/plugin-commonjs": "^28.0.6",
60
66
  "@rollup/plugin-node-resolve": "^16.0.1",
61
67
  "@rollup/plugin-typescript": "^12.1.4",
@@ -72,6 +78,7 @@
72
78
  "@types/react-dom": "^19.1.5",
73
79
  "autoprefixer": "^10.4.21",
74
80
  "chromatic": "^13.0.0",
81
+ "dotenv-cli": "^8.0.0",
75
82
  "husky": "^9.1.7",
76
83
  "postcss": "^8.5.5",
77
84
  "postcss-loader": "^8.1.1",
@@ -84,8 +91,7 @@
84
91
  "sass": "^1.89.2",
85
92
  "storybook": "^8.0.0",
86
93
  "tailwindcss": "3.4.17",
87
- "typescript": "^5.8.3",
88
- "@internationalized/date": "^3.8.2"
94
+ "typescript": "^5.8.3"
89
95
  },
90
96
  "type": "module"
91
97
  }