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.
@@ -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) {
@@ -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