@inf-monkeys-tech/monkeys-design 1.0.6 → 1.0.7

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.
@@ -87,6 +87,7 @@ var WorkbenchResizableSidebar = forwardRef(
87
87
  function WorkbenchResizableSidebar2({
88
88
  title,
89
89
  items,
90
+ sections = [],
90
91
  activeItemId,
91
92
  itemAs,
92
93
  collapsed,
@@ -203,6 +204,7 @@ var WorkbenchResizableSidebar = forwardRef(
203
204
  document.body.style.userSelect = "";
204
205
  };
205
206
  }, [collapseThreshold, collapsible, isResizing, maxWidth, minWidth, resolvedWidth, resolvedCollapsed]);
207
+ const resolvedItems = sections.length ? [...items, ...sections.flatMap((section) => section.items)] : items;
206
208
  const renderItem = (item, mobile = false) => {
207
209
  const active = item.active ?? item.id === activeItemId;
208
210
  const ItemComponent = itemAs ?? (item.href ? "a" : "button");
@@ -239,7 +241,7 @@ var WorkbenchResizableSidebar = forwardRef(
239
241
  children: [
240
242
  /* @__PURE__ */ jsx("span", { className: cn("inline-flex h-4 w-4 shrink-0 items-center justify-center [&_svg]:h-3.5 [&_svg]:w-3.5", classNames?.itemIcon), children: item.icon }),
241
243
  mobile || !resolvedCollapsed ? /* @__PURE__ */ jsx("span", { className: cn("min-w-0 flex-1 truncate", classNames?.itemLabel), children: item.label }) : null,
242
- !mobile && !resolvedCollapsed && item.endContent ? /* @__PURE__ */ jsx("span", { className: "shrink-0", children: item.endContent }) : null
244
+ !mobile && !resolvedCollapsed && item.endContent !== void 0 && item.endContent !== null ? /* @__PURE__ */ jsx("span", { className: "shrink-0", children: item.endContent }) : null
243
245
  ]
244
246
  },
245
247
  item.id
@@ -293,12 +295,35 @@ var WorkbenchResizableSidebar = forwardRef(
293
295
  }
294
296
  ) : null
295
297
  ] }),
296
- /* @__PURE__ */ jsx("div", { className: cn("min-h-0 flex-1 space-y-2 overflow-y-auto", resolvedCollapsed && "flex w-full flex-col items-center", classNames?.list), children: items.map((item) => renderItem(item)) })
298
+ /* @__PURE__ */ jsxs("div", { className: cn("min-h-0 flex-1 space-y-2 overflow-y-auto", resolvedCollapsed && "flex w-full flex-col items-center", classNames?.list), children: [
299
+ items.map((item) => renderItem(item)),
300
+ sections.map((section) => /* @__PURE__ */ jsxs(
301
+ "div",
302
+ {
303
+ className: cn("flex w-full flex-col gap-2", classNames?.section, section.className),
304
+ children: [
305
+ !resolvedCollapsed && section.label ? /* @__PURE__ */ jsx(
306
+ "div",
307
+ {
308
+ className: cn(
309
+ "px-2 text-[11px] font-medium text-muted-foreground",
310
+ classNames?.sectionLabel,
311
+ section.labelClassName
312
+ ),
313
+ children: section.label
314
+ }
315
+ ) : null,
316
+ section.items.map((item) => renderItem(item))
317
+ ]
318
+ },
319
+ section.id
320
+ ))
321
+ ] })
297
322
  ] })
298
323
  ]
299
324
  }
300
325
  ),
301
- /* @__PURE__ */ jsx("nav", { className: cn("gap-2 overflow-x-auto pb-1", mobileClassName, classNames?.mobileNav), "aria-label": typeof title === "string" ? title : void 0, children: items.map((item) => renderItem(item, true)) })
326
+ /* @__PURE__ */ jsx("nav", { className: cn("gap-2 overflow-x-auto pb-1", mobileClassName, classNames?.mobileNav), "aria-label": typeof title === "string" ? title : void 0, children: resolvedItems.map((item) => renderItem(item, true)) })
302
327
  ] });
303
328
  }
304
329
  );