@rango-dev/ui 0.1.12 → 0.1.13-next.2
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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useCopyToClipboard } from './useCopyToClipboard';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useCopyToClipboard(resetInterval?: number): readonly [boolean, (text: string | number) => void];
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ var walletsShared = require('@rango-dev/wallets-shared');
|
|
|
16
16
|
var RadixSwitch = require('@radix-ui/react-switch');
|
|
17
17
|
var RadioGroup = require('@radix-ui/react-radio-group');
|
|
18
18
|
var reactColor = require('react-color');
|
|
19
|
+
var copy = _interopDefault(require('copy-to-clipboard'));
|
|
19
20
|
|
|
20
21
|
function _extends() {
|
|
21
22
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -555,9 +556,9 @@ var HistoryIcon = function HistoryIcon(_ref) {
|
|
|
555
556
|
color: color,
|
|
556
557
|
fill: "none",
|
|
557
558
|
stroke: "currentColor",
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
559
|
+
strokeWidth: "2",
|
|
560
|
+
strokeLinecap: "round",
|
|
561
|
+
strokeLinejoin: "round",
|
|
561
562
|
xmlns: "http://www.w3.org/2000/svg",
|
|
562
563
|
className: "_icon"
|
|
563
564
|
}, props), React.createElement("path", {
|
|
@@ -624,9 +625,9 @@ var SettingsIcon = function SettingsIcon(_ref) {
|
|
|
624
625
|
viewBox: "0 0 24 24",
|
|
625
626
|
color: color,
|
|
626
627
|
stroke: "currentColor",
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
628
|
+
strokeWidth: "2",
|
|
629
|
+
strokeLinecap: "round",
|
|
630
|
+
strokeLinejoin: "round",
|
|
630
631
|
fill: "none",
|
|
631
632
|
xmlns: "http://www.w3.org/2000/svg",
|
|
632
633
|
className: "_icon"
|
|
@@ -866,9 +867,9 @@ var ChevronRightIcon = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRe
|
|
|
866
867
|
viewBox: "0 0 24 24",
|
|
867
868
|
fill: "none",
|
|
868
869
|
stroke: "currentColor",
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
870
|
+
strokeWidth: "2",
|
|
871
|
+
strokeLinecap: "round",
|
|
872
|
+
strokeLinejoin: "round",
|
|
872
873
|
className: "_icon"
|
|
873
874
|
}, props, {
|
|
874
875
|
ref: forwardedRef
|
|
@@ -893,9 +894,9 @@ var ArrowRightIcon = function ArrowRightIcon(_ref) {
|
|
|
893
894
|
color: color,
|
|
894
895
|
fill: "none",
|
|
895
896
|
stroke: "currentColor",
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
897
|
+
strokeWidth: "2",
|
|
898
|
+
strokeLinecap: "round",
|
|
899
|
+
strokeLinejoin: "round",
|
|
899
900
|
xmlns: "http://www.w3.org/2000/svg",
|
|
900
901
|
className: "_icon"
|
|
901
902
|
}, props), React.createElement("line", {
|
|
@@ -1063,9 +1064,9 @@ var RetryIcon = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
|
|
1063
1064
|
viewBox: "0 0 24 24",
|
|
1064
1065
|
fill: "none",
|
|
1065
1066
|
stroke: "currentColor",
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1067
|
+
strokeWidth: "2",
|
|
1068
|
+
strokeLinecap: "round",
|
|
1069
|
+
strokeLinejoin: "round",
|
|
1069
1070
|
className: "_icon"
|
|
1070
1071
|
}, props, {
|
|
1071
1072
|
ref: forwardedRef
|
|
@@ -1282,9 +1283,9 @@ var DisconnectIcon = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef)
|
|
|
1282
1283
|
viewBox: "0 0 24 24",
|
|
1283
1284
|
fill: "none",
|
|
1284
1285
|
stroke: "currentColor",
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1286
|
+
strokeWidth: "2",
|
|
1287
|
+
strokeLinecap: "round",
|
|
1288
|
+
strokeLinejoin: "round",
|
|
1288
1289
|
className: "_icon"
|
|
1289
1290
|
}, props, {
|
|
1290
1291
|
ref: forwardedRef
|
|
@@ -2664,12 +2665,21 @@ var InputContainer = /*#__PURE__*/styled('div', {
|
|
|
2664
2665
|
variants: {
|
|
2665
2666
|
size: {
|
|
2666
2667
|
small: {
|
|
2668
|
+
'& input': {
|
|
2669
|
+
fontSize: '$14'
|
|
2670
|
+
},
|
|
2667
2671
|
height: '$32'
|
|
2668
2672
|
},
|
|
2669
2673
|
medium: {
|
|
2674
|
+
'& input': {
|
|
2675
|
+
fontSize: '$15'
|
|
2676
|
+
},
|
|
2670
2677
|
height: '$40'
|
|
2671
2678
|
},
|
|
2672
2679
|
large: {
|
|
2680
|
+
'& input': {
|
|
2681
|
+
fontSize: '$16'
|
|
2682
|
+
},
|
|
2673
2683
|
height: '$48'
|
|
2674
2684
|
}
|
|
2675
2685
|
},
|
|
@@ -2710,7 +2720,6 @@ var Input = /*#__PURE__*/styled('input', {
|
|
|
2710
2720
|
border: 'none',
|
|
2711
2721
|
borderRadius: '$5',
|
|
2712
2722
|
outline: 'none',
|
|
2713
|
-
fontSize: '$l',
|
|
2714
2723
|
backgroundColor: 'transparent',
|
|
2715
2724
|
'-webkit-appearance': 'none',
|
|
2716
2725
|
margin: 0,
|
|
@@ -3224,9 +3233,9 @@ function TokenSelector(props) {
|
|
|
3224
3233
|
return React__default.createElement(SecondaryPage, {
|
|
3225
3234
|
textField: true,
|
|
3226
3235
|
hasHeader: hasHeader,
|
|
3227
|
-
title: "Select " + type + "
|
|
3236
|
+
title: "Select " + type + " token",
|
|
3228
3237
|
onBack: onBack,
|
|
3229
|
-
textFieldPlaceholder: "Search
|
|
3238
|
+
textFieldPlaceholder: "Search tokens by name"
|
|
3230
3239
|
}, function (searchedFor) {
|
|
3231
3240
|
var filteredTokens = filterTokens(list, searchedFor);
|
|
3232
3241
|
return loadingStatus === 'loading' ? React__default.createElement(LoaderContainer, null, React__default.createElement(Spinner, {
|
|
@@ -3266,8 +3275,8 @@ function BlockchainSelector(props) {
|
|
|
3266
3275
|
return React__default.createElement(SecondaryPage, {
|
|
3267
3276
|
textField: true,
|
|
3268
3277
|
hasHeader: hasHeader,
|
|
3269
|
-
textFieldPlaceholder: "Search
|
|
3270
|
-
title: "Select " + type + "
|
|
3278
|
+
textFieldPlaceholder: "Search blockchains by name",
|
|
3279
|
+
title: "Select " + type + " Blockchain",
|
|
3271
3280
|
onBack: onBack
|
|
3272
3281
|
}, function (searchedFor) {
|
|
3273
3282
|
var filteredBlockchains = filterBlockchains(list, searchedFor);
|
|
@@ -3447,7 +3456,10 @@ var State = function State(_ref) {
|
|
|
3447
3456
|
};
|
|
3448
3457
|
|
|
3449
3458
|
var WalletImageContainer = /*#__PURE__*/styled('div', {
|
|
3450
|
-
paddingRight: '$12'
|
|
3459
|
+
paddingRight: '$12',
|
|
3460
|
+
'& img': {
|
|
3461
|
+
borderRadius: '50%'
|
|
3462
|
+
}
|
|
3451
3463
|
});
|
|
3452
3464
|
var Text = /*#__PURE__*/styled('div', {
|
|
3453
3465
|
display: 'flex',
|
|
@@ -3734,7 +3746,7 @@ function LiquiditySourcesSelector(props) {
|
|
|
3734
3746
|
loadingStatus = props.loadingStatus;
|
|
3735
3747
|
return React__default.createElement(SecondaryPage, {
|
|
3736
3748
|
textField: true,
|
|
3737
|
-
textFieldPlaceholder: "Search
|
|
3749
|
+
textFieldPlaceholder: "Search by name",
|
|
3738
3750
|
title: "Liquidity Sources",
|
|
3739
3751
|
TopButton: React__default.createElement(Button, {
|
|
3740
3752
|
variant: "ghost",
|
|
@@ -4102,6 +4114,25 @@ var MainContainer$2 = /*#__PURE__*/styled('div', {
|
|
|
4102
4114
|
padding: '$16',
|
|
4103
4115
|
boxSizing: 'border-box',
|
|
4104
4116
|
backgroundColor: '$background',
|
|
4117
|
+
overflow: 'hidden',
|
|
4118
|
+
'& *': {
|
|
4119
|
+
boxSizing: 'border-box',
|
|
4120
|
+
listStyleType: 'none',
|
|
4121
|
+
'&::-webkit-scrollbar': {
|
|
4122
|
+
width: '$8',
|
|
4123
|
+
height: '$8'
|
|
4124
|
+
},
|
|
4125
|
+
'&::-webkit-scrollbar-thumb': {
|
|
4126
|
+
backgroundColor: '$neutrals400',
|
|
4127
|
+
borderRadius: '$10'
|
|
4128
|
+
},
|
|
4129
|
+
'&::-webkit-scrollbar-thumb:hover': {
|
|
4130
|
+
backgroundColor: '$neutrals500'
|
|
4131
|
+
},
|
|
4132
|
+
'&::-webkit-scrollbar-track': {
|
|
4133
|
+
backgroundColor: '$neutrals300'
|
|
4134
|
+
}
|
|
4135
|
+
},
|
|
4105
4136
|
variants: {
|
|
4106
4137
|
fixedHeight: {
|
|
4107
4138
|
"true": {
|
|
@@ -4139,6 +4170,9 @@ var TokenContainer = /*#__PURE__*/styled('div', {
|
|
|
4139
4170
|
});
|
|
4140
4171
|
var TokenImage = /*#__PURE__*/styled('div', {
|
|
4141
4172
|
position: 'relative',
|
|
4173
|
+
'img': {
|
|
4174
|
+
borderRadius: '50%'
|
|
4175
|
+
},
|
|
4142
4176
|
'.overlay': {
|
|
4143
4177
|
position: 'absolute',
|
|
4144
4178
|
right: -4,
|
|
@@ -4497,7 +4531,9 @@ function ConfirmSwap(props) {
|
|
|
4497
4531
|
disabled: confirmDisabled
|
|
4498
4532
|
}, confirmButtonTitle))
|
|
4499
4533
|
}, 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) {
|
|
4500
|
-
return React__default.createElement(React__default.Fragment,
|
|
4534
|
+
return React__default.createElement(React__default.Fragment, {
|
|
4535
|
+
key: index
|
|
4536
|
+
}, React__default.createElement(Spacer, {
|
|
4501
4537
|
direction: "vertical"
|
|
4502
4538
|
}), React__default.createElement(Alert, Object.assign({
|
|
4503
4539
|
type: "error",
|
|
@@ -4508,7 +4544,9 @@ function ConfirmSwap(props) {
|
|
|
4508
4544
|
children: error
|
|
4509
4545
|
})));
|
|
4510
4546
|
}), warnings == null ? void 0 : warnings.map(function (warning, index) {
|
|
4511
|
-
return React__default.createElement(React__default.Fragment,
|
|
4547
|
+
return React__default.createElement(React__default.Fragment, {
|
|
4548
|
+
key: index
|
|
4549
|
+
}, React__default.createElement(Spacer, {
|
|
4512
4550
|
direction: "vertical"
|
|
4513
4551
|
}), React__default.createElement(Alert, Object.assign({
|
|
4514
4552
|
type: "warning",
|
|
@@ -4567,15 +4605,16 @@ function SwapsGroup(props) {
|
|
|
4567
4605
|
return React__default.createElement(React__default.Fragment, null, groups.filter(function (group) {
|
|
4568
4606
|
return group.swaps.length > 0;
|
|
4569
4607
|
}).map(function (group, index) {
|
|
4570
|
-
return React__default.createElement(React__default.Fragment,
|
|
4608
|
+
return React__default.createElement(React__default.Fragment, {
|
|
4571
4609
|
key: index
|
|
4572
|
-
}, React__default.createElement(Typography, {
|
|
4610
|
+
}, React__default.createElement(Group, null, React__default.createElement(Typography, {
|
|
4573
4611
|
variant: "body2",
|
|
4574
4612
|
color: "neutrals600",
|
|
4575
4613
|
className: "group-title"
|
|
4576
|
-
}, group.title), group.swaps.map(function (swap
|
|
4577
|
-
return React__default.createElement(React__default.Fragment,
|
|
4578
|
-
key:
|
|
4614
|
+
}, group.title), group.swaps.map(function (swap) {
|
|
4615
|
+
return React__default.createElement(React__default.Fragment, {
|
|
4616
|
+
key: swap.requestId
|
|
4617
|
+
}, React__default.createElement(SwapDetail, {
|
|
4579
4618
|
swap: swap,
|
|
4580
4619
|
status: swap.status,
|
|
4581
4620
|
onClick: onSwapClick
|
|
@@ -4608,7 +4647,7 @@ function History(props) {
|
|
|
4608
4647
|
return React__default.createElement(SecondaryPage, {
|
|
4609
4648
|
onBack: onBack,
|
|
4610
4649
|
textField: true,
|
|
4611
|
-
textFieldPlaceholder: "Search by
|
|
4650
|
+
textFieldPlaceholder: "Search by blockchain, token or request Id",
|
|
4612
4651
|
title: "Swaps"
|
|
4613
4652
|
}, function (searchedFor) {
|
|
4614
4653
|
var filterSwaps = filteredHistory(list, searchedFor);
|
|
@@ -4661,7 +4700,9 @@ var SwapMessages = function SwapMessages(props) {
|
|
|
4661
4700
|
footer: React__default.createElement(Button, {
|
|
4662
4701
|
variant: 'outlined',
|
|
4663
4702
|
type: "primary",
|
|
4664
|
-
onClick:
|
|
4703
|
+
onClick: function onClick() {
|
|
4704
|
+
(props == null ? void 0 : props.switchNetwork) && props.switchNetwork()["catch"](function () {});
|
|
4705
|
+
}
|
|
4665
4706
|
}, "Change network to ", currentStepBlockchain)
|
|
4666
4707
|
}), !!detailedMessage.content ? React__default.createElement(DetailedMessage, null, React__default.createElement(Typography, {
|
|
4667
4708
|
variant: "body2"
|
|
@@ -4944,6 +4985,28 @@ function SwapHistory(props) {
|
|
|
4944
4985
|
}));
|
|
4945
4986
|
}
|
|
4946
4987
|
|
|
4988
|
+
function useCopyToClipboard(resetInterval) {
|
|
4989
|
+
var _React$useState = React__default.useState(false),
|
|
4990
|
+
isCopied = _React$useState[0],
|
|
4991
|
+
setCopied = _React$useState[1];
|
|
4992
|
+
var handleCopy = React__default.useCallback(function (text) {
|
|
4993
|
+
copy(text.toString());
|
|
4994
|
+
setCopied(true);
|
|
4995
|
+
}, []);
|
|
4996
|
+
React__default.useEffect(function () {
|
|
4997
|
+
var timeout;
|
|
4998
|
+
if (isCopied && resetInterval) {
|
|
4999
|
+
timeout = setTimeout(function () {
|
|
5000
|
+
return setCopied(false);
|
|
5001
|
+
}, resetInterval);
|
|
5002
|
+
}
|
|
5003
|
+
return function () {
|
|
5004
|
+
clearTimeout(timeout);
|
|
5005
|
+
};
|
|
5006
|
+
}, [isCopied, resetInterval]);
|
|
5007
|
+
return [isCopied, handleCopy];
|
|
5008
|
+
}
|
|
5009
|
+
|
|
4947
5010
|
exports.AddCircleIcon = AddCircleIcon;
|
|
4948
5011
|
exports.AddIcon = AddIcon;
|
|
4949
5012
|
exports.AddWalletIcon = AddWalletIcon;
|
|
@@ -5027,4 +5090,5 @@ exports.globalCss = globalCss;
|
|
|
5027
5090
|
exports.keyframes = keyframes;
|
|
5028
5091
|
exports.lightTheme = lightTheme;
|
|
5029
5092
|
exports.styled = styled;
|
|
5093
|
+
exports.useCopyToClipboard = useCopyToClipboard;
|
|
5030
5094
|
//# sourceMappingURL=ui.cjs.development.js.map
|