UNPKG

@privy-io/react-auth

Version:

React client for the Privy Auth API

38 lines (36 loc) 1.81 kB
import{jsxs as r,jsx as e}from"react/jsx-runtime";import{X as t,Check as i}from"lucide-react";import o from"react";import{styled as n}from"styled-components";const a=n.div` display: flex; flex-direction: column; justify-content: flex-start; gap: 10px; /* 10px gap between items */ padding-left: 8px; /* 8px indentation container */ `;n.div` &&& { margin-left: 6px; /* Center the line under the checkbox (12px/2) */ border-left: 2px solid var(--privy-color-foreground-4); height: 10px; /* 10px H padding between paragraphs */ margin-top: 0; margin-bottom: 0; } `;const c=({children:n,variant:a="default",icon:c})=>{let p=()=>{switch(a){case"success":return"var(--privy-color-icon-success)";case"error":return"var(--privy-color-icon-error)";default:return"var(--privy-color-icon-muted)"}};/*#__PURE__*/return r(l,{children:[/*#__PURE__*/e(s,{$variant:a,"data-variant":a,children:(()=>{if(c) /*#__PURE__*/return o.isValidElement(c)?/*#__PURE__*/o.cloneElement(c,{stroke:p(),strokeWidth:2}):c;switch(a){case"success":default:/*#__PURE__*/return e(i,{size:12,stroke:p(),strokeWidth:3});case"error":/*#__PURE__*/return e(t,{size:12,stroke:p(),strokeWidth:3})}})()}),n]})};let s=n.div` display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background-color: ${({$variant:r})=>{switch(r){case"success":return"var(--privy-color-success-bg, #EAFCEF)";case"error":return"var(--privy-color-error-bg, #FEE2E2)";default:return"var(--privy-color-background-2)"}}}; flex-shrink: 0; `,l=n.div` display: flex; justify-content: flex-start; align-items: flex-start; /* Align all elements to the top */ text-align: left; gap: 8px; && { a { color: var(--privy-color-accent); } } `;export{a as T,c as a};