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 +59 -44
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +59 -44
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -8778,7 +8778,7 @@ var SidebarContainer = styled.div(_templateObject$n || (_templateObject$n = _tag
|
|
|
8778
8778
|
theme = _ref3.theme;
|
|
8779
8779
|
return $background || theme.vms.accent.softBlue;
|
|
8780
8780
|
});
|
|
8781
|
-
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.1s cubic-bezier(0.4, 0, 0.2, 1);\n padding: ", ";\n color: ", ";\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n"])), function (_ref4) {
|
|
8781
|
+
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.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) {
|
|
8782
8782
|
var $padding = _ref4.$padding;
|
|
8783
8783
|
return $padding;
|
|
8784
8784
|
}, function (_ref5) {
|
|
@@ -8790,44 +8790,50 @@ var SidebarLink = styled(NavLink)(_templateObject2$j || (_templateObject2$j = _t
|
|
|
8790
8790
|
}, function (_ref7) {
|
|
8791
8791
|
var theme = _ref7.theme;
|
|
8792
8792
|
return theme.vms["default"].primary;
|
|
8793
|
+
}, function (_ref8) {
|
|
8794
|
+
var theme = _ref8.theme;
|
|
8795
|
+
return theme.vms.text.white;
|
|
8796
|
+
}, function (_ref9) {
|
|
8797
|
+
var theme = _ref9.theme;
|
|
8798
|
+
return theme.vms["default"].primary;
|
|
8793
8799
|
});
|
|
8794
|
-
var IconWrapper$2 = styled.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 (
|
|
8795
|
-
var $selected =
|
|
8796
|
-
theme =
|
|
8800
|
+
var IconWrapper$2 = styled.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) {
|
|
8801
|
+
var $selected = _ref10.$selected,
|
|
8802
|
+
theme = _ref10.theme;
|
|
8797
8803
|
return $selected ? theme.vms["default"].primary : theme.vms["default"].tertiary;
|
|
8798
8804
|
});
|
|
8799
8805
|
var Logo = styled.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"])));
|
|
8800
|
-
var TextContainer = styled.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 (
|
|
8801
|
-
var $padding =
|
|
8806
|
+
var TextContainer = styled.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) {
|
|
8807
|
+
var $padding = _ref11.$padding;
|
|
8802
8808
|
return $padding;
|
|
8803
|
-
}, function (_ref10) {
|
|
8804
|
-
var $fontSize = _ref10.$fontSize;
|
|
8805
|
-
return $fontSize || '20px';
|
|
8806
|
-
}, function (_ref11) {
|
|
8807
|
-
var $fontWeight = _ref11.$fontWeight;
|
|
8808
|
-
return $fontWeight || '500';
|
|
8809
8809
|
}, function (_ref12) {
|
|
8810
|
-
var $
|
|
8811
|
-
return $
|
|
8810
|
+
var $fontSize = _ref12.$fontSize;
|
|
8811
|
+
return $fontSize || '20px';
|
|
8812
8812
|
}, function (_ref13) {
|
|
8813
|
-
var $
|
|
8814
|
-
return $
|
|
8813
|
+
var $fontWeight = _ref13.$fontWeight;
|
|
8814
|
+
return $fontWeight || '500';
|
|
8815
8815
|
}, function (_ref14) {
|
|
8816
8816
|
var $isExpanded = _ref14.$isExpanded;
|
|
8817
|
+
return $isExpanded ? 1 : 0;
|
|
8818
|
+
}, function (_ref15) {
|
|
8819
|
+
var $isExpanded = _ref15.$isExpanded;
|
|
8820
|
+
return $isExpanded ? 'visible' : 'hidden';
|
|
8821
|
+
}, function (_ref16) {
|
|
8822
|
+
var $isExpanded = _ref16.$isExpanded;
|
|
8817
8823
|
return $isExpanded ? 'translateX(0)' : 'translateX(-10px)';
|
|
8818
8824
|
});
|
|
8819
|
-
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 (
|
|
8820
|
-
var $position =
|
|
8825
|
+
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 (_ref17) {
|
|
8826
|
+
var $position = _ref17.$position;
|
|
8821
8827
|
return $position || 'absolute';
|
|
8822
8828
|
});
|
|
8823
|
-
var Sidebar = function Sidebar(
|
|
8824
|
-
var logo =
|
|
8825
|
-
content =
|
|
8826
|
-
background =
|
|
8827
|
-
ProfileContent =
|
|
8828
|
-
|
|
8829
|
-
isExpanded =
|
|
8830
|
-
setIsExpanded =
|
|
8829
|
+
var Sidebar = function Sidebar(_ref18) {
|
|
8830
|
+
var logo = _ref18.logo,
|
|
8831
|
+
content = _ref18.content,
|
|
8832
|
+
background = _ref18.background,
|
|
8833
|
+
ProfileContent = _ref18.ProfileContent,
|
|
8834
|
+
_ref18$isExpanded = _ref18.isExpanded,
|
|
8835
|
+
isExpanded = _ref18$isExpanded === void 0 ? false : _ref18$isExpanded,
|
|
8836
|
+
setIsExpanded = _ref18.setIsExpanded;
|
|
8831
8837
|
var location = useLocation();
|
|
8832
8838
|
var _useState = useState({}),
|
|
8833
8839
|
openMenus = _useState[0],
|
|
@@ -8863,9 +8869,9 @@ var Sidebar = function Sidebar(_ref16) {
|
|
|
8863
8869
|
return currentBase === getBasePath(child.activeUrl) || currentBase === getBasePath(child.url);
|
|
8864
8870
|
}));
|
|
8865
8871
|
};
|
|
8866
|
-
var ChildLink = React.memo(function (
|
|
8867
|
-
var child =
|
|
8868
|
-
isExpanded =
|
|
8872
|
+
var ChildLink = React.memo(function (_ref19) {
|
|
8873
|
+
var child = _ref19.child,
|
|
8874
|
+
isExpanded = _ref19.isExpanded;
|
|
8869
8875
|
var themeColors = useTheme$1();
|
|
8870
8876
|
var location = useLocation();
|
|
8871
8877
|
var active = getBasePath(location.pathname) === getBasePath(child.activeUrl) || getBasePath(location.pathname) === getBasePath(child.url);
|
|
@@ -8875,28 +8881,32 @@ var Sidebar = function Sidebar(_ref16) {
|
|
|
8875
8881
|
return React.createElement(SidebarLink, {
|
|
8876
8882
|
to: child.url || '#',
|
|
8877
8883
|
key: child.id,
|
|
8884
|
+
"$padding": '0px 10px 0px 0px',
|
|
8885
|
+
onClick: function onClick(e) {
|
|
8886
|
+
if (child.url && child.url === location.pathname) {
|
|
8887
|
+
e.preventDefault();
|
|
8888
|
+
}
|
|
8889
|
+
},
|
|
8878
8890
|
onMouseEnter: function onMouseEnter() {
|
|
8879
8891
|
return setIsHovered(true);
|
|
8880
8892
|
},
|
|
8881
8893
|
onMouseLeave: function onMouseLeave() {
|
|
8882
8894
|
return setIsHovered(false);
|
|
8883
|
-
}
|
|
8884
|
-
"$padding": '0px 10px 0px 0px'
|
|
8895
|
+
}
|
|
8885
8896
|
}, React.createElement(IconWrapper$2, {
|
|
8886
8897
|
"$selected": active
|
|
8887
8898
|
}, React.createElement(Icon, {
|
|
8888
8899
|
icon: child.icon,
|
|
8889
8900
|
size: 18,
|
|
8890
8901
|
weight: child.iconWeight,
|
|
8891
|
-
color:
|
|
8902
|
+
color: active || isHovered ? themeColors.vms.text.white : themeColors.vms.text.medium
|
|
8892
8903
|
})), React.createElement(Container, {
|
|
8893
8904
|
"$width": '100%',
|
|
8894
8905
|
"$justifyContent": 'space-between',
|
|
8895
8906
|
"$gap": '5px'
|
|
8896
8907
|
}, React.createElement(TextContainer, {
|
|
8897
8908
|
"$isExpanded": isExpanded,
|
|
8898
|
-
"$fontSize": '12px'
|
|
8899
|
-
"$color": themeColors.vms.text.medium
|
|
8909
|
+
"$fontSize": '12px'
|
|
8900
8910
|
}, child.label), _getTotalNotifications(child) > 0 && React.createElement(NotificationBadge, {
|
|
8901
8911
|
"$position": 'unset'
|
|
8902
8912
|
}, _getTotalNotifications(child) > 99 ? '99+' : _getTotalNotifications(child))));
|
|
@@ -8914,14 +8924,14 @@ var Sidebar = function Sidebar(_ref16) {
|
|
|
8914
8924
|
});
|
|
8915
8925
|
}));
|
|
8916
8926
|
};
|
|
8917
|
-
var SidebarItem =
|
|
8918
|
-
var item =
|
|
8919
|
-
isActive =
|
|
8920
|
-
isOpen =
|
|
8921
|
-
hasChildren =
|
|
8922
|
-
isExpanded =
|
|
8923
|
-
onToggle =
|
|
8924
|
-
renderChildLinks =
|
|
8927
|
+
var SidebarItem = function SidebarItem(_ref20) {
|
|
8928
|
+
var item = _ref20.item,
|
|
8929
|
+
isActive = _ref20.isActive,
|
|
8930
|
+
isOpen = _ref20.isOpen,
|
|
8931
|
+
hasChildren = _ref20.hasChildren,
|
|
8932
|
+
isExpanded = _ref20.isExpanded,
|
|
8933
|
+
onToggle = _ref20.onToggle,
|
|
8934
|
+
renderChildLinks = _ref20.renderChildLinks;
|
|
8925
8935
|
var themeColors = useTheme$1();
|
|
8926
8936
|
var _useState3 = useState(false),
|
|
8927
8937
|
isHovered = _useState3[0],
|
|
@@ -8971,7 +8981,12 @@ var Sidebar = function Sidebar(_ref16) {
|
|
|
8971
8981
|
cursor: 'pointer'
|
|
8972
8982
|
})));
|
|
8973
8983
|
return item.url ? React.createElement(SidebarLink, {
|
|
8974
|
-
to: item.url
|
|
8984
|
+
to: item.url,
|
|
8985
|
+
onClick: function onClick(e) {
|
|
8986
|
+
if (item.url === location.pathname) {
|
|
8987
|
+
e.preventDefault();
|
|
8988
|
+
}
|
|
8989
|
+
}
|
|
8975
8990
|
}, ContentLayout) : React.createElement(Container, {
|
|
8976
8991
|
"$flexDirection": 'column',
|
|
8977
8992
|
"$alignItems": 'start',
|
|
@@ -8982,7 +8997,7 @@ var Sidebar = function Sidebar(_ref16) {
|
|
|
8982
8997
|
"$hoverColor": themeColors.vms.text.white,
|
|
8983
8998
|
"$width": '100%'
|
|
8984
8999
|
}, ContentLayout), hasChildren && isExpanded && isOpen && renderChildLinks && React.createElement(Container, null, renderChildLinks(item.children)));
|
|
8985
|
-
}
|
|
9000
|
+
};
|
|
8986
9001
|
return React.createElement(SidebarContainer, {
|
|
8987
9002
|
"$background": background,
|
|
8988
9003
|
"$isExpanded": isExpanded,
|