@inf-monkeys-tech/monkeys-design 1.0.65 → 1.0.66

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
@@ -17297,6 +17297,14 @@ function HeadbarChevronIcon({ open }) {
17297
17297
  }
17298
17298
  );
17299
17299
  }
17300
+ function getHeadbarSummaryTitle(rootLabel, childLabel) {
17301
+ if (typeof rootLabel !== "string" || typeof childLabel !== "string") {
17302
+ return void 0;
17303
+ }
17304
+ const rootText = rootLabel.trim();
17305
+ const childText = childLabel.trim();
17306
+ return rootText && childText ? `${rootText} ${childText}` : void 0;
17307
+ }
17300
17308
  function HeadbarNavMenuItem({
17301
17309
  activeItemId,
17302
17310
  compound,
@@ -17307,6 +17315,7 @@ function HeadbarNavMenuItem({
17307
17315
  menuContentRadiusClass,
17308
17316
  menuItemRadiusClass,
17309
17317
  onNavigate,
17318
+ title,
17310
17319
  useTokenRadius
17311
17320
  }) {
17312
17321
  const [open, setOpen] = React4.useState(false);
@@ -17353,7 +17362,8 @@ function HeadbarNavMenuItem({
17353
17362
  active: isActive || isOpen,
17354
17363
  icon: item.icon,
17355
17364
  endIcon: /* @__PURE__ */ jsxRuntime.jsx(HeadbarChevronIcon, { open: isOpen }),
17356
- label: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate whitespace-nowrap", children: label }),
17365
+ label,
17366
+ title,
17357
17367
  disabled: item.disabled,
17358
17368
  onClick: () => {
17359
17369
  const wasOpenOnPointerDown = wasOpenOnPointerDownRef.current;
@@ -17380,7 +17390,7 @@ function HeadbarNavMenuItem({
17380
17390
  ),
17381
17391
  classNames: {
17382
17392
  icon: "text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current",
17383
- label: "text-[inherit] [&_*]:!text-[inherit]"
17393
+ label: "flex min-w-0 items-center text-[inherit] [&_*]:!text-[inherit]"
17384
17394
  },
17385
17395
  className: cn2(
17386
17396
  "max-w-[12rem] shrink-0 border shadow-none",
@@ -17399,10 +17409,13 @@ function HeadbarNavMenuItem({
17399
17409
  onMouseEnter: openMenu,
17400
17410
  onMouseLeave: scheduleCloseMenu,
17401
17411
  className: cn2(
17402
- "z-50 min-w-56 border p-1.5 animate-in fade-in-0 zoom-in-95",
17412
+ "z-50 border p-1.5 animate-in fade-in-0 zoom-in-95",
17403
17413
  menuContentRadiusClass
17404
17414
  ),
17405
17415
  style: {
17416
+ width: "max-content",
17417
+ minWidth: "var(--radix-dropdown-menu-trigger-width)",
17418
+ maxWidth: "min(20rem, var(--radix-dropdown-menu-content-available-width))",
17406
17419
  background: "var(--monkeys-component-navigation-headbar-menu-background, hsl(var(--popover)))",
17407
17420
  borderColor: "var(--monkeys-component-navigation-headbar-menu-border-color, hsl(var(--border)))",
17408
17421
  color: "var(--monkeys-component-navigation-headbar-menu-foreground, hsl(var(--popover-foreground)))",
@@ -17414,7 +17427,7 @@ function HeadbarNavMenuItem({
17414
17427
  {
17415
17428
  disabled: child.disabled,
17416
17429
  className: cn2(
17417
- "relative flex cursor-pointer select-none items-center gap-2.5 px-3 py-2 text-sm outline-none transition-colors hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))] focus:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] focus:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))] data-[highlighted]:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] data-[highlighted]:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))]",
17430
+ "relative flex w-full min-w-0 cursor-pointer select-none items-center gap-2.5 px-3 py-2 text-sm outline-none transition-colors hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))] focus:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] focus:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))] data-[highlighted]:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] data-[highlighted]:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))]",
17418
17431
  menuItemRadiusClass
17419
17432
  ),
17420
17433
  style: getHeadbarItemStyle(
@@ -17458,7 +17471,24 @@ function NavigationHeadbarMenu({
17458
17471
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-max min-w-0 shrink-0 items-center gap-1", children: items.map((item) => {
17459
17472
  const isActive = activeRootId === item.id || activeItemId === item.id;
17460
17473
  const hasSecondaryAction = Boolean(item.headbarSecondaryAction);
17461
- const label = item.headbarLabel ?? item.label;
17474
+ const rootLabel = item.headbarLabel ?? item.label;
17475
+ const activeChild = item.children?.find(
17476
+ (child) => child.id === activeItemId
17477
+ );
17478
+ const activeChildLabel = activeChild ? activeChild.headbarLabel ?? activeChild.label : void 0;
17479
+ const label = activeChild ? /* @__PURE__ */ jsxRuntime.jsxs(
17480
+ "span",
17481
+ {
17482
+ "data-navigation-headbar-selected-child": activeChild.id,
17483
+ className: "flex min-w-0 items-center gap-1.5 whitespace-nowrap",
17484
+ children: [
17485
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0", children: rootLabel }),
17486
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: ": " }),
17487
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: activeChildLabel })
17488
+ ]
17489
+ }
17490
+ ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate whitespace-nowrap", children: rootLabel });
17491
+ const title = activeChild ? getHeadbarSummaryTitle(rootLabel, activeChildLabel) : void 0;
17462
17492
  const primaryAction = item.children?.length ? /* @__PURE__ */ jsxRuntime.jsx(
17463
17493
  HeadbarNavMenuItem,
17464
17494
  {
@@ -17471,6 +17501,7 @@ function NavigationHeadbarMenu({
17471
17501
  menuContentRadiusClass,
17472
17502
  menuItemRadiusClass,
17473
17503
  onNavigate,
17504
+ title,
17474
17505
  useTokenRadius
17475
17506
  }
17476
17507
  ) : /* @__PURE__ */ jsxRuntime.jsx(