@getpara/react-sdk 1.8.0 → 2.0.0-alpha.3
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/{modal/components/AddFunds/MoonPayEmbed.js → MoonPayEmbed-Q2HP2BFI.js} +3 -1
- package/dist/MoonPayEmbed-Q2HP2BFI.js.br +0 -0
- package/dist/MoonPayEmbed-Q2HP2BFI.js.gz +0 -0
- package/dist/chunk-MMUBH76A.js.br +0 -0
- package/dist/chunk-MMUBH76A.js.gz +0 -0
- package/dist/cli/cli.mjs +40 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6499 -6
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/modal/components/AuthInput/AuthInput.d.ts +1 -1
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.d.ts +4 -4
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +1 -1
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +1 -1
- package/dist/modal/components/ChainSwitch/ChainSwitch.d.ts +1 -1
- package/dist/modal/components/Controls/Selects.d.ts +1 -1
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.d.ts +1 -1
- package/dist/modal/components/Footer/Footer.d.ts +1 -1
- package/dist/modal/components/WalletCard/WalletCard.d.ts +2 -2
- package/dist/modal/components/common.d.ts +7 -7
- package/dist/modal/constants/constants.d.ts +1 -1
- package/dist/modal/index.d.ts +0 -2
- package/dist/modal/stores/index.d.ts +0 -2
- package/dist/modal/stores/modal/useModalStore.d.ts +22 -20
- package/dist/modal/types/commonTypes.d.ts +4 -9
- package/dist/modal/types/externalWallets.d.ts +0 -2
- package/dist/modal/types/modalProps.d.ts +1 -33
- package/dist/modal/utils/authLayoutHelpers.d.ts +2 -2
- package/dist/modal/utils/getTileButtonFlex.d.ts +1 -1
- package/dist/modal/utils/isPasskeySupported.d.ts +1 -0
- package/dist/modal/utils/openPopup.d.ts +2 -2
- package/dist/modal/utils/stringFormatters.d.ts +0 -1
- package/dist/provider/ParaProvider.d.ts +3 -1
- package/dist/provider/actions/getAccount.d.ts +19 -7
- package/dist/provider/actions/getWallet.d.ts +1 -1
- package/dist/provider/actions/index.d.ts +25 -0
- package/dist/provider/actions/utils.d.ts +3 -0
- package/dist/provider/components/CosmosWalletWrapper.d.ts +11 -0
- package/dist/provider/components/EvmWalletWrapper.d.ts +12 -0
- package/dist/provider/components/ExternalWalletWrapper.d.ts +8 -0
- package/dist/provider/components/SolanaWalletWrapper.d.ts +9 -0
- package/dist/provider/external/getParaCosmosConnector.d.ts +7 -0
- package/dist/provider/external/getParaEvmConnector.d.ts +7 -0
- package/dist/provider/external/getParaSolanaConnector.d.ts +7 -0
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.d.ts +12 -0
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.d.ts +3 -0
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.d.ts +8 -0
- package/dist/provider/hooks/mutations/index.d.ts +25 -10
- package/dist/provider/hooks/mutations/utils.d.ts +4 -0
- package/dist/provider/hooks/queries/index.d.ts +0 -1
- package/dist/provider/hooks/queries/useAccount.d.ts +1 -6
- package/dist/provider/hooks/queries/useWallet.d.ts +1 -1
- package/dist/provider/hooks/utils/useWalletState.d.ts +3 -2
- package/dist/provider/index.d.ts +1 -0
- package/dist/provider/providers/AuthProvider.d.ts +31 -0
- package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +7 -0
- package/dist/provider/providers/EvmExternalWalletProvider.d.ts +7 -0
- package/dist/provider/providers/ExternalWalletProvider.d.ts +73 -0
- package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +7 -0
- package/dist/provider/stores/getters.d.ts +3 -3
- package/dist/provider/stores/setters.d.ts +1 -0
- package/dist/provider/stores/slices/config.d.ts +3 -0
- package/dist/provider/stores/slices/externalWallets.d.ts +3 -0
- package/dist/provider/stores/slices/index.d.ts +1 -0
- package/dist/provider/stores/types.d.ts +46 -3
- package/dist/provider/types/externalWalletProviders.d.ts +12 -0
- package/dist/provider/types/provider.d.ts +119 -16
- package/dist/provider/types/utils.d.ts +16 -0
- package/dist/provider/utils/paraConfigTypeGuards.d.ts +7 -0
- package/dist/provider/utils/renameMutations.d.ts +3 -0
- package/package.json +19 -7
- package/dist/modal/ParaModal.js +0 -362
- package/dist/modal/components/Account/Account.js +0 -77
- package/dist/modal/components/AddFunds/AddFunds.js +0 -220
- package/dist/modal/components/AddFunds/AddFundsAwaiting.js +0 -72
- package/dist/modal/components/AddFunds/AddFundsDone.js +0 -43
- package/dist/modal/components/AddFunds/index.js +0 -4
- package/dist/modal/components/AuthInput/AuthInput.js +0 -283
- package/dist/modal/components/AuthInput/countryCodes.js +0 -42
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +0 -33
- package/dist/modal/components/AuthInput/phoneMasks.js +0 -253
- package/dist/modal/components/AuthMainStep/AuthMainStep.js +0 -37
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +0 -113
- package/dist/modal/components/AuthOptions/AuthOptions.js +0 -33
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -18
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +0 -10
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -18
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -44
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +0 -55
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -93
- package/dist/modal/components/Body/AnimatedHeightWrapper.js +0 -29
- package/dist/modal/components/Body/Body.js +0 -308
- package/dist/modal/components/ChainSwitch/ChainSwitch.js +0 -94
- package/dist/modal/components/ChainSwitch/config.js +0 -17
- package/dist/modal/components/Controls/Controls.js +0 -74
- package/dist/modal/components/Controls/Selects.js +0 -234
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +0 -140
- package/dist/modal/components/ExternalWalletStep/config.js +0 -17
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.js +0 -96
- package/dist/modal/components/ExternalWallets/ExternalWallets.js +0 -172
- package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.d.ts +0 -8
- package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.js +0 -124
- package/dist/modal/components/Footer/Footer.js +0 -93
- package/dist/modal/components/Header/Header.js +0 -43
- package/dist/modal/components/Header/hooks/useStepTitle.js +0 -50
- package/dist/modal/components/Hero/Hero.js +0 -116
- package/dist/modal/components/IFrameStep/IFrameStep.js +0 -55
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +0 -28
- package/dist/modal/components/ModalContent/ModalContent.js +0 -324
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -81
- package/dist/modal/components/OAuth/OAuth.js +0 -153
- package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -139
- package/dist/modal/components/OnRampComponents/AddingFunds.js +0 -23
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +0 -77
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +0 -101
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +0 -141
- package/dist/modal/components/StripeComponents/StripeComponents.js +0 -88
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -24
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +0 -159
- package/dist/modal/components/Waiting/Waiting.js +0 -17
- package/dist/modal/components/WalletCard/PartnerIcon.js +0 -34
- package/dist/modal/components/WalletCard/WalletCard.js +0 -127
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +0 -52
- package/dist/modal/components/common.js +0 -96
- package/dist/modal/components/index.js +0 -2
- package/dist/modal/constants/constants.js +0 -111
- package/dist/modal/constants/defaults.js +0 -10
- package/dist/modal/constants/oAuthLogos.js +0 -24
- package/dist/modal/hooks/useActiveWallet.d.ts +0 -1
- package/dist/modal/hooks/useActiveWallet.js +0 -15
- package/dist/modal/hooks/useCreateAccount.d.ts +0 -4
- package/dist/modal/hooks/useCreateAccount.js +0 -72
- package/dist/modal/hooks/useEmbeddedExternalConnection.d.ts +0 -1
- package/dist/modal/hooks/useEmbeddedExternalConnection.js +0 -54
- package/dist/modal/hooks/useGoBack.js +0 -42
- package/dist/modal/hooks/useSetLoginURLs.d.ts +0 -8
- package/dist/modal/hooks/useSetLoginURLs.js +0 -49
- package/dist/modal/hooks/useWalletBalance.d.ts +0 -4
- package/dist/modal/hooks/useWalletBalance.js +0 -47
- package/dist/modal/index.js +0 -33
- package/dist/modal/providers/CosmosExternalWalletContextStub.d.ts +0 -42
- package/dist/modal/providers/CosmosExternalWalletContextStub.js +0 -38
- package/dist/modal/providers/EvmExternalWalletContextStub.d.ts +0 -46
- package/dist/modal/providers/EvmExternalWalletContextStub.js +0 -55
- package/dist/modal/providers/ExternalWalletContext.d.ts +0 -92
- package/dist/modal/providers/ExternalWalletContext.js +0 -394
- package/dist/modal/providers/SolanaExternalWalletContextStub.d.ts +0 -32
- package/dist/modal/providers/SolanaExternalWalletContextStub.js +0 -32
- package/dist/modal/stores/externalWalletProvider/actions.d.ts +0 -3
- package/dist/modal/stores/externalWalletProvider/actions.js +0 -10
- package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.d.ts +0 -22
- package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.js +0 -21
- package/dist/modal/stores/index.js +0 -4
- package/dist/modal/stores/modal/actions.js +0 -70
- package/dist/modal/stores/modal/useModalStore.js +0 -65
- package/dist/modal/stores/theme/actions.d.ts +0 -3
- package/dist/modal/stores/theme/actions.js +0 -28
- package/dist/modal/stores/theme/useThemeStore.d.ts +0 -20
- package/dist/modal/stores/theme/useThemeStore.js +0 -21
- package/dist/modal/stores/userInfo/actions.d.ts +0 -3
- package/dist/modal/stores/userInfo/actions.js +0 -30
- package/dist/modal/stores/userInfo/useUserInfoStore.d.ts +0 -19
- package/dist/modal/stores/userInfo/useUserInfoStore.js +0 -17
- package/dist/modal/types/commonTypes.js +0 -1
- package/dist/modal/types/externalWallets.js +0 -32
- package/dist/modal/types/modalProps.js +0 -12
- package/dist/modal/utils/authLayoutHelpers.js +0 -8
- package/dist/modal/utils/getMailtoLink.js +0 -10
- package/dist/modal/utils/getTileButtonFlex.js +0 -20
- package/dist/modal/utils/openPopup.js +0 -60
- package/dist/modal/utils/routeMobileExternalWallet.js +0 -31
- package/dist/modal/utils/steps.js +0 -232
- package/dist/modal/utils/stringFormatters.js +0 -19
- package/dist/modal/utils/validateOnRampConfig.js +0 -32
- package/dist/package.json +0 -6
- package/dist/provider/ParaProvider.js +0 -22
- package/dist/provider/actions/checkIfUserExists.d.ts +0 -9
- package/dist/provider/actions/checkIfUserExists.js +0 -21
- package/dist/provider/actions/createUser.d.ts +0 -12
- package/dist/provider/actions/createUser.js +0 -26
- package/dist/provider/actions/getAccount.js +0 -22
- package/dist/provider/actions/getWallet.js +0 -14
- package/dist/provider/actions/getWalletBalance.d.ts +0 -2
- package/dist/provider/actions/getWalletBalance.js +0 -14
- package/dist/provider/actions/initiateLogin.d.ts +0 -4
- package/dist/provider/actions/initiateLogin.js +0 -20
- package/dist/provider/actions/keepSessionAlive.d.ts +0 -2
- package/dist/provider/actions/keepSessionAlive.js +0 -20
- package/dist/provider/actions/logout.d.ts +0 -2
- package/dist/provider/actions/logout.js +0 -17
- package/dist/provider/actions/signMessage.d.ts +0 -8
- package/dist/provider/actions/signMessage.js +0 -20
- package/dist/provider/actions/signTransaction.d.ts +0 -8
- package/dist/provider/actions/signTransaction.js +0 -20
- package/dist/provider/actions/waitForAccountCreation.d.ts +0 -2
- package/dist/provider/actions/waitForAccountCreation.js +0 -21
- package/dist/provider/actions/waitForLoginAndSetup.d.ts +0 -6
- package/dist/provider/actions/waitForLoginAndSetup.js +0 -24
- package/dist/provider/actions/waitForPasskeyAndCreateWallet.d.ts +0 -2
- package/dist/provider/actions/waitForPasskeyAndCreateWallet.js +0 -21
- package/dist/provider/hooks/index.js +0 -4
- package/dist/provider/hooks/mutations/index.js +0 -24
- package/dist/provider/hooks/mutations/useCheckIfUserExists.d.ts +0 -13
- package/dist/provider/hooks/mutations/useCheckIfUserExists.js +0 -23
- package/dist/provider/hooks/mutations/useCreateUser.d.ts +0 -13
- package/dist/provider/hooks/mutations/useCreateUser.js +0 -20
- package/dist/provider/hooks/mutations/useInitiateLogin.d.ts +0 -14
- package/dist/provider/hooks/mutations/useInitiateLogin.js +0 -23
- package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +0 -12
- package/dist/provider/hooks/mutations/useKeepSessionAlive.js +0 -20
- package/dist/provider/hooks/mutations/useLogout.d.ts +0 -12
- package/dist/provider/hooks/mutations/useLogout.js +0 -30
- package/dist/provider/hooks/mutations/useSignMessage.d.ts +0 -15
- package/dist/provider/hooks/mutations/useSignMessage.js +0 -39
- package/dist/provider/hooks/mutations/useSignTransaction.d.ts +0 -14
- package/dist/provider/hooks/mutations/useSignTransaction.js +0 -39
- package/dist/provider/hooks/mutations/useWaitForAccountCreation.d.ts +0 -12
- package/dist/provider/hooks/mutations/useWaitForAccountCreation.js +0 -30
- package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.d.ts +0 -14
- package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.js +0 -30
- package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.d.ts +0 -13
- package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.js +0 -30
- package/dist/provider/hooks/queries/index.js +0 -10
- package/dist/provider/hooks/queries/useAccount.js +0 -21
- package/dist/provider/hooks/queries/useWallet.js +0 -22
- package/dist/provider/hooks/queries/useWalletBalance.d.ts +0 -7
- package/dist/provider/hooks/queries/useWalletBalance.js +0 -26
- package/dist/provider/hooks/utils/index.js +0 -10
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +0 -74
- package/dist/provider/hooks/utils/useClient.js +0 -10
- package/dist/provider/hooks/utils/useEventListeners.js +0 -105
- package/dist/provider/hooks/utils/useInternalClient.js +0 -10
- package/dist/provider/hooks/utils/useModal.js +0 -17
- package/dist/provider/hooks/utils/useWalletState.js +0 -33
- package/dist/provider/index.js +0 -8
- package/dist/provider/stores/getters.js +0 -13
- package/dist/provider/stores/slices/client.js +0 -9
- package/dist/provider/stores/slices/index.js +0 -4
- package/dist/provider/stores/slices/modal.js +0 -9
- package/dist/provider/stores/slices/wallet.js +0 -13
- package/dist/provider/stores/types.js +0 -1
- package/dist/provider/stores/useStore.js +0 -27
- package/dist/provider/types/provider.js +0 -1
- package/dist/provider/types/query.js +0 -1
- package/dist/provider/types/utils.js +0 -1
- package/dist/provider/utils/constants.d.ts +0 -5
- package/dist/provider/utils/constants.js +0 -11
- package/dist/provider/utils/renameMutations.js +0 -16
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
const defaultPhoneMask = "#################";
|
|
4
|
-
const phoneMasks = {
|
|
5
|
-
AF: "### ### ####",
|
|
6
|
-
AX: "## ### ####",
|
|
7
|
-
AL: "(###) ### ###",
|
|
8
|
-
DZ: "(###) ### ###",
|
|
9
|
-
AS: "(###) ###-####",
|
|
10
|
-
AD: "### ###",
|
|
11
|
-
AO: "(###) ### ###",
|
|
12
|
-
AI: "(###) ###-####",
|
|
13
|
-
AG: "(###) ###-####",
|
|
14
|
-
AR: "(###) ###-####",
|
|
15
|
-
AM: "## ### ###",
|
|
16
|
-
AW: "### ####",
|
|
17
|
-
AU: "# #### ####",
|
|
18
|
-
AT: "(###) ### ####",
|
|
19
|
-
AZ: "(###) ### ## ##",
|
|
20
|
-
BS: "(###) ###-####",
|
|
21
|
-
BH: "#### ####",
|
|
22
|
-
BD: "# ### ###",
|
|
23
|
-
BB: "(###) ###-####",
|
|
24
|
-
BY: "(##) ###-##-##",
|
|
25
|
-
BE: "(###) ### ###",
|
|
26
|
-
BZ: "###-####",
|
|
27
|
-
BJ: "##-##-####",
|
|
28
|
-
BM: "(###) ###-####",
|
|
29
|
-
BT: "# ### ###",
|
|
30
|
-
BO: "# ### ####",
|
|
31
|
-
BA: "## ###-###",
|
|
32
|
-
BW: "## ### ###",
|
|
33
|
-
BR: "(##) ####-####",
|
|
34
|
-
IO: "### ####",
|
|
35
|
-
BN: "### ####",
|
|
36
|
-
BG: "(###) ### ###",
|
|
37
|
-
BF: "## ## ####",
|
|
38
|
-
BI: "## ## ####",
|
|
39
|
-
KH: "## ### ###",
|
|
40
|
-
CM: "#### ####",
|
|
41
|
-
CA: "(###) ###-####",
|
|
42
|
-
CV: "(###) ## ##",
|
|
43
|
-
KY: "(###) ###-####",
|
|
44
|
-
CF: "## ## ####",
|
|
45
|
-
TD: "## ## ## ##",
|
|
46
|
-
CL: "# #### ####",
|
|
47
|
-
CN: "(###) #### ####",
|
|
48
|
-
CX: "# ## ## ##",
|
|
49
|
-
CC: "# ## ## ##",
|
|
50
|
-
CO: "(###) ### ####",
|
|
51
|
-
KM: "## ## ## ##",
|
|
52
|
-
CG: "## ### ####",
|
|
53
|
-
CK: "## ###",
|
|
54
|
-
CR: "#### ####",
|
|
55
|
-
HR: "## #### ###",
|
|
56
|
-
CU: "# ### ####",
|
|
57
|
-
CY: "## ### ###",
|
|
58
|
-
CZ: "### ### ###",
|
|
59
|
-
CD: "### ### ###",
|
|
60
|
-
DK: "## ## ## ##",
|
|
61
|
-
DJ: "## ## ## ##",
|
|
62
|
-
DM: "(###) ###-####",
|
|
63
|
-
DO: "(###) ###-####",
|
|
64
|
-
EC: "## ### ####",
|
|
65
|
-
EG: "# #### ####",
|
|
66
|
-
SV: "#### ####",
|
|
67
|
-
GQ: "## ### ####",
|
|
68
|
-
ER: "# ### ###",
|
|
69
|
-
EE: "#### ####",
|
|
70
|
-
SZ: "#### ####",
|
|
71
|
-
ET: "## ### ####",
|
|
72
|
-
FK: "#####",
|
|
73
|
-
FO: "######",
|
|
74
|
-
FJ: "### ####",
|
|
75
|
-
FI: "## ### ####",
|
|
76
|
-
FR: "## ## ## ## ##",
|
|
77
|
-
GF: "### ## ## ##",
|
|
78
|
-
PF: "## ## ##",
|
|
79
|
-
GA: "# ## ## ##",
|
|
80
|
-
GM: "### ####",
|
|
81
|
-
GE: "(###) ## ## ##",
|
|
82
|
-
DE: "###########",
|
|
83
|
-
GH: "## ### ####",
|
|
84
|
-
GI: "### #####",
|
|
85
|
-
GR: "(###) ### ####",
|
|
86
|
-
GL: "## ## ##",
|
|
87
|
-
GD: "(###) ###-####",
|
|
88
|
-
GP: "### ## ## ##",
|
|
89
|
-
GU: "(###) ###-####",
|
|
90
|
-
GT: "# ### ####",
|
|
91
|
-
GG: "(####) ### ###",
|
|
92
|
-
GN: "## ### ###",
|
|
93
|
-
GW: "# #######",
|
|
94
|
-
GY: "### ####",
|
|
95
|
-
HT: "## ## ####",
|
|
96
|
-
VA: "### ####",
|
|
97
|
-
HN: "####-####",
|
|
98
|
-
HK: "#### ####",
|
|
99
|
-
HU: "(##) ### ####",
|
|
100
|
-
IS: "### ####",
|
|
101
|
-
IN: "####### ###",
|
|
102
|
-
ID: "(###) ###-####",
|
|
103
|
-
IR: "(###) ### ####",
|
|
104
|
-
IQ: "(###) ### ####",
|
|
105
|
-
IE: "(###) ### ###",
|
|
106
|
-
IM: "(####) ### ###",
|
|
107
|
-
IL: "#-###-####",
|
|
108
|
-
IT: "(###) #### ###",
|
|
109
|
-
CI: "## ## ## ##",
|
|
110
|
-
JM: "(###) ###-####",
|
|
111
|
-
JP: "(###) ###-####",
|
|
112
|
-
JE: "(####) ### ###",
|
|
113
|
-
JO: "# #### ####",
|
|
114
|
-
KZ: "(###) ###-##-##",
|
|
115
|
-
KE: "### ######",
|
|
116
|
-
KI: "## ###",
|
|
117
|
-
KP: "###-###-####",
|
|
118
|
-
KR: "(###) ####-####",
|
|
119
|
-
XK: "## ### ###",
|
|
120
|
-
KW: "#### ####",
|
|
121
|
-
KG: "(###) ###-###",
|
|
122
|
-
LA: "## ## ####",
|
|
123
|
-
LV: "## ### ###",
|
|
124
|
-
LB: "## ### ###",
|
|
125
|
-
LS: "# ### ####",
|
|
126
|
-
LR: "## ### ###",
|
|
127
|
-
LY: "##-#######",
|
|
128
|
-
LI: "(###) ###-####",
|
|
129
|
-
LT: "(###) ## ###",
|
|
130
|
-
LU: "### ### ###",
|
|
131
|
-
MO: "#### ####",
|
|
132
|
-
MG: "## ## ### ##",
|
|
133
|
-
MW: "# #### ####",
|
|
134
|
-
MY: "(###) ###-###",
|
|
135
|
-
MV: "###-####",
|
|
136
|
-
ML: "## ## ####",
|
|
137
|
-
MT: "#### ####",
|
|
138
|
-
MH: "###-####",
|
|
139
|
-
MQ: "### ## ## ##",
|
|
140
|
-
MR: "## ## ####",
|
|
141
|
-
MU: "### ####",
|
|
142
|
-
YT: "### ## ## ##",
|
|
143
|
-
MX: "(###) ###-####",
|
|
144
|
-
FM: "### ####",
|
|
145
|
-
MD: "#### ####",
|
|
146
|
-
MC: "(###) ###-###",
|
|
147
|
-
MN: "## ## ####",
|
|
148
|
-
ME: "## ### ###",
|
|
149
|
-
MS: "(###) ###-####",
|
|
150
|
-
MA: "#-####-####",
|
|
151
|
-
MZ: "## ### ####",
|
|
152
|
-
MM: "# ### ####",
|
|
153
|
-
NA: "## ### ####",
|
|
154
|
-
NR: "### ####",
|
|
155
|
-
NP: "#-######",
|
|
156
|
-
NL: "## ### ####",
|
|
157
|
-
NC: "##.##.##",
|
|
158
|
-
NZ: "## ### ###",
|
|
159
|
-
NI: "#### ####",
|
|
160
|
-
NE: "## ## ## ##",
|
|
161
|
-
NG: "## ### ####",
|
|
162
|
-
NU: "####",
|
|
163
|
-
NF: "### ###",
|
|
164
|
-
MK: "## ### ###",
|
|
165
|
-
MP: "(###) ###-####",
|
|
166
|
-
NO: "### ## ###",
|
|
167
|
-
OM: "#### ####",
|
|
168
|
-
PK: "(###) #######",
|
|
169
|
-
PW: "### ####",
|
|
170
|
-
PS: "## ### ####",
|
|
171
|
-
PA: "####-####",
|
|
172
|
-
PG: "(###) ## ###",
|
|
173
|
-
PY: "## ### ####",
|
|
174
|
-
PE: "(###) ### ###",
|
|
175
|
-
PH: "(###) ###-####",
|
|
176
|
-
PN: "### ####",
|
|
177
|
-
PL: "### ### ###",
|
|
178
|
-
PT: "## ### ####",
|
|
179
|
-
PR: "(###) ###-####",
|
|
180
|
-
QA: "#### ####",
|
|
181
|
-
RE: "##### ####",
|
|
182
|
-
RO: "## ### ####",
|
|
183
|
-
RU: "(###) ###-##-##",
|
|
184
|
-
RW: "(###) ### ###",
|
|
185
|
-
BL: "### ## ## ##",
|
|
186
|
-
SH: "####",
|
|
187
|
-
KN: "(###) ###-####",
|
|
188
|
-
LC: "(###) ###-####",
|
|
189
|
-
MF: "### ## ## ##",
|
|
190
|
-
PM: "## ## ##",
|
|
191
|
-
VC: "(###) ###-####",
|
|
192
|
-
WS: "####",
|
|
193
|
-
SM: "(####) ######",
|
|
194
|
-
ST: "## ####",
|
|
195
|
-
SA: "# ### ####",
|
|
196
|
-
SN: "## ### ####",
|
|
197
|
-
RS: "## ### ####",
|
|
198
|
-
SC: "# ### ###",
|
|
199
|
-
SL: "## ######",
|
|
200
|
-
SG: "#### ####",
|
|
201
|
-
SX: "(###) ###-####",
|
|
202
|
-
SK: "(###) ### ###",
|
|
203
|
-
SI: "## ### ###",
|
|
204
|
-
SB: "### ####",
|
|
205
|
-
SO: "# ### ###",
|
|
206
|
-
ZA: "## ### ####",
|
|
207
|
-
GS: "####",
|
|
208
|
-
SS: "# ### ####",
|
|
209
|
-
ES: "### ### ###",
|
|
210
|
-
LK: "## ### ####",
|
|
211
|
-
SD: "## ### ####",
|
|
212
|
-
SR: "###-####",
|
|
213
|
-
SJ: "### ## ###",
|
|
214
|
-
SE: "## ### ####",
|
|
215
|
-
CH: "## ### ####",
|
|
216
|
-
SY: "## #### ###",
|
|
217
|
-
TW: "#### ####",
|
|
218
|
-
TJ: "## ### ####",
|
|
219
|
-
TZ: "## ### ####",
|
|
220
|
-
TH: "# #### ####",
|
|
221
|
-
TL: "#### ####",
|
|
222
|
-
TG: "## ## ## ##",
|
|
223
|
-
TK: "####",
|
|
224
|
-
TO: "####",
|
|
225
|
-
TT: "(###) ###-####",
|
|
226
|
-
TN: "## ### ###",
|
|
227
|
-
TR: "(###) ### ####",
|
|
228
|
-
TM: "# ### ###",
|
|
229
|
-
TC: "(###) ###-####",
|
|
230
|
-
TV: "####",
|
|
231
|
-
UG: "## ### ####",
|
|
232
|
-
UA: "## ### ####",
|
|
233
|
-
AE: "# ### ####",
|
|
234
|
-
GB: "#### ### ###",
|
|
235
|
-
US: "(###) ###-####",
|
|
236
|
-
UM: "(###) ###-####",
|
|
237
|
-
UY: "# ### ## ##",
|
|
238
|
-
UZ: "## ### ####",
|
|
239
|
-
VU: "## ####",
|
|
240
|
-
VE: "###-###-####",
|
|
241
|
-
VN: "## #### ###",
|
|
242
|
-
VG: "(###) ###-####",
|
|
243
|
-
VI: "(###) ###-####",
|
|
244
|
-
WF: "## ####",
|
|
245
|
-
EH: "###-###-###",
|
|
246
|
-
YE: "# ### ###",
|
|
247
|
-
ZM: "## ### ####",
|
|
248
|
-
ZW: "# #######"
|
|
249
|
-
};
|
|
250
|
-
export {
|
|
251
|
-
defaultPhoneMask,
|
|
252
|
-
phoneMasks
|
|
253
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import styled from "styled-components";
|
|
5
|
-
import { useThemeStore } from "../../stores/theme/useThemeStore.js";
|
|
6
|
-
import { AuthMainStepContent } from "./AuthMainStepContent.js";
|
|
7
|
-
import { CenteredText } from "../common.js";
|
|
8
|
-
const AuthMainStep = ({ oAuthMethods, disableEmailLogin, disablePhoneLogin }) => {
|
|
9
|
-
const logo = useThemeStore((state) => state.getLogo());
|
|
10
|
-
const appName = useThemeStore((state) => state.appName);
|
|
11
|
-
const authLayout = useThemeStore((state) => state.authLayout);
|
|
12
|
-
const embeddedModal = useThemeStore((state) => state.embeddedModal);
|
|
13
|
-
const firstLayoutType = authLayout[0].split(":")[0];
|
|
14
|
-
const heading = firstLayoutType === "AUTH" ? "Sign Up or Login" : "Connect Wallet";
|
|
15
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16
|
-
logo && /* @__PURE__ */ jsx(Logo, { src: logo, alt: `${appName ? `${appName} -` : ""}logo` }),
|
|
17
|
-
!embeddedModal && /* @__PURE__ */ jsx(CenteredText, { variant: logo ? "bodyM" : "headingS", weight: "semiBold", children: heading }),
|
|
18
|
-
/* @__PURE__ */ jsx(
|
|
19
|
-
AuthMainStepContent,
|
|
20
|
-
{
|
|
21
|
-
disableEmailLogin,
|
|
22
|
-
disablePhoneLogin,
|
|
23
|
-
oAuthMethods
|
|
24
|
-
}
|
|
25
|
-
)
|
|
26
|
-
] });
|
|
27
|
-
};
|
|
28
|
-
const Logo = styled.img`
|
|
29
|
-
height: 100px;
|
|
30
|
-
max-width: 260px;
|
|
31
|
-
object-fit: contain;
|
|
32
|
-
box-sizing: content-box;
|
|
33
|
-
align-self: center;
|
|
34
|
-
`;
|
|
35
|
-
export {
|
|
36
|
-
AuthMainStep
|
|
37
|
-
};
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { Fragment as Fragment2, useMemo } from "react";
|
|
5
|
-
import { CpslButton, CpslDivider, CpslIconGroup } from "@getpara/react-components";
|
|
6
|
-
import styled from "styled-components";
|
|
7
|
-
import { useExternalWallets } from "../../providers/ExternalWalletContext.js";
|
|
8
|
-
import { ExternalWallets } from "../ExternalWallets/ExternalWallets.js";
|
|
9
|
-
import { useModalStore, useThemeStore } from "../../stores/index.js";
|
|
10
|
-
import { ModalStep } from "../../utils/steps.js";
|
|
11
|
-
import { AuthLayout } from "../../types/modalProps.js";
|
|
12
|
-
import { brandedOAuthLogos, oAuthLogos } from "../../constants/oAuthLogos.js";
|
|
13
|
-
import { AuthOptions } from "../AuthOptions/AuthOptions.js";
|
|
14
|
-
const AuthMainStepContent = ({ oAuthMethods, disableEmailLogin, disablePhoneLogin }) => {
|
|
15
|
-
const { wallets } = useExternalWallets();
|
|
16
|
-
const authLayout = useThemeStore((state) => state.authLayout);
|
|
17
|
-
const setStep = useModalStore((state) => state.setStep);
|
|
18
|
-
const oAuthLogoVariant = useThemeStore((state) => state.oAuthLogoVariant);
|
|
19
|
-
const isDark = useThemeStore((state) => state.isDark);
|
|
20
|
-
const useBrandedLogos = oAuthLogoVariant === "default";
|
|
21
|
-
const useDarkLogos = useBrandedLogos ? isDark : oAuthLogoVariant !== "dark";
|
|
22
|
-
const handleCondensedAuthClick = () => {
|
|
23
|
-
setStep(ModalStep.AUTH_MORE);
|
|
24
|
-
};
|
|
25
|
-
const handleCondensedExternalClick = () => {
|
|
26
|
-
setStep(ModalStep.EX_WALLET_MORE);
|
|
27
|
-
};
|
|
28
|
-
const Content = useMemo(() => {
|
|
29
|
-
const methods = [];
|
|
30
|
-
authLayout.forEach((layout) => {
|
|
31
|
-
switch (layout) {
|
|
32
|
-
case AuthLayout.AUTH_FULL: {
|
|
33
|
-
methods.push([
|
|
34
|
-
/* @__PURE__ */ jsx(
|
|
35
|
-
AuthOptions,
|
|
36
|
-
{
|
|
37
|
-
oAuthMethods,
|
|
38
|
-
disableEmailLogin,
|
|
39
|
-
disablePhoneLogin
|
|
40
|
-
},
|
|
41
|
-
"authFull"
|
|
42
|
-
),
|
|
43
|
-
layout
|
|
44
|
-
]);
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
case AuthLayout.AUTH_CONDENSED: {
|
|
48
|
-
const icons = [];
|
|
49
|
-
oAuthMethods == null ? void 0 : oAuthMethods.forEach((method) => icons.push(useBrandedLogos ? brandedOAuthLogos[method] : oAuthLogos[method]));
|
|
50
|
-
methods.push([
|
|
51
|
-
/* @__PURE__ */ jsxs(CondensedButton, { onClick: handleCondensedAuthClick, variant: "tertiary", fullWidth: true, children: [
|
|
52
|
-
/* @__PURE__ */ jsx(IconGroupSpacer, { slot: "start", icons: [], $isDark: useDarkLogos }),
|
|
53
|
-
"Sign Up or Login",
|
|
54
|
-
/* @__PURE__ */ jsx(StyledIconGroup, { slot: "end", icons: icons.splice(0, 3), $isDark: useDarkLogos })
|
|
55
|
-
] }, "authCondensed"),
|
|
56
|
-
layout
|
|
57
|
-
]);
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
case AuthLayout.EXTERNAL_FULL: {
|
|
61
|
-
if (!!wallets.length) {
|
|
62
|
-
methods.push([/* @__PURE__ */ jsx(ExternalWallets, {}, "externalWallets"), layout]);
|
|
63
|
-
}
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
case AuthLayout.EXTERNAL_CONDENSED: {
|
|
67
|
-
const icons = [];
|
|
68
|
-
wallets == null ? void 0 : wallets.forEach((wallet) => icons.push(wallet.iconUrl));
|
|
69
|
-
methods.push([
|
|
70
|
-
/* @__PURE__ */ jsxs(CondensedButton, { onClick: handleCondensedExternalClick, variant: "tertiary", fullWidth: true, children: [
|
|
71
|
-
/* @__PURE__ */ jsx(IconGroupSpacer, { slot: "start", icons: [], $isDark: useDarkLogos }),
|
|
72
|
-
"Connect Wallet",
|
|
73
|
-
/* @__PURE__ */ jsx(StyledIconGroup, { slot: "end", icons: icons.splice(0, 3), $isDark: useDarkLogos })
|
|
74
|
-
] }, "authCondensed"),
|
|
75
|
-
layout
|
|
76
|
-
]);
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
default: {
|
|
80
|
-
break;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
return /* @__PURE__ */ jsx(Fragment, { children: methods.map(([reactNode, key], index) => /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
85
|
-
reactNode,
|
|
86
|
-
methods.length > 1 && index < methods.length - 1 && /* @__PURE__ */ jsx(CpslDivider, { children: "or" }, "or")
|
|
87
|
-
] }, key)) });
|
|
88
|
-
}, [oAuthMethods, disableEmailLogin, disablePhoneLogin, wallets, authLayout]);
|
|
89
|
-
return /* @__PURE__ */ jsx(Container, { "data-testid": "main-auth-step-content", children: Content });
|
|
90
|
-
};
|
|
91
|
-
const Container = styled.div`
|
|
92
|
-
display: flex;
|
|
93
|
-
flex-direction: column;
|
|
94
|
-
gap: 8px;
|
|
95
|
-
`;
|
|
96
|
-
const StyledIconGroup = styled(CpslIconGroup)`
|
|
97
|
-
--icon-item-color: ${({ $isDark }) => $isDark ? "white" : "black"};
|
|
98
|
-
flex: 1;
|
|
99
|
-
justify-content: flex-end;
|
|
100
|
-
`;
|
|
101
|
-
const IconGroupSpacer = styled(StyledIconGroup)`
|
|
102
|
-
visibility: hidden;
|
|
103
|
-
`;
|
|
104
|
-
const CondensedButton = styled(CpslButton)`
|
|
105
|
-
--button-justify-content: space-between;
|
|
106
|
-
|
|
107
|
-
&::part(button-native) {
|
|
108
|
-
max-height: 50px;
|
|
109
|
-
}
|
|
110
|
-
`;
|
|
111
|
-
export {
|
|
112
|
-
AuthMainStepContent
|
|
113
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
|
-
import { useMemo } from "react";
|
|
5
|
-
import styled from "styled-components";
|
|
6
|
-
import { OAuth } from "../OAuth/OAuth.js";
|
|
7
|
-
import { AuthInput } from "../AuthInput/AuthInput.js";
|
|
8
|
-
import { useExternalWallets } from "../../providers/ExternalWalletContext.js";
|
|
9
|
-
import { useModalStore } from "../../stores/index.js";
|
|
10
|
-
import { ModalStep } from "../../utils/steps.js";
|
|
11
|
-
const AuthOptions = ({ oAuthMethods, disableEmailLogin, disablePhoneLogin }) => {
|
|
12
|
-
const { wallets } = useExternalWallets();
|
|
13
|
-
const showAllOAuth = useModalStore((state) => state.step === ModalStep.AUTH_MORE);
|
|
14
|
-
const Content = useMemo(() => {
|
|
15
|
-
const Methods = [];
|
|
16
|
-
if (!!(oAuthMethods == null ? void 0 : oAuthMethods.length)) {
|
|
17
|
-
Methods.push(/* @__PURE__ */ jsx(OAuth, { methods: oAuthMethods }, "oAuth"));
|
|
18
|
-
}
|
|
19
|
-
if (!disableEmailLogin || !disablePhoneLogin) {
|
|
20
|
-
Methods.push(/* @__PURE__ */ jsx(AuthInput, { disableEmailLogin, disablePhoneLogin }, "input"));
|
|
21
|
-
}
|
|
22
|
-
return /* @__PURE__ */ jsx(Fragment, { children: Methods });
|
|
23
|
-
}, [showAllOAuth, oAuthMethods, disableEmailLogin, disablePhoneLogin, wallets]);
|
|
24
|
-
return /* @__PURE__ */ jsx(Container, { children: Content });
|
|
25
|
-
};
|
|
26
|
-
const Container = styled.div`
|
|
27
|
-
display: flex;
|
|
28
|
-
flex-direction: column;
|
|
29
|
-
gap: 8px;
|
|
30
|
-
`;
|
|
31
|
-
export {
|
|
32
|
-
AuthOptions
|
|
33
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { useModalStore } from "../../stores/index.js";
|
|
5
|
-
import { Waiting } from "../Waiting/Waiting.js";
|
|
6
|
-
const AwaitingBiometricsStep = () => {
|
|
7
|
-
const isLogin = useModalStore((state) => state.isLogin());
|
|
8
|
-
return /* @__PURE__ */ jsx(
|
|
9
|
-
Waiting,
|
|
10
|
-
{
|
|
11
|
-
heading: isLogin ? "Waiting for Passkey" : "Creating Passkey",
|
|
12
|
-
subheading: "Follow the prompts presented by your browser."
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
AwaitingBiometricsStep
|
|
18
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { Waiting } from "../Waiting/Waiting.js";
|
|
5
|
-
const AwaitingOAuthStep = () => {
|
|
6
|
-
return /* @__PURE__ */ jsx(Waiting, { heading: "Complete Login", subheading: "Follow the prompts presented by your browser." });
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
AwaitingOAuthStep
|
|
10
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { useModalStore } from "../../stores/index.js";
|
|
5
|
-
import { Waiting } from "../Waiting/Waiting.js";
|
|
6
|
-
const AwaitingPasswordStep = () => {
|
|
7
|
-
const isLogin = useModalStore((state) => state.isLogin());
|
|
8
|
-
return /* @__PURE__ */ jsx(
|
|
9
|
-
Waiting,
|
|
10
|
-
{
|
|
11
|
-
heading: isLogin ? "Waiting for Password" : "Creating Password",
|
|
12
|
-
subheading: "Follow the prompts presented by your browser."
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
AwaitingPasswordStep
|
|
18
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { CpslIcon, CpslInfoBox, CpslText } from "@getpara/react-components";
|
|
5
|
-
import { InfoBoxContent, InfoBoxHeader, StepContainer } from "../common.js";
|
|
6
|
-
import { useEffect, useRef, useState } from "react";
|
|
7
|
-
import { Waiting } from "../Waiting/Waiting.js";
|
|
8
|
-
import { useThemeStore } from "../../stores/index.js";
|
|
9
|
-
const AwaitingWalletCreationStep = () => {
|
|
10
|
-
const hideWallets = useThemeStore((state) => state.hideWallets);
|
|
11
|
-
const [showInfoBox, setShowInfoBox] = useState(false);
|
|
12
|
-
const showInfoBoxTimeout = useRef();
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
if (typeof window !== "undefined") {
|
|
15
|
-
showInfoBoxTimeout.current = window.setTimeout(() => {
|
|
16
|
-
setShowInfoBox(true);
|
|
17
|
-
}, 4e3);
|
|
18
|
-
}
|
|
19
|
-
return () => clearTimeout(showInfoBoxTimeout.current);
|
|
20
|
-
}, []);
|
|
21
|
-
return /* @__PURE__ */ jsxs(StepContainer, { $wide: true, children: [
|
|
22
|
-
/* @__PURE__ */ jsx(
|
|
23
|
-
Waiting,
|
|
24
|
-
{
|
|
25
|
-
heading: hideWallets ? "Creating Your Account" : "Creating Your Wallet",
|
|
26
|
-
subheading: "This should only take a couple of seconds."
|
|
27
|
-
}
|
|
28
|
-
),
|
|
29
|
-
showInfoBox && /* @__PURE__ */ jsx(CpslInfoBox, { children: /* @__PURE__ */ jsxs(InfoBoxContent, { children: [
|
|
30
|
-
/* @__PURE__ */ jsxs(InfoBoxHeader, { children: [
|
|
31
|
-
/* @__PURE__ */ jsx(CpslIcon, { icon: "clock" }),
|
|
32
|
-
/* @__PURE__ */ jsx(CpslText, { weight: "medium", children: "Hang on" })
|
|
33
|
-
] }),
|
|
34
|
-
/* @__PURE__ */ jsxs(CpslText, { variant: "bodyS", weight: "medium", color: "secondary", children: [
|
|
35
|
-
"Creating your ",
|
|
36
|
-
hideWallets ? "account" : "wallet",
|
|
37
|
-
" is taking a little longer than expected, but we're working on it!"
|
|
38
|
-
] })
|
|
39
|
-
] }) })
|
|
40
|
-
] });
|
|
41
|
-
};
|
|
42
|
-
export {
|
|
43
|
-
AwaitingWalletCreationStep
|
|
44
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__spreadValues
|
|
4
|
-
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { CpslButton, CpslDivider, CpslIcon, CpslQrCode, CpslSpinner, CpslText } from "@getpara/react-components";
|
|
7
|
-
import { useModalStore, useThemeStore, useUserInfoStore } from "../../stores/index.js";
|
|
8
|
-
import { InnerStepContainer, StepContainer, Heading, QRContainer } from "../common.js";
|
|
9
|
-
import { useCopyToClipboard, UserIdentifier } from "@getpara/react-common";
|
|
10
|
-
import { useCreateAccount } from "../../hooks/useCreateAccount.js";
|
|
11
|
-
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
12
|
-
const BiometricCreationStep = () => {
|
|
13
|
-
const createAccount = useCreateAccount();
|
|
14
|
-
const para = useInternalClient();
|
|
15
|
-
const appName = useThemeStore((state) => state.appName);
|
|
16
|
-
const webAuthURLForCreate = useModalStore((state) => state.webAuthURLForCreate);
|
|
17
|
-
const iFrameUrl = useModalStore((state) => state.iFrameUrl);
|
|
18
|
-
const isPasskeySupported = useModalStore((state) => state.isPasskeySupported);
|
|
19
|
-
const authInfo = useUserInfoStore((state) => state.getAuthInfo());
|
|
20
|
-
const [isCopied, copy] = useCopyToClipboard();
|
|
21
|
-
const handleCopy = () => {
|
|
22
|
-
copy(webAuthURLForCreate);
|
|
23
|
-
};
|
|
24
|
-
const isBoth = !!webAuthURLForCreate && !!iFrameUrl;
|
|
25
|
-
return /* @__PURE__ */ jsxs(StepContainer, { $wide: true, children: [
|
|
26
|
-
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
27
|
-
/* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: para.isExternalWalletAuth ? `Finish setup for your${appName ? ` ${appName}` : ""} wallet` : isBoth ? "Secure Your Account" : "Create Passkey" }),
|
|
28
|
-
/* @__PURE__ */ jsx(UserIdentifier, __spreadValues({}, authInfo)),
|
|
29
|
-
/* @__PURE__ */ jsx(CpslText, { variant: "bodyS", color: "secondary", weight: "medium", children: isBoth ? "Choose a password or set up a passkey" : "Your Passkey keeps your account safe." })
|
|
30
|
-
] }),
|
|
31
|
-
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
32
|
-
isPasskeySupported ? /* @__PURE__ */ jsxs(CpslButton, { fullWidth: true, onClick: createAccount.withPasskey, children: [
|
|
33
|
-
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "key" }),
|
|
34
|
-
isBoth ? "Create Passkey" : "Create"
|
|
35
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
36
|
-
/* @__PURE__ */ jsx(CpslText, { weight: "semiBold", children: "Scan with your mobile device" }),
|
|
37
|
-
/* @__PURE__ */ jsx(QRContainer, { children: !webAuthURLForCreate ? /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) : /* @__PURE__ */ jsx(CpslQrCode, { url: webAuthURLForCreate }) }),
|
|
38
|
-
/* @__PURE__ */ jsxs(CpslButton, { size: "small", variant: "ghost", onClick: handleCopy, children: [
|
|
39
|
-
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: isCopied ? "check" : "copy" }),
|
|
40
|
-
isCopied ? "Copied" : "Copy Link"
|
|
41
|
-
] })
|
|
42
|
-
] }),
|
|
43
|
-
isBoth && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
44
|
-
/* @__PURE__ */ jsx(CpslDivider, { children: "or" }),
|
|
45
|
-
/* @__PURE__ */ jsxs(CpslButton, { fullWidth: true, onClick: createAccount.withPassword, children: [
|
|
46
|
-
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "passcode" }),
|
|
47
|
-
"Choose Password"
|
|
48
|
-
] })
|
|
49
|
-
] })
|
|
50
|
-
] })
|
|
51
|
-
] });
|
|
52
|
-
};
|
|
53
|
-
export {
|
|
54
|
-
BiometricCreationStep
|
|
55
|
-
};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__spreadValues
|
|
4
|
-
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { CpslButton, CpslDivider, CpslIcon } from "@getpara/react-components";
|
|
7
|
-
import { useMemo } from "react";
|
|
8
|
-
import { useModalStore, useUserInfoStore } from "../../stores/index.js";
|
|
9
|
-
import { ModalStep } from "../../utils/steps.js";
|
|
10
|
-
import { Heading, StepContainer, InnerStepContainer } from "../common.js";
|
|
11
|
-
import { openPopup } from "../../utils/openPopup.js";
|
|
12
|
-
import styled from "styled-components";
|
|
13
|
-
import { AuthMethod } from "@getpara/web-sdk";
|
|
14
|
-
import { formatBiometricHints, KnownDevices, UserIdentifier } from "@getpara/react-common";
|
|
15
|
-
const BiometricLoginStep = () => {
|
|
16
|
-
const refs = useModalStore((state) => state.refs);
|
|
17
|
-
const supportedAuthMethods = useModalStore((state) => state.supportedAuthMethods);
|
|
18
|
-
const passwordUrlForLogin = useModalStore((state) => state.passwordUrlForLogin);
|
|
19
|
-
const webAuthURLForLogin = useModalStore((state) => state.webAuthURLForLogin);
|
|
20
|
-
const setStep = useModalStore((state) => state.setStep);
|
|
21
|
-
const biometricLocationHints = useModalStore((state) => state.biometricLocationHints);
|
|
22
|
-
const authInfo = useUserInfoStore((state) => state.getAuthInfo());
|
|
23
|
-
const passkeysSupported = useModalStore((state) => state.isPasskeySupported);
|
|
24
|
-
const formattedHints = useMemo(() => formatBiometricHints(biometricLocationHints), [biometricLocationHints]);
|
|
25
|
-
const handlePasskeyClick = () => {
|
|
26
|
-
refs.popupWindow.current = openPopup({
|
|
27
|
-
url: webAuthURLForLogin,
|
|
28
|
-
target: "ParaPasskey",
|
|
29
|
-
type: "LOGIN_PASSKEY",
|
|
30
|
-
current: refs.popupWindow.current
|
|
31
|
-
});
|
|
32
|
-
setStep(ModalStep.AWAITING_BIOMETRIC_LOGIN);
|
|
33
|
-
};
|
|
34
|
-
const handlePasswordClick = () => {
|
|
35
|
-
refs.popupWindow.current = openPopup({
|
|
36
|
-
url: passwordUrlForLogin,
|
|
37
|
-
target: "ParaPassword",
|
|
38
|
-
type: "LOGIN_PASSWORD",
|
|
39
|
-
current: refs.popupWindow.current
|
|
40
|
-
});
|
|
41
|
-
setStep(ModalStep.AWAITING_PASSWORD_LOGIN);
|
|
42
|
-
};
|
|
43
|
-
function shouldShowWelcomeBack() {
|
|
44
|
-
return !(biometricLocationHints == null ? void 0 : biometricLocationHints.length) || passkeysSupported && formattedHints.isOnKnownDevice || (supportedAuthMethods == null ? void 0 : supportedAuthMethods.has) && supportedAuthMethods.has(AuthMethod.PASSWORD);
|
|
45
|
-
}
|
|
46
|
-
return /* @__PURE__ */ jsxs(StepContainer, { $wide: true, children: [
|
|
47
|
-
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
48
|
-
shouldShowWelcomeBack() && /* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: "Welcome back," }),
|
|
49
|
-
/* @__PURE__ */ jsx(UserIdentifier, __spreadValues({}, authInfo))
|
|
50
|
-
] }),
|
|
51
|
-
/* @__PURE__ */ jsxs(MainContainer, { children: [
|
|
52
|
-
(supportedAuthMethods == null ? void 0 : supportedAuthMethods.has) && supportedAuthMethods.has(AuthMethod.PASSWORD) && passwordUrlForLogin && /* @__PURE__ */ jsx(PasswordOnly, { handlePasswordClick }),
|
|
53
|
-
(supportedAuthMethods == null ? void 0 : supportedAuthMethods.has) && supportedAuthMethods.has(AuthMethod.PASSKEY) && webAuthURLForLogin && /* @__PURE__ */ jsx(
|
|
54
|
-
BiometricOnly,
|
|
55
|
-
{
|
|
56
|
-
handlePasskeyClick,
|
|
57
|
-
formattedHints,
|
|
58
|
-
shortLoginLink: webAuthURLForLogin,
|
|
59
|
-
passkeysSupported,
|
|
60
|
-
biometricLocationHints
|
|
61
|
-
}
|
|
62
|
-
)
|
|
63
|
-
] })
|
|
64
|
-
] });
|
|
65
|
-
};
|
|
66
|
-
const PasswordOnly = ({ handlePasswordClick }) => {
|
|
67
|
-
return /* @__PURE__ */ jsx(CpslButton, { fullWidth: true, onClick: handlePasswordClick, children: "Login" });
|
|
68
|
-
};
|
|
69
|
-
const BiometricOnly = ({
|
|
70
|
-
handlePasskeyClick,
|
|
71
|
-
formattedHints,
|
|
72
|
-
shortLoginLink,
|
|
73
|
-
passkeysSupported,
|
|
74
|
-
biometricLocationHints = []
|
|
75
|
-
}) => {
|
|
76
|
-
const [hasHints, isOnKnownDevice] = [biometricLocationHints.length > 0, formattedHints.isOnKnownDevice];
|
|
77
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
78
|
-
(hasHints && !isOnKnownDevice || !passkeysSupported) && /* @__PURE__ */ jsx(KnownDevices, { hints: formattedHints, link: shortLoginLink }),
|
|
79
|
-
passkeysSupported && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
80
|
-
hasHints && !isOnKnownDevice && /* @__PURE__ */ jsx(CpslDivider, { children: "or" }),
|
|
81
|
-
/* @__PURE__ */ jsx(CpslButton, { fullWidth: true, onClick: handlePasskeyClick, children: !hasHints || isOnKnownDevice ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
82
|
-
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "key" }),
|
|
83
|
-
"Login with passkey"
|
|
84
|
-
] }) : "Continue anyway" })
|
|
85
|
-
] })
|
|
86
|
-
] });
|
|
87
|
-
};
|
|
88
|
-
const MainContainer = styled(InnerStepContainer)`
|
|
89
|
-
gap: 16px;
|
|
90
|
-
`;
|
|
91
|
-
export {
|
|
92
|
-
BiometricLoginStep
|
|
93
|
-
};
|