@mailstep/design-system 0.7.72 → 0.7.73

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailstep/design-system",
3
- "version": "0.7.72",
3
+ "version": "0.7.73",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -41,10 +41,10 @@ var MenuItem = function (_a) {
41
41
  itemLinkWrapClassName += ' separator';
42
42
  }
43
43
  var isActive = useCallback(function (match, location) {
44
- var childSelected = !!(items === null || items === void 0 ? void 0 : items.find(function (item) { var _a; return ((_a = item.link) === null || _a === void 0 ? void 0 : _a.replace(removeOptionalEnd, '')) === (location === null || location === void 0 ? void 0 : location.pathname); }));
45
- var isActive = !!matchPath(location === null || location === void 0 ? void 0 : location.pathname, { path: match === null || match === void 0 ? void 0 : match.path });
44
+ var childSelected = !!(items === null || items === void 0 ? void 0 : items.find(function (item) { var _a; return ((_a = item.link) === null || _a === void 0 ? void 0 : _a.replace(removeOptionalEnd, '')) === location.pathname; }));
45
+ var isActive = !!matchPath(location.pathname, { path: match === null || match === void 0 ? void 0 : match.path });
46
46
  // partial match helps to match paths with parameters which are not matched by matchPath above
47
- var partialMatch = (location === null || location === void 0 ? void 0 : location.pathname.startsWith(link.slice(0, -1))) && (location === null || location === void 0 ? void 0 : location.pathname.includes('/settings/'));
47
+ var partialMatch = location.pathname.startsWith(link.slice(0, -1)) && location.pathname.includes('/settings/');
48
48
  return isActive || childSelected || partialMatch;
49
49
  }, [items, link]);
50
50
  return (_jsxs(_Fragment, { children: [separator && _jsx(ItemsSeparator, {}), _jsxs(MenuItemContainer, { ref: parentRef, "$isCompact": isCompact, "$lightMode": lightMode, hasChildren: hasChildren, isHovering: isHovering, children: [_jsxs(ItemLinkWrap, __assign({}, linkProps, { onMouseOver: handleMouseOver, exact: true, activeClassName: hasChildren ? 'selected' : undefined, onClick: toggleChildren, "$isCompact": isCompact, className: itemLinkWrapClassName,
@@ -32,7 +32,7 @@ var MenuItem = function (_a) {
32
32
  var item = _a.item, ItemComponent = _a.ItemComponent, onClose = _a.onClose;
33
33
  var onClick = item.onClick, link = item.link, hasSeparator = item.hasSeparator, name = item.name, autoClose = item.autoClose;
34
34
  var location = useLocation();
35
- var isActive = link === (location === null || location === void 0 ? void 0 : location.pathname);
35
+ var isActive = link === location.pathname;
36
36
  var onClickCallback = useCallback(function (e) {
37
37
  if (onClick) {
38
38
  e.preventDefault();
@@ -42,7 +42,7 @@ var Link = function (props) {
42
42
  var theme = useTheme();
43
43
  var themeColor = props.color ? th.color(props.color)({ theme: theme }) : undefined;
44
44
  var themeFontSize = th.fontSize((_a = props.size) !== null && _a !== void 0 ? _a : 1)({ theme: theme });
45
- return (_jsx(StyledLink, __assign({}, props, { color: themeColor, size: themeFontSize, children: props.children })));
45
+ return (_jsx(StyledLink, __assign({}, props, { to: props.to || '', color: themeColor, size: themeFontSize, children: props.children })));
46
46
  };
47
47
  export default Link;
48
48
  var templateObject_1, templateObject_2;