labsense-ui-kit 1.3.74 → 1.3.76

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.
@@ -5,6 +5,28 @@ import { toast } from 'react-hot-toast';
5
5
  import { useNavigate, NavLink, useLocation } from 'react-router-dom';
6
6
  import { useTranslation } from 'react-i18next';
7
7
 
8
+ function _arrayLikeToArray(r, a) {
9
+ (null == a || a > r.length) && (a = r.length);
10
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
11
+ return n;
12
+ }
13
+ function _createForOfIteratorHelperLoose(r, e) {
14
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
15
+ if (t) return (t = t.call(r)).next.bind(t);
16
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
17
+ t && (r = t);
18
+ var o = 0;
19
+ return function () {
20
+ return o >= r.length ? {
21
+ done: !0
22
+ } : {
23
+ done: !1,
24
+ value: r[o++]
25
+ };
26
+ };
27
+ }
28
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
29
+ }
8
30
  function _extends() {
9
31
  return _extends = Object.assign ? Object.assign.bind() : function (n) {
10
32
  for (var e = 1; e < arguments.length; e++) {
@@ -17,6 +39,13 @@ function _extends() {
17
39
  function _taggedTemplateLiteralLoose(e, t) {
18
40
  return t || (t = e.slice(0)), e.raw = t, e;
19
41
  }
42
+ function _unsupportedIterableToArray(r, a) {
43
+ if (r) {
44
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
45
+ var t = {}.toString.call(r).slice(8, -1);
46
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
47
+ }
48
+ }
20
49
 
21
50
  var Action = function Action(_ref) {
22
51
  var size = _ref.size,
@@ -10735,48 +10764,49 @@ var ProgressBar = function ProgressBar(_ref3) {
10735
10764
  }));
10736
10765
  };
10737
10766
 
10738
- var _templateObject$n, _templateObject2$j, _templateObject3$c, _templateObject4$9, _templateObject5$8, _templateObject6$8, _templateObject7$6;
10739
- var SidebarContainer = styled.div(_templateObject$n || (_templateObject$n = _taggedTemplateLiteralLoose(["\n width: 68px;\n max-width: 68px;\n height: 100vh;\n background: ", ";\n transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), max-width 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: 998;\n justify-content: space-between;\n\n /* Expand on hover */\n &:hover {\n width: max-content;\n max-width: 400px;\n\n /* You can also add a class for children */\n span, .expandable {\n opacity: 1;\n visibility: visible;\n transform: translateX(0);\n }\n }\n"])), function (_ref) {
10740
- var $background = _ref.$background,
10741
- theme = _ref.theme;
10767
+ var _templateObject$n, _templateObject2$j, _templateObject3$c, _templateObject4$9, _templateObject5$8, _templateObject6$8, _templateObject7$6, _templateObject8$5, _templateObject9$5;
10768
+ var MOBILE_BREAKPOINT = '768px';
10769
+ var Overlay = styled.div(_templateObject$n || (_templateObject$n = _taggedTemplateLiteralLoose(["\n display: none;\n \n @media (max-width: ", ") {\n display: block;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n z-index: 997;\n opacity: ", ";\n visibility: ", ";\n transition: opacity 0.3s ease, visibility 0.3s ease;\n }\n"])), MOBILE_BREAKPOINT, function (_ref) {
10770
+ var $isOpen = _ref.$isOpen;
10771
+ return $isOpen ? 1 : 0;
10772
+ }, function (_ref2) {
10773
+ var $isOpen = _ref2.$isOpen;
10774
+ return $isOpen ? 'visible' : 'hidden';
10775
+ });
10776
+ var HamburgerButton = styled.button(_templateObject2$j || (_templateObject2$j = _taggedTemplateLiteralLoose(["\n display: none;\n \n @media (max-width: ", ") {\n display: flex;\n position: fixed;\n top: 20px;\n left: 20px;\n z-index: 999;\n background: ", ";\n border: none;\n border-radius: 8px;\n padding: 12px;\n cursor: pointer;\n align-items: center;\n justify-content: center;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n transition: transform 0.2s ease;\n\n &:active {\n transform: scale(0.95);\n }\n }\n"])), MOBILE_BREAKPOINT, function (_ref3) {
10777
+ var $background = _ref3.$background,
10778
+ theme = _ref3.theme;
10742
10779
  return $background || theme.vms.accent.softBlue;
10743
10780
  });
10744
- 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: none;\n padding: ", ";\n color: ", ";\n\n /* Hover state */\n &:hover {\n color: ", ";\n background: ", ";\n \n /* Make icons white on hover */\n svg {\n color: ", " !important;\n transition: none;\n }\n }\n\n /* Active link state */\n &.active {\n color: ", ";\n background: ", ";\n \n /* Make icons white when active */\n svg {\n color: ", " !important;\n transition: none;\n }\n }\n"])), function (_ref2) {
10745
- var $padding = _ref2.$padding;
10746
- return $padding;
10747
- }, function (_ref3) {
10748
- var theme = _ref3.theme;
10749
- return theme.vms.text.medium;
10750
- }, function (_ref4) {
10751
- var theme = _ref4.theme;
10752
- return theme.vms.text.white;
10753
- }, function (_ref5) {
10754
- var theme = _ref5.theme;
10755
- return theme.vms["default"].primary;
10781
+ var SidebarContainer = styled.div(_templateObject3$c || (_templateObject3$c = _taggedTemplateLiteralLoose(["\n width: 68px;\n max-width: 68px;\n height: 100vh;\n background: ", ";\n transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), max-width 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: 998;\n justify-content: space-between;\n gap: 24px;\n\n /* Expand on hover */\n &:hover {\n width: max-content;\n max-width: 400px;\n\n /* You can also add a class for children */\n span, .expandable {\n opacity: 1;\n visibility: visible;\n transform: translateX(0);\n }\n }\n\n /* Mobile styles */\n @media (max-width: ", ") {\n transform: translateX(", ");\n transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n width: 280px;\n max-width: 280px;\n box-shadow: ", ";\n\n /* Always show text on mobile when open */\n span, .expandable {\n opacity: ", ";\n visibility: ", ";\n transform: translateX(0);\n }\n\n /* Disable hover expansion on mobile */\n &:hover {\n width: 280px;\n max-width: 280px;\n }\n }\n"])), function (_ref4) {
10782
+ var $background = _ref4.$background,
10783
+ theme = _ref4.theme;
10784
+ return $background || theme.vms.accent.softBlue;
10785
+ }, MOBILE_BREAKPOINT, function (_ref5) {
10786
+ var $isMobileOpen = _ref5.$isMobileOpen;
10787
+ return $isMobileOpen ? '0' : '-100%';
10756
10788
  }, function (_ref6) {
10757
- var theme = _ref6.theme;
10758
- return theme.vms.text.white;
10789
+ var $isMobileOpen = _ref6.$isMobileOpen;
10790
+ return $isMobileOpen ? '2px 0 8px rgba(0, 0, 0, 0.15)' : 'none';
10759
10791
  }, function (_ref7) {
10760
- var theme = _ref7.theme;
10761
- return theme.vms.text.white;
10792
+ var $isMobileOpen = _ref7.$isMobileOpen;
10793
+ return $isMobileOpen ? 1 : 0;
10762
10794
  }, function (_ref8) {
10763
- var theme = _ref8.theme;
10764
- return theme.vms["default"].primary;
10765
- }, function (_ref9) {
10766
- var theme = _ref9.theme;
10767
- return theme.vms.text.white;
10768
- });
10769
- var IconWrapper$2 = styled.div(_templateObject3$c || (_templateObject3$c = _taggedTemplateLiteralLoose(["\n background: ", ";\n transition: none;\n padding: 4px;\n border-radius: 4px;\n width: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n"])), function (_ref10) {
10770
- var $selected = _ref10.$selected,
10771
- theme = _ref10.theme;
10772
- return $selected ? theme.vms["default"].primary : theme.vms["default"].tertiary;
10795
+ var $isMobileOpen = _ref8.$isMobileOpen;
10796
+ return $isMobileOpen ? 'visible' : 'hidden';
10773
10797
  });
10774
- var StyledContainer = styled(Container)(_templateObject4$9 || (_templateObject4$9 = _taggedTemplateLiteralLoose(["\n transition: none;\n\n svg {\n transition: none;\n }\n\n /* Parent hover / active */\n &:hover,\n &.active {\n svg {\n color: ", " !important;\n }\n }\n\n /* 2nd child reacts ONLY when parent is hovered */\n &:hover > div:nth-child(2) {\n svg {\n color: ", " !important;\n\n path {\n stroke: ", " !important;\n }\n }\n }\n\n /* Default state for 2nd child */\n > div:nth-child(2) {\n svg {\n color: ", " !important;\n\n path {\n stroke: ", " !important;\n }\n }\n }\n"])), function (_ref11) {
10798
+ var SidebarLink = styled(NavLink)(_templateObject4$9 || (_templateObject4$9 = _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: none;\n padding: ", ";\n color: ", ";\n\n /* Hover state */\n &:hover {\n color: ", ";\n background: ", ";\n \n /* Make icons white on hover */\n svg {\n color: ", " !important;\n transition: none;\n }\n }\n\n /* Active link state */\n &.active {\n color: ", ";\n background: ", ";\n \n /* Make icons white when active */\n svg {\n color: ", " !important;\n transition: none;\n }\n }\n"])), function (_ref9) {
10799
+ var $padding = _ref9.$padding;
10800
+ return $padding;
10801
+ }, function (_ref10) {
10802
+ var theme = _ref10.theme;
10803
+ return theme.vms.text.medium;
10804
+ }, function (_ref11) {
10775
10805
  var theme = _ref11.theme;
10776
10806
  return theme.vms.text.white;
10777
10807
  }, function (_ref12) {
10778
10808
  var theme = _ref12.theme;
10779
- return theme.vms.text.white;
10809
+ return theme.vms["default"].primary;
10780
10810
  }, function (_ref13) {
10781
10811
  var theme = _ref13.theme;
10782
10812
  return theme.vms.text.white;
@@ -10785,37 +10815,68 @@ var StyledContainer = styled(Container)(_templateObject4$9 || (_templateObject4$
10785
10815
  return theme.vms.text.white;
10786
10816
  }, function (_ref15) {
10787
10817
  var theme = _ref15.theme;
10818
+ return theme.vms["default"].primary;
10819
+ }, function (_ref16) {
10820
+ var theme = _ref16.theme;
10821
+ return theme.vms.text.white;
10822
+ });
10823
+ var IconWrapper$2 = styled.div(_templateObject5$8 || (_templateObject5$8 = _taggedTemplateLiteralLoose(["\n background: ", ";\n transition: none;\n padding: 4px;\n border-radius: 4px;\n width: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n"])), function (_ref17) {
10824
+ var $selected = _ref17.$selected,
10825
+ theme = _ref17.theme;
10826
+ return $selected ? theme.vms["default"].primary : theme.vms["default"].tertiary;
10827
+ });
10828
+ var StyledContainer = styled(Container)(_templateObject6$8 || (_templateObject6$8 = _taggedTemplateLiteralLoose(["\n transition: none;\n\n svg {\n transition: none;\n }\n\n /* Parent hover / active */\n &:hover,\n &.active {\n svg {\n color: ", " !important;\n }\n }\n\n /* 2nd child reacts ONLY when parent is hovered */\n &:hover > div:nth-child(2) {\n svg {\n color: ", " !important;\n\n path {\n stroke: ", " !important;\n }\n }\n }\n\n /* Default state for 2nd child */\n > div:nth-child(2) {\n svg {\n color: ", " !important;\n\n path {\n stroke: ", " !important;\n }\n }\n }\n"])), function (_ref18) {
10829
+ var theme = _ref18.theme;
10830
+ return theme.vms.text.white;
10831
+ }, function (_ref19) {
10832
+ var theme = _ref19.theme;
10833
+ return theme.vms.text.white;
10834
+ }, function (_ref20) {
10835
+ var theme = _ref20.theme;
10836
+ return theme.vms.text.white;
10837
+ }, function (_ref21) {
10838
+ var theme = _ref21.theme;
10839
+ return theme.vms.text.white;
10840
+ }, function (_ref22) {
10841
+ var theme = _ref22.theme;
10788
10842
  return theme.vms.text.medium;
10789
10843
  });
10790
- var Logo = styled.div(_templateObject5$8 || (_templateObject5$8 = _taggedTemplateLiteralLoose(["\n transition: none;\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"])));
10791
- var TextContainer = styled.span(_templateObject6$8 || (_templateObject6$8 = _taggedTemplateLiteralLoose(["\n white-space: nowrap;\n opacity: 0;\n visibility: hidden;\n transform: translateX(-10px);\n transition: all 0.3s ease;\n padding: ", ";\n font-size: ", ";\n font-weight: ", ";\n\n ", ":hover & {\n opacity: 1;\n visibility: visible;\n transform: translateX(0);\n }\n"])), function (_ref16) {
10792
- var $padding = _ref16.$padding;
10844
+ var Logo = styled.div(_templateObject7$6 || (_templateObject7$6 = _taggedTemplateLiteralLoose(["\n transition: none;\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"])));
10845
+ var TextContainer = styled.span(_templateObject8$5 || (_templateObject8$5 = _taggedTemplateLiteralLoose(["\n white-space: nowrap;\n opacity: 0;\n visibility: hidden;\n transform: translateX(-10px);\n transition: all 0.3s ease;\n padding: ", ";\n font-size: ", ";\n font-weight: ", ";\n\n ", ":hover & {\n opacity: 1;\n visibility: visible;\n transform: translateX(0);\n }\n\n /* Mobile: Always visible when sidebar is open */\n @media (max-width: ", ") {\n opacity: 1;\n visibility: visible;\n transform: translateX(0);\n }\n"])), function (_ref23) {
10846
+ var $padding = _ref23.$padding;
10793
10847
  return $padding;
10794
- }, function (_ref17) {
10795
- var $fontSize = _ref17.$fontSize;
10848
+ }, function (_ref24) {
10849
+ var $fontSize = _ref24.$fontSize;
10796
10850
  return $fontSize || '20px';
10797
- }, function (_ref18) {
10798
- var $fontWeight = _ref18.$fontWeight;
10851
+ }, function (_ref25) {
10852
+ var $fontWeight = _ref25.$fontWeight;
10799
10853
  return $fontWeight || '500';
10800
- }, SidebarContainer);
10801
- var NotificationBadge = styled.div(_templateObject7$6 || (_templateObject7$6 = _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 z-index: 100;\n width: max-content;\n"])), function (_ref19) {
10802
- var $position = _ref19.$position;
10854
+ }, SidebarContainer, MOBILE_BREAKPOINT);
10855
+ var NotificationBadge = styled.div(_templateObject9$5 || (_templateObject9$5 = _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 z-index: 100;\n width: max-content;\n"])), function (_ref26) {
10856
+ var $position = _ref26.$position;
10803
10857
  return $position || 'absolute';
10804
10858
  });
10805
- var Sidebar = function Sidebar(_ref20) {
10806
- var logo = _ref20.logo,
10807
- content = _ref20.content,
10808
- background = _ref20.background,
10809
- ProfileContent = _ref20.ProfileContent,
10810
- _ref20$isExpanded = _ref20.isExpanded,
10811
- isExpanded = _ref20$isExpanded === void 0 ? false : _ref20$isExpanded,
10812
- setIsExpanded = _ref20.setIsExpanded;
10859
+ var Sidebar = function Sidebar(_ref27) {
10860
+ var logo = _ref27.logo,
10861
+ content = _ref27.content,
10862
+ background = _ref27.background,
10863
+ ProfileContent = _ref27.ProfileContent,
10864
+ _ref27$isExpanded = _ref27.isExpanded,
10865
+ isExpanded = _ref27$isExpanded === void 0 ? false : _ref27$isExpanded,
10866
+ setIsExpanded = _ref27.setIsExpanded;
10813
10867
  var location = useLocation();
10814
10868
  var _useState = useState({}),
10815
10869
  openMenus = _useState[0],
10816
10870
  setOpenMenus = _useState[1];
10871
+ var _useState2 = useState(false),
10872
+ isMobileOpen = _useState2[0],
10873
+ setIsMobileOpen = _useState2[1];
10874
+ var _useState3 = useState(false),
10875
+ isMobile = _useState3[0],
10876
+ setIsMobile = _useState3[1];
10817
10877
  var isExpandedRef = useRef(isExpanded);
10818
- var _useState2 = useState(function () {
10878
+ var sidebarRef = useRef(null);
10879
+ var _useState4 = useState(function () {
10819
10880
  var container = document.getElementById('badge-portal-container');
10820
10881
  if (!container) {
10821
10882
  container = document.createElement('div');
@@ -10827,16 +10888,39 @@ var Sidebar = function Sidebar(_ref20) {
10827
10888
  }
10828
10889
  return container;
10829
10890
  }),
10830
- badgePortalContainer = _useState2[0];
10891
+ badgePortalContainer = _useState4[0];
10892
+ useEffect(function () {
10893
+ var checkMobile = function checkMobile() {
10894
+ setIsMobile(window.innerWidth <= 768);
10895
+ };
10896
+ checkMobile();
10897
+ window.addEventListener('resize', checkMobile);
10898
+ return function () {
10899
+ window.removeEventListener('resize', checkMobile);
10900
+ };
10901
+ }, []);
10831
10902
  useEffect(function () {
10832
10903
  isExpandedRef.current = isExpanded;
10833
10904
  if (!isExpanded) setOpenMenus({});
10834
10905
  }, [isExpanded]);
10906
+ var toggleMobileMenu = useCallback(function () {
10907
+ setIsMobileOpen(function (prev) {
10908
+ return !prev;
10909
+ });
10910
+ }, []);
10911
+ var closeMobileMenu = useCallback(function () {
10912
+ if (isMobile) {
10913
+ setIsMobileOpen(false);
10914
+ }
10915
+ }, [isMobile]);
10916
+ var handleOverlayClick = useCallback(function () {
10917
+ setIsMobileOpen(false);
10918
+ }, []);
10835
10919
  var toggleMenu = function toggleMenu(id) {
10836
10920
  setOpenMenus(function (prev) {
10837
- var _ref21;
10921
+ var _ref28;
10838
10922
  var isCurrentlyOpen = !!prev[id];
10839
- return isCurrentlyOpen ? {} : (_ref21 = {}, _ref21[id] = true, _ref21);
10923
+ return isCurrentlyOpen ? {} : (_ref28 = {}, _ref28[id] = true, _ref28);
10840
10924
  });
10841
10925
  };
10842
10926
  var getTotalNotifications = useCallback(function (item) {
@@ -10861,8 +10945,8 @@ var Sidebar = function Sidebar(_ref20) {
10861
10945
  return currentBase === getBasePath(child.activeUrl) || currentBase === getBasePath(child.url);
10862
10946
  }));
10863
10947
  };
10864
- var ChildLink = function ChildLink(_ref22) {
10865
- var child = _ref22.child;
10948
+ var ChildLink = function ChildLink(_ref29) {
10949
+ var child = _ref29.child;
10866
10950
  var themeColors = useTheme$1();
10867
10951
  var location = useLocation();
10868
10952
  var active = getBasePath(location.pathname) === getBasePath(child.activeUrl) || getBasePath(location.pathname) === getBasePath(child.url);
@@ -10870,6 +10954,7 @@ var Sidebar = function Sidebar(_ref20) {
10870
10954
  if (child.url && child.url === location.pathname) {
10871
10955
  e.preventDefault();
10872
10956
  }
10957
+ closeMobileMenu();
10873
10958
  }, [child.url, location.pathname]);
10874
10959
  return React.createElement(SidebarLink, {
10875
10960
  to: child.url || '#',
@@ -10908,14 +10993,14 @@ var Sidebar = function Sidebar(_ref20) {
10908
10993
  });
10909
10994
  }));
10910
10995
  };
10911
- var SidebarItem = function SidebarItem(_ref23) {
10912
- var item = _ref23.item,
10913
- isActive = _ref23.isActive,
10914
- isOpen = _ref23.isOpen,
10915
- hasChildren = _ref23.hasChildren,
10916
- isExpanded = _ref23.isExpanded,
10917
- onToggle = _ref23.onToggle,
10918
- renderChildLinks = _ref23.renderChildLinks;
10996
+ var SidebarItem = function SidebarItem(_ref30) {
10997
+ var item = _ref30.item,
10998
+ isActive = _ref30.isActive,
10999
+ isOpen = _ref30.isOpen,
11000
+ hasChildren = _ref30.hasChildren,
11001
+ isExpanded = _ref30.isExpanded,
11002
+ onToggle = _ref30.onToggle,
11003
+ renderChildLinks = _ref30.renderChildLinks;
10919
11004
  var themeColors = useTheme$1();
10920
11005
  var activeClass = isActive ? 'active' : '';
10921
11006
  var handleClick = useCallback(function () {
@@ -10980,6 +11065,7 @@ var Sidebar = function Sidebar(_ref20) {
10980
11065
  if (item.url === location.pathname) {
10981
11066
  e.preventDefault();
10982
11067
  }
11068
+ closeMobileMenu();
10983
11069
  }, [item.url]);
10984
11070
  return item.url ? React.createElement(SidebarLink, {
10985
11071
  to: item.url,
@@ -11005,8 +11091,30 @@ var Sidebar = function Sidebar(_ref20) {
11005
11091
  var handleSidebarExpansion = useCallback(function (expanded) {
11006
11092
  if (isExpandedRef.current !== expanded) {
11007
11093
  setIsExpanded(expanded);
11094
+ isExpandedRef.current = expanded;
11008
11095
  }
11009
11096
  }, [setIsExpanded]);
11097
+ useEffect(function () {
11098
+ var sidebar = sidebarRef.current;
11099
+ if (!sidebar) return;
11100
+ if (typeof ResizeObserver === 'undefined') return;
11101
+ if (isMobile) return;
11102
+ var resizeObserver = new ResizeObserver(function (entries) {
11103
+ for (var _iterator = _createForOfIteratorHelperLoose(entries), _step; !(_step = _iterator()).done;) {
11104
+ var entry = _step.value;
11105
+ var width = entry.contentRect.width;
11106
+ if (width > 70) {
11107
+ handleSidebarExpansion(true);
11108
+ } else {
11109
+ handleSidebarExpansion(false);
11110
+ }
11111
+ }
11112
+ });
11113
+ resizeObserver.observe(sidebar);
11114
+ return function () {
11115
+ resizeObserver.disconnect();
11116
+ };
11117
+ }, [handleSidebarExpansion, isMobile]);
11010
11118
  useEffect(function () {
11011
11119
  var updateBadgePositions = function updateBadgePositions() {
11012
11120
  content.forEach(function (item) {
@@ -11027,14 +11135,22 @@ var Sidebar = function Sidebar(_ref20) {
11027
11135
  window.removeEventListener('resize', updateBadgePositions);
11028
11136
  };
11029
11137
  }, [content, isExpanded, getTotalNotifications]);
11030
- return React.createElement(SidebarContainer, {
11138
+ var themeColors = useTheme$1();
11139
+ return React.createElement(React.Fragment, null, React.createElement(HamburgerButton, {
11031
11140
  "$background": background,
11032
- onMouseEnter: function onMouseEnter() {
11033
- return handleSidebarExpansion(true);
11034
- },
11035
- onMouseLeave: function onMouseLeave() {
11036
- return handleSidebarExpansion(false);
11037
- }
11141
+ onClick: toggleMobileMenu,
11142
+ "aria-label": "Toggle menu"
11143
+ }, React.createElement(Icon, {
11144
+ icon: isMobileOpen ? 'X' : 'Hamburger',
11145
+ size: 24,
11146
+ color: themeColors.vms.text.white
11147
+ })), React.createElement(Overlay, {
11148
+ "$isOpen": isMobileOpen,
11149
+ onClick: handleOverlayClick
11150
+ }), React.createElement(SidebarContainer, {
11151
+ ref: sidebarRef,
11152
+ "$background": background,
11153
+ "$isMobileOpen": isMobileOpen
11038
11154
  }, React.createElement(Container, {
11039
11155
  "$flexDirection": 'column',
11040
11156
  "$gap": '28px',
@@ -11051,7 +11167,9 @@ var Sidebar = function Sidebar(_ref20) {
11051
11167
  }))), React.createElement(Container, {
11052
11168
  "$flexDirection": 'column',
11053
11169
  "$gap": '16px',
11054
- "$width": '100%'
11170
+ "$width": '100%',
11171
+ "$overflow": 'auto',
11172
+ "$scrollbarWidth": 'none'
11055
11173
  }, content.map(function (item) {
11056
11174
  var _item$children3;
11057
11175
  var active = isRouteActive(item) || false;
@@ -11063,13 +11181,13 @@ var Sidebar = function Sidebar(_ref20) {
11063
11181
  isActive: active,
11064
11182
  isOpen: isOpen,
11065
11183
  hasChildren: hasChildren,
11066
- isExpanded: isExpanded,
11184
+ isExpanded: isMobile ? isMobileOpen : isExpanded,
11067
11185
  onToggle: function onToggle() {
11068
11186
  return toggleMenu(item.id);
11069
11187
  },
11070
11188
  renderChildLinks: renderChildLinks
11071
11189
  });
11072
- }))), ProfileContent);
11190
+ }))), ProfileContent));
11073
11191
  };
11074
11192
 
11075
11193
  var _templateObject$o, _templateObject2$k, _templateObject3$d, _templateObject4$a;