@thecb/components 8.3.1-beta.7 → 8.3.1-beta.9

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.cjs.js CHANGED
@@ -19853,8 +19853,8 @@ var StyledInternalLink = styled__default( /*#__PURE__*/React.forwardRef(function
19853
19853
  var margin = _ref7.margin;
19854
19854
  return margin;
19855
19855
  }, function (_ref8) {
19856
- var match = _ref8.match;
19857
- return match ? INFO_BLUE : 'transparent';
19856
+ var matchesCurrentRoute = _ref8.matchesCurrentRoute;
19857
+ return matchesCurrentRoute ? INFO_BLUE : 'transparent';
19858
19858
  }, function (_ref9) {
19859
19859
  var hoverColor = _ref9.hoverColor;
19860
19860
  return hoverColor;
@@ -21513,11 +21513,13 @@ _curry2(function test(pattern, str) {
21513
21513
 
21514
21514
  var URL_TEST = /(([a-z]{3,6}:\/\/)|(^|\s))([a-zA-Z0-9\-]+\.)+[a-z]{2,13}[\.\?\=\&\%\/\w\-]*\b([^@]|$)/;
21515
21515
 
21516
- var _excluded$m = ["url", "disabled", "fileLink", "extraStyles", "linkExtraStyles", "newTab", "dataQa"];
21516
+ var _excluded$m = ["url", "matchesCurrentRoute", "disabled", "fileLink", "extraStyles", "linkExtraStyles", "newTab", "dataQa"];
21517
21517
 
21518
21518
  var ButtonWithLink = function ButtonWithLink(_ref) {
21519
21519
  var _ref$url = _ref.url,
21520
21520
  url = _ref$url === void 0 ? "/" : _ref$url,
21521
+ _ref$matchesCurrentRo = _ref.matchesCurrentRoute,
21522
+ matchesCurrentRoute = _ref$matchesCurrentRo === void 0 ? false : _ref$matchesCurrentRo,
21521
21523
  _ref$disabled = _ref.disabled,
21522
21524
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
21523
21525
  _ref$fileLink = _ref.fileLink,
@@ -21532,12 +21534,11 @@ var ButtonWithLink = function ButtonWithLink(_ref) {
21532
21534
  var ButtonWithLinkWrapper = function ButtonWithLinkWrapper(_ref2) {
21533
21535
  var children = _ref2.children,
21534
21536
  url = _ref2.url,
21537
+ matchesCurrentRoute = _ref2.matchesCurrentRoute,
21535
21538
  disabled = _ref2.disabled,
21536
21539
  newTab = _ref2.newTab,
21537
21540
  dataQa = _ref2.dataQa,
21538
21541
  extraStyles = _ref2.extraStyles;
21539
- var match = reactRouterDom.useMatch(url);
21540
- console.log("🚀 ~ file: ButtonWithLink.js:32 ~ match:", match);
21541
21542
 
21542
21543
  if (disabled) {
21543
21544
  return safeChildren(children, /*#__PURE__*/React__default.createElement("span", null));
@@ -21551,7 +21552,7 @@ var ButtonWithLink = function ButtonWithLink(_ref) {
21551
21552
  dataQa: dataQa
21552
21553
  }, safeChildren(children, /*#__PURE__*/React__default.createElement("span", null))) : /*#__PURE__*/React__default.createElement(InternalLink, {
21553
21554
  to: url,
21554
- match: match,
21555
+ matchesCurrentRoute: matchesCurrentRoute,
21555
21556
  tabIndex: "-1",
21556
21557
  dataQa: dataQa,
21557
21558
  extraStyles: extraStyles
@@ -21559,6 +21560,7 @@ var ButtonWithLink = function ButtonWithLink(_ref) {
21559
21560
  };
21560
21561
 
21561
21562
  return /*#__PURE__*/React__default.createElement(ButtonWithLinkWrapper, {
21563
+ matchesCurrentRoute: matchesCurrentRoute,
21562
21564
  url: url,
21563
21565
  disabled: disabled,
21564
21566
  newTab: newTab,