@xswap-link/sdk 0.14.0 → 0.15.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 (78) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/index.d.mts +4 -0
  3. package/dist/index.d.ts +4 -0
  4. package/dist/index.global.js +92 -92
  5. package/dist/index.js +3208 -2862
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +3083 -2740
  8. package/dist/index.mjs.map +1 -1
  9. package/localTheme.ts +6 -4
  10. package/package.json +1 -1
  11. package/src/assets/icons/AdjustmentsIcon.tsx +5 -7
  12. package/src/assets/icons/ChainlinkMarkIcon.tsx +4 -5
  13. package/src/assets/icons/CheckCircleThinIcon.tsx +22 -0
  14. package/src/assets/icons/ChevronDownThinIcon.tsx +39 -0
  15. package/src/assets/icons/ChevronDownWideThinIcon.tsx +18 -0
  16. package/src/assets/icons/ChevronsUpDownThinIcon.tsx +21 -0
  17. package/src/assets/icons/ClockIcon.tsx +3 -7
  18. package/src/assets/icons/CloseIcon.tsx +9 -4
  19. package/src/assets/icons/ErrorCircleThinIcon.tsx +22 -0
  20. package/src/assets/icons/LinkExternalThinIcon.tsx +19 -0
  21. package/src/assets/icons/LoadingRingIcon.tsx +22 -0
  22. package/src/assets/icons/ProgressRingThinIcon.tsx +29 -0
  23. package/src/assets/icons/SearchThinIcon.tsx +15 -0
  24. package/src/assets/icons/SignThinIcon.tsx +15 -0
  25. package/src/assets/icons/WalletCheckThinIcon.tsx +24 -0
  26. package/src/assets/icons/WarningIcon.tsx +8 -5
  27. package/src/assets/icons/index.ts +11 -0
  28. package/src/components/Modal/index.tsx +14 -9
  29. package/src/components/PoweredBy/index.tsx +6 -8
  30. package/src/components/Swap/Header/index.tsx +2 -4
  31. package/src/components/Swap/HistoryView/ActivityCard/index.tsx +110 -115
  32. package/src/components/Swap/HistoryView/index.tsx +10 -7
  33. package/src/components/Swap/PickerView/index.tsx +151 -0
  34. package/src/components/Swap/ReorderButton/ReorderButton.tsx +4 -4
  35. package/src/components/Swap/SettingsView/Delivery/index.tsx +19 -17
  36. package/src/components/Swap/SettingsView/InfiniteApproval/index.tsx +19 -17
  37. package/src/components/Swap/SettingsView/Slippage/index.tsx +55 -49
  38. package/src/components/Swap/SwapView/ConfirmationView/TokenTiles/index.tsx +69 -0
  39. package/src/components/Swap/SwapView/ConfirmationView/TxOverview/Header/index.tsx +13 -25
  40. package/src/components/Swap/SwapView/ConfirmationView/TxOverview/Steps/index.tsx +65 -113
  41. package/src/components/Swap/SwapView/ConfirmationView/TxOverview/index.tsx +68 -26
  42. package/src/components/Swap/SwapView/ConfirmationView/TxResult/index.tsx +51 -74
  43. package/src/components/Swap/SwapView/FeesPanel/DeliveryInfo/index.tsx +1 -1
  44. package/src/components/Swap/SwapView/FeesPanel/index.tsx +5 -5
  45. package/src/components/Swap/SwapView/SwapButton/index.tsx +2 -31
  46. package/src/components/Swap/SwapView/SwapPanel/AmountPanel/Balance/index.tsx +2 -2
  47. package/src/components/Swap/SwapView/SwapPanel/AmountPanel/index.tsx +2 -2
  48. package/src/components/Swap/SwapView/SwapPanel/TokenPanel/ChainPicker/index.tsx +143 -0
  49. package/src/components/Swap/SwapView/SwapPanel/TokenPanel/TokenPicker/NetworkFilter/index.tsx +19 -16
  50. package/src/components/Swap/SwapView/SwapPanel/TokenPanel/TokenPicker/TokenItem/index.tsx +11 -4
  51. package/src/components/Swap/SwapView/SwapPanel/TokenPanel/TokenPicker/index.tsx +185 -105
  52. package/src/components/Swap/SwapView/SwapPanel/TokenPanel/index.tsx +54 -120
  53. package/src/components/Swap/SwapView/SwapPanel/UsdValue/index.tsx +2 -2
  54. package/src/components/Swap/SwapView/SwapPanel/WalletPanel/index.tsx +10 -16
  55. package/src/components/Swap/SwapView/SwapPanel/index.tsx +4 -4
  56. package/src/components/Swap/SwapView/WalletPicker/index.tsx +131 -139
  57. package/src/components/Swap/SwapView/index.tsx +11 -7
  58. package/src/components/Swap/WalletPickerView/index.tsx +65 -0
  59. package/src/components/Swap/index.tsx +39 -8
  60. package/src/components/ToggleButton/index.tsx +5 -7
  61. package/src/components/TokenLogo/index.tsx +1 -1
  62. package/src/components/TxConfigForm/index.tsx +2 -2
  63. package/src/components/TxModal/index.tsx +14 -4
  64. package/src/components/global.css +18 -1
  65. package/src/constants/index.ts +4 -0
  66. package/src/context/HistoryProvider.tsx +1 -1
  67. package/src/context/SwapProvider.tsx +193 -81
  68. package/src/context/TxUIWrapper.tsx +3 -3
  69. package/src/hooks/useEvmContractApi.ts +28 -4
  70. package/src/models/payloads/GetBalancesPayload.ts +1 -0
  71. package/src/services/api.ts +37 -0
  72. package/src/utils/index.ts +27 -1
  73. package/src/utils/tokens.ts +20 -1
  74. package/src/utils/validation.ts +9 -4
  75. package/tailwind.config.js +4 -1
  76. package/src/components/Swap/SwapView/ConfirmationView/TxOverview/ArrowIcon.tsx +0 -13
  77. package/src/components/Swap/SwapView/ConfirmationView/TxOverview/SwapPanel/index.tsx +0 -72
  78. package/src/components/Swap/SwapView/ConfirmationView/TxResult/TokenItem/index.tsx +0 -25
package/localTheme.ts CHANGED
@@ -50,19 +50,21 @@ const lightThemeStyles: ModalIntegrationThemeStyles = {
50
50
  };
51
51
 
52
52
  const darkThemeStyles: ModalIntegrationThemeStyles = {
53
- mainAccentLight: "#3681C6",
54
- mainAccentDark: "#2B4A9D",
53
+ // Lavender CTA gradient from the swap-v2 design
54
+ mainAccentLight: "#D3DAF2",
55
+ mainAccentDark: "#B8C1E9",
55
56
  bgPrimary: "#020202",
56
57
  bgSecondary: "#0F0F0F",
57
58
  bgTertiary: "#ffffff",
58
59
  textPrimary: "#FFFFFF",
59
60
  textSecondary: "#3681C6",
60
61
  textRed: "#F44336",
61
- textOrange: "#FFCA28",
62
+ textOrange: "#F46F28",
62
63
  textGreen: "#4CAF50",
63
64
  clickSecondary: "#3681C6",
64
65
  clickTertiary: "#FFFFFF",
65
- buttonPrText: "#FFFFFF",
66
+ // Dark text sits on the light lavender primary button
67
+ buttonPrText: "#020202",
66
68
  buttonPrOffBg: "#272727",
67
69
  buttonPrOffText: "#90A4AE",
68
70
  labelText: "#FFFFFF",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xswap-link/sdk",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "JavaScript SDK for XSwap platform",
5
5
  "homepage": "https://github.com/xswap-link/xswap-sdk",
6
6
  "repository": {
@@ -3,16 +3,14 @@ export const AdjustmentsIcon = ({ className }: { className?: string }) => {
3
3
  <svg
4
4
  xmlns="http://www.w3.org/2000/svg"
5
5
  fill="none"
6
- viewBox="0 0 24 24"
7
- strokeWidth={1.5}
6
+ // The 20px-wide artwork is clipped to a 16px box in the design,
7
+ // so the slider lines run edge to edge.
8
+ viewBox="2 0 16 10.4"
8
9
  stroke="currentColor"
10
+ strokeLinejoin="round"
9
11
  className={className}
10
12
  >
11
- <path
12
- strokeLinecap="round"
13
- strokeLinejoin="round"
14
- d="M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75"
15
- />
13
+ <path d="M8.4 2.1L20 2.1M5.2 2.1C5.2 1.21634 5.91635 0.5 6.8 0.5C7.68366 0.5 8.4 1.21635 8.4 2.1C8.4 2.98366 7.68366 3.7 6.8 3.7C5.91635 3.7 5.2 2.98365 5.2 2.1ZM0 2.1H5.2M14.8 8.3L20 8.3M11.6 8.3C11.6 7.41634 12.3163 6.7 13.2 6.7C14.0837 6.7 14.8 7.41635 14.8 8.3C14.8 9.18366 14.0837 9.9 13.2 9.9C12.3163 9.9 11.6 9.18366 11.6 8.3ZM6.8 8.3H11.6" />
16
14
  </svg>
17
15
  );
18
16
  };
@@ -1,15 +1,14 @@
1
1
  export const ChainlinkMarkIcon = () => {
2
2
  return (
3
3
  <svg
4
- width="24"
5
- height="24"
6
- viewBox="0 0 24 24"
4
+ width="17.35"
5
+ height="20"
6
+ viewBox="0 0 17.35 20"
7
7
  fill="none"
8
8
  xmlns="http://www.w3.org/2000/svg"
9
9
  >
10
- <rect width="24" height="24" rx="4" fill="white" fillOpacity="0.03" />
11
10
  <path
12
- d="M12.0667 5L6 8.5V15.5L12.0667 19L18.1333 15.5V8.5L12.0667 5ZM15.5632 14.0166L12.0678 16.0331L8.57239 14.0166V9.98344L12.0678 7.96688L15.5632 9.98344V14.0166Z"
11
+ d="M8.67502 0L0 5L5.56362e-07 15L8.67502 20L17.35 15L17.35 5L8.67502 0ZM13.6749 12.8808L8.67663 15.7615L3.67838 12.8808L3.67838 7.1192L8.67663 4.2384L13.6749 7.1192L13.6749 12.8808Z"
13
12
  fill="#0847F7"
14
13
  />
15
14
  </svg>
@@ -0,0 +1,22 @@
1
+ export const CheckCircleThinIcon = ({
2
+ className,
3
+ }: {
4
+ className?: string;
5
+ }) => {
6
+ return (
7
+ <svg
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ width="24"
10
+ height="24"
11
+ viewBox="0 0 24 24"
12
+ fill="currentColor"
13
+ className={className}
14
+ >
15
+ <path
16
+ fillRule="evenodd"
17
+ clipRule="evenodd"
18
+ d="M12 0C18.6274 0 24 5.37258 24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0ZM15.0195 8L9.96582 13.0801L7.65137 10.7539H6.54102L6.5 12.5166L6.54102 12.5576V12.8184H6.80078L9.96582 16L15.8711 10.0654H17.5V8H15.0195Z"
19
+ />
20
+ </svg>
21
+ );
22
+ };
@@ -0,0 +1,39 @@
1
+ export const ChevronDownThinIcon = ({ className }: { className?: string }) => {
2
+ return (
3
+ <svg
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ width="24"
6
+ height="24"
7
+ viewBox="0 0 24 24"
8
+ fill="none"
9
+ stroke="currentColor"
10
+ strokeLinejoin="round"
11
+ className={className}
12
+ >
13
+ <path d="M16 9.75V10.2509L12.7071 13.5438C12.3166 13.9343 11.6834 13.9343 11.2929 13.5438L8 10.2509V9.75" />
14
+ </svg>
15
+ );
16
+ };
17
+
18
+ // Smaller variant used inside the wallet address chip; the glyph-to-box
19
+ // ratio differs from the 24px icon, so it is a separate drawing.
20
+ export const ChevronDownThinSmallIcon = ({
21
+ className,
22
+ }: {
23
+ className?: string;
24
+ }) => {
25
+ return (
26
+ <svg
27
+ xmlns="http://www.w3.org/2000/svg"
28
+ width="16"
29
+ height="16"
30
+ viewBox="0 0 16 16"
31
+ fill="none"
32
+ stroke="currentColor"
33
+ strokeLinejoin="round"
34
+ className={className}
35
+ >
36
+ <path d="M10 6.75V7.24546L8.70711 8.53836C8.31658 8.92888 7.68342 8.92888 7.29289 8.53836L6 7.24546V6.75" />
37
+ </svg>
38
+ );
39
+ };
@@ -0,0 +1,18 @@
1
+ export const ChevronDownWideThinIcon = ({
2
+ className,
3
+ }: {
4
+ className?: string;
5
+ }) => {
6
+ return (
7
+ <svg
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ width="24"
10
+ height="24"
11
+ viewBox="0 0 24 24"
12
+ fill="currentColor"
13
+ className={className}
14
+ >
15
+ <path d="M11.9999 14.5001L6.99998 9.49994L12 10.75L17 9.49994L11.9999 14.5001Z" />
16
+ </svg>
17
+ );
18
+ };
@@ -0,0 +1,21 @@
1
+ export const ChevronsUpDownThinIcon = ({
2
+ className,
3
+ }: {
4
+ className?: string;
5
+ }) => {
6
+ return (
7
+ <svg
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ width="9"
10
+ height="15.1734"
11
+ viewBox="0 0 9 15.1734"
12
+ fill="none"
13
+ stroke="currentColor"
14
+ strokeLinejoin="round"
15
+ className={className}
16
+ >
17
+ <path d="M8.5 10.5867V11.0876L5.20711 14.3805C4.81658 14.7711 4.18342 14.7711 3.79289 14.3805L0.5 11.0876V10.5867" />
18
+ <path d="M0.5 4.58671L0.5 4.08579L3.79289 0.792893C4.18342 0.402369 4.81658 0.402369 5.20711 0.792893L8.5 4.08579L8.5 4.58671" />
19
+ </svg>
20
+ );
21
+ };
@@ -3,16 +3,12 @@ export const ClockIcon = ({ className }: { className?: string }) => {
3
3
  <svg
4
4
  xmlns="http://www.w3.org/2000/svg"
5
5
  fill="none"
6
- viewBox="0 0 24 24"
7
- strokeWidth={1.5}
6
+ viewBox="0 0 16 16"
8
7
  stroke="currentColor"
9
8
  className={className}
10
9
  >
11
- <path
12
- strokeLinecap="round"
13
- strokeLinejoin="round"
14
- d="M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"
15
- />
10
+ <path d="M8 0.5C12.1421 0.5 15.5 3.85786 15.5 8C15.5 12.0748 12.2503 15.3875 8.20117 15.4941L4.35352 11.6465C3.67047 10.924 2.67065 9.92446 1.84375 9.10742C1.42752 8.69616 1.05392 8.32896 0.78418 8.06543C0.671658 7.9555 0.576752 7.86393 0.504883 7.79395C0.614072 3.7471 3.92679 0.5 8 0.5Z" />
11
+ <path d="M8 4V8H10.0011" />
16
12
  </svg>
17
13
  );
18
14
  };
@@ -3,13 +3,18 @@ import { FC } from "react";
3
3
  export const CloseIcon: FC<{ className?: string }> = ({ className }) => {
4
4
  return (
5
5
  <svg
6
- height="18"
7
- width="18"
6
+ // Native 10x9 glyph size from the design; pass className to resize
7
+ height="9"
8
+ width="10"
8
9
  xmlns="http://www.w3.org/2000/svg"
9
- viewBox="0 0 10.312 8.319"
10
+ viewBox="0 0 10 9"
11
+ fill="none"
12
+ stroke="currentColor"
10
13
  className={className || ""}
11
14
  >
12
- <path d="M6.073 4.078 10.151 0H9.093A1.87 1.87 0 0 0 7.77.548L5.157 3.162 2.543.548A1.87 1.87 0 0 0 1.22 0H.161L4.24 4.078 0 8.318h1.058a1.87 1.87 0 0 0 1.322-.547l2.777-2.777 2.776 2.777a1.869 1.869 0 0 0 1.322.548h1.058Z" />
15
+ {/* Hairline 1px stroke at any render size, as in the design */}
16
+ <path vectorEffect="non-scaling-stroke" d="M0 0.5H1L9 8.5H10" />
17
+ <path vectorEffect="non-scaling-stroke" d="M10 0.5H9L1 8.5H0" />
13
18
  </svg>
14
19
  );
15
20
  };
@@ -0,0 +1,22 @@
1
+ export const ErrorCircleThinIcon = ({
2
+ className,
3
+ }: {
4
+ className?: string;
5
+ }) => {
6
+ return (
7
+ <svg
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ width="24"
10
+ height="24"
11
+ viewBox="0 0 24 24"
12
+ fill="currentColor"
13
+ className={className}
14
+ >
15
+ <path
16
+ fillRule="evenodd"
17
+ clipRule="evenodd"
18
+ d="M12 0C18.6274 0 24 5.37258 24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0ZM11 16V18H13V16H11ZM10.5 6V8L11 10V14H13V10L13.5 8V6H10.5Z"
19
+ />
20
+ </svg>
21
+ );
22
+ };
@@ -0,0 +1,19 @@
1
+ export const LinkExternalThinIcon = ({
2
+ className,
3
+ }: {
4
+ className?: string;
5
+ }) => {
6
+ return (
7
+ <svg
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ width="12"
10
+ height="12"
11
+ viewBox="0 0 12 12"
12
+ fill="currentColor"
13
+ className={className}
14
+ >
15
+ <path d="M10.9226 10.9226H1.07744V1.07744H5.45455L4.3771 0H0V12H12V7.6229L10.9226 6.54545V10.9226Z" />
16
+ <path d="M7.07071 0L8.14815 1.07744H10.1549L7.81145 3.42088L8.57912 4.18855L10.9226 1.84512V3.83838L12 4.91582V0H7.07071Z" />
17
+ </svg>
18
+ );
19
+ };
@@ -0,0 +1,22 @@
1
+ export const LoadingRingIcon = ({ className }: { className?: string }) => {
2
+ return (
3
+ <svg
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ width="16"
6
+ height="16"
7
+ viewBox="0 0 16 16"
8
+ fill="none"
9
+ stroke="currentColor"
10
+ className={className}
11
+ >
12
+ <path
13
+ opacity="0.5"
14
+ d="M8 0.500001C12.1421 0.500001 15.5 3.85787 15.5 8C15.5 12.1421 12.1421 15.5 8 15.5C3.85787 15.5 0.500002 12.1421 0.500002 8C0.500002 3.85787 3.85787 0.500001 8 0.500001Z"
15
+ />
16
+ <path
17
+ d="M1 8C1 7.08075 1.18106 6.1705 1.53284 5.32122C1.88463 4.47194 2.40024 3.70026 3.05025 3.05025C3.70026 2.40024 4.47194 1.88463 5.32122 1.53284C6.17049 1.18106 7.08075 1 8 1"
18
+ strokeWidth="2"
19
+ />
20
+ </svg>
21
+ );
22
+ };
@@ -0,0 +1,29 @@
1
+ export const ProgressRingThinIcon = ({
2
+ className,
3
+ }: {
4
+ className?: string;
5
+ }) => {
6
+ return (
7
+ <svg
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ width="24"
10
+ height="24"
11
+ viewBox="0 0 24 24"
12
+ fill="none"
13
+ className={className}
14
+ >
15
+ <circle
16
+ cx="12"
17
+ cy="12"
18
+ r="11.5"
19
+ stroke="currentColor"
20
+ strokeOpacity="0.2"
21
+ />
22
+ {/* Progress arc keeps the fixed design blue, only the track follows currentColor */}
23
+ <path
24
+ stroke="#0747F7"
25
+ d="M21.3496 18.6959C20.202 20.2983 18.6618 21.5789 16.8768 22.4147C15.0919 23.2506 13.122 23.6136 11.1564 23.469C9.19071 23.3244 7.29521 22.6771 5.65176 21.589C4.0083 20.501 2.67207 19.0089 1.77129 17.2558C0.870505 15.5027 0.435407 13.5475 0.50775 11.5779C0.580093 9.60826 1.15745 7.69027 2.18441 6.00799C3.21137 4.32571 4.65347 2.93561 6.37231 1.97109C8.09114 1.00657 10.029 0.500001 12 0.500001"
26
+ />
27
+ </svg>
28
+ );
29
+ };
@@ -0,0 +1,15 @@
1
+ export const SearchThinIcon = ({ className }: { className?: string }) => {
2
+ return (
3
+ <svg
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ width="16"
6
+ height="16"
7
+ viewBox="0 0 16 16"
8
+ fill="none"
9
+ stroke="currentColor"
10
+ className={className}
11
+ >
12
+ <path d="M9.03101 11.5355L10.4947 13H12.5M10.4947 8C10.4947 10.7614 8.25731 13 5.49735 13C2.73739 13 0.5 10.7614 0.5 8C0.5 5.23858 2.73739 3 5.49735 3C8.25731 3 10.4947 5.23858 10.4947 8Z" />
13
+ </svg>
14
+ );
15
+ };
@@ -0,0 +1,15 @@
1
+ export const SignThinIcon = ({ className }: { className?: string }) => {
2
+ return (
3
+ <svg
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ width="24"
6
+ height="24"
7
+ viewBox="0 0 24 24"
8
+ fill="currentColor"
9
+ className={className}
10
+ >
11
+ <path d="M15.9892 5.83567L17.3734 4.45066C17.6619 4.16211 18.0533 4 18.4614 4C18.8694 4 19.2608 4.16211 19.5493 4.45066C19.8379 4.73921 20 5.13057 20 5.53864C20 5.94672 19.8379 6.33808 19.5493 6.62663L7.75954 18.4164C7.32576 18.85 6.79083 19.1686 6.20305 19.3436L4 20L4.6564 17.797C4.8314 17.2092 5.15004 16.6742 5.58357 16.2405L10 11.8244L15.9892 5.83567Z" />
12
+ <path d="M15.9892 5.83567L16.3427 6.18923L16.3428 6.18912L15.9892 5.83567ZM17.3734 4.45066L17.0198 4.09711L17.0197 4.09721L17.3734 4.45066ZM18.4614 4V3.5V4ZM19.5493 6.62663L19.9029 6.98018L19.5493 6.62663ZM7.75954 18.4164L8.11299 18.7701L8.1131 18.77L7.75954 18.4164ZM6.20305 19.3436L6.06038 18.8644L6.06028 18.8644L6.20305 19.3436ZM4 20L3.52082 19.8572L3.3293 20.5H4V20ZM4.6564 17.797L5.13558 17.9397L5.13561 17.9396L4.6564 17.797ZM5.58357 16.2405L5.23003 15.8869L5.22991 15.887L5.58357 16.2405ZM10 11.8244L10.3535 12.1779L10 11.8244ZM15.9892 5.83567L16.3428 6.18912L17.727 4.80411L17.3734 4.45066L17.0197 4.09721L15.6355 5.48222L15.9892 5.83567ZM17.3734 4.45066L17.7269 4.80421C17.9217 4.60943 18.1859 4.5 18.4614 4.5V4V3.5C17.9207 3.5 17.4021 3.71479 17.0198 4.09711L17.3734 4.45066ZM18.4614 4V4.5C18.7368 4.5 19.001 4.60943 19.1958 4.80421L19.5493 4.45066L19.9029 4.09711C19.5206 3.71479 19.002 3.5 18.4614 3.5V4ZM19.5493 4.45066L19.1958 4.80421C19.3906 4.999 19.5 5.26318 19.5 5.53864H20H20.5C20.5 4.99796 20.2852 4.47943 19.9029 4.09711L19.5493 4.45066ZM20 5.53864H19.5C19.5 5.81411 19.3906 6.07829 19.1958 6.27308L19.5493 6.62663L19.9029 6.98018C20.2852 6.59786 20.5 6.07933 20.5 5.53864H20ZM19.5493 6.62663L19.1958 6.27308L7.40599 18.0629L7.75954 18.4164L8.1131 18.77L19.9029 6.98018L19.5493 6.62663ZM7.75954 18.4164L7.40609 18.0628C7.03105 18.4376 6.56856 18.7131 6.06038 18.8644L6.20305 19.3436L6.34572 19.8228C7.0131 19.6241 7.62047 19.2623 8.11299 18.7701L7.75954 18.4164ZM6.20305 19.3436L6.06028 18.8644L3.85723 19.5208L4 20L4.14277 20.4792L6.34582 19.8228L6.20305 19.3436ZM4 20L4.47918 20.1428L5.13558 17.9397L4.6564 17.797L4.17722 17.6542L3.52082 19.8572L4 20ZM4.6564 17.797L5.13561 17.9396C5.28691 17.4314 5.56241 16.9689 5.93723 16.5939L5.58357 16.2405L5.22991 15.887C4.73768 16.3795 4.37588 16.9869 4.17719 17.6543L4.6564 17.797ZM4 20V20.5H12V20V19.5H4V20ZM12 20V20.5H15.1537V20V19.5H12V20ZM17.0869 20V20.5H18.59V20V19.5H17.0869V20ZM5.58357 16.2405L5.93711 16.594L10.3535 12.1779L10 11.8244L9.64646 11.4708L5.23003 15.8869L5.58357 16.2405ZM10 11.8244L10.3535 12.1779L16.3427 6.18923L15.9892 5.83567L15.6356 5.4821L9.64646 11.4708L10 11.8244ZM10 11.8244V11.3244H6.74576V11.8244V12.3244H10V11.8244ZM6.74576 9.5V10H7.04178V9.5V9H6.74576V9.5ZM8.5 8.04179H9V8H8.5H8V8.04179H8.5ZM7.04178 9.5V10C8.12328 10 9 9.12328 9 8.04179H8.5H8C8 8.57099 7.57099 9 7.04178 9V9.5ZM5.58357 10.6622H6.08357C6.08357 10.2965 6.38004 10 6.74576 10V9.5V9C5.82776 9 5.08357 9.74419 5.08357 10.6622H5.58357ZM6.74576 11.8244V11.3244C6.38004 11.3244 6.08357 11.0279 6.08357 10.6622H5.58357H5.08357C5.08357 11.5802 5.82776 12.3244 6.74576 12.3244V11.8244Z" />
13
+ </svg>
14
+ );
15
+ };
@@ -0,0 +1,24 @@
1
+ export const WalletCheckThinIcon = ({ className }: { className?: string }) => {
2
+ return (
3
+ <svg
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ width="24"
6
+ height="24"
7
+ viewBox="0 0 24 24"
8
+ fill="none"
9
+ className={className}
10
+ >
11
+ <rect x="3.5" y="4.5" width="17" height="15" rx="4.5" stroke="currentColor" />
12
+ <path
13
+ d="M16 6C18.7614 6 21 8.23858 21 11V15C21 17.7614 18.7614 20 16 20H8C5.23858 20 3 17.7614 3 15V11C3 8.23858 5.23858 6 8 6H16ZM4.0459 15.6104C4.05655 15.679 4.06905 15.747 4.08301 15.8145C4.05554 15.6816 4.03445 15.5464 4.02051 15.4092L4.0459 15.6104Z"
14
+ fill="currentColor"
15
+ />
16
+ {/* Check badge is a dark cutout over the filled wallet body, as in the design */}
17
+ <path
18
+ d="M17 10C20.3137 10 23 12.6863 23 16C23 19.3137 20.3137 22 17 22C13.6863 22 11 19.3137 11 16C11 12.6863 13.6863 10 17 10ZM18.5098 14.25L15.9834 16.79L14.8262 15.627H14.2705L14.25 16.5078L14.2705 16.5293V16.6592H14.4004L15.9834 18.25L18.9355 15.2822H19.75V14.25H18.5098Z"
19
+ fill="#121212"
20
+ />
21
+ <circle cx="17" cy="16" r="5.5" stroke="currentColor" />
22
+ </svg>
23
+ );
24
+ };
@@ -2,14 +2,17 @@ export const WarningIcon = ({ className }: { className?: string }) => {
2
2
  return (
3
3
  <svg
4
4
  xmlns="http://www.w3.org/2000/svg"
5
- viewBox="0 0 24 24"
6
- fill="currentColor"
5
+ viewBox="0 0 14 14"
6
+ fill="none"
7
7
  className={className}
8
8
  >
9
9
  <path
10
- fillRule="evenodd"
11
- d="M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003ZM12 8.25a.75.75 0 0 1 .75.75v3.75a.75.75 0 0 1-1.5 0V9a.75.75 0 0 1 .75-.75Zm0 8.25a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z"
12
- clipRule="evenodd"
10
+ d="M11 0C12.6568 6.60986e-05 14 1.34319 14 3V11C14 12.6568 12.6568 13.9999 11 14H3C1.34315 14 1.61073e-08 12.6569 0 11V3C1.28858e-07 1.34315 1.34315 0 3 0H11Z"
11
+ fill="#F46F28"
12
+ />
13
+ <path
14
+ d="M7.66699 9.66699V11H6.33301V9.66699H7.66699ZM8 3V4.33301L7.66699 5.66699V8.33301H6.33301V5.66699L6 4.33301V3H8Z"
15
+ fill="#0B0B0B"
13
16
  />
14
17
  </svg>
15
18
  );
@@ -12,8 +12,12 @@ export * from "./CaretsUpDownIcon";
12
12
  export * from "./CashbacklIcon";
13
13
  export * from "./ChainlinkIcon";
14
14
  export * from "./ChainlinkMarkIcon";
15
+ export * from "./CheckCircleThinIcon";
15
16
  export * from "./CheckIcon";
16
17
  export * from "./ChevronDownIcon";
18
+ export * from "./ChevronDownThinIcon";
19
+ export * from "./ChevronDownWideThinIcon";
20
+ export * from "./ChevronsUpDownThinIcon";
17
21
  export * from "./ChevronUpIcon";
18
22
  export * from "./CircularProgressIcon";
19
23
  export * from "./CloseIcon";
@@ -22,6 +26,7 @@ export * from "./CopyIcon";
22
26
  export * from "./DotGreenIcon";
23
27
  export * from "./DotRedIcon";
24
28
  export * from "./DownArrorIcon";
29
+ export * from "./ErrorCircleThinIcon";
25
30
  export * from "./ErrorIcon";
26
31
  export * from "./ErrorModalStatusIcon";
27
32
  export * from "./HelpIcon";
@@ -30,18 +35,24 @@ export * from "./HistoryIcon";
30
35
  export * from "./HourGlassIcon";
31
36
  export * from "./InfoIcon";
32
37
  export * from "./LinkExternalIcon";
38
+ export * from "./LinkExternalThinIcon";
39
+ export * from "./LoadingRingIcon";
33
40
  export * from "./PercentageIcon";
41
+ export * from "./ProgressRingThinIcon";
34
42
  export * from "./RankIcon";
35
43
  export * from "./SearchIcon";
44
+ export * from "./SearchThinIcon";
36
45
  export * from "./SettingsGradientBgIcon";
37
46
  export * from "./SettingsIcon";
38
47
  export * from "./SignIcon";
48
+ export * from "./SignThinIcon";
39
49
  export * from "./SuccessIcon";
40
50
  export * from "./SuccessModalStatusIcon";
41
51
  export * from "./ThumbUpRoundedIcon";
42
52
  export * from "./TimerIcon";
43
53
  export * from "./TokensIcon";
44
54
  export * from "./WaitingIcon";
55
+ export * from "./WalletCheckThinIcon";
45
56
  export * from "./WarningIcon";
46
57
  export * from "./WalletConnectIcon";
47
58
  export * from "./XMarkIcon";
@@ -7,6 +7,11 @@ import { FC, ReactNode } from "react";
7
7
  * - Modals needs to be inside all app's main contexts,
8
8
  * - Modals' need to rerender on props change.
9
9
  *
10
+ * Presentation follows the swap-v2 design:
11
+ * - sm and up: the content replaces the widget in place (fills the widget
12
+ * container with the same radius), or is centered when in overlay mode,
13
+ * - below sm: a bottom sheet pinned to the viewport with a drag handle.
14
+ *
10
15
  * Usage:
11
16
  * ```
12
17
  * const [open, setOpen] = useState(false);
@@ -30,12 +35,14 @@ export const Modal: FC<{
30
35
  return (
31
36
  <div
32
37
  className={`${
33
- overlay ? "fixed bg-[rgba(0,0,0,0.8)]" : "absolute"
34
- } top-0 left-0 right-0 bottom-0 flex items-center justify-center z-10 ${
38
+ overlay
39
+ ? "fixed bg-[rgba(0,0,0,0.8)]"
40
+ : "fixed sm:absolute bg-[rgba(2,2,2,0.8)] sm:bg-transparent"
41
+ } top-0 left-0 right-0 bottom-0 flex flex-col justify-end sm:justify-center items-center z-10 ${
35
42
  className || ""
36
43
  }`}
37
44
  onMouseDown={(e) => {
38
- if (e.target === e.currentTarget && overlay) {
45
+ if (e.target === e.currentTarget) {
39
46
  e.stopPropagation();
40
47
  e.nativeEvent.stopImmediatePropagation();
41
48
  e.preventDefault();
@@ -44,13 +51,11 @@ export const Modal: FC<{
44
51
  }}
45
52
  >
46
53
  <div
47
- className="flex flex-col bg-t_bg_primary rounded-[20px] border border-solid border-t_text_primary border-opacity-10 p-5 sm:p-6 w-full min-w-[340px]"
48
- style={{
49
- height: overlay ? "600px" : "100%",
50
- maxWidth: "636px",
51
- maxHeight: "100%",
52
- }}
54
+ className={`flex flex-col w-full bg-gradient-to-r from-t_bg_secondary/50 to-t_bg_secondary/50 bg-t_bg_primary border-t sm:border border-solid border-t_text_primary border-opacity-10 rounded-t-[24px] rounded-b-none sm:rounded-[32px] p-4 pt-2.5 sm:p-8 h-[85vh] max-h-full overflow-hidden ${
55
+ overlay ? "sm:h-[600px] sm:max-w-[636px]" : "sm:h-full"
56
+ }`}
53
57
  >
58
+ <div className="sm:hidden mx-auto mb-4 h-1 w-8 rounded-full bg-t_bg_tertiary bg-opacity-10 shrink-0" />
54
59
  {children}
55
60
  </div>
56
61
  </div>
@@ -3,17 +3,15 @@ import { ChainlinkMarkIcon } from "@src/assets/icons";
3
3
  export const PoweredBy = () => {
4
4
  return (
5
5
  <div className="flex justify-end items-center">
6
- <div className="flex items-center gap-2 p-2 rounded-lg bg-gradient-to-r from-t_bg_tertiary/0 to-t_bg_tertiary/5">
7
- <div className="flex items-center [&_svg]:h-6 [&_svg]:w-6">
6
+ <div className="flex items-center gap-2.5 px-3 py-2 rounded-lg bg-gradient-to-r from-t_bg_tertiary/0 to-t_bg_tertiary/5">
7
+ <div className="flex items-center [&_svg]:h-5 [&_svg]:w-auto">
8
8
  <ChainlinkMarkIcon />
9
9
  </div>
10
- <p className="text-sm whitespace-nowrap leading-6">
11
- <span className="text-t_text_primary text-opacity-50">
12
- {`Backed By `}
13
- </span>
14
- <span className="text-t_text_primary text-opacity-75">
15
- Chainlink.
10
+ <p className="text-xs whitespace-nowrap leading-5 tracking-[0.015em]">
11
+ <span className="text-t_text_primary text-opacity-70">
12
+ {`POWERED BY `}
16
13
  </span>
14
+ <span className="text-t_text_primary">CCIP.</span>
17
15
  </p>
18
16
  </div>
19
17
  </div>
@@ -1,20 +1,18 @@
1
1
  import { useSwapContext } from "@src/context";
2
2
  import { Controls } from "./Controls";
3
3
 
4
- const DEFAULT_WIDGET_TITLE = "XLane.";
5
-
6
4
  type Props = {
7
5
  onClose: () => void;
8
6
  };
9
7
  export const Header = ({ onClose }: Props) => {
10
- const { tab, integrationConfig } = useSwapContext();
8
+ const { tab, integrationConfig, bridgeUI } = useSwapContext();
11
9
 
12
10
  const title =
13
11
  tab === "Settings"
14
12
  ? "Preferences"
15
13
  : tab === "History"
16
14
  ? "My Activity"
17
- : integrationConfig.widgetTitle || DEFAULT_WIDGET_TITLE;
15
+ : integrationConfig.widgetTitle || (bridgeUI ? "Bridge" : "Swap");
18
16
 
19
17
  return (
20
18
  <div className="flex justify-between items-center">