@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.
@@ -3704,6 +3704,14 @@ function HeadbarChevronIcon({ open }) {
3704
3704
  }
3705
3705
  );
3706
3706
  }
3707
+ function getHeadbarSummaryTitle(rootLabel, childLabel) {
3708
+ if (typeof rootLabel !== "string" || typeof childLabel !== "string") {
3709
+ return void 0;
3710
+ }
3711
+ const rootText = rootLabel.trim();
3712
+ const childText = childLabel.trim();
3713
+ return rootText && childText ? `${rootText} ${childText}` : void 0;
3714
+ }
3707
3715
  function HeadbarNavMenuItem({
3708
3716
  activeItemId,
3709
3717
  compound,
@@ -3714,6 +3722,7 @@ function HeadbarNavMenuItem({
3714
3722
  menuContentRadiusClass,
3715
3723
  menuItemRadiusClass,
3716
3724
  onNavigate,
3725
+ title,
3717
3726
  useTokenRadius
3718
3727
  }) {
3719
3728
  const [open, setOpen] = react.useState(false);
@@ -3760,7 +3769,8 @@ function HeadbarNavMenuItem({
3760
3769
  active: isActive || isOpen,
3761
3770
  icon: item.icon,
3762
3771
  endIcon: /* @__PURE__ */ jsxRuntime.jsx(HeadbarChevronIcon, { open: isOpen }),
3763
- label: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate whitespace-nowrap", children: label }),
3772
+ label,
3773
+ title,
3764
3774
  disabled: item.disabled,
3765
3775
  onClick: () => {
3766
3776
  const wasOpenOnPointerDown = wasOpenOnPointerDownRef.current;
@@ -3787,7 +3797,7 @@ function HeadbarNavMenuItem({
3787
3797
  ),
3788
3798
  classNames: {
3789
3799
  icon: "text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current",
3790
- label: "text-[inherit] [&_*]:!text-[inherit]"
3800
+ label: "flex min-w-0 items-center text-[inherit] [&_*]:!text-[inherit]"
3791
3801
  },
3792
3802
  className: cn2(
3793
3803
  "max-w-[12rem] shrink-0 border shadow-none",
@@ -3806,10 +3816,13 @@ function HeadbarNavMenuItem({
3806
3816
  onMouseEnter: openMenu,
3807
3817
  onMouseLeave: scheduleCloseMenu,
3808
3818
  className: cn2(
3809
- "z-50 min-w-56 border p-1.5 animate-in fade-in-0 zoom-in-95",
3819
+ "z-50 border p-1.5 animate-in fade-in-0 zoom-in-95",
3810
3820
  menuContentRadiusClass
3811
3821
  ),
3812
3822
  style: {
3823
+ width: "max-content",
3824
+ minWidth: "var(--radix-dropdown-menu-trigger-width)",
3825
+ maxWidth: "min(20rem, var(--radix-dropdown-menu-content-available-width))",
3813
3826
  background: "var(--monkeys-component-navigation-headbar-menu-background, hsl(var(--popover)))",
3814
3827
  borderColor: "var(--monkeys-component-navigation-headbar-menu-border-color, hsl(var(--border)))",
3815
3828
  color: "var(--monkeys-component-navigation-headbar-menu-foreground, hsl(var(--popover-foreground)))",
@@ -3821,7 +3834,7 @@ function HeadbarNavMenuItem({
3821
3834
  {
3822
3835
  disabled: child.disabled,
3823
3836
  className: cn2(
3824
- "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)))]",
3837
+ "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)))]",
3825
3838
  menuItemRadiusClass
3826
3839
  ),
3827
3840
  style: getHeadbarItemStyle(
@@ -3865,7 +3878,24 @@ function NavigationHeadbarMenu({
3865
3878
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-max min-w-0 shrink-0 items-center gap-1", children: items.map((item) => {
3866
3879
  const isActive = activeRootId === item.id || activeItemId === item.id;
3867
3880
  const hasSecondaryAction = Boolean(item.headbarSecondaryAction);
3868
- const label = item.headbarLabel ?? item.label;
3881
+ const rootLabel = item.headbarLabel ?? item.label;
3882
+ const activeChild = item.children?.find(
3883
+ (child) => child.id === activeItemId
3884
+ );
3885
+ const activeChildLabel = activeChild ? activeChild.headbarLabel ?? activeChild.label : void 0;
3886
+ const label = activeChild ? /* @__PURE__ */ jsxRuntime.jsxs(
3887
+ "span",
3888
+ {
3889
+ "data-navigation-headbar-selected-child": activeChild.id,
3890
+ className: "flex min-w-0 items-center gap-1.5 whitespace-nowrap",
3891
+ children: [
3892
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0", children: rootLabel }),
3893
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: ": " }),
3894
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: activeChildLabel })
3895
+ ]
3896
+ }
3897
+ ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate whitespace-nowrap", children: rootLabel });
3898
+ const title = activeChild ? getHeadbarSummaryTitle(rootLabel, activeChildLabel) : void 0;
3869
3899
  const primaryAction = item.children?.length ? /* @__PURE__ */ jsxRuntime.jsx(
3870
3900
  HeadbarNavMenuItem,
3871
3901
  {
@@ -3878,6 +3908,7 @@ function NavigationHeadbarMenu({
3878
3908
  menuContentRadiusClass,
3879
3909
  menuItemRadiusClass,
3880
3910
  onNavigate,
3911
+ title,
3881
3912
  useTokenRadius
3882
3913
  }
3883
3914
  ) : /* @__PURE__ */ jsxRuntime.jsx(