@homebound/beam 2.277.0 → 2.277.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.
@@ -12,6 +12,9 @@ const Css_1 = require("../../Css");
12
12
  const utils_1 = require("../../utils");
13
13
  const defaultTestId_1 = require("../../utils/defaultTestId");
14
14
  const react_router_dom_1 = require("react-router-dom");
15
+ // Note: Respect Ctrl-clicking pop-up elements to open a link in a new tab on a menu item
16
+ // See https://github.com/adobe/react-spectrum/issues/1244#issuecomment-1125813249
17
+ const noopWorkaround = () => { };
15
18
  function MenuItemImpl(props) {
16
19
  const { item, state, onClose, contrast } = props;
17
20
  const menuItem = item.value;
@@ -57,7 +60,7 @@ function MenuItemImpl(props) {
57
60
  ...(isDisabled ? Css_1.Css.gray500.cursorNotAllowed.$ : {}),
58
61
  ...(destructive ? Css_1.Css.red600.$ : {}),
59
62
  ...(isSelected ? Css_1.Css.fw5.$ : {}),
60
- }, ...tid[(0, defaultTestId_1.defaultTestId)(menuItem.label)], children: (0, Tooltip_1.maybeTooltip)({
63
+ }, ...tid[(0, defaultTestId_1.defaultTestId)(menuItem.label)], onPointerUp: noopWorkaround, onKeyDown: noopWorkaround, children: (0, Tooltip_1.maybeTooltip)({
61
64
  title: (0, Tooltip_1.resolveTooltip)(disabled),
62
65
  placement: "right",
63
66
  children: renderMenuItem(menuItem, isSelected, isDisabled, contrast),
@@ -85,7 +88,7 @@ function maybeWrapInLink(onClick, content, disabled) {
85
88
  if (disabled || typeof onClick !== "string") {
86
89
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: content });
87
90
  }
88
- return (0, utils_1.isAbsoluteUrl)(onClick) ? ((0, jsx_runtime_1.jsxs)("a", { href: onClick, target: "_blank", rel: "noopener noreferrer", className: "navLink", css: Css_1.Css.df.aic.jcsb.w100.$, children: [content, (0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.fs0.ml2.$, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: "linkExternal" }) })] })) : ((0, jsx_runtime_1.jsx)(react_router_dom_1.Link, { className: "navLink", to: onClick, children: content }));
91
+ return (0, utils_1.isAbsoluteUrl)(onClick) ? ((0, jsx_runtime_1.jsxs)("a", { href: onClick, target: "_blank", rel: "noopener noreferrer", className: "navLink", css: Css_1.Css.df.aic.jcsb.w100.$, children: [content, (0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.fs0.ml2.$, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: "linkExternal" }) })] })) : ((0, jsx_runtime_1.jsx)(react_router_dom_1.Link, { className: "navLink", to: onClick, onPointerUp: noopWorkaround, onKeyDown: noopWorkaround, children: content }));
89
92
  }
90
93
  function isIconMenuItem(item) {
91
94
  return item && typeof item === "object" && "icon" in item;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.277.0",
3
+ "version": "2.277.1",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",