UNPKG

@privy-io/react-auth

Version:

React client for the Privy Auth API

2 lines (1 loc) 1.57 kB
import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useState as e}from"react";import{styled as t}from"styled-components";import{C as i}from"./copy-Bx2Jwc5_.mjs";const n=({style:r,color:e,...t})=>/*#__PURE__*/o("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:e||"currentColor",style:{height:"1.5rem",width:"1.5rem",...r},...t,children:/*#__PURE__*/o("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),p=t=>{let[p,a]=e(!1);/*#__PURE__*/return r(l,{color:t.color,onClick:()=>{a(!0),navigator.clipboard.writeText(t.text),setTimeout((()=>a(!1)),1500)},$justCopied:p,children:[p?/*#__PURE__*/o(n,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):/*#__PURE__*/o(i,{style:{height:"14px",width:"14px"}}),p?"Copied":"Copy"," ",t.itemName?t.itemName:"to Clipboard"]})};let l=/*#__PURE__*/t.button.withConfig({displayName:"StyledCopytoClipboardButton",componentId:"sc-46f4187f-0"})(["display:flex;align-items:center;gap:6px;&&{margin:8px 2px;font-size:14px;color:",";font-weight:",";transition:color 350ms ease;:focus,:active{background-color:transparent;border:none;outline:none;box-shadow:none;}:hover{color:",";}:active{color:'var(--privy-color-foreground)';font-weight:medium;}@media (max-width:440px){margin:12px 2px;}}svg{width:14px;height:14px;}"],(o=>o.$justCopied?"var(--privy-color-foreground)":o.color||"var(--privy-color-foreground-3)"),(o=>o.$justCopied?"medium":"normal"),(o=>o.$justCopied?"var(--privy-color-foreground)":"var(--privy-color-foreground-2)"));export{p as C};