labsense-ui-kit 1.2.40 → 1.2.42
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/hooks/index.d.ts +2 -1
- package/dist/hooks/useCopyToClipboard.d.ts +4 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +32 -4
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +33 -6
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useRef, useEffect, useState, useId } from 'react';
|
|
1
|
+
import React, { useRef, useEffect, useCallback, useState, useId } from 'react';
|
|
2
2
|
import styled, { useTheme as useTheme$1, css, keyframes, styled as styled$1 } from 'styled-components';
|
|
3
3
|
import { toast } from 'react-hot-toast';
|
|
4
4
|
import { useNavigate, NavLink, useLocation } from 'react-router-dom';
|
|
@@ -4907,6 +4907,33 @@ var useClickOutside = function useClickOutside(elRef, elCallback) {
|
|
|
4907
4907
|
}, [elCallback, elRef]);
|
|
4908
4908
|
};
|
|
4909
4909
|
|
|
4910
|
+
var useCopyToClipboard = function useCopyToClipboard() {
|
|
4911
|
+
var copyToClipboard = useCallback(function (str) {
|
|
4912
|
+
var el = document.createElement('textarea');
|
|
4913
|
+
el.value = str;
|
|
4914
|
+
el.setAttribute('readonly', '');
|
|
4915
|
+
el.style.position = 'absolute';
|
|
4916
|
+
el.style.left = '-9999px';
|
|
4917
|
+
document.body.appendChild(el);
|
|
4918
|
+
var selection = document.getSelection();
|
|
4919
|
+
if (selection) {
|
|
4920
|
+
var selected = selection.rangeCount > 0 ? selection.getRangeAt(0) : false;
|
|
4921
|
+
el.select();
|
|
4922
|
+
var success = document.execCommand('copy');
|
|
4923
|
+
document.body.removeChild(el);
|
|
4924
|
+
if (selected) {
|
|
4925
|
+
selection.removeAllRanges();
|
|
4926
|
+
selection.addRange(selected);
|
|
4927
|
+
}
|
|
4928
|
+
return success;
|
|
4929
|
+
}
|
|
4930
|
+
return false;
|
|
4931
|
+
}, []);
|
|
4932
|
+
return {
|
|
4933
|
+
copyToClipboard: copyToClipboard
|
|
4934
|
+
};
|
|
4935
|
+
};
|
|
4936
|
+
|
|
4910
4937
|
var _templateObject, _templateObject2;
|
|
4911
4938
|
var ModalOverlay = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n font-family: NotoSans, sans-serif;\n z-index: 9999;\n backdrop-filter: blur(4px);\n"])));
|
|
4912
4939
|
var ModalContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n background: ", ";\n box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n max-height: 100vh;\n max-width: ", ";\n overflow: visible;\n"])), function (_ref) {
|
|
@@ -5986,8 +6013,8 @@ var StyledButton = styled.button(_templateObject5$1 || (_templateObject5$1 = _ta
|
|
|
5986
6013
|
return '';
|
|
5987
6014
|
}
|
|
5988
6015
|
}, function (_ref16) {
|
|
5989
|
-
var color = _ref16
|
|
5990
|
-
return color;
|
|
6016
|
+
var $color = _ref16.$color;
|
|
6017
|
+
return $color;
|
|
5991
6018
|
});
|
|
5992
6019
|
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
6020
|
var $fontFamily = _ref17.$fontFamily;
|
|
@@ -8967,7 +8994,7 @@ var Sidebar = function Sidebar(_ref16) {
|
|
|
8967
8994
|
"$color": themeColors.text.medium
|
|
8968
8995
|
}, child.label), _getTotalNotifications(child) > 0 && React.createElement(NotificationBadge, {
|
|
8969
8996
|
"$position": 'unset'
|
|
8970
|
-
}, _getTotalNotifications(child))));
|
|
8997
|
+
}, _getTotalNotifications(child) > 99 ? '99+' : _getTotalNotifications(child))));
|
|
8971
8998
|
});
|
|
8972
8999
|
var renderChildLinks = function renderChildLinks(children) {
|
|
8973
9000
|
return React.createElement(Container, {
|
|
@@ -9026,7 +9053,7 @@ var Sidebar = function Sidebar(_ref16) {
|
|
|
9026
9053
|
size: 20,
|
|
9027
9054
|
weight: item.iconWeight,
|
|
9028
9055
|
color: isHovered || isActive ? themeColors.text.white : themeColors.text.medium
|
|
9029
|
-
})), _getTotalNotifications(item) > 0 && React.createElement(NotificationBadge, null, _getTotalNotifications(item))), React.createElement(TextContainer, {
|
|
9056
|
+
})), _getTotalNotifications(item) > 0 && React.createElement(NotificationBadge, null, _getTotalNotifications(item) > 99 ? '99+' : _getTotalNotifications(item))), React.createElement(TextContainer, {
|
|
9030
9057
|
"$isExpanded": isExpanded,
|
|
9031
9058
|
"$fontSize": '14px'
|
|
9032
9059
|
}, item.label)), hasChildren && React.createElement(Container, {
|
|
@@ -9555,5 +9582,5 @@ var InternalTabs = function InternalTabs(_ref) {
|
|
|
9555
9582
|
}));
|
|
9556
9583
|
};
|
|
9557
9584
|
|
|
9558
|
-
export { Badge, Breadcrumbs, ButtonComponent as Button, ButtonCarousel, ButtonDropdown, CheckBox, CircularLoader, CircularProgress, Container, DatePicker, DropdownMenu$1 as DropdownMenu, Icon, IconTooltip, InternalTabs, Loader, MultiSelectDropdown, OptionComponent, Options, Pagination, ProgressBar, SearchBox, SelectOption, SelectedOption, Sidebar, Span, Table, TableCell, TableRow, Tabs, TextArea, TextField, TextFieldWithDropdown, convertEpochToDateString, convertEpochToOnlyDate, convertToEpoch, formatCalendarDateTime, formatDate, formatEpochToIST, formatTimestamp, getCurrentTheme, getSystemTimezoneAbbreviation, themes, timeAgo, timeStringToSeconds, useClickOutside, useCustomModal, useNotification, useTheme };
|
|
9585
|
+
export { Badge, Breadcrumbs, ButtonComponent as Button, ButtonCarousel, ButtonDropdown, CheckBox, CircularLoader, CircularProgress, Container, DatePicker, DropdownMenu$1 as DropdownMenu, Icon, IconTooltip, InternalTabs, Loader, MultiSelectDropdown, OptionComponent, Options, Pagination, ProgressBar, SearchBox, SelectOption, SelectedOption, Sidebar, Span, Table, TableCell, TableRow, Tabs, TextArea, TextField, TextFieldWithDropdown, convertEpochToDateString, convertEpochToOnlyDate, convertToEpoch, formatCalendarDateTime, formatDate, formatEpochToIST, formatTimestamp, getCurrentTheme, getSystemTimezoneAbbreviation, themes, timeAgo, timeStringToSeconds, useClickOutside, useCopyToClipboard, useCustomModal, useNotification, useTheme };
|
|
9559
9586
|
//# sourceMappingURL=index.modern.js.map
|