@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/components/StepDetail/StepDetail.d.ts +3 -1
- package/dist/containers/SwapHistory/SwapHistory.d.ts +1 -0
- package/dist/ui.cjs.development.js +120 -103
- 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 +120 -103
- package/dist/ui.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/StepDetail/StepDetail.tsx +55 -18
- package/src/containers/SwapHistory/SwapHistory.tsx +82 -94
|
@@ -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(
|
|
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
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
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(
|
|
1709
|
+
}, React__default.createElement(Logo, {
|
|
1721
1710
|
src: logo,
|
|
1722
|
-
alt: symbol
|
|
1723
|
-
|
|
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
|
|
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',
|
|
@@ -4632,7 +4657,22 @@ var _excluded$J = ["pendingSwap", "onBack", "onCopy", "isCopied", "onCancel", "d
|
|
|
4632
4657
|
var SwapperContainer$1 = /*#__PURE__*/styled('div', {
|
|
4633
4658
|
display: 'flex',
|
|
4634
4659
|
alignItems: 'center',
|
|
4635
|
-
|
|
4660
|
+
paddingLeft: '$4',
|
|
4661
|
+
variants: {
|
|
4662
|
+
created: {
|
|
4663
|
+
"true": {
|
|
4664
|
+
filter: 'grayscale(100%)'
|
|
4665
|
+
}
|
|
4666
|
+
},
|
|
4667
|
+
running: {
|
|
4668
|
+
"true": {
|
|
4669
|
+
animation: pulse + " 2s ease-in-out infinite"
|
|
4670
|
+
}
|
|
4671
|
+
}
|
|
4672
|
+
}
|
|
4673
|
+
});
|
|
4674
|
+
var FeeContainer = /*#__PURE__*/styled('div', {
|
|
4675
|
+
paddingLeft: '$4'
|
|
4636
4676
|
});
|
|
4637
4677
|
var Fee = /*#__PURE__*/styled('div', {
|
|
4638
4678
|
display: 'flex',
|
|
@@ -4646,7 +4686,7 @@ var Dot$1 = /*#__PURE__*/styled('div', {
|
|
|
4646
4686
|
height: '$8',
|
|
4647
4687
|
backgroundColor: '$foreground',
|
|
4648
4688
|
borderRadius: '4px',
|
|
4649
|
-
marginLeft: '
|
|
4689
|
+
marginLeft: '11px'
|
|
4650
4690
|
});
|
|
4651
4691
|
var ArrowDown = /*#__PURE__*/styled('div', {
|
|
4652
4692
|
width: '0px',
|
|
@@ -4654,7 +4694,7 @@ var ArrowDown = /*#__PURE__*/styled('div', {
|
|
|
4654
4694
|
borderLeft: '5px solid transparent',
|
|
4655
4695
|
borderRight: '5px solid transparent',
|
|
4656
4696
|
borderTop: '5px solid $foreground',
|
|
4657
|
-
marginLeft: '$
|
|
4697
|
+
marginLeft: '$10'
|
|
4658
4698
|
});
|
|
4659
4699
|
var StyledAnchor = /*#__PURE__*/styled('a', {
|
|
4660
4700
|
color: '$primary',
|
|
@@ -4682,13 +4722,10 @@ var Description = /*#__PURE__*/styled(Typography, {
|
|
|
4682
4722
|
color: '$success',
|
|
4683
4723
|
marginLeft: '$8'
|
|
4684
4724
|
});
|
|
4685
|
-
var Error = /*#__PURE__*/styled(Description, {
|
|
4686
|
-
color: '$error'
|
|
4687
|
-
});
|
|
4688
4725
|
var Line$1 = /*#__PURE__*/styled('div', {
|
|
4689
4726
|
width: '0',
|
|
4690
4727
|
minHeight: '$16',
|
|
4691
|
-
marginLeft: '
|
|
4728
|
+
marginLeft: '14px',
|
|
4692
4729
|
border: '1px dashed $foreground',
|
|
4693
4730
|
borderRadius: 'inherit'
|
|
4694
4731
|
});
|
|
@@ -4731,22 +4768,9 @@ var ExtraDetails = /*#__PURE__*/styled('div', {
|
|
|
4731
4768
|
color: '$neutrals600',
|
|
4732
4769
|
fontSize: '$12'
|
|
4733
4770
|
});
|
|
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
4771
|
var SwapFlowContainer = /*#__PURE__*/styled('div', {
|
|
4749
|
-
overflowY: 'auto'
|
|
4772
|
+
overflowY: 'auto',
|
|
4773
|
+
paddingTop: '$8'
|
|
4750
4774
|
});
|
|
4751
4775
|
function SwapHistory(props) {
|
|
4752
4776
|
var pendingSwap = props.pendingSwap,
|
|
@@ -4796,39 +4820,30 @@ function SwapHistory(props) {
|
|
|
4796
4820
|
}))), 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
4821
|
size: 32
|
|
4798
4822
|
}), pendingSwap == null ? void 0 : pendingSwap.steps.map(function (step, index) {
|
|
4799
|
-
return React__default.createElement(
|
|
4800
|
-
key: index
|
|
4801
|
-
hasNotStarted: step.status === 'created',
|
|
4802
|
-
isRunning: step.status != 'failed' && step.status != 'success' && step.status != 'created'
|
|
4823
|
+
return React__default.createElement("div", {
|
|
4824
|
+
key: index
|
|
4803
4825
|
}, index === 0 && React__default.createElement(RelativeContainer$1, null, React__default.createElement(StepDetail, {
|
|
4804
4826
|
logo: step.fromLogo,
|
|
4805
4827
|
symbol: step.fromSymbol,
|
|
4806
|
-
// @ts-ignore
|
|
4807
4828
|
chainLogo: step.fromBlockchainLogo || '',
|
|
4808
4829
|
blockchain: step.fromBlockchain,
|
|
4809
4830
|
amount: pendingSwap.inputAmount
|
|
4810
|
-
}), React__default.createElement(Dot$1, null)), React__default.createElement(Line$1, null), React__default.createElement(SwapperContainer$1,
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
src: step.swapperLogo,
|
|
4831
|
+
}), React__default.createElement(Dot$1, null)), React__default.createElement(Line$1, null), React__default.createElement(SwapperContainer$1, {
|
|
4832
|
+
created: step.status === 'created',
|
|
4833
|
+
running: !['created', 'success', 'failed'].includes(step.status)
|
|
4834
|
+
}, React__default.createElement(Image, {
|
|
4835
|
+
src: step.swapperLogo || '',
|
|
4815
4836
|
alt: step.swapperId,
|
|
4816
|
-
size:
|
|
4817
|
-
}), React__default.createElement(
|
|
4818
|
-
ml: 4,
|
|
4837
|
+
size: 20
|
|
4838
|
+
}), React__default.createElement(FeeContainer, null, React__default.createElement(Typography, {
|
|
4819
4839
|
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,
|
|
4840
|
+
}, 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
4841
|
variant: "caption"
|
|
4825
|
-
}, "$",
|
|
4826
|
-
// @ts-ignore
|
|
4827
|
-
step.feeInUsd, ' ', "estimated gas fee")))), React__default.createElement("div", {
|
|
4842
|
+
}, "\xA0 $", step.feeInUsd, " estimated gas fee")))), React__default.createElement("div", {
|
|
4828
4843
|
style: {
|
|
4829
4844
|
display: 'flex'
|
|
4830
4845
|
}
|
|
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) {
|
|
4846
|
+
}, 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
4847
|
return React__default.createElement(InternalDetail, {
|
|
4833
4848
|
key: index
|
|
4834
4849
|
}, React__default.createElement(DescriptionContainer, null, React__default.createElement(CheckCircleIcon, {
|
|
@@ -4841,17 +4856,19 @@ function SwapHistory(props) {
|
|
|
4841
4856
|
rel: "noreferrer",
|
|
4842
4857
|
key: index
|
|
4843
4858
|
}, "TX-Link"));
|
|
4844
|
-
}), step.status === 'failed' && React__default.createElement(InternalDetail, null, React__default.createElement(DescriptionContainer, null, React__default.createElement(InfoCircleIcon, {
|
|
4859
|
+
})), step.status === 'failed' && React__default.createElement(InternalDetail, null, React__default.createElement(DescriptionContainer, null, React__default.createElement(InfoCircleIcon, {
|
|
4845
4860
|
color: "error"
|
|
4846
|
-
}), React__default.createElement(
|
|
4847
|
-
variant: "body2"
|
|
4861
|
+
}), React__default.createElement(Description, {
|
|
4862
|
+
variant: "body2",
|
|
4863
|
+
color: "$error500"
|
|
4848
4864
|
}, "Step failed")))))), index + 1 === pendingSwap.steps.length && React__default.createElement(ArrowDown, null), React__default.createElement(StepDetail, {
|
|
4849
4865
|
logo: step.toLogo,
|
|
4850
4866
|
symbol: step.toSymbol,
|
|
4851
|
-
// @ts-ignore
|
|
4852
4867
|
chainLogo: step.toBlockchainLogo || '',
|
|
4853
4868
|
blockchain: step.toBlockchain,
|
|
4854
|
-
amount: step.outputAmount || ''
|
|
4869
|
+
amount: step.outputAmount || '',
|
|
4870
|
+
estimatedAmount: step.expectedOutputAmountHumanReadable || '',
|
|
4871
|
+
success: step.status === 'success'
|
|
4855
4872
|
}));
|
|
4856
4873
|
}), React__default.createElement(Divider, {
|
|
4857
4874
|
size: 32
|