@rango-dev/ui 0.1.11-next.4 → 0.1.11-next.6

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.
@@ -5,6 +5,8 @@ export interface PropTypes {
5
5
  amount: string;
6
6
  symbol: string;
7
7
  blockchain: string;
8
+ estimatedAmount?: string;
8
9
  direction?: 'horizontal' | 'vertical';
10
+ success?: boolean;
9
11
  }
10
- export declare function StepDetail({ logo, chainLogo, amount, symbol, blockchain, direction, }: PropsWithChildren<PropTypes>): JSX.Element;
12
+ export declare function StepDetail(props: PropsWithChildren<PropTypes>): JSX.Element;
@@ -4,6 +4,7 @@ import { PropTypes as SwapMessagesPropTypes } from './SwapMessages';
4
4
  export declare const SwapperContainer: any;
5
5
  export declare const BodyError: any;
6
6
  export declare const ErrorMsg: any;
7
+ export declare const FeeContainer: any;
7
8
  export declare const Fee: any;
8
9
  export declare const RelativeContainer: any;
9
10
  export declare const Footer: any;
@@ -1614,37 +1614,6 @@ Typography.toString = function () {
1614
1614
  return '._typography';
1615
1615
  };
1616
1616
 
1617
- var FilledCircle = /*#__PURE__*/styled('span', {
1618
- width: '10px',
1619
- height: '10px',
1620
- backgroundColor: '$primary',
1621
- borderRadius: '99999px'
1622
- });
1623
-
1624
- var _excluded$E = ["size"];
1625
- var ImageContainer = /*#__PURE__*/styled('div', {
1626
- display: 'flex',
1627
- justifyContent: 'center',
1628
- alignItems: 'center',
1629
- '.image': {
1630
- width: '100%',
1631
- height: '100%',
1632
- objectFit: 'contain'
1633
- }
1634
- });
1635
- function Image(props) {
1636
- var size = props.size,
1637
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$E);
1638
- return React__default.createElement(ImageContainer, {
1639
- css: {
1640
- width: size + 'px',
1641
- height: size + 'px'
1642
- }
1643
- }, React__default.createElement("img", Object.assign({
1644
- className: "image"
1645
- }, otherProps)));
1646
- }
1647
-
1648
1617
  var StepLogoContainer = /*#__PURE__*/styled('div', {
1649
1618
  position: 'relative',
1650
1619
  width: '$28',
@@ -1658,18 +1627,25 @@ var StepLogoContainer = /*#__PURE__*/styled('div', {
1658
1627
  }
1659
1628
  }
1660
1629
  });
1630
+ var Logo = /*#__PURE__*/styled('img', {
1631
+ width: '$28',
1632
+ height: '$28',
1633
+ borderRadius: '50%'
1634
+ });
1661
1635
  var ChainLogo = /*#__PURE__*/styled('div', {
1662
1636
  position: 'absolute',
1663
1637
  right: -4,
1664
1638
  bottom: -4,
1665
1639
  width: '$16',
1666
1640
  height: '$16',
1641
+ padding: '$2',
1667
1642
  borderRadius: '50%',
1668
- display: 'flex',
1669
- justifyContent: 'center',
1670
- alignItems: 'center',
1671
1643
  backgroundColor: '$background',
1672
- border: '1px solid $neutrals400'
1644
+ border: '1px solid $neutrals400',
1645
+ img: {
1646
+ width: '100%',
1647
+ display: 'block'
1648
+ }
1673
1649
  });
1674
1650
  var StepContainer = /*#__PURE__*/styled('div', {
1675
1651
  display: 'flex',
@@ -1683,6 +1659,14 @@ var StepContainer = /*#__PURE__*/styled('div', {
1683
1659
  textAlign: 'center',
1684
1660
  justifyContent: 'center'
1685
1661
  }
1662
+ },
1663
+ success: {
1664
+ "true": {
1665
+ filter: 'none'
1666
+ },
1667
+ "false": {
1668
+ filter: 'grayscale(100%)'
1669
+ }
1686
1670
  }
1687
1671
  }
1688
1672
  });
@@ -1703,37 +1687,47 @@ var Detail = /*#__PURE__*/styled('div', {
1703
1687
  });
1704
1688
  var SubTitle = /*#__PURE__*/styled(Typography, {
1705
1689
  color: '$neutrals600',
1706
- display: 'block'
1707
- });
1708
- function StepDetail(_ref) {
1709
- var logo = _ref.logo,
1710
- chainLogo = _ref.chainLogo,
1711
- amount = _ref.amount,
1712
- symbol = _ref.symbol,
1713
- blockchain = _ref.blockchain,
1714
- _ref$direction = _ref.direction,
1715
- direction = _ref$direction === void 0 ? 'horizontal' : _ref$direction;
1690
+ display: 'block',
1691
+ paddingLeft: '$8'
1692
+ });
1693
+ function StepDetail(props) {
1694
+ var logo = props.logo,
1695
+ chainLogo = props.chainLogo,
1696
+ amount = props.amount,
1697
+ symbol = props.symbol,
1698
+ blockchain = props.blockchain,
1699
+ estimatedAmount = props.estimatedAmount,
1700
+ _props$success = props.success,
1701
+ success = _props$success === void 0 ? true : _props$success,
1702
+ _props$direction = props.direction,
1703
+ direction = _props$direction === void 0 ? 'horizontal' : _props$direction;
1716
1704
  return React__default.createElement(StepContainer, {
1717
- direction: direction
1705
+ direction: direction,
1706
+ success: success
1718
1707
  }, React__default.createElement(StepLogoContainer, {
1719
1708
  direction: direction
1720
- }, React__default.createElement(Image, {
1709
+ }, React__default.createElement(Logo, {
1721
1710
  src: logo,
1722
- alt: symbol,
1723
- size: 28
1724
- }), React__default.createElement(ChainLogo, null, React__default.createElement(Image, {
1711
+ alt: symbol
1712
+ }), React__default.createElement(ChainLogo, null, React__default.createElement("img", {
1725
1713
  src: chainLogo,
1726
- alt: blockchain,
1727
- size: 12
1714
+ alt: blockchain
1728
1715
  }))), React__default.createElement(Detail, {
1729
1716
  pl: direction === 'horizontal'
1730
- }, React__default.createElement(Typography, {
1717
+ }, amount && React__default.createElement(Typography, {
1731
1718
  noWrap: true,
1732
1719
  variant: direction === 'vertical' ? 'body2' : 'h6'
1733
- }, amount ? parseFloat(amount).toFixed(2) : '?', " ", symbol), React__default.createElement(SubTitle, {
1720
+ }, amount), !amount && estimatedAmount && React__default.createElement(Typography, {
1721
+ noWrap: true,
1722
+ variant: direction === 'vertical' ? 'body2' : 'h6',
1723
+ color: '$neutrals500'
1724
+ }, estimatedAmount), "\xA0", React__default.createElement(Typography, {
1725
+ variant: direction === 'vertical' ? 'body2' : 'h6',
1726
+ noWrap: true
1727
+ }, symbol), React__default.createElement(SubTitle, {
1734
1728
  noWrap: true,
1735
1729
  variant: "caption",
1736
- color: "neutrals800"
1730
+ color: "$neutrals800"
1737
1731
  }, "on ", blockchain)));
1738
1732
  }
1739
1733
 
@@ -1955,6 +1949,37 @@ function Tooltip(_ref) {
1955
1949
  })))));
1956
1950
  }
1957
1951
 
1952
+ var FilledCircle = /*#__PURE__*/styled('span', {
1953
+ width: '10px',
1954
+ height: '10px',
1955
+ backgroundColor: '$primary',
1956
+ borderRadius: '99999px'
1957
+ });
1958
+
1959
+ var _excluded$E = ["size"];
1960
+ var ImageContainer = /*#__PURE__*/styled('div', {
1961
+ display: 'flex',
1962
+ justifyContent: 'center',
1963
+ alignItems: 'center',
1964
+ '.image': {
1965
+ width: '100%',
1966
+ height: '100%',
1967
+ objectFit: 'contain'
1968
+ }
1969
+ });
1970
+ function Image(props) {
1971
+ var size = props.size,
1972
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$E);
1973
+ return React__default.createElement(ImageContainer, {
1974
+ css: {
1975
+ width: size + 'px',
1976
+ height: size + 'px'
1977
+ }
1978
+ }, React__default.createElement("img", Object.assign({
1979
+ className: "image"
1980
+ }, otherProps)));
1981
+ }
1982
+
1958
1983
  var Container = /*#__PURE__*/styled('div', {
1959
1984
  borderRadius: '$5',
1960
1985
  border: '1px solid $neutrals300',
@@ -3207,7 +3232,8 @@ function TokenSelector(props) {
3207
3232
  }
3208
3233
 
3209
3234
  var ListContainer$1 = /*#__PURE__*/styled('div', {
3210
- overflowY: 'auto'
3235
+ overflowY: 'auto',
3236
+ padding: '0 $4'
3211
3237
  });
3212
3238
  var filterBlockchains = function filterBlockchains(list, searchedFor) {
3213
3239
  return list.filter(function (blockchain) {
@@ -3549,7 +3575,8 @@ var MainContainer$1 = /*#__PURE__*/styled('div', {
3549
3575
  variants: {
3550
3576
  loaded: {
3551
3577
  "true": {
3552
- overflowY: 'auto'
3578
+ overflowY: 'auto',
3579
+ padding: '0 $4'
3553
3580
  }
3554
3581
  }
3555
3582
  }
@@ -4632,7 +4659,22 @@ var _excluded$J = ["pendingSwap", "onBack", "onCopy", "isCopied", "onCancel", "d
4632
4659
  var SwapperContainer$1 = /*#__PURE__*/styled('div', {
4633
4660
  display: 'flex',
4634
4661
  alignItems: 'center',
4635
- marginLeft: '6px'
4662
+ paddingLeft: '$4',
4663
+ variants: {
4664
+ created: {
4665
+ "true": {
4666
+ filter: 'grayscale(100%)'
4667
+ }
4668
+ },
4669
+ running: {
4670
+ "true": {
4671
+ animation: pulse + " 2s ease-in-out infinite"
4672
+ }
4673
+ }
4674
+ }
4675
+ });
4676
+ var FeeContainer = /*#__PURE__*/styled('div', {
4677
+ paddingLeft: '$4'
4636
4678
  });
4637
4679
  var Fee = /*#__PURE__*/styled('div', {
4638
4680
  display: 'flex',
@@ -4646,7 +4688,7 @@ var Dot$1 = /*#__PURE__*/styled('div', {
4646
4688
  height: '$8',
4647
4689
  backgroundColor: '$foreground',
4648
4690
  borderRadius: '4px',
4649
- marginLeft: '$8'
4691
+ marginLeft: '11px'
4650
4692
  });
4651
4693
  var ArrowDown = /*#__PURE__*/styled('div', {
4652
4694
  width: '0px',
@@ -4654,7 +4696,7 @@ var ArrowDown = /*#__PURE__*/styled('div', {
4654
4696
  borderLeft: '5px solid transparent',
4655
4697
  borderRight: '5px solid transparent',
4656
4698
  borderTop: '5px solid $foreground',
4657
- marginLeft: '$8'
4699
+ marginLeft: '$10'
4658
4700
  });
4659
4701
  var StyledAnchor = /*#__PURE__*/styled('a', {
4660
4702
  color: '$primary',
@@ -4682,13 +4724,10 @@ var Description = /*#__PURE__*/styled(Typography, {
4682
4724
  color: '$success',
4683
4725
  marginLeft: '$8'
4684
4726
  });
4685
- var Error = /*#__PURE__*/styled(Description, {
4686
- color: '$error'
4687
- });
4688
4727
  var Line$1 = /*#__PURE__*/styled('div', {
4689
4728
  width: '0',
4690
4729
  minHeight: '$16',
4691
- marginLeft: '$12',
4730
+ marginLeft: '14px',
4692
4731
  border: '1px dashed $foreground',
4693
4732
  borderRadius: 'inherit'
4694
4733
  });
@@ -4731,22 +4770,9 @@ var ExtraDetails = /*#__PURE__*/styled('div', {
4731
4770
  color: '$neutrals600',
4732
4771
  fontSize: '$12'
4733
4772
  });
4734
- var StepContainer$1 = /*#__PURE__*/styled('div', {
4735
- variants: {
4736
- hasNotStarted: {
4737
- "true": {
4738
- filter: 'grayscale(100%)'
4739
- }
4740
- },
4741
- isRunning: {
4742
- "true": {
4743
- animation: pulse + " 2s ease-in-out infinite"
4744
- }
4745
- }
4746
- }
4747
- });
4748
4773
  var SwapFlowContainer = /*#__PURE__*/styled('div', {
4749
- overflowY: 'auto'
4774
+ overflowY: 'auto',
4775
+ paddingTop: '$8'
4750
4776
  });
4751
4777
  function SwapHistory(props) {
4752
4778
  var pendingSwap = props.pendingSwap,
@@ -4796,39 +4822,30 @@ function SwapHistory(props) {
4796
4822
  }))), React__default.createElement(ExtraDetails, null, date))), React__default.createElement(SwapFlowContainer, null, extraMessageProps.shortMessage && React__default.createElement(SwapMessages, Object.assign({}, extraMessageProps)), React__default.createElement(Divider, {
4797
4823
  size: 32
4798
4824
  }), pendingSwap == null ? void 0 : pendingSwap.steps.map(function (step, index) {
4799
- return React__default.createElement(StepContainer$1, {
4800
- key: index,
4801
- hasNotStarted: step.status === 'created',
4802
- isRunning: step.status != 'failed' && step.status != 'success' && step.status != 'created'
4825
+ return React__default.createElement("div", {
4826
+ key: index
4803
4827
  }, index === 0 && React__default.createElement(RelativeContainer$1, null, React__default.createElement(StepDetail, {
4804
4828
  logo: step.fromLogo,
4805
4829
  symbol: step.fromSymbol,
4806
- // @ts-ignore
4807
4830
  chainLogo: step.fromBlockchainLogo || '',
4808
4831
  blockchain: step.fromBlockchain,
4809
4832
  amount: pendingSwap.inputAmount
4810
- }), React__default.createElement(Dot$1, null)), React__default.createElement(Line$1, null), React__default.createElement(SwapperContainer$1, null, React__default.createElement(Image
4811
- // @ts-ignore
4812
- , {
4813
- // @ts-ignore
4814
- src: step.swapperLogo,
4833
+ }), React__default.createElement(Dot$1, null)), React__default.createElement(Line$1, null), React__default.createElement(SwapperContainer$1, {
4834
+ created: step.status === 'created',
4835
+ running: !['created', 'success', 'failed'].includes(step.status)
4836
+ }, React__default.createElement(Image, {
4837
+ src: step.swapperLogo || '',
4815
4838
  alt: step.swapperId,
4816
- size: 16
4817
- }), React__default.createElement("div", null, React__default.createElement(Typography, {
4818
- ml: 4,
4839
+ size: 20
4840
+ }), React__default.createElement(FeeContainer, null, React__default.createElement(Typography, {
4819
4841
  variant: "caption"
4820
- },
4821
- // @ts-ignore
4822
- step.swapperType, ' ', "from ", step.fromSymbol, " to ", step.toSymbol, "via ", step.swapperId), React__default.createElement(Fee, null, React__default.createElement(GasIcon, null), React__default.createElement(Typography, {
4823
- ml: 4,
4842
+ }, step.swapperType, " from ", step.fromSymbol, " to ", step.toSymbol, "\xA0 via ", step.swapperId), React__default.createElement(Fee, null, React__default.createElement(GasIcon, null), React__default.createElement(Typography, {
4824
4843
  variant: "caption"
4825
- }, "$",
4826
- // @ts-ignore
4827
- step.feeInUsd, ' ', "estimated gas fee")))), React__default.createElement("div", {
4844
+ }, "\xA0 $", step.feeInUsd, " estimated gas fee")))), React__default.createElement("div", {
4828
4845
  style: {
4829
4846
  display: 'flex'
4830
4847
  }
4831
- }, React__default.createElement(InternalDetailsContainer, null, React__default.createElement(Line$1, null), !!step.explorerUrl && React__default.createElement("div", null, step.explorerUrl.map(function (item, index) {
4848
+ }, React__default.createElement(InternalDetailsContainer, null, React__default.createElement(Line$1, null), React__default.createElement("div", null, !!step.explorerUrl && React__default.createElement("div", null, step.explorerUrl.map(function (item, index) {
4832
4849
  return React__default.createElement(InternalDetail, {
4833
4850
  key: index
4834
4851
  }, React__default.createElement(DescriptionContainer, null, React__default.createElement(CheckCircleIcon, {
@@ -4841,17 +4858,19 @@ function SwapHistory(props) {
4841
4858
  rel: "noreferrer",
4842
4859
  key: index
4843
4860
  }, "TX-Link"));
4844
- }), step.status === 'failed' && React__default.createElement(InternalDetail, null, React__default.createElement(DescriptionContainer, null, React__default.createElement(InfoCircleIcon, {
4861
+ })), step.status === 'failed' && React__default.createElement(InternalDetail, null, React__default.createElement(DescriptionContainer, null, React__default.createElement(InfoCircleIcon, {
4845
4862
  color: "error"
4846
- }), React__default.createElement(Error, {
4847
- variant: "body2"
4863
+ }), React__default.createElement(Description, {
4864
+ variant: "body2",
4865
+ color: "$error500"
4848
4866
  }, "Step failed")))))), index + 1 === pendingSwap.steps.length && React__default.createElement(ArrowDown, null), React__default.createElement(StepDetail, {
4849
4867
  logo: step.toLogo,
4850
4868
  symbol: step.toSymbol,
4851
- // @ts-ignore
4852
4869
  chainLogo: step.toBlockchainLogo || '',
4853
4870
  blockchain: step.toBlockchain,
4854
- amount: step.outputAmount || ''
4871
+ amount: step.outputAmount || '',
4872
+ estimatedAmount: step.expectedOutputAmountHumanReadable || '',
4873
+ success: step.status === 'success'
4855
4874
  }));
4856
4875
  }), React__default.createElement(Divider, {
4857
4876
  size: 32