@launchpad-ui/clipboard
Advanced tools
Comparing version 0.3.1 to 0.4.0
@@ -12,3 +12,2 @@ /// <reference types="react" /> | ||
popoverTargetClassName?: string; | ||
shouldOnlyShowTooltipAfterCopy?: boolean; | ||
onClick?(): void; | ||
@@ -15,0 +14,0 @@ asChild?: boolean; |
@@ -31,3 +31,2 @@ // ../../scripts/react-shim.js | ||
testId, | ||
shouldOnlyShowTooltipAfterCopy, | ||
onClick, | ||
@@ -56,14 +55,5 @@ asChild | ||
const testIdOrFallback = testId ? testId : "temp-test-id"; | ||
const handleFocus = () => { | ||
if (!shouldOnlyShowTooltipAfterCopy) { | ||
setIsOpen(true); | ||
} | ||
}; | ||
const handleBlur = () => { | ||
setIsOpen(false); | ||
setWasCopied(false); | ||
}; | ||
const handleInteraction = (isOpen2) => { | ||
setIsOpen(shouldOnlyShowTooltipAfterCopy ? false : isOpen2); | ||
setWasCopied((prev) => !isOpen2 ? isOpen2 : prev); | ||
setIsOpen(isOpen2); | ||
setTimeout(() => setWasCopied((prev) => !isOpen2 ? isOpen2 : prev)); | ||
}; | ||
@@ -88,4 +78,2 @@ const handleKeyDown = (event) => { | ||
}, /* @__PURE__ */ React.createElement(Component, { | ||
onBlur: handleBlur, | ||
onFocus: handleFocus, | ||
onClick: handleCopy, | ||
@@ -96,5 +84,4 @@ onKeyDown: handleKeyDown, | ||
"aria-label": ariaLabelText, | ||
"data-test-id": "copyToClipboardTrigger", | ||
testId: "copyToClipboardTrigger", | ||
role: "button", | ||
className: "CopyToClipboard-trigger", | ||
tabIndex: 0 | ||
@@ -101,0 +88,0 @@ }, children))); |
@@ -61,3 +61,2 @@ "use strict"; | ||
testId, | ||
shouldOnlyShowTooltipAfterCopy, | ||
onClick, | ||
@@ -86,14 +85,5 @@ asChild | ||
const testIdOrFallback = testId ? testId : "temp-test-id"; | ||
const handleFocus = () => { | ||
if (!shouldOnlyShowTooltipAfterCopy) { | ||
setIsOpen(true); | ||
} | ||
}; | ||
const handleBlur = () => { | ||
setIsOpen(false); | ||
setWasCopied(false); | ||
}; | ||
const handleInteraction = (isOpen2) => { | ||
setIsOpen(shouldOnlyShowTooltipAfterCopy ? false : isOpen2); | ||
setWasCopied((prev) => !isOpen2 ? isOpen2 : prev); | ||
setIsOpen(isOpen2); | ||
setTimeout(() => setWasCopied((prev) => !isOpen2 ? isOpen2 : prev)); | ||
}; | ||
@@ -118,4 +108,2 @@ const handleKeyDown = (event) => { | ||
}, /* @__PURE__ */ React.createElement(Component, { | ||
onBlur: handleBlur, | ||
onFocus: handleFocus, | ||
onClick: handleCopy, | ||
@@ -126,5 +114,4 @@ onKeyDown: handleKeyDown, | ||
"aria-label": ariaLabelText, | ||
"data-test-id": "copyToClipboardTrigger", | ||
testId: "copyToClipboardTrigger", | ||
role: "button", | ||
className: "CopyToClipboard-trigger", | ||
tabIndex: 0 | ||
@@ -131,0 +118,0 @@ }, children))); |
{ | ||
"name": "@launchpad-ui/clipboard", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"status": "beta", | ||
@@ -29,6 +29,6 @@ "publishConfig": { | ||
"dependencies": { | ||
"@launchpad-ui/button": "~0.3.0", | ||
"@launchpad-ui/button": "~0.3.1", | ||
"@launchpad-ui/icons": "~0.2.3", | ||
"@launchpad-ui/tokens": "~0.1.5", | ||
"@launchpad-ui/tooltip": "~0.3.6", | ||
"@launchpad-ui/tooltip": "~0.3.7", | ||
"@react-aria/live-announcer": "^3.1.0", | ||
@@ -35,0 +35,0 @@ "@radix-ui/react-slot": "^1.0.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
24077
235
Updated@launchpad-ui/button@~0.3.1
Updated@launchpad-ui/tooltip@~0.3.7