@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.
@@ -3681,6 +3681,14 @@ function HeadbarChevronIcon({ open }) {
3681
3681
  }
3682
3682
  );
3683
3683
  }
3684
+ function getHeadbarSummaryTitle(rootLabel, childLabel) {
3685
+ if (typeof rootLabel !== "string" || typeof childLabel !== "string") {
3686
+ return void 0;
3687
+ }
3688
+ const rootText = rootLabel.trim();
3689
+ const childText = childLabel.trim();
3690
+ return rootText && childText ? `${rootText} ${childText}` : void 0;
3691
+ }
3684
3692
  function HeadbarNavMenuItem({
3685
3693
  activeItemId,
3686
3694
  compound,
@@ -3691,6 +3699,7 @@ function HeadbarNavMenuItem({
3691
3699
  menuContentRadiusClass,
3692
3700
  menuItemRadiusClass,
3693
3701
  onNavigate,
3702
+ title,
3694
3703
  useTokenRadius
3695
3704
  }) {
3696
3705
  const [open, setOpen] = useState(false);
@@ -3737,7 +3746,8 @@ function HeadbarNavMenuItem({
3737
3746
  active: isActive || isOpen,
3738
3747
  icon: item.icon,
3739
3748
  endIcon: /* @__PURE__ */ jsx(HeadbarChevronIcon, { open: isOpen }),
3740
- label: /* @__PURE__ */ jsx("span", { className: "truncate whitespace-nowrap", children: label }),
3749
+ label,
3750
+ title,
3741
3751
  disabled: item.disabled,
3742
3752
  onClick: () => {
3743
3753
  const wasOpenOnPointerDown = wasOpenOnPointerDownRef.current;
@@ -3764,7 +3774,7 @@ function HeadbarNavMenuItem({
3764
3774
  ),
3765
3775
  classNames: {
3766
3776
  icon: "text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current",
3767
- label: "text-[inherit] [&_*]:!text-[inherit]"
3777
+ label: "flex min-w-0 items-center text-[inherit] [&_*]:!text-[inherit]"
3768
3778
  },
3769
3779
  className: cn2(
3770
3780
  "max-w-[12rem] shrink-0 border shadow-none",
@@ -3783,10 +3793,13 @@ function HeadbarNavMenuItem({
3783
3793
  onMouseEnter: openMenu,
3784
3794
  onMouseLeave: scheduleCloseMenu,
3785
3795
  className: cn2(
3786
- "z-50 min-w-56 border p-1.5 animate-in fade-in-0 zoom-in-95",
3796
+ "z-50 border p-1.5 animate-in fade-in-0 zoom-in-95",
3787
3797
  menuContentRadiusClass
3788
3798
  ),
3789
3799
  style: {
3800
+ width: "max-content",
3801
+ minWidth: "var(--radix-dropdown-menu-trigger-width)",
3802
+ maxWidth: "min(20rem, var(--radix-dropdown-menu-content-available-width))",
3790
3803
  background: "var(--monkeys-component-navigation-headbar-menu-background, hsl(var(--popover)))",
3791
3804
  borderColor: "var(--monkeys-component-navigation-headbar-menu-border-color, hsl(var(--border)))",
3792
3805
  color: "var(--monkeys-component-navigation-headbar-menu-foreground, hsl(var(--popover-foreground)))",
@@ -3798,7 +3811,7 @@ function HeadbarNavMenuItem({
3798
3811
  {
3799
3812
  disabled: child.disabled,
3800
3813
  className: cn2(
3801
- "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)))]",
3814
+ "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)))]",
3802
3815
  menuItemRadiusClass
3803
3816
  ),
3804
3817
  style: getHeadbarItemStyle(
@@ -3842,7 +3855,24 @@ function NavigationHeadbarMenu({
3842
3855
  return /* @__PURE__ */ jsx("div", { className: "flex w-max min-w-0 shrink-0 items-center gap-1", children: items.map((item) => {
3843
3856
  const isActive = activeRootId === item.id || activeItemId === item.id;
3844
3857
  const hasSecondaryAction = Boolean(item.headbarSecondaryAction);
3845
- const label = item.headbarLabel ?? item.label;
3858
+ const rootLabel = item.headbarLabel ?? item.label;
3859
+ const activeChild = item.children?.find(
3860
+ (child) => child.id === activeItemId
3861
+ );
3862
+ const activeChildLabel = activeChild ? activeChild.headbarLabel ?? activeChild.label : void 0;
3863
+ const label = activeChild ? /* @__PURE__ */ jsxs(
3864
+ "span",
3865
+ {
3866
+ "data-navigation-headbar-selected-child": activeChild.id,
3867
+ className: "flex min-w-0 items-center gap-1.5 whitespace-nowrap",
3868
+ children: [
3869
+ /* @__PURE__ */ jsx("span", { className: "shrink-0", children: rootLabel }),
3870
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: ": " }),
3871
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: activeChildLabel })
3872
+ ]
3873
+ }
3874
+ ) : /* @__PURE__ */ jsx("span", { className: "truncate whitespace-nowrap", children: rootLabel });
3875
+ const title = activeChild ? getHeadbarSummaryTitle(rootLabel, activeChildLabel) : void 0;
3846
3876
  const primaryAction = item.children?.length ? /* @__PURE__ */ jsx(
3847
3877
  HeadbarNavMenuItem,
3848
3878
  {
@@ -3855,6 +3885,7 @@ function NavigationHeadbarMenu({
3855
3885
  menuContentRadiusClass,
3856
3886
  menuItemRadiusClass,
3857
3887
  onNavigate,
3888
+ title,
3858
3889
  useTokenRadius
3859
3890
  }
3860
3891
  ) : /* @__PURE__ */ jsx(