@rango-dev/widget-embedded 0.17.1-next.30 → 0.17.1-next.31

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 (43) hide show
  1. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +314 -0
  2. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
  3. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
  4. package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts.map +1 -1
  5. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts.map +1 -1
  6. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +1727 -0
  7. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -1
  8. package/dist/components/Quote/Quote.d.ts.map +1 -1
  9. package/dist/components/Quote/Quote.styles.d.ts +471 -0
  10. package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
  11. package/dist/components/Quote/QuoteSummary.styles.d.ts +157 -0
  12. package/dist/components/Quote/QuoteSummary.styles.d.ts.map +1 -1
  13. package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -1
  14. package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
  15. package/dist/components/SwapDetails/SwapDetails.styles.d.ts +628 -0
  16. package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
  17. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +157 -0
  18. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
  19. package/dist/components/TokenList/TokenList.d.ts.map +1 -1
  20. package/dist/components/TokenList/TokenList.styles.d.ts +942 -0
  21. package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
  22. package/dist/index.js +1 -1
  23. package/dist/index.js.map +3 -3
  24. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  25. package/package.json +2 -2
  26. package/src/components/BlockchainList/BlockchainList.styles.ts +2 -2
  27. package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +12 -6
  28. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +4 -2
  29. package/src/components/LoadingSwapDetails/LoadingSwapDetailStep.tsx +14 -7
  30. package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +63 -60
  31. package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +17 -8
  32. package/src/components/Quote/Quote.styles.ts +22 -19
  33. package/src/components/Quote/Quote.tsx +6 -3
  34. package/src/components/Quote/QuoteSummary.styles.ts +9 -8
  35. package/src/components/Quote/QuoteSummary.tsx +2 -2
  36. package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +5 -3
  37. package/src/components/SwapDetails/SwapDetails.styles.ts +37 -33
  38. package/src/components/SwapDetails/SwapDetails.tsx +14 -6
  39. package/src/components/SwapsGroup/SwapsGroup.styles.ts +4 -2
  40. package/src/components/SwapsGroup/SwapsGroup.tsx +3 -3
  41. package/src/components/TokenList/TokenList.styles.ts +52 -43
  42. package/src/components/TokenList/TokenList.tsx +13 -5
  43. package/src/pages/ConfirmSwapPage.tsx +24 -19
@@ -1,10 +1,12 @@
1
- import { darkTheme, styled } from '@rango-dev/ui';
1
+ import { css, darkTheme, styled } from '@rango-dev/ui';
2
+
3
+ export const groupStyles = css();
2
4
 
3
5
  export const Group = styled('div', {
4
6
  width: '100%',
5
7
  display: 'flex',
6
8
  flexDirection: 'column',
7
- '.group-title': {
9
+ [`& .${groupStyles}`]: {
8
10
  $$color: '$colors$neutral600',
9
11
  [`.${darkTheme} &`]: {
10
12
  $$color: '$colors$neutral700',
@@ -6,7 +6,7 @@ import React from 'react';
6
6
 
7
7
  import { limitDecimalPlaces } from '../../utils/numbers';
8
8
 
9
- import { Group, SwapList, Time } from './SwapsGroup.styles';
9
+ import { Group, groupStyles, SwapList, Time } from './SwapsGroup.styles';
10
10
 
11
11
  export function SwapsGroup(props: PropTypes) {
12
12
  const { list, onSwapClick, groupBy, isLoading } = props;
@@ -34,7 +34,7 @@ export function SwapsGroup(props: PropTypes) {
34
34
  <Typography
35
35
  variant="label"
36
36
  size="medium"
37
- className="group-title">
37
+ className={groupStyles()}>
38
38
  {i18n.t(group.title)}
39
39
  </Typography>
40
40
  </Time>
@@ -67,7 +67,7 @@ export function SwapsGroup(props: PropTypes) {
67
67
  <Typography
68
68
  variant="label"
69
69
  size="medium"
70
- className="group-title">
70
+ className={groupStyles()}>
71
71
  {i18n.t(group.title)}
72
72
  </Typography>
73
73
  </Time>
@@ -1,4 +1,47 @@
1
- import { darkTheme, styled, Typography } from '@rango-dev/ui';
1
+ import {
2
+ css,
3
+ darkTheme,
4
+ ImageContainer,
5
+ styled,
6
+ Typography,
7
+ } from '@rango-dev/ui';
8
+
9
+ export const tokenNameStyles = css({
10
+ position: 'absolute',
11
+ transform: 'none',
12
+ transition: 'transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms',
13
+ textOverflow: 'ellipsis',
14
+ whiteSpace: 'nowrap',
15
+ maxWidth: 100,
16
+ overflow: 'hidden',
17
+ });
18
+ export const descriptionStyles = css({
19
+ position: 'relative',
20
+ height: 12,
21
+ width: 150,
22
+ });
23
+ export const tokenTitleStyles = css({
24
+ position: 'absolute',
25
+ transform: 'none',
26
+ transition: 'transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms',
27
+ bottom: '-8px',
28
+ });
29
+ export const tokenAddressStyles = css({
30
+ transform: 'translateY(12px)',
31
+ visibility: 'hidden',
32
+ '& a': {
33
+ fontSize: '$12',
34
+ lineHeight: '$16',
35
+ $$color: '$colors$neutral600',
36
+ [`.${darkTheme} &`]: {
37
+ $$color: '$colors$neutral700',
38
+ },
39
+ color: '$$color',
40
+ textDecoration: 'none',
41
+ },
42
+ });
43
+ export const tokenWithoutNameStyles = css({});
44
+ export const usdValueStyles = css();
2
45
 
3
46
  export const Container = styled('div', {
4
47
  display: 'flex',
@@ -23,58 +66,25 @@ export const List = styled('ul', {
23
66
  listStyle: 'none',
24
67
  '& li': {
25
68
  alignItems: 'none',
26
- '.description': {
27
- position: 'relative',
28
- height: 12,
29
- width: 150,
30
- '.token-title': {
31
- position: 'absolute',
32
- transform: 'none',
33
- transition: 'transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms',
34
- bottom: '-8px',
35
- },
36
69
 
37
- '.token-address': {
38
- transform: 'translateY(12px)',
39
- visibility: 'hidden',
40
- '& a': {
41
- fontSize: '$12',
42
- lineHeight: '$16',
43
- $$color: '$colors$neutral600',
44
- [`.${darkTheme} &`]: {
45
- $$color: '$colors$neutral700',
46
- },
47
- color: '$$color',
48
- textDecoration: 'none',
49
- },
50
- },
51
- '.token-name': {
52
- position: 'absolute',
53
- transform: 'none',
54
- transition: 'transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms',
55
- textOverflow: 'ellipsis',
56
- whiteSpace: 'nowrap',
57
- maxWidth: 100,
58
- overflow: 'hidden',
59
- },
60
- },
61
70
  '&:hover': {
62
- '.description': {
63
- '.token-address': {
71
+ [`& .${descriptionStyles}`]: {
72
+ [`& .${tokenAddressStyles}`]: {
64
73
  position: 'absolute',
65
74
  transform: 'none',
66
75
  transition: 'transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms',
67
76
  visibility: 'visible',
68
77
  },
69
- '.token-address-without-name': {
78
+
79
+ [`& .${tokenWithoutNameStyles}`]: {
70
80
  bottom: '-15px',
71
81
  },
72
- '.token-name': {
82
+ [`& .${tokenNameStyles}`]: {
73
83
  position: 'absolute',
74
84
  transform: 'translateY(-12px)',
75
85
  visibility: 'hidden',
76
86
  },
77
- '.token-title': {
87
+ [`& .${tokenTitleStyles}`]: {
78
88
  position: 'absolute',
79
89
  transform: 'translateY(-12px)',
80
90
  bottom: '-10px',
@@ -96,8 +106,7 @@ export const TagTitle = styled(Typography, {});
96
106
 
97
107
  export const BalanceContainer = styled('div', {
98
108
  textAlign: 'right',
99
-
100
- '.usd-value': {
109
+ [`& .${usdValueStyles}`]: {
101
110
  $$color: '$colors$neutral600',
102
111
  [`.${darkTheme} &`]: {
103
112
  $$color: '$colors$neutral700',
@@ -118,7 +127,7 @@ export const Description = styled('div', {
118
127
  });
119
128
  export const ImageSection = styled('div', {
120
129
  position: 'relative',
121
- '.image-container': {
130
+ [`& ${ImageContainer}`]: {
122
131
  borderRadius: '$xm',
123
132
  overflow: 'hidden',
124
133
  },
@@ -27,6 +27,7 @@ import { LoadingTokenList } from './LoadingTokenList';
27
27
  import {
28
28
  BalanceContainer,
29
29
  Container,
30
+ descriptionStyles,
30
31
  End,
31
32
  ImageSection,
32
33
  List,
@@ -34,6 +35,11 @@ import {
34
35
  Tag,
35
36
  TagTitle,
36
37
  Title,
38
+ tokenAddressStyles,
39
+ tokenNameStyles,
40
+ tokenTitleStyles,
41
+ tokenWithoutNameStyles,
42
+ usdValueStyles,
37
43
  } from './TokenList.styles';
38
44
 
39
45
  const PAGE_SIZE = 20;
@@ -44,11 +50,11 @@ const renderDesc = (props: RenderDescProps) => {
44
50
  const length = address.length;
45
51
 
46
52
  return (
47
- <div className="description">
53
+ <div className={descriptionStyles()}>
48
54
  {name ? (
49
- <div className="token-name">{name}</div>
55
+ <div className={tokenNameStyles()}>{name}</div>
50
56
  ) : (
51
- <Title className="token-title">
57
+ <Title className={tokenTitleStyles()}>
52
58
  <Typography variant="title" size="xmedium">
53
59
  {token.symbol}
54
60
  </Typography>
@@ -63,7 +69,9 @@ const renderDesc = (props: RenderDescProps) => {
63
69
 
64
70
  {!!address && (
65
71
  <div
66
- className={`token-address ${!name && 'token-address-without-name'}`}>
72
+ className={`${tokenAddressStyles()} ${
73
+ !name && tokenWithoutNameStyles()
74
+ }`}>
67
75
  <a
68
76
  href={url}
69
77
  target="_blank"
@@ -236,7 +244,7 @@ export function TokenList(props: PropTypes) {
236
244
  {tokenBalance.usdValue && (
237
245
  <Typography
238
246
  variant="body"
239
- className="usd-value"
247
+ className={usdValueStyles()}
240
248
  size="xsmall">
241
249
  {`$${tokenBalance.usdValue}`}
242
250
  </Typography>
@@ -9,6 +9,7 @@ import { useManager } from '@rango-dev/queue-manager-react';
9
9
  import {
10
10
  Alert,
11
11
  Button,
12
+ css,
12
13
  Divider,
13
14
  IconButton,
14
15
  RefreshIcon,
@@ -40,18 +41,7 @@ import { getContainer } from '../utils/common';
40
41
  const Container = styled('div', {
41
42
  position: 'relative',
42
43
  width: '100%',
43
- '& .description': {
44
- display: 'flex',
45
- justifyContent: 'space-between',
46
- alignItems: 'center',
47
- },
48
- '& .icon': {
49
- width: '$24',
50
- height: '$24',
51
- display: 'flex',
52
- justifyContent: 'center',
53
- alignItems: 'center',
54
- },
44
+
55
45
  '& .quote-update__alert': {
56
46
  paddingTop: '$10',
57
47
  },
@@ -61,16 +51,31 @@ const Buttons = styled('div', {
61
51
  width: '100%',
62
52
  display: 'flex',
63
53
  justifyContent: 'space-between',
64
- '& .confirm-button': {
65
- flexGrow: 1,
66
- paddingRight: '$10',
67
- },
68
54
  [`& ${IconButton}`]: {
69
55
  width: '$48',
70
56
  height: '$48',
71
57
  },
72
58
  });
73
59
 
60
+ const confirmBtnStyles = css({
61
+ flexGrow: 1,
62
+ paddingRight: '$10',
63
+ });
64
+
65
+ const iconStyles = css({
66
+ width: '$24',
67
+ height: '$24',
68
+ display: 'flex',
69
+ justifyContent: 'center',
70
+ alignItems: 'center',
71
+ });
72
+
73
+ const descriptionStyles = css({
74
+ display: 'flex',
75
+ justifyContent: 'space-between',
76
+ alignItems: 'center',
77
+ });
78
+
74
79
  export function ConfirmSwapPage() {
75
80
  //TODO: move component's logics to a custom hook
76
81
  const {
@@ -282,7 +287,7 @@ export function ConfirmSwapPage() {
282
287
  }}
283
288
  footer={
284
289
  <Buttons>
285
- <div className="confirm-button">
290
+ <div className={confirmBtnStyles()}>
286
291
  <Button
287
292
  variant="contained"
288
293
  type="primary"
@@ -315,7 +320,7 @@ export function ConfirmSwapPage() {
315
320
  )}
316
321
 
317
322
  <Container>
318
- <div className="description">
323
+ <div className={descriptionStyles()}>
319
324
  <Typography variant="title" size="small">
320
325
  {i18n.t('You get')}
321
326
  </Typography>
@@ -324,7 +329,7 @@ export function ConfirmSwapPage() {
324
329
  variant="ghost"
325
330
  disabled={fetchingConfirmationQuote}
326
331
  onClick={onRefresh}>
327
- <div className="icon">
332
+ <div className={iconStyles()}>
328
333
  <RefreshIcon size={16} />
329
334
  </div>
330
335
  </Button>