@thecb/components 7.0.2-beta.8 → 7.0.2
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
|
@@ -126,7 +126,7 @@ const CollapsibleSection = ({
|
|
|
126
126
|
initial={initiallyOpen ? "open" : "closed"}
|
|
127
127
|
exit="closed"
|
|
128
128
|
variants={wrapper}
|
|
129
|
-
extraStyles={`transform-origin: 100% 0; overflow-y: hidden
|
|
129
|
+
extraStyles={`transform-origin: 100% 0; overflow-y: hidden;`}
|
|
130
130
|
id={`${id}-content`}
|
|
131
131
|
role={"region"}
|
|
132
132
|
aria-labelledby={`${id}-button`}
|
|
@@ -48,7 +48,7 @@ const Copyable = ({
|
|
|
48
48
|
hasPopover = true,
|
|
49
49
|
popoverMinWidth = "max-content",
|
|
50
50
|
popoverID = 0,
|
|
51
|
-
popoverExtraStyles
|
|
51
|
+
popoverExtraStyles
|
|
52
52
|
}) => {
|
|
53
53
|
const [popoverContent, setPopoverContent] = useState(initialPopoverContent);
|
|
54
54
|
const [startTimer, setStartTimer] = useState(false);
|
|
@@ -57,7 +57,6 @@ const Copyable = ({
|
|
|
57
57
|
|
|
58
58
|
const cleanup = () => {
|
|
59
59
|
if (timeoutId) {
|
|
60
|
-
// console.log(`Clearing timeout ${timeoutId}`);
|
|
61
60
|
clearTimeout(timeoutId);
|
|
62
61
|
}
|
|
63
62
|
};
|
|
@@ -70,10 +69,8 @@ const Copyable = ({
|
|
|
70
69
|
}
|
|
71
70
|
// Start a timeout to restore popover content to the initial value.
|
|
72
71
|
// Record the ID of the timeout so it can be cleaned up later.
|
|
73
|
-
// console.log("Starting timeout");
|
|
74
72
|
setTimeoutId(
|
|
75
73
|
setTimeout(() => {
|
|
76
|
-
// console.log(`Timeout ${timeoutId} finished`);
|
|
77
74
|
setPopoverContent(initialPopoverContent);
|
|
78
75
|
}, copiedPopoverContentDuration)
|
|
79
76
|
);
|
|
@@ -83,7 +80,7 @@ const Copyable = ({
|
|
|
83
80
|
setStartTimer(false);
|
|
84
81
|
}
|
|
85
82
|
|
|
86
|
-
// Return cleanup function so timeout will be cleared when component
|
|
83
|
+
// Return cleanup function so timeout will be cleared when component unmounts.
|
|
87
84
|
return cleanup;
|
|
88
85
|
}, [startTimer]);
|
|
89
86
|
|
|
@@ -96,7 +93,7 @@ const Copyable = ({
|
|
|
96
93
|
onCopy?.();
|
|
97
94
|
setAttemptCopy(false);
|
|
98
95
|
})
|
|
99
|
-
.catch(
|
|
96
|
+
.catch(error => {
|
|
100
97
|
console.error(error);
|
|
101
98
|
setPopoverContent(copyErrorPopoverContent);
|
|
102
99
|
setAttemptCopy(false);
|
|
@@ -118,13 +115,13 @@ const Copyable = ({
|
|
|
118
115
|
top: "auto",
|
|
119
116
|
right: "auto",
|
|
120
117
|
bottom: "auto",
|
|
121
|
-
left: `calc(-${popoverArrowWidth} - 8px)
|
|
118
|
+
left: `calc(-${popoverArrowWidth} - 8px)`
|
|
122
119
|
}}
|
|
123
120
|
arrowPosition={{
|
|
124
121
|
arrowTop: "auto",
|
|
125
122
|
arrowRight: "-8px",
|
|
126
123
|
arrowBottom: `calc(50% - ${popoverArrowWidth})`,
|
|
127
|
-
arrowLeft: "auto"
|
|
124
|
+
arrowLeft: "auto"
|
|
128
125
|
}}
|
|
129
126
|
transform="translate(-100%, -75%)"
|
|
130
127
|
arrowDirection="right"
|