@thecb/components 8.3.1-beta.6 → 8.3.1-beta.8

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.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import React, { createContext, createElement, PureComponent, forwardRef, Component, cloneElement, Children, useContext, Fragment as Fragment$1, useRef, useState, useLayoutEffect, memo, useEffect as useEffect$1, useMemo, useCallback, isValidElement, createRef } from 'react';
2
2
  import styled, { ThemeContext, css, ThemeProvider, keyframes as keyframes$3 } from 'styled-components';
3
3
  import theme from 'styled-theming';
4
- import { Link, useMatch, useNavigate, useLocation } from 'react-router-dom';
4
+ import { Link, useNavigate, useLocation } from 'react-router-dom';
5
5
  import reactDom from 'react-dom';
6
6
 
7
7
  function ownKeys(object, enumerableOnly) {
@@ -19845,8 +19845,8 @@ var StyledInternalLink = styled( /*#__PURE__*/forwardRef(function (_ref, ref) {
19845
19845
  var margin = _ref7.margin;
19846
19846
  return margin;
19847
19847
  }, function (_ref8) {
19848
- var match = _ref8.match;
19849
- return match ? INFO_BLUE : 'transparent';
19848
+ var matchesCurrentRoute = _ref8.matchesCurrentRoute;
19849
+ return matchesCurrentRoute ? INFO_BLUE : 'transparent';
19850
19850
  }, function (_ref9) {
19851
19851
  var hoverColor = _ref9.hoverColor;
19852
19852
  return hoverColor;
@@ -21505,11 +21505,12 @@ _curry2(function test(pattern, str) {
21505
21505
 
21506
21506
  var URL_TEST = /(([a-z]{3,6}:\/\/)|(^|\s))([a-zA-Z0-9\-]+\.)+[a-z]{2,13}[\.\?\=\&\%\/\w\-]*\b([^@]|$)/;
21507
21507
 
21508
- var _excluded$m = ["url", "disabled", "fileLink", "extraStyles", "linkExtraStyles", "newTab", "dataQa"];
21508
+ var _excluded$m = ["url", "matchesCurrentRoute", "disabled", "fileLink", "extraStyles", "linkExtraStyles", "newTab", "dataQa"];
21509
21509
 
21510
21510
  var ButtonWithLink = function ButtonWithLink(_ref) {
21511
21511
  var _ref$url = _ref.url,
21512
21512
  url = _ref$url === void 0 ? "/" : _ref$url,
21513
+ _ref$matchesCurrentRo = _ref.matchesCurrentRoute,
21513
21514
  _ref$disabled = _ref.disabled,
21514
21515
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
21515
21516
  _ref$fileLink = _ref.fileLink,
@@ -21524,12 +21525,11 @@ var ButtonWithLink = function ButtonWithLink(_ref) {
21524
21525
  var ButtonWithLinkWrapper = function ButtonWithLinkWrapper(_ref2) {
21525
21526
  var children = _ref2.children,
21526
21527
  url = _ref2.url,
21528
+ matchesCurrentRoute = _ref2.matchesCurrentRoute,
21527
21529
  disabled = _ref2.disabled,
21528
21530
  newTab = _ref2.newTab,
21529
21531
  dataQa = _ref2.dataQa,
21530
21532
  extraStyles = _ref2.extraStyles;
21531
- var match = useMatch();
21532
- console.log("🚀 ~ file: ButtonWithLink.js:32 ~ match:", match);
21533
21533
 
21534
21534
  if (disabled) {
21535
21535
  return safeChildren(children, /*#__PURE__*/React.createElement("span", null));
@@ -21543,7 +21543,7 @@ var ButtonWithLink = function ButtonWithLink(_ref) {
21543
21543
  dataQa: dataQa
21544
21544
  }, safeChildren(children, /*#__PURE__*/React.createElement("span", null))) : /*#__PURE__*/React.createElement(InternalLink, {
21545
21545
  to: url,
21546
- match: match,
21546
+ matchesCurrentRoute: matchesCurrentRoute,
21547
21547
  tabIndex: "-1",
21548
21548
  dataQa: dataQa,
21549
21549
  extraStyles: extraStyles