@rango-dev/ui 0.1.12 → 0.1.13
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/hooks/index.d.ts +1 -0
- package/dist/hooks/useCopyToClipboard.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/ui.cjs.development.js +98 -34
- package/dist/ui.cjs.development.js.map +1 -1
- package/dist/ui.cjs.production.min.js +1 -1
- package/dist/ui.cjs.production.min.js.map +1 -1
- package/dist/ui.esm.js +98 -35
- package/dist/ui.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/BlockchainSelector/BlockchainSelector.tsx +2 -2
- package/src/components/Icon/ArrowRightIcon.tsx +3 -3
- package/src/components/Icon/ChevronRightIcon.tsx +3 -3
- package/src/components/Icon/DisconnectIcon.tsx +3 -3
- package/src/components/Icon/HistoryIcon.tsx +3 -3
- package/src/components/Icon/RetryIcon.tsx +3 -3
- package/src/components/Icon/SettingIcon.tsx +3 -3
- package/src/components/LiquiditySourcesSelector/LiquiditySourcesSelector.tsx +1 -1
- package/src/components/SwapContainer/SwapContainer.tsx +16 -0
- package/src/components/SwapDetail/Token.tsx +3 -1
- package/src/components/TextField/TextField.tsx +10 -2
- package/src/components/TokenSelector/TokenSelector.tsx +2 -2
- package/src/components/Wallet/Wallet.tsx +4 -0
- package/src/containers/ConfirmSwap/ConfirmSwap.tsx +4 -4
- package/src/containers/History/History.tsx +1 -1
- package/src/containers/History/SwapsGroup.tsx +7 -7
- package/src/containers/SwapHistory/SwapMessages.tsx +3 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useCopyToClipboard.ts +23 -0
- package/src/index.ts +1 -0
- /package/{README.md → readme.md} +0 -0
package/dist/ui.esm.js
CHANGED
|
@@ -9,6 +9,7 @@ import { detectInstallLink } from '@rango-dev/wallets-shared';
|
|
|
9
9
|
import { Root as Root$2, Thumb } from '@radix-ui/react-switch';
|
|
10
10
|
import { Root as Root$3, Item, Indicator as Indicator$1 } from '@radix-ui/react-radio-group';
|
|
11
11
|
import { ChromePicker } from 'react-color';
|
|
12
|
+
import copy from 'copy-to-clipboard';
|
|
12
13
|
|
|
13
14
|
function _extends() {
|
|
14
15
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -548,9 +549,9 @@ var HistoryIcon = function HistoryIcon(_ref) {
|
|
|
548
549
|
color: color,
|
|
549
550
|
fill: "none",
|
|
550
551
|
stroke: "currentColor",
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
552
|
+
strokeWidth: "2",
|
|
553
|
+
strokeLinecap: "round",
|
|
554
|
+
strokeLinejoin: "round",
|
|
554
555
|
xmlns: "http://www.w3.org/2000/svg",
|
|
555
556
|
className: "_icon"
|
|
556
557
|
}, props), createElement("path", {
|
|
@@ -617,9 +618,9 @@ var SettingsIcon = function SettingsIcon(_ref) {
|
|
|
617
618
|
viewBox: "0 0 24 24",
|
|
618
619
|
color: color,
|
|
619
620
|
stroke: "currentColor",
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
621
|
+
strokeWidth: "2",
|
|
622
|
+
strokeLinecap: "round",
|
|
623
|
+
strokeLinejoin: "round",
|
|
623
624
|
fill: "none",
|
|
624
625
|
xmlns: "http://www.w3.org/2000/svg",
|
|
625
626
|
className: "_icon"
|
|
@@ -859,9 +860,9 @@ var ChevronRightIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
|
859
860
|
viewBox: "0 0 24 24",
|
|
860
861
|
fill: "none",
|
|
861
862
|
stroke: "currentColor",
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
863
|
+
strokeWidth: "2",
|
|
864
|
+
strokeLinecap: "round",
|
|
865
|
+
strokeLinejoin: "round",
|
|
865
866
|
className: "_icon"
|
|
866
867
|
}, props, {
|
|
867
868
|
ref: forwardedRef
|
|
@@ -886,9 +887,9 @@ var ArrowRightIcon = function ArrowRightIcon(_ref) {
|
|
|
886
887
|
color: color,
|
|
887
888
|
fill: "none",
|
|
888
889
|
stroke: "currentColor",
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
890
|
+
strokeWidth: "2",
|
|
891
|
+
strokeLinecap: "round",
|
|
892
|
+
strokeLinejoin: "round",
|
|
892
893
|
xmlns: "http://www.w3.org/2000/svg",
|
|
893
894
|
className: "_icon"
|
|
894
895
|
}, props), createElement("line", {
|
|
@@ -1056,9 +1057,9 @@ var RetryIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
|
1056
1057
|
viewBox: "0 0 24 24",
|
|
1057
1058
|
fill: "none",
|
|
1058
1059
|
stroke: "currentColor",
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1060
|
+
strokeWidth: "2",
|
|
1061
|
+
strokeLinecap: "round",
|
|
1062
|
+
strokeLinejoin: "round",
|
|
1062
1063
|
className: "_icon"
|
|
1063
1064
|
}, props, {
|
|
1064
1065
|
ref: forwardedRef
|
|
@@ -1275,9 +1276,9 @@ var DisconnectIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
|
1275
1276
|
viewBox: "0 0 24 24",
|
|
1276
1277
|
fill: "none",
|
|
1277
1278
|
stroke: "currentColor",
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1279
|
+
strokeWidth: "2",
|
|
1280
|
+
strokeLinecap: "round",
|
|
1281
|
+
strokeLinejoin: "round",
|
|
1281
1282
|
className: "_icon"
|
|
1282
1283
|
}, props, {
|
|
1283
1284
|
ref: forwardedRef
|
|
@@ -2657,12 +2658,21 @@ var InputContainer = /*#__PURE__*/styled('div', {
|
|
|
2657
2658
|
variants: {
|
|
2658
2659
|
size: {
|
|
2659
2660
|
small: {
|
|
2661
|
+
'& input': {
|
|
2662
|
+
fontSize: '$14'
|
|
2663
|
+
},
|
|
2660
2664
|
height: '$32'
|
|
2661
2665
|
},
|
|
2662
2666
|
medium: {
|
|
2667
|
+
'& input': {
|
|
2668
|
+
fontSize: '$15'
|
|
2669
|
+
},
|
|
2663
2670
|
height: '$40'
|
|
2664
2671
|
},
|
|
2665
2672
|
large: {
|
|
2673
|
+
'& input': {
|
|
2674
|
+
fontSize: '$16'
|
|
2675
|
+
},
|
|
2666
2676
|
height: '$48'
|
|
2667
2677
|
}
|
|
2668
2678
|
},
|
|
@@ -2703,7 +2713,6 @@ var Input = /*#__PURE__*/styled('input', {
|
|
|
2703
2713
|
border: 'none',
|
|
2704
2714
|
borderRadius: '$5',
|
|
2705
2715
|
outline: 'none',
|
|
2706
|
-
fontSize: '$l',
|
|
2707
2716
|
backgroundColor: 'transparent',
|
|
2708
2717
|
'-webkit-appearance': 'none',
|
|
2709
2718
|
margin: 0,
|
|
@@ -3217,9 +3226,9 @@ function TokenSelector(props) {
|
|
|
3217
3226
|
return React__default.createElement(SecondaryPage, {
|
|
3218
3227
|
textField: true,
|
|
3219
3228
|
hasHeader: hasHeader,
|
|
3220
|
-
title: "Select " + type + "
|
|
3229
|
+
title: "Select " + type + " token",
|
|
3221
3230
|
onBack: onBack,
|
|
3222
|
-
textFieldPlaceholder: "Search
|
|
3231
|
+
textFieldPlaceholder: "Search tokens by name"
|
|
3223
3232
|
}, function (searchedFor) {
|
|
3224
3233
|
var filteredTokens = filterTokens(list, searchedFor);
|
|
3225
3234
|
return loadingStatus === 'loading' ? React__default.createElement(LoaderContainer, null, React__default.createElement(Spinner, {
|
|
@@ -3259,8 +3268,8 @@ function BlockchainSelector(props) {
|
|
|
3259
3268
|
return React__default.createElement(SecondaryPage, {
|
|
3260
3269
|
textField: true,
|
|
3261
3270
|
hasHeader: hasHeader,
|
|
3262
|
-
textFieldPlaceholder: "Search
|
|
3263
|
-
title: "Select " + type + "
|
|
3271
|
+
textFieldPlaceholder: "Search blockchains by name",
|
|
3272
|
+
title: "Select " + type + " Blockchain",
|
|
3264
3273
|
onBack: onBack
|
|
3265
3274
|
}, function (searchedFor) {
|
|
3266
3275
|
var filteredBlockchains = filterBlockchains(list, searchedFor);
|
|
@@ -3441,7 +3450,10 @@ var State = function State(_ref) {
|
|
|
3441
3450
|
};
|
|
3442
3451
|
|
|
3443
3452
|
var WalletImageContainer = /*#__PURE__*/styled('div', {
|
|
3444
|
-
paddingRight: '$12'
|
|
3453
|
+
paddingRight: '$12',
|
|
3454
|
+
'& img': {
|
|
3455
|
+
borderRadius: '50%'
|
|
3456
|
+
}
|
|
3445
3457
|
});
|
|
3446
3458
|
var Text = /*#__PURE__*/styled('div', {
|
|
3447
3459
|
display: 'flex',
|
|
@@ -3728,7 +3740,7 @@ function LiquiditySourcesSelector(props) {
|
|
|
3728
3740
|
loadingStatus = props.loadingStatus;
|
|
3729
3741
|
return React__default.createElement(SecondaryPage, {
|
|
3730
3742
|
textField: true,
|
|
3731
|
-
textFieldPlaceholder: "Search
|
|
3743
|
+
textFieldPlaceholder: "Search by name",
|
|
3732
3744
|
title: "Liquidity Sources",
|
|
3733
3745
|
TopButton: React__default.createElement(Button, {
|
|
3734
3746
|
variant: "ghost",
|
|
@@ -4096,6 +4108,25 @@ var MainContainer$2 = /*#__PURE__*/styled('div', {
|
|
|
4096
4108
|
padding: '$16',
|
|
4097
4109
|
boxSizing: 'border-box',
|
|
4098
4110
|
backgroundColor: '$background',
|
|
4111
|
+
overflow: 'hidden',
|
|
4112
|
+
'& *': {
|
|
4113
|
+
boxSizing: 'border-box',
|
|
4114
|
+
listStyleType: 'none',
|
|
4115
|
+
'&::-webkit-scrollbar': {
|
|
4116
|
+
width: '$8',
|
|
4117
|
+
height: '$8'
|
|
4118
|
+
},
|
|
4119
|
+
'&::-webkit-scrollbar-thumb': {
|
|
4120
|
+
backgroundColor: '$neutrals400',
|
|
4121
|
+
borderRadius: '$10'
|
|
4122
|
+
},
|
|
4123
|
+
'&::-webkit-scrollbar-thumb:hover': {
|
|
4124
|
+
backgroundColor: '$neutrals500'
|
|
4125
|
+
},
|
|
4126
|
+
'&::-webkit-scrollbar-track': {
|
|
4127
|
+
backgroundColor: '$neutrals300'
|
|
4128
|
+
}
|
|
4129
|
+
},
|
|
4099
4130
|
variants: {
|
|
4100
4131
|
fixedHeight: {
|
|
4101
4132
|
"true": {
|
|
@@ -4133,6 +4164,9 @@ var TokenContainer = /*#__PURE__*/styled('div', {
|
|
|
4133
4164
|
});
|
|
4134
4165
|
var TokenImage = /*#__PURE__*/styled('div', {
|
|
4135
4166
|
position: 'relative',
|
|
4167
|
+
'img': {
|
|
4168
|
+
borderRadius: '50%'
|
|
4169
|
+
},
|
|
4136
4170
|
'.overlay': {
|
|
4137
4171
|
position: 'absolute',
|
|
4138
4172
|
right: -4,
|
|
@@ -4491,7 +4525,9 @@ function ConfirmSwap(props) {
|
|
|
4491
4525
|
disabled: confirmDisabled
|
|
4492
4526
|
}, confirmButtonTitle))
|
|
4493
4527
|
}, React__default.createElement(MainContainer$3, null, React__default.createElement("div", null, extraMessages || null, React__default.createElement(Alerts, null, errors == null ? void 0 : errors.map(function (error, index) {
|
|
4494
|
-
return React__default.createElement(React__default.Fragment,
|
|
4528
|
+
return React__default.createElement(React__default.Fragment, {
|
|
4529
|
+
key: index
|
|
4530
|
+
}, React__default.createElement(Spacer, {
|
|
4495
4531
|
direction: "vertical"
|
|
4496
4532
|
}), React__default.createElement(Alert, Object.assign({
|
|
4497
4533
|
type: "error",
|
|
@@ -4502,7 +4538,9 @@ function ConfirmSwap(props) {
|
|
|
4502
4538
|
children: error
|
|
4503
4539
|
})));
|
|
4504
4540
|
}), warnings == null ? void 0 : warnings.map(function (warning, index) {
|
|
4505
|
-
return React__default.createElement(React__default.Fragment,
|
|
4541
|
+
return React__default.createElement(React__default.Fragment, {
|
|
4542
|
+
key: index
|
|
4543
|
+
}, React__default.createElement(Spacer, {
|
|
4506
4544
|
direction: "vertical"
|
|
4507
4545
|
}), React__default.createElement(Alert, Object.assign({
|
|
4508
4546
|
type: "warning",
|
|
@@ -4561,15 +4599,16 @@ function SwapsGroup(props) {
|
|
|
4561
4599
|
return React__default.createElement(React__default.Fragment, null, groups.filter(function (group) {
|
|
4562
4600
|
return group.swaps.length > 0;
|
|
4563
4601
|
}).map(function (group, index) {
|
|
4564
|
-
return React__default.createElement(React__default.Fragment,
|
|
4602
|
+
return React__default.createElement(React__default.Fragment, {
|
|
4565
4603
|
key: index
|
|
4566
|
-
}, React__default.createElement(Typography, {
|
|
4604
|
+
}, React__default.createElement(Group, null, React__default.createElement(Typography, {
|
|
4567
4605
|
variant: "body2",
|
|
4568
4606
|
color: "neutrals600",
|
|
4569
4607
|
className: "group-title"
|
|
4570
|
-
}, group.title), group.swaps.map(function (swap
|
|
4571
|
-
return React__default.createElement(React__default.Fragment,
|
|
4572
|
-
key:
|
|
4608
|
+
}, group.title), group.swaps.map(function (swap) {
|
|
4609
|
+
return React__default.createElement(React__default.Fragment, {
|
|
4610
|
+
key: swap.requestId
|
|
4611
|
+
}, React__default.createElement(SwapDetail, {
|
|
4573
4612
|
swap: swap,
|
|
4574
4613
|
status: swap.status,
|
|
4575
4614
|
onClick: onSwapClick
|
|
@@ -4602,7 +4641,7 @@ function History(props) {
|
|
|
4602
4641
|
return React__default.createElement(SecondaryPage, {
|
|
4603
4642
|
onBack: onBack,
|
|
4604
4643
|
textField: true,
|
|
4605
|
-
textFieldPlaceholder: "Search by
|
|
4644
|
+
textFieldPlaceholder: "Search by blockchain, token or request Id",
|
|
4606
4645
|
title: "Swaps"
|
|
4607
4646
|
}, function (searchedFor) {
|
|
4608
4647
|
var filterSwaps = filteredHistory(list, searchedFor);
|
|
@@ -4655,7 +4694,9 @@ var SwapMessages = function SwapMessages(props) {
|
|
|
4655
4694
|
footer: React__default.createElement(Button, {
|
|
4656
4695
|
variant: 'outlined',
|
|
4657
4696
|
type: "primary",
|
|
4658
|
-
onClick:
|
|
4697
|
+
onClick: function onClick() {
|
|
4698
|
+
(props == null ? void 0 : props.switchNetwork) && props.switchNetwork()["catch"](function () {});
|
|
4699
|
+
}
|
|
4659
4700
|
}, "Change network to ", currentStepBlockchain)
|
|
4660
4701
|
}), !!detailedMessage.content ? React__default.createElement(DetailedMessage, null, React__default.createElement(Typography, {
|
|
4661
4702
|
variant: "body2"
|
|
@@ -4938,5 +4979,27 @@ function SwapHistory(props) {
|
|
|
4938
4979
|
}));
|
|
4939
4980
|
}
|
|
4940
4981
|
|
|
4941
|
-
|
|
4982
|
+
function useCopyToClipboard(resetInterval) {
|
|
4983
|
+
var _React$useState = React__default.useState(false),
|
|
4984
|
+
isCopied = _React$useState[0],
|
|
4985
|
+
setCopied = _React$useState[1];
|
|
4986
|
+
var handleCopy = React__default.useCallback(function (text) {
|
|
4987
|
+
copy(text.toString());
|
|
4988
|
+
setCopied(true);
|
|
4989
|
+
}, []);
|
|
4990
|
+
React__default.useEffect(function () {
|
|
4991
|
+
var timeout;
|
|
4992
|
+
if (isCopied && resetInterval) {
|
|
4993
|
+
timeout = setTimeout(function () {
|
|
4994
|
+
return setCopied(false);
|
|
4995
|
+
}, resetInterval);
|
|
4996
|
+
}
|
|
4997
|
+
return function () {
|
|
4998
|
+
clearTimeout(timeout);
|
|
4999
|
+
};
|
|
5000
|
+
}, [isCopied, resetInterval]);
|
|
5001
|
+
return [isCopied, handleCopy];
|
|
5002
|
+
}
|
|
5003
|
+
|
|
5004
|
+
export { AddCircleIcon, AddIcon, AddWalletIcon, Alert, AngleDownIcon, AngleLeftIcon, AngleRightIcon, AngleUpIcon, ArrowRightIcon, BagIcon, BanIcon, BestRoute, BlockchainSelector, Button, CheckCircleIcon, CheckIcon, CheckSquareIcon, CheckWalletIcon, Checkbox, ChevronRightIcon, Chip, CloseIcon, ColorPicker, ConfirmSwap, ConnectWalletsModal, CopyIcon, DeleteCircleIcon, DeleteWalletIcon, DisconnectIcon, Divider, DownloadIcon, Drawer, FilledCircle, GasIcon, Header, History, HistoryIcon, HorizontalSwapIcon, Image, InfoCircleIcon, LiquiditySourcesSelector, LoadingFailedAlert, MinusCircleIcon, Modal, Radio, RetryIcon, RetryLeftIcon, RetryRightIcon, SearchIcon, SearchMinusIcon, SecondaryPage, SelectableWalletList, Settings, SettingsIcon, SignatureIcon, Spacer, Spinner, StepDetail, SwapContainer, SwapDetail, SwapHistory, SwapWalletIcon, SwapsGroup, Switch, TextField, TimeIcon, TokenList, TokenSelector, Tooltip, TrashIcon, TryAgainIcon, Typography, VerticalSwapIcon, Wallet, WalletIcon, WalletState, WarningIcon, createTheme, css, darkTheme, globalCss, keyframes, lightTheme, styled, useCopyToClipboard };
|
|
4942
5005
|
//# sourceMappingURL=ui.esm.js.map
|