@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.mjs CHANGED
@@ -17262,6 +17262,14 @@ function HeadbarChevronIcon({ open }) {
17262
17262
  }
17263
17263
  );
17264
17264
  }
17265
+ function getHeadbarSummaryTitle(rootLabel, childLabel) {
17266
+ if (typeof rootLabel !== "string" || typeof childLabel !== "string") {
17267
+ return void 0;
17268
+ }
17269
+ const rootText = rootLabel.trim();
17270
+ const childText = childLabel.trim();
17271
+ return rootText && childText ? `${rootText} ${childText}` : void 0;
17272
+ }
17265
17273
  function HeadbarNavMenuItem({
17266
17274
  activeItemId,
17267
17275
  compound,
@@ -17272,6 +17280,7 @@ function HeadbarNavMenuItem({
17272
17280
  menuContentRadiusClass,
17273
17281
  menuItemRadiusClass,
17274
17282
  onNavigate,
17283
+ title,
17275
17284
  useTokenRadius
17276
17285
  }) {
17277
17286
  const [open, setOpen] = useState(false);
@@ -17318,7 +17327,8 @@ function HeadbarNavMenuItem({
17318
17327
  active: isActive || isOpen,
17319
17328
  icon: item.icon,
17320
17329
  endIcon: /* @__PURE__ */ jsx(HeadbarChevronIcon, { open: isOpen }),
17321
- label: /* @__PURE__ */ jsx("span", { className: "truncate whitespace-nowrap", children: label }),
17330
+ label,
17331
+ title,
17322
17332
  disabled: item.disabled,
17323
17333
  onClick: () => {
17324
17334
  const wasOpenOnPointerDown = wasOpenOnPointerDownRef.current;
@@ -17345,7 +17355,7 @@ function HeadbarNavMenuItem({
17345
17355
  ),
17346
17356
  classNames: {
17347
17357
  icon: "text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current",
17348
- label: "text-[inherit] [&_*]:!text-[inherit]"
17358
+ label: "flex min-w-0 items-center text-[inherit] [&_*]:!text-[inherit]"
17349
17359
  },
17350
17360
  className: cn2(
17351
17361
  "max-w-[12rem] shrink-0 border shadow-none",
@@ -17364,10 +17374,13 @@ function HeadbarNavMenuItem({
17364
17374
  onMouseEnter: openMenu,
17365
17375
  onMouseLeave: scheduleCloseMenu,
17366
17376
  className: cn2(
17367
- "z-50 min-w-56 border p-1.5 animate-in fade-in-0 zoom-in-95",
17377
+ "z-50 border p-1.5 animate-in fade-in-0 zoom-in-95",
17368
17378
  menuContentRadiusClass
17369
17379
  ),
17370
17380
  style: {
17381
+ width: "max-content",
17382
+ minWidth: "var(--radix-dropdown-menu-trigger-width)",
17383
+ maxWidth: "min(20rem, var(--radix-dropdown-menu-content-available-width))",
17371
17384
  background: "var(--monkeys-component-navigation-headbar-menu-background, hsl(var(--popover)))",
17372
17385
  borderColor: "var(--monkeys-component-navigation-headbar-menu-border-color, hsl(var(--border)))",
17373
17386
  color: "var(--monkeys-component-navigation-headbar-menu-foreground, hsl(var(--popover-foreground)))",
@@ -17379,7 +17392,7 @@ function HeadbarNavMenuItem({
17379
17392
  {
17380
17393
  disabled: child.disabled,
17381
17394
  className: cn2(
17382
- "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)))]",
17395
+ "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)))]",
17383
17396
  menuItemRadiusClass
17384
17397
  ),
17385
17398
  style: getHeadbarItemStyle(
@@ -17423,7 +17436,24 @@ function NavigationHeadbarMenu({
17423
17436
  return /* @__PURE__ */ jsx("div", { className: "flex w-max min-w-0 shrink-0 items-center gap-1", children: items.map((item) => {
17424
17437
  const isActive = activeRootId === item.id || activeItemId === item.id;
17425
17438
  const hasSecondaryAction = Boolean(item.headbarSecondaryAction);
17426
- const label = item.headbarLabel ?? item.label;
17439
+ const rootLabel = item.headbarLabel ?? item.label;
17440
+ const activeChild = item.children?.find(
17441
+ (child) => child.id === activeItemId
17442
+ );
17443
+ const activeChildLabel = activeChild ? activeChild.headbarLabel ?? activeChild.label : void 0;
17444
+ const label = activeChild ? /* @__PURE__ */ jsxs(
17445
+ "span",
17446
+ {
17447
+ "data-navigation-headbar-selected-child": activeChild.id,
17448
+ className: "flex min-w-0 items-center gap-1.5 whitespace-nowrap",
17449
+ children: [
17450
+ /* @__PURE__ */ jsx("span", { className: "shrink-0", children: rootLabel }),
17451
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: ": " }),
17452
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: activeChildLabel })
17453
+ ]
17454
+ }
17455
+ ) : /* @__PURE__ */ jsx("span", { className: "truncate whitespace-nowrap", children: rootLabel });
17456
+ const title = activeChild ? getHeadbarSummaryTitle(rootLabel, activeChildLabel) : void 0;
17427
17457
  const primaryAction = item.children?.length ? /* @__PURE__ */ jsx(
17428
17458
  HeadbarNavMenuItem,
17429
17459
  {
@@ -17436,6 +17466,7 @@ function NavigationHeadbarMenu({
17436
17466
  menuContentRadiusClass,
17437
17467
  menuItemRadiusClass,
17438
17468
  onNavigate,
17469
+ title,
17439
17470
  useTokenRadius
17440
17471
  }
17441
17472
  ) : /* @__PURE__ */ jsx(