labsense-ui-kit 1.3.75 → 1.3.77

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.
@@ -0,0 +1,13 @@
1
+ export declare const breakpoints: {
2
+ xs: number;
3
+ sm: number;
4
+ md: number;
5
+ lg: number;
6
+ };
7
+ export declare const getResponsiveFlags: (width: number) => {
8
+ isXS: boolean;
9
+ isSM: boolean;
10
+ isMD: boolean;
11
+ isLG: boolean;
12
+ isXL: boolean;
13
+ };
@@ -3,4 +3,6 @@ import useCopyToClipboard from './useCopyToClipboard';
3
3
  import useCustomModal from './useCustomModal';
4
4
  import useNotification from './useNotification';
5
5
  import useTheme from './useTheme';
6
- export { useClickOutside, useCopyToClipboard, useCustomModal, useNotification, useTheme };
6
+ import useWindowSize from './useWindowSize';
7
+ import { getResponsiveFlags } from './breakpoints';
8
+ export { useClickOutside, useCopyToClipboard, useCustomModal, useNotification, useTheme, getResponsiveFlags, useWindowSize };
@@ -0,0 +1,2 @@
1
+ declare const useWindowSize: () => number[];
2
+ export default useWindowSize;
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import { ButtonCarousel } from './Carousel';
5
5
  import { Container, Span } from './Container&Span/StyledComponents';
6
6
  import { DatePicker } from './Date-Time';
7
7
  import { ButtonDropdown, MultiSelectDropdown, OptionComponent, SelectedOption, SelectOption, DropdownMenu, Options } from './Dropdown';
8
- import { useClickOutside, useCopyToClipboard, useCustomModal, useNotification, useTheme } from './hooks';
8
+ import { useClickOutside, useCopyToClipboard, useCustomModal, useNotification, useTheme, getResponsiveFlags, useWindowSize } from './hooks';
9
9
  import { Icon, IconProps, IconNames } from './Icons';
10
10
  import { SearchBox, TextArea, TextField, TextFieldWithDropdown, CheckBox } from './Inputs';
11
11
  import { CircularLoader, Loader } from './Loader';
@@ -24,7 +24,7 @@ export { ButtonCarousel };
24
24
  export { Container, Span };
25
25
  export { DatePicker };
26
26
  export { ButtonDropdown, MultiSelectDropdown, OptionComponent, SelectedOption, SelectOption, DropdownMenu, Options };
27
- export { useClickOutside, useCopyToClipboard, useCustomModal, useNotification, useTheme };
27
+ export { useClickOutside, useCopyToClipboard, useCustomModal, useNotification, useTheme, getResponsiveFlags, useWindowSize };
28
28
  export { Icon, IconProps, IconNames };
29
29
  export { SearchBox, TextArea, TextField, TextFieldWithDropdown, CheckBox };
30
30
  export { CircularLoader, Loader };
package/dist/index.js CHANGED
@@ -6890,6 +6890,39 @@ var useNotification = function useNotification() {
6890
6890
  };
6891
6891
  };
6892
6892
 
6893
+ var useWindowSize = function useWindowSize() {
6894
+ var _useState = React.useState([window.innerWidth, window.innerHeight]),
6895
+ size = _useState[0],
6896
+ setSize = _useState[1];
6897
+ React.useLayoutEffect(function () {
6898
+ function updateSize() {
6899
+ setSize([window.innerWidth, window.innerHeight]);
6900
+ }
6901
+ window.addEventListener('resize', updateSize);
6902
+ updateSize();
6903
+ return function () {
6904
+ return window.removeEventListener('resize', updateSize);
6905
+ };
6906
+ }, []);
6907
+ return size;
6908
+ };
6909
+
6910
+ var breakpoints = {
6911
+ xs: 576,
6912
+ sm: 768,
6913
+ md: 992,
6914
+ lg: 1280
6915
+ };
6916
+ var getResponsiveFlags = function getResponsiveFlags(width) {
6917
+ return {
6918
+ isXS: width < breakpoints.xs,
6919
+ isSM: width < breakpoints.sm && width >= breakpoints.xs,
6920
+ isMD: width < breakpoints.md && width >= breakpoints.sm,
6921
+ isLG: width < breakpoints.lg && width >= breakpoints.md,
6922
+ isXL: width >= breakpoints.lg
6923
+ };
6924
+ };
6925
+
6893
6926
  var _templateObject$3, _templateObject2$3;
6894
6927
  var TooltipWrapper = styled__default.div(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n"])));
6895
6928
  var TooltipText = styled__default.span(_templateObject2$3 || (_templateObject2$3 = _taggedTemplateLiteralLoose(["\n visibility: ", ";\n opacity: ", ";\n transition: opacity 0.2s ease-in-out;\n background-color: ", ";\n color: ", ";\n border: ", ";\n border-radius: 8px;\n padding: 8px 16px;\n font-size: ", ";\n font-weight: ", ";\n max-width: 300px;\n width: max-content;\n position: fixed;\n z-index: 999;\n pointer-events: none;\n"])), function (_ref) {
@@ -10768,48 +10801,49 @@ var ProgressBar = function ProgressBar(_ref3) {
10768
10801
  }));
10769
10802
  };
10770
10803
 
10771
- var _templateObject$n, _templateObject2$j, _templateObject3$c, _templateObject4$9, _templateObject5$8, _templateObject6$8, _templateObject7$6;
10772
- var SidebarContainer = styled__default.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 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"])), function (_ref) {
10773
- var $background = _ref.$background,
10774
- theme = _ref.theme;
10804
+ var _templateObject$n, _templateObject2$j, _templateObject3$c, _templateObject4$9, _templateObject5$8, _templateObject6$8, _templateObject7$6, _templateObject8$5, _templateObject9$5;
10805
+ var MOBILE_BREAKPOINT = '768px';
10806
+ var Overlay = styled__default.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) {
10807
+ var $isOpen = _ref.$isOpen;
10808
+ return $isOpen ? 1 : 0;
10809
+ }, function (_ref2) {
10810
+ var $isOpen = _ref2.$isOpen;
10811
+ return $isOpen ? 'visible' : 'hidden';
10812
+ });
10813
+ var HamburgerButton = styled__default.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) {
10814
+ var $background = _ref3.$background,
10815
+ theme = _ref3.theme;
10775
10816
  return $background || theme.vms.accent.softBlue;
10776
10817
  });
10777
- 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: 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) {
10778
- var $padding = _ref2.$padding;
10779
- return $padding;
10780
- }, function (_ref3) {
10781
- var theme = _ref3.theme;
10782
- return theme.vms.text.medium;
10783
- }, function (_ref4) {
10784
- var theme = _ref4.theme;
10785
- return theme.vms.text.white;
10786
- }, function (_ref5) {
10787
- var theme = _ref5.theme;
10788
- return theme.vms["default"].primary;
10818
+ var SidebarContainer = styled__default.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) {
10819
+ var $background = _ref4.$background,
10820
+ theme = _ref4.theme;
10821
+ return $background || theme.vms.accent.softBlue;
10822
+ }, MOBILE_BREAKPOINT, function (_ref5) {
10823
+ var $isMobileOpen = _ref5.$isMobileOpen;
10824
+ return $isMobileOpen ? '0' : '-100%';
10789
10825
  }, function (_ref6) {
10790
- var theme = _ref6.theme;
10791
- return theme.vms.text.white;
10826
+ var $isMobileOpen = _ref6.$isMobileOpen;
10827
+ return $isMobileOpen ? '2px 0 8px rgba(0, 0, 0, 0.15)' : 'none';
10792
10828
  }, function (_ref7) {
10793
- var theme = _ref7.theme;
10794
- return theme.vms.text.white;
10829
+ var $isMobileOpen = _ref7.$isMobileOpen;
10830
+ return $isMobileOpen ? 1 : 0;
10795
10831
  }, function (_ref8) {
10796
- var theme = _ref8.theme;
10797
- return theme.vms["default"].primary;
10798
- }, function (_ref9) {
10799
- var theme = _ref9.theme;
10800
- return theme.vms.text.white;
10801
- });
10802
- var IconWrapper$2 = styled__default.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) {
10803
- var $selected = _ref10.$selected,
10804
- theme = _ref10.theme;
10805
- return $selected ? theme.vms["default"].primary : theme.vms["default"].tertiary;
10832
+ var $isMobileOpen = _ref8.$isMobileOpen;
10833
+ return $isMobileOpen ? 'visible' : 'hidden';
10806
10834
  });
10807
- var StyledContainer = styled__default(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) {
10835
+ var SidebarLink = styled__default(reactRouterDom.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) {
10836
+ var $padding = _ref9.$padding;
10837
+ return $padding;
10838
+ }, function (_ref10) {
10839
+ var theme = _ref10.theme;
10840
+ return theme.vms.text.medium;
10841
+ }, function (_ref11) {
10808
10842
  var theme = _ref11.theme;
10809
10843
  return theme.vms.text.white;
10810
10844
  }, function (_ref12) {
10811
10845
  var theme = _ref12.theme;
10812
- return theme.vms.text.white;
10846
+ return theme.vms["default"].primary;
10813
10847
  }, function (_ref13) {
10814
10848
  var theme = _ref13.theme;
10815
10849
  return theme.vms.text.white;
@@ -10818,38 +10852,68 @@ var StyledContainer = styled__default(Container)(_templateObject4$9 || (_templat
10818
10852
  return theme.vms.text.white;
10819
10853
  }, function (_ref15) {
10820
10854
  var theme = _ref15.theme;
10855
+ return theme.vms["default"].primary;
10856
+ }, function (_ref16) {
10857
+ var theme = _ref16.theme;
10858
+ return theme.vms.text.white;
10859
+ });
10860
+ var IconWrapper$2 = styled__default.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) {
10861
+ var $selected = _ref17.$selected,
10862
+ theme = _ref17.theme;
10863
+ return $selected ? theme.vms["default"].primary : theme.vms["default"].tertiary;
10864
+ });
10865
+ var StyledContainer = styled__default(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) {
10866
+ var theme = _ref18.theme;
10867
+ return theme.vms.text.white;
10868
+ }, function (_ref19) {
10869
+ var theme = _ref19.theme;
10870
+ return theme.vms.text.white;
10871
+ }, function (_ref20) {
10872
+ var theme = _ref20.theme;
10873
+ return theme.vms.text.white;
10874
+ }, function (_ref21) {
10875
+ var theme = _ref21.theme;
10876
+ return theme.vms.text.white;
10877
+ }, function (_ref22) {
10878
+ var theme = _ref22.theme;
10821
10879
  return theme.vms.text.medium;
10822
10880
  });
10823
- var Logo = styled__default.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"])));
10824
- var TextContainer = styled__default.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) {
10825
- var $padding = _ref16.$padding;
10881
+ var Logo = styled__default.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"])));
10882
+ var TextContainer = styled__default.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) {
10883
+ var $padding = _ref23.$padding;
10826
10884
  return $padding;
10827
- }, function (_ref17) {
10828
- var $fontSize = _ref17.$fontSize;
10885
+ }, function (_ref24) {
10886
+ var $fontSize = _ref24.$fontSize;
10829
10887
  return $fontSize || '20px';
10830
- }, function (_ref18) {
10831
- var $fontWeight = _ref18.$fontWeight;
10888
+ }, function (_ref25) {
10889
+ var $fontWeight = _ref25.$fontWeight;
10832
10890
  return $fontWeight || '500';
10833
- }, SidebarContainer);
10834
- var NotificationBadge = styled__default.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) {
10835
- var $position = _ref19.$position;
10891
+ }, SidebarContainer, MOBILE_BREAKPOINT);
10892
+ var NotificationBadge = styled__default.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) {
10893
+ var $position = _ref26.$position;
10836
10894
  return $position || 'absolute';
10837
10895
  });
10838
- var Sidebar = function Sidebar(_ref20) {
10839
- var logo = _ref20.logo,
10840
- content = _ref20.content,
10841
- background = _ref20.background,
10842
- ProfileContent = _ref20.ProfileContent,
10843
- _ref20$isExpanded = _ref20.isExpanded,
10844
- isExpanded = _ref20$isExpanded === void 0 ? false : _ref20$isExpanded,
10845
- setIsExpanded = _ref20.setIsExpanded;
10896
+ var Sidebar = function Sidebar(_ref27) {
10897
+ var logo = _ref27.logo,
10898
+ content = _ref27.content,
10899
+ background = _ref27.background,
10900
+ ProfileContent = _ref27.ProfileContent,
10901
+ _ref27$isExpanded = _ref27.isExpanded,
10902
+ isExpanded = _ref27$isExpanded === void 0 ? false : _ref27$isExpanded,
10903
+ setIsExpanded = _ref27.setIsExpanded;
10846
10904
  var location = reactRouterDom.useLocation();
10847
10905
  var _useState = React.useState({}),
10848
10906
  openMenus = _useState[0],
10849
10907
  setOpenMenus = _useState[1];
10908
+ var _useState2 = React.useState(false),
10909
+ isMobileOpen = _useState2[0],
10910
+ setIsMobileOpen = _useState2[1];
10911
+ var _useState3 = React.useState(false),
10912
+ isMobile = _useState3[0],
10913
+ setIsMobile = _useState3[1];
10850
10914
  var isExpandedRef = React.useRef(isExpanded);
10851
10915
  var sidebarRef = React.useRef(null);
10852
- var _useState2 = React.useState(function () {
10916
+ var _useState4 = React.useState(function () {
10853
10917
  var container = document.getElementById('badge-portal-container');
10854
10918
  if (!container) {
10855
10919
  container = document.createElement('div');
@@ -10861,16 +10925,39 @@ var Sidebar = function Sidebar(_ref20) {
10861
10925
  }
10862
10926
  return container;
10863
10927
  }),
10864
- badgePortalContainer = _useState2[0];
10928
+ badgePortalContainer = _useState4[0];
10929
+ React.useEffect(function () {
10930
+ var checkMobile = function checkMobile() {
10931
+ setIsMobile(window.innerWidth <= 768);
10932
+ };
10933
+ checkMobile();
10934
+ window.addEventListener('resize', checkMobile);
10935
+ return function () {
10936
+ window.removeEventListener('resize', checkMobile);
10937
+ };
10938
+ }, []);
10865
10939
  React.useEffect(function () {
10866
10940
  isExpandedRef.current = isExpanded;
10867
10941
  if (!isExpanded) setOpenMenus({});
10868
10942
  }, [isExpanded]);
10943
+ var toggleMobileMenu = React.useCallback(function () {
10944
+ setIsMobileOpen(function (prev) {
10945
+ return !prev;
10946
+ });
10947
+ }, []);
10948
+ var closeMobileMenu = React.useCallback(function () {
10949
+ if (isMobile) {
10950
+ setIsMobileOpen(false);
10951
+ }
10952
+ }, [isMobile]);
10953
+ var handleOverlayClick = React.useCallback(function () {
10954
+ setIsMobileOpen(false);
10955
+ }, []);
10869
10956
  var toggleMenu = function toggleMenu(id) {
10870
10957
  setOpenMenus(function (prev) {
10871
- var _ref21;
10958
+ var _ref28;
10872
10959
  var isCurrentlyOpen = !!prev[id];
10873
- return isCurrentlyOpen ? {} : (_ref21 = {}, _ref21[id] = true, _ref21);
10960
+ return isCurrentlyOpen ? {} : (_ref28 = {}, _ref28[id] = true, _ref28);
10874
10961
  });
10875
10962
  };
10876
10963
  var getTotalNotifications = React.useCallback(function (item) {
@@ -10895,8 +10982,8 @@ var Sidebar = function Sidebar(_ref20) {
10895
10982
  return currentBase === getBasePath(child.activeUrl) || currentBase === getBasePath(child.url);
10896
10983
  }));
10897
10984
  };
10898
- var ChildLink = function ChildLink(_ref22) {
10899
- var child = _ref22.child;
10985
+ var ChildLink = function ChildLink(_ref29) {
10986
+ var child = _ref29.child;
10900
10987
  var themeColors = styled.useTheme();
10901
10988
  var location = reactRouterDom.useLocation();
10902
10989
  var active = getBasePath(location.pathname) === getBasePath(child.activeUrl) || getBasePath(location.pathname) === getBasePath(child.url);
@@ -10904,6 +10991,7 @@ var Sidebar = function Sidebar(_ref20) {
10904
10991
  if (child.url && child.url === location.pathname) {
10905
10992
  e.preventDefault();
10906
10993
  }
10994
+ closeMobileMenu();
10907
10995
  }, [child.url, location.pathname]);
10908
10996
  return React__default.createElement(SidebarLink, {
10909
10997
  to: child.url || '#',
@@ -10942,14 +11030,14 @@ var Sidebar = function Sidebar(_ref20) {
10942
11030
  });
10943
11031
  }));
10944
11032
  };
10945
- var SidebarItem = function SidebarItem(_ref23) {
10946
- var item = _ref23.item,
10947
- isActive = _ref23.isActive,
10948
- isOpen = _ref23.isOpen,
10949
- hasChildren = _ref23.hasChildren,
10950
- isExpanded = _ref23.isExpanded,
10951
- onToggle = _ref23.onToggle,
10952
- renderChildLinks = _ref23.renderChildLinks;
11033
+ var SidebarItem = function SidebarItem(_ref30) {
11034
+ var item = _ref30.item,
11035
+ isActive = _ref30.isActive,
11036
+ isOpen = _ref30.isOpen,
11037
+ hasChildren = _ref30.hasChildren,
11038
+ isExpanded = _ref30.isExpanded,
11039
+ onToggle = _ref30.onToggle,
11040
+ renderChildLinks = _ref30.renderChildLinks;
10953
11041
  var themeColors = styled.useTheme();
10954
11042
  var activeClass = isActive ? 'active' : '';
10955
11043
  var handleClick = React.useCallback(function () {
@@ -11014,6 +11102,7 @@ var Sidebar = function Sidebar(_ref20) {
11014
11102
  if (item.url === location.pathname) {
11015
11103
  e.preventDefault();
11016
11104
  }
11105
+ closeMobileMenu();
11017
11106
  }, [item.url]);
11018
11107
  return item.url ? React__default.createElement(SidebarLink, {
11019
11108
  to: item.url,
@@ -11046,6 +11135,7 @@ var Sidebar = function Sidebar(_ref20) {
11046
11135
  var sidebar = sidebarRef.current;
11047
11136
  if (!sidebar) return;
11048
11137
  if (typeof ResizeObserver === 'undefined') return;
11138
+ if (isMobile) return;
11049
11139
  var resizeObserver = new ResizeObserver(function (entries) {
11050
11140
  for (var _iterator = _createForOfIteratorHelperLoose(entries), _step; !(_step = _iterator()).done;) {
11051
11141
  var entry = _step.value;
@@ -11061,7 +11151,7 @@ var Sidebar = function Sidebar(_ref20) {
11061
11151
  return function () {
11062
11152
  resizeObserver.disconnect();
11063
11153
  };
11064
- }, [handleSidebarExpansion]);
11154
+ }, [handleSidebarExpansion, isMobile]);
11065
11155
  React.useEffect(function () {
11066
11156
  var updateBadgePositions = function updateBadgePositions() {
11067
11157
  content.forEach(function (item) {
@@ -11082,9 +11172,22 @@ var Sidebar = function Sidebar(_ref20) {
11082
11172
  window.removeEventListener('resize', updateBadgePositions);
11083
11173
  };
11084
11174
  }, [content, isExpanded, getTotalNotifications]);
11085
- return React__default.createElement(SidebarContainer, {
11175
+ var themeColors = styled.useTheme();
11176
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(HamburgerButton, {
11177
+ "$background": background,
11178
+ onClick: toggleMobileMenu,
11179
+ "aria-label": "Toggle menu"
11180
+ }, React__default.createElement(Icon, {
11181
+ icon: isMobileOpen ? 'X' : 'Hamburger',
11182
+ size: 24,
11183
+ color: themeColors.vms.text.white
11184
+ })), React__default.createElement(Overlay, {
11185
+ "$isOpen": isMobileOpen,
11186
+ onClick: handleOverlayClick
11187
+ }), React__default.createElement(SidebarContainer, {
11086
11188
  ref: sidebarRef,
11087
- "$background": background
11189
+ "$background": background,
11190
+ "$isMobileOpen": isMobileOpen
11088
11191
  }, React__default.createElement(Container, {
11089
11192
  "$flexDirection": 'column',
11090
11193
  "$gap": '28px',
@@ -11115,13 +11218,13 @@ var Sidebar = function Sidebar(_ref20) {
11115
11218
  isActive: active,
11116
11219
  isOpen: isOpen,
11117
11220
  hasChildren: hasChildren,
11118
- isExpanded: isExpanded,
11221
+ isExpanded: isMobile ? isMobileOpen : isExpanded,
11119
11222
  onToggle: function onToggle() {
11120
11223
  return toggleMenu(item.id);
11121
11224
  },
11122
11225
  renderChildLinks: renderChildLinks
11123
11226
  });
11124
- }))), ProfileContent);
11227
+ }))), ProfileContent));
11125
11228
  };
11126
11229
 
11127
11230
  var _templateObject$o, _templateObject2$k, _templateObject3$d, _templateObject4$a;
@@ -12347,6 +12450,7 @@ exports.formatDate = formatDate;
12347
12450
  exports.formatEpochToIST = formatEpochToIST;
12348
12451
  exports.formatTimestamp = formatTimestamp;
12349
12452
  exports.getCurrentTheme = getCurrentTheme;
12453
+ exports.getResponsiveFlags = getResponsiveFlags;
12350
12454
  exports.getSystemTimezoneAbbreviation = getSystemTimezoneAbbreviation;
12351
12455
  exports.themes = themes;
12352
12456
  exports.timeAgo = timeAgo;
@@ -12356,4 +12460,5 @@ exports.useCopyToClipboard = useCopyToClipboard;
12356
12460
  exports.useCustomModal = UseCustomModal;
12357
12461
  exports.useNotification = useNotification;
12358
12462
  exports.useTheme = useTheme;
12463
+ exports.useWindowSize = useWindowSize;
12359
12464
  //# sourceMappingURL=index.js.map