@rango-dev/ui 0.1.10-next.69
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 +6 -0
- package/dist/components/Alert/Alert.stories.d.ts +4 -0
- package/dist/components/Alert/index.d.ts +1 -0
- package/dist/components/BestRoute/BestRoute.d.ts +8 -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 +14 -0
- package/dist/components/BlockchainSelector/BlockchainSelector.stories.d.ts +4 -0
- package/dist/components/BlockchainSelector/index.d.ts +1 -0
- package/dist/components/BlockchainsList/BlockchainsList.d.ts +7 -0
- package/dist/components/BlockchainsList/BlockchainsList.stories.d.ts +4 -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 +6 -0
- package/dist/components/Chip/index.d.ts +1 -0
- package/dist/components/ConnectWalletsModal/ConnectWallets.stories.d.ts +4 -0
- package/dist/components/ConnectWalletsModal/ConnectWalletsModal.d.ts +10 -0
- package/dist/components/ConnectWalletsModal/index.d.ts +1 -0
- package/dist/components/ConnectWalletsModal/mockData.d.ts +2 -0
- package/dist/components/Drawer/Drawer.d.ts +12 -0
- package/dist/components/Drawer/Drawer.stories.d.ts +7 -0
- package/dist/components/Drawer/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/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/CloseIcon.d.ts +1 -0
- package/dist/components/Icon/DeleteCircleIcon.d.ts +3 -0
- package/dist/components/Icon/DeleteWalletIcon.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 +36 -0
- package/dist/components/Icon/types.d.ts +6 -0
- package/dist/components/LiquiditySourceList/LiquiditySource.stories.d.ts +4 -0
- package/dist/components/LiquiditySourceList/LiquiditySourceList.d.ts +8 -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 +11 -0
- package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.stories.d.ts +4 -0
- package/dist/components/LiquiditySourcesSelector/index.d.ts +1 -0
- package/dist/components/Modal/Modal.d.ts +11 -0
- package/dist/components/Modal/Modal.stories.d.ts +4 -0
- package/dist/components/Modal/index.d.ts +1 -0
- package/dist/components/Radio/Radio.d.ts +12 -0
- package/dist/components/Radio/Radio.stories.d.ts +4 -0
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/SecondaryPage/SecondaryPage.d.ts +18 -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 +19 -0
- package/dist/components/Settings/Settings.stories.d.ts +4 -0
- package/dist/components/Settings/index.d.ts +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +5 -0
- package/dist/components/Skeleton/Skeleton.stories.d.ts +4 -0
- package/dist/components/Skeleton/index.d.ts +1 -0
- package/dist/components/Spacer/Spacer.d.ts +5 -0
- package/dist/components/Spacer/Spacer.stories.d.ts +4 -0
- package/dist/components/Spacer/index.d.ts +1 -0
- package/dist/components/Spinner/Spinner.d.ts +5 -0
- package/dist/components/Spinner/Spinner.stories.d.ts +4 -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 +4 -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 +6 -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/index.d.ts +1 -0
- package/dist/components/SwapDetail/mock.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts +5 -0
- package/dist/components/Switch/Switch.stories.d.ts +4 -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/TokenList.d.ts +14 -0
- package/dist/components/TokenList/TokenList.stories.d.ts +4 -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 +10 -0
- package/dist/components/TokenSelector/TokenSelector.stories.d.ts +4 -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 +14 -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 +18 -0
- package/dist/components/Wallet/State.d.ts +6 -0
- package/dist/components/Wallet/Wallet.d.ts +6 -0
- package/dist/components/Wallet/Wallet.stories.d.ts +4 -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 +24 -0
- package/dist/containers/ConfirmSwap/ConfirmSwap.d.ts +23 -0
- package/dist/containers/ConfirmSwap/ConfirmSwap.stories.d.ts +5 -0
- package/dist/containers/ConfirmSwap/index.d.ts +1 -0
- package/dist/containers/ConfirmSwap/mock.d.ts +2 -0
- package/dist/containers/ConfirmWallets/ConfirmWallets.d.ts +14 -0
- package/dist/containers/ConfirmWallets/ConfirmWallets.stories.d.ts +6 -0
- package/dist/containers/ConfirmWallets/index.d.ts +1 -0
- package/dist/containers/ConfirmWallets/mock.d.ts +5 -0
- package/dist/containers/ConfirmWallets/types.d.ts +8 -0
- package/dist/containers/History/History.d.ts +8 -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 +59 -0
- package/dist/containers/SwapHistory/SwapHistory.d.ts +7 -0
- package/dist/containers/SwapHistory/SwapHistory.stories.d.ts +4 -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 +4 -0
- package/dist/helper/index.d.ts +6 -0
- package/dist/helper/swaps.d.ts +5 -0
- package/dist/helpers.d.ts +1 -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 +1 -0
- package/dist/types/meta.d.ts +22 -0
- package/dist/types/swaps.d.ts +22 -0
- package/dist/types/wallet.d.ts +14 -0
- package/dist/ui.cjs.development.js +4103 -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 +4028 -0
- package/dist/ui.esm.js.map +1 -0
- package/package.json +89 -0
- package/src/components/Alert/Alert.stories.tsx +22 -0
- package/src/components/Alert/Alert.tsx +78 -0
- package/src/components/Alert/index.ts +1 -0
- package/src/components/BestRoute/BestRoute.stories.tsx +31 -0
- package/src/components/BestRoute/BestRoute.tsx +189 -0
- package/src/components/BestRoute/index.ts +1 -0
- package/src/components/BestRoute/mock.ts +544 -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 +60 -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 +407 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +22 -0
- package/src/components/Checkbox/Checkbox.tsx +54 -0
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/Chip/Chip.stories.tsx +37 -0
- package/src/components/Chip/Chip.tsx +45 -0
- package/src/components/Chip/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 +118 -0
- package/src/components/Drawer/Drawer.stories.tsx +86 -0
- package/src/components/Drawer/Drawer.tsx +128 -0
- package/src/components/Drawer/index.ts +1 -0
- package/src/components/Icon/AddCircleIcon.tsx +29 -0
- package/src/components/Icon/AddIcon.tsx +28 -0
- package/src/components/Icon/AddWalletIcon.tsx +48 -0
- package/src/components/Icon/AngleDownIcon.tsx +30 -0
- package/src/components/Icon/AngleLeftIcon.tsx +31 -0
- package/src/components/Icon/AngleRightIcon.tsx +30 -0
- package/src/components/Icon/AngleUpIcon.tsx +30 -0
- package/src/components/Icon/BagIcon.tsx +37 -0
- package/src/components/Icon/BanIcon.tsx +30 -0
- package/src/components/Icon/CheckCircleIcon.tsx +37 -0
- package/src/components/Icon/CheckIcon.tsx +28 -0
- package/src/components/Icon/CheckSquareIcon.tsx +35 -0
- package/src/components/Icon/CheckWalletIcon.tsx +43 -0
- package/src/components/Icon/CloseIcon.tsx +9 -0
- package/src/components/Icon/DeleteCircleIcon.tsx +29 -0
- package/src/components/Icon/DeleteWalletIcon.tsx +48 -0
- package/src/components/Icon/DownloadIcon.tsx +35 -0
- package/src/components/Icon/GasIcon.tsx +35 -0
- package/src/components/Icon/HistoryIcon.tsx +38 -0
- package/src/components/Icon/HorizontalSwapIcon.tsx +36 -0
- package/src/components/Icon/Icons.stories.tsx +44 -0
- package/src/components/Icon/InfoCircleIcon.tsx +37 -0
- package/src/components/Icon/MinusCircleIcon.tsx +29 -0
- package/src/components/Icon/RetryIcon.tsx +30 -0
- package/src/components/Icon/RetryLeftIcon.tsx +29 -0
- package/src/components/Icon/RetryRightIcon.tsx +29 -0
- package/src/components/Icon/SearchIcon.tsx +29 -0
- package/src/components/Icon/SearchMinusIcon.tsx +29 -0
- package/src/components/Icon/SettingIcon.tsx +37 -0
- package/src/components/Icon/SignatureIcon.tsx +30 -0
- package/src/components/Icon/SwapWalletIcon.tsx +48 -0
- package/src/components/Icon/TimeIcon.tsx +29 -0
- package/src/components/Icon/TrashIcon.tsx +29 -0
- package/src/components/Icon/TryAgainIcon.tsx +29 -0
- package/src/components/Icon/VerticalSwapIcon.tsx +36 -0
- package/src/components/Icon/WalletIconIcon.tsx +38 -0
- package/src/components/Icon/WarningIcon.tsx +35 -0
- package/src/components/Icon/common.ts +69 -0
- package/src/components/Icon/index.ts +44 -0
- package/src/components/Icon/types.tsx +44 -0
- package/src/components/LiquiditySourceList/LiquiditySource.stories.tsx +13 -0
- package/src/components/LiquiditySourceList/LiquiditySourceList.tsx +114 -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 +55 -0
- package/src/components/LiquiditySourcesSelector/index.ts +1 -0
- package/src/components/Modal/Modal.stories.tsx +22 -0
- package/src/components/Modal/Modal.tsx +76 -0
- package/src/components/Modal/index.ts +1 -0
- package/src/components/Radio/Radio.stories.tsx +23 -0
- package/src/components/Radio/Radio.tsx +95 -0
- package/src/components/Radio/index.ts +1 -0
- package/src/components/SecondaryPage/SecondaryPage.stories.tsx +7 -0
- package/src/components/SecondaryPage/SecondaryPage.tsx +95 -0
- package/src/components/SecondaryPage/index.ts +1 -0
- package/src/components/SelectableWalletList/SelectableWalletList.stories.tsx +14 -0
- package/src/components/SelectableWalletList/SelectableWalletList.tsx +113 -0
- package/src/components/SelectableWalletList/index.ts +1 -0
- package/src/components/SelectableWalletList/mock.ts +12 -0
- package/src/components/Settings/Settings.stories.tsx +34 -0
- package/src/components/Settings/Settings.tsx +160 -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 +18 -0
- package/src/components/Spacer/Spacer.tsx +98 -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 +81 -0
- package/src/components/StatusDrawer/index.ts +1 -0
- package/src/components/StepDetail/StepDetail.stories.tsx +37 -0
- package/src/components/StepDetail/StepDetail.tsx +97 -0
- package/src/components/StepDetail/index.ts +1 -0
- package/src/components/SwapContainer/SwapContainer.stories.tsx +13 -0
- package/src/components/SwapContainer/SwapContainer.tsx +35 -0
- package/src/components/SwapContainer/index.ts +1 -0
- package/src/components/SwapDetail/SwapDetail.stories.tsx +19 -0
- package/src/components/SwapDetail/SwapDetail.tsx +150 -0
- package/src/components/SwapDetail/index.ts +1 -0
- package/src/components/SwapDetail/mock.ts +275 -0
- package/src/components/Switch/Switch.stories.tsx +9 -0
- package/src/components/Switch/Switch.tsx +52 -0
- package/src/components/Switch/index.ts +1 -0
- package/src/components/TextField/TextField.stories.tsx +31 -0
- package/src/components/TextField/TextField.tsx +129 -0
- package/src/components/TextField/index.ts +1 -0
- package/src/components/TokenList/TokenList.stories.tsx +18 -0
- package/src/components/TokenList/TokenList.tsx +180 -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 +35 -0
- package/src/components/TokenSelector/index.ts +1 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +52 -0
- package/src/components/Tooltip/Tooltip.tsx +110 -0
- package/src/components/Tooltip/index.ts +1 -0
- package/src/components/Typography/Typography.stories.tsx +68 -0
- package/src/components/Typography/Typography.tsx +199 -0
- package/src/components/Typography/index.ts +1 -0
- package/src/components/VirtualizedList/VirtualizedList.tsx +78 -0
- package/src/components/Wallet/State.tsx +36 -0
- package/src/components/Wallet/Wallet.stories.tsx +36 -0
- package/src/components/Wallet/Wallet.tsx +42 -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 +24 -0
- package/src/containers/ConfirmSwap/ConfirmSwap.stories.tsx +13 -0
- package/src/containers/ConfirmSwap/ConfirmSwap.tsx +154 -0
- package/src/containers/ConfirmSwap/index.ts +1 -0
- package/src/containers/ConfirmSwap/mock.ts +146 -0
- package/src/containers/ConfirmWallets/ConfirmWallets.stories.tsx +26 -0
- package/src/containers/ConfirmWallets/ConfirmWallets.tsx +98 -0
- package/src/containers/ConfirmWallets/index.ts +1 -0
- package/src/containers/ConfirmWallets/mock.ts +222 -0
- package/src/containers/ConfirmWallets/types.ts +9 -0
- package/src/containers/History/History.stories.tsx +14 -0
- package/src/containers/History/History.tsx +93 -0
- package/src/containers/History/index.ts +1 -0
- package/src/containers/History/mock.ts +825 -0
- package/src/containers/History/types.tsx +66 -0
- package/src/containers/SwapHistory/SwapHistory.stories.tsx +13 -0
- package/src/containers/SwapHistory/SwapHistory.tsx +165 -0
- package/src/containers/SwapHistory/index.ts +1 -0
- package/src/containers/SwapHistory/mock.ts +275 -0
- package/src/containers/index.ts +4 -0
- package/src/helper/index.ts +23 -0
- package/src/helper/swaps.ts +23 -0
- package/src/helpers.ts +2 -0
- package/src/index.ts +4 -0
- package/src/theme.ts +161 -0
- package/src/types/index.ts +1 -0
- package/src/types/meta.ts +20 -0
- package/src/types/swaps.tsx +36 -0
- package/src/types/wallet.ts +20 -0
package/package.json
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rango-dev/ui",
|
|
3
|
+
"version": "0.1.10-next.69",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"typings": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"src"
|
|
10
|
+
],
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=10"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"dev": "tsdx watch",
|
|
16
|
+
"build": "tsdx build",
|
|
17
|
+
"test": "tsdx test --passWithNoTests",
|
|
18
|
+
"lint": "tsdx lint",
|
|
19
|
+
"prepare": "tsdx build",
|
|
20
|
+
"size": "size-limit",
|
|
21
|
+
"analyze": "size-limit --why",
|
|
22
|
+
"storybook": "start-storybook -p 3000",
|
|
23
|
+
"build-storybook": "build-storybook"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"react": ">=16"
|
|
27
|
+
},
|
|
28
|
+
"husky": {
|
|
29
|
+
"hooks": {
|
|
30
|
+
"pre-commit": "tsdx lint"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"prettier": {
|
|
34
|
+
"printWidth": 80,
|
|
35
|
+
"semi": true,
|
|
36
|
+
"singleQuote": true,
|
|
37
|
+
"trailingComma": "es5"
|
|
38
|
+
},
|
|
39
|
+
"module": "dist/ui.esm.js",
|
|
40
|
+
"size-limit": [
|
|
41
|
+
{
|
|
42
|
+
"path": "dist/ui.cjs.production.min.js",
|
|
43
|
+
"limit": "10 KB"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"path": "dist/ui.esm.js",
|
|
47
|
+
"limit": "10 KB"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@babel/core": "^7.20.2",
|
|
52
|
+
"@size-limit/preset-small-lib": "^8.1.0",
|
|
53
|
+
"@storybook/addon-essentials": "^6.5.13",
|
|
54
|
+
"@storybook/addon-info": "^5.3.21",
|
|
55
|
+
"@storybook/addon-links": "^6.5.13",
|
|
56
|
+
"@storybook/addons": "^6.5.13",
|
|
57
|
+
"@storybook/react": "^6.5.13",
|
|
58
|
+
"@types/react": "^18.0.25",
|
|
59
|
+
"@types/react-dom": "^18.0.8",
|
|
60
|
+
"@types/react-virtualized-auto-sizer": "^1.0.1",
|
|
61
|
+
"@types/react-window": "^1.8.5",
|
|
62
|
+
"@types/react-window-infinite-loader": "^1.0.6",
|
|
63
|
+
"babel-loader": "^9.1.0",
|
|
64
|
+
"husky": "^8.0.2",
|
|
65
|
+
"react": "^18.2.0",
|
|
66
|
+
"react-dom": "^18.2.0",
|
|
67
|
+
"react-is": "^18.2.0",
|
|
68
|
+
"size-limit": "^8.1.0",
|
|
69
|
+
"tsdx": "^0.14.1",
|
|
70
|
+
"tslib": "^2.4.1",
|
|
71
|
+
"typescript": "^4.8.4"
|
|
72
|
+
},
|
|
73
|
+
"dependencies": {
|
|
74
|
+
"@radix-ui/react-checkbox": "^1.0.1",
|
|
75
|
+
"@radix-ui/react-radio-group": "^1.1.1",
|
|
76
|
+
"@radix-ui/react-switch": "^1.0.1",
|
|
77
|
+
"@radix-ui/react-tooltip": "^1.0.2",
|
|
78
|
+
"@rango-dev/wallets-shared": "^0.1.11-next.69",
|
|
79
|
+
"@stitches/react": "^1.2.8",
|
|
80
|
+
"rango-sdk": "^0.1.11",
|
|
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
|
+
"gitHead": "35fad4db1d491a9589a8215b0c4a4e2f541d07f2"
|
|
89
|
+
}
|
|
@@ -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,78 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CheckCircleIcon, InfoCircleIcon, WarningIcon } from '../Icon';
|
|
3
|
+
import { Typography } from '../Typography';
|
|
4
|
+
import { styled } from '../../theme';
|
|
5
|
+
|
|
6
|
+
const MainContainer = styled('div', {
|
|
7
|
+
display: 'flex',
|
|
8
|
+
width: '100%',
|
|
9
|
+
alignItems: 'center',
|
|
10
|
+
padding: '$16',
|
|
11
|
+
borderRadius: '$5',
|
|
12
|
+
variants: {
|
|
13
|
+
type: {
|
|
14
|
+
primary: {
|
|
15
|
+
backgroundColor: '$primary200',
|
|
16
|
+
},
|
|
17
|
+
secondary: {
|
|
18
|
+
backgroundColor: '$neutrals400',
|
|
19
|
+
},
|
|
20
|
+
success: {
|
|
21
|
+
backgroundColor: '$success300',
|
|
22
|
+
},
|
|
23
|
+
warning: {
|
|
24
|
+
backgroundColor: '$warning300',
|
|
25
|
+
},
|
|
26
|
+
error: {
|
|
27
|
+
backgroundColor: '$error300',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const ContentContainer = styled('div', {
|
|
34
|
+
display: 'flex',
|
|
35
|
+
flexDirection: 'column',
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const TitleContainer = styled('div', {
|
|
39
|
+
marginBottom: '$8',
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const IconContainer = styled('div', {
|
|
43
|
+
marginRight: '$24',
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export interface PropTypes {
|
|
47
|
+
type: 'primary' | 'secondary' | 'success' | 'warning' | 'error';
|
|
48
|
+
description: string;
|
|
49
|
+
title?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function Alert(props: PropTypes) {
|
|
53
|
+
const { type, description, title } = props;
|
|
54
|
+
|
|
55
|
+
const showIcon = (
|
|
56
|
+
['error', 'success', 'warning'] as PropTypes['type'][]
|
|
57
|
+
).includes(type);
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<MainContainer type={type}>
|
|
61
|
+
{showIcon && (
|
|
62
|
+
<IconContainer>
|
|
63
|
+
{type === 'success' && <CheckCircleIcon color="success" size={28} />}
|
|
64
|
+
{type === 'warning' && <WarningIcon size={28} />}
|
|
65
|
+
{type === 'error' && <InfoCircleIcon color="error" size={28} />}
|
|
66
|
+
</IconContainer>
|
|
67
|
+
)}
|
|
68
|
+
<ContentContainer>
|
|
69
|
+
{title && (
|
|
70
|
+
<TitleContainer>
|
|
71
|
+
<Typography variant="h6">{title}</Typography>
|
|
72
|
+
</TitleContainer>
|
|
73
|
+
)}
|
|
74
|
+
<Typography variant="body2">{description}</Typography>
|
|
75
|
+
</ContentContainer>
|
|
76
|
+
</MainContainer>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Alert } from './Alert';
|
|
@@ -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,189 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { GasIcon, TimeIcon } from '../../components/Icon';
|
|
3
|
+
import { StepDetail } from '../../components/StepDetail';
|
|
4
|
+
import { Typography } from '../../components/Typography';
|
|
5
|
+
import { rawFees, secondsToString, totalArrivalTime } from '../../helper';
|
|
6
|
+
import { styled } from '../../theme';
|
|
7
|
+
import { Skeleton } from '../Skeleton';
|
|
8
|
+
import { Spinner } from '../Spinner';
|
|
9
|
+
import { BestRouteResponse } from 'rango-sdk';
|
|
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
|
+
const HR = styled('hr', {
|
|
45
|
+
width: '100%',
|
|
46
|
+
background: '$neutrals200',
|
|
47
|
+
margin: '$8 0',
|
|
48
|
+
});
|
|
49
|
+
const SwapperLogo = styled('img', {
|
|
50
|
+
width: '$16',
|
|
51
|
+
height: '$16',
|
|
52
|
+
});
|
|
53
|
+
const RelativeContainer = styled('div', {
|
|
54
|
+
position: 'relative',
|
|
55
|
+
});
|
|
56
|
+
const Dot = styled('div', {
|
|
57
|
+
width: '$6',
|
|
58
|
+
height: '$6',
|
|
59
|
+
backgroundColor: '$foreground',
|
|
60
|
+
position: 'absolute',
|
|
61
|
+
top: '45%',
|
|
62
|
+
right: -5,
|
|
63
|
+
marginLeft: '$8',
|
|
64
|
+
borderRadius: '50%',
|
|
65
|
+
'@md': {
|
|
66
|
+
width: '$8',
|
|
67
|
+
height: '$8',
|
|
68
|
+
right: -8,
|
|
69
|
+
top: '45%',
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
const ArrowRight = styled('div', {
|
|
73
|
+
width: '0px',
|
|
74
|
+
height: '0px',
|
|
75
|
+
borderTop: '5px solid transparent',
|
|
76
|
+
borderBottom: '5px solid transparent',
|
|
77
|
+
borderLeft: '5px solid $foreground',
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const GasContainer = styled('div', {
|
|
81
|
+
backgroundColor: '$neutrals300',
|
|
82
|
+
borderRadius: '5px',
|
|
83
|
+
margin: '$4',
|
|
84
|
+
display: 'flex',
|
|
85
|
+
flexDirection: 'column',
|
|
86
|
+
justifyContent: 'center',
|
|
87
|
+
alignItems: 'center',
|
|
88
|
+
padding: '$4',
|
|
89
|
+
'@md': {
|
|
90
|
+
padding: '$8',
|
|
91
|
+
margin: '$8',
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
const SkeletonContainer = styled('div', {
|
|
95
|
+
padding: '$4',
|
|
96
|
+
'@md': {
|
|
97
|
+
padding: '$8',
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
const SwapperContainer = styled('div', {
|
|
101
|
+
display: 'flex',
|
|
102
|
+
justifyContent: 'center',
|
|
103
|
+
alignItems: 'center',
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
export interface PropTypes {
|
|
107
|
+
data: BestRouteResponse | null;
|
|
108
|
+
loading?: boolean;
|
|
109
|
+
error?: string;
|
|
110
|
+
}
|
|
111
|
+
export function BestRoute({
|
|
112
|
+
data,
|
|
113
|
+
loading,
|
|
114
|
+
error,
|
|
115
|
+
}: PropsWithChildren<PropTypes>) {
|
|
116
|
+
let fee,
|
|
117
|
+
time: string = '';
|
|
118
|
+
|
|
119
|
+
if (!!data) {
|
|
120
|
+
fee = rawFees(data);
|
|
121
|
+
time = secondsToString(totalArrivalTime(data));
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<Container>
|
|
126
|
+
{loading ? (
|
|
127
|
+
<SkeletonContainer>
|
|
128
|
+
<Skeleton width={48} height={94} />
|
|
129
|
+
</SkeletonContainer>
|
|
130
|
+
) : (
|
|
131
|
+
<GasContainer>
|
|
132
|
+
<GasIcon size={20} />
|
|
133
|
+
<Typography mt={4} align="center" variant="caption">
|
|
134
|
+
{error && '-'}
|
|
135
|
+
{!!data && `$${fee}`}
|
|
136
|
+
</Typography>
|
|
137
|
+
<HR />
|
|
138
|
+
<TimeIcon size={20} />
|
|
139
|
+
<Typography mt={4} align="center" variant="caption">
|
|
140
|
+
{error && '-'}
|
|
141
|
+
{!!data && `~${time}m`}
|
|
142
|
+
</Typography>
|
|
143
|
+
</GasContainer>
|
|
144
|
+
)}
|
|
145
|
+
<BestRouteContainer>
|
|
146
|
+
{loading && <Spinner color="primary" />}
|
|
147
|
+
|
|
148
|
+
{error && <ErrorMsg variant="caption">{error}</ErrorMsg>}
|
|
149
|
+
|
|
150
|
+
{!!data &&
|
|
151
|
+
data.result?.swaps.map((swap, index) => (
|
|
152
|
+
<>
|
|
153
|
+
{index === 0 && (
|
|
154
|
+
<RelativeContainer>
|
|
155
|
+
<StepDetail
|
|
156
|
+
direction="vertical"
|
|
157
|
+
logo={swap.from.logo}
|
|
158
|
+
symbol={swap.from.symbol}
|
|
159
|
+
chainLogo={swap.from.blockchainLogo}
|
|
160
|
+
blockchain={swap.from.blockchain}
|
|
161
|
+
amount={swap.fromAmount}
|
|
162
|
+
/>
|
|
163
|
+
<Dot />
|
|
164
|
+
</RelativeContainer>
|
|
165
|
+
)}
|
|
166
|
+
<SwapperContainer>
|
|
167
|
+
<Line />
|
|
168
|
+
<SwapperLogo src={swap.swapperLogo} alt={swap.swapperId} />
|
|
169
|
+
<Line />
|
|
170
|
+
</SwapperContainer>
|
|
171
|
+
|
|
172
|
+
{index + 1 === data.result?.swaps.length && <ArrowRight />}
|
|
173
|
+
<StepDetail
|
|
174
|
+
direction="vertical"
|
|
175
|
+
logo={swap.to.logo}
|
|
176
|
+
symbol={swap.to.symbol}
|
|
177
|
+
chainLogo={swap.to.blockchainLogo}
|
|
178
|
+
blockchain={swap.to.blockchain}
|
|
179
|
+
amount={swap.toAmount}
|
|
180
|
+
/>
|
|
181
|
+
</>
|
|
182
|
+
))}
|
|
183
|
+
{!!data && !data?.result && (
|
|
184
|
+
<Typography variant="body2">No routes found</Typography>
|
|
185
|
+
)}
|
|
186
|
+
</BestRouteContainer>
|
|
187
|
+
</Container>
|
|
188
|
+
);
|
|
189
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BestRoute } from './BestRoute';
|