@dynamic-labs/sdk-react-core 2.0.0-alpha.3 → 2.0.0-alpha.5
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 +39 -0
- package/package.cjs +4 -3
- package/package.js +4 -3
- package/package.json +16 -13
- package/src/index.cjs +47 -34
- package/src/index.js +29 -21
- package/src/lib/Main.cjs +12 -8
- package/src/lib/Main.js +12 -8
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +12 -8
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +12 -8
- package/src/lib/components/AnimatePresence/AnimatePresence.cjs +12 -8
- package/src/lib/components/AnimatePresence/AnimatePresence.js +12 -8
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +16 -8
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +16 -8
- package/src/lib/components/Captcha/Captcha.cjs +12 -8
- package/src/lib/components/Captcha/Captcha.js +12 -8
- package/src/lib/components/ChainIcon/ChainIcon.cjs +27 -0
- package/src/lib/components/ChainIcon/ChainIcon.d.ts +8 -0
- package/src/lib/components/ChainIcon/ChainIcon.js +23 -0
- package/src/lib/components/ChainIcon/index.d.ts +1 -0
- package/src/lib/components/Divider/Divider.cjs +11 -7
- package/src/lib/components/Divider/Divider.js +11 -7
- package/src/lib/components/DynamicConnectButton/DynamicConnectButton.cjs +12 -8
- package/src/lib/components/DynamicConnectButton/DynamicConnectButton.js +12 -8
- package/src/lib/components/EmailIcon/EmailIcon.cjs +14 -0
- package/src/lib/components/EmailIcon/EmailIcon.d.ts +2 -0
- package/src/lib/components/EmailIcon/EmailIcon.js +10 -0
- package/src/lib/components/EmailIcon/index.d.ts +1 -0
- package/src/lib/components/IconWithSpinner/IconWithSpinner.cjs +2 -0
- package/src/lib/components/IconWithSpinner/IconWithSpinner.js +2 -0
- package/src/lib/components/IconWithSpinner/Indicator/Indicator.cjs +2 -0
- package/src/lib/components/IconWithSpinner/Indicator/Indicator.js +2 -0
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.cjs +2 -0
- package/src/lib/components/IconWithSpinner/Spinner/Spinner.js +2 -0
- package/src/lib/components/IconWithStatus/IconWithStatus.cjs +2 -0
- package/src/lib/components/IconWithStatus/IconWithStatus.js +2 -0
- package/src/lib/components/InlineSubmitButton/InlineSubmitButton.cjs +89 -0
- package/src/lib/components/InlineSubmitButton/InlineSubmitButton.d.ts +10 -0
- package/src/lib/components/InlineSubmitButton/InlineSubmitButton.js +85 -0
- package/src/lib/components/InlineSubmitButton/index.d.ts +1 -0
- package/src/lib/components/Input/Input.cjs +9 -6
- package/src/lib/components/Input/Input.d.ts +13 -2
- package/src/lib/components/Input/Input.js +9 -6
- package/src/lib/components/Input/Input.types.d.ts +1 -0
- package/src/lib/components/LogoutButton/LogoutButton.cjs +12 -8
- package/src/lib/components/LogoutButton/LogoutButton.js +12 -8
- package/src/lib/components/MenuList/Dropdown/Dropdown.cjs +12 -8
- package/src/lib/components/MenuList/Dropdown/Dropdown.js +12 -8
- package/src/lib/components/MenuList/MenuList/MenuList.cjs +2 -2
- package/src/lib/components/MenuList/MenuList/MenuList.js +2 -2
- package/src/lib/components/MenuList/index.d.ts +1 -0
- package/src/lib/components/Modal/Modal.cjs +12 -8
- package/src/lib/components/Modal/Modal.js +12 -8
- package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +12 -8
- package/src/lib/components/NeedHelpSection/NeedHelpSection.js +12 -8
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +15 -11
- package/src/lib/components/NetworkPicker/NetworkPicker.d.ts +2 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.js +15 -11
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +11 -7
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +11 -7
- package/src/lib/components/NetworkPicker/components/Network/Network.cjs +11 -7
- package/src/lib/components/NetworkPicker/components/Network/Network.js +11 -7
- package/src/lib/components/NetworkPicker/components/NetworkControlSkeleton/NetworkControlSkeleton.cjs +70 -1
- package/src/lib/components/NetworkPicker/components/NetworkControlSkeleton/NetworkControlSkeleton.js +71 -2
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +12 -8
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +12 -8
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +13 -19
- package/src/lib/components/OTPVerificationView/OTPVerificationView.d.ts +7 -4
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +13 -19
- package/src/lib/components/OverlayCard/OverlayCard.cjs +31 -24
- package/src/lib/components/OverlayCard/OverlayCard.d.ts +0 -1
- package/src/lib/components/OverlayCard/OverlayCard.js +31 -24
- package/src/lib/components/OverlayCard/OverlayCardTarget/OverlayCardTarget.cjs +46 -0
- package/src/lib/components/OverlayCard/OverlayCardTarget/OverlayCardTarget.d.ts +17 -0
- package/src/lib/components/OverlayCard/OverlayCardTarget/OverlayCardTarget.js +40 -0
- package/src/lib/components/OverlayCard/OverlayCardTarget/index.d.ts +1 -0
- package/src/lib/components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs +11 -7
- package/src/lib/components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js +11 -7
- package/src/lib/components/PhoneIcon/PhoneIcon.d.ts +2 -0
- package/src/lib/components/PhoneIcon/index.d.ts +1 -0
- package/src/lib/components/Portal/Portal.cjs +13 -8
- package/src/lib/components/Portal/Portal.js +13 -8
- package/src/lib/components/PoweredByDynamic/PoweredByDynamic.cjs +12 -8
- package/src/lib/components/PoweredByDynamic/PoweredByDynamic.js +12 -8
- package/src/lib/components/RenderView/RenderView.cjs +10 -7
- package/src/lib/components/RenderView/RenderView.js +10 -7
- package/src/lib/components/RetrySendVerificationCodeSection/RetrySendVerificationCodeSection.cjs +12 -8
- package/src/lib/components/RetrySendVerificationCodeSection/RetrySendVerificationCodeSection.js +12 -8
- package/src/lib/components/{SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.cjs → SecureEmbeddedWalletCard/SecureEmbeddedWalletCard.cjs} +14 -10
- package/src/lib/components/SecureEmbeddedWalletCard/SecureEmbeddedWalletCard.d.ts +6 -0
- package/src/lib/components/{SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.js → SecureEmbeddedWalletCard/SecureEmbeddedWalletCard.js} +14 -10
- package/src/lib/components/SecureEmbeddedWalletCard/index.d.ts +1 -0
- package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +4 -2
- package/src/lib/components/SendBalanceForm/SendBalanceForm.d.ts +1 -0
- package/src/lib/components/SendBalanceForm/SendBalanceForm.js +4 -2
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.cjs +3 -3
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.d.ts +1 -0
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.js +3 -3
- package/src/lib/components/ShadowDOM/ShadowDOM.cjs +12 -8
- package/src/lib/components/ShadowDOM/ShadowDOM.js +12 -8
- package/src/lib/components/Skeleton/Skeleton.cjs +2 -2
- package/src/lib/components/Skeleton/Skeleton.d.ts +2 -1
- package/src/lib/components/Skeleton/Skeleton.js +2 -2
- package/src/lib/components/SocialSignIn/SocialSignIn.cjs +15 -11
- package/src/lib/components/SocialSignIn/SocialSignIn.js +15 -11
- package/src/lib/components/{SyncPasskeyFlow/SyncPasskeyFlow.cjs → SyncEmbeddedWalletAuthFlow/SyncEmbeddedWalletAuthFlow.cjs} +14 -10
- package/src/lib/components/SyncEmbeddedWalletAuthFlow/SyncEmbeddedWalletAuthFlow.d.ts +1 -0
- package/src/lib/components/{SyncPasskeyFlow/SyncPasskeyFlow.js → SyncEmbeddedWalletAuthFlow/SyncEmbeddedWalletAuthFlow.js} +14 -10
- package/src/lib/components/SyncEmbeddedWalletAuthFlow/index.d.ts +1 -0
- package/src/lib/components/ToggleVisibilityButton/ToggleVisibilityButton.d.ts +8 -0
- package/src/lib/components/ToggleVisibilityButton/index.d.ts +1 -0
- package/src/lib/components/Toolkit/Toolkit.cjs +18 -14
- package/src/lib/components/Toolkit/Toolkit.js +18 -14
- package/src/lib/components/Toolkit/components/LoginWithEmailSwitch.cjs +13 -9
- package/src/lib/components/Toolkit/components/LoginWithEmailSwitch.js +13 -9
- package/src/lib/components/Toolkit/components/LoginWithEmailViewDisplayPriorityOrderSwitch.cjs +15 -13
- package/src/lib/components/Toolkit/components/LoginWithEmailViewDisplayPriorityOrderSwitch.js +15 -13
- package/src/lib/components/Tooltip/Tooltip.cjs +12 -8
- package/src/lib/components/Tooltip/Tooltip.js +12 -8
- package/src/lib/components/TosAndPp/TosAndPp.cjs +12 -8
- package/src/lib/components/TosAndPp/TosAndPp.js +12 -8
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +11 -7
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +11 -7
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +12 -8
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +12 -8
- package/src/lib/components/Transition/OpacityTransition/OpacityTransition.cjs +2 -2
- package/src/lib/components/Transition/OpacityTransition/OpacityTransition.js +2 -2
- package/src/lib/components/Transition/SlideInUpTransition/SlideInUpTransition.cjs +2 -2
- package/src/lib/components/Transition/SlideInUpTransition/SlideInUpTransition.js +2 -2
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +12 -8
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +12 -8
- package/src/lib/components/Transition/ZoomTransition/ZoomTransition.cjs +2 -2
- package/src/lib/components/Transition/ZoomTransition/ZoomTransition.js +2 -2
- package/src/lib/components/Typography/Typography.cjs +2 -2
- package/src/lib/components/Typography/Typography.js +2 -2
- package/src/lib/components/Typography/Typography.types.d.ts +2 -1
- package/src/lib/components/UserAddress/UserAddress.cjs +12 -8
- package/src/lib/components/UserAddress/UserAddress.js +12 -8
- package/src/lib/components/UserProfile/UserProfile.cjs +12 -8
- package/src/lib/components/UserProfile/UserProfile.js +12 -8
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +11 -7
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +11 -7
- package/src/lib/components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs +13 -9
- package/src/lib/components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js +13 -9
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.cjs +11 -7
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +11 -7
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +15 -9
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +15 -9
- package/src/lib/components/UserProfileForm/UserProfileForm.cjs +12 -8
- package/src/lib/components/UserProfileForm/UserProfileForm.js +12 -8
- package/src/lib/components/index.d.ts +10 -5
- package/src/lib/context/CaptchaContext/CaptchaContext.d.ts +1 -1
- package/src/lib/context/ConnectWithEmailOtpContext/ConnectWithEmailOtpProvider.cjs +12 -8
- package/src/lib/context/ConnectWithEmailOtpContext/ConnectWithEmailOtpProvider.js +12 -8
- package/src/lib/context/DynamicContext/DynamicContext.cjs +20 -27
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +0 -1
- package/src/lib/context/DynamicContext/DynamicContext.js +20 -27
- package/src/lib/context/DynamicContext/handleDisconnectWallet/handleDisconnectWallet.cjs +1 -4
- package/src/lib/context/DynamicContext/handleDisconnectWallet/handleDisconnectWallet.js +1 -4
- package/src/lib/context/DynamicContext/helpers/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/helpers/initRefreshAuth/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/helpers/initRefreshAuth/initRefreshAuth.cjs +55 -0
- package/src/lib/context/DynamicContext/helpers/initRefreshAuth/initRefreshAuth.d.ts +11 -0
- package/src/lib/context/DynamicContext/helpers/initRefreshAuth/initRefreshAuth.js +50 -0
- package/src/lib/context/DynamicContext/hooks/useDisplayOrderState/useDisplayOrderState.cjs +3 -19
- package/src/lib/context/DynamicContext/hooks/useDisplayOrderState/useDisplayOrderState.js +4 -20
- package/src/lib/context/DynamicContext/hooks/useDisplayOrderState/useDisplayOrderState.types.d.ts +1 -1
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.cjs +2 -0
- package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.js +2 -0
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +15 -7
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +15 -7
- package/src/lib/context/DynamicContext/hooks/useSetShowLinkNewWalletModal/useSetShowLinkNewWalletModal.cjs +1 -1
- package/src/lib/context/DynamicContext/hooks/useSetShowLinkNewWalletModal/useSetShowLinkNewWalletModal.d.ts +1 -1
- package/src/lib/context/DynamicContext/hooks/useSetShowLinkNewWalletModal/useSetShowLinkNewWalletModal.js +1 -1
- package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.cjs +14 -13
- package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.js +14 -13
- package/src/lib/context/DynamicContext/types/index.d.ts +1 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.cjs +2 -2
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.js +2 -2
- package/src/lib/context/DynamicContext/useDynamicContext/useOverrides/useOverrides.cjs +12 -8
- package/src/lib/context/DynamicContext/useDynamicContext/useOverrides/useOverrides.js +12 -8
- package/src/lib/context/FundingContext/FundingContext.cjs +11 -7
- package/src/lib/context/FundingContext/FundingContext.js +11 -7
- package/src/lib/context/LoadingContext/LoadingContext.cjs +12 -8
- package/src/lib/context/LoadingContext/LoadingContext.js +12 -8
- package/src/lib/context/MockContext/MockContext.cjs +9 -5
- package/src/lib/context/MockContext/MockContext.js +9 -5
- package/src/lib/context/PasskeyContext/PasskeyContext.cjs +11 -7
- package/src/lib/context/PasskeyContext/PasskeyContext.js +11 -7
- package/src/lib/context/PhantomRedirectContext/PhantomRedirectContext.cjs +12 -8
- package/src/lib/context/PhantomRedirectContext/PhantomRedirectContext.js +12 -8
- package/src/lib/context/PhantomRedirectContext/useResponseHandlers.cjs +15 -9
- package/src/lib/context/PhantomRedirectContext/useResponseHandlers.js +15 -9
- package/src/lib/context/PhoneNumberContext/PhoneNumberContext.d.ts +14 -0
- package/src/lib/context/PhoneNumberContext/index.d.ts +1 -0
- package/src/lib/context/SendBalanceContext/SendBalanceContext.cjs +12 -8
- package/src/lib/context/SendBalanceContext/SendBalanceContext.js +12 -8
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +12 -8
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +12 -8
- package/src/lib/context/UserFieldEditorContext/UserFieldEditorContext.cjs +12 -8
- package/src/lib/context/UserFieldEditorContext/UserFieldEditorContext.js +12 -8
- package/src/lib/context/VerificationContext/VerificationContext.cjs +31 -0
- package/src/lib/context/VerificationContext/VerificationContext.d.ts +17 -0
- package/src/lib/context/VerificationContext/VerificationContext.js +25 -0
- package/src/lib/context/VerificationContext/index.d.ts +1 -0
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/context/WalletContext/WalletContext.cjs +24 -9
- package/src/lib/context/WalletContext/WalletContext.d.ts +8 -3
- package/src/lib/context/WalletContext/WalletContext.js +25 -11
- package/src/lib/data/api.cjs +76 -1
- package/src/lib/data/api.d.ts +25 -2
- package/src/lib/data/api.js +74 -4
- package/src/lib/events/dynamicEvents.d.ts +11 -2
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +11 -8
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +11 -8
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +11 -7
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +11 -7
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpContent.cjs +12 -8
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpContent.js +12 -8
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.cjs +11 -7
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.js +11 -7
- package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/PasskeyInfoHelper.cjs +11 -7
- package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/PasskeyInfoHelper.js +11 -7
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/Item/Item.cjs +11 -7
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/Item/Item.js +11 -7
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +11 -7
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +11 -7
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletListHelpContent.cjs +13 -9
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletListHelpContent.js +13 -9
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +11 -7
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletMoreInfoContent/WalletMoreInfoContent.js +11 -7
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.cjs +12 -8
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.js +12 -8
- package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.cjs +13 -9
- package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.js +13 -9
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.cjs +18 -15
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.js +18 -15
- package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.cjs +11 -7
- package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.js +11 -7
- package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.cjs +13 -9
- package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.js +13 -9
- package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.cjs +11 -7
- package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.js +11 -7
- package/src/lib/locale/en/translation.cjs +46 -2
- package/src/lib/locale/en/translation.d.ts +45 -1
- package/src/lib/locale/en/translation.js +46 -2
- package/src/lib/main.global.cjs +1 -1
- package/src/lib/main.global.js +1 -1
- package/src/lib/modals/ConfirmationModal/ConfirmationModal.d.ts +3 -0
- package/src/lib/modals/ConfirmationModal/ConfirmationModal.types.d.ts +8 -0
- package/src/lib/modals/ConfirmationModal/index.d.ts +1 -0
- package/src/lib/modals/DynamicAuthModal/DynamicAuthModal.cjs +11 -7
- package/src/lib/modals/DynamicAuthModal/DynamicAuthModal.js +11 -7
- package/src/lib/modals/EnterPasswordModal/EnterPasswordModal.d.ts +3 -0
- package/src/lib/modals/EnterPasswordModal/EnterPasswordModal.types.d.ts +6 -0
- package/src/lib/modals/EnterPasswordModal/index.d.ts +1 -0
- package/src/lib/modals/SendBalanceModal/SendBalanceModal.cjs +12 -8
- package/src/lib/modals/SendBalanceModal/SendBalanceModal.js +12 -8
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +12 -8
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +12 -8
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +13 -17
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +13 -17
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.types.d.ts +4 -5
- package/src/lib/modals/UserFieldEditorModal/UserFieldEditorModal.cjs +11 -7
- package/src/lib/modals/UserFieldEditorModal/UserFieldEditorModal.js +11 -7
- package/src/lib/modals/index.d.ts +2 -0
- package/src/lib/shared/assets/chevron-down.cjs +53 -0
- package/src/lib/shared/assets/chevron-down.js +29 -0
- package/src/lib/shared/assets/index.d.ts +16 -13
- package/src/lib/shared/assets/password-hero.cjs +53 -0
- package/src/lib/shared/assets/password-hero.js +29 -0
- package/src/lib/shared/assets/sign-in-with-phone.cjs +53 -0
- package/src/lib/shared/assets/sign-in-with-phone.js +29 -0
- package/src/lib/shared/types/connectionAndSignature.d.ts +15 -0
- package/src/lib/shared/types/dynamicEventsCallbacks.d.ts +48 -0
- package/src/lib/shared/types/embeddedWallets.d.ts +6 -0
- package/src/lib/shared/types/general.d.ts +5 -0
- package/src/lib/shared/types/index.d.ts +8 -220
- package/src/lib/shared/types/localStorage.d.ts +18 -0
- package/src/lib/shared/types/ui.d.ts +14 -0
- package/src/lib/shared/types/user.d.ts +15 -0
- package/src/lib/shared/types/wallets.d.ts +85 -0
- package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.cjs +9 -2
- package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.d.ts +2 -1
- package/src/lib/shared/utils/functions/formatBigNumber/formatBigNumber.js +9 -2
- package/src/lib/shared/utils/functions/generateRandomPassword/generateRandomPassword.cjs +14 -0
- package/src/lib/shared/utils/functions/generateRandomPassword/generateRandomPassword.d.ts +1 -0
- package/src/lib/shared/utils/functions/generateRandomPassword/generateRandomPassword.js +10 -0
- package/src/lib/shared/utils/functions/generateRandomPassword/index.d.ts +1 -0
- package/src/lib/shared/utils/functions/index.d.ts +2 -0
- package/src/lib/shared/utils/functions/providerLabel/providerLabel.cjs +3 -0
- package/src/lib/shared/utils/functions/providerLabel/providerLabel.d.ts +1 -1
- package/src/lib/shared/utils/functions/providerLabel/providerLabel.js +3 -0
- package/src/lib/shared/utils/functions/validatePassword/index.d.ts +1 -0
- package/src/lib/shared/utils/functions/validatePassword/validatePassword.cjs +59 -0
- package/src/lib/shared/utils/functions/validatePassword/validatePassword.d.ts +13 -0
- package/src/lib/shared/utils/functions/validatePassword/validatePassword.js +55 -0
- package/src/lib/shared/utils/hooks/useThrottle/useThrottle.cjs +1 -0
- package/src/lib/shared/utils/hooks/useThrottle/useThrottle.d.ts +1 -1
- package/src/lib/shared/utils/hooks/useThrottle/useThrottle.js +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/localStorage.cjs +2 -0
- package/src/lib/utils/constants/localStorage.d.ts +1 -0
- package/src/lib/utils/constants/localStorage.js +2 -1
- package/src/lib/utils/constants/values.cjs +2 -0
- package/src/lib/utils/constants/values.d.ts +1 -0
- package/src/lib/utils/constants/values.js +2 -1
- package/src/lib/utils/functions/findCoinbaseMPCWallet/findCoinbaseMPCWallet.cjs +7 -0
- package/src/lib/utils/functions/findCoinbaseMPCWallet/findCoinbaseMPCWallet.d.ts +2 -0
- package/src/lib/utils/functions/findCoinbaseMPCWallet/findCoinbaseMPCWallet.js +3 -0
- package/src/lib/utils/functions/findCoinbaseMPCWallet/index.d.ts +1 -0
- package/src/lib/utils/functions/formatPhone/formatPhone.cjs +28 -0
- package/src/lib/utils/functions/formatPhone/formatPhone.d.ts +5 -0
- package/src/lib/utils/functions/formatPhone/formatPhone.js +24 -0
- package/src/lib/utils/functions/formatPhone/index.d.ts +1 -0
- package/src/lib/utils/functions/getAuthToken/getAuthToken.cjs +3 -1
- package/src/lib/utils/functions/getAuthToken/getAuthToken.js +3 -1
- package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.cjs +32 -0
- package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.d.ts +10 -0
- package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.js +28 -0
- package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/index.d.ts +1 -0
- package/src/lib/utils/functions/getEOAWallet/getEOAWallet.cjs +38 -0
- package/src/lib/utils/functions/getEOAWallet/getEOAWallet.d.ts +3 -0
- package/src/lib/utils/functions/getEOAWallet/getEOAWallet.js +34 -0
- package/src/lib/utils/functions/getEOAWallet/index.d.ts +1 -0
- package/src/lib/utils/functions/getUserIdentifier/getUserIdentifier.cjs +43 -0
- package/src/lib/utils/functions/getUserIdentifier/getUserIdentifier.d.ts +6 -0
- package/src/lib/utils/functions/getUserIdentifier/getUserIdentifier.js +39 -0
- package/src/lib/utils/functions/getUserIdentifier/index.d.ts +1 -0
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.cjs +1 -0
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.js +1 -0
- package/src/lib/utils/functions/index.d.ts +11 -0
- package/src/lib/utils/functions/isCoinbaseWaasEnabled/index.d.ts +1 -0
- package/src/lib/utils/functions/isCoinbaseWaasEnabled/isCoinbaseWaasEnabled.cjs +13 -0
- package/src/lib/utils/functions/isCoinbaseWaasEnabled/isCoinbaseWaasEnabled.d.ts +2 -0
- package/src/lib/utils/functions/isCoinbaseWaasEnabled/isCoinbaseWaasEnabled.js +9 -0
- package/src/lib/utils/functions/isEmailProviderEnabled/isEmailProviderEnabled.cjs +5 -4
- package/src/lib/utils/functions/isEmailProviderEnabled/isEmailProviderEnabled.d.ts +1 -1
- package/src/lib/utils/functions/isEmailProviderEnabled/isEmailProviderEnabled.js +5 -4
- package/src/lib/utils/functions/isPhoneNumberProviderEnabled/index.d.ts +1 -0
- package/src/lib/utils/functions/isPhoneNumberProviderEnabled/isPhoneNumberProviderEnabled.cjs +28 -0
- package/src/lib/utils/functions/isPhoneNumberProviderEnabled/isPhoneNumberProviderEnabled.d.ts +2 -0
- package/src/lib/utils/functions/isPhoneNumberProviderEnabled/isPhoneNumberProviderEnabled.js +24 -0
- package/src/lib/utils/functions/modulo/index.d.ts +1 -0
- package/src/lib/utils/functions/modulo/modulo.cjs +8 -0
- package/src/lib/utils/functions/modulo/modulo.d.ts +2 -0
- package/src/lib/utils/functions/modulo/modulo.js +4 -0
- package/src/lib/utils/functions/requiresPasswordForEmbeddedWallet/index.d.ts +1 -0
- package/src/lib/utils/functions/requiresPasswordForEmbeddedWallet/requiresPasswordForEmbeddedWallet.cjs +15 -0
- package/src/lib/utils/functions/requiresPasswordForEmbeddedWallet/requiresPasswordForEmbeddedWallet.d.ts +2 -0
- package/src/lib/utils/functions/requiresPasswordForEmbeddedWallet/requiresPasswordForEmbeddedWallet.js +11 -0
- package/src/lib/utils/functions/requiresPasswordForEmbeddedWalletOnSignup/index.d.ts +1 -0
- package/src/lib/utils/functions/requiresPasswordForEmbeddedWalletOnSignup/requiresPasswordForEmbeddedWalletOnSignup.cjs +35 -0
- package/src/lib/utils/functions/requiresPasswordForEmbeddedWalletOnSignup/requiresPasswordForEmbeddedWalletOnSignup.d.ts +2 -0
- package/src/lib/utils/functions/requiresPasswordForEmbeddedWalletOnSignup/requiresPasswordForEmbeddedWalletOnSignup.js +31 -0
- package/src/lib/utils/functions/updateUserInfo/index.d.ts +1 -0
- package/src/lib/utils/functions/updateUserInfo/updateUserInfo.cjs +18 -0
- package/src/lib/utils/functions/updateUserInfo/updateUserInfo.d.ts +1 -0
- package/src/lib/utils/functions/updateUserInfo/updateUserInfo.js +14 -0
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +12 -8
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +12 -8
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +12 -8
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +12 -8
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs +13 -9
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js +13 -9
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.cjs +12 -8
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.js +12 -8
- package/src/lib/utils/hooks/index.d.ts +2 -1
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +12 -8
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +12 -8
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.cjs +11 -7
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.js +11 -7
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +15 -8
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +15 -8
- package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.cjs +12 -8
- package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.js +12 -8
- package/src/lib/utils/hooks/useConfirmationPortal/index.d.ts +1 -0
- package/src/lib/utils/hooks/useConfirmationPortal/useConfirmationPortal.d.ts +13 -0
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +1 -0
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +1 -0
- package/src/lib/utils/hooks/useConnectWithEmail/useConnectWithEmail.cjs +12 -8
- package/src/lib/utils/hooks/useConnectWithEmail/useConnectWithEmail.js +12 -8
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +12 -8
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +12 -8
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +12 -8
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +12 -8
- package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.cjs +12 -8
- package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.js +12 -8
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +4 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +4 -0
- package/src/lib/utils/hooks/useDynamicScopes/useDynamicScopes.cjs +12 -8
- package/src/lib/utils/hooks/useDynamicScopes/useDynamicScopes.js +12 -8
- package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.cjs +13 -9
- package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.js +13 -9
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.cjs +12 -8
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.js +12 -8
- package/src/lib/utils/hooks/useEmbeddedWallet/useCoinbaseMPC/index.d.ts +1 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.cjs +215 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.d.ts +5 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.js +211 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +51 -12
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +2 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +51 -12
- package/src/lib/utils/hooks/useEmbeddedWallet/useTurnkey/useTurnkey.cjs +12 -8
- package/src/lib/utils/hooks/useEmbeddedWallet/useTurnkey/useTurnkey.js +12 -8
- package/src/lib/utils/hooks/useEmbeddedWalletPassword/index.d.ts +1 -0
- package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.cjs +140 -0
- package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.d.ts +4 -0
- package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.js +136 -0
- package/src/lib/utils/hooks/useHandleWalletsToConnect/useHandleWalletsToConnect.cjs +12 -8
- package/src/lib/utils/hooks/useHandleWalletsToConnect/useHandleWalletsToConnect.js +12 -8
- package/src/lib/utils/hooks/useInitEmbeddedWalletAuthMethod/useInitEmbeddedWalletAuthMethod.cjs +14 -13
- package/src/lib/utils/hooks/useInitEmbeddedWalletAuthMethod/useInitEmbeddedWalletAuthMethod.js +14 -13
- package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.cjs +12 -8
- package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.js +12 -8
- package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.cjs +14 -13
- package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.js +14 -13
- package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.cjs +12 -8
- package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.js +12 -8
- package/src/lib/utils/hooks/useOnlyConnectedMode/useOnlyConnectedMode.cjs +12 -8
- package/src/lib/utils/hooks/useOnlyConnectedMode/useOnlyConnectedMode.js +12 -8
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs +14 -13
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js +14 -13
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.cjs +2 -0
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.js +2 -0
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.cjs +1 -0
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.d.ts +1 -0
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.js +1 -0
- package/src/lib/utils/hooks/useSendBalance/helpers/EVMSendBalance.cjs +43 -0
- package/src/lib/utils/hooks/useSendBalance/helpers/EVMSendBalance.d.ts +16 -0
- package/src/lib/utils/hooks/useSendBalance/helpers/EVMSendBalance.js +39 -0
- package/src/lib/utils/hooks/useSendBalance/helpers/SendBalanceBase.cjs +35 -0
- package/src/lib/utils/hooks/useSendBalance/helpers/SendBalanceBase.d.ts +21 -0
- package/src/lib/utils/hooks/useSendBalance/helpers/SendBalanceBase.js +31 -0
- package/src/lib/utils/hooks/useSendBalance/helpers/SolanaSendBalance.cjs +51 -0
- package/src/lib/utils/hooks/useSendBalance/helpers/SolanaSendBalance.d.ts +18 -0
- package/src/lib/utils/hooks/useSendBalance/helpers/SolanaSendBalance.js +47 -0
- package/src/lib/utils/hooks/useSendBalance/helpers/index.d.ts +3 -0
- package/src/lib/utils/hooks/useSendBalance/index.d.ts +1 -0
- package/src/lib/utils/hooks/useSendBalance/useSendBalance.cjs +121 -0
- package/src/lib/utils/hooks/useSendBalance/useSendBalance.d.ts +17 -0
- package/src/lib/utils/hooks/useSendBalance/useSendBalance.js +117 -0
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +12 -8
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +12 -8
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +12 -8
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +12 -8
- package/src/lib/utils/hooks/useTransactionEstimatedGas/useTransactionEstimatedGas.cjs +4 -2
- package/src/lib/utils/hooks/useTransactionEstimatedGas/useTransactionEstimatedGas.d.ts +4 -3
- package/src/lib/utils/hooks/useTransactionEstimatedGas/useTransactionEstimatedGas.js +4 -2
- package/src/lib/utils/hooks/useUpdateUserProfileByJWTCallback/useUpdateUserProfileByJWTCallback.cjs +12 -8
- package/src/lib/utils/hooks/useUpdateUserProfileByJWTCallback/useUpdateUserProfileByJWTCallback.js +12 -8
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs +13 -9
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js +13 -9
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUserWithModal/useUpdateUserWithModal.cjs +12 -8
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUserWithModal/useUpdateUserWithModal.js +12 -8
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.cjs +9 -44
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.d.ts +3 -5
- package/src/lib/utils/hooks/useValidateSession/useValidateSession.js +10 -45
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +13 -9
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.d.ts +5 -2
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +13 -9
- package/src/lib/utils/hooks/useViewSettings/useViewSettings.cjs +12 -8
- package/src/lib/utils/hooks/useViewSettings/useViewSettings.js +12 -8
- package/src/lib/utils/hooks/useWalletConnectorOptions/useWalletConnectorOptions.cjs +1 -3
- package/src/lib/utils/hooks/useWalletConnectorOptions/useWalletConnectorOptions.d.ts +3 -4
- package/src/lib/utils/hooks/useWalletConnectorOptions/useWalletConnectorOptions.js +1 -3
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs +2 -0
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyMagicIsSetup/verifyMagicIsSetup.js +2 -0
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyZeroDevIsSetup/verifyZeroDevIsSetup.cjs +2 -0
- package/src/lib/utils/hooks/useWalletConnectorOptions/utils/verifyZeroDevIsSetup/verifyZeroDevIsSetup.js +2 -0
- package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.cjs +2 -0
- package/src/lib/utils/hooks/useWalletConnectors/reconnectSocialWallet.js +2 -0
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +2 -0
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +2 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.cjs +2 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.js +2 -0
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +11 -7
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +11 -7
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +14 -10
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.d.ts +1 -5
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +14 -10
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.cjs +2 -0
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.js +2 -0
- package/src/lib/views/AccountExistsView/AccountExistsView.cjs +11 -7
- package/src/lib/views/AccountExistsView/AccountExistsView.js +11 -7
- package/src/lib/views/BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.cjs +12 -8
- package/src/lib/views/BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.js +12 -8
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.cjs +12 -8
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.js +12 -8
- package/src/lib/views/BridgeWelcomeView/BridgeWelcomeView.cjs +12 -8
- package/src/lib/views/BridgeWelcomeView/BridgeWelcomeView.js +12 -8
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +11 -7
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +11 -7
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +12 -8
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +12 -8
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +11 -7
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +11 -7
- package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +11 -8
- package/src/lib/views/CollectUserDataView/UserDataFields/index.js +11 -8
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs +11 -7
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +11 -7
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +11 -7
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +11 -7
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +11 -8
- package/src/lib/views/EmailUpdate/EmailUpdate.js +11 -8
- package/src/lib/views/EmailVerification/EmailVerification.cjs +14 -10
- package/src/lib/views/EmailVerification/EmailVerification.js +14 -10
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +32 -26
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +32 -26
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +15 -16
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +15 -16
- package/src/lib/views/EnterPasswordView/EnterPasswordView.d.ts +8 -0
- package/src/lib/views/EnterPasswordView/index.d.ts +1 -0
- package/src/lib/views/LoginView/LoginView.cjs +39 -19
- package/src/lib/views/LoginView/LoginView.js +39 -19
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +18 -27
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +20 -29
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.cjs +125 -0
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.d.ts +3 -0
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.js +121 -0
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/checkPhoneNumberForError/checkPhoneNumberForError.cjs +12 -0
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/checkPhoneNumberForError/checkPhoneNumberForError.d.ts +5 -0
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/checkPhoneNumberForError/checkPhoneNumberForError.js +8 -0
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/checkPhoneNumberForError/index.d.ts +1 -0
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/getCustomCountries/getCustomCountries.cjs +21 -0
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/getCustomCountries/getCustomCountries.d.ts +4 -0
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/getCustomCountries/getCustomCountries.js +16 -0
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/getCustomCountries/index.d.ts +1 -0
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/index.d.ts +1 -0
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/index.d.ts +1 -0
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.cjs +235 -0
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.d.ts +33 -0
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/usePhoneInputLogic.js +230 -0
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.cjs +12 -8
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.js +12 -8
- package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.cjs +12 -8
- package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.js +12 -8
- package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.cjs +12 -8
- package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.js +12 -8
- package/src/lib/views/{SendBalanceView/components/TransactionStage/TransactionStage.cjs → LoginView/sections/ToggleableSection/ToggleableSection.cjs} +33 -34
- package/src/lib/views/LoginView/sections/ToggleableSection/ToggleableSection.d.ts +11 -0
- package/src/lib/views/{SendBalanceView/components/TransactionStage/TransactionStage.js → LoginView/sections/ToggleableSection/ToggleableSection.js} +34 -35
- package/src/lib/views/LoginView/sections/ToggleableSection/index.d.ts +1 -0
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.cjs +11 -7
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.js +11 -7
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSignInSection.cjs +11 -7
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSignInSection.js +11 -7
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSimpleSignIn/WalletSimpleSignIn.cjs +12 -8
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSimpleSignIn/WalletSimpleSignIn.js +12 -8
- package/src/lib/views/LoginView/sections/index.d.ts +3 -1
- package/src/lib/views/LoginView/useLoginView/getLoginViewStructure/getLoginViewStructure.cjs +62 -0
- package/src/lib/views/LoginView/useLoginView/getLoginViewStructure/getLoginViewStructure.d.ts +28 -0
- package/src/lib/views/LoginView/useLoginView/getLoginViewStructure/getLoginViewStructure.js +58 -0
- package/src/lib/views/LoginView/useLoginView/getLoginViewStructure/index.d.ts +1 -0
- package/src/lib/views/LoginView/useLoginView/index.d.ts +1 -0
- package/src/lib/views/LoginView/useLoginView/useLoginView.cjs +201 -0
- package/src/lib/views/LoginView/{useLoginView.d.ts → useLoginView/useLoginView.d.ts} +1 -1
- package/src/lib/views/LoginView/useLoginView/useLoginView.js +196 -0
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +13 -9
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +13 -9
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +10 -6
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +10 -6
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +10 -6
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +10 -6
- package/src/lib/views/NoAccess/NoAccess.cjs +12 -8
- package/src/lib/views/NoAccess/NoAccess.js +12 -8
- package/src/lib/views/NoAccess/useNoAccessText.cjs +12 -8
- package/src/lib/views/NoAccess/useNoAccessText.js +12 -8
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +11 -7
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +11 -7
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +11 -7
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +11 -7
- package/src/lib/views/Passkey/EmbeddedAuthChoice/AuthChoiceInfo/AuthChoiceInfo.cjs +11 -7
- package/src/lib/views/Passkey/EmbeddedAuthChoice/AuthChoiceInfo/AuthChoiceInfo.js +11 -7
- package/src/lib/views/Passkey/EmbeddedAuthChoice/EmbeddedAuthChoice.cjs +11 -7
- package/src/lib/views/Passkey/EmbeddedAuthChoice/EmbeddedAuthChoice.js +11 -7
- package/src/lib/views/Passkey/EmbeddedAuthChoiceCards/ActionCard/ActionCard.cjs +11 -7
- package/src/lib/views/Passkey/EmbeddedAuthChoiceCards/ActionCard/ActionCard.js +11 -7
- package/src/lib/views/Passkey/EmbeddedAuthChoiceCards/EmbeddedAuthChoiceCards.cjs +11 -7
- package/src/lib/views/Passkey/EmbeddedAuthChoiceCards/EmbeddedAuthChoiceCards.js +11 -7
- package/src/lib/views/Passkey/PasskeyDeviceIcon/PasskeyDeviceIcon.cjs +12 -8
- package/src/lib/views/Passkey/PasskeyDeviceIcon/PasskeyDeviceIcon.js +12 -8
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +13 -9
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +13 -9
- package/src/lib/views/Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.cjs +11 -7
- package/src/lib/views/Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.js +11 -7
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.cjs +13 -13
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.js +13 -13
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.cjs +13 -12
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.js +13 -12
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.cjs +11 -7
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.js +11 -7
- package/src/lib/views/Passkey/RenamePasskeyView/RenamePasskeyView.cjs +10 -7
- package/src/lib/views/Passkey/RenamePasskeyView/RenamePasskeyView.js +10 -7
- package/src/lib/views/Passkey/utils/createEmbeddedWalletWithPasskey/createEmbeddedWalletWithPasskey.cjs +1 -0
- package/src/lib/views/Passkey/utils/createEmbeddedWalletWithPasskey/createEmbeddedWalletWithPasskey.js +1 -0
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.cjs +1 -0
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.js +1 -0
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +1 -0
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +1 -0
- package/src/lib/views/PendingConnectView/PendingConnectView.cjs +11 -7
- package/src/lib/views/PendingConnectView/PendingConnectView.js +11 -7
- package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +11 -7
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +11 -7
- package/src/lib/views/QrCodeView/QRCode.cjs +12 -8
- package/src/lib/views/QrCodeView/QRCode.js +12 -8
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +11 -7
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +11 -7
- package/src/lib/views/QrCodeView/QrCodeView.cjs +12 -8
- package/src/lib/views/QrCodeView/QrCodeView.js +12 -8
- package/src/lib/views/SelectHardwareWalletView/SelectHardwareWalletView.cjs +11 -7
- package/src/lib/views/SelectHardwareWalletView/SelectHardwareWalletView.js +11 -7
- package/src/lib/views/SelectWalletInWalletGroupView/SelectWalletInWalletGroupView.cjs +12 -8
- package/src/lib/views/SelectWalletInWalletGroupView/SelectWalletInWalletGroupView.js +12 -8
- package/src/lib/views/SelectWalletInWalletGroupView/components/WalletGroupItem/WalletGroupItem.cjs +12 -8
- package/src/lib/views/SelectWalletInWalletGroupView/components/WalletGroupItem/WalletGroupItem.js +12 -8
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +34 -53
- package/src/lib/views/SendBalanceView/SendBalanceView.js +34 -53
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +11 -7
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +11 -7
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.cjs +11 -7
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.js +11 -7
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +39 -25
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.d.ts +6 -3
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +40 -26
- package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs +17 -2
- package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.js +17 -2
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionGas/useTransactionGas.cjs +21 -11
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionGas/useTransactionGas.d.ts +5 -4
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionGas/useTransactionGas.js +21 -11
- package/src/lib/views/UserFieldEditorView/UserFieldEditorView.cjs +12 -8
- package/src/lib/views/UserFieldEditorView/UserFieldEditorView.js +12 -8
- package/src/lib/views/UserFieldEditorView/useAssignDefaultValues/useAssignDefaultValues.cjs +12 -8
- package/src/lib/views/UserFieldEditorView/useAssignDefaultValues/useAssignDefaultValues.js +12 -8
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.cjs +11 -7
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.js +11 -7
- package/src/lib/views/WalletGroupView/WalletGroupView.cjs +13 -9
- package/src/lib/views/WalletGroupView/WalletGroupView.js +13 -9
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.cjs +12 -8
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.js +12 -8
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.cjs +11 -7
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.js +11 -7
- package/src/lib/views/WalletList/WalletList.cjs +11 -7
- package/src/lib/views/WalletList/WalletList.js +11 -7
- package/src/lib/views/WalletList/WalletListGridTabs/WalletListGridTabs.cjs +11 -7
- package/src/lib/views/WalletList/WalletListGridTabs/WalletListGridTabs.js +11 -7
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +12 -8
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +12 -8
- package/src/lib/views/WalletList/data.cjs +2 -6
- package/src/lib/views/WalletList/data.d.ts +1 -1
- package/src/lib/views/WalletList/data.js +2 -6
- package/src/lib/views/WalletList/hooks/useTabState.cjs +12 -8
- package/src/lib/views/WalletList/hooks/useTabState.js +12 -8
- package/src/lib/views/WalletLockedView/WalletLockedView.cjs +11 -7
- package/src/lib/views/WalletLockedView/WalletLockedView.js +11 -7
- package/src/lib/views/WalletRedirectView/WalletRedirectView.cjs +86 -0
- package/src/lib/views/WalletRedirectView/WalletRedirectView.d.ts +2 -0
- package/src/lib/views/WalletRedirectView/WalletRedirectView.js +82 -0
- package/src/lib/views/WalletRedirectView/index.d.ts +1 -0
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +12 -8
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +12 -8
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +12 -8
- package/src/lib/views/WalletUsedView/WalletUsedView.js +12 -8
- package/src/lib/views/viewToComponentMap.cjs +14 -7
- package/src/lib/views/viewToComponentMap.js +14 -7
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.cjs +11 -7
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.js +11 -7
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeUserProfile/DynamicBridgeUserProfile.cjs +11 -7
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeUserProfile/DynamicBridgeUserProfile.js +11 -7
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.cjs +11 -7
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.js +11 -7
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.cjs +10 -6
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.js +10 -6
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.cjs +12 -8
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.js +12 -8
- package/src/lib/widgets/DynamicBridgeWidget/views/EditProfileView/EditProfileView.cjs +12 -8
- package/src/lib/widgets/DynamicBridgeWidget/views/EditProfileView/EditProfileView.js +12 -8
- package/src/lib/widgets/DynamicBridgeWidget/views/ProfileView/ProfileView.cjs +12 -8
- package/src/lib/widgets/DynamicBridgeWidget/views/ProfileView/ProfileView.js +12 -8
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.cjs +11 -7
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.js +11 -7
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs +12 -8
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js +12 -8
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.cjs +10 -7
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.js +10 -7
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.cjs +10 -6
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.js +10 -6
- package/src/lib/widgets/DynamicMultiWalletPromptsWidget/DynamicMultiWalletPromptsWidget.cjs +71 -1
- package/src/lib/widgets/DynamicMultiWalletPromptsWidget/DynamicMultiWalletPromptsWidget.js +71 -1
- package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/DynamicWidget.js +11 -7
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +38 -42
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +38 -42
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveBitcoinWalletAddresses/ActiveBitcoinWalletAddresses.cjs +9 -5
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveBitcoinWalletAddresses/ActiveBitcoinWalletAddresses.js +9 -5
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.cjs +13 -8
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.d.ts +2 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.js +13 -8
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/index.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +22 -21
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.d.ts +3 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +23 -22
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +20 -10
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +20 -10
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +4 -53
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +4 -53
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +11 -7
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.cjs +12 -8
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.js +12 -8
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +10 -6
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +10 -6
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +12 -8
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +12 -8
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +20 -23
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +20 -23
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +12 -8
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +12 -8
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +11 -7
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +9 -5
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +9 -5
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +11 -7
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +14 -8
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +14 -8
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +11 -7
- package/src/lib/widgets/DynamicWidget/components/PromptModal/PromptModal.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/components/PromptModal/PromptModal.js +11 -7
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +11 -7
- package/src/lib/widgets/DynamicWidget/components/UnknownWalletInformation/UnknownWalletInformation.cjs +9 -5
- package/src/lib/widgets/DynamicWidget/components/UnknownWalletInformation/UnknownWalletInformation.js +9 -5
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +12 -8
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +12 -8
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithNetwork/WalletIconWithNetwork.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithNetwork/WalletIconWithNetwork.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.js +11 -7
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +12 -8
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +12 -8
- package/src/lib/widgets/DynamicWidget/hooks/useCloseMultiWalletPrompt/useCloseMultiWalletPrompt.cjs +12 -8
- package/src/lib/widgets/DynamicWidget/hooks/useCloseMultiWalletPrompt/useCloseMultiWalletPrompt.js +12 -8
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.cjs +14 -10
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.d.ts +4 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchBalance/useFetchBalance.js +14 -10
- package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.cjs +19 -10
- package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.d.ts +4 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.js +19 -10
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.cjs +16 -10
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.d.ts +4 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.js +16 -10
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.cjs +12 -8
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.js +12 -8
- package/src/lib/widgets/DynamicWidget/hooks/useMultiWalletPromptState/useMultiWalletPromptState.cjs +12 -8
- package/src/lib/widgets/DynamicWidget/hooks/useMultiWalletPromptState/useMultiWalletPromptState.js +12 -8
- package/src/lib/widgets/DynamicWidget/prompts/AwaitingConnectionModal/AwaitingConnectionModal.cjs +12 -8
- package/src/lib/widgets/DynamicWidget/prompts/AwaitingConnectionModal/AwaitingConnectionModal.js +12 -8
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.js +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.cjs +12 -8
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +12 -8
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.js +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.js +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.cjs +12 -8
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.js +12 -8
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +11 -7
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +12 -8
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +12 -8
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +12 -8
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +12 -8
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.js +11 -7
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +10 -6
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +10 -6
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +11 -7
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +11 -7
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.cjs +12 -8
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.js +12 -8
- package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.cjs +9 -5
- package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.js +9 -5
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.cjs +11 -7
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +11 -7
- package/src/lib/components/OverlayCard/OverlayCard.context.cjs +0 -9
- package/src/lib/components/OverlayCard/OverlayCard.context.d.ts +0 -6
- package/src/lib/components/OverlayCard/OverlayCard.context.js +0 -5
- package/src/lib/components/OverlayCard/OverlayCardTarget.cjs +0 -17
- package/src/lib/components/OverlayCard/OverlayCardTarget.d.ts +0 -2
- package/src/lib/components/OverlayCard/OverlayCardTarget.js +0 -13
- package/src/lib/components/SecureTurnkeyWalletCard/SecureTurnkeyWalletCard.d.ts +0 -6
- package/src/lib/components/SecureTurnkeyWalletCard/index.d.ts +0 -1
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.d.ts +0 -1
- package/src/lib/components/SyncPasskeyFlow/index.d.ts +0 -1
- package/src/lib/context/EmailVerificationContext/EmailVerificationContext.cjs +0 -31
- package/src/lib/context/EmailVerificationContext/EmailVerificationContext.d.ts +0 -13
- package/src/lib/context/EmailVerificationContext/EmailVerificationContext.js +0 -25
- package/src/lib/context/EmailVerificationContext/index.d.ts +0 -1
- package/src/lib/utils/functions/isAccountAbstractionWallet/isAccountAbstractionWallet.cjs +0 -18
- package/src/lib/utils/functions/isAccountAbstractionWallet/isAccountAbstractionWallet.js +0 -14
- package/src/lib/utils/functions/isMagicConnector/isMagicConnector.cjs +0 -10
- package/src/lib/utils/functions/isMagicConnector/isMagicConnector.js +0 -6
- package/src/lib/utils/hooks/useTransactionWithGasPrice/index.d.ts +0 -1
- package/src/lib/utils/hooks/useTransactionWithGasPrice/useTransactionWithGasPrice.cjs +0 -56
- package/src/lib/utils/hooks/useTransactionWithGasPrice/useTransactionWithGasPrice.d.ts +0 -32
- package/src/lib/utils/hooks/useTransactionWithGasPrice/useTransactionWithGasPrice.js +0 -52
- package/src/lib/views/LoginView/useLoginView.cjs +0 -265
- package/src/lib/views/LoginView/useLoginView.js +0 -260
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.d.ts +0 -11
- package/src/lib/views/SendBalanceView/components/TransactionStage/index.d.ts +0 -1
- package/src/lib/views/SendBalanceView/components/index.d.ts +0 -1
package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.cjs
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var reactInternationalPhone = require('react-international-phone');
|
|
8
|
+
var classNames = require('../../../../utils/functions/classNames/classNames.cjs');
|
|
9
|
+
require('../../../../events/dynamicEvents.cjs');
|
|
10
|
+
require('../../../../../../_virtual/_tslib.cjs');
|
|
11
|
+
require('@dynamic-labs/utils');
|
|
12
|
+
require('../../../../context/DynamicContext/DynamicContext.cjs');
|
|
13
|
+
require('@dynamic-labs/sdk-api');
|
|
14
|
+
var logger = require('../../../../shared/logger.cjs');
|
|
15
|
+
require('@dynamic-labs/iconic');
|
|
16
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
17
|
+
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
18
|
+
var chevronDown = require('../../../../shared/assets/chevron-down.cjs');
|
|
19
|
+
require('@dynamic-labs/wallet-book');
|
|
20
|
+
require('../../../../utils/constants/colors.cjs');
|
|
21
|
+
require('../../../../utils/constants/values.cjs');
|
|
22
|
+
require('../../../../shared/utils/classes/storage/localStorage.cjs');
|
|
23
|
+
require('viem');
|
|
24
|
+
require('../../../../shared/consts/index.cjs');
|
|
25
|
+
var useInternalDynamicContext = require('../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
26
|
+
require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
27
|
+
require('../../../../context/ErrorContext/ErrorContext.cjs');
|
|
28
|
+
require('@dynamic-labs/multi-wallet');
|
|
29
|
+
var isPhoneNumberProviderEnabled = require('../../../../utils/functions/isPhoneNumberProviderEnabled/isPhoneNumberProviderEnabled.cjs');
|
|
30
|
+
require('../../../../config/ApiEndpoint.cjs');
|
|
31
|
+
require('viem/chains');
|
|
32
|
+
require('../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
33
|
+
require('../../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
34
|
+
require('../../../../context/VerificationContext/VerificationContext.cjs');
|
|
35
|
+
require('react-dom');
|
|
36
|
+
require('../../../../context/WalletContext/WalletContext.cjs');
|
|
37
|
+
require('../../../../context/ThemeContext/ThemeContext.cjs');
|
|
38
|
+
require('@dynamic-labs/types');
|
|
39
|
+
require('yup');
|
|
40
|
+
require('react-i18next');
|
|
41
|
+
require('../../../../context/MockContext/MockContext.cjs');
|
|
42
|
+
require('../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
43
|
+
require('../../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
44
|
+
require('@dynamic-labs/rpc-providers');
|
|
45
|
+
require('../../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
46
|
+
require('../../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
47
|
+
require('../../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
48
|
+
require('../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
49
|
+
require('../../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
50
|
+
require('../../../../components/OverlayCard/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
51
|
+
require('../../../../context/FooterAnimationContext/index.cjs');
|
|
52
|
+
var Typography = require('../../../../components/Typography/Typography.cjs');
|
|
53
|
+
require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
54
|
+
require('../../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
55
|
+
require('react-focus-lock');
|
|
56
|
+
require('../../../../context/LoadingContext/LoadingContext.cjs');
|
|
57
|
+
var Icon = require('../../../../components/Icon/Icon.cjs');
|
|
58
|
+
require('i18next');
|
|
59
|
+
require('qrcode');
|
|
60
|
+
require('../../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
61
|
+
require('../../../../components/IconButton/IconButton.cjs');
|
|
62
|
+
require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
63
|
+
require('../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
64
|
+
require('formik');
|
|
65
|
+
var Button = require('../../../../components/Button/Button.cjs');
|
|
66
|
+
require('../../../../components/Alert/Alert.cjs');
|
|
67
|
+
require('../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
68
|
+
require('../../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
69
|
+
require('../../../TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
70
|
+
require('../../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
71
|
+
var InlineSubmitButton = require('../../../../components/InlineSubmitButton/InlineSubmitButton.cjs');
|
|
72
|
+
require('../../../../components/InlineWidget/InlineWidget.cjs');
|
|
73
|
+
var Input = require('../../../../components/Input/Input.cjs');
|
|
74
|
+
require('../../../../components/IsBrowser/IsBrowser.cjs');
|
|
75
|
+
var MenuList = require('../../../../components/MenuList/MenuList/MenuList.cjs');
|
|
76
|
+
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
77
|
+
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
78
|
+
require('../../../WalletList/WalletList.cjs');
|
|
79
|
+
require('@hcaptcha/react-hcaptcha');
|
|
80
|
+
require('../../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
81
|
+
require('../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
82
|
+
var usePhoneInputLogic = require('./usePhoneInputLogic/usePhoneInputLogic.cjs');
|
|
83
|
+
|
|
84
|
+
const PhoneNumberSignInSection = ({ isLoading, onSubmit, onSubmitError, }) => {
|
|
85
|
+
var _a, _b;
|
|
86
|
+
const { projectSettings } = useInternalDynamicContext.useInternalDynamicContext();
|
|
87
|
+
const countryInputRef = React.useRef(null);
|
|
88
|
+
const [countryDropdownOpen, setCountryDropdownOpen] = React.useState(false);
|
|
89
|
+
const anchorRef = React.useRef(null);
|
|
90
|
+
const [invalidNumberMessage, setInvalidNumberMessage] = React.useState(undefined);
|
|
91
|
+
const { formattedPhone, currentCountry, handleCountryInput, handlePhoneInput, hasInput, inputRef, placeholder, countryInput, onBlurCountry, filteredCountries, openDropdown, handleCountryKeyDown, closeDropdown, setCountry, onMenuDisplayToggle, onFocusCountry, isInputComplete, handleSubmit, countryFontSize, } = usePhoneInputLogic.usePhoneInputLogic({
|
|
92
|
+
countryInputRef,
|
|
93
|
+
onSubmit,
|
|
94
|
+
onSubmitError,
|
|
95
|
+
setCountryDropdownOpen,
|
|
96
|
+
setInvalidNumberMessage,
|
|
97
|
+
});
|
|
98
|
+
/** Indicates the state of the input relative to the user's interaction */
|
|
99
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
100
|
+
const [isFocused, setIsFocused] = React.useState(false);
|
|
101
|
+
if (!isPhoneNumberProviderEnabled.isPhoneNumberProviderEnabled((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _a !== void 0 ? _a : [])) {
|
|
102
|
+
logger.logger.error('Failed to render PhoneNumberSignInSection - no sign in provider enabled');
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
return (jsxRuntime.jsxs("form", { className: 'login-with-phone-number-form', onSubmit: (e) => handleSubmit(e), children: [jsxRuntime.jsxs("div", { className: 'login-with-phone-number-form__fields', onPointerEnter: () => setIsHovered(true), onPointerLeave: () => setIsHovered(false), onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), ref: anchorRef, children: [jsxRuntime.jsxs("div", { className: classNames.classNames('login-with-phone-number-form__fields__country-code', {
|
|
106
|
+
'login-with-phone-number-form__fields__country-code--disabled': isLoading,
|
|
107
|
+
}), onClick: openDropdown, "data-testid": 'country-code', children: [jsxRuntime.jsx(reactInternationalPhone.FlagImage, { iso2: currentCountry.iso2, size: '24px', className: 'login-with-phone-number-form__fields__country-code__flag' }), jsxRuntime.jsx(Typography.Typography, { className: 'login-with-phone-number-form__fields__country-code__plus', variant: 'body_normal', weight: 'regular', style: { fontSize: countryFontSize }, color: 'primary', children: "+" }), jsxRuntime.jsx(Input.Input, { label: '', id: 'country_code_field', value: countryInput, onChange: handleCountryInput, disabled: isLoading, containerClassName: 'login-with-phone-number-form__fields__country-code__container', className: 'login-with-phone-number-form__fields__country-code__container__input', onBlur: onBlurCountry, ref: countryInputRef, onKeyDown: handleCountryKeyDown, onFocus: onFocusCountry, style: { fontSize: countryFontSize }, "data-testid": 'country-code-input' }), jsxRuntime.jsx(Icon.Icon, { className: 'login-with-phone-number-form__fields__country-code__chevron', children: jsxRuntime.jsx(chevronDown.ReactComponent, {}) })] }), jsxRuntime.jsx(Input.Input, { label: '', id: 'phone_number_field', value: formattedPhone, onChange: handlePhoneInput, disabled: isLoading, containerClassName: 'login-with-phone-number-form__fields__phone-number', className: 'login-with-phone-number-form__fields__phone-number__input', ref: inputRef, error: Boolean(invalidNumberMessage) }), !hasInput && (jsxRuntime.jsx(Typography.Typography, { className: 'login-with-phone-number-form__fields__placeholder', variant: 'body_normal', weight: 'regular', children: placeholder })), jsxRuntime.jsx(InlineSubmitButton.InlineSubmitButton, { disabled: isLoading || !isInputComplete, highlighted: isInputComplete, isFocused: isFocused, isHovered: isHovered, className: 'login-with-phone-number-form__fields__inline-submit' })] }), jsxRuntime.jsx(MenuList.MenuList, { isOpen: countryDropdownOpen, onClickClose: closeDropdown, popperProps: {
|
|
108
|
+
anchorOrigin: 'bottom-left',
|
|
109
|
+
anchorRef,
|
|
110
|
+
}, mobileTitle: 'Select country', dropdownClassName: 'login-with-phone-number-form__dropdown', children: jsxRuntime.jsx("div", { className: 'login-with-phone-number-form__dropdown__items', ref: onMenuDisplayToggle, children: filteredCountries.map((countryData) => {
|
|
111
|
+
const country = reactInternationalPhone.parseCountry(countryData);
|
|
112
|
+
const { iso2, name, dialCode } = country;
|
|
113
|
+
const isSelected = iso2 === currentCountry.iso2;
|
|
114
|
+
return (jsxRuntime.jsxs("div", { className: classNames.classNames('login-with-phone-number-form__dropdown__items__country', {
|
|
115
|
+
'login-with-phone-number-form__dropdown__items__country--selected': isSelected,
|
|
116
|
+
}), onClick: () => {
|
|
117
|
+
setCountry(country);
|
|
118
|
+
closeDropdown();
|
|
119
|
+
}, id: iso2, children: [jsxRuntime.jsx(reactInternationalPhone.FlagImage, { iso2: iso2, size: '24px' }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'primary', children: name }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', children: dialCode })] }, iso2));
|
|
120
|
+
}) }) }), Boolean(invalidNumberMessage) && (jsxRuntime.jsx(Typography.Typography, { variant: 'body_mini', className: 'login-with-phone-number-form__error-message', children: invalidNumberMessage })), !((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal) === null || _b === void 0 ? void 0 : _b.emailSubmitButtonInsideInput) && (jsxRuntime.jsx(Button.Button, { dataTestId: 'big-submit-button', buttonClassName: 'login-with-phone-number-form__button', type: 'submit', loading: isLoading, disabled: isLoading || !isInputComplete, buttonVariant: 'brand-primary', buttonPadding: 'login-screen-height', expanded: true, typographyProps: {
|
|
121
|
+
color: 'inherit',
|
|
122
|
+
}, children: "Continue" }))] }));
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
exports.PhoneNumberSignInSection = PhoneNumberSignInSection;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useRef, useState } from 'react';
|
|
3
|
+
import { FlagImage, parseCountry } from 'react-international-phone';
|
|
4
|
+
import { classNames } from '../../../../utils/functions/classNames/classNames.js';
|
|
5
|
+
import '../../../../events/dynamicEvents.js';
|
|
6
|
+
import '../../../../../../_virtual/_tslib.js';
|
|
7
|
+
import '@dynamic-labs/utils';
|
|
8
|
+
import '../../../../context/DynamicContext/DynamicContext.js';
|
|
9
|
+
import '@dynamic-labs/sdk-api';
|
|
10
|
+
import { logger } from '../../../../shared/logger.js';
|
|
11
|
+
import '@dynamic-labs/iconic';
|
|
12
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
13
|
+
import '../../../../context/ViewContext/ViewContext.js';
|
|
14
|
+
import { ReactComponent as SvgChevronDown } from '../../../../shared/assets/chevron-down.js';
|
|
15
|
+
import '@dynamic-labs/wallet-book';
|
|
16
|
+
import '../../../../utils/constants/colors.js';
|
|
17
|
+
import '../../../../utils/constants/values.js';
|
|
18
|
+
import '../../../../shared/utils/classes/storage/localStorage.js';
|
|
19
|
+
import 'viem';
|
|
20
|
+
import '../../../../shared/consts/index.js';
|
|
21
|
+
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
22
|
+
import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
23
|
+
import '../../../../context/ErrorContext/ErrorContext.js';
|
|
24
|
+
import '@dynamic-labs/multi-wallet';
|
|
25
|
+
import { isPhoneNumberProviderEnabled } from '../../../../utils/functions/isPhoneNumberProviderEnabled/isPhoneNumberProviderEnabled.js';
|
|
26
|
+
import '../../../../config/ApiEndpoint.js';
|
|
27
|
+
import 'viem/chains';
|
|
28
|
+
import '../../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
29
|
+
import '../../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
30
|
+
import '../../../../context/VerificationContext/VerificationContext.js';
|
|
31
|
+
import 'react-dom';
|
|
32
|
+
import '../../../../context/WalletContext/WalletContext.js';
|
|
33
|
+
import '../../../../context/ThemeContext/ThemeContext.js';
|
|
34
|
+
import '@dynamic-labs/types';
|
|
35
|
+
import 'yup';
|
|
36
|
+
import 'react-i18next';
|
|
37
|
+
import '../../../../context/MockContext/MockContext.js';
|
|
38
|
+
import '../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
39
|
+
import '../../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
40
|
+
import '@dynamic-labs/rpc-providers';
|
|
41
|
+
import '../../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
42
|
+
import '../../../../components/ShadowDOM/ShadowDOM.js';
|
|
43
|
+
import '../../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
44
|
+
import '../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
45
|
+
import '../../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
46
|
+
import '../../../../components/OverlayCard/OverlayCardTarget/OverlayCardTarget.js';
|
|
47
|
+
import '../../../../context/FooterAnimationContext/index.js';
|
|
48
|
+
import { Typography } from '../../../../components/Typography/Typography.js';
|
|
49
|
+
import '../../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
50
|
+
import '../../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
51
|
+
import 'react-focus-lock';
|
|
52
|
+
import '../../../../context/LoadingContext/LoadingContext.js';
|
|
53
|
+
import { Icon } from '../../../../components/Icon/Icon.js';
|
|
54
|
+
import 'i18next';
|
|
55
|
+
import 'qrcode';
|
|
56
|
+
import '../../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
57
|
+
import '../../../../components/IconButton/IconButton.js';
|
|
58
|
+
import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
59
|
+
import '../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
60
|
+
import 'formik';
|
|
61
|
+
import { Button } from '../../../../components/Button/Button.js';
|
|
62
|
+
import '../../../../components/Alert/Alert.js';
|
|
63
|
+
import '../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
64
|
+
import '../../../../context/PasskeyContext/PasskeyContext.js';
|
|
65
|
+
import '../../../TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
66
|
+
import '../../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
67
|
+
import { InlineSubmitButton } from '../../../../components/InlineSubmitButton/InlineSubmitButton.js';
|
|
68
|
+
import '../../../../components/InlineWidget/InlineWidget.js';
|
|
69
|
+
import { Input } from '../../../../components/Input/Input.js';
|
|
70
|
+
import '../../../../components/IsBrowser/IsBrowser.js';
|
|
71
|
+
import { MenuList } from '../../../../components/MenuList/MenuList/MenuList.js';
|
|
72
|
+
import '../../../../components/Popper/Popper/Popper.js';
|
|
73
|
+
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
74
|
+
import '../../../WalletList/WalletList.js';
|
|
75
|
+
import '@hcaptcha/react-hcaptcha';
|
|
76
|
+
import '../../../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
77
|
+
import '../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
78
|
+
import { usePhoneInputLogic } from './usePhoneInputLogic/usePhoneInputLogic.js';
|
|
79
|
+
|
|
80
|
+
const PhoneNumberSignInSection = ({ isLoading, onSubmit, onSubmitError, }) => {
|
|
81
|
+
var _a, _b;
|
|
82
|
+
const { projectSettings } = useInternalDynamicContext();
|
|
83
|
+
const countryInputRef = useRef(null);
|
|
84
|
+
const [countryDropdownOpen, setCountryDropdownOpen] = useState(false);
|
|
85
|
+
const anchorRef = useRef(null);
|
|
86
|
+
const [invalidNumberMessage, setInvalidNumberMessage] = useState(undefined);
|
|
87
|
+
const { formattedPhone, currentCountry, handleCountryInput, handlePhoneInput, hasInput, inputRef, placeholder, countryInput, onBlurCountry, filteredCountries, openDropdown, handleCountryKeyDown, closeDropdown, setCountry, onMenuDisplayToggle, onFocusCountry, isInputComplete, handleSubmit, countryFontSize, } = usePhoneInputLogic({
|
|
88
|
+
countryInputRef,
|
|
89
|
+
onSubmit,
|
|
90
|
+
onSubmitError,
|
|
91
|
+
setCountryDropdownOpen,
|
|
92
|
+
setInvalidNumberMessage,
|
|
93
|
+
});
|
|
94
|
+
/** Indicates the state of the input relative to the user's interaction */
|
|
95
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
96
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
97
|
+
if (!isPhoneNumberProviderEnabled((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _a !== void 0 ? _a : [])) {
|
|
98
|
+
logger.error('Failed to render PhoneNumberSignInSection - no sign in provider enabled');
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
return (jsxs("form", { className: 'login-with-phone-number-form', onSubmit: (e) => handleSubmit(e), children: [jsxs("div", { className: 'login-with-phone-number-form__fields', onPointerEnter: () => setIsHovered(true), onPointerLeave: () => setIsHovered(false), onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), ref: anchorRef, children: [jsxs("div", { className: classNames('login-with-phone-number-form__fields__country-code', {
|
|
102
|
+
'login-with-phone-number-form__fields__country-code--disabled': isLoading,
|
|
103
|
+
}), onClick: openDropdown, "data-testid": 'country-code', children: [jsx(FlagImage, { iso2: currentCountry.iso2, size: '24px', className: 'login-with-phone-number-form__fields__country-code__flag' }), jsx(Typography, { className: 'login-with-phone-number-form__fields__country-code__plus', variant: 'body_normal', weight: 'regular', style: { fontSize: countryFontSize }, color: 'primary', children: "+" }), jsx(Input, { label: '', id: 'country_code_field', value: countryInput, onChange: handleCountryInput, disabled: isLoading, containerClassName: 'login-with-phone-number-form__fields__country-code__container', className: 'login-with-phone-number-form__fields__country-code__container__input', onBlur: onBlurCountry, ref: countryInputRef, onKeyDown: handleCountryKeyDown, onFocus: onFocusCountry, style: { fontSize: countryFontSize }, "data-testid": 'country-code-input' }), jsx(Icon, { className: 'login-with-phone-number-form__fields__country-code__chevron', children: jsx(SvgChevronDown, {}) })] }), jsx(Input, { label: '', id: 'phone_number_field', value: formattedPhone, onChange: handlePhoneInput, disabled: isLoading, containerClassName: 'login-with-phone-number-form__fields__phone-number', className: 'login-with-phone-number-form__fields__phone-number__input', ref: inputRef, error: Boolean(invalidNumberMessage) }), !hasInput && (jsx(Typography, { className: 'login-with-phone-number-form__fields__placeholder', variant: 'body_normal', weight: 'regular', children: placeholder })), jsx(InlineSubmitButton, { disabled: isLoading || !isInputComplete, highlighted: isInputComplete, isFocused: isFocused, isHovered: isHovered, className: 'login-with-phone-number-form__fields__inline-submit' })] }), jsx(MenuList, { isOpen: countryDropdownOpen, onClickClose: closeDropdown, popperProps: {
|
|
104
|
+
anchorOrigin: 'bottom-left',
|
|
105
|
+
anchorRef,
|
|
106
|
+
}, mobileTitle: 'Select country', dropdownClassName: 'login-with-phone-number-form__dropdown', children: jsx("div", { className: 'login-with-phone-number-form__dropdown__items', ref: onMenuDisplayToggle, children: filteredCountries.map((countryData) => {
|
|
107
|
+
const country = parseCountry(countryData);
|
|
108
|
+
const { iso2, name, dialCode } = country;
|
|
109
|
+
const isSelected = iso2 === currentCountry.iso2;
|
|
110
|
+
return (jsxs("div", { className: classNames('login-with-phone-number-form__dropdown__items__country', {
|
|
111
|
+
'login-with-phone-number-form__dropdown__items__country--selected': isSelected,
|
|
112
|
+
}), onClick: () => {
|
|
113
|
+
setCountry(country);
|
|
114
|
+
closeDropdown();
|
|
115
|
+
}, id: iso2, children: [jsx(FlagImage, { iso2: iso2, size: '24px' }), jsx(Typography, { variant: 'body_small', color: 'primary', children: name }), jsx(Typography, { variant: 'body_small', color: 'secondary', children: dialCode })] }, iso2));
|
|
116
|
+
}) }) }), Boolean(invalidNumberMessage) && (jsx(Typography, { variant: 'body_mini', className: 'login-with-phone-number-form__error-message', children: invalidNumberMessage })), !((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal) === null || _b === void 0 ? void 0 : _b.emailSubmitButtonInsideInput) && (jsx(Button, { dataTestId: 'big-submit-button', buttonClassName: 'login-with-phone-number-form__button', type: 'submit', loading: isLoading, disabled: isLoading || !isInputComplete, buttonVariant: 'brand-primary', buttonPadding: 'login-screen-height', expanded: true, typographyProps: {
|
|
117
|
+
color: 'inherit',
|
|
118
|
+
}, children: "Continue" }))] }));
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export { PhoneNumberSignInSection };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const PHONE_NUMBER_REGEX = /^\+[1-9]\d{1,14}$/;
|
|
6
|
+
/**
|
|
7
|
+
* Performs a regex check to ensure phone follows the e.164 format
|
|
8
|
+
* https://www.twilio.com/docs/glossary/what-e164
|
|
9
|
+
*/
|
|
10
|
+
const checkPhoneNumberForError = (number) => PHONE_NUMBER_REGEX.test(number);
|
|
11
|
+
|
|
12
|
+
exports.checkPhoneNumberForError = checkPhoneNumberForError;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const PHONE_NUMBER_REGEX = /^\+[1-9]\d{1,14}$/;
|
|
2
|
+
/**
|
|
3
|
+
* Performs a regex check to ensure phone follows the e.164 format
|
|
4
|
+
* https://www.twilio.com/docs/glossary/what-e164
|
|
5
|
+
*/
|
|
6
|
+
const checkPhoneNumberForError = (number) => PHONE_NUMBER_REGEX.test(number);
|
|
7
|
+
|
|
8
|
+
export { checkPhoneNumberForError };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './checkPhoneNumberForError';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var reactInternationalPhone = require('react-international-phone');
|
|
6
|
+
|
|
7
|
+
// To see which iso2 maps to which country, see
|
|
8
|
+
// https://github.com/goveo/react-international-phone/blob/master/src/data/countryData.ts
|
|
9
|
+
const getCustomCountries = () => reactInternationalPhone.defaultCountries
|
|
10
|
+
.map(reactInternationalPhone.parseCountry)
|
|
11
|
+
.filter(({ iso2 }) => supportedCountries.includes(iso2))
|
|
12
|
+
.map((country) =>
|
|
13
|
+
// Override these formats when we implement these countries
|
|
14
|
+
// if (country.iso2 === 'br') country.format = '(..) .....-....';
|
|
15
|
+
// if (country.iso2 === 'fr') country.format = '(.) .. .. .. ..';
|
|
16
|
+
reactInternationalPhone.buildCountryData(country));
|
|
17
|
+
/** Which countries we currently support */
|
|
18
|
+
const supportedCountries = ['us', 'ca'];
|
|
19
|
+
|
|
20
|
+
exports.getCustomCountries = getCustomCountries;
|
|
21
|
+
exports.supportedCountries = supportedCountries;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defaultCountries, parseCountry, buildCountryData } from 'react-international-phone';
|
|
2
|
+
|
|
3
|
+
// To see which iso2 maps to which country, see
|
|
4
|
+
// https://github.com/goveo/react-international-phone/blob/master/src/data/countryData.ts
|
|
5
|
+
const getCustomCountries = () => defaultCountries
|
|
6
|
+
.map(parseCountry)
|
|
7
|
+
.filter(({ iso2 }) => supportedCountries.includes(iso2))
|
|
8
|
+
.map((country) =>
|
|
9
|
+
// Override these formats when we implement these countries
|
|
10
|
+
// if (country.iso2 === 'br') country.format = '(..) .....-....';
|
|
11
|
+
// if (country.iso2 === 'fr') country.format = '(.) .. .. .. ..';
|
|
12
|
+
buildCountryData(country));
|
|
13
|
+
/** Which countries we currently support */
|
|
14
|
+
const supportedCountries = ['us', 'ca'];
|
|
15
|
+
|
|
16
|
+
export { getCustomCountries, supportedCountries };
|
package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/getCustomCountries/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getCustomCountries';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PhoneNumberSignInSection';
|
package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/usePhoneInputLogic/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './usePhoneInputLogic';
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var reactInternationalPhone = require('react-international-phone');
|
|
7
|
+
var reactI18next = require('react-i18next');
|
|
8
|
+
var localStorage = require('../../../../../shared/utils/classes/storage/localStorage.cjs');
|
|
9
|
+
var useThrottle = require('../../../../../shared/utils/hooks/useThrottle/useThrottle.cjs');
|
|
10
|
+
var localStorage$1 = require('../../../../../utils/constants/localStorage.cjs');
|
|
11
|
+
var modulo = require('../../../../../utils/functions/modulo/modulo.cjs');
|
|
12
|
+
var getCustomCountries = require('../getCustomCountries/getCustomCountries.cjs');
|
|
13
|
+
var checkPhoneNumberForError = require('../checkPhoneNumberForError/checkPhoneNumberForError.cjs');
|
|
14
|
+
|
|
15
|
+
const customCountries = getCustomCountries.getCustomCountries();
|
|
16
|
+
/** The default country we want to use */
|
|
17
|
+
const getDefaultCountry = () => {
|
|
18
|
+
var _a;
|
|
19
|
+
const defaultCountryIso2 = (_a = localStorage.LocalStorage.getFromLS(localStorage$1.PHONE_INPUT_DEFAULT_COUNTRY)) !== null && _a !== void 0 ? _a : 'us';
|
|
20
|
+
return customCountries
|
|
21
|
+
.map(reactInternationalPhone.parseCountry)
|
|
22
|
+
.find(({ iso2 }) => iso2 === defaultCountryIso2);
|
|
23
|
+
};
|
|
24
|
+
const MENU_DISPLAY_THROTTLE = 50;
|
|
25
|
+
const COUNTRY_INPUT_SCROLL_DELAY = 20;
|
|
26
|
+
const usePhoneInputLogic = ({ countryInputRef, setCountryDropdownOpen, setInvalidNumberMessage, onSubmit, onSubmitError, }) => {
|
|
27
|
+
var _a, _b, _c, _d;
|
|
28
|
+
const { inputValue: formattedPhone, phone, country: currentCountry, setCountry: setSelectedCountry, handlePhoneValueChange: handlePhoneInput, inputRef, } = reactInternationalPhone.usePhoneInput({
|
|
29
|
+
countries: customCountries,
|
|
30
|
+
defaultCountry: (_b = (_a = getDefaultCountry()) === null || _a === void 0 ? void 0 : _a.iso2) !== null && _b !== void 0 ? _b : 'us',
|
|
31
|
+
disableDialCodeAndPrefix: true,
|
|
32
|
+
});
|
|
33
|
+
/** What is currently displayed on the country input */
|
|
34
|
+
const [countryInput, setCountryInput] = React.useState((_d = (_c = getDefaultCountry()) === null || _c === void 0 ? void 0 : _c.dialCode) !== null && _d !== void 0 ? _d : '1');
|
|
35
|
+
const { t } = reactI18next.useTranslation();
|
|
36
|
+
// =================================================================
|
|
37
|
+
// DROPDOWN
|
|
38
|
+
// =================================================================
|
|
39
|
+
/** String to filter the countries with */
|
|
40
|
+
// Even though this value is similar to countryInput, it needs to differ for a specific scenario:
|
|
41
|
+
// The user inputs a value (say 55) and then starts cycling with the arrow keys.
|
|
42
|
+
// If we were using the countryInput to filter the list, that filter would change with each new country.
|
|
43
|
+
const [filterQuery, setFilterQuery] = React.useState('');
|
|
44
|
+
/** List of countries, but filtered by the current input */
|
|
45
|
+
const filteredCountries = React.useMemo(() => {
|
|
46
|
+
if (!filterQuery)
|
|
47
|
+
return customCountries;
|
|
48
|
+
// If input is a country name
|
|
49
|
+
if (isNaN(parseInt(filterQuery)))
|
|
50
|
+
return customCountries.filter((countryData) => {
|
|
51
|
+
const { name, iso2 } = reactInternationalPhone.parseCountry(countryData);
|
|
52
|
+
return (name.toLowerCase().includes(filterQuery.toLowerCase()) ||
|
|
53
|
+
iso2 === filterQuery.toLowerCase() ||
|
|
54
|
+
currentCountry.iso2 === iso2);
|
|
55
|
+
});
|
|
56
|
+
return customCountries.filter((countryData) => {
|
|
57
|
+
const { dialCode, iso2 } = reactInternationalPhone.parseCountry(countryData);
|
|
58
|
+
return dialCode.includes(filterQuery) || currentCountry.iso2 === iso2;
|
|
59
|
+
});
|
|
60
|
+
}, [currentCountry.iso2, filterQuery]);
|
|
61
|
+
const openDropdown = () => {
|
|
62
|
+
// Don't filter on open, wait for input
|
|
63
|
+
setFilterQuery('');
|
|
64
|
+
setCountryDropdownOpen(true);
|
|
65
|
+
};
|
|
66
|
+
const closeDropdown = React.useCallback(() => {
|
|
67
|
+
setCountryDropdownOpen(false);
|
|
68
|
+
}, [setCountryDropdownOpen]);
|
|
69
|
+
// =================================================================
|
|
70
|
+
// COUNTRY INPUT
|
|
71
|
+
// =================================================================
|
|
72
|
+
/** The last inputted value for country that was valid */
|
|
73
|
+
const lastValidCountry = React.useRef(getDefaultCountry());
|
|
74
|
+
const handleCountryInput = ({ target, }) => {
|
|
75
|
+
const value = target.value.slice(0, 4);
|
|
76
|
+
setCountryInput(value);
|
|
77
|
+
// Start filtering as soon as there is any input
|
|
78
|
+
setFilterQuery(value);
|
|
79
|
+
// Check which country this dial code corresponds to
|
|
80
|
+
const { country: guessedCountry } = reactInternationalPhone.guessCountryByPartialPhoneNumber({
|
|
81
|
+
countries: customCountries,
|
|
82
|
+
currentCountryIso2: currentCountry.iso2,
|
|
83
|
+
phone: value,
|
|
84
|
+
});
|
|
85
|
+
if (!guessedCountry)
|
|
86
|
+
return;
|
|
87
|
+
lastValidCountry.current = guessedCountry;
|
|
88
|
+
setSelectedCountry(guessedCountry.iso2);
|
|
89
|
+
localStorage.LocalStorage.setToLS(localStorage$1.PHONE_INPUT_DEFAULT_COUNTRY, guessedCountry.iso2);
|
|
90
|
+
setTimeout(() => scrollCountryIntoView(guessedCountry.iso2), COUNTRY_INPUT_SCROLL_DELAY);
|
|
91
|
+
};
|
|
92
|
+
const resetToLastValidCountry = () => {
|
|
93
|
+
if (!lastValidCountry.current ||
|
|
94
|
+
countryInput === lastValidCountry.current.dialCode)
|
|
95
|
+
return;
|
|
96
|
+
setSelectedCountry(lastValidCountry.current.iso2);
|
|
97
|
+
localStorage.LocalStorage.setToLS(localStorage$1.PHONE_INPUT_DEFAULT_COUNTRY, lastValidCountry.current.iso2);
|
|
98
|
+
setCountryInput(lastValidCountry.current.dialCode);
|
|
99
|
+
// Changing country resets the phone number, so we must also reset any errors
|
|
100
|
+
setInvalidNumberMessage(undefined);
|
|
101
|
+
};
|
|
102
|
+
/** Handles up and down arrow input */
|
|
103
|
+
const handleArrowInput = React.useCallback((event) => {
|
|
104
|
+
event.preventDefault();
|
|
105
|
+
const currentIndex = filteredCountries.findIndex((countryData) => reactInternationalPhone.parseCountry(countryData).iso2 === currentCountry.iso2);
|
|
106
|
+
const direction = event.key === 'ArrowUp' ? -1 : 1;
|
|
107
|
+
const newCountry = reactInternationalPhone.parseCountry(filteredCountries[modulo.modulo(currentIndex + direction, filteredCountries.length)]);
|
|
108
|
+
scrollCountryIntoView(newCountry.iso2);
|
|
109
|
+
// We don't set filterQuery here because we don't want to change
|
|
110
|
+
// the filter while the user is cycling through the list
|
|
111
|
+
setCountryInput(newCountry.dialCode);
|
|
112
|
+
setSelectedCountry(newCountry.iso2);
|
|
113
|
+
lastValidCountry.current = newCountry;
|
|
114
|
+
localStorage.LocalStorage.setToLS(localStorage$1.PHONE_INPUT_DEFAULT_COUNTRY, newCountry.iso2);
|
|
115
|
+
// Changing country resets the phone number, so we must also reset any errors
|
|
116
|
+
setInvalidNumberMessage(undefined);
|
|
117
|
+
}, [
|
|
118
|
+
currentCountry.iso2,
|
|
119
|
+
filteredCountries,
|
|
120
|
+
setInvalidNumberMessage,
|
|
121
|
+
setSelectedCountry,
|
|
122
|
+
]);
|
|
123
|
+
const handleEnterInput = React.useCallback(() => {
|
|
124
|
+
var _a;
|
|
125
|
+
closeDropdown();
|
|
126
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.select();
|
|
127
|
+
}, [closeDropdown, inputRef]);
|
|
128
|
+
const handleCountryKeyDown = React.useCallback((event) => {
|
|
129
|
+
// When navigating away, close dropdown but don't prevent navigation
|
|
130
|
+
if (event.key === 'Tab')
|
|
131
|
+
return closeDropdown();
|
|
132
|
+
if (event.key === 'ArrowUp' || event.key === 'ArrowDown')
|
|
133
|
+
return handleArrowInput(event);
|
|
134
|
+
if (event.key === 'Enter')
|
|
135
|
+
return handleEnterInput(event);
|
|
136
|
+
}, [closeDropdown, handleArrowInput, handleEnterInput]);
|
|
137
|
+
const handleSubmit = (e) => {
|
|
138
|
+
e.preventDefault();
|
|
139
|
+
const error = checkPhoneNumberForError.checkPhoneNumberForError(phone);
|
|
140
|
+
if (error) {
|
|
141
|
+
setInvalidNumberMessage(t('dyn_login.helper.phone_number_form.invalid_number'));
|
|
142
|
+
onSubmitError === null || onSubmitError === void 0 ? void 0 : onSubmitError();
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
146
|
+
// TODO: maybe engage captcha, then submit to the phone wallet provider
|
|
147
|
+
};
|
|
148
|
+
// =================================================================
|
|
149
|
+
// UTILITIES
|
|
150
|
+
// =================================================================
|
|
151
|
+
// Due to the way react-international-phone works, numberInput always has a value (the dial code),
|
|
152
|
+
// even if it's not visible in the input itself.
|
|
153
|
+
/** Tells whether the phone input has any characters typed into it */
|
|
154
|
+
const hasInput = React.useMemo(() => reactInternationalPhone.removeDialCode({
|
|
155
|
+
charAfterDialCode: '+',
|
|
156
|
+
dialCode: currentCountry.dialCode,
|
|
157
|
+
phone,
|
|
158
|
+
}).length > 0, [currentCountry.dialCode, phone]);
|
|
159
|
+
/** Placeholder based on selected country's format */
|
|
160
|
+
const placeholder = React.useMemo(() => reactInternationalPhone.getActiveFormattingMask({
|
|
161
|
+
country: currentCountry,
|
|
162
|
+
phone: '+00000000',
|
|
163
|
+
}), [currentCountry]);
|
|
164
|
+
/** Ref of the entire form */
|
|
165
|
+
const countriesContainer = React.useRef(null);
|
|
166
|
+
const scrollCountryIntoView = (iso2) => {
|
|
167
|
+
var _a;
|
|
168
|
+
const selectedItem = (_a = countriesContainer.current) === null || _a === void 0 ? void 0 : _a.querySelector('#' + iso2);
|
|
169
|
+
selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.scrollIntoView({
|
|
170
|
+
behavior: 'instant',
|
|
171
|
+
block: 'center',
|
|
172
|
+
inline: 'center',
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
// We pass this as a ref to the countries dropdown. React fires it multiple times, so we throttle
|
|
176
|
+
const onMenuDisplayToggle = useThrottle.useThrottle((menu) => {
|
|
177
|
+
var _a;
|
|
178
|
+
const wasOpen = Boolean(countriesContainer.current);
|
|
179
|
+
const isOpen = Boolean(menu);
|
|
180
|
+
countriesContainer.current = menu;
|
|
181
|
+
// If we receive null that means the menu was closed
|
|
182
|
+
// The rest on the code should only execute when going from hidden to shown
|
|
183
|
+
if (wasOpen || !isOpen)
|
|
184
|
+
return;
|
|
185
|
+
(_a = countryInputRef.current) === null || _a === void 0 ? void 0 : _a.select();
|
|
186
|
+
scrollCountryIntoView(currentCountry.iso2);
|
|
187
|
+
}, MENU_DISPLAY_THROTTLE);
|
|
188
|
+
/** Sets all the state related to country */
|
|
189
|
+
const setCountry = (newCountry) => {
|
|
190
|
+
setCountryInput(newCountry.dialCode);
|
|
191
|
+
setSelectedCountry(newCountry.iso2);
|
|
192
|
+
localStorage.LocalStorage.setToLS(localStorage$1.PHONE_INPUT_DEFAULT_COUNTRY, newCountry.iso2);
|
|
193
|
+
lastValidCountry.current = newCountry;
|
|
194
|
+
// Changing country resets the phone number, so we must also reset any errors
|
|
195
|
+
setInvalidNumberMessage(undefined);
|
|
196
|
+
};
|
|
197
|
+
/** Whether user has provided all the digits of the phone number input */
|
|
198
|
+
const isInputComplete = React.useMemo(() => formattedPhone.length >=
|
|
199
|
+
reactInternationalPhone.getActiveFormattingMask({
|
|
200
|
+
country: currentCountry,
|
|
201
|
+
phone,
|
|
202
|
+
}).length, [currentCountry, formattedPhone.length, phone]);
|
|
203
|
+
/** Override fontsize of country code for larger inputs */
|
|
204
|
+
const countryFontSize = React.useMemo(() => {
|
|
205
|
+
if (countryInput.length > 3)
|
|
206
|
+
return 'var(--dynamic-text-size-body-mini)';
|
|
207
|
+
if (countryInput.length > 2)
|
|
208
|
+
return 'var(--dynamic-text-size-body-small)';
|
|
209
|
+
return 'var(--dynamic-text-size-body-normal)';
|
|
210
|
+
}, [countryInput.length]);
|
|
211
|
+
return {
|
|
212
|
+
closeDropdown,
|
|
213
|
+
countryFontSize,
|
|
214
|
+
countryInput,
|
|
215
|
+
currentCountry,
|
|
216
|
+
filteredCountries,
|
|
217
|
+
formattedPhone,
|
|
218
|
+
handleCountryInput,
|
|
219
|
+
handleCountryKeyDown,
|
|
220
|
+
handlePhoneInput,
|
|
221
|
+
handleSubmit,
|
|
222
|
+
hasInput,
|
|
223
|
+
inputRef,
|
|
224
|
+
isInputComplete,
|
|
225
|
+
onBlurCountry: resetToLastValidCountry,
|
|
226
|
+
onFocusCountry: openDropdown,
|
|
227
|
+
onMenuDisplayToggle,
|
|
228
|
+
openDropdown,
|
|
229
|
+
placeholder,
|
|
230
|
+
setCountry,
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
exports.getDefaultCountry = getDefaultCountry;
|
|
235
|
+
exports.usePhoneInputLogic = usePhoneInputLogic;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ChangeEventHandler, Dispatch, FormEvent, KeyboardEventHandler, RefObject, SetStateAction } from 'react';
|
|
2
|
+
import { ParsedCountry } from 'react-international-phone';
|
|
3
|
+
type UsePhoneLogicProps = {
|
|
4
|
+
countryInputRef: RefObject<HTMLInputElement>;
|
|
5
|
+
setCountryDropdownOpen: Dispatch<SetStateAction<boolean>>;
|
|
6
|
+
setInvalidNumberMessage: Dispatch<SetStateAction<string | undefined>>;
|
|
7
|
+
onSubmit: VoidFunction | undefined;
|
|
8
|
+
onSubmitError: VoidFunction | undefined;
|
|
9
|
+
};
|
|
10
|
+
/** The default country we want to use */
|
|
11
|
+
export declare const getDefaultCountry: () => ParsedCountry | undefined;
|
|
12
|
+
export declare const usePhoneInputLogic: ({ countryInputRef, setCountryDropdownOpen, setInvalidNumberMessage, onSubmit, onSubmitError, }: UsePhoneLogicProps) => {
|
|
13
|
+
closeDropdown: () => void;
|
|
14
|
+
countryFontSize: string;
|
|
15
|
+
countryInput: string;
|
|
16
|
+
currentCountry: ParsedCountry;
|
|
17
|
+
filteredCountries: import("react-international-phone").CountryData[];
|
|
18
|
+
formattedPhone: string;
|
|
19
|
+
handleCountryInput: ChangeEventHandler<HTMLInputElement>;
|
|
20
|
+
handleCountryKeyDown: KeyboardEventHandler<HTMLInputElement>;
|
|
21
|
+
handlePhoneInput: (e: import("react").ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => string;
|
|
22
|
+
handleSubmit: (e: FormEvent<HTMLFormElement>) => void;
|
|
23
|
+
hasInput: boolean;
|
|
24
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
25
|
+
isInputComplete: boolean;
|
|
26
|
+
onBlurCountry: () => void;
|
|
27
|
+
onFocusCountry: () => void;
|
|
28
|
+
onMenuDisplayToggle: (menu: HTMLDivElement | null) => void;
|
|
29
|
+
openDropdown: () => void;
|
|
30
|
+
placeholder: string;
|
|
31
|
+
setCountry: (newCountry: ParsedCountry) => void;
|
|
32
|
+
};
|
|
33
|
+
export {};
|