@rash2x/bridge-widget 0.1.9 → 0.1.10

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",
@@ -1066,10 +1001,7 @@ const routePresets = [
1066
1001
  RoutePriority.CHEAPEST,
1067
1002
  RoutePriority.RECOMMENDED
1068
1003
  ];
1069
- const SettingModal = ({
1070
- isOpen,
1071
- onClose
1072
- }) => {
1004
+ const SettingModal = ({ isOpen, onClose }) => {
1073
1005
  const { t: t2 } = useTranslation();
1074
1006
  const { toChain } = useChainsStore();
1075
1007
  const { tokens } = useTokensStore();
@@ -1102,13 +1034,10 @@ const SettingModal = ({
1102
1034
  );
1103
1035
  const activeBtn = "bg-settings-active hover:bg-settings-active/80 text-settings-active-foreground";
1104
1036
  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: [
1037
+ return /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs(DialogContent, { children: [
1038
+ /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t2("settings.title", { defaultValue: "Settings" }) }) }),
1039
+ /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
1040
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5", children: [
1112
1041
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
1113
1042
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
1114
1043
  /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm font-medium leading-3.5", children: t2("settings.gasOnDestination") }),
@@ -1622,7 +1551,7 @@ const TokenRow = ({
1622
1551
  Button,
1623
1552
  {
1624
1553
  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" : ""}`,
1554
+ 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
1555
  children: [
1627
1556
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
1628
1557
  /* @__PURE__ */ jsx(
@@ -1677,7 +1606,7 @@ const VirtualizedTokenList = ({
1677
1606
  const bal = getBalance(node.token.symbol);
1678
1607
  const usd = getTokenUsdValue(node.token.symbol, node.token.price?.usd);
1679
1608
  const isSelected = selectedAssetSymbol?.toUpperCase() === node.token.symbol.toUpperCase();
1680
- return /* @__PURE__ */ jsx("div", { style, className: "px-0", children: /* @__PURE__ */ jsx(
1609
+ return /* @__PURE__ */ jsx(
1681
1610
  TokenRow,
1682
1611
  {
1683
1612
  symbol: node.token.symbol,
@@ -1689,7 +1618,7 @@ const VirtualizedTokenList = ({
1689
1618
  isBalanceLoading: balancesLoading,
1690
1619
  onPick: () => onPick(node.token.symbol, node.willChangeSrc)
1691
1620
  }
1692
- ) });
1621
+ );
1693
1622
  };
1694
1623
  const getItemSize = (index) => {
1695
1624
  const node = nodes[index];
@@ -1796,72 +1725,64 @@ const TokenSelectModal = ({
1796
1725
  }
1797
1726
  return out;
1798
1727
  }, [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") }),
1728
+ return /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && handleClose(), children: /* @__PURE__ */ jsxs(DialogContent, { className: "!max-h-[80dvh] overflow-auto", children: [
1729
+ /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t2("bridge.selectToken") }) }),
1730
+ /* @__PURE__ */ jsxs(
1731
+ "div",
1732
+ {
1733
+ 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"}`,
1734
+ children: [
1735
+ /* @__PURE__ */ jsx(SearchIcon, { className: "size-6 text-input-icon" }),
1849
1736
  /* @__PURE__ */ jsx(
1850
- VirtualizedTokenList,
1737
+ Input,
1851
1738
  {
1852
- nodes: virtualNodes,
1853
- balancesLoading: balancesQuery.isLoading || balancesQuery.isFetching,
1854
- hasAnyWallet: hasAnyWallet(),
1855
- selectedAssetSymbol,
1856
- getBalance,
1857
- getTokenUsdValue,
1858
- onPick
1739
+ placeholder: t2("bridge.searchToken"),
1740
+ 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",
1741
+ value: query,
1742
+ onChange: (e) => setQuery(e.target.value),
1743
+ onFocus: () => setIsFocused(true),
1744
+ onBlur: () => setIsFocused(false)
1859
1745
  }
1860
1746
  )
1861
- ] }) })
1862
- ] })
1863
- }
1864
- );
1747
+ ]
1748
+ }
1749
+ ),
1750
+ hasAnyWallet() && /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
1751
+ /* @__PURE__ */ jsx(
1752
+ Button,
1753
+ {
1754
+ variant: tab === "my" ? "default" : "outline",
1755
+ onClick: () => setTab("my"),
1756
+ size: "sm",
1757
+ children: t2("bridge.myTokens")
1758
+ }
1759
+ ),
1760
+ /* @__PURE__ */ jsx(
1761
+ Button,
1762
+ {
1763
+ variant: tab === "all" ? "default" : "outline",
1764
+ onClick: () => setTab("all"),
1765
+ size: "sm",
1766
+ children: t2("bridge.allTokens")
1767
+ }
1768
+ )
1769
+ ] }),
1770
+ /* @__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: [
1771
+ 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") }),
1772
+ /* @__PURE__ */ jsx(
1773
+ VirtualizedTokenList,
1774
+ {
1775
+ nodes: virtualNodes,
1776
+ balancesLoading: balancesQuery.isLoading || balancesQuery.isFetching,
1777
+ hasAnyWallet: hasAnyWallet(),
1778
+ selectedAssetSymbol,
1779
+ getBalance,
1780
+ getTokenUsdValue,
1781
+ onPick
1782
+ }
1783
+ )
1784
+ ] }) })
1785
+ ] }) });
1865
1786
  };
1866
1787
  const useBridgeQuoteStore = create$1((set) => ({
1867
1788
  inputAmount: "",
@@ -2724,7 +2645,7 @@ const ChainSelectModal = ({
2724
2645
  };
2725
2646
  const renderChainItem = (chain, willChangeSrc) => {
2726
2647
  const isSelected = fromChain?.chainKey === chain.chainKey || toChain?.chainKey === chain.chainKey;
2727
- return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
2648
+ return /* @__PURE__ */ jsx(
2728
2649
  Button,
2729
2650
  {
2730
2651
  onClick: () => onChainPick(chain, willChangeSrc),
@@ -2740,52 +2661,43 @@ const ChainSelectModal = ({
2740
2661
  ),
2741
2662
  /* @__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
2663
  ] })
2743
- }
2744
- ) }, chain.chainKey);
2664
+ },
2665
+ chain.chainKey
2666
+ );
2745
2667
  };
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
- );
2668
+ return /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && handleClose(), children: /* @__PURE__ */ jsxs(DialogContent, { className: "!max-h-[80dvh] overflow-hidden", children: [
2669
+ /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t2("bridge.selectNetwork") }) }),
2670
+ /* @__PURE__ */ jsxs(
2671
+ "div",
2672
+ {
2673
+ 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"}`,
2674
+ children: [
2675
+ /* @__PURE__ */ jsx(SearchIcon, { className: "size-6 text-muted-foreground" }),
2676
+ /* @__PURE__ */ jsx(
2677
+ Input,
2678
+ {
2679
+ placeholder: t2("bridge.searchDestinationChain"),
2680
+ className: "w-full outline-none leading-0 p-0 h-6 text-base text-foreground placeholder:text-muted-foreground bg-none dark:bg-transparent",
2681
+ value: query,
2682
+ onChange: (e) => setQuery(e.target.value),
2683
+ onFocus: () => setIsFocused(true),
2684
+ onBlur: () => setIsFocused(false)
2685
+ }
2686
+ )
2687
+ ]
2688
+ }
2689
+ ),
2690
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto", children: [
2691
+ groupedChains.available.length > 0 && groupedChains.available.map((c) => renderChainItem(c, false)),
2692
+ groupedChains.available.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
2693
+ 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") }),
2694
+ groupedChains.willChangeSrc.length > 0 && groupedChains.willChangeSrc.map(
2695
+ (c) => renderChainItem(c, true)
2696
+ )
2697
+ ] }),
2698
+ 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") })
2699
+ ] })
2700
+ ] }) });
2789
2701
  };
2790
2702
  const useWalletSelectModal = create$1((set) => ({
2791
2703
  isOpen: false,
@@ -4153,20 +4065,17 @@ const WalletSelectModal = () => {
4153
4065
  console.error("Failed to connect wallet:", error);
4154
4066
  }
4155
4067
  };
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" }) })
4068
+ return /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs(DialogContent, { children: [
4069
+ /* @__PURE__ */ jsxs(DialogHeader, { children: [
4070
+ /* @__PURE__ */ jsx(DialogTitle, { children: t2("wallets.chooseWallet") }),
4071
+ /* @__PURE__ */ jsx(DialogDescription, { children: t2("wallets.oneWalletPerEnv") })
4163
4072
  ] }),
4164
- /* @__PURE__ */ jsxs("div", { className: "mt-5 flex flex-col gap-3.5", children: [
4073
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
4165
4074
  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") }),
4075
+ /* @__PURE__ */ jsx("div", { className: "py-2 font-semibold text-muted-foreground uppercase", children: t2("wallets.connected") }),
4167
4076
  /* @__PURE__ */ jsx("div", { className: "", children: connectedWallets.map((wallet) => {
4168
4077
  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: [
4078
+ 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
4079
  /* @__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
4080
  /* @__PURE__ */ jsx("div", { className: "w-7.5 h-7.5 flex items-center justify-center", children: /* @__PURE__ */ jsx(IconComponent, { className: "size-7.5" }) }),
4172
4081
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start min-w-0", children: [
@@ -4189,8 +4098,8 @@ const WalletSelectModal = () => {
4189
4098
  }) })
4190
4099
  ] }),
4191
4100
  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) => {
4101
+ /* @__PURE__ */ jsx("div", { className: "py-2 font-semibold text-muted-foreground uppercase", children: category.title }),
4102
+ /* @__PURE__ */ jsx("div", { className: "-mx-5", children: category.wallets.map((wallet) => {
4194
4103
  const IconComponent = wallet.icon;
4195
4104
  const isEvmConnector = category.title === t2("wallets.evmWallets");
4196
4105
  const connector = isEvmConnector ? connectors.find((c) => c.id === wallet.id) : null;
@@ -6163,8 +6072,8 @@ const TransactionManager = () => {
6163
6072
  if (status === "completed") {
6164
6073
  step = /* @__PURE__ */ jsx(SuccessStep, {});
6165
6074
  }
6166
- return /* @__PURE__ */ jsx(Modal, { isOpen: true, onClose: () => {
6167
- }, children: step });
6075
+ return /* @__PURE__ */ jsx(Dialog, { open: true, onOpenChange: () => {
6076
+ }, 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
6077
  };
6169
6078
  const useTokensRequest = () => {
6170
6079
  const { setTokens, setSelectedToken, setSelectedAssetSymbol } = useTokensStore();
@@ -7933,7 +7842,7 @@ const EvaaBridgeWithProviders = (props) => {
7933
7842
  useEffect(() => {
7934
7843
  setTronConnected(!!tronConnected);
7935
7844
  }, [tronConnected, setTronConnected]);
7936
- return /* @__PURE__ */ jsx(ModalContainerProvider, { containerId: props.modalContainerId, children: /* @__PURE__ */ jsx(
7845
+ return /* @__PURE__ */ jsx(
7937
7846
  ChainStrategyProvider,
7938
7847
  {
7939
7848
  evmWallet: {
@@ -7958,7 +7867,7 @@ const EvaaBridgeWithProviders = (props) => {
7958
7867
  tonApiKey: props.tonApiKey,
7959
7868
  children: /* @__PURE__ */ jsx(EvaaBridgeContent, { ...props })
7960
7869
  }
7961
- ) });
7870
+ );
7962
7871
  };
7963
7872
  const EvaaBridgeContent = ({
7964
7873
  className,