@getpara/react-sdk 1.6.1-dev.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{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/index.js +6659 -6
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +1 -0
- package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.d.ts +2 -1
- package/dist/modal/components/common.d.ts +4 -0
- package/dist/modal/index.d.ts +1 -0
- package/dist/modal/providers/CosmosExternalWalletContextStub.d.ts +13 -0
- package/dist/modal/providers/EvmExternalWalletContextStub.d.ts +11 -0
- package/dist/modal/providers/ExternalWalletContext.d.ts +15 -1
- package/dist/modal/providers/SolanaExternalWalletContextStub.d.ts +11 -0
- package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.d.ts +2 -0
- package/dist/modal/types/commonTypes.d.ts +12 -2
- package/dist/modal/types/externalWallets.d.ts +2 -0
- package/dist/modal/types/modalProps.d.ts +6 -0
- package/dist/modal/utils/steps.d.ts +2 -0
- package/dist/provider/utils/constants.d.ts +5 -0
- package/package.json +5 -5
- package/dist/modal/ParaModal.js +0 -337
- package/dist/modal/components/Account/Account.js +0 -69
- 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 -52
- 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 -304
- 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 -213
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +0 -151
- package/dist/modal/components/ExternalWalletStep/config.js +0 -17
- package/dist/modal/components/ExternalWallets/ExternalWallets.js +0 -172
- package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.js +0 -123
- 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 -122
- 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 -310
- 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 -83
- 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.js +0 -15
- package/dist/modal/hooks/useCreateAccount.js +0 -72
- package/dist/modal/hooks/useEmbeddedExternalConnection.js +0 -39
- package/dist/modal/hooks/useGoBack.js +0 -35
- package/dist/modal/hooks/useSetLoginURLs.js +0 -45
- package/dist/modal/index.js +0 -32
- package/dist/modal/providers/CosmosExternalWalletContextStub.js +0 -34
- package/dist/modal/providers/EvmExternalWalletContextStub.js +0 -38
- package/dist/modal/providers/ExternalWalletContext.js +0 -275
- package/dist/modal/providers/SolanaExternalWalletContextStub.js +0 -19
- package/dist/modal/stores/externalWalletProvider/actions.js +0 -10
- package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.js +0 -20
- 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.js +0 -28
- package/dist/modal/stores/theme/useThemeStore.js +0 -21
- package/dist/modal/stores/userInfo/actions.js +0 -30
- package/dist/modal/stores/userInfo/useUserInfoStore.js +0 -17
- package/dist/modal/types/commonTypes.js +0 -1
- package/dist/modal/types/externalWallets.js +0 -31
- 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 -228
- package/dist/modal/utils/stringFormatters.js +0 -14
- package/dist/modal/utils/validateOnRampConfig.js +0 -32
- package/dist/provider/ParaProvider.js +0 -22
- package/dist/provider/actions/checkIfUserExists.js +0 -21
- 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/initiateLogin.js +0 -20
- package/dist/provider/actions/keepSessionAlive.js +0 -20
- package/dist/provider/actions/logout.js +0 -17
- package/dist/provider/actions/signMessage.js +0 -20
- package/dist/provider/actions/signTransaction.js +0 -20
- package/dist/provider/actions/waitForAccountCreation.js +0 -21
- package/dist/provider/actions/waitForLoginAndSetup.js +0 -24
- 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.js +0 -23
- package/dist/provider/hooks/mutations/useCreateUser.js +0 -20
- package/dist/provider/hooks/mutations/useInitiateLogin.js +0 -23
- package/dist/provider/hooks/mutations/useKeepSessionAlive.js +0 -20
- package/dist/provider/hooks/mutations/useLogout.js +0 -30
- package/dist/provider/hooks/mutations/useSignMessage.js +0 -33
- package/dist/provider/hooks/mutations/useSignTransaction.js +0 -33
- package/dist/provider/hooks/mutations/useWaitForAccountCreation.js +0 -30
- package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.js +0 -30
- package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.js +0 -30
- package/dist/provider/hooks/queries/index.js +0 -8
- package/dist/provider/hooks/queries/useAccount.js +0 -21
- package/dist/provider/hooks/queries/useWallet.js +0 -22
- 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 -11
- 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/renameMutations.js +0 -16
|
@@ -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,52 +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, 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
|
-
const BiometricCreationStep = () => {
|
|
12
|
-
const createAccount = useCreateAccount();
|
|
13
|
-
const webAuthURLForCreate = useModalStore((state) => state.webAuthURLForCreate);
|
|
14
|
-
const iFrameUrl = useModalStore((state) => state.iFrameUrl);
|
|
15
|
-
const isPasskeySupported = useModalStore((state) => state.isPasskeySupported);
|
|
16
|
-
const authInfo = useUserInfoStore((state) => state.getAuthInfo());
|
|
17
|
-
const [isCopied, copy] = useCopyToClipboard();
|
|
18
|
-
const handleCopy = () => {
|
|
19
|
-
copy(webAuthURLForCreate);
|
|
20
|
-
};
|
|
21
|
-
const isBoth = !!webAuthURLForCreate && !!iFrameUrl;
|
|
22
|
-
return /* @__PURE__ */ jsxs(StepContainer, { $wide: true, children: [
|
|
23
|
-
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
24
|
-
/* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: isBoth ? "Secure Your Account" : "Create Passkey" }),
|
|
25
|
-
/* @__PURE__ */ jsx(UserIdentifier, __spreadValues({}, authInfo)),
|
|
26
|
-
/* @__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." })
|
|
27
|
-
] }),
|
|
28
|
-
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
29
|
-
isPasskeySupported ? /* @__PURE__ */ jsxs(CpslButton, { fullWidth: true, onClick: createAccount.withPasskey, children: [
|
|
30
|
-
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "key" }),
|
|
31
|
-
isBoth ? "Create Passkey" : "Create"
|
|
32
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
33
|
-
/* @__PURE__ */ jsx(CpslText, { weight: "semiBold", children: "Scan with your mobile device" }),
|
|
34
|
-
/* @__PURE__ */ jsx(QRContainer, { children: !webAuthURLForCreate ? /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) : /* @__PURE__ */ jsx(CpslQrCode, { url: webAuthURLForCreate }) }),
|
|
35
|
-
/* @__PURE__ */ jsxs(CpslButton, { size: "small", variant: "ghost", onClick: handleCopy, children: [
|
|
36
|
-
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: isCopied ? "check" : "copy" }),
|
|
37
|
-
isCopied ? "Copied" : "Copy Link"
|
|
38
|
-
] })
|
|
39
|
-
] }),
|
|
40
|
-
isBoth && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
41
|
-
/* @__PURE__ */ jsx(CpslDivider, { children: "or" }),
|
|
42
|
-
/* @__PURE__ */ jsxs(CpslButton, { fullWidth: true, onClick: createAccount.withPassword, children: [
|
|
43
|
-
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "passcode" }),
|
|
44
|
-
"Choose Password"
|
|
45
|
-
] })
|
|
46
|
-
] })
|
|
47
|
-
] })
|
|
48
|
-
] });
|
|
49
|
-
};
|
|
50
|
-
export {
|
|
51
|
-
BiometricCreationStep
|
|
52
|
-
};
|
|
@@ -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
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { motion } from "framer-motion";
|
|
5
|
-
import { useEffect, useRef, useState } from "react";
|
|
6
|
-
import styled from "styled-components";
|
|
7
|
-
const AnimatedHeightWrapper = ({ children, className }) => {
|
|
8
|
-
const containerRef = useRef(null);
|
|
9
|
-
const [height, setHeight] = useState("auto");
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
if (containerRef.current) {
|
|
12
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
13
|
-
const observedHeight = entries[0].contentRect.height;
|
|
14
|
-
setHeight(observedHeight);
|
|
15
|
-
});
|
|
16
|
-
resizeObserver.observe(containerRef.current);
|
|
17
|
-
return () => {
|
|
18
|
-
resizeObserver.disconnect();
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
}, []);
|
|
22
|
-
return /* @__PURE__ */ jsx(Container, { className, style: { height }, animate: { height }, transition: { duration: 0.2 }, children: /* @__PURE__ */ jsx("div", { ref: containerRef, children }) });
|
|
23
|
-
};
|
|
24
|
-
const Container = styled(motion.div)`
|
|
25
|
-
overflow: hidden;
|
|
26
|
-
`;
|
|
27
|
-
export {
|
|
28
|
-
AnimatedHeightWrapper
|
|
29
|
-
};
|