Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contentful/f36-copybutton

Package Overview
Dependencies
Maintainers
105
Versions
344
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contentful/f36-copybutton - npm Package Compare versions

Comparing version 4.0.1-next-v4-8846.2359 to 4.0.1-next-v4-8879.2361

2

dist/module.js

@@ -1,2 +0,2 @@

import o from"@babel/runtime/helpers/esm/extends";import{cx as t,css as e}from"emotion";import r,{useRef as a,useState as n,useCallback as i}from"react";import l from"react-copy-to-clipboard";import{CopyIcon as s}from"@contentful/f36-icons";import{Tooltip as c}from"@contentful/f36-tooltip";import p from"@contentful/f36-tokens";var u,d,m,b;u={},d="CopyButton",m=()=>y,Object.defineProperty(u,d,{get:m,set:b,enumerable:!0,configurable:!0});function f(u,d){const{onCopy:m,value:b,className:f,testId:y="cf-ui-copy-button",tooltipText:g="Copy to clipboard",tooltipCopiedText:C="Copied!",tooltipProps:h,isDisabled:x=!1,size:v="medium",...w}=u,k=(({size:o})=>{const t="small"===o?"32px":"40px";return{wrapper:e({display:"inline-block",height:t,position:"relative",width:t},""),copyButton:e({alignItems:"center",background:p.colorWhite,border:`1px solid ${p.gray300}`,display:"inline-flex",height:"100%",justifyContent:"center",outline:"none",padding:0,transition:`background ${p.transitionDurationShort} ${p.transitionEasingDefault}`,width:"100%","&:hover":{backgroundColor:p.gray100,cursor:"pointer"},"&:active":{backgroundColor:p.gray200,cursor:"pointer"},"&:focus":{boxShadow:p.glowMuted}},""),copyButtonDisabled:e({cursor:"not-allowed",backgroundColor:p.gray100,"&:hover":{cursor:"not-allowed",backgroundColor:p.gray100},"&:focus":{borderColor:p.gray300,boxShadow:"none"},"&:active, &:active:hover":{borderColor:p.gray300,boxShadow:"none"}},"")}})({size:v}),[B,D]=n(!1),E=a(null),S=i((o=>{m&&m(o),D(!0),setTimeout((()=>{D(!1),E.current&&E.current.blur()}),1e3)}),[m]);return r.createElement("div",o({ref:d,"data-test-id":y,className:t(k.wrapper,f)},w),r.createElement(l,{text:b,onCopy:S},r.createElement(c,o({content:B?C:g},h,{isDisabled:x}),r.createElement("button",{type:"button",ref:E,className:t(k.copyButton,{[k.copyButtonDisabled]:x}),"aria-label":`Copy ${b} to clipboard`,disabled:x},r.createElement(s,{variant:"muted",size:"small"===v?"tiny":"small"})))))}const y=r.forwardRef(f);export{y as CopyButton};
import o from"@babel/runtime/helpers/esm/extends";import{cx as t,css as e}from"emotion";import r,{useCallback as a,useRef as n,useState as i}from"react";import l from"react-copy-to-clipboard";import{CopyIcon as s}from"@contentful/f36-icons";import{Tooltip as c}from"@contentful/f36-tooltip";import p from"@contentful/f36-tokens";var u,d,m,b;u={},d="CopyButton",m=()=>y,Object.defineProperty(u,d,{get:m,set:b,enumerable:!0,configurable:!0});function f(u,d){const{onCopy:m,value:b,className:f,testId:y="cf-ui-copy-button",tooltipText:g="Copy to clipboard",tooltipCopiedText:C="Copied!",tooltipProps:h,isDisabled:x=!1,size:v="medium",...w}=u,k=(({size:o})=>{const t="small"===o?"32px":"40px";return{wrapper:e({display:"inline-block",height:t,position:"relative",width:t},""),copyButton:e({alignItems:"center",background:p.colorWhite,border:`1px solid ${p.gray300}`,display:"inline-flex",height:"100%",justifyContent:"center",outline:"none",padding:0,transition:`background ${p.transitionDurationShort} ${p.transitionEasingDefault}`,width:"100%","&:hover":{backgroundColor:p.gray100,cursor:"pointer"},"&:active":{backgroundColor:p.gray200,cursor:"pointer"},"&:focus":{boxShadow:p.glowMuted}},""),copyButtonDisabled:e({cursor:"not-allowed",backgroundColor:p.gray100,"&:hover":{cursor:"not-allowed",backgroundColor:p.gray100},"&:focus":{borderColor:p.gray300,boxShadow:"none"},"&:active, &:active:hover":{borderColor:p.gray300,boxShadow:"none"}},"")}})({size:v}),[B,D]=i(!1),E=n(null),S=a((o=>{m&&m(o),D(!0),setTimeout((()=>{D(!1),E.current&&E.current.blur()}),1e3)}),[m]);return r.createElement("div",o({ref:d,"data-test-id":y,className:t(k.wrapper,f)},w),r.createElement(l,{text:b,onCopy:S},r.createElement(c,o({content:B?C:g},h,{isDisabled:x}),r.createElement("button",{type:"button",ref:E,className:t(k.copyButton,{[k.copyButtonDisabled]:x}),"aria-label":`Copy ${b} to clipboard`,disabled:x},r.createElement(s,{variant:"muted",size:"small"===v?"tiny":"small"})))))}const y=r.forwardRef(f);export{y as CopyButton};
//# sourceMappingURL=module.js.map
{
"name": "@contentful/f36-copybutton",
"version": "4.0.1-next-v4-8846.2359+3923eeac",
"version": "4.0.1-next-v4-8879.2361+ee39c787",
"description": "Forma 36: CopyButton component",

@@ -10,6 +10,6 @@ "scripts": {

"@babel/runtime": "^7.6.2",
"@contentful/f36-core": "4.0.1-next-v4-8846.2359+3923eeac",
"@contentful/f36-icons": "4.0.1-next-v4-8846.2359+3923eeac",
"@contentful/f36-tokens": "4.0.1-next-v4-8846.2359+3923eeac",
"@contentful/f36-tooltip": "4.0.1-next-v4-8846.2359+3923eeac",
"@contentful/f36-core": "4.0.1-next-v4-8879.2361+ee39c787",
"@contentful/f36-icons": "4.0.1-next-v4-8879.2361+ee39c787",
"@contentful/f36-tokens": "4.0.1-next-v4-8879.2361+ee39c787",
"@contentful/f36-tooltip": "4.0.1-next-v4-8879.2361+ee39c787",
"emotion": "^10.0.17",

@@ -39,3 +39,3 @@ "react-copy-to-clipboard": "^5.0.3"

},
"gitHead": "3923eeacefff259b5ee0cf9fc916006f3d240e8d"
"gitHead": "ee39c7876324bfadc940bfe7c54c603aab4e0791"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc