@crossmint/client-sdk-react-ui 1.13.13 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-2BOQSASO.cjs +1 -0
- package/dist/{chunk-MZF4MBS7.cjs → chunk-2QD52VTM.cjs} +1 -1
- package/dist/{chunk-T3FEXCWD.js → chunk-2VBA64WU.js} +1 -1
- package/dist/{chunk-RAQ2JGJM.cjs → chunk-2VOUTE6Q.cjs} +1 -1
- package/dist/{chunk-JTIVU7MW.cjs → chunk-3SFKQITQ.cjs} +1 -1
- package/dist/{chunk-VM753NZQ.cjs → chunk-5RAT4BDZ.cjs} +1 -1
- package/dist/{chunk-XBG3ON3X.cjs → chunk-62JYTT2Y.cjs} +1 -1
- package/dist/{chunk-C4LCX5UF.js → chunk-6LMKMBUO.js} +1 -1
- package/dist/{chunk-MGDFRHG7.js → chunk-BA5K73JO.js} +1 -1
- package/dist/{chunk-RLX4C3U4.cjs → chunk-BMLVCKVF.cjs} +1 -1
- package/dist/{chunk-IGSI4FRO.cjs → chunk-BYC3IIHX.cjs} +1 -1
- package/dist/chunk-C6COHFJA.cjs +6 -0
- package/dist/chunk-DJYFUGOG.js +1 -0
- package/dist/{chunk-KWIJ4SIV.cjs → chunk-E5PPNNTL.cjs} +1 -1
- package/dist/{chunk-4NI5EBOY.js → chunk-EPBUJQPI.js} +1 -1
- package/dist/chunk-FSG3MT7C.cjs +1 -0
- package/dist/{chunk-7YJSU577.cjs → chunk-GLFNYRYD.cjs} +1 -1
- package/dist/chunk-HFEX7S3W.cjs +1 -0
- package/dist/{chunk-6233XGKJ.js → chunk-HFMBK6WE.js} +1 -1
- package/dist/{chunk-SKHTZC4A.js → chunk-HJ4ILZ44.js} +1 -1
- package/dist/chunk-HT4JFOOR.js +6 -0
- package/dist/{chunk-VLJ2U7IU.cjs → chunk-I3IRK4TX.cjs} +1 -1
- package/dist/{chunk-RTENNFLH.js → chunk-IJNTDUWF.js} +1 -1
- package/dist/{chunk-ZGWCOWTY.js → chunk-JVFUP7YQ.js} +1 -1
- package/dist/{chunk-ITQPATPQ.js → chunk-K3OKP3AX.js} +1 -1
- package/dist/{chunk-DT7TR35K.cjs → chunk-KLKC2IGI.cjs} +1 -1
- package/dist/{chunk-RGDZBGF3.js → chunk-MYDJFGIG.js} +1 -1
- package/dist/{chunk-CGMDFXGU.cjs → chunk-N6H73LL4.cjs} +1 -1
- package/dist/{chunk-NNHLYOE6.cjs → chunk-NC4DHK5G.cjs} +1 -1
- package/dist/{chunk-LQH3BSH4.js → chunk-NKOSSBPQ.js} +1 -1
- package/dist/chunk-NQ2WKZU6.js +1 -0
- package/dist/chunk-P7QEGS22.js +1 -0
- package/dist/{chunk-JUT2GKR4.js → chunk-PWNUFLMO.js} +1 -1
- package/dist/{chunk-BS6JMGOU.js → chunk-QDKGGCBY.js} +1 -1
- package/dist/{chunk-62X3Z7SG.cjs → chunk-QG4LZRPV.cjs} +1 -1
- package/dist/{chunk-PDRTXQQD.js → chunk-QRX6P4MW.js} +1 -1
- package/dist/{chunk-XV7FPAZ2.js → chunk-RR35R23S.js} +1 -1
- package/dist/{chunk-PE2HZ3ZP.js → chunk-VRC3MYU6.js} +1 -1
- package/dist/{chunk-6KCMHDB2.cjs → chunk-WRC5F2W4.cjs} +1 -1
- package/dist/{chunk-ZTB62MGQ.cjs → chunk-YNTE6H67.cjs} +1 -1
- package/dist/components/CrossmintNFTCollectionView.cjs +1 -1
- package/dist/components/CrossmintNFTCollectionView.js +1 -1
- package/dist/components/CrossmintNFTDetail.cjs +1 -1
- package/dist/components/CrossmintNFTDetail.js +1 -1
- package/dist/components/auth/AuthForm.cjs +1 -1
- package/dist/components/auth/AuthForm.js +1 -1
- package/dist/components/auth/AuthFormBackButton.cjs +1 -1
- package/dist/components/auth/AuthFormBackButton.js +1 -1
- package/dist/components/auth/AuthFormDialog.cjs +1 -1
- package/dist/components/auth/AuthFormDialog.js +1 -1
- package/dist/components/auth/EmbeddedAuthForm.cjs +1 -1
- package/dist/components/auth/EmbeddedAuthForm.js +1 -1
- package/dist/components/auth/PasskeyPrompt.cjs +1 -1
- package/dist/components/auth/PasskeyPrompt.js +1 -1
- package/dist/components/auth/methods/email/EmailAuthFlow.cjs +1 -1
- package/dist/components/auth/methods/email/EmailAuthFlow.js +1 -1
- package/dist/components/auth/methods/email/EmailOTPInput.cjs +1 -1
- package/dist/components/auth/methods/email/EmailOTPInput.js +1 -1
- package/dist/components/auth/methods/email/EmailSignIn.cjs +1 -1
- package/dist/components/auth/methods/email/EmailSignIn.js +1 -1
- package/dist/components/auth/methods/farcaster/FarcasterSignIn.cjs +1 -1
- package/dist/components/auth/methods/farcaster/FarcasterSignIn.js +1 -1
- package/dist/components/auth/methods/google/ContinueWithGoogle.cjs +1 -0
- package/dist/components/auth/methods/google/ContinueWithGoogle.d.cts +9 -0
- package/dist/components/auth/methods/google/ContinueWithGoogle.d.ts +9 -0
- package/dist/components/auth/methods/google/ContinueWithGoogle.js +1 -0
- package/dist/components/auth/methods/google/GoogleSignIn.cjs +1 -1
- package/dist/components/auth/methods/google/GoogleSignIn.js +1 -1
- package/dist/components/auth/methods/twitter/TwitterSignIn.cjs +1 -1
- package/dist/components/auth/methods/twitter/TwitterSignIn.js +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlow.cjs +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlow.js +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlowButton.cjs +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlowButton.js +1 -1
- package/dist/components/auth/methods/web3/Web3Connector.cjs +1 -1
- package/dist/components/auth/methods/web3/Web3Connector.js +1 -1
- package/dist/components/auth/methods/web3/Web3Connectors.cjs +1 -1
- package/dist/components/auth/methods/web3/Web3Connectors.js +1 -1
- package/dist/components/common/CountdownButton.cjs +1 -0
- package/dist/components/common/CountdownButton.d.cts +13 -0
- package/dist/components/common/CountdownButton.d.ts +13 -0
- package/dist/components/common/CountdownButton.js +1 -0
- package/dist/components/common/CrossmintLogoV2/schemas.d.cts +32 -32
- package/dist/components/common/CrossmintLogoV2/schemas.d.ts +32 -32
- package/dist/components/common/Dialog.cjs +1 -1
- package/dist/components/common/Dialog.js +1 -1
- package/dist/components/common/Divider.cjs +1 -1
- package/dist/components/common/Divider.js +1 -1
- package/dist/components/common/SecuredByCrossmint.cjs +1 -1
- package/dist/components/common/SecuredByCrossmint.js +1 -1
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.cjs +1 -1
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js +1 -1
- package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.cjs +1 -1
- package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.js +1 -1
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.cjs +1 -1
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.js +1 -1
- package/dist/components/embed/v3/crypto/utils/handleSendTransaction.cjs +1 -1
- package/dist/components/embed/v3/crypto/utils/handleSendTransaction.js +1 -1
- package/dist/components/embed/v3/index.cjs +1 -1
- package/dist/components/embed/v3/index.js +1 -1
- package/dist/components/hosted/CrossmintPayButton_DEPRECATED.cjs +1 -1
- package/dist/components/hosted/CrossmintPayButton_DEPRECATED.js +1 -1
- package/dist/components/hosted/index.cjs +1 -1
- package/dist/components/hosted/index.js +1 -1
- package/dist/components/hosted/v3/CrossmintHostedCheckoutV3.cjs +1 -1
- package/dist/components/hosted/v3/CrossmintHostedCheckoutV3.js +1 -1
- package/dist/components/hosted/v3/index.cjs +1 -1
- package/dist/components/hosted/v3/index.js +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.js +1 -1
- package/dist/consts/version.cjs +1 -1
- package/dist/consts/version.js +1 -1
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useAuth.cjs +1 -1
- package/dist/hooks/useAuth.js +1 -1
- package/dist/hooks/useCrossmintAuth.cjs +1 -1
- package/dist/hooks/useCrossmintAuth.js +1 -1
- package/dist/hooks/useCrossmintCheckout.cjs +1 -1
- package/dist/hooks/useCrossmintCheckout.js +1 -1
- package/dist/hooks/useOAuthWindowListener.cjs +1 -1
- package/dist/hooks/useOAuthWindowListener.d.cts +1 -1
- package/dist/hooks/useOAuthWindowListener.d.ts +1 -1
- package/dist/hooks/useOAuthWindowListener.js +1 -1
- package/dist/hooks/useWallet.cjs +1 -1
- package/dist/hooks/useWallet.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/providers/CrossmintAuthProvider.cjs +1 -1
- package/dist/providers/CrossmintAuthProvider.d.cts +3 -1
- package/dist/providers/CrossmintAuthProvider.d.ts +3 -1
- package/dist/providers/CrossmintAuthProvider.js +1 -1
- package/dist/providers/CrossmintWalletProvider.cjs +1 -1
- package/dist/providers/CrossmintWalletProvider.js +1 -1
- package/dist/providers/TwindProvider.cjs +1 -1
- package/dist/providers/TwindProvider.js +1 -1
- package/dist/providers/auth/AuthFormProvider.cjs +1 -1
- package/dist/providers/auth/AuthFormProvider.d.cts +10 -4
- package/dist/providers/auth/AuthFormProvider.d.ts +10 -4
- package/dist/providers/auth/AuthFormProvider.js +1 -1
- package/dist/providers/auth/web3/DynamicWeb3WalletConnect.cjs +1 -1
- package/dist/providers/auth/web3/DynamicWeb3WalletConnect.js +1 -1
- package/dist/providers/index.cjs +1 -1
- package/dist/providers/index.js +1 -1
- package/dist/twind.config.cjs +1 -1
- package/dist/twind.config.js +1 -1
- package/dist/utils/createCrossmintApiClient.cjs +1 -1
- package/dist/utils/createCrossmintApiClient.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-67T77DGT.cjs +0 -1
- package/dist/chunk-6X47UP4T.cjs +0 -1
- package/dist/chunk-LURWXXMI.cjs +0 -1
- package/dist/chunk-N3DNU6TD.js +0 -1
- package/dist/chunk-UIMMLWKZ.js +0 -1
- package/dist/chunk-X6ALZSEN.js +0 -1
- /package/dist/{chunk-AUSETHZ3.cjs → chunk-NMROW7IT.cjs} +0 -0
- /package/dist/{chunk-2VILTRL5.js → chunk-U2KHFXUK.js} +0 -0
package/dist/chunk-N3DNU6TD.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var s="1.13.13";var r=s;export{r as a};
|
package/dist/chunk-UIMMLWKZ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as It}from"./chunk-JSNUJJQJ.js";import{a as St}from"./chunk-PE2HZ3ZP.js";import{a as Mt,e as Ut,h as Tt,i as Lt}from"./chunk-X6ALZSEN.js";import{a as At,b as Et,c as D}from"./chunk-VHNBXIOC.js";import{a as Pt}from"./chunk-T3FEXCWD.js";import{a as L}from"./chunk-TNCETEEL.js";import{a as Rt}from"./chunk-PDRTXQQD.js";import{a as E}from"./chunk-NBJIJZGO.js";import{a as Ot}from"./chunk-SFDQPSSP.js";import{a as Nt}from"./chunk-JPJKOERH.js";import{a as _}from"./chunk-UAFW3OWA.js";import{a as kt}from"./chunk-C3JRTLQP.js";import{a as Wt}from"./chunk-E4TBJMOO.js";import{a as Ft}from"./chunk-4ITU7JF2.js";import{b as G}from"./chunk-ROJ6HFVK.js";import{a as N,b as M,c as B,d as v}from"./chunk-PXDN3KFO.js";import{createContext as $o,useMemo as Zo,useState as eo}from"react";import{createPortal as te}from"react-dom";import{SmartWalletError as ro,SmartWalletSDK as oe}from"@crossmint/client-sdk-smart-wallet";import{useContext as so}from"react";function Dt(){let r=so(et);if(!r)throw new Error("useWallet must be used within CrossmintAuthProvider or CrossmintWalletProvider");return r}import{useContext as Qo}from"react";import{createContext as Bo,useEffect as mt,useMemo as Vo,useRef as Ho,useState as ut}from"react";import{CrossmintAuth as jo,getCookie as Ko}from"@crossmint/client-sdk-auth";import{validateApiKeyAndGetCrossmintBaseUrl as zo}from"@crossmint/common-sdk-base";import{SESSION_PREFIX as Go}from"@crossmint/common-sdk-auth";import{VisuallyHidden as to}from"@radix-ui/react-visually-hidden";import{createContext as io,useCallback as lo,useContext as ao,useEffect as uo,useState as q}from"react";import{CrossmintAuthenticationError as mo}from"@crossmint/common-sdk-auth";import{useContext as no}from"react";function U(){let r=no(j);if(!r)throw new Error("useCrossmintAuth must be used within a CrossmintAuthProvider");return r}import{jsx as co}from"react/jsx-runtime";var Bt={google:"",twitter:""},Vt=io(void 0),p=()=>{let r=ao(Vt);if(!r)throw new Error("useAuthForm must be used within an AuthFormProvider");return r},Ht=({children:r,initialState:e})=>{let{crossmintAuth:o}=U(),[t,i]=q("initial"),[s,n]=q(null),[a,l]=q(Bt),[u,m]=q(!0),{loginMethods:c,baseUrl:d,setDialogOpen:f,appearance:g,embeddedWallets:h}=e;if(c.includes("web3")&&(h==null?void 0:h.createOnLogin)==="all-users")throw new Error("Creating wallets on login is not yet supported for web3 login method");let y=lo(()=>v(void 0,null,function*(){m(!0);try{let F=c.filter(S=>S in Bt).map(S=>v(void 0,null,function*(){let W=yield o==null?void 0:o.getOAuthUrl(S);return{[S]:W}})),w=Object.assign({},...yield Promise.all(F));l(w)}catch(b){n(b instanceof mo?b.message:"Unable to load oauth providers. Please try again later.")}finally{m(!1)}}),[c,o]);uo(()=>{y()},[y]);let O={step:t,error:s,baseUrl:d,appearance:g,loginMethods:c,oauthUrlMap:a,isLoadingOauthUrlMap:u,setDialogOpen:b=>{f==null||f(b),b||setTimeout(()=>i("initial"),250)},setError:n,setStep:i};return co(Vt.Provider,{value:O,children:r})};import{lazy as Mo}from"react";import Uo from"color";import{useState as yo}from"react";import{useState as rt}from"react";import{jsx as jt}from"react/jsx-runtime";var X=s=>{var n=s,{className:r,iconColor:e,ringColor:o,onClick:t}=n,i=B(n,["className","iconColor","ringColor","onClick"]);let{setError:a}=p();return jt("button",M(N({className:E("absolute left-4 top-4 min-[480px]:!left-6 min-[480px]:!top-6 rounded-full opacity-70 ring-offset-background text-cm-text-primary transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-cm-accent focus:ring-offset-2 disabled:pointer-events-none",r),onClick:l=>{a(null),t==null||t(l)}},i),{children:jt(Ot,{className:"w-6 h-6",style:{color:e}})}))};import{jsx as P,jsxs as Y}from"react/jsx-runtime";var fo=6;function Kt({otpEmailData:r,setOtpEmailData:e}){var h,y,I,O,b,F,w,S,W,T,ct,dt,ft,gt,pt,ht,yt,xt,Ct,bt,wt;let{crossmintAuth:o}=U(),{appearance:t,setDialogOpen:i,setStep:s,setError:n}=p(),[a,l]=rt(""),[u,m]=rt(!1),[c,d]=rt(!1),f=()=>v(this,null,function*(){var z,vt;d(!0);try{let ot=yield o==null?void 0:o.confirmEmailOtp((z=r==null?void 0:r.email)!=null?z:"",(vt=r==null?void 0:r.emailId)!=null?vt:"",a);yield o==null?void 0:o.handleRefreshAuthMaterial(ot),i(!1),s("initial")}catch(ot){console.error("Error confirming email OTP",ot),n("Invalid code. Please try again."),m(!0)}finally{d(!1)}});return Y("div",{children:[P(X,{onClick:()=>{s("initial"),e(null)},iconColor:(h=t==null?void 0:t.colors)==null?void 0:h.textPrimary,ringColor:(y=t==null?void 0:t.colors)==null?void 0:y.accent}),Y("div",{className:"flex flex-col items-center justify-start w-full",children:[P("div",{className:"relative left-3",children:P(kt,{customAccentColor:(I=t==null?void 0:t.colors)==null?void 0:I.accent,customButtonBackgroundColor:(O=t==null?void 0:t.colors)==null?void 0:O.buttonBackground,customBackgroundColor:(b=t==null?void 0:t.colors)==null?void 0:b.background})}),P("p",{className:"text-base font-normal mt-4 mb-1 text-center text-cm-text-primary",style:{color:(F=t==null?void 0:t.colors)==null?void 0:F.textPrimary},children:"Check your email"}),P("p",{className:"text-center text-cm-text-secondary px-4",style:{color:(w=t==null?void 0:t.colors)==null?void 0:w.textSecondary},children:"A temporary login code has been sent to your email"}),P("div",{className:"py-8",children:P(At,{maxLength:fo,value:a,onChange:z=>{l(z),m(!1),n(null)},onComplete:f,disabled:c,customStyles:{accent:(W=(S=t==null?void 0:t.colors)==null?void 0:S.accent)!=null?W:"#04AA6D",danger:(ct=(T=t==null?void 0:t.colors)==null?void 0:T.danger)!=null?ct:"#f44336",border:(ft=(dt=t==null?void 0:t.colors)==null?void 0:dt.border)!=null?ft:"#E5E7EB",textPrimary:(pt=(gt=t==null?void 0:t.colors)==null?void 0:gt.textPrimary)!=null?pt:"#909ca3",buttonBackground:(yt=(ht=t==null?void 0:t.colors)==null?void 0:ht.buttonBackground)!=null?yt:"#eff6ff",inputBackground:(Ct=(xt=t==null?void 0:t.colors)==null?void 0:xt.inputBackground)!=null?Ct:"#FFFFFF",borderRadius:t==null?void 0:t.borderRadius},children:Y(Et,{children:[P(D,{index:0,hasError:u}),P(D,{index:1,hasError:u}),P(D,{index:2,hasError:u}),P(D,{index:3,hasError:u}),P(D,{index:4,hasError:u}),P(D,{index:5,hasError:u})]})})}),Y("p",{className:"text-sm leading-tight text-cm-text-secondary text-center",children:[P("span",{style:{color:(bt=t==null?void 0:t.colors)==null?void 0:bt.textSecondary},children:"Can't find the email? Check spam folder or contact"})," ",P("a",{className:"transition-opacity duration-150 text-cm-link hover:opacity-70",style:{color:(wt=t==null?void 0:t.colors)==null?void 0:wt.textLink},href:"mailto:support@crossmint.io",children:"support@crossmint.io"},"resend-email-link")]})]})]})}import{useState as st}from"react";import go from"color";import{isEmailValid as po}from"@crossmint/common-sdk-auth";import{Fragment as ho,jsx as R,jsxs as nt}from"react/jsx-runtime";function zt({setOtpEmailData:r}){var d,f,g,h,y,I,O,b,F,w;let{crossmintAuth:e}=U(),{appearance:o,setStep:t,setError:i}=p(),[s,n]=st(""),[a,l]=st(""),[u,m]=st(!1);function c(S){return v(this,null,function*(){if(S.preventDefault(),!po(s)){l("Please enter a valid email address");return}m(!0);try{let W=s.trim().toLowerCase(),T=yield e==null?void 0:e.sendEmailOtp(W);r({email:W,emailId:T.emailId}),t("otp")}catch(W){m(!1),i("Failed to send email. Please try again or contact support.")}})}return R(ho,{children:R("div",{className:"flex flex-col items-start justify-start w-full rounded-lg",children:nt("div",{className:"w-full",children:[nt("form",{role:"form",className:"relative",onSubmit:c,noValidate:!0,children:[R("label",{htmlFor:"emailInput",className:"sr-only",children:"Email"}),R("input",{className:E("flex-grow text-cm-text-secondary text-left pl-[16px] pr-[80px] h-[58px] w-full border border-cm-border rounded-xl bg-cm-background-primary placeholder:text-sm placeholder:text-opacity-60","transition-none duration-200 ease-in-out","focus:outline-none focus-ring-custom",a?"border-red-500":""),style:{color:(d=o==null?void 0:o.colors)==null?void 0:d.textPrimary,borderRadius:o==null?void 0:o.borderRadius,borderColor:a?(f=o==null?void 0:o.colors)==null?void 0:f.danger:(g=o==null?void 0:o.colors)==null?void 0:g.border,backgroundColor:(h=o==null?void 0:o.colors)==null?void 0:h.inputBackground,"--focus-ring-color":new go((I=(y=o==null?void 0:o.colors)==null?void 0:y.accent)!=null?I:"#04AA6D").alpha(.18).toString()},type:"email",placeholder:"Enter email",value:s,onChange:S=>{n(S.target.value),l(""),i(null)},readOnly:u,"aria-describedby":"emailError"}),nt("div",{className:"absolute inset-y-0 right-0 flex items-center pr-4",children:[a&&R(_,{customColor:(O=o==null?void 0:o.colors)==null?void 0:O.danger}),u&&R(L,{style:{color:(b=o==null?void 0:o.colors)==null?void 0:b.textSecondary,fill:(F=o==null?void 0:o.colors)==null?void 0:F.textPrimary}}),!a&&!u&&R("button",{type:"submit",className:E("cursor-pointer font-medium text-cm-accent text-nowrap"),style:{color:(w=o==null?void 0:o.colors)==null?void 0:w.accent},disabled:!s,children:"Sign in"})]})]}),a&&R("p",{className:"text-xs text-red-500 mb-2 pt-2",children:a})]})})})}import{jsx as Gt}from"react/jsx-runtime";function _t(){let{step:r}=p(),[e,o]=yo(null);return r==="otp"?Gt(Kt,{otpEmailData:e,setOtpEmailData:o}):r==="initial"?Gt(zt,{setOtpEmailData:o}):null}import{jsx as it,jsxs as xo}from"react/jsx-runtime";function qt({appearance:r,text:e}){var t,i,s;let{step:o}=p();return o!=="initial"?null:xo("div",{className:"flex items-center justify-center w-full pt-2 pb-3",children:[it("span",{className:"w-full h-[1px] bg-cm-border",style:{backgroundColor:(t=r==null?void 0:r.colors)==null?void 0:t.border}}),e!=null?it("p",{className:"flex-none px-2 text-sm text-cm-text-primary",style:{color:(i=r==null?void 0:r.colors)==null?void 0:i.textSecondary},children:e}):null,it("span",{className:"w-full h-[1px] bg-cm-border",style:{backgroundColor:(s=r==null?void 0:r.colors)==null?void 0:s.border}})]})}import{ChildWindow as Co,PopupWindow as bo}from"@crossmint/client-sdk-window";import{useEffect as wo,useRef as vo,useState as Po}from"react";import{z as J}from"zod";var Q=r=>{let{crossmintAuth:e}=U(),{oauthUrlMap:o,setError:t}=p(),[i,s]=Po(!1),n=vo(null);return wo(()=>(n.current==null&&(n.current=new Co(window.opener||window.parent,"*",{incomingEvents:So})),()=>{n.current!=null&&n.current.off("authMaterialFromPopupCallback")}),[]),{createPopupAndSetupListeners:()=>v(void 0,null,function*(){if(n.current==null)throw new Error("Child window not initialized");s(!0),t(null);let l=yield bo.init(o[r],{awaitToLoad:!1,crossOrigin:!0,width:400,height:700}),u=d=>v(void 0,null,function*(){var f;yield e==null?void 0:e.handleRefreshAuthMaterial(d.oneTimeSecret),(f=n.current)==null||f.off("authMaterialFromPopupCallback"),l.window.close(),s(!1)}),m=d=>{var f;t(d.error),(f=n.current)==null||f.off("errorFromPopupCallback"),l.window.close(),s(!1)};n.current.on("authMaterialFromPopupCallback",u),n.current.on("errorFromPopupCallback",m);let c=setInterval(()=>{var d;l.window.closed&&(clearInterval(c),s(!1),(d=n.current)==null||d.off("authMaterialFromPopupCallback"))},2500)}),isLoading:i}},So={authMaterialFromPopupCallback:J.object({oneTimeSecret:J.string()}),errorFromPopupCallback:J.object({error:J.string()})};import{Fragment as Ao,jsx as $,jsxs as Xt}from"react/jsx-runtime";function Yt(e){var r=B(e,[]);var l,u,m,c;let{step:o,appearance:t,isLoadingOauthUrlMap:i}=p(),{createPopupAndSetupListeners:s,isLoading:n}=Q("google"),a=i||n;return o!=="initial"?null:Xt("button",M(N({className:E("relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none",a?"cursor-not-allowed hover:bg-cm-muted-primary":""),style:{borderRadius:t==null?void 0:t.borderRadius,backgroundColor:(l=t==null?void 0:t.colors)==null?void 0:l.buttonBackground},onClick:a?void 0:s},r),{children:[Xt(Ao,{children:[$(Ft,{className:"h-[25px] w-[25px] absolute left-[18px]"}),a?$(L,{style:{color:(u=t==null?void 0:t.colors)==null?void 0:u.textSecondary,fill:(m=t==null?void 0:t.colors)==null?void 0:m.textPrimary}}):$("span",{className:"font-medium",style:{margin:"0px 32px",color:(c=t==null?void 0:t.colors)==null?void 0:c.textPrimary},children:"Sign in with Google"})]}),$("span",{className:"sr-only",children:"Sign in with Google"})]}))}import{useEffect as lt,useMemo as Eo,useState as ko}from"react";import{useSignIn as Oo,QRCode as Fo}from"@farcaster/auth-kit";import{Fragment as Io,jsx as A,jsxs as K}from"react/jsx-runtime";function Jt(){var i,s;let{step:r,appearance:e,setStep:o,setError:t}=p();return r==="initial"?A("div",{children:K("button",{className:E("relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none"),style:{borderRadius:e==null?void 0:e.borderRadius,backgroundColor:(i=e==null?void 0:e.colors)==null?void 0:i.buttonBackground},onClick:()=>{o("qrCode"),t(null)},children:[A(Wt,{className:"h-[25px] w-[25px] absolute left-[18px]"}),A("span",{className:"font-medium",style:{margin:"0px 32px",color:(s=e==null?void 0:e.colors)==null?void 0:s.textPrimary},children:"Sign in with Farcaster"}),A("span",{className:"sr-only",children:"Sign in with Farcaster"})]})}):r==="qrCode"?A(Wo,{}):null}function Wo(){var g,h,y,I,O,b,F,w,S;let{crossmintAuth:r}=U(),{appearance:e,setStep:o,setDialogOpen:t,setError:i}=p(),[s,n]=ko(null),a=Eo(()=>({onSuccess:W=>{n(W)}}),[]),{signIn:l,url:u,connect:m,signOut:c,isConnected:d}=Oo(a),f=W=>v(this,null,function*(){i(null);try{let T=yield r==null?void 0:r.signInWithFarcaster(W);yield r==null?void 0:r.handleRefreshAuthMaterial(T),t(!1),o("initial")}catch(T){console.error("Error during Farcaster sign-in:",T),i("Failed to sign in with Farcaster")}});return lt(()=>{s!=null&&f(s)},[s]),lt(()=>{d&&l()},[d]),lt(()=>{m()},[]),K("div",{children:[A(X,{onClick:()=>{c(),o("initial")},iconColor:(g=e==null?void 0:e.colors)==null?void 0:g.textPrimary,ringColor:(h=e==null?void 0:e.colors)==null?void 0:h.accent}),K("div",{className:"flex flex-col items-center gap-4",children:[K("div",{className:"text-center",children:[A("h3",{className:"text-lg font-semibold text-cm-text-primary mb-2",style:{color:(y=e==null?void 0:e.colors)==null?void 0:y.textPrimary},children:"Sign in with Farcaster"}),A("p",{className:"text-base font-normal text-cm-text-secondary",style:{color:(I=e==null?void 0:e.colors)==null?void 0:I.textSecondary},children:"Scan with your phone's camera to continue."})]}),A("div",{className:"bg-white aspect-square rounded-lg p-4",style:{backgroundColor:(O=e==null?void 0:e.colors)==null?void 0:O.inputBackground,borderRadius:e==null?void 0:e.borderRadius},children:u!=null?A(Fo,{uri:u,size:280}):A("div",{className:"min-h-[246px] flex items-center justify-center",children:A(L,{style:{color:(b=e==null?void 0:e.colors)==null?void 0:b.textSecondary,fill:(F=e==null?void 0:e.colors)==null?void 0:F.textPrimary}})})}),u?K(Io,{children:[A("p",{className:"text-base text-center font-normal text-cm-text-secondary",style:{color:(w=e==null?void 0:e.colors)==null?void 0:w.textSecondary},children:"Alternatively, click on this link to open Warpcast."}),A("a",{href:u,rel:"noopener noreferrer",target:"_blank",className:"text-base font-normal text-cm-link",style:{color:(S=e==null?void 0:e.colors)==null?void 0:S.textLink},children:"Open Warpcast"})]}):null]})]})}import{Fragment as No,jsx as Z,jsxs as Qt}from"react/jsx-runtime";function $t(e){var r=B(e,[]);var l,u,m,c;let{step:o,appearance:t,isLoadingOauthUrlMap:i}=p(),{createPopupAndSetupListeners:s,isLoading:n}=Q("twitter"),a=i||n;return o!=="initial"?null:Qt("button",M(N({className:E("relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none",a?"cursor-not-allowed hover:bg-cm-muted-primary":""),style:{borderRadius:t==null?void 0:t.borderRadius,backgroundColor:(l=t==null?void 0:t.colors)==null?void 0:l.buttonBackground},onClick:a?void 0:s},r),{children:[Qt(No,{children:[Z(Nt,{className:"h-[25px] w-[25px] absolute left-[18px]"}),a?Z(L,{style:{color:(u=t==null?void 0:t.colors)==null?void 0:u.textSecondary,fill:(m=t==null?void 0:t.colors)==null?void 0:m.textPrimary}}):Z("span",{className:"font-medium",style:{margin:"0px 32px",color:(c=t==null?void 0:t.colors)==null?void 0:c.textPrimary},children:"Sign in with X"})]}),Z("span",{className:"sr-only",children:"Sign in with X"})]}))}import{Fragment as Lo,jsx as k,jsxs as tt}from"react/jsx-runtime";var To=Mo(()=>import("./components/auth/methods/web3/Web3AuthFlow.js").then(r=>({default:r.Web3AuthFlow})));function Zt({className:r}){var n,a,l,u,m,c,d,f,g,h;let{step:e,appearance:o,loginMethods:t,baseUrl:i,error:s}=p();return tt("div",{className:E("relative p-6 pb-4 !min-[480px]:p-10 !min-[480px]:pb-8 flex flex-col gap-[10px] antialiased animate-none",r),children:[s!=null?tt("div",{className:"flex items-start justify-start w-full rounded-lg p-2 mt-4 bg-cm-danger-muted",style:{backgroundColor:new Uo((a=(n=o==null?void 0:o.colors)==null?void 0:n.danger)!=null?a:"#f44336").alpha(.12).toString()},children:[k("div",{className:"min-w-[20px]",children:k(_,{customColor:(u=(l=o==null?void 0:o.colors)==null?void 0:l.danger)!=null?u:"#f44336"})}),k("p",{className:"ml-2 text-sm",style:{color:(c=(m=o==null?void 0:o.colors)==null?void 0:m.danger)!=null?c:"#f44336"},children:s})]}):null,e==="initial"?tt("div",{children:[k("h1",{className:"text-2xl font-bold text-cm-text-primary",style:{color:(d=o==null?void 0:o.colors)==null?void 0:d.textPrimary},children:"Sign In"}),k("p",{className:"text-base font-normal mb-3 text-cm-text-secondary",style:{color:(f=o==null?void 0:o.colors)==null?void 0:f.textSecondary},children:"Sign in using one of the options below"})]}):null,t.includes("email")?tt(Lo,{children:[k(_t,{}),t.length>1?k(qt,{appearance:o,text:"OR"}):null]}):null,t.includes("google")?k(Yt,{}):null,t.includes("farcaster")?k(It,{baseUrl:i,children:k(Jt,{})}):null,t.includes("twitter")?k($t,{}):null,t.includes("web3")?k(To,{}):null,e==="initial"||e==="otp"?k(Pt,{className:"mt-1.5 md:mt-4 justify-center",color:(h=(g=o==null?void 0:o.colors)==null?void 0:g.textSecondary)!=null?h:"#67797F"}):null]})}import{useEffect as Ro}from"react";import{jsx as V,jsxs as Do}from"react/jsx-runtime";function at({open:r}){var t,i,s;let{appearance:e,setDialogOpen:o}=p();return Ro(()=>{document.body.style.overflow=r?"hidden":""},[r]),V(Mt,{modal:!1,open:r,onOpenChange:o,children:Do(Ut,{onInteractOutside:n=>n.preventDefault(),onOpenAutoFocus:n=>n.preventDefault(),closeButtonColor:(t=e==null?void 0:e.colors)==null?void 0:t.textPrimary,closeButtonRingColor:(i=e==null?void 0:e.colors)==null?void 0:i.accent,className:"cm-responsive-border-radius-auth-dialog !p-0 !min-[480px]:p-0",style:{borderRadius:e==null?void 0:e.borderRadius,backgroundColor:(s=e==null?void 0:e.colors)==null?void 0:s.background},children:[V(to,{asChild:!0,children:V(Tt,{children:"Crossmint Auth"})}),V(to,{asChild:!0,children:V(Lt,{children:"Sign in via Crossmint"})}),V(Zt,{className:"max-w-[448px]"})]})})}import{Fragment as Jo,jsx as H,jsxs as Yo}from"react/jsx-runtime";var _o={crossmintAuth:void 0,login:()=>{},logout:()=>{},jwt:void 0,user:void 0,status:"initializing",getUser:()=>{}},j=Bo(_o),qo={defaultChain:"base-sepolia",createOnLogin:"off",type:"evm-smart-wallet"};function vs({embeddedWallets:r=qo,children:e,appearance:o,loginMethods:t=["email","google"],refreshRoute:i,logoutRoute:s}){let[n,a]=ut(void 0),{crossmint:l,setJwt:u}=G("CrossmintAuthProvider must be used within CrossmintProvider"),m=Ho(null),c=Vo(()=>(m.current||(m.current=jo.from(l,{callbacks:{onLogout:()=>{u(void 0),a(void 0)},onTokenRefresh:w=>{u(w.jwt),a(w.user)}},refreshRoute:i,logoutRoute:s})),m.current),[]),d=zo(l.apiKey),[f,g]=ut(!1),[h,y]=ut(!1);mt(()=>{if(l.jwt==null){let w=Ko(Go);u(w)}y(!0)},[]),mt(()=>{l.jwt!=null&&g(!1)},[l.jwt]);let I=()=>{if(l.jwt!=null){console.log("User already logged in");return}g(!0)},O=()=>{c.logout()},b=()=>h?l.jwt!=null?"logged-in":f?"in-progress":"logged-out":"initializing",F=()=>v(this,null,function*(){if(l.jwt==null){console.log("User not logged in");return}let w=yield c.getUser();a(w)});return H(Rt,{children:H(j.Provider,{value:{crossmintAuth:c,login:I,logout:O,jwt:l.jwt,user:n,status:b(),getUser:F},children:H(oo,{defaultChain:r.defaultChain,showPasskeyHelpers:r.showPasskeyHelpers,appearance:o,children:Yo(Ht,{initialState:{appearance:o,setDialogOpen:g,loginMethods:t,embeddedWallets:r,baseUrl:d},children:[H(Xo,{embeddedWallets:r,accessToken:l.jwt,children:e}),H(at,{open:f})]})},l.jwt)})})}function Xo({embeddedWallets:r,children:e,accessToken:o}){let{getOrCreateWallet:t,clearWallet:i,status:s}=Dt();return mt(()=>{r.createOnLogin==="all-users"&&s==="not-loaded"&&o!=null&&t({type:r.type,signer:{type:"PASSKEY"}}),s==="loaded"&&o==null&&i()},[o,s]),H(Jo,{children:e})}function Ms(){let r=Qo(j);if(r===void 0)throw new Error("useAuth must be used within an AuthProvider");return r}import{jsx as re,jsxs as se}from"react/jsx-runtime";var et=$o({status:"not-loaded",getOrCreateWallet:()=>Promise.resolve({startedCreation:!1}),clearWallet:()=>{}});function oo({children:r,defaultChain:e,showPasskeyHelpers:o=!0,appearance:t}){let{crossmint:i}=G("CrossmintWalletProvider must be used within CrossmintProvider"),s=Zo(()=>oe.init({clientApiKey:i.apiKey}),[i.apiKey]),[n,a]=eo({status:"not-loaded"}),[l,u]=eo({open:!1}),m=(...h)=>v(this,[...h],function*(g={type:"evm-smart-wallet",signer:{type:"PASSKEY"}}){if(n.status=="in-progress")return console.log("Wallet already loading"),{startedCreation:!1,reason:"Wallet is already loading."};if(i.jwt==null)return{startedCreation:!1,reason:'Jwt not set in "CrossmintProvider".'};try{a({status:"in-progress"});let y=yield s.getOrCreateWallet({jwt:i.jwt},e,c(g));a({status:"loaded",wallet:y})}catch(y){console.error("There was an error creating a wallet ",y),a(ee(y))}return{startedCreation:!0}}),c=g=>o&&g.signer.type==="PASSKEY"?M(N({},g),{signer:M(N({},g.signer),{onPrePasskeyRegistration:d("create-wallet"),onPasskeyRegistrationError:d("create-wallet-error"),onFirstTimePasskeySigning:d("transaction"),onFirstTimePasskeySigningError:d("transaction-error")})}):g,d=g=>()=>new Promise(h=>{u({type:g,open:!0,primaryActionOnClick:()=>{u({open:!1}),h()},secondaryActionOnClick:()=>{u({open:!1}),h()}})}),f=()=>{a({status:"not-loaded"})};return se(et.Provider,{value:M(N({},n),{getOrCreateWallet:m,clearWallet:f}),children:[r,l.open?te(re(St,{state:l,appearance:t}),document.body):null]})}function ee(r){if(r instanceof ro)return{status:"loading-error",error:r};let e=r instanceof Error?r.message:String(r),o=r instanceof Error?r.stack:void 0;return{status:"loading-error",error:new ro(`Unknown Wallet Error: ${e}`,o)}}export{et as a,oo as b,Dt as c,U as d,p as e,Ht as f,X as g,fo as h,Kt as i,zt as j,_t as k,qt as l,Q as m,Yt as n,Jt as o,$t as p,Zt as q,at as r,j as s,vs as t,Ms as u};
|
package/dist/chunk-X6ALZSEN.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./chunk-NBJIJZGO.js";import{a as l,b as d,c as m}from"./chunk-PXDN3KFO.js";import*as c from"react";import*as e from"@radix-ui/react-dialog";import{jsx as a,jsxs as p}from"react/jsx-runtime";var w=e.Root,T=e.Trigger,k=e.Close,D=e.Portal,v=c.forwardRef((b,x)=>{var g=b,{className:i,children:o,showCloseButton:n=!0,closeButtonColor:t,closeButtonRingColor:s}=g,f=m(g,["className","children","showCloseButton","closeButtonColor","closeButtonRingColor"]);return p(D,{children:[a("div",{className:"fixed inset-0 z-40 bg-black/60 backdrop-blur-sm overflow-x-hidden"}),p(e.Content,d(l({ref:x,className:r("fixed z-50 p-6 pb-4 bg-cm-background-primary border border-cm-border shadow-xl transition-none","inset-x-0 bottom-0 w-full border-t rounded-t-xl","max-[479px]:data-[state=closed]:animate-slide-out-to-bottom max-[479px]:data-[state=open]:animate-slide-in-from-bottom","min-[480px]:inset-auto !min-[480px]:p-10 !min-[480px]:pb-8 min-[480px]:left-[50%] min-[480px]:top-[50%] min-[480px]:translate-x-[-50%] min-[480px]:translate-y-[-52%]","min-[480px]:max-w-[448px] min-[480px]:rounded-xl","min-[480px]:data-[state=closed]:animate-fade-out min-[480px]:data-[state=open]:animate-fade-in",i)},f),{children:[o,n&&p(e.Close,{className:r("absolute rounded-full opacity-70 ring-offset-background transition-opacity hover:opacity-100","focus:outline-none focus:ring-2 focus:ring-cm-accent focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-text-primary","right-4 top-4 !min-[480px]:right-6 !min-[480px]:top-6"),style:{color:t!=null?t:"#00150D"},children:[p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-6 w-6",children:[a("path",{d:"M18 6 6 18"}),a("path",{d:"m6 6 12 12"})]}),a("span",{className:"sr-only",children:"Close"})]})]}))]})});v.displayName=e.Content.displayName;var u=n=>{var t=n,{className:i}=t,o=m(t,["className"]);return a("div",l({className:r("flex flex-col space-y-1.5 text-center sm:text-left",i)},o))};u.displayName="DialogHeader";var P=n=>{var t=n,{className:i}=t,o=m(t,["className"]);return a("div",l({className:r("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",i)},o))};P.displayName="DialogFooter";var y=c.forwardRef((t,n)=>{var s=t,{className:i}=s,o=m(s,["className"]);return a(e.Title,l({ref:n,className:r("text-lg font-semibold leading-none tracking-tight",i)},o))});y.displayName=e.Title.displayName;var R=c.forwardRef((t,n)=>{var s=t,{className:i}=s,o=m(s,["className"]);return a(e.Description,l({ref:n,className:r("text-sm text-muted-foreground",i)},o))});R.displayName=e.Description.displayName;export{w as a,T as b,k as c,D as d,v as e,u as f,P as g,y as h,R as i};
|
|
File without changes
|
|
File without changes
|