labsense-ui-kit 1.2.41 → 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 +28 -0
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +29 -2
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import useClickOutside from './useClickOutside';
|
|
2
|
+
import useCopyToClipboard from './useCopyToClipboard';
|
|
2
3
|
import useCustomModal from './useCustomModal';
|
|
3
4
|
import useNotification from './useNotification';
|
|
4
5
|
import useTheme from './useTheme';
|
|
5
|
-
export { useClickOutside, useCustomModal, useNotification, useTheme };
|
|
6
|
+
export { useClickOutside, useCopyToClipboard, useCustomModal, useNotification, useTheme };
|
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, useCustomModal, useNotification, useTheme } from './hooks';
|
|
8
|
+
import { useClickOutside, useCopyToClipboard, useCustomModal, useNotification, useTheme } from './hooks';
|
|
9
9
|
import { Icon, 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, useCustomModal, useNotification, useTheme };
|
|
27
|
+
export { useClickOutside, useCopyToClipboard, useCustomModal, useNotification, useTheme };
|
|
28
28
|
export { Icon, IconNames };
|
|
29
29
|
export { SearchBox, TextArea, TextField, TextFieldWithDropdown, CheckBox };
|
|
30
30
|
export { CircularLoader, Loader };
|
package/dist/index.js
CHANGED
|
@@ -4911,6 +4911,33 @@ var useClickOutside = function useClickOutside(elRef, elCallback) {
|
|
|
4911
4911
|
}, [elCallback, elRef]);
|
|
4912
4912
|
};
|
|
4913
4913
|
|
|
4914
|
+
var useCopyToClipboard = function useCopyToClipboard() {
|
|
4915
|
+
var copyToClipboard = React.useCallback(function (str) {
|
|
4916
|
+
var el = document.createElement('textarea');
|
|
4917
|
+
el.value = str;
|
|
4918
|
+
el.setAttribute('readonly', '');
|
|
4919
|
+
el.style.position = 'absolute';
|
|
4920
|
+
el.style.left = '-9999px';
|
|
4921
|
+
document.body.appendChild(el);
|
|
4922
|
+
var selection = document.getSelection();
|
|
4923
|
+
if (selection) {
|
|
4924
|
+
var selected = selection.rangeCount > 0 ? selection.getRangeAt(0) : false;
|
|
4925
|
+
el.select();
|
|
4926
|
+
var success = document.execCommand('copy');
|
|
4927
|
+
document.body.removeChild(el);
|
|
4928
|
+
if (selected) {
|
|
4929
|
+
selection.removeAllRanges();
|
|
4930
|
+
selection.addRange(selected);
|
|
4931
|
+
}
|
|
4932
|
+
return success;
|
|
4933
|
+
}
|
|
4934
|
+
return false;
|
|
4935
|
+
}, []);
|
|
4936
|
+
return {
|
|
4937
|
+
copyToClipboard: copyToClipboard
|
|
4938
|
+
};
|
|
4939
|
+
};
|
|
4940
|
+
|
|
4914
4941
|
var _templateObject, _templateObject2;
|
|
4915
4942
|
var ModalOverlay = styled__default.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"])));
|
|
4916
4943
|
var ModalContainer = styled__default.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) {
|
|
@@ -9604,6 +9631,7 @@ exports.themes = themes;
|
|
|
9604
9631
|
exports.timeAgo = timeAgo;
|
|
9605
9632
|
exports.timeStringToSeconds = timeStringToSeconds;
|
|
9606
9633
|
exports.useClickOutside = useClickOutside;
|
|
9634
|
+
exports.useCopyToClipboard = useCopyToClipboard;
|
|
9607
9635
|
exports.useCustomModal = useCustomModal;
|
|
9608
9636
|
exports.useNotification = useNotification;
|
|
9609
9637
|
exports.useTheme = useTheme;
|