@rash2x/bridge-widget 0.1.11 → 0.1.12

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.
@@ -3,25 +3,25 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
5
5
  import { useTranslation } from "react-i18next";
6
- import * as require$$0 from "react";
7
- import require$$0__default, { useState, useCallback, useMemo, createContext, useContext, useEffect, memo, forwardRef, useRef } from "react";
6
+ import require$$0, { useState, useCallback, useMemo, createContext, useContext, useEffect, memo, forwardRef, useRef } from "react";
8
7
  import { create as create$1 } from "zustand";
9
- import { Slot } from "@radix-ui/react-slot";
10
- import { cva } from "class-variance-authority";
11
- import { clsx } from "clsx";
12
- import { twMerge } from "tailwind-merge";
13
- import * as DialogPrimitive from "@radix-ui/react-dialog";
14
- import { XIcon, X, ChevronDownIcon } from "lucide-react";
15
- import * as TooltipPrimitive from "@radix-ui/react-tooltip";
8
+ import { Button } from "@/components/ui/button";
9
+ import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from "@/components/ui/dialog";
10
+ import { Tooltip, TooltipTrigger, TooltipContent } from "@/components/ui/tooltip";
11
+ import { cn } from "@/lib/utils";
12
+ import { Input } from "@/components/ui/input";
16
13
  import { useAccount, useConnect, useDisconnect, useWalletClient, usePublicClient } from "wagmi";
17
14
  import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks";
18
15
  import { useTonAddress, useTonConnectUI } from "@tonconnect/ui-react";
19
16
  import { useQuery, useQueryClient } from "@tanstack/react-query";
20
17
  import { Address, beginCell as beginCell$1, storeMessage, loadMessage, Cell } from "@ton/core";
21
18
  import { VariableSizeList } from "react-window";
22
- import * as SwitchPrimitive from "@radix-ui/react-switch";
19
+ import { Skeleton } from "@/components/ui/skeleton";
20
+ import { CardHeader, CardTitle, CardAction, Card, CardContent, CardFooter } from "@/components/ui/card";
21
+ import { Switch } from "@/components/ui/switch";
22
+ import { X } from "lucide-react";
23
23
  import { AnimatePresence, motion } from "framer-motion";
24
- import * as AccordionPrimitive from "@radix-ui/react-accordion";
24
+ import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "@/components/ui/accordion";
25
25
  import { t } from "i18next";
26
26
  import { toast, Toaster } from "sonner";
27
27
  import { BrowserProvider, Contract, parseUnits } from "ethers";
@@ -480,147 +480,6 @@ const ExitIcon = (props) => {
480
480
  }
481
481
  );
482
482
  };
483
- function cn(...inputs) {
484
- return twMerge(clsx(inputs));
485
- }
486
- const buttonVariants = cva(
487
- "inline-flex items-center rounded-full text-lg justify-center gap-2 whitespace-nowrap text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
488
- {
489
- variants: {
490
- variant: {
491
- default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
492
- destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
493
- outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
494
- secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
495
- ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
496
- link: "text-primary underline-offset-4 hover:underline"
497
- },
498
- size: {
499
- default: "h-13 px-4 py-2 has-[>svg]:px-3",
500
- sm: "h-9 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
501
- lg: "h-15 font-semibold rounded-full text-lg px-6 has-[>svg]:px-4",
502
- icon: "size-9"
503
- }
504
- },
505
- defaultVariants: {
506
- variant: "default",
507
- size: "default"
508
- }
509
- }
510
- );
511
- const Button = require$$0.forwardRef(
512
- ({ className, variant, size, asChild = false, type, ...props }, ref) => {
513
- const Comp = asChild ? Slot : "button";
514
- return /* @__PURE__ */ jsx(
515
- Comp,
516
- {
517
- ref,
518
- "data-slot": "button",
519
- ...!asChild ? { type: type ?? "button" } : null,
520
- className: cn(buttonVariants({ variant, size }), className),
521
- ...props
522
- }
523
- );
524
- }
525
- );
526
- Button.displayName = "Button";
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
- }) {
541
- return /* @__PURE__ */ jsx(
542
- DialogPrimitive.Overlay,
543
- {
544
- "data-slot": "dialog-overlay",
545
- className: cn(
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",
547
- className
548
- ),
549
- ...props
550
- }
551
- );
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 }) {
589
- return /* @__PURE__ */ jsx(
590
- "div",
591
- {
592
- "data-slot": "dialog-header",
593
- className: cn("flex flex-col gap-2 text-center sm:text-left", className),
594
- ...props
595
- }
596
- );
597
- }
598
- function DialogTitle({
599
- className,
600
- ...props
601
- }) {
602
- return /* @__PURE__ */ jsx(
603
- DialogPrimitive.Title,
604
- {
605
- "data-slot": "dialog-title",
606
- className: cn("text-lg leading-none font-semibold", className),
607
- ...props
608
- }
609
- );
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
- }
622
- );
623
- }
624
483
  const TipIcon = (props) => {
625
484
  return /* @__PURE__ */ jsxs(
626
485
  "svg",
@@ -677,52 +536,6 @@ const TipIcon = (props) => {
677
536
  }
678
537
  );
679
538
  };
680
- function TooltipProvider({
681
- delayDuration = 0,
682
- ...props
683
- }) {
684
- return /* @__PURE__ */ jsx(
685
- TooltipPrimitive.Provider,
686
- {
687
- "data-slot": "tooltip-provider",
688
- delayDuration,
689
- ...props
690
- }
691
- );
692
- }
693
- function Tooltip({
694
- ...props
695
- }) {
696
- return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
697
- }
698
- function TooltipTrigger({
699
- ...props
700
- }) {
701
- return /* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
702
- }
703
- function TooltipContent({
704
- className,
705
- sideOffset = 0,
706
- children,
707
- ...props
708
- }) {
709
- return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
710
- TooltipPrimitive.Content,
711
- {
712
- "data-slot": "tooltip-content",
713
- sideOffset,
714
- className: cn(
715
- "bg-primary text-primary-foreground text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5",
716
- className
717
- ),
718
- ...props,
719
- children: [
720
- children,
721
- /* @__PURE__ */ jsx(TooltipPrimitive.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
722
- ]
723
- }
724
- ) });
725
- }
726
539
  const Tip = (props) => {
727
540
  const { children, text } = props;
728
541
  return /* @__PURE__ */ jsxs(Tooltip, { children: [
@@ -1121,21 +934,6 @@ const SettingModal = ({ isOpen, onClose }) => {
1121
934
  ] })
1122
935
  ] }) });
1123
936
  };
1124
- function Input({ className, type, ...props }) {
1125
- return /* @__PURE__ */ jsx(
1126
- "input",
1127
- {
1128
- type,
1129
- "data-slot": "input",
1130
- className: cn(
1131
- "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md bg-transparent px-3 py-1 text-base transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
1132
- "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
1133
- className
1134
- ),
1135
- ...props
1136
- }
1137
- );
1138
- }
1139
937
  function useAddresses() {
1140
938
  const { fromChain, toChain } = useChainsStore();
1141
939
  const { address: evmAddress } = useAccount();
@@ -1527,9 +1325,6 @@ function useTokenSelectData(items) {
1527
1325
  hasAnyWallet
1528
1326
  };
1529
1327
  }
1530
- function Skeleton({ className }) {
1531
- return /* @__PURE__ */ jsx("div", { className: cn("animate-pulse rounded-md bg-[#999]", className) });
1532
- }
1533
1328
  const TokenRow = ({
1534
1329
  symbol,
1535
1330
  name,
@@ -1903,75 +1698,6 @@ const SelectTokenButton = ({
1903
1698
  }
1904
1699
  );
1905
1700
  };
1906
- function Card({ className, ...props }) {
1907
- return /* @__PURE__ */ jsx(
1908
- "div",
1909
- {
1910
- "data-slot": "card",
1911
- className: cn(
1912
- "bg-card text-card-foreground flex flex-col gap-4 rounded-lg border py-4 shadow-sm",
1913
- className
1914
- ),
1915
- ...props
1916
- }
1917
- );
1918
- }
1919
- function CardHeader({ className, ...props }) {
1920
- return /* @__PURE__ */ jsx(
1921
- "div",
1922
- {
1923
- "data-slot": "card-header",
1924
- className: cn(
1925
- "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-4",
1926
- className
1927
- ),
1928
- ...props
1929
- }
1930
- );
1931
- }
1932
- function CardTitle({ className, ...props }) {
1933
- return /* @__PURE__ */ jsx(
1934
- "div",
1935
- {
1936
- "data-slot": "card-title",
1937
- className: cn("leading-none font-semibold", className),
1938
- ...props
1939
- }
1940
- );
1941
- }
1942
- function CardAction({ className, ...props }) {
1943
- return /* @__PURE__ */ jsx(
1944
- "div",
1945
- {
1946
- "data-slot": "card-action",
1947
- className: cn(
1948
- "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
1949
- className
1950
- ),
1951
- ...props
1952
- }
1953
- );
1954
- }
1955
- function CardContent({ className, ...props }) {
1956
- return /* @__PURE__ */ jsx(
1957
- "div",
1958
- {
1959
- "data-slot": "card-content",
1960
- className: cn("px-4", className),
1961
- ...props
1962
- }
1963
- );
1964
- }
1965
- function CardFooter({ className, ...props }) {
1966
- return /* @__PURE__ */ jsx(
1967
- "div",
1968
- {
1969
- "data-slot": "card-footer",
1970
- className: cn("flex items-center px-4 [.border-t]:pt-4", className),
1971
- ...props
1972
- }
1973
- );
1974
- }
1975
1701
  const FormHeaderComponent = () => {
1976
1702
  const { t: t2 } = useTranslation();
1977
1703
  const { isOpen, onClose, onOpen } = useModal();
@@ -2887,31 +2613,6 @@ const SwapSection = ({
2887
2613
  )
2888
2614
  ] });
2889
2615
  };
2890
- function Switch({
2891
- className,
2892
- ...props
2893
- }) {
2894
- return /* @__PURE__ */ jsx(
2895
- SwitchPrimitive.Root,
2896
- {
2897
- "data-slot": "switch",
2898
- className: cn(
2899
- "peer data-[state=checked]:bg-[#0095F9] data-[state=unchecked]:bg-[#CACFD3] focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
2900
- className
2901
- ),
2902
- ...props,
2903
- children: /* @__PURE__ */ jsx(
2904
- SwitchPrimitive.Thumb,
2905
- {
2906
- "data-slot": "switch-thumb",
2907
- className: cn(
2908
- "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
2909
- )
2910
- }
2911
- )
2912
- }
2913
- );
2914
- }
2915
2616
  const useCustomAddressStore = create$1((set) => ({
2916
2617
  customDstAddress: void 0,
2917
2618
  setCustomDstAddress: (address) => set({ customDstAddress: address }),
@@ -3056,60 +2757,6 @@ const ToggleRow = ({ enabled, onToggle }) => {
3056
2757
  ) })
3057
2758
  ] });
3058
2759
  };
3059
- function Accordion({
3060
- ...props
3061
- }) {
3062
- return /* @__PURE__ */ jsx(AccordionPrimitive.Root, { "data-slot": "accordion", ...props });
3063
- }
3064
- function AccordionItem({
3065
- className,
3066
- ...props
3067
- }) {
3068
- return /* @__PURE__ */ jsx(
3069
- AccordionPrimitive.Item,
3070
- {
3071
- "data-slot": "accordion-item",
3072
- className: cn("border-b last:border-b-0", className),
3073
- ...props
3074
- }
3075
- );
3076
- }
3077
- function AccordionTrigger({
3078
- className,
3079
- children,
3080
- ...props
3081
- }) {
3082
- return /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
3083
- AccordionPrimitive.Trigger,
3084
- {
3085
- "data-slot": "accordion-trigger",
3086
- className: cn(
3087
- "focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
3088
- className
3089
- ),
3090
- ...props,
3091
- children: [
3092
- children,
3093
- /* @__PURE__ */ jsx(ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0 transition-transform duration-200" })
3094
- ]
3095
- }
3096
- ) });
3097
- }
3098
- function AccordionContent({
3099
- className,
3100
- children,
3101
- ...props
3102
- }) {
3103
- return /* @__PURE__ */ jsx(
3104
- AccordionPrimitive.Content,
3105
- {
3106
- "data-slot": "accordion-content",
3107
- className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
3108
- ...props,
3109
- children: /* @__PURE__ */ jsx("div", { className: cn("pt-0 pb-4", className), children })
3110
- }
3111
- );
3112
- }
3113
2760
  function getQuoteAmounts(quote, srcToken, dstToken) {
3114
2761
  if (!quote || !srcToken || !dstToken) {
3115
2762
  return {
@@ -5493,7 +5140,7 @@ function requireDist() {
5493
5140
  return mod && mod.__esModule ? mod : { "default": mod };
5494
5141
  };
5495
5142
  Object.defineProperty(dist, "__esModule", { value: true });
5496
- var react_1 = __importStar(require$$0__default);
5143
+ var react_1 = __importStar(require$$0);
5497
5144
  var canvas_confetti_1 = __importDefault(require$$1);
5498
5145
  var DEFAULT_GLOBAL_OPTIONS = {
5499
5146
  resize: true,
@@ -5607,7 +5254,7 @@ function requirePresets() {
5607
5254
  return mod && mod.__esModule ? mod : { "default": mod };
5608
5255
  };
5609
5256
  Object.defineProperty(presets, "__esModule", { value: true });
5610
- var react_1 = __importStar(require$$0__default);
5257
+ var react_1 = __importStar(require$$0);
5611
5258
  var index_1 = __importDefault(requireDist());
5612
5259
  var DEFAULT_DECORATE_OPTIONS = function(o) {
5613
5260
  return o;
@@ -5805,7 +5452,7 @@ function requireFireworks() {
5805
5452
  return mod && mod.__esModule ? mod : { "default": mod };
5806
5453
  };
5807
5454
  Object.defineProperty(fireworks$1, "__esModule", { value: true });
5808
- var react_1 = __importDefault(require$$0__default);
5455
+ var react_1 = __importDefault(require$$0);
5809
5456
  var index_1 = __importDefault(requirePresets());
5810
5457
  var fireworks_1 = __importDefault(requireFireworks$1());
5811
5458
  function Fireworks2(props) {