@dynamic-labs/sdk-react-core 0.19.0-alpha.0 → 0.19.0-alpha.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/CHANGELOG.md +31 -0
- package/package.cjs +3 -3
- package/package.js +3 -3
- package/package.json +11 -10
- package/src/index.cjs +2 -0
- package/src/index.js +1 -0
- package/src/lib/Main.cjs +5 -0
- package/src/lib/Main.js +5 -0
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +9 -6
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +9 -6
- package/src/lib/components/Button/Button.cjs +10 -7
- package/src/lib/components/Button/Button.d.ts +3 -3
- package/src/lib/components/Button/Button.js +10 -7
- package/src/lib/components/DynamicConnectButton/components/ConnectButton.cjs +1 -1
- package/src/lib/components/DynamicConnectButton/components/ConnectButton.js +1 -1
- package/src/lib/components/Icon/Icon.cjs +1 -0
- package/src/lib/components/Icon/Icon.js +1 -0
- package/src/lib/components/Icon/Icon.types.d.ts +1 -1
- package/src/lib/components/IconWithSpinner/IconWithSpinner.d.ts +1 -1
- package/src/lib/components/ListTile/ListTile.cjs +1 -1
- package/src/lib/components/ListTile/ListTile.js +1 -1
- package/src/lib/components/ListTile/ListTile.types.d.ts +1 -0
- package/src/lib/components/ModalHeader/ModalHeader.cjs +2 -2
- package/src/lib/components/ModalHeader/ModalHeader.js +2 -2
- package/src/lib/components/ModalHeader/ModalHeader.types.d.ts +2 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +1 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.js +1 -1
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +5 -3
- package/src/lib/components/OTPVerificationView/OTPVerificationView.d.ts +1 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +5 -3
- package/src/lib/components/PoweredByDynamic/PoweredByDynamic.cjs +6 -2
- package/src/lib/components/PoweredByDynamic/PoweredByDynamic.d.ts +1 -0
- package/src/lib/components/PoweredByDynamic/PoweredByDynamic.js +6 -2
- package/src/lib/components/UserProfileForm/UserProfileForm.cjs +26 -14
- package/src/lib/components/UserProfileForm/UserProfileForm.d.ts +14 -3
- package/src/lib/components/UserProfileForm/UserProfileForm.js +27 -15
- package/src/lib/components/UserProfileForm/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +9 -3
- package/src/lib/context/DynamicContext/DynamicContext.js +10 -4
- package/src/lib/context/ViewContext/ViewContext.d.ts +1 -1
- package/src/lib/data/api.cjs +16 -0
- package/src/lib/data/api.d.ts +1 -0
- package/src/lib/data/api.js +18 -3
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +10 -2
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +10 -2
- package/src/lib/shared/assets/double-arrow-right.cjs +53 -0
- package/src/lib/shared/assets/double-arrow-right.js +29 -0
- package/src/lib/shared/assets/index.d.ts +1 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/constants/index.d.ts +1 -1
- package/src/lib/utils/constants/localStorage.cjs +3 -1
- package/src/lib/utils/constants/localStorage.d.ts +1 -0
- package/src/lib/utils/constants/localStorage.js +3 -2
- package/src/lib/utils/functions/getUserProfileFields/getUserProfileFields.cjs +14 -2
- package/src/lib/utils/functions/getUserProfileFields/getUserProfileFields.d.ts +3 -2
- package/src/lib/utils/functions/getUserProfileFields/getUserProfileFields.js +14 -2
- package/src/lib/utils/functions/getUserProfileFields/index.d.ts +1 -0
- package/src/lib/utils/functions/index.d.ts +2 -0
- package/src/lib/utils/functions/isMagicConnector/index.d.ts +1 -0
- package/src/lib/utils/functions/isMagicConnector/isMagicConnector.d.ts +2 -0
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +6 -4
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.d.ts +3 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +6 -4
- package/src/lib/utils/hooks/index.d.ts +4 -1
- package/src/lib/utils/hooks/multiWallet/useMultiWallet/useMultiWallet.cjs +19 -3
- package/src/lib/utils/hooks/multiWallet/useMultiWallet/useMultiWallet.d.ts +1 -2
- package/src/lib/utils/hooks/multiWallet/useMultiWallet/useMultiWallet.js +20 -4
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +2 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +2 -1
- package/src/lib/utils/hooks/useFindSocialIcon/index.d.ts +1 -0
- package/src/lib/utils/hooks/{useGetSocialIcon/useGetSocialIcon.cjs → useFindSocialIcon/useFindSocialIcon.cjs} +3 -3
- package/src/lib/utils/hooks/useFindSocialIcon/useFindSocialIcon.d.ts +3 -0
- package/src/lib/utils/hooks/useFindSocialIcon/useFindSocialIcon.js +10 -0
- package/src/lib/utils/hooks/useTransactionEstimatedGas/index.d.ts +1 -0
- package/src/lib/utils/hooks/useTransactionEstimatedGas/useTransactionEstimatedGas.cjs +61 -0
- package/src/lib/utils/hooks/useTransactionEstimatedGas/useTransactionEstimatedGas.d.ts +20 -0
- package/src/lib/utils/hooks/useTransactionEstimatedGas/useTransactionEstimatedGas.js +57 -0
- package/src/lib/utils/hooks/useTransactionWithGasPrice/index.d.ts +1 -0
- package/src/lib/utils/hooks/useTransactionWithGasPrice/useTransactionWithGasPrice.d.ts +32 -0
- package/src/lib/utils/hooks/useWalletConnectorEvent/index.d.ts +1 -0
- package/src/lib/utils/hooks/useWalletConnectorEvent/useWalletConnectorEvent.cjs +42 -0
- package/src/lib/utils/hooks/useWalletConnectorEvent/useWalletConnectorEvent.d.ts +12 -0
- package/src/lib/utils/hooks/useWalletConnectorEvent/useWalletConnectorEvent.js +38 -0
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +12 -0
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +12 -0
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +91 -136
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +92 -137
- package/src/lib/views/AccountExistsView/AccountExistsView.cjs +3 -3
- package/src/lib/views/AccountExistsView/AccountExistsView.js +3 -3
- package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +4 -0
- package/src/lib/views/CollectUserDataView/UserDataFields/index.js +4 -0
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +8 -2
- package/src/lib/views/EmailUpdate/EmailUpdate.js +8 -2
- package/src/lib/views/EmailVerification/EmailVerification.cjs +13 -4
- package/src/lib/views/EmailVerification/EmailVerification.js +15 -6
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +3 -2
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +3 -2
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs +5 -3
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js +6 -4
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.cjs +3 -3
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.js +3 -3
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +107 -0
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.d.ts +2 -0
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +103 -0
- package/src/lib/views/MergeUserAccountsView/index.d.ts +1 -0
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +13 -3
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +13 -3
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +14 -4
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +14 -4
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +3 -3
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +3 -3
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.cjs +3 -3
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.js +3 -3
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionData/useTransactionData.cjs +2 -8
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionData/useTransactionData.js +3 -9
- package/src/lib/views/viewToComponentMap.cjs +2 -0
- package/src/lib/views/viewToComponentMap.js +2 -0
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.cjs +2 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.js +2 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetFooter/DynamicWidgetFooter.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetFooter/DynamicWidgetFooter.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.js +1 -1
- package/src/lib/utils/hooks/useGetSocialIcon/index.d.ts +0 -1
- package/src/lib/utils/hooks/useGetSocialIcon/useGetSocialIcon.d.ts +0 -2
- package/src/lib/utils/hooks/useGetSocialIcon/useGetSocialIcon.js +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,35 @@
|
|
|
1
1
|
|
|
2
|
+
## [0.19.0-alpha.1](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.0...v0.19.0-alpha.1) (2023-08-10)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* cleaning up email input field - delete continue button ([#2833](https://github.com/dynamic-labs/DynamicAuth/issues/2833)) ([baa399e](https://github.com/dynamic-labs/DynamicAuth/commit/baa399e387bce9570a7e7774d68dc3c92f86be1b))
|
|
8
|
+
* disable social buttons after provider is selected ([#2875](https://github.com/dynamic-labs/DynamicAuth/issues/2875)) ([6296ce1](https://github.com/dynamic-labs/DynamicAuth/commit/6296ce13062a8589cf6fb4741957dc9bf84552a2))
|
|
9
|
+
* **GVTY-65:** Allow Merging accounts when duplicated email in KYC step ([#2772](https://github.com/dynamic-labs/DynamicAuth/issues/2772)) ([8efb6ae](https://github.com/dynamic-labs/DynamicAuth/commit/8efb6aecc9445ef1798a5c6358eac27b16f661b6))
|
|
10
|
+
* hide network from nav if hideNetworkInDynamicWidget setting is true ([#2842](https://github.com/dynamic-labs/DynamicAuth/issues/2842)) ([f3dc9ba](https://github.com/dynamic-labs/DynamicAuth/commit/f3dc9ba987781d5d0540336f351bb9f148400eac))
|
|
11
|
+
* show email submit button on focus ([#2860](https://github.com/dynamic-labs/DynamicAuth/issues/2860)) ([87d8ae0](https://github.com/dynamic-labs/DynamicAuth/commit/87d8ae0806425a25835efda5f9b9abc58e5de18e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* account already exist message not displaying automatically ([#2896](https://github.com/dynamic-labs/DynamicAuth/issues/2896)) ([ba56c93](https://github.com/dynamic-labs/DynamicAuth/commit/ba56c936546428b0a1111ab5ef6e8d0d9a463bb5))
|
|
17
|
+
* array of dynamicWagmiSettings not being sent, must be turned into object ([#2835](https://github.com/dynamic-labs/DynamicAuth/issues/2835)) ([092c45a](https://github.com/dynamic-labs/DynamicAuth/commit/092c45afd3676fbd7c3d28f51818470de7f95768))
|
|
18
|
+
* change network modal doesn't pop on secondary wallet, when primaryWallet was disconnected ([#2817](https://github.com/dynamic-labs/DynamicAuth/issues/2817)) ([b68c156](https://github.com/dynamic-labs/DynamicAuth/commit/b68c1565f936d2f4275b104a0881ba5720101abd))
|
|
19
|
+
* connectSuccess callback is not being called when connecting new wallet after unlink ([#2814](https://github.com/dynamic-labs/DynamicAuth/issues/2814)) ([d5b34d8](https://github.com/dynamic-labs/DynamicAuth/commit/d5b34d8a073436ce39280766608578fd97567fac))
|
|
20
|
+
* css variables are being ignored for ConnectButton component ([#2869](https://github.com/dynamic-labs/DynamicAuth/issues/2869)) ([a54fb46](https://github.com/dynamic-labs/DynamicAuth/commit/a54fb46648758001450a33e6d86cf04765507701))
|
|
21
|
+
* css variables for the ConnectButton are being ignored ([#2856](https://github.com/dynamic-labs/DynamicAuth/issues/2856)) ([65a342f](https://github.com/dynamic-labs/DynamicAuth/commit/65a342f828b6a16f714fc6b6e2066e1b742b2c0a))
|
|
22
|
+
* don't let user update email if it's linked to an embedded wallet ([#2883](https://github.com/dynamic-labs/DynamicAuth/issues/2883)) ([99aa303](https://github.com/dynamic-labs/DynamicAuth/commit/99aa3033e62c0dee14657cb811db8d5b3597f7de))
|
|
23
|
+
* **GVTY-150:** blocto pop up to sign after disconnect ([#2854](https://github.com/dynamic-labs/DynamicAuth/issues/2854)) ([df5481b](https://github.com/dynamic-labs/DynamicAuth/commit/df5481b2d5438848ad96cdee402f40b520bead08))
|
|
24
|
+
* **GVTY-155:** update to the new design ([#2889](https://github.com/dynamic-labs/DynamicAuth/issues/2889)) ([31f7f54](https://github.com/dynamic-labs/DynamicAuth/commit/31f7f54444c623fe7d5bcf8a42f94ee22eedc3e1))
|
|
25
|
+
* **GVTY-159:** email update view not showing email used error ([#2887](https://github.com/dynamic-labs/DynamicAuth/issues/2887)) ([bd40e4c](https://github.com/dynamic-labs/DynamicAuth/commit/bd40e4c77cda42752d44e42b98bfcea4cfd77a80))
|
|
26
|
+
* **OTPOverviewView:** enable close only on close button click ([#2877](https://github.com/dynamic-labs/DynamicAuth/issues/2877)) ([2be23e7](https://github.com/dynamic-labs/DynamicAuth/commit/2be23e7ddefe67c971d863ad9069ac5b8a74f4e5))
|
|
27
|
+
* **transaction:** improve gas estimate in transaction confirmation ([#2767](https://github.com/dynamic-labs/DynamicAuth/issues/2767)) ([7180ae5](https://github.com/dynamic-labs/DynamicAuth/commit/7180ae50559f924ae9769b2b8d87eadc6604c754))
|
|
28
|
+
* use findSocialIcon instead getSocialIcon to avoid render errors ([#2834](https://github.com/dynamic-labs/DynamicAuth/issues/2834)) ([2c57f98](https://github.com/dynamic-labs/DynamicAuth/commit/2c57f98fd5c461ae4acbe2836f719ebe18bc21fc))
|
|
29
|
+
* **useWalletConnectorEvent:** ensure connector is initialized ([#2849](https://github.com/dynamic-labs/DynamicAuth/issues/2849)) ([9137131](https://github.com/dynamic-labs/DynamicAuth/commit/913713166af8a6e6cc15a8e362e57b328fc0a76f))
|
|
30
|
+
* **wcv2:** simulate chain change event in switchNetwork ([#2809](https://github.com/dynamic-labs/DynamicAuth/issues/2809)) ([2329b80](https://github.com/dynamic-labs/DynamicAuth/commit/2329b808f57644cebb664be536bc41e256d108d8))
|
|
31
|
+
* wrong wallet list is showing after disconnecting and network change ([#2815](https://github.com/dynamic-labs/DynamicAuth/issues/2815)) ([6cae101](https://github.com/dynamic-labs/DynamicAuth/commit/6cae1019f40be4ffe7ab0426aa159c652a770a82))
|
|
32
|
+
|
|
2
33
|
## [0.19.0-alpha.0](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.25...v0.19.0-alpha.0) (2023-08-01)
|
|
3
34
|
|
|
4
35
|
## [0.18.0-RC.25](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.24...v0.18.0-RC.25) (2023-08-01)
|
package/package.cjs
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = "0.19.0-alpha.
|
|
5
|
+
var version = "0.19.0-alpha.1";
|
|
6
6
|
var dependencies = {
|
|
7
7
|
"react-focus-lock": "2.9.2",
|
|
8
|
-
"@dynamic-labs/iconic": "0.1.
|
|
9
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
8
|
+
"@dynamic-labs/iconic": "0.1.27",
|
|
9
|
+
"@dynamic-labs/sdk-api": "0.0.256",
|
|
10
10
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
11
11
|
"country-list": "2.3.0",
|
|
12
12
|
yup: "0.32.11",
|
package/package.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var version = "0.19.0-alpha.
|
|
1
|
+
var version = "0.19.0-alpha.1";
|
|
2
2
|
var dependencies = {
|
|
3
3
|
"react-focus-lock": "2.9.2",
|
|
4
|
-
"@dynamic-labs/iconic": "0.1.
|
|
5
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
4
|
+
"@dynamic-labs/iconic": "0.1.27",
|
|
5
|
+
"@dynamic-labs/sdk-api": "0.0.256",
|
|
6
6
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
7
7
|
"country-list": "2.3.0",
|
|
8
8
|
yup: "0.32.11",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "0.19.0-alpha.
|
|
3
|
+
"version": "0.19.0-alpha.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -8,21 +8,22 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"react-focus-lock": "2.9.2",
|
|
11
|
-
"@dynamic-labs/iconic": "0.1.
|
|
12
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
11
|
+
"@dynamic-labs/iconic": "0.1.27",
|
|
12
|
+
"@dynamic-labs/sdk-api": "0.0.256",
|
|
13
13
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
14
14
|
"country-list": "2.3.0",
|
|
15
15
|
"yup": "0.32.11",
|
|
16
16
|
"formik": "2.2.9",
|
|
17
17
|
"qrcode": "1.5.1",
|
|
18
18
|
"ethers": "5.7.2",
|
|
19
|
-
"@dynamic-labs/logger": "0.19.0-alpha.
|
|
20
|
-
"@dynamic-labs/multi-wallet": "0.19.0-alpha.
|
|
21
|
-
"@dynamic-labs/rpc-providers": "0.19.0-alpha.
|
|
22
|
-
"@dynamic-labs/types": "0.19.0-alpha.
|
|
23
|
-
"@dynamic-labs/utils": "0.19.0-alpha.
|
|
24
|
-
"@dynamic-labs/wallet-book": "0.19.0-alpha.
|
|
25
|
-
"@dynamic-labs/wallet-connector-core": "0.19.0-alpha.
|
|
19
|
+
"@dynamic-labs/logger": "0.19.0-alpha.1",
|
|
20
|
+
"@dynamic-labs/multi-wallet": "0.19.0-alpha.1",
|
|
21
|
+
"@dynamic-labs/rpc-providers": "0.19.0-alpha.1",
|
|
22
|
+
"@dynamic-labs/types": "0.19.0-alpha.1",
|
|
23
|
+
"@dynamic-labs/utils": "0.19.0-alpha.1",
|
|
24
|
+
"@dynamic-labs/wallet-book": "0.19.0-alpha.1",
|
|
25
|
+
"@dynamic-labs/wallet-connector-core": "0.19.0-alpha.1",
|
|
26
|
+
"eventemitter3": "5.0.1"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
29
|
"semver": "7.3.8"
|
package/src/index.cjs
CHANGED
|
@@ -77,6 +77,7 @@ var switchHorizontal = require('./lib/shared/assets/switch-horizontal.cjs');
|
|
|
77
77
|
var dotsHorizontal = require('./lib/shared/assets/dots-horizontal.cjs');
|
|
78
78
|
var send = require('./lib/shared/assets/send.cjs');
|
|
79
79
|
var questionMark = require('./lib/shared/assets/question-mark.cjs');
|
|
80
|
+
var doubleArrowRight = require('./lib/shared/assets/double-arrow-right.cjs');
|
|
80
81
|
var index$2 = require('./lib/shared/consts/index.cjs');
|
|
81
82
|
var logger = require('./lib/shared/logger.cjs');
|
|
82
83
|
require('./lib/utils/constants/colors.cjs');
|
|
@@ -207,6 +208,7 @@ exports.SwitchHorizontalIcon = switchHorizontal.ReactComponent;
|
|
|
207
208
|
exports.DotsHorizontalIcon = dotsHorizontal.ReactComponent;
|
|
208
209
|
exports.SendIcon = send.ReactComponent;
|
|
209
210
|
exports.QuestionMarkIcon = questionMark.ReactComponent;
|
|
211
|
+
exports.DoubleArrowRightIcon = doubleArrowRight.ReactComponent;
|
|
210
212
|
exports.authModalZIndex = index$2.authModalZIndex;
|
|
211
213
|
exports.countryCodes = index$2.countryCodes;
|
|
212
214
|
exports.defaultWalletsForChains = index$2.defaultWalletsForChains;
|
package/src/index.js
CHANGED
|
@@ -73,6 +73,7 @@ export { ReactComponent as SwitchHorizontalIcon } from './lib/shared/assets/swit
|
|
|
73
73
|
export { ReactComponent as DotsHorizontalIcon } from './lib/shared/assets/dots-horizontal.js';
|
|
74
74
|
export { ReactComponent as SendIcon } from './lib/shared/assets/send.js';
|
|
75
75
|
export { ReactComponent as QuestionMarkIcon } from './lib/shared/assets/question-mark.js';
|
|
76
|
+
export { ReactComponent as DoubleArrowRightIcon } from './lib/shared/assets/double-arrow-right.js';
|
|
76
77
|
export { authModalZIndex, countryCodes, defaultWalletsForChains, tShirtSizes, teamNames, toolkitZIndex, tooltipZIndex, widgetModalZIndex } from './lib/shared/consts/index.js';
|
|
77
78
|
export { logger } from './lib/shared/logger.js';
|
|
78
79
|
import './lib/utils/constants/colors.js';
|
package/src/lib/Main.cjs
CHANGED
|
@@ -54,6 +54,9 @@ var isSelectedWalletAlreadyConnected = require('./utils/functions/isSelectedWall
|
|
|
54
54
|
var viewToComponentMap = require('./views/viewToComponentMap.cjs');
|
|
55
55
|
require('./main.global.cjs');
|
|
56
56
|
|
|
57
|
+
const viewsToDisableCloseOnOverlayClick = [
|
|
58
|
+
'email-wallet-otp-verification-view',
|
|
59
|
+
];
|
|
57
60
|
const Main = () => {
|
|
58
61
|
const { selectedWalletConnector, linkedWallets, isProjectSettingsLoading, projectSettings, setShowAuthFlow, showAuthFlow, wallets, clearStatesOnBackClick, user, unlinkConnectedWallet, authMode, connectedWallets, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
59
62
|
const { view, goToInitialView } = ViewContext.useViewContext();
|
|
@@ -61,6 +64,8 @@ const Main = () => {
|
|
|
61
64
|
const { setExistentAccountData } = AccountExistsContext.useAccountExistsContext();
|
|
62
65
|
usePreventPageScroll.usePreventPageScroll(showAuthFlow);
|
|
63
66
|
const handleClose = () => {
|
|
67
|
+
if (viewsToDisableCloseOnOverlayClick.includes(view))
|
|
68
|
+
return;
|
|
64
69
|
setShowAuthFlow(false);
|
|
65
70
|
setDeniedAddress('');
|
|
66
71
|
setDeniedOauthProvider(undefined);
|
package/src/lib/Main.js
CHANGED
|
@@ -50,6 +50,9 @@ import { isSelectedWalletAlreadyConnected } from './utils/functions/isSelectedWa
|
|
|
50
50
|
import { viewToComponentMap } from './views/viewToComponentMap.js';
|
|
51
51
|
import './main.global.js';
|
|
52
52
|
|
|
53
|
+
const viewsToDisableCloseOnOverlayClick = [
|
|
54
|
+
'email-wallet-otp-verification-view',
|
|
55
|
+
];
|
|
53
56
|
const Main = () => {
|
|
54
57
|
const { selectedWalletConnector, linkedWallets, isProjectSettingsLoading, projectSettings, setShowAuthFlow, showAuthFlow, wallets, clearStatesOnBackClick, user, unlinkConnectedWallet, authMode, connectedWallets, } = useInternalDynamicContext();
|
|
55
58
|
const { view, goToInitialView } = useViewContext();
|
|
@@ -57,6 +60,8 @@ const Main = () => {
|
|
|
57
60
|
const { setExistentAccountData } = useAccountExistsContext();
|
|
58
61
|
usePreventPageScroll(showAuthFlow);
|
|
59
62
|
const handleClose = () => {
|
|
63
|
+
if (viewsToDisableCloseOnOverlayClick.includes(view))
|
|
64
|
+
return;
|
|
60
65
|
setShowAuthFlow(false);
|
|
61
66
|
setDeniedAddress('');
|
|
62
67
|
setDeniedOauthProvider(undefined);
|
|
@@ -45,9 +45,9 @@ require('../MenuList/Dropdown/Dropdown.cjs');
|
|
|
45
45
|
require('../../context/MockContext/MockContext.cjs');
|
|
46
46
|
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
47
47
|
require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
48
|
-
var
|
|
48
|
+
var useFindSocialIcon = require('../../utils/hooks/useFindSocialIcon/useFindSocialIcon.cjs');
|
|
49
49
|
|
|
50
|
-
const getMagicEmailOrSocialIcon = ({
|
|
50
|
+
const getMagicEmailOrSocialIcon = ({ findSocialIcon, wallet, jwt, }) => {
|
|
51
51
|
if (walletConnectorCore.isEmailOTPWalletConnector(wallet.connector)) {
|
|
52
52
|
return iconic.SignInWithEmailIcon;
|
|
53
53
|
}
|
|
@@ -59,7 +59,7 @@ const getMagicEmailOrSocialIcon = ({ getSocialIcon, wallet, jwt, }) => {
|
|
|
59
59
|
}
|
|
60
60
|
const { oauthProvider } = socialAccountDataForWallet;
|
|
61
61
|
try {
|
|
62
|
-
const MagicSocialWalletIcon =
|
|
62
|
+
const MagicSocialWalletIcon = findSocialIcon(oauthProvider);
|
|
63
63
|
return MagicSocialWalletIcon;
|
|
64
64
|
}
|
|
65
65
|
catch (err) {
|
|
@@ -71,10 +71,13 @@ const getMagicEmailOrSocialIcon = ({ getSocialIcon, wallet, jwt, }) => {
|
|
|
71
71
|
const AuthProviderIcon = ({ jwt, iconSize = 64, showStatus, wallet, }) => {
|
|
72
72
|
const { primaryWallet, selectedWalletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
73
73
|
const { deniedOauthProvider, deniedAddress } = AccessDeniedContext.useAccessDeniedContext();
|
|
74
|
-
const
|
|
74
|
+
const findSocialIcon = useFindSocialIcon.useFindSocialIcon();
|
|
75
75
|
// when access is denied we don't have jwt set, so we're getting this value out of useAccessDeniedContext
|
|
76
76
|
if (deniedOauthProvider) {
|
|
77
|
-
const MagicSocialWalletIcon =
|
|
77
|
+
const MagicSocialWalletIcon = findSocialIcon(deniedOauthProvider);
|
|
78
|
+
if (!MagicSocialWalletIcon) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
78
81
|
return (jsxRuntime.jsx(MagicSocialWalletIcon, { style: {
|
|
79
82
|
height: pixelToRem.pixelToRem(iconSize),
|
|
80
83
|
width: pixelToRem.pixelToRem(iconSize),
|
|
@@ -89,7 +92,7 @@ const AuthProviderIcon = ({ jwt, iconSize = 64, showStatus, wallet, }) => {
|
|
|
89
92
|
return null;
|
|
90
93
|
}
|
|
91
94
|
const MagicEmailOrSocialIcon = getMagicEmailOrSocialIcon({
|
|
92
|
-
|
|
95
|
+
findSocialIcon,
|
|
93
96
|
jwt,
|
|
94
97
|
wallet: walletForIcon,
|
|
95
98
|
});
|
|
@@ -41,9 +41,9 @@ import '../MenuList/Dropdown/Dropdown.js';
|
|
|
41
41
|
import '../../context/MockContext/MockContext.js';
|
|
42
42
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
43
43
|
import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
44
|
-
import {
|
|
44
|
+
import { useFindSocialIcon } from '../../utils/hooks/useFindSocialIcon/useFindSocialIcon.js';
|
|
45
45
|
|
|
46
|
-
const getMagicEmailOrSocialIcon = ({
|
|
46
|
+
const getMagicEmailOrSocialIcon = ({ findSocialIcon, wallet, jwt, }) => {
|
|
47
47
|
if (isEmailOTPWalletConnector(wallet.connector)) {
|
|
48
48
|
return SignInWithEmailIcon;
|
|
49
49
|
}
|
|
@@ -55,7 +55,7 @@ const getMagicEmailOrSocialIcon = ({ getSocialIcon, wallet, jwt, }) => {
|
|
|
55
55
|
}
|
|
56
56
|
const { oauthProvider } = socialAccountDataForWallet;
|
|
57
57
|
try {
|
|
58
|
-
const MagicSocialWalletIcon =
|
|
58
|
+
const MagicSocialWalletIcon = findSocialIcon(oauthProvider);
|
|
59
59
|
return MagicSocialWalletIcon;
|
|
60
60
|
}
|
|
61
61
|
catch (err) {
|
|
@@ -67,10 +67,13 @@ const getMagicEmailOrSocialIcon = ({ getSocialIcon, wallet, jwt, }) => {
|
|
|
67
67
|
const AuthProviderIcon = ({ jwt, iconSize = 64, showStatus, wallet, }) => {
|
|
68
68
|
const { primaryWallet, selectedWalletConnector } = useInternalDynamicContext();
|
|
69
69
|
const { deniedOauthProvider, deniedAddress } = useAccessDeniedContext();
|
|
70
|
-
const
|
|
70
|
+
const findSocialIcon = useFindSocialIcon();
|
|
71
71
|
// when access is denied we don't have jwt set, so we're getting this value out of useAccessDeniedContext
|
|
72
72
|
if (deniedOauthProvider) {
|
|
73
|
-
const MagicSocialWalletIcon =
|
|
73
|
+
const MagicSocialWalletIcon = findSocialIcon(deniedOauthProvider);
|
|
74
|
+
if (!MagicSocialWalletIcon) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
74
77
|
return (jsx(MagicSocialWalletIcon, { style: {
|
|
75
78
|
height: pixelToRem(iconSize),
|
|
76
79
|
width: pixelToRem(iconSize),
|
|
@@ -85,7 +88,7 @@ const AuthProviderIcon = ({ jwt, iconSize = 64, showStatus, wallet, }) => {
|
|
|
85
88
|
return null;
|
|
86
89
|
}
|
|
87
90
|
const MagicEmailOrSocialIcon = getMagicEmailOrSocialIcon({
|
|
88
|
-
|
|
91
|
+
findSocialIcon,
|
|
89
92
|
jwt,
|
|
90
93
|
wallet: walletForIcon,
|
|
91
94
|
});
|
|
@@ -36,12 +36,15 @@ const Button = ({ buttonClassName = '', buttonPadding = 'medium', buttonVariant
|
|
|
36
36
|
}, buttonPadding ? buttonPaddingClassNameMap[buttonPadding] : '', buttonVariant ? buttonVariantClassNameMap[buttonVariant] : '', buttonRounded ? buttonRoundedClassNameMap[buttonRounded] : '', buttonClassName);
|
|
37
37
|
const handleClick = (e) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
38
38
|
if (onClick) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
const onClickResult = onClick(e);
|
|
40
|
+
if (onClickResult instanceof Promise) {
|
|
41
|
+
setInternalButtonLoading(true);
|
|
42
|
+
try {
|
|
43
|
+
yield onClickResult;
|
|
44
|
+
}
|
|
45
|
+
finally {
|
|
46
|
+
setInternalButtonLoading(false);
|
|
47
|
+
}
|
|
45
48
|
}
|
|
46
49
|
}
|
|
47
50
|
if (feedback) {
|
|
@@ -52,7 +55,7 @@ const Button = ({ buttonClassName = '', buttonPadding = 'medium', buttonVariant
|
|
|
52
55
|
}
|
|
53
56
|
});
|
|
54
57
|
const buttonContent = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [startSlot && jsxRuntime.jsx("div", Object.assign({ className: 'button__start-slot' }, { children: startSlot })), (feedback || children) && (jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'button_primary', color: 'primary', as: 'span' }, typographyProps, { children: isFeedbackVisible && feedback ? feedback : children }))), endSlot && jsxRuntime.jsx("div", Object.assign({ className: 'button__end-slot' }, { children: endSlot }))] }));
|
|
55
|
-
return (jsxRuntime.jsxs("button", Object.assign({ type: type, onClick: handleClick, className: buttonEffectiveClassName, disabled: disabled || internalButtonLoading || loading, "data-testid": dataTestId }, { children: [(internalButtonLoading || loading) && (jsxRuntime.jsx("div", Object.assign({ className: 'button__spinner-container' }, { children: jsxRuntime.jsx(spinner.Spinner, { className: 'button__spinner' }) }))), buttonContent] })));
|
|
58
|
+
return (jsxRuntime.jsxs("button", Object.assign({ type: type, onClick: handleClick, className: buttonEffectiveClassName, disabled: disabled || internalButtonLoading || loading, "data-testid": dataTestId }, { children: [(internalButtonLoading || loading) && (jsxRuntime.jsx("div", Object.assign({ className: 'button__spinner-container', "data-testid": 'button__spinner' }, { children: jsxRuntime.jsx(spinner.Spinner, { className: 'button__spinner' }) }))), buttonContent] })));
|
|
56
59
|
};
|
|
57
60
|
|
|
58
61
|
exports.Button = Button;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes, MouseEventHandler, ReactNode } from 'react';
|
|
1
|
+
import { ButtonHTMLAttributes, FC, MouseEventHandler, ReactNode } from 'react';
|
|
2
2
|
import { TypographyProps } from '../Typography/Typography.types';
|
|
3
3
|
type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
|
|
4
4
|
type ButtonPadding = 'small' | 'medium' | 'large' | 'none';
|
|
5
5
|
type ButtonRounded = 'default' | 'medium' | 'small';
|
|
6
|
-
type
|
|
6
|
+
export type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> & {
|
|
7
7
|
buttonClassName?: string;
|
|
8
8
|
buttonPadding?: ButtonPadding;
|
|
9
9
|
buttonRounded?: ButtonRounded;
|
|
@@ -18,5 +18,5 @@ type Props = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> & {
|
|
|
18
18
|
typographyProps?: Omit<TypographyProps, 'as'>;
|
|
19
19
|
onClick?: MouseEventHandler<HTMLButtonElement> | (() => Promise<void>);
|
|
20
20
|
};
|
|
21
|
-
export declare const Button:
|
|
21
|
+
export declare const Button: FC<ButtonProps>;
|
|
22
22
|
export {};
|
|
@@ -32,12 +32,15 @@ const Button = ({ buttonClassName = '', buttonPadding = 'medium', buttonVariant
|
|
|
32
32
|
}, buttonPadding ? buttonPaddingClassNameMap[buttonPadding] : '', buttonVariant ? buttonVariantClassNameMap[buttonVariant] : '', buttonRounded ? buttonRoundedClassNameMap[buttonRounded] : '', buttonClassName);
|
|
33
33
|
const handleClick = (e) => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
34
|
if (onClick) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
const onClickResult = onClick(e);
|
|
36
|
+
if (onClickResult instanceof Promise) {
|
|
37
|
+
setInternalButtonLoading(true);
|
|
38
|
+
try {
|
|
39
|
+
yield onClickResult;
|
|
40
|
+
}
|
|
41
|
+
finally {
|
|
42
|
+
setInternalButtonLoading(false);
|
|
43
|
+
}
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
46
|
if (feedback) {
|
|
@@ -48,7 +51,7 @@ const Button = ({ buttonClassName = '', buttonPadding = 'medium', buttonVariant
|
|
|
48
51
|
}
|
|
49
52
|
});
|
|
50
53
|
const buttonContent = (jsxs(Fragment, { children: [startSlot && jsx("div", Object.assign({ className: 'button__start-slot' }, { children: startSlot })), (feedback || children) && (jsx(Typography, Object.assign({ variant: 'button_primary', color: 'primary', as: 'span' }, typographyProps, { children: isFeedbackVisible && feedback ? feedback : children }))), endSlot && jsx("div", Object.assign({ className: 'button__end-slot' }, { children: endSlot }))] }));
|
|
51
|
-
return (jsxs("button", Object.assign({ type: type, onClick: handleClick, className: buttonEffectiveClassName, disabled: disabled || internalButtonLoading || loading, "data-testid": dataTestId }, { children: [(internalButtonLoading || loading) && (jsx("div", Object.assign({ className: 'button__spinner-container' }, { children: jsx(Spinner, { className: 'button__spinner' }) }))), buttonContent] })));
|
|
54
|
+
return (jsxs("button", Object.assign({ type: type, onClick: handleClick, className: buttonEffectiveClassName, disabled: disabled || internalButtonLoading || loading, "data-testid": dataTestId }, { children: [(internalButtonLoading || loading) && (jsx("div", Object.assign({ className: 'button__spinner-container', "data-testid": 'button__spinner' }, { children: jsx(Spinner, { className: 'button__spinner' }) }))), buttonContent] })));
|
|
52
55
|
};
|
|
53
56
|
|
|
54
57
|
export { Button };
|
|
@@ -6,6 +6,6 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var Button = require('../../Button/Button.cjs');
|
|
7
7
|
var classNames = require('../../../utils/functions/classNames/classNames.cjs');
|
|
8
8
|
|
|
9
|
-
const ConnectButton = ({ buttonClassName, buttonContainerClassName, onClick, isActive, isLoading, children, }) => (jsxRuntime.jsx("div", Object.assign({ className: buttonContainerClassName }, { children: jsxRuntime.jsx(Button.Button, Object.assign({ dataTestId: 'ConnectButton', onClick: onClick, buttonClassName: classNames.classNames('connect-button', buttonClassName), loading: isLoading && isActive, disabled: isLoading && isActive, buttonVariant: 'primary', buttonPadding: 'large'
|
|
9
|
+
const ConnectButton = ({ buttonClassName, buttonContainerClassName, onClick, isActive, isLoading, children, }) => (jsxRuntime.jsx("div", Object.assign({ className: buttonContainerClassName }, { children: jsxRuntime.jsx(Button.Button, Object.assign({ dataTestId: 'ConnectButton', onClick: onClick, buttonClassName: classNames.classNames('connect-button', buttonClassName), loading: isLoading && isActive, disabled: isLoading && isActive, buttonVariant: 'primary', buttonPadding: 'large' }, { children: children })) })));
|
|
10
10
|
|
|
11
11
|
exports.ConnectButton = ConnectButton;
|
|
@@ -2,6 +2,6 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { Button } from '../../Button/Button.js';
|
|
3
3
|
import { classNames } from '../../../utils/functions/classNames/classNames.js';
|
|
4
4
|
|
|
5
|
-
const ConnectButton = ({ buttonClassName, buttonContainerClassName, onClick, isActive, isLoading, children, }) => (jsx("div", Object.assign({ className: buttonContainerClassName }, { children: jsx(Button, Object.assign({ dataTestId: 'ConnectButton', onClick: onClick, buttonClassName: classNames('connect-button', buttonClassName), loading: isLoading && isActive, disabled: isLoading && isActive, buttonVariant: 'primary', buttonPadding: 'large'
|
|
5
|
+
const ConnectButton = ({ buttonClassName, buttonContainerClassName, onClick, isActive, isLoading, children, }) => (jsx("div", Object.assign({ className: buttonContainerClassName }, { children: jsx(Button, Object.assign({ dataTestId: 'ConnectButton', onClick: onClick, buttonClassName: classNames('connect-button', buttonClassName), loading: isLoading && isActive, disabled: isLoading && isActive, buttonVariant: 'primary', buttonPadding: 'large' }, { children: children })) })));
|
|
6
6
|
|
|
7
7
|
export { ConnectButton };
|
|
@@ -14,6 +14,7 @@ const Icon = ({ children, className = '', color, size, }) => {
|
|
|
14
14
|
'text-tertiary': 'icon--color-text-tertiary',
|
|
15
15
|
};
|
|
16
16
|
const sizeClassNameMap = {
|
|
17
|
+
large: 'icon--size-large',
|
|
17
18
|
medium: 'icon--size-medium',
|
|
18
19
|
small: 'icon--size-small',
|
|
19
20
|
xsmall: 'icon--size-xsmall',
|
|
@@ -10,6 +10,7 @@ const Icon = ({ children, className = '', color, size, }) => {
|
|
|
10
10
|
'text-tertiary': 'icon--color-text-tertiary',
|
|
11
11
|
};
|
|
12
12
|
const sizeClassNameMap = {
|
|
13
|
+
large: 'icon--size-large',
|
|
13
14
|
medium: 'icon--size-medium',
|
|
14
15
|
small: 'icon--size-small',
|
|
15
16
|
xsmall: 'icon--size-xsmall',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC, ReactElement } from 'react';
|
|
2
2
|
export type IconColor = 'text-primary' | 'text-secondary' | 'text-tertiary' | 'text-error' | 'brand-primary';
|
|
3
|
-
export type IconSize = 'xsmall' | 'small' | 'medium';
|
|
3
|
+
export type IconSize = 'xsmall' | 'small' | 'medium' | 'large';
|
|
4
4
|
export type IconProps = {
|
|
5
5
|
children: ReactElement;
|
|
6
6
|
className?: string;
|
|
@@ -2,7 +2,7 @@ import { ReactElement } from 'react';
|
|
|
2
2
|
import { Iconic } from '@dynamic-labs/iconic';
|
|
3
3
|
import { Icon } from '../../shared';
|
|
4
4
|
type Props = {
|
|
5
|
-
Icon?: Icon | Iconic | ReactElement;
|
|
5
|
+
Icon?: Icon | Iconic | ReactElement | null;
|
|
6
6
|
className?: string;
|
|
7
7
|
customSpinnerColor?: string;
|
|
8
8
|
iconSize?: number;
|
|
@@ -6,6 +6,6 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
7
7
|
var Typography = require('../Typography/Typography.cjs');
|
|
8
8
|
|
|
9
|
-
const ListTile = ({ children, onClick, leading, trailing, style, className = '', dataTestId, }) => (jsxRuntime.jsxs("button", Object.assign({ "data-testid": dataTestId, type: 'button', className: classNames.classNames(className, 'list-tile'), onClick: onClick, style: style }, { children: [leading, jsxRuntime.jsx("div", Object.assign({ className: 'list-tile__children' }, { children: jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'body_normal', color: 'primary', as: 'span' }, { children: children })) })), trailing] })));
|
|
9
|
+
const ListTile = ({ children, onClick, leading, disabled = false, trailing, style, className = '', dataTestId, }) => (jsxRuntime.jsxs("button", Object.assign({ "data-testid": dataTestId, type: 'button', className: classNames.classNames(className, 'list-tile'), onClick: onClick, style: style, disabled: disabled }, { children: [leading, jsxRuntime.jsx("div", Object.assign({ className: 'list-tile__children' }, { children: jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'body_normal', color: 'primary', as: 'span' }, { children: children })) })), trailing] })));
|
|
10
10
|
|
|
11
11
|
exports.ListTile = ListTile;
|
|
@@ -2,6 +2,6 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
3
3
|
import { Typography } from '../Typography/Typography.js';
|
|
4
4
|
|
|
5
|
-
const ListTile = ({ children, onClick, leading, trailing, style, className = '', dataTestId, }) => (jsxs("button", Object.assign({ "data-testid": dataTestId, type: 'button', className: classNames(className, 'list-tile'), onClick: onClick, style: style }, { children: [leading, jsx("div", Object.assign({ className: 'list-tile__children' }, { children: jsx(Typography, Object.assign({ weight: 'medium', variant: 'body_normal', color: 'primary', as: 'span' }, { children: children })) })), trailing] })));
|
|
5
|
+
const ListTile = ({ children, onClick, leading, disabled = false, trailing, style, className = '', dataTestId, }) => (jsxs("button", Object.assign({ "data-testid": dataTestId, type: 'button', className: classNames(className, 'list-tile'), onClick: onClick, style: style, disabled: disabled }, { children: [leading, jsx("div", Object.assign({ className: 'list-tile__children' }, { children: jsx(Typography, Object.assign({ weight: 'medium', variant: 'body_normal', color: 'primary', as: 'span' }, { children: children })) })), trailing] })));
|
|
6
6
|
|
|
7
7
|
export { ListTile };
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
7
7
|
|
|
8
|
-
const ModalHeader = ({ alignContent, children, leading, trailing, positionAbsolute = false, }) => (jsxRuntime.jsxs("div", Object.assign({ className: classNames.classNames('modal-header', {
|
|
8
|
+
const ModalHeader = ({ alignContent, children, leading, trailing, positionAbsolute = false, style, }) => (jsxRuntime.jsxs("div", Object.assign({ className: classNames.classNames('modal-header', {
|
|
9
9
|
'modal-header--absolute': positionAbsolute,
|
|
10
10
|
'modal-header--align-content-bottom': alignContent === 'bottom',
|
|
11
|
-
}) }, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'modal-header__leading' }, { children: leading })), children, jsxRuntime.jsx("div", Object.assign({ className: 'modal-header__trailing' }, { children: trailing }))] })));
|
|
11
|
+
}), style: style }, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'modal-header__leading' }, { children: leading })), children, jsxRuntime.jsx("div", Object.assign({ className: 'modal-header__trailing' }, { children: trailing }))] })));
|
|
12
12
|
|
|
13
13
|
exports.ModalHeader = ModalHeader;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
3
3
|
|
|
4
|
-
const ModalHeader = ({ alignContent, children, leading, trailing, positionAbsolute = false, }) => (jsxs("div", Object.assign({ className: classNames('modal-header', {
|
|
4
|
+
const ModalHeader = ({ alignContent, children, leading, trailing, positionAbsolute = false, style, }) => (jsxs("div", Object.assign({ className: classNames('modal-header', {
|
|
5
5
|
'modal-header--absolute': positionAbsolute,
|
|
6
6
|
'modal-header--align-content-bottom': alignContent === 'bottom',
|
|
7
|
-
}) }, { children: [jsx("div", Object.assign({ className: 'modal-header__leading' }, { children: leading })), children, jsx("div", Object.assign({ className: 'modal-header__trailing' }, { children: trailing }))] })));
|
|
7
|
+
}), style: style }, { children: [jsx("div", Object.assign({ className: 'modal-header__leading' }, { children: leading })), children, jsx("div", Object.assign({ className: 'modal-header__trailing' }, { children: trailing }))] })));
|
|
8
8
|
|
|
9
9
|
export { ModalHeader };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from 'react';
|
|
1
|
+
import { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
2
2
|
export type ModalHeaderProps = {
|
|
3
3
|
alignContent?: 'bottom';
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
leading?: ReactElement | ReactElement[];
|
|
6
6
|
positionAbsolute?: boolean;
|
|
7
7
|
trailing?: ReactNode;
|
|
8
|
+
style?: CSSProperties;
|
|
8
9
|
};
|
|
9
10
|
export type ModalHeaderComponent = (props: ModalHeaderProps) => ReactElement;
|
|
@@ -76,7 +76,7 @@ const NetworkPicker = ({ activeClassName = '', buttonClassName = '', checkboxCla
|
|
|
76
76
|
setIsNetworkPickerOpen(false);
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
|
-
return (jsxRuntime.jsxs("div", Object.assign({ className: classNames.classNames('non-widget-network-picker', mainClassName), ref: pickerRef }, { children: [jsxRuntime.jsx(NetworkControl.NetworkControl, { evmNetworks: evmNetworks, activeClassName: activeClassName, network: network, loading: loadingNetwork, isOpen: isNetworkPickerOpen, setIsOpen: setIsNetworkPickerOpen, walletConnector: connector, showNetworkName: showNetworkName, buttonClassName: buttonClassName }), jsxRuntime.jsx("div", { ref: anchorRef, style: { marginTop: 5, position: 'absolute' } }), shouldAllowOpenDropdown && (jsxRuntime.jsx(MenuList.MenuList, Object.assign({ className: listClassName, isOpen: isNetworkPickerOpen, onClickClose: () => setIsNetworkPickerOpen(false), popperProps: { anchorOrigin: 'bottom-left', anchorRef }, mobileTitle: 'Select network' }, { children: evmNetworks.map(({ name, networkId, vanityName, iconUrls }) => (jsxRuntime.jsx(NetworkAction.NetworkAction, { iconUrl: iconUrls === null || iconUrls === void 0 ? void 0 : iconUrls[0], networkId: networkId, networkName: vanityName || name, network: network, onClick: handleNetworkChange, checkboxClassName: checkboxClassName, newNetworkId: newNetworkId, notSupported: supportedWalletNetworks &&
|
|
79
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: classNames.classNames('non-widget-network-picker', mainClassName), ref: pickerRef, "data-testid": 'network-picker' }, { children: [jsxRuntime.jsx(NetworkControl.NetworkControl, { evmNetworks: evmNetworks, activeClassName: activeClassName, network: network, loading: loadingNetwork, isOpen: isNetworkPickerOpen, setIsOpen: setIsNetworkPickerOpen, walletConnector: connector, showNetworkName: showNetworkName, buttonClassName: buttonClassName }), jsxRuntime.jsx("div", { ref: anchorRef, style: { marginTop: 5, position: 'absolute' } }), shouldAllowOpenDropdown && (jsxRuntime.jsx(MenuList.MenuList, Object.assign({ className: listClassName, isOpen: isNetworkPickerOpen, onClickClose: () => setIsNetworkPickerOpen(false), popperProps: { anchorOrigin: 'bottom-left', anchorRef }, mobileTitle: 'Select network' }, { children: evmNetworks.map(({ name, networkId, vanityName, iconUrls }) => (jsxRuntime.jsx(NetworkAction.NetworkAction, { iconUrl: iconUrls === null || iconUrls === void 0 ? void 0 : iconUrls[0], networkId: networkId, networkName: vanityName || name, network: network, onClick: handleNetworkChange, checkboxClassName: checkboxClassName, newNetworkId: newNetworkId, notSupported: supportedWalletNetworks &&
|
|
80
80
|
!supportedWalletNetworks.includes(`${networkId}`) }, networkId))) })))] })));
|
|
81
81
|
};
|
|
82
82
|
|
|
@@ -72,7 +72,7 @@ const NetworkPicker = ({ activeClassName = '', buttonClassName = '', checkboxCla
|
|
|
72
72
|
setIsNetworkPickerOpen(false);
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
|
-
return (jsxs("div", Object.assign({ className: classNames('non-widget-network-picker', mainClassName), ref: pickerRef }, { children: [jsx(NetworkControl, { evmNetworks: evmNetworks, activeClassName: activeClassName, network: network, loading: loadingNetwork, isOpen: isNetworkPickerOpen, setIsOpen: setIsNetworkPickerOpen, walletConnector: connector, showNetworkName: showNetworkName, buttonClassName: buttonClassName }), jsx("div", { ref: anchorRef, style: { marginTop: 5, position: 'absolute' } }), shouldAllowOpenDropdown && (jsx(MenuList, Object.assign({ className: listClassName, isOpen: isNetworkPickerOpen, onClickClose: () => setIsNetworkPickerOpen(false), popperProps: { anchorOrigin: 'bottom-left', anchorRef }, mobileTitle: 'Select network' }, { children: evmNetworks.map(({ name, networkId, vanityName, iconUrls }) => (jsx(NetworkAction, { iconUrl: iconUrls === null || iconUrls === void 0 ? void 0 : iconUrls[0], networkId: networkId, networkName: vanityName || name, network: network, onClick: handleNetworkChange, checkboxClassName: checkboxClassName, newNetworkId: newNetworkId, notSupported: supportedWalletNetworks &&
|
|
75
|
+
return (jsxs("div", Object.assign({ className: classNames('non-widget-network-picker', mainClassName), ref: pickerRef, "data-testid": 'network-picker' }, { children: [jsx(NetworkControl, { evmNetworks: evmNetworks, activeClassName: activeClassName, network: network, loading: loadingNetwork, isOpen: isNetworkPickerOpen, setIsOpen: setIsNetworkPickerOpen, walletConnector: connector, showNetworkName: showNetworkName, buttonClassName: buttonClassName }), jsx("div", { ref: anchorRef, style: { marginTop: 5, position: 'absolute' } }), shouldAllowOpenDropdown && (jsx(MenuList, Object.assign({ className: listClassName, isOpen: isNetworkPickerOpen, onClickClose: () => setIsNetworkPickerOpen(false), popperProps: { anchorOrigin: 'bottom-left', anchorRef }, mobileTitle: 'Select network' }, { children: evmNetworks.map(({ name, networkId, vanityName, iconUrls }) => (jsx(NetworkAction, { iconUrl: iconUrls === null || iconUrls === void 0 ? void 0 : iconUrls[0], networkId: networkId, networkName: vanityName || name, network: network, onClick: handleNetworkChange, checkboxClassName: checkboxClassName, newNetworkId: newNetworkId, notSupported: supportedWalletNetworks &&
|
|
76
76
|
!supportedWalletNetworks.includes(`${networkId}`) }, networkId))) })))] })));
|
|
77
77
|
};
|
|
78
78
|
|
|
@@ -10,6 +10,7 @@ require('@dynamic-labs/sdk-api');
|
|
|
10
10
|
require('../../shared/logger.cjs');
|
|
11
11
|
require('@dynamic-labs/wallet-connector-core');
|
|
12
12
|
require('../../context/ViewContext/ViewContext.cjs');
|
|
13
|
+
var close = require('../../shared/assets/close.cjs');
|
|
13
14
|
var chevronLeft = require('../../shared/assets/chevron-left.cjs');
|
|
14
15
|
var check = require('../../shared/assets/check.cjs');
|
|
15
16
|
var pencilAltIcon = require('../../shared/assets/pencil-alt-icon.cjs');
|
|
@@ -54,9 +55,10 @@ require('yup');
|
|
|
54
55
|
require('../InlineWidget/InlineWidget.cjs');
|
|
55
56
|
require('../MenuList/Dropdown/Dropdown.cjs');
|
|
56
57
|
|
|
57
|
-
const OTPVerificationView = ({ onClickBack, onClickEditEmail, isLoading, email, onPinComplete, isValid, error, onPinChange, displayPoweredByDynamic = false, }) => {
|
|
58
|
-
const backButton = (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ type: 'button', onClick: onClickBack, "data-testid": 'back-button' }, { children: jsxRuntime.jsx(chevronLeft.ReactComponent, {}) })));
|
|
59
|
-
|
|
58
|
+
const OTPVerificationView = ({ onClickBack, onClickEditEmail, isLoading, email, onPinComplete, isValid, error, onPinChange, onClickClose, displayPoweredByDynamic = false, }) => {
|
|
59
|
+
const backButton = onClickBack && (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ type: 'button', onClick: onClickBack, "data-testid": 'back-button' }, { children: jsxRuntime.jsx(chevronLeft.ReactComponent, {}) })));
|
|
60
|
+
const closeButton = (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ onClick: onClickClose, type: 'button', "data-testid": 'close-button' }, { children: jsxRuntime.jsx(close.ReactComponent, {}) })));
|
|
61
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view' }, { children: [jsxRuntime.jsx(ModalHeaderBanner.ModalHeaderBanner, { type: 'error', message: error === null || error === void 0 ? void 0 : error.message }), jsxRuntime.jsx(ModalHeader.ModalHeader, Object.assign({ alignContent: 'bottom', leading: onClickBack && backButton, trailing: onClickClose && closeButton }, { children: jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view__status-header' }, { children: [isValid && (jsxRuntime.jsx(IconWithStatus.IconWithStatus, { Icon: iconic.SignInWithEmailIcon, iconSize: 50, InnerIcon: check.ReactComponent })), !isValid && (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: iconic.SignInWithEmailIcon, iconSize: 80, isSpinning: isLoading }))] })) })), jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'otp-verification-view__title' }, { children: isValid ? 'Verification code confirmed' : 'Confirm verification code' })), jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view__body' }, { children: [isValid && (jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "Hang tight while we get things ready for you" }))), !isValid && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "We\u2019ve sent a verification code to" })), jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view__email-container' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'bold', color: 'secondary' }, { children: shortenEmail.shortenEmail(email) })), onClickEditEmail && (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ onClick: onClickEditEmail, "data-testid": 'otp-verification-view__edit-button' }, { children: jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'text-tertiary' }, { children: jsxRuntime.jsx(pencilAltIcon.ReactComponent, {}) })) })))] }))] }))] })), jsxRuntime.jsx(PinField.PinField, { initialValue: Array(6).join('.').split('.'), isLoading: isLoading, handleComplete: onPinComplete, isValidated: isValid, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: onPinChange }), jsxRuntime.jsx("div", Object.assign({ className: 'otp-verification-view__footer' }, { children: displayPoweredByDynamic && jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {}) }))] })));
|
|
60
62
|
};
|
|
61
63
|
|
|
62
64
|
exports.OTPVerificationView = OTPVerificationView;
|
|
@@ -6,6 +6,7 @@ type OtpVerificationLayoutProps = {
|
|
|
6
6
|
isLoading: boolean;
|
|
7
7
|
isValid: boolean;
|
|
8
8
|
onClickBack?: MouseEventHandler<HTMLButtonElement>;
|
|
9
|
+
onClickClose?: MouseEventHandler<HTMLButtonElement>;
|
|
9
10
|
onClickEditEmail?: MouseEventHandler<HTMLButtonElement>;
|
|
10
11
|
onPinChange?: (value: string) => void;
|
|
11
12
|
onPinComplete: (value: string) => void;
|
|
@@ -6,6 +6,7 @@ import '@dynamic-labs/sdk-api';
|
|
|
6
6
|
import '../../shared/logger.js';
|
|
7
7
|
import '@dynamic-labs/wallet-connector-core';
|
|
8
8
|
import '../../context/ViewContext/ViewContext.js';
|
|
9
|
+
import { ReactComponent as SvgClose } from '../../shared/assets/close.js';
|
|
9
10
|
import { ReactComponent as SvgChevronLeft } from '../../shared/assets/chevron-left.js';
|
|
10
11
|
import { ReactComponent as SvgCheck } from '../../shared/assets/check.js';
|
|
11
12
|
import { ReactComponent as SvgPencilAltIcon } from '../../shared/assets/pencil-alt-icon.js';
|
|
@@ -50,9 +51,10 @@ import 'yup';
|
|
|
50
51
|
import '../InlineWidget/InlineWidget.js';
|
|
51
52
|
import '../MenuList/Dropdown/Dropdown.js';
|
|
52
53
|
|
|
53
|
-
const OTPVerificationView = ({ onClickBack, onClickEditEmail, isLoading, email, onPinComplete, isValid, error, onPinChange, displayPoweredByDynamic = false, }) => {
|
|
54
|
-
const backButton = (jsx(IconButton, Object.assign({ type: 'button', onClick: onClickBack, "data-testid": 'back-button' }, { children: jsx(SvgChevronLeft, {}) })));
|
|
55
|
-
|
|
54
|
+
const OTPVerificationView = ({ onClickBack, onClickEditEmail, isLoading, email, onPinComplete, isValid, error, onPinChange, onClickClose, displayPoweredByDynamic = false, }) => {
|
|
55
|
+
const backButton = onClickBack && (jsx(IconButton, Object.assign({ type: 'button', onClick: onClickBack, "data-testid": 'back-button' }, { children: jsx(SvgChevronLeft, {}) })));
|
|
56
|
+
const closeButton = (jsx(IconButton, Object.assign({ onClick: onClickClose, type: 'button', "data-testid": 'close-button' }, { children: jsx(SvgClose, {}) })));
|
|
57
|
+
return (jsxs("div", Object.assign({ className: 'otp-verification-view' }, { children: [jsx(ModalHeaderBanner, { type: 'error', message: error === null || error === void 0 ? void 0 : error.message }), jsx(ModalHeader, Object.assign({ alignContent: 'bottom', leading: onClickBack && backButton, trailing: onClickClose && closeButton }, { children: jsxs("div", Object.assign({ className: 'otp-verification-view__status-header' }, { children: [isValid && (jsx(IconWithStatus, { Icon: SignInWithEmailIcon, iconSize: 50, InnerIcon: SvgCheck })), !isValid && (jsx(IconWithSpinner, { Icon: SignInWithEmailIcon, iconSize: 80, isSpinning: isLoading }))] })) })), jsx(Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'otp-verification-view__title' }, { children: isValid ? 'Verification code confirmed' : 'Confirm verification code' })), jsxs("div", Object.assign({ className: 'otp-verification-view__body' }, { children: [isValid && (jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "Hang tight while we get things ready for you" }))), !isValid && (jsxs(Fragment, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "We\u2019ve sent a verification code to" })), jsxs("div", Object.assign({ className: 'otp-verification-view__email-container' }, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'bold', color: 'secondary' }, { children: shortenEmail(email) })), onClickEditEmail && (jsx(IconButton, Object.assign({ onClick: onClickEditEmail, "data-testid": 'otp-verification-view__edit-button' }, { children: jsx(Icon, Object.assign({ color: 'text-tertiary' }, { children: jsx(SvgPencilAltIcon, {}) })) })))] }))] }))] })), jsx(PinField, { initialValue: Array(6).join('.').split('.'), isLoading: isLoading, handleComplete: onPinComplete, isValidated: isValid, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: onPinChange }), jsx("div", Object.assign({ className: 'otp-verification-view__footer' }, { children: displayPoweredByDynamic && jsx(PoweredByDynamic, {}) }))] })));
|
|
56
58
|
};
|
|
57
59
|
|
|
58
60
|
export { OTPVerificationView };
|