@getpara/react-sdk 2.0.0-alpha.18 → 2.0.0-alpha.19

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 (46) hide show
  1. package/dist/cli/cli.mjs +2 -0
  2. package/dist/modal/ParaModal.js +2 -2
  3. package/dist/modal/components/Account/Account.js +6 -6
  4. package/dist/modal/components/AddFunds/AddFunds.js +2 -2
  5. package/dist/modal/components/AddFunds/AddFundsAsset.js +6 -6
  6. package/dist/modal/components/AddFunds/AddFundsAwaiting.js +2 -2
  7. package/dist/modal/components/AddFunds/AddFundsProvider.js +4 -4
  8. package/dist/modal/components/AddFunds/AddFundsSettings.js +6 -6
  9. package/dist/modal/components/AddFunds/common.js +2 -2
  10. package/dist/modal/components/AuthInput/AuthInput.js +6 -6
  11. package/dist/modal/components/AuthMainStep/AuthMainStep.js +2 -2
  12. package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +6 -6
  13. package/dist/modal/components/AuthOptions/AuthOptions.js +4 -4
  14. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +2 -2
  15. package/dist/modal/components/Body/AnimatedHeightWrapper.js +2 -2
  16. package/dist/modal/components/Body/Body.js +8 -8
  17. package/dist/modal/components/ChainSwitch/ChainSwitch.js +4 -4
  18. package/dist/modal/components/Controls/Controls.js +5 -5
  19. package/dist/modal/components/Controls/Selects.js +6 -6
  20. package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +6 -6
  21. package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.js +2 -2
  22. package/dist/modal/components/ExternalWallets/ExternalWallets.js +12 -12
  23. package/dist/modal/components/Footer/Footer.js +10 -10
  24. package/dist/modal/components/Header/Header.js +2 -2
  25. package/dist/modal/components/Header/hooks/useStepTitle.js +1 -0
  26. package/dist/modal/components/Hero/Hero.js +7 -7
  27. package/dist/modal/components/IFrameStep/IFrameStep.js +3 -3
  28. package/dist/modal/components/OAuth/OAuth.js +3 -3
  29. package/dist/modal/components/OAuth/TelegramOAuthStep.js +4 -4
  30. package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +8 -8
  31. package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +4 -4
  32. package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +3 -3
  33. package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +4 -4
  34. package/dist/modal/components/WalletCard/PartnerIcon.js +4 -4
  35. package/dist/modal/components/WalletCard/WalletCard.js +7 -7
  36. package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +2 -2
  37. package/dist/modal/components/common.js +19 -19
  38. package/dist/modal/constants/constants.js +1 -1
  39. package/dist/modal/utils/steps.d.ts +2 -0
  40. package/dist/modal/utils/steps.js +5 -1
  41. package/dist/provider/index.d.ts +2 -0
  42. package/dist/provider/index.js +2 -0
  43. package/dist/provider/providers/AuthProvider.js +14 -4
  44. package/package.json +8 -8
  45. package/dist/modal/types/externalWallets.d.ts +0 -37
  46. package/dist/modal/types/externalWallets.js +0 -34
@@ -2,27 +2,27 @@
2
2
  import "../../chunk-MMUBH76A.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { CpslIcon, CpslInput, CpslSelect, CpslSelectItem, CpslText, CpslTileButton } from "@getpara/react-components";
5
- import { styled } from "styled-components";
5
+ import { safeStyled } from "@getpara/react-common";
6
6
  import { MOBILE_SIZE, NETWORKS, ON_RAMP_ASSETS } from "../constants/constants.js";
7
7
  import { useStore } from "../../provider/stores/useStore.js";
8
- const SpinnerContainer = styled.div`
8
+ const SpinnerContainer = safeStyled.div`
9
9
  display: flex;
10
10
  align-items: center;
11
11
  justify-content: center;
12
12
  `;
13
- const QRContainer = styled.div`
13
+ const QRContainer = safeStyled.div`
14
14
  display: flex;
15
15
  justify-content: center;
16
16
  align-items: center;
17
17
  width: 286px;
18
18
  height: 286px;
19
19
  `;
20
- const InfoBoxContent = styled.div`
20
+ const InfoBoxContent = safeStyled.div`
21
21
  display: flex;
22
22
  flex-direction: column;
23
23
  gap: 8px;
24
24
  `;
25
- const InfoBoxHeader = styled.div`
25
+ const InfoBoxHeader = safeStyled.div`
26
26
  display: flex;
27
27
  align-items: center;
28
28
  gap: 4px;
@@ -32,21 +32,21 @@ const InfoBoxHeader = styled.div`
32
32
  --width: 20px;
33
33
  }
34
34
  `;
35
- const FilledDisabledInput = styled(CpslInput)`
35
+ const FilledDisabledInput = safeStyled(CpslInput)`
36
36
  --container-border-color: var(--cpsl-color-input-border-placeholder);
37
37
  --container-background-color: var(--cpsl-color-background-0);
38
38
  --input-background-color: transparent;
39
39
  --input-font-weight: 500;
40
40
  --input-color: var(--cpsl-color-text-secondary);
41
41
  `;
42
- const FullWidthFilledDisabledInput = styled(FilledDisabledInput)`
42
+ const FullWidthFilledDisabledInput = safeStyled(FilledDisabledInput)`
43
43
  width: 100%;
44
44
  `;
45
- const CenteredText = styled(CpslText)`
45
+ const CenteredText = safeStyled(CpslText)`
46
46
  width: 100%;
47
47
  text-align: center;
48
48
  `;
49
- const InnerStepContainer = styled.div`
49
+ const InnerStepContainer = safeStyled.div`
50
50
  width: 100%;
51
51
  height: 100%;
52
52
  align-self: center;
@@ -55,22 +55,22 @@ const InnerStepContainer = styled.div`
55
55
  align-items: center;
56
56
  gap: 8px;
57
57
  `;
58
- const StepContainer = styled(InnerStepContainer)`
58
+ const StepContainer = safeStyled(InnerStepContainer)`
59
59
  gap: ${({ $wide }) => $wide ? "32px" : "24px"};
60
60
  `;
61
- const Heading = styled(CenteredText)``;
62
- const StyledCpslTileButton = styled(CpslTileButton)`
61
+ const Heading = safeStyled(CenteredText)``;
62
+ const StyledCpslTileButton = safeStyled(CpslTileButton)`
63
63
  --button-width: 100%;
64
64
  --button-height: 87px;
65
65
  --button-icon-height: 32px;
66
66
  --button-icon-width: 32px;
67
67
  `;
68
- const HeroIcon = styled(CpslIcon)`
68
+ const HeroIcon = safeStyled(CpslIcon)`
69
69
  --height: 80px;
70
70
  --width: 80px;
71
71
  --icon-color: var(--cpsl-color-text-primary);
72
72
  `;
73
- const HeaderSelect = styled(CpslSelect)`
73
+ const HeaderSelect = safeStyled(CpslSelect)`
74
74
  --container-height: 26px;
75
75
  --container-border-width: 0px;
76
76
  --container-padding-end: 0px;
@@ -106,13 +106,13 @@ const HeaderSelect = styled(CpslSelect)`
106
106
  --icon-color: var(--cpsl-color-contrast);
107
107
  }
108
108
  `;
109
- const HeaderSelectItem = styled(CpslSelectItem)`
109
+ const HeaderSelectItem = safeStyled(CpslSelectItem)`
110
110
  --outer-container-padding-start: 4px;
111
111
  --outer-container-padding-end: 4px;
112
112
  --outer-container-padding-top: 4px;
113
113
  --outer-container-padding-bottom: 4px;
114
114
  `;
115
- const HeaderSelectContainer = styled.div`
115
+ const HeaderSelectContainer = safeStyled.div`
116
116
  position: relative;
117
117
  display: flex;
118
118
  align-items: center;
@@ -121,7 +121,7 @@ const HeaderSelectContainer = styled.div`
121
121
  background-color: var(--cpsl-color-background-8);
122
122
  padding: 4px;
123
123
  `;
124
- const StyledIcon = styled(CpslIcon)`
124
+ const StyledIcon = safeStyled(CpslIcon)`
125
125
  background: var(--cpsl-color-background-0);
126
126
  border-radius: 100%;
127
127
  `;
@@ -141,13 +141,13 @@ function NetworkIcon({ network, size }) {
141
141
  const data = NETWORKS[network];
142
142
  return /* @__PURE__ */ jsx(StyledIcon, { size, icon: data.icon, inset: data.isCircular ? void 0 : "15%", invert: isDark && data.isDark });
143
143
  }
144
- const ErrorContainer = styled.div`
144
+ const ErrorContainer = safeStyled.div`
145
145
  display: flex;
146
146
  align-items: center;
147
147
  justify-content: center;
148
148
  gap: 4px;
149
149
  `;
150
- const ErrorIcon = styled(CpslIcon)`
150
+ const ErrorIcon = safeStyled(CpslIcon)`
151
151
  --height: 16px;
152
152
  --width: 16px;
153
153
  --icon-color: var(--cpsl-color-text-error);
@@ -119,7 +119,7 @@ const BODY_MOTION_VARIANTS = {
119
119
  const BODY_TRANSITION = {
120
120
  duration: 0.2
121
121
  };
122
- const SDK_VERSION = "2.0.0-alpha.18";
122
+ const SDK_VERSION = "2.0.0-alpha.19";
123
123
  export {
124
124
  BODY_MOTION_VARIANTS,
125
125
  BODY_TRANSITION,
@@ -19,6 +19,7 @@ export declare enum ModalStep {
19
19
  WALLET_CREATION_DONE = "WALLET_CREATION_DONE",
20
20
  SECRET = "SECRET",
21
21
  BIOMETRIC_LOGIN = "BIOMETRIC_LOGIN",
22
+ EMBEDDED_PASSWORD_LOGIN = "EMBEDDED_PASSWORD_LOGIN",
22
23
  AWAITING_BIOMETRIC_LOGIN = "AWAITING_BIOMETRIC_LOGIN",
23
24
  AWAITING_PASSWORD_LOGIN = "AWAITING_PASSWORD_LOGIN",
24
25
  LOGIN_DONE = "LOGIN_DONE",
@@ -95,6 +96,7 @@ declare enum LoginModalStep {
95
96
  FARCASTER_OAUTH = "FARCASTER_OAUTH",
96
97
  TELEGRAM_OAUTH = "TELEGRAM_OAUTH",
97
98
  BIOMETRIC_LOGIN = "BIOMETRIC_LOGIN",
99
+ EMBEDDED_PASSWORD_LOGIN = "EMBEDDED_PASSWORD_LOGIN",
98
100
  AWAITING_BIOMETRIC_LOGIN = "AWAITING_BIOMETRIC_LOGIN",
99
101
  AWAITING_PASSWORD_LOGIN = "AWAITING_PASSWORD_LOGIN",
100
102
  AWAITING_WALLET_CREATION = "AWAITING_WALLET_CREATION",
@@ -20,6 +20,7 @@ var ModalStep = /* @__PURE__ */ ((ModalStep2) => {
20
20
  ModalStep2["WALLET_CREATION_DONE"] = "WALLET_CREATION_DONE";
21
21
  ModalStep2["SECRET"] = "SECRET";
22
22
  ModalStep2["BIOMETRIC_LOGIN"] = "BIOMETRIC_LOGIN";
23
+ ModalStep2["EMBEDDED_PASSWORD_LOGIN"] = "EMBEDDED_PASSWORD_LOGIN";
23
24
  ModalStep2["AWAITING_BIOMETRIC_LOGIN"] = "AWAITING_BIOMETRIC_LOGIN";
24
25
  ModalStep2["AWAITING_PASSWORD_LOGIN"] = "AWAITING_PASSWORD_LOGIN";
25
26
  ModalStep2["LOGIN_DONE"] = "LOGIN_DONE";
@@ -61,6 +62,7 @@ const RESET_TO_AUTH_STEPS = [
61
62
  "PASSWORD_CREATION" /* PASSWORD_CREATION */,
62
63
  "AWAITING_PASSWORD_CREATION" /* AWAITING_PASSWORD_CREATION */,
63
64
  "BIOMETRIC_LOGIN" /* BIOMETRIC_LOGIN */,
65
+ "EMBEDDED_PASSWORD_LOGIN" /* EMBEDDED_PASSWORD_LOGIN */,
64
66
  "AWAITING_BIOMETRIC_LOGIN" /* AWAITING_BIOMETRIC_LOGIN */,
65
67
  "AWAITING_PASSWORD_LOGIN" /* AWAITING_PASSWORD_LOGIN */,
66
68
  "AWAITING_WALLET_CREATION" /* AWAITING_WALLET_CREATION */,
@@ -165,6 +167,7 @@ var LoginModalStep = /* @__PURE__ */ ((LoginModalStep2) => {
165
167
  LoginModalStep2["FARCASTER_OAUTH"] = "FARCASTER_OAUTH";
166
168
  LoginModalStep2["TELEGRAM_OAUTH"] = "TELEGRAM_OAUTH";
167
169
  LoginModalStep2["BIOMETRIC_LOGIN"] = "BIOMETRIC_LOGIN";
170
+ LoginModalStep2["EMBEDDED_PASSWORD_LOGIN"] = "EMBEDDED_PASSWORD_LOGIN";
168
171
  LoginModalStep2["AWAITING_BIOMETRIC_LOGIN"] = "AWAITING_BIOMETRIC_LOGIN";
169
172
  LoginModalStep2["AWAITING_PASSWORD_LOGIN"] = "AWAITING_PASSWORD_LOGIN";
170
173
  LoginModalStep2["AWAITING_WALLET_CREATION"] = "AWAITING_WALLET_CREATION";
@@ -191,6 +194,7 @@ const LoginPreviousStep = {
191
194
  ["AWAITING_OAUTH" /* AWAITING_OAUTH */]: "AUTH_MAIN" /* AUTH_MAIN */,
192
195
  ["FARCASTER_OAUTH" /* FARCASTER_OAUTH */]: "AUTH_MAIN" /* AUTH_MAIN */,
193
196
  ["BIOMETRIC_LOGIN" /* BIOMETRIC_LOGIN */]: "AUTH_MAIN" /* AUTH_MAIN */,
197
+ ["EMBEDDED_PASSWORD_LOGIN" /* EMBEDDED_PASSWORD_LOGIN */]: "AUTH_MAIN" /* AUTH_MAIN */,
194
198
  ["AWAITING_BIOMETRIC_LOGIN" /* AWAITING_BIOMETRIC_LOGIN */]: "BIOMETRIC_LOGIN" /* BIOMETRIC_LOGIN */,
195
199
  ["AWAITING_PASSWORD_LOGIN" /* AWAITING_PASSWORD_LOGIN */]: "BIOMETRIC_LOGIN" /* BIOMETRIC_LOGIN */,
196
200
  ["AWAITING_WALLET_CREATION" /* AWAITING_WALLET_CREATION */]: void 0,
@@ -232,7 +236,7 @@ function getAddFundsStep(currentTab) {
232
236
  return "ADD_FUNDS_WITHDRAW" /* ADD_FUNDS_WITHDRAW */;
233
237
  }
234
238
  }
235
- const IFrameSteps = ["PASSWORD_CREATION" /* PASSWORD_CREATION */];
239
+ const IFrameSteps = ["PASSWORD_CREATION" /* PASSWORD_CREATION */, "EMBEDDED_PASSWORD_LOGIN" /* EMBEDDED_PASSWORD_LOGIN */];
236
240
  export {
237
241
  AccountPreviousStep,
238
242
  GuestPreviousStep,
@@ -2,3 +2,5 @@ export { ParaProvider } from './ParaProvider.js';
2
2
  export * from './hooks/index.js';
3
3
  export * from './stores/getters.js';
4
4
  export * from './stores/setters.js';
5
+ export * from './types/externalWalletProviders.js';
6
+ export * from './types/provider.js';
@@ -4,6 +4,8 @@ import { ParaProvider } from "./ParaProvider.js";
4
4
  export * from "./hooks/index.js";
5
5
  export * from "./stores/getters.js";
6
6
  export * from "./stores/setters.js";
7
+ export * from "./types/externalWalletProviders.js";
8
+ export * from "./types/provider.js";
7
9
  export {
8
10
  ParaProvider
9
11
  };
@@ -188,8 +188,13 @@ function AuthProvider({
188
188
  },
189
189
  [isIFrameReady]
190
190
  );
191
- const login = () => {
192
- setStep(ModalStep.BIOMETRIC_LOGIN);
191
+ const login = (authState) => {
192
+ if (authState.isWalletSelectionNeeded || authState.passkeyUrl) {
193
+ setStep(ModalStep.BIOMETRIC_LOGIN);
194
+ } else {
195
+ setIFrameUrl(authState.passwordUrl);
196
+ setStep(ModalStep.EMBEDDED_PASSWORD_LOGIN);
197
+ }
193
198
  refs.poll.current = {
194
199
  action: "login",
195
200
  timeout: window == null ? void 0 : window.setTimeout(() => __async(this, null, function* () {
@@ -197,11 +202,16 @@ function AuthProvider({
197
202
  {
198
203
  isCanceled: () => cancelIfExitedSteps([
199
204
  ModalStep.BIOMETRIC_LOGIN,
205
+ ModalStep.EMBEDDED_PASSWORD_LOGIN,
200
206
  ModalStep.AWAITING_BIOMETRIC_LOGIN,
201
207
  ModalStep.AWAITING_PASSWORD_LOGIN
202
208
  ]),
203
209
  onPoll: () => {
204
- goBackIfPopupClosedOnSteps([ModalStep.AWAITING_BIOMETRIC_LOGIN, ModalStep.AWAITING_PASSWORD_LOGIN]);
210
+ goBackIfPopupClosedOnSteps([
211
+ ModalStep.AWAITING_BIOMETRIC_LOGIN,
212
+ ModalStep.AWAITING_PASSWORD_LOGIN,
213
+ ModalStep.EMBEDDED_PASSWORD_LOGIN
214
+ ]);
205
215
  }
206
216
  },
207
217
  {
@@ -262,7 +272,7 @@ function AuthProvider({
262
272
  }
263
273
  break;
264
274
  case "login":
265
- login();
275
+ login(authState);
266
276
  break;
267
277
  case "signup":
268
278
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/react-sdk",
3
- "version": "2.0.0-alpha.18",
3
+ "version": "2.0.0-alpha.19",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,9 +15,9 @@
15
15
  "*.css"
16
16
  ],
17
17
  "dependencies": {
18
- "@getpara/react-common": "2.0.0-alpha.18",
19
- "@getpara/react-components": "2.0.0-alpha.18",
20
- "@getpara/web-sdk": "2.0.0-alpha.18",
18
+ "@getpara/react-common": "2.0.0-alpha.19",
19
+ "@getpara/react-components": "2.0.0-alpha.19",
20
+ "@getpara/web-sdk": "2.0.0-alpha.19",
21
21
  "date-fns": "^3.6.0",
22
22
  "framer-motion": "11.3.28",
23
23
  "libphonenumber-js": "^1.11.1",
@@ -33,9 +33,9 @@
33
33
  "cli": "node ./dist/cli/cli.mjs"
34
34
  },
35
35
  "devDependencies": {
36
- "@getpara/cosmos-wallet-connectors": "2.0.0-alpha.18",
37
- "@getpara/evm-wallet-connectors": "2.0.0-alpha.18",
38
- "@getpara/solana-wallet-connectors": "2.0.0-alpha.18",
36
+ "@getpara/cosmos-wallet-connectors": "2.0.0-alpha.19",
37
+ "@getpara/evm-wallet-connectors": "2.0.0-alpha.19",
38
+ "@getpara/solana-wallet-connectors": "2.0.0-alpha.19",
39
39
  "@testing-library/dom": "^10.4.0",
40
40
  "@testing-library/react": "^16.3.0",
41
41
  "@testing-library/react-hooks": "^8.0.1",
@@ -63,5 +63,5 @@
63
63
  "resolutions": {
64
64
  "styled-components": "^6"
65
65
  },
66
- "gitHead": "2333bc727fe61593821d448ee12facaee230c4b0"
66
+ "gitHead": "80d2c5d7e1203fb12378aa29bfd4d7003c7d7075"
67
67
  }
@@ -1,37 +0,0 @@
1
- export declare enum EvmWallet {
2
- METAMASK = "METAMASK",
3
- RAINBOW = "RAINBOW",
4
- COINBASE = "COINBASE",
5
- WALLETCONNECT = "WALLETCONNECT",
6
- ZERION = "ZERION",
7
- SAFE = "SAFE",
8
- RABBY = "RABBY",
9
- OKX = "OKX"
10
- }
11
- export declare enum SolanaWallet {
12
- PHANTOM = "PHANTOM",
13
- GLOW = "GLOW",
14
- BACKPACK = "BACKPACK",
15
- SOLFLARE = "SOLFLARE"
16
- }
17
- export declare enum CosmosWallet {
18
- KEPLR = "KEPLR",
19
- LEAP = "LEAP"
20
- }
21
- export declare const ExternalWallet: {
22
- KEPLR: CosmosWallet.KEPLR;
23
- LEAP: CosmosWallet.LEAP;
24
- PHANTOM: SolanaWallet.PHANTOM;
25
- GLOW: SolanaWallet.GLOW;
26
- BACKPACK: SolanaWallet.BACKPACK;
27
- SOLFLARE: SolanaWallet.SOLFLARE;
28
- METAMASK: EvmWallet.METAMASK;
29
- RAINBOW: EvmWallet.RAINBOW;
30
- COINBASE: EvmWallet.COINBASE;
31
- WALLETCONNECT: EvmWallet.WALLETCONNECT;
32
- ZERION: EvmWallet.ZERION;
33
- SAFE: EvmWallet.SAFE;
34
- RABBY: EvmWallet.RABBY;
35
- OKX: EvmWallet.OKX;
36
- };
37
- export type TExternalWallet = keyof typeof ExternalWallet;
@@ -1,34 +0,0 @@
1
- "use client";
2
- import {
3
- __spreadValues
4
- } from "../../chunk-MMUBH76A.js";
5
- var EvmWallet = /* @__PURE__ */ ((EvmWallet2) => {
6
- EvmWallet2["METAMASK"] = "METAMASK";
7
- EvmWallet2["RAINBOW"] = "RAINBOW";
8
- EvmWallet2["COINBASE"] = "COINBASE";
9
- EvmWallet2["WALLETCONNECT"] = "WALLETCONNECT";
10
- EvmWallet2["ZERION"] = "ZERION";
11
- EvmWallet2["SAFE"] = "SAFE";
12
- EvmWallet2["RABBY"] = "RABBY";
13
- EvmWallet2["OKX"] = "OKX";
14
- return EvmWallet2;
15
- })(EvmWallet || {});
16
- var SolanaWallet = /* @__PURE__ */ ((SolanaWallet2) => {
17
- SolanaWallet2["PHANTOM"] = "PHANTOM";
18
- SolanaWallet2["GLOW"] = "GLOW";
19
- SolanaWallet2["BACKPACK"] = "BACKPACK";
20
- SolanaWallet2["SOLFLARE"] = "SOLFLARE";
21
- return SolanaWallet2;
22
- })(SolanaWallet || {});
23
- var CosmosWallet = /* @__PURE__ */ ((CosmosWallet2) => {
24
- CosmosWallet2["KEPLR"] = "KEPLR";
25
- CosmosWallet2["LEAP"] = "LEAP";
26
- return CosmosWallet2;
27
- })(CosmosWallet || {});
28
- const ExternalWallet = __spreadValues(__spreadValues(__spreadValues({}, EvmWallet), SolanaWallet), CosmosWallet);
29
- export {
30
- CosmosWallet,
31
- EvmWallet,
32
- ExternalWallet,
33
- SolanaWallet
34
- };