@deframe-sdk/components 0.1.6 → 0.1.7

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.
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ var React6 = require('react');
6
6
  var framerMotion = require('framer-motion');
7
7
  var md = require('react-icons/md');
8
8
  var hi2 = require('react-icons/hi2');
9
+ var io5 = require('react-icons/io5');
9
10
 
10
11
  function _interopNamespace(e) {
11
12
  if (e && e.__esModule) return e;
@@ -2558,6 +2559,840 @@ var StrategyDetailsView = ({
2558
2559
  /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "strategy-details-footer", className: "sticky bottom-0 left-0 right-0 border-t border-border-subtle dark:border-border-subtle-dark px-md py-md", children: /* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: onDeposit, className: "w-full", children: depositButtonLabel }) })
2559
2560
  ] });
2560
2561
  };
2562
+ var ProgressIndicator = ({
2563
+ progress,
2564
+ className = ""
2565
+ }) => {
2566
+ const clampedProgress = Math.min(100, Math.max(0, progress));
2567
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `relative h-[12px] w-full ${className}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute left-0 right-0 top-1/2 -translate-y-1/2 flex items-center", children: [
2568
+ /* @__PURE__ */ jsxRuntime.jsx(
2569
+ "div",
2570
+ {
2571
+ className: "h-[4px] bg-brand-primary rounded-lg transition-all duration-300",
2572
+ style: { width: `${clampedProgress}%` }
2573
+ }
2574
+ ),
2575
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 h-[4px] bg-bg-muted dark:bg-bg-muted-dark rounded-lg ml-1" })
2576
+ ] }) });
2577
+ };
2578
+ var LoadingDots = ({ className = "" }) => {
2579
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: `flex gap-0.5 ${className}`, children: [
2580
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "animate-bounce", style: { animationDelay: "0ms", animationDuration: "1.4s" }, children: "." }),
2581
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "animate-bounce", style: { animationDelay: "200ms", animationDuration: "1.4s" }, children: "." }),
2582
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "animate-bounce", style: { animationDelay: "400ms", animationDuration: "1.4s" }, children: "." })
2583
+ ] });
2584
+ };
2585
+ var SearchInput = ({
2586
+ placeholder = "Search",
2587
+ value: controlledValue,
2588
+ disabled = false,
2589
+ onChange,
2590
+ onSearch,
2591
+ className = "",
2592
+ inputClassName,
2593
+ autoFocus = false,
2594
+ containerTestId,
2595
+ inputTestId
2596
+ }) => {
2597
+ const [internalValue, setInternalValue] = React6.useState(controlledValue || "");
2598
+ React6.useEffect(() => {
2599
+ if (controlledValue !== void 0) {
2600
+ setInternalValue(controlledValue);
2601
+ }
2602
+ }, [controlledValue]);
2603
+ const handleInputChange = (newValue) => {
2604
+ setInternalValue(newValue);
2605
+ onChange == null ? void 0 : onChange(newValue);
2606
+ onSearch == null ? void 0 : onSearch(newValue);
2607
+ };
2608
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex-1 flex items-center relative ${className}`, "data-testid": containerTestId, children: [
2609
+ /* @__PURE__ */ jsxRuntime.jsx(
2610
+ "input",
2611
+ {
2612
+ "data-testid": inputTestId,
2613
+ type: "text",
2614
+ value: internalValue,
2615
+ placeholder,
2616
+ disabled,
2617
+ autoFocus,
2618
+ onChange: (e) => handleInputChange(e.target.value),
2619
+ className: [
2620
+ "w-full h-full rounded p-4 pr-12 leading-normal tracking-wide",
2621
+ !inputClassName ? "bg-bg-subtle dark:bg-bg-subtle-dark" : "",
2622
+ "placeholder:text-text-disabled dark:placeholder:text-text-disabled-dark text-text-primary dark:text-text-primary-dark",
2623
+ "focus:outline-none focus:ring-2 focus:ring-brand-primary",
2624
+ disabled ? "cursor-not-allowed opacity-50" : "",
2625
+ inputClassName || ""
2626
+ ].filter(Boolean).join(" ")
2627
+ }
2628
+ ),
2629
+ /* @__PURE__ */ jsxRuntime.jsx(md.MdOutlineSearch, { className: "w-4 h-4 text-text-secondary absolute right-4" })
2630
+ ] });
2631
+ };
2632
+ var SearchEmptyState = ({
2633
+ title,
2634
+ description
2635
+ }) => {
2636
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full py-md bg-bg-default dark:bg-bg-default-dark rounded-lg flex flex-col justify-center items-center gap-sm h-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full flex flex-col justify-center items-center gap-md py-20", children: [
2637
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col justify-center items-center gap-md text-center", children: [
2638
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-20 h-20 bg-bg-muted dark:bg-bg-muted-dark rounded-full flex justify-center items-center", children: /* @__PURE__ */ jsxRuntime.jsx(md.MdOutlineSearchOff, { className: "w-10 h-10 text-text-tertiary dark:text-text-tertiary-dark" }) }),
2639
+ /* @__PURE__ */ jsxRuntime.jsx(TextHeading_default, { variant: "h3", children: title })
2640
+ ] }),
2641
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "self-stretch text-center", children: /* @__PURE__ */ jsxRuntime.jsx(TextBody_default, { variant: "text-small", children: description }) })
2642
+ ] }) });
2643
+ };
2644
+ var CollapsibleSection = ({
2645
+ title,
2646
+ subtitle,
2647
+ children,
2648
+ defaultOpen = false,
2649
+ open: controlledOpen,
2650
+ onOpenChange,
2651
+ className = "",
2652
+ collapseText,
2653
+ expandText
2654
+ }) => {
2655
+ const [internalOpen, setInternalOpen] = React6__namespace.default.useState(defaultOpen);
2656
+ const isOpen = controlledOpen !== void 0 ? controlledOpen : internalOpen;
2657
+ const handleToggle = () => {
2658
+ const newOpenState = !isOpen;
2659
+ if (controlledOpen === void 0) {
2660
+ setInternalOpen(newOpenState);
2661
+ }
2662
+ onOpenChange == null ? void 0 : onOpenChange(newOpenState);
2663
+ };
2664
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex flex-col gap-sm w-full ${className}`, children: [
2665
+ /* @__PURE__ */ jsxRuntime.jsxs(
2666
+ "button",
2667
+ {
2668
+ type: "button",
2669
+ onClick: handleToggle,
2670
+ className: "flex items-center justify-between w-full text-left cursor-pointer",
2671
+ "aria-expanded": isOpen,
2672
+ "aria-label": `${isOpen ? collapseText : expandText} ${title}`,
2673
+ children: [
2674
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-xs", children: /* @__PURE__ */ jsxRuntime.jsx(TextBody_default, { className: "text-white font-medium", children: title }) }),
2675
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-xs", children: [
2676
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx(TextBody_default, { variant: "text-small", children: subtitle }),
2677
+ /* @__PURE__ */ jsxRuntime.jsx(
2678
+ framerMotion.motion.svg,
2679
+ {
2680
+ className: "w-5 h-5 text-gray-400",
2681
+ fill: "none",
2682
+ stroke: "currentColor",
2683
+ viewBox: "0 0 24 24",
2684
+ animate: { rotate: isOpen ? 180 : 0 },
2685
+ transition: { duration: 0.2, ease: "easeInOut" },
2686
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 9l7 7 7-7" })
2687
+ }
2688
+ )
2689
+ ] })
2690
+ ]
2691
+ }
2692
+ ),
2693
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxRuntime.jsx(
2694
+ framerMotion.motion.div,
2695
+ {
2696
+ initial: { height: 0, opacity: 0 },
2697
+ animate: { height: "auto", opacity: 1 },
2698
+ exit: { height: 0, opacity: 0 },
2699
+ transition: { duration: 0.2, ease: "easeInOut" },
2700
+ style: { overflow: "hidden" },
2701
+ children
2702
+ }
2703
+ ) })
2704
+ ] });
2705
+ };
2706
+ var TransactionScreenIcon = ({
2707
+ type,
2708
+ gradient = "linear-gradient(135deg, #F6A700 0%, #F59E0B 100%)"
2709
+ }) => {
2710
+ if (type === "success") {
2711
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-20 h-20", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full rounded-full bg-brand-primary flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-8 h-8 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 3, children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }) });
2712
+ }
2713
+ if (type === "warning") {
2714
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-[83px] h-[83px]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full rounded-full flex items-center justify-center", style: { background: gradient }, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-8 h-8 text-bg-default dark:text-bg-default-dark", fill: "currentColor", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 5.33334C15.6444 5.33334 15.3111 5.51112 15.1111 5.8L5.11112 21.8C4.91112 22.0889 4.91112 22.4667 5.11112 22.7556C5.31112 23.0444 5.64445 23.2222 6.00001 23.2222H26C26.3556 23.2222 26.6889 23.0444 26.8889 22.7556C27.0889 22.4667 27.0889 22.0889 26.8889 21.8L16.8889 5.8C16.6889 5.51112 16.3556 5.33334 16 5.33334ZM16 10.6667C16.5333 10.6667 17 11.1333 17 11.6667V16C17 16.5333 16.5333 17 16 17C15.4667 17 15 16.5333 15 16V11.6667C15 11.1333 15.4667 10.6667 16 10.6667ZM16 19.3333C16.7333 19.3333 17.3333 19.9333 17.3333 20.6667C17.3333 21.4 16.7333 22 16 22C15.2667 22 14.6667 21.4 14.6667 20.6667C14.6667 19.9333 15.2667 19.3333 16 19.3333Z" }) }) }) });
2715
+ }
2716
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-[83px] h-[83px]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full rounded-full flex items-center justify-center", style: { background: gradient }, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "11", height: "10", viewBox: "0 0 11 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "w-8 h-8 text-white", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3.66659 8.33301H7.33325V7.08301C7.33325 6.62468 7.15374 6.23231 6.79471 5.90593C6.43568 5.57954 6.00409 5.41634 5.49992 5.41634C4.99575 5.41634 4.56415 5.57954 4.20513 5.90593C3.8461 6.23231 3.66659 6.62468 3.66659 7.08301V8.33301ZM5.49992 4.58301C6.00409 4.58301 6.43568 4.41981 6.79471 4.09342C7.15374 3.76704 7.33325 3.37467 7.33325 2.91634V1.66634H3.66659V2.91634C3.66659 3.37467 3.8461 3.76704 4.20513 4.09342C4.56415 4.41981 4.99575 4.58301 5.49992 4.58301ZM2.29159 9.16634C2.16172 9.16634 2.05287 9.12641 1.96502 9.04655C1.87718 8.96669 1.83325 8.86773 1.83325 8.74968C1.83325 8.63162 1.87718 8.53266 1.96502 8.4528C2.05287 8.37294 2.16172 8.33301 2.29159 8.33301H2.74992V7.08301C2.74992 6.6594 2.85877 6.26183 3.07648 5.8903C3.29419 5.51877 3.59784 5.2219 3.98742 4.99967C3.59784 4.77745 3.29419 4.48058 3.07648 4.10905C2.85877 3.73752 2.74992 3.33995 2.74992 2.91634V1.66634H2.29159C2.16172 1.66634 2.05287 1.62641 1.96502 1.54655C1.87718 1.46669 1.83325 1.36773 1.83325 1.24967C1.83325 1.13162 1.87718 1.03266 1.96502 0.952799C2.05287 0.872938 2.16172 0.833008 2.29159 0.833008H8.70825C8.83811 0.833008 8.94697 0.872938 9.03481 0.952799C9.12266 1.03266 9.16659 1.13162 9.16659 1.24967C9.16659 1.36773 9.12266 1.46669 9.03481 1.54655C8.94697 1.62641 8.83811 1.66634 8.70825 1.66634H8.24992V2.91634C8.24992 3.33995 8.14106 3.73752 7.92336 4.10905C7.70565 4.48058 7.402 4.77745 7.01242 4.99967C7.402 5.2219 7.70565 5.51877 7.92336 5.8903C8.14106 6.26183 8.24992 6.6594 8.24992 7.08301V8.33301H8.70825C8.83811 8.33301 8.94697 8.37294 9.03481 8.4528C9.12266 8.53266 9.16659 8.63162 9.16659 8.74968C9.16659 8.86773 9.12266 8.96669 9.03481 9.04655C8.94697 9.12641 8.83811 9.16634 8.70825 9.16634H2.29159Z", fill: "currentColor" }) }) }) });
2717
+ };
2718
+ var TransactionScreen = ({
2719
+ progress,
2720
+ iconType,
2721
+ iconGradient,
2722
+ title,
2723
+ description,
2724
+ onClose,
2725
+ onBack,
2726
+ backTitle = "",
2727
+ actions,
2728
+ children,
2729
+ testId
2730
+ }) => {
2731
+ return /* @__PURE__ */ jsxRuntime.jsx(BackgroundContainer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-full", children: [
2732
+ onBack && /* @__PURE__ */ jsxRuntime.jsx(DetailsHeader, { title: backTitle, onBack }),
2733
+ onClose && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": testId, className: "flex justify-start px-md pt-md", children: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { onClick: onClose }) }),
2734
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full px-md pt-sm", children: /* @__PURE__ */ jsxRuntime.jsx(ProgressIndicator, { progress }) }),
2735
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 overflow-y-auto px-md py-lg flex flex-col gap-lg", children: [
2736
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-md pt-lg", children: [
2737
+ /* @__PURE__ */ jsxRuntime.jsx(TransactionScreenIcon, { type: iconType, gradient: iconGradient }),
2738
+ /* @__PURE__ */ jsxRuntime.jsx(TextHeading_default, { variant: "h-large", children: title }),
2739
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-text-md-mobile font-poppins text-text-secondary dark:text-text-secondary-dark text-center", style: { maxWidth: "350px" }, children: description })
2740
+ ] }),
2741
+ children,
2742
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1" })
2743
+ ] }),
2744
+ actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-md pb-md", children: actions })
2745
+ ] }) });
2746
+ };
2747
+ var TransactionScreenInvestmentCard = ({
2748
+ strategyName,
2749
+ apyLabel,
2750
+ apyValue,
2751
+ iconSrc,
2752
+ iconAlt,
2753
+ amountUSD,
2754
+ amountToken
2755
+ }) => {
2756
+ const [hasImageError, setHasImageError] = React6__namespace.default.useState(false);
2757
+ React6__namespace.default.useEffect(() => {
2758
+ setHasImageError(false);
2759
+ }, [iconSrc]);
2760
+ const shouldShowImage = Boolean(iconSrc) && !hasImageError;
2761
+ const fallbackLabel = (iconAlt || "?").slice(0, 1).toUpperCase();
2762
+ return /* @__PURE__ */ jsxRuntime.jsx(SectionCard, { className: "!p-[22px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
2763
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-start gap-xs", children: [
2764
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-accent-lg-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: strategyName }),
2765
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
2766
+ apyLabel,
2767
+ " ",
2768
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody_default, { as: "span", className: "text-state-success", children: apyValue })
2769
+ ] })
2770
+ ] }),
2771
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-sm", children: [
2772
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-8 h-8 rounded-full bg-bg-muted dark:bg-bg-muted-dark flex items-center justify-center", children: shouldShowImage ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: iconSrc, alt: iconAlt, className: "w-6 h-6 rounded-full", onError: () => setHasImageError(true) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold text-text-secondary dark:text-text-secondary-dark", children: fallbackLabel }) }),
2773
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-end", children: [
2774
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: amountUSD }),
2775
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: amountToken })
2776
+ ] })
2777
+ ] })
2778
+ ] }) });
2779
+ };
2780
+ function StepStatusIcon({ status }) {
2781
+ switch (status) {
2782
+ case "completed":
2783
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-6 h-6 rounded-full bg-bg-muted dark:bg-bg-muted-dark flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(io5.IoCheckmarkOutline, { className: "w-4 h-4", style: { color: "var(--color-state-success, #2BA176)" } }) });
2784
+ case "processing":
2785
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-6 h-6 rounded-full bg-bg-muted dark:bg-bg-muted-dark flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(io5.IoTimeOutline, { className: "w-4 h-4", style: { color: "var(--color-state-warning, #F6A700)" } }) });
2786
+ case "failed":
2787
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-6 h-6 rounded-full bg-bg-muted dark:bg-bg-muted-dark flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(io5.IoAlertCircleOutline, { className: "w-4 h-4", style: { color: "var(--color-state-error, #FF4D4F)" } }) });
2788
+ }
2789
+ }
2790
+ function StepStatusText({
2791
+ step,
2792
+ completedText,
2793
+ processingText,
2794
+ failedText,
2795
+ viewOnExplorerText
2796
+ }) {
2797
+ if (step.statusText) {
2798
+ const textColorClass2 = step.status === "completed" ? "text-text-primary dark:text-text-primary-dark" : step.status === "processing" ? "text-text-secondary dark:text-text-secondary-dark" : step.status === "failed" ? "text-state-error" : "text-text-disabled dark:text-text-disabled-dark";
2799
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-sm ${textColorClass2}`, children: step.statusText });
2800
+ }
2801
+ if (step.status === "completed" && step.explorerUrl) {
2802
+ return /* @__PURE__ */ jsxRuntime.jsx(
2803
+ "a",
2804
+ {
2805
+ href: step.explorerUrl,
2806
+ target: "_blank",
2807
+ rel: "noopener noreferrer",
2808
+ className: "text-sm text-brand-primary dark:text-brand-primary-dark underline hover:no-underline",
2809
+ children: viewOnExplorerText
2810
+ }
2811
+ );
2812
+ }
2813
+ const defaultText = step.status === "completed" ? completedText : step.status === "processing" ? processingText : failedText;
2814
+ const textColorClass = step.status === "completed" ? "text-text-primary dark:text-text-primary-dark" : step.status === "processing" ? "text-text-secondary dark:text-text-secondary-dark" : "text-state-error";
2815
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-sm ${textColorClass}`, children: defaultText });
2816
+ }
2817
+ function StepDisplay({ step, completedText, processingText, failedText, viewOnExplorerText }) {
2818
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4 w-full", children: [
2819
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-text-primary dark:text-text-primary-dark font-medium", children: step.label }) }),
2820
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0", children: step.value ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-text-secondary dark:text-text-secondary-dark", children: step.value }) : /* @__PURE__ */ jsxRuntime.jsx(StepStatusText, { step, completedText, processingText, failedText, viewOnExplorerText }) })
2821
+ ] });
2822
+ }
2823
+ function TransactionProcessingDetails({
2824
+ steps,
2825
+ className = "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised",
2826
+ defaultOpen = true,
2827
+ labels
2828
+ }) {
2829
+ if (!steps || steps.length === 0) {
2830
+ return null;
2831
+ }
2832
+ const getProcessingSteps = () => {
2833
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col w-full", children: steps.map((step, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3", children: [
2834
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
2835
+ step.status && /* @__PURE__ */ jsxRuntime.jsx(StepStatusIcon, { status: step.status }),
2836
+ index < steps.length - 1 && step.status && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px flex-1 min-h-[16px] bg-white my-1" })
2837
+ ] }),
2838
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 pb-2 min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(StepDisplay, { step, completedText: labels.completedText, processingText: labels.processingText, failedText: labels.failedText, viewOnExplorerText: labels.viewOnExplorerText }) })
2839
+ ] }, `step-${index}`)) });
2840
+ };
2841
+ const items = [
2842
+ {
2843
+ label: "",
2844
+ value: getProcessingSteps(),
2845
+ valueClassName: "flex flex-col gap-0 w-full"
2846
+ }
2847
+ ];
2848
+ return /* @__PURE__ */ jsxRuntime.jsx(
2849
+ SummaryDetails,
2850
+ {
2851
+ title: labels.title,
2852
+ items,
2853
+ defaultOpen,
2854
+ className
2855
+ }
2856
+ );
2857
+ }
2858
+ var TokenWithChainBadge = ({
2859
+ tokenLogoUrl,
2860
+ tokenAlt,
2861
+ chainLogoUrl,
2862
+ chainName
2863
+ }) => {
2864
+ const fallbackText = encodeURIComponent((tokenAlt || "TOK").slice(0, 3).toUpperCase());
2865
+ const fallbackSrc = `https://placehold.co/40x40?text=${fallbackText}`;
2866
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-10 h-10", children: [
2867
+ /* @__PURE__ */ jsxRuntime.jsx(
2868
+ "img",
2869
+ {
2870
+ src: tokenLogoUrl || fallbackSrc,
2871
+ alt: tokenAlt || "",
2872
+ className: "object-cover w-10 h-10 rounded-full",
2873
+ onError: (e) => {
2874
+ e.target.src = fallbackSrc;
2875
+ }
2876
+ }
2877
+ ),
2878
+ chainLogoUrl && /* @__PURE__ */ jsxRuntime.jsx(
2879
+ "img",
2880
+ {
2881
+ src: chainLogoUrl,
2882
+ alt: chainName,
2883
+ className: "absolute object-cover w-6 h-6 p-px bg-white border rounded-full -bottom-1 -right-1 border-bg-default",
2884
+ onError: (e) => {
2885
+ e.target.style.display = "none";
2886
+ }
2887
+ }
2888
+ )
2889
+ ] });
2890
+ };
2891
+ var SwapProcessingView = ({
2892
+ fromTokenSymbol,
2893
+ fromTokenIcon,
2894
+ toTokenSymbol,
2895
+ toTokenIcon,
2896
+ formattedInputAmount,
2897
+ formattedOutputAmount,
2898
+ formattedInputAmountUSD,
2899
+ formattedOutputAmountUSD,
2900
+ progress,
2901
+ transactionSteps,
2902
+ onClose,
2903
+ onGoToHistory,
2904
+ titleText,
2905
+ descriptionPrefix,
2906
+ activityHistoryText,
2907
+ processingDetailsLabels
2908
+ }) => {
2909
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2910
+ TransactionScreen,
2911
+ {
2912
+ testId: "swap-processing-screen",
2913
+ onClose,
2914
+ progress,
2915
+ iconType: "processing",
2916
+ title: /* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": "swap-processing-title", children: titleText }),
2917
+ description: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2918
+ descriptionPrefix,
2919
+ " ",
2920
+ /* @__PURE__ */ jsxRuntime.jsxs(
2921
+ "span",
2922
+ {
2923
+ className: "font-semibold underline underline-offset-2 cursor-pointer text-brand-primary",
2924
+ onClick: onGoToHistory,
2925
+ children: [
2926
+ activityHistoryText,
2927
+ "."
2928
+ ]
2929
+ }
2930
+ )
2931
+ ] }),
2932
+ children: [
2933
+ /* @__PURE__ */ jsxRuntime.jsx(SectionCard, { className: "!p-[22px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between w-full relative px-md", children: [
2934
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
2935
+ /* @__PURE__ */ jsxRuntime.jsx("img", { src: fromTokenIcon, alt: fromTokenSymbol, className: "w-8 h-8 rounded-full" }),
2936
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
2937
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
2938
+ formattedInputAmount,
2939
+ " ",
2940
+ fromTokenSymbol
2941
+ ] }),
2942
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedInputAmountUSD })
2943
+ ] })
2944
+ ] }),
2945
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-brand-secondary rounded-full p-2 shadow-md z-10", children: /* @__PURE__ */ jsxRuntime.jsx(md.MdOutlineSwapHoriz, { className: "w-5 h-5" }) }),
2946
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
2947
+ /* @__PURE__ */ jsxRuntime.jsx("img", { src: toTokenIcon, alt: toTokenSymbol, className: "w-8 h-8 rounded-full" }),
2948
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
2949
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
2950
+ "~",
2951
+ formattedOutputAmount,
2952
+ " ",
2953
+ toTokenSymbol
2954
+ ] }),
2955
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedOutputAmountUSD })
2956
+ ] })
2957
+ ] })
2958
+ ] }) }),
2959
+ /* @__PURE__ */ jsxRuntime.jsx(
2960
+ TransactionProcessingDetails,
2961
+ {
2962
+ steps: transactionSteps,
2963
+ className: "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised dark:lg:!bg-bg-raised-dark",
2964
+ labels: processingDetailsLabels
2965
+ }
2966
+ )
2967
+ ]
2968
+ }
2969
+ );
2970
+ };
2971
+ var SwapCrossChainProcessingView = ({
2972
+ fromTokenSymbol,
2973
+ fromTokenIcon,
2974
+ toTokenSymbol,
2975
+ toTokenIcon,
2976
+ originChainId,
2977
+ destinationChainId,
2978
+ originChainLogoUrl,
2979
+ originChainName,
2980
+ destinationChainLogoUrl,
2981
+ destinationChainName,
2982
+ formattedInputAmount,
2983
+ formattedOutputAmount,
2984
+ formattedInputAmountUSD,
2985
+ formattedOutputAmountUSD,
2986
+ progress,
2987
+ title,
2988
+ description,
2989
+ transactionSteps,
2990
+ onClose,
2991
+ onGoToHistory,
2992
+ viewHistoryText,
2993
+ processingDetailsLabels
2994
+ }) => {
2995
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2996
+ TransactionScreen,
2997
+ {
2998
+ onClose,
2999
+ progress,
3000
+ iconType: "processing",
3001
+ title,
3002
+ description: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3003
+ description,
3004
+ " ",
3005
+ /* @__PURE__ */ jsxRuntime.jsx(
3006
+ "span",
3007
+ {
3008
+ className: "font-semibold underline cursor-pointer underline-offset-2 text-brand-primary",
3009
+ onClick: onGoToHistory,
3010
+ children: viewHistoryText
3011
+ }
3012
+ ),
3013
+ "."
3014
+ ] }),
3015
+ children: [
3016
+ /* @__PURE__ */ jsxRuntime.jsx(SectionCard, { className: "!p-[22px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex items-center justify-between w-full px-md", children: [
3017
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
3018
+ /* @__PURE__ */ jsxRuntime.jsx(
3019
+ TokenWithChainBadge,
3020
+ {
3021
+ tokenLogoUrl: fromTokenIcon,
3022
+ tokenAlt: fromTokenSymbol,
3023
+ chainId: originChainId,
3024
+ chainLogoUrl: originChainLogoUrl,
3025
+ chainName: originChainName
3026
+ }
3027
+ ),
3028
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
3029
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
3030
+ formattedInputAmount,
3031
+ " ",
3032
+ fromTokenSymbol
3033
+ ] }),
3034
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedInputAmountUSD })
3035
+ ] })
3036
+ ] }),
3037
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute z-10 p-2 -translate-x-1/2 -translate-y-1/2 rounded-full shadow-md left-1/2 top-1/2 bg-brand-secondary", children: /* @__PURE__ */ jsxRuntime.jsx(md.MdOutlineSwapHoriz, { className: "w-5 h-5" }) }),
3038
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
3039
+ /* @__PURE__ */ jsxRuntime.jsx(
3040
+ TokenWithChainBadge,
3041
+ {
3042
+ tokenLogoUrl: toTokenIcon,
3043
+ tokenAlt: toTokenSymbol,
3044
+ chainId: destinationChainId,
3045
+ chainLogoUrl: destinationChainLogoUrl,
3046
+ chainName: destinationChainName
3047
+ }
3048
+ ),
3049
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
3050
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
3051
+ "~",
3052
+ formattedOutputAmount,
3053
+ " ",
3054
+ toTokenSymbol
3055
+ ] }),
3056
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedOutputAmountUSD })
3057
+ ] })
3058
+ ] })
3059
+ ] }) }),
3060
+ /* @__PURE__ */ jsxRuntime.jsx(
3061
+ TransactionProcessingDetails,
3062
+ {
3063
+ steps: transactionSteps,
3064
+ className: "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised dark:lg:!bg-bg-raised-dark",
3065
+ labels: processingDetailsLabels
3066
+ }
3067
+ )
3068
+ ]
3069
+ }
3070
+ );
3071
+ };
3072
+ var SwapSignatureWarningView = ({
3073
+ fromTokenSymbol,
3074
+ fromTokenIcon,
3075
+ toTokenSymbol,
3076
+ toTokenIcon,
3077
+ formattedInputAmount,
3078
+ formattedOutputAmount,
3079
+ formattedInputAmountUSD,
3080
+ formattedOutputAmountUSD,
3081
+ progress,
3082
+ errorTitle,
3083
+ errorDescription,
3084
+ transactionSteps,
3085
+ onCancel,
3086
+ onTryAgain,
3087
+ cancelButtonText,
3088
+ retryButtonText,
3089
+ processingDetailsLabels
3090
+ }) => {
3091
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3092
+ TransactionScreen,
3093
+ {
3094
+ testId: "swap-signature-warning-screen",
3095
+ onClose: onCancel,
3096
+ progress,
3097
+ iconType: "warning",
3098
+ title: /* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": "swap-signature-warning-title", children: errorTitle }),
3099
+ description: errorDescription,
3100
+ actions: /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-testid": "swap-signature-warning-actions", className: "flex gap-sm w-full", children: [
3101
+ /* @__PURE__ */ jsxRuntime.jsx(SecondaryButton, { "data-testid": "swap-signature-warning-cancel", className: "flex-1", onClick: onCancel, children: cancelButtonText }),
3102
+ /* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { "data-testid": "swap-signature-warning-retry", className: "flex-1", onClick: onTryAgain, children: retryButtonText })
3103
+ ] }),
3104
+ children: [
3105
+ /* @__PURE__ */ jsxRuntime.jsx(SectionCard, { className: "!p-[22px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between w-full relative px-md", children: [
3106
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
3107
+ /* @__PURE__ */ jsxRuntime.jsx("img", { src: fromTokenIcon, alt: fromTokenSymbol, className: "w-8 h-8 rounded-full" }),
3108
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
3109
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
3110
+ formattedInputAmount,
3111
+ " ",
3112
+ fromTokenSymbol
3113
+ ] }),
3114
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedInputAmountUSD })
3115
+ ] })
3116
+ ] }),
3117
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-brand-secondary rounded-full p-2 shadow-md z-10", children: /* @__PURE__ */ jsxRuntime.jsx(md.MdOutlineSwapHoriz, { className: "w-5 h-5" }) }),
3118
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
3119
+ /* @__PURE__ */ jsxRuntime.jsx("img", { src: toTokenIcon, alt: toTokenSymbol, className: "w-8 h-8 rounded-full" }),
3120
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
3121
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
3122
+ "~",
3123
+ formattedOutputAmount,
3124
+ " ",
3125
+ toTokenSymbol
3126
+ ] }),
3127
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedOutputAmountUSD })
3128
+ ] })
3129
+ ] })
3130
+ ] }) }),
3131
+ /* @__PURE__ */ jsxRuntime.jsx(
3132
+ TransactionProcessingDetails,
3133
+ {
3134
+ steps: transactionSteps,
3135
+ defaultOpen: true,
3136
+ className: "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised dark:lg:!bg-bg-raised-dark",
3137
+ labels: processingDetailsLabels
3138
+ }
3139
+ )
3140
+ ]
3141
+ }
3142
+ );
3143
+ };
3144
+ var SwapSuccessView = ({
3145
+ fromTokenSymbol,
3146
+ fromTokenIcon,
3147
+ toTokenSymbol,
3148
+ toTokenIcon,
3149
+ formattedInputAmount,
3150
+ formattedOutputAmount,
3151
+ formattedInputAmountUSD,
3152
+ formattedOutputAmountUSD,
3153
+ transactionSteps,
3154
+ onClose,
3155
+ onStartNewSwap,
3156
+ onGoToWallet,
3157
+ labels,
3158
+ processingDetailsLabels
3159
+ }) => {
3160
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3161
+ TransactionScreen,
3162
+ {
3163
+ testId: "swap-success-screen",
3164
+ onClose,
3165
+ progress: 100,
3166
+ iconType: "success",
3167
+ title: /* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": "swap-success-title", children: labels.title }),
3168
+ description: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3169
+ labels.descriptionPrefix,
3170
+ " ",
3171
+ /* @__PURE__ */ jsxRuntime.jsxs("strong", { className: "font-semibold", children: [
3172
+ formattedInputAmount,
3173
+ " ",
3174
+ fromTokenSymbol
3175
+ ] }),
3176
+ " ",
3177
+ labels.descriptionMiddle,
3178
+ " ",
3179
+ /* @__PURE__ */ jsxRuntime.jsxs("strong", { className: "font-semibold", children: [
3180
+ formattedOutputAmount,
3181
+ " ",
3182
+ toTokenSymbol
3183
+ ] }),
3184
+ /* @__PURE__ */ jsxRuntime.jsx("br", {}),
3185
+ labels.descriptionSuffix,
3186
+ " ",
3187
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "font-semibold text-brand-primary cursor-pointer", onClick: onGoToWallet, children: labels.walletLinkText })
3188
+ ] }),
3189
+ actions: /* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": "swap-start-new-wrapper", className: "w-full", children: /* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { "data-testid": "swap-start-new-button", className: "w-full", onClick: onStartNewSwap, children: labels.startNewSwapButton }) }),
3190
+ children: [
3191
+ /* @__PURE__ */ jsxRuntime.jsx(SectionCard, { className: "!p-[22px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between w-full relative px-md", children: [
3192
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
3193
+ /* @__PURE__ */ jsxRuntime.jsx("img", { src: fromTokenIcon, alt: fromTokenSymbol, className: "w-8 h-8 rounded-full" }),
3194
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
3195
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
3196
+ formattedInputAmount,
3197
+ " ",
3198
+ fromTokenSymbol
3199
+ ] }),
3200
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedInputAmountUSD })
3201
+ ] })
3202
+ ] }),
3203
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-brand-secondary rounded-full p-2 shadow-md z-10", children: /* @__PURE__ */ jsxRuntime.jsx(md.MdOutlineSwapHoriz, { className: "w-5 h-5" }) }),
3204
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
3205
+ /* @__PURE__ */ jsxRuntime.jsx("img", { src: toTokenIcon, alt: toTokenSymbol, className: "w-8 h-8 rounded-full" }),
3206
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
3207
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
3208
+ "~",
3209
+ formattedOutputAmount,
3210
+ " ",
3211
+ toTokenSymbol
3212
+ ] }),
3213
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedOutputAmountUSD })
3214
+ ] })
3215
+ ] })
3216
+ ] }) }),
3217
+ /* @__PURE__ */ jsxRuntime.jsx(
3218
+ TransactionProcessingDetails,
3219
+ {
3220
+ steps: transactionSteps,
3221
+ defaultOpen: true,
3222
+ className: "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised dark:lg:!bg-bg-raised-dark",
3223
+ labels: processingDetailsLabels
3224
+ }
3225
+ )
3226
+ ]
3227
+ }
3228
+ );
3229
+ };
3230
+ var SwapTransactionFailedView = ({
3231
+ fromTokenSymbol,
3232
+ fromTokenIcon,
3233
+ toTokenSymbol,
3234
+ toTokenIcon,
3235
+ formattedInputAmount,
3236
+ formattedOutputAmount,
3237
+ formattedInputAmountUSD,
3238
+ formattedOutputAmountUSD,
3239
+ progress,
3240
+ errorTitle,
3241
+ errorDescription,
3242
+ transactionSteps,
3243
+ hasExplorerLink,
3244
+ onBack,
3245
+ onViewExplorer,
3246
+ onTryAgain,
3247
+ viewOnExplorerText,
3248
+ retryButtonText,
3249
+ processingDetailsLabels
3250
+ }) => {
3251
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3252
+ TransactionScreen,
3253
+ {
3254
+ testId: "swap-failed-screen",
3255
+ onClose: onBack,
3256
+ progress,
3257
+ iconType: "warning",
3258
+ iconGradient: "linear-gradient(135deg, #EF4444 0%, #DC2626 100%)",
3259
+ title: /* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": "swap-failed-title", children: errorTitle }),
3260
+ description: errorDescription,
3261
+ actions: /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-testid": "swap-failed-actions", className: "flex gap-sm w-full", children: [
3262
+ /* @__PURE__ */ jsxRuntime.jsx(SecondaryButton, { "data-testid": "swap-failed-view-explorer", className: "flex-1", onClick: onViewExplorer, disabled: !hasExplorerLink, children: viewOnExplorerText }),
3263
+ /* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { "data-testid": "swap-failed-retry", className: "flex-1", onClick: onTryAgain, children: retryButtonText })
3264
+ ] }),
3265
+ children: [
3266
+ /* @__PURE__ */ jsxRuntime.jsx(SectionCard, { className: "!p-[22px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between w-full relative px-md", children: [
3267
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
3268
+ /* @__PURE__ */ jsxRuntime.jsx("img", { src: fromTokenIcon, alt: fromTokenSymbol, className: "w-8 h-8 rounded-full" }),
3269
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
3270
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
3271
+ "~",
3272
+ formattedInputAmount,
3273
+ " ",
3274
+ fromTokenSymbol
3275
+ ] }),
3276
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedInputAmountUSD })
3277
+ ] })
3278
+ ] }),
3279
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-brand-secondary rounded-full p-2 shadow-md z-10", children: /* @__PURE__ */ jsxRuntime.jsx(md.MdOutlineSwapHoriz, { className: "w-5 h-5" }) }),
3280
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
3281
+ /* @__PURE__ */ jsxRuntime.jsx("img", { src: toTokenIcon, alt: toTokenSymbol, className: "w-8 h-8 rounded-full" }),
3282
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
3283
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
3284
+ "~",
3285
+ formattedOutputAmount,
3286
+ " ",
3287
+ toTokenSymbol
3288
+ ] }),
3289
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedOutputAmountUSD })
3290
+ ] })
3291
+ ] })
3292
+ ] }) }),
3293
+ /* @__PURE__ */ jsxRuntime.jsx(
3294
+ TransactionProcessingDetails,
3295
+ {
3296
+ steps: transactionSteps,
3297
+ defaultOpen: true,
3298
+ className: "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised dark:lg:!bg-bg-raised-dark",
3299
+ labels: processingDetailsLabels
3300
+ }
3301
+ )
3302
+ ]
3303
+ }
3304
+ );
3305
+ };
3306
+ var ChooseAnAssetSwapView = ({
3307
+ actionSheetId,
3308
+ isOpen,
3309
+ currentActionSheetId,
3310
+ onClose,
3311
+ onSearch,
3312
+ autoFocus,
3313
+ displayedTokens,
3314
+ hasMore,
3315
+ onLoadMore,
3316
+ findBalance,
3317
+ isFetching,
3318
+ onAssetClick,
3319
+ labels,
3320
+ formatTokenAmount,
3321
+ formatCurrencyValue
3322
+ }) => {
3323
+ const [searchValue, setSearchValue] = React6__namespace.default.useState("");
3324
+ const handleSearch = (value) => {
3325
+ setSearchValue(value);
3326
+ onSearch(value);
3327
+ };
3328
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center", "data-testid": `swap-token-actionsheet-wrapper-${actionSheetId}`, children: /* @__PURE__ */ jsxRuntime.jsx(
3329
+ ActionSheet,
3330
+ {
3331
+ id: actionSheetId,
3332
+ currentActionSheetId,
3333
+ isOpen,
3334
+ onClose,
3335
+ position: "bottom",
3336
+ height: "full",
3337
+ contentClassName: "w-full max-w-[620px] mx-auto",
3338
+ children: /* @__PURE__ */ jsxRuntime.jsxs(BackgroundContainer, { className: "flex flex-col h-full", children: [
3339
+ /* @__PURE__ */ jsxRuntime.jsx(Navbar, { children: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { testId: `swap-token-actionsheet-close-${actionSheetId}`, onClick: onClose }) }),
3340
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col flex-1 w-full p-6 overflow-hidden", children: [
3341
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-shrink-0", children: [
3342
+ /* @__PURE__ */ jsxRuntime.jsx(TextHeading_default, { children: labels.title }),
3343
+ /* @__PURE__ */ jsxRuntime.jsx("br", {}),
3344
+ /* @__PURE__ */ jsxRuntime.jsx(
3345
+ SearchInput,
3346
+ {
3347
+ onSearch: handleSearch,
3348
+ placeholder: labels.searchPlaceholder,
3349
+ autoFocus,
3350
+ inputClassName: "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised lg:dark:!bg-bg-raised-dark",
3351
+ containerTestId: `swap-token-search-container-${actionSheetId}`,
3352
+ inputTestId: `swap-token-search-input-${actionSheetId}`
3353
+ }
3354
+ )
3355
+ ] }),
3356
+ searchValue && displayedTokens.length === 0 && !isFetching ? /* @__PURE__ */ jsxRuntime.jsx(SearchEmptyState, { title: labels.searchEmptyTitle, description: labels.searchEmptyDescription }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 w-full mt-4 overflow-y-auto flex-1 min-h-0", children: [
3357
+ isFetching && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center items-center w-full py-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
3358
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody_default, { variant: "text-small", className: "text-text-secondary dark:text-text-secondary-dark", children: labels.searchingText }),
3359
+ /* @__PURE__ */ jsxRuntime.jsx(LoadingDots, {})
3360
+ ] }) }),
3361
+ displayedTokens.map((token, index) => {
3362
+ const balance = findBalance(token);
3363
+ const tokenPriceUSD = Number(balance == null ? void 0 : balance.priceUSD) || 0;
3364
+ const formattedBalance = (balance == null ? void 0 : balance.amountUI) ? formatTokenAmount(balance.amountUI, tokenPriceUSD, 2) : "0";
3365
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3366
+ ListItem,
3367
+ {
3368
+ className: "w-full flex-shrink-0",
3369
+ onClick: () => onAssetClick(token),
3370
+ "data-testid": `swap-token-item-${token.symbol.toLowerCase()}-${token.chainId}`,
3371
+ "data-address": token.address,
3372
+ "data-chain-id": token.chainId,
3373
+ "data-symbol": token.symbol,
3374
+ children: [
3375
+ /* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: token.logoURI || "", alt: token.name, className: "w-10 h-10 rounded-full" }) }),
3376
+ /* @__PURE__ */ jsxRuntime.jsxs(ListItemContent, { children: [
3377
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody_default, { children: token.name }),
3378
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody_default, { variant: "text-small", children: token.symbol })
3379
+ ] }),
3380
+ /* @__PURE__ */ jsxRuntime.jsxs(ListItemRightSide, { children: [
3381
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody_default, { children: formattedBalance }),
3382
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody_default, { variant: "text-small", children: formatCurrencyValue(Number(balance == null ? void 0 : balance.amountInUSD) || 0) })
3383
+ ] })
3384
+ ]
3385
+ },
3386
+ `token-${token.address}-${index}`
3387
+ );
3388
+ }),
3389
+ hasMore && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center items-center w-full py-4 flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(TertiaryButton, { onClick: onLoadMore, children: labels.loadMoreButton }) })
3390
+ ] })
3391
+ ] })
3392
+ ] })
3393
+ }
3394
+ ) });
3395
+ };
2561
3396
 
2562
3397
  exports.ActionButton = ActionButton;
2563
3398
  exports.ActionSheet = ActionSheet;
@@ -2565,8 +3400,10 @@ exports.AddressDisplay = AddressDisplay;
2565
3400
  exports.BackgroundContainer = BackgroundContainer;
2566
3401
  exports.BannerNotification = BannerNotification;
2567
3402
  exports.ChooseAStrategyActionsheetView = ChooseAStrategyActionsheetView;
3403
+ exports.ChooseAnAssetSwapView = ChooseAnAssetSwapView;
2568
3404
  exports.CloseButton = CloseButton;
2569
3405
  exports.CollapsibleInfoRow = CollapsibleInfoRow;
3406
+ exports.CollapsibleSection = CollapsibleSection;
2570
3407
  exports.ConnectWalletList = ConnectWalletList;
2571
3408
  exports.Currency = Currency;
2572
3409
  exports.DeframeComponentsProvider = DeframeComponentsProvider;
@@ -2589,12 +3426,16 @@ exports.ListItem = ListItem;
2589
3426
  exports.ListItemContent = ListItemContent;
2590
3427
  exports.ListItemLeftSide = ListItemLeftSide;
2591
3428
  exports.ListItemRightSide = ListItemRightSide;
3429
+ exports.LoadingDots = LoadingDots;
2592
3430
  exports.LowRiskBadge = LowRiskBadge;
2593
3431
  exports.MediumRiskBadge = MediumRiskBadge;
2594
3432
  exports.Navbar = Navbar;
2595
3433
  exports.PercentageButton = PercentageButton;
2596
3434
  exports.PrimaryButton = PrimaryButton;
3435
+ exports.ProgressIndicator = ProgressIndicator;
2597
3436
  exports.ScrollableContent = ScrollableContent;
3437
+ exports.SearchEmptyState = SearchEmptyState;
3438
+ exports.SearchInput = SearchInput;
2598
3439
  exports.SecondaryButton = SecondaryButton;
2599
3440
  exports.SectionCard = SectionCard;
2600
3441
  exports.Select = Select;
@@ -2602,17 +3443,25 @@ exports.SelectContent = SelectContent;
2602
3443
  exports.SelectItem = SelectItem;
2603
3444
  exports.SelectTrigger = SelectTrigger;
2604
3445
  exports.Skeleton = Skeleton;
3446
+ exports.StepDisplay = StepDisplay;
3447
+ exports.StepStatusIcon = StepStatusIcon;
3448
+ exports.StepStatusText = StepStatusText;
2605
3449
  exports.StrategyDetailsView = StrategyDetailsView;
2606
3450
  exports.SummaryDetails = SummaryDetails;
2607
3451
  exports.SummaryDetailsCryptoControlV2 = SummaryDetailsCryptoControlV2;
2608
3452
  exports.SwapAmountInputView = SwapAmountInputView;
3453
+ exports.SwapCrossChainProcessingView = SwapCrossChainProcessingView;
2609
3454
  exports.SwapNetworkSelectorView = SwapNetworkSelectorView;
2610
3455
  exports.SwapOutputAmountView = SwapOutputAmountView;
3456
+ exports.SwapProcessingView = SwapProcessingView;
2611
3457
  exports.SwapQuoteBlockchainCostsView = SwapQuoteBlockchainCostsView;
2612
3458
  exports.SwapQuoteErrorsView = SwapQuoteErrorsView;
2613
3459
  exports.SwapQuoteHeaderView = SwapQuoteHeaderView;
3460
+ exports.SwapSignatureWarningView = SwapSignatureWarningView;
2614
3461
  exports.SwapSlippageToleranceButtonsView = SwapSlippageToleranceButtonsView;
3462
+ exports.SwapSuccessView = SwapSuccessView;
2615
3463
  exports.SwapTokenSelectorView = SwapTokenSelectorView;
3464
+ exports.SwapTransactionFailedView = SwapTransactionFailedView;
2616
3465
  exports.Tabs = Tabs;
2617
3466
  exports.TabsContent = TabsContent;
2618
3467
  exports.TabsList = TabsList;
@@ -2623,6 +3472,11 @@ exports.TextAccent = TextAccent_default;
2623
3472
  exports.TextBody = TextBody_default;
2624
3473
  exports.TextHeading = TextHeading_default;
2625
3474
  exports.Title = Title;
3475
+ exports.TokenWithChainBadge = TokenWithChainBadge;
3476
+ exports.TransactionProcessingDetails = TransactionProcessingDetails;
3477
+ exports.TransactionScreen = TransactionScreen;
3478
+ exports.TransactionScreenIcon = TransactionScreenIcon;
3479
+ exports.TransactionScreenInvestmentCard = TransactionScreenInvestmentCard;
2626
3480
  exports.WalletItem = WalletItem;
2627
3481
  exports.WalletList = ConnectWalletList;
2628
3482
  exports.WalletListContainer = WalletListContainer;