@coinbase/cdp-react 0.0.86 → 0.0.88
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/assets/CDPReactProvider.css +1 -1
- package/dist/assets/EnrollMfaFlow.css +1 -1
- package/dist/assets/VerifyMfaFlow.css +1 -1
- package/dist/assets/VerifyMfaFlowBackButton.css +1 -0
- package/dist/assets/VerifyMfaInline.css +1 -1
- package/dist/assets/VerifyMfaItem.css +1 -0
- package/dist/assets/VerifyMfaItems.css +1 -0
- package/dist/assets/sms.css +1 -0
- package/dist/chunks/CDPReactProvider.BkmtXUv1.js +337 -0
- package/dist/chunks/{LinkAuthFlow.BaUSMzGH.js → LinkAuthFlow.B4FAtf4V.js} +13 -13
- package/dist/chunks/index.BX4k-ruQ.js +12 -0
- package/dist/chunks/index.Bgx0-QLY.js +12 -0
- package/dist/chunks/{index.C_DV0Ud7.js → index.DgrgIsTX.js} +1 -1
- package/dist/chunks/useSendComponentCallOnce.DGjALrnZ.js +278 -0
- package/dist/components/AuthButton/index.js +1 -1
- package/dist/components/CDPReactProvider/index.js +1 -1
- package/dist/components/CopyEvmKeyButton/index.js +1 -1
- package/dist/components/CopySolanaKeyButton/index.js +1 -1
- package/dist/components/EnrollMfa/EnrollMfaDescription.js +4 -3
- package/dist/components/EnrollMfa/EnrollMfaFlow.js +27 -26
- package/dist/components/EnrollMfa/EnrollMfaFlowBackButton.js +7 -6
- package/dist/components/EnrollMfa/EnrollMfaFlowProvider.d.ts +1 -1
- package/dist/components/EnrollMfa/EnrollMfaFlowProvider.js +5 -4
- package/dist/components/EnrollMfa/EnrollMfaImage.js +7 -6
- package/dist/components/EnrollMfa/EnrollMfaItem.js +7 -6
- package/dist/components/EnrollMfa/EnrollMfaItems.js +28 -25
- package/dist/components/EnrollMfa/EnrollMfaProvider.js +22 -17
- package/dist/components/EnrollMfa/EnrollMfaTitle.js +8 -7
- package/dist/components/EnrollMfa/index.js +134 -128
- package/dist/components/EnrollMfa/methods/sms.d.ts +6 -0
- package/dist/components/EnrollMfa/methods/sms.js +148 -0
- package/dist/components/EnrollMfa/methods/totp.js +24 -19
- package/dist/components/EnrollMfa/types.d.ts +17 -5
- package/dist/components/EnrollMfa/types.js +1 -0
- package/dist/components/EnrollMfa/useEnrollMfaReducer.js +51 -38
- package/dist/components/EnrollMfaModal/index.js +2 -2
- package/dist/components/ExportWallet/index.js +109 -101
- package/dist/components/ExportWalletModal/index.js +2 -2
- package/dist/components/Fund/index.js +2 -2
- package/dist/components/FundModal/index.js +2 -2
- package/dist/components/LinkAuth/LinkAuthFlow.js +2 -2
- package/dist/components/LinkAuth/LinkAuthFlowBackButton.js +2 -2
- package/dist/components/LinkAuth/LinkAuthFlowProvider.js +2 -2
- package/dist/components/LinkAuth/LinkAuthItem.js +1 -1
- package/dist/components/LinkAuth/LinkAuthItems.js +1 -1
- package/dist/components/LinkAuth/LinkAuthProvider.js +1 -1
- package/dist/components/LinkAuth/index.js +4 -4
- package/dist/components/LinkAuth/types.js +1 -1
- package/dist/components/LinkAuth/utils.js +1 -1
- package/dist/components/LinkAuthModal/index.js +3 -3
- package/dist/components/OAuthStatusModal/index.js +2 -2
- package/dist/components/SendEvmTransactionButton/index.js +1 -1
- package/dist/components/SendSolanaTransactionButton/index.js +1 -1
- package/dist/components/SignIn/SignInAuthMethodButtons.js +1 -1
- package/dist/components/SignIn/SignInBackButton.js +12 -12
- package/dist/components/SignIn/SignInDescription.js +2 -2
- package/dist/components/SignIn/SignInForm.js +2 -2
- package/dist/components/SignIn/SignInImage.js +1 -1
- package/dist/components/SignIn/SignInProvider.js +1 -1
- package/dist/components/SignIn/SignInTitle.js +2 -2
- package/dist/components/SignIn/flows/SignInWithEmail.js +1 -1
- package/dist/components/SignIn/flows/SignInWithOAuth.js +1 -1
- package/dist/components/SignIn/flows/SignInWithSms.js +74 -84
- package/dist/components/SignIn/index.js +2 -2
- package/dist/components/SignIn/types.d.ts +2 -0
- package/dist/components/SignIn/types.js +1 -1
- package/dist/components/SignIn/useSignInReducer.js +20 -6
- package/dist/components/SignInModal/index.js +2 -2
- package/dist/components/SignOutButton/index.js +1 -1
- package/dist/components/VerifyMfa/VerifyMfaDescription.d.ts +1 -1
- package/dist/components/VerifyMfa/VerifyMfaDescription.js +24 -14
- package/dist/components/VerifyMfa/VerifyMfaFlow.d.ts +5 -4
- package/dist/components/VerifyMfa/VerifyMfaFlow.js +52 -13
- package/dist/components/VerifyMfa/VerifyMfaFlowBackButton.d.ts +9 -0
- package/dist/components/VerifyMfa/VerifyMfaFlowBackButton.js +40 -0
- package/dist/components/VerifyMfa/VerifyMfaFlowProvider.d.ts +23 -0
- package/dist/components/VerifyMfa/VerifyMfaFlowProvider.js +37 -0
- package/dist/components/VerifyMfa/VerifyMfaImage.d.ts +1 -1
- package/dist/components/VerifyMfa/VerifyMfaImage.js +25 -13
- package/dist/components/VerifyMfa/VerifyMfaItem.d.ts +10 -0
- package/dist/components/VerifyMfa/VerifyMfaItem.js +27 -0
- package/dist/components/VerifyMfa/VerifyMfaItems.d.ts +9 -0
- package/dist/components/VerifyMfa/VerifyMfaItems.js +31 -0
- package/dist/components/VerifyMfa/VerifyMfaProvider.js +27 -14
- package/dist/components/VerifyMfa/VerifyMfaTitle.d.ts +1 -1
- package/dist/components/VerifyMfa/VerifyMfaTitle.js +23 -13
- package/dist/components/VerifyMfa/index.d.ts +6 -2
- package/dist/components/VerifyMfa/index.js +24 -15
- package/dist/components/VerifyMfa/methods/sms.d.ts +6 -0
- package/dist/components/VerifyMfa/methods/sms.js +90 -0
- package/dist/components/VerifyMfa/methods/totp.js +40 -39
- package/dist/components/VerifyMfa/types.d.ts +21 -2
- package/dist/components/VerifyMfa/types.js +1 -0
- package/dist/components/VerifyMfa/useVerifyMfaReducer.d.ts +2 -1
- package/dist/components/VerifyMfa/useVerifyMfaReducer.js +29 -4
- package/dist/components/VerifyMfaInline/index.d.ts +1 -1
- package/dist/components/VerifyMfaInline/index.js +133 -116
- package/dist/components/VerifyMfaModal/index.js +8 -6
- package/dist/components/ui/SwitchTransition/index.js +3 -3
- package/dist/hooks/usePhoneNumberState.d.ts +15 -0
- package/dist/hooks/usePhoneNumberState.js +39 -0
- package/dist/hooks/useTransitionMap.js +24 -22
- package/dist/hooks/useVerifyMfaModal.js +2 -2
- package/dist/index.js +60 -52
- package/dist/utils/transition.d.ts +3 -3
- package/dist/utils/transition.js +21 -20
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -6
- package/dist/chunks/CDPReactProvider.CIQm4C4z.js +0 -299
- package/dist/chunks/index.CKQKBoX2.js +0 -9
- package/dist/chunks/index.Dp-lIxM1.js +0 -9
- package/dist/chunks/useSendComponentCallOnce.BHZMuo6E.js +0 -273
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import "../../chunks/useSendComponentCallOnce.
|
|
2
|
+
import "../../chunks/useSendComponentCallOnce.DGjALrnZ.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "../../chunks/lite.1fxw3LjI.js";
|
|
5
|
-
import "../../chunks/CDPReactProvider.
|
|
5
|
+
import "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
6
6
|
import { E as W, a as g, b as n, c as C, d as T } from "../ExportWallet/index.js";
|
|
7
7
|
import "../ui/Banner/index.js";
|
|
8
8
|
import "../ui/Button/index.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n, jsxs as i, Fragment as f } from "react/jsx-runtime";
|
|
2
|
-
import { u as p } from "../../chunks/useSendComponentCallOnce.
|
|
2
|
+
import { u as p } from "../../chunks/useSendComponentCallOnce.DGjALrnZ.js";
|
|
3
3
|
import { useId as a } from "react";
|
|
4
|
-
import { u as c } from "../../chunks/CDPReactProvider.
|
|
4
|
+
import { u as c } from "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
5
5
|
import { CoinbaseFooter as F } from "../ui/CoinbaseFooter/index.js";
|
|
6
6
|
import { FundForm as l } from "./FundForm.js";
|
|
7
7
|
import { FundProvider as C, useFundContext as _ } from "./FundProvider.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as o, jsxs as u, Fragment as p } from "react/jsx-runtime";
|
|
2
|
-
import { u as w } from "../../chunks/useSendComponentCallOnce.
|
|
2
|
+
import { u as w } from "../../chunks/useSendComponentCallOnce.DGjALrnZ.js";
|
|
3
3
|
import { createContext as j, useState as A, useCallback as F, useMemo as S, useId as $, useContext as z } from "react";
|
|
4
4
|
import { c as x } from "../../chunks/lite.1fxw3LjI.js";
|
|
5
|
-
import { u as V } from "../../chunks/CDPReactProvider.
|
|
5
|
+
import { u as V } from "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
6
6
|
import { Fund as k, FundFooter as D } from "../Fund/index.js";
|
|
7
7
|
import { Button as v } from "../ui/Button/index.js";
|
|
8
8
|
import { Modal as H, ModalContent as L, ModalTitle as R, ModalClose as U, ModalTrigger as W } from "../ui/Modal/index.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import "../../chunks/CDPReactProvider.
|
|
3
|
+
import "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
4
4
|
import "../SignIn/index.js";
|
|
5
5
|
import "@coinbase/cdp-hooks";
|
|
6
6
|
import "../ui/SwitchSlideTransition/index.js";
|
|
7
7
|
import "../ui/VisuallyHidden/index.js";
|
|
8
|
-
import { a as A } from "../../chunks/LinkAuthFlow.
|
|
8
|
+
import { a as A } from "../../chunks/LinkAuthFlow.B4FAtf4V.js";
|
|
9
9
|
import "./LinkAuthItems.js";
|
|
10
10
|
import "./types.js";
|
|
11
11
|
import "../SignIn/SignInProvider.js";
|
|
@@ -3,9 +3,9 @@ import { c as k } from "../../chunks/lite.1fxw3LjI.js";
|
|
|
3
3
|
import "react";
|
|
4
4
|
import { Button as p } from "../ui/Button/index.js";
|
|
5
5
|
import { IconArrowLeft as f } from "../../icons/IconArrowLeft.js";
|
|
6
|
-
import { b as w } from "../../chunks/LinkAuthFlow.
|
|
6
|
+
import { b as w } from "../../chunks/LinkAuthFlow.B4FAtf4V.js";
|
|
7
7
|
import { useLinkAuthContext as _ } from "./LinkAuthProvider.js";
|
|
8
|
-
import "../../chunks/CDPReactProvider.
|
|
8
|
+
import "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
9
9
|
import { methodToView as b } from "./utils.js";
|
|
10
10
|
import '../../assets/LinkAuthFlowBackButton.css';const h = "LinkAuthFlowBackButton-module__button___wPKfW", B = "LinkAuthFlowBackButton-module__icon___OUmzY", o = {
|
|
11
11
|
button: h,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import "../../chunks/CDPReactProvider.
|
|
4
|
-
import { L as e, u as n, b as s } from "../../chunks/LinkAuthFlow.
|
|
3
|
+
import "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
4
|
+
import { L as e, u as n, b as s } from "../../chunks/LinkAuthFlow.B4FAtf4V.js";
|
|
5
5
|
export {
|
|
6
6
|
e as LinkAuthFlowProvider,
|
|
7
7
|
n as useLinkAuthFlow,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { ToggleListItem as s } from "../ui/ToggleListItem/index.js";
|
|
4
|
-
import "../../chunks/CDPReactProvider.
|
|
4
|
+
import "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
5
5
|
const u = ({
|
|
6
6
|
authMethod: n,
|
|
7
7
|
userAlias: e,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { c as I } from "../../chunks/lite.1fxw3LjI.js";
|
|
3
3
|
import { useMemo as b } from "react";
|
|
4
|
-
import "../../chunks/CDPReactProvider.
|
|
4
|
+
import "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
5
5
|
import { IconAppleLogo as d } from "../../icons/IconAppleLogo.js";
|
|
6
6
|
import { IconEnvelope as f } from "../../icons/IconEnvelope.js";
|
|
7
7
|
import { IconGoogleColorLogo as L } from "../../icons/IconGoogleColorLogo.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { useCurrentUser as c } from "@coinbase/cdp-hooks";
|
|
3
3
|
import { createContext as p, useContext as M, useMemo as r, useReducer as A, useEffect as f } from "react";
|
|
4
|
-
import { u as L } from "../../chunks/CDPReactProvider.
|
|
4
|
+
import { u as L } from "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
5
5
|
import { formatPhoneNumber as k } from "../../utils/formatPhoneNumber.js";
|
|
6
6
|
const T = {
|
|
7
7
|
methodToLink: null,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as r, jsxs as h, Fragment as C } from "react/jsx-runtime";
|
|
2
2
|
import { useLinkOAuth as I } from "@coinbase/cdp-hooks";
|
|
3
|
-
import { u as N } from "../../chunks/useSendComponentCallOnce.
|
|
3
|
+
import { u as N } from "../../chunks/useSendComponentCallOnce.DGjALrnZ.js";
|
|
4
4
|
import { useRef as d, useState as P, useCallback as a } from "react";
|
|
5
|
-
import "../../chunks/CDPReactProvider.
|
|
5
|
+
import "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
6
6
|
import { useOauthStatusModal as U } from "../OAuthStatusModal/index.js";
|
|
7
7
|
import { Banner as D } from "../ui/Banner/index.js";
|
|
8
8
|
import { useTimeout as H } from "../../hooks/useTimeout.js";
|
|
9
9
|
import { getMessageFromUnknownError as M } from "../../utils/getMessageFromUnknownError.js";
|
|
10
10
|
import "libphonenumber-js";
|
|
11
11
|
import { toOAuthProviderType as v } from "../../utils/toOAuthProviderType.js";
|
|
12
|
-
import { L as V, a as j } from "../../chunks/LinkAuthFlow.
|
|
13
|
-
import { u as kt } from "../../chunks/LinkAuthFlow.
|
|
12
|
+
import { L as V, a as j } from "../../chunks/LinkAuthFlow.B4FAtf4V.js";
|
|
13
|
+
import { u as kt } from "../../chunks/LinkAuthFlow.B4FAtf4V.js";
|
|
14
14
|
import { LinkAuthFlowBackButton as K } from "./LinkAuthFlowBackButton.js";
|
|
15
15
|
import { LinkAuthItem as pt } from "./LinkAuthItem.js";
|
|
16
16
|
import { LinkAuthItems as At } from "./LinkAuthItems.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as o, jsxs as n, Fragment as d } from "react/jsx-runtime";
|
|
2
|
-
import { u as p } from "../../chunks/useSendComponentCallOnce.
|
|
2
|
+
import { u as p } from "../../chunks/useSendComponentCallOnce.DGjALrnZ.js";
|
|
3
3
|
import { createContext as f, useMemo as L, useContext as g } from "react";
|
|
4
4
|
import { c as A } from "../../chunks/lite.1fxw3LjI.js";
|
|
5
|
-
import "../../chunks/CDPReactProvider.
|
|
5
|
+
import "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
6
6
|
import { LinkAuth as C, LinkAuthError as x } from "../LinkAuth/index.js";
|
|
7
7
|
import { Button as m } from "../ui/Button/index.js";
|
|
8
8
|
import { Modal as b, ModalContent as v, ModalTitle as w, ModalClose as N, ModalTrigger as T } from "../ui/Modal/index.js";
|
|
@@ -11,7 +11,7 @@ import { IconXMark as F } from "../../icons/IconXMark.js";
|
|
|
11
11
|
import { childrenHasComponent as c } from "../../utils/childrenHasComponent.js";
|
|
12
12
|
import { LinkAuthTitle as H } from "../LinkAuth/LinkAuthTitle.js";
|
|
13
13
|
import { LinkAuthFlowBackButton as j } from "../LinkAuth/LinkAuthFlowBackButton.js";
|
|
14
|
-
import { a as B } from "../../chunks/LinkAuthFlow.
|
|
14
|
+
import { a as B } from "../../chunks/LinkAuthFlow.B4FAtf4V.js";
|
|
15
15
|
import '../../assets/LinkAuthModal.css';const S = "LinkAuthModal-module__header___qoco6", D = "LinkAuthModal-module__error___Srl7H", E = "LinkAuthModal-module__trigger___aHDfG", r = {
|
|
16
16
|
header: S,
|
|
17
17
|
error: D,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as s, jsxs as r, Fragment as S } from "react/jsx-runtime";
|
|
2
2
|
import "@coinbase/cdp-core";
|
|
3
3
|
import { useOAuthState as I } from "@coinbase/cdp-hooks";
|
|
4
|
-
import { u as b } from "../../chunks/useSendComponentCallOnce.
|
|
4
|
+
import { u as b } from "../../chunks/useSendComponentCallOnce.DGjALrnZ.js";
|
|
5
5
|
import { useCallback as N, useState as O, useEffect as h, useRef as A } from "react";
|
|
6
|
-
import { a as $ } from "../../chunks/CDPReactProvider.
|
|
6
|
+
import { a as $ } from "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
7
7
|
import { CoinbaseFooter as k } from "../ui/CoinbaseFooter/index.js";
|
|
8
8
|
import { LoadingSpinner as w } from "../ui/LoadingSpinner/index.js";
|
|
9
9
|
import { Modal as E, ModalContent as L, ModalTitle as y, ModalDescription as R } from "../ui/Modal/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as E } from "react/jsx-runtime";
|
|
2
2
|
import { useSendEvmTransaction as _, APIError as S } from "@coinbase/cdp-hooks";
|
|
3
|
-
import { u as b } from "../../chunks/useSendComponentCallOnce.
|
|
3
|
+
import { u as b } from "../../chunks/useSendComponentCallOnce.DGjALrnZ.js";
|
|
4
4
|
import { useState as T, useCallback as y } from "react";
|
|
5
5
|
import { c as C } from "../../chunks/lite.1fxw3LjI.js";
|
|
6
6
|
import { Button as w } from "../ui/Button/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _ } from "react/jsx-runtime";
|
|
2
2
|
import { useSendSolanaTransaction as b, APIError as T } from "@coinbase/cdp-hooks";
|
|
3
|
-
import { u as w } from "../../chunks/useSendComponentCallOnce.
|
|
3
|
+
import { u as w } from "../../chunks/useSendComponentCallOnce.DGjALrnZ.js";
|
|
4
4
|
import { useState as x, useCallback as y } from "react";
|
|
5
5
|
import { c as B } from "../../chunks/lite.1fxw3LjI.js";
|
|
6
6
|
import { Button as C } from "../ui/Button/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback as v, useMemo as y } from "react";
|
|
3
|
-
import "../../chunks/CDPReactProvider.
|
|
3
|
+
import "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
4
4
|
import { useSignInWithOAuth as S } from "./hooks/useSignInWithOAuth.js";
|
|
5
5
|
import { useSignInContext as _ } from "./SignInProvider.js";
|
|
6
6
|
import { Button as C } from "../ui/Button/index.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as f } from "react";
|
|
3
|
-
import { Button as
|
|
4
|
-
import { IconArrowLeft as
|
|
3
|
+
import { Button as _ } from "../ui/Button/index.js";
|
|
4
|
+
import { IconArrowLeft as S } from "../../icons/IconArrowLeft.js";
|
|
5
5
|
import "../../theme/theme.js";
|
|
6
|
-
import { useSignInContext as
|
|
6
|
+
import { useSignInContext as d } from "./SignInProvider.js";
|
|
7
7
|
import "@coinbase/cdp-hooks";
|
|
8
|
-
import "../../chunks/CDPReactProvider.
|
|
9
|
-
import '../../assets/SignInBackButton.css';const
|
|
10
|
-
icon:
|
|
11
|
-
},
|
|
8
|
+
import "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
9
|
+
import '../../assets/SignInBackButton.css';const B = "SignInBackButton-module__icon___stNFS", k = {
|
|
10
|
+
icon: B
|
|
11
|
+
}, E = ({
|
|
12
12
|
step: t,
|
|
13
13
|
children: i,
|
|
14
14
|
onClick: r,
|
|
@@ -17,11 +17,11 @@ import '../../assets/SignInBackButton.css';const _ = "SignInBackButton-module__i
|
|
|
17
17
|
["aria-label"]: s = "Back",
|
|
18
18
|
...a
|
|
19
19
|
}) => {
|
|
20
|
-
const { state: o, dispatch: m } =
|
|
21
|
-
r?.(u), m({ type: "
|
|
20
|
+
const { state: o, dispatch: m } = d(), p = f(() => t || o.step, [t, o.step]), l = (u) => {
|
|
21
|
+
r?.(u), m({ type: "GO_TO_PREVIOUS_STEP" });
|
|
22
22
|
};
|
|
23
23
|
return p !== "verification" ? null : /* @__PURE__ */ n(
|
|
24
|
-
|
|
24
|
+
_,
|
|
25
25
|
{
|
|
26
26
|
type: "button",
|
|
27
27
|
"aria-label": s,
|
|
@@ -29,10 +29,10 @@ import '../../assets/SignInBackButton.css';const _ = "SignInBackButton-module__i
|
|
|
29
29
|
size: e,
|
|
30
30
|
variant: c,
|
|
31
31
|
...a,
|
|
32
|
-
children: i || /* @__PURE__ */ n(
|
|
32
|
+
children: i || /* @__PURE__ */ n(S, { className: k.icon })
|
|
33
33
|
}
|
|
34
34
|
);
|
|
35
35
|
};
|
|
36
36
|
export {
|
|
37
|
-
|
|
37
|
+
E as SignInBackButton
|
|
38
38
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { a as d } from "../../chunks/index.
|
|
3
|
+
import { a as d } from "../../chunks/index.DgrgIsTX.js";
|
|
4
4
|
import { useSignInContext as h } from "./SignInProvider.js";
|
|
5
5
|
import "@coinbase/cdp-hooks";
|
|
6
|
-
import "../../chunks/CDPReactProvider.
|
|
6
|
+
import "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
7
7
|
import '../../assets/SignInDescription.css';const u = "SignInDescription-module__description___jZLc6", _ = {
|
|
8
8
|
description: u
|
|
9
9
|
}, M = ({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as d, useState as I, useLayoutEffect as p } from "react";
|
|
3
|
-
import "../../chunks/CDPReactProvider.
|
|
3
|
+
import "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
4
4
|
import { SwitchFadeTransition as T } from "../ui/SwitchFadeTransition/index.js";
|
|
5
|
-
import { a as y } from "../../chunks/index.
|
|
5
|
+
import { a as y } from "../../chunks/index.DgrgIsTX.js";
|
|
6
6
|
import { useSignInContext as v } from "./SignInProvider.js";
|
|
7
7
|
import "@coinbase/cdp-hooks";
|
|
8
8
|
import '../../assets/SignInForm.css';const E = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { u as a } from "../../chunks/CDPReactProvider.
|
|
2
|
+
import { u as a } from "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
3
3
|
import '../../assets/SignInImage.css';const e = "SignInImage-module__logo___rlzt-", m = {
|
|
4
4
|
logo: e
|
|
5
5
|
}, p = (t) => /^https?:\/\//.test(t), f = ({ className: t = "", alt: s, src: g }) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as h } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as m, useContext as l, useMemo as i } from "react";
|
|
3
|
-
import { u as f } from "../../chunks/CDPReactProvider.
|
|
3
|
+
import { u as f } from "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
4
4
|
import "@coinbase/cdp-hooks";
|
|
5
5
|
import { useSignInReducer as p } from "./useSignInReducer.js";
|
|
6
6
|
const a = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { a as c } from "../../chunks/index.
|
|
3
|
+
import { a as c } from "../../chunks/index.DgrgIsTX.js";
|
|
4
4
|
import { useSignInContext as d } from "./SignInProvider.js";
|
|
5
5
|
import "@coinbase/cdp-hooks";
|
|
6
|
-
import "../../chunks/CDPReactProvider.
|
|
6
|
+
import "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
7
7
|
import '../../assets/SignInTitle.css';const l = "SignInTitle-module__heading___QJ071", g = {
|
|
8
8
|
heading: l
|
|
9
9
|
}, S = ({
|
|
@@ -8,7 +8,7 @@ import { useEmailForm as A } from "../hooks/useEmailForm.js";
|
|
|
8
8
|
import { useOTPForm as B } from "../hooks/useOTPForm.js";
|
|
9
9
|
import { SignInCredentials as G } from "../SignInCredentials.js";
|
|
10
10
|
import { useSignInContext as E } from "../SignInProvider.js";
|
|
11
|
-
import "../../../chunks/CDPReactProvider.
|
|
11
|
+
import "../../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
12
12
|
const J = ["email", "otp"], N = ({
|
|
13
13
|
step: n,
|
|
14
14
|
autoFocus: s,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as h, Fragment as a, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import "@coinbase/cdp-hooks";
|
|
3
3
|
import { useRef as A, useCallback as S, useEffect as v } from "react";
|
|
4
|
-
import { u as m } from "../../../chunks/CDPReactProvider.
|
|
4
|
+
import { u as m } from "../../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
5
5
|
import { useSignInWithOAuth as O } from "../hooks/useSignInWithOAuth.js";
|
|
6
6
|
import { Button as W } from "../../ui/Button/index.js";
|
|
7
7
|
import { ServerError as I } from "../../ui/ServerError/index.js";
|
|
@@ -1,116 +1,106 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useIsSignedIn as
|
|
3
|
-
import "
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { formatPhoneNumber as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
const ee = ["phoneNumber", "otp"], te = ({
|
|
1
|
+
import { jsxs as u, Fragment as c, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useIsSignedIn as M, useSignInWithSms as H, useLinkSms as V, useVerifySmsOTP as q } from "@coinbase/cdp-hooks";
|
|
3
|
+
import { useRef as S, useLayoutEffect as z, useMemo as A } from "react";
|
|
4
|
+
import { OTPForm as B } from "../../forms/OTPForm/index.js";
|
|
5
|
+
import { PhoneNumberForm as G } from "../../forms/PhoneNumberForm/index.js";
|
|
6
|
+
import { SwitchSlideTransition as J } from "../../ui/SwitchSlideTransition/index.js";
|
|
7
|
+
import { usePhoneNumberState as Q } from "../../../hooks/usePhoneNumberState.js";
|
|
8
|
+
import { formatPhoneNumber as U } from "../../../utils/formatPhoneNumber.js";
|
|
9
|
+
import { useOTPForm as X } from "../hooks/useOTPForm.js";
|
|
10
|
+
import { usePhoneNumberForm as Y } from "../hooks/usePhoneNumberForm.js";
|
|
11
|
+
import { SignInCredentials as Z } from "../SignInCredentials.js";
|
|
12
|
+
import { useSignInContext as g } from "../SignInProvider.js";
|
|
13
|
+
import "../../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
14
|
+
const _ = ["phoneNumber", "otp"], $ = ({
|
|
16
15
|
step: o,
|
|
17
16
|
autoFocus: i,
|
|
18
17
|
onSuccess: m,
|
|
19
|
-
children:
|
|
18
|
+
children: a
|
|
20
19
|
}) => {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}), { resendCountdown:
|
|
27
|
-
passwordLength:
|
|
28
|
-
submit: (
|
|
29
|
-
}),
|
|
30
|
-
e.value !== u.value && (f(e), R(e.e164));
|
|
31
|
-
};
|
|
32
|
-
A(() => {
|
|
33
|
-
if (t.phoneNumber === u.e164)
|
|
34
|
-
return;
|
|
35
|
-
const e = Z(t.phoneNumber, c);
|
|
36
|
-
f(e);
|
|
37
|
-
}, [t.phoneNumber, c, u.e164]);
|
|
38
|
-
const g = () => {
|
|
20
|
+
const h = S(null), P = 6, { isSignedIn: N } = M(), { state: e } = g(), { signInWithSms: T } = H(), { linkSms: C } = V(), { verifySmsOTP: O } = q(), p = o || e.step, t = p === "credentials" ? "phoneNumber" : "otp", d = S(t), { setPhoneNumber: I, submitPhoneNumber: f } = Y({
|
|
21
|
+
submit: (n) => N ? C(n) : T({ phoneNumber: n })
|
|
22
|
+
}), { phoneNumberObject: v, countryCode: y, handlePhoneNumberChange: F, handleCountryCodeChange: w } = Q({
|
|
23
|
+
phoneNumber: e.phoneNumber,
|
|
24
|
+
onPhoneNumberChange: I
|
|
25
|
+
}), { resendCountdown: R, resetOTP: D, setOTP: W, startResendTimer: x, submitOtp: E } = X({
|
|
26
|
+
passwordLength: P,
|
|
27
|
+
submit: (n) => O({ flowId: e.flowId, otp: n })
|
|
28
|
+
}), l = () => {
|
|
39
29
|
x(60);
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
const r = new FormData(
|
|
47
|
-
|
|
30
|
+
}, j = () => {
|
|
31
|
+
D(), f({ phoneNumber: e.phoneNumber, onSuccess: l });
|
|
32
|
+
}, L = (n) => {
|
|
33
|
+
n.preventDefault(), f({ phoneNumber: e.phoneNumber, onSuccess: l });
|
|
34
|
+
}, k = (n) => {
|
|
35
|
+
n.preventDefault();
|
|
36
|
+
const r = new FormData(n.currentTarget).get("otp") || e.otp;
|
|
37
|
+
E({ otp: r, onSuccess: m });
|
|
48
38
|
};
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
|
|
39
|
+
return z(() => {
|
|
40
|
+
d.current !== t && (h.current?.transition.toggle(t), d.current = t);
|
|
41
|
+
}, [t]), /* @__PURE__ */ s(
|
|
42
|
+
J,
|
|
53
43
|
{
|
|
54
44
|
autoFocus: i ? "input[type='tel']" : !1,
|
|
55
45
|
animateHeight: !1,
|
|
56
|
-
items:
|
|
46
|
+
items: _,
|
|
57
47
|
initialEntered: !0,
|
|
58
|
-
direction:
|
|
59
|
-
transitionRef:
|
|
60
|
-
children: ({ itemKey:
|
|
48
|
+
direction: t === "otp" ? "left" : "right",
|
|
49
|
+
transitionRef: h,
|
|
50
|
+
children: ({ itemKey: n, ...b }) => {
|
|
61
51
|
let r = null;
|
|
62
|
-
return
|
|
63
|
-
|
|
52
|
+
return n === "phoneNumber" && (r = /* @__PURE__ */ s(
|
|
53
|
+
G,
|
|
64
54
|
{
|
|
65
|
-
countryCode:
|
|
66
|
-
error:
|
|
67
|
-
isPending:
|
|
55
|
+
countryCode: y,
|
|
56
|
+
error: t === "phoneNumber" && e.error || "",
|
|
57
|
+
isPending: e.isPending,
|
|
68
58
|
onCountryCodeChange: w,
|
|
69
|
-
onPhoneNumberChange:
|
|
70
|
-
onSubmit:
|
|
71
|
-
phoneNumber:
|
|
59
|
+
onPhoneNumberChange: F,
|
|
60
|
+
onSubmit: L,
|
|
61
|
+
phoneNumber: v
|
|
72
62
|
}
|
|
73
|
-
)),
|
|
74
|
-
|
|
63
|
+
)), n === "otp" && (r = /* @__PURE__ */ s(
|
|
64
|
+
B,
|
|
75
65
|
{
|
|
76
|
-
canResetOTP:
|
|
77
|
-
error:
|
|
78
|
-
isPending:
|
|
66
|
+
canResetOTP: e.canResetOTP,
|
|
67
|
+
error: t === "otp" && e.error || "",
|
|
68
|
+
isPending: e.isPending,
|
|
79
69
|
onOTPChange: W,
|
|
80
|
-
onResendOTP:
|
|
81
|
-
onSubmit:
|
|
82
|
-
otp:
|
|
83
|
-
resendCountdown:
|
|
84
|
-
successMessage:
|
|
70
|
+
onResendOTP: j,
|
|
71
|
+
onSubmit: k,
|
|
72
|
+
otp: e.otp,
|
|
73
|
+
resendCountdown: R,
|
|
74
|
+
successMessage: e.isSuccess ? "Success!" : void 0
|
|
85
75
|
}
|
|
86
|
-
)), /* @__PURE__ */ s("div", { ...
|
|
76
|
+
)), /* @__PURE__ */ s("div", { ...b, children: a ? a({ step: p, Form: r }) : r });
|
|
87
77
|
}
|
|
88
78
|
}
|
|
89
79
|
);
|
|
90
|
-
},
|
|
80
|
+
}, K = ({ step: o }) => /* @__PURE__ */ u(c, { children: [
|
|
91
81
|
o === "credentials" && "Sign in",
|
|
92
82
|
o === "verification" && "Enter verification code"
|
|
93
|
-
] }),
|
|
94
|
-
const { state: i } =
|
|
95
|
-
() =>
|
|
83
|
+
] }), ee = ({ step: o }) => {
|
|
84
|
+
const { state: i } = g(), m = A(
|
|
85
|
+
() => U(i.phoneNumber),
|
|
96
86
|
[i.phoneNumber]
|
|
97
87
|
);
|
|
98
|
-
return /* @__PURE__ */
|
|
88
|
+
return /* @__PURE__ */ u(c, { children: [
|
|
99
89
|
o === "credentials" && "We’ll send you a verification code via text.",
|
|
100
|
-
o === "verification" && /* @__PURE__ */
|
|
90
|
+
o === "verification" && /* @__PURE__ */ u(c, { children: [
|
|
101
91
|
"Enter the 6 digit code sent to",
|
|
102
92
|
" ",
|
|
103
|
-
m ? /* @__PURE__ */ s(
|
|
93
|
+
m ? /* @__PURE__ */ s(Z, { children: m }) : "your phone number"
|
|
104
94
|
] })
|
|
105
95
|
] });
|
|
106
|
-
},
|
|
107
|
-
description:
|
|
108
|
-
forms:
|
|
109
|
-
title:
|
|
96
|
+
}, fe = {
|
|
97
|
+
description: ee,
|
|
98
|
+
forms: $,
|
|
99
|
+
title: K
|
|
110
100
|
};
|
|
111
101
|
export {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
102
|
+
$ as SignInWithSms,
|
|
103
|
+
ee as SignInWithSmsDescription,
|
|
104
|
+
K as SignInWithSmsTitle,
|
|
105
|
+
fe as config
|
|
116
106
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n, jsxs as r, Fragment as c } from "react/jsx-runtime";
|
|
2
|
-
import { u } from "../../chunks/useSendComponentCallOnce.
|
|
2
|
+
import { u } from "../../chunks/useSendComponentCallOnce.DGjALrnZ.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { u as d } from "../../chunks/CDPReactProvider.
|
|
4
|
+
import { u as d } from "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
5
5
|
import { SignInAuthMethodButtons as f } from "./SignInAuthMethodButtons.js";
|
|
6
6
|
import { SignInBackButton as I } from "./SignInBackButton.js";
|
|
7
7
|
import { SignInDescription as S } from "./SignInDescription.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useReducer as
|
|
1
|
+
import { useReducer as l } from "react";
|
|
2
2
|
import "@coinbase/cdp-hooks";
|
|
3
|
-
import "../../chunks/CDPReactProvider.
|
|
4
|
-
function
|
|
3
|
+
import "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
4
|
+
function u(e, r) {
|
|
5
5
|
switch (r.type) {
|
|
6
6
|
case "SET_AUTH_METHODS":
|
|
7
7
|
return {
|
|
@@ -13,8 +13,8 @@ function l(e, r) {
|
|
|
13
13
|
...e,
|
|
14
14
|
authMethod: r.payload.authMethod,
|
|
15
15
|
step: "credentials",
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
phoneNumber: r.payload.authMethod === "sms" ? "" : e.phoneNumber,
|
|
17
|
+
email: r.payload.authMethod === "email" ? "" : e.email,
|
|
18
18
|
error: null
|
|
19
19
|
};
|
|
20
20
|
case "SET_EMAIL":
|
|
@@ -74,6 +74,20 @@ function l(e, r) {
|
|
|
74
74
|
return { ...e, error: null, canResetOTP: !1 };
|
|
75
75
|
case "CLEAR_ERROR":
|
|
76
76
|
return { ...e, error: null };
|
|
77
|
+
case "GO_TO_PREVIOUS_STEP":
|
|
78
|
+
return {
|
|
79
|
+
authMethod: e.authMethod,
|
|
80
|
+
authMethods: e.authMethods,
|
|
81
|
+
canResetOTP: !1,
|
|
82
|
+
error: null,
|
|
83
|
+
isPending: !1,
|
|
84
|
+
isSuccess: !1,
|
|
85
|
+
email: e.email,
|
|
86
|
+
flowId: "",
|
|
87
|
+
otp: "",
|
|
88
|
+
phoneNumber: e.phoneNumber,
|
|
89
|
+
step: "credentials"
|
|
90
|
+
};
|
|
77
91
|
case "RESET_STATE":
|
|
78
92
|
return {
|
|
79
93
|
authMethod: e.authMethod,
|
|
@@ -92,7 +106,7 @@ function l(e, r) {
|
|
|
92
106
|
throw new Error("Unknown action type");
|
|
93
107
|
}
|
|
94
108
|
}
|
|
95
|
-
const s = (e) => u
|
|
109
|
+
const s = (e) => l(u, e);
|
|
96
110
|
export {
|
|
97
111
|
s as useSignInReducer
|
|
98
112
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as n, jsxs as t, Fragment as c } from "react/jsx-runtime";
|
|
2
|
-
import { u as C } from "../../chunks/useSendComponentCallOnce.
|
|
2
|
+
import { u as C } from "../../chunks/useSendComponentCallOnce.DGjALrnZ.js";
|
|
3
3
|
import { createContext as b, useMemo as x, useContext as v } from "react";
|
|
4
4
|
import { c as N } from "../../chunks/lite.1fxw3LjI.js";
|
|
5
|
-
import { u as w } from "../../chunks/CDPReactProvider.
|
|
5
|
+
import { u as w } from "../../chunks/CDPReactProvider.BkmtXUv1.js";
|
|
6
6
|
import { SignIn as T } from "../SignIn/index.js";
|
|
7
7
|
import "@coinbase/cdp-hooks";
|
|
8
8
|
import { Button as h } from "../ui/Button/index.js";
|