@lifi/widget 4.0.0 → 4.2.0
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/dist/esm/App.d.ts +4 -2
- package/dist/esm/App.d.ts.map +1 -1
- package/dist/esm/App.js +4 -4
- package/dist/esm/App.js.map +1 -1
- package/dist/esm/AppDefault.js +14 -0
- package/dist/esm/AppDefault.js.map +1 -1
- package/dist/esm/AppDrawer.d.ts +1 -1
- package/dist/esm/AppDrawer.d.ts.map +1 -1
- package/dist/esm/AppDrawer.js +5 -6
- package/dist/esm/AppDrawer.js.map +1 -1
- package/dist/esm/AppDrawerContext.js +2 -2
- package/dist/esm/AppDrawerContext.js.map +1 -1
- package/dist/esm/components/ActionRow/ActionRow.style.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.js +2 -1
- package/dist/esm/components/AmountInput/AmountInput.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.style.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.js +4 -2
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.style.js +1 -1
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.style.js.map +1 -1
- package/dist/esm/components/AmountInput/PriceFormHelperText.js +4 -2
- package/dist/esm/components/AmountInput/PriceFormHelperText.js.map +1 -1
- package/dist/esm/components/AmountInput/PriceFormHelperText.style.js.map +1 -1
- package/dist/esm/components/AmountInputCard/AmountInputCard.style.js +98 -0
- package/dist/esm/components/AmountInputCard/AmountInputCard.style.js.map +1 -0
- package/dist/esm/components/AmountInputCard/AmountInputCardPair.js +25 -0
- package/dist/esm/components/AmountInputCard/AmountInputCardPair.js.map +1 -0
- package/dist/esm/components/AmountInputCard/BalanceDisplay.js +35 -0
- package/dist/esm/components/AmountInputCard/BalanceDisplay.js.map +1 -0
- package/dist/esm/components/AmountInputCard/BalanceDisplay.style.js +11 -0
- package/dist/esm/components/AmountInputCard/BalanceDisplay.style.js.map +1 -0
- package/dist/esm/components/AmountInputCard/FiatValueToggle.js +41 -0
- package/dist/esm/components/AmountInputCard/FiatValueToggle.js.map +1 -0
- package/dist/esm/components/AmountInputCard/PercentageChips.js +80 -0
- package/dist/esm/components/AmountInputCard/PercentageChips.js.map +1 -0
- package/dist/esm/components/AmountInputCard/PercentageChips.style.js +43 -0
- package/dist/esm/components/AmountInputCard/PercentageChips.style.js.map +1 -0
- package/dist/esm/components/AmountInputCard/ReceiveAmountCard.js +137 -0
- package/dist/esm/components/AmountInputCard/ReceiveAmountCard.js.map +1 -0
- package/dist/esm/components/AmountInputCard/SendAmountCard.js +102 -0
- package/dist/esm/components/AmountInputCard/SendAmountCard.js.map +1 -0
- package/dist/esm/components/AppContainer.js.map +1 -1
- package/dist/esm/components/Avatar/AccountAvatar.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.js +12 -3
- package/dist/esm/components/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.style.js.map +1 -1
- package/dist/esm/components/Avatar/SmallAvatar.js.map +1 -1
- package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.js +1 -0
- package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.js.map +1 -1
- package/dist/esm/components/BottomSheet/BottomSheet.js +3 -3
- package/dist/esm/components/BottomSheet/BottomSheet.js.map +1 -1
- package/dist/esm/components/ButtonTertiary.js.map +1 -1
- package/dist/esm/components/Card/Card.js.map +1 -1
- package/dist/esm/components/Card/CardButton.style.js.map +1 -1
- package/dist/esm/components/Card/CardHeader.js.map +1 -1
- package/dist/esm/components/Card/CardIconButton.js.map +1 -1
- package/dist/esm/components/Card/CardLabel.js.map +1 -1
- package/dist/esm/components/Card/CardTitle.js.map +1 -1
- package/dist/esm/components/Card/InputCard.js.map +1 -1
- package/dist/esm/components/ChainSelect/ChainSelect.js.map +1 -1
- package/dist/esm/components/ChainSelect/ChainSelect.style.js.map +1 -1
- package/dist/esm/components/ChainSelect/useChainSelect.js.map +1 -1
- package/dist/esm/components/Chains/AllChainsAvatar.js.map +1 -1
- package/dist/esm/components/Chains/ChainList.js.map +1 -1
- package/dist/esm/components/Chains/ChainList.style.js.map +1 -1
- package/dist/esm/components/Chains/ChainsExpanded.style.js.map +1 -1
- package/dist/esm/components/Chains/VirtualizedChainList.js +2 -1
- package/dist/esm/components/Chains/VirtualizedChainList.js.map +1 -1
- package/dist/esm/components/ContextMenu.style.js.map +1 -1
- package/dist/esm/components/ContractComponent/NFT/NFT.style.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.style.js.map +1 -1
- package/dist/esm/components/EmptyListIndicator/EmptyListIndicator.style.js.map +1 -1
- package/dist/esm/components/ExecutionStatusCard/StatusIcon.js.map +1 -1
- package/dist/esm/components/ExecutionStatusCard/StatusIcon.style.js.map +1 -1
- package/dist/esm/components/ExecutionStatusCard/iconKey.js.map +1 -1
- package/dist/esm/components/Expansion/Expansion.style.js.map +1 -1
- package/dist/esm/components/Header/ActivitiesButton.style.js.map +1 -1
- package/dist/esm/components/Header/CloseDrawerButton.js +1 -0
- package/dist/esm/components/Header/CloseDrawerButton.js.map +1 -1
- package/dist/esm/components/Header/Header.js +7 -10
- package/dist/esm/components/Header/Header.js.map +1 -1
- package/dist/esm/components/Header/Header.style.js.map +1 -1
- package/dist/esm/components/Header/HeaderNavigationTabs.js +39 -0
- package/dist/esm/components/Header/HeaderNavigationTabs.js.map +1 -0
- package/dist/esm/components/Header/HeaderTabs.js +33 -0
- package/dist/esm/components/Header/HeaderTabs.js.map +1 -0
- package/dist/esm/components/Header/NavigationHeader.js +7 -5
- package/dist/esm/components/Header/NavigationHeader.js.map +1 -1
- package/dist/esm/components/Header/SettingsButton.style.js.map +1 -1
- package/dist/esm/components/Header/WalletMenu.style.js.map +1 -1
- package/dist/esm/components/IconCircle/IconCircle.style.js +1 -1
- package/dist/esm/components/IconCircle/IconCircle.style.js.map +1 -1
- package/dist/esm/components/IconTypography.js.map +1 -1
- package/dist/esm/components/Input.js.map +1 -1
- package/dist/esm/components/LimitOrderSettings/LimitOrderSettings.js +99 -0
- package/dist/esm/components/LimitOrderSettings/LimitOrderSettings.js.map +1 -0
- package/dist/esm/components/LimitOrderSettings/LimitOrderSettings.style.js +52 -0
- package/dist/esm/components/LimitOrderSettings/LimitOrderSettings.style.js.map +1 -0
- package/dist/esm/components/LimitPriceCard/LimitPriceCard.js +115 -0
- package/dist/esm/components/LimitPriceCard/LimitPriceCard.js.map +1 -0
- package/dist/esm/components/LimitPriceCard/LimitPriceCard.style.js +89 -0
- package/dist/esm/components/LimitPriceCard/LimitPriceCard.style.js.map +1 -0
- package/dist/esm/components/LimitPriceCard/LimitPricePresets.js +91 -0
- package/dist/esm/components/LimitPriceCard/LimitPricePresets.js.map +1 -0
- package/dist/esm/components/ListItem/ListItem.js.map +1 -1
- package/dist/esm/components/ListItem/ListItemButton.js.map +1 -1
- package/dist/esm/components/ListItemButton.js.map +1 -1
- package/dist/esm/components/ListItemText.js.map +1 -1
- package/dist/esm/components/Menu.js.map +1 -1
- package/dist/esm/components/Messages/AlertMessage.style.js.map +1 -1
- package/dist/esm/components/Messages/GasRefuelMessage.style.js.map +1 -1
- package/dist/esm/components/Messages/WarningMessages.js.map +1 -1
- package/dist/esm/components/PageContainer.js.map +1 -1
- package/dist/esm/components/PoweredBy/PoweredBy.js.map +1 -1
- package/dist/esm/components/PoweredBy/PoweredBy.style.js.map +1 -1
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.js +1 -0
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.js.map +1 -1
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.style.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteDetails.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteDetails.style.js +2 -2
- package/dist/esm/components/RouteCard/RouteDetails.style.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteProviderCard.js +118 -0
- package/dist/esm/components/RouteCard/RouteProviderCard.js.map +1 -0
- package/dist/esm/components/RouteCard/RouteToken.style.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteTokens.js.map +1 -1
- package/dist/esm/components/RouteCard/getMatchingLabels.js.map +1 -1
- package/dist/esm/components/Routes/LimitOrderRoutes.js +34 -0
- package/dist/esm/components/Routes/LimitOrderRoutes.js.map +1 -0
- package/dist/esm/components/Routes/Routes.js +2 -2
- package/dist/esm/components/Routes/Routes.js.map +1 -1
- package/dist/esm/components/Routes/RoutesContent.js.map +1 -1
- package/dist/esm/components/Routes/RoutesExpanded.style.js.map +1 -1
- package/dist/esm/components/Search/SearchInput.style.js.map +1 -1
- package/dist/esm/components/Search/SearchNotFound.style.js.map +1 -1
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js.map +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletButton.style.js.map +1 -1
- package/dist/esm/components/SettingsListItemButton.js.map +1 -1
- package/dist/esm/components/SettingsPanel/SettingsPanel.js +51 -0
- package/dist/esm/components/SettingsPanel/SettingsPanel.js.map +1 -0
- package/dist/esm/components/SettingsPanel/SettingsPanel.style.js +33 -0
- package/dist/esm/components/SettingsPanel/SettingsPanel.style.js.map +1 -0
- package/dist/esm/components/SettingsPanel/utils.js +14 -0
- package/dist/esm/components/SettingsPanel/utils.js.map +1 -0
- package/dist/esm/components/Skeleton/WidgetSkeleton.js +50 -47
- package/dist/esm/components/Skeleton/WidgetSkeleton.js.map +1 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.js.map +1 -1
- package/dist/esm/components/Step/StepActions.js.map +1 -1
- package/dist/esm/components/Step/StepActions.style.js.map +1 -1
- package/dist/esm/components/StepActions/SentToWalletRow.style.js.map +1 -1
- package/dist/esm/components/StepActions/StepActionRow.style.js.map +1 -1
- package/dist/esm/components/SwapButton/SwapButton.js +50 -0
- package/dist/esm/components/SwapButton/SwapButton.js.map +1 -0
- package/dist/esm/components/SwapButton/SwapButton.style.js +24 -0
- package/dist/esm/components/SwapButton/SwapButton.style.js.map +1 -0
- package/dist/esm/components/Switch.js.map +1 -1
- package/dist/esm/components/Tabs/NavigationTabs.js +3 -0
- package/dist/esm/components/Tabs/NavigationTabs.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.style.js.map +1 -1
- package/dist/esm/components/Timer/StepStatusTimer.style.js.map +1 -1
- package/dist/esm/components/Token/Token.style.js.map +1 -1
- package/dist/esm/components/TokenList/PinTokenButton.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheet.js +4 -4
- package/dist/esm/components/TokenList/TokenDetailsSheet.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.js +4 -4
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.style.js.map +1 -1
- package/dist/esm/components/TokenList/TokenList.style.js.map +1 -1
- package/dist/esm/components/TokenList/TokenListItem.js +2 -2
- package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
- package/dist/esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
- package/dist/esm/components/TokenList/useTokenSelect.js +3 -3
- package/dist/esm/components/TokenList/useTokenSelect.js.map +1 -1
- package/dist/esm/components/TokenPillButton/TokenPillButton.js +52 -0
- package/dist/esm/components/TokenPillButton/TokenPillButton.js.map +1 -0
- package/dist/esm/components/TokenPillButton/TokenPillButton.style.js +39 -0
- package/dist/esm/components/TokenPillButton/TokenPillButton.style.js.map +1 -0
- package/dist/esm/components/TokenRate/TokenRate.style.js.map +1 -1
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.js.map +1 -1
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.style.js.map +1 -1
- package/dist/esm/components/TransactionCard/TransactionCard.style.js.map +1 -1
- package/dist/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/config/version.js.map +1 -1
- package/dist/esm/hooks/timer/validate.js.map +1 -1
- package/dist/esm/hooks/useAccountsBalancesData.js.map +1 -1
- package/dist/esm/hooks/useAvailableChains.js +1 -1
- package/dist/esm/hooks/useChainSearch.js +2 -1
- package/dist/esm/hooks/useChainSearch.js.map +1 -1
- package/dist/esm/hooks/useChains.js +1 -1
- package/dist/esm/hooks/useExplorer.js.map +1 -1
- package/dist/esm/hooks/useFilteredByTokenBalances.js +1 -1
- package/dist/esm/hooks/useFilteredByTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useFromTokenSufficiency.js.map +1 -1
- package/dist/esm/hooks/useGasSufficiency.js.map +1 -1
- package/dist/esm/hooks/useLanguages.js +2 -2
- package/dist/esm/hooks/useLanguages.js.map +1 -1
- package/dist/esm/hooks/useLimitMarketRate.js +24 -0
- package/dist/esm/hooks/useLimitMarketRate.js.map +1 -0
- package/dist/esm/hooks/useLinkedLimitFields.js +49 -0
- package/dist/esm/hooks/useLinkedLimitFields.js.map +1 -0
- package/dist/esm/hooks/useRouteExecution.js.map +1 -1
- package/dist/esm/hooks/useRouteExecutionMessage.js.map +1 -1
- package/dist/esm/hooks/useRouteRequiredAccountConnection.js.map +1 -1
- package/dist/esm/hooks/useRoutes.js +23 -6
- package/dist/esm/hooks/useRoutes.js.map +1 -1
- package/dist/esm/hooks/useSwapOnly.js +2 -4
- package/dist/esm/hooks/useSwapOnly.js.map +1 -1
- package/dist/esm/hooks/useToAddressRequirements.js +2 -2
- package/dist/esm/hooks/useToAddressRequirements.js.map +1 -1
- package/dist/esm/hooks/useToken.js.map +1 -1
- package/dist/esm/hooks/useTokenBalance.js.map +1 -1
- package/dist/esm/hooks/useTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useTokenBalancesQueries.js.map +1 -1
- package/dist/esm/hooks/useTokenSearch.js +1 -1
- package/dist/esm/hooks/useTokenSearch.js.map +1 -1
- package/dist/esm/hooks/useTokens.js +17 -15
- package/dist/esm/hooks/useTokens.js.map +1 -1
- package/dist/esm/hooks/useTools.js +1 -1
- package/dist/esm/hooks/useTransactionDetails.js.map +1 -1
- package/dist/esm/hooks/useTransactionHistory.js.map +1 -1
- package/dist/esm/hooks/useTransactionList.js.map +1 -1
- package/dist/esm/hooks/useWideVariant.js +5 -2
- package/dist/esm/hooks/useWideVariant.js.map +1 -1
- package/dist/esm/i18n/en.json +25 -0
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/pages/ActivitiesPage/ActivitiesPage.js.map +1 -1
- package/dist/esm/pages/MainPage/LimitPageContent.js +23 -0
- package/dist/esm/pages/MainPage/LimitPageContent.js.map +1 -0
- package/dist/esm/pages/MainPage/MainPage.js +19 -22
- package/dist/esm/pages/MainPage/MainPage.js.map +1 -1
- package/dist/esm/pages/MainPage/MainPageActions.js +28 -0
- package/dist/esm/pages/MainPage/MainPageActions.js.map +1 -0
- package/dist/esm/pages/MainPage/ReviewButton.js +11 -4
- package/dist/esm/pages/MainPage/ReviewButton.js.map +1 -1
- package/dist/esm/pages/RoutePriorityPage.js +48 -0
- package/dist/esm/pages/RoutePriorityPage.js.map +1 -0
- package/dist/esm/pages/RoutesPage/RoutesPage.js.map +1 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.style.js.map +1 -1
- package/dist/esm/pages/SelectEnabledToolsPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/BookmarkAddressSheet.js +3 -3
- package/dist/esm/pages/SendToWallet/BookmarkAddressSheet.js.map +1 -1
- package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js +3 -3
- package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js +2 -2
- package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/GasPriceSettings.js +1 -1
- package/dist/esm/pages/SettingsPage/ResetSettingsButton.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/RoutePrioritySettings.js +12 -27
- package/dist/esm/pages/SettingsPage/RoutePrioritySettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js +3 -3
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingsAccordian.js +3 -3
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingsAccordian.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippagePage.js +133 -0
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippagePage.js.map +1 -0
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js +14 -72
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +26 -14
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/ThemeSettings.js +4 -0
- package/dist/esm/pages/SettingsPage/ThemeSettings.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/ContactSupportButton.style.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js.map +1 -1
- package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.js +3 -3
- package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.js +16 -15
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.style.js.map +1 -1
- package/dist/esm/pages/TransactionPage/RouteTracker.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js +3 -3
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.style.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TransactionExecutionContent.js +27 -31
- package/dist/esm/pages/TransactionPage/TransactionExecutionContent.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TransactionReview.js +4 -1
- package/dist/esm/pages/TransactionPage/TransactionReview.js.map +1 -1
- package/dist/esm/pages/TransactionPage/utils.js.map +1 -1
- package/dist/esm/providers/I18nProvider/I18nProvider.js +1 -1
- package/dist/esm/providers/I18nProvider/I18nProvider.js.map +1 -1
- package/dist/esm/providers/I18nProvider/enResource.d.ts +1 -1
- package/dist/esm/providers/I18nProvider/enResource.js +1 -1
- package/dist/esm/providers/I18nProvider/i18n.js.map +1 -1
- package/dist/esm/providers/I18nProvider/types.d.ts +2 -2
- package/dist/esm/providers/QueryClientProvider.js +2 -2
- package/dist/esm/providers/QueryClientProvider.js.map +1 -1
- package/dist/esm/providers/SDKClientProvider.js +3 -3
- package/dist/esm/providers/SDKClientProvider.js.map +1 -1
- package/dist/esm/providers/WidgetProvider/WidgetProvider.js +4 -5
- package/dist/esm/providers/WidgetProvider/WidgetProvider.js.map +1 -1
- package/dist/esm/stores/StoreProvider.js +3 -4
- package/dist/esm/stores/StoreProvider.js.map +1 -1
- package/dist/esm/stores/bookmarks/BookmarkStore.js +3 -3
- package/dist/esm/stores/bookmarks/BookmarkStore.js.map +1 -1
- package/dist/esm/stores/bookmarks/createBookmarkStore.js.map +1 -1
- package/dist/esm/stores/chains/ChainOrderStore.js +4 -4
- package/dist/esm/stores/chains/ChainOrderStore.js.map +1 -1
- package/dist/esm/stores/chains/createChainOrderStore.js.map +1 -1
- package/dist/esm/stores/form/FormStore.js +1 -1
- package/dist/esm/stores/form/FormStore.js.map +1 -1
- package/dist/esm/stores/form/URLSearchParamsBuilder.js +14 -3
- package/dist/esm/stores/form/URLSearchParamsBuilder.js.map +1 -1
- package/dist/esm/stores/form/createFormStore.js +6 -2
- package/dist/esm/stores/form/createFormStore.js.map +1 -1
- package/dist/esm/stores/form/getDefaultValuesFromQueryString.js +3 -0
- package/dist/esm/stores/form/getDefaultValuesFromQueryString.js.map +1 -1
- package/dist/esm/stores/form/types.d.ts +9 -1
- package/dist/esm/stores/form/types.d.ts.map +1 -1
- package/dist/esm/stores/form/types.js.map +1 -1
- package/dist/esm/stores/form/useClearAmountFields.js +1 -0
- package/dist/esm/stores/form/useClearAmountFields.js.map +1 -1
- package/dist/esm/stores/form/useFieldActions.js.map +1 -1
- package/dist/esm/stores/form/useFieldValues.js.map +1 -1
- package/dist/esm/stores/form/useFormRef.js.map +1 -1
- package/dist/esm/stores/form/useFormStore.js +2 -2
- package/dist/esm/stores/form/useFormStore.js.map +1 -1
- package/dist/esm/stores/header/useHeaderStore.js +3 -3
- package/dist/esm/stores/header/useHeaderStore.js.map +1 -1
- package/dist/esm/stores/inputMode/useInputModeStore.js.map +1 -1
- package/dist/esm/stores/navigationTabs/useNavigationTabLabel.js +22 -0
- package/dist/esm/stores/navigationTabs/useNavigationTabLabel.js.map +1 -0
- package/dist/esm/stores/navigationTabs/useNavigationTabsStore.js +64 -0
- package/dist/esm/stores/navigationTabs/useNavigationTabsStore.js.map +1 -0
- package/dist/esm/stores/navigationTabs/utils.js +122 -0
- package/dist/esm/stores/navigationTabs/utils.js.map +1 -0
- package/dist/esm/stores/pinnedTokens/PinnedTokensStore.js +3 -3
- package/dist/esm/stores/pinnedTokens/PinnedTokensStore.js.map +1 -1
- package/dist/esm/stores/pinnedTokens/createPinnedTokensStore.js.map +1 -1
- package/dist/esm/stores/routes/RouteExecutionStore.js +3 -3
- package/dist/esm/stores/routes/RouteExecutionStore.js.map +1 -1
- package/dist/esm/stores/routes/createRouteExecutionStore.js.map +1 -1
- package/dist/esm/stores/routes/useIntermediateRoutesStore.js.map +1 -1
- package/dist/esm/stores/routes/useRouteExecutionIndicator.js.map +1 -1
- package/dist/esm/stores/routes/utils.js.map +1 -1
- package/dist/esm/stores/settings/SettingsStore.js +3 -3
- package/dist/esm/stores/settings/SettingsStore.js.map +1 -1
- package/dist/esm/stores/settings/createSettingsStore.js +122 -96
- package/dist/esm/stores/settings/createSettingsStore.js.map +1 -1
- package/dist/esm/stores/settings/types.d.ts +0 -2
- package/dist/esm/stores/settings/types.d.ts.map +1 -1
- package/dist/esm/stores/settings/types.js.map +1 -1
- package/dist/esm/stores/settings/useSettingsActions.js.map +1 -1
- package/dist/esm/themes/createTheme.js.map +1 -1
- package/dist/esm/themes/utils.js.map +1 -1
- package/dist/esm/types/events.d.ts +10 -1
- package/dist/esm/types/events.d.ts.map +1 -1
- package/dist/esm/types/events.js +2 -0
- package/dist/esm/types/events.js.map +1 -1
- package/dist/esm/types/widget.d.ts +28 -2
- package/dist/esm/types/widget.d.ts.map +1 -1
- package/dist/esm/types/widget.js.map +1 -1
- package/dist/esm/utils/compactNumberFormatter.js.map +1 -1
- package/dist/esm/utils/converters.js.map +1 -1
- package/dist/esm/utils/deepEqual.js.map +1 -1
- package/dist/esm/utils/fees.js.map +1 -1
- package/dist/esm/utils/format.d.ts +1 -1
- package/dist/esm/utils/format.d.ts.map +1 -1
- package/dist/esm/utils/format.js +2 -2
- package/dist/esm/utils/format.js.map +1 -1
- package/dist/esm/utils/getActionMessage.js.map +1 -1
- package/dist/esm/utils/getErrorMessage.js.map +1 -1
- package/dist/esm/utils/item.js.map +1 -1
- package/dist/esm/utils/limitOrder.js +61 -0
- package/dist/esm/utils/limitOrder.js.map +1 -0
- package/dist/esm/utils/{variant.js → mode.js} +2 -2
- package/dist/esm/utils/mode.js.map +1 -0
- package/dist/esm/utils/navigationRoutes.d.ts +2 -0
- package/dist/esm/utils/navigationRoutes.d.ts.map +1 -1
- package/dist/esm/utils/navigationRoutes.js +6 -0
- package/dist/esm/utils/navigationRoutes.js.map +1 -1
- package/dist/esm/utils/prepareActions.js +1 -1
- package/dist/esm/utils/prepareActions.js.map +1 -1
- package/dist/esm/utils/timer.js.map +1 -1
- package/dist/esm/utils/token.js +1 -1
- package/dist/esm/utils/token.js.map +1 -1
- package/dist/esm/utils/tokenList.js.map +1 -1
- package/package.json +13 -13
- package/src/App.tsx +7 -7
- package/src/AppDefault.tsx +16 -0
- package/src/AppDrawer.tsx +77 -78
- package/src/AppDrawerContext.ts +2 -2
- package/src/components/AmountInput/AmountInputEndAdornment.style.ts +1 -1
- package/src/components/AmountInput/AmountInputEndAdornment.tsx +5 -2
- package/src/components/AmountInputCard/AmountInputCard.style.tsx +157 -0
- package/src/components/AmountInputCard/AmountInputCardPair.tsx +25 -0
- package/src/components/AmountInputCard/BalanceDisplay.style.tsx +9 -0
- package/src/components/AmountInputCard/BalanceDisplay.tsx +46 -0
- package/src/components/AmountInputCard/FiatValueToggle.tsx +55 -0
- package/src/components/AmountInputCard/PercentageChips.style.tsx +60 -0
- package/src/components/AmountInputCard/PercentageChips.tsx +100 -0
- package/src/components/AmountInputCard/ReceiveAmountCard.tsx +219 -0
- package/src/components/AmountInputCard/SendAmountCard.tsx +179 -0
- package/src/components/Avatar/Avatar.tsx +8 -3
- package/src/components/BaseTransactionButton/BaseTransactionButton.tsx +1 -0
- package/src/components/BottomSheet/BottomSheet.tsx +56 -52
- package/src/components/Header/CloseDrawerButton.tsx +5 -1
- package/src/components/Header/Header.tsx +20 -18
- package/src/components/Header/HeaderNavigationTabs.tsx +42 -0
- package/src/components/Header/HeaderTabs.tsx +48 -0
- package/src/components/Header/NavigationHeader.tsx +11 -8
- package/src/components/LimitOrderSettings/LimitOrderSettings.style.tsx +69 -0
- package/src/components/LimitOrderSettings/LimitOrderSettings.tsx +124 -0
- package/src/components/LimitPriceCard/LimitPriceCard.style.tsx +103 -0
- package/src/components/LimitPriceCard/LimitPriceCard.tsx +153 -0
- package/src/components/LimitPriceCard/LimitPricePresets.tsx +139 -0
- package/src/components/ReverseTokensButton/ReverseTokensButton.tsx +4 -1
- package/src/components/RouteCard/RouteProviderCard.tsx +113 -0
- package/src/components/Routes/LimitOrderRoutes.tsx +64 -0
- package/src/components/Routes/Routes.tsx +3 -2
- package/src/components/SettingsPanel/SettingsPanel.style.tsx +41 -0
- package/src/components/SettingsPanel/SettingsPanel.tsx +73 -0
- package/src/components/SettingsPanel/utils.ts +27 -0
- package/src/components/Skeleton/WidgetSkeleton.tsx +1 -1
- package/src/components/SwapButton/SwapButton.style.tsx +28 -0
- package/src/components/SwapButton/SwapButton.tsx +71 -0
- package/src/components/Tabs/NavigationTabs.tsx +3 -0
- package/src/components/TokenList/TokenDetailsSheet.tsx +9 -7
- package/src/components/TokenList/TokenDetailsSheetContent.tsx +176 -177
- package/src/components/TokenList/useTokenSelect.ts +2 -2
- package/src/components/TokenPillButton/TokenPillButton.style.tsx +50 -0
- package/src/components/TokenPillButton/TokenPillButton.tsx +81 -0
- package/src/config/version.ts +1 -1
- package/src/hooks/useLimitMarketRate.ts +39 -0
- package/src/hooks/useLinkedLimitFields.ts +74 -0
- package/src/hooks/useRoutes.ts +45 -4
- package/src/hooks/useSwapOnly.ts +2 -5
- package/src/hooks/useToAddressRequirements.ts +2 -2
- package/src/hooks/useWideVariant.ts +8 -2
- package/src/pages/MainPage/LimitPageContent.tsx +18 -0
- package/src/pages/MainPage/MainPage.tsx +43 -30
- package/src/pages/MainPage/MainPageActions.tsx +35 -0
- package/src/pages/MainPage/ReviewButton.tsx +15 -3
- package/src/pages/RoutePriorityPage.tsx +55 -0
- package/src/pages/SendToWallet/BookmarkAddressSheet.tsx +176 -185
- package/src/pages/SendToWallet/ConfirmAddressSheet.tsx +9 -6
- package/src/pages/SettingsPage/RoutePrioritySettings.tsx +14 -38
- package/src/pages/SettingsPage/SettingsCard/SettingCardExpandable.tsx +58 -65
- package/src/pages/SettingsPage/SettingsCard/SettingsAccordian.tsx +4 -4
- package/src/pages/SettingsPage/SlippageSettings/SlippagePage.tsx +176 -0
- package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.style.tsx +32 -25
- package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx +14 -128
- package/src/pages/SettingsPage/ThemeSettings.tsx +4 -0
- package/src/pages/TransactionPage/ConfirmToAddressSheet.tsx +9 -6
- package/src/pages/TransactionPage/ExchangeRateBottomSheet.tsx +53 -58
- package/src/pages/TransactionPage/TokenValueBottomSheet.tsx +24 -21
- package/src/pages/TransactionPage/TransactionExecutionContent.tsx +8 -6
- package/src/providers/QueryClientProvider.tsx +2 -2
- package/src/providers/SDKClientProvider.tsx +3 -7
- package/src/providers/WidgetProvider/WidgetProvider.tsx +6 -7
- package/src/stores/StoreProvider.tsx +3 -10
- package/src/stores/bookmarks/BookmarkStore.tsx +4 -4
- package/src/stores/chains/ChainOrderStore.tsx +4 -4
- package/src/stores/form/FormStore.tsx +2 -2
- package/src/stores/form/URLSearchParamsBuilder.tsx +25 -3
- package/src/stores/form/createFormStore.ts +7 -3
- package/src/stores/form/getDefaultValuesFromQueryString.ts +11 -0
- package/src/stores/form/types.ts +14 -1
- package/src/stores/form/useClearAmountFields.ts +1 -0
- package/src/stores/form/useFormStore.ts +2 -2
- package/src/stores/header/useHeaderStore.tsx +3 -5
- package/src/stores/navigationTabs/types.ts +33 -0
- package/src/stores/navigationTabs/useNavigationTabLabel.ts +28 -0
- package/src/stores/navigationTabs/useNavigationTabsStore.tsx +113 -0
- package/src/stores/navigationTabs/utils.ts +196 -0
- package/src/stores/pinnedTokens/PinnedTokensStore.tsx +4 -4
- package/src/stores/routes/RouteExecutionStore.tsx +4 -4
- package/src/stores/settings/SettingsStore.tsx +4 -4
- package/src/stores/settings/createSettingsStore.ts +48 -12
- package/src/stores/settings/types.ts +1 -16
- package/src/types/events.ts +12 -0
- package/src/types/widget.ts +40 -1
- package/src/utils/format.ts +6 -2
- package/src/utils/limitOrder.ts +88 -0
- package/src/utils/navigationRoutes.ts +6 -0
- package/dist/esm/components/Header/SplitNavigationTabs.js +0 -33
- package/dist/esm/components/Header/SplitNavigationTabs.js.map +0 -1
- package/dist/esm/stores/settings/useSplitModeStore.js +0 -36
- package/dist/esm/stores/settings/useSplitModeStore.js.map +0 -1
- package/dist/esm/utils/variant.js.map +0 -1
- package/src/components/Header/SplitNavigationTabs.tsx +0 -32
- package/src/stores/settings/useSplitModeStore.tsx +0 -58
- /package/src/utils/{variant.ts → mode.ts} +0 -0
package/src/AppDefault.tsx
CHANGED
|
@@ -12,6 +12,7 @@ import { NotFound } from './components/NotFound.js'
|
|
|
12
12
|
import { ActivitiesPage } from './pages/ActivitiesPage/ActivitiesPage.js'
|
|
13
13
|
import { LanguagesPage } from './pages/LanguagesPage.js'
|
|
14
14
|
import { MainPage } from './pages/MainPage/MainPage.js'
|
|
15
|
+
import { RoutePriorityPage } from './pages/RoutePriorityPage.js'
|
|
15
16
|
import { RoutesPage } from './pages/RoutesPage/RoutesPage.js'
|
|
16
17
|
import { SelectChainPage } from './pages/SelectChainPage/SelectChainPage.js'
|
|
17
18
|
import { SelectEnabledToolsPage } from './pages/SelectEnabledToolsPage.js'
|
|
@@ -22,6 +23,7 @@ import { RecentWalletsPage } from './pages/SendToWallet/RecentWalletsPage.js'
|
|
|
22
23
|
import { SendToConfiguredWalletPage } from './pages/SendToWallet/SendToConfiguredWalletPage.js'
|
|
23
24
|
import { SendToWalletPage } from './pages/SendToWallet/SendToWalletPage.js'
|
|
24
25
|
import { SettingsPage } from './pages/SettingsPage/SettingsPage.js'
|
|
26
|
+
import { SlippagePage } from './pages/SettingsPage/SlippageSettings/SlippagePage.js'
|
|
25
27
|
import { TransactionDetailsPage } from './pages/TransactionDetailsPage/TransactionDetailsPage.js'
|
|
26
28
|
import { TransactionPage } from './pages/TransactionPage/TransactionPage.js'
|
|
27
29
|
import { navigationRoutes } from './utils/navigationRoutes.js'
|
|
@@ -66,6 +68,18 @@ const settingsLanguagesRoute = createRoute({
|
|
|
66
68
|
component: LanguagesPage,
|
|
67
69
|
})
|
|
68
70
|
|
|
71
|
+
const settingsRoutePriorityRoute = createRoute({
|
|
72
|
+
getParentRoute: () => settingsLayoutRoute,
|
|
73
|
+
path: navigationRoutes.routePriority,
|
|
74
|
+
component: RoutePriorityPage,
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
const settingsSlippageRoute = createRoute({
|
|
78
|
+
getParentRoute: () => settingsLayoutRoute,
|
|
79
|
+
path: navigationRoutes.slippage,
|
|
80
|
+
component: SlippagePage,
|
|
81
|
+
})
|
|
82
|
+
|
|
69
83
|
const fromTokenLayoutRoute = createRoute({
|
|
70
84
|
getParentRoute: () => rootRoute,
|
|
71
85
|
path: navigationRoutes.fromToken,
|
|
@@ -214,6 +228,8 @@ const routeTree = rootRoute.addChildren([
|
|
|
214
228
|
settingsLayoutRoute.addChildren([
|
|
215
229
|
settingsIndexRoute,
|
|
216
230
|
settingsLanguagesRoute,
|
|
231
|
+
settingsRoutePriorityRoute,
|
|
232
|
+
settingsSlippageRoute,
|
|
217
233
|
settingsBridgesRoute,
|
|
218
234
|
settingsExchangesRoute,
|
|
219
235
|
]),
|
package/src/AppDrawer.tsx
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { Drawer } from '@mui/material'
|
|
2
|
-
import type {
|
|
3
|
-
ForwardRefExoticComponent,
|
|
4
|
-
PropsWithChildren,
|
|
5
|
-
RefAttributes,
|
|
6
|
-
} from 'react'
|
|
2
|
+
import type { JSX, PropsWithChildren, Ref } from 'react'
|
|
7
3
|
import {
|
|
8
|
-
forwardRef,
|
|
9
4
|
useCallback,
|
|
10
5
|
useImperativeHandle,
|
|
11
6
|
useMemo,
|
|
@@ -23,82 +18,86 @@ export interface WidgetDrawer {
|
|
|
23
18
|
closeDrawer(): void
|
|
24
19
|
}
|
|
25
20
|
|
|
26
|
-
export const AppDrawer
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
export const AppDrawer = ({
|
|
22
|
+
elementRef,
|
|
23
|
+
open,
|
|
24
|
+
onClose,
|
|
25
|
+
children,
|
|
26
|
+
ref,
|
|
27
|
+
}: PropsWithChildren<WidgetDrawerProps> & {
|
|
28
|
+
ref?: Ref<WidgetDrawer>
|
|
29
|
+
}): JSX.Element => {
|
|
30
|
+
const openRef = useRef(Boolean(open))
|
|
31
|
+
const [drawerOpen, setDrawerOpen] = useState(Boolean(open))
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
const toggleDrawer = useCallback(() => {
|
|
34
|
+
setDrawerOpen((open) => {
|
|
35
|
+
openRef.current = !open
|
|
36
|
+
return openRef.current
|
|
37
|
+
})
|
|
38
|
+
if (!openRef.current) {
|
|
39
|
+
onClose?.()
|
|
40
|
+
}
|
|
41
|
+
}, [onClose])
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
const openDrawer = useCallback(() => {
|
|
44
|
+
setDrawerOpen(true)
|
|
45
|
+
openRef.current = true
|
|
46
|
+
}, [])
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
const closeDrawer = useCallback(() => {
|
|
49
|
+
setDrawerOpen(false)
|
|
50
|
+
openRef.current = false
|
|
51
|
+
onClose?.()
|
|
52
|
+
}, [onClose])
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
54
|
+
useImperativeHandle(
|
|
55
|
+
ref,
|
|
56
|
+
() => ({
|
|
57
|
+
isOpen: () => openRef.current,
|
|
58
|
+
toggleDrawer,
|
|
59
|
+
openDrawer,
|
|
60
|
+
closeDrawer,
|
|
61
|
+
}),
|
|
62
|
+
[closeDrawer, openDrawer, toggleDrawer]
|
|
63
|
+
)
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
const drawerContext: WidgetDrawerContext = useMemo(
|
|
66
|
+
() => ({
|
|
67
|
+
closeDrawer,
|
|
68
|
+
}),
|
|
69
|
+
[closeDrawer]
|
|
70
|
+
)
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
72
|
+
return (
|
|
73
|
+
<DrawerContext value={drawerContext}>
|
|
74
|
+
<Drawer
|
|
75
|
+
ref={elementRef}
|
|
76
|
+
anchor="right"
|
|
77
|
+
open={drawerOpen}
|
|
78
|
+
onClose={closeDrawer}
|
|
79
|
+
slotProps={{
|
|
80
|
+
paper: {
|
|
81
|
+
sx: (theme) => ({
|
|
82
|
+
background: theme.vars.palette.background.default,
|
|
83
|
+
width: theme?.container?.width ?? '100%',
|
|
84
|
+
minWidth:
|
|
85
|
+
theme?.container?.minWidth ?? theme.breakpoints.values.xs,
|
|
86
|
+
maxWidth:
|
|
87
|
+
theme?.container?.maxWidth ?? theme.breakpoints.values.sm,
|
|
88
|
+
}),
|
|
89
|
+
},
|
|
90
|
+
backdrop: {
|
|
91
|
+
sx: {
|
|
92
|
+
backgroundColor: 'rgb(0 0 0 / 48%)',
|
|
93
|
+
backdropFilter: 'blur(3px)',
|
|
89
94
|
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
{children}
|
|
100
|
-
</Drawer>
|
|
101
|
-
</DrawerContext.Provider>
|
|
102
|
-
)
|
|
103
|
-
}
|
|
104
|
-
)
|
|
95
|
+
},
|
|
96
|
+
}}
|
|
97
|
+
keepMounted
|
|
98
|
+
>
|
|
99
|
+
{children}
|
|
100
|
+
</Drawer>
|
|
101
|
+
</DrawerContext>
|
|
102
|
+
)
|
|
103
|
+
}
|
package/src/AppDrawerContext.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Context, createContext,
|
|
1
|
+
import { type Context, createContext, use } from 'react'
|
|
2
2
|
|
|
3
3
|
export interface WidgetDrawerContext {
|
|
4
4
|
closeDrawer?(): void
|
|
@@ -7,4 +7,4 @@ export interface WidgetDrawerContext {
|
|
|
7
7
|
export const DrawerContext: Context<WidgetDrawerContext> =
|
|
8
8
|
createContext<WidgetDrawerContext>({})
|
|
9
9
|
|
|
10
|
-
export const useDrawer = (): WidgetDrawerContext =>
|
|
10
|
+
export const useDrawer = (): WidgetDrawerContext => use(DrawerContext)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { formatUnits } from '@lifi/sdk'
|
|
2
|
+
import { useAccount } from '@lifi/wallet-management'
|
|
2
3
|
import type React from 'react'
|
|
3
4
|
import { type JSX, memo } from 'react'
|
|
4
5
|
import { useTranslation } from 'react-i18next'
|
|
@@ -25,6 +26,9 @@ export const AmountInputEndAdornment: React.NamedExoticComponent<FormTypeProps>
|
|
|
25
26
|
FormKeyHelper.getTokenKey(formType)
|
|
26
27
|
)
|
|
27
28
|
|
|
29
|
+
const chain = getChainById(chainId)
|
|
30
|
+
const { account } = useAccount({ chainType: chain?.chainType })
|
|
31
|
+
|
|
28
32
|
// We get gas recommendations for the source chain to make sure that after pressing the Max button
|
|
29
33
|
// the user will have enough funds remaining to cover gas costs
|
|
30
34
|
const { data } = useGasRecommendation(chainId)
|
|
@@ -35,7 +39,6 @@ export const AmountInputEndAdornment: React.NamedExoticComponent<FormTypeProps>
|
|
|
35
39
|
if (!token?.amount) {
|
|
36
40
|
return 0n
|
|
37
41
|
}
|
|
38
|
-
const chain = getChainById(chainId)
|
|
39
42
|
let maxAmount = token.amount
|
|
40
43
|
if (chain?.nativeToken.address === tokenAddress && data?.recommended) {
|
|
41
44
|
const recommendedAmount = BigInt(data.recommended.amount)
|
|
@@ -73,7 +76,7 @@ export const AmountInputEndAdornment: React.NamedExoticComponent<FormTypeProps>
|
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
78
|
|
|
76
|
-
if (formType !== 'from' || !token) {
|
|
79
|
+
if (formType !== 'from' || !token || !account?.isConnected) {
|
|
77
80
|
return null
|
|
78
81
|
}
|
|
79
82
|
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box,
|
|
3
|
+
ButtonBase,
|
|
4
|
+
InputBase,
|
|
5
|
+
inputBaseClasses,
|
|
6
|
+
styled,
|
|
7
|
+
Typography,
|
|
8
|
+
} from '@mui/material'
|
|
9
|
+
import type React from 'react'
|
|
10
|
+
import type { FormType } from '../../stores/form/types.js'
|
|
11
|
+
import { InputCard } from '../Card/InputCard.js'
|
|
12
|
+
|
|
13
|
+
export const maxInputFontSize = 30
|
|
14
|
+
export const minInputFontSize = 20
|
|
15
|
+
export const amountHeight = 32
|
|
16
|
+
export const footerFontSize = 12
|
|
17
|
+
|
|
18
|
+
export const AmountCard: React.FC<
|
|
19
|
+
React.ComponentProps<typeof InputCard> & {
|
|
20
|
+
formType?: FormType
|
|
21
|
+
mask?: boolean
|
|
22
|
+
}
|
|
23
|
+
> = styled(InputCard, {
|
|
24
|
+
shouldForwardProp: (prop) => !['formType', 'mask'].includes(prop as string),
|
|
25
|
+
})<{ formType?: FormType; mask?: boolean }>(
|
|
26
|
+
({ theme, formType, mask = true }) => {
|
|
27
|
+
const cardVariant = theme.components?.MuiCard?.defaultProps?.variant
|
|
28
|
+
// Notch faces the swap button between the stacked cards: bottom edge for the
|
|
29
|
+
// top (send) card, top edge for the bottom (receive) card.
|
|
30
|
+
const vertical = formType === 'to' ? '-4px' : 'calc(100% + 4px)'
|
|
31
|
+
return {
|
|
32
|
+
display: 'flex',
|
|
33
|
+
flexDirection: 'column',
|
|
34
|
+
gap: theme.spacing(1.5),
|
|
35
|
+
padding: theme.spacing(2),
|
|
36
|
+
...(cardVariant !== 'outlined' &&
|
|
37
|
+
mask && {
|
|
38
|
+
mask: `radial-gradient(circle 22px at 50% ${vertical}, #fff0 96%, #fff) 100% 100% / 100% 100% no-repeat`,
|
|
39
|
+
}),
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
export const CardHeaderRow: React.FC<React.ComponentProps<typeof Box>> = styled(
|
|
45
|
+
Box
|
|
46
|
+
)(({ theme }) => ({
|
|
47
|
+
display: 'flex',
|
|
48
|
+
justifyContent: 'space-between',
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
padding: 0,
|
|
51
|
+
height: theme.spacing(2),
|
|
52
|
+
}))
|
|
53
|
+
|
|
54
|
+
export const CardBodyRow: React.FC<React.ComponentProps<typeof Box>> = styled(
|
|
55
|
+
Box
|
|
56
|
+
)(({ theme }) => ({
|
|
57
|
+
display: 'flex',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
gap: theme.spacing(2),
|
|
60
|
+
}))
|
|
61
|
+
|
|
62
|
+
export const CardFooterRow: React.FC<React.ComponentProps<typeof Box>> = styled(
|
|
63
|
+
Box
|
|
64
|
+
)(({ theme }) => ({
|
|
65
|
+
display: 'flex',
|
|
66
|
+
justifyContent: 'space-between',
|
|
67
|
+
alignItems: 'center',
|
|
68
|
+
height: theme.spacing(2),
|
|
69
|
+
}))
|
|
70
|
+
|
|
71
|
+
export const LargeInput: React.FC<React.ComponentProps<typeof InputBase>> =
|
|
72
|
+
styled(InputBase)(({ theme }) => ({
|
|
73
|
+
fontSize: maxInputFontSize,
|
|
74
|
+
fontWeight: 700,
|
|
75
|
+
lineHeight: 1.4,
|
|
76
|
+
height: amountHeight,
|
|
77
|
+
flex: 1,
|
|
78
|
+
minWidth: 0,
|
|
79
|
+
boxShadow: 'none',
|
|
80
|
+
[`.${inputBaseClasses.input}`]: {
|
|
81
|
+
height: amountHeight,
|
|
82
|
+
padding: 0,
|
|
83
|
+
},
|
|
84
|
+
[`.${inputBaseClasses.input}::placeholder`]: {
|
|
85
|
+
color: theme.vars.palette.text.primary,
|
|
86
|
+
opacity: 0.5,
|
|
87
|
+
},
|
|
88
|
+
'& input[type="number"]::-webkit-outer-spin-button, & input[type="number"]::-webkit-inner-spin-button':
|
|
89
|
+
{
|
|
90
|
+
WebkitAppearance: 'none',
|
|
91
|
+
margin: 0,
|
|
92
|
+
},
|
|
93
|
+
'& input[type="number"]': {
|
|
94
|
+
MozAppearance: 'textfield',
|
|
95
|
+
},
|
|
96
|
+
[`&.${inputBaseClasses.disabled}`]: {
|
|
97
|
+
color: 'inherit',
|
|
98
|
+
},
|
|
99
|
+
[`.${inputBaseClasses.input}.${inputBaseClasses.disabled}`]: {
|
|
100
|
+
WebkitTextFillColor: 'unset',
|
|
101
|
+
},
|
|
102
|
+
}))
|
|
103
|
+
|
|
104
|
+
export const AmountDisplay: React.FC<React.ComponentProps<typeof Typography>> =
|
|
105
|
+
styled(Typography)(() => ({
|
|
106
|
+
fontSize: maxInputFontSize,
|
|
107
|
+
fontWeight: 700,
|
|
108
|
+
lineHeight: 1.4,
|
|
109
|
+
height: amountHeight,
|
|
110
|
+
display: 'flex',
|
|
111
|
+
alignItems: 'center',
|
|
112
|
+
flex: 1,
|
|
113
|
+
minWidth: 0,
|
|
114
|
+
overflow: 'visible',
|
|
115
|
+
whiteSpace: 'nowrap',
|
|
116
|
+
}))
|
|
117
|
+
|
|
118
|
+
export const FooterText: React.FC<React.ComponentProps<typeof Typography>> =
|
|
119
|
+
styled(Typography)(({ theme }) => ({
|
|
120
|
+
fontSize: footerFontSize,
|
|
121
|
+
fontWeight: 500,
|
|
122
|
+
lineHeight: 1,
|
|
123
|
+
color: theme.vars.palette.text.secondary,
|
|
124
|
+
}))
|
|
125
|
+
|
|
126
|
+
export const CardContainer: React.FC<React.ComponentProps<typeof Box>> = styled(
|
|
127
|
+
Box
|
|
128
|
+
)(() => ({
|
|
129
|
+
display: 'flex',
|
|
130
|
+
flexDirection: 'column',
|
|
131
|
+
position: 'relative',
|
|
132
|
+
}))
|
|
133
|
+
|
|
134
|
+
export const ToggleButton: React.FC<
|
|
135
|
+
React.ComponentProps<typeof ButtonBase> & { clickable?: boolean }
|
|
136
|
+
> = styled(ButtonBase, {
|
|
137
|
+
shouldForwardProp: (prop) => prop !== 'clickable',
|
|
138
|
+
})<{ clickable?: boolean }>(({ theme, clickable }) => ({
|
|
139
|
+
display: 'flex',
|
|
140
|
+
alignItems: 'center',
|
|
141
|
+
gap: theme.spacing(0.25),
|
|
142
|
+
borderRadius: theme.vars.shape.borderRadiusSecondary,
|
|
143
|
+
padding: theme.spacing(0.25, 0.5, 0.25, 0.75),
|
|
144
|
+
marginLeft: theme.spacing(-0.75),
|
|
145
|
+
backgroundColor: 'transparent',
|
|
146
|
+
...(clickable
|
|
147
|
+
? {
|
|
148
|
+
cursor: 'pointer',
|
|
149
|
+
'&:hover': {
|
|
150
|
+
backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
|
|
151
|
+
},
|
|
152
|
+
}
|
|
153
|
+
: {
|
|
154
|
+
cursor: 'default',
|
|
155
|
+
pointerEvents: 'none',
|
|
156
|
+
}),
|
|
157
|
+
}))
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { BoxProps } from '@mui/material'
|
|
2
|
+
import type React from 'react'
|
|
3
|
+
import type { JSX } from 'react'
|
|
4
|
+
import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js'
|
|
5
|
+
import { LimitPriceCard } from '../LimitPriceCard/LimitPriceCard.js'
|
|
6
|
+
import { SwapButton } from '../SwapButton/SwapButton.js'
|
|
7
|
+
import { CardContainer } from './AmountInputCard.style.js'
|
|
8
|
+
import { ReceiveAmountCard } from './ReceiveAmountCard.js'
|
|
9
|
+
import { SendAmountCard } from './SendAmountCard.js'
|
|
10
|
+
|
|
11
|
+
export const AmountInputCardPair: React.FC<BoxProps> = (props): JSX.Element => {
|
|
12
|
+
// Refuel's destination is fixed to native gas, so reversing from/to is
|
|
13
|
+
// meaningless — hide the swap button (and the notch mask it sits in).
|
|
14
|
+
const { mode } = useWidgetConfig()
|
|
15
|
+
const showSwapButton = mode !== 'refuel'
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<CardContainer {...props}>
|
|
19
|
+
{mode === 'limit' ? <LimitPriceCard sx={{ marginBottom: 1 }} /> : null}
|
|
20
|
+
<SendAmountCard mask={showSwapButton} />
|
|
21
|
+
<SwapButton sx={{ visibility: showSwapButton ? 'visible' : 'hidden' }} />
|
|
22
|
+
<ReceiveAmountCard mask={showSwapButton} />
|
|
23
|
+
</CardContainer>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Box, styled } from '@mui/material'
|
|
2
|
+
import type React from 'react'
|
|
3
|
+
|
|
4
|
+
export const BalanceContainer: React.FC<React.ComponentProps<typeof Box>> =
|
|
5
|
+
styled(Box)(({ theme }) => ({
|
|
6
|
+
display: 'flex',
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
gap: theme.spacing(0.5),
|
|
9
|
+
}))
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import AccountBalanceWalletOutlinedIcon from '@mui/icons-material/AccountBalanceWalletOutlined'
|
|
2
|
+
import { Skeleton } from '@mui/material'
|
|
3
|
+
import { type JSX, memo } from 'react'
|
|
4
|
+
import { useTranslation } from 'react-i18next'
|
|
5
|
+
import { useTokenAddressBalance } from '../../hooks/useTokenAddressBalance.js'
|
|
6
|
+
import type { FormTypeProps } from '../../stores/form/types.js'
|
|
7
|
+
import { FormKeyHelper } from '../../stores/form/types.js'
|
|
8
|
+
import { useFieldValues } from '../../stores/form/useFieldValues.js'
|
|
9
|
+
import { formatTokenAmount } from '../../utils/format.js'
|
|
10
|
+
import { FooterText, footerFontSize } from './AmountInputCard.style.js'
|
|
11
|
+
import { BalanceContainer } from './BalanceDisplay.style.js'
|
|
12
|
+
|
|
13
|
+
export const BalanceDisplay: React.NamedExoticComponent<FormTypeProps> = memo(
|
|
14
|
+
({ formType }: FormTypeProps): JSX.Element | null => {
|
|
15
|
+
const { t } = useTranslation()
|
|
16
|
+
const [chainId, tokenAddress] = useFieldValues(
|
|
17
|
+
FormKeyHelper.getChainKey(formType),
|
|
18
|
+
FormKeyHelper.getTokenKey(formType)
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
const { token, isLoading } = useTokenAddressBalance(chainId, tokenAddress)
|
|
22
|
+
|
|
23
|
+
if (isLoading && tokenAddress) {
|
|
24
|
+
return (
|
|
25
|
+
<Skeleton variant="text" width={72} sx={{ fontSize: footerFontSize }} />
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (!token?.amount) {
|
|
30
|
+
return null
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const tokenAmount = formatTokenAmount(token.amount, token.decimals)
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<BalanceContainer>
|
|
37
|
+
<FooterText title={tokenAmount}>
|
|
38
|
+
{t('format.tokenAmount', { value: tokenAmount })}
|
|
39
|
+
</FooterText>
|
|
40
|
+
<AccountBalanceWalletOutlinedIcon
|
|
41
|
+
sx={{ fontSize: 16, color: 'text.secondary' }}
|
|
42
|
+
/>
|
|
43
|
+
</BalanceContainer>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import SwapVertIcon from '@mui/icons-material/SwapVert'
|
|
2
|
+
import { type JSX, memo } from 'react'
|
|
3
|
+
import { useTranslation } from 'react-i18next'
|
|
4
|
+
import { useToken } from '../../hooks/useToken.js'
|
|
5
|
+
import type { FormTypeProps } from '../../stores/form/types.js'
|
|
6
|
+
import { FormKeyHelper } from '../../stores/form/types.js'
|
|
7
|
+
import { useFieldValues } from '../../stores/form/useFieldValues.js'
|
|
8
|
+
import { useInputModeStore } from '../../stores/inputMode/useInputModeStore.js'
|
|
9
|
+
import { formatTokenPrice } from '../../utils/format.js'
|
|
10
|
+
import { FooterText, ToggleButton } from './AmountInputCard.style.js'
|
|
11
|
+
|
|
12
|
+
export const FiatValueToggle: React.NamedExoticComponent<FormTypeProps> = memo(
|
|
13
|
+
({ formType }: FormTypeProps): JSX.Element => {
|
|
14
|
+
const { t } = useTranslation()
|
|
15
|
+
const [chainId, tokenAddress, amount] = useFieldValues(
|
|
16
|
+
FormKeyHelper.getChainKey(formType),
|
|
17
|
+
FormKeyHelper.getTokenKey(formType),
|
|
18
|
+
FormKeyHelper.getAmountKey(formType)
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
const { token } = useToken(chainId, tokenAddress)
|
|
22
|
+
const { inputMode, toggleInputMode } = useInputModeStore()
|
|
23
|
+
const currentInputMode = inputMode[formType]
|
|
24
|
+
|
|
25
|
+
const handleToggle = (e: React.MouseEvent): void => {
|
|
26
|
+
e.stopPropagation()
|
|
27
|
+
toggleInputMode(formType)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const canToggle = !!token?.priceUSD
|
|
31
|
+
|
|
32
|
+
const displayValue =
|
|
33
|
+
currentInputMode === 'amount'
|
|
34
|
+
? t('format.currency', {
|
|
35
|
+
value: formatTokenPrice(amount, token?.priceUSD, token?.decimals),
|
|
36
|
+
})
|
|
37
|
+
: t('format.tokenAmount', { value: amount || '0' })
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<ToggleButton
|
|
41
|
+
clickable={canToggle}
|
|
42
|
+
onClick={canToggle ? handleToggle : undefined}
|
|
43
|
+
aria-label={canToggle ? 'Toggle fiat value' : undefined}
|
|
44
|
+
>
|
|
45
|
+
<FooterText>{displayValue}</FooterText>
|
|
46
|
+
{currentInputMode === 'price' && token?.symbol ? (
|
|
47
|
+
<FooterText>{token.symbol}</FooterText>
|
|
48
|
+
) : null}
|
|
49
|
+
{canToggle ? (
|
|
50
|
+
<SwapVertIcon sx={{ fontSize: 14, color: 'text.secondary' }} />
|
|
51
|
+
) : null}
|
|
52
|
+
</ToggleButton>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Box, Button, styled } from '@mui/material'
|
|
2
|
+
import { cardClasses } from '@mui/material/Card'
|
|
3
|
+
import type React from 'react'
|
|
4
|
+
|
|
5
|
+
const chipCount = 4
|
|
6
|
+
const staggerStepMs = 25
|
|
7
|
+
|
|
8
|
+
const revealStagger = Object.fromEntries(
|
|
9
|
+
Array.from({ length: chipCount }, (_, index) => [
|
|
10
|
+
`&[data-delay="${index}"]`,
|
|
11
|
+
{
|
|
12
|
+
[`.${cardClasses.root}:hover &`]: {
|
|
13
|
+
opacity: 1,
|
|
14
|
+
transform: 'scale(1) translateX(0)',
|
|
15
|
+
pointerEvents: 'auto',
|
|
16
|
+
transitionDelay: `${(chipCount - 1 - index) * staggerStepMs}ms`,
|
|
17
|
+
},
|
|
18
|
+
[`.${cardClasses.root}:not(:hover) &`]: {
|
|
19
|
+
transitionDelay: `${index * staggerStepMs}ms`,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
])
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
export const ChipContainer: React.FC<React.ComponentProps<typeof Box>> = styled(
|
|
26
|
+
Box
|
|
27
|
+
)(({ theme }) => ({
|
|
28
|
+
display: 'flex',
|
|
29
|
+
gap: theme.spacing(0.5),
|
|
30
|
+
}))
|
|
31
|
+
|
|
32
|
+
export const Chip: React.FC<React.ComponentProps<typeof Button>> = styled(
|
|
33
|
+
Button
|
|
34
|
+
)(({ theme }) => ({
|
|
35
|
+
minWidth: 0,
|
|
36
|
+
padding: theme.spacing(0.5, 1.5),
|
|
37
|
+
fontSize: 12,
|
|
38
|
+
fontWeight: 700,
|
|
39
|
+
lineHeight: 1.3334,
|
|
40
|
+
backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
|
|
41
|
+
color: theme.vars.palette.text.primary,
|
|
42
|
+
transition:
|
|
43
|
+
'opacity 200ms cubic-bezier(0.4, 0, 0.2, 1), transform 200ms cubic-bezier(0.4, 0, 0.2, 1), background-color 200ms ease',
|
|
44
|
+
'&:hover': {
|
|
45
|
+
backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 8%, transparent)`,
|
|
46
|
+
},
|
|
47
|
+
// Reveal-on-hover — only on devices that support hover. On touch there is no
|
|
48
|
+
// hover, so the chips stay permanently visible (the default above) instead of
|
|
49
|
+
// becoming an unreachable dead row.
|
|
50
|
+
'@media (hover: hover)': {
|
|
51
|
+
opacity: 0,
|
|
52
|
+
transform: 'scale(0.85) translateX(10px)',
|
|
53
|
+
pointerEvents: 'none',
|
|
54
|
+
...revealStagger,
|
|
55
|
+
'@media (prefers-reduced-motion: reduce)': {
|
|
56
|
+
transform: 'none !important',
|
|
57
|
+
transitionDelay: '0ms !important',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
}))
|