@crossmint/client-sdk-react-ui 1.10.3 → 1.10.5

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.
Files changed (172) hide show
  1. package/dist/{chunk-H2WTBOQ5.cjs → chunk-3LHIEADG.cjs} +3 -3
  2. package/dist/{chunk-R2H6H2HY.js → chunk-4BGD6LSC.js} +2 -2
  3. package/dist/{chunk-NGWVWCWP.cjs → chunk-6AFXSTEN.cjs} +3 -3
  4. package/dist/{chunk-GHIVSSM5.js → chunk-7YHGZZ6G.js} +2 -2
  5. package/dist/{chunk-2EYYCX3O.cjs → chunk-CPISBXIR.cjs} +2 -2
  6. package/dist/{chunk-2EYYCX3O.cjs.map → chunk-CPISBXIR.cjs.map} +1 -1
  7. package/dist/{chunk-7EGLPJKV.cjs → chunk-E7KTAG6X.cjs} +3 -3
  8. package/dist/{chunk-FOCUIKYH.cjs → chunk-EBMORHG3.cjs} +160 -79
  9. package/dist/chunk-EBMORHG3.cjs.map +1 -0
  10. package/dist/{chunk-HXZYERJJ.js → chunk-FKRBO2MK.js} +2 -2
  11. package/dist/{chunk-3RXUFZTR.cjs → chunk-G526QBKQ.cjs} +3 -3
  12. package/dist/{chunk-L5BIVHQJ.cjs → chunk-GGVJALEH.cjs} +3 -3
  13. package/dist/{chunk-ZRXZOZZZ.cjs → chunk-HR57IU52.cjs} +3 -3
  14. package/dist/{chunk-DJ32OEWG.cjs → chunk-HSLAH2PN.cjs} +4 -4
  15. package/dist/{chunk-DJ32OEWG.cjs.map → chunk-HSLAH2PN.cjs.map} +1 -1
  16. package/dist/{chunk-GM7C5PE4.js → chunk-HYP7ISWS.js} +2 -2
  17. package/dist/{chunk-WBKHUVJU.js → chunk-JZYMJ733.js} +2 -2
  18. package/dist/{chunk-5H7AYX72.cjs → chunk-LD66M6G7.cjs} +3 -3
  19. package/dist/{chunk-ZRYD4SFA.js → chunk-LF3XEXLA.js} +2 -2
  20. package/dist/{chunk-74SNQV3K.js → chunk-MBJBFR2H.js} +2 -2
  21. package/dist/{chunk-WK5RAFJ3.js → chunk-NFWMF6T7.js} +4 -4
  22. package/dist/chunk-NFWMF6T7.js.map +1 -0
  23. package/dist/{chunk-EVL7VEPX.js → chunk-NKOG6FTK.js} +2 -2
  24. package/dist/{chunk-GBW67Z6V.cjs → chunk-NTAMXW3Z.cjs} +3 -3
  25. package/dist/{chunk-ZCYU7QA6.cjs → chunk-Q3UM7UCM.cjs} +4 -4
  26. package/dist/chunk-Q3UM7UCM.cjs.map +1 -0
  27. package/dist/{chunk-CUODMU27.js → chunk-T5WAVOPI.js} +236 -155
  28. package/dist/chunk-T5WAVOPI.js.map +1 -0
  29. package/dist/{chunk-O4DWHB3U.js → chunk-YP4CPG34.js} +2 -2
  30. package/dist/{chunk-O4DWHB3U.js.map → chunk-YP4CPG34.js.map} +1 -1
  31. package/dist/{chunk-6DNBJVR5.js → chunk-ZSWTJ6E7.js} +4 -4
  32. package/dist/chunk-ZSWTJ6E7.js.map +1 -0
  33. package/dist/components/CrossmintNFTCollectionView.cjs +3 -3
  34. package/dist/components/CrossmintNFTCollectionView.js +2 -2
  35. package/dist/components/CrossmintNFTDetail.cjs +3 -3
  36. package/dist/components/CrossmintNFTDetail.js +2 -2
  37. package/dist/components/auth/AuthForm.cjs +7 -8
  38. package/dist/components/auth/AuthForm.js +6 -7
  39. package/dist/components/auth/AuthFormBackButton.cjs +28 -2
  40. package/dist/components/auth/AuthFormBackButton.d.cts +1 -1
  41. package/dist/components/auth/AuthFormBackButton.d.ts +1 -1
  42. package/dist/components/auth/AuthFormBackButton.js +27 -1
  43. package/dist/components/auth/AuthFormDialog.cjs +7 -8
  44. package/dist/components/auth/AuthFormDialog.js +6 -7
  45. package/dist/components/auth/EmbeddedAuthForm.cjs +8 -9
  46. package/dist/components/auth/EmbeddedAuthForm.js +7 -8
  47. package/dist/components/auth/methods/email/EmailAuthFlow.cjs +7 -8
  48. package/dist/components/auth/methods/email/EmailAuthFlow.js +6 -7
  49. package/dist/components/auth/methods/email/EmailOTPInput.cjs +7 -8
  50. package/dist/components/auth/methods/email/EmailOTPInput.js +6 -7
  51. package/dist/components/auth/methods/email/EmailSignIn.cjs +7 -8
  52. package/dist/components/auth/methods/email/EmailSignIn.js +6 -7
  53. package/dist/components/auth/methods/farcaster/FarcasterSignIn.cjs +7 -8
  54. package/dist/components/auth/methods/farcaster/FarcasterSignIn.js +6 -7
  55. package/dist/components/auth/methods/google/GoogleSignIn.cjs +7 -8
  56. package/dist/components/auth/methods/google/GoogleSignIn.js +6 -7
  57. package/dist/components/auth/methods/web3/Web3AuthFlow.cjs +7 -8
  58. package/dist/components/auth/methods/web3/Web3AuthFlow.js +6 -7
  59. package/dist/components/auth/methods/web3/{Web3SignIn.cjs → Web3AuthFlowButton.cjs} +8 -9
  60. package/dist/components/auth/methods/web3/Web3AuthFlowButton.d.cts +5 -0
  61. package/dist/components/auth/methods/web3/Web3AuthFlowButton.d.ts +5 -0
  62. package/dist/components/auth/methods/web3/{Web3SignIn.js → Web3AuthFlowButton.js} +9 -10
  63. package/dist/components/auth/methods/web3/{Web3ConnectButton.cjs → Web3Connector.cjs} +3 -3
  64. package/dist/components/auth/methods/web3/{Web3ConnectButton.d.cts → Web3Connector.d.cts} +2 -2
  65. package/dist/components/auth/methods/web3/{Web3ConnectButton.d.ts → Web3Connector.d.ts} +2 -2
  66. package/dist/components/auth/methods/web3/{Web3ConnectButton.js → Web3Connector.js} +4 -4
  67. package/dist/components/auth/methods/web3/Web3ConnectorButton.cjs +9 -0
  68. package/dist/components/auth/methods/web3/{Web3ProviderButton.d.cts → Web3ConnectorButton.d.cts} +2 -2
  69. package/dist/components/auth/methods/web3/{Web3ProviderButton.d.ts → Web3ConnectorButton.d.ts} +2 -2
  70. package/dist/components/auth/methods/web3/Web3ConnectorButton.js +9 -0
  71. package/dist/components/auth/methods/web3/{Web3AuthWrapper.cjs → Web3ConnectorContainer.cjs} +8 -9
  72. package/dist/components/auth/methods/web3/{Web3AuthWrapper.d.cts → Web3ConnectorContainer.d.cts} +2 -2
  73. package/dist/components/auth/methods/web3/{Web3AuthWrapper.d.ts → Web3ConnectorContainer.d.ts} +2 -2
  74. package/dist/components/auth/methods/web3/{Web3AuthWrapper.js → Web3ConnectorContainer.js} +9 -10
  75. package/dist/components/auth/methods/web3/Web3Connectors.cjs +7 -8
  76. package/dist/components/auth/methods/web3/Web3Connectors.js +6 -7
  77. package/dist/components/common/Divider.cjs +7 -8
  78. package/dist/components/common/Divider.js +6 -7
  79. package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.cjs +9 -10
  80. package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js +8 -9
  81. package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.cjs +8 -9
  82. package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.js +7 -8
  83. package/dist/components/embed/v3/index.cjs +9 -10
  84. package/dist/components/embed/v3/index.js +8 -9
  85. package/dist/components/hosted/CrossmintPayButton.cjs +3 -3
  86. package/dist/components/hosted/CrossmintPayButton.js +2 -2
  87. package/dist/components/hosted/index.cjs +3 -3
  88. package/dist/components/hosted/index.js +2 -2
  89. package/dist/components/index.cjs +13 -14
  90. package/dist/components/index.js +12 -13
  91. package/dist/consts/version.cjs +2 -2
  92. package/dist/consts/version.js +1 -1
  93. package/dist/hooks/index.cjs +7 -8
  94. package/dist/hooks/index.js +6 -7
  95. package/dist/hooks/useAuth.cjs +7 -8
  96. package/dist/hooks/useAuth.js +6 -7
  97. package/dist/hooks/useCrossmintAuth.cjs +7 -8
  98. package/dist/hooks/useCrossmintAuth.js +6 -7
  99. package/dist/hooks/useCrossmintCheckout.cjs +4 -4
  100. package/dist/hooks/useCrossmintCheckout.js +3 -3
  101. package/dist/hooks/useOAuthWindowListener.cjs +7 -8
  102. package/dist/hooks/useOAuthWindowListener.js +6 -7
  103. package/dist/hooks/useWallet.cjs +7 -8
  104. package/dist/hooks/useWallet.js +6 -7
  105. package/dist/index.cjs +13 -14
  106. package/dist/index.cjs.map +1 -1
  107. package/dist/index.js +12 -13
  108. package/dist/index.js.map +1 -1
  109. package/dist/providers/CrossmintAuthProvider.cjs +7 -8
  110. package/dist/providers/CrossmintAuthProvider.js +6 -7
  111. package/dist/providers/CrossmintWalletProvider.cjs +7 -8
  112. package/dist/providers/CrossmintWalletProvider.js +6 -7
  113. package/dist/providers/auth/AuthFormProvider.cjs +7 -8
  114. package/dist/providers/auth/AuthFormProvider.d.cts +2 -0
  115. package/dist/providers/auth/AuthFormProvider.d.ts +2 -0
  116. package/dist/providers/auth/AuthFormProvider.js +6 -7
  117. package/dist/providers/index.cjs +7 -8
  118. package/dist/providers/index.js +6 -7
  119. package/dist/utils/createCrossmintApiClient.cjs +3 -3
  120. package/dist/utils/createCrossmintApiClient.js +2 -2
  121. package/package.json +4 -4
  122. package/src/components/auth/AuthForm.tsx +24 -2
  123. package/src/components/auth/AuthFormBackButton.tsx +9 -1
  124. package/src/components/auth/AuthFormDialog.tsx +1 -1
  125. package/src/components/auth/methods/email/EmailOTPInput.tsx +5 -3
  126. package/src/components/auth/methods/email/EmailSignIn.tsx +3 -2
  127. package/src/components/auth/methods/farcaster/FarcasterSignIn.tsx +5 -2
  128. package/src/components/auth/methods/web3/Web3AuthFlow.tsx +2 -2
  129. package/src/components/auth/methods/web3/{Web3SignIn.tsx → Web3AuthFlowButton.tsx} +6 -3
  130. package/src/components/auth/methods/web3/{Web3ConnectButton.tsx → Web3Connector.tsx} +1 -1
  131. package/src/components/auth/methods/web3/{Web3ProviderButton.tsx → Web3ConnectorButton.tsx} +1 -1
  132. package/src/components/auth/methods/web3/{Web3AuthWrapper.tsx → Web3ConnectorContainer.tsx} +5 -5
  133. package/src/components/auth/methods/web3/Web3Connectors.tsx +12 -8
  134. package/src/hooks/useOAuthWindowListener.ts +13 -10
  135. package/src/providers/auth/AuthFormProvider.tsx +6 -0
  136. package/dist/chunk-6DNBJVR5.js.map +0 -1
  137. package/dist/chunk-CUODMU27.js.map +0 -1
  138. package/dist/chunk-FOCUIKYH.cjs.map +0 -1
  139. package/dist/chunk-GY6G3ZC2.cjs +0 -41
  140. package/dist/chunk-GY6G3ZC2.cjs.map +0 -1
  141. package/dist/chunk-QJ44PL7L.js +0 -41
  142. package/dist/chunk-QJ44PL7L.js.map +0 -1
  143. package/dist/chunk-WK5RAFJ3.js.map +0 -1
  144. package/dist/chunk-ZCYU7QA6.cjs.map +0 -1
  145. package/dist/components/auth/methods/web3/Web3ProviderButton.cjs +0 -9
  146. package/dist/components/auth/methods/web3/Web3ProviderButton.js +0 -9
  147. package/dist/components/auth/methods/web3/Web3SignIn.d.cts +0 -5
  148. package/dist/components/auth/methods/web3/Web3SignIn.d.ts +0 -5
  149. /package/dist/{chunk-H2WTBOQ5.cjs.map → chunk-3LHIEADG.cjs.map} +0 -0
  150. /package/dist/{chunk-R2H6H2HY.js.map → chunk-4BGD6LSC.js.map} +0 -0
  151. /package/dist/{chunk-NGWVWCWP.cjs.map → chunk-6AFXSTEN.cjs.map} +0 -0
  152. /package/dist/{chunk-GHIVSSM5.js.map → chunk-7YHGZZ6G.js.map} +0 -0
  153. /package/dist/{chunk-7EGLPJKV.cjs.map → chunk-E7KTAG6X.cjs.map} +0 -0
  154. /package/dist/{chunk-HXZYERJJ.js.map → chunk-FKRBO2MK.js.map} +0 -0
  155. /package/dist/{chunk-3RXUFZTR.cjs.map → chunk-G526QBKQ.cjs.map} +0 -0
  156. /package/dist/{chunk-L5BIVHQJ.cjs.map → chunk-GGVJALEH.cjs.map} +0 -0
  157. /package/dist/{chunk-ZRXZOZZZ.cjs.map → chunk-HR57IU52.cjs.map} +0 -0
  158. /package/dist/{chunk-GM7C5PE4.js.map → chunk-HYP7ISWS.js.map} +0 -0
  159. /package/dist/{chunk-WBKHUVJU.js.map → chunk-JZYMJ733.js.map} +0 -0
  160. /package/dist/{chunk-5H7AYX72.cjs.map → chunk-LD66M6G7.cjs.map} +0 -0
  161. /package/dist/{chunk-ZRYD4SFA.js.map → chunk-LF3XEXLA.js.map} +0 -0
  162. /package/dist/{chunk-74SNQV3K.js.map → chunk-MBJBFR2H.js.map} +0 -0
  163. /package/dist/{chunk-EVL7VEPX.js.map → chunk-NKOG6FTK.js.map} +0 -0
  164. /package/dist/{chunk-GBW67Z6V.cjs.map → chunk-NTAMXW3Z.cjs.map} +0 -0
  165. /package/dist/components/auth/methods/web3/{Web3AuthWrapper.cjs.map → Web3AuthFlowButton.cjs.map} +0 -0
  166. /package/dist/components/auth/methods/web3/{Web3AuthWrapper.js.map → Web3AuthFlowButton.js.map} +0 -0
  167. /package/dist/components/auth/methods/web3/{Web3ConnectButton.cjs.map → Web3Connector.cjs.map} +0 -0
  168. /package/dist/components/auth/methods/web3/{Web3ConnectButton.js.map → Web3Connector.js.map} +0 -0
  169. /package/dist/components/auth/methods/web3/{Web3ProviderButton.cjs.map → Web3ConnectorButton.cjs.map} +0 -0
  170. /package/dist/components/auth/methods/web3/{Web3ProviderButton.js.map → Web3ConnectorButton.js.map} +0 -0
  171. /package/dist/components/auth/methods/web3/{Web3SignIn.cjs.map → Web3ConnectorContainer.cjs.map} +0 -0
  172. /package/dist/components/auth/methods/web3/{Web3SignIn.js.map → Web3ConnectorContainer.js.map} +0 -0
@@ -1,9 +1,9 @@
1
1
  import {
2
- Web3ProviderButton
3
- } from "./chunk-WK5RAFJ3.js";
2
+ Web3ConnectorButton
3
+ } from "./chunk-NFWMF6T7.js";
4
4
  import {
5
- Web3ConnectButton
6
- } from "./chunk-6DNBJVR5.js";
5
+ Web3Connector
6
+ } from "./chunk-ZSWTJ6E7.js";
7
7
  import {
8
8
  WagmiAuthProvider
9
9
  } from "./chunk-OZS4WEKF.js";
@@ -33,12 +33,12 @@ import {
33
33
  import {
34
34
  TwindProvider
35
35
  } from "./chunk-HATQVB6H.js";
36
- import {
37
- AuthFormBackButton
38
- } from "./chunk-QJ44PL7L.js";
39
36
  import {
40
37
  classNames
41
38
  } from "./chunk-RZPQIRIY.js";
39
+ import {
40
+ LeftArrowIcon
41
+ } from "./chunk-ZDQGQY7Z.js";
42
42
  import {
43
43
  WalletIcon
44
44
  } from "./chunk-VZIXXIU5.js";
@@ -134,6 +134,7 @@ var AuthFormProvider = ({
134
134
  }) => {
135
135
  const { crossmintAuth } = useCrossmintAuth();
136
136
  const [step, setStep] = useState("initial");
137
+ const [error, setError] = useState(null);
137
138
  const [oauthUrlMap, setOauthUrlMap] = useState(initialOAuthUrlMap);
138
139
  const [isLoadingOauthUrlMap, setIsLoadingOauthUrlMap] = useState(true);
139
140
  const { loginMethods, baseUrl, setDialogOpen, appearance, embeddedWallets } = initialState;
@@ -152,8 +153,9 @@ var AuthFormProvider = ({
152
153
  }));
153
154
  const oauthUrlMap2 = Object.assign({}, ...yield Promise.all(oauthPromiseList));
154
155
  setOauthUrlMap(oauthUrlMap2);
155
- } catch (error) {
156
- console.error("Error fetching OAuth URLs:", error);
156
+ } catch (error2) {
157
+ console.error("Error fetching OAuth URLs:", error2);
158
+ setError("Unable to load oauth providers. Please try again later.");
157
159
  } finally {
158
160
  setIsLoadingOauthUrlMap(false);
159
161
  }
@@ -169,12 +171,14 @@ var AuthFormProvider = ({
169
171
  };
170
172
  const value = {
171
173
  step,
174
+ error,
172
175
  baseUrl,
173
176
  appearance,
174
177
  loginMethods,
175
178
  oauthUrlMap,
176
179
  isLoadingOauthUrlMap,
177
180
  setDialogOpen: handleToggleDialog,
181
+ setError,
178
182
  setStep
179
183
  };
180
184
  return /* @__PURE__ */ jsx(AuthFormContext.Provider, { value, children: /* @__PURE__ */ jsx(WagmiAuthProvider, { children }) });
@@ -185,7 +189,41 @@ import { useState as useState4 } from "react";
185
189
 
186
190
  // src/components/auth/methods/email/EmailOTPInput.tsx
187
191
  import { useState as useState2 } from "react";
188
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
192
+
193
+ // src/components/auth/AuthFormBackButton.tsx
194
+ import { jsx as jsx2 } from "react/jsx-runtime";
195
+ var AuthFormBackButton = (_a) => {
196
+ var _b = _a, {
197
+ className,
198
+ iconColor,
199
+ ringColor,
200
+ onClick
201
+ } = _b, props = __objRest(_b, [
202
+ "className",
203
+ "iconColor",
204
+ "ringColor",
205
+ "onClick"
206
+ ]);
207
+ const { setError } = useAuthForm();
208
+ return /* @__PURE__ */ jsx2(
209
+ "button",
210
+ __spreadProps(__spreadValues({
211
+ className: classNames(
212
+ "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",
213
+ className
214
+ ),
215
+ onClick: (event) => {
216
+ setError(null);
217
+ onClick == null ? void 0 : onClick(event);
218
+ }
219
+ }, props), {
220
+ children: /* @__PURE__ */ jsx2(LeftArrowIcon, { className: "w-6 h-6", style: { color: iconColor } })
221
+ })
222
+ );
223
+ };
224
+
225
+ // src/components/auth/methods/email/EmailOTPInput.tsx
226
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
189
227
  var EMAIL_VERIFICATION_TOKEN_LENGTH = 6;
190
228
  function EmailOTPInput({
191
229
  otpEmailData,
@@ -193,7 +231,7 @@ function EmailOTPInput({
193
231
  }) {
194
232
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
195
233
  const { crossmintAuth } = useCrossmintAuth();
196
- const { appearance, setDialogOpen, setStep } = useAuthForm();
234
+ const { appearance, setDialogOpen, setStep, setError } = useAuthForm();
197
235
  const [token, setToken] = useState2("");
198
236
  const [hasError, setHasError] = useState2(false);
199
237
  const [loading, setLoading] = useState2(false);
@@ -209,8 +247,9 @@ function EmailOTPInput({
209
247
  yield crossmintAuth == null ? void 0 : crossmintAuth.handleRefreshAuthMaterial(oneTimeSecret);
210
248
  setDialogOpen(false);
211
249
  setStep("initial");
212
- } catch (e) {
213
- console.error("Error signing in via email ", e);
250
+ } catch (error) {
251
+ console.error("Error confirming email OTP", error);
252
+ setError("Invalid code. Please try again.");
214
253
  setHasError(true);
215
254
  } finally {
216
255
  setLoading(false);
@@ -221,7 +260,7 @@ function EmailOTPInput({
221
260
  setOtpEmailData(null);
222
261
  };
223
262
  return /* @__PURE__ */ jsxs("div", { children: [
224
- /* @__PURE__ */ jsx2(
263
+ /* @__PURE__ */ jsx3(
225
264
  AuthFormBackButton,
226
265
  {
227
266
  onClick: handleOnBack,
@@ -230,7 +269,7 @@ function EmailOTPInput({
230
269
  }
231
270
  ),
232
271
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-start w-full", children: [
233
- /* @__PURE__ */ jsx2("div", { className: "relative left-3", children: /* @__PURE__ */ jsx2(
272
+ /* @__PURE__ */ jsx3("div", { className: "relative left-3", children: /* @__PURE__ */ jsx3(
234
273
  EmailOtpIcon,
235
274
  {
236
275
  customAccentColor: (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.accent,
@@ -238,7 +277,7 @@ function EmailOTPInput({
238
277
  customBackgroundColor: (_e = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _e.background
239
278
  }
240
279
  ) }),
241
- /* @__PURE__ */ jsx2(
280
+ /* @__PURE__ */ jsx3(
242
281
  "p",
243
282
  {
244
283
  className: "text-base font-normal mt-4 mb-1 text-center text-cm-text-primary",
@@ -246,7 +285,7 @@ function EmailOTPInput({
246
285
  children: "Check your email"
247
286
  }
248
287
  ),
249
- /* @__PURE__ */ jsx2(
288
+ /* @__PURE__ */ jsx3(
250
289
  "p",
251
290
  {
252
291
  className: "text-center text-cm-text-secondary px-4",
@@ -254,7 +293,7 @@ function EmailOTPInput({
254
293
  children: "A temporary login code has been sent to your email"
255
294
  }
256
295
  ),
257
- /* @__PURE__ */ jsx2("div", { className: "py-8", children: /* @__PURE__ */ jsx2(
296
+ /* @__PURE__ */ jsx3("div", { className: "py-8", children: /* @__PURE__ */ jsx3(
258
297
  InputOTP,
259
298
  {
260
299
  maxLength: EMAIL_VERIFICATION_TOKEN_LENGTH,
@@ -262,6 +301,7 @@ function EmailOTPInput({
262
301
  onChange: (val) => {
263
302
  setToken(val);
264
303
  setHasError(false);
304
+ setError(null);
265
305
  },
266
306
  onComplete: handleOnSubmit,
267
307
  disabled: loading,
@@ -275,19 +315,19 @@ function EmailOTPInput({
275
315
  borderRadius: appearance == null ? void 0 : appearance.borderRadius
276
316
  },
277
317
  children: /* @__PURE__ */ jsxs(InputOTPGroup, { children: [
278
- /* @__PURE__ */ jsx2(InputOTPSlot, { index: 0, hasError }),
279
- /* @__PURE__ */ jsx2(InputOTPSlot, { index: 1, hasError }),
280
- /* @__PURE__ */ jsx2(InputOTPSlot, { index: 2, hasError }),
281
- /* @__PURE__ */ jsx2(InputOTPSlot, { index: 3, hasError }),
282
- /* @__PURE__ */ jsx2(InputOTPSlot, { index: 4, hasError }),
283
- /* @__PURE__ */ jsx2(InputOTPSlot, { index: 5, hasError })
318
+ /* @__PURE__ */ jsx3(InputOTPSlot, { index: 0, hasError }),
319
+ /* @__PURE__ */ jsx3(InputOTPSlot, { index: 1, hasError }),
320
+ /* @__PURE__ */ jsx3(InputOTPSlot, { index: 2, hasError }),
321
+ /* @__PURE__ */ jsx3(InputOTPSlot, { index: 3, hasError }),
322
+ /* @__PURE__ */ jsx3(InputOTPSlot, { index: 4, hasError }),
323
+ /* @__PURE__ */ jsx3(InputOTPSlot, { index: 5, hasError })
284
324
  ] })
285
325
  }
286
326
  ) }),
287
327
  /* @__PURE__ */ jsxs("p", { className: "text-sm leading-tight text-cm-text-secondary text-center", children: [
288
- /* @__PURE__ */ jsx2("span", { style: { color: (_t = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _t.textSecondary }, children: "Can't find the email? Check spam folder or contact" }),
328
+ /* @__PURE__ */ jsx3("span", { style: { color: (_t = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _t.textSecondary }, children: "Can't find the email? Check spam folder or contact" }),
289
329
  " ",
290
- /* @__PURE__ */ jsx2(
330
+ /* @__PURE__ */ jsx3(
291
331
  "a",
292
332
  {
293
333
  className: "transition-opacity duration-150 text-cm-link hover:opacity-70",
@@ -306,11 +346,11 @@ function EmailOTPInput({
306
346
  import { useState as useState3 } from "react";
307
347
  import Color from "color";
308
348
  import { isEmailValid } from "@crossmint/common-sdk-auth";
309
- import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
349
+ import { Fragment, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
310
350
  function EmailSignIn({ setOtpEmailData }) {
311
351
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
312
352
  const { crossmintAuth } = useCrossmintAuth();
313
- const { appearance, setStep } = useAuthForm();
353
+ const { appearance, setStep, setError } = useAuthForm();
314
354
  const [emailInput, setEmailInput] = useState3("");
315
355
  const [emailError, setEmailError] = useState3("");
316
356
  const [isLoading, setIsLoading] = useState3(false);
@@ -329,11 +369,11 @@ function EmailSignIn({ setOtpEmailData }) {
329
369
  setStep("otp");
330
370
  } catch (_e2) {
331
371
  setIsLoading(false);
332
- setEmailError("Failed to send email. Please try again or contact support.");
372
+ setError("Failed to send email. Please try again or contact support.");
333
373
  }
334
374
  });
335
375
  }
336
- return /* @__PURE__ */ jsx3(Fragment, { children: /* @__PURE__ */ jsx3("div", { className: "flex flex-col items-start justify-start w-full rounded-lg", children: /* @__PURE__ */ jsxs2("div", { className: "w-full", children: [
376
+ return /* @__PURE__ */ jsx4(Fragment, { children: /* @__PURE__ */ jsx4("div", { className: "flex flex-col items-start justify-start w-full rounded-lg", children: /* @__PURE__ */ jsxs2("div", { className: "w-full", children: [
337
377
  /* @__PURE__ */ jsxs2(
338
378
  "form",
339
379
  {
@@ -342,8 +382,8 @@ function EmailSignIn({ setOtpEmailData }) {
342
382
  onSubmit: handleOnSubmit,
343
383
  noValidate: true,
344
384
  children: [
345
- /* @__PURE__ */ jsx3("label", { htmlFor: "emailInput", className: "sr-only", children: "Email" }),
346
- /* @__PURE__ */ jsx3(
385
+ /* @__PURE__ */ jsx4("label", { htmlFor: "emailInput", className: "sr-only", children: "Email" }),
386
+ /* @__PURE__ */ jsx4(
347
387
  "input",
348
388
  {
349
389
  className: classNames(
@@ -367,14 +407,15 @@ function EmailSignIn({ setOtpEmailData }) {
367
407
  onChange: (e) => {
368
408
  setEmailInput(e.target.value);
369
409
  setEmailError("");
410
+ setError(null);
370
411
  },
371
412
  readOnly: isLoading,
372
413
  "aria-describedby": "emailError"
373
414
  }
374
415
  ),
375
416
  /* @__PURE__ */ jsxs2("div", { className: "absolute inset-y-0 right-0 flex items-center pr-4", children: [
376
- emailError && /* @__PURE__ */ jsx3(AlertIcon, { customColor: (_g = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _g.danger }),
377
- isLoading && /* @__PURE__ */ jsx3(
417
+ emailError && /* @__PURE__ */ jsx4(AlertIcon, { customColor: (_g = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _g.danger }),
418
+ isLoading && /* @__PURE__ */ jsx4(
378
419
  Spinner,
379
420
  {
380
421
  style: {
@@ -383,7 +424,7 @@ function EmailSignIn({ setOtpEmailData }) {
383
424
  }
384
425
  }
385
426
  ),
386
- !emailError && !isLoading && /* @__PURE__ */ jsx3(
427
+ !emailError && !isLoading && /* @__PURE__ */ jsx4(
387
428
  "button",
388
429
  {
389
430
  type: "submit",
@@ -397,26 +438,26 @@ function EmailSignIn({ setOtpEmailData }) {
397
438
  ]
398
439
  }
399
440
  ),
400
- emailError && /* @__PURE__ */ jsx3("p", { className: "text-xs text-red-500 mb-2 pt-2", children: emailError })
441
+ emailError && /* @__PURE__ */ jsx4("p", { className: "text-xs text-red-500 mb-2 pt-2", children: emailError })
401
442
  ] }) }) });
402
443
  }
403
444
 
404
445
  // src/components/auth/methods/email/EmailAuthFlow.tsx
405
- import { jsx as jsx4 } from "react/jsx-runtime";
446
+ import { jsx as jsx5 } from "react/jsx-runtime";
406
447
  function EmailAuthFlow() {
407
448
  const { step } = useAuthForm();
408
449
  const [otpEmailData, setOtpEmailData] = useState4(null);
409
450
  if (step === "otp") {
410
- return /* @__PURE__ */ jsx4(EmailOTPInput, { otpEmailData, setOtpEmailData });
451
+ return /* @__PURE__ */ jsx5(EmailOTPInput, { otpEmailData, setOtpEmailData });
411
452
  }
412
453
  if (step === "initial") {
413
- return /* @__PURE__ */ jsx4(EmailSignIn, { setOtpEmailData });
454
+ return /* @__PURE__ */ jsx5(EmailSignIn, { setOtpEmailData });
414
455
  }
415
456
  return null;
416
457
  }
417
458
 
418
459
  // src/components/common/Divider.tsx
419
- import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
460
+ import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
420
461
  function Divider({ appearance, text }) {
421
462
  var _a, _b, _c;
422
463
  const { step } = useAuthForm();
@@ -424,8 +465,8 @@ function Divider({ appearance, text }) {
424
465
  return null;
425
466
  }
426
467
  return /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-center w-full pt-2 pb-3", children: [
427
- /* @__PURE__ */ jsx5("span", { className: "w-full h-[1px] bg-cm-border", style: { backgroundColor: (_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.border } }),
428
- text != null ? /* @__PURE__ */ jsx5(
468
+ /* @__PURE__ */ jsx6("span", { className: "w-full h-[1px] bg-cm-border", style: { backgroundColor: (_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.border } }),
469
+ text != null ? /* @__PURE__ */ jsx6(
429
470
  "p",
430
471
  {
431
472
  className: "flex-none px-2 text-sm text-cm-text-primary",
@@ -433,7 +474,7 @@ function Divider({ appearance, text }) {
433
474
  children: text
434
475
  }
435
476
  ) : null,
436
- /* @__PURE__ */ jsx5("span", { className: "w-full h-[1px] bg-cm-border", style: { backgroundColor: (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.border } })
477
+ /* @__PURE__ */ jsx6("span", { className: "w-full h-[1px] bg-cm-border", style: { backgroundColor: (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.border } })
437
478
  ] });
438
479
  }
439
480
 
@@ -443,14 +484,13 @@ import { useEffect as useEffect2, useRef, useState as useState5 } from "react";
443
484
  import { z } from "zod";
444
485
  var useOAuthWindowListener = (provider) => {
445
486
  const { crossmintAuth } = useCrossmintAuth();
446
- const { oauthUrlMap } = useAuthForm();
487
+ const { oauthUrlMap, setError } = useAuthForm();
447
488
  const [isLoading, setIsLoading] = useState5(false);
448
489
  const childRef = useRef(null);
449
490
  useEffect2(() => {
450
491
  if (childRef.current == null) {
451
492
  childRef.current = new ChildWindow(window.opener || window.parent, "*", {
452
- incomingEvents,
453
- outgoingEvents
493
+ incomingEvents
454
494
  });
455
495
  }
456
496
  return () => {
@@ -464,6 +504,7 @@ var useOAuthWindowListener = (provider) => {
464
504
  throw new Error("Child window not initialized");
465
505
  }
466
506
  setIsLoading(true);
507
+ setError(null);
467
508
  const popup = yield PopupWindow.init(oauthUrlMap[provider], {
468
509
  awaitToLoad: false,
469
510
  crossOrigin: true,
@@ -477,7 +518,15 @@ var useOAuthWindowListener = (provider) => {
477
518
  popup.window.close();
478
519
  setIsLoading(false);
479
520
  });
521
+ const handleError = (data) => {
522
+ var _a;
523
+ setError(data.error);
524
+ (_a = childRef.current) == null ? void 0 : _a.off("errorFromPopupCallback");
525
+ popup.window.close();
526
+ setIsLoading(false);
527
+ };
480
528
  childRef.current.on("authMaterialFromPopupCallback", handleAuthMaterial);
529
+ childRef.current.on("errorFromPopupCallback", handleError);
481
530
  const checkWindowClosure = setInterval(() => {
482
531
  var _a;
483
532
  if (popup.window.closed) {
@@ -493,14 +542,12 @@ var useOAuthWindowListener = (provider) => {
493
542
  };
494
543
  };
495
544
  var incomingEvents = {
496
- authMaterialFromPopupCallback: z.object({ oneTimeSecret: z.string() })
497
- };
498
- var outgoingEvents = {
499
- authMaterialFromAuthFrame: z.object({ oneTimeSecret: z.string() })
545
+ authMaterialFromPopupCallback: z.object({ oneTimeSecret: z.string() }),
546
+ errorFromPopupCallback: z.object({ error: z.string() })
500
547
  };
501
548
 
502
549
  // src/components/auth/methods/google/GoogleSignIn.tsx
503
- import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
550
+ import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
504
551
  function GoogleSignIn(_a) {
505
552
  var props = __objRest(_a, []);
506
553
  var _a2, _b, _c, _d;
@@ -527,8 +574,8 @@ function GoogleSignIn(_a) {
527
574
  }, props), {
528
575
  children: [
529
576
  /* @__PURE__ */ jsxs4(Fragment2, { children: [
530
- /* @__PURE__ */ jsx6(GoogleIcon, { className: "h-[25px] w-[25px] absolute left-[18px]" }),
531
- isLoading ? /* @__PURE__ */ jsx6(
577
+ /* @__PURE__ */ jsx7(GoogleIcon, { className: "h-[25px] w-[25px] absolute left-[18px]" }),
578
+ isLoading ? /* @__PURE__ */ jsx7(
532
579
  Spinner,
533
580
  {
534
581
  style: {
@@ -536,7 +583,7 @@ function GoogleSignIn(_a) {
536
583
  fill: (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.textPrimary
537
584
  }
538
585
  }
539
- ) : /* @__PURE__ */ jsx6(
586
+ ) : /* @__PURE__ */ jsx7(
540
587
  "span",
541
588
  {
542
589
  className: "font-medium",
@@ -545,7 +592,7 @@ function GoogleSignIn(_a) {
545
592
  }
546
593
  )
547
594
  ] }),
548
- /* @__PURE__ */ jsx6("span", { className: "sr-only", children: "Sign in with Google" })
595
+ /* @__PURE__ */ jsx7("span", { className: "sr-only", children: "Sign in with Google" })
549
596
  ]
550
597
  })
551
598
  );
@@ -554,12 +601,12 @@ function GoogleSignIn(_a) {
554
601
  // src/components/auth/methods/farcaster/FarcasterSignIn.tsx
555
602
  import { useEffect as useEffect3, useMemo, useState as useState6 } from "react";
556
603
  import { useSignIn, QRCode } from "@farcaster/auth-kit";
557
- import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
604
+ import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
558
605
  function FarcasterSignIn() {
559
606
  var _a, _b;
560
- const { step, appearance, setStep } = useAuthForm();
607
+ const { step, appearance, setStep, setError } = useAuthForm();
561
608
  if (step === "initial") {
562
- return /* @__PURE__ */ jsx7("div", { children: /* @__PURE__ */ jsxs5(
609
+ return /* @__PURE__ */ jsx8("div", { children: /* @__PURE__ */ jsxs5(
563
610
  "button",
564
611
  {
565
612
  className: classNames(
@@ -573,10 +620,11 @@ function FarcasterSignIn() {
573
620
  },
574
621
  onClick: () => {
575
622
  setStep("qrCode");
623
+ setError(null);
576
624
  },
577
625
  children: [
578
- /* @__PURE__ */ jsx7(FarcasterIcon, { className: "h-[25px] w-[25px] absolute left-[18px]" }),
579
- /* @__PURE__ */ jsx7(
626
+ /* @__PURE__ */ jsx8(FarcasterIcon, { className: "h-[25px] w-[25px] absolute left-[18px]" }),
627
+ /* @__PURE__ */ jsx8(
580
628
  "span",
581
629
  {
582
630
  className: "font-medium",
@@ -584,20 +632,20 @@ function FarcasterSignIn() {
584
632
  children: "Sign in with Farcaster"
585
633
  }
586
634
  ),
587
- /* @__PURE__ */ jsx7("span", { className: "sr-only", children: "Sign in with Farcaster" })
635
+ /* @__PURE__ */ jsx8("span", { className: "sr-only", children: "Sign in with Farcaster" })
588
636
  ]
589
637
  }
590
638
  ) });
591
639
  }
592
640
  if (step === "qrCode") {
593
- return /* @__PURE__ */ jsx7(FarcasterQRCode, {});
641
+ return /* @__PURE__ */ jsx8(FarcasterQRCode, {});
594
642
  }
595
643
  return null;
596
644
  }
597
645
  function FarcasterQRCode() {
598
646
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
599
647
  const { crossmintAuth } = useCrossmintAuth();
600
- const { appearance, setStep, setDialogOpen } = useAuthForm();
648
+ const { appearance, setStep, setDialogOpen, setError } = useAuthForm();
601
649
  const [farcasterData, setFarcasterData] = useState6(null);
602
650
  const farcasterProps = useMemo(
603
651
  () => ({
@@ -609,6 +657,7 @@ function FarcasterQRCode() {
609
657
  );
610
658
  const { signIn, url: qrCodeUrl, connect, signOut, isConnected } = useSignIn(farcasterProps);
611
659
  const handleFarcasterSignIn = (data) => __async(this, null, function* () {
660
+ setError(null);
612
661
  try {
613
662
  const oneTimeSecret = yield crossmintAuth == null ? void 0 : crossmintAuth.signInWithFarcaster(data);
614
663
  yield crossmintAuth == null ? void 0 : crossmintAuth.handleRefreshAuthMaterial(oneTimeSecret);
@@ -616,6 +665,7 @@ function FarcasterQRCode() {
616
665
  setStep("initial");
617
666
  } catch (error) {
618
667
  console.error("Error during Farcaster sign-in:", error);
668
+ setError("Failed to sign in with Farcaster");
619
669
  }
620
670
  });
621
671
  useEffect3(() => {
@@ -632,7 +682,7 @@ function FarcasterQRCode() {
632
682
  connect();
633
683
  }, []);
634
684
  return /* @__PURE__ */ jsxs5("div", { children: [
635
- /* @__PURE__ */ jsx7(
685
+ /* @__PURE__ */ jsx8(
636
686
  AuthFormBackButton,
637
687
  {
638
688
  onClick: () => {
@@ -645,7 +695,7 @@ function FarcasterQRCode() {
645
695
  ),
646
696
  /* @__PURE__ */ jsxs5("div", { className: "flex flex-col items-center gap-4", children: [
647
697
  /* @__PURE__ */ jsxs5("div", { className: "text-center", children: [
648
- /* @__PURE__ */ jsx7(
698
+ /* @__PURE__ */ jsx8(
649
699
  "h3",
650
700
  {
651
701
  className: "text-lg font-semibold text-cm-text-primary mb-2",
@@ -653,7 +703,7 @@ function FarcasterQRCode() {
653
703
  children: "Sign in with Farcaster"
654
704
  }
655
705
  ),
656
- /* @__PURE__ */ jsx7(
706
+ /* @__PURE__ */ jsx8(
657
707
  "p",
658
708
  {
659
709
  className: "text-base font-normal text-cm-text-secondary",
@@ -662,7 +712,7 @@ function FarcasterQRCode() {
662
712
  }
663
713
  )
664
714
  ] }),
665
- /* @__PURE__ */ jsx7(
715
+ /* @__PURE__ */ jsx8(
666
716
  "div",
667
717
  {
668
718
  className: "bg-white aspect-square rounded-lg p-4",
@@ -670,7 +720,7 @@ function FarcasterQRCode() {
670
720
  backgroundColor: (_e = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _e.inputBackground,
671
721
  borderRadius: appearance == null ? void 0 : appearance.borderRadius
672
722
  },
673
- children: qrCodeUrl != null ? /* @__PURE__ */ jsx7(QRCode, { uri: qrCodeUrl, size: 280 }) : /* @__PURE__ */ jsx7("div", { className: "min-h-[246px] flex items-center justify-center", children: /* @__PURE__ */ jsx7(
723
+ children: qrCodeUrl != null ? /* @__PURE__ */ jsx8(QRCode, { uri: qrCodeUrl, size: 280 }) : /* @__PURE__ */ jsx8("div", { className: "min-h-[246px] flex items-center justify-center", children: /* @__PURE__ */ jsx8(
674
724
  Spinner,
675
725
  {
676
726
  style: {
@@ -682,7 +732,7 @@ function FarcasterQRCode() {
682
732
  }
683
733
  ),
684
734
  qrCodeUrl ? /* @__PURE__ */ jsxs5(Fragment3, { children: [
685
- /* @__PURE__ */ jsx7(
735
+ /* @__PURE__ */ jsx8(
686
736
  "p",
687
737
  {
688
738
  className: "text-base text-center font-normal text-cm-text-secondary",
@@ -690,7 +740,7 @@ function FarcasterQRCode() {
690
740
  children: "Alternatively, click on this link to open Warpcast."
691
741
  }
692
742
  ),
693
- /* @__PURE__ */ jsx7(
743
+ /* @__PURE__ */ jsx8(
694
744
  "a",
695
745
  {
696
746
  href: qrCodeUrl,
@@ -706,11 +756,11 @@ function FarcasterQRCode() {
706
756
  ] });
707
757
  }
708
758
 
709
- // src/components/auth/methods/web3/Web3SignIn.tsx
710
- import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
711
- function Web3SignIn() {
759
+ // src/components/auth/methods/web3/Web3AuthFlowButton.tsx
760
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
761
+ function Web3AuthFlowButton() {
712
762
  var _a, _b, _c, _d, _e;
713
- const { step, appearance, setStep } = useAuthForm();
763
+ const { step, appearance, setStep, setError } = useAuthForm();
714
764
  if (step !== "initial") {
715
765
  return null;
716
766
  }
@@ -727,39 +777,41 @@ function Web3SignIn() {
727
777
  borderColor: (_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.border,
728
778
  backgroundColor: (_b = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _b.buttonBackground
729
779
  },
730
- onClick: () => setStep("web3"),
780
+ onClick: () => {
781
+ setStep("web3");
782
+ setError(null);
783
+ },
731
784
  children: [
732
- /* @__PURE__ */ jsx8(
785
+ /* @__PURE__ */ jsx9(
733
786
  WalletIcon,
734
787
  {
735
788
  className: "h-[21px] w-[21px] absolute left-[20px]",
736
789
  style: { color: (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.textPrimary }
737
790
  }
738
791
  ),
739
- /* @__PURE__ */ jsx8("span", { className: "font-medium", style: { margin: "0px 32px", color: (_d = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _d.textPrimary }, children: "Continue with a wallet" }),
740
- /* @__PURE__ */ jsx8(
792
+ /* @__PURE__ */ jsx9("span", { className: "font-medium", style: { margin: "0px 32px", color: (_d = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _d.textPrimary }, children: "Continue with a wallet" }),
793
+ /* @__PURE__ */ jsx9(
741
794
  ChevronRightIcon,
742
795
  {
743
796
  className: "h-[21px] w-[21px] absolute right-[20px]",
744
797
  style: { color: (_e = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _e.textSecondary }
745
798
  }
746
799
  ),
747
- /* @__PURE__ */ jsx8("span", { className: "sr-only", children: "Continue with a wallet" })
800
+ /* @__PURE__ */ jsx9("span", { className: "sr-only", children: "Continue with a wallet" })
748
801
  ]
749
802
  }
750
803
  );
751
804
  }
752
805
 
753
- // src/components/auth/methods/web3/Web3AuthWrapper.tsx
806
+ // src/components/auth/methods/web3/Web3ConnectorContainer.tsx
754
807
  import { useState as useState7, useEffect as useEffect4 } from "react";
755
808
  import { useAccount, useChainId, useConnect, useSignMessage } from "wagmi";
756
- import { jsx as jsx9 } from "react/jsx-runtime";
757
- function Web3AuthWrapper({ providerType, flag, icon }) {
809
+ import { jsx as jsx10 } from "react/jsx-runtime";
810
+ function Web3ConnectorContainer({ providerType, flag, icon }) {
758
811
  var _a, _b;
759
812
  const { crossmintAuth } = useCrossmintAuth();
760
- const { appearance } = useAuthForm();
813
+ const { appearance, error, setError } = useAuthForm();
761
814
  const [isLoading, setIsLoading] = useState7(false);
762
- const [error, setError] = useState7(null);
763
815
  const chainId = useChainId();
764
816
  const { address, status: accountStatus } = useAccount();
765
817
  const { signMessageAsync, status: signMessageStatus } = useSignMessage();
@@ -783,6 +835,7 @@ function Web3AuthWrapper({ providerType, flag, icon }) {
783
835
  return;
784
836
  }
785
837
  setIsLoading(true);
838
+ setError(null);
786
839
  try {
787
840
  const res = yield crossmintAuth == null ? void 0 : crossmintAuth.signInWithSmartWallet(address);
788
841
  const signature = yield signMessageAsync({ message: res.challenge });
@@ -797,8 +850,8 @@ function Web3AuthWrapper({ providerType, flag, icon }) {
797
850
  }
798
851
  });
799
852
  const isLoadingOrPending = isLoading || accountStatus === "connecting" || accountStatus === "reconnecting" || signMessageStatus === "pending";
800
- return /* @__PURE__ */ jsx9(
801
- Web3ConnectButton,
853
+ return /* @__PURE__ */ jsx10(
854
+ Web3Connector,
802
855
  {
803
856
  icon,
804
857
  appearance,
@@ -818,7 +871,7 @@ function Web3AuthWrapper({ providerType, flag, icon }) {
818
871
 
819
872
  // src/components/auth/methods/web3/Web3Connectors.tsx
820
873
  import { useAccount as useAccount2, useDisconnect } from "wagmi";
821
- import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
874
+ import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
822
875
  function Web3Connectors() {
823
876
  var _a, _b, _c, _d, _e, _f, _g;
824
877
  const { appearance, step, setStep } = useAuthForm();
@@ -826,7 +879,7 @@ function Web3Connectors() {
826
879
  const { disconnect } = useDisconnect();
827
880
  if (step === "web3") {
828
881
  return /* @__PURE__ */ jsxs7(Fragment4, { children: [
829
- /* @__PURE__ */ jsx10(
882
+ /* @__PURE__ */ jsx11(
830
883
  AuthFormBackButton,
831
884
  {
832
885
  onClick: () => setStep("initial"),
@@ -835,7 +888,7 @@ function Web3Connectors() {
835
888
  }
836
889
  ),
837
890
  /* @__PURE__ */ jsxs7("div", { className: "flex flex-col items-center gap-2", children: [
838
- /* @__PURE__ */ jsx10("div", { className: "text-center mb-6", children: /* @__PURE__ */ jsx10(
891
+ /* @__PURE__ */ jsx11("div", { className: "text-center mb-6", children: /* @__PURE__ */ jsx11(
839
892
  "h3",
840
893
  {
841
894
  className: "text-lg font-semibold text-cm-text-primary",
@@ -844,8 +897,8 @@ function Web3Connectors() {
844
897
  }
845
898
  ) }),
846
899
  /* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-[10px] w-full", children: [
847
- /* @__PURE__ */ jsx10(
848
- Web3ProviderButton,
900
+ /* @__PURE__ */ jsx11(
901
+ Web3ConnectorButton,
849
902
  {
850
903
  title: "Metamask",
851
904
  appearance,
@@ -860,8 +913,8 @@ function Web3Connectors() {
860
913
  }
861
914
  }
862
915
  ),
863
- /* @__PURE__ */ jsx10(
864
- Web3ProviderButton,
916
+ /* @__PURE__ */ jsx11(
917
+ Web3ConnectorButton,
865
918
  {
866
919
  title: "WalletConnect",
867
920
  appearance,
@@ -882,119 +935,146 @@ function Web3Connectors() {
882
935
  }
883
936
  if (step === "web3/metamask") {
884
937
  return /* @__PURE__ */ jsxs7(Fragment4, { children: [
885
- /* @__PURE__ */ jsx10(
938
+ /* @__PURE__ */ jsx11(
886
939
  AuthFormBackButton,
887
940
  {
888
- onClick: () => setStep("web3"),
941
+ onClick: () => {
942
+ setStep("web3");
943
+ },
889
944
  iconColor: (_d = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _d.textPrimary,
890
945
  ringColor: (_e = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _e.accent
891
946
  }
892
947
  ),
893
- /* @__PURE__ */ jsx10(Web3AuthWrapper, { providerType: "metaMaskSDK", flag: "isMetaMask", icon: metamaskIcon })
948
+ /* @__PURE__ */ jsx11(Web3ConnectorContainer, { providerType: "metaMaskSDK", flag: "isMetaMask", icon: metamaskIcon })
894
949
  ] });
895
950
  }
896
951
  if (step === "web3/walletconnect") {
897
952
  return /* @__PURE__ */ jsxs7(Fragment4, { children: [
898
- /* @__PURE__ */ jsx10(
953
+ /* @__PURE__ */ jsx11(
899
954
  AuthFormBackButton,
900
955
  {
901
- onClick: () => setStep("web3"),
956
+ onClick: () => {
957
+ setStep("web3");
958
+ },
902
959
  iconColor: (_f = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _f.textPrimary,
903
960
  ringColor: (_g = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _g.accent
904
961
  }
905
962
  ),
906
- /* @__PURE__ */ jsx10(Web3AuthWrapper, { providerType: "walletConnect", icon: walletConnectIcon })
963
+ /* @__PURE__ */ jsx11(Web3ConnectorContainer, { providerType: "walletConnect", icon: walletConnectIcon })
907
964
  ] });
908
965
  }
909
966
  return null;
910
967
  }
911
968
 
912
969
  // src/components/auth/methods/web3/Web3AuthFlow.tsx
913
- import { jsx as jsx11 } from "react/jsx-runtime";
970
+ import { jsx as jsx12 } from "react/jsx-runtime";
914
971
  function Web3AuthFlow() {
915
972
  const { step } = useAuthForm();
916
973
  if (step.startsWith("web3")) {
917
- return /* @__PURE__ */ jsx11(Web3Connectors, {});
974
+ return /* @__PURE__ */ jsx12(Web3Connectors, {});
918
975
  }
919
976
  if (step === "initial") {
920
- return /* @__PURE__ */ jsx11(Web3SignIn, {});
977
+ return /* @__PURE__ */ jsx12(Web3AuthFlowButton, {});
921
978
  }
922
979
  return null;
923
980
  }
924
981
 
925
982
  // src/components/auth/AuthForm.tsx
926
- import { Fragment as Fragment5, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
983
+ import Color2 from "color";
984
+ import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
927
985
  function AuthForm({ className }) {
928
- var _a, _b, _c, _d;
929
- const { step, appearance, loginMethods, baseUrl } = useAuthForm();
930
- return /* @__PURE__ */ jsxs8("div", { className: classNames("flex flex-col gap-[10px] antialiased animate-none", className), children: [
931
- step === "initial" ? /* @__PURE__ */ jsxs8("div", { children: [
932
- /* @__PURE__ */ jsx12(
933
- "h1",
934
- {
935
- className: "text-2xl font-bold text-cm-text-primary",
936
- style: { color: (_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.textPrimary },
937
- children: "Sign In"
938
- }
986
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
987
+ const { step, appearance, loginMethods, baseUrl, error } = useAuthForm();
988
+ return /* @__PURE__ */ jsxs8(
989
+ "div",
990
+ {
991
+ className: classNames(
992
+ "relative p-6 pb-4 !min-[480px]:p-10 !min-[480px]:pb-8 flex flex-col gap-[10px] antialiased animate-none",
993
+ className
939
994
  ),
940
- /* @__PURE__ */ jsx12(
941
- "p",
942
- {
943
- className: "text-base font-normal mb-3 text-cm-text-secondary",
944
- style: { color: (_b = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _b.textSecondary },
945
- children: "Sign in using one of the options below"
946
- }
947
- )
948
- ] }) : null,
949
- loginMethods.includes("email") ? /* @__PURE__ */ jsxs8(Fragment5, { children: [
950
- /* @__PURE__ */ jsx12(EmailAuthFlow, {}),
951
- loginMethods.length > 1 ? /* @__PURE__ */ jsx12(Divider, { appearance, text: "OR" }) : null
952
- ] }) : null,
953
- loginMethods.includes("google") ? /* @__PURE__ */ jsx12(GoogleSignIn, {}) : null,
954
- loginMethods.includes("farcaster") ? /* @__PURE__ */ jsx12(FarcasterProvider, { baseUrl, children: /* @__PURE__ */ jsx12(FarcasterSignIn, {}) }) : null,
955
- loginMethods.includes("web3") ? /* @__PURE__ */ jsx12(Web3AuthFlow, {}) : null,
956
- step === "initial" || step === "otp" ? /* @__PURE__ */ jsx12(
957
- PoweredByCrossmint,
958
- {
959
- className: "mt-4 justify-center",
960
- color: (_d = (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.textSecondary) != null ? _d : "#A4AFB2"
961
- }
962
- ) : null
963
- ] });
995
+ children: [
996
+ error ? /* @__PURE__ */ jsxs8(
997
+ "div",
998
+ {
999
+ className: "flex items-start justify-start w-full rounded-lg p-2 mt-4 bg-cm-danger-muted",
1000
+ style: {
1001
+ backgroundColor: new Color2((_b = (_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.danger) != null ? _b : "#f44336").alpha(0.12).toString()
1002
+ },
1003
+ children: [
1004
+ /* @__PURE__ */ jsx13(AlertIcon, { customColor: (_d = (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.danger) != null ? _d : "#f44336" }),
1005
+ /* @__PURE__ */ jsx13("p", { className: "ml-2 text-sm", style: { color: (_f = (_e = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _e.danger) != null ? _f : "#f44336" }, children: error })
1006
+ ]
1007
+ }
1008
+ ) : null,
1009
+ step === "initial" ? /* @__PURE__ */ jsxs8("div", { children: [
1010
+ /* @__PURE__ */ jsx13(
1011
+ "h1",
1012
+ {
1013
+ className: "text-2xl font-bold text-cm-text-primary",
1014
+ style: { color: (_g = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _g.textPrimary },
1015
+ children: "Sign In"
1016
+ }
1017
+ ),
1018
+ /* @__PURE__ */ jsx13(
1019
+ "p",
1020
+ {
1021
+ className: "text-base font-normal mb-3 text-cm-text-secondary",
1022
+ style: { color: (_h = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _h.textSecondary },
1023
+ children: "Sign in using one of the options below"
1024
+ }
1025
+ )
1026
+ ] }) : null,
1027
+ loginMethods.includes("email") ? /* @__PURE__ */ jsxs8(Fragment5, { children: [
1028
+ /* @__PURE__ */ jsx13(EmailAuthFlow, {}),
1029
+ loginMethods.length > 1 ? /* @__PURE__ */ jsx13(Divider, { appearance, text: "OR" }) : null
1030
+ ] }) : null,
1031
+ loginMethods.includes("google") ? /* @__PURE__ */ jsx13(GoogleSignIn, {}) : null,
1032
+ loginMethods.includes("farcaster") ? /* @__PURE__ */ jsx13(FarcasterProvider, { baseUrl, children: /* @__PURE__ */ jsx13(FarcasterSignIn, {}) }) : null,
1033
+ loginMethods.includes("web3") ? /* @__PURE__ */ jsx13(Web3AuthFlow, {}) : null,
1034
+ step === "initial" || step === "otp" ? /* @__PURE__ */ jsx13(
1035
+ PoweredByCrossmint,
1036
+ {
1037
+ className: "mt-4 justify-center",
1038
+ color: (_j = (_i = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _i.textSecondary) != null ? _j : "#A4AFB2"
1039
+ }
1040
+ ) : null
1041
+ ]
1042
+ }
1043
+ );
964
1044
  }
965
1045
 
966
1046
  // src/components/auth/AuthFormDialog.tsx
967
1047
  import { useEffect as useEffect5 } from "react";
968
- import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
1048
+ import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
969
1049
  function AuthFormDialog({ open }) {
970
1050
  var _a, _b, _c;
971
1051
  const { appearance, setDialogOpen } = useAuthForm();
972
1052
  useEffect5(() => {
973
1053
  document.body.style.overflow = open ? "hidden" : "";
974
1054
  }, [open]);
975
- return /* @__PURE__ */ jsx13(Dialog, { modal: false, open, onOpenChange: setDialogOpen, children: /* @__PURE__ */ jsxs9(
1055
+ return /* @__PURE__ */ jsx14(Dialog, { modal: false, open, onOpenChange: setDialogOpen, children: /* @__PURE__ */ jsxs9(
976
1056
  DialogContent,
977
1057
  {
978
1058
  onInteractOutside: (e) => e.preventDefault(),
979
1059
  onOpenAutoFocus: (e) => e.preventDefault(),
980
1060
  closeButtonColor: (_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.textPrimary,
981
1061
  closeButtonRingColor: (_b = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _b.accent,
982
- className: "cm-responsive-border-radius-auth-dialog",
1062
+ className: "cm-responsive-border-radius-auth-dialog !p-0 !min-[480px]:p-0",
983
1063
  style: {
984
1064
  borderRadius: appearance == null ? void 0 : appearance.borderRadius,
985
1065
  backgroundColor: (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.background
986
1066
  },
987
1067
  children: [
988
- /* @__PURE__ */ jsx13(VisuallyHidden, { asChild: true, children: /* @__PURE__ */ jsx13(DialogTitle, { children: "Crossmint Auth" }) }),
989
- /* @__PURE__ */ jsx13(VisuallyHidden, { asChild: true, children: /* @__PURE__ */ jsx13(DialogDescription, { children: "Sign in via Crossmint" }) }),
990
- /* @__PURE__ */ jsx13(AuthForm, { className: "max-w-[448px]" })
1068
+ /* @__PURE__ */ jsx14(VisuallyHidden, { asChild: true, children: /* @__PURE__ */ jsx14(DialogTitle, { children: "Crossmint Auth" }) }),
1069
+ /* @__PURE__ */ jsx14(VisuallyHidden, { asChild: true, children: /* @__PURE__ */ jsx14(DialogDescription, { children: "Sign in via Crossmint" }) }),
1070
+ /* @__PURE__ */ jsx14(AuthForm, { className: "max-w-[448px]" })
991
1071
  ]
992
1072
  }
993
1073
  ) });
994
1074
  }
995
1075
 
996
1076
  // src/providers/CrossmintAuthProvider.tsx
997
- import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
1077
+ import { Fragment as Fragment6, jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
998
1078
  var defaultContextValue = {
999
1079
  crossmintAuth: void 0,
1000
1080
  login: () => {
@@ -1084,7 +1164,7 @@ function CrossmintAuthProvider({
1084
1164
  const user2 = yield crossmintAuth.getUser();
1085
1165
  setUser(user2);
1086
1166
  });
1087
- return /* @__PURE__ */ jsx14(TwindProvider, { children: /* @__PURE__ */ jsx14(
1167
+ return /* @__PURE__ */ jsx15(TwindProvider, { children: /* @__PURE__ */ jsx15(
1088
1168
  AuthContext.Provider,
1089
1169
  {
1090
1170
  value: {
@@ -1096,7 +1176,7 @@ function CrossmintAuthProvider({
1096
1176
  status: getAuthStatus(),
1097
1177
  getUser
1098
1178
  },
1099
- children: /* @__PURE__ */ jsx14(
1179
+ children: /* @__PURE__ */ jsx15(
1100
1180
  CrossmintWalletProvider,
1101
1181
  {
1102
1182
  defaultChain: embeddedWallets.defaultChain,
@@ -1113,8 +1193,8 @@ function CrossmintAuthProvider({
1113
1193
  baseUrl: crossmintBaseUrl
1114
1194
  },
1115
1195
  children: [
1116
- /* @__PURE__ */ jsx14(WalletManager, { embeddedWallets, accessToken: crossmint.jwt, children }),
1117
- /* @__PURE__ */ jsx14(AuthFormDialog, { open: dialogOpen })
1196
+ /* @__PURE__ */ jsx15(WalletManager, { embeddedWallets, accessToken: crossmint.jwt, children }),
1197
+ /* @__PURE__ */ jsx15(AuthFormDialog, { open: dialogOpen })
1118
1198
  ]
1119
1199
  }
1120
1200
  )
@@ -1140,7 +1220,7 @@ function WalletManager({
1140
1220
  clearWallet();
1141
1221
  }
1142
1222
  }, [accessToken, status]);
1143
- return /* @__PURE__ */ jsx14(Fragment6, { children });
1223
+ return /* @__PURE__ */ jsx15(Fragment6, { children });
1144
1224
  }
1145
1225
 
1146
1226
  // src/hooks/useAuth.ts
@@ -1153,7 +1233,7 @@ function useAuth() {
1153
1233
  }
1154
1234
 
1155
1235
  // src/providers/CrossmintWalletProvider.tsx
1156
- import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
1236
+ import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
1157
1237
  var WalletContext = createContext3({
1158
1238
  status: "not-loaded",
1159
1239
  getOrCreateWallet: () => Promise.resolve({ startedCreation: false }),
@@ -1225,7 +1305,7 @@ function CrossmintWalletProvider({
1225
1305
  };
1226
1306
  return /* @__PURE__ */ jsxs11(WalletContext.Provider, { value: __spreadProps(__spreadValues({}, walletState), { getOrCreateWallet, clearWallet }), children: [
1227
1307
  children,
1228
- passkeyPromptState.open ? createPortal(/* @__PURE__ */ jsx15(PasskeyPrompt, { state: passkeyPromptState, appearance }), document.body) : null
1308
+ passkeyPromptState.open ? createPortal(/* @__PURE__ */ jsx16(PasskeyPrompt, { state: passkeyPromptState, appearance }), document.body) : null
1229
1309
  ] });
1230
1310
  }
1231
1311
  function deriveErrorState(error) {
@@ -1244,6 +1324,7 @@ export {
1244
1324
  useCrossmintAuth,
1245
1325
  useAuthForm,
1246
1326
  AuthFormProvider,
1327
+ AuthFormBackButton,
1247
1328
  EMAIL_VERIFICATION_TOKEN_LENGTH,
1248
1329
  EmailOTPInput,
1249
1330
  EmailSignIn,
@@ -1252,8 +1333,8 @@ export {
1252
1333
  useOAuthWindowListener,
1253
1334
  GoogleSignIn,
1254
1335
  FarcasterSignIn,
1255
- Web3SignIn,
1256
- Web3AuthWrapper,
1336
+ Web3AuthFlowButton,
1337
+ Web3ConnectorContainer,
1257
1338
  Web3Connectors,
1258
1339
  Web3AuthFlow,
1259
1340
  AuthForm,
@@ -1262,4 +1343,4 @@ export {
1262
1343
  CrossmintAuthProvider,
1263
1344
  useAuth
1264
1345
  };
1265
- //# sourceMappingURL=chunk-CUODMU27.js.map
1346
+ //# sourceMappingURL=chunk-T5WAVOPI.js.map