@rash2x/bridge-widget 0.1.9 → 0.1.11

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.
@@ -4,14 +4,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4
4
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
5
5
  import { useTranslation } from "react-i18next";
6
6
  import * as require$$0 from "react";
7
- import require$$0__default, { useState, useCallback, createContext, useContext, useRef, useEffect, useMemo, memo, forwardRef } from "react";
7
+ import require$$0__default, { useState, useCallback, useMemo, createContext, useContext, useEffect, memo, forwardRef, useRef } from "react";
8
8
  import { create as create$1 } from "zustand";
9
9
  import { Slot } from "@radix-ui/react-slot";
10
10
  import { cva } from "class-variance-authority";
11
11
  import { clsx } from "clsx";
12
12
  import { twMerge } from "tailwind-merge";
13
- import { createPortal } from "react-dom";
14
- import { AnimatePresence, motion } from "framer-motion";
13
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
14
+ import { XIcon, X, ChevronDownIcon } from "lucide-react";
15
15
  import * as TooltipPrimitive from "@radix-ui/react-tooltip";
16
16
  import { useAccount, useConnect, useDisconnect, useWalletClient, usePublicClient } from "wagmi";
17
17
  import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks";
@@ -20,7 +20,7 @@ import { useQuery, useQueryClient } from "@tanstack/react-query";
20
20
  import { Address, beginCell as beginCell$1, storeMessage, loadMessage, Cell } from "@ton/core";
21
21
  import { VariableSizeList } from "react-window";
22
22
  import * as SwitchPrimitive from "@radix-ui/react-switch";
23
- import { X, ChevronDownIcon } from "lucide-react";
23
+ import { AnimatePresence, motion } from "framer-motion";
24
24
  import * as AccordionPrimitive from "@radix-ui/react-accordion";
25
25
  import { t } from "i18next";
26
26
  import { toast, Toaster } from "sonner";
@@ -267,32 +267,6 @@ const ArrowSwapIcon = (props) => {
267
267
  }
268
268
  );
269
269
  };
270
- const CloseIcon = (props) => {
271
- return /* @__PURE__ */ jsxs(
272
- "svg",
273
- {
274
- width: "24",
275
- height: "24",
276
- viewBox: "0 0 24 24",
277
- fill: "none",
278
- xmlns: "http://www.w3.org/2000/svg",
279
- ...props,
280
- children: [
281
- /* @__PURE__ */ jsx("rect", { width: "24", height: "24", rx: "12", fill: "black", fillOpacity: "0.8" }),
282
- /* @__PURE__ */ jsx(
283
- "path",
284
- {
285
- d: "M16 8.00005L8 16M16 16L8 8",
286
- stroke: "white",
287
- strokeWidth: "1.5",
288
- strokeLinecap: "round",
289
- strokeLinejoin: "round"
290
- }
291
- )
292
- ]
293
- }
294
- );
295
- };
296
270
  const SearchIcon = (props) => {
297
271
  return /* @__PURE__ */ jsxs(
298
272
  "svg",
@@ -550,142 +524,103 @@ const Button = require$$0.forwardRef(
550
524
  }
551
525
  );
552
526
  Button.displayName = "Button";
553
- const ModalContainerContext = createContext(void 0);
554
- const ModalContainerProvider = ({
555
- containerId,
556
- children
557
- }) => {
558
- return /* @__PURE__ */ jsx(ModalContainerContext.Provider, { value: containerId, children });
559
- };
560
- const useModalContainer = () => {
561
- const containerId = useContext(ModalContainerContext);
562
- if (typeof document === "undefined") {
563
- return null;
564
- }
565
- if (!containerId) {
566
- return document.body;
567
- }
568
- return document.getElementById(containerId) || document.body;
569
- };
570
- const ModalContent = ({ children, className }) => {
571
- return /* @__PURE__ */ jsx("div", { className: cn("p-5 flex flex-col h-full", className), children });
572
- };
573
- const ModalHeader = ({ children, className }) => {
574
- return /* @__PURE__ */ jsx(
575
- "div",
576
- {
577
- className: cn("relative flex gap-4 flex-col justify-between", className),
578
- children
579
- }
580
- );
581
- };
582
- const ModalTitle = ({ children, className }) => {
527
+ function Dialog({
528
+ ...props
529
+ }) {
530
+ return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
531
+ }
532
+ function DialogPortal({
533
+ ...props
534
+ }) {
535
+ return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
536
+ }
537
+ function DialogOverlay({
538
+ className,
539
+ ...props
540
+ }) {
583
541
  return /* @__PURE__ */ jsx(
584
- "h2",
542
+ DialogPrimitive.Overlay,
585
543
  {
544
+ "data-slot": "dialog-overlay",
586
545
  className: cn(
587
- "text-2xl leading-7.5 font-bold font-display text-dialog-foreground",
546
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
588
547
  className
589
548
  ),
590
- children
549
+ ...props
591
550
  }
592
551
  );
593
- };
594
- const ModalDescription = ({ children, className }) => {
552
+ }
553
+ function DialogContent({
554
+ className,
555
+ children,
556
+ showCloseButton = true,
557
+ ...props
558
+ }) {
559
+ return /* @__PURE__ */ jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
560
+ /* @__PURE__ */ jsx(DialogOverlay, {}),
561
+ /* @__PURE__ */ jsxs(
562
+ DialogPrimitive.Content,
563
+ {
564
+ "data-slot": "dialog-content",
565
+ className: cn(
566
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
567
+ className
568
+ ),
569
+ ...props,
570
+ children: [
571
+ children,
572
+ showCloseButton && /* @__PURE__ */ jsxs(
573
+ DialogPrimitive.Close,
574
+ {
575
+ "data-slot": "dialog-close",
576
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
577
+ children: [
578
+ /* @__PURE__ */ jsx(XIcon, {}),
579
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
580
+ ]
581
+ }
582
+ )
583
+ ]
584
+ }
585
+ )
586
+ ] });
587
+ }
588
+ function DialogHeader({ className, ...props }) {
595
589
  return /* @__PURE__ */ jsx(
596
- "p",
590
+ "div",
597
591
  {
598
- className: cn(
599
- "text-base font-medium text-muted-foreground leading-5",
600
- className
601
- ),
602
- children
592
+ "data-slot": "dialog-header",
593
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
594
+ ...props
603
595
  }
604
596
  );
605
- };
606
- const ModalClose = ({ onClick, children, className }) => {
597
+ }
598
+ function DialogTitle({
599
+ className,
600
+ ...props
601
+ }) {
607
602
  return /* @__PURE__ */ jsx(
608
- "button",
603
+ DialogPrimitive.Title,
609
604
  {
610
- className: cn(
611
- "cursor-pointer absolute right-0 top-0 p-0 bg-transparent rounded-full hover:bg-transparent shadow-none w-6 h-6",
612
- className
613
- ),
614
- onClick,
615
- children
605
+ "data-slot": "dialog-title",
606
+ className: cn("text-lg leading-none font-semibold", className),
607
+ ...props
616
608
  }
617
609
  );
618
- };
619
- const Modal = ({
620
- isOpen,
621
- onClose,
622
- children,
623
- className
624
- }) => {
625
- const panelRef = useRef(null);
626
- const lastActiveRef = useRef(null);
627
- const container = useModalContainer();
628
- useEffect(() => {
629
- if (!isOpen) return;
630
- lastActiveRef.current = document.activeElement;
631
- const t2 = setTimeout(() => {
632
- panelRef.current?.focus();
633
- }, 0);
634
- return () => {
635
- clearTimeout(t2);
636
- lastActiveRef.current?.focus?.();
637
- };
638
- }, [isOpen]);
639
- useEffect(() => {
640
- if (!isOpen) return;
641
- window.document.body.style.overflow = "hidden";
642
- const onKey = (e) => {
643
- if (e.key === "Escape") onClose();
644
- };
645
- window.addEventListener("keydown", onKey);
646
- return () => window.removeEventListener("keydown", onKey);
647
- }, [isOpen, onClose]);
648
- if (typeof document === "undefined") return null;
649
- return createPortal(
650
- /* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxs(
651
- motion.div,
652
- {
653
- className: "fixed m-auto border border-border max-w-md max-h-[80%] z-[100] bg-dialog sm:absolute sm:inset-0 sm:top-0 sm:bottom-0 sm:w-full rounded-xl",
654
- initial: { opacity: 0 },
655
- animate: { opacity: 1 },
656
- exit: { opacity: 0 },
657
- children: [
658
- /* @__PURE__ */ jsx(
659
- motion.div,
660
- {
661
- ref: panelRef,
662
- role: "dialog",
663
- "aria-modal": "true",
664
- tabIndex: -1,
665
- className: cn(
666
- "outline-none overflow-auto relative z-30 w-screen h-screen rounded-none sm:w-full sm:h-full sm:rounded-3xl",
667
- className
668
- ),
669
- initial: { opacity: 0, scale: 0.9 },
670
- animate: { opacity: 1, scale: 1 },
671
- exit: { opacity: 0, scale: 0.9 },
672
- transition: {
673
- type: "spring",
674
- stiffness: 480,
675
- damping: 32,
676
- mass: 0.6
677
- },
678
- onMouseDown: (e) => e.stopPropagation(),
679
- children
680
- }
681
- ),
682
- /* @__PURE__ */ jsx("div", { className: "fixed inset-0 backdrop-blur-sm bg-background/10 z-10" })
683
- ]
684
- }
685
- ) }),
686
- container
610
+ }
611
+ function DialogDescription({
612
+ className,
613
+ ...props
614
+ }) {
615
+ return /* @__PURE__ */ jsx(
616
+ DialogPrimitive.Description,
617
+ {
618
+ "data-slot": "dialog-description",
619
+ className: cn("text-muted-foreground text-sm", className),
620
+ ...props
621
+ }
687
622
  );
688
- };
623
+ }
689
624
  const TipIcon = (props) => {
690
625
  return /* @__PURE__ */ jsxs(
691
626
  "svg",
@@ -791,14 +726,7 @@ function TooltipContent({
791
726
  const Tip = (props) => {
792
727
  const { children, text } = props;
793
728
  return /* @__PURE__ */ jsxs(Tooltip, { children: [
794
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
795
- Button,
796
- {
797
- variant: "default",
798
- className: "cursor-pointer rounded-none shadow-none shrink-0 !p-0 !m-0 !w-fit !h-auto !bg-transparent hover:bg-transparent",
799
- children
800
- }
801
- ) }),
729
+ /* @__PURE__ */ jsx(TooltipTrigger, { children }),
802
730
  /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: text }) })
803
731
  ] });
804
732
  };
@@ -1066,10 +994,7 @@ const routePresets = [
1066
994
  RoutePriority.CHEAPEST,
1067
995
  RoutePriority.RECOMMENDED
1068
996
  ];
1069
- const SettingModal = ({
1070
- isOpen,
1071
- onClose
1072
- }) => {
997
+ const SettingModal = ({ isOpen, onClose }) => {
1073
998
  const { t: t2 } = useTranslation();
1074
999
  const { toChain } = useChainsStore();
1075
1000
  const { tokens } = useTokensStore();
@@ -1102,13 +1027,10 @@ const SettingModal = ({
1102
1027
  );
1103
1028
  const activeBtn = "bg-settings-active hover:bg-settings-active/80 text-settings-active-foreground";
1104
1029
  const notActiveBtn = "bg-settings-button hover:bg-settings-button/80 text-settings-button-foreground";
1105
- return /* @__PURE__ */ jsx(Modal, { isOpen, onClose, children: /* @__PURE__ */ jsxs(ModalContent, { children: [
1106
- /* @__PURE__ */ jsxs(ModalHeader, { children: [
1107
- /* @__PURE__ */ jsx(ModalTitle, { children: t2("settings.title", { defaultValue: "Settings" }) }),
1108
- /* @__PURE__ */ jsx(ModalClose, { className: "", onClick: onClose, children: /* @__PURE__ */ jsx(CloseIcon, { className: "size-6 p-0 [&>rect]:fill-modal-x [&>path]:stroke-modal-x-foreground" }) })
1109
- ] }),
1110
- /* @__PURE__ */ jsxs("div", { className: "space-y-5 mt-7.5", children: [
1111
- /* @__PURE__ */ jsxs("div", { className: "mt-2.5 flex flex-col gap-5", children: [
1030
+ return /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs(DialogContent, { children: [
1031
+ /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t2("settings.title", { defaultValue: "Settings" }) }) }),
1032
+ /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
1033
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5", children: [
1112
1034
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
1113
1035
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
1114
1036
  /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm font-medium leading-3.5", children: t2("settings.gasOnDestination") }),
@@ -1622,14 +1544,14 @@ const TokenRow = ({
1622
1544
  Button,
1623
1545
  {
1624
1546
  onClick: onPick,
1625
- className: `w-full h-[50px] cursor-pointer bg-transparent flex shadow-none items-center justify-between gap-2.5 px-5 py-2.5 hover:bg-modal-item-hover rounded-12 transition-[300] ${isSelected ? "border border-ring" : ""}`,
1547
+ className: `w-full h-12.5 rounded-md cursor-pointer bg-transparent flex shadow-none items-center justify-between gap-2.5 px-5 py-2.5 hover:bg-modal-item-hover transition-[300] ${isSelected ? "border border-ring" : ""}`,
1626
1548
  children: [
1627
1549
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
1628
1550
  /* @__PURE__ */ jsx(
1629
1551
  TokenSymbol,
1630
1552
  {
1631
1553
  symbol,
1632
- className: "w-7.5 h-7.5 rounded-full",
1554
+ className: "size-7.5 max-w-7.5 rounded-full",
1633
1555
  alt: symbol
1634
1556
  }
1635
1557
  ),
@@ -1677,7 +1599,7 @@ const VirtualizedTokenList = ({
1677
1599
  const bal = getBalance(node.token.symbol);
1678
1600
  const usd = getTokenUsdValue(node.token.symbol, node.token.price?.usd);
1679
1601
  const isSelected = selectedAssetSymbol?.toUpperCase() === node.token.symbol.toUpperCase();
1680
- return /* @__PURE__ */ jsx("div", { style, className: "px-0", children: /* @__PURE__ */ jsx(
1602
+ return /* @__PURE__ */ jsx(
1681
1603
  TokenRow,
1682
1604
  {
1683
1605
  symbol: node.token.symbol,
@@ -1689,7 +1611,7 @@ const VirtualizedTokenList = ({
1689
1611
  isBalanceLoading: balancesLoading,
1690
1612
  onPick: () => onPick(node.token.symbol, node.willChangeSrc)
1691
1613
  }
1692
- ) });
1614
+ );
1693
1615
  };
1694
1616
  const getItemSize = (index) => {
1695
1617
  const node = nodes[index];
@@ -1796,72 +1718,64 @@ const TokenSelectModal = ({
1796
1718
  }
1797
1719
  return out;
1798
1720
  }, [effectiveTab, myTokens, groupedTokens, t2]);
1799
- return /* @__PURE__ */ jsx(
1800
- Modal,
1801
- {
1802
- isOpen,
1803
- onClose: handleClose,
1804
- children: /* @__PURE__ */ jsxs(ModalContent, { children: [
1805
- /* @__PURE__ */ jsxs(ModalHeader, { children: [
1806
- /* @__PURE__ */ jsx(ModalTitle, { children: t2("bridge.selectToken") }),
1807
- /* @__PURE__ */ jsx(ModalClose, { onClick: handleClose, children: /* @__PURE__ */ jsx(CloseIcon, { className: "size-6 p-0 [&>rect]:fill-modal-x [&>path]:stroke-modal-x-foreground" }) })
1808
- ] }),
1809
- /* @__PURE__ */ jsxs(
1810
- "div",
1811
- {
1812
- className: `flex items-center gap-2.5 px-5 py-3.5 bg-input rounded-12 mt-6 h-12.5 transition-all duration-200 ${isFocused ? "border border-ring" : "border border-transparent"}`,
1813
- children: [
1814
- /* @__PURE__ */ jsx(SearchIcon, { className: "size-6 text-input-icon" }),
1815
- /* @__PURE__ */ jsx(
1816
- Input,
1817
- {
1818
- placeholder: t2("bridge.searchToken"),
1819
- className: "w-full outline-none leading-0 p-0 h-6 text-base text-input-text placeholder:text-input-placeholder bg-none dark:bg-transparent",
1820
- value: query,
1821
- onChange: (e) => setQuery(e.target.value),
1822
- onFocus: () => setIsFocused(true),
1823
- onBlur: () => setIsFocused(false)
1824
- }
1825
- )
1826
- ]
1827
- }
1828
- ),
1829
- hasAnyWallet() && /* @__PURE__ */ jsxs("div", { className: "mt-4 flex gap-2", children: [
1830
- /* @__PURE__ */ jsx(
1831
- Button,
1832
- {
1833
- className: `px-5 py-2.5 rounded-full text-sm font-bold hover:bg-filter-active hover:text-filter-active-foreground cursor-pointer ${tab === "my" ? "bg-filter-active text-filter-active-foreground" : "bg-filter text-filter-foreground"}`,
1834
- onClick: () => setTab("my"),
1835
- children: t2("bridge.myTokens")
1836
- }
1837
- ),
1838
- /* @__PURE__ */ jsx(
1839
- Button,
1840
- {
1841
- className: `px-4 py-2 rounded-full text-sm font-bold hover:bg-filter-active hover:text-filter-active-foreground cursor-pointer ${tab === "all" ? "bg-filter-active text-filter-active-foreground" : "bg-filter text-filter-foreground"}`,
1842
- onClick: () => setTab("all"),
1843
- children: t2("bridge.allTokens")
1844
- }
1845
- )
1846
- ] }),
1847
- /* @__PURE__ */ jsx("div", { className: "mt-4 flex-1 overflow-hidden", children: virtualNodes.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground px-5 py-3.5", children: t2("bridge.noResults") }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1848
- 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") }),
1721
+ return /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && handleClose(), children: /* @__PURE__ */ jsxs(DialogContent, { className: "!max-h-[80dvh] overflow-auto", children: [
1722
+ /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t2("bridge.selectToken") }) }),
1723
+ /* @__PURE__ */ jsxs(
1724
+ "div",
1725
+ {
1726
+ className: `flex items-center gap-2.5 px-5 py-3.5 bg-input rounded-12 h-12.5 transition-all duration-200 ${isFocused ? "border border-ring" : "border border-transparent"}`,
1727
+ children: [
1728
+ /* @__PURE__ */ jsx(SearchIcon, { className: "size-6 text-input-icon" }),
1849
1729
  /* @__PURE__ */ jsx(
1850
- VirtualizedTokenList,
1730
+ Input,
1851
1731
  {
1852
- nodes: virtualNodes,
1853
- balancesLoading: balancesQuery.isLoading || balancesQuery.isFetching,
1854
- hasAnyWallet: hasAnyWallet(),
1855
- selectedAssetSymbol,
1856
- getBalance,
1857
- getTokenUsdValue,
1858
- onPick
1732
+ placeholder: t2("bridge.searchToken"),
1733
+ className: "w-full outline-none leading-0 p-0 h-6 text-base text-input-text placeholder:text-input-placeholder bg-none dark:bg-transparent",
1734
+ value: query,
1735
+ onChange: (e) => setQuery(e.target.value),
1736
+ onFocus: () => setIsFocused(true),
1737
+ onBlur: () => setIsFocused(false)
1859
1738
  }
1860
1739
  )
1861
- ] }) })
1862
- ] })
1863
- }
1864
- );
1740
+ ]
1741
+ }
1742
+ ),
1743
+ hasAnyWallet() && /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
1744
+ /* @__PURE__ */ jsx(
1745
+ Button,
1746
+ {
1747
+ variant: tab === "my" ? "default" : "outline",
1748
+ onClick: () => setTab("my"),
1749
+ size: "sm",
1750
+ children: t2("bridge.myTokens")
1751
+ }
1752
+ ),
1753
+ /* @__PURE__ */ jsx(
1754
+ Button,
1755
+ {
1756
+ variant: tab === "all" ? "default" : "outline",
1757
+ onClick: () => setTab("all"),
1758
+ size: "sm",
1759
+ children: t2("bridge.allTokens")
1760
+ }
1761
+ )
1762
+ ] }),
1763
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-hidden -mx-5", children: virtualNodes.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground px-5 py-3.5", children: t2("bridge.noResults") }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1764
+ 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") }),
1765
+ /* @__PURE__ */ jsx(
1766
+ VirtualizedTokenList,
1767
+ {
1768
+ nodes: virtualNodes,
1769
+ balancesLoading: balancesQuery.isLoading || balancesQuery.isFetching,
1770
+ hasAnyWallet: hasAnyWallet(),
1771
+ selectedAssetSymbol,
1772
+ getBalance,
1773
+ getTokenUsdValue,
1774
+ onPick
1775
+ }
1776
+ )
1777
+ ] }) })
1778
+ ] }) });
1865
1779
  };
1866
1780
  const useBridgeQuoteStore = create$1((set) => ({
1867
1781
  inputAmount: "",
@@ -1995,7 +1909,7 @@ function Card({ className, ...props }) {
1995
1909
  {
1996
1910
  "data-slot": "card",
1997
1911
  className: cn(
1998
- "bg-card text-card-foreground flex flex-col gap-4 rounded-xl border py-4 shadow-sm",
1912
+ "bg-card text-card-foreground flex flex-col gap-4 rounded-lg border py-4 shadow-sm",
1999
1913
  className
2000
1914
  ),
2001
1915
  ...props
@@ -2724,7 +2638,7 @@ const ChainSelectModal = ({
2724
2638
  };
2725
2639
  const renderChainItem = (chain, willChangeSrc) => {
2726
2640
  const isSelected = fromChain?.chainKey === chain.chainKey || toChain?.chainKey === chain.chainKey;
2727
- return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
2641
+ return /* @__PURE__ */ jsx(
2728
2642
  Button,
2729
2643
  {
2730
2644
  onClick: () => onChainPick(chain, willChangeSrc),
@@ -2740,52 +2654,43 @@ const ChainSelectModal = ({
2740
2654
  ),
2741
2655
  /* @__PURE__ */ jsx("div", { className: "flex flex-col items-start", children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 ", children: /* @__PURE__ */ jsx("p", { className: "text-foreground text-base font-extrabold leading-[100%]", children: chain.name }) }) })
2742
2656
  ] })
2743
- }
2744
- ) }, chain.chainKey);
2657
+ },
2658
+ chain.chainKey
2659
+ );
2745
2660
  };
2746
- return /* @__PURE__ */ jsx(
2747
- Modal,
2748
- {
2749
- isOpen,
2750
- onClose: handleClose,
2751
- children: /* @__PURE__ */ jsxs(ModalContent, { children: [
2752
- /* @__PURE__ */ jsxs(ModalHeader, { children: [
2753
- /* @__PURE__ */ jsx(ModalTitle, { children: t2("bridge.selectNetwork") }),
2754
- /* @__PURE__ */ jsx(ModalClose, { onClick: handleClose, children: /* @__PURE__ */ jsx(CloseIcon, { className: "size-6 p-0 [&>rect]:fill-modal-x [&>path]:stroke-modal-x-foreground" }) })
2755
- ] }),
2756
- /* @__PURE__ */ jsxs(
2757
- "div",
2758
- {
2759
- className: `flex items-center gap-2.5 px-5 py-3.5 bg-input rounded-12 mt-6 h-12.5 transition-all duration-200 ${isFocused ? "border border-ring" : "border border-transparent"}`,
2760
- children: [
2761
- /* @__PURE__ */ jsx(SearchIcon, { className: "size-6 text-muted-foreground" }),
2762
- /* @__PURE__ */ jsx(
2763
- Input,
2764
- {
2765
- placeholder: t2("bridge.searchDestinationChain"),
2766
- className: "w-full outline-none leading-0 p-0 h-6 text-base text-foreground placeholder:text-muted-foreground bg-none dark:bg-transparent",
2767
- value: query,
2768
- onChange: (e) => setQuery(e.target.value),
2769
- onFocus: () => setIsFocused(true),
2770
- onBlur: () => setIsFocused(false)
2771
- }
2772
- )
2773
- ]
2774
- }
2775
- ),
2776
- /* @__PURE__ */ jsxs("div", { className: "mt-4 flex-1 overflow-y-auto", children: [
2777
- groupedChains.available.length > 0 && /* @__PURE__ */ jsx("div", { children: groupedChains.available.map((c) => renderChainItem(c, false)) }),
2778
- groupedChains.available.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
2779
- groupedChains.willChangeSrc.length > 0 && /* @__PURE__ */ jsx("p", { className: "px-5 py-2 leading-4 text-base font-semibold text-muted-foreground uppercase", children: t2("bridge.willChangeSourceChain") }),
2780
- groupedChains.willChangeSrc.length > 0 && groupedChains.willChangeSrc.map(
2781
- (c) => renderChainItem(c, true)
2782
- )
2783
- ] }),
2784
- groupedChains.available.length === 0 && groupedChains.willChangeSrc.length === 0 && /* @__PURE__ */ jsx("div", { className: "px-5 py-3.5 text-sm text-muted-foreground", children: t2("bridge.noResults") })
2785
- ] })
2786
- ] })
2787
- }
2788
- );
2661
+ return /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && handleClose(), children: /* @__PURE__ */ jsxs(DialogContent, { className: "!max-h-[80dvh] overflow-hidden", children: [
2662
+ /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t2("bridge.selectNetwork") }) }),
2663
+ /* @__PURE__ */ jsxs(
2664
+ "div",
2665
+ {
2666
+ className: `flex items-center gap-2.5 px-5 py-3.5 bg-input rounded-md h-12.5 transition-all duration-200 ${isFocused ? "border border-ring" : "border border-transparent"}`,
2667
+ children: [
2668
+ /* @__PURE__ */ jsx(SearchIcon, { className: "size-6 text-muted-foreground" }),
2669
+ /* @__PURE__ */ jsx(
2670
+ Input,
2671
+ {
2672
+ placeholder: t2("bridge.searchDestinationChain"),
2673
+ className: "w-full outline-none leading-0 p-0 h-6 text-base text-foreground placeholder:text-muted-foreground bg-none dark:bg-transparent",
2674
+ value: query,
2675
+ onChange: (e) => setQuery(e.target.value),
2676
+ onFocus: () => setIsFocused(true),
2677
+ onBlur: () => setIsFocused(false)
2678
+ }
2679
+ )
2680
+ ]
2681
+ }
2682
+ ),
2683
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto", children: [
2684
+ groupedChains.available.length > 0 && groupedChains.available.map((c) => renderChainItem(c, false)),
2685
+ groupedChains.available.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
2686
+ groupedChains.willChangeSrc.length > 0 && /* @__PURE__ */ jsx("p", { className: "px-5 py-2 leading-4 text-base font-semibold text-muted-foreground uppercase", children: t2("bridge.willChangeSourceChain") }),
2687
+ groupedChains.willChangeSrc.length > 0 && groupedChains.willChangeSrc.map(
2688
+ (c) => renderChainItem(c, true)
2689
+ )
2690
+ ] }),
2691
+ groupedChains.available.length === 0 && groupedChains.willChangeSrc.length === 0 && /* @__PURE__ */ jsx("div", { className: "px-5 py-3.5 text-sm text-muted-foreground", children: t2("bridge.noResults") })
2692
+ ] })
2693
+ ] }) });
2789
2694
  };
2790
2695
  const useWalletSelectModal = create$1((set) => ({
2791
2696
  isOpen: false,
@@ -3083,7 +2988,7 @@ const ToggleRow = ({ enabled, onToggle }) => {
3083
2988
  } catch {
3084
2989
  }
3085
2990
  };
3086
- return /* @__PURE__ */ jsxs("div", { className: "p-4 flex flex-col rounded-b-xl gap-2 bg-muted", children: [
2991
+ return /* @__PURE__ */ jsxs("div", { className: "p-4 flex flex-col rounded-b-lg gap-2 bg-muted", children: [
3087
2992
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
3088
2993
  /* @__PURE__ */ jsx("p", { className: "text-sm leading-4.5 font-medium text-muted-foreground", children: t2("bridge.sendToAnotherAddress") }),
3089
2994
  /* @__PURE__ */ jsx(
@@ -3351,8 +3256,8 @@ const Details = () => {
3351
3256
  })();
3352
3257
  const currentSlippageText = formatPercentage(slippageBps);
3353
3258
  const routeText = quote?.route ? getRouteDisplayName(quote.route) : t2(`settings.routePresets.${routePriority}`);
3354
- return /* @__PURE__ */ jsx(Accordion, { type: "single", collapsible: true, className: "w-full", children: /* @__PURE__ */ jsxs(AccordionItem, { value: "item-1", className: "bg-muted rounded-xl", children: [
3355
- /* @__PURE__ */ jsx(AccordionTrigger, { className: "w-full gap-1 items-center py-6 px-5 rounded-b-xl data-[state=open]:pb-3", children: /* @__PURE__ */ jsxs("div", { className: "w-full flex items-center justify-between", children: [
3259
+ return /* @__PURE__ */ jsx(Accordion, { type: "single", collapsible: true, className: "w-full", children: /* @__PURE__ */ jsxs(AccordionItem, { value: "item-1", className: "bg-muted rounded-lg", children: [
3260
+ /* @__PURE__ */ jsx(AccordionTrigger, { className: "w-full gap-1 items-center py-6 px-5 rounded-b-lg data-[state=open]:pb-3", children: /* @__PURE__ */ jsxs("div", { className: "w-full flex items-center justify-between", children: [
3356
3261
  /* @__PURE__ */ jsx("p", { className: "text-sm font-normal text-priority leading-3.5", children: t2("bridge.youWillReceive", { defaultValue: "You will receive" }) }),
3357
3262
  /* @__PURE__ */ jsxs("div", { className: "bg-transparent hover:bg-transparent shadow-none h-4 p-0 px-0 py-0 flex items-center gap-1.5", children: [
3358
3263
  /* @__PURE__ */ jsx(TokenSymbol, { symbol, className: "w-4 h-4", alt: "token" }),
@@ -4153,20 +4058,17 @@ const WalletSelectModal = () => {
4153
4058
  console.error("Failed to connect wallet:", error);
4154
4059
  }
4155
4060
  };
4156
- return /* @__PURE__ */ jsx(Modal, { isOpen, onClose, children: /* @__PURE__ */ jsxs(ModalContent, { children: [
4157
- /* @__PURE__ */ jsxs(ModalHeader, { children: [
4158
- /* @__PURE__ */ jsx(ModalTitle, { children: t2("wallets.chooseWallet", { defaultValue: "Choose wallet" }) }),
4159
- /* @__PURE__ */ jsx(ModalDescription, { children: t2("wallets.oneWalletPerEnv", {
4160
- defaultValue: "You can only connect one wallet per environment."
4161
- }) }),
4162
- /* @__PURE__ */ jsx(ModalClose, { onClick: onClose, children: /* @__PURE__ */ jsx(CloseIcon, { className: "size-6 p-0 [&>rect]:fill-modal-x [&>path]:stroke-modal-x-foreground" }) })
4061
+ return /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs(DialogContent, { children: [
4062
+ /* @__PURE__ */ jsxs(DialogHeader, { children: [
4063
+ /* @__PURE__ */ jsx(DialogTitle, { children: t2("wallets.chooseWallet") }),
4064
+ /* @__PURE__ */ jsx(DialogDescription, { children: t2("wallets.oneWalletPerEnv") })
4163
4065
  ] }),
4164
- /* @__PURE__ */ jsxs("div", { className: "mt-5 flex flex-col gap-3.5", children: [
4066
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
4165
4067
  connectedWallets.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
4166
- /* @__PURE__ */ jsx("div", { className: "px-5 py-2 leading-4 text-base font-semibold text-muted-foreground uppercase", children: t2("wallets.connected") }),
4068
+ /* @__PURE__ */ jsx("div", { className: "py-2 font-semibold text-muted-foreground uppercase", children: t2("wallets.connected") }),
4167
4069
  /* @__PURE__ */ jsx("div", { className: "", children: connectedWallets.map((wallet) => {
4168
4070
  const IconComponent = wallet.icon;
4169
- return /* @__PURE__ */ jsx("div", { className: "", children: /* @__PURE__ */ jsxs(Button, { className: "w-full cursor-pointer bg-transparent flex shadow-none items-center justify-between gap-2.5 px-5 py-2.5 hover:bg-muted h-auto rounded-12 transition-[300]", children: [
4071
+ 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-2.5 px-5 py-2.5 hover:bg-muted h-auto rounded-12 transition-[300]", children: [
4170
4072
  /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3 min-w-0", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2.5", children: [
4171
4073
  /* @__PURE__ */ jsx("div", { className: "w-7.5 h-7.5 flex items-center justify-center", children: /* @__PURE__ */ jsx(IconComponent, { className: "size-7.5" }) }),
4172
4074
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start min-w-0", children: [
@@ -4189,8 +4091,8 @@ const WalletSelectModal = () => {
4189
4091
  }) })
4190
4092
  ] }),
4191
4093
  categories.map((category) => /* @__PURE__ */ jsxs("div", { children: [
4192
- /* @__PURE__ */ jsx("div", { className: "px-5 py-2 leading-4 text-base font-semibold text-muted-foreground uppercase", children: category.title }),
4193
- /* @__PURE__ */ jsx("div", { className: "", children: category.wallets.map((wallet) => {
4094
+ /* @__PURE__ */ jsx("div", { className: "py-2 font-semibold text-muted-foreground uppercase", children: category.title }),
4095
+ /* @__PURE__ */ jsx("div", { className: "-mx-5", children: category.wallets.map((wallet) => {
4194
4096
  const IconComponent = wallet.icon;
4195
4097
  const isEvmConnector = category.title === t2("wallets.evmWallets");
4196
4098
  const connector = isEvmConnector ? connectors.find((c) => c.id === wallet.id) : null;
@@ -6163,8 +6065,8 @@ const TransactionManager = () => {
6163
6065
  if (status === "completed") {
6164
6066
  step = /* @__PURE__ */ jsx(SuccessStep, {});
6165
6067
  }
6166
- return /* @__PURE__ */ jsx(Modal, { isOpen: true, onClose: () => {
6167
- }, children: step });
6068
+ return /* @__PURE__ */ jsx(Dialog, { open: true, onOpenChange: () => {
6069
+ }, children: /* @__PURE__ */ jsx(DialogContent, { showCloseButton: false, className: "p-0 gap-0 border-none max-w-[calc(100%-2rem)] sm:max-w-md", children: step }) });
6168
6070
  };
6169
6071
  const useTokensRequest = () => {
6170
6072
  const { setTokens, setSelectedToken, setSelectedAssetSymbol } = useTokensStore();
@@ -6667,6 +6569,7 @@ class EvmChainStrategy {
6667
6569
  console.warn("No publicClient available for balance query");
6668
6570
  return {};
6669
6571
  }
6572
+ console.log("publicClient", this.publicClient);
6670
6573
  return await getEvmBalances(this.publicClient, address, tokens, priorityToken);
6671
6574
  }
6672
6575
  isAddressValid(address) {
@@ -7933,7 +7836,7 @@ const EvaaBridgeWithProviders = (props) => {
7933
7836
  useEffect(() => {
7934
7837
  setTronConnected(!!tronConnected);
7935
7838
  }, [tronConnected, setTronConnected]);
7936
- return /* @__PURE__ */ jsx(ModalContainerProvider, { containerId: props.modalContainerId, children: /* @__PURE__ */ jsx(
7839
+ return /* @__PURE__ */ jsx(
7937
7840
  ChainStrategyProvider,
7938
7841
  {
7939
7842
  evmWallet: {
@@ -7958,7 +7861,7 @@ const EvaaBridgeWithProviders = (props) => {
7958
7861
  tonApiKey: props.tonApiKey,
7959
7862
  children: /* @__PURE__ */ jsx(EvaaBridgeContent, { ...props })
7960
7863
  }
7961
- ) });
7864
+ );
7962
7865
  };
7963
7866
  const EvaaBridgeContent = ({
7964
7867
  className,
@@ -8071,7 +7974,7 @@ const EvaaBridgeContent = ({
8071
7974
  /* @__PURE__ */ jsx(
8072
7975
  SwapSection,
8073
7976
  {
8074
- className: "rounded-t-xl",
7977
+ className: "rounded-t-lg",
8075
7978
  label: t2("bridge.sourceNetwork"),
8076
7979
  balance: fromBalance,
8077
7980
  chain: fromChain,