labsense-ui-kit 1.2.55 → 1.2.56

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
@@ -8782,7 +8782,7 @@ var SidebarContainer = styled__default.div(_templateObject$n || (_templateObject
8782
8782
  theme = _ref3.theme;
8783
8783
  return $background || theme.vms.accent.softBlue;
8784
8784
  });
8785
- var SidebarLink = styled__default(reactRouterDom.NavLink)(_templateObject2$j || (_templateObject2$j = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n height: 28px;\n width: 100%;\n gap: 10px;\n cursor: pointer;\n border-radius: 4px;\n text-decoration: none;\n transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);\n padding: ", ";\n color: ", ";\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n"])), function (_ref4) {
8785
+ var SidebarLink = styled__default(reactRouterDom.NavLink)(_templateObject2$j || (_templateObject2$j = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n height: 28px;\n width: 100%;\n gap: 10px;\n cursor: pointer;\n border-radius: 4px;\n text-decoration: none;\n transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);\n padding: ", ";\n color: ", ";\n\n /* Hover state */\n &:hover {\n color: ", ";\n background: ", ";\n }\n\n /* Active link state */\n &.active {\n color: ", ";\n background: ", ";\n }\n"])), function (_ref4) {
8786
8786
  var $padding = _ref4.$padding;
8787
8787
  return $padding;
8788
8788
  }, function (_ref5) {
@@ -8794,44 +8794,50 @@ var SidebarLink = styled__default(reactRouterDom.NavLink)(_templateObject2$j ||
8794
8794
  }, function (_ref7) {
8795
8795
  var theme = _ref7.theme;
8796
8796
  return theme.vms["default"].primary;
8797
+ }, function (_ref8) {
8798
+ var theme = _ref8.theme;
8799
+ return theme.vms.text.white;
8800
+ }, function (_ref9) {
8801
+ var theme = _ref9.theme;
8802
+ return theme.vms["default"].primary;
8797
8803
  });
8798
- var IconWrapper$2 = styled__default.div(_templateObject3$c || (_templateObject3$c = _taggedTemplateLiteralLoose(["\n background: ", ";\n transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);\n padding: 4px;\n border-radius: 4px;\n width: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n"])), function (_ref8) {
8799
- var $selected = _ref8.$selected,
8800
- theme = _ref8.theme;
8804
+ var IconWrapper$2 = styled__default.div(_templateObject3$c || (_templateObject3$c = _taggedTemplateLiteralLoose(["\n background: ", ";\n transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);\n padding: 4px;\n border-radius: 4px;\n width: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n"])), function (_ref10) {
8805
+ var $selected = _ref10.$selected,
8806
+ theme = _ref10.theme;
8801
8807
  return $selected ? theme.vms["default"].primary : theme.vms["default"].tertiary;
8802
8808
  });
8803
8809
  var Logo = styled__default.div(_templateObject4$9 || (_templateObject4$9 = _taggedTemplateLiteralLoose(["\n transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);\n display: flex;\n width: 100%;\n min-width: max-content;\n height: 32px;\n align-items: center;\n justify-content: center;\n gap: 10px;\n"])));
8804
- var TextContainer = styled__default.span(_templateObject5$8 || (_templateObject5$8 = _taggedTemplateLiteralLoose(["\n white-space: nowrap;\n padding: ", ";\n font-size: ", ";\n font-weight: ", ";\n opacity: ", ";\n visibility: ", ";\n transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;\n transform: ", ";\n"])), function (_ref9) {
8805
- var $padding = _ref9.$padding;
8810
+ var TextContainer = styled__default.span(_templateObject5$8 || (_templateObject5$8 = _taggedTemplateLiteralLoose(["\n white-space: nowrap;\n padding: ", ";\n font-size: ", ";\n font-weight: ", ";\n opacity: ", ";\n visibility: ", ";\n transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;\n transform: ", ";\n"])), function (_ref11) {
8811
+ var $padding = _ref11.$padding;
8806
8812
  return $padding;
8807
- }, function (_ref10) {
8808
- var $fontSize = _ref10.$fontSize;
8809
- return $fontSize || '20px';
8810
- }, function (_ref11) {
8811
- var $fontWeight = _ref11.$fontWeight;
8812
- return $fontWeight || '500';
8813
8813
  }, function (_ref12) {
8814
- var $isExpanded = _ref12.$isExpanded;
8815
- return $isExpanded ? 1 : 0;
8814
+ var $fontSize = _ref12.$fontSize;
8815
+ return $fontSize || '20px';
8816
8816
  }, function (_ref13) {
8817
- var $isExpanded = _ref13.$isExpanded;
8818
- return $isExpanded ? 'visible' : 'hidden';
8817
+ var $fontWeight = _ref13.$fontWeight;
8818
+ return $fontWeight || '500';
8819
8819
  }, function (_ref14) {
8820
8820
  var $isExpanded = _ref14.$isExpanded;
8821
+ return $isExpanded ? 1 : 0;
8822
+ }, function (_ref15) {
8823
+ var $isExpanded = _ref15.$isExpanded;
8824
+ return $isExpanded ? 'visible' : 'hidden';
8825
+ }, function (_ref16) {
8826
+ var $isExpanded = _ref16.$isExpanded;
8821
8827
  return $isExpanded ? 'translateX(0)' : 'translateX(-10px)';
8822
8828
  });
8823
- var NotificationBadge = styled__default.div(_templateObject6$7 || (_templateObject6$7 = _taggedTemplateLiteralLoose(["\n position: ", ";\n top: -4px;\n right: -4px;\n background: red;\n color: white;\n font-size: 10px;\n font-weight: bold;\n border-radius: 50%;\n padding: 2px 5px;\n min-width: 16px;\n height: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n"])), function (_ref15) {
8824
- var $position = _ref15.$position;
8829
+ var NotificationBadge = styled__default.div(_templateObject6$7 || (_templateObject6$7 = _taggedTemplateLiteralLoose(["\n position: ", ";\n top: -4px;\n right: -4px;\n background: red;\n color: white;\n font-size: 10px;\n font-weight: bold;\n border-radius: 50%;\n padding: 2px 5px;\n min-width: 16px;\n height: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n"])), function (_ref17) {
8830
+ var $position = _ref17.$position;
8825
8831
  return $position || 'absolute';
8826
8832
  });
8827
- var Sidebar = function Sidebar(_ref16) {
8828
- var logo = _ref16.logo,
8829
- content = _ref16.content,
8830
- background = _ref16.background,
8831
- ProfileContent = _ref16.ProfileContent,
8832
- _ref16$isExpanded = _ref16.isExpanded,
8833
- isExpanded = _ref16$isExpanded === void 0 ? false : _ref16$isExpanded,
8834
- setIsExpanded = _ref16.setIsExpanded;
8833
+ var Sidebar = function Sidebar(_ref18) {
8834
+ var logo = _ref18.logo,
8835
+ content = _ref18.content,
8836
+ background = _ref18.background,
8837
+ ProfileContent = _ref18.ProfileContent,
8838
+ _ref18$isExpanded = _ref18.isExpanded,
8839
+ isExpanded = _ref18$isExpanded === void 0 ? false : _ref18$isExpanded,
8840
+ setIsExpanded = _ref18.setIsExpanded;
8835
8841
  var location = reactRouterDom.useLocation();
8836
8842
  var _useState = React.useState({}),
8837
8843
  openMenus = _useState[0],
@@ -8867,9 +8873,9 @@ var Sidebar = function Sidebar(_ref16) {
8867
8873
  return currentBase === getBasePath(child.activeUrl) || currentBase === getBasePath(child.url);
8868
8874
  }));
8869
8875
  };
8870
- var ChildLink = React__default.memo(function (_ref17) {
8871
- var child = _ref17.child,
8872
- isExpanded = _ref17.isExpanded;
8876
+ var ChildLink = React__default.memo(function (_ref19) {
8877
+ var child = _ref19.child,
8878
+ isExpanded = _ref19.isExpanded;
8873
8879
  var themeColors = styled.useTheme();
8874
8880
  var location = reactRouterDom.useLocation();
8875
8881
  var active = getBasePath(location.pathname) === getBasePath(child.activeUrl) || getBasePath(location.pathname) === getBasePath(child.url);
@@ -8879,28 +8885,32 @@ var Sidebar = function Sidebar(_ref16) {
8879
8885
  return React__default.createElement(SidebarLink, {
8880
8886
  to: child.url || '#',
8881
8887
  key: child.id,
8888
+ "$padding": '0px 10px 0px 0px',
8889
+ onClick: function onClick(e) {
8890
+ if (child.url && child.url === location.pathname) {
8891
+ e.preventDefault();
8892
+ }
8893
+ },
8882
8894
  onMouseEnter: function onMouseEnter() {
8883
8895
  return setIsHovered(true);
8884
8896
  },
8885
8897
  onMouseLeave: function onMouseLeave() {
8886
8898
  return setIsHovered(false);
8887
- },
8888
- "$padding": '0px 10px 0px 0px'
8899
+ }
8889
8900
  }, React__default.createElement(IconWrapper$2, {
8890
8901
  "$selected": active
8891
8902
  }, React__default.createElement(Icon, {
8892
8903
  icon: child.icon,
8893
8904
  size: 18,
8894
8905
  weight: child.iconWeight,
8895
- color: isHovered || active ? themeColors.vms.text.white : themeColors.vms.text.medium
8906
+ color: active || isHovered ? themeColors.vms.text.white : themeColors.vms.text.medium
8896
8907
  })), React__default.createElement(Container, {
8897
8908
  "$width": '100%',
8898
8909
  "$justifyContent": 'space-between',
8899
8910
  "$gap": '5px'
8900
8911
  }, React__default.createElement(TextContainer, {
8901
8912
  "$isExpanded": isExpanded,
8902
- "$fontSize": '12px',
8903
- "$color": themeColors.vms.text.medium
8913
+ "$fontSize": '12px'
8904
8914
  }, child.label), _getTotalNotifications(child) > 0 && React__default.createElement(NotificationBadge, {
8905
8915
  "$position": 'unset'
8906
8916
  }, _getTotalNotifications(child) > 99 ? '99+' : _getTotalNotifications(child))));
@@ -8918,14 +8928,14 @@ var Sidebar = function Sidebar(_ref16) {
8918
8928
  });
8919
8929
  }));
8920
8930
  };
8921
- var SidebarItem = React__default.memo(function (_ref18) {
8922
- var item = _ref18.item,
8923
- isActive = _ref18.isActive,
8924
- isOpen = _ref18.isOpen,
8925
- hasChildren = _ref18.hasChildren,
8926
- isExpanded = _ref18.isExpanded,
8927
- onToggle = _ref18.onToggle,
8928
- renderChildLinks = _ref18.renderChildLinks;
8931
+ var SidebarItem = function SidebarItem(_ref20) {
8932
+ var item = _ref20.item,
8933
+ isActive = _ref20.isActive,
8934
+ isOpen = _ref20.isOpen,
8935
+ hasChildren = _ref20.hasChildren,
8936
+ isExpanded = _ref20.isExpanded,
8937
+ onToggle = _ref20.onToggle,
8938
+ renderChildLinks = _ref20.renderChildLinks;
8929
8939
  var themeColors = styled.useTheme();
8930
8940
  var _useState3 = React.useState(false),
8931
8941
  isHovered = _useState3[0],
@@ -8975,7 +8985,12 @@ var Sidebar = function Sidebar(_ref16) {
8975
8985
  cursor: 'pointer'
8976
8986
  })));
8977
8987
  return item.url ? React__default.createElement(SidebarLink, {
8978
- to: item.url
8988
+ to: item.url,
8989
+ onClick: function onClick(e) {
8990
+ if (item.url === location.pathname) {
8991
+ e.preventDefault();
8992
+ }
8993
+ }
8979
8994
  }, ContentLayout) : React__default.createElement(Container, {
8980
8995
  "$flexDirection": 'column',
8981
8996
  "$alignItems": 'start',
@@ -8986,7 +9001,7 @@ var Sidebar = function Sidebar(_ref16) {
8986
9001
  "$hoverColor": themeColors.vms.text.white,
8987
9002
  "$width": '100%'
8988
9003
  }, ContentLayout), hasChildren && isExpanded && isOpen && renderChildLinks && React__default.createElement(Container, null, renderChildLinks(item.children)));
8989
- });
9004
+ };
8990
9005
  return React__default.createElement(SidebarContainer, {
8991
9006
  "$background": background,
8992
9007
  "$isExpanded": isExpanded,