@umami/react-zen 0.155.0 → 0.157.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 CHANGED
@@ -31468,7 +31468,7 @@ function NavMenu({
31468
31468
  }
31469
31469
  function NavMenuGroup({
31470
31470
  title,
31471
- allowMinimize,
31471
+ allowMinimize = true,
31472
31472
  isMinimized,
31473
31473
  className,
31474
31474
  children,
@@ -31476,22 +31476,35 @@ function NavMenuGroup({
31476
31476
  ...props
31477
31477
  }) {
31478
31478
  const [minimized, setMinimized] = (0, import_react185.useState)(!!isMinimized);
31479
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Column, { ...props, gap, className: (0, import_classnames38.default)(className, minimized && NavMenu_default.minimized), children: [
31480
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
31481
- Row,
31482
- {
31483
- className: NavMenu_default.item,
31484
- alignItems: "center",
31485
- justifyContent: "space-between",
31486
- onClick: () => setMinimized(!minimized),
31487
- children: [
31488
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Text, { className: NavMenu_default.title, children: title }),
31489
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Icon2, { rotate: minimized ? 0 : 90, color: "muted", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ChevronRight, {}) })
31490
- ]
31491
- }
31492
- ),
31493
- !minimized && children
31494
- ] });
31479
+ const handleClick = () => {
31480
+ if (allowMinimize) {
31481
+ setMinimized((state) => !state);
31482
+ }
31483
+ };
31484
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
31485
+ Column,
31486
+ {
31487
+ ...props,
31488
+ gap,
31489
+ className: (0, import_classnames38.default)(className, allowMinimize && minimized && NavMenu_default.minimized),
31490
+ children: [
31491
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
31492
+ Row,
31493
+ {
31494
+ className: NavMenu_default.item,
31495
+ alignItems: "center",
31496
+ justifyContent: "space-between",
31497
+ onClick: handleClick,
31498
+ children: [
31499
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Text, { className: NavMenu_default.title, children: title }),
31500
+ allowMinimize && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Icon2, { rotate: minimized ? 0 : 90, color: "muted", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ChevronRight, {}) })
31501
+ ]
31502
+ }
31503
+ ),
31504
+ !minimized && children
31505
+ ]
31506
+ }
31507
+ );
31495
31508
  }
31496
31509
  function NavMenuItem({ isSelected, className, children, ...props }) {
31497
31510
  const { itemBackgroundColor } = (0, import_react185.useContext)(NavMenuContext);
package/dist/index.mjs CHANGED
@@ -31356,7 +31356,7 @@ function NavMenu({
31356
31356
  }
31357
31357
  function NavMenuGroup({
31358
31358
  title,
31359
- allowMinimize,
31359
+ allowMinimize = true,
31360
31360
  isMinimized,
31361
31361
  className,
31362
31362
  children,
@@ -31364,22 +31364,35 @@ function NavMenuGroup({
31364
31364
  ...props
31365
31365
  }) {
31366
31366
  const [minimized, setMinimized] = useState15(!!isMinimized);
31367
- return /* @__PURE__ */ jsxs29(Column, { ...props, gap, className: (0, import_classnames38.default)(className, minimized && NavMenu_default.minimized), children: [
31368
- /* @__PURE__ */ jsxs29(
31369
- Row,
31370
- {
31371
- className: NavMenu_default.item,
31372
- alignItems: "center",
31373
- justifyContent: "space-between",
31374
- onClick: () => setMinimized(!minimized),
31375
- children: [
31376
- /* @__PURE__ */ jsx53(Text, { className: NavMenu_default.title, children: title }),
31377
- /* @__PURE__ */ jsx53(Icon2, { rotate: minimized ? 0 : 90, color: "muted", children: /* @__PURE__ */ jsx53(ChevronRight, {}) })
31378
- ]
31379
- }
31380
- ),
31381
- !minimized && children
31382
- ] });
31367
+ const handleClick = () => {
31368
+ if (allowMinimize) {
31369
+ setMinimized((state) => !state);
31370
+ }
31371
+ };
31372
+ return /* @__PURE__ */ jsxs29(
31373
+ Column,
31374
+ {
31375
+ ...props,
31376
+ gap,
31377
+ className: (0, import_classnames38.default)(className, allowMinimize && minimized && NavMenu_default.minimized),
31378
+ children: [
31379
+ /* @__PURE__ */ jsxs29(
31380
+ Row,
31381
+ {
31382
+ className: NavMenu_default.item,
31383
+ alignItems: "center",
31384
+ justifyContent: "space-between",
31385
+ onClick: handleClick,
31386
+ children: [
31387
+ /* @__PURE__ */ jsx53(Text, { className: NavMenu_default.title, children: title }),
31388
+ allowMinimize && /* @__PURE__ */ jsx53(Icon2, { rotate: minimized ? 0 : 90, color: "muted", children: /* @__PURE__ */ jsx53(ChevronRight, {}) })
31389
+ ]
31390
+ }
31391
+ ),
31392
+ !minimized && children
31393
+ ]
31394
+ }
31395
+ );
31383
31396
  }
31384
31397
  function NavMenuItem({ isSelected, className, children, ...props }) {
31385
31398
  const { itemBackgroundColor } = useContext6(NavMenuContext);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umami/react-zen",
3
- "version": "0.155.0",
3
+ "version": "0.157.0",
4
4
  "description": "Modern, minimalist React component library",
5
5
  "author": "Umami <hello@umami.is>",
6
6
  "license": "MIT",