@rango-dev/ui 0.22.1-next.19 → 0.22.1-next.20

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/index.js +6 -6
  2. package/dist/index.js.map +3 -3
  3. package/dist/translations/en.d.ts.map +1 -1
  4. package/dist/translations/es.d.ts.map +1 -1
  5. package/dist/translations/fr.d.ts.map +1 -1
  6. package/dist/translations/ja.d.ts.map +1 -1
  7. package/dist/widget/ui/src/components/Button/Button.styles.d.ts.map +1 -1
  8. package/dist/widget/ui/src/components/ListItem/ListItem.styles.d.ts.map +1 -1
  9. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts.map +1 -1
  10. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts +158 -0
  11. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts.map +1 -1
  12. package/dist/widget/ui/src/components/Skeleton/Skeleton.d.ts.map +1 -1
  13. package/dist/widget/ui/src/components/Skeleton/Skeleton.types.d.ts +1 -1
  14. package/dist/widget/ui/src/components/Skeleton/Skeleton.types.d.ts.map +1 -1
  15. package/dist/widget/ui/src/components/Switch/Switch.styles.d.ts.map +1 -1
  16. package/dist/widget/ui/src/components/TextField/TextField.d.ts.map +1 -1
  17. package/dist/widget/ui/src/components/Tooltip/Tooltip.d.ts.map +1 -1
  18. package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts +2 -2
  19. package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts.map +1 -1
  20. package/dist/widget/ui/src/containers/SwapInput/SwapInput.d.ts.map +1 -1
  21. package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts +158 -0
  22. package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts.map +1 -1
  23. package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts +1 -0
  24. package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts.map +1 -1
  25. package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts.map +1 -1
  26. package/package.json +1 -1
  27. package/src/components/Button/Button.styles.tsx +1 -0
  28. package/src/components/ListItem/ListItem.styles.ts +2 -0
  29. package/src/components/ListItemButton/ListItemButton.styles.ts +1 -0
  30. package/src/components/PriceImpact/PriceImpact.styles.ts +9 -1
  31. package/src/components/PriceImpact/PriceImpact.tsx +3 -3
  32. package/src/components/Skeleton/Skeleton.tsx +3 -2
  33. package/src/components/Skeleton/Skeleton.types.ts +1 -1
  34. package/src/components/Switch/Switch.styles.tsx +3 -5
  35. package/src/components/TextField/TextField.tsx +3 -5
  36. package/src/components/Tooltip/Tooltip.styles.ts +8 -5
  37. package/src/components/Tooltip/Tooltip.tsx +2 -3
  38. package/src/components/Wallet/Wallet.styles.ts +1 -1
  39. package/src/containers/SwapInput/SwapInput.styles.ts +14 -3
  40. package/src/containers/SwapInput/SwapInput.tsx +11 -6
  41. package/src/containers/SwapInput/SwapInput.types.ts +1 -0
  42. package/src/containers/SwapInput/TokenSection.styles.ts +5 -1
  43. package/src/containers/SwapInput/TokenSection.tsx +2 -2
@@ -23,9 +23,7 @@ function TextFieldComponent(props: PropsWithChildren<PropTypes>, ref?: Ref) {
23
23
  <>
24
24
  {label && (
25
25
  <>
26
- <Label
27
- className="_text"
28
- {...(inputAttributes.id && { htmlFor: inputAttributes.id })}>
26
+ <Label {...(inputAttributes.id && { htmlFor: inputAttributes.id })}>
29
27
  <Typography variant="label" size="large">
30
28
  {label}
31
29
  </Typography>
@@ -39,10 +37,9 @@ function TextFieldComponent(props: PropsWithChildren<PropTypes>, ref?: Ref) {
39
37
  variant={variant}
40
38
  size={size}
41
39
  style={style}
42
- className="_text">
40
+ className="_text-field">
43
41
  {prefix || null}
44
42
  <Input
45
- className="_text"
46
43
  {...inputAttributes}
47
44
  spellCheck={false}
48
45
  suffix={!!suffix}
@@ -56,5 +53,6 @@ function TextFieldComponent(props: PropsWithChildren<PropTypes>, ref?: Ref) {
56
53
 
57
54
  const TextField = React.forwardRef(TextFieldComponent);
58
55
  TextField.displayName = 'TextField';
56
+ TextField.toString = () => '._text-field';
59
57
 
60
58
  export { TextField };
@@ -7,13 +7,16 @@ export const TooltipContent = styled(RadixTooltip.Content, {
7
7
  zIndex: '999999',
8
8
  });
9
9
 
10
- export const TooltipArrow = styled(RadixTooltip.Arrow, {
11
- fill: '$neutral100',
12
- });
13
-
14
10
  export const TooltipTypography = styled(Typography, {
15
11
  borderRadius: '$md',
16
12
  padding: '$5 $10',
17
- boxShadow: '5px 5px 10px 0px rgba(0, 0, 0, 0.10)',
13
+ boxShadow:
14
+ 'inset 0 0 0.5px 1px rgba(255, 255, 255, 0.075), 0 0 0 1px rgba(0, 0, 0, 0.05), 0 0.3px 0.4px rgba(0, 0, 0, 0.02), 0.9px 1.5px rgba(0, 0, 0, 0.045), 0 3.5px 6px rgba(0, 0, 0, 0.09)',
18
15
  backgroundColor: '$neutral100',
19
16
  });
17
+
18
+ export const TriggerContent = styled('div', {
19
+ display: 'flex',
20
+ justifyContent: 'center',
21
+ alignItems: 'center',
22
+ });
@@ -5,9 +5,9 @@ import * as RadixTooltip from '@radix-ui/react-tooltip';
5
5
  import React from 'react';
6
6
 
7
7
  import {
8
- TooltipArrow,
9
8
  TooltipContent,
10
9
  TooltipTypography,
10
+ TriggerContent,
11
11
  } from './Tooltip.styles';
12
12
 
13
13
  export function Tooltip(props: PropsWithChildren<PropTypes>) {
@@ -24,14 +24,13 @@ export function Tooltip(props: PropsWithChildren<PropTypes>) {
24
24
  <RadixTooltip.Provider delayDuration={0}>
25
25
  <RadixTooltip.Root open={open}>
26
26
  <RadixTooltip.Trigger asChild>
27
- <div>{children}</div>
27
+ <TriggerContent>{children}</TriggerContent>
28
28
  </RadixTooltip.Trigger>
29
29
  <RadixTooltip.Portal container={container}>
30
30
  <TooltipContent side={side} sideOffset={sideOffset}>
31
31
  <TooltipTypography variant="label" size="medium" color={color}>
32
32
  {content}
33
33
  </TooltipTypography>
34
- <TooltipArrow />
35
34
  </TooltipContent>
36
35
  </RadixTooltip.Portal>
37
36
  </RadixTooltip.Root>
@@ -30,7 +30,7 @@ export const WalletButton = styled('button', {
30
30
  backgroundColor: '$$color',
31
31
  alignItems: 'center',
32
32
  cursor: 'pointer',
33
- width: 110,
33
+ width: 100,
34
34
  position: 'relative',
35
35
  fontFamily: 'inherit',
36
36
  '&:hover': {
@@ -1,4 +1,4 @@
1
- import { Button, TextField } from '../../components';
1
+ import { Button, TextField, Typography } from '../../components';
2
2
  import { css, darkTheme, styled } from '../../theme';
3
3
 
4
4
  export const textStyles = css();
@@ -29,12 +29,12 @@ export const Container = styled('div', {
29
29
  });
30
30
 
31
31
  export const InputAmount = styled(TextField, {
32
+ width: '100%',
32
33
  padding: '0',
33
34
  fontSize: '$18',
34
35
  lineHeight: '$26',
35
36
  fontWeight: '$medium',
36
37
  textAlign: 'right',
37
- width: 140,
38
38
  '&:disabled': {
39
39
  cursor: 'unset',
40
40
  },
@@ -48,7 +48,8 @@ export const MaxButton = styled(Button, {
48
48
  });
49
49
 
50
50
  export const ValueTypography = styled('div', {
51
- width: 140,
51
+ display: 'flex',
52
+ width: '100%',
52
53
  textAlign: 'right',
53
54
  whiteSpace: 'nowrap',
54
55
  overflow: 'hidden',
@@ -92,6 +93,8 @@ export const balanceStyles = css({
92
93
  });
93
94
 
94
95
  export const amountStyles = css({
96
+ width: '45%',
97
+ maxWidth: '170px',
95
98
  display: 'flex',
96
99
  flexDirection: 'column',
97
100
  justifyContent: 'center',
@@ -102,3 +105,11 @@ export const amountStyles = css({
102
105
  export const labelContainerStyles = css({
103
106
  paddingBottom: '$5',
104
107
  });
108
+
109
+ export const UsdPrice = styled(Typography, {
110
+ width: '100%',
111
+ textAlign: 'right',
112
+ whiteSpace: 'nowrap',
113
+ overflow: 'hidden',
114
+ textOverflow: 'ellipsis',
115
+ });
@@ -15,11 +15,16 @@ import {
15
15
  labelStyles,
16
16
  MaxButton,
17
17
  textStyles,
18
+ UsdPrice,
18
19
  ValueTypography,
19
20
  } from './SwapInput.styles';
20
21
  import { TokenSection } from './TokenSection';
21
22
 
22
23
  export function SwapInput(props: SwapInputProps) {
24
+ const showBalance =
25
+ 'balance' in props && !props.loading && !props.loadingBalance;
26
+ const showBalanceSkeleton =
27
+ 'balance' in props && (props.loading || props.loadingBalance);
23
28
  return (
24
29
  <Container sharpBottomStyle={props.sharpBottomStyle}>
25
30
  <div className={labelContainerStyles()}>
@@ -27,7 +32,7 @@ export function SwapInput(props: SwapInputProps) {
27
32
  <Typography variant="body" size="small" className={textStyles()}>
28
33
  {props.label}
29
34
  </Typography>
30
- {'balance' in props && !props.loading && (
35
+ {showBalance && (
31
36
  <div className={balanceStyles()}>
32
37
  <Typography
33
38
  className={textStyles()}
@@ -46,7 +51,7 @@ export function SwapInput(props: SwapInputProps) {
46
51
  </MaxButton>
47
52
  </div>
48
53
  )}
49
- {props.loading && (
54
+ {showBalanceSkeleton && (
50
55
  <div className={balanceStyles()}>
51
56
  <Skeleton variant="text" size="large" width={105} />
52
57
  </div>
@@ -66,9 +71,9 @@ export function SwapInput(props: SwapInputProps) {
66
71
  <div className={amountStyles()}>
67
72
  {props.loading || (props.mode === 'To' && props.fetchingQuote) ? (
68
73
  <>
69
- <Skeleton variant="text" size="large" width={92} />
74
+ <Skeleton variant="text" size="large" />
70
75
  <Divider size={8} />
71
- <Skeleton variant="text" size="medium" width={92} />
76
+ <Skeleton variant="text" size="medium" />
72
77
  </>
73
78
  ) : (
74
79
  <>
@@ -96,11 +101,11 @@ export function SwapInput(props: SwapInputProps) {
96
101
  />
97
102
  ) : (
98
103
  <ValueTypography hasWarning={!!props.price.error}>
99
- <Typography variant="body" size="medium">
104
+ <UsdPrice variant="body" size="medium">
100
105
  {props.price.usdValue
101
106
  ? `~$${props.price.usdValue}`
102
107
  : props.price.error}
103
- </Typography>
108
+ </UsdPrice>
104
109
  </ValueTypography>
105
110
  )}
106
111
  </>
@@ -25,6 +25,7 @@ export type BaseProps = {
25
25
  type FromProps = {
26
26
  mode: 'From';
27
27
  balance?: string;
28
+ loadingBalance: boolean;
28
29
  onSelectMaxBalance: () => void;
29
30
  onInputChange: (inputAmount: string) => void;
30
31
  };
@@ -3,6 +3,8 @@ import { css, darkTheme, styled } from '../../theme';
3
3
 
4
4
  export const Container = styled(Button, {
5
5
  maxWidth: '180px',
6
+ minWidth: '130px',
7
+ flexGrow: 1,
6
8
  backgroundColor: 'transparent',
7
9
  color: '$neutral700',
8
10
  '&:disabled': {
@@ -31,7 +33,7 @@ export const Container = styled(Button, {
31
33
  export const chainNameStyles = css();
32
34
 
33
35
  export const TokenSectionContainer = styled('div', {
34
- width: '10.625rem',
36
+ maxWidth: '170px',
35
37
  padding: '$2 $5',
36
38
  display: 'flex',
37
39
  borderRadius: '$xs',
@@ -53,8 +55,10 @@ export const tokenChainStyles = css({
53
55
  justifyContent: 'center',
54
56
  alignItems: 'start',
55
57
  paddingLeft: '$10',
58
+ flexGrow: 1,
56
59
  });
57
60
 
58
61
  export const skeletonStyles = css({
62
+ width: '100%',
59
63
  padding: '$5 $0',
60
64
  });
@@ -36,9 +36,9 @@ export function TokenSection(props: TokenSectionProps) {
36
36
  <div className={tokenChainStyles()}>
37
37
  {loading ? (
38
38
  <div className={skeletonStyles()}>
39
- <Skeleton variant="text" size="large" width={92} />
39
+ <Skeleton variant="text" size="large" />
40
40
  <Divider size={8} />
41
- <Skeleton variant="text" size="medium" width={92} />
41
+ <Skeleton variant="text" size="medium" />
42
42
  </div>
43
43
  ) : (
44
44
  <>