@rango-dev/ui 0.1.10-next.91 → 0.1.10

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.
Files changed (116) hide show
  1. package/README.md +1 -181
  2. package/dist/components/Alert/Alert.d.ts +3 -2
  3. package/dist/components/Alert/LoadingFailedAlert.d.ts +2 -0
  4. package/dist/components/Alert/NotFoundAlert.d.ts +7 -0
  5. package/dist/components/Alert/index.d.ts +1 -0
  6. package/dist/components/BlockchainSelector/BlockchainSelector.d.ts +1 -1
  7. package/dist/components/Button/Button.d.ts +3 -3
  8. package/dist/components/Divider/Divider.d.ts +6 -0
  9. package/dist/components/Divider/index.d.ts +1 -0
  10. package/dist/components/Header/Header.d.ts +9 -0
  11. package/dist/components/Header/index.d.ts +1 -0
  12. package/dist/components/Icon/ArrowRightIcon.d.ts +3 -0
  13. package/dist/components/Icon/ChevronRightIcon.d.ts +3 -0
  14. package/dist/components/Icon/DisconnectIcon.d.ts +3 -0
  15. package/dist/components/Icon/index.d.ts +3 -0
  16. package/dist/components/Icon/types.d.ts +1 -1
  17. package/dist/components/LiquiditySourceList/LiquiditySourceList.d.ts +3 -1
  18. package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.d.ts +2 -1
  19. package/dist/components/SelectableWalletList/mock.d.ts +1 -1
  20. package/dist/components/Settings/Settings.d.ts +2 -1
  21. package/dist/components/Spacer/Spacer.d.ts +1 -1
  22. package/dist/components/SwapContainer/SwapContainer.d.ts +1 -0
  23. package/dist/components/SwapDetail/Token.d.ts +16 -0
  24. package/dist/components/TextField/TextField.stories.d.ts +1 -1
  25. package/dist/components/TokenSelector/TokenSelector.d.ts +3 -0
  26. package/dist/components/Typography/Typography.d.ts +3 -2
  27. package/dist/components/index.d.ts +2 -0
  28. package/dist/containers/ConfirmSwap/ConfirmSwap.d.ts +10 -17
  29. package/dist/containers/ConfirmSwap/ConfirmSwap.stories.d.ts +1 -0
  30. package/dist/containers/ConfirmSwap/mock.d.ts +3 -0
  31. package/dist/containers/History/History.d.ts +6 -1
  32. package/dist/containers/History/index.d.ts +1 -1
  33. package/dist/containers/History/types.d.ts +3 -24
  34. package/dist/containers/SwapHistory/SwapHistory.d.ts +16 -3
  35. package/dist/containers/SwapHistory/SwapMessages.d.ts +17 -0
  36. package/dist/containers/index.d.ts +0 -1
  37. package/dist/helper/index.d.ts +1 -0
  38. package/dist/types/meta.d.ts +1 -0
  39. package/dist/ui.cjs.development.js +1455 -1033
  40. package/dist/ui.cjs.development.js.map +1 -1
  41. package/dist/ui.cjs.production.min.js +1 -1
  42. package/dist/ui.cjs.production.min.js.map +1 -1
  43. package/dist/ui.esm.js +1463 -1046
  44. package/dist/ui.esm.js.map +1 -1
  45. package/package.json +3 -2
  46. package/src/components/Alert/Alert.tsx +63 -39
  47. package/src/components/Alert/LoadingFailedAlert.tsx +11 -0
  48. package/src/components/Alert/NotFoundAlert.tsx +19 -0
  49. package/src/components/Alert/index.ts +1 -0
  50. package/src/components/BestRoute/BestRoute.tsx +28 -19
  51. package/src/components/BestRoute/mock.ts +10 -0
  52. package/src/components/BlockchainSelector/BlockchainSelector.tsx +13 -21
  53. package/src/components/Button/Button.stories.tsx +1 -1
  54. package/src/components/Button/Button.tsx +36 -23
  55. package/src/components/Chip/Chip.tsx +7 -4
  56. package/src/components/ConnectWalletsModal/mockData.ts +16 -0
  57. package/src/components/Divider/Divider.tsx +41 -0
  58. package/src/components/Divider/index.ts +1 -0
  59. package/src/components/Header/Header.tsx +39 -0
  60. package/src/components/Header/index.ts +1 -0
  61. package/src/components/Icon/ArrowRightIcon.tsx +31 -0
  62. package/src/components/Icon/ChevronRightIcon.tsx +29 -0
  63. package/src/components/Icon/DisconnectIcon.tsx +31 -0
  64. package/src/components/Icon/HistoryIcon.tsx +12 -18
  65. package/src/components/Icon/RetryIcon.tsx +13 -13
  66. package/src/components/Icon/SettingIcon.tsx +6 -14
  67. package/src/components/Icon/index.ts +3 -0
  68. package/src/components/Icon/types.tsx +1 -1
  69. package/src/components/LiquiditySourceList/LiquiditySourceList.tsx +104 -30
  70. package/src/components/LiquiditySourcesSelector/LiquiditySourcesSelector.tsx +16 -11
  71. package/src/components/Radio/Radio.tsx +5 -4
  72. package/src/components/SecondaryPage/SecondaryPage.tsx +26 -52
  73. package/src/components/SelectableWalletList/SelectableWalletList.tsx +5 -1
  74. package/src/components/SelectableWalletList/mock.ts +4 -3
  75. package/src/components/Settings/Settings.tsx +47 -12
  76. package/src/components/Spacer/Spacer.tsx +31 -1
  77. package/src/components/StatusDrawer/StatusDrawer.tsx +1 -0
  78. package/src/components/StepDetail/StepDetail.tsx +19 -7
  79. package/src/components/SwapContainer/SwapContainer.tsx +22 -17
  80. package/src/components/SwapDetail/SwapDetail.tsx +77 -115
  81. package/src/components/SwapDetail/Token.tsx +68 -0
  82. package/src/components/SwapDetail/mock.ts +1 -0
  83. package/src/components/Switch/Switch.tsx +7 -5
  84. package/src/components/TextField/TextField.tsx +3 -1
  85. package/src/components/TokenList/TokenItem.tsx +4 -1
  86. package/src/components/TokenList/TokenList.tsx +16 -18
  87. package/src/components/TokenSelector/TokenSelector.tsx +47 -10
  88. package/src/components/Typography/Typography.stories.tsx +4 -0
  89. package/src/components/Typography/Typography.tsx +20 -9
  90. package/src/components/Wallet/State.tsx +2 -3
  91. package/src/components/Wallet/Wallet.tsx +33 -6
  92. package/src/components/index.ts +2 -0
  93. package/src/containers/ConfirmSwap/ConfirmSwap.stories.tsx +11 -2
  94. package/src/containers/ConfirmSwap/ConfirmSwap.tsx +103 -119
  95. package/src/containers/ConfirmSwap/mock.ts +79 -2
  96. package/src/containers/History/History.tsx +57 -38
  97. package/src/containers/History/index.ts +1 -1
  98. package/src/containers/History/mock.ts +1 -0
  99. package/src/containers/History/types.tsx +2 -30
  100. package/src/containers/SwapHistory/SwapHistory.tsx +309 -165
  101. package/src/containers/SwapHistory/SwapMessages.tsx +116 -0
  102. package/src/containers/SwapHistory/mock.ts +1 -0
  103. package/src/containers/index.ts +0 -1
  104. package/src/helper/index.ts +14 -0
  105. package/src/theme.ts +4 -2
  106. package/src/types/meta.ts +2 -0
  107. package/dist/containers/ConfirmWallets/ConfirmWallets.d.ts +0 -18
  108. package/dist/containers/ConfirmWallets/ConfirmWallets.stories.d.ts +0 -6
  109. package/dist/containers/ConfirmWallets/index.d.ts +0 -1
  110. package/dist/containers/ConfirmWallets/mock.d.ts +0 -5
  111. package/dist/helper/swaps.d.ts +0 -5
  112. package/src/containers/ConfirmWallets/ConfirmWallets.stories.tsx +0 -26
  113. package/src/containers/ConfirmWallets/ConfirmWallets.tsx +0 -118
  114. package/src/containers/ConfirmWallets/index.ts +0 -1
  115. package/src/containers/ConfirmWallets/mock.ts +0 -222
  116. package/src/helper/swaps.ts +0 -23
@@ -2,88 +2,45 @@ import React, { PropsWithChildren } from 'react';
2
2
  import { PendingSwap } from '../../containers/History/types';
3
3
  import { styled } from '../../theme';
4
4
  import { Button } from '../Button';
5
- import { CheckCircleIcon, InfoCircleIcon, TryAgainIcon } from '../Icon';
6
- import { StepDetail } from '../StepDetail';
5
+ import { ArrowRightIcon } from '../Icon';
6
+ import { Spacer } from '../Spacer';
7
+ import { Spinner } from '../Spinner';
8
+ import { Token } from './Token';
7
9
 
8
10
  const Container = styled('div', {
9
11
  position: 'relative',
10
- });
11
-
12
- const ButtonContainer = styled('div', {
13
- paddingTop: '$8',
14
- });
15
- const SwapContainer = styled('div', {
16
12
  display: 'flex',
17
13
  justifyContent: 'space-between',
18
- '@md': {
19
- padding: '$12',
14
+ alignItems: 'center',
15
+ padding: '$16 0',
16
+ borderBottom: '1px solid $neutrals300',
17
+
18
+ '& > .info': {
19
+ display: 'flex',
20
+ alignItems: 'center',
20
21
  },
21
- '&:hover': {
22
- borderColor: '$primary',
22
+
23
+ '.status': {
24
+ textTransform: 'uppercase',
25
+ fontWeight: 'bold',
26
+ fontSize: '$12',
23
27
  },
24
28
 
25
- variants: {
26
- status: {
27
- failed: {
28
- borderColor: '$error',
29
- },
30
- running: {
31
- borderColor: '$neutrals400',
32
- },
33
- success: {
34
- borderColor: '$success',
35
- },
36
- },
29
+ '&.running': {
30
+ color: '$foreground',
37
31
  },
38
- });
39
- const Arrow = styled('div', {
40
- display: 'flex',
41
- justifyContent: 'center',
42
- alignItems: 'center',
43
- });
44
- const Line = styled('div', {
45
- height: '0',
46
- width: '$20',
47
- border: '1px dashed $foreground',
48
- borderRadius: 'inherit',
49
- '@md': {
50
- width: '$36',
32
+ '&.failed,&.success': {
33
+ color: '$neutrals600',
51
34
  },
52
- '@lg': {
53
- width: '$48',
35
+
36
+ '&.failed .status': {
37
+ color: '$error',
54
38
  },
55
- });
56
- const Dot = styled('div', {
57
- width: '$6',
58
- height: '$6',
59
- backgroundColor: '$foreground',
60
- borderRadius: '50%',
61
- '@lg': {
62
- width: '$8',
63
- height: '$8',
39
+ '&.success .status': {
40
+ color: '$success',
64
41
  },
65
42
  });
66
- const ArrowRight = styled('div', {
67
- width: '0px',
68
- height: '0px',
69
- borderTop: '5px solid transparent',
70
- borderBottom: '5px solid transparent',
71
- borderLeft: '5px solid $foreground',
72
- });
73
- const StatusContainer = styled('div', {
74
- position: 'absolute',
75
- right: '-8px',
76
- top: '30%',
77
- background: '$background',
78
- borderRadius: '50%',
79
- display: 'flex',
80
- justifyContent: 'center',
81
43
 
82
- '@md': {
83
- top: '40%',
84
- right: '-8px',
85
- },
86
- });
87
44
  export interface PropTypes {
88
45
  swap: PendingSwap;
89
46
  status: 'running' | 'failed' | 'success';
@@ -99,52 +56,57 @@ export function SwapDetail({
99
56
  const lastStep = swap.steps[swap.steps.length - 1];
100
57
 
101
58
  return (
102
- <Container onClick={onClick.bind(null, swap.requestId)}>
103
- <ButtonContainer>
104
- <Button
105
- variant="outlined"
106
- align="grow"
107
- size="large"
108
- type={
109
- status === 'failed'
110
- ? 'error'
111
- : status === 'success'
112
- ? 'success'
113
- : undefined
114
- }
115
- >
116
- <SwapContainer>
117
- <StepDetail
118
- logo={firstStep.fromLogo}
119
- symbol={firstStep.fromSymbol}
120
- chainLogo={firstStep.fromBlockchainLogo}
121
- blockchain={firstStep.fromBlockchain}
122
- amount={swap.inputAmount}
123
- />
124
- <Arrow>
125
- <Dot />
126
- <Line />
127
- <ArrowRight />
128
- </Arrow>
129
- <StepDetail
130
- logo={lastStep.toLogo}
131
- symbol={lastStep.toSymbol}
132
- chainLogo={lastStep.toBlockchainLogo}
133
- blockchain={lastStep.toBlockchain}
134
- amount={lastStep.outputAmount}
135
- />
136
- </SwapContainer>
137
- </Button>
138
- </ButtonContainer>
139
- <StatusContainer>
140
- {status === 'running' ? (
141
- <TryAgainIcon size={16} />
142
- ) : status === 'failed' ? (
143
- <InfoCircleIcon size={18} color="error" />
144
- ) : (
145
- <CheckCircleIcon size={18} color="success" />
146
- )}
147
- </StatusContainer>
148
- </Container>
59
+ <Button
60
+ variant="ghost"
61
+ size="free"
62
+ fullWidth
63
+ onClick={onClick.bind(null, swap.requestId)}
64
+ >
65
+ <Container className={`${status}`}>
66
+ <div className="info">
67
+ <Token
68
+ data={{
69
+ token: {
70
+ logo: firstStep.fromLogo,
71
+ symbol: firstStep.fromSymbol,
72
+ },
73
+ blockchain: {
74
+ // @ts-ignore
75
+ logo: firstStep.fromBlockchainLogo,
76
+ name: firstStep.fromBlockchain,
77
+ },
78
+ amount: swap.inputAmount,
79
+ }}
80
+ />
81
+ <Spacer size={12} />
82
+ <ArrowRightIcon size={12} />
83
+ <Spacer size={12} />
84
+ <Token
85
+ data={{
86
+ token: {
87
+ logo: lastStep.toLogo,
88
+ symbol: lastStep.toSymbol,
89
+ },
90
+ blockchain: {
91
+ // @ts-ignore
92
+ logo: lastStep.toBlockchainLogo,
93
+ name: lastStep.toBlockchain,
94
+ },
95
+ amount:
96
+ lastStep.outputAmount ||
97
+ lastStep.expectedOutputAmountHumanReadable ||
98
+ '',
99
+ }}
100
+ />
101
+ </div>
102
+ <div className={`status`}>
103
+ {status === 'running' ? (
104
+ <Spinner size={24} color="primary" />
105
+ ) : (
106
+ status
107
+ )}
108
+ </div>
109
+ </Container>
110
+ </Button>
149
111
  );
150
112
  }
@@ -0,0 +1,68 @@
1
+ import React from 'react';
2
+ import { styled } from '../../theme';
3
+ import { Spacer } from '../Spacer';
4
+
5
+ const TokenContainer = styled('div', {
6
+ display: 'flex',
7
+ alignItems: 'center',
8
+
9
+ '& .amount': {
10
+ fontWeight: 'bold',
11
+ },
12
+ });
13
+
14
+ const TokenImage = styled('div', {
15
+ position: 'relative',
16
+ width: '$24',
17
+ height: '$24',
18
+
19
+ img: {
20
+ width: '100%',
21
+ display: 'block',
22
+ },
23
+
24
+ '.overlay': {
25
+ position: 'absolute',
26
+ right: -4,
27
+ bottom: -4,
28
+ width: '$16',
29
+ height: '$16',
30
+ padding: '$2',
31
+ borderRadius: '50%',
32
+ backgroundColor: '$background',
33
+ border: '1px solid $neutrals400',
34
+ },
35
+ });
36
+
37
+ interface PropTypes {
38
+ data: {
39
+ token: {
40
+ logo: string;
41
+ symbol: string;
42
+ };
43
+ blockchain: {
44
+ logo: string;
45
+ name: string;
46
+ };
47
+ amount: string;
48
+ };
49
+ }
50
+ export function Token(props: PropTypes) {
51
+ return (
52
+ <TokenContainer>
53
+ <TokenImage>
54
+ <img src={props.data.token.logo} alt="" />
55
+ <div className="overlay">
56
+ <img
57
+ src={props.data.blockchain.logo}
58
+ alt={props.data.blockchain.name}
59
+ />
60
+ </div>
61
+ </TokenImage>
62
+ <Spacer size={8} />
63
+ <span className="amount">{props.data.amount}</span>
64
+ <Spacer size={4} />
65
+ {props.data.token.symbol}
66
+ </TokenContainer>
67
+ );
68
+ }
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  import { RoutingResultType, TransactionType } from 'rango-sdk';
2
3
  import { PendingSwap } from '../../containers/History/types';
3
4
 
@@ -9,14 +9,16 @@ const StyledSwitchRoot = styled(RadixSwitch.Root, {
9
9
  borderStyle: 'solid',
10
10
  width: '42px',
11
11
  height: '22px',
12
- backgroundColor: '$neutrals300',
13
- borderColor: '$neutrals400',
12
+ backgroundColor: '$neutrals600',
13
+ borderColor: '$neutrals600',
14
14
  borderRadius: '99999px',
15
15
  position: 'relative',
16
16
  padding: '0',
17
17
  cursor: 'pointer',
18
+
18
19
  '&[data-state="checked"]': {
19
- backgroundColor: '$primary100',
20
+ backgroundColor: '$success',
21
+ borderColor: '$success',
20
22
  },
21
23
  '-webkit-tap-highlight-color': 'rgba(0, 0, 0, 0)',
22
24
  });
@@ -28,13 +30,13 @@ const StyledSwitchThumb = styled(RadixSwitch.Thumb, {
28
30
  display: 'block',
29
31
  width: '18px',
30
32
  height: '18px',
31
- backgroundColor: '$neutrals500',
33
+ backgroundColor: '$white',
32
34
  transition: ' transform 300ms',
33
35
  borderRadius: '999999px',
34
36
  willChange: 'transform',
37
+
35
38
  '&[data-state="checked"]': {
36
39
  transform: 'translateX(20px)',
37
- backgroundColor: '$primary',
38
40
  },
39
41
  });
40
42
 
@@ -4,6 +4,7 @@ import { styled } from '../../theme';
4
4
 
5
5
  const InputContainer = styled('div', {
6
6
  backgroundColor: '$background',
7
+ padding: '1px',
7
8
  boxSizing: 'border-box',
8
9
  border: '1px solid $neutrals400',
9
10
  borderRadius: '$5',
@@ -15,7 +16,8 @@ const InputContainer = styled('div', {
15
16
  color: '$foreground',
16
17
  transition: 'border-color ease .3s',
17
18
  '&:focus-within': {
18
- borderColor: '$primary',
19
+ borderColor: '$success',
20
+ outline: '1px solid $success',
19
21
  },
20
22
  variants: {
21
23
  size: {
@@ -40,6 +40,7 @@ export function TokenItem(props: PropTypes) {
40
40
  ...style,
41
41
  height: '48px',
42
42
  top: `${parseFloat(style?.top as string) + 0}px`,
43
+ padding: '0 4px',
43
44
  }}
44
45
  >
45
46
  <Button
@@ -62,7 +63,9 @@ export function TokenItem(props: PropTypes) {
62
63
  >
63
64
  <TokenNameContainer>
64
65
  <Typography variant="body1">{token.symbol}</Typography>
65
- <Typography variant="body2">{token.name}</Typography>
66
+ <Typography variant="caption" color="neutrals600">
67
+ {token.name}
68
+ </Typography>
66
69
  </TokenNameContainer>
67
70
  </Button>
68
71
  </div>
@@ -53,7 +53,7 @@ export function TokenList(props: PropTypes) {
53
53
 
54
54
  useEffect(() => {
55
55
  setTokens(list.slice(0, PAGE_SIZE));
56
- }, [searchedText]);
56
+ }, [searchedText, list]);
57
57
 
58
58
  useEffect(() => {
59
59
  setHasNextPage(list.length > tokens.length);
@@ -76,22 +76,20 @@ export function TokenList(props: PropTypes) {
76
76
  );
77
77
 
78
78
  return (
79
- <div style={{ height: '450px' }}>
80
- <VirtualizedList
81
- Item={({ index, style }) => (
82
- <TokenItem
83
- token={tokens[index]}
84
- style={style}
85
- onClick={changeSelected}
86
- selected={isSelected(tokens[index])}
87
- />
88
- )}
89
- hasNextPage={hasNextPage}
90
- itemCount={tokens.length}
91
- loadNextPage={loadNextPage}
92
- innerElementType={innerElementType}
93
- size={56}
94
- />
95
- </div>
79
+ <VirtualizedList
80
+ Item={({ index, style }) => (
81
+ <TokenItem
82
+ token={tokens[index]}
83
+ style={style}
84
+ onClick={changeSelected}
85
+ selected={isSelected(tokens[index])}
86
+ />
87
+ )}
88
+ hasNextPage={hasNextPage}
89
+ itemCount={tokens.length}
90
+ loadNextPage={loadNextPage}
91
+ innerElementType={innerElementType}
92
+ size={56}
93
+ />
96
94
  );
97
95
  }
@@ -3,7 +3,23 @@ import { containsText } from '../../helper';
3
3
  import { SecondaryPage } from '../SecondaryPage/SecondaryPage';
4
4
  import { TokenList } from '../TokenList';
5
5
  import { TokenWithAmount } from '../TokenList/TokenList';
6
+ import { LoadingStatus } from '../../types/meta';
7
+ import { Spinner } from '../Spinner';
8
+ import { LoadingFailedAlert } from '../Alert/LoadingFailedAlert';
9
+ import { NotFoundAlert } from '../Alert/NotFoundAlert';
10
+ import { styled } from '../../theme';
6
11
 
12
+ const Container = styled('div', {
13
+ flex: '1',
14
+ });
15
+
16
+ export const LoaderContainer = styled('div', {
17
+ display: 'flex',
18
+ justifyContent: 'center',
19
+ width: '100%',
20
+ position: 'absolute',
21
+ top: '50%',
22
+ });
7
23
  export interface PropTypes {
8
24
  list: TokenWithAmount[];
9
25
  type?: 'Source' | 'Destination';
@@ -13,6 +29,7 @@ export interface PropTypes {
13
29
  multiSelect?: boolean;
14
30
  onBack?: () => void;
15
31
  selectedList?: TokenWithAmount[] | 'all';
32
+ loadingStatus: LoadingStatus;
16
33
  }
17
34
 
18
35
  const filterTokens = (list: TokenWithAmount[], searchedFor: string) =>
@@ -33,6 +50,7 @@ export function TokenSelector(props: PropTypes) {
33
50
  multiSelect,
34
51
  selectedList,
35
52
  onBack,
53
+ loadingStatus,
36
54
  } = props;
37
55
 
38
56
  return (
@@ -43,16 +61,35 @@ export function TokenSelector(props: PropTypes) {
43
61
  hasHeader={hasHeader}
44
62
  onBack={onBack}
45
63
  >
46
- {(searchedFor) => (
47
- <TokenList
48
- searchedText={searchedFor}
49
- list={filterTokens(list, searchedFor)}
50
- selected={selected}
51
- selectedList={selectedList}
52
- multiSelect={multiSelect}
53
- onChange={onChange}
54
- />
55
- )}
64
+ {(searchedFor) => {
65
+ const filteredTokens = filterTokens(list, searchedFor);
66
+ return (
67
+ <Container>
68
+ {loadingStatus === 'loading' && (
69
+ <LoaderContainer>
70
+ <Spinner size={24} />
71
+ </LoaderContainer>
72
+ )}
73
+ {loadingStatus === 'failed' && <LoadingFailedAlert />}
74
+ {loadingStatus === 'success' && (
75
+ <>
76
+ {filteredTokens.length ? (
77
+ <TokenList
78
+ searchedText={searchedFor}
79
+ list={filteredTokens}
80
+ selected={selected}
81
+ selectedList={selectedList}
82
+ multiSelect={multiSelect}
83
+ onChange={onChange}
84
+ />
85
+ ) : (
86
+ <NotFoundAlert catergory="Token" searchedFor={searchedFor} />
87
+ )}
88
+ </>
89
+ )}
90
+ </Container>
91
+ );
92
+ }}
56
93
  </SecondaryPage>
57
94
  );
58
95
  }
@@ -13,6 +13,7 @@ export default {
13
13
  options: [
14
14
  'body1',
15
15
  'body2',
16
+ 'body3',
16
17
  'h1',
17
18
  'h2',
18
19
  'h3',
@@ -61,6 +62,9 @@ export const Main = (props: PropTypes) => (
61
62
  <Typography {...props} variant="body2">
62
63
  Body 2
63
64
  </Typography>
65
+ <Typography {...props} variant="body3">
66
+ Body 3
67
+ </Typography>
64
68
  <Typography {...props} variant="caption">
65
69
  Caption
66
70
  </Typography>
@@ -4,7 +4,6 @@ import { styled } from '../../theme';
4
4
 
5
5
  const TypographyContainer = styled('span', {
6
6
  margin: 0,
7
- color: '$foreground',
8
7
  display: 'inline-block',
9
8
  variants: {
10
9
  variant: {
@@ -51,12 +50,6 @@ const TypographyContainer = styled('span', {
51
50
  h5: {
52
51
  fontSize: '$16',
53
52
  fontWeight: '$600',
54
- '@md': {
55
- fontSize: '$18',
56
- },
57
- '@lg': {
58
- fontSize: '$20',
59
- },
60
53
  },
61
54
  h6: {
62
55
  fontSize: '$14',
@@ -85,6 +78,10 @@ const TypographyContainer = styled('span', {
85
78
  fontSize: '$16',
86
79
  },
87
80
  },
81
+ body3: {
82
+ fontSize: '$12',
83
+ fontWeight: '$400',
84
+ },
88
85
  caption: {
89
86
  fontSize: '$10',
90
87
  fontWeight: '$400',
@@ -178,6 +175,7 @@ export interface PropTypes {
178
175
  | 'h6'
179
176
  | 'body1'
180
177
  | 'body2'
178
+ | 'body3'
181
179
  | 'caption';
182
180
  align?: 'center' | 'left' | 'right';
183
181
  noWrap?: boolean;
@@ -187,16 +185,29 @@ export interface PropTypes {
187
185
  mr?: 2 | 4 | 8 | 12;
188
186
  className?: string;
189
187
  style?: CSSProperties;
190
-
188
+ color?: string;
191
189
  }
192
190
 
193
191
  export function Typography({
194
192
  children,
195
193
  className,
194
+ color,
196
195
  ...props
197
196
  }: PropsWithChildren<PropTypes>) {
197
+ const customCss = color
198
+ ? {
199
+ color: color.startsWith('$') ? color : `$${color}`,
200
+ }
201
+ : {
202
+ color: '$foreground',
203
+ };
204
+
198
205
  return (
199
- <TypographyContainer className={`_typography _text ${className}`} {...props}>
206
+ <TypographyContainer
207
+ className={`_typography _text ${className || ''}`}
208
+ css={customCss}
209
+ {...props}
210
+ >
200
211
  {children}
201
212
  </TypographyContainer>
202
213
  );
@@ -1,7 +1,6 @@
1
1
  import React, { Fragment } from 'react';
2
2
  import { styled } from '../../theme';
3
- import { FilledCircle } from '../common';
4
- import { DownloadIcon } from '../Icon';
3
+ import { DisconnectIcon, DownloadIcon } from '../Icon';
5
4
  import { Spinner } from '../Spinner';
6
5
  import { WalletState } from '../../types/wallet';
7
6
  import { InstallObjects, detectInstallLink } from '@rango-dev/wallets-shared';
@@ -28,7 +27,7 @@ export const State = ({
28
27
  </a>
29
28
  )}
30
29
  {walletState === WalletState.CONNECTING && <Spinner />}
31
- {walletState === WalletState.CONNECTED && <FilledCircle />}
30
+ {walletState === WalletState.CONNECTED && <DisconnectIcon />}
32
31
  </StateIconContainer>
33
32
  )}
34
33
  </Fragment>
@@ -12,6 +12,25 @@ const WalletImage = styled('img', {
12
12
  height: '$24',
13
13
  marginRight: '$12',
14
14
  });
15
+ const Text = styled('div', {
16
+ display: 'flex',
17
+ flexDirection: 'column',
18
+ });
19
+
20
+ const ExtendedButton = styled(Button, {
21
+ variants: {
22
+ type: {
23
+ primary: {
24
+ outline: '1px solid $primary',
25
+ borderColor: '$primary',
26
+
27
+ '&:hover': {
28
+ borderColor: '$primary',
29
+ },
30
+ },
31
+ },
32
+ },
33
+ });
15
34
 
16
35
  export type PropTypes = WalletInfo & {
17
36
  onClick: (walletType: WalletType) => void;
@@ -19,10 +38,11 @@ export type PropTypes = WalletInfo & {
19
38
 
20
39
  export function Wallet(props: PropTypes) {
21
40
  const { name, type, image, state, onClick, installLink } = props;
41
+
22
42
  return (
23
- <Button
43
+ <ExtendedButton
24
44
  type={state === WalletState.CONNECTED ? 'primary' : undefined}
25
- disabled={!state}
45
+ disabled={state == WalletState.CONNECTING}
26
46
  onClick={() => {
27
47
  if (state === WalletState.NOT_INSTALLED) {
28
48
  window.open(detectInstallLink(installLink), '_blank');
@@ -34,9 +54,16 @@ export function Wallet(props: PropTypes) {
34
54
  prefix={<WalletImage src={image} />}
35
55
  suffix={<State walletState={state} installLink={installLink} />}
36
56
  >
37
- <Typography variant="h5" noWrap={false}>
38
- {name}
39
- </Typography>
40
- </Button>
57
+ <Text>
58
+ <Typography variant="h5" noWrap={false}>
59
+ {name}
60
+ </Typography>
61
+ {state === WalletState.CONNECTED ? (
62
+ <Typography variant="caption" noWrap={false} color="primary">
63
+ Connected
64
+ </Typography>
65
+ ) : null}
66
+ </Text>
67
+ </ExtendedButton>
41
68
  );
42
69
  }
@@ -27,3 +27,5 @@ export * from './Radio';
27
27
  export * from './TokenList';
28
28
  export * from './common';
29
29
  export * from './Drawer';
30
+ export * from './Header';
31
+ export * from './Divider';