@privy-io/react-auth
Version:
React client for the Privy Auth API
27 lines (24 loc) • 1.08 kB
JavaScript
import{jsx as r}from"react/jsx-runtime";import{keyframes as o,css as i,styled as e}from"styled-components";import{L as l}from"./LoadingSkeleton-U6-3yFwI.mjs";const n=({children:o,color:i,isLoading:e,isPulsing:l,...n})=>/*#__PURE__*/r(a,{$color:i,$isLoading:e,$isPulsing:l,...n,children:o});let a=e.span`
padding: 0.25rem;
font-size: 0.75rem;
font-weight: 500;
line-height: 1rem; /* 150% */
border-radius: var(--privy-border-radius-xs);
display: flex;
align-items: center;
${r=>{let e,l;"green"===r.$color&&(e="var(--privy-color-success-dark)",l="var(--privy-color-success-light)"),"red"===r.$color&&(e="var(--privy-color-error)",l="var(--privy-color-error-light)"),"gray"===r.$color&&(e="var(--privy-color-foreground-2)",l="var(--privy-color-background-2)");let n=o`
from, to {
background-color: ${l};
}
50% {
background-color: rgba(${l}, 0.8);
}
`;return i`
color: ${e};
background-color: ${l};
${r.$isPulsing&&i`
animation: ${n} 3s linear infinite;
`};
`}}
${l}
`;export{n as C};