@thecb/components 7.0.2-beta.4 → 7.0.2-beta.5
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/package.json
CHANGED
|
@@ -37,25 +37,25 @@ const Copyable = ({
|
|
|
37
37
|
popoverMinWidth = "210px",
|
|
38
38
|
copiedPopoverContentDuration = 1000,
|
|
39
39
|
popoverID = 0,
|
|
40
|
-
extraStyles
|
|
40
|
+
extraStyles,
|
|
41
41
|
}) => {
|
|
42
42
|
const popoverPosition = {
|
|
43
43
|
top: "-65px",
|
|
44
44
|
right: "auto",
|
|
45
45
|
bottom: "auto",
|
|
46
|
-
left: "50%"
|
|
46
|
+
left: "50%",
|
|
47
47
|
};
|
|
48
48
|
const popoverArrowPosition = {
|
|
49
49
|
arrowTop: "auto",
|
|
50
50
|
arrowRight: "auto",
|
|
51
51
|
arrowBottom: "-8px",
|
|
52
|
-
arrowLeft: "calc(50% - 4px)" // Popover arrow is 8px wide. This places the middle of the arrow in the middle of the popover.
|
|
52
|
+
arrowLeft: "calc(50% - 4px)", // Popover arrow is 8px wide. This places the middle of the arrow in the middle of the popover.
|
|
53
53
|
};
|
|
54
54
|
const [popoverContent, setPopoverContent] = useState(initialPopoverContent);
|
|
55
55
|
const [timer, setTimer] = useState(undefined);
|
|
56
56
|
const onClick = () => {
|
|
57
57
|
setPopoverContent(copiedPopoverContent);
|
|
58
|
-
navigator.clipboard.writeText(text).catch(e => console.error(e));
|
|
58
|
+
navigator.clipboard.writeText(text).catch((e) => console.error(e));
|
|
59
59
|
onCopy?.();
|
|
60
60
|
if (timer) {
|
|
61
61
|
clearTimeout(timer);
|
|
@@ -73,7 +73,7 @@ const Copyable = ({
|
|
|
73
73
|
position={popoverPosition}
|
|
74
74
|
arrowPosition={popoverArrowPosition}
|
|
75
75
|
popoverID={popoverID}
|
|
76
|
-
extraStyles={`> button#btnPopover${popoverID} { margin: 0 }; #Disclosed${popoverID} { transform: translateX(-50%); }; ${extraStyles}`}
|
|
76
|
+
extraStyles={`> button#btnPopover${popoverID} { margin: 0 }; > #Disclosed${popoverID} { transform: translateX(-50%); }; ${extraStyles}`}
|
|
77
77
|
triggerText={CopyableText({ text, onClick })}
|
|
78
78
|
content={popoverContent}
|
|
79
79
|
></Popover>
|