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

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/ui.esm.js CHANGED
@@ -1607,37 +1607,6 @@ Typography.toString = function () {
1607
1607
  return '._typography';
1608
1608
  };
1609
1609
 
1610
- var FilledCircle = /*#__PURE__*/styled('span', {
1611
- width: '10px',
1612
- height: '10px',
1613
- backgroundColor: '$primary',
1614
- borderRadius: '99999px'
1615
- });
1616
-
1617
- var _excluded$E = ["size"];
1618
- var ImageContainer = /*#__PURE__*/styled('div', {
1619
- display: 'flex',
1620
- justifyContent: 'center',
1621
- alignItems: 'center',
1622
- '.image': {
1623
- width: '100%',
1624
- height: '100%',
1625
- objectFit: 'contain'
1626
- }
1627
- });
1628
- function Image(props) {
1629
- var size = props.size,
1630
- otherProps = _objectWithoutPropertiesLoose(props, _excluded$E);
1631
- return React__default.createElement(ImageContainer, {
1632
- css: {
1633
- width: size + 'px',
1634
- height: size + 'px'
1635
- }
1636
- }, React__default.createElement("img", Object.assign({
1637
- className: "image"
1638
- }, otherProps)));
1639
- }
1640
-
1641
1610
  var StepLogoContainer = /*#__PURE__*/styled('div', {
1642
1611
  position: 'relative',
1643
1612
  width: '$28',
@@ -1651,18 +1620,25 @@ var StepLogoContainer = /*#__PURE__*/styled('div', {
1651
1620
  }
1652
1621
  }
1653
1622
  });
1623
+ var Logo = /*#__PURE__*/styled('img', {
1624
+ width: '$28',
1625
+ height: '$28',
1626
+ borderRadius: '50%'
1627
+ });
1654
1628
  var ChainLogo = /*#__PURE__*/styled('div', {
1655
1629
  position: 'absolute',
1656
1630
  right: -4,
1657
1631
  bottom: -4,
1658
1632
  width: '$16',
1659
1633
  height: '$16',
1634
+ padding: '$2',
1660
1635
  borderRadius: '50%',
1661
- display: 'flex',
1662
- justifyContent: 'center',
1663
- alignItems: 'center',
1664
1636
  backgroundColor: '$background',
1665
- border: '1px solid $neutrals400'
1637
+ border: '1px solid $neutrals400',
1638
+ img: {
1639
+ width: '100%',
1640
+ display: 'block'
1641
+ }
1666
1642
  });
1667
1643
  var StepContainer = /*#__PURE__*/styled('div', {
1668
1644
  display: 'flex',
@@ -1676,6 +1652,14 @@ var StepContainer = /*#__PURE__*/styled('div', {
1676
1652
  textAlign: 'center',
1677
1653
  justifyContent: 'center'
1678
1654
  }
1655
+ },
1656
+ success: {
1657
+ "true": {
1658
+ filter: 'none'
1659
+ },
1660
+ "false": {
1661
+ filter: 'grayscale(100%)'
1662
+ }
1679
1663
  }
1680
1664
  }
1681
1665
  });
@@ -1696,37 +1680,47 @@ var Detail = /*#__PURE__*/styled('div', {
1696
1680
  });
1697
1681
  var SubTitle = /*#__PURE__*/styled(Typography, {
1698
1682
  color: '$neutrals600',
1699
- display: 'block'
1700
- });
1701
- function StepDetail(_ref) {
1702
- var logo = _ref.logo,
1703
- chainLogo = _ref.chainLogo,
1704
- amount = _ref.amount,
1705
- symbol = _ref.symbol,
1706
- blockchain = _ref.blockchain,
1707
- _ref$direction = _ref.direction,
1708
- direction = _ref$direction === void 0 ? 'horizontal' : _ref$direction;
1683
+ display: 'block',
1684
+ paddingLeft: '$8'
1685
+ });
1686
+ function StepDetail(props) {
1687
+ var logo = props.logo,
1688
+ chainLogo = props.chainLogo,
1689
+ amount = props.amount,
1690
+ symbol = props.symbol,
1691
+ blockchain = props.blockchain,
1692
+ estimatedAmount = props.estimatedAmount,
1693
+ _props$success = props.success,
1694
+ success = _props$success === void 0 ? true : _props$success,
1695
+ _props$direction = props.direction,
1696
+ direction = _props$direction === void 0 ? 'horizontal' : _props$direction;
1709
1697
  return React__default.createElement(StepContainer, {
1710
- direction: direction
1698
+ direction: direction,
1699
+ success: success
1711
1700
  }, React__default.createElement(StepLogoContainer, {
1712
1701
  direction: direction
1713
- }, React__default.createElement(Image, {
1702
+ }, React__default.createElement(Logo, {
1714
1703
  src: logo,
1715
- alt: symbol,
1716
- size: 28
1717
- }), React__default.createElement(ChainLogo, null, React__default.createElement(Image, {
1704
+ alt: symbol
1705
+ }), React__default.createElement(ChainLogo, null, React__default.createElement("img", {
1718
1706
  src: chainLogo,
1719
- alt: blockchain,
1720
- size: 12
1707
+ alt: blockchain
1721
1708
  }))), React__default.createElement(Detail, {
1722
1709
  pl: direction === 'horizontal'
1723
- }, React__default.createElement(Typography, {
1710
+ }, amount && React__default.createElement(Typography, {
1724
1711
  noWrap: true,
1725
1712
  variant: direction === 'vertical' ? 'body2' : 'h6'
1726
- }, amount ? parseFloat(amount).toFixed(2) : '?', " ", symbol), React__default.createElement(SubTitle, {
1713
+ }, amount), !amount && estimatedAmount && React__default.createElement(Typography, {
1714
+ noWrap: true,
1715
+ variant: direction === 'vertical' ? 'body2' : 'h6',
1716
+ color: '$neutrals500'
1717
+ }, estimatedAmount), "\xA0", React__default.createElement(Typography, {
1718
+ variant: direction === 'vertical' ? 'body2' : 'h6',
1719
+ noWrap: true
1720
+ }, symbol), React__default.createElement(SubTitle, {
1727
1721
  noWrap: true,
1728
1722
  variant: "caption",
1729
- color: "neutrals800"
1723
+ color: "$neutrals800"
1730
1724
  }, "on ", blockchain)));
1731
1725
  }
1732
1726
 
@@ -1948,6 +1942,37 @@ function Tooltip(_ref) {
1948
1942
  })))));
1949
1943
  }
1950
1944
 
1945
+ var FilledCircle = /*#__PURE__*/styled('span', {
1946
+ width: '10px',
1947
+ height: '10px',
1948
+ backgroundColor: '$primary',
1949
+ borderRadius: '99999px'
1950
+ });
1951
+
1952
+ var _excluded$E = ["size"];
1953
+ var ImageContainer = /*#__PURE__*/styled('div', {
1954
+ display: 'flex',
1955
+ justifyContent: 'center',
1956
+ alignItems: 'center',
1957
+ '.image': {
1958
+ width: '100%',
1959
+ height: '100%',
1960
+ objectFit: 'contain'
1961
+ }
1962
+ });
1963
+ function Image(props) {
1964
+ var size = props.size,
1965
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$E);
1966
+ return React__default.createElement(ImageContainer, {
1967
+ css: {
1968
+ width: size + 'px',
1969
+ height: size + 'px'
1970
+ }
1971
+ }, React__default.createElement("img", Object.assign({
1972
+ className: "image"
1973
+ }, otherProps)));
1974
+ }
1975
+
1951
1976
  var Container = /*#__PURE__*/styled('div', {
1952
1977
  borderRadius: '$5',
1953
1978
  border: '1px solid $neutrals300',
@@ -4626,7 +4651,22 @@ var _excluded$J = ["pendingSwap", "onBack", "onCopy", "isCopied", "onCancel", "d
4626
4651
  var SwapperContainer$1 = /*#__PURE__*/styled('div', {
4627
4652
  display: 'flex',
4628
4653
  alignItems: 'center',
4629
- marginLeft: '6px'
4654
+ paddingLeft: '$4',
4655
+ variants: {
4656
+ created: {
4657
+ "true": {
4658
+ filter: 'grayscale(100%)'
4659
+ }
4660
+ },
4661
+ running: {
4662
+ "true": {
4663
+ animation: pulse + " 2s ease-in-out infinite"
4664
+ }
4665
+ }
4666
+ }
4667
+ });
4668
+ var FeeContainer = /*#__PURE__*/styled('div', {
4669
+ paddingLeft: '$4'
4630
4670
  });
4631
4671
  var Fee = /*#__PURE__*/styled('div', {
4632
4672
  display: 'flex',
@@ -4640,7 +4680,7 @@ var Dot$1 = /*#__PURE__*/styled('div', {
4640
4680
  height: '$8',
4641
4681
  backgroundColor: '$foreground',
4642
4682
  borderRadius: '4px',
4643
- marginLeft: '$8'
4683
+ marginLeft: '11px'
4644
4684
  });
4645
4685
  var ArrowDown = /*#__PURE__*/styled('div', {
4646
4686
  width: '0px',
@@ -4648,7 +4688,7 @@ var ArrowDown = /*#__PURE__*/styled('div', {
4648
4688
  borderLeft: '5px solid transparent',
4649
4689
  borderRight: '5px solid transparent',
4650
4690
  borderTop: '5px solid $foreground',
4651
- marginLeft: '$8'
4691
+ marginLeft: '$10'
4652
4692
  });
4653
4693
  var StyledAnchor = /*#__PURE__*/styled('a', {
4654
4694
  color: '$primary',
@@ -4676,13 +4716,10 @@ var Description = /*#__PURE__*/styled(Typography, {
4676
4716
  color: '$success',
4677
4717
  marginLeft: '$8'
4678
4718
  });
4679
- var Error = /*#__PURE__*/styled(Description, {
4680
- color: '$error'
4681
- });
4682
4719
  var Line$1 = /*#__PURE__*/styled('div', {
4683
4720
  width: '0',
4684
4721
  minHeight: '$16',
4685
- marginLeft: '$12',
4722
+ marginLeft: '14px',
4686
4723
  border: '1px dashed $foreground',
4687
4724
  borderRadius: 'inherit'
4688
4725
  });
@@ -4725,22 +4762,9 @@ var ExtraDetails = /*#__PURE__*/styled('div', {
4725
4762
  color: '$neutrals600',
4726
4763
  fontSize: '$12'
4727
4764
  });
4728
- var StepContainer$1 = /*#__PURE__*/styled('div', {
4729
- variants: {
4730
- hasNotStarted: {
4731
- "true": {
4732
- filter: 'grayscale(100%)'
4733
- }
4734
- },
4735
- isRunning: {
4736
- "true": {
4737
- animation: pulse + " 2s ease-in-out infinite"
4738
- }
4739
- }
4740
- }
4741
- });
4742
4765
  var SwapFlowContainer = /*#__PURE__*/styled('div', {
4743
- overflowY: 'auto'
4766
+ overflowY: 'auto',
4767
+ paddingTop: '$8'
4744
4768
  });
4745
4769
  function SwapHistory(props) {
4746
4770
  var pendingSwap = props.pendingSwap,
@@ -4790,39 +4814,30 @@ function SwapHistory(props) {
4790
4814
  }))), React__default.createElement(ExtraDetails, null, date))), React__default.createElement(SwapFlowContainer, null, extraMessageProps.shortMessage && React__default.createElement(SwapMessages, Object.assign({}, extraMessageProps)), React__default.createElement(Divider, {
4791
4815
  size: 32
4792
4816
  }), pendingSwap == null ? void 0 : pendingSwap.steps.map(function (step, index) {
4793
- return React__default.createElement(StepContainer$1, {
4794
- key: index,
4795
- hasNotStarted: step.status === 'created',
4796
- isRunning: step.status != 'failed' && step.status != 'success' && step.status != 'created'
4817
+ return React__default.createElement("div", {
4818
+ key: index
4797
4819
  }, index === 0 && React__default.createElement(RelativeContainer$1, null, React__default.createElement(StepDetail, {
4798
4820
  logo: step.fromLogo,
4799
4821
  symbol: step.fromSymbol,
4800
- // @ts-ignore
4801
4822
  chainLogo: step.fromBlockchainLogo || '',
4802
4823
  blockchain: step.fromBlockchain,
4803
4824
  amount: pendingSwap.inputAmount
4804
- }), React__default.createElement(Dot$1, null)), React__default.createElement(Line$1, null), React__default.createElement(SwapperContainer$1, null, React__default.createElement(Image
4805
- // @ts-ignore
4806
- , {
4807
- // @ts-ignore
4808
- src: step.swapperLogo,
4825
+ }), React__default.createElement(Dot$1, null)), React__default.createElement(Line$1, null), React__default.createElement(SwapperContainer$1, {
4826
+ created: step.status === 'created',
4827
+ running: !['created', 'success', 'failed'].includes(step.status)
4828
+ }, React__default.createElement(Image, {
4829
+ src: step.swapperLogo || '',
4809
4830
  alt: step.swapperId,
4810
- size: 16
4811
- }), React__default.createElement("div", null, React__default.createElement(Typography, {
4812
- ml: 4,
4831
+ size: 20
4832
+ }), React__default.createElement(FeeContainer, null, React__default.createElement(Typography, {
4813
4833
  variant: "caption"
4814
- },
4815
- // @ts-ignore
4816
- 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, {
4817
- ml: 4,
4834
+ }, 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, {
4818
4835
  variant: "caption"
4819
- }, "$",
4820
- // @ts-ignore
4821
- step.feeInUsd, ' ', "estimated gas fee")))), React__default.createElement("div", {
4836
+ }, "\xA0 $", step.feeInUsd, " estimated gas fee")))), React__default.createElement("div", {
4822
4837
  style: {
4823
4838
  display: 'flex'
4824
4839
  }
4825
- }, React__default.createElement(InternalDetailsContainer, null, React__default.createElement(Line$1, null), !!step.explorerUrl && React__default.createElement("div", null, step.explorerUrl.map(function (item, index) {
4840
+ }, 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) {
4826
4841
  return React__default.createElement(InternalDetail, {
4827
4842
  key: index
4828
4843
  }, React__default.createElement(DescriptionContainer, null, React__default.createElement(CheckCircleIcon, {
@@ -4835,17 +4850,19 @@ function SwapHistory(props) {
4835
4850
  rel: "noreferrer",
4836
4851
  key: index
4837
4852
  }, "TX-Link"));
4838
- }), step.status === 'failed' && React__default.createElement(InternalDetail, null, React__default.createElement(DescriptionContainer, null, React__default.createElement(InfoCircleIcon, {
4853
+ })), step.status === 'failed' && React__default.createElement(InternalDetail, null, React__default.createElement(DescriptionContainer, null, React__default.createElement(InfoCircleIcon, {
4839
4854
  color: "error"
4840
- }), React__default.createElement(Error, {
4841
- variant: "body2"
4855
+ }), React__default.createElement(Description, {
4856
+ variant: "body2",
4857
+ color: "$error500"
4842
4858
  }, "Step failed")))))), index + 1 === pendingSwap.steps.length && React__default.createElement(ArrowDown, null), React__default.createElement(StepDetail, {
4843
4859
  logo: step.toLogo,
4844
4860
  symbol: step.toSymbol,
4845
- // @ts-ignore
4846
4861
  chainLogo: step.toBlockchainLogo || '',
4847
4862
  blockchain: step.toBlockchain,
4848
- amount: step.outputAmount || ''
4863
+ amount: step.outputAmount || '',
4864
+ estimatedAmount: step.expectedOutputAmountHumanReadable || '',
4865
+ success: step.status === 'success'
4849
4866
  }));
4850
4867
  }), React__default.createElement(Divider, {
4851
4868
  size: 32