@rango-dev/ui 0.1.10-next.102
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/README.md +181 -0
- package/dist/components/Alert/Alert.d.ts +7 -0
- package/dist/components/Alert/Alert.stories.d.ts +5 -0
- package/dist/components/Alert/LoadingFailedAlert.d.ts +2 -0
- package/dist/components/Alert/NotFoundAlert.d.ts +7 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/BestRoute/BestRoute.d.ts +12 -0
- package/dist/components/BestRoute/BestRoute.stories.d.ts +8 -0
- package/dist/components/BestRoute/index.d.ts +1 -0
- package/dist/components/BestRoute/mock.d.ts +4 -0
- package/dist/components/BlockchainSelector/BlockchainSelector.d.ts +17 -0
- package/dist/components/BlockchainSelector/BlockchainSelector.stories.d.ts +5 -0
- package/dist/components/BlockchainSelector/index.d.ts +1 -0
- package/dist/components/BlockchainsList/BlockchainsList.d.ts +10 -0
- package/dist/components/BlockchainsList/BlockchainsList.stories.d.ts +5 -0
- package/dist/components/BlockchainsList/index.d.ts +1 -0
- package/dist/components/BlockchainsList/mockData.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +17 -0
- package/dist/components/Button/Button.stories.d.ts +8 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +11 -0
- package/dist/components/Checkbox/Checkbox.stories.d.ts +5 -0
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Chip/Chip.d.ts +12 -0
- package/dist/components/Chip/Chip.stories.d.ts +7 -0
- package/dist/components/Chip/index.d.ts +1 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +9 -0
- package/dist/components/ColorPicker/ColorPicker.stories.d.ts +5 -0
- package/dist/components/ColorPicker/index.d.ts +1 -0
- package/dist/components/ConnectWalletsModal/ConnectWallets.stories.d.ts +5 -0
- package/dist/components/ConnectWalletsModal/ConnectWalletsModal.d.ts +11 -0
- package/dist/components/ConnectWalletsModal/index.d.ts +1 -0
- package/dist/components/ConnectWalletsModal/mockData.d.ts +2 -0
- package/dist/components/Divider/Divider.d.ts +6 -0
- package/dist/components/Divider/index.d.ts +1 -0
- package/dist/components/Drawer/Drawer.d.ts +13 -0
- package/dist/components/Drawer/Drawer.stories.d.ts +8 -0
- package/dist/components/Drawer/index.d.ts +1 -0
- package/dist/components/Header/Header.d.ts +9 -0
- package/dist/components/Header/index.d.ts +1 -0
- package/dist/components/Icon/AddCircleIcon.d.ts +3 -0
- package/dist/components/Icon/AddIcon.d.ts +3 -0
- package/dist/components/Icon/AddWalletIcon.d.ts +3 -0
- package/dist/components/Icon/AngleDownIcon.d.ts +3 -0
- package/dist/components/Icon/AngleLeftIcon.d.ts +3 -0
- package/dist/components/Icon/AngleRightIcon.d.ts +3 -0
- package/dist/components/Icon/AngleUpIcon.d.ts +3 -0
- package/dist/components/Icon/ArrowRightIcon.d.ts +3 -0
- package/dist/components/Icon/BagIcon.d.ts +3 -0
- package/dist/components/Icon/BanIcon.d.ts +3 -0
- package/dist/components/Icon/CheckCircleIcon.d.ts +3 -0
- package/dist/components/Icon/CheckIcon.d.ts +3 -0
- package/dist/components/Icon/CheckSquareIcon.d.ts +3 -0
- package/dist/components/Icon/CheckWalletIcon.d.ts +3 -0
- package/dist/components/Icon/ChevronRightIcon.d.ts +3 -0
- package/dist/components/Icon/CloseIcon.d.ts +1 -0
- package/dist/components/Icon/CopyIcon.d.ts +3 -0
- package/dist/components/Icon/DeleteCircleIcon.d.ts +3 -0
- package/dist/components/Icon/DeleteWalletIcon.d.ts +3 -0
- package/dist/components/Icon/DisconnectIcon.d.ts +3 -0
- package/dist/components/Icon/DownloadIcon.d.ts +3 -0
- package/dist/components/Icon/GasIcon.d.ts +3 -0
- package/dist/components/Icon/HistoryIcon.d.ts +3 -0
- package/dist/components/Icon/HorizontalSwapIcon.d.ts +3 -0
- package/dist/components/Icon/Icons.stories.d.ts +5 -0
- package/dist/components/Icon/InfoCircleIcon.d.ts +3 -0
- package/dist/components/Icon/MinusCircleIcon.d.ts +3 -0
- package/dist/components/Icon/RetryIcon.d.ts +3 -0
- package/dist/components/Icon/RetryLeftIcon.d.ts +3 -0
- package/dist/components/Icon/RetryRightIcon.d.ts +3 -0
- package/dist/components/Icon/SearchIcon.d.ts +3 -0
- package/dist/components/Icon/SearchMinusIcon.d.ts +3 -0
- package/dist/components/Icon/SettingIcon.d.ts +3 -0
- package/dist/components/Icon/SignatureIcon.d.ts +3 -0
- package/dist/components/Icon/SwapWalletIcon.d.ts +3 -0
- package/dist/components/Icon/TimeIcon.d.ts +3 -0
- package/dist/components/Icon/TrashIcon.d.ts +3 -0
- package/dist/components/Icon/TryAgainIcon.d.ts +3 -0
- package/dist/components/Icon/VerticalSwapIcon.d.ts +3 -0
- package/dist/components/Icon/WalletIconIcon.d.ts +3 -0
- package/dist/components/Icon/WarningIcon.d.ts +3 -0
- package/dist/components/Icon/common.d.ts +2 -0
- package/dist/components/Icon/index.d.ts +40 -0
- package/dist/components/Icon/types.d.ts +6 -0
- package/dist/components/LiquiditySourceList/LiquiditySource.stories.d.ts +5 -0
- package/dist/components/LiquiditySourceList/LiquiditySourceList.d.ts +11 -0
- package/dist/components/LiquiditySourceList/index.d.ts +1 -0
- package/dist/components/LiquiditySourceList/mockData.d.ts +2 -0
- package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.d.ts +13 -0
- package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.stories.d.ts +5 -0
- package/dist/components/LiquiditySourcesSelector/index.d.ts +1 -0
- package/dist/components/Modal/Modal.d.ts +12 -0
- package/dist/components/Modal/Modal.stories.d.ts +5 -0
- package/dist/components/Modal/index.d.ts +1 -0
- package/dist/components/Radio/Radio.d.ts +13 -0
- package/dist/components/Radio/Radio.stories.d.ts +5 -0
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/SecondaryPage/SecondaryPage.d.ts +16 -0
- package/dist/components/SecondaryPage/SecondaryPage.stories.d.ts +2 -0
- package/dist/components/SecondaryPage/index.d.ts +1 -0
- package/dist/components/SelectableWalletList/SelectableWalletList.d.ts +7 -0
- package/dist/components/SelectableWalletList/SelectableWalletList.stories.d.ts +5 -0
- package/dist/components/SelectableWalletList/index.d.ts +1 -0
- package/dist/components/SelectableWalletList/mock.d.ts +2 -0
- package/dist/components/Settings/Settings.d.ts +23 -0
- package/dist/components/Settings/Settings.stories.d.ts +5 -0
- package/dist/components/Settings/index.d.ts +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +6 -0
- package/dist/components/Skeleton/Skeleton.stories.d.ts +5 -0
- package/dist/components/Skeleton/index.d.ts +1 -0
- package/dist/components/Spacer/Spacer.d.ts +6 -0
- package/dist/components/Spacer/Spacer.stories.d.ts +5 -0
- package/dist/components/Spacer/index.d.ts +1 -0
- package/dist/components/Spinner/Spinner.d.ts +6 -0
- package/dist/components/Spinner/Spinner.stories.d.ts +5 -0
- package/dist/components/Spinner/index.d.ts +1 -0
- package/dist/components/StatusDrawer/StatusDrawer.d.ts +11 -0
- package/dist/components/StatusDrawer/StatusDrawer.stories.d.ts +5 -0
- package/dist/components/StatusDrawer/index.d.ts +1 -0
- package/dist/components/StepDetail/StepDetail.d.ts +10 -0
- package/dist/components/StepDetail/StepDetail.stories.d.ts +5 -0
- package/dist/components/StepDetail/index.d.ts +1 -0
- package/dist/components/SwapContainer/SwapContainer.d.ts +7 -0
- package/dist/components/SwapContainer/SwapContainer.stories.d.ts +5 -0
- package/dist/components/SwapContainer/index.d.ts +1 -0
- package/dist/components/SwapDetail/SwapDetail.d.ts +8 -0
- package/dist/components/SwapDetail/SwapDetail.stories.d.ts +5 -0
- package/dist/components/SwapDetail/Token.d.ts +16 -0
- package/dist/components/SwapDetail/index.d.ts +1 -0
- package/dist/components/SwapDetail/mock.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts +6 -0
- package/dist/components/Switch/Switch.stories.d.ts +5 -0
- package/dist/components/Switch/index.d.ts +1 -0
- package/dist/components/TextField/TextField.d.ts +10 -0
- package/dist/components/TextField/TextField.stories.d.ts +7 -0
- package/dist/components/TextField/index.d.ts +1 -0
- package/dist/components/TokenList/TokenItem.d.ts +11 -0
- package/dist/components/TokenList/TokenList.d.ts +17 -0
- package/dist/components/TokenList/TokenList.stories.d.ts +5 -0
- package/dist/components/TokenList/index.d.ts +1 -0
- package/dist/components/TokenList/mockData.d.ts +2 -0
- package/dist/components/TokenSelector/TokenSelector.d.ts +16 -0
- package/dist/components/TokenSelector/TokenSelector.stories.d.ts +5 -0
- package/dist/components/TokenSelector/index.d.ts +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +7 -0
- package/dist/components/Tooltip/Tooltip.stories.d.ts +5 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Typography/Typography.d.ts +18 -0
- package/dist/components/Typography/Typography.stories.d.ts +5 -0
- package/dist/components/Typography/index.d.ts +1 -0
- package/dist/components/VirtualizedList/VirtualizedList.d.ts +17 -0
- package/dist/components/Wallet/State.d.ts +7 -0
- package/dist/components/Wallet/Wallet.d.ts +7 -0
- package/dist/components/Wallet/Wallet.stories.d.ts +5 -0
- package/dist/components/Wallet/index.d.ts +1 -0
- package/dist/components/common/FilledCircle.d.ts +1 -0
- package/dist/components/common/index.d.ts +1 -0
- package/dist/components/index.d.ts +31 -0
- package/dist/containers/ConfirmSwap/ConfirmSwap.d.ts +20 -0
- package/dist/containers/ConfirmSwap/ConfirmSwap.stories.d.ts +6 -0
- package/dist/containers/ConfirmSwap/index.d.ts +1 -0
- package/dist/containers/ConfirmSwap/mock.d.ts +5 -0
- package/dist/containers/History/History.d.ts +13 -0
- package/dist/containers/History/History.stories.d.ts +5 -0
- package/dist/containers/History/index.d.ts +1 -0
- package/dist/containers/History/mock.d.ts +2 -0
- package/dist/containers/History/types.d.ts +39 -0
- package/dist/containers/SwapHistory/SwapHistory.d.ts +24 -0
- package/dist/containers/SwapHistory/SwapHistory.stories.d.ts +5 -0
- package/dist/containers/SwapHistory/SwapMessages.d.ts +17 -0
- package/dist/containers/SwapHistory/index.d.ts +1 -0
- package/dist/containers/SwapHistory/mock.d.ts +2 -0
- package/dist/containers/index.d.ts +3 -0
- package/dist/helper/index.d.ts +2 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +8 -0
- package/dist/theme.d.ts +8 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/meta.d.ts +23 -0
- package/dist/types/swaps.d.ts +29 -0
- package/dist/types/wallet.d.ts +23 -0
- package/dist/ui.cjs.development.js +4956 -0
- package/dist/ui.cjs.development.js.map +1 -0
- package/dist/ui.cjs.production.min.js +2 -0
- package/dist/ui.cjs.production.min.js.map +1 -0
- package/dist/ui.esm.js +4870 -0
- package/dist/ui.esm.js.map +1 -0
- package/package.json +88 -0
- package/src/components/Alert/Alert.stories.tsx +22 -0
- package/src/components/Alert/Alert.tsx +102 -0
- package/src/components/Alert/LoadingFailedAlert.tsx +11 -0
- package/src/components/Alert/NotFoundAlert.tsx +19 -0
- package/src/components/Alert/index.ts +2 -0
- package/src/components/BestRoute/BestRoute.stories.tsx +31 -0
- package/src/components/BestRoute/BestRoute.tsx +232 -0
- package/src/components/BestRoute/index.ts +1 -0
- package/src/components/BestRoute/mock.ts +554 -0
- package/src/components/BlockchainSelector/BlockchainSelector.stories.tsx +25 -0
- package/src/components/BlockchainSelector/BlockchainSelector.tsx +93 -0
- package/src/components/BlockchainSelector/index.ts +1 -0
- package/src/components/BlockchainsList/BlockchainsList.stories.tsx +25 -0
- package/src/components/BlockchainsList/BlockchainsList.tsx +70 -0
- package/src/components/BlockchainsList/index.ts +1 -0
- package/src/components/BlockchainsList/mockData.ts +2972 -0
- package/src/components/Button/Button.stories.tsx +59 -0
- package/src/components/Button/Button.tsx +421 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +22 -0
- package/src/components/Checkbox/Checkbox.tsx +56 -0
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/Chip/Chip.stories.tsx +37 -0
- package/src/components/Chip/Chip.tsx +48 -0
- package/src/components/Chip/index.ts +1 -0
- package/src/components/ColorPicker/ColorPicker.stories.tsx +36 -0
- package/src/components/ColorPicker/ColorPicker.tsx +85 -0
- package/src/components/ColorPicker/index.ts +1 -0
- package/src/components/ConnectWalletsModal/ConnectWallets.stories.tsx +13 -0
- package/src/components/ConnectWalletsModal/ConnectWalletsModal.tsx +42 -0
- package/src/components/ConnectWalletsModal/index.ts +1 -0
- package/src/components/ConnectWalletsModal/mockData.ts +134 -0
- package/src/components/Divider/Divider.tsx +41 -0
- package/src/components/Divider/index.ts +1 -0
- package/src/components/Drawer/Drawer.stories.tsx +86 -0
- package/src/components/Drawer/Drawer.tsx +124 -0
- package/src/components/Drawer/index.ts +1 -0
- package/src/components/Header/Header.tsx +39 -0
- package/src/components/Header/index.ts +1 -0
- package/src/components/Icon/AddCircleIcon.tsx +31 -0
- package/src/components/Icon/AddIcon.tsx +31 -0
- package/src/components/Icon/AddWalletIcon.tsx +50 -0
- package/src/components/Icon/AngleDownIcon.tsx +30 -0
- package/src/components/Icon/AngleLeftIcon.tsx +33 -0
- package/src/components/Icon/AngleRightIcon.tsx +32 -0
- package/src/components/Icon/AngleUpIcon.tsx +32 -0
- package/src/components/Icon/ArrowRightIcon.tsx +31 -0
- package/src/components/Icon/BagIcon.tsx +39 -0
- package/src/components/Icon/BanIcon.tsx +32 -0
- package/src/components/Icon/CheckCircleIcon.tsx +39 -0
- package/src/components/Icon/CheckIcon.tsx +30 -0
- package/src/components/Icon/CheckSquareIcon.tsx +37 -0
- package/src/components/Icon/CheckWalletIcon.tsx +45 -0
- package/src/components/Icon/ChevronRightIcon.tsx +29 -0
- package/src/components/Icon/CloseIcon.tsx +9 -0
- package/src/components/Icon/CopyIcon.tsx +59 -0
- package/src/components/Icon/DeleteCircleIcon.tsx +31 -0
- package/src/components/Icon/DeleteWalletIcon.tsx +50 -0
- package/src/components/Icon/DisconnectIcon.tsx +31 -0
- package/src/components/Icon/DownloadIcon.tsx +37 -0
- package/src/components/Icon/GasIcon.tsx +37 -0
- package/src/components/Icon/HistoryIcon.tsx +34 -0
- package/src/components/Icon/HorizontalSwapIcon.tsx +38 -0
- package/src/components/Icon/Icons.stories.tsx +44 -0
- package/src/components/Icon/InfoCircleIcon.tsx +39 -0
- package/src/components/Icon/MinusCircleIcon.tsx +31 -0
- package/src/components/Icon/RetryIcon.tsx +30 -0
- package/src/components/Icon/RetryLeftIcon.tsx +31 -0
- package/src/components/Icon/RetryRightIcon.tsx +31 -0
- package/src/components/Icon/SearchIcon.tsx +31 -0
- package/src/components/Icon/SearchMinusIcon.tsx +31 -0
- package/src/components/Icon/SettingIcon.tsx +31 -0
- package/src/components/Icon/SignatureIcon.tsx +32 -0
- package/src/components/Icon/SwapWalletIcon.tsx +50 -0
- package/src/components/Icon/TimeIcon.tsx +29 -0
- package/src/components/Icon/TrashIcon.tsx +31 -0
- package/src/components/Icon/TryAgainIcon.tsx +31 -0
- package/src/components/Icon/VerticalSwapIcon.tsx +38 -0
- package/src/components/Icon/WalletIconIcon.tsx +40 -0
- package/src/components/Icon/WarningIcon.tsx +37 -0
- package/src/components/Icon/common.ts +69 -0
- package/src/components/Icon/index.ts +48 -0
- package/src/components/Icon/types.tsx +45 -0
- package/src/components/LiquiditySourceList/LiquiditySource.stories.tsx +13 -0
- package/src/components/LiquiditySourceList/LiquiditySourceList.tsx +195 -0
- package/src/components/LiquiditySourceList/index.ts +1 -0
- package/src/components/LiquiditySourceList/mockData.ts +316 -0
- package/src/components/LiquiditySourcesSelector/LiquiditySourcesSelector.stories.tsx +16 -0
- package/src/components/LiquiditySourcesSelector/LiquiditySourcesSelector.tsx +61 -0
- package/src/components/LiquiditySourcesSelector/index.ts +1 -0
- package/src/components/Modal/Modal.stories.tsx +22 -0
- package/src/components/Modal/Modal.tsx +93 -0
- package/src/components/Modal/index.ts +1 -0
- package/src/components/Radio/Radio.stories.tsx +23 -0
- package/src/components/Radio/Radio.tsx +100 -0
- package/src/components/Radio/index.ts +1 -0
- package/src/components/SecondaryPage/SecondaryPage.stories.tsx +7 -0
- package/src/components/SecondaryPage/SecondaryPage.tsx +68 -0
- package/src/components/SecondaryPage/index.ts +1 -0
- package/src/components/SelectableWalletList/SelectableWalletList.stories.tsx +14 -0
- package/src/components/SelectableWalletList/SelectableWalletList.tsx +118 -0
- package/src/components/SelectableWalletList/index.ts +1 -0
- package/src/components/SelectableWalletList/mock.ts +13 -0
- package/src/components/Settings/Settings.stories.tsx +34 -0
- package/src/components/Settings/Settings.tsx +208 -0
- package/src/components/Settings/index.ts +1 -0
- package/src/components/Skeleton/Skeleton.stories.tsx +24 -0
- package/src/components/Skeleton/Skeleton.tsx +66 -0
- package/src/components/Skeleton/index.ts +1 -0
- package/src/components/Spacer/Spacer.stories.tsx +31 -0
- package/src/components/Spacer/Spacer.tsx +128 -0
- package/src/components/Spacer/index.ts +1 -0
- package/src/components/Spinner/Spinner.stories.tsx +25 -0
- package/src/components/Spinner/Spinner.tsx +61 -0
- package/src/components/Spinner/index.ts +1 -0
- package/src/components/StatusDrawer/StatusDrawer.stories.tsx +38 -0
- package/src/components/StatusDrawer/StatusDrawer.tsx +82 -0
- package/src/components/StatusDrawer/index.ts +1 -0
- package/src/components/StepDetail/StepDetail.stories.tsx +37 -0
- package/src/components/StepDetail/StepDetail.tsx +109 -0
- package/src/components/StepDetail/index.ts +1 -0
- package/src/components/SwapContainer/SwapContainer.stories.tsx +13 -0
- package/src/components/SwapContainer/SwapContainer.tsx +43 -0
- package/src/components/SwapContainer/index.ts +1 -0
- package/src/components/SwapDetail/SwapDetail.stories.tsx +19 -0
- package/src/components/SwapDetail/SwapDetail.tsx +112 -0
- package/src/components/SwapDetail/Token.tsx +68 -0
- package/src/components/SwapDetail/index.ts +1 -0
- package/src/components/SwapDetail/mock.ts +276 -0
- package/src/components/Switch/Switch.stories.tsx +9 -0
- package/src/components/Switch/Switch.tsx +55 -0
- package/src/components/Switch/index.ts +1 -0
- package/src/components/TextField/TextField.stories.tsx +31 -0
- package/src/components/TextField/TextField.tsx +141 -0
- package/src/components/TextField/index.ts +1 -0
- package/src/components/TokenList/TokenItem.tsx +73 -0
- package/src/components/TokenList/TokenList.stories.tsx +18 -0
- package/src/components/TokenList/TokenList.tsx +95 -0
- package/src/components/TokenList/index.ts +1 -0
- package/src/components/TokenList/mockData.ts +1721 -0
- package/src/components/TokenSelector/TokenSelector.stories.tsx +18 -0
- package/src/components/TokenSelector/TokenSelector.tsx +95 -0
- package/src/components/TokenSelector/index.ts +1 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +52 -0
- package/src/components/Tooltip/Tooltip.tsx +116 -0
- package/src/components/Tooltip/index.ts +1 -0
- package/src/components/Typography/Typography.stories.tsx +72 -0
- package/src/components/Typography/Typography.tsx +216 -0
- package/src/components/Typography/index.ts +1 -0
- package/src/components/VirtualizedList/VirtualizedList.tsx +62 -0
- package/src/components/Wallet/State.tsx +34 -0
- package/src/components/Wallet/Wallet.stories.tsx +36 -0
- package/src/components/Wallet/Wallet.tsx +69 -0
- package/src/components/Wallet/index.ts +1 -0
- package/src/components/common/FilledCircle.tsx +8 -0
- package/src/components/common/index.ts +1 -0
- package/src/components/index.ts +31 -0
- package/src/containers/ConfirmSwap/ConfirmSwap.stories.tsx +22 -0
- package/src/containers/ConfirmSwap/ConfirmSwap.tsx +180 -0
- package/src/containers/ConfirmSwap/index.ts +1 -0
- package/src/containers/ConfirmSwap/mock.ts +223 -0
- package/src/containers/History/History.stories.tsx +14 -0
- package/src/containers/History/History.tsx +115 -0
- package/src/containers/History/index.ts +1 -0
- package/src/containers/History/mock.ts +826 -0
- package/src/containers/History/types.tsx +47 -0
- package/src/containers/SwapHistory/SwapHistory.stories.tsx +13 -0
- package/src/containers/SwapHistory/SwapHistory.tsx +442 -0
- package/src/containers/SwapHistory/SwapMessages.tsx +116 -0
- package/src/containers/SwapHistory/index.ts +1 -0
- package/src/containers/SwapHistory/mock.ts +276 -0
- package/src/containers/index.ts +3 -0
- package/src/helper/index.ts +16 -0
- package/src/index.ts +4 -0
- package/src/theme.ts +163 -0
- package/src/types/index.ts +3 -0
- package/src/types/meta.ts +22 -0
- package/src/types/swaps.ts +44 -0
- package/src/types/wallet.ts +30 -0
package/package.json
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rango-dev/ui",
|
|
3
|
+
"version": "0.1.10-next.102",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"typings": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"src"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"dev": "tsdx watch",
|
|
13
|
+
"build": "tsdx build --tsconfig ./tsconfig.json",
|
|
14
|
+
"test": "tsdx test --passWithNoTests",
|
|
15
|
+
"lint": "tsdx lint",
|
|
16
|
+
"prepare": "tsdx build --tsconfig ./tsconfig.json",
|
|
17
|
+
"size": "size-limit",
|
|
18
|
+
"analyze": "size-limit --why",
|
|
19
|
+
"storybook": "start-storybook -p 3000",
|
|
20
|
+
"build-storybook": "build-storybook"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"@rango-dev/queue-manager-rango-preset": "*",
|
|
24
|
+
"react": ">=16"
|
|
25
|
+
},
|
|
26
|
+
"husky": {
|
|
27
|
+
"hooks": {
|
|
28
|
+
"pre-commit": "tsdx lint"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"prettier": {
|
|
32
|
+
"printWidth": 80,
|
|
33
|
+
"semi": true,
|
|
34
|
+
"singleQuote": true,
|
|
35
|
+
"trailingComma": "es5"
|
|
36
|
+
},
|
|
37
|
+
"module": "dist/ui.esm.js",
|
|
38
|
+
"size-limit": [
|
|
39
|
+
{
|
|
40
|
+
"path": "dist/ui.cjs.production.min.js",
|
|
41
|
+
"limit": "10 KB"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"path": "dist/ui.esm.js",
|
|
45
|
+
"limit": "10 KB"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@babel/core": "^7.20.2",
|
|
50
|
+
"@size-limit/preset-small-lib": "^8.1.0",
|
|
51
|
+
"@storybook/addon-essentials": "^6.5.13",
|
|
52
|
+
"@storybook/addon-info": "^5.3.21",
|
|
53
|
+
"@storybook/addon-links": "^6.5.13",
|
|
54
|
+
"@storybook/addons": "^6.5.13",
|
|
55
|
+
"@storybook/react": "^6.5.13",
|
|
56
|
+
"@types/react": "^18.0.25",
|
|
57
|
+
"@types/react-dom": "^18.0.8",
|
|
58
|
+
"@types/react-virtualized-auto-sizer": "^1.0.1",
|
|
59
|
+
"@types/react-window": "^1.8.5",
|
|
60
|
+
"@types/react-window-infinite-loader": "^1.0.6",
|
|
61
|
+
"babel-loader": "^9.1.0",
|
|
62
|
+
"husky": "^8.0.2",
|
|
63
|
+
"react": "^18.2.0",
|
|
64
|
+
"react-dom": "^18.2.0",
|
|
65
|
+
"react-is": "^18.2.0",
|
|
66
|
+
"size-limit": "^8.1.0",
|
|
67
|
+
"tsdx": "^0.14.1",
|
|
68
|
+
"tslib": "^2.4.1",
|
|
69
|
+
"typescript": "^4.8.4"
|
|
70
|
+
},
|
|
71
|
+
"dependencies": {
|
|
72
|
+
"@radix-ui/react-checkbox": "^1.0.1",
|
|
73
|
+
"@radix-ui/react-radio-group": "^1.1.1",
|
|
74
|
+
"@radix-ui/react-switch": "^1.0.1",
|
|
75
|
+
"@radix-ui/react-tooltip": "^1.0.2",
|
|
76
|
+
"@rango-dev/wallets-shared": "^0.1.11-next.78",
|
|
77
|
+
"@stitches/react": "^1.2.8",
|
|
78
|
+
"@types/react-color": "^3.0.6",
|
|
79
|
+
"rango-sdk": "^0.1.20",
|
|
80
|
+
"react-color": "^2.19.3",
|
|
81
|
+
"react-virtualized-auto-sizer": "^1.0.7",
|
|
82
|
+
"react-window": "^1.8.8",
|
|
83
|
+
"react-window-infinite-loader": "^1.0.8"
|
|
84
|
+
},
|
|
85
|
+
"publishConfig": {
|
|
86
|
+
"access": "public"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentMeta } from '@storybook/react';
|
|
3
|
+
import { Alert } from '.';
|
|
4
|
+
import { PropTypes } from './Alert';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Alert',
|
|
8
|
+
component: Alert,
|
|
9
|
+
argTypes: {
|
|
10
|
+
type: {
|
|
11
|
+
defaultValue: 'success',
|
|
12
|
+
},
|
|
13
|
+
title: {
|
|
14
|
+
defaultValue: 'Alert Title',
|
|
15
|
+
},
|
|
16
|
+
description: {
|
|
17
|
+
defaultValue: 'Alert description ...',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
} as ComponentMeta<typeof Alert>;
|
|
21
|
+
|
|
22
|
+
export const Main = (args: PropTypes) => <Alert {...args} />;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import React, { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { CheckCircleIcon, InfoCircleIcon, WarningIcon } from '../Icon';
|
|
3
|
+
import { Typography } from '../Typography';
|
|
4
|
+
import { styled } from '../../theme';
|
|
5
|
+
import { Spacer } from '../Spacer';
|
|
6
|
+
|
|
7
|
+
const MainContainer = styled('div', {
|
|
8
|
+
width: '100%',
|
|
9
|
+
padding: '$16',
|
|
10
|
+
borderRadius: '$5',
|
|
11
|
+
backgroundColor: '$neutrals300',
|
|
12
|
+
color: '$neutrals800',
|
|
13
|
+
|
|
14
|
+
'.main': {
|
|
15
|
+
display: 'flex',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
'.footer': {
|
|
20
|
+
paddingTop: '$8',
|
|
21
|
+
},
|
|
22
|
+
'&.hasIcon .footer': {
|
|
23
|
+
paddingLeft: '$32',
|
|
24
|
+
},
|
|
25
|
+
variants: {
|
|
26
|
+
type: {
|
|
27
|
+
primary: {
|
|
28
|
+
color: '$primary200',
|
|
29
|
+
},
|
|
30
|
+
secondary: {
|
|
31
|
+
color: '$foreground',
|
|
32
|
+
},
|
|
33
|
+
success: {
|
|
34
|
+
color: '$success300',
|
|
35
|
+
},
|
|
36
|
+
warning: {
|
|
37
|
+
color: '$warning500',
|
|
38
|
+
},
|
|
39
|
+
error: {
|
|
40
|
+
color: '$error300',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export interface PropTypes {
|
|
47
|
+
type?: 'primary' | 'secondary' | 'success' | 'warning' | 'error';
|
|
48
|
+
title?: string;
|
|
49
|
+
footer?: ReactNode;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function Alert(props: PropsWithChildren<PropTypes>) {
|
|
53
|
+
const { type, children, title } = props;
|
|
54
|
+
|
|
55
|
+
const showIcon = (
|
|
56
|
+
['error', 'success', 'warning'] as PropTypes['type'][]
|
|
57
|
+
).includes(type);
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<MainContainer type={type} className={showIcon ? 'hasIcon' : ''}>
|
|
61
|
+
<div className="main">
|
|
62
|
+
{showIcon && (
|
|
63
|
+
<>
|
|
64
|
+
<div
|
|
65
|
+
style={{
|
|
66
|
+
width: '32px',
|
|
67
|
+
display: 'flex',
|
|
68
|
+
justifyContent: 'center',
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
72
|
+
{type === 'success' && <CheckCircleIcon color={type} size={24} />}
|
|
73
|
+
{type === 'warning' && <WarningIcon color={type} size={24} />}
|
|
74
|
+
{type === 'error' && <InfoCircleIcon color={type} size={24} />}
|
|
75
|
+
<Spacer size={8} />
|
|
76
|
+
</div>
|
|
77
|
+
</>
|
|
78
|
+
)}
|
|
79
|
+
<div
|
|
80
|
+
style={{
|
|
81
|
+
display: 'flex',
|
|
82
|
+
justifyContent: 'center',
|
|
83
|
+
alignItems: 'start',
|
|
84
|
+
flexDirection: 'column',
|
|
85
|
+
width: '100%',
|
|
86
|
+
}}
|
|
87
|
+
>
|
|
88
|
+
{title && (
|
|
89
|
+
<>
|
|
90
|
+
<Typography className="title" variant="h6" color={type}>
|
|
91
|
+
{title}
|
|
92
|
+
</Typography>
|
|
93
|
+
{!!children && <Spacer size={8} direction="vertical" />}
|
|
94
|
+
</>
|
|
95
|
+
)}
|
|
96
|
+
{children}
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
{props.footer ? <div className="footer">{props.footer}</div> : null}
|
|
100
|
+
</MainContainer>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Alert } from './Alert';
|
|
3
|
+
|
|
4
|
+
interface PropTypes {
|
|
5
|
+
catergory: string;
|
|
6
|
+
searchedFor?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function NotFoundAlert(props: PropTypes) {
|
|
10
|
+
const { catergory, searchedFor } = props;
|
|
11
|
+
return (
|
|
12
|
+
<Alert
|
|
13
|
+
type="secondary"
|
|
14
|
+
title={`${catergory} ${
|
|
15
|
+
searchedFor ? "'" + searchedFor + "'" : ''
|
|
16
|
+
} not found.`}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentMeta } from '@storybook/react';
|
|
3
|
+
import { BestRoute, PropTypes } from './BestRoute';
|
|
4
|
+
import { bestRoute, bestRouteExample2, bestRouteExample3 } from './mock';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/Best Route',
|
|
8
|
+
component: BestRoute,
|
|
9
|
+
} as ComponentMeta<typeof BestRoute>;
|
|
10
|
+
|
|
11
|
+
export const Main = (props: PropTypes) => (
|
|
12
|
+
<div style={{ maxWidth: 512 }}>
|
|
13
|
+
<BestRoute {...props} data={bestRoute} />
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
export const With4Step = (props: PropTypes) => (
|
|
17
|
+
<div style={{ maxWidth: 512 }}>
|
|
18
|
+
<BestRoute {...props} data={bestRouteExample2} />
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export const With2Step = (props: PropTypes) => (
|
|
23
|
+
<div style={{ maxWidth: 512 }}>
|
|
24
|
+
<BestRoute {...props} data={bestRouteExample3} />
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
export const WithError = (props: PropTypes) => (
|
|
28
|
+
<div style={{ maxWidth: 512 }}>
|
|
29
|
+
<BestRoute {...props} error="No Route Found" />
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import React, { Fragment, PropsWithChildren } from 'react';
|
|
2
|
+
import { GasIcon, TimeIcon } from '../../components/Icon';
|
|
3
|
+
import { StepDetail } from '../../components/StepDetail';
|
|
4
|
+
import { Typography } from '../../components/Typography';
|
|
5
|
+
import { keyframes, styled } from '../../theme';
|
|
6
|
+
import { Skeleton } from '../Skeleton';
|
|
7
|
+
import { Spinner } from '../Spinner';
|
|
8
|
+
import { BestRouteResponse } from 'rango-sdk';
|
|
9
|
+
import { Tooltip } from '../Tooltip';
|
|
10
|
+
|
|
11
|
+
const Container = styled('div', {
|
|
12
|
+
borderRadius: '$5',
|
|
13
|
+
border: '1px solid $neutrals300',
|
|
14
|
+
display: 'flex',
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
minHeight: 126,
|
|
17
|
+
justifyContent: 'space-between',
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const ErrorMsg = styled(Typography, {
|
|
21
|
+
color: '$error',
|
|
22
|
+
});
|
|
23
|
+
const BestRouteContainer = styled('div', {
|
|
24
|
+
display: 'flex',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
margin: '0 auto',
|
|
27
|
+
overflowX: 'auto',
|
|
28
|
+
overflowY: 'hidden',
|
|
29
|
+
alignSelf: 'stretch',
|
|
30
|
+
padding: '$4',
|
|
31
|
+
'@md': {
|
|
32
|
+
padding: '$8',
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
const Line = styled('div', {
|
|
36
|
+
height: '0',
|
|
37
|
+
width: '$20',
|
|
38
|
+
border: '1px dashed $foreground',
|
|
39
|
+
borderRadius: 'inherit',
|
|
40
|
+
'@lg': {
|
|
41
|
+
width: '$32',
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const HR = styled('hr', {
|
|
46
|
+
width: '100%',
|
|
47
|
+
border: '1px solid $neutrals400',
|
|
48
|
+
margin: '$8 0',
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const SwapperLogo = styled('img', {
|
|
52
|
+
width: '$16',
|
|
53
|
+
height: '$16',
|
|
54
|
+
});
|
|
55
|
+
const RelativeContainer = styled('div', {
|
|
56
|
+
position: 'relative',
|
|
57
|
+
});
|
|
58
|
+
const Dot = styled('div', {
|
|
59
|
+
width: '$6',
|
|
60
|
+
height: '$6',
|
|
61
|
+
backgroundColor: '$foreground',
|
|
62
|
+
position: 'absolute',
|
|
63
|
+
top: '45%',
|
|
64
|
+
right: -5,
|
|
65
|
+
marginLeft: '$8',
|
|
66
|
+
borderRadius: '50%',
|
|
67
|
+
'@md': {
|
|
68
|
+
width: '$8',
|
|
69
|
+
height: '$8',
|
|
70
|
+
right: -8,
|
|
71
|
+
top: '45%',
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
const ArrowRight = styled('div', {
|
|
75
|
+
width: '0px',
|
|
76
|
+
height: '0px',
|
|
77
|
+
borderTop: '5px solid transparent',
|
|
78
|
+
borderBottom: '5px solid transparent',
|
|
79
|
+
borderLeft: '5px solid $foreground',
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
export const pulse = keyframes({
|
|
83
|
+
'0%': {
|
|
84
|
+
opacity: 1,
|
|
85
|
+
},
|
|
86
|
+
'50%': {
|
|
87
|
+
opacity: 0.3,
|
|
88
|
+
},
|
|
89
|
+
'100%': {
|
|
90
|
+
opacity: 1,
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const GasContainer = styled('div', {
|
|
95
|
+
backgroundColor: '$neutrals300',
|
|
96
|
+
borderRadius: '5px',
|
|
97
|
+
margin: '$4',
|
|
98
|
+
display: 'flex',
|
|
99
|
+
flexDirection: 'column',
|
|
100
|
+
justifyContent: 'center',
|
|
101
|
+
alignItems: 'center',
|
|
102
|
+
padding: '$4',
|
|
103
|
+
'@md': {
|
|
104
|
+
padding: '$8',
|
|
105
|
+
margin: '$8',
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const CostContainer = styled('div', {
|
|
110
|
+
display: 'flex',
|
|
111
|
+
flexDirection: 'column',
|
|
112
|
+
alignItems: 'center',
|
|
113
|
+
variants: {
|
|
114
|
+
warning: {
|
|
115
|
+
true: {
|
|
116
|
+
animation: `${pulse} 2s ease-in-out infinite`,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const TotalFee = styled(Typography, {
|
|
123
|
+
variants: {
|
|
124
|
+
warning: {
|
|
125
|
+
true: {
|
|
126
|
+
color: '$warning300',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
const SkeletonContainer = styled('div', {
|
|
133
|
+
padding: '$4',
|
|
134
|
+
'@md': {
|
|
135
|
+
padding: '$8',
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
const SwapperContainer = styled('div', {
|
|
139
|
+
display: 'flex',
|
|
140
|
+
justifyContent: 'center',
|
|
141
|
+
alignItems: 'center',
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
export interface PropTypes {
|
|
145
|
+
data: BestRouteResponse | null;
|
|
146
|
+
totalFee: string;
|
|
147
|
+
feeWarning: boolean;
|
|
148
|
+
totalTime: string;
|
|
149
|
+
loading?: boolean;
|
|
150
|
+
error?: string;
|
|
151
|
+
}
|
|
152
|
+
export function BestRoute(props: PropsWithChildren<PropTypes>) {
|
|
153
|
+
const { data, loading, error, totalFee, feeWarning, totalTime } = props;
|
|
154
|
+
return (
|
|
155
|
+
<Container>
|
|
156
|
+
{loading ? (
|
|
157
|
+
<SkeletonContainer>
|
|
158
|
+
<Skeleton width={48} height={94} />
|
|
159
|
+
</SkeletonContainer>
|
|
160
|
+
) : (
|
|
161
|
+
<GasContainer>
|
|
162
|
+
<Tooltip content="Transaction cost (fee)">
|
|
163
|
+
<CostContainer warning={feeWarning}>
|
|
164
|
+
<GasIcon size={20} color={feeWarning ? 'warning' : undefined} />
|
|
165
|
+
<TotalFee
|
|
166
|
+
mt={4}
|
|
167
|
+
align="center"
|
|
168
|
+
variant="caption"
|
|
169
|
+
warning={feeWarning}
|
|
170
|
+
>
|
|
171
|
+
{error && '-'}
|
|
172
|
+
{!!data && `$${totalFee}`}
|
|
173
|
+
</TotalFee>
|
|
174
|
+
</CostContainer>
|
|
175
|
+
</Tooltip>
|
|
176
|
+
<HR />
|
|
177
|
+
<Tooltip content="Time estimate">
|
|
178
|
+
<CostContainer warning={feeWarning}>
|
|
179
|
+
<TimeIcon size={20} />
|
|
180
|
+
<Typography mt={4} align="center" variant="caption">
|
|
181
|
+
{error && '-'}
|
|
182
|
+
{!!data && `~${totalTime}m`}
|
|
183
|
+
</Typography>
|
|
184
|
+
</CostContainer>
|
|
185
|
+
</Tooltip>
|
|
186
|
+
</GasContainer>
|
|
187
|
+
)}
|
|
188
|
+
<BestRouteContainer>
|
|
189
|
+
{loading && <Spinner color="primary" />}
|
|
190
|
+
|
|
191
|
+
{error && <ErrorMsg variant="caption">{error}</ErrorMsg>}
|
|
192
|
+
|
|
193
|
+
{!!data &&
|
|
194
|
+
data.result?.swaps.map((swap, index) => (
|
|
195
|
+
<Fragment key={index}>
|
|
196
|
+
{index === 0 && (
|
|
197
|
+
<RelativeContainer>
|
|
198
|
+
<StepDetail
|
|
199
|
+
direction="vertical"
|
|
200
|
+
logo={swap.from.logo}
|
|
201
|
+
symbol={swap.from.symbol}
|
|
202
|
+
chainLogo={swap.from.blockchainLogo}
|
|
203
|
+
blockchain={swap.from.blockchain}
|
|
204
|
+
amount={swap.fromAmount}
|
|
205
|
+
/>
|
|
206
|
+
<Dot />
|
|
207
|
+
</RelativeContainer>
|
|
208
|
+
)}
|
|
209
|
+
<SwapperContainer>
|
|
210
|
+
<Line />
|
|
211
|
+
<SwapperLogo src={swap.swapperLogo} alt={swap.swapperId} />
|
|
212
|
+
<Line />
|
|
213
|
+
</SwapperContainer>
|
|
214
|
+
|
|
215
|
+
{index + 1 === data.result?.swaps.length && <ArrowRight />}
|
|
216
|
+
<StepDetail
|
|
217
|
+
direction="vertical"
|
|
218
|
+
logo={swap.to.logo}
|
|
219
|
+
symbol={swap.to.symbol}
|
|
220
|
+
chainLogo={swap.to.blockchainLogo}
|
|
221
|
+
blockchain={swap.to.blockchain}
|
|
222
|
+
amount={swap.toAmount}
|
|
223
|
+
/>
|
|
224
|
+
</Fragment>
|
|
225
|
+
))}
|
|
226
|
+
{!!data && !data?.result && (
|
|
227
|
+
<Typography variant="body2">No routes found</Typography>
|
|
228
|
+
)}
|
|
229
|
+
</BestRouteContainer>
|
|
230
|
+
</Container>
|
|
231
|
+
);
|
|
232
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BestRoute } from './BestRoute';
|