@rango-dev/ui 0.44.1-next.5 → 0.45.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 (85) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/index.js.map +4 -4
  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/ChainToken/ChainToken.constants.d.ts +1 -0
  40. package/dist/widget/ui/src/components/ChainToken/ChainToken.constants.d.ts.map +1 -1
  41. package/dist/widget/ui/src/components/ChainToken/ChainToken.d.ts.map +1 -1
  42. package/dist/widget/ui/src/components/ChainToken/ChainToken.types.d.ts +2 -2
  43. package/dist/widget/ui/src/components/ChainToken/ChainToken.types.d.ts.map +1 -1
  44. package/dist/widget/ui/src/components/CustomTokenWarning/CustomTokenWarning.d.ts +4 -0
  45. package/dist/widget/ui/src/components/CustomTokenWarning/CustomTokenWarning.d.ts.map +1 -0
  46. package/dist/widget/ui/src/components/CustomTokenWarning/CustomTokenWarning.styles.d.ts +486 -0
  47. package/dist/widget/ui/src/components/CustomTokenWarning/CustomTokenWarning.styles.d.ts.map +1 -0
  48. package/dist/widget/ui/src/components/CustomTokenWarning/CustomTokenWarning.types.d.ts +4 -0
  49. package/dist/widget/ui/src/components/CustomTokenWarning/CustomTokenWarning.types.d.ts.map +1 -0
  50. package/dist/widget/ui/src/components/CustomTokenWarning/index.d.ts +2 -0
  51. package/dist/widget/ui/src/components/CustomTokenWarning/index.d.ts.map +1 -0
  52. package/dist/widget/ui/src/components/FullExpandedQuote/FullExpandedQuote.Skeletons.d.ts.map +1 -1
  53. package/dist/widget/ui/src/components/SwapListItem/SwapListItem.types.d.ts +4 -4
  54. package/dist/widget/ui/src/components/SwapListItem/SwapListItem.types.d.ts.map +1 -1
  55. package/dist/widget/ui/src/components/SwapListItem/SwapToken.d.ts.map +1 -1
  56. package/dist/widget/ui/src/components/index.d.ts +1 -0
  57. package/dist/widget/ui/src/components/index.d.ts.map +1 -1
  58. package/dist/widget/ui/src/containers/Notifications/Notifications.types.d.ts +2 -2
  59. package/dist/widget/ui/src/containers/Notifications/Notifications.types.d.ts.map +1 -1
  60. package/dist/widget/ui/src/containers/SwapInput/SwapInput.d.ts.map +1 -1
  61. package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts +6 -3
  62. package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts.map +1 -1
  63. package/dist/widget/ui/src/containers/SwapInput/TokenSection.d.ts.map +1 -1
  64. package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts +160 -0
  65. package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts.map +1 -1
  66. package/dist/widget/ui/src/containers/SwapInput/TokenSection.types.d.ts +4 -2
  67. package/dist/widget/ui/src/containers/SwapInput/TokenSection.types.d.ts.map +1 -1
  68. package/package.json +3 -3
  69. package/src/components/ChainToken/ChainToken.constants.ts +3 -0
  70. package/src/components/ChainToken/ChainToken.tsx +15 -7
  71. package/src/components/ChainToken/ChainToken.types.ts +2 -2
  72. package/src/components/CustomTokenWarning/CustomTokenWarning.styles.ts +30 -0
  73. package/src/components/CustomTokenWarning/CustomTokenWarning.tsx +44 -0
  74. package/src/components/CustomTokenWarning/CustomTokenWarning.types.ts +3 -0
  75. package/src/components/CustomTokenWarning/index.ts +1 -0
  76. package/src/components/FullExpandedQuote/FullExpandedQuote.Skeletons.tsx +1 -7
  77. package/src/components/SwapListItem/SwapListItem.types.ts +4 -4
  78. package/src/components/SwapListItem/SwapToken.tsx +2 -12
  79. package/src/components/index.ts +1 -0
  80. package/src/containers/Notifications/Notifications.types.ts +2 -2
  81. package/src/containers/SwapInput/SwapInput.tsx +2 -0
  82. package/src/containers/SwapInput/SwapInput.types.ts +5 -3
  83. package/src/containers/SwapInput/TokenSection.styles.ts +7 -0
  84. package/src/containers/SwapInput/TokenSection.tsx +17 -5
  85. package/src/containers/SwapInput/TokenSection.types.ts +4 -2
@@ -1 +1 @@
1
- {"version":3,"file":"TokenSection.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/SwapInput/TokenSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAiB1B,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBAgDpD"}
1
+ {"version":3,"file":"TokenSection.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/SwapInput/TokenSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAmB1B,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBA0DpD"}
@@ -1078,4 +1078,164 @@ export declare const skeletonStyles: import("@stitches/react/types/styled-compon
1078
1078
  zIndices: {};
1079
1079
  transitions: {};
1080
1080
  }, import("@stitches/react/types/config.js").DefaultThemeMap, {}>>;
1081
+ export declare const TitleContainer: import("@stitches/react/types/styled-component.js").StyledComponent<"div", {}, {
1082
+ xs: string;
1083
+ sm: string;
1084
+ md: string;
1085
+ lg: string;
1086
+ }, import("@stitches/react/types/css-util.js").CSS<{
1087
+ xs: string;
1088
+ sm: string;
1089
+ md: string;
1090
+ lg: string;
1091
+ }, {
1092
+ colors: {
1093
+ primary: string;
1094
+ primary500: string;
1095
+ primary550: string;
1096
+ secondary: string;
1097
+ secondary100: string;
1098
+ secondary150: string;
1099
+ secondary200: string;
1100
+ secondary250: string;
1101
+ secondary500: string;
1102
+ secondary550: string;
1103
+ neutral: string;
1104
+ neutral100: string;
1105
+ neutral200: string;
1106
+ neutral300: string;
1107
+ neutral400: string;
1108
+ neutral500: string;
1109
+ neutral600: string;
1110
+ neutral700: string;
1111
+ neutral800: string;
1112
+ neutral900: string;
1113
+ error100: string;
1114
+ error300: string;
1115
+ error500: string;
1116
+ error600: string;
1117
+ error700: string;
1118
+ warning100: string;
1119
+ warning300: string;
1120
+ warning500: string;
1121
+ warning600: string;
1122
+ warning700: string;
1123
+ info: string;
1124
+ info100: string;
1125
+ info300: string;
1126
+ info500: string;
1127
+ info600: string;
1128
+ info700: string;
1129
+ success100: string;
1130
+ success300: string;
1131
+ success500: string;
1132
+ success600: string;
1133
+ success700: string;
1134
+ background: string;
1135
+ foreground: string;
1136
+ };
1137
+ space: {
1138
+ 0: string;
1139
+ 5: string;
1140
+ 10: string;
1141
+ 15: string;
1142
+ 20: string;
1143
+ 25: string;
1144
+ 30: string;
1145
+ 40: string;
1146
+ 46: string;
1147
+ 50: string;
1148
+ 60: string;
1149
+ 70: string;
1150
+ 80: string;
1151
+ 90: string;
1152
+ 100: string;
1153
+ 2: string;
1154
+ 4: string;
1155
+ 6: string;
1156
+ 8: string;
1157
+ 12: string;
1158
+ 16: string;
1159
+ 24: string;
1160
+ 28: string;
1161
+ 32: string;
1162
+ 36: string;
1163
+ };
1164
+ radii: {
1165
+ xs: string;
1166
+ sm: string;
1167
+ xm: string;
1168
+ md: string;
1169
+ xl: string;
1170
+ lg: string;
1171
+ primary: string;
1172
+ secondary: string;
1173
+ };
1174
+ fontSizes: {
1175
+ 10: string;
1176
+ 12: string;
1177
+ 14: string;
1178
+ 16: string;
1179
+ 18: string;
1180
+ 20: string;
1181
+ 22: string;
1182
+ 24: string;
1183
+ 28: string;
1184
+ 32: string;
1185
+ 36: string;
1186
+ 40: string;
1187
+ 48: string;
1188
+ };
1189
+ fonts: {
1190
+ primary: string;
1191
+ widget: string;
1192
+ };
1193
+ fontWeights: {
1194
+ regular: number;
1195
+ medium: number;
1196
+ semiBold: number;
1197
+ bold: number;
1198
+ };
1199
+ lineHeights: {
1200
+ 12: string;
1201
+ 16: string;
1202
+ 20: string;
1203
+ 24: string;
1204
+ 26: string;
1205
+ 28: string;
1206
+ 30: string;
1207
+ 36: string;
1208
+ 40: string;
1209
+ 44: string;
1210
+ 52: string;
1211
+ 64: string;
1212
+ };
1213
+ letterSpacings: {};
1214
+ sizes: {
1215
+ 4: string;
1216
+ 6: string;
1217
+ 8: string;
1218
+ 10: string;
1219
+ 12: string;
1220
+ 16: string;
1221
+ 18: string;
1222
+ 20: string;
1223
+ 24: string;
1224
+ 26: string;
1225
+ 28: string;
1226
+ 30: string;
1227
+ 32: string;
1228
+ 36: string;
1229
+ 40: string;
1230
+ 45: string;
1231
+ 48: string;
1232
+ };
1233
+ borderWidths: {};
1234
+ borderStyles: {};
1235
+ shadows: {
1236
+ mainContainer: string;
1237
+ };
1238
+ zIndices: {};
1239
+ transitions: {};
1240
+ }, import("@stitches/react/types/config.js").DefaultThemeMap, {}>>;
1081
1241
  //# sourceMappingURL=TokenSection.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TokenSection.styles.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/SwapInput/TokenSection.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAwBX,MAAO,SAClB;aAAY,MAAO,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kEAY1B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kEAAQ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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kEAKzB,CAAC"}
@@ -1,11 +1,13 @@
1
1
  export type TokenSectionProps = {
2
- chainImage: string;
3
- tokenImage: string;
2
+ chainImage?: string;
3
+ tokenImage?: string;
4
4
  tokenSymbol: string;
5
5
  chain: string;
6
6
  chianImageId?: string;
7
7
  error?: boolean;
8
8
  onClick: () => void;
9
9
  loading?: boolean;
10
+ warning?: boolean;
11
+ tooltipContainer?: HTMLElement;
10
12
  };
11
13
  //# sourceMappingURL=TokenSection.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TokenSection.types.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/SwapInput/TokenSection.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC"}
1
+ {"version":3,"file":"TokenSection.types.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/SwapInput/TokenSection.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,WAAW,CAAC;CAChC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/ui",
3
- "version": "0.44.1-next.5",
3
+ "version": "0.45.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -53,7 +53,7 @@
53
53
  "@radix-ui/react-select": "^2.0.0",
54
54
  "@radix-ui/react-switch": "^1.0.1",
55
55
  "@radix-ui/react-tooltip": "^1.0.2",
56
- "@rango-dev/wallets-shared": "^0.42.1-next.4",
56
+ "@rango-dev/wallets-shared": "^0.43.0",
57
57
  "@stitches/react": "^1.2.8",
58
58
  "copy-to-clipboard": "^3.3.3",
59
59
  "rango-types": "^0.1.81",
@@ -62,4 +62,4 @@
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  }
65
- }
65
+ }
@@ -8,3 +8,6 @@ export const tokenChainSizeMap: {
8
8
  medium: { token: 27, chain: 10 },
9
9
  large: { token: 30, chain: 15 },
10
10
  };
11
+
12
+ export const DEFAULT_TOKEN_IMAGE_SRC =
13
+ 'https://raw.githubusercontent.com/rango-exchange/assets/refs/heads/main/common/unknown-image.png';
@@ -5,7 +5,10 @@ import React from 'react';
5
5
  import { Image } from '../common/index.js';
6
6
  import { Skeleton } from '../Skeleton/index.js';
7
7
 
8
- import { tokenChainSizeMap } from './ChainToken.constants.js';
8
+ import {
9
+ DEFAULT_TOKEN_IMAGE_SRC,
10
+ tokenChainSizeMap,
11
+ } from './ChainToken.constants.js';
9
12
  import {
10
13
  ChainImageContainer,
11
14
  Container,
@@ -22,6 +25,11 @@ export const ChainToken: React.FC<ChainTokenPropTypes> = (props) => {
22
25
  loading,
23
26
  } = props;
24
27
 
28
+ const tokenImageSrc =
29
+ tokenImage === '' ? DEFAULT_TOKEN_IMAGE_SRC : tokenImage;
30
+ const chainImageSrc =
31
+ chainImage === '' ? DEFAULT_TOKEN_IMAGE_SRC : chainImage;
32
+
25
33
  return (
26
34
  <Container
27
35
  css={
@@ -39,19 +47,19 @@ export const ChainToken: React.FC<ChainTokenPropTypes> = (props) => {
39
47
  width={tokenChainSizeMap[size].token}
40
48
  />
41
49
  ) : (
42
- <TokenImageContainer hasBorder={!tokenImage}>
50
+ <TokenImageContainer hasBorder={!tokenImageSrc}>
43
51
  <Image
44
52
  size={tokenChainSizeMap[size].token}
45
- src={tokenImage}
53
+ src={tokenImageSrc}
46
54
  type="circular"
47
- {...((useAsPlaceholder || !tokenImage) && {
55
+ {...((useAsPlaceholder || !tokenImageSrc) && {
48
56
  useAsPlaceholder: true,
49
57
  backgroundColor: 'transparent',
50
58
  })}
51
59
  />
52
60
  </TokenImageContainer>
53
61
  )}
54
- <ChainImageContainer size={size} hasBorder={!chainImage}>
62
+ <ChainImageContainer size={size} hasBorder={!chainImageSrc}>
55
63
  {loading ? (
56
64
  <Skeleton
57
65
  variant="circular"
@@ -62,9 +70,9 @@ export const ChainToken: React.FC<ChainTokenPropTypes> = (props) => {
62
70
  <Image
63
71
  id={chianImageId}
64
72
  size={tokenChainSizeMap[size].chain}
65
- src={chainImage}
73
+ src={chainImageSrc}
66
74
  type="circular"
67
- {...((useAsPlaceholder || !chainImage) && {
75
+ {...((useAsPlaceholder || !chainImageSrc) && {
68
76
  useAsPlaceholder: true,
69
77
  backgroundColor: 'transparent',
70
78
  })}
@@ -5,8 +5,8 @@ type BaseProps = Stitches.VariantProps<typeof ChainImageContainer>;
5
5
  type BaseSizes = Exclude<BaseProps['size'], object>;
6
6
 
7
7
  export type ChainTokenPropTypes = {
8
- tokenImage: string;
9
- chainImage: string;
8
+ tokenImage?: string;
9
+ chainImage?: string;
10
10
  chianImageId?: string;
11
11
  size: NonNullable<BaseSizes>;
12
12
  useAsPlaceholder?: boolean;
@@ -0,0 +1,30 @@
1
+ import type { Tooltip } from '../Tooltip';
2
+ import type { ComponentProps } from 'react';
3
+
4
+ import { styled } from '../../theme';
5
+ import { IconHighlight } from '../Alert/Alert.styles';
6
+
7
+ export const tooltipStyles: ComponentProps<typeof Tooltip>['styles'] = {
8
+ root: {
9
+ zIndex: 10,
10
+ },
11
+ };
12
+
13
+ export const TooltipContent = styled('div', {
14
+ width: '217px',
15
+ display: 'flex',
16
+ justifyContent: 'center',
17
+ alignItems: 'center',
18
+
19
+ '& .warning-icon-container': {
20
+ width: '$20',
21
+ height: '$20',
22
+ alignSelf: 'unset',
23
+ },
24
+ });
25
+
26
+ export const StyledIconHighlight = styled(IconHighlight, {
27
+ width: '14px',
28
+ height: '14px',
29
+ alignSelf: 'unset',
30
+ });
@@ -0,0 +1,44 @@
1
+ import type { PropTypes } from './CustomTokenWarning.types';
2
+
3
+ import { i18n } from '@lingui/core';
4
+ import React from 'react';
5
+
6
+ import { WarningIcon } from '../../icons';
7
+ import { IconHighlight } from '../Alert/Alert.styles';
8
+ import { Divider } from '../Divider';
9
+ import { Tooltip } from '../Tooltip';
10
+ import { Typography } from '../Typography';
11
+
12
+ import {
13
+ StyledIconHighlight,
14
+ TooltipContent,
15
+ tooltipStyles,
16
+ } from './CustomTokenWarning.styles';
17
+
18
+ export function CustomTokenWarning(props: PropTypes) {
19
+ return (
20
+ <Tooltip
21
+ styles={tooltipStyles}
22
+ side="bottom"
23
+ align="center"
24
+ sideOffset={20}
25
+ container={props.container}
26
+ content={
27
+ <TooltipContent>
28
+ <IconHighlight type="warning" className="warning-icon-container">
29
+ <WarningIcon color="warning" size={13} />
30
+ </IconHighlight>
31
+ <Divider size={4} direction="horizontal" />
32
+ <Typography variant="body" size="xsmall">
33
+ {i18n.t(
34
+ 'This token may involve potential security risks; proceed with caution.'
35
+ )}
36
+ </Typography>
37
+ </TooltipContent>
38
+ }>
39
+ <StyledIconHighlight type="warning">
40
+ <WarningIcon color="warning" size={9} />
41
+ </StyledIconHighlight>
42
+ </Tooltip>
43
+ );
44
+ }
@@ -0,0 +1,3 @@
1
+ export type PropTypes = {
2
+ container?: HTMLElement;
3
+ };
@@ -0,0 +1 @@
1
+ export { CustomTokenWarning } from './CustomTokenWarning';
@@ -34,13 +34,7 @@ export function SkeletonHeader() {
34
34
  export function SkeletonOutput() {
35
35
  return (
36
36
  <OutputLoading>
37
- <ChainToken
38
- useAsPlaceholder={true}
39
- size="large"
40
- chainImage=""
41
- tokenImage=""
42
- loading={true}
43
- />
37
+ <ChainToken useAsPlaceholder={true} size="large" loading={true} />
44
38
  <Skeleton variant="rounded" width={122} height={29} />
45
39
  </OutputLoading>
46
40
  );
@@ -25,11 +25,11 @@ export const StatusColors = {
25
25
  export interface SwapTokenData {
26
26
  from: {
27
27
  token: {
28
- image: string;
28
+ image?: string;
29
29
  displayName: string;
30
30
  };
31
31
  blockchain: {
32
- image: string;
32
+ image?: string;
33
33
  };
34
34
  amount: string;
35
35
  realAmount: string;
@@ -37,11 +37,11 @@ export interface SwapTokenData {
37
37
 
38
38
  to: {
39
39
  token: {
40
- image: string;
40
+ image?: string;
41
41
  displayName: string;
42
42
  };
43
43
  blockchain: {
44
- image: string;
44
+ image?: string;
45
45
  };
46
46
  amount: string;
47
47
  realAmount: string;
@@ -27,23 +27,13 @@ export function SwapToken(props: PropTypes) {
27
27
  <TokenContainer>
28
28
  <Images>
29
29
  <div>
30
- <ChainToken
31
- tokenImage=""
32
- chainImage=""
33
- size="medium"
34
- loading={true}
35
- />
30
+ <ChainToken size="medium" loading={true} />
36
31
  </div>
37
32
  <div
38
33
  style={{
39
34
  transform: 'translateX(-5px)',
40
35
  }}>
41
- <ChainToken
42
- tokenImage=""
43
- chainImage=""
44
- size="medium"
45
- loading={true}
46
- />
36
+ <ChainToken size="medium" loading={true} />
47
37
  </div>
48
38
  </Images>
49
39
  <LayoutLoading>
@@ -43,6 +43,7 @@ export * from './Flags/index.js';
43
43
  export * from './Select/index.js';
44
44
  export * from './QuoteTag/index.js';
45
45
  export * from './Tabs/index.js';
46
+ export * from './CustomTokenWarning/index.js';
46
47
  export type {
47
48
  SvgIconProps,
48
49
  SvgIconPropsWithChildren,
@@ -9,8 +9,8 @@ type Notification = {
9
9
 
10
10
  export type PropTypes = {
11
11
  list: Notification[];
12
- getBlockchainImage: (blockchain: string) => string;
13
- getTokenImage: (token: Asset) => string;
12
+ getBlockchainImage: (blockchain: string) => string | undefined;
13
+ getTokenImage: (token: Asset) => string | undefined;
14
14
  onClickItem: (requestId: string) => void;
15
15
  onClearAll: () => void;
16
16
  containerStyles?: CSS;
@@ -96,6 +96,8 @@ export function SwapInput(props: SwapInputPropTypes) {
96
96
  tokenImage={props.token.image}
97
97
  onClick={props.onClickToken}
98
98
  loading={props.loading}
99
+ warning={props.token.securityWarning}
100
+ tooltipContainer={props.tooltipContainer}
99
101
  />
100
102
  <div className={amountStyles()}>
101
103
  {props.loading || (props.mode === 'To' && props.fetchingQuote) ? (
@@ -3,11 +3,12 @@ import type { PriceImpactWarningLevel } from '../../components/PriceImpact/Price
3
3
  export type BaseProps = {
4
4
  chain: {
5
5
  displayName: string;
6
- image: string;
6
+ image?: string;
7
7
  };
8
8
  token: {
9
9
  displayName: string;
10
- image: string;
10
+ image?: string;
11
+ securityWarning?: boolean;
11
12
  };
12
13
  price: {
13
14
  value: string;
@@ -41,4 +42,5 @@ type ToProps = {
41
42
  warningLevel: PriceImpactWarningLevel;
42
43
  };
43
44
 
44
- export type SwapInputPropTypes = BaseProps & (FromProps | ToProps);
45
+ export type SwapInputPropTypes = BaseProps &
46
+ (FromProps | ToProps) & { tooltipContainer?: HTMLElement };
@@ -74,3 +74,10 @@ export const skeletonStyles = css({
74
74
  width: '100%',
75
75
  padding: '$5 $0',
76
76
  });
77
+
78
+ export const TitleContainer = styled('div', {
79
+ display: 'flex',
80
+ justifyContent: 'center',
81
+ alignItems: 'center',
82
+ flexWrap: 'wrap',
83
+ });
@@ -2,6 +2,7 @@ import type { TokenSectionProps } from './TokenSection.types.js';
2
2
 
3
3
  import { i18n } from '@lingui/core';
4
4
  import React from 'react';
5
+ import { CustomTokenWarning } from 'src/components/CustomTokenWarning/CustomTokenWarning.js';
5
6
 
6
7
  import {
7
8
  ChainToken,
@@ -14,6 +15,7 @@ import {
14
15
  chainNameStyles,
15
16
  Container,
16
17
  skeletonStyles,
18
+ TitleContainer,
17
19
  tokenChainStyles,
18
20
  TokenSectionContainer,
19
21
  } from './TokenSection.styles.js';
@@ -28,6 +30,8 @@ export function TokenSection(props: TokenSectionProps) {
28
30
  chianImageId,
29
31
  onClick,
30
32
  loading,
33
+ warning,
34
+ tooltipContainer,
31
35
  } = props;
32
36
  return (
33
37
  <Container variant="default" disabled={error || loading} onClick={onClick}>
@@ -49,11 +53,19 @@ export function TokenSection(props: TokenSectionProps) {
49
53
  </div>
50
54
  ) : (
51
55
  <>
52
- <Typography variant="title" size="medium">
53
- {error || (!loading && !tokenSymbol)
54
- ? i18n.t('Select Token')
55
- : tokenSymbol}
56
- </Typography>
56
+ <TitleContainer>
57
+ <Typography variant="title" size="medium">
58
+ {error || (!loading && !tokenSymbol)
59
+ ? i18n.t('Select Token')
60
+ : tokenSymbol}
61
+ </Typography>
62
+ {warning && (
63
+ <>
64
+ <Divider size={4} direction="horizontal" />
65
+ <CustomTokenWarning container={tooltipContainer} />
66
+ </>
67
+ )}
68
+ </TitleContainer>
57
69
  <Typography
58
70
  variant="body"
59
71
  size="medium"
@@ -1,10 +1,12 @@
1
1
  export type TokenSectionProps = {
2
- chainImage: string;
3
- tokenImage: string;
2
+ chainImage?: string;
3
+ tokenImage?: string;
4
4
  tokenSymbol: string;
5
5
  chain: string;
6
6
  chianImageId?: string;
7
7
  error?: boolean;
8
8
  onClick: () => void;
9
9
  loading?: boolean;
10
+ warning?: boolean;
11
+ tooltipContainer?: HTMLElement;
10
12
  };