@getpara/react-sdk-lite 2.0.0-alpha.38 → 2.0.0-alpha.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/css/modal.css +14 -1
  2. package/dist/modal/ParaModal.js +29 -6
  3. package/dist/modal/components/Account/Account.d.ts +1 -5
  4. package/dist/modal/components/Account/Account.js +53 -71
  5. package/dist/modal/components/Account/AccountHeader.d.ts +3 -0
  6. package/dist/modal/components/Account/AccountHeader.js +63 -0
  7. package/dist/modal/components/Account/AccountProfile.d.ts +4 -1
  8. package/dist/modal/components/Account/AccountProfile.js +108 -21
  9. package/dist/modal/components/AddFunds/AddFunds.js +11 -6
  10. package/dist/modal/components/AddFunds/AddFundsAsset.js +5 -32
  11. package/dist/modal/components/AddFunds/AddFundsDone.js +1 -1
  12. package/dist/modal/components/AddFunds/AddFundsProvider.js +1 -1
  13. package/dist/modal/components/AddFunds/AddFundsReceive.js +8 -53
  14. package/dist/modal/components/AuthMainStep/AuthMainStep.js +3 -5
  15. package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +4 -3
  16. package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +4 -1
  17. package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +7 -5
  18. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +4 -4
  19. package/dist/modal/components/Body/AnimatedHeightWrapper.d.ts +1 -0
  20. package/dist/modal/components/Body/AnimatedHeightWrapper.js +2 -2
  21. package/dist/modal/components/Body/Body.d.ts +3 -1
  22. package/dist/modal/components/Body/Body.js +40 -47
  23. package/dist/modal/components/ChainSwitch/ChainSwitch.js +13 -21
  24. package/dist/modal/components/Controls/{Selects.d.ts → ChainSelect.d.ts} +0 -1
  25. package/dist/modal/components/Controls/ChainSelect.js +88 -0
  26. package/dist/modal/components/Controls/Controls.js +10 -20
  27. package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +17 -12
  28. package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.js +1 -1
  29. package/dist/modal/components/Footer/Footer.js +26 -57
  30. package/dist/modal/components/Header/Header.js +46 -8
  31. package/dist/modal/components/Header/hooks/useStepTitle.d.ts +4 -0
  32. package/dist/modal/components/Header/hooks/useStepTitle.js +48 -15
  33. package/dist/modal/components/IFrameStep/IFrameStep.js +22 -10
  34. package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +16 -10
  35. package/dist/modal/components/ModalContent/ModalContent.d.ts +4 -3
  36. package/dist/modal/components/ModalContent/ModalContent.js +5 -1
  37. package/dist/modal/components/OAuth/FarcasterOAuthStep.js +1 -1
  38. package/dist/modal/components/OAuth/OAuth.js +1 -1
  39. package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +2 -2
  40. package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +3 -3
  41. package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +1 -1
  42. package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +1 -1
  43. package/dist/modal/components/Waiting/Waiting.js +1 -1
  44. package/dist/modal/components/WalletCard/WalletCard.d.ts +6 -3
  45. package/dist/modal/components/WalletCard/WalletCard.js +41 -15
  46. package/dist/modal/components/WalletSelect/WalletSelect.d.ts +11 -0
  47. package/dist/modal/components/WalletSelect/WalletSelect.js +153 -0
  48. package/dist/modal/components/common.d.ts +9 -4
  49. package/dist/modal/components/common.js +57 -13
  50. package/dist/modal/constants/constants.d.ts +7 -12
  51. package/dist/modal/constants/constants.js +7 -1
  52. package/dist/modal/constants/oAuthLogos.d.ts +2 -6
  53. package/dist/modal/constants/oAuthLogos.js +42 -40
  54. package/dist/modal/hooks/useGoBack.js +9 -0
  55. package/dist/modal/types/commonTypes.d.ts +8 -0
  56. package/dist/modal/utils/getWalletDisplayName.js +3 -6
  57. package/dist/modal/utils/icons.d.ts +5 -0
  58. package/dist/modal/utils/icons.js +17 -0
  59. package/dist/provider/ParaProvider.js +24 -129
  60. package/dist/provider/ParaProviderMin.d.ts +4 -0
  61. package/dist/provider/ParaProviderMin.js +140 -0
  62. package/dist/provider/components/CosmosWalletWrapper.d.ts +1 -1
  63. package/dist/provider/components/EvmWalletWrapper.d.ts +1 -1
  64. package/dist/provider/components/ExternalWalletWrapper.js +3 -36
  65. package/dist/provider/components/SolanaWalletWrapper.d.ts +1 -1
  66. package/dist/provider/hooks/mutations/useCreateWallet.d.ts +3 -3
  67. package/dist/provider/hooks/mutations/useCreateWallet.js +1 -1
  68. package/dist/provider/hooks/mutations/useCreateWalletPerType.d.ts +3 -3
  69. package/dist/provider/hooks/mutations/useCreateWalletPerType.js +1 -1
  70. package/dist/provider/hooks/mutations/useIssueJwt.d.ts +3 -3
  71. package/dist/provider/hooks/mutations/useIssueJwt.js +1 -1
  72. package/dist/provider/hooks/mutations/useResendVerificationCode.d.ts +6 -6
  73. package/dist/provider/hooks/mutations/useResendVerificationCode.js +1 -1
  74. package/dist/provider/hooks/mutations/useVerifyExternalWallet.d.ts +6 -0
  75. package/dist/provider/hooks/mutations/useVerifyFarcaster.d.ts +3 -3
  76. package/dist/provider/hooks/mutations/useVerifyFarcaster.js +1 -1
  77. package/dist/provider/hooks/mutations/useVerifyNewAccount.d.ts +6 -0
  78. package/dist/provider/hooks/mutations/useWaitForLogin.d.ts +3 -3
  79. package/dist/provider/hooks/mutations/useWaitForLogin.js +1 -1
  80. package/dist/provider/hooks/mutations/useWaitForSignup.d.ts +3 -3
  81. package/dist/provider/hooks/mutations/useWaitForSignup.js +1 -1
  82. package/dist/provider/hooks/mutations/useWaitForWalletCreation.d.ts +3 -3
  83. package/dist/provider/hooks/mutations/useWaitForWalletCreation.js +1 -1
  84. package/dist/provider/index.d.ts +1 -0
  85. package/dist/provider/index.js +3 -1
  86. package/dist/provider/providers/AuthProvider.js +24 -13
  87. package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +1 -1
  88. package/dist/provider/providers/CosmosExternalWalletProvider.js +3 -0
  89. package/dist/provider/providers/EvmExternalWalletProvider.d.ts +1 -1
  90. package/dist/provider/providers/EvmExternalWalletProvider.js +3 -0
  91. package/dist/provider/providers/ExternalWalletProvider.js +1 -1
  92. package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +1 -1
  93. package/dist/provider/providers/SolanaExternalWalletProvider.js +3 -0
  94. package/dist/provider/stores/slices/modal.js +16 -12
  95. package/dist/provider/utils/constants.d.ts +5 -0
  96. package/dist/provider/utils/constants.js +64 -1
  97. package/dist/public/PPMori-Regular.woff2 +0 -0
  98. package/dist/public/PPMori-SemiBold.woff2 +0 -0
  99. package/package.json +8 -8
  100. package/dist/modal/components/Controls/Selects.js +0 -173
  101. package/dist/provider/utils/externalWalletDefaults.d.ts +0 -6
  102. package/dist/provider/utils/externalWalletDefaults.js +0 -33
@@ -10,20 +10,17 @@ import { getOnRampNetworks } from "@getpara/web-sdk";
10
10
  import { safeStyled } from "@getpara/react-common";
11
11
  import { getAssetCode, getAssetName, ON_RAMP_ASSETS } from "../../constants/constants.js";
12
12
  import { useModalStore } from "../../stores/index.js";
13
- import { useRef, useState } from "react";
13
+ import { useState } from "react";
14
14
  import { useAddFunds } from "./AddFundsContext.js";
15
15
  import { useWallet } from "../../../provider/hooks/queries/useWallet.js";
16
- import { AssetIcon } from "../common.js";
16
+ import { AssetIcon, GradientScroll } from "../common.js";
17
17
  import { AnimatePresence, motion } from "framer-motion";
18
18
  import { contentMotionProps } from "./common.js";
19
19
  function AddFundsAsset() {
20
20
  const onRampConfig = useModalStore((state) => state.onRampConfig);
21
21
  const { assets, setAsset, network, setNetwork } = useAddFunds();
22
22
  const { data: activeWallet } = useWallet();
23
- const [isAtBottom, setIsAtBottom] = useState(false);
24
- const [isAtTop, setIsAtTop] = useState(true);
25
23
  const [searchStr, setSearchStr] = useState("");
26
- const ref = useRef(null);
27
24
  const onSelect = (_asset) => __async(this, null, function* () {
28
25
  yield setAsset(_asset);
29
26
  if (!network && !!onRampConfig && !!activeWallet) {
@@ -35,21 +32,6 @@ function AddFundsAsset() {
35
32
  );
36
33
  }
37
34
  });
38
- const onScroll = () => {
39
- if (ref.current) {
40
- const { scrollTop, scrollHeight, clientHeight } = ref.current;
41
- if (scrollTop + clientHeight >= scrollHeight - 30) {
42
- setIsAtBottom(true);
43
- } else {
44
- setIsAtBottom(false);
45
- }
46
- if (scrollTop < 30) {
47
- setIsAtTop(true);
48
- } else {
49
- setIsAtTop(false);
50
- }
51
- }
52
- };
53
35
  return /* @__PURE__ */ jsxs(Fragment, { children: [
54
36
  /* @__PURE__ */ jsx(AnimatePresence, { mode: "sync", children: assets.length >= 4 && /* @__PURE__ */ jsx(motion.div, __spreadProps(__spreadValues({}, contentMotionProps), { children: /* @__PURE__ */ jsx(
55
37
  SearchInput,
@@ -62,7 +44,7 @@ function AddFundsAsset() {
62
44
  children: /* @__PURE__ */ jsx(comp.CpslIcon, { icon: "search", slot: "start" })
63
45
  }
64
46
  ) })) }),
65
- /* @__PURE__ */ jsx(ScrollContainer, { isAtBottom, isAtTop, ref, onScroll, children: /* @__PURE__ */ jsx(AssetList, { children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "sync", children: assets.filter((asset) => {
47
+ /* @__PURE__ */ jsx(GradientScroll, { height: "calc(100% - 56px)", gap: "8px", children: /* @__PURE__ */ jsx(AssetList, { children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "sync", children: assets.filter((asset) => {
66
48
  return searchStr === "" || getAssetCode(asset).toLowerCase().startsWith(searchStr.toLowerCase()) || getAssetName(asset).toLowerCase().startsWith(searchStr.toLowerCase());
67
49
  }).map((asset) => /* @__PURE__ */ jsx(
68
50
  motion.li,
@@ -75,8 +57,8 @@ function AddFundsAsset() {
75
57
  children: /* @__PURE__ */ jsxs(AssetButton, { fullWidth: true, variant: "secondary", onClick: () => onSelect(asset), children: [
76
58
  /* @__PURE__ */ jsx(AssetIcon, { asset, size: "48px" }),
77
59
  /* @__PURE__ */ jsxs(Info, { children: [
78
- /* @__PURE__ */ jsx(Code, { variant: "bodyL", children: ON_RAMP_ASSETS[asset].code }),
79
- /* @__PURE__ */ jsx(Name, { variant: "bodyS", children: ON_RAMP_ASSETS[asset].name })
60
+ /* @__PURE__ */ jsx(Code, { color: "contrast", variant: "bodyL", children: ON_RAMP_ASSETS[asset].code }),
61
+ /* @__PURE__ */ jsx(Name, { color: "contrast", variant: "bodyS", children: ON_RAMP_ASSETS[asset].name })
80
62
  ] })
81
63
  ] }, asset)
82
64
  },
@@ -84,15 +66,6 @@ function AddFundsAsset() {
84
66
  )) }) }) })
85
67
  ] });
86
68
  }
87
- const ScrollContainer = safeStyled.div`
88
- height: calc(100% - 56px);
89
- width: 100%;
90
- display: flex;
91
- flex-direction: column;
92
- gap: 8px;
93
- overflow-y: auto;
94
- mask-image: ${({ isAtBottom, isAtTop }) => !isAtBottom && !isAtTop ? "linear-gradient(to bottom, transparent 0%, black 24px, black calc(100% - 24px), transparent 100%)" : !isAtBottom ? "linear-gradient(to bottom, black calc(100% - 24px), transparent 100%)" : !isAtTop ? "linear-gradient(to top, black calc(100% - 24px), transparent 100%)" : "none"};
95
- `;
96
69
  const AssetList = safeStyled.ul`
97
70
  display: flex;
98
71
  flex-direction: column;
@@ -29,7 +29,7 @@ const AddFundsDone = ({ isSuccess, onClose }) => {
29
29
  return /* @__PURE__ */ jsxs(StepContainer, { children: [
30
30
  /* @__PURE__ */ jsx(HeroIcon, { icon: "checkCircleFilled" }),
31
31
  /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
32
- /* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: heading }),
32
+ /* @__PURE__ */ jsx(Heading, { children: heading }),
33
33
  /* @__PURE__ */ jsx(CpslText, { variant: "bodyS", color: "secondary", children: text })
34
34
  ] }),
35
35
  /* @__PURE__ */ jsx(
@@ -28,7 +28,7 @@ function AddFundsProvider() {
28
28
  const { asset, network, fiatQuantity, isProviderAllowed, tab } = useAddFunds();
29
29
  const { data: activeWallet } = useWallet();
30
30
  return /* @__PURE__ */ jsxs(Container, __spreadProps(__spreadValues({}, contentMotionProps), { children: [
31
- /* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: "Choose Provider" }),
31
+ /* @__PURE__ */ jsx(Heading, { children: "Choose Provider" }),
32
32
  /* @__PURE__ */ jsxs($InnerStepContainer, { children: [
33
33
  /* @__PURE__ */ jsxs(NoProviders, { isHidden: Object.values(isProviderAllowed).some((v) => !!v), variant: "bodyM", children: [
34
34
  "No providers are available for this ",
@@ -1,20 +1,10 @@
1
1
  "use client";
2
2
  import "../../../chunk-MMUBH76A.js";
3
3
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
- import {
5
- CpslButton,
6
- CpslDivider,
7
- CpslIcon,
8
- CpslIdenticon,
9
- CpslQrCode,
10
- CpslSpinner,
11
- CpslText
12
- } from "@getpara/react-components";
13
- import { CenteredText, FilledDisabledInput, InnerStepContainer, QRContainer } from "../common.js";
4
+ import { CpslQrCode, CpslSpinner } from "@getpara/react-components";
5
+ import { CenteredText, InnerStepContainer, QRContainer } from "../common.js";
14
6
  import { isMobile } from "@getpara/web-sdk";
15
7
  import { useModalStore } from "../../stores/index.js";
16
- import { useStore } from "../../../provider/stores/useStore.js";
17
- import { useCopyToClipboard } from "@getpara/react-common";
18
8
  import { useMemo } from "react";
19
9
  import { useWallet } from "../../../provider/hooks/index.js";
20
10
  import { useAddFunds } from "./AddFundsContext.js";
@@ -26,56 +16,21 @@ const GENERIC_WALLET = {
26
16
  COSMOS: "Cosmos networks"
27
17
  };
28
18
  function AddFundsReceive() {
29
- const [isCopied, copy] = useCopyToClipboard();
30
19
  const { networks } = useAddFunds();
31
20
  const para = useInternalClient();
32
- const appName = useStore((state) => state.appName);
33
- const hideWallets = useStore((state) => {
34
- var _a;
35
- return (_a = state.modalConfig) == null ? void 0 : _a.hideWallets;
36
- });
37
21
  const onRampConfig = useModalStore((state) => state.onRampConfig);
38
22
  const { data: activeWallet } = useWallet();
39
23
  const address = useMemo(
40
24
  () => activeWallet ? para.getDisplayAddress(activeWallet.id, { addressType: activeWallet.type }) : "",
41
25
  [para, activeWallet == null ? void 0 : activeWallet.id, activeWallet == null ? void 0 : activeWallet.type]
42
26
  );
43
- const onCopy = () => {
44
- copy(address);
45
- };
46
27
  return /* @__PURE__ */ jsxs(Fragment, { children: [
47
- activeWallet && /* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsxs(
48
- FilledDisabledInput,
49
- {
50
- noAutoDisable: true,
51
- readonly: true,
52
- placeholder: para.getDisplayAddress(activeWallet.id, {
53
- truncate: true,
54
- addressType: activeWallet.type,
55
- targetLength: 16
56
- }),
57
- children: [
58
- /* @__PURE__ */ jsx(CpslIdenticon, { slot: "start", size: "32px", hash: para.getIdenticonHash(activeWallet.id, activeWallet.type) }),
59
- /* @__PURE__ */ jsx(CpslButton, { slot: "end", variant: "ghost", onClick: onCopy, children: /* @__PURE__ */ jsx(CpslIcon, { icon: isCopied ? "check" : "copy" }) })
60
- ]
61
- },
62
- address
63
- ) }),
64
- !isMobile() && /* @__PURE__ */ jsxs(Fragment, { children: [
65
- /* @__PURE__ */ jsx(CpslDivider, { children: "or" }),
66
- /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
67
- /* @__PURE__ */ jsx(QRContainer, { children: !address ? /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) : /* @__PURE__ */ jsx(CpslQrCode, { url: address }, address) }),
68
- /* @__PURE__ */ jsx(CpslText, { weight: "semiBold", color: "secondary", children: "Scan with your crypto wallet" })
69
- ] })
70
- ] }),
71
- (activeWallet == null ? void 0 : activeWallet.type) && /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
72
- /* @__PURE__ */ jsxs(CenteredText, { weight: "semiBold", children: [
73
- !!(onRampConfig == null ? void 0 : onRampConfig.allowedAssets) && networks.length > 0 || hideWallets ? appName != null ? appName : "This App" : "This Wallet",
74
- " ",
75
- "Only Supports:"
76
- ] }),
77
- /* @__PURE__ */ jsx(CenteredText, { weight: "medium", color: "secondary", children: !!(onRampConfig == null ? void 0 : onRampConfig.allowedAssets) && networks.length > 0 ? formatNetworkList(networks) : GENERIC_WALLET[activeWallet.type] })
78
- ] })
28
+ !isMobile() && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsx(QRContainer, { children: !address ? /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) : /* @__PURE__ */ jsx(CpslQrCode, { url: address }, address) }) }) }),
29
+ (activeWallet == null ? void 0 : activeWallet.type) && /* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsxs(CenteredText, { variant: "bodyS", weight: "semiBold", children: [
30
+ "Only send funds on",
31
+ " ",
32
+ !!(onRampConfig == null ? void 0 : onRampConfig.allowedAssets) && networks.length > 0 ? formatNetworkList(networks) : GENERIC_WALLET[activeWallet.type]
33
+ ] }) })
79
34
  ] });
80
35
  }
81
36
  export {
@@ -5,14 +5,13 @@ import { safeStyled } from "@getpara/react-common";
5
5
  import { AuthMainStepContent } from "./AuthMainStepContent.js";
6
6
  import { CenteredText } from "../common.js";
7
7
  import { useStore } from "../../../provider/stores/useStore.js";
8
- import { useModalStore } from "../../stores/index.js";
8
+ import { useStepTitle } from "../Header/hooks/useStepTitle.js";
9
9
  const AuthMainStep = ({
10
10
  oAuthMethods,
11
11
  disableEmailLogin,
12
12
  disablePhoneLogin,
13
13
  isGuestModeEnabled = false
14
14
  }) => {
15
- const authLayout = useModalStore((state) => state.authLayout);
16
15
  const embeddedModal = useStore((state) => {
17
16
  var _a;
18
17
  return (_a = state.modalConfig) == null ? void 0 : _a.embeddedModal;
@@ -22,11 +21,10 @@ const AuthMainStep = ({
22
21
  return (_a = state.modalConfig) == null ? void 0 : _a.logo;
23
22
  });
24
23
  const appName = useStore((state) => state.appName);
25
- const firstLayoutType = authLayout == null ? void 0 : authLayout[0].split(":")[0];
26
- const heading = firstLayoutType === "AUTH" ? "Sign Up or Login" : "Connect Wallet";
24
+ const { title, isTitleDisplayed } = useStepTitle();
27
25
  return /* @__PURE__ */ jsxs(Fragment, { children: [
28
26
  logo && /* @__PURE__ */ jsx(Logo, { src: logo, alt: `${appName ? `${appName} -` : ""}logo` }),
29
- !embeddedModal && /* @__PURE__ */ jsx(CenteredText, { variant: logo ? "bodyM" : "headingS", weight: "semiBold", children: heading }),
27
+ !embeddedModal && !isTitleDisplayed && /* @__PURE__ */ jsx(CenteredText, { variant: logo ? "bodyM" : "headingS", weight: "semiBold", children: title }),
30
28
  /* @__PURE__ */ jsx(
31
29
  AuthMainStepContent,
32
30
  {
@@ -14,6 +14,7 @@ import { useExternalWallets } from "../../../provider/providers/ExternalWalletPr
14
14
  import { useStore } from "../../../provider/stores/useStore.js";
15
15
  import { useAuthActions } from "../../../provider/providers/AuthProvider.js";
16
16
  import { useAccount, useParaStatus } from "../../../provider/index.js";
17
+ import { connectWalletTitle, signUpOrLogInTitle } from "../Header/hooks/useStepTitle.js";
17
18
  const AuthMainStepContent = ({
18
19
  oAuthMethods,
19
20
  disableEmailLogin,
@@ -71,11 +72,11 @@ const AuthMainStepContent = ({
71
72
  }
72
73
  case AuthLayout.AUTH_CONDENSED: {
73
74
  const icons = [];
74
- oAuthMethods == null ? void 0 : oAuthMethods.forEach((method) => icons.push(ACCOUNT_TYPES[method][useBrandedLogos ? "logoBranded" : "logo"]));
75
+ oAuthMethods == null ? void 0 : oAuthMethods.forEach((method) => icons.push(ACCOUNT_TYPES[method][useBrandedLogos ? "iconBranded" : "icon"]));
75
76
  methods.push([
76
77
  /* @__PURE__ */ jsxs(CondensedButton, { onClick: handleCondensedAuthClick, variant: "tertiary", fullWidth: true, children: [
77
78
  /* @__PURE__ */ jsx(IconGroupSpacer, { slot: "start", icons: [], $isDark: useDarkLogos }),
78
- "Sign Up or Login",
79
+ signUpOrLogInTitle,
79
80
  /* @__PURE__ */ jsx(StyledIconGroup, { slot: "end", icons: icons.splice(0, 3), $isDark: useDarkLogos })
80
81
  ] }, "authCondensed"),
81
82
  layout
@@ -94,7 +95,7 @@ const AuthMainStepContent = ({
94
95
  methods.push([
95
96
  /* @__PURE__ */ jsxs(CondensedButton, { onClick: handleCondensedExternalClick, variant: "tertiary", fullWidth: true, children: [
96
97
  /* @__PURE__ */ jsx(IconGroupSpacer, { slot: "start", icons: [], $isDark: useDarkLogos }),
97
- "Connect Wallet",
98
+ connectWalletTitle,
98
99
  /* @__PURE__ */ jsx(StyledIconGroup, { slot: "end", icons: icons.splice(0, 3), $isDark: useDarkLogos })
99
100
  ] }, "authCondensed"),
100
101
  layout
@@ -5,10 +5,13 @@ import { useModalStore } from "../../stores/index.js";
5
5
  import { Waiting } from "../Waiting/Waiting.js";
6
6
  const AwaitingPasswordStep = () => {
7
7
  const isLogin = useModalStore((state) => state.isLogin());
8
+ const signupState = useModalStore((state) => state.getSignupState());
9
+ const loginState = useModalStore((state) => state.getLoginState());
10
+ const isPIN = !!(signupState == null ? void 0 : signupState.pinUrl) || !!(loginState == null ? void 0 : loginState.pinUrl);
8
11
  return /* @__PURE__ */ jsx(
9
12
  Waiting,
10
13
  {
11
- heading: isLogin ? "Waiting for Password" : "Creating Password",
14
+ heading: isLogin ? `Waiting for ${isPIN ? "PIN" : "Password"}` : `Creating ${isPIN ? "PIN" : "Password"}`,
12
15
  subheading: "Follow the prompts presented by your browser."
13
16
  }
14
17
  );
@@ -25,15 +25,16 @@ const BiometricCreationStep = () => {
25
25
  const onClick = (method) => () => {
26
26
  presentSignupUi(method, signupState);
27
27
  };
28
- const isBoth = !!(signupState == null ? void 0 : signupState.passkeyUrl) && !!(signupState == null ? void 0 : signupState.passwordUrl);
28
+ const isBoth = !!(signupState == null ? void 0 : signupState.passkeyUrl) && (!!(signupState == null ? void 0 : signupState.passwordUrl) || !!(signupState == null ? void 0 : signupState.pinUrl));
29
+ const isPIN = !!(signupState == null ? void 0 : signupState.pinUrl);
29
30
  if (!signupState) {
30
31
  return null;
31
32
  }
32
33
  return /* @__PURE__ */ jsxs(StepContainer, { $wide: true, children: [
33
34
  /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
34
- /* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: para.isExternalWalletAuth ? `Finish setup for your${appName ? ` ${appName}` : ""} wallet` : isBoth ? "Secure Your Account" : "Create Passkey" }),
35
+ /* @__PURE__ */ jsx(Heading, { children: para.isExternalWalletAuth ? `Finish setup for your${appName ? ` ${appName}` : ""} wallet` : isBoth ? "Secure Your Account" : "Create Passkey" }),
35
36
  /* @__PURE__ */ jsx(UserIdentifier, { authInfo }),
36
- /* @__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." })
37
+ /* @__PURE__ */ jsx(CpslText, { variant: "bodyS", color: "secondary", weight: "medium", children: isBoth ? `Choose a ${isPIN ? "PIN" : "password"} or set up a passkey` : "Your Passkey keeps your account safe." })
37
38
  ] }),
38
39
  /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
39
40
  (signupState == null ? void 0 : signupState.isPasskeySupported) ? /* @__PURE__ */ jsxs(CpslButton, { fullWidth: true, onClick: onClick(AuthMethod.PASSKEY), children: [
@@ -49,9 +50,10 @@ const BiometricCreationStep = () => {
49
50
  ] }),
50
51
  isBoth && /* @__PURE__ */ jsxs(Fragment, { children: [
51
52
  /* @__PURE__ */ jsx(CpslDivider, { children: "or" }),
52
- /* @__PURE__ */ jsxs(CpslButton, { fullWidth: true, onClick: onClick(AuthMethod.PASSWORD), disabled: !!authStepRoute, children: [
53
+ /* @__PURE__ */ jsxs(CpslButton, { fullWidth: true, onClick: onClick(isPIN ? AuthMethod.PIN : AuthMethod.PASSWORD), disabled: !!authStepRoute, children: [
53
54
  /* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "passcode" }),
54
- "Choose Password"
55
+ "Choose ",
56
+ isPIN ? "PIN" : "Password"
55
57
  ] })
56
58
  ] })
57
59
  ] })
@@ -17,16 +17,16 @@ const BiometricLoginStep = () => {
17
17
  if (!loginState) {
18
18
  return null;
19
19
  }
20
- const { passkeyUrl, passkeyKnownDeviceUrl, passwordUrl, isPasskeySupported } = loginState;
20
+ const { passkeyUrl, pinUrl, passkeyKnownDeviceUrl, passwordUrl, isPasskeySupported } = loginState;
21
21
  const { isOnKnownDevice = false, formattedHints } = biometricHints || {};
22
- const isPasskey = !!passkeyUrl, isPassword = !!passwordUrl, isNeither = !isPasskey && !isPassword, hasHints = (_a = formattedHints == null ? void 0 : formattedHints.length) != null ? _a : 0 > 0, isPasskeyOnKnownDevice = isPasskeySupported && isOnKnownDevice, isPasskeyUnavailable = hasHints && !isOnKnownDevice || !isPasskeySupported || isNeither, displayKnownDevices = isPasskeyUnavailable && !!biometricHints && (hasHints || !!passkeyKnownDeviceUrl), displayWelcomeBack = isPasskeyOnKnownDevice || isPassword;
22
+ const isPasskey = !!passkeyUrl, isPassword = !!passwordUrl, isPIN = !!pinUrl, isNeither = !isPasskey && !isPassword, hasHints = (_a = formattedHints == null ? void 0 : formattedHints.length) != null ? _a : 0 > 0, isPasskeyOnKnownDevice = isPasskeySupported && isOnKnownDevice, isPasskeyUnavailable = hasHints && !isOnKnownDevice || !isPasskeySupported || isNeither, displayKnownDevices = isPasskeyUnavailable && !!biometricHints && (hasHints || !!passkeyKnownDeviceUrl), displayWelcomeBack = isPasskeyOnKnownDevice || isPassword || isPIN;
23
23
  return /* @__PURE__ */ jsxs(StepContainer, { $wide: true, children: [
24
24
  /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
25
- displayWelcomeBack && /* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: "Welcome back," }),
25
+ displayWelcomeBack && /* @__PURE__ */ jsx(Heading, { children: "Welcome back," }),
26
26
  /* @__PURE__ */ jsx(UserIdentifier, { authInfo: para.authInfo })
27
27
  ] }),
28
28
  /* @__PURE__ */ jsxs(MainContainer, { children: [
29
- isPassword && /* @__PURE__ */ jsx(CpslButton, { fullWidth: true, onClick: () => presentLoginUi(AuthMethod.PASSWORD, loginState), children: "Login" }),
29
+ (isPassword || isPIN) && /* @__PURE__ */ jsx(CpslButton, { fullWidth: true, onClick: () => presentLoginUi(isPIN ? AuthMethod.PIN : AuthMethod.PASSWORD, loginState), children: "Login" }),
30
30
  isPasskey && /* @__PURE__ */ jsxs(Fragment, { children: [
31
31
  displayKnownDevices && /* @__PURE__ */ jsxs(Fragment, { children: [
32
32
  /* @__PURE__ */ jsx(KnownDevices, { hints: biometricHints, link: passkeyKnownDeviceUrl }),
@@ -1,6 +1,7 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
2
  interface AnimatedHeightWrapperProps extends PropsWithChildren {
3
3
  className?: string;
4
+ noAnimate?: boolean;
4
5
  }
5
6
  export declare const AnimatedHeightWrapper: React.FC<AnimatedHeightWrapperProps>;
6
7
  export {};
@@ -4,7 +4,7 @@ import { jsx } from "react/jsx-runtime";
4
4
  import { motion } from "framer-motion";
5
5
  import { useEffect, useRef, useState } from "react";
6
6
  import { safeStyled } from "@getpara/react-common";
7
- const AnimatedHeightWrapper = ({ children, className }) => {
7
+ const AnimatedHeightWrapper = ({ children, className, noAnimate }) => {
8
8
  const containerRef = useRef(null);
9
9
  const [height, setHeight] = useState("auto");
10
10
  useEffect(() => {
@@ -19,7 +19,7 @@ const AnimatedHeightWrapper = ({ children, className }) => {
19
19
  };
20
20
  }
21
21
  }, []);
22
- return /* @__PURE__ */ jsx(Container, { className, style: { height }, animate: { height }, transition: { duration: 0.2 }, children: /* @__PURE__ */ jsx("div", { ref: containerRef, children }) });
22
+ return /* @__PURE__ */ jsx(Container, { className, style: { height }, animate: { height }, transition: { duration: noAnimate ? 0 : 0.2 }, children: /* @__PURE__ */ jsx("div", { ref: containerRef, children }) });
23
23
  };
24
24
  const Container = safeStyled(motion.div)`
25
25
  overflow: hidden;
@@ -5,7 +5,9 @@ interface BodyProps {
5
5
  disableEmailLogin: boolean;
6
6
  disablePhoneLogin: boolean;
7
7
  isGuestModeEnabled?: boolean;
8
+ onDisconnect: () => void;
9
+ isDisconnecting: boolean;
8
10
  onClose: () => void;
9
11
  }
10
- export declare const Body: ({ oAuthMethods, twoFactorAuthEnabled, disableEmailLogin, disablePhoneLogin, isGuestModeEnabled, onClose, }: BodyProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const Body: ({ oAuthMethods, twoFactorAuthEnabled, disableEmailLogin, disablePhoneLogin, isGuestModeEnabled, onClose, onDisconnect, isDisconnecting, }: BodyProps) => import("react/jsx-runtime").JSX.Element;
11
13
  export {};
@@ -26,7 +26,6 @@ import { Account } from "../Account/Account.js";
26
26
  import { AuthOptions } from "../AuthOptions/AuthOptions.js";
27
27
  import { ExternalWallets } from "../ExternalWallets/ExternalWallets.js";
28
28
  import { ExternalWalletStep } from "../ExternalWalletStep/ExternalWalletStep.js";
29
- import { Hero } from "../Hero/Hero.js";
30
29
  import { AnimatedHeightWrapper } from "./AnimatedHeightWrapper.js";
31
30
  import { ChainSwitch } from "../ChainSwitch/ChainSwitch.js";
32
31
  import { motion, AnimatePresence } from "framer-motion";
@@ -44,25 +43,22 @@ import { AccountProfileLink } from "../Account/AccountProfileLink.js";
44
43
  import { AccountProfileUnlink } from "../Account/AccountProfileUnlink.js";
45
44
  import { ExternalWalletNetworkSelectStep } from "../ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js";
46
45
  import { AwaitingIFrameStep } from "../AwaitingIFrameStep/AwaitingIFrameStep.js";
46
+ import { Footer } from "../Footer/Footer.js";
47
47
  const MIN_HEIGHT = {
48
48
  [ModalStep.ADD_FUNDS_AWAITING]: "680px"
49
49
  };
50
50
  const PADDING_TOP = {
51
51
  [ModalStep.TELEGRAM_OAUTH]: "36px"
52
52
  };
53
- const PADDING_BOTTOM = {
54
- [ModalStep.TELEGRAM_OAUTH]: "16px"
55
- };
56
- const PADDING_X = {
57
- [ModalStep.ACCOUNT_PROFILE]: "32px"
58
- };
59
53
  const Body = ({
60
54
  oAuthMethods,
61
55
  twoFactorAuthEnabled,
62
56
  disableEmailLogin,
63
57
  disablePhoneLogin,
64
58
  isGuestModeEnabled = false,
65
- onClose
59
+ onClose,
60
+ onDisconnect,
61
+ isDisconnecting
66
62
  }) => {
67
63
  const currentStep = useModalStore((state) => state.step);
68
64
  const onRampConfig = useModalStore((state) => state.onRampConfig);
@@ -170,10 +166,10 @@ const Body = ({
170
166
  return /* @__PURE__ */ jsx(AddFundsDone, { onClose });
171
167
  }
172
168
  case ModalStep.ACCOUNT_MAIN: {
173
- return /* @__PURE__ */ jsx(Account, { onClose });
169
+ return /* @__PURE__ */ jsx(Account, {});
174
170
  }
175
171
  case ModalStep.ACCOUNT_PROFILE: {
176
- return /* @__PURE__ */ jsx(AccountProfile, {});
172
+ return /* @__PURE__ */ jsx(AccountProfile, { onDisconnect, isDisconnecting });
177
173
  }
178
174
  case ModalStep.ACCOUNT_PROFILE_LIST: {
179
175
  return /* @__PURE__ */ jsx(AccountProfileLinkOptions, {});
@@ -228,7 +224,7 @@ const Body = ({
228
224
  /* @__PURE__ */ jsx(Controls, { onClose }),
229
225
  /* @__PURE__ */ jsx(Header, {})
230
226
  ] }),
231
- /* @__PURE__ */ jsxs(AnimatedWrapper, { children: [
227
+ /* @__PURE__ */ jsxs(AnimatedWrapper, { noAnimate: IFrameSteps.includes(currentStep), children: [
232
228
  /* @__PURE__ */ jsx(
233
229
  AnimatePresence,
234
230
  {
@@ -238,7 +234,7 @@ const Body = ({
238
234
  setStepDirection(1);
239
235
  },
240
236
  custom: stepDirection,
241
- children: /* @__PURE__ */ jsxs(
237
+ children: /* @__PURE__ */ jsx(
242
238
  BodyContainer,
243
239
  {
244
240
  custom: stepDirection,
@@ -247,49 +243,49 @@ const Body = ({
247
243
  animate: "center",
248
244
  exit: "exit",
249
245
  transition: BODY_TRANSITION,
250
- children: [
251
- /* @__PURE__ */ jsx(Hero, {}),
252
- /* @__PURE__ */ jsxs(
253
- InnerContainer,
254
- {
255
- $embeddedModal: !!embeddedModal,
256
- $step: currentStep,
257
- $isIFrameStep: IFrameSteps.includes(currentStep),
258
- children: [
259
- /* @__PURE__ */ jsx(NetworkSpeedBanner, { fontSize: "12px", iconSize: "16px" }),
260
- Content(),
261
- (onRampConfig == null ? void 0 : onRampConfig.testMode) && [
262
- ModalStep.ADD_FUNDS_BUY,
263
- ModalStep.ADD_FUNDS_WITHDRAW,
264
- ModalStep.ADD_FUNDS_AWAITING,
265
- ModalStep.ADD_FUNDS_FAILURE,
266
- ModalStep.ADD_FUNDS_SUCCESS
267
- ].includes(currentStep) && isTestModeAlert && accountAddFundTab !== EnabledFlow.RECEIVE && /* @__PURE__ */ jsx(TestModeAlert, { children: /* @__PURE__ */ jsxs("div", { style: { fontSize: "14px" }, children: [
268
- "This Para Modal is configured to run on-ramp services in ",
269
- /* @__PURE__ */ jsx("b", { children: "test mode" }),
270
- " only, for development purposes. If you are a user of ",
271
- appName,
272
- ", please contact support.",
273
- /* @__PURE__ */ jsx(CloseButton, { onClick: () => setIsTestModeAlert(false), children: /* @__PURE__ */ jsx(CloseX, { icon: "x" }) })
274
- ] }) })
275
- ]
276
- }
277
- )
278
- ]
246
+ children: /* @__PURE__ */ jsxs(
247
+ InnerContainer,
248
+ {
249
+ $embeddedModal: !!embeddedModal,
250
+ $step: currentStep,
251
+ $isIFrameStep: IFrameSteps.includes(currentStep),
252
+ children: [
253
+ /* @__PURE__ */ jsx(NetworkSpeedBanner, { fontSize: "12px", iconSize: "16px" }),
254
+ Content(),
255
+ (onRampConfig == null ? void 0 : onRampConfig.testMode) && [
256
+ ModalStep.ADD_FUNDS_BUY,
257
+ ModalStep.ADD_FUNDS_WITHDRAW,
258
+ ModalStep.ADD_FUNDS_AWAITING,
259
+ ModalStep.ADD_FUNDS_FAILURE,
260
+ ModalStep.ADD_FUNDS_SUCCESS
261
+ ].includes(currentStep) && isTestModeAlert && accountAddFundTab !== EnabledFlow.RECEIVE && /* @__PURE__ */ jsx(TestModeAlert, { children: /* @__PURE__ */ jsxs("div", { style: { fontSize: "14px" }, children: [
262
+ "This Para Modal is configured to run on-ramp services in ",
263
+ /* @__PURE__ */ jsx("b", { children: "test mode" }),
264
+ " only, for development purposes. If you are a user of ",
265
+ appName,
266
+ ", please contact support.",
267
+ /* @__PURE__ */ jsx(CloseButton, { onClick: () => setIsTestModeAlert(false), children: /* @__PURE__ */ jsx(CloseX, { icon: "x" }) })
268
+ ] }) })
269
+ ]
270
+ }
271
+ )
279
272
  },
280
273
  ["ADD_FUNDS_BUY", "ADD_FUNDS_RECEIVE", "ADD_FUNDS_WITHDRAW"].includes(currentStep) ? "ADD_FUNDS" : currentStep
281
274
  )
282
275
  }
283
276
  ),
284
- /* @__PURE__ */ jsx(IFrameStep, {})
277
+ /* @__PURE__ */ jsx(IFrameStep, {}),
278
+ /* @__PURE__ */ jsx(Footer, {})
285
279
  ] })
286
280
  ] });
287
281
  };
288
282
  const Container = safeStyled.div`
289
283
  position: relative;
284
+ display: flex;
285
+ flex-direction: column;
286
+ gap: 16px;
290
287
  `;
291
288
  const AnimatedWrapper = safeStyled(AnimatedHeightWrapper)`
292
- margin-top: -16px;
293
289
  `;
294
290
  const BodyContainer = safeStyled(motion.div)`
295
291
  position: relative;
@@ -305,10 +301,7 @@ const InnerContainer = safeStyled.div`
305
301
  flex-direction: column;
306
302
  justify-content: flex-start;
307
303
  gap: 24px;
308
- padding: ${({ $embeddedModal, $step, $isIFrameStep }) => {
309
- var _a, _b, _c;
310
- return $isIFrameStep ? "0px" : $embeddedModal ? "12px 0px 0px" : `${(_a = PADDING_TOP[$step]) != null ? _a : "72px"} ${(_b = PADDING_X[$step]) != null ? _b : "72px"} ${(_c = PADDING_BOTTOM[$step]) != null ? _c : "32px"}`;
311
- }};
304
+ padding: 0px;
312
305
  min-height: ${({ $step }) => {
313
306
  var _a;
314
307
  return (_a = MIN_HEIGHT[$step]) != null ? _a : "auto";
@@ -4,10 +4,10 @@ import {
4
4
  } from "../../../chunk-MMUBH76A.js";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  import { CpslButton, CpslIcon, CpslQrCode, CpslSpinner, CpslText } from "@getpara/react-components";
7
- import { CenteredText, InnerStepContainer, QRContainer, StepContainer } from "../common.js";
7
+ import { HeroAccountTypeIcon, InnerStepContainer, QRContainer, StepContainer } from "../common.js";
8
8
  import { useEffect, useMemo } from "react";
9
9
  import { useModalStore } from "../../stores/index.js";
10
- import { safeStyled } from "@getpara/react-common";
10
+ import { HeroSpinner, safeStyled } from "@getpara/react-common";
11
11
  import { useCopyToClipboard } from "@getpara/react-common";
12
12
  import { ModalStep } from "../../utils/steps.js";
13
13
  import { routeMobileExternalWallet } from "../../utils/routeMobileExternalWallet.js";
@@ -56,15 +56,18 @@ const ChainSwitch = () => {
56
56
  ] })
57
57
  ] }) });
58
58
  }
59
+ const isError = !!(externalWalletError == null ? void 0 : externalWalletError[0]);
59
60
  return /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
60
- !(externalWalletError == null ? void 0 : externalWalletError.length) ? /* @__PURE__ */ jsx(CenteredText, { color: "contrast", weight: "semiBold", children: `Confirm the request to change networks in your ${wallet.name} wallet.` }) : /* @__PURE__ */ jsxs(Fragment, { children: [
61
- /* @__PURE__ */ jsxs(ErrorContainer, { children: [
62
- /* @__PURE__ */ jsx(ErrorIcon, { icon: "alertCircle" }),
63
- /* @__PURE__ */ jsx(CenteredText, { weight: "semiBold", color: "error", children: externalWalletError[0] })
64
- ] }),
65
- externalWalletError[1] && /* @__PURE__ */ jsx(CenteredText, { color: "secondary", weight: "medium", children: externalWalletError[1] })
66
- ] }),
67
- ((_a = externalWalletError == null ? void 0 : externalWalletError[0]) == null ? void 0 : _a.toLowerCase()) !== NETWORK_NOT_SUPPORTED_ERROR && /* @__PURE__ */ jsxs(CpslButton, { variant: "secondary", onClick: handleTryAgainClick, children: [
61
+ /* @__PURE__ */ jsx(
62
+ HeroSpinner,
63
+ {
64
+ icon: /* @__PURE__ */ jsx(HeroAccountTypeIcon, { accountType: wallet.internalId, src: wallet ? wallet.iconUrl : void 0 }),
65
+ status: isError ? "error" : "pending",
66
+ text: isError ? externalWalletError[0] : `Confirm the request to change networks in your ${wallet.name} wallet.`,
67
+ secondaryText: externalWalletError == null ? void 0 : externalWalletError[1]
68
+ }
69
+ ),
70
+ ((_a = externalWalletError == null ? void 0 : externalWalletError[0]) == null ? void 0 : _a.toLowerCase()) !== NETWORK_NOT_SUPPORTED_ERROR && /* @__PURE__ */ jsxs(CpslButton, { fullWidth: true, variant: "secondary", onClick: handleTryAgainClick, children: [
68
71
  /* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "refresh" }),
69
72
  "Try Again"
70
73
  ] })
@@ -79,17 +82,6 @@ const Container = safeStyled(StepContainer)`
79
82
  flex: 1;
80
83
  justify-content: space-between;
81
84
  `;
82
- const ErrorContainer = safeStyled.div`
83
- display: flex;
84
- align-items: center;
85
- justify-content: center;
86
- gap: 4px;
87
- `;
88
- const ErrorIcon = safeStyled(CpslIcon)`
89
- --height: 16px;
90
- --width: 16px;
91
- --icon-color: var(--cpsl-color-text-error);
92
- `;
93
85
  export {
94
86
  ChainSwitch
95
87
  };
@@ -1,2 +1 @@
1
1
  export declare const ChainSelect: () => import("react/jsx-runtime").JSX.Element | null;
2
- export declare const AccountSelect: () => import("react/jsx-runtime").JSX.Element;