labsense-ui-kit 1.2.39 → 1.2.41

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.
@@ -5986,8 +5986,8 @@ var StyledButton = styled.button(_templateObject5$1 || (_templateObject5$1 = _ta
5986
5986
  return '';
5987
5987
  }
5988
5988
  }, function (_ref16) {
5989
- var color = _ref16.color;
5990
- return color;
5989
+ var $color = _ref16.$color;
5990
+ return $color;
5991
5991
  });
5992
5992
  var ButtonText = styled.span(_templateObject6$1 || (_templateObject6$1 = _taggedTemplateLiteralLoose(["\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n white-space: nowrap;\n"])), function (_ref17) {
5993
5993
  var $fontFamily = _ref17.$fontFamily;
@@ -8834,7 +8834,7 @@ var ProgressBar = function ProgressBar(_ref3) {
8834
8834
  }));
8835
8835
  };
8836
8836
 
8837
- var _templateObject$n, _templateObject2$j, _templateObject3$c, _templateObject4$9, _templateObject5$8;
8837
+ var _templateObject$n, _templateObject2$j, _templateObject3$c, _templateObject4$9, _templateObject5$8, _templateObject6$7;
8838
8838
  var SidebarContainer = styled.div(_templateObject$n || (_templateObject$n = _taggedTemplateLiteralLoose(["\n width: ", ";\n max-width: ", ";\n height: 100vh;\n background: ", ";\n transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);\n display: flex;\n flex-direction: column;\n align-items: start;\n padding: 20px;\n position: fixed;\n left: 0;\n top: 0;\n overflow: hidden;\n z-index: 10;\n justify-content: space-between;\n"])), function (_ref) {
8839
8839
  var $isExpanded = _ref.$isExpanded;
8840
8840
  return $isExpanded ? 'max-content' : '68px';
@@ -8846,7 +8846,7 @@ var SidebarContainer = styled.div(_templateObject$n || (_templateObject$n = _tag
8846
8846
  theme = _ref3.theme;
8847
8847
  return $background || theme.accent.softBlue;
8848
8848
  });
8849
- var SidebarLink = styled(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.5s cubic-bezier(0.4, 0, 0.2, 1);\n padding: ", ";\n color: ", ";\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n"])), function (_ref4) {
8849
+ var SidebarLink = styled(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.5s cubic-bezier(0.4, 0, 0.2, 1);\n padding: ", ";\n color: ", ";\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n"])), function (_ref4) {
8850
8850
  var $padding = _ref4.$padding;
8851
8851
  return $padding;
8852
8852
  }, function (_ref5) {
@@ -8884,14 +8884,18 @@ var TextContainer = styled.span(_templateObject5$8 || (_templateObject5$8 = _tag
8884
8884
  var $isExpanded = _ref14.$isExpanded;
8885
8885
  return $isExpanded ? 'translateX(0)' : 'translateX(-10px)';
8886
8886
  });
8887
- var Sidebar = function Sidebar(_ref15) {
8888
- var logo = _ref15.logo,
8889
- content = _ref15.content,
8890
- background = _ref15.background,
8891
- ProfileContent = _ref15.ProfileContent,
8892
- _ref15$isExpanded = _ref15.isExpanded,
8893
- isExpanded = _ref15$isExpanded === void 0 ? false : _ref15$isExpanded,
8894
- setIsExpanded = _ref15.setIsExpanded;
8887
+ var NotificationBadge = styled.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) {
8888
+ var $position = _ref15.$position;
8889
+ return $position || 'absolute';
8890
+ });
8891
+ var Sidebar = function Sidebar(_ref16) {
8892
+ var logo = _ref16.logo,
8893
+ content = _ref16.content,
8894
+ background = _ref16.background,
8895
+ ProfileContent = _ref16.ProfileContent,
8896
+ _ref16$isExpanded = _ref16.isExpanded,
8897
+ isExpanded = _ref16$isExpanded === void 0 ? false : _ref16$isExpanded,
8898
+ setIsExpanded = _ref16.setIsExpanded;
8895
8899
  var location = useLocation();
8896
8900
  var _useState = useState({}),
8897
8901
  openMenus = _useState[0],
@@ -8905,22 +8909,31 @@ var Sidebar = function Sidebar(_ref15) {
8905
8909
  return _extends({}, prev, (_extends2 = {}, _extends2[id] = !prev[id], _extends2));
8906
8910
  });
8907
8911
  };
8912
+ var _getTotalNotifications = function getTotalNotifications(item) {
8913
+ var _item$children;
8914
+ if ((_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length) {
8915
+ return (item.notificationCount || 0) + item.children.reduce(function (sum, child) {
8916
+ return sum + _getTotalNotifications(child);
8917
+ }, 0);
8918
+ }
8919
+ return item.notificationCount || 0;
8920
+ };
8908
8921
  var getBasePath = function getBasePath(path) {
8909
8922
  if (!path) return '';
8910
8923
  var parts = path.split('/').filter(Boolean);
8911
8924
  return parts.length > 0 ? "/" + parts[0] : '';
8912
8925
  };
8913
8926
  var isRouteActive = function isRouteActive(item) {
8914
- var _item$children;
8927
+ var _item$children2;
8915
8928
  var currentBase = getBasePath(location.pathname);
8916
8929
  var itemBase = item.activeUrl ? getBasePath(item.activeUrl) : getBasePath(item.url);
8917
- return currentBase === itemBase || ((_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.some(function (child) {
8930
+ return currentBase === itemBase || ((_item$children2 = item.children) === null || _item$children2 === void 0 ? void 0 : _item$children2.some(function (child) {
8918
8931
  return currentBase === getBasePath(child.activeUrl) || currentBase === getBasePath(child.url);
8919
8932
  }));
8920
8933
  };
8921
- var ChildLink = React.memo(function (_ref16) {
8922
- var child = _ref16.child,
8923
- isExpanded = _ref16.isExpanded;
8934
+ var ChildLink = React.memo(function (_ref17) {
8935
+ var child = _ref17.child,
8936
+ isExpanded = _ref17.isExpanded;
8924
8937
  var themeColors = useTheme$1();
8925
8938
  var location = useLocation();
8926
8939
  var active = getBasePath(location.pathname) === getBasePath(child.activeUrl) || getBasePath(location.pathname) === getBasePath(child.url);
@@ -8935,7 +8948,8 @@ var Sidebar = function Sidebar(_ref15) {
8935
8948
  },
8936
8949
  onMouseLeave: function onMouseLeave() {
8937
8950
  return setIsHovered(false);
8938
- }
8951
+ },
8952
+ "$padding": '0px 10px 0px 0px'
8939
8953
  }, React.createElement(IconWrapper$2, {
8940
8954
  "$selected": active
8941
8955
  }, React.createElement(Icon, {
@@ -8943,12 +8957,17 @@ var Sidebar = function Sidebar(_ref15) {
8943
8957
  size: 18,
8944
8958
  weight: child.iconWeight,
8945
8959
  color: isHovered || active ? themeColors.text.white : themeColors.text.medium
8946
- })), React.createElement(TextContainer, {
8960
+ })), React.createElement(Container, {
8961
+ "$width": '100%',
8962
+ "$justifyContent": 'space-between',
8963
+ "$gap": '5px'
8964
+ }, React.createElement(TextContainer, {
8947
8965
  "$isExpanded": isExpanded,
8948
8966
  "$fontSize": '12px',
8949
- "$color": themeColors.text.medium,
8950
- "$padding": '0px 10px 0px 0px'
8951
- }, child.label));
8967
+ "$color": themeColors.text.medium
8968
+ }, child.label), _getTotalNotifications(child) > 0 && React.createElement(NotificationBadge, {
8969
+ "$position": 'unset'
8970
+ }, _getTotalNotifications(child) > 99 ? '99+' : _getTotalNotifications(child))));
8952
8971
  });
8953
8972
  var renderChildLinks = function renderChildLinks(children) {
8954
8973
  return React.createElement(Container, {
@@ -8963,14 +8982,14 @@ var Sidebar = function Sidebar(_ref15) {
8963
8982
  });
8964
8983
  }));
8965
8984
  };
8966
- var SidebarItem = React.memo(function (_ref17) {
8967
- var item = _ref17.item,
8968
- isActive = _ref17.isActive,
8969
- isOpen = _ref17.isOpen,
8970
- hasChildren = _ref17.hasChildren,
8971
- isExpanded = _ref17.isExpanded,
8972
- onToggle = _ref17.onToggle,
8973
- renderChildLinks = _ref17.renderChildLinks;
8985
+ var SidebarItem = React.memo(function (_ref18) {
8986
+ var item = _ref18.item,
8987
+ isActive = _ref18.isActive,
8988
+ isOpen = _ref18.isOpen,
8989
+ hasChildren = _ref18.hasChildren,
8990
+ isExpanded = _ref18.isExpanded,
8991
+ onToggle = _ref18.onToggle,
8992
+ renderChildLinks = _ref18.renderChildLinks;
8974
8993
  var themeColors = useTheme$1();
8975
8994
  var _useState3 = useState(false),
8976
8995
  isHovered = _useState3[0],
@@ -8987,10 +9006,19 @@ var Sidebar = function Sidebar(_ref15) {
8987
9006
  "$width": '100%',
8988
9007
  "$cursor": 'pointer',
8989
9008
  "$borderRadius": '4px',
9009
+ "$justifyContent": 'space-between',
8990
9010
  "$hoverBackground": themeColors["default"].primary,
8991
9011
  onClick: function onClick() {
8992
9012
  return hasChildren && onToggle();
8993
9013
  }
9014
+ }, React.createElement(Container, {
9015
+ "$alignItems": 'center',
9016
+ "$gap": '8px',
9017
+ "$width": '100%',
9018
+ "$cursor": 'pointer',
9019
+ "$borderRadius": '4px'
9020
+ }, React.createElement(Container, {
9021
+ "$position": 'relative'
8994
9022
  }, React.createElement(IconWrapper$2, {
8995
9023
  "$selected": !!isActive
8996
9024
  }, React.createElement(Icon, {
@@ -8998,11 +9026,12 @@ var Sidebar = function Sidebar(_ref15) {
8998
9026
  size: 20,
8999
9027
  weight: item.iconWeight,
9000
9028
  color: isHovered || isActive ? themeColors.text.white : themeColors.text.medium
9001
- })), React.createElement(TextContainer, {
9029
+ })), _getTotalNotifications(item) > 0 && React.createElement(NotificationBadge, null, _getTotalNotifications(item) > 99 ? '99+' : _getTotalNotifications(item))), React.createElement(TextContainer, {
9002
9030
  "$isExpanded": isExpanded,
9003
9031
  "$fontSize": '14px'
9004
- }, item.label), hasChildren && React.createElement(Container, {
9005
- "$padding": '9px'
9032
+ }, item.label)), hasChildren && React.createElement(Container, {
9033
+ "$padding": '9px',
9034
+ "$opacity": isExpanded ? 1 : 0
9006
9035
  }, React.createElement(Icon, {
9007
9036
  icon: isOpen ? 'UpArrow' : 'DownArrow',
9008
9037
  size: 10,
@@ -9014,10 +9043,12 @@ var Sidebar = function Sidebar(_ref15) {
9014
9043
  }, ContentLayout) : React.createElement(Container, {
9015
9044
  "$flexDirection": 'column',
9016
9045
  "$alignItems": 'start',
9017
- "$gap": '8px'
9046
+ "$gap": '8px',
9047
+ "$width": '100%'
9018
9048
  }, React.createElement(Container, {
9019
9049
  "$color": themeColors.text.medium,
9020
- "$hoverColor": themeColors.text.white
9050
+ "$hoverColor": themeColors.text.white,
9051
+ "$width": '100%'
9021
9052
  }, ContentLayout), hasChildren && isExpanded && isOpen && renderChildLinks && React.createElement(Container, null, renderChildLinks(item.children)));
9022
9053
  });
9023
9054
  return React.createElement(SidebarContainer, {
@@ -9049,9 +9080,9 @@ var Sidebar = function Sidebar(_ref15) {
9049
9080
  "$gap": '16px',
9050
9081
  "$width": '100%'
9051
9082
  }, content.map(function (item) {
9052
- var _item$children2;
9083
+ var _item$children3;
9053
9084
  var active = isRouteActive(item) || false;
9054
- var hasChildren = !!((_item$children2 = item.children) !== null && _item$children2 !== void 0 && _item$children2.length);
9085
+ var hasChildren = !!((_item$children3 = item.children) !== null && _item$children3 !== void 0 && _item$children3.length);
9055
9086
  var isOpen = openMenus[item.id];
9056
9087
  return React.createElement(SidebarItem, {
9057
9088
  key: item.id,
@@ -9196,7 +9227,7 @@ var TableRow = function TableRow(_ref) {
9196
9227
  }));
9197
9228
  };
9198
9229
 
9199
- var _templateObject$q, _templateObject2$l, _templateObject3$e, _templateObject4$b, _templateObject5$9, _templateObject6$7;
9230
+ var _templateObject$q, _templateObject2$l, _templateObject3$e, _templateObject4$b, _templateObject5$9, _templateObject6$8;
9200
9231
  var TableContainer = styled.div(_templateObject$q || (_templateObject$q = _taggedTemplateLiteralLoose(["\n background: ", ";\n width: 100%;\n display: flex;\n overflow: hidden;\n border-radius: 8px;\n"])), function (_ref) {
9201
9232
  var theme = _ref.theme;
9202
9233
  return theme.brand.light;
@@ -9222,7 +9253,7 @@ var LegendDivider = styled.div(_templateObject5$9 || (_templateObject5$9 = _tagg
9222
9253
  var $marginRight = _ref6.$marginRight;
9223
9254
  return $marginRight != null ? $marginRight : '0px';
9224
9255
  });
9225
- var Divider = styled.div(_templateObject6$7 || (_templateObject6$7 = _taggedTemplateLiteralLoose(["\n height: 2px;\n background: ", ";\n"])), function (_ref7) {
9256
+ var Divider = styled.div(_templateObject6$8 || (_templateObject6$8 = _taggedTemplateLiteralLoose(["\n height: 2px;\n background: ", ";\n"])), function (_ref7) {
9226
9257
  var theme = _ref7.theme;
9227
9258
  return theme.border.extraLight;
9228
9259
  });
@@ -9393,7 +9424,7 @@ var Table = function Table(_ref8) {
9393
9424
  }))));
9394
9425
  };
9395
9426
 
9396
- var _templateObject$r, _templateObject2$m, _templateObject3$f, _templateObject4$c, _templateObject5$a, _templateObject6$8;
9427
+ var _templateObject$r, _templateObject2$m, _templateObject3$f, _templateObject4$c, _templateObject5$a, _templateObject6$9;
9397
9428
  var Container$4 = styled.div(_templateObject$r || (_templateObject$r = _taggedTemplateLiteralLoose(["\n width: 100%;\n height: 100%; \n display: flex;\n flex-direction: column;\n overflow: ", ";\n gap: ", ";\n border: ", ";\n border-radius: 8px;\n"])), function (_ref) {
9398
9429
  var $overflow = _ref.$overflow;
9399
9430
  return $overflow || 'visible';
@@ -9442,7 +9473,7 @@ var DetailsFirstContainer = styled.div(_templateObject5$a || (_templateObject5$a
9442
9473
  theme = _ref13.theme;
9443
9474
  return $active ? theme["default"].primary : theme.text.medium;
9444
9475
  });
9445
- var TabItemsWrapper = styled.div(_templateObject6$8 || (_templateObject6$8 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 24px;\n // overflow-x: auto;\n scrollbar-width: thin;\n"])));
9476
+ var TabItemsWrapper = styled.div(_templateObject6$9 || (_templateObject6$9 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 24px;\n // overflow-x: auto;\n scrollbar-width: thin;\n"])));
9446
9477
  var Tabs = function Tabs(_ref14) {
9447
9478
  var tabItems = _ref14.tabItems,
9448
9479
  _ref14$disabled = _ref14.disabled,