labsense-ui-kit 1.4.56 → 1.4.58

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.
@@ -12549,7 +12549,7 @@ var SidebarContainer = styled.div(_templateObject3$c || (_templateObject3$c = _t
12549
12549
  var $isMobileOpen = _ref7.$isMobileOpen;
12550
12550
  return $isMobileOpen ? 'visible' : 'hidden';
12551
12551
  });
12552
- 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 /* Remove all transitions for instant color changes */\n * {\n transition: none !important;\n }\n\n /* Hover state */\n &:hover {\n color: ", ";\n background: ", ";\n \n /* Make icons white on hover */\n svg {\n color: ", " !important;\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 }\n }\n"])), function (_ref8) {
12552
+ 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 /* Remove all transitions for instant color changes */\n * {\n transition: none !important;\n }\n\n /* Hover / active / keyboard-focus share the same highlight, so the icon\n switches color together with the fill instead of the ring appearing alone */\n &:hover,\n &.active,\n &:focus-visible {\n color: ", ";\n background: ", ";\n\n svg {\n color: ", " !important;\n }\n }\n\n &:focus {\n outline: none;\n }\n\n /* text.dark tracks the sidebar's own surface (near-black on the light\n theme, white on the dark theme) so the ring stays visible in both,\n unlike text.white which is calibrated for text sitting on the primary fill */\n &:focus-visible {\n box-shadow: inset 0 0 0 2px ", ";\n }\n"])), function (_ref8) {
12553
12553
  var $padding = _ref8.$padding;
12554
12554
  return $padding;
12555
12555
  }, function (_ref9) {
@@ -12566,20 +12566,20 @@ var SidebarLink = styled(NavLink)(_templateObject4$9 || (_templateObject4$9 = _t
12566
12566
  return theme.vms.text.white;
12567
12567
  }, function (_ref13) {
12568
12568
  var theme = _ref13.theme;
12569
- return theme.vms.text.white;
12570
- }, function (_ref14) {
12571
- var theme = _ref14.theme;
12572
- return theme.vms["default"].primary;
12573
- }, function (_ref15) {
12574
- var theme = _ref15.theme;
12575
- return theme.vms.text.white;
12569
+ return theme.vms.text.dark;
12576
12570
  });
12577
- 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\n /* Ensure icons inherit hover color from parent */\n svg {\n transition: none;\n }\n"])), function (_ref16) {
12578
- var $selected = _ref16.$selected,
12579
- theme = _ref16.theme;
12571
+ 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\n /* Ensure icons inherit hover color from parent */\n svg {\n transition: none;\n }\n"])), function (_ref14) {
12572
+ var $selected = _ref14.$selected,
12573
+ theme = _ref14.theme;
12580
12574
  return $selected ? theme.vms["default"].primary : theme.vms["default"].tertiary;
12581
12575
  });
12582
- 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 (_ref17) {
12576
+ var StyledContainer = styled(Container)(_templateObject6$8 || (_templateObject6$8 = _taggedTemplateLiteralLoose(["\n transition: none;\n\n svg {\n transition: none;\n }\n\n /* Parent hover / active / keyboard-focus (for rows with no url of their\n own - see the tabIndex added in SidebarItem) */\n &:hover,\n &.active,\n &:focus-visible {\n svg {\n color: ", " !important;\n }\n }\n\n /* 2nd child reacts ONLY when parent is hovered or keyboard-focused */\n &:hover > div:nth-child(2),\n &:focus-visible > 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\n &:focus {\n outline: none;\n }\n\n /* Same fill + ring treatment as SidebarLink, for rows made keyboard-focusable below */\n &:focus-visible {\n background: ", ";\n color: ", ";\n box-shadow: inset 0 0 0 2px ", ";\n }\n"])), function (_ref15) {
12577
+ var theme = _ref15.theme;
12578
+ return theme.vms.text.white;
12579
+ }, function (_ref16) {
12580
+ var theme = _ref16.theme;
12581
+ return theme.vms.text.white;
12582
+ }, function (_ref17) {
12583
12583
  var theme = _ref17.theme;
12584
12584
  return theme.vms.text.white;
12585
12585
  }, function (_ref18) {
@@ -12587,37 +12587,40 @@ var StyledContainer = styled(Container)(_templateObject6$8 || (_templateObject6$
12587
12587
  return theme.vms.text.white;
12588
12588
  }, function (_ref19) {
12589
12589
  var theme = _ref19.theme;
12590
- return theme.vms.text.white;
12590
+ return theme.vms.text.medium;
12591
12591
  }, function (_ref20) {
12592
12592
  var theme = _ref20.theme;
12593
- return theme.vms.text.white;
12593
+ return theme.vms["default"].primary;
12594
12594
  }, function (_ref21) {
12595
12595
  var theme = _ref21.theme;
12596
- return theme.vms.text.medium;
12596
+ return theme.vms.text.white;
12597
+ }, function (_ref22) {
12598
+ var theme = _ref22.theme;
12599
+ return theme.vms.text.dark;
12597
12600
  });
12598
12601
  var Logo = styled(Container)(_templateObject7$6 || (_templateObject7$6 = _taggedTemplateLiteralLoose(["\n transition: none;\n display: flex;\n width: 100%;\n min-width: max-content;\n align-items: center;\n justify-content: center;\n gap: 10px;\n"])));
12599
- 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: opacity 0.3s ease, visibility 0.3s ease, transform 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 (_ref22) {
12600
- var $padding = _ref22.$padding;
12602
+ 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: opacity 0.3s ease, visibility 0.3s ease, transform 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) {
12603
+ var $padding = _ref23.$padding;
12601
12604
  return $padding;
12602
- }, function (_ref23) {
12603
- var $fontSize = _ref23.$fontSize;
12604
- return $fontSize || '20px';
12605
12605
  }, function (_ref24) {
12606
- var $fontWeight = _ref24.$fontWeight;
12606
+ var $fontSize = _ref24.$fontSize;
12607
+ return $fontSize || '20px';
12608
+ }, function (_ref25) {
12609
+ var $fontWeight = _ref25.$fontWeight;
12607
12610
  return $fontWeight || '500';
12608
12611
  }, SidebarContainer, MOBILE_BREAKPOINT);
12609
- var NotificationBadge = styled.div(_templateObject9$4 || (_templateObject9$4 = _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 (_ref25) {
12610
- var $position = _ref25.$position;
12612
+ var NotificationBadge = styled.div(_templateObject9$4 || (_templateObject9$4 = _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) {
12613
+ var $position = _ref26.$position;
12611
12614
  return $position || 'absolute';
12612
12615
  });
12613
- var Sidebar = function Sidebar(_ref26) {
12614
- var logo = _ref26.logo,
12615
- content = _ref26.content,
12616
- background = _ref26.background,
12617
- ProfileContent = _ref26.ProfileContent,
12618
- _ref26$isExpanded = _ref26.isExpanded,
12619
- isExpanded = _ref26$isExpanded === void 0 ? false : _ref26$isExpanded,
12620
- setIsExpanded = _ref26.setIsExpanded;
12616
+ var Sidebar = function Sidebar(_ref27) {
12617
+ var logo = _ref27.logo,
12618
+ content = _ref27.content,
12619
+ background = _ref27.background,
12620
+ ProfileContent = _ref27.ProfileContent,
12621
+ _ref27$isExpanded = _ref27.isExpanded,
12622
+ isExpanded = _ref27$isExpanded === void 0 ? false : _ref27$isExpanded,
12623
+ setIsExpanded = _ref27.setIsExpanded;
12621
12624
  var location = useLocation();
12622
12625
  var _useState = useState({}),
12623
12626
  openMenus = _useState[0],
@@ -12682,9 +12685,9 @@ var Sidebar = function Sidebar(_ref26) {
12682
12685
  }, []);
12683
12686
  var toggleMenu = function toggleMenu(id) {
12684
12687
  setOpenMenus(function (prev) {
12685
- var _ref27;
12688
+ var _ref28;
12686
12689
  var isCurrentlyOpen = !!prev[id];
12687
- return isCurrentlyOpen ? {} : (_ref27 = {}, _ref27[id] = true, _ref27);
12690
+ return isCurrentlyOpen ? {} : (_ref28 = {}, _ref28[id] = true, _ref28);
12688
12691
  });
12689
12692
  };
12690
12693
  var getTotalNotifications = useCallback(function (item) {
@@ -12709,8 +12712,8 @@ var Sidebar = function Sidebar(_ref26) {
12709
12712
  return currentBase === getBasePath(child.activeUrl) || currentBase === getBasePath(child.url);
12710
12713
  }));
12711
12714
  };
12712
- var ChildLink = function ChildLink(_ref28) {
12713
- var child = _ref28.child;
12715
+ var ChildLink = function ChildLink(_ref29) {
12716
+ var child = _ref29.child;
12714
12717
  var location = useLocation();
12715
12718
  var active = getBasePath(location.pathname) === getBasePath(child.activeUrl) || getBasePath(location.pathname) === getBasePath(child.url);
12716
12719
  var handleClick = useCallback(function (e) {
@@ -12757,14 +12760,14 @@ var Sidebar = function Sidebar(_ref26) {
12757
12760
  });
12758
12761
  }));
12759
12762
  };
12760
- var SidebarItem = function SidebarItem(_ref29) {
12761
- var item = _ref29.item,
12762
- isActive = _ref29.isActive,
12763
- isOpen = _ref29.isOpen,
12764
- hasChildren = _ref29.hasChildren,
12765
- isExpanded = _ref29.isExpanded,
12766
- onToggle = _ref29.onToggle,
12767
- renderChildLinks = _ref29.renderChildLinks;
12763
+ var SidebarItem = function SidebarItem(_ref30) {
12764
+ var item = _ref30.item,
12765
+ isActive = _ref30.isActive,
12766
+ isOpen = _ref30.isOpen,
12767
+ hasChildren = _ref30.hasChildren,
12768
+ isExpanded = _ref30.isExpanded,
12769
+ onToggle = _ref30.onToggle,
12770
+ renderChildLinks = _ref30.renderChildLinks;
12768
12771
  var themeColors = useTheme$1();
12769
12772
  var activeClass = isActive ? 'active' : '';
12770
12773
  var handleClick = useCallback(function () {
@@ -12772,6 +12775,7 @@ var Sidebar = function Sidebar(_ref26) {
12772
12775
  onToggle();
12773
12776
  }
12774
12777
  }, [hasChildren, onToggle]);
12778
+ var isOwnFocusTarget = !item.url && hasChildren;
12775
12779
  var ContentLayout = React.createElement(StyledContainer, {
12776
12780
  className: activeClass,
12777
12781
  "$alignItems": 'center',
@@ -12781,7 +12785,16 @@ var Sidebar = function Sidebar(_ref26) {
12781
12785
  "$borderRadius": '4px',
12782
12786
  "$justifyContent": 'space-between',
12783
12787
  "$hoverBackground": themeColors.vms["default"].primary,
12784
- onClick: handleClick
12788
+ onClick: handleClick,
12789
+ role: isOwnFocusTarget ? 'button' : undefined,
12790
+ tabIndex: isOwnFocusTarget ? 0 : undefined,
12791
+ "aria-expanded": isOwnFocusTarget ? isOpen : undefined,
12792
+ onKeyDown: isOwnFocusTarget ? function (e) {
12793
+ if (e.key === 'Enter' || e.key === ' ') {
12794
+ e.preventDefault();
12795
+ handleClick();
12796
+ }
12797
+ } : undefined
12785
12798
  }, React.createElement(Container, {
12786
12799
  "$alignItems": 'center',
12787
12800
  "$gap": '8px',
@@ -13407,7 +13420,7 @@ var FirstContainer = styled.div(_templateObject2$m || (_templateObject2$m = _tag
13407
13420
  var $headerPadding = _ref6.$headerPadding;
13408
13421
  return $headerPadding ? $headerPadding : '0px';
13409
13422
  });
13410
- var TabContainer = styled.div(_templateObject3$f || (_templateObject3$f = _taggedTemplateLiteralLoose(["\n width: auto;\n display: flex;\n align-items: center;\n cursor: ", ";\n opacity: ", ";\n gap: 8px;\n font-size: 14px;\n font-weight: 500;\n color: ", ";\n height: ", ";\n\n svg {\n cursor: ", ";\n }\n\n"])), function (_ref7) {
13423
+ var TabContainer = styled.div(_templateObject3$f || (_templateObject3$f = _taggedTemplateLiteralLoose(["\n width: auto;\n display: flex;\n align-items: center;\n cursor: ", ";\n opacity: ", ";\n gap: 8px;\n font-size: 14px;\n font-weight: 500;\n color: ", ";\n height: ", ";\n\n svg {\n cursor: ", ";\n }\n\n &:focus {\n outline: none;\n }\n\n &:focus-visible {\n height: 35px;\n max-height: 35px;\n border-radius: 4px;\n box-shadow: 0 0 0 2px ", ";\n\n div {\n font-size: 12px;\n }\n }\n"])), function (_ref7) {
13411
13424
  var $disabled = _ref7.$disabled;
13412
13425
  return $disabled ? 'not-allowed' : 'pointer';
13413
13426
  }, function (_ref8) {
@@ -13422,36 +13435,39 @@ var TabContainer = styled.div(_templateObject3$f || (_templateObject3$f = _tagge
13422
13435
  }, function (_ref11) {
13423
13436
  var $disabled = _ref11.$disabled;
13424
13437
  return $disabled ? 'not-allowed' : 'pointer';
13438
+ }, function (_ref12) {
13439
+ var theme = _ref12.theme;
13440
+ return theme.vms["default"].primary;
13425
13441
  });
13426
- var TabItemContainer = styled.div(_templateObject4$c || (_templateObject4$c = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n position: relative;\n gap: 8px;\n height: 100%;\n max-height: ", ";\n\n &:after {\n content: '';\n display: ", ";\n width: 100%;\n min-height: 3px;\n background: ", ";\n position: absolute;\n bottom: -1px;\n left: 0px;\n }\n"])), function (_ref12) {
13427
- var $headerHeight = _ref12.$headerHeight;
13442
+ var TabItemContainer = styled.div(_templateObject4$c || (_templateObject4$c = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n position: relative;\n gap: 8px;\n height: 100%;\n max-height: ", ";\n\n &:after {\n content: '';\n display: ", ";\n width: 100%;\n min-height: 3px;\n background: ", ";\n position: absolute;\n bottom: -1px;\n left: 0px;\n }\n"])), function (_ref13) {
13443
+ var $headerHeight = _ref13.$headerHeight;
13428
13444
  return $headerHeight ? $headerHeight : '34px';
13429
13445
  }, function (props) {
13430
13446
  return props.$active ? 'block' : 'none';
13431
- }, function (_ref13) {
13432
- var theme = _ref13.theme;
13447
+ }, function (_ref14) {
13448
+ var theme = _ref14.theme;
13433
13449
  return theme.vms["default"].primary;
13434
13450
  });
13435
- var DetailsFirstContainer = styled.div(_templateObject5$a || (_templateObject5$a = _taggedTemplateLiteralLoose(["\n text-align: center;\n font-size: 14px;\n line-height: 18px;\n font-weight: 500;\n height: 100%;\n display: flex;\n align-items: center;\n color: ", ";\n white-space: nowrap;\n"])), function (_ref14) {
13436
- var $active = _ref14.$active,
13437
- theme = _ref14.theme;
13451
+ var DetailsFirstContainer = styled.div(_templateObject5$a || (_templateObject5$a = _taggedTemplateLiteralLoose(["\n text-align: center;\n font-size: 14px;\n line-height: 18px;\n font-weight: 500;\n height: 100%;\n display: flex;\n align-items: center;\n color: ", ";\n white-space: nowrap;\n"])), function (_ref15) {
13452
+ var $active = _ref15.$active,
13453
+ theme = _ref15.theme;
13438
13454
  return $active ? theme.vms["default"].primary : theme.vms.text.medium;
13439
13455
  });
13440
13456
  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"])));
13441
- var Tabs = function Tabs(_ref15) {
13442
- var tabItems = _ref15.tabItems,
13443
- _ref15$disabled = _ref15.disabled,
13444
- disabled = _ref15$disabled === void 0 ? false : _ref15$disabled,
13445
- headerHeight = _ref15.headerHeight,
13446
- headerPadding = _ref15.headerPadding,
13447
- activeTab = _ref15.activeTab,
13448
- border = _ref15.border,
13449
- _ref15$gap = _ref15.gap,
13450
- gap = _ref15$gap === void 0 ? '24px' : _ref15$gap,
13451
- overflow = _ref15.overflow,
13452
- scrollbarWidth = _ref15.scrollbarWidth,
13453
- bordeBottom = _ref15.bordeBottom,
13454
- tabRightNode = _ref15.tabRightNode;
13457
+ var Tabs = function Tabs(_ref16) {
13458
+ var tabItems = _ref16.tabItems,
13459
+ _ref16$disabled = _ref16.disabled,
13460
+ disabled = _ref16$disabled === void 0 ? false : _ref16$disabled,
13461
+ headerHeight = _ref16.headerHeight,
13462
+ headerPadding = _ref16.headerPadding,
13463
+ activeTab = _ref16.activeTab,
13464
+ border = _ref16.border,
13465
+ _ref16$gap = _ref16.gap,
13466
+ gap = _ref16$gap === void 0 ? '24px' : _ref16$gap,
13467
+ overflow = _ref16.overflow,
13468
+ scrollbarWidth = _ref16.scrollbarWidth,
13469
+ bordeBottom = _ref16.bordeBottom,
13470
+ tabRightNode = _ref16.tabRightNode;
13455
13471
  var themeColors = useTheme();
13456
13472
  return React.createElement(Container$4, {
13457
13473
  "$gap": gap,