@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
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { type ChangeEvent, type JSX, useEffect, useRef, useState } from 'react'
|
|
2
|
+
import { useTranslation } from 'react-i18next'
|
|
3
|
+
import { ChipContainer } from '../AmountInputCard/PercentageChips.style.js'
|
|
4
|
+
import {
|
|
5
|
+
EditablePriceChip,
|
|
6
|
+
PriceChip,
|
|
7
|
+
PriceChipInput,
|
|
8
|
+
} from './LimitPriceCard.style.js'
|
|
9
|
+
|
|
10
|
+
/** Quick-set presets, as percentage offsets from market (0 = at market). */
|
|
11
|
+
const PRESETS = [0, 1, 5, 10] as const
|
|
12
|
+
|
|
13
|
+
interface LimitPricePresetsProps {
|
|
14
|
+
/** Apply a percentage offset from the market rate (0 = at market). */
|
|
15
|
+
onSelect: (pct: number) => void
|
|
16
|
+
/** Disables the free-form custom pill (no tokens / no market rate yet). */
|
|
17
|
+
disabled: boolean
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Row of quick-set price controls: fixed percentage presets plus a free-form
|
|
22
|
+
* "custom %" pill that collapses to a button until engaged. Owns its own
|
|
23
|
+
* custom-input state so the card only deals with applying an offset.
|
|
24
|
+
*/
|
|
25
|
+
export const LimitPricePresets = ({
|
|
26
|
+
onSelect,
|
|
27
|
+
disabled,
|
|
28
|
+
}: LimitPricePresetsProps): JSX.Element => {
|
|
29
|
+
const { t } = useTranslation()
|
|
30
|
+
const customInputRef = useRef<HTMLInputElement>(null)
|
|
31
|
+
const [customPct, setCustomPct] = useState('')
|
|
32
|
+
const [customFocused, setCustomFocused] = useState(false)
|
|
33
|
+
|
|
34
|
+
// The custom pill renders as a plain button until engaged; when it flips into
|
|
35
|
+
// edit mode (focused), move the caret into the freshly-mounted input.
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (customFocused) {
|
|
38
|
+
customInputRef.current?.focus()
|
|
39
|
+
}
|
|
40
|
+
}, [customFocused])
|
|
41
|
+
|
|
42
|
+
// Picking a fixed preset clears any custom value so the custom pill collapses
|
|
43
|
+
// back to its "Custom" button instead of showing a stale, no-longer-applied %.
|
|
44
|
+
const handlePresetClick = (pct: number): void => {
|
|
45
|
+
setCustomPct('')
|
|
46
|
+
setCustomFocused(false)
|
|
47
|
+
onSelect(pct)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Free-form offset pill: apply the typed percentage live so the price input
|
|
51
|
+
// tracks the offset as the user types. Accepts an optional leading +/- sign
|
|
52
|
+
// so the price can be set above (premium) or below (discount) market.
|
|
53
|
+
const handleCustomChange = (event: ChangeEvent<HTMLInputElement>): void => {
|
|
54
|
+
const raw = event.target.value
|
|
55
|
+
if (raw && !/^[+-]?\d*\.?\d*$/.test(raw)) {
|
|
56
|
+
return
|
|
57
|
+
}
|
|
58
|
+
setCustomPct(raw)
|
|
59
|
+
const numeric = Number(raw)
|
|
60
|
+
// Bare '', '+', '-', '.' etc. aren't applicable numbers yet — Number() maps
|
|
61
|
+
// the signs/dot to NaN, and '' to 0, so guard both.
|
|
62
|
+
if (raw === '' || Number.isNaN(numeric)) {
|
|
63
|
+
return
|
|
64
|
+
}
|
|
65
|
+
onSelect(numeric)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const handleCustomKeyDown = (
|
|
69
|
+
event: React.KeyboardEvent<HTMLInputElement>
|
|
70
|
+
): void => {
|
|
71
|
+
if (event.key === 'Enter') {
|
|
72
|
+
event.currentTarget.blur()
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// On blur, surface an explicit sign: a bare positive entry like "10" reads as
|
|
77
|
+
// "+10" so the direction (above/below market) is unambiguous once collapsed.
|
|
78
|
+
const handleCustomBlur = (): void => {
|
|
79
|
+
setCustomFocused(false)
|
|
80
|
+
setCustomPct((prev) => {
|
|
81
|
+
if (!prev || prev.startsWith('+') || prev.startsWith('-')) {
|
|
82
|
+
return prev
|
|
83
|
+
}
|
|
84
|
+
return Number.isNaN(Number(prev)) ? prev : `+${prev}`
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Collapse to a plain "Custom" label only while empty and unfocused; once the
|
|
89
|
+
// user engages (focus) or has typed a value, reveal the `+__%` affixes.
|
|
90
|
+
const showCustomLabel = customPct === '' && !customFocused
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<ChipContainer sx={{ marginTop: 0.5, flexWrap: 'wrap' }}>
|
|
94
|
+
{PRESETS.map((pct) => (
|
|
95
|
+
<PriceChip key={pct} onClick={() => handlePresetClick(pct)}>
|
|
96
|
+
{pct === 0 ? t('limitOrder.market') : `+${pct}%`}
|
|
97
|
+
</PriceChip>
|
|
98
|
+
))}
|
|
99
|
+
{showCustomLabel ? (
|
|
100
|
+
<PriceChip disabled={disabled} onClick={() => setCustomFocused(true)}>
|
|
101
|
+
{t('limitOrder.custom')}
|
|
102
|
+
</PriceChip>
|
|
103
|
+
) : (
|
|
104
|
+
<EditablePriceChip
|
|
105
|
+
aria-disabled={disabled}
|
|
106
|
+
onClick={(event) => {
|
|
107
|
+
// `aria-disabled` only announces the state; enforce it so a
|
|
108
|
+
// programmatic click can't apply an offset while disabled.
|
|
109
|
+
if (disabled) {
|
|
110
|
+
return
|
|
111
|
+
}
|
|
112
|
+
const input = event.currentTarget.querySelector('input')
|
|
113
|
+
input?.focus()
|
|
114
|
+
const numeric = Number(customPct)
|
|
115
|
+
if (customPct && !Number.isNaN(numeric)) {
|
|
116
|
+
onSelect(numeric)
|
|
117
|
+
}
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
<PriceChipInput
|
|
121
|
+
ref={customInputRef}
|
|
122
|
+
inputMode="decimal"
|
|
123
|
+
autoComplete="off"
|
|
124
|
+
placeholder="0"
|
|
125
|
+
aria-label={t('limitOrder.custom')}
|
|
126
|
+
value={customPct}
|
|
127
|
+
onChange={handleCustomChange}
|
|
128
|
+
onKeyDown={handleCustomKeyDown}
|
|
129
|
+
onFocus={() => setCustomFocused(true)}
|
|
130
|
+
onBlur={handleCustomBlur}
|
|
131
|
+
disabled={disabled}
|
|
132
|
+
style={{ width: `${Math.max(customPct.length, 1)}ch` }}
|
|
133
|
+
/>
|
|
134
|
+
%
|
|
135
|
+
</EditablePriceChip>
|
|
136
|
+
)}
|
|
137
|
+
</ChipContainer>
|
|
138
|
+
)
|
|
139
|
+
}
|
|
@@ -50,7 +50,10 @@ export const ReverseTokensButton = (): JSX.Element => {
|
|
|
50
50
|
}
|
|
51
51
|
return (
|
|
52
52
|
<ReverseContainer>
|
|
53
|
-
<IconCard
|
|
53
|
+
<IconCard
|
|
54
|
+
data-testid="widget-reverse-tokens-button"
|
|
55
|
+
onClick={handleClick}
|
|
56
|
+
>
|
|
54
57
|
<ArrowForward fontSize="inherit" />
|
|
55
58
|
</IconCard>
|
|
56
59
|
</ReverseContainer>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type { Route } from '@lifi/sdk'
|
|
2
|
+
import LocalGasStationRounded from '@mui/icons-material/LocalGasStationRounded'
|
|
3
|
+
import { Box, Skeleton, Typography } from '@mui/material'
|
|
4
|
+
import { useTranslation } from 'react-i18next'
|
|
5
|
+
import { getAccumulatedFeeCostsBreakdown } from '../../utils/fees.js'
|
|
6
|
+
import { SmallAvatar } from '../Avatar/SmallAvatar.js'
|
|
7
|
+
import type { CardProps } from '../Card/Card.js'
|
|
8
|
+
import { Card } from '../Card/Card.js'
|
|
9
|
+
import { IconTypography } from '../IconTypography.js'
|
|
10
|
+
|
|
11
|
+
interface RouteProviderCardProps {
|
|
12
|
+
route: Route
|
|
13
|
+
active?: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const RouteProviderCard: React.FC<
|
|
17
|
+
RouteProviderCardProps & Omit<CardProps, 'variant'>
|
|
18
|
+
> = ({ route, active, onClick, ...other }) => {
|
|
19
|
+
const { t } = useTranslation()
|
|
20
|
+
|
|
21
|
+
const provider = route.steps[0]?.toolDetails
|
|
22
|
+
const { gasCostUSD } = getAccumulatedFeeCostsBreakdown(route)
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Card
|
|
26
|
+
type={active ? 'selected' : 'default'}
|
|
27
|
+
selectionColor="secondary"
|
|
28
|
+
onClick={onClick}
|
|
29
|
+
sx={{ py: 1.5, px: 2, ...(onClick ? { cursor: 'pointer' } : {}) }}
|
|
30
|
+
{...other}
|
|
31
|
+
>
|
|
32
|
+
<Box
|
|
33
|
+
sx={{
|
|
34
|
+
display: 'flex',
|
|
35
|
+
alignItems: 'center',
|
|
36
|
+
justifyContent: 'space-between',
|
|
37
|
+
gap: 1,
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
<Box
|
|
41
|
+
sx={{
|
|
42
|
+
display: 'flex',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
gap: 1,
|
|
45
|
+
minWidth: 0,
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
<SmallAvatar src={provider?.logoURI} alt={provider?.name} size={20}>
|
|
49
|
+
{provider?.name?.[0]}
|
|
50
|
+
</SmallAvatar>
|
|
51
|
+
<Typography
|
|
52
|
+
noWrap
|
|
53
|
+
sx={{
|
|
54
|
+
fontSize: 14,
|
|
55
|
+
fontWeight: 600,
|
|
56
|
+
color: 'text.primary',
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
59
|
+
{provider?.name}
|
|
60
|
+
</Typography>
|
|
61
|
+
</Box>
|
|
62
|
+
<Box
|
|
63
|
+
sx={{
|
|
64
|
+
display: 'flex',
|
|
65
|
+
alignItems: 'center',
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
<IconTypography component="span" sx={{ mr: 0.5, fontSize: 16 }}>
|
|
69
|
+
<LocalGasStationRounded fontSize="inherit" />
|
|
70
|
+
</IconTypography>
|
|
71
|
+
<Typography
|
|
72
|
+
data-value={gasCostUSD}
|
|
73
|
+
sx={{
|
|
74
|
+
fontSize: 14,
|
|
75
|
+
color: 'text.primary',
|
|
76
|
+
fontWeight: 600,
|
|
77
|
+
lineHeight: 1,
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
{!gasCostUSD
|
|
81
|
+
? t('main.fees.free')
|
|
82
|
+
: t('format.currency', {
|
|
83
|
+
value: gasCostUSD,
|
|
84
|
+
})}
|
|
85
|
+
</Typography>
|
|
86
|
+
</Box>
|
|
87
|
+
</Box>
|
|
88
|
+
</Card>
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export const RouteProviderCardSkeleton: React.FC<Omit<CardProps, 'variant'>> = (
|
|
93
|
+
props
|
|
94
|
+
) => {
|
|
95
|
+
return (
|
|
96
|
+
<Card sx={{ py: 1.5, px: 2 }} {...props}>
|
|
97
|
+
<Box
|
|
98
|
+
sx={{
|
|
99
|
+
display: 'flex',
|
|
100
|
+
alignItems: 'center',
|
|
101
|
+
justifyContent: 'space-between',
|
|
102
|
+
gap: 1,
|
|
103
|
+
}}
|
|
104
|
+
>
|
|
105
|
+
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
|
106
|
+
<Skeleton variant="circular" width={20} height={20} />
|
|
107
|
+
<Skeleton variant="text" width={80} height={20} />
|
|
108
|
+
</Box>
|
|
109
|
+
<Skeleton variant="text" width={56} height={20} />
|
|
110
|
+
</Box>
|
|
111
|
+
</Card>
|
|
112
|
+
)
|
|
113
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Stack } from '@mui/material'
|
|
2
|
+
import { useRoutes } from '../../hooks/useRoutes.js'
|
|
3
|
+
import { useToAddressRequirements } from '../../hooks/useToAddressRequirements.js'
|
|
4
|
+
import { useFieldActions } from '../../stores/form/useFieldActions.js'
|
|
5
|
+
import { useFieldValues } from '../../stores/form/useFieldValues.js'
|
|
6
|
+
import type { CardProps } from '../Card/Card.js'
|
|
7
|
+
import { RouteNotFoundCard } from '../RouteCard/RouteNotFoundCard.js'
|
|
8
|
+
import {
|
|
9
|
+
RouteProviderCard,
|
|
10
|
+
RouteProviderCardSkeleton,
|
|
11
|
+
} from '../RouteCard/RouteProviderCard.js'
|
|
12
|
+
|
|
13
|
+
export const LimitOrderRoutes: React.FC<CardProps> = (props) => {
|
|
14
|
+
const { routes, isLoading, isFetching, isFetched } = useRoutes()
|
|
15
|
+
const [toAddress, selectedRouteId] = useFieldValues(
|
|
16
|
+
'toAddress',
|
|
17
|
+
'selectedRouteId'
|
|
18
|
+
)
|
|
19
|
+
const { setFieldValue } = useFieldActions()
|
|
20
|
+
const { requiredToAddress } = useToAddressRequirements()
|
|
21
|
+
|
|
22
|
+
const currentRoute = routes?.[0]
|
|
23
|
+
|
|
24
|
+
if (!currentRoute && !isLoading && !isFetching && !isFetched) {
|
|
25
|
+
return null
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const toAddressUnsatisfied = currentRoute && requiredToAddress && !toAddress
|
|
29
|
+
const allowInteraction = !toAddressUnsatisfied
|
|
30
|
+
|
|
31
|
+
const activeRouteId =
|
|
32
|
+
routes?.find((route) => route.id === selectedRouteId)?.id ??
|
|
33
|
+
currentRoute?.id
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Stack
|
|
37
|
+
direction="column"
|
|
38
|
+
spacing={1}
|
|
39
|
+
sx={props.sx}
|
|
40
|
+
className={props.className}
|
|
41
|
+
>
|
|
42
|
+
{isLoading && !currentRoute ? (
|
|
43
|
+
Array.from({ length: 2 }).map((_, index) => (
|
|
44
|
+
<RouteProviderCardSkeleton key={index} />
|
|
45
|
+
))
|
|
46
|
+
) : !currentRoute ? (
|
|
47
|
+
<RouteNotFoundCard />
|
|
48
|
+
) : (
|
|
49
|
+
routes?.map((route) => (
|
|
50
|
+
<RouteProviderCard
|
|
51
|
+
key={route.id}
|
|
52
|
+
route={route}
|
|
53
|
+
active={route.id === activeRouteId}
|
|
54
|
+
onClick={
|
|
55
|
+
allowInteraction
|
|
56
|
+
? () => setFieldValue('selectedRouteId', route.id)
|
|
57
|
+
: undefined
|
|
58
|
+
}
|
|
59
|
+
/>
|
|
60
|
+
))
|
|
61
|
+
)}
|
|
62
|
+
</Stack>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
@@ -16,7 +16,7 @@ import { RouteNotFoundCard } from '../RouteCard/RouteNotFoundCard.js'
|
|
|
16
16
|
export const Routes: React.FC<CardProps> = (props) => {
|
|
17
17
|
const { t } = useTranslation()
|
|
18
18
|
const navigate = useNavigate()
|
|
19
|
-
const { mode, modeOptions, showSingleRoute } = useWidgetConfig()
|
|
19
|
+
const { mode, modeOptions, showSingleRoute, defaultUI } = useWidgetConfig()
|
|
20
20
|
const {
|
|
21
21
|
routes,
|
|
22
22
|
isLoading,
|
|
@@ -51,7 +51,8 @@ export const Routes: React.FC<CardProps> = (props) => {
|
|
|
51
51
|
|
|
52
52
|
return (
|
|
53
53
|
<Card {...props}>
|
|
54
|
-
|
|
54
|
+
{/* The cards layout's Receive card already carries this header. */}
|
|
55
|
+
{defaultUI?.layout === 'cards' ? null : <CardTitle>{title}</CardTitle>}
|
|
55
56
|
<ProgressToNextUpdate
|
|
56
57
|
updatedAt={dataUpdatedAt || Date.now()}
|
|
57
58
|
timeToUpdate={refetchTime}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Box, ButtonBase, styled, Typography } from '@mui/material'
|
|
2
|
+
import type React from 'react'
|
|
3
|
+
|
|
4
|
+
export const SettingsPanelContainer: React.FC<
|
|
5
|
+
React.ComponentProps<typeof Box>
|
|
6
|
+
> = styled(Box)(({ theme }) => ({
|
|
7
|
+
display: 'flex',
|
|
8
|
+
flexDirection: 'column',
|
|
9
|
+
gap: theme.spacing(1),
|
|
10
|
+
}))
|
|
11
|
+
|
|
12
|
+
export const SettingsPanelButton: React.FC<
|
|
13
|
+
React.ComponentProps<typeof ButtonBase>
|
|
14
|
+
> = styled(ButtonBase)(({ theme }) => ({
|
|
15
|
+
display: 'flex',
|
|
16
|
+
width: '100%',
|
|
17
|
+
justifyContent: 'space-between',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
gap: theme.spacing(1),
|
|
20
|
+
padding: theme.spacing(2),
|
|
21
|
+
borderRadius: theme.vars.shape.borderRadius,
|
|
22
|
+
}))
|
|
23
|
+
|
|
24
|
+
export const SettingsPanelTitle: React.FC<
|
|
25
|
+
React.ComponentProps<typeof Typography>
|
|
26
|
+
> = styled(Typography)(({ theme }) => ({
|
|
27
|
+
fontSize: 14,
|
|
28
|
+
lineHeight: 1,
|
|
29
|
+
fontWeight: 700,
|
|
30
|
+
color: theme.vars.palette.text.primary,
|
|
31
|
+
}))
|
|
32
|
+
|
|
33
|
+
export const SettingsPanelValue: React.FC<
|
|
34
|
+
React.ComponentProps<typeof Typography>
|
|
35
|
+
> = styled(Typography)(({ theme }) => ({
|
|
36
|
+
fontSize: 14,
|
|
37
|
+
lineHeight: 1,
|
|
38
|
+
fontWeight: 500,
|
|
39
|
+
color: theme.vars.palette.text.secondary,
|
|
40
|
+
whiteSpace: 'nowrap',
|
|
41
|
+
}))
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { BoxProps } from '@mui/material'
|
|
2
|
+
import { useNavigate } from '@tanstack/react-router'
|
|
3
|
+
import type { JSX } from 'react'
|
|
4
|
+
import { useTranslation } from 'react-i18next'
|
|
5
|
+
import { useSplitMode } from '../../stores/navigationTabs/useNavigationTabsStore.js'
|
|
6
|
+
import { useSettingsStore } from '../../stores/settings/SettingsStore.js'
|
|
7
|
+
import { useSettings } from '../../stores/settings/useSettings.js'
|
|
8
|
+
import { navigationRoutes } from '../../utils/navigationRoutes.js'
|
|
9
|
+
import { Card } from '../Card/Card.js'
|
|
10
|
+
import {
|
|
11
|
+
SettingsPanelButton,
|
|
12
|
+
SettingsPanelContainer,
|
|
13
|
+
SettingsPanelTitle,
|
|
14
|
+
SettingsPanelValue,
|
|
15
|
+
} from './SettingsPanel.style.js'
|
|
16
|
+
import {
|
|
17
|
+
bridgeSettingsPanelKeys,
|
|
18
|
+
type SettingsPanelKey,
|
|
19
|
+
swapSettingsPanelKeys,
|
|
20
|
+
} from './utils.js'
|
|
21
|
+
|
|
22
|
+
export const SettingsPanel: React.FC<BoxProps> = (props): JSX.Element => {
|
|
23
|
+
const { t } = useTranslation()
|
|
24
|
+
const navigate = useNavigate()
|
|
25
|
+
const splitMode = useSplitMode()
|
|
26
|
+
const { slippage, routePriority } = useSettings(['slippage', 'routePriority'])
|
|
27
|
+
const [enabledBridges, totalBridges, enabledExchanges, totalExchanges] =
|
|
28
|
+
useSettingsStore((state) => [
|
|
29
|
+
Object.values(state._enabledBridges).filter(Boolean).length,
|
|
30
|
+
Object.values(state._enabledBridges).length,
|
|
31
|
+
Object.values(state._enabledExchanges).filter(Boolean).length,
|
|
32
|
+
Object.values(state._enabledExchanges).length,
|
|
33
|
+
])
|
|
34
|
+
|
|
35
|
+
const rows =
|
|
36
|
+
splitMode === 'bridge' ? bridgeSettingsPanelKeys : swapSettingsPanelKeys
|
|
37
|
+
|
|
38
|
+
const labelByKey: Record<SettingsPanelKey, string> = {
|
|
39
|
+
routePriority: t('settings.routePriority'),
|
|
40
|
+
exchanges: t('settings.enabledExchanges'),
|
|
41
|
+
bridges: t('settings.enabledBridges'),
|
|
42
|
+
slippage: t('settings.slippage'),
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const valueByKey: Record<SettingsPanelKey, string> = {
|
|
46
|
+
routePriority:
|
|
47
|
+
routePriority === 'FASTEST'
|
|
48
|
+
? t('settings.routePriorityOptions.fastest.title')
|
|
49
|
+
: t('settings.routePriorityOptions.cheapest.title'),
|
|
50
|
+
exchanges: `${enabledExchanges}/${totalExchanges}`,
|
|
51
|
+
bridges: `${enabledBridges}/${totalBridges}`,
|
|
52
|
+
slippage: slippage ? `${slippage}%` : t('button.auto'),
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const handleClick = (key: SettingsPanelKey) => {
|
|
56
|
+
navigate({
|
|
57
|
+
to: `/${navigationRoutes.settings}/${navigationRoutes[key]}`,
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<SettingsPanelContainer {...props}>
|
|
63
|
+
{rows.map((key) => (
|
|
64
|
+
<Card key={key}>
|
|
65
|
+
<SettingsPanelButton onClick={() => handleClick(key)} disableRipple>
|
|
66
|
+
<SettingsPanelTitle>{labelByKey[key]}</SettingsPanelTitle>
|
|
67
|
+
<SettingsPanelValue>{valueByKey[key]}</SettingsPanelValue>
|
|
68
|
+
</SettingsPanelButton>
|
|
69
|
+
</Card>
|
|
70
|
+
))}
|
|
71
|
+
</SettingsPanelContainer>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { NavigationTabKey } from '../../types/widget.js'
|
|
2
|
+
|
|
3
|
+
export type SettingsPanelKey =
|
|
4
|
+
| 'routePriority'
|
|
5
|
+
| 'exchanges'
|
|
6
|
+
| 'bridges'
|
|
7
|
+
| 'slippage'
|
|
8
|
+
|
|
9
|
+
/** Navigation tabs that surface the settings panel on the main page. */
|
|
10
|
+
export const advancedNavigationTabKeys: NavigationTabKey[] = [
|
|
11
|
+
'swap-advanced',
|
|
12
|
+
'bridge-advanced',
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
// Keys are ordered to match the settings page layout.
|
|
16
|
+
// Swap is same-chain, so route priority and bridges are not relevant.
|
|
17
|
+
export const swapSettingsPanelKeys: SettingsPanelKey[] = [
|
|
18
|
+
'slippage',
|
|
19
|
+
'exchanges',
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
export const bridgeSettingsPanelKeys: SettingsPanelKey[] = [
|
|
23
|
+
'routePriority',
|
|
24
|
+
'slippage',
|
|
25
|
+
'bridges',
|
|
26
|
+
'exchanges',
|
|
27
|
+
]
|
|
@@ -89,7 +89,7 @@ export const WidgetSkeleton = ({
|
|
|
89
89
|
colorSchemeStorageKey="li.fi-widget-color-scheme"
|
|
90
90
|
disableTransitionOnChange
|
|
91
91
|
>
|
|
92
|
-
<AppExpandedContainer>
|
|
92
|
+
<AppExpandedContainer data-testid="widget-skeleton-container">
|
|
93
93
|
<RelativeContainer sx={{ display: 'flex', flexDirection: 'column' }}>
|
|
94
94
|
<SkeletonHeaderContainer>
|
|
95
95
|
{!hiddenUI?.walletMenu ? (
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Box, styled } from '@mui/material'
|
|
2
|
+
import type React from 'react'
|
|
3
|
+
import { Card } from '../Card/Card.js'
|
|
4
|
+
|
|
5
|
+
// Sits just above MUI's appBar layer (1100) so the swap icon stays on top of the
|
|
6
|
+
// two overlapping amount cards it bridges.
|
|
7
|
+
const swapButtonZIndex = 1110
|
|
8
|
+
|
|
9
|
+
export const SwapIconCard: React.FC<React.ComponentProps<typeof Card>> = styled(
|
|
10
|
+
Card
|
|
11
|
+
)(({ theme }) => ({
|
|
12
|
+
height: 32,
|
|
13
|
+
width: 32,
|
|
14
|
+
fontSize: 16,
|
|
15
|
+
display: 'flex',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
justifyContent: 'center',
|
|
18
|
+
borderRadius: theme.vars.shape.borderRadiusTertiary,
|
|
19
|
+
zIndex: swapButtonZIndex,
|
|
20
|
+
}))
|
|
21
|
+
|
|
22
|
+
export const SwapButtonContainer: React.FC<React.ComponentProps<typeof Box>> =
|
|
23
|
+
styled(Box)(({ theme }) => ({
|
|
24
|
+
display: 'flex',
|
|
25
|
+
justifyContent: 'center',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
margin: theme.spacing(-1.5),
|
|
28
|
+
}))
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import ArrowDownward from '@mui/icons-material/ArrowDownward'
|
|
2
|
+
import type { BoxProps } from '@mui/material'
|
|
3
|
+
import type { JSX } from 'react'
|
|
4
|
+
import { useTranslation } from 'react-i18next'
|
|
5
|
+
import { useAvailableChains } from '../../hooks/useAvailableChains.js'
|
|
6
|
+
import { useToAddressAutoPopulate } from '../../hooks/useToAddressAutoPopulate.js'
|
|
7
|
+
import { useToAddressReset } from '../../hooks/useToAddressReset.js'
|
|
8
|
+
import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js'
|
|
9
|
+
import { useFieldActions } from '../../stores/form/useFieldActions.js'
|
|
10
|
+
import { SwapButtonContainer, SwapIconCard } from './SwapButton.style.js'
|
|
11
|
+
|
|
12
|
+
export const SwapButton: React.FC<BoxProps> = ({
|
|
13
|
+
sx,
|
|
14
|
+
...props
|
|
15
|
+
}): JSX.Element => {
|
|
16
|
+
const { t } = useTranslation()
|
|
17
|
+
const { mode } = useWidgetConfig()
|
|
18
|
+
const { setFieldValue, getFieldValues } = useFieldActions()
|
|
19
|
+
const { getChainById } = useAvailableChains()
|
|
20
|
+
const { tryResetToAddress } = useToAddressReset()
|
|
21
|
+
const autoPopulateToAddress = useToAddressAutoPopulate()
|
|
22
|
+
|
|
23
|
+
const handleClick = (): void => {
|
|
24
|
+
const [fromChainId, fromToken, toChainId, toToken, toAddress, toAmount] =
|
|
25
|
+
getFieldValues(
|
|
26
|
+
'fromChain',
|
|
27
|
+
'fromToken',
|
|
28
|
+
'toChain',
|
|
29
|
+
'toToken',
|
|
30
|
+
'toAddress',
|
|
31
|
+
'toAmount'
|
|
32
|
+
)
|
|
33
|
+
const newFromAmount =
|
|
34
|
+
mode === 'limit' && toAmount ? (toAmount as string) : ''
|
|
35
|
+
setFieldValue('fromAmount', newFromAmount, { isTouched: true })
|
|
36
|
+
setFieldValue('fromChain', toChainId, { isTouched: true })
|
|
37
|
+
setFieldValue('fromToken', toToken, { isTouched: true })
|
|
38
|
+
setFieldValue('toChain', fromChainId, { isTouched: true })
|
|
39
|
+
setFieldValue('toToken', fromToken, { isTouched: true })
|
|
40
|
+
|
|
41
|
+
const autoPopulatedToAddress = autoPopulateToAddress({
|
|
42
|
+
formType: 'from',
|
|
43
|
+
selectedToAddress: toAddress,
|
|
44
|
+
selectedChainId: toChainId,
|
|
45
|
+
selectedOppositeChainId: fromChainId,
|
|
46
|
+
selectedOppositeTokenAddress: fromToken,
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
if (autoPopulatedToAddress) {
|
|
50
|
+
return
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const toChain = getChainById(fromChainId)
|
|
54
|
+
if (toChain) {
|
|
55
|
+
tryResetToAddress(toChain)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<SwapButtonContainer sx={sx} {...props}>
|
|
61
|
+
<SwapIconCard
|
|
62
|
+
component="button"
|
|
63
|
+
onClick={handleClick}
|
|
64
|
+
aria-label={t('button.swap')}
|
|
65
|
+
data-testid="widget-swap-tokens-button"
|
|
66
|
+
>
|
|
67
|
+
<ArrowDownward fontSize="inherit" />
|
|
68
|
+
</SwapIconCard>
|
|
69
|
+
</SwapButtonContainer>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
@@ -40,6 +40,9 @@ export const NavigationTab: React.FC<React.ComponentProps<typeof Tab>> = styled(
|
|
|
40
40
|
slot: 'root',
|
|
41
41
|
}
|
|
42
42
|
)(({ theme }) => ({
|
|
43
|
+
flex: 'none',
|
|
44
|
+
whiteSpace: 'nowrap',
|
|
45
|
+
minWidth: 'auto',
|
|
43
46
|
minHeight: theme.spacing(5),
|
|
44
47
|
maxHeight: theme.spacing(5),
|
|
45
48
|
}))
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import {
|
|
1
|
+
import type { JSX, Ref } from 'react'
|
|
2
|
+
import { useImperativeHandle, useRef, useState } from 'react'
|
|
3
3
|
import { BottomSheet } from '../BottomSheet/BottomSheet.js'
|
|
4
4
|
import type { BottomSheetBase } from '../BottomSheet/types.js'
|
|
5
5
|
import { TokenDetailsSheetContent } from './TokenDetailsSheetContent.js'
|
|
6
6
|
import type { TokenDetailsSheetBase } from './types.js'
|
|
7
7
|
|
|
8
|
-
export const TokenDetailsSheet
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
export const TokenDetailsSheet = ({
|
|
9
|
+
ref,
|
|
10
|
+
}: {
|
|
11
|
+
ref?: Ref<TokenDetailsSheetBase>
|
|
12
|
+
}): JSX.Element => {
|
|
11
13
|
const bottomSheetRef = useRef<BottomSheetBase>(null)
|
|
12
14
|
const [tokenAddress, setTokenAddress] = useState<string | undefined>(
|
|
13
15
|
undefined
|
|
@@ -35,11 +37,11 @@ export const TokenDetailsSheet: React.ForwardRefExoticComponent<
|
|
|
35
37
|
return (
|
|
36
38
|
<BottomSheet ref={bottomSheetRef} keepMounted>
|
|
37
39
|
<TokenDetailsSheetContent
|
|
38
|
-
|
|
40
|
+
onClose={() => bottomSheetRef.current?.close()}
|
|
39
41
|
tokenAddress={tokenAddress}
|
|
40
42
|
withoutContractAddress={withoutContractAddress}
|
|
41
43
|
chainId={chainId}
|
|
42
44
|
/>
|
|
43
45
|
</BottomSheet>
|
|
44
46
|
)
|
|
45
|
-
}
|
|
47
|
+
}
|