@openfort/react 0.3.2 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/browsers.js +13 -0
- package/build/assets/browsers.js.map +1 -0
- package/build/assets/chains.js +139 -0
- package/build/assets/chains.js.map +1 -0
- package/build/assets/icons.js +41 -0
- package/build/assets/icons.js.map +1 -0
- package/build/assets/logos.js +173 -0
- package/build/assets/logos.js.map +1 -0
- package/build/assets/wave.js +6 -0
- package/build/assets/wave.js.map +1 -0
- package/build/components/BalanceButton/index.js +89 -0
- package/build/components/BalanceButton/index.js.map +1 -0
- package/build/components/Common/Alert/index.js +10 -0
- package/build/components/Common/Alert/index.js.map +1 -0
- package/build/components/Common/Alert/styles.js +55 -0
- package/build/components/Common/Alert/styles.js.map +1 -0
- package/build/components/Common/Avatar/index.d.ts +11 -3
- package/build/components/Common/Avatar/index.js +100 -0
- package/build/components/Common/Avatar/index.js.map +1 -0
- package/build/components/Common/Avatar/styles.js +59 -0
- package/build/components/Common/Avatar/styles.js.map +1 -0
- package/build/components/Common/BrowserIcon/index.js +28 -0
- package/build/components/Common/BrowserIcon/index.js.map +1 -0
- package/build/components/Common/BrowserIcon/styles.js +20 -0
- package/build/components/Common/BrowserIcon/styles.js.map +1 -0
- package/build/components/Common/Button/index.js +36 -0
- package/build/components/Common/Button/index.js.map +1 -0
- package/build/components/Common/Button/styles.js +302 -0
- package/build/components/Common/Button/styles.js.map +1 -0
- package/build/components/Common/Button/types.d.ts +1 -0
- package/build/components/Common/Chain/index.d.ts +8 -0
- package/build/components/Common/Chain/index.js +38 -0
- package/build/components/Common/Chain/index.js.map +1 -0
- package/build/components/Common/Chain/styles.js +94 -0
- package/build/components/Common/Chain/styles.js.map +1 -0
- package/build/components/Common/ConnectorList/index.js +58 -0
- package/build/components/Common/ConnectorList/index.js.map +1 -0
- package/build/components/Common/ConnectorList/styles.js +324 -0
- package/build/components/Common/ConnectorList/styles.js.map +1 -0
- package/build/components/Common/CopyToClipboard/CopyButton.js +12 -0
- package/build/components/Common/CopyToClipboard/CopyButton.js.map +1 -0
- package/build/components/Common/CopyToClipboard/CopyIcon.js +76 -0
- package/build/components/Common/CopyToClipboard/CopyIcon.js.map +1 -0
- package/build/components/Common/CopyToClipboard/CopyIconButton.js +38 -0
- package/build/components/Common/CopyToClipboard/CopyIconButton.js.map +1 -0
- package/build/components/Common/CopyToClipboard/CopyText.js +26 -0
- package/build/components/Common/CopyToClipboard/CopyText.js.map +1 -0
- package/build/components/Common/CustomQRCode/QRCode.js +60 -0
- package/build/components/Common/CustomQRCode/QRCode.js.map +1 -0
- package/build/components/Common/CustomQRCode/index.js +22 -0
- package/build/components/Common/CustomQRCode/index.js.map +1 -0
- package/build/components/Common/CustomQRCode/styles.js +155 -0
- package/build/components/Common/CustomQRCode/styles.js.map +1 -0
- package/build/components/Common/FitText/index.js +28 -0
- package/build/components/Common/FitText/index.js.map +1 -0
- package/build/components/Common/Input/index.js +17 -0
- package/build/components/Common/Input/index.js.map +1 -0
- package/build/components/Common/Input/styles.js +53 -0
- package/build/components/Common/Input/styles.js.map +1 -0
- package/build/components/Common/LargeButton/index.js +10 -0
- package/build/components/Common/LargeButton/index.js.map +1 -0
- package/build/components/Common/LargeButton/styles.js +69 -0
- package/build/components/Common/LargeButton/styles.js.map +1 -0
- package/build/components/Common/Loading/index.js +96 -0
- package/build/components/Common/Loading/index.js.map +1 -0
- package/build/components/Common/Modal/index.js +272 -0
- package/build/components/Common/Modal/index.js.map +1 -0
- package/build/components/Common/Modal/styles.d.ts +0 -1
- package/build/components/Common/Modal/styles.js +657 -0
- package/build/components/Common/Modal/styles.js.map +1 -0
- package/build/components/Common/OTPInput/index.js +108 -0
- package/build/components/Common/OTPInput/index.js.map +1 -0
- package/build/components/Common/OTPInput/styles.js +153 -0
- package/build/components/Common/OTPInput/styles.js.map +1 -0
- package/build/components/Common/Portal/index.js +31 -0
- package/build/components/Common/Portal/index.js.map +1 -0
- package/build/components/Common/PoweredByFooter/index.js +103 -0
- package/build/components/Common/PoweredByFooter/index.js.map +1 -0
- package/build/components/Common/Providers/ProviderHeader.d.ts +2 -2
- package/build/components/Common/Providers/ProviderHeader.js +55 -0
- package/build/components/Common/Providers/ProviderHeader.js.map +1 -0
- package/build/components/Common/Providers/ProviderIcon.d.ts +2 -2
- package/build/components/Common/Providers/ProviderIcon.js +41 -0
- package/build/components/Common/Providers/ProviderIcon.js.map +1 -0
- package/build/components/Common/Providers/getProviderName.d.ts +1 -1
- package/build/components/Common/Providers/getProviderName.js +15 -0
- package/build/components/Common/Providers/getProviderName.js.map +1 -0
- package/build/components/Common/ScrollArea/index.js +58 -0
- package/build/components/Common/ScrollArea/index.js.map +1 -0
- package/build/components/Common/ScrollArea/styles.js +168 -0
- package/build/components/Common/ScrollArea/styles.js.map +1 -0
- package/build/components/Common/Spinner/index.js +24 -0
- package/build/components/Common/Spinner/index.js.map +1 -0
- package/build/components/Common/Spinner/styles.js +22 -0
- package/build/components/Common/Spinner/styles.js.map +1 -0
- package/build/components/Common/SquircleSpinner/index.js +15 -0
- package/build/components/Common/SquircleSpinner/index.js.map +1 -0
- package/build/components/Common/SquircleSpinner/styles.js +66 -0
- package/build/components/Common/SquircleSpinner/styles.js.map +1 -0
- package/build/components/Common/ThemedButton/index.js +25 -0
- package/build/components/Common/ThemedButton/index.js.map +1 -0
- package/build/components/Common/ThemedButton/styles.js +152 -0
- package/build/components/Common/ThemedButton/styles.js.map +1 -0
- package/build/components/Common/TickList/index.js +11 -0
- package/build/components/Common/TickList/index.js.map +1 -0
- package/build/components/Common/TickList/styles.js +28 -0
- package/build/components/Common/TickList/styles.js.map +1 -0
- package/build/components/Common/Tooltip/index.js +91 -0
- package/build/components/Common/Tooltip/index.js.map +1 -0
- package/build/components/Common/Tooltip/styles.js +81 -0
- package/build/components/Common/Tooltip/styles.js.map +1 -0
- package/build/components/Common/WalletRecoveryIcon/index.d.ts +4 -0
- package/build/components/Common/WalletRecoveryIcon/index.js +19 -0
- package/build/components/Common/WalletRecoveryIcon/index.js.map +1 -0
- package/build/components/ConnectButton/index.d.ts +12 -4
- package/build/components/ConnectButton/index.js +266 -0
- package/build/components/ConnectButton/index.js.map +1 -0
- package/build/components/ConnectButton/styles.js +50 -0
- package/build/components/ConnectButton/styles.js.map +1 -0
- package/build/components/ConnectKitThemeProvider/ConnectKitThemeProvider.js +20 -0
- package/build/components/ConnectKitThemeProvider/ConnectKitThemeProvider.js.map +1 -0
- package/build/components/ConnectModal/ConnectUsing.d.ts +1 -1
- package/build/components/ConnectModal/ConnectUsing.js +68 -0
- package/build/components/ConnectModal/ConnectUsing.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithInjector/CircleSpinner/index.js +17 -0
- package/build/components/ConnectModal/ConnectWithInjector/CircleSpinner/index.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithInjector/CircleSpinner/styles.js +118 -0
- package/build/components/ConnectModal/ConnectWithInjector/CircleSpinner/styles.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithInjector/index.d.ts +0 -2
- package/build/components/ConnectModal/ConnectWithInjector/index.js +295 -0
- package/build/components/ConnectModal/ConnectWithInjector/index.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithInjector/styles.js +133 -0
- package/build/components/ConnectModal/ConnectWithInjector/styles.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithMobile.js +99 -0
- package/build/components/ConnectModal/ConnectWithMobile.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithOAuth.js +128 -0
- package/build/components/ConnectModal/ConnectWithOAuth.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithQRCode.js +78 -0
- package/build/components/ConnectModal/ConnectWithQRCode.js.map +1 -0
- package/build/components/ConnectModal/index.js +227 -0
- package/build/components/ConnectModal/index.js.map +1 -0
- package/build/components/FloatingGraphic/index.js +13 -0
- package/build/components/FloatingGraphic/index.js.map +1 -0
- package/build/components/FloatingGraphic/styles.js +175 -0
- package/build/components/FloatingGraphic/styles.js.map +1 -0
- package/build/components/Openfort/OpenfortProvider.d.ts +10 -25
- package/build/components/Openfort/OpenfortProvider.js +351 -0
- package/build/components/Openfort/OpenfortProvider.js.map +1 -0
- package/build/components/Openfort/context.d.ts +48 -5
- package/build/components/Openfort/context.js +7 -0
- package/build/components/Openfort/context.js.map +1 -0
- package/build/components/Openfort/routeHelpers.d.ts +5 -0
- package/build/components/Openfort/routeHelpers.js +20 -0
- package/build/components/Openfort/routeHelpers.js.map +1 -0
- package/build/components/Openfort/types.d.ts +57 -23
- package/build/components/Openfort/types.js +119 -0
- package/build/components/Openfort/types.js.map +1 -0
- package/build/components/Openfort/useOpenfort.d.ts +2 -0
- package/build/components/Openfort/useOpenfort.js +12 -0
- package/build/components/Openfort/useOpenfort.js.map +1 -0
- package/build/components/PageContent/index.js +55 -0
- package/build/components/PageContent/index.js.map +1 -0
- package/build/components/PageContent/styles.js +11 -0
- package/build/components/PageContent/styles.js.map +1 -0
- package/build/components/Pages/About/graphics.js +193 -0
- package/build/components/Pages/About/graphics.js.map +1 -0
- package/build/components/Pages/About/index.js +142 -0
- package/build/components/Pages/About/index.js.map +1 -0
- package/build/components/Pages/About/styles.js +142 -0
- package/build/components/Pages/About/styles.js.map +1 -0
- package/build/components/Pages/AssetInventory/index.js +66 -0
- package/build/components/Pages/AssetInventory/index.js.map +1 -0
- package/build/components/Pages/Buy/coinbaseApi.js +106 -0
- package/build/components/Pages/Buy/coinbaseApi.js.map +1 -0
- package/build/components/Pages/Buy/index.js +88 -0
- package/build/components/Pages/Buy/index.js.map +1 -0
- package/build/components/Pages/Buy/onrampApi.js +57 -0
- package/build/components/Pages/Buy/onrampApi.js.map +1 -0
- package/build/components/Pages/Buy/providers.js +39 -0
- package/build/components/Pages/Buy/providers.js.map +1 -0
- package/build/components/Pages/Buy/stripeApi.js +74 -0
- package/build/components/Pages/Buy/stripeApi.js.map +1 -0
- package/build/components/Pages/Buy/styles.js +230 -0
- package/build/components/Pages/Buy/styles.js.map +1 -0
- package/build/components/Pages/Buy/utils.js +71 -0
- package/build/components/Pages/Buy/utils.js.map +1 -0
- package/build/components/Pages/BuyComplete/index.js +47 -0
- package/build/components/Pages/BuyComplete/index.js.map +1 -0
- package/build/components/Pages/BuyProcessing/index.js +231 -0
- package/build/components/Pages/BuyProcessing/index.js.map +1 -0
- package/build/components/Pages/BuyProviderSelect/index.js +55 -0
- package/build/components/Pages/BuyProviderSelect/index.js.map +1 -0
- package/build/components/Pages/BuyProviderSelect/styles.js +103 -0
- package/build/components/Pages/BuyProviderSelect/styles.js.map +1 -0
- package/build/components/Pages/BuySelectProvider/index.js +245 -0
- package/build/components/Pages/BuySelectProvider/index.js.map +1 -0
- package/build/components/Pages/Connected/ConnectedPageLayout.d.ts +22 -0
- package/build/components/Pages/Connected/ConnectedPageLayout.js +11 -0
- package/build/components/Pages/Connected/ConnectedPageLayout.js.map +1 -0
- package/build/components/Pages/Connected/EthereumConnected.d.ts +3 -0
- package/build/components/Pages/Connected/EthereumConnected.js +133 -0
- package/build/components/Pages/Connected/EthereumConnected.js.map +1 -0
- package/build/components/Pages/Connected/SolanaConnected.d.ts +3 -0
- package/build/components/Pages/Connected/SolanaConnected.js +96 -0
- package/build/components/Pages/Connected/SolanaConnected.js.map +1 -0
- package/build/components/Pages/Connected/index.d.ts +2 -2
- package/build/components/Pages/Connected/index.js +18 -0
- package/build/components/Pages/Connected/index.js.map +1 -0
- package/build/components/Pages/Connected/styles.js +122 -0
- package/build/components/Pages/Connected/styles.js.map +1 -0
- package/build/components/Pages/ConnectedSuccess/index.js +19 -0
- package/build/components/Pages/ConnectedSuccess/index.js.map +1 -0
- package/build/components/Pages/Connectors/index.js +73 -0
- package/build/components/Pages/Connectors/index.js.map +1 -0
- package/build/components/Pages/CreateGuestUserPage/index.js +28 -0
- package/build/components/Pages/CreateGuestUserPage/index.js.map +1 -0
- package/build/components/Pages/CreateWallet/SolanaCreateWallet.d.ts +6 -0
- package/build/components/Pages/CreateWallet/SolanaCreateWallet.js +241 -0
- package/build/components/Pages/CreateWallet/SolanaCreateWallet.js.map +1 -0
- package/build/components/Pages/CreateWallet/index.js +303 -0
- package/build/components/Pages/CreateWallet/index.js.map +1 -0
- package/build/components/Pages/CreateWallet/styles.js +17 -0
- package/build/components/Pages/CreateWallet/styles.js.map +1 -0
- package/build/components/Pages/DownloadApp/index.js +32 -0
- package/build/components/Pages/DownloadApp/index.js.map +1 -0
- package/build/components/Pages/EmailLogin/index.js +118 -0
- package/build/components/Pages/EmailLogin/index.js.map +1 -0
- package/build/components/Pages/EmailLogin/styles.js +24 -0
- package/build/components/Pages/EmailLogin/styles.js.map +1 -0
- package/build/components/Pages/EmailOTP/index.js +116 -0
- package/build/components/Pages/EmailOTP/index.js.map +1 -0
- package/build/components/Pages/EmailOTP/styles.js +38 -0
- package/build/components/Pages/EmailOTP/styles.js.map +1 -0
- package/build/components/Pages/EmailVerification/index.js +86 -0
- package/build/components/Pages/EmailVerification/index.js.map +1 -0
- package/build/components/Pages/ExportKey/index.js +44 -0
- package/build/components/Pages/ExportKey/index.js.map +1 -0
- package/build/components/Pages/ForgotPassword/index.js +129 -0
- package/build/components/Pages/ForgotPassword/index.js.map +1 -0
- package/build/components/Pages/LinkEmail/index.js +63 -0
- package/build/components/Pages/LinkEmail/index.js.map +1 -0
- package/build/components/Pages/LinkedProvider/index.d.ts +3 -0
- package/build/components/Pages/LinkedProvider/index.js +90 -0
- package/build/components/Pages/LinkedProvider/index.js.map +1 -0
- package/build/components/Pages/LinkedProviders/index.js +45 -0
- package/build/components/Pages/LinkedProviders/index.js.map +1 -0
- package/build/components/Pages/LinkedProviders/styles.js +51 -0
- package/build/components/Pages/LinkedProviders/styles.js.map +1 -0
- package/build/components/Pages/LoadWallets/index.js +91 -0
- package/build/components/Pages/LoadWallets/index.js.map +1 -0
- package/build/components/Pages/Loading/index.js +61 -0
- package/build/components/Pages/Loading/index.js.map +1 -0
- package/build/components/Pages/MobileConnectors/index.js +71 -0
- package/build/components/Pages/MobileConnectors/index.js.map +1 -0
- package/build/components/Pages/MobileConnectors/styles.js +65 -0
- package/build/components/Pages/MobileConnectors/styles.js.map +1 -0
- package/build/components/Pages/NoAssetsAvailable/index.js +45 -0
- package/build/components/Pages/NoAssetsAvailable/index.js.map +1 -0
- package/build/components/Pages/NoAssetsAvailable/styles.js +10 -0
- package/build/components/Pages/NoAssetsAvailable/styles.js.map +1 -0
- package/build/components/Pages/Onboarding/index.js +20 -0
- package/build/components/Pages/Onboarding/index.js.map +1 -0
- package/build/components/Pages/PhoneOTP/index.js +128 -0
- package/build/components/Pages/PhoneOTP/index.js.map +1 -0
- package/build/components/Pages/PhoneOTP/styles.js +38 -0
- package/build/components/Pages/PhoneOTP/styles.js.map +1 -0
- package/build/components/Pages/Profile/index.js +35 -0
- package/build/components/Pages/Profile/index.js.map +1 -0
- package/build/components/Pages/Providers/index.js +157 -0
- package/build/components/Pages/Providers/index.js.map +1 -0
- package/build/components/Pages/Providers/styles.js +156 -0
- package/build/components/Pages/Providers/styles.js.map +1 -0
- package/build/components/Pages/Receive/index.js +61 -0
- package/build/components/Pages/Receive/index.js.map +1 -0
- package/build/components/Pages/Receive/styles.d.ts +1 -0
- package/build/components/Pages/Receive/styles.js +52 -0
- package/build/components/Pages/Receive/styles.js.map +1 -0
- package/build/components/Pages/Recover/index.js +252 -0
- package/build/components/Pages/Recover/index.js.map +1 -0
- package/build/components/Pages/Recover/recoveryRegistry.d.ts +32 -0
- package/build/components/Pages/Recover/recoveryRegistry.js +61 -0
- package/build/components/Pages/Recover/recoveryRegistry.js.map +1 -0
- package/build/components/Pages/RemoveLinkedProvider/index.js +104 -0
- package/build/components/Pages/RemoveLinkedProvider/index.js.map +1 -0
- package/build/components/Pages/SelectToken/index.js +102 -0
- package/build/components/Pages/SelectToken/index.js.map +1 -0
- package/build/components/Pages/SelectToken/styles.js +78 -0
- package/build/components/Pages/SelectToken/styles.js.map +1 -0
- package/build/components/Pages/SelectWalletToRecover/index.d.ts +1 -2
- package/build/components/Pages/SelectWalletToRecover/index.js +70 -0
- package/build/components/Pages/SelectWalletToRecover/index.js.map +1 -0
- package/build/components/Pages/Send/EthereumSend.d.ts +1 -0
- package/build/components/Pages/Send/EthereumSend.js +88 -0
- package/build/components/Pages/Send/EthereumSend.js.map +1 -0
- package/build/components/Pages/Send/index.d.ts +7 -1
- package/build/components/Pages/Send/index.js +17 -0
- package/build/components/Pages/Send/index.js.map +1 -0
- package/build/components/Pages/Send/styles.js +112 -0
- package/build/components/Pages/Send/styles.js.map +1 -0
- package/build/components/Pages/Send/utils.d.ts +1 -1
- package/build/components/Pages/Send/utils.js +63 -0
- package/build/components/Pages/Send/utils.js.map +1 -0
- package/build/components/Pages/SendConfirmation/EstimatedFees.js +66 -0
- package/build/components/Pages/SendConfirmation/EstimatedFees.js.map +1 -0
- package/build/components/Pages/SendConfirmation/index.js +331 -0
- package/build/components/Pages/SendConfirmation/index.js.map +1 -0
- package/build/components/Pages/SendConfirmation/styles.js +129 -0
- package/build/components/Pages/SendConfirmation/styles.js.map +1 -0
- package/build/components/Pages/SocialProviders/index.js +15 -0
- package/build/components/Pages/SocialProviders/index.js.map +1 -0
- package/build/components/PasswordStrength/PasswordStrengthIndicator.js +62 -0
- package/build/components/PasswordStrength/PasswordStrengthIndicator.js.map +1 -0
- package/build/components/PasswordStrength/password-utility.js +128 -0
- package/build/components/PasswordStrength/password-utility.js.map +1 -0
- package/build/constants/chainConfigs.js +316 -0
- package/build/constants/chainConfigs.js.map +1 -0
- package/build/constants/defaultTheme.js +6 -0
- package/build/constants/defaultTheme.js.map +1 -0
- package/build/constants/openfort.d.ts +4 -0
- package/build/constants/openfort.js +8 -0
- package/build/constants/openfort.js.map +1 -0
- package/build/core/ConnectionStrategy.d.ts +31 -0
- package/build/core/ConnectionStrategy.js +9 -0
- package/build/core/ConnectionStrategy.js.map +1 -0
- package/build/core/ConnectionStrategyContext.d.ts +16 -0
- package/build/core/ConnectionStrategyContext.js +22 -0
- package/build/core/ConnectionStrategyContext.js.map +1 -0
- package/build/core/errors.d.ts +1 -0
- package/build/core/strategies/EthereumBridgeStrategy.d.ts +11 -0
- package/build/core/strategies/EthereumBridgeStrategy.js +83 -0
- package/build/core/strategies/EthereumBridgeStrategy.js.map +1 -0
- package/build/core/strategies/EthereumEmbeddedStrategy.d.ts +8 -0
- package/build/core/strategies/EthereumEmbeddedStrategy.js +85 -0
- package/build/core/strategies/EthereumEmbeddedStrategy.js.map +1 -0
- package/build/core/strategies/SolanaEmbeddedStrategy.d.ts +9 -0
- package/build/core/strategies/SolanaEmbeddedStrategy.js +53 -0
- package/build/core/strategies/SolanaEmbeddedStrategy.js.map +1 -0
- package/build/core/strategyUtils.d.ts +6 -0
- package/build/core/strategyUtils.js +31 -0
- package/build/core/strategyUtils.js.map +1 -0
- package/build/ethereum/OpenfortEthereumBridgeContext.d.ts +87 -0
- package/build/ethereum/OpenfortEthereumBridgeContext.js +18 -0
- package/build/ethereum/OpenfortEthereumBridgeContext.js.map +1 -0
- package/build/ethereum/hooks/getEmbeddedWalletClient.d.ts +14 -0
- package/build/ethereum/hooks/getEmbeddedWalletClient.js +24 -0
- package/build/ethereum/hooks/getEmbeddedWalletClient.js.map +1 -0
- package/build/ethereum/hooks/useEthereumEmbeddedWallet.d.ts +17 -0
- package/build/ethereum/hooks/useEthereumEmbeddedWallet.js +425 -0
- package/build/ethereum/hooks/useEthereumEmbeddedWallet.js.map +1 -0
- package/build/ethereum/hooks/useEthereumWalletAssets.d.ts +29 -0
- package/build/ethereum/hooks/useEthereumWalletAssets.js +204 -0
- package/build/ethereum/hooks/useEthereumWalletAssets.js.map +1 -0
- package/build/ethereum/index.d.ts +11 -0
- package/build/ethereum/index.js +3 -0
- package/build/ethereum/index.js.map +1 -0
- package/build/ethereum/types.d.ts +140 -0
- package/build/hooks/openfort/auth/requestEmailVerification.js +21 -0
- package/build/hooks/openfort/auth/requestEmailVerification.js.map +1 -0
- package/build/hooks/openfort/auth/status.js +11 -0
- package/build/hooks/openfort/auth/status.js.map +1 -0
- package/build/hooks/openfort/auth/useAuthCallback.d.ts +2 -1
- package/build/hooks/openfort/auth/useAuthCallback.js +197 -0
- package/build/hooks/openfort/auth/useAuthCallback.js.map +1 -0
- package/build/hooks/openfort/auth/useConnectToWalletPostAuth.d.ts +2 -2
- package/build/hooks/openfort/auth/useConnectToWalletPostAuth.js +161 -0
- package/build/hooks/openfort/auth/useConnectToWalletPostAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useEmailAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/useEmailAuth.js +496 -0
- package/build/hooks/openfort/auth/useEmailAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useEmailOtpAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/useEmailOtpAuth.js +151 -0
- package/build/hooks/openfort/auth/useEmailOtpAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useGuestAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/useGuestAuth.js +142 -0
- package/build/hooks/openfort/auth/useGuestAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useOAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/useOAuth.js +217 -0
- package/build/hooks/openfort/auth/useOAuth.js.map +1 -0
- package/build/hooks/openfort/auth/usePhoneOtpAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/usePhoneOtpAuth.js +174 -0
- package/build/hooks/openfort/auth/usePhoneOtpAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useSignOut.d.ts +2 -1
- package/build/hooks/openfort/auth/useSignOut.js +104 -0
- package/build/hooks/openfort/auth/useSignOut.js.map +1 -0
- package/build/hooks/openfort/hookConsistency.js +17 -0
- package/build/hooks/openfort/hookConsistency.js.map +1 -0
- package/build/hooks/openfort/use7702Authorization.js +73 -0
- package/build/hooks/openfort/use7702Authorization.js.map +1 -0
- package/build/hooks/openfort/useGrantPermissions.d.ts +7 -76
- package/build/hooks/openfort/useGrantPermissions.js +221 -0
- package/build/hooks/openfort/useGrantPermissions.js.map +1 -0
- package/build/hooks/openfort/useProviders.js +75 -0
- package/build/hooks/openfort/useProviders.js.map +1 -0
- package/build/hooks/openfort/useRevokePermissions.d.ts +2 -1
- package/build/hooks/openfort/useRevokePermissions.js +126 -0
- package/build/hooks/openfort/useRevokePermissions.js.map +1 -0
- package/build/hooks/openfort/useUI.d.ts +4 -45
- package/build/hooks/openfort/useUI.js +122 -0
- package/build/hooks/openfort/useUI.js.map +1 -0
- package/build/hooks/openfort/useUser.d.ts +12 -35
- package/build/hooks/openfort/useUser.js +61 -0
- package/build/hooks/openfort/useUser.js.map +1 -0
- package/build/hooks/openfort/walletTypes.d.ts +32 -0
- package/build/hooks/openfort/walletTypes.js +53 -0
- package/build/hooks/openfort/walletTypes.js.map +1 -0
- package/build/hooks/useBalance.d.ts +50 -0
- package/build/hooks/useBalance.js +80 -0
- package/build/hooks/useBalance.js.map +1 -0
- package/build/hooks/useConnectLifecycle.d.ts +7 -0
- package/build/hooks/useConnectLifecycle.js +43 -0
- package/build/hooks/useConnectLifecycle.js.map +1 -0
- package/build/hooks/useConnectors.d.ts +3 -5
- package/build/hooks/useConnectors.js +26 -0
- package/build/hooks/useConnectors.js.map +1 -0
- package/build/hooks/useCopyToClipboard.js +29 -0
- package/build/hooks/useCopyToClipboard.js.map +1 -0
- package/build/hooks/useFitText.js +125 -0
- package/build/hooks/useFitText.js.map +1 -0
- package/build/hooks/useFocusTrap.d.ts +4 -1
- package/build/hooks/useFocusTrap.js +60 -0
- package/build/hooks/useFocusTrap.js.map +1 -0
- package/build/hooks/useGoogleFont.js +43 -0
- package/build/hooks/useGoogleFont.js.map +1 -0
- package/build/hooks/useIsMobile.js +17 -0
- package/build/hooks/useIsMobile.js.map +1 -0
- package/build/hooks/useIsMounted.js +10 -0
- package/build/hooks/useIsMounted.js.map +1 -0
- package/build/hooks/useLastConnector.js +39 -0
- package/build/hooks/useLastConnector.js.map +1 -0
- package/build/hooks/useLocales.d.ts +1 -1
- package/build/hooks/useLocales.js +68 -0
- package/build/hooks/useLocales.js.map +1 -0
- package/build/hooks/useLockBodyScroll.js +53 -0
- package/build/hooks/useLockBodyScroll.js.map +1 -0
- package/build/hooks/usePrevious.js +14 -0
- package/build/hooks/usePrevious.js.map +1 -0
- package/build/hooks/useResolvedIdentity.d.ts +70 -0
- package/build/hooks/useResolvedIdentity.js +90 -0
- package/build/hooks/useResolvedIdentity.js.map +1 -0
- package/build/hooks/useRouteProps.d.ts +10 -5
- package/build/hooks/useRouteProps.js +27 -0
- package/build/hooks/useRouteProps.js.map +1 -0
- package/build/hooks/useWalletConnectModal.js +59 -0
- package/build/hooks/useWalletConnectModal.js.map +1 -0
- package/build/hooks/useWindowSize.js +23 -0
- package/build/hooks/useWindowSize.js.map +1 -0
- package/build/index.d.ts +61 -16
- package/build/index.js +31 -0
- package/build/index.js.map +1 -0
- package/build/localizations/index.js +57 -0
- package/build/localizations/index.js.map +1 -0
- package/build/localizations/locales/ar-AE.js +100 -0
- package/build/localizations/locales/ar-AE.js.map +1 -0
- package/build/localizations/locales/ca-AD.js +98 -0
- package/build/localizations/locales/ca-AD.js.map +1 -0
- package/build/localizations/locales/ee-EE.js +98 -0
- package/build/localizations/locales/ee-EE.js.map +1 -0
- package/build/localizations/locales/en-US.js +115 -0
- package/build/localizations/locales/en-US.js.map +1 -0
- package/build/localizations/locales/es-ES.js +98 -0
- package/build/localizations/locales/es-ES.js.map +1 -0
- package/build/localizations/locales/fa-IR.js +98 -0
- package/build/localizations/locales/fa-IR.js.map +1 -0
- package/build/localizations/locales/fr-FR.js +98 -0
- package/build/localizations/locales/fr-FR.js.map +1 -0
- package/build/localizations/locales/ja-JP.js +98 -0
- package/build/localizations/locales/ja-JP.js.map +1 -0
- package/build/localizations/locales/pt-BR.js +98 -0
- package/build/localizations/locales/pt-BR.js.map +1 -0
- package/build/localizations/locales/ru-RU.js +98 -0
- package/build/localizations/locales/ru-RU.js.map +1 -0
- package/build/localizations/locales/tr-TR.js +98 -0
- package/build/localizations/locales/tr-TR.js.map +1 -0
- package/build/localizations/locales/vi-VN.js +98 -0
- package/build/localizations/locales/vi-VN.js.map +1 -0
- package/build/localizations/locales/zh-CN.js +98 -0
- package/build/localizations/locales/zh-CN.js.map +1 -0
- package/build/openfort/CoreOpenfortProvider.d.ts +9 -22
- package/build/openfort/CoreOpenfortProvider.js +389 -0
- package/build/openfort/CoreOpenfortProvider.js.map +1 -0
- package/build/{hooks/useConnectCallback.d.ts → openfort/connectCallbackTypes.d.ts} +2 -2
- package/build/openfort/context.d.ts +3 -2
- package/build/openfort/context.js +6 -0
- package/build/openfort/context.js.map +1 -0
- package/build/openfort/core/client.d.ts +2 -1
- package/build/openfort/core/client.js +23 -0
- package/build/openfort/core/client.js.map +1 -0
- package/build/openfort/hooks/useActiveAddressSync.d.ts +20 -0
- package/build/openfort/hooks/useActiveAddressSync.js +76 -0
- package/build/openfort/hooks/useActiveAddressSync.js.map +1 -0
- package/build/openfort/hooks/useAutoRecovery.d.ts +26 -0
- package/build/openfort/hooks/useAutoRecovery.js +102 -0
- package/build/openfort/hooks/useAutoRecovery.js.map +1 -0
- package/build/openfort/hooks/useEmbeddedStateMachine.d.ts +31 -0
- package/build/openfort/hooks/useEmbeddedStateMachine.js +77 -0
- package/build/openfort/hooks/useEmbeddedStateMachine.js.map +1 -0
- package/build/openfort/selectors.d.ts +9 -0
- package/build/openfort/selectors.js +15 -0
- package/build/openfort/selectors.js.map +1 -0
- package/build/openfort/store.d.ts +46 -0
- package/build/openfort/store.js +116 -0
- package/build/openfort/store.js.map +1 -0
- package/build/openfort/useOpenfort.d.ts +9 -3
- package/build/openfort/useOpenfort.js +15 -0
- package/build/openfort/useOpenfort.js.map +1 -0
- package/build/openfort/useOpenfortStore.d.ts +2 -0
- package/build/openfort/useOpenfortStore.js +13 -0
- package/build/openfort/useOpenfortStore.js.map +1 -0
- package/build/query/index.d.ts +2 -0
- package/build/query/queryKeys.d.ts +12 -0
- package/build/query/queryKeys.js +15 -0
- package/build/query/queryKeys.js.map +1 -0
- package/build/query/queryOptions.d.ts +23 -0
- package/build/query/queryOptions.js +31 -0
- package/build/query/queryOptions.js.map +1 -0
- package/build/shared/hooks/useAsyncData.d.ts +19 -0
- package/build/shared/hooks/useAsyncData.js +69 -0
- package/build/shared/hooks/useAsyncData.js.map +1 -0
- package/build/shared/hooks/useRecoveryOTP.d.ts +11 -0
- package/build/shared/hooks/useRecoveryOTP.js +64 -0
- package/build/shared/hooks/useRecoveryOTP.js.map +1 -0
- package/build/shared/types.d.ts +65 -0
- package/build/shared/utils/embeddedWalletStatusMapper.d.ts +15 -0
- package/build/shared/utils/embeddedWalletStatusMapper.js +22 -0
- package/build/shared/utils/embeddedWalletStatusMapper.js.map +1 -0
- package/build/shared/utils/explorer.d.ts +24 -0
- package/build/shared/utils/explorer.js +71 -0
- package/build/shared/utils/explorer.js.map +1 -0
- package/build/shared/utils/otpError.d.ts +8 -0
- package/build/shared/utils/otpError.js +17 -0
- package/build/shared/utils/otpError.js.map +1 -0
- package/build/shared/utils/recovery.d.ts +15 -0
- package/build/shared/utils/recovery.js +96 -0
- package/build/shared/utils/recovery.js.map +1 -0
- package/build/shared/utils/walletStatusProps.d.ts +18 -0
- package/build/shared/utils/walletStatusProps.js +45 -0
- package/build/shared/utils/walletStatusProps.js.map +1 -0
- package/build/siwe/create-siwe-message.d.ts +15 -1
- package/build/siwe/create-siwe-message.js +32 -0
- package/build/siwe/create-siwe-message.js.map +1 -0
- package/build/solana/SolanaContext.d.ts +43 -0
- package/build/solana/SolanaContext.js +87 -0
- package/build/solana/SolanaContext.js.map +1 -0
- package/build/solana/hooks/recoveryResolver.d.ts +16 -0
- package/build/solana/hooks/recoveryResolver.js +39 -0
- package/build/solana/hooks/recoveryResolver.js.map +1 -0
- package/build/solana/hooks/useSolanaEmbeddedWallet.d.ts +17 -0
- package/build/solana/hooks/useSolanaEmbeddedWallet.js +389 -0
- package/build/solana/hooks/useSolanaEmbeddedWallet.js.map +1 -0
- package/build/solana/hooks/utils.d.ts +1 -0
- package/build/solana/hooks/utils.js +10 -0
- package/build/solana/hooks/utils.js.map +1 -0
- package/build/solana/index.d.ts +12 -0
- package/build/solana/index.js +2 -0
- package/build/solana/index.js.map +1 -0
- package/build/solana/operations.d.ts +22 -0
- package/build/solana/operations.js +40 -0
- package/build/solana/operations.js.map +1 -0
- package/build/solana/provider.d.ts +131 -0
- package/build/solana/provider.js +126 -0
- package/build/solana/provider.js.map +1 -0
- package/build/solana/types.d.ts +253 -0
- package/build/styles/index.js +334 -0
- package/build/styles/index.js.map +1 -0
- package/build/styles/styled/index.js +14 -0
- package/build/styles/styled/index.js.map +1 -0
- package/build/styles/themes/base.js +147 -0
- package/build/styles/themes/base.js.map +1 -0
- package/build/styles/themes/index.js +13 -0
- package/build/styles/themes/index.js.map +1 -0
- package/build/styles/themes/midnight.js +78 -0
- package/build/styles/themes/midnight.js.map +1 -0
- package/build/styles/themes/minimal.js +100 -0
- package/build/styles/themes/minimal.js.map +1 -0
- package/build/styles/themes/nouns.js +83 -0
- package/build/styles/themes/nouns.js.map +1 -0
- package/build/styles/themes/retro.js +110 -0
- package/build/styles/themes/retro.js.map +1 -0
- package/build/styles/themes/rounded.js +110 -0
- package/build/styles/themes/rounded.js.map +1 -0
- package/build/styles/themes/soft.js +73 -0
- package/build/styles/themes/soft.js.map +1 -0
- package/build/styles/themes/web95.js +136 -0
- package/build/styles/themes/web95.js.map +1 -0
- package/build/types.d.ts +5 -6
- package/build/types.js +33 -0
- package/build/types.js.map +1 -0
- package/build/utils/banner.d.ts +1 -0
- package/build/utils/banner.js +14 -0
- package/build/utils/banner.js.map +1 -0
- package/build/utils/errorHandling.js +331 -0
- package/build/utils/errorHandling.js.map +1 -0
- package/build/utils/format.d.ts +18 -0
- package/build/utils/format.js +59 -0
- package/build/utils/format.js.map +1 -0
- package/build/utils/index.d.ts +2 -3
- package/build/utils/index.js +67 -0
- package/build/utils/index.js.map +1 -0
- package/build/utils/logger.js +13 -0
- package/build/utils/logger.js.map +1 -0
- package/build/utils/oauthErrorHandler.d.ts +1 -1
- package/build/utils/oauthErrorHandler.js +42 -0
- package/build/utils/oauthErrorHandler.js.map +1 -0
- package/build/utils/p3.js +14 -0
- package/build/utils/p3.js.map +1 -0
- package/build/utils/rpc.d.ts +34 -0
- package/build/utils/rpc.js +93 -0
- package/build/utils/rpc.js.map +1 -0
- package/build/utils/useOnUserReturn.js +25 -0
- package/build/utils/useOnUserReturn.js.map +1 -0
- package/build/utils/validation.js +7 -0
- package/build/utils/validation.js.map +1 -0
- package/build/utils/wallets.d.ts +6 -0
- package/build/utils/wallets.js +14 -0
- package/build/utils/wallets.js.map +1 -0
- package/build/version.d.ts +1 -1
- package/build/version.js +4 -0
- package/build/version.js.map +1 -0
- package/build/wagmi/OpenfortWagmiBridge.d.ts +3 -0
- package/build/wagmi/OpenfortWagmiBridge.js +166 -0
- package/build/wagmi/OpenfortWagmiBridge.js.map +1 -0
- package/build/wagmi/components/ChainSelect/index.js +140 -0
- package/build/wagmi/components/ChainSelect/index.js.map +1 -0
- package/build/wagmi/components/ChainSelectDropdown/index.js +144 -0
- package/build/wagmi/components/ChainSelectDropdown/index.js.map +1 -0
- package/build/wagmi/components/ChainSelectDropdown/styles.js +47 -0
- package/build/wagmi/components/ChainSelectDropdown/styles.js.map +1 -0
- package/build/wagmi/components/ChainSelectList/index.js +109 -0
- package/build/wagmi/components/ChainSelectList/index.js.map +1 -0
- package/build/wagmi/components/ChainSelectList/styles.js +225 -0
- package/build/wagmi/components/ChainSelectList/styles.js.map +1 -0
- package/build/wagmi/components/SwitchNetworks/index.js +22 -0
- package/build/wagmi/components/SwitchNetworks/index.js.map +1 -0
- package/build/wagmi/connectorFilter.d.ts +6 -0
- package/build/wagmi/connectorFilter.js +16 -0
- package/build/wagmi/connectorFilter.js.map +1 -0
- package/build/{defaultConfig.d.ts → wagmi/defaultConfig.d.ts} +1 -2
- package/build/wagmi/defaultConfig.js +27 -0
- package/build/wagmi/defaultConfig.js.map +1 -0
- package/build/wagmi/defaultConnectors.js +36 -0
- package/build/wagmi/defaultConnectors.js.map +1 -0
- package/build/wagmi/embeddedConnector.d.ts +4 -0
- package/build/wagmi/embeddedConnector.js +80 -0
- package/build/wagmi/embeddedConnector.js.map +1 -0
- package/build/wagmi/index.d.ts +10 -0
- package/build/wagmi/index.js +10 -0
- package/build/wagmi/index.js.map +1 -0
- package/build/wagmi/useChainIsSupported.d.ts +20 -0
- package/build/wagmi/useChainIsSupported.js +30 -0
- package/build/wagmi/useChainIsSupported.js.map +1 -0
- package/build/wagmi/useChains.d.ts +29 -0
- package/build/wagmi/useChains.js +38 -0
- package/build/wagmi/useChains.js.map +1 -0
- package/build/wagmi/useConnectWithSiwe.d.ts +22 -0
- package/build/wagmi/useConnectWithSiwe.js +115 -0
- package/build/wagmi/useConnectWithSiwe.js.map +1 -0
- package/build/wagmi/useEmbeddedWalletWagmiSync.d.ts +2 -0
- package/build/wagmi/useEmbeddedWalletWagmiSync.js +55 -0
- package/build/wagmi/useEmbeddedWalletWagmiSync.js.map +1 -0
- package/build/wagmi/useWalletAuth.d.ts +24 -0
- package/build/wagmi/useWalletAuth.js +180 -0
- package/build/wagmi/useWalletAuth.js.map +1 -0
- package/build/wallets/useExternalConnectors.d.ts +17 -0
- package/build/wallets/useExternalConnectors.js +98 -0
- package/build/wallets/useExternalConnectors.js.map +1 -0
- package/build/wallets/walletConfigs.js +344 -0
- package/build/wallets/walletConfigs.js.map +1 -0
- package/package.json +62 -11
- package/build/components/PageLayout/index.d.ts +0 -6
- package/build/components/contexts/web3/index.d.ts +0 -13
- package/build/constants/erc20.d.ts +0 -42
- package/build/hooks/openfort/auth/useWalletAuth.d.ts +0 -20
- package/build/hooks/openfort/useConnectWithSiwe.d.ts +0 -8
- package/build/hooks/openfort/useWalletAssets.d.ts +0 -16
- package/build/hooks/openfort/useWallets.d.ts +0 -134
- package/build/hooks/useChainIsSupported.d.ts +0 -24
- package/build/hooks/useChains.d.ts +0 -41
- package/build/hooks/useConnect.d.ts +0 -24
- package/build/hooks/useEnsFallbackConfig.d.ts +0 -1
- package/build/index.es.js +0 -19627
- package/build/index.es.js.map +0 -1
- package/build/openfortCustomTypes.d.ts +0 -10
- package/build/wallets/index.d.ts +0 -7
- package/build/wallets/useWagmiWallets.d.ts +0 -9
- /package/build/components/Pages/{SoicalProviders → SocialProviders}/index.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelect/index.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelectDropdown/index.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelectDropdown/styles.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelectList/index.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelectList/styles.d.ts +0 -0
- /package/build/{components/Pages → wagmi/components}/SwitchNetworks/index.d.ts +0 -0
- /package/build/{defaultConnectors.d.ts → wagmi/defaultConnectors.d.ts} +0 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { OAuthProvider, ChainTypeEnum } from '@openfort/openfort-js';
|
|
3
|
+
import { AnimatePresence, motion } from 'framer-motion';
|
|
4
|
+
import { useMemo, useEffect } from 'react';
|
|
5
|
+
import { PhoneInput } from 'react-international-phone';
|
|
6
|
+
import { GuestIcon, PhoneIcon, EmailIcon } from '../../../assets/icons.js';
|
|
7
|
+
import Logos, { providersLogos, OtherSocials } from '../../../assets/logos.js';
|
|
8
|
+
import { useEthereumEmbeddedWallet } from '../../../ethereum/hooks/useEthereumEmbeddedWallet.js';
|
|
9
|
+
import { useProviders } from '../../../hooks/openfort/useProviders.js';
|
|
10
|
+
import { useOpenfortCore } from '../../../openfort/useOpenfort.js';
|
|
11
|
+
import { useSolanaEmbeddedWallet } from '../../../solana/hooks/useSolanaEmbeddedWallet.js';
|
|
12
|
+
import { logger } from '../../../utils/logger.js';
|
|
13
|
+
import { isValidEmail } from '../../../utils/validation.js';
|
|
14
|
+
import Button from '../../Common/Button/index.js';
|
|
15
|
+
import Loader from '../../Common/Loading/index.js';
|
|
16
|
+
import { ModalHeading } from '../../Common/Modal/styles.js';
|
|
17
|
+
import PoweredByFooter from '../../Common/PoweredByFooter/index.js';
|
|
18
|
+
import { UIAuthProvider, routes, socialProviders } from '../../Openfort/types.js';
|
|
19
|
+
import { useOpenfort } from '../../Openfort/useOpenfort.js';
|
|
20
|
+
import { PageContent } from '../../PageContent/index.js';
|
|
21
|
+
import { ProvidersButton, ProviderInputInner, EmailInnerButton, ProviderIcon, ProviderLabel } from './styles.js';
|
|
22
|
+
|
|
23
|
+
const ProviderButtonBase = ({ children, icon, onClick, disabled }) => {
|
|
24
|
+
return (jsx(ProvidersButton, { children: jsxs(Button, { onClick: onClick, disabled: disabled, children: [jsx(ProviderLabel, { children: children }), jsx(ProviderIcon, { children: icon })] }) }));
|
|
25
|
+
};
|
|
26
|
+
const GuestButton = () => {
|
|
27
|
+
const { setRoute } = useOpenfort();
|
|
28
|
+
const handleClick = () => {
|
|
29
|
+
setRoute(routes.CREATE_GUEST_USER);
|
|
30
|
+
};
|
|
31
|
+
return (jsx(ProviderButtonBase, { onClick: handleClick, icon: jsx(GuestIcon, {}), children: "Guest" }));
|
|
32
|
+
};
|
|
33
|
+
const WalletButton = ({ disabled }) => {
|
|
34
|
+
const { setRoute } = useOpenfort();
|
|
35
|
+
const { user } = useOpenfortCore();
|
|
36
|
+
return (jsx(ProviderButtonBase, { onClick: () => setRoute({ route: routes.CONNECTORS, connectType: user ? 'link' : 'connect' }), icon: jsx(Logos.OtherWallets, {}), disabled: disabled, children: "Wallet" }));
|
|
37
|
+
};
|
|
38
|
+
const EmailButton = ({ handleSubmit }) => {
|
|
39
|
+
const { emailInput, setEmailInput } = useOpenfort();
|
|
40
|
+
const isValidEmail$1 = useMemo(() => {
|
|
41
|
+
return isValidEmail(emailInput);
|
|
42
|
+
}, [emailInput]);
|
|
43
|
+
return (jsx(ProvidersButton, { children: jsx("form", { onSubmit: (e) => {
|
|
44
|
+
e.preventDefault();
|
|
45
|
+
if (isValidEmail$1)
|
|
46
|
+
handleSubmit();
|
|
47
|
+
}, noValidate: true, children: jsxs(ProviderInputInner, { children: [jsx("input", { value: emailInput, onChange: (e) => setEmailInput(e.target.value), type: "email", placeholder: "Enter your email", formNoValidate: true }), jsx("div", { style: { position: 'relative' }, children: jsx(AnimatePresence, { initial: false, children: isValidEmail$1 ? (jsx(motion.div, { initial: { x: -5, opacity: 0 }, animate: { x: 0, opacity: 1 }, exit: { x: -5, opacity: 0, position: 'absolute' }, transition: { duration: 0.2, ease: [0.25, 1, 0.5, 1] }, children: jsx(EmailInnerButton, { type: "submit", "aria-label": "Submit email", children: jsx(ProviderIcon, { children: jsxs("svg", { width: "13", height: "12", viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("title", { children: "Submit email" }), jsx("line", { stroke: "currentColor", x1: "1", y1: "6", x2: "12", y2: "6", strokeWidth: "1", strokeLinecap: "round" }), jsx("path", { stroke: "currentColor", d: "M7.51431 1.5L11.757 5.74264M7.5 10.4858L11.7426 6.24314", strokeWidth: "1", strokeLinecap: "round" })] }) }) }) }, emailInput ? 'enabled' : 'disabled')) : (jsx(motion.div, { initial: { x: 5, opacity: 0 }, animate: { x: 0, opacity: 1 }, exit: { x: 5, opacity: 0, position: 'absolute' }, transition: { duration: 0.2, ease: [0.25, 1, 0.5, 1] }, children: jsx(ProviderIcon, { children: jsx(EmailIcon, {}) }) })) }) })] }) }) }));
|
|
48
|
+
};
|
|
49
|
+
const EmailPasswordButton = () => {
|
|
50
|
+
const { setRoute } = useOpenfort();
|
|
51
|
+
const { user } = useOpenfortCore();
|
|
52
|
+
const handleSubmit = () => {
|
|
53
|
+
setRoute(user ? routes.LINK_EMAIL : routes.EMAIL_LOGIN);
|
|
54
|
+
};
|
|
55
|
+
return jsx(EmailButton, { handleSubmit: handleSubmit });
|
|
56
|
+
};
|
|
57
|
+
const EmailOTPButton = () => {
|
|
58
|
+
const { setRoute } = useOpenfort();
|
|
59
|
+
const handleSubmit = () => {
|
|
60
|
+
setRoute(routes.EMAIL_OTP);
|
|
61
|
+
};
|
|
62
|
+
return jsx(EmailButton, { handleSubmit: handleSubmit });
|
|
63
|
+
};
|
|
64
|
+
const PhoneButton = () => {
|
|
65
|
+
const { uiConfig, phoneInput, setPhoneInput, setRoute } = useOpenfort();
|
|
66
|
+
const handleSubmit = (e) => {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
setRoute(routes.PHONE_OTP);
|
|
69
|
+
};
|
|
70
|
+
const hasValue = phoneInput.length > 5;
|
|
71
|
+
// && !defaultCountries.some((country: CountryData) => phoneInput.replace('+', '') === country[2])
|
|
72
|
+
return (jsx(ProvidersButton, { children: jsx("form", { onSubmit: handleSubmit, noValidate: true, children: jsxs(ProviderInputInner, { children: [jsx("div", { style: { width: '100%' }, children: jsx(PhoneInput, { value: phoneInput, onChange: (phone) => setPhoneInput(phone), hideDropdown: false, placeholder: "Enter your phone", style: {
|
|
73
|
+
'--react-international-phone-height': '56px',
|
|
74
|
+
'--react-international-phone-text-color': 'var(--ck-body-color)',
|
|
75
|
+
'--react-international-phone-background-color': 'var(--ck-secondary-button-background)',
|
|
76
|
+
'--react-international-phone-country-selector-background-color': 'var(--ck-secondary-button-background)',
|
|
77
|
+
'--react-international-phone-selected-dropdown-item-background-color': 'var(--ck-secondary-button-hover-background)',
|
|
78
|
+
'--react-international-phone-country-selector-background-color-hover': 'var(--ck-secondary-button-hover-background)',
|
|
79
|
+
'--react-international-phone-font-size': '16px',
|
|
80
|
+
paddingLeft: '4px',
|
|
81
|
+
}, ...uiConfig.phoneConfig }) }), jsx("div", { style: { position: 'relative' }, children: jsx(AnimatePresence, { initial: false, children: hasValue ? (jsx(EmailInnerButton, { initial: { x: -5, opacity: 0 }, animate: { x: 0, opacity: 1 }, exit: { x: -5, opacity: 0, position: 'absolute' }, transition: { duration: 0.2, ease: [0.25, 1, 0.5, 1] }, type: "submit", "aria-label": "Submit email", children: jsx(ProviderIcon, { children: jsxs("svg", { width: "13", height: "12", viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("title", { children: "Submit email" }), jsx("line", { stroke: "currentColor", x1: "1", y1: "6", x2: "12", y2: "6", strokeWidth: "1", strokeLinecap: "round" }), jsx("path", { stroke: "currentColor", d: "M7.51431 1.5L11.757 5.74264M7.5 10.4858L11.7426 6.24314", strokeWidth: "1", strokeLinecap: "round" })] }) }) }, phoneInput ? 'enabled' : 'disabled')) : (jsx(motion.div, { initial: { x: 5, opacity: 0 }, animate: { x: 0, opacity: 1 }, exit: { x: 5, opacity: 0, position: 'absolute' }, transition: { duration: 0.2, ease: [0.25, 1, 0.5, 1] }, children: jsx(ProviderIcon, { children: jsx(PhoneIcon, {}) }) })) }) })] }) }) }));
|
|
82
|
+
};
|
|
83
|
+
const AuthProviderButton = ({ provider, title = `${provider} login`, icon, }) => {
|
|
84
|
+
const { setRoute, setConnector } = useOpenfort();
|
|
85
|
+
const handleClick = () => {
|
|
86
|
+
setRoute({ route: routes.CONNECT, connectType: 'linkIfUserConnectIfNoUser' });
|
|
87
|
+
setConnector({ id: provider, type: 'oauth' });
|
|
88
|
+
};
|
|
89
|
+
return (jsx(ProviderButtonBase, { onClick: handleClick, icon: icon, children: title }));
|
|
90
|
+
};
|
|
91
|
+
const authProviderToOAuthProviderMap = {
|
|
92
|
+
guest: jsx(GuestButton, {}),
|
|
93
|
+
wallet: null,
|
|
94
|
+
emailPassword: jsx(EmailPasswordButton, {}),
|
|
95
|
+
emailOtp: jsx(EmailOTPButton, {}),
|
|
96
|
+
phone: jsx(PhoneButton, {}),
|
|
97
|
+
google: (jsx(AuthProviderButton, { provider: OAuthProvider.GOOGLE, title: "Google", icon: providersLogos[UIAuthProvider.GOOGLE] })),
|
|
98
|
+
twitter: (jsx(AuthProviderButton, { provider: OAuthProvider.TWITTER, title: "X", icon: providersLogos[UIAuthProvider.TWITTER] })),
|
|
99
|
+
facebook: (jsx(AuthProviderButton, { provider: OAuthProvider.FACEBOOK, title: "Facebook", icon: providersLogos[UIAuthProvider.FACEBOOK] })),
|
|
100
|
+
discord: (jsx(AuthProviderButton, { provider: OAuthProvider.DISCORD, title: "Discord", icon: providersLogos[UIAuthProvider.DISCORD] })),
|
|
101
|
+
apple: (jsx(AuthProviderButton, { provider: OAuthProvider.APPLE, title: "Apple", icon: providersLogos[UIAuthProvider.APPLE] })),
|
|
102
|
+
};
|
|
103
|
+
const ProviderButton = ({ provider }) => {
|
|
104
|
+
const { user, chainType } = useOpenfortCore();
|
|
105
|
+
if (user && (provider === UIAuthProvider.EMAIL_OTP || provider === UIAuthProvider.EMAIL_PASSWORD)) {
|
|
106
|
+
return jsx(EmailPasswordButton, {});
|
|
107
|
+
}
|
|
108
|
+
if (provider === UIAuthProvider.WALLET) {
|
|
109
|
+
return jsx(WalletButton, { disabled: chainType === ChainTypeEnum.SVM });
|
|
110
|
+
}
|
|
111
|
+
return authProviderToOAuthProviderMap[provider] || null;
|
|
112
|
+
};
|
|
113
|
+
// This accounts for the case where the user has an address but no user, which can happen if the user has not signed up yet, but logged in with a wallet
|
|
114
|
+
const AddressButNoUserCase = () => {
|
|
115
|
+
const { updateUser } = useOpenfortCore();
|
|
116
|
+
const { logout } = useOpenfortCore();
|
|
117
|
+
useEffect(() => {
|
|
118
|
+
updateUser()
|
|
119
|
+
.then((user) => {
|
|
120
|
+
if (!user)
|
|
121
|
+
logout();
|
|
122
|
+
})
|
|
123
|
+
.catch(() => {
|
|
124
|
+
logger.error('Failed to update user');
|
|
125
|
+
});
|
|
126
|
+
}, [updateUser, logout]);
|
|
127
|
+
return (jsx(PageContent, { children: jsx(Loader, { header: "Updating user" }) }));
|
|
128
|
+
};
|
|
129
|
+
const SocialProvidersButton = ({ thereAreSocialsAlready }) => {
|
|
130
|
+
const { setRoute } = useOpenfort();
|
|
131
|
+
return (jsx(ProviderButtonBase, { onClick: () => setRoute(routes.SOCIAL_PROVIDERS), icon: jsx(OtherSocials, {}), children: thereAreSocialsAlready ? 'Other socials' : 'Social providers' }));
|
|
132
|
+
};
|
|
133
|
+
const Providers = () => {
|
|
134
|
+
const { user } = useOpenfortCore();
|
|
135
|
+
const { previousRoute } = useOpenfort();
|
|
136
|
+
const { mainProviders, hasExcessProviders } = useProviders();
|
|
137
|
+
const { chainType } = useOpenfortCore();
|
|
138
|
+
// Use chain-specific hooks
|
|
139
|
+
const ethereumWallet = useEthereumEmbeddedWallet();
|
|
140
|
+
const solanaWallet = useSolanaEmbeddedWallet();
|
|
141
|
+
const wallet = chainType === ChainTypeEnum.EVM ? ethereumWallet : solanaWallet;
|
|
142
|
+
const isConnected = wallet.status === 'connected';
|
|
143
|
+
const address = isConnected ? wallet.address : undefined;
|
|
144
|
+
const onBack = useMemo(() => {
|
|
145
|
+
if (user) {
|
|
146
|
+
return 'back';
|
|
147
|
+
}
|
|
148
|
+
return null;
|
|
149
|
+
}, [previousRoute, user]);
|
|
150
|
+
if (address && !user) {
|
|
151
|
+
return jsx(AddressButNoUserCase, {});
|
|
152
|
+
}
|
|
153
|
+
return (jsxs(PageContent, { onBack: onBack, children: [jsx(ModalHeading, { children: user ? 'Link auth' : 'Connect' }), mainProviders.map((auth) => (jsx(ProviderButton, { provider: auth }, auth))), hasExcessProviders && (jsx(SocialProvidersButton, { thereAreSocialsAlready: !!mainProviders.find((p) => socialProviders.includes(p)) })), jsx(PoweredByFooter, { showDisclaimer: true })] }));
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export { ProviderButton, Providers as default };
|
|
157
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { motion } from 'framer-motion';
|
|
2
|
+
import styled from '../../../styles/styled/index.js';
|
|
3
|
+
import { ButtonContainer, ButtonContainerInner, InnerContainer } from '../../Common/Button/styles.js';
|
|
4
|
+
|
|
5
|
+
const ProviderInputInner = styled.div `
|
|
6
|
+
// Styles from react-international-phone (imported here to avoid importing the whole CSS file for nextjs compatibility)
|
|
7
|
+
.react-international-phone-country-selector{position:relative}.react-international-phone-country-selector-button{display:flex;height:var(--react-international-phone-height, 36px);box-sizing:border-box;align-items:center;justify-content:center;padding:0;border:1px solid var(--react-international-phone-country-selector-border-color, var(--react-international-phone-border-color, gainsboro));margin:0;appearance:button;-webkit-appearance:button;background-color:var(--react-international-phone-country-selector-background-color, var(--react-international-phone-background-color, white));cursor:pointer;text-transform:none;user-select:none}.react-international-phone-country-selector-button:hover{background-color:var(--react-international-phone-country-selector-background-color-hover, whitesmoke)}.react-international-phone-country-selector-button--hide-dropdown{cursor:auto}.react-international-phone-country-selector-button--hide-dropdown:hover{background-color:transparent}.react-international-phone-country-selector-button__button-content{display:flex;align-items:center;justify-content:center}.react-international-phone-country-selector-button__flag-emoji{margin:0 4px}.react-international-phone-country-selector-button__flag-emoji--disabled{opacity:.75}.react-international-phone-country-selector-button__dropdown-arrow{border-top:var(--react-international-phone-country-selector-arrow-size, 4px) solid var(--react-international-phone-country-selector-arrow-color, #777);border-right:var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;border-left:var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;margin-right:4px;transition:all .1s ease-out}.react-international-phone-country-selector-button__dropdown-arrow--active{transform:rotateX(180deg)}.react-international-phone-country-selector-button__dropdown-arrow--disabled{border-top-color:var(--react-international-phone-disabled-country-selector-arrow-color, #999)}.react-international-phone-country-selector-button--disabled,.react-international-phone-country-selector-button--disabled:hover{background-color:var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke))}.react-international-phone-country-selector-button--disabled{cursor:auto}.react-international-phone-flag-emoji{width:var(--react-international-phone-flag-width, 24px);height:var(--react-international-phone-flag-height, 24px);box-sizing:border-box}.react-international-phone-country-selector-dropdown{position:absolute;z-index:1;top:var(--react-international-phone-dropdown-top, 44px);left:var(--react-international-phone-dropdown-left, 0);display:flex;width:300px;max-height:200px;flex-direction:column;padding:4px 0;margin:0;background-color:var(--react-international-phone-dropdown-item-background-color, var(--react-international-phone-background-color, white));box-shadow:var(--react-international-phone-dropdown-shadow, 2px 2px 16px rgba(0, 0, 0, .25));color:var(--react-international-phone-dropdown-item-text-color, var(--react-international-phone-text-color, #222));list-style:none;overflow-y:scroll}.react-international-phone-country-selector-dropdown__preferred-list-divider{height:1px;border:none;margin:var(--react-international-phone-dropdown-preferred-list-divider-margin, 0);background:var(--react-international-phone-dropdown-preferred-list-divider-color, var(--react-international-phone-border-color, gainsboro))}.react-international-phone-country-selector-dropdown__list-item{display:flex;min-height:var(--react-international-phone-dropdown-item-height, 28px);box-sizing:border-box;align-items:center;padding:2px 8px}.react-international-phone-country-selector-dropdown__list-item-flag-emoji{margin-right:8px}.react-international-phone-country-selector-dropdown__list-item-country-name{overflow:hidden;margin-right:8px;font-size:var(--react-international-phone-dropdown-item-font-size, 14px);text-overflow:ellipsis;white-space:nowrap}.react-international-phone-country-selector-dropdown__list-item-dial-code{color:var(--react-international-phone-dropdown-item-dial-code-color, gray);font-size:var(--react-international-phone-dropdown-item-font-size, 14px)}.react-international-phone-country-selector-dropdown__list-item:hover{background-color:var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke));cursor:pointer}.react-international-phone-country-selector-dropdown__list-item--selected,.react-international-phone-country-selector-dropdown__list-item--focused{background-color:var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke);color:var(--react-international-phone-selected-dropdown-item-text-color, var(--react-international-phone-text-color, #222))}.react-international-phone-country-selector-dropdown__list-item--selected .react-international-phone-country-selector-dropdown__list-item-dial-code,.react-international-phone-country-selector-dropdown__list-item--focused .react-international-phone-country-selector-dropdown__list-item-dial-code{color:var(--react-international-phone-selected-dropdown-item-dial-code-color, var(--react-international-phone-dropdown-item-dial-code-color, gray))}.react-international-phone-country-selector-dropdown__list-item--focused{background-color:var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke))}.react-international-phone-dial-code-preview{display:flex;align-items:center;justify-content:center;padding:0 8px;border:1px solid var(--react-international-phone-dial-code-preview-border-color, var(--react-international-phone-border-color, gainsboro));margin-right:-1px;background-color:var(--react-international-phone-dial-code-preview-background-color, var(--react-international-phone-background-color, white));color:var(--react-international-phone-dial-code-preview-text-color, var(--react-international-phone-text-color, #222));font-size:var(--react-international-phone-dial-code-preview-font-size, var(--react-international-phone-font-size, 13px))}.react-international-phone-dial-code-preview--disabled{background-color:var(--react-international-phone-dial-code-preview-disabled-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));color:var(--react-international-phone-dial-code-preview-disabled-text-color, var(--react-international-phone-disabled-text-color, #666))}.react-international-phone-input-container{display:flex}.react-international-phone-input-container .react-international-phone-country-selector-button{border-radius:var(--react-international-phone-border-radius, 4px);margin-right:-1px;border-bottom-right-radius:0;border-top-right-radius:0}.react-international-phone-input-container .react-international-phone-input{overflow:visible;height:var(--react-international-phone-height, 36px);box-sizing:border-box;padding:0 8px;border:1px solid var(--react-international-phone-border-color, gainsboro);border-radius:var(--react-international-phone-border-radius, 4px);margin:0;background-color:var(--react-international-phone-background-color, white);border-bottom-left-radius:0;border-top-left-radius:0;color:var(--react-international-phone-text-color, #222);font-family:inherit;font-size:var(--react-international-phone-font-size, 13px)}.react-international-phone-input-container .react-international-phone-input:focus{outline:none}.react-international-phone-input-container .react-international-phone-input--disabled{background-color:var(--react-international-phone-disabled-background-color, whitesmoke);color:var(--react-international-phone-disabled-text-color, #666)}
|
|
8
|
+
|
|
9
|
+
border-radius: var(--ck-secondary-button-border-radius);
|
|
10
|
+
font-size: 1rem;
|
|
11
|
+
color: var(--ck-body-color);
|
|
12
|
+
transition: all 0.2s;
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 100%;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
margin-top: 12px;
|
|
19
|
+
|
|
20
|
+
box-shadow: var(--ck-secondary-button-box-shadow);
|
|
21
|
+
background: var(--ck-secondary-button-background);
|
|
22
|
+
|
|
23
|
+
padding-right: 20px;
|
|
24
|
+
|
|
25
|
+
&:focus-within {
|
|
26
|
+
box-shadow: var(--ck-secondary-button-hover-box-shadow);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
input {
|
|
30
|
+
padding-left: 20px;
|
|
31
|
+
padding-right: 10px;
|
|
32
|
+
|
|
33
|
+
border: none !important;
|
|
34
|
+
outline: none !important;
|
|
35
|
+
background: transparent !important;
|
|
36
|
+
box-shadow: none !important;
|
|
37
|
+
|
|
38
|
+
::placeholder {
|
|
39
|
+
color: var(--ck-body-color-muted);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
width: 100%;
|
|
43
|
+
height: 100%;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.react-international-phone-country-selector-button {
|
|
47
|
+
padding-left: 20px;
|
|
48
|
+
padding-right: 10px;
|
|
49
|
+
--react-international-phone-border-color: none;
|
|
50
|
+
--react-international-phone-border-radius: var(--ck-secondary-button-border-radius);
|
|
51
|
+
--react-international-phone-background-color: var(--ck-secondary-button-background);
|
|
52
|
+
--react-international-phone-text-color: var(--ck-body-color);
|
|
53
|
+
border-radius: var(--ck-secondary-button-border-radius) 0px 0px var(--ck-secondary-button-border-radius);
|
|
54
|
+
transition: all .2s ease-out;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.react-international-phone-country-selector-dropdown {
|
|
58
|
+
box-shadow: var(--ck-secondary-button-hover-box-shadow);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.react-international-phone-country-selector-button__dropdown-arrow {
|
|
62
|
+
border-top: var(--react-international-phone-country-selector-arrow-size, 4px) solid var(--react-international-phone-country-selector-arrow-color, #777) !important;
|
|
63
|
+
border-right: var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent !important;
|
|
64
|
+
border-left: var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent !important;
|
|
65
|
+
margin-right: 4px;
|
|
66
|
+
transition: all .1s ease-out;
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
const EmailInnerButton = styled(motion.button) `
|
|
70
|
+
color: var(--ck-body-action-color);
|
|
71
|
+
transition: background-color 200ms ease, transform 100ms ease, color 200ms ease, transition 200ms ease, opacity 200ms ease;
|
|
72
|
+
border-radius: 16px;
|
|
73
|
+
|
|
74
|
+
svg {
|
|
75
|
+
display: block;
|
|
76
|
+
position: relative;
|
|
77
|
+
padding: 4px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&:enabled {
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
&:hover {
|
|
83
|
+
background: var(--ck-body-background-secondary);
|
|
84
|
+
color: var(--ck-body-action-hover-color);
|
|
85
|
+
}
|
|
86
|
+
&:active {
|
|
87
|
+
transform: scale(0.9);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
`;
|
|
91
|
+
const ProvidersButton = styled.div `
|
|
92
|
+
${ButtonContainer} {
|
|
93
|
+
height: 64px;
|
|
94
|
+
font-size: 17px;
|
|
95
|
+
font-weight: var(--ck-primary-button-font-weight, 500);
|
|
96
|
+
line-height: 20px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
${ProviderInputInner} {
|
|
100
|
+
height: 64px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&:first-of-type {
|
|
104
|
+
${ButtonContainer}, ${ProviderInputInner} {
|
|
105
|
+
margin-top: 0;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
${ButtonContainerInner} {
|
|
110
|
+
padding: 0 20px;
|
|
111
|
+
justify-content: space-between;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
${InnerContainer} {
|
|
115
|
+
justify-content: space-between;
|
|
116
|
+
width: 100%;
|
|
117
|
+
max-width: 100%;
|
|
118
|
+
}
|
|
119
|
+
`;
|
|
120
|
+
const ProviderLabel = styled.span `
|
|
121
|
+
display: flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
gap: 9px;
|
|
124
|
+
width: 100%;
|
|
125
|
+
overflow: hidden;
|
|
126
|
+
white-space: nowrap;
|
|
127
|
+
text-overflow: ellipsis;
|
|
128
|
+
padding: 2px 0;
|
|
129
|
+
`;
|
|
130
|
+
const ProviderIcon = styled.div `
|
|
131
|
+
width: 32px;
|
|
132
|
+
height: 32px;
|
|
133
|
+
flex-shrink: 0;
|
|
134
|
+
svg,
|
|
135
|
+
img {
|
|
136
|
+
display: block;
|
|
137
|
+
position: relative;
|
|
138
|
+
pointer-events: none;
|
|
139
|
+
overflow: hidden;
|
|
140
|
+
width: 100%;
|
|
141
|
+
height: 100%;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&[data-shape='squircle'] {
|
|
145
|
+
border-radius: 22.5%;
|
|
146
|
+
}
|
|
147
|
+
&[data-shape='circle'] {
|
|
148
|
+
border-radius: 100%;
|
|
149
|
+
}
|
|
150
|
+
&[data-shape='square'] {
|
|
151
|
+
border-radius: 0;
|
|
152
|
+
}
|
|
153
|
+
`;
|
|
154
|
+
|
|
155
|
+
export { EmailInnerButton, ProviderIcon, ProviderInputInner, ProviderLabel, ProvidersButton };
|
|
156
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { ChainTypeEnum } from '@openfort/openfort-js';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import Logos from '../../../assets/logos.js';
|
|
5
|
+
import { useEthereumEmbeddedWallet } from '../../../ethereum/hooks/useEthereumEmbeddedWallet.js';
|
|
6
|
+
import { useOpenfortCore } from '../../../openfort/useOpenfort.js';
|
|
7
|
+
import { useSolanaEmbeddedWallet } from '../../../solana/hooks/useSolanaEmbeddedWallet.js';
|
|
8
|
+
import { CopyIconButton } from '../../Common/CopyToClipboard/CopyIconButton.js';
|
|
9
|
+
import CustomQRCode from '../../Common/CustomQRCode/index.js';
|
|
10
|
+
import { ModalHeading, ModalBody } from '../../Common/Modal/styles.js';
|
|
11
|
+
import { routes } from '../../Openfort/types.js';
|
|
12
|
+
import { useOpenfort } from '../../Openfort/useOpenfort.js';
|
|
13
|
+
import { PageContent } from '../../PageContent/index.js';
|
|
14
|
+
import { ReceiveContent, QRWrapper, AddressSection, Label, AddressRow, AddressField, NetworkInfo } from './styles.js';
|
|
15
|
+
|
|
16
|
+
function formatSolanaCluster(cluster) {
|
|
17
|
+
if (cluster === 'mainnet-beta')
|
|
18
|
+
return 'Mainnet';
|
|
19
|
+
return cluster.charAt(0).toUpperCase() + cluster.slice(1);
|
|
20
|
+
}
|
|
21
|
+
const Receive = () => {
|
|
22
|
+
var _a;
|
|
23
|
+
const context = useOpenfort();
|
|
24
|
+
const { route, chains } = context;
|
|
25
|
+
const currentRoute = (_a = route === null || route === void 0 ? void 0 : route.route) !== null && _a !== void 0 ? _a : '';
|
|
26
|
+
const isSolanaRoute = currentRoute.startsWith('sol:');
|
|
27
|
+
const { chainType } = useOpenfortCore();
|
|
28
|
+
const ethereumWallet = useEthereumEmbeddedWallet();
|
|
29
|
+
const solanaWallet = useSolanaEmbeddedWallet();
|
|
30
|
+
const wallet = chainType === ChainTypeEnum.EVM ? ethereumWallet : solanaWallet;
|
|
31
|
+
const isConnected = wallet.status === 'connected';
|
|
32
|
+
const address = isConnected ? wallet.address : undefined;
|
|
33
|
+
const chainId = isConnected && chainType === ChainTypeEnum.EVM ? wallet.chainId : undefined;
|
|
34
|
+
const chain = chains.find((c) => c.id === chainId);
|
|
35
|
+
const qrValue = address || '';
|
|
36
|
+
const networkLabel = isConnected && chainType === ChainTypeEnum.SVM && solanaWallet.cluster
|
|
37
|
+
? formatSolanaCluster(solanaWallet.cluster)
|
|
38
|
+
: (chain === null || chain === void 0 ? void 0 : chain.name)
|
|
39
|
+
? `${chain.name}${chainId ? ` · Chain ID: ${chainId}` : ''}`
|
|
40
|
+
: chainId
|
|
41
|
+
? `Chain ID: ${chainId}`
|
|
42
|
+
: null;
|
|
43
|
+
const { uiConfig: options } = context;
|
|
44
|
+
const renderLogo = () => {
|
|
45
|
+
if (options === null || options === void 0 ? void 0 : options.logo) {
|
|
46
|
+
if (typeof options.logo === 'string') {
|
|
47
|
+
return jsx("img", { src: options.logo, alt: "Logo", style: { width: '100%' } });
|
|
48
|
+
}
|
|
49
|
+
return options.logo;
|
|
50
|
+
}
|
|
51
|
+
return jsx(Logos.Openfort, {});
|
|
52
|
+
};
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
const timer = setTimeout(() => context.triggerResize(), 100);
|
|
55
|
+
return () => clearTimeout(timer);
|
|
56
|
+
}, [address, context]);
|
|
57
|
+
return (jsx(PageContent, { onBack: isSolanaRoute ? routes.SOL_CONNECTED : routes.CONNECTED, children: jsxs(ReceiveContent, { children: [jsx(ModalHeading, { children: "Receive funds" }), jsx(ModalBody, { children: "Scan the QR code or copy your wallet details." }), address && (jsx(QRWrapper, { children: jsx(CustomQRCode, { value: qrValue, image: jsx("div", { style: { padding: 10 }, children: renderLogo() }) }) })), jsxs(AddressSection, { children: [jsx(Label, { children: "Your wallet address" }), jsxs(AddressRow, { children: [jsx(AddressField, { children: address !== null && address !== void 0 ? address : '--' }), jsx(CopyIconButton, { value: address !== null && address !== void 0 ? address : '' })] })] }), networkLabel && jsxs(NetworkInfo, { children: ["Network: ", networkLabel] })] }) }));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { Receive as default };
|
|
61
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const ReceiveContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
1
2
|
export declare const QRWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
3
|
export declare const AddressSection: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
4
|
export declare const Label: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import styled from '../../../styles/styled/index.js';
|
|
2
|
+
|
|
3
|
+
const ReceiveContent = styled.div `
|
|
4
|
+
min-height: 480px;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
`;
|
|
8
|
+
const QRWrapper = styled.div `
|
|
9
|
+
display: block;
|
|
10
|
+
margin: 24px auto 16px;
|
|
11
|
+
width: 100%;
|
|
12
|
+
max-width: 280px;
|
|
13
|
+
|
|
14
|
+
> div {
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
const AddressSection = styled.div `
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
gap: 12px;
|
|
22
|
+
text-align: left;
|
|
23
|
+
`;
|
|
24
|
+
const Label = styled.span `
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
font-weight: 600;
|
|
27
|
+
color: var(--ck-body-color);
|
|
28
|
+
`;
|
|
29
|
+
const AddressRow = styled.div `
|
|
30
|
+
display: flex;
|
|
31
|
+
gap: 8px;
|
|
32
|
+
align-items: center;
|
|
33
|
+
`;
|
|
34
|
+
const AddressField = styled.div `
|
|
35
|
+
flex: 1;
|
|
36
|
+
padding: 12px;
|
|
37
|
+
border-radius: var(--ck-secondary-button-border-radius);
|
|
38
|
+
background: var(--ck-secondary-button-background);
|
|
39
|
+
box-shadow: var(--ck-secondary-button-box-shadow);
|
|
40
|
+
font-size: 14px;
|
|
41
|
+
color: var(--ck-body-color);
|
|
42
|
+
word-break: break-all;
|
|
43
|
+
`;
|
|
44
|
+
const NetworkInfo = styled.div `
|
|
45
|
+
margin-top: 12px;
|
|
46
|
+
font-size: 13px;
|
|
47
|
+
color: var(--ck-body-color-muted);
|
|
48
|
+
text-align: center;
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
export { AddressField, AddressRow, AddressSection, Label, NetworkInfo, QRWrapper, ReceiveContent };
|
|
52
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|