@rango-dev/ui 0.15.1-next.7 → 0.15.1-next.8

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 (36) hide show
  1. package/dist/index.js +6 -6
  2. package/dist/index.js.map +4 -4
  3. package/dist/widget/ui/src/components/BestRoute/BestRoute.d.ts.map +1 -1
  4. package/dist/widget/ui/src/components/BestRoute/BestRoute.styles.d.ts.map +1 -1
  5. package/dist/widget/ui/src/components/BestRoute/RouteSummary.d.ts +12 -0
  6. package/dist/widget/ui/src/components/BestRoute/RouteSummary.d.ts.map +1 -0
  7. package/dist/widget/ui/src/components/BestRoute/RouteSummary.styles.d.ts +149 -0
  8. package/dist/widget/ui/src/components/BestRoute/RouteSummary.styles.d.ts.map +1 -0
  9. package/dist/widget/ui/src/components/BestRoute/index.d.ts +1 -0
  10. package/dist/widget/ui/src/components/BestRoute/index.d.ts.map +1 -1
  11. package/dist/widget/ui/src/components/Modal/Modal.d.ts.map +1 -1
  12. package/dist/widget/ui/src/components/Tooltip/Tooltip.d.ts +1 -1
  13. package/dist/widget/ui/src/components/Tooltip/Tooltip.d.ts.map +1 -1
  14. package/dist/widget/ui/src/components/Tooltip/Tooltip.types.d.ts +7 -2
  15. package/dist/widget/ui/src/components/Tooltip/Tooltip.types.d.ts.map +1 -1
  16. package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts.map +1 -1
  17. package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts.map +1 -1
  18. package/dist/widget/ui/src/hooks/usePaddingRight.d.ts +2 -1
  19. package/dist/widget/ui/src/hooks/usePaddingRight.d.ts.map +1 -1
  20. package/package.json +1 -1
  21. package/src/components/BestRoute/BestRoute.styles.ts +4 -5
  22. package/src/components/BestRoute/BestRoute.tsx +10 -32
  23. package/src/components/BestRoute/BestRouteSkeleton.styles.ts +1 -1
  24. package/src/components/BestRoute/RouteSummary.styles.ts +15 -0
  25. package/src/components/BestRoute/RouteSummary.tsx +48 -0
  26. package/src/components/BestRoute/index.ts +1 -0
  27. package/src/components/Modal/Modal.tsx +2 -4
  28. package/src/components/TokenAmount/TokenAmount.tsx +3 -3
  29. package/src/components/Tooltip/Tooltip.tsx +20 -45
  30. package/src/components/Tooltip/Tooltip.types.ts +7 -2
  31. package/src/components/Wallet/ClickableWallet.tsx +1 -1
  32. package/src/containers/SwapInput/SwapInput.styles.ts +3 -0
  33. package/src/containers/SwapInput/SwapInput.tsx +1 -1
  34. package/src/containers/SwapInput/TokenSection.styles.ts +3 -0
  35. package/src/containers/SwapInput/TokenSection.tsx +3 -3
  36. package/src/hooks/usePaddingRight.ts +17 -14
@@ -1 +1 @@
1
- {"version":3,"file":"BestRoute.d.ts","sourceRoot":"","sources":["../../../../../../src/components/BestRoute/BestRoute.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,KAA4C,MAAM,OAAO,CAAC;AAuBjE,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,qBAqK9C"}
1
+ {"version":3,"file":"BestRoute.d.ts","sourceRoot":"","sources":["../../../../../../src/components/BestRoute/BestRoute.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,KAA4C,MAAM,OAAO,CAAC;AAuBjE,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,qBA+I9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"BestRoute.styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/BestRoute/BestRoute.styles.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAK3D,eAAO,MAAM,qCAAqC,MAAM,CAAC;AAEzD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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S;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAMpB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { Step } from './BestRoute.types';
2
+ import type { PriceImpactWarningLevel } from '../PriceImpact';
3
+ import React from 'react';
4
+ type PropTypes = {
5
+ from: Step['from'];
6
+ to: Step['to'];
7
+ percentageChange?: string | null;
8
+ warningLevel: PriceImpactWarningLevel;
9
+ };
10
+ export declare function RouteSummary(props: PropTypes): React.JSX.Element;
11
+ export {};
12
+ //# sourceMappingURL=RouteSummary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RouteSummary.d.ts","sourceRoot":"","sources":["../../../../../../src/components/BestRoute/RouteSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAE9D,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACnB,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,YAAY,EAAE,uBAAuB,CAAC;CACvC,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,qBA+B5C"}
@@ -0,0 +1,149 @@
1
+ export declare const Container: import("@stitches/react/types/styled-component").StyledComponent<"div", {}, {
2
+ sm: string;
3
+ md: string;
4
+ lg: string;
5
+ }, import("@stitches/react/types/css-util").CSS<{
6
+ sm: string;
7
+ md: string;
8
+ lg: string;
9
+ }, {
10
+ colors: {
11
+ primary500: string;
12
+ primary600: string;
13
+ secondary100: string;
14
+ secondary200: string;
15
+ secondary300: string;
16
+ secondary400: string;
17
+ secondary500: string;
18
+ secondary600: string;
19
+ secondary700: string;
20
+ secondary800: string;
21
+ secondary900: string;
22
+ neutral100: string;
23
+ neutral200: string;
24
+ neutral300: string;
25
+ neutral400: string;
26
+ neutral500: string;
27
+ neutral600: string;
28
+ neutral700: string;
29
+ neutral800: string;
30
+ neutral900: string;
31
+ error100: string;
32
+ error300: string;
33
+ error500: string;
34
+ error600: string;
35
+ error700: string;
36
+ warning100: string;
37
+ warning300: string;
38
+ warning500: string;
39
+ warning600: string;
40
+ warning700: string;
41
+ info100: string;
42
+ info300: string;
43
+ info500: string;
44
+ info600: string;
45
+ info700: string;
46
+ success100: string;
47
+ success300: string;
48
+ success500: string;
49
+ success600: string;
50
+ success700: string;
51
+ background: string;
52
+ foreground: string;
53
+ };
54
+ space: {
55
+ 0: string;
56
+ 5: string;
57
+ 10: string;
58
+ 15: string;
59
+ 20: string;
60
+ 25: string;
61
+ 30: string;
62
+ 40: string;
63
+ 46: string;
64
+ 50: string;
65
+ 60: string;
66
+ 70: string;
67
+ 80: string;
68
+ 90: string;
69
+ 100: string;
70
+ 2: string;
71
+ 4: string;
72
+ 6: string;
73
+ 8: string;
74
+ 12: string;
75
+ 16: string;
76
+ 24: string;
77
+ 28: string;
78
+ 32: string;
79
+ };
80
+ radii: {
81
+ xs: string;
82
+ sm: string;
83
+ xm: string;
84
+ md: string;
85
+ xl: string;
86
+ lg: string;
87
+ };
88
+ fontSizes: {
89
+ 10: string;
90
+ 12: string;
91
+ 14: string;
92
+ 16: string;
93
+ 18: string;
94
+ 20: string;
95
+ 22: string;
96
+ 24: string;
97
+ 28: string;
98
+ 32: string;
99
+ 36: string;
100
+ 40: string;
101
+ 48: string;
102
+ };
103
+ fonts: {};
104
+ fontWeights: {
105
+ regular: number;
106
+ medium: number;
107
+ semiBold: number;
108
+ bold: number;
109
+ };
110
+ lineHeights: {
111
+ 12: string;
112
+ 16: string;
113
+ 20: string;
114
+ 24: string;
115
+ 26: string;
116
+ 28: string;
117
+ 30: string;
118
+ 36: string;
119
+ 40: string;
120
+ 44: string;
121
+ 52: string;
122
+ 64: string;
123
+ };
124
+ letterSpacings: {};
125
+ sizes: {
126
+ 4: string;
127
+ 6: string;
128
+ 8: string;
129
+ 12: string;
130
+ 16: string;
131
+ 18: string;
132
+ 20: string;
133
+ 24: string;
134
+ 28: string;
135
+ 32: string;
136
+ 36: string;
137
+ 40: string;
138
+ 45: string;
139
+ 48: string;
140
+ };
141
+ borderWidths: {};
142
+ borderStyles: {};
143
+ shadows: {
144
+ s: string;
145
+ };
146
+ zIndices: {};
147
+ transitions: {};
148
+ }, import("@stitches/react/types/config").DefaultThemeMap, {}>>;
149
+ //# sourceMappingURL=RouteSummary.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RouteSummary.styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/BestRoute/RouteSummary.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAYpB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export { BestRoute } from './BestRoute';
2
2
  export type { Step } from './BestRoute.types';
3
3
  export { BestRouteSkeleton } from './BestRouteSkeleton';
4
+ export { RouteSummary } from './RouteSummary';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/BestRoute/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/BestRoute/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAsC,MAAM,OAAO,CAAC;AAwB3D,wBAAgB,KAAK,CAAC,KAAK,EAAE,iBAAiB,CAAC,SAAS,CAAC,qBA2GxD"}
1
+ {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAsC,MAAM,OAAO,CAAC;AAwB3D,wBAAgB,KAAK,CAAC,KAAK,EAAE,iBAAiB,CAAC,SAAS,CAAC,qBAyGxD"}
@@ -1,5 +1,5 @@
1
1
  import type { PropTypes } from './Tooltip.types';
2
2
  import type { PropsWithChildren } from 'react';
3
3
  import React from 'react';
4
- export declare function Tooltip({ children, content, side, color, }: PropsWithChildren<PropTypes>): React.JSX.Element;
4
+ export declare function Tooltip(props: PropsWithChildren<PropTypes>): React.JSX.Element;
5
5
  //# sourceMappingURL=Tooltip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG/C,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,OAAO,EACP,IAAY,EACZ,KAAK,GACN,EAAE,iBAAiB,CAAC,SAAS,CAAC,qBA4C9B"}
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,wBAAgB,OAAO,CAAC,KAAK,EAAE,iBAAiB,CAAC,SAAS,CAAC,qBAyB1D"}
@@ -1,7 +1,12 @@
1
- import type { ReactNode } from 'react';
1
+ import type * as RadixTooltip from '@radix-ui/react-tooltip';
2
+ import type { ComponentProps, ReactNode } from 'react';
3
+ type RadixTooltipContentProps = ComponentProps<typeof RadixTooltip.Content>;
2
4
  export interface PropTypes {
3
5
  content: ReactNode;
4
- side?: 'top' | 'right' | 'bottom' | 'left';
6
+ side?: RadixTooltipContentProps['side'];
5
7
  color?: 'primary' | 'error' | 'warning' | 'success';
8
+ sideOffset?: RadixTooltipContentProps['sideOffset'];
9
+ container?: HTMLElement;
6
10
  }
11
+ export {};
7
12
  //# sourceMappingURL=Tooltip.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tooltip/Tooltip.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,SAAS,CAAC;IACnB,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;CACrD"}
1
+ {"version":3,"file":"Tooltip.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Tooltip/Tooltip.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,YAAY,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,KAAK,wBAAwB,GAAG,cAAc,CAAC,OAAO,YAAY,CAAC,OAAO,CAAC,CAAC;AAE5E,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,SAAS,CAAC;IACnB,IAAI,CAAC,EAAE,wBAAwB,CAAC,MAAM,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;IACpD,UAAU,CAAC,EAAE,wBAAwB,CAAC,YAAY,CAAC,CAAC;IACpD,SAAS,CAAC,EAAE,WAAW,CAAC;CACzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"SwapInput.styles.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/SwapInput/SwapInput.styles.ts"],"names":[],"mappings":";;;AAGA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAqCpB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAgBhC,CAAC"}
1
+ {"version":3,"file":"TokenSection.styles.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/SwapInput/TokenSection.styles.ts"],"names":[],"mappings":";;;AAGA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAoBpB,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAmBhC,CAAC"}
@@ -1,5 +1,6 @@
1
+ import type { MutableRefObject } from 'react';
1
2
  type Params = {
2
- element: HTMLElement | null;
3
+ elementRef: MutableRefObject<HTMLElement | null>;
3
4
  paddingRight: string;
4
5
  };
5
6
  export declare function usePaddingRight(params: Params): void;
@@ -1 +1 @@
1
- {"version":3,"file":"usePaddingRight.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/usePaddingRight.ts"],"names":[],"mappings":"AAEA,KAAK,MAAM,GAAG;IACZ,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAMF,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,QA0B7C"}
1
+ {"version":3,"file":"usePaddingRight.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/usePaddingRight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAI9C,KAAK,MAAM,GAAG;IACZ,UAAU,EAAE,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACjD,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAMF,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,QA2B7C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/ui",
3
- "version": "0.15.1-next.7",
3
+ "version": "0.15.1-next.8",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -7,9 +7,6 @@ export const EXPANDABLE_ROUTES_TRANSITION_DURATION = 300;
7
7
 
8
8
  export const RouteContainer = styled(Collapsible.Root, {
9
9
  display: 'flex',
10
- position: 'absolute',
11
- top: 'calc(100% - 36px)',
12
- left: '$0',
13
10
  flexDirection: 'column',
14
11
  alignItems: 'start',
15
12
  overflowX: 'auto',
@@ -44,7 +41,6 @@ export const SummaryContainer = styled('div', {
44
41
  color: '$foreground',
45
42
  cursor: 'pointer',
46
43
  boxSizing: 'border-box',
47
- padding: '$15 $15 $46 $15',
48
44
  position: 'relative',
49
45
  variants: {
50
46
  recommended: {
@@ -71,7 +67,10 @@ export const SummaryContainer = styled('div', {
71
67
  },
72
68
  basic: { true: { borderTopRightRadius: '0', borderTopLeftRadius: '0' } },
73
69
  },
74
- '& .summary': { width: '100%' },
70
+ '& .summary': {
71
+ width: '100%',
72
+ padding: '$15 $15 $10 $15',
73
+ },
75
74
  '& .basic-info': {
76
75
  paddingTop: '$10',
77
76
  display: 'flex',
@@ -19,9 +19,9 @@ import {
19
19
  HorizontalSeparator,
20
20
  IconContainer,
21
21
  RouteContainer,
22
- Separator,
23
22
  SummaryContainer,
24
23
  } from './BestRoute.styles';
24
+ import { RouteSummary } from './RouteSummary';
25
25
 
26
26
  export function BestRoute(props: BestRouteProps) {
27
27
  const {
@@ -92,35 +92,9 @@ export function BestRoute(props: BestRouteProps) {
92
92
  )}
93
93
  {type === 'swap-preview' && (
94
94
  <>
95
- <TokenAmount
96
- direction="horizontal"
97
- label="Swap input"
98
- type="input"
99
- price={{ value: input.value, usdValue: input.usdValue }}
100
- token={{
101
- displayName: steps[0].from.token.displayName,
102
- image: steps[0].from.token.image,
103
- }}
104
- chain={{ image: steps[0].from.chain.image }}
105
- />
106
- <Separator
107
- css={{
108
- height: '$32',
109
- marginLeft: '14px',
110
- position: 'absolute',
111
- top: '85px',
112
- }}
113
- />
114
- <TokenAmount
115
- direction="horizontal"
116
- label="Estimated output"
117
- type="output"
118
- price={{ value: output.value, usdValue: output.usdValue }}
119
- token={{
120
- displayName: steps[numberOfSteps - 1].to.token.displayName,
121
- image: steps[numberOfSteps - 1].to.token.image,
122
- }}
123
- chain={{ image: steps[numberOfSteps - 1].to.chain.image }}
95
+ <RouteSummary
96
+ from={steps[0].from}
97
+ to={steps[numberOfSteps - 1].to}
124
98
  percentageChange={percentageChange}
125
99
  warningLevel={warningLevel}
126
100
  />
@@ -141,7 +115,9 @@ export function BestRoute(props: BestRouteProps) {
141
115
  const key = `item-${index}`;
142
116
  return (
143
117
  <React.Fragment key={key}>
144
- <Tooltip content={step.from.chain.displayName}>
118
+ <Tooltip
119
+ sideOffset={2}
120
+ content={step.from.chain.displayName}>
145
121
  <Image src={step.from.chain.image} size={16} />
146
122
  </Tooltip>
147
123
  {index === numberOfSteps - 1 && (
@@ -149,7 +125,9 @@ export function BestRoute(props: BestRouteProps) {
149
125
  <IconContainer>
150
126
  <ChevronRightIcon size={12} color="black" />
151
127
  </IconContainer>
152
- <Tooltip content={step.to.chain.displayName}>
128
+ <Tooltip
129
+ sideOffset={2}
130
+ content={step.to.chain.displayName}>
153
131
  <Image src={step.to.chain.image} size={16} />
154
132
  </Tooltip>
155
133
  </>
@@ -22,7 +22,7 @@ export const Container = styled('div', {
22
22
  display: 'flex',
23
23
  },
24
24
  '& .basic-summary': {
25
- padding: '$15 $0',
25
+ padding: '$15 $0 14px $0',
26
26
  },
27
27
  '& .output': {
28
28
  padding: '$6 $0 $15 $0',
@@ -0,0 +1,15 @@
1
+ import { styled } from '../../theme';
2
+
3
+ export const Container = styled('div', {
4
+ position: 'relative',
5
+ display: 'flex',
6
+ flexDirection: 'column',
7
+ width: '100%',
8
+ '& .separator': {
9
+ height: '14px',
10
+ marginLeft: '14px',
11
+ position: 'absolute',
12
+ borderLeft: '1px solid $foreground',
13
+ top: '42%',
14
+ },
15
+ });
@@ -0,0 +1,48 @@
1
+ import type { Step } from './BestRoute.types';
2
+ import type { PriceImpactWarningLevel } from '../PriceImpact';
3
+
4
+ import React from 'react';
5
+
6
+ import { TokenAmount } from '../TokenAmount';
7
+
8
+ import { Container } from './RouteSummary.styles';
9
+
10
+ type PropTypes = {
11
+ from: Step['from'];
12
+ to: Step['to'];
13
+ percentageChange?: string | null;
14
+ warningLevel: PriceImpactWarningLevel;
15
+ };
16
+
17
+ export function RouteSummary(props: PropTypes) {
18
+ const { from, to, percentageChange, warningLevel } = props;
19
+ return (
20
+ <Container>
21
+ <TokenAmount
22
+ direction="horizontal"
23
+ label="Swap input"
24
+ type="input"
25
+ price={{ value: from.price.value, usdValue: from.price.usdValue }}
26
+ token={{
27
+ displayName: from.token.displayName,
28
+ image: from.token.image,
29
+ }}
30
+ chain={{ image: from.chain.image }}
31
+ />
32
+ <div className="separator" />
33
+ <TokenAmount
34
+ direction="horizontal"
35
+ label="Estimated output"
36
+ type="output"
37
+ price={{ value: to.price.value, usdValue: to.price.usdValue }}
38
+ token={{
39
+ displayName: to.token.displayName,
40
+ image: to.token.image,
41
+ }}
42
+ chain={{ image: to.chain.image }}
43
+ percentageChange={percentageChange}
44
+ warningLevel={warningLevel}
45
+ />
46
+ </Container>
47
+ );
48
+ }
@@ -1,3 +1,4 @@
1
1
  export { BestRoute } from './BestRoute';
2
2
  export type { Step } from './BestRoute.types';
3
3
  export { BestRouteSkeleton } from './BestRouteSkeleton';
4
+ export { RouteSummary } from './RouteSummary';
@@ -46,7 +46,7 @@ export function Modal(props: PropsWithChildren<PropTypes>) {
46
46
  const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
47
47
  const contentRef = useRef<HTMLDivElement | null>(null);
48
48
  usePaddingRight({
49
- element: contentRef.current,
49
+ elementRef: contentRef,
50
50
  paddingRight: theme.sizes[DEFAULT_CONTENT_PADDING],
51
51
  });
52
52
 
@@ -112,9 +112,7 @@ export function Modal(props: PropsWithChildren<PropTypes>) {
112
112
  </Flex>
113
113
  </ModalHeader>
114
114
  )}
115
- <Content ref={(ref) => (contentRef.current = ref)}>
116
- {children}
117
- </Content>
115
+ <Content ref={contentRef}>{children}</Content>
118
116
  {(hasLogo || footer) && (
119
117
  <Footer>
120
118
  <div className="footer__content">{footer}</div>
@@ -23,17 +23,17 @@ export function TokenAmount(props: PropTypes) {
23
23
  {props.label}
24
24
  </Typography>
25
25
  )}
26
- <div>
26
+ <div title={`${props.price.value} ${props.token.displayName}`}>
27
27
  <Typography
28
28
  ml={4}
29
- size="large"
29
+ size="medium"
30
30
  variant="title"
31
31
  style={{ fontWeight: 600 }}>
32
32
  {props.price.value}
33
33
  </Typography>
34
34
  <Typography
35
35
  ml={8}
36
- size="large"
36
+ size="medium"
37
37
  variant="title"
38
38
  style={{ fontWeight: 400 }}>
39
39
  {props.token.displayName}
@@ -2,58 +2,33 @@ import type { PropTypes } from './Tooltip.types';
2
2
  import type { PropsWithChildren } from 'react';
3
3
 
4
4
  import * as RadixTooltip from '@radix-ui/react-tooltip';
5
- import React, { useState } from 'react';
5
+ import React from 'react';
6
6
 
7
7
  import { TooltipTypography } from './Tooltip.styles';
8
- import useEventListener from './useEventListener';
9
8
 
10
- export function Tooltip({
11
- children,
12
- content,
13
- side = 'top',
14
- color,
15
- }: PropsWithChildren<PropTypes>) {
16
- const [open, setOpen] = useState<boolean>(false);
17
- const [{ clientX, clientY }, setPosition] = useState({
18
- clientX: 0,
19
- clientY: 0,
20
- });
21
- useEventListener('mousemove', ({ clientX, clientY }) =>
22
- setPosition({ clientX, clientY })
23
- );
9
+ export function Tooltip(props: PropsWithChildren<PropTypes>) {
10
+ const {
11
+ children,
12
+ content,
13
+ color,
14
+ sideOffset,
15
+ container,
16
+ side = 'top',
17
+ } = props;
24
18
  return (
25
- <>
26
- <div
27
- style={{ display: 'contents' }}
28
- onMouseOver={() => setOpen(true)}
29
- onMouseOut={() => setOpen(false)}>
30
- {children}
31
- </div>
32
- <RadixTooltip.Provider>
33
- <RadixTooltip.Root open={open}>
34
- <RadixTooltip.Trigger asChild>
35
- <div
36
- style={{
37
- position: 'fixed',
38
- pointerEvents: 'none',
39
- top: `${clientY}px`,
40
- left: `${clientX}px`,
41
- }}
42
- />
43
- </RadixTooltip.Trigger>
44
- <RadixTooltip.Content
45
- key={`${clientX}${clientY}`}
46
- sideOffset={20}
47
- style={{
48
- zIndex: 9999999,
49
- }}
50
- side={side}>
19
+ <RadixTooltip.Provider>
20
+ <RadixTooltip.Root>
21
+ <RadixTooltip.Trigger asChild>
22
+ <div>{children}</div>
23
+ </RadixTooltip.Trigger>
24
+ <RadixTooltip.Portal container={container}>
25
+ <RadixTooltip.Content side={side} sideOffset={sideOffset}>
51
26
  <TooltipTypography variant="label" size="medium" color={color}>
52
27
  {content}
53
28
  </TooltipTypography>
54
29
  </RadixTooltip.Content>
55
- </RadixTooltip.Root>
56
- </RadixTooltip.Provider>
57
- </>
30
+ </RadixTooltip.Portal>
31
+ </RadixTooltip.Root>
32
+ </RadixTooltip.Provider>
58
33
  );
59
34
  }
@@ -1,7 +1,12 @@
1
- import type { ReactNode } from 'react';
1
+ import type * as RadixTooltip from '@radix-ui/react-tooltip';
2
+ import type { ComponentProps, ReactNode } from 'react';
3
+
4
+ type RadixTooltipContentProps = ComponentProps<typeof RadixTooltip.Content>;
2
5
 
3
6
  export interface PropTypes {
4
7
  content: ReactNode;
5
- side?: 'top' | 'right' | 'bottom' | 'left';
8
+ side?: RadixTooltipContentProps['side'];
6
9
  color?: 'primary' | 'error' | 'warning' | 'success';
10
+ sideOffset?: RadixTooltipContentProps['sideOffset'];
11
+ container?: HTMLElement;
7
12
  }
@@ -36,7 +36,7 @@ function Wallet(props: WalletPropTypes) {
36
36
  }
37
37
 
38
38
  return (
39
- <Tooltip content={info.tooltipText} side="bottom">
39
+ <Tooltip content={info.tooltipText} side="top">
40
40
  <WalletButton
41
41
  disabled={props.state == WalletState.CONNECTING}
42
42
  onClick={() => {
@@ -47,6 +47,9 @@ export const InputAmount = styled(TextField, {
47
47
  fontWeight: '$medium',
48
48
  textAlign: 'right',
49
49
  width: 140,
50
+ '&:disabled': {
51
+ cursor: 'unset',
52
+ },
50
53
  });
51
54
  export const MaxButton = styled(Button, {
52
55
  $$color: '$colors$info300',
@@ -55,7 +55,7 @@ export function SwapInput(props: SwapInputProps) {
55
55
  {props.loading ? (
56
56
  <>
57
57
  <Skeleton variant="text" size="large" width={92} />
58
- <Divider size={4} />
58
+ <Divider size={8} />
59
59
  <Skeleton variant="text" size="medium" width={92} />
60
60
  </>
61
61
  ) : (
@@ -39,4 +39,7 @@ export const TokenSectionContainer = styled('div', {
39
39
  alignItems: 'start',
40
40
  paddingLeft: '$10',
41
41
  },
42
+ '& .token-chain-name__skeleton': {
43
+ padding: '$5 $0',
44
+ },
42
45
  });