@homebound/beam 3.63.0 → 3.63.1

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
@@ -10784,6 +10784,10 @@ function MenuItemImpl(props) {
10784
10784
  isHovered
10785
10785
  } = useHover7({});
10786
10786
  const tid = useTestIds(props);
10787
+ const openInNewTabRef = useRef15(false);
10788
+ function captureModifiers(e) {
10789
+ openInNewTabRef.current = wantsNewTab(e);
10790
+ }
10787
10791
  const {
10788
10792
  menuItemProps
10789
10793
  } = useMenuItem({
@@ -10797,7 +10801,7 @@ function MenuItemImpl(props) {
10797
10801
  onClick
10798
10802
  } = menuItem;
10799
10803
  if (typeof onClick === "string") {
10800
- if (isAbsoluteUrl(onClick)) {
10804
+ if (isAbsoluteUrl(onClick) || openInNewTabRef.current) {
10801
10805
  window.open(onClick, "_blank").opener = null;
10802
10806
  return;
10803
10807
  }
@@ -10819,55 +10823,68 @@ function MenuItemImpl(props) {
10819
10823
  const isDisabled = Boolean(disabled);
10820
10824
  const isSelected = state.selectionManager.selectedKeys.has(label);
10821
10825
  const isFocused = state.selectionManager.focusedKey === item.key;
10822
- return /* @__PURE__ */ jsx43("li", { ...menuItemProps, ...hoverProps, ref, ...trussProps27({
10823
- ...{
10824
- display: "df",
10825
- alignItems: "aic",
10826
- paddingTop: "pt1",
10827
- paddingBottom: "pb1",
10828
- paddingLeft: "pl2",
10829
- paddingRight: "pr2",
10830
- cursor: "cursorPointer",
10831
- outline: "outline0",
10832
- minHeight: "mh_42px",
10833
- fontWeight: "fw4",
10834
- fontSize: "fz_14px",
10835
- lineHeight: "lh_20px"
10836
- },
10837
- ...menuItem.hasDivider ? {
10838
- borderBottomStyle: "bbs_solid",
10839
- borderBottomWidth: "bbw_1px",
10840
- borderColor: "bcGray700"
10841
- } : {},
10842
- ...!isDisabled && isHovered ? {
10843
- backgroundColor: ["bgColor_var", {
10844
- "--backgroundColor": "var(--b-menu-item-bg-hover)"
10845
- }]
10846
- } : {},
10847
- ...isFocused ? {
10848
- boxShadow: ["boxShadow_var", {
10849
- "--boxShadow": maybeCssVar18(`inset 0 0 0 1px var(${"--b-focus-ring-inset" /* FocusRingInset */})`)
10850
- }]
10851
- } : {},
10852
- ...isDisabled ? {
10853
- color: ["color_var", {
10854
- "--color": "var(--b-text-disabled)"
10855
- }],
10856
- cursor: "cursorNotAllowed"
10857
- } : {},
10858
- ...destructive ? {
10859
- color: ["color_var", {
10860
- "--color": "var(--b-danger)"
10861
- }]
10862
- } : {},
10863
- ...isSelected ? {
10864
- fontWeight: "fw5"
10865
- } : {}
10866
- }), ...tid[defaultTestId(menuItem.label)], children: maybeTooltip({
10867
- title: resolveTooltip(disabled),
10868
- placement: "right",
10869
- children: renderMenuItem(menuItem, isSelected, isDisabled)
10870
- }) });
10826
+ return /* @__PURE__ */ jsx43(
10827
+ "li",
10828
+ {
10829
+ ...menuItemProps,
10830
+ ...hoverProps,
10831
+ onPointerDownCapture: captureModifiers,
10832
+ onKeyDownCapture: captureModifiers,
10833
+ onClickCapture: captureModifiers,
10834
+ ref,
10835
+ ...trussProps27({
10836
+ ...{
10837
+ display: "df",
10838
+ alignItems: "aic",
10839
+ paddingTop: "pt1",
10840
+ paddingBottom: "pb1",
10841
+ paddingLeft: "pl2",
10842
+ paddingRight: "pr2",
10843
+ cursor: "cursorPointer",
10844
+ outline: "outline0",
10845
+ minHeight: "mh_42px",
10846
+ fontWeight: "fw4",
10847
+ fontSize: "fz_14px",
10848
+ lineHeight: "lh_20px"
10849
+ },
10850
+ ...menuItem.hasDivider ? {
10851
+ borderBottomStyle: "bbs_solid",
10852
+ borderBottomWidth: "bbw_1px",
10853
+ borderColor: "bcGray700"
10854
+ } : {},
10855
+ ...!isDisabled && isHovered ? {
10856
+ backgroundColor: ["bgColor_var", {
10857
+ "--backgroundColor": "var(--b-menu-item-bg-hover)"
10858
+ }]
10859
+ } : {},
10860
+ ...isFocused ? {
10861
+ boxShadow: ["boxShadow_var", {
10862
+ "--boxShadow": maybeCssVar18(`inset 0 0 0 1px var(${"--b-focus-ring-inset" /* FocusRingInset */})`)
10863
+ }]
10864
+ } : {},
10865
+ ...isDisabled ? {
10866
+ color: ["color_var", {
10867
+ "--color": "var(--b-text-disabled)"
10868
+ }],
10869
+ cursor: "cursorNotAllowed"
10870
+ } : {},
10871
+ ...destructive ? {
10872
+ color: ["color_var", {
10873
+ "--color": "var(--b-danger)"
10874
+ }]
10875
+ } : {},
10876
+ ...isSelected ? {
10877
+ fontWeight: "fw5"
10878
+ } : {}
10879
+ }),
10880
+ ...tid[defaultTestId(menuItem.label)],
10881
+ children: maybeTooltip({
10882
+ title: resolveTooltip(disabled),
10883
+ placement: "right",
10884
+ children: renderMenuItem(menuItem, isSelected, isDisabled)
10885
+ })
10886
+ }
10887
+ );
10871
10888
  }
10872
10889
  function renderMenuItem(menuItem, isSelected, isDisabled) {
10873
10890
  return /* @__PURE__ */ jsxs27("div", { className: "df w100 aic jcsb gap2", children: [
@@ -10911,6 +10928,9 @@ function maybeWrapInLink(onClick, content, disabled) {
10911
10928
  /* @__PURE__ */ jsx43("span", { className: "fs0 ml2", children: /* @__PURE__ */ jsx43(Icon, { icon: "linkExternal" }) })
10912
10929
  ] }) : /* @__PURE__ */ jsx43(Link3, { className: "navLink", to: onClick, children: content });
10913
10930
  }
10931
+ function wantsNewTab(e) {
10932
+ return e.metaKey || e.ctrlKey || e.shiftKey;
10933
+ }
10914
10934
  function isIconMenuItem(item) {
10915
10935
  return item && typeof item === "object" && "icon" in item;
10916
10936
  }