@rango-dev/ui 0.1.11-next.8 → 0.1.11

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.
@@ -1,13 +1,6 @@
1
1
  import { PropsWithChildren } from 'react';
2
- import { PendingSwap } from './types';
3
- export declare type GroupBy = (list: PendingSwap[]) => {
4
- title: string;
5
- swaps: PendingSwap[];
6
- }[];
7
- export interface PropTypes {
8
- list: PendingSwap[];
9
- onBack: () => void;
10
- onSwapClick: (requestId: string) => void;
11
- groupBy?: GroupBy;
12
- }
13
- export declare function History({ list, onBack, onSwapClick, groupBy, }: PropsWithChildren<PropTypes>): JSX.Element;
2
+ import { PropTypes as SwapsGroupPropTypes } from './SwapsGroup';
3
+ export declare type PropTypes = SwapsGroupPropTypes & {
4
+ loading: boolean;
5
+ };
6
+ export declare function History(props: PropsWithChildren<PropTypes>): JSX.Element;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
3
+ export declare type GroupBy = (list: PendingSwap[]) => {
4
+ title: string;
5
+ swaps: PendingSwap[];
6
+ }[];
7
+ export interface PropTypes {
8
+ list: PendingSwap[];
9
+ onBack: () => void;
10
+ onSwapClick: (requestId: string) => void;
11
+ groupBy?: GroupBy;
12
+ }
13
+ export declare function SwapsGroup(props: Omit<PropTypes, 'onBack'>): JSX.Element;
@@ -1 +1,2 @@
1
- export { History, GroupBy } from './History';
1
+ export { History } from './History';
2
+ export { SwapsGroup, GroupBy } from './SwapsGroup';
@@ -1511,10 +1511,7 @@ var TypographyContainer = /*#__PURE__*/styled('span', {
1511
1511
  },
1512
1512
  body2: {
1513
1513
  fontSize: '$14',
1514
- fontWeight: '$400',
1515
- '@lg': {
1516
- fontSize: '$16'
1517
- }
1514
+ fontWeight: '$400'
1518
1515
  },
1519
1516
  body3: {
1520
1517
  fontSize: '$12',
@@ -2719,6 +2716,13 @@ var Input = /*#__PURE__*/styled('input', {
2719
2716
  margin: 0,
2720
2717
  '&:disabled': {
2721
2718
  cursor: 'not-allowed'
2719
+ },
2720
+ '&::-webkit-outer-spin-button, &::-webkit-inner-spin-button': {
2721
+ '-webkit-appearance': 'none',
2722
+ margin: 0
2723
+ },
2724
+ '&[type="number"]': {
2725
+ '-moz-appearance': 'textfield'
2722
2726
  }
2723
2727
  });
2724
2728
  var Label = /*#__PURE__*/styled('label', {
@@ -2998,7 +3002,7 @@ function Alert(props) {
2998
3002
  color: type,
2999
3003
  size: 24
3000
3004
  }), React__default.createElement(Spacer, {
3001
- size: 8
3005
+ size: 4
3002
3006
  }))), React__default.createElement("div", {
3003
3007
  style: {
3004
3008
  display: 'flex',
@@ -3012,7 +3016,7 @@ function Alert(props) {
3012
3016
  variant: "title",
3013
3017
  color: type
3014
3018
  }, title), !!children && React__default.createElement(Spacer, {
3015
- size: 8,
3019
+ size: 4,
3016
3020
  direction: "vertical"
3017
3021
  })), children)), props.footer ? React__default.createElement("div", {
3018
3022
  className: "footer"
@@ -3201,7 +3205,7 @@ var LoaderContainer = /*#__PURE__*/styled('div', {
3201
3205
  display: 'flex',
3202
3206
  justifyContent: 'center',
3203
3207
  width: '100%',
3204
- paddingTop: '5%',
3208
+ paddingTop: '33%',
3205
3209
  flex: 1
3206
3210
  });
3207
3211
  var filterTokens = function filterTokens(list, searchedFor) {
@@ -3267,12 +3271,12 @@ function BlockchainSelector(props) {
3267
3271
  onBack: onBack
3268
3272
  }, function (searchedFor) {
3269
3273
  var filteredBlockchains = filterBlockchains(list, searchedFor);
3270
- return React__default.createElement(ListContainer$1, {
3274
+ return React__default.createElement(React__default.Fragment, null, loadingStatus === 'loading' && React__default.createElement(LoaderContainer, null, React__default.createElement(Spinner, {
3275
+ size: 24
3276
+ })), React__default.createElement(ListContainer$1, {
3271
3277
  style: listContainerStyle,
3272
3278
  key: "1"
3273
- }, loadingStatus === 'loading' && React__default.createElement(LoaderContainer, null, React__default.createElement(Spinner, {
3274
- size: 24
3275
- })), loadingStatus === 'failed' && React__default.createElement(LoadingFailedAlert, null), loadingStatus === 'success' && React__default.createElement(React__default.Fragment, null, filteredBlockchains.length ? React__default.createElement(BlockchainsList, {
3279
+ }, loadingStatus === 'failed' && React__default.createElement(LoadingFailedAlert, null), loadingStatus === 'success' && React__default.createElement(React__default.Fragment, null, filteredBlockchains.length ? React__default.createElement(BlockchainsList, {
3276
3280
  list: filteredBlockchains,
3277
3281
  selected: selected,
3278
3282
  multiSelect: multiSelect,
@@ -3281,7 +3285,7 @@ function BlockchainSelector(props) {
3281
3285
  }) : React__default.createElement(NotFoundAlert, {
3282
3286
  catergory: "Blockchain",
3283
3287
  searchedFor: searchedFor
3284
- })));
3288
+ }))));
3285
3289
  });
3286
3290
  }
3287
3291
 
@@ -4005,8 +4009,8 @@ function Settings(props) {
4005
4009
  onSlippageChange(slippage);
4006
4010
  };
4007
4011
  var PageContent = React__default.createElement(React__default.Fragment, null, React__default.createElement(BaseContainer, null, React__default.createElement(Head, null, React__default.createElement(Typography, {
4008
- variant: "body1"
4009
- }, "Slippage tolerance per swap"), customSlippage ? React__default.createElement(Typography, {
4012
+ variant: "body2"
4013
+ }, "Slippage tolerance"), customSlippage ? React__default.createElement(Typography, {
4010
4014
  variant: "caption",
4011
4015
  color: "error"
4012
4016
  }, customSlippage, "% Custom") : undefined), React__default.createElement(SlippageChipsContainer, null, slippages.map(function (slippage, index) {
@@ -4060,7 +4064,7 @@ function Settings(props) {
4060
4064
  marginTop: '$24'
4061
4065
  }
4062
4066
  })), React__default.createElement(InfiniteContainer, null, React__default.createElement(Typography, {
4063
- variant: "body1"
4067
+ variant: "body2"
4064
4068
  }, "Infinite Approval"), React__default.createElement(Switch, {
4065
4069
  checked: infiniteApprove,
4066
4070
  onChange: toggleInfiniteApprove
@@ -4077,7 +4081,7 @@ function Settings(props) {
4077
4081
  color: "$error500"
4078
4082
  }, "Loading failed"), React__default.createElement(StyledAngleRight, null))
4079
4083
  }, React__default.createElement(Typography, {
4080
- variant: "body1"
4084
+ variant: "body2"
4081
4085
  }, "Liquidity Sources"))));
4082
4086
  return React__default.createElement(SecondaryPage, {
4083
4087
  title: "Settings",
@@ -4552,17 +4556,7 @@ var Group = /*#__PURE__*/styled('div', {
4552
4556
  textTransform: 'uppercase'
4553
4557
  }
4554
4558
  });
4555
- var Container$6 = /*#__PURE__*/styled('div', {
4556
- overflowY: 'auto'
4557
- });
4558
- var filteredHistory = function filteredHistory(list, searchedFor) {
4559
- return list.filter(function (swap) {
4560
- var firstStep = swap.steps[0];
4561
- var lastStep = swap.steps[swap.steps.length - 1];
4562
- return containsText(firstStep.fromBlockchain, searchedFor) || containsText(firstStep.fromSymbol, searchedFor) || containsText(lastStep.toBlockchain, searchedFor) || containsText(lastStep.toSymbol, searchedFor) || containsText(swap.requestId, searchedFor);
4563
- });
4564
- };
4565
- var SwapsGroup = function SwapsGroup(props) {
4559
+ function SwapsGroup(props) {
4566
4560
  var list = props.list,
4567
4561
  onSwapClick = props.onSwapClick,
4568
4562
  groupBy = props.groupBy;
@@ -4577,6 +4571,7 @@ var SwapsGroup = function SwapsGroup(props) {
4577
4571
  key: index
4578
4572
  }, React__default.createElement(Typography, {
4579
4573
  variant: "body2",
4574
+ color: "neutrals600",
4580
4575
  className: "group-title"
4581
4576
  }, group.title), group.swaps.map(function (swap, index) {
4582
4577
  return React__default.createElement(React__default.Fragment, null, React__default.createElement(SwapDetail, {
@@ -4591,13 +4586,25 @@ var SwapsGroup = function SwapsGroup(props) {
4591
4586
  size: 24
4592
4587
  }));
4593
4588
  }));
4589
+ }
4590
+
4591
+ var Container$6 = /*#__PURE__*/styled('div', {
4592
+ overflowY: 'auto'
4593
+ });
4594
+ var filteredHistory = function filteredHistory(list, searchedFor) {
4595
+ return list.filter(function (swap) {
4596
+ var firstStep = swap.steps[0];
4597
+ var lastStep = swap.steps[swap.steps.length - 1];
4598
+ return containsText(firstStep.fromBlockchain, searchedFor) || containsText(firstStep.fromSymbol, searchedFor) || containsText(lastStep.toBlockchain, searchedFor) || containsText(lastStep.toSymbol, searchedFor) || containsText(swap.requestId, searchedFor);
4599
+ });
4594
4600
  };
4595
- function History(_ref) {
4596
- var _ref$list = _ref.list,
4597
- list = _ref$list === void 0 ? [] : _ref$list,
4598
- onBack = _ref.onBack,
4599
- onSwapClick = _ref.onSwapClick,
4600
- groupBy = _ref.groupBy;
4601
+ function History(props) {
4602
+ var _props$list = props.list,
4603
+ list = _props$list === void 0 ? [] : _props$list,
4604
+ onBack = props.onBack,
4605
+ onSwapClick = props.onSwapClick,
4606
+ groupBy = props.groupBy,
4607
+ loading = props.loading;
4601
4608
  return React__default.createElement(SecondaryPage, {
4602
4609
  onBack: onBack,
4603
4610
  textField: true,
@@ -4605,13 +4612,15 @@ function History(_ref) {
4605
4612
  title: "Swaps"
4606
4613
  }, function (searchedFor) {
4607
4614
  var filterSwaps = filteredHistory(list, searchedFor);
4608
- return React__default.createElement(Container$6, null, filterSwaps.length ? React__default.createElement(SwapsGroup, {
4615
+ return React__default.createElement(React__default.Fragment, null, loading && React__default.createElement(LoaderContainer, null, React__default.createElement(Spinner, {
4616
+ size: 24
4617
+ })), React__default.createElement(Container$6, null, !loading && React__default.createElement(React__default.Fragment, null, filterSwaps.length ? React__default.createElement(SwapsGroup, {
4609
4618
  list: filterSwaps,
4610
4619
  onSwapClick: onSwapClick,
4611
4620
  groupBy: groupBy
4612
4621
  }) : React__default.createElement(NotFoundAlert, {
4613
4622
  catergory: "Swap"
4614
- }));
4623
+ }))));
4615
4624
  });
4616
4625
  }
4617
4626
 
@@ -4655,21 +4664,21 @@ var SwapMessages = function SwapMessages(props) {
4655
4664
  onClick: props.switchNetwork
4656
4665
  }, "Change network to ", currentStepBlockchain)
4657
4666
  }), !!detailedMessage.content ? React__default.createElement(DetailedMessage, null, React__default.createElement(Typography, {
4658
- variant: "body3"
4667
+ variant: "body2"
4659
4668
  }, shouldShowMoreDetailsButton && !expandedMessage ? detailedMessage.content.substring(0, allowedNumberOfChars) + (allowedNumberOfChars > 0 ? '...' : '') : detailedMessage.content)) : null, !!lastConvertedTokenInFailedSwap && React__default.createElement(React__default.Fragment, null, React__default.createElement("p", null, React__default.createElement(Typography, {
4660
- variant: "body3"
4669
+ variant: "body2"
4661
4670
  }, "Don't worry, your fund is\xA0"), React__default.createElement(SuccessText, {
4662
- variant: "body3"
4671
+ variant: "body2"
4663
4672
  }, React__default.createElement("b", null, "Safe"))), React__default.createElement("p", null, React__default.createElement(Typography, {
4664
- variant: "body3"
4673
+ variant: "body2"
4665
4674
  }, "It is converted to \xA0", React__default.createElement("u", null, lastConvertedTokenInFailedSwap.outputAmount), "\xA0"), React__default.createElement(SuccessText, {
4666
- variant: "body3"
4675
+ variant: "body2"
4667
4676
  }, React__default.createElement("b", null, lastConvertedTokenInFailedSwap.symbol, "\xA0")), React__default.createElement(Typography, {
4668
- variant: "body3"
4677
+ variant: "body2"
4669
4678
  }, "on your\xA0"), React__default.createElement(SuccessText, {
4670
- variant: "body3"
4679
+ variant: "body2"
4671
4680
  }, React__default.createElement("b", null, lastConvertedTokenInFailedSwap.blockchain, "\xA0")), React__default.createElement(Typography, {
4672
- variant: "body3"
4681
+ variant: "body2"
4673
4682
  }, "wallet"))));
4674
4683
  };
4675
4684
 
@@ -4692,7 +4701,8 @@ var SwapperContainer$1 = /*#__PURE__*/styled('div', {
4692
4701
  }
4693
4702
  });
4694
4703
  var FeeContainer = /*#__PURE__*/styled('div', {
4695
- paddingLeft: '$16'
4704
+ paddingLeft: '$16',
4705
+ color: '$neutrals800'
4696
4706
  });
4697
4707
  var Fee = /*#__PURE__*/styled('div', {
4698
4708
  display: 'flex',
@@ -4778,6 +4788,7 @@ var Row$2 = /*#__PURE__*/styled('div', {
4778
4788
  }
4779
4789
  });
4780
4790
  var RequestId = /*#__PURE__*/styled('div', {
4791
+ width: '150px',
4781
4792
  whiteSpace: 'nowrap',
4782
4793
  overflow: 'hidden',
4783
4794
  textOverflow: 'ellipsis',
@@ -4858,9 +4869,9 @@ function SwapHistory(props) {
4858
4869
  alt: step.swapperId,
4859
4870
  size: 20
4860
4871
  }), React__default.createElement(FeeContainer, null, React__default.createElement(Typography, {
4861
- variant: "caption"
4872
+ variant: "body2"
4862
4873
  }, step.swapperType === 'DEX' ? 'Swap' : 'Bridge', " via", ' ', step.swapperId), React__default.createElement(Fee, null, React__default.createElement(GasIcon, null), React__default.createElement(Typography, {
4863
- variant: "caption"
4874
+ variant: "body2"
4864
4875
  }, "\xA0 $", step.feeInUsd, " estimated gas fee")))), React__default.createElement("div", {
4865
4876
  style: {
4866
4877
  display: 'flex'
@@ -4875,7 +4886,7 @@ function SwapHistory(props) {
4875
4886
  }), React__default.createElement(CheckCircleIcon, {
4876
4887
  color: "primary"
4877
4888
  }), React__default.createElement(Description, {
4878
- variant: "body3"
4889
+ variant: "body2"
4879
4890
  }, React__default.createElement(StyledAnchor, {
4880
4891
  href: item.url,
4881
4892
  target: "_blank",
@@ -4885,7 +4896,7 @@ function SwapHistory(props) {
4885
4896
  })), step.status === 'failed' && React__default.createElement(InternalDetail, null, React__default.createElement(DescriptionContainer, null, React__default.createElement(InfoCircleIcon, {
4886
4897
  color: "error"
4887
4898
  }), React__default.createElement(Description, {
4888
- variant: "body3",
4899
+ variant: "body2",
4889
4900
  color: "$error500"
4890
4901
  }, "Step failed")))))), index + 1 === pendingSwap.steps.length && React__default.createElement(ArrowDown, null), React__default.createElement(StepDetail, {
4891
4902
  logo: step.toLogo,
@@ -4995,6 +5006,7 @@ exports.SwapContainer = SwapContainer;
4995
5006
  exports.SwapDetail = SwapDetail;
4996
5007
  exports.SwapHistory = SwapHistory;
4997
5008
  exports.SwapWalletIcon = SwapWalletIcon;
5009
+ exports.SwapsGroup = SwapsGroup;
4998
5010
  exports.Switch = Switch;
4999
5011
  exports.TextField = TextField;
5000
5012
  exports.TimeIcon = TimeIcon;