@rash2x/bridge-widget 0.6.43 → 0.6.46

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.
@@ -26,6 +26,7 @@ const tooltip = require("@/components/ui/tooltip");
26
26
  const alert = require("@/components/ui/alert");
27
27
  const sonner = require("sonner");
28
28
  const badge = require("@/components/ui/badge");
29
+ const reactDialog = require("@radix-ui/react-dialog");
29
30
  const viem = require("viem");
30
31
  const tronwalletAdapters = require("@tronweb3/tronwallet-adapters");
31
32
  const tronweb = require("tronweb");
@@ -4418,9 +4419,9 @@ const ProgressStep = ({
4418
4419
  title: t2("transaction.steps.completed")
4419
4420
  }
4420
4421
  ];
4421
- return /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogContent, { showCloseButton: false, className: "overflow-hidden md:max-w-[420px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex relative flex-col gap-6 flex-1 items-center justify-start text-center bg-background noise p-10 pb-0", children: [
4422
+ return /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogContent, { showCloseButton: false, className: "overflow-hidden md:max-w-[420px] p-0", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex relative flex-col gap-6 flex-1 items-center justify-start text-center bg-background noise p-10", children: [
4422
4423
  icon,
4423
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2 pb-2 text-center", children: /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t2("transaction.inProgress") }) }),
4424
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2 pt-4 pb-2 text-center", children: /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t2("transaction.inProgress") }) }),
4424
4425
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
4425
4426
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-5 top-5 bottom-5 border-l border-dashed border-foreground/50" }),
4426
4427
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-6 relative z-10", children: steps.map((step) => /* @__PURE__ */ jsxRuntime.jsxs(
@@ -4440,6 +4441,25 @@ const ProgressStep = ({
4440
4441
  ] })
4441
4442
  ] }) });
4442
4443
  };
4444
+ const FailedStep = ({
4445
+ icon = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircleIcon, { className: "w-16 h-16" })
4446
+ }) => {
4447
+ const { current, reset } = useTransactionStore();
4448
+ const { t: t2 } = useBridgeTranslation();
4449
+ return /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogContent, { showCloseButton: true, className: "overflow-hidden md:max-w-[420px] p-0", children: [
4450
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col relative gap-4 flex-1 items-center justify-start text-center noise p-10 pb-0", children: [
4451
+ icon,
4452
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 pt-4 pb-2 text-center", children: [
4453
+ /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t2("transaction.failed") }),
4454
+ current?.errorCode && /* @__PURE__ */ jsxRuntime.jsx(reactDialog.DialogDescription, { children: t2(
4455
+ `errors.${current.errorCode}`,
4456
+ current.errorParams || {}
4457
+ ) })
4458
+ ] })
4459
+ ] }),
4460
+ /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogFooter, { className: "px-10 pb-10 ", children: /* @__PURE__ */ jsxRuntime.jsx(button.Button, { variant: "outline", className: "w-full min-w-40", onClick: reset, children: t2("common.close") }) })
4461
+ ] });
4462
+ };
4443
4463
  const EXPLORER_CONFIGS = {
4444
4464
  // TON
4445
4465
  ton: {
@@ -4577,7 +4597,7 @@ const SuccessStep = ({
4577
4597
  children: [
4578
4598
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4 flex-1 justify-start items-center text-center bg-background noise p-10 pb-0", children: [
4579
4599
  icon,
4580
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2 text-center", children: /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { className: "text-[28px]", children: t2("transaction.success") }) }),
4600
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2 pt-4 text-center", children: /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { className: "text-[28px]", children: t2("transaction.success") }) }),
4581
4601
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full space-y-2 mt-3 relative z-10 pb-14", children: [
4582
4602
  metadata?.srcAmountHuman && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center", children: [
4583
4603
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: t2("transaction.bridged") }),
@@ -4637,7 +4657,7 @@ const SuccessStep = ({
4637
4657
  ] })
4638
4658
  ] })
4639
4659
  ] }),
4640
- /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogFooter, { className: "px-10 pb-10", children: /* @__PURE__ */ jsxRuntime.jsx(button.Button, { onClick: reset, className: "w-full", children: t2("transaction.done") }) })
4660
+ /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogFooter, { className: "px-10 pb-10 pt-12", children: /* @__PURE__ */ jsxRuntime.jsx(button.Button, { onClick: reset, className: "w-full", children: t2("transaction.done") }) })
4641
4661
  ]
4642
4662
  }
4643
4663
  );
@@ -4664,9 +4684,9 @@ const ConfirmStep = ({
4664
4684
  }) => {
4665
4685
  const { t: t2 } = useBridgeTranslation();
4666
4686
  const { formatTime } = useCountdown(90);
4667
- return /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogContent, { showCloseButton: false, className: "overflow-hidden md:max-w-[420px] p-0", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col relative gap-4 flex-1 items-center justify-start text-center noise p-10 pb-0", children: [
4687
+ return /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogContent, { showCloseButton: false, className: "overflow-hidden md:max-w-[420px] p-0", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col relative gap-4 flex-1 items-center justify-start text-center noise p-10", children: [
4668
4688
  icon,
4669
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 pb-2 text-center", children: [
4689
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 pt-4 pb-2 text-center", children: [
4670
4690
  /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: t2("transaction.confirm") }),
4671
4691
  /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogDescription, { children: t2("transaction.signTransaction") })
4672
4692
  ] }),
@@ -4690,7 +4710,7 @@ const StatusStepsDialog = ({
4690
4710
  step = /* @__PURE__ */ jsxRuntime.jsx(SuccessStep, { icon: icons?.success });
4691
4711
  }
4692
4712
  if (status === "failed") {
4693
- step = /* @__PURE__ */ jsxRuntime.jsx(SuccessStep, { icon: icons?.failed });
4713
+ step = /* @__PURE__ */ jsxRuntime.jsx(FailedStep, { icon: icons?.failed });
4694
4714
  }
4695
4715
  return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog, { open: true, onOpenChange: () => reset(), children: step });
4696
4716
  };
@@ -25946,7 +25966,7 @@ class WalletConnectModal {
25946
25966
  }
25947
25967
  async initUi() {
25948
25968
  if (typeof window !== "undefined") {
25949
- await Promise.resolve().then(() => require("./index-Ccca0yyI.cjs"));
25969
+ await Promise.resolve().then(() => require("./index-D87zq9PV.cjs"));
25950
25970
  const modal = document.createElement("wcm-modal");
25951
25971
  document.body.insertAdjacentElement("beforeend", modal);
25952
25972
  OptionsCtrl.setIsUiLoaded(true);
@@ -26703,4 +26723,4 @@ exports.useSettingsStore = useSettingsStore;
26703
26723
  exports.useSwapModel = useSwapModel;
26704
26724
  exports.useTokensStore = useTokensStore;
26705
26725
  exports.useTransactionStore = useTransactionStore;
26706
- //# sourceMappingURL=index-Cqs3pq51.cjs.map
26726
+ //# sourceMappingURL=index-dS_Zjwua.cjs.map