@rash2x/bridge-widget 0.1.27 → 0.1.28

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.
@@ -426,25 +426,125 @@ const MetaMaskIcon = (props) => {
426
426
  return /* @__PURE__ */ jsxs(
427
427
  "svg",
428
428
  {
429
+ width: "31",
430
+ height: "31",
431
+ viewBox: "0 0 31 31",
432
+ fill: "none",
433
+ xmlns: "http://www.w3.org/2000/svg",
434
+ ...props,
435
+ children: [
436
+ /* @__PURE__ */ jsx(
437
+ "mask",
438
+ {
439
+ id: "mask0_13528_106779",
440
+ maskUnits: "userSpaceOnUse",
441
+ x: "0",
442
+ y: "0",
443
+ width: "31",
444
+ height: "31",
445
+ children: /* @__PURE__ */ jsx("circle", { cx: "15.5", cy: "15.5", r: "15.5", fill: "#190066" })
446
+ }
447
+ ),
448
+ /* @__PURE__ */ jsx("g", { mask: "url(#mask0_13528_106779)", children: /* @__PURE__ */ jsx("circle", { cx: "15.5", cy: "15.5", r: "15.5", fill: "#190066" }) }),
449
+ /* @__PURE__ */ jsxs("g", { "clip-path": "url(#clip0_13528_106779)", children: [
450
+ /* @__PURE__ */ jsx(
451
+ "path",
452
+ {
453
+ d: "M23.1854 23.0614L19.3864 21.9326L16.5214 23.6416L14.5224 23.6407L11.6556 21.9326L7.85821 23.0612L6.70312 19.1703L7.85821 14.8517L6.70312 11.2002L7.85821 6.6748L13.7921 10.2122H17.2517L23.1854 6.6748L24.3405 11.2002L23.1854 14.8515L24.3405 19.1701L23.1854 23.0614Z",
454
+ fill: "#FF5C16"
455
+ }
456
+ ),
457
+ /* @__PURE__ */ jsx(
458
+ "path",
459
+ {
460
+ d: "M7.85156 6.6748L13.7855 10.2149L13.5494 12.6443L7.85156 6.6748ZM11.6495 19.1716L14.2605 21.1561L11.6495 21.9323V19.1716ZM14.051 15.8903L13.5492 12.6456L10.3374 14.8519L10.3356 14.851V14.8528L10.3456 17.1237L11.6481 15.8903H14.051ZM23.1775 6.6748L17.2438 10.2149L17.4788 12.6443L23.1775 6.6748ZM19.3808 19.1716L16.7702 21.156L19.381 21.9321L19.3808 19.1716ZM20.693 14.8526V14.851L20.6922 14.8519L17.4801 12.6456L16.9784 15.8903H19.3806L20.6838 17.1237L20.693 14.8526Z",
461
+ fill: "#FF5C16"
462
+ }
463
+ ),
464
+ /* @__PURE__ */ jsx(
465
+ "path",
466
+ {
467
+ d: "M11.6558 21.9281L7.85821 23.0567L6.70312 19.1675H11.6558V21.9281ZM14.0577 15.8857L14.783 20.5764L13.7777 17.9685L10.3514 17.1201L11.6545 15.8859L14.0577 15.8857ZM19.388 21.9281L23.1856 23.0567L24.3407 19.1675H19.388V21.9281ZM16.9862 15.8857L16.2608 20.5764L17.2661 17.9685L20.6925 17.1201L19.3884 15.8859L16.9862 15.8857Z",
468
+ fill: "#E34807"
469
+ }
470
+ ),
471
+ /* @__PURE__ */ jsx(
472
+ "path",
473
+ {
474
+ d: "M6.70312 19.1685L7.85821 14.8496H10.3424L10.3515 17.1215L13.7779 17.9697L14.7832 20.5777L14.2664 21.1521L11.6558 19.1675H6.70312V19.1685ZM24.3409 19.1685L23.1858 14.8496H20.7016L20.6925 17.1215L17.2661 17.9697L16.2608 20.5777L16.7776 21.1521L19.3884 19.1675H24.3407L24.3409 19.1685ZM17.2519 10.21H13.7923L13.5571 12.6394L14.7834 20.5746H16.2608L17.488 12.6394L17.2519 10.21Z",
475
+ fill: "#FF8D5D"
476
+ }
477
+ ),
478
+ /* @__PURE__ */ jsx(
479
+ "path",
480
+ {
481
+ d: "M7.85821 6.6748L6.70312 11.2002L7.85821 14.8515H10.3424L13.556 12.6443L7.85821 6.6748ZM13.3407 16.8324H12.2154L11.6025 17.4318L13.7793 17.9705L13.3407 16.8317V16.8324ZM23.1856 6.6748L24.3407 11.2002L23.1856 14.8515H20.7014L17.4878 12.6443L23.1856 6.6748ZM17.705 16.8324H18.8317L19.4446 17.4327L17.2652 17.9721L17.705 16.8317V16.8324ZM16.5209 22.0935L16.7776 21.1554L16.261 20.5811H14.7828L14.2662 21.1554L14.523 22.0934",
482
+ fill: "#661800"
483
+ }
484
+ ),
485
+ /* @__PURE__ */ jsx(
486
+ "path",
487
+ {
488
+ d: "M16.5176 22.0928V23.6414H14.5195V22.0928H16.5176Z",
489
+ fill: "#C0C4CD"
490
+ }
491
+ ),
492
+ /* @__PURE__ */ jsx(
493
+ "path",
494
+ {
495
+ d: "M11.6602 21.9353L14.5277 23.6459V22.0971L14.2711 21.1592L11.6602 21.9353ZM19.3914 21.9353L16.5239 23.6459V22.0971L16.7805 21.1592L19.3914 21.9353Z",
496
+ fill: "#E7EBF6"
497
+ }
498
+ )
499
+ ] }),
500
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_13528_106779", children: /* @__PURE__ */ jsx(
501
+ "rect",
502
+ {
503
+ width: "17.7143",
504
+ height: "17.1664",
505
+ fill: "white",
506
+ transform: "translate(6.65234 6.64355)"
507
+ }
508
+ ) }) })
509
+ ]
510
+ }
511
+ );
512
+ };
513
+ const WalletConnectIcon = (props) => {
514
+ return /* @__PURE__ */ jsxs(
515
+ "svg",
516
+ {
517
+ width: "31",
518
+ height: "31",
519
+ viewBox: "0 0 31 31",
429
520
  fill: "none",
430
- height: "30",
431
- viewBox: "0 0 400 400",
432
- width: "30",
433
521
  xmlns: "http://www.w3.org/2000/svg",
434
- xmlnsXlink: "http://www.w3.org/1999/xlink",
435
522
  ...props,
436
523
  children: [
437
- /* @__PURE__ */ jsx("clipPath", { id: "a", children: /* @__PURE__ */ jsx("path", { d: "m0 0h400v400h-400z" }) }),
438
- /* @__PURE__ */ jsxs("g", { clipPath: "url(#a)", children: [
439
- /* @__PURE__ */ jsx("circle", { cx: "200", cy: "200", fill: "#3396ff", r: "199.5", stroke: "#66b1ff" }),
524
+ /* @__PURE__ */ jsxs("g", { "clip-path": "url(#clip0_13528_106803)", children: [
525
+ /* @__PURE__ */ jsx(
526
+ "path",
527
+ {
528
+ d: "M15.5 31C6.93959 31 0 24.0604 0 15.5C0 6.93959 6.93959 0 15.5 0C24.0604 0 31 6.93959 31 15.5C31 24.0604 24.0604 31 15.5 31Z",
529
+ fill: "#2A425C"
530
+ }
531
+ ),
440
532
  /* @__PURE__ */ jsx(
441
533
  "path",
442
534
  {
443
- d: "m122.519 148.965c42.791-41.729 112.171-41.729 154.962 0l5.15 5.022c2.14 2.086 2.14 5.469 0 7.555l-17.617 17.18c-1.07 1.043-2.804 1.043-3.874 0l-7.087-6.911c-29.853-29.111-78.253-29.111-108.106 0l-7.59 7.401c-1.07 1.043-2.804 1.043-3.874 0l-17.617-17.18c-2.14-2.086-2.14-5.469 0-7.555zm191.397 35.529 15.679 15.29c2.14 2.086 2.14 5.469 0 7.555l-70.7 68.944c-2.139 2.087-5.608 2.087-7.748 0l-50.178-48.931c-.535-.522-1.402-.522-1.937 0l-50.178 48.931c-2.139 2.087-5.608 2.087-7.748 0l-70.7015-68.945c-2.1396-2.086-2.1396-5.469 0-7.555l15.6795-15.29c2.1396-2.086 5.6085-2.086 7.7481 0l50.1789 48.932c.535.522 1.402.522 1.937 0l50.177-48.932c2.139-2.087 5.608-2.087 7.748 0l50.179 48.932c.535.522 1.402.522 1.937 0l50.179-48.931c2.139-2.087 5.608-2.087 7.748 0z",
444
- fill: "#fff"
535
+ d: "M20.364 14.1881L22.1887 12.3747C18.0647 8.27614 12.9404 8.27614 8.81641 12.3747L10.6411 14.1881C13.7775 11.071 17.2297 11.071 20.3661 14.1881H20.364Z",
536
+ fill: "#3A99FB"
537
+ }
538
+ ),
539
+ /* @__PURE__ */ jsx(
540
+ "path",
541
+ {
542
+ d: "M19.7567 18.4127L15.5013 14.1836L11.2459 18.4127L6.9905 14.1836L5.16797 15.9949L11.2459 22.0374L15.5013 17.8083L19.7567 22.0374L25.8346 15.9949L24.0121 14.1836L19.7567 18.4127Z",
543
+ fill: "#3A99FB"
445
544
  }
446
545
  )
447
- ] })
546
+ ] }),
547
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_13528_106803", children: /* @__PURE__ */ jsx("rect", { width: "31", height: "31", fill: "white" }) }) })
448
548
  ]
449
549
  }
450
550
  );
@@ -1194,7 +1294,7 @@ const TokenRow = ({
1194
1294
  Button,
1195
1295
  {
1196
1296
  onClick: onPick,
1197
- className: `w-full bg-transparent flex items-center justify-between gap-3 px-5 hover:bg-accent hover:scale-100 ${isSelected ? "border border-ring" : ""}`,
1297
+ className: `w-full rounded-sm bg-transparent flex items-center justify-between gap-3 px-5 hover:bg-accent hover:scale-100 ${isSelected ? "border border-ring" : ""}`,
1198
1298
  children: [
1199
1299
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
1200
1300
  /* @__PURE__ */ jsx(
@@ -1388,7 +1488,7 @@ const TokenSelectModal = ({
1388
1488
  }
1389
1489
  )
1390
1490
  ] }),
1391
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-auto -mx-5", children: hasNoResults ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground px-5 py-4", children: t2("bridge.noResults") }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1491
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-auto -mx-3", children: hasNoResults ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground px-5 py-4", children: t2("bridge.noResults") }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1392
1492
  effectiveTab === "my" && myTokens.length === 0 && /* @__PURE__ */ jsx("p", { className: "leading-4 text-base font-semibold text-muted-foreground uppercase px-5 py-2", children: t2("bridge.noBalancesFound") }),
1393
1493
  tokensToRender.map(({ token, willChangeSrc }) => {
1394
1494
  const bal = getBalance(token.symbol);
@@ -1558,7 +1658,7 @@ const SelectTokenButton = ({
1558
1658
  alt: label
1559
1659
  }
1560
1660
  ),
1561
- /* @__PURE__ */ jsx("span", { className: "text-secondary-foreground text-sm font-semibold", children: label })
1661
+ /* @__PURE__ */ jsx("span", { children: label })
1562
1662
  ] }),
1563
1663
  /* @__PURE__ */ jsx(ArrowDownIcon, { className: "w-4 h-4 text-secondary-foreground" })
1564
1664
  ]
@@ -2238,7 +2338,7 @@ const SelectNetworkButton = ({
2238
2338
  alt: label
2239
2339
  }
2240
2340
  ),
2241
- /* @__PURE__ */ jsx("span", { className: "text-secondary-foreground text-sm leading-5 font-semibold ", children: label })
2341
+ /* @__PURE__ */ jsx("span", { children: label })
2242
2342
  ] }),
2243
2343
  /* @__PURE__ */ jsx(ArrowDownIcon, { className: "w-4 h-4 text-secondary-foreground" })
2244
2344
  ]
@@ -2257,7 +2357,7 @@ const normalizeValue = (value, max) => {
2257
2357
  }
2258
2358
  return void 0;
2259
2359
  };
2260
- const CurrencyInput = forwardRef(
2360
+ const TokenInput = forwardRef(
2261
2361
  ({
2262
2362
  value,
2263
2363
  onAmountChange,
@@ -2282,7 +2382,7 @@ const CurrencyInput = forwardRef(
2282
2382
  [max, onAmountChange]
2283
2383
  );
2284
2384
  if (showSkeleton && readOnly) {
2285
- return /* @__PURE__ */ jsx(Skeleton, { className: cn("h-8 w-1/3 rounded-md", className) });
2385
+ return /* @__PURE__ */ jsx(Skeleton, { className: cn("h-12 w-1/3 rounded-md", className) });
2286
2386
  }
2287
2387
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2288
2388
  Input,
@@ -2305,7 +2405,7 @@ const CurrencyInput = forwardRef(
2305
2405
  ) });
2306
2406
  }
2307
2407
  );
2308
- CurrencyInput.displayName = "CurrencyInput";
2408
+ TokenInput.displayName = "TokenInput";
2309
2409
  const ChainSelectModal = ({
2310
2410
  isOpen,
2311
2411
  onClose,
@@ -2378,7 +2478,7 @@ const ChainSelectModal = ({
2378
2478
  Button,
2379
2479
  {
2380
2480
  onClick: () => onChainPick(chain, willChangeSrc),
2381
- className: `w-full cursor-pointer flex shadow-none items-center justify-between gap-3 px-5 py-4 h-13 font-extrabold capitalize hover:bg-muted bg-transparent rounded-md transition-[300] ${isSelected ? "border border-ring" : ""}`,
2481
+ className: `w-full cursor-pointer flex shadow-none rounded-sm items-center justify-between gap-3 px-5 py-4 h-13 font-extrabold capitalize hover:bg-muted bg-transparent transition-[300] ${isSelected ? "border border-ring" : ""}`,
2382
2482
  children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
2383
2483
  /* @__PURE__ */ jsx(
2384
2484
  NetworkSymbol,
@@ -2573,7 +2673,7 @@ const SwapSection = ({
2573
2673
  }
2574
2674
  ),
2575
2675
  /* @__PURE__ */ jsx(
2576
- CurrencyInput,
2676
+ TokenInput,
2577
2677
  {
2578
2678
  value: amount,
2579
2679
  onAmountChange: useCallback(
@@ -3642,8 +3742,7 @@ const WalletSelectModal = () => {
3642
3742
  ).map((connector) => ({
3643
3743
  id: connector.id,
3644
3744
  name: connector.name,
3645
- icon: MetaMaskIcon,
3646
- // You can add a WalletConnect icon here
3745
+ icon: connector.id === "metaMaskSDK" ? MetaMaskIcon : WalletConnectIcon,
3647
3746
  enabled: true
3648
3747
  }));
3649
3748
  const tronWallets = [
@@ -3696,14 +3795,12 @@ const WalletSelectModal = () => {
3696
3795
  /* @__PURE__ */ jsx("div", { className: "py-2 font-semibold text-muted-foreground uppercase", children: t2("wallets.connected") }),
3697
3796
  /* @__PURE__ */ jsx("div", { className: "", children: connectedWallets.map((wallet) => {
3698
3797
  const IconComponent = wallet.icon;
3699
- return /* @__PURE__ */ jsx("div", { className: "-mx-5", children: /* @__PURE__ */ jsxs(Button, { className: "w-full cursor-pointer bg-transparent flex shadow-none items-center justify-between gap-3 px-5 py-3 hover:bg-muted h-auto rounded-md transition-[300]", children: [
3700
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3 min-w-0", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
3701
- /* @__PURE__ */ jsx("div", { className: "w-8 h-8 flex items-center justify-center", children: /* @__PURE__ */ jsx(IconComponent, { className: "w-8 h-8" }) }),
3702
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start min-w-0", children: [
3703
- /* @__PURE__ */ jsx("p", { className: "font-extrabold text-foreground text-sm leading-4 truncate", children: short(wallet.address) }),
3704
- /* @__PURE__ */ jsx("div", { className: "text-xs leading-3 font-semibold text-muted-foreground", children: wallet.name })
3705
- ] })
3706
- ] }) }),
3798
+ return /* @__PURE__ */ jsx("div", { className: "-mx-3", children: /* @__PURE__ */ jsxs(Button, { className: "w-full cursor-pointer bg-transparent flex shadow-none items-center justify-start gap-3 px-3 py-3 hover:bg-muted h-auto rounded-md transition-[300]", children: [
3799
+ /* @__PURE__ */ jsx(IconComponent, { className: "min-w-8 min-h-8" }),
3800
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start min-w-0", children: [
3801
+ /* @__PURE__ */ jsx("p", { className: "font-extrabold text-foreground text-sm leading-4 truncate", children: short(wallet.address) }),
3802
+ /* @__PURE__ */ jsx("div", { className: "text-xs leading-3 font-semibold text-muted-foreground", children: wallet.name })
3803
+ ] }),
3707
3804
  /* @__PURE__ */ jsx(
3708
3805
  "div",
3709
3806
  {
@@ -3711,8 +3808,8 @@ const WalletSelectModal = () => {
3711
3808
  wallet.onDisconnect();
3712
3809
  onClose();
3713
3810
  },
3714
- className: "text-sm font-medium text-muted-foreground",
3715
- children: /* @__PURE__ */ jsx(ExitIcon, { className: "text-[#808080] w-6 h-6" })
3811
+ className: "text-sm ml-auto font-medium text-muted-foreground",
3812
+ children: /* @__PURE__ */ jsx(ExitIcon, { className: "text-muted-foreground w-6 h-6" })
3716
3813
  }
3717
3814
  )
3718
3815
  ] }) }, wallet.id);
@@ -3720,11 +3817,11 @@ const WalletSelectModal = () => {
3720
3817
  ] }),
3721
3818
  categories.map((category) => /* @__PURE__ */ jsxs("div", { children: [
3722
3819
  /* @__PURE__ */ jsx("div", { className: "py-2 font-semibold text-muted-foreground uppercase", children: category.title }),
3723
- /* @__PURE__ */ jsx("div", { className: "-mx-5", children: category.wallets.map((wallet) => {
3820
+ /* @__PURE__ */ jsx("div", { className: "-mx-3", children: category.wallets.map((wallet) => {
3724
3821
  const IconComponent = wallet.icon;
3725
3822
  const isEvmConnector = category.title === t2("wallets.evmWallets");
3726
3823
  const connector = isEvmConnector ? connectors.find((c) => c.id === wallet.id) : null;
3727
- return /* @__PURE__ */ jsx("div", { className: "", children: /* @__PURE__ */ jsx(
3824
+ return /* @__PURE__ */ jsx("div", { className: "", children: /* @__PURE__ */ jsxs(
3728
3825
  Button,
3729
3826
  {
3730
3827
  type: "button",
@@ -3737,14 +3834,14 @@ const WalletSelectModal = () => {
3737
3834
  }
3738
3835
  },
3739
3836
  disabled: isEvmConnector ? isPending : !wallet.enabled,
3740
- className: "w-full cursor-pointer bg-transparent flex shadow-none items-center justify-between gap-3 px-5 py-3 hover:bg-muted h-auto rounded-md transition-[300] disabled:opacity-50 disabled:cursor-not-allowed",
3741
- children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [
3742
- /* @__PURE__ */ jsx("div", { className: "w-8 flex items-center justify-center", children: /* @__PURE__ */ jsx(IconComponent, { className: "w-8 h-8" }) }),
3837
+ className: "w-full cursor-pointer bg-transparent flex shadow-none items-center justify-start gap-3 px-3 py-3 hover:bg-muted h-auto rounded-sm transition-[300] disabled:opacity-50 disabled:cursor-not-allowed",
3838
+ children: [
3839
+ /* @__PURE__ */ jsx(IconComponent, { className: "min-w-8 min-h-8" }),
3743
3840
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start min-w-0", children: [
3744
3841
  /* @__PURE__ */ jsx("p", { className: "font-extrabold text-foreground text-sm leading-4 truncate", children: wallet.name }),
3745
3842
  wallet.comingSoon ? /* @__PURE__ */ jsx("div", { className: "text-xs leading-3 font-semibold text-muted-foreground", children: t2("wallets.comingSoon") }) : /* @__PURE__ */ jsx("div", { className: "text-xs leading-3 font-semibold text-muted-foreground", children: t2("wallets.connect") })
3746
3843
  ] })
3747
- ] })
3844
+ ]
3748
3845
  }
3749
3846
  ) }, wallet.id);
3750
3847
  }) })