@rango-dev/ui 0.45.1-next.8 → 0.46.0

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 (53) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/index.js.map +3 -3
  3. package/dist/translations/af.d.ts.map +1 -1
  4. package/dist/translations/ar.d.ts.map +1 -1
  5. package/dist/translations/bn.d.ts.map +1 -1
  6. package/dist/translations/ca.d.ts.map +1 -1
  7. package/dist/translations/da.d.ts.map +1 -1
  8. package/dist/translations/de.d.ts.map +1 -1
  9. package/dist/translations/el.d.ts.map +1 -1
  10. package/dist/translations/en.d.ts.map +1 -1
  11. package/dist/translations/es.d.ts.map +1 -1
  12. package/dist/translations/fi.d.ts.map +1 -1
  13. package/dist/translations/fil.d.ts.map +1 -1
  14. package/dist/translations/fr.d.ts.map +1 -1
  15. package/dist/translations/hi.d.ts.map +1 -1
  16. package/dist/translations/hu.d.ts.map +1 -1
  17. package/dist/translations/id.d.ts.map +1 -1
  18. package/dist/translations/it.d.ts.map +1 -1
  19. package/dist/translations/ja.d.ts.map +1 -1
  20. package/dist/translations/ko.d.ts.map +1 -1
  21. package/dist/translations/lt.d.ts.map +1 -1
  22. package/dist/translations/ms.d.ts.map +1 -1
  23. package/dist/translations/nl.d.ts.map +1 -1
  24. package/dist/translations/pl.d.ts.map +1 -1
  25. package/dist/translations/pt.d.ts.map +1 -1
  26. package/dist/translations/ru.d.ts.map +1 -1
  27. package/dist/translations/sk.d.ts.map +1 -1
  28. package/dist/translations/sr.d.ts.map +1 -1
  29. package/dist/translations/sv.d.ts.map +1 -1
  30. package/dist/translations/sw.d.ts.map +1 -1
  31. package/dist/translations/th.d.ts.map +1 -1
  32. package/dist/translations/tr.d.ts.map +1 -1
  33. package/dist/translations/uk.d.ts.map +1 -1
  34. package/dist/translations/ur.d.ts.map +1 -1
  35. package/dist/translations/vi.d.ts.map +1 -1
  36. package/dist/translations/zh-CN.d.ts.map +1 -1
  37. package/dist/translations/zh-TW.d.ts.map +1 -1
  38. package/dist/ui.build.json +1 -1
  39. package/dist/widget/ui/src/components/Modal/Modal.styles.d.ts.map +1 -1
  40. package/dist/widget/ui/src/components/StepDetails/StepDetails.d.ts.map +1 -1
  41. package/dist/widget/ui/src/containers/SwapInput/SwapInput.d.ts.map +1 -1
  42. package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts +160 -0
  43. package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts.map +1 -1
  44. package/dist/widget/ui/src/containers/SwapInput/TokenSection.d.ts.map +1 -1
  45. package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts +322 -0
  46. package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts.map +1 -1
  47. package/package.json +3 -3
  48. package/src/components/Modal/Modal.styles.ts +1 -0
  49. package/src/components/StepDetails/StepDetails.tsx +5 -3
  50. package/src/containers/SwapInput/SwapInput.styles.ts +4 -0
  51. package/src/containers/SwapInput/SwapInput.tsx +19 -16
  52. package/src/containers/SwapInput/TokenSection.styles.ts +37 -4
  53. package/src/containers/SwapInput/TokenSection.tsx +29 -5
@@ -1,11 +1,15 @@
1
1
  import { ChainImageContainer } from '../../components/ChainToken/ChainToken.styles.js';
2
- import { Button } from '../../components/index.js';
2
+ import {
3
+ Button,
4
+ type TooltipPropTypes,
5
+ Typography,
6
+ } from '../../components/index.js';
3
7
  import { css, darkTheme, styled } from '../../theme.js';
4
8
 
5
9
  export const Container = styled(Button, {
10
+ width: '100%',
6
11
  maxWidth: '180px',
7
12
  minWidth: '130px',
8
- flexGrow: 1,
9
13
  backgroundColor: 'transparent',
10
14
  borderRadius: '$xs',
11
15
 
@@ -39,11 +43,16 @@ export const Container = styled(Button, {
39
43
  backgroundColor: '$$color !important',
40
44
  },
41
45
  },
46
+
47
+ '& > span': {
48
+ width: '100%',
49
+ },
42
50
  });
43
51
 
44
52
  export const chainNameStyles = css();
45
53
 
46
54
  export const TokenSectionContainer = styled('div', {
55
+ width: '100%',
47
56
  maxWidth: '170px',
48
57
  padding: '$2 $5',
49
58
  display: 'flex',
@@ -68,6 +77,8 @@ export const tokenChainStyles = css({
68
77
  paddingLeft: '$10',
69
78
  flexGrow: 1,
70
79
  textAlign: 'left',
80
+ width: '100%',
81
+ overflow: 'hidden',
71
82
  });
72
83
 
73
84
  export const skeletonStyles = css({
@@ -76,8 +87,30 @@ export const skeletonStyles = css({
76
87
  });
77
88
 
78
89
  export const TitleContainer = styled('div', {
90
+ width: '100%',
79
91
  display: 'flex',
80
- justifyContent: 'center',
81
92
  alignItems: 'center',
82
- flexWrap: 'wrap',
93
+ });
94
+
95
+ export const Title = styled(Typography, {
96
+ overflow: 'hidden',
97
+ textOverflow: 'ellipsis',
98
+ whiteSpace: 'nowrap',
99
+ });
100
+
101
+ export const SymbolTooltipStyles: TooltipPropTypes['styles'] = {
102
+ content: {
103
+ padding: '$10',
104
+ },
105
+ root: {
106
+ zIndex: 10,
107
+ maxWidth: 'calc(100% - 18px)',
108
+ display: 'flex',
109
+ justifyContent: 'start',
110
+ },
111
+ };
112
+
113
+ export const SymbolTooltipContent = styled(Typography, {
114
+ maxWidth: 217,
115
+ lineBreak: 'anywhere',
83
116
  });
@@ -8,6 +8,7 @@ import {
8
8
  ChainToken,
9
9
  Divider,
10
10
  Skeleton,
11
+ Tooltip,
11
12
  Typography,
12
13
  } from '../../components/index.js';
13
14
 
@@ -15,6 +16,9 @@ import {
15
16
  chainNameStyles,
16
17
  Container,
17
18
  skeletonStyles,
19
+ SymbolTooltipContent,
20
+ SymbolTooltipStyles,
21
+ Title,
18
22
  TitleContainer,
19
23
  tokenChainStyles,
20
24
  TokenSectionContainer,
@@ -33,6 +37,9 @@ export function TokenSection(props: TokenSectionProps) {
33
37
  warning,
34
38
  tooltipContainer,
35
39
  } = props;
40
+
41
+ const tokenSelected = !error && !loading && !!tokenSymbol;
42
+
36
43
  return (
37
44
  <Container variant="default" disabled={error || loading} onClick={onClick}>
38
45
  <TokenSectionContainer>
@@ -54,11 +61,28 @@ export function TokenSection(props: TokenSectionProps) {
54
61
  ) : (
55
62
  <>
56
63
  <TitleContainer>
57
- <Typography variant="title" size="medium">
58
- {error || (!loading && !tokenSymbol)
59
- ? i18n.t('Select Token')
60
- : tokenSymbol}
61
- </Typography>
64
+ {tokenSelected ? (
65
+ <Tooltip
66
+ styles={SymbolTooltipStyles}
67
+ align="start"
68
+ side="bottom"
69
+ alignOffset={-15}
70
+ sideOffset={15}
71
+ container={tooltipContainer}
72
+ content={
73
+ <SymbolTooltipContent variant="body" size="xsmall">
74
+ {tokenSymbol}
75
+ </SymbolTooltipContent>
76
+ }>
77
+ <Title variant="title" size="medium">
78
+ {tokenSymbol}
79
+ </Title>
80
+ </Tooltip>
81
+ ) : (
82
+ <Typography variant="title" size="medium">
83
+ {i18n.t('Select Token')}
84
+ </Typography>
85
+ )}
62
86
  {warning && (
63
87
  <>
64
88
  <Divider size={4} direction="horizontal" />