@umami/react-zen 0.156.0 → 0.158.0
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 +7 -2
- package/dist/index.mjs +7 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31476,6 +31476,11 @@ function NavMenuGroup({
|
|
|
31476
31476
|
...props
|
|
31477
31477
|
}) {
|
|
31478
31478
|
const [minimized, setMinimized] = (0, import_react185.useState)(!!isMinimized);
|
|
31479
|
+
const handleClick = () => {
|
|
31480
|
+
if (allowMinimize) {
|
|
31481
|
+
setMinimized((state) => !state);
|
|
31482
|
+
}
|
|
31483
|
+
};
|
|
31479
31484
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
31480
31485
|
Column,
|
|
31481
31486
|
{
|
|
@@ -31489,7 +31494,7 @@ function NavMenuGroup({
|
|
|
31489
31494
|
className: NavMenu_default.item,
|
|
31490
31495
|
alignItems: "center",
|
|
31491
31496
|
justifyContent: "space-between",
|
|
31492
|
-
onClick:
|
|
31497
|
+
onClick: handleClick,
|
|
31493
31498
|
children: [
|
|
31494
31499
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Text, { className: NavMenu_default.title, children: title }),
|
|
31495
31500
|
allowMinimize && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Icon2, { rotate: minimized ? 0 : 90, color: "muted", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ChevronRight, {}) })
|
|
@@ -31845,7 +31850,7 @@ function SidebarItem({
|
|
|
31845
31850
|
className: (0, import_classnames46.default)(Sidebar_default.item, className, isSelected && Sidebar_default.selected),
|
|
31846
31851
|
children: [
|
|
31847
31852
|
icon && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Icon2, { size: "sm", children: icon }),
|
|
31848
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Text, { className: (0, import_classnames46.default)(Sidebar_default.label), children: label }),
|
|
31853
|
+
label && !isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Text, { className: (0, import_classnames46.default)(Sidebar_default.label), children: label }),
|
|
31849
31854
|
children
|
|
31850
31855
|
]
|
|
31851
31856
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -31364,6 +31364,11 @@ function NavMenuGroup({
|
|
|
31364
31364
|
...props
|
|
31365
31365
|
}) {
|
|
31366
31366
|
const [minimized, setMinimized] = useState15(!!isMinimized);
|
|
31367
|
+
const handleClick = () => {
|
|
31368
|
+
if (allowMinimize) {
|
|
31369
|
+
setMinimized((state) => !state);
|
|
31370
|
+
}
|
|
31371
|
+
};
|
|
31367
31372
|
return /* @__PURE__ */ jsxs29(
|
|
31368
31373
|
Column,
|
|
31369
31374
|
{
|
|
@@ -31377,7 +31382,7 @@ function NavMenuGroup({
|
|
|
31377
31382
|
className: NavMenu_default.item,
|
|
31378
31383
|
alignItems: "center",
|
|
31379
31384
|
justifyContent: "space-between",
|
|
31380
|
-
onClick:
|
|
31385
|
+
onClick: handleClick,
|
|
31381
31386
|
children: [
|
|
31382
31387
|
/* @__PURE__ */ jsx53(Text, { className: NavMenu_default.title, children: title }),
|
|
31383
31388
|
allowMinimize && /* @__PURE__ */ jsx53(Icon2, { rotate: minimized ? 0 : 90, color: "muted", children: /* @__PURE__ */ jsx53(ChevronRight, {}) })
|
|
@@ -31733,7 +31738,7 @@ function SidebarItem({
|
|
|
31733
31738
|
className: (0, import_classnames46.default)(Sidebar_default.item, className, isSelected && Sidebar_default.selected),
|
|
31734
31739
|
children: [
|
|
31735
31740
|
icon && /* @__PURE__ */ jsx61(Icon2, { size: "sm", children: icon }),
|
|
31736
|
-
label && /* @__PURE__ */ jsx61(Text, { className: (0, import_classnames46.default)(Sidebar_default.label), children: label }),
|
|
31741
|
+
label && !isCollapsed && /* @__PURE__ */ jsx61(Text, { className: (0, import_classnames46.default)(Sidebar_default.label), children: label }),
|
|
31737
31742
|
children
|
|
31738
31743
|
]
|
|
31739
31744
|
}
|