@deframe-sdk/components 0.1.5 → 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.mjs CHANGED
@@ -1,9 +1,11 @@
1
1
  import { twMerge } from 'tailwind-merge';
2
- import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import * as React6 from 'react';
4
- import { useState, useEffect, useMemo } from 'react';
4
+ import React6__default, { useState, useEffect, useMemo } from 'react';
5
5
  import { motion, AnimatePresence } from 'framer-motion';
6
- import { MdCheckCircleOutline, MdErrorOutline, MdWarningAmber, MdInfoOutline, MdClose } from 'react-icons/md';
6
+ import { MdCheckCircleOutline, MdErrorOutline, MdWarningAmber, MdInfoOutline, MdClose, MdOutlineSearch, MdOutlineSearchOff, MdOutlineSwapHoriz } from 'react-icons/md';
7
+ import { HiChevronUp, HiChevronDown, HiChevronLeft, HiXMark, HiArrowRight } from 'react-icons/hi2';
8
+ import { IoAlertCircleOutline, IoTimeOutline, IoCheckmarkOutline } from 'react-icons/io5';
7
9
 
8
10
  var __defProp = Object.defineProperty;
9
11
  var __defProps = Object.defineProperties;
@@ -1422,6 +1424,130 @@ var SummaryDetails = ({
1422
1424
  }
1423
1425
  );
1424
1426
  };
1427
+ var SummaryDetailsCryptoControlV2 = ({
1428
+ title,
1429
+ items,
1430
+ defaultOpen = false,
1431
+ className = "",
1432
+ summaryClassName = "",
1433
+ contentClassName = "",
1434
+ showDividers = true
1435
+ }) => {
1436
+ return /* @__PURE__ */ jsxs(
1437
+ "details",
1438
+ {
1439
+ "data-test-id": "summary-details-v2",
1440
+ "data-slot": "summary-details-v2",
1441
+ className: twMerge(
1442
+ "bg-[var(--color-bg-subtle,#1a1a1a)] rounded-lg border border-border-default dark:border-border-default-dark p-4 w-full max-w-[320px] group",
1443
+ className
1444
+ ),
1445
+ open: defaultOpen,
1446
+ children: [
1447
+ /* @__PURE__ */ jsx(
1448
+ "summary",
1449
+ {
1450
+ "data-test-id": "summary-details-v2-summary",
1451
+ "data-slot": "summary-details-v2-summary",
1452
+ className: twMerge("cursor-pointer list-none", summaryClassName),
1453
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
1454
+ /* @__PURE__ */ jsx(
1455
+ "span",
1456
+ {
1457
+ "data-test-id": "summary-details-v2-title",
1458
+ "data-slot": "summary-details-v2-title",
1459
+ className: "text-[15px] font-semibold text-text-primary dark:text-text-primary-dark",
1460
+ children: title
1461
+ }
1462
+ ),
1463
+ /* @__PURE__ */ jsx(
1464
+ "svg",
1465
+ {
1466
+ "data-test-id": "summary-details-v2-chevron",
1467
+ "data-slot": "summary-details-v2-chevron",
1468
+ className: "w-4 h-4 text-text-secondary dark:text-text-secondary-dark transition-transform duration-300 group-open:rotate-180 flex-shrink-0",
1469
+ viewBox: "0 0 24 24",
1470
+ fill: "none",
1471
+ stroke: "currentColor",
1472
+ "aria-hidden": "true",
1473
+ children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 9l7 7 7-7" })
1474
+ }
1475
+ )
1476
+ ] })
1477
+ }
1478
+ ),
1479
+ /* @__PURE__ */ jsx(
1480
+ "div",
1481
+ {
1482
+ "data-test-id": "summary-details-v2-top-divider",
1483
+ "data-slot": "summary-details-v2-top-divider",
1484
+ className: "h-px bg-border-default dark:bg-border-default-dark mt-3"
1485
+ }
1486
+ ),
1487
+ /* @__PURE__ */ jsx(
1488
+ "div",
1489
+ {
1490
+ "data-test-id": "summary-details-v2-content",
1491
+ "data-slot": "summary-details-v2-content",
1492
+ className: twMerge("mt-0", contentClassName),
1493
+ children: items.map((item, i) => /* @__PURE__ */ jsxs(React6.Fragment, { children: [
1494
+ /* @__PURE__ */ jsxs(
1495
+ "div",
1496
+ {
1497
+ "data-test-id": "summary-details-v2-row",
1498
+ "data-slot": "summary-details-v2-row",
1499
+ className: "flex justify-between items-center py-[10px] gap-3",
1500
+ children: [
1501
+ /* @__PURE__ */ jsx(
1502
+ "span",
1503
+ {
1504
+ "data-test-id": "summary-details-v2-row-label",
1505
+ "data-slot": "summary-details-v2-row-label",
1506
+ className: twMerge(
1507
+ "text-[11px] font-medium uppercase tracking-[0.07em] text-text-tertiary dark:text-text-tertiary-dark flex-shrink-0",
1508
+ item.labelClassName
1509
+ ),
1510
+ children: item.label
1511
+ }
1512
+ ),
1513
+ typeof item.value === "string" ? /* @__PURE__ */ jsx(
1514
+ "span",
1515
+ {
1516
+ "data-test-id": "summary-details-v2-row-value",
1517
+ "data-slot": "summary-details-v2-row-value",
1518
+ className: twMerge(
1519
+ "text-[13px] font-semibold text-text-primary dark:text-text-primary-dark text-right",
1520
+ item.valueClassName
1521
+ ),
1522
+ children: item.value
1523
+ }
1524
+ ) : /* @__PURE__ */ jsx(
1525
+ "div",
1526
+ {
1527
+ "data-test-id": "summary-details-v2-row-value",
1528
+ "data-slot": "summary-details-v2-row-value",
1529
+ className: twMerge("text-right", item.valueClassName),
1530
+ children: item.value
1531
+ }
1532
+ )
1533
+ ]
1534
+ }
1535
+ ),
1536
+ showDividers && i < items.length - 1 && /* @__PURE__ */ jsx(
1537
+ "div",
1538
+ {
1539
+ "data-test-id": "summary-details-v2-row-divider",
1540
+ "data-slot": "summary-details-v2-row-divider",
1541
+ className: "h-px bg-border-default dark:bg-border-default-dark"
1542
+ }
1543
+ )
1544
+ ] }, i))
1545
+ }
1546
+ )
1547
+ ]
1548
+ }
1549
+ );
1550
+ };
1425
1551
  var ActionSheet = ({
1426
1552
  id,
1427
1553
  currentActionSheetId,
@@ -1688,7 +1814,1565 @@ function DeframeComponentsProvider({
1688
1814
  }
1689
1815
  );
1690
1816
  }
1817
+ var InfoRow = ({ children, borderBottom, className }) => {
1818
+ const baseClasses = "self-stretch inline-flex justify-between items-start";
1819
+ const borderClasses = borderBottom ? "border-b border-border-default dark:border-border-default-dark pb-sm" : "";
1820
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "info-row", className: twMerge(baseClasses, borderClasses, className), children });
1821
+ };
1822
+ var InfoLabel = ({ children, className }) => {
1823
+ const baseClasses = "text-sm text-text-secondary dark:text-text-secondary-dark";
1824
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "info-label", className: twMerge(baseClasses, className), children });
1825
+ };
1826
+ var variantClasses = {
1827
+ default: "text-text-primary dark:text-text-primary-dark",
1828
+ success: "text-state-success",
1829
+ warning: "text-state-warning",
1830
+ error: "text-state-error"
1831
+ };
1832
+ var InfoValue = ({ children, variant = "default", className }) => {
1833
+ const baseClasses = "text-sm font-semibold";
1834
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "info-value", className: twMerge(baseClasses, variantClasses[variant], className), children });
1835
+ };
1836
+ var InfoRowWithIcon = ({ children, borderBottom, className }) => {
1837
+ const baseClasses = "flex items-start justify-between h-[17px]";
1838
+ const borderClasses = borderBottom ? "border-b border-border-default dark:border-border-default-dark pb-sm" : "";
1839
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "info-row-with-icon", className: twMerge(baseClasses, borderClasses, className), children });
1840
+ };
1841
+ var InfoRowIconLabel = ({ children, className }) => {
1842
+ const baseClasses = "text-sm text-text-secondary dark:text-text-secondary-dark";
1843
+ return /* @__PURE__ */ jsxs("div", { "data-test-id": "info-row-icon-label", className: twMerge(baseClasses, className), children: [
1844
+ "\u2022 ",
1845
+ children
1846
+ ] });
1847
+ };
1848
+ var InfoRowIconValue = ({ children, className }) => {
1849
+ const baseClasses = "text-sm font-semibold text-text-primary dark:text-text-primary-dark";
1850
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "info-row-icon-value", className: twMerge(baseClasses, className), children });
1851
+ };
1852
+ var CollapsibleInfoRow = ({
1853
+ label,
1854
+ value,
1855
+ children,
1856
+ defaultOpen = false,
1857
+ className,
1858
+ collapseLabel,
1859
+ expandLabel
1860
+ }) => {
1861
+ const [isOpen, setIsOpen] = React6__default.useState(defaultOpen);
1862
+ const baseClasses = "flex flex-col gap-sm w-full";
1863
+ return /* @__PURE__ */ jsxs("div", { "data-test-id": "collapsible-info-row", className: twMerge(baseClasses, className), children: [
1864
+ /* @__PURE__ */ jsxs(
1865
+ "button",
1866
+ {
1867
+ type: "button",
1868
+ onClick: () => setIsOpen(!isOpen),
1869
+ className: "flex items-start justify-between w-full text-left h-[18px] cursor-pointer",
1870
+ "aria-expanded": isOpen,
1871
+ "aria-label": `${isOpen ? collapseLabel : expandLabel} ${label}`,
1872
+ children: [
1873
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-[2px]", children: [
1874
+ /* @__PURE__ */ jsx("span", { className: "text-text-sm text-text-secondary dark:text-text-secondary-dark", children: label }),
1875
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-[18px] h-[18px]", children: isOpen ? /* @__PURE__ */ jsx(HiChevronUp, { className: "w-3 h-3 text-text-secondary dark:text-text-secondary-dark" }) : /* @__PURE__ */ jsx(HiChevronDown, { className: "w-3 h-3 text-text-secondary dark:text-text-secondary-dark" }) })
1876
+ ] }),
1877
+ /* @__PURE__ */ jsx("span", { className: "text-text-sm font-semibold text-text-secondary dark:text-text-secondary-dark", children: value })
1878
+ ]
1879
+ }
1880
+ ),
1881
+ isOpen && children
1882
+ ] });
1883
+ };
1884
+ var BackgroundContainer = ({ children, className }) => {
1885
+ const baseClasses = "w-full flex-1 min-h-0 px-md bg-bg-default lg:bg-bg-subtle dark:bg-bg-default-dark lg:dark:bg-bg-subtle-dark text-text-primary dark:text-text-primary-dark flex flex-col relative overflow-y-auto";
1886
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "background-container", className: twMerge(baseClasses, className), children });
1887
+ };
1888
+ var SectionCard = ({ children, className }) => {
1889
+ const baseClasses = "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised rounded shadow-sm p-md flex flex-col gap-sm";
1890
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "section-card", className: twMerge(baseClasses, className), children });
1891
+ };
1892
+ var Navbar = ({ children, className }) => {
1893
+ const baseClasses = "w-full px-sm pr-md pt-sm pb-md border-b items-center border-border-subtle dark:border-border-subtle-dark flex";
1894
+ return /* @__PURE__ */ jsx("nav", { "data-test-id": "navbar", className: twMerge(baseClasses, className), children });
1895
+ };
1896
+ var gapClasses = {
1897
+ xs: "gap-xs",
1898
+ sm: "gap-sm",
1899
+ md: "gap-md",
1900
+ lg: "gap-lg"
1901
+ };
1902
+ var FlexCol = ({ children, className, gap = "xs" }) => {
1903
+ const baseClasses = "flex flex-col";
1904
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "flex-col", className: twMerge(baseClasses, gapClasses[gap], className), children });
1905
+ };
1906
+ var gapClasses2 = {
1907
+ xs: "gap-xs",
1908
+ sm: "gap-sm",
1909
+ md: "gap-md",
1910
+ lg: "gap-lg"
1911
+ };
1912
+ var FlexRow = ({ children, className, gap = "xs" }) => {
1913
+ const baseClasses = "flex items-center";
1914
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "flex-row", className: twMerge(baseClasses, gapClasses2[gap], className), children });
1915
+ };
1916
+ var ScrollableContent = ({ children, className }) => {
1917
+ const baseClasses = "flex-1 overflow-y-auto px-md py-lg";
1918
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "scrollable-content", className: twMerge(baseClasses, className), children });
1919
+ };
1920
+ var DetailsHeader = ({ title, onBack, className, backAriaLabel = "Back" }) => {
1921
+ const baseClasses = "w-full px-sm pr-md pt-sm pb-md border-b border-border-subtle dark:border-border-subtle-dark flex items-center";
1922
+ return /* @__PURE__ */ jsxs("div", { "data-test-id": "details-header", className: twMerge(baseClasses, className), children: [
1923
+ /* @__PURE__ */ jsx(
1924
+ "button",
1925
+ {
1926
+ "data-test-id": "details-header-back-button",
1927
+ onClick: onBack,
1928
+ className: "w-12 h-12 rounded-full flex items-center justify-center text-text-secondary dark:text-text-secondary-dark hover:text-brand-primary cursor-pointer",
1929
+ "aria-label": backAriaLabel,
1930
+ children: /* @__PURE__ */ jsx(HiChevronLeft, { className: "w-6 h-6 text-text-tertiary dark:text-text-tertiary-dark" })
1931
+ }
1932
+ ),
1933
+ /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center", children: /* @__PURE__ */ jsx(TextHeading_default, { variant: "h-large", children: title }) })
1934
+ ] });
1935
+ };
1936
+ var CloseButton = ({ onClick, testId, ariaLabel = "Close", className }) => {
1937
+ const baseClasses = "w-12 h-12 rounded-full flex items-center justify-center text-text-secondary dark:text-text-secondary-dark hover:text-brand-primary transition-colors cursor-pointer";
1938
+ return /* @__PURE__ */ jsx(
1939
+ "button",
1940
+ {
1941
+ "data-test-id": testId != null ? testId : "close-button",
1942
+ onClick,
1943
+ className: twMerge(baseClasses, className),
1944
+ "aria-label": ariaLabel,
1945
+ children: /* @__PURE__ */ jsx(HiXMark, { className: "w-6 h-6" })
1946
+ }
1947
+ );
1948
+ };
1949
+ var HighRiskBadge = ({ className, label }) => {
1950
+ const baseClasses = "inline-flex justify-start items-start gap-1";
1951
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "high-risk-badge", className: twMerge(baseClasses, className), children: /* @__PURE__ */ jsx(
1952
+ "div",
1953
+ {
1954
+ "data-size": "Small",
1955
+ "data-type": "Failed",
1956
+ className: "h-6 px-2 py-1 opacity-95 bg-red-500/20 rounded-lg outline outline-1 outline-offset-[-1px] outline-state-error flex justify-center items-center gap-1",
1957
+ children: /* @__PURE__ */ jsx("div", { className: "flex justify-start items-center gap-2.5", children: /* @__PURE__ */ jsx("div", { className: "justify-start text-state-error text-xs font-normal font-poppins leading-4", children: label }) })
1958
+ }
1959
+ ) });
1960
+ };
1961
+ var MediumRiskBadge = ({ className, label }) => {
1962
+ const baseClasses = "inline-flex justify-start items-start gap-1";
1963
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "medium-risk-badge", className: twMerge(baseClasses, className), children: /* @__PURE__ */ jsx(
1964
+ "div",
1965
+ {
1966
+ "data-size": "Small",
1967
+ "data-type": "Warning",
1968
+ className: "h-6 px-2 py-1 opacity-95 bg-amber-500/20 rounded-lg outline outline-1 outline-offset-[-1px] outline-state-warning flex justify-center items-center gap-1",
1969
+ children: /* @__PURE__ */ jsx("div", { className: "flex justify-start items-center gap-2.5", children: /* @__PURE__ */ jsx("div", { className: "justify-start text-state-warning text-xs font-normal font-poppins leading-4", children: label }) })
1970
+ }
1971
+ ) });
1972
+ };
1973
+ var LowRiskBadge = ({ className, label }) => {
1974
+ const baseClasses = "inline-flex justify-start items-start gap-1";
1975
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "low-risk-badge", className: twMerge(baseClasses, className), children: /* @__PURE__ */ jsx(
1976
+ "div",
1977
+ {
1978
+ "data-size": "Small",
1979
+ "data-type": "Completed",
1980
+ className: "h-6 px-2 py-1 opacity-95 bg-teal-600/20 rounded-lg outline outline-1 outline-offset-[-1px] outline-state-success flex justify-center items-center gap-1",
1981
+ children: /* @__PURE__ */ jsx("div", { className: "flex justify-start items-center gap-2.5", children: /* @__PURE__ */ jsx("div", { className: "justify-start text-state-success text-xs font-normal font-poppins leading-4", children: label }) })
1982
+ }
1983
+ ) });
1984
+ };
1985
+ var gapClasses3 = {
1986
+ xs: "gap-xs",
1987
+ sm: "gap-sm",
1988
+ md: "gap-md",
1989
+ lg: "gap-lg"
1990
+ };
1991
+ var HistoryFlexCol = ({ children, className, gap = "xs" }) => /* @__PURE__ */ jsx("div", { "data-test-id": "history-flex-col", className: twMerge("flex flex-col", gapClasses3[gap], className), children });
1992
+ var TransactionTypeLabel = ({ children }) => /* @__PURE__ */ jsx("p", { "data-test-id": "transaction-type-label", className: "text-text-sm-mobile text-text-secondary dark:text-text-secondary-dark", children });
1993
+ var Amount = ({ children }) => /* @__PURE__ */ jsx("p", { "data-test-id": "amount", className: "text-accent-md-mobile text-text-secondary dark:text-text-secondary-dark", children });
1994
+ var AmountInUsd = ({ children }) => /* @__PURE__ */ jsxs("p", { "data-test-id": "amount-in-usd", className: "text-text-sm-mobile text-text-secondary dark:text-text-secondary-dark", children: [
1995
+ "~ ",
1996
+ children
1997
+ ] });
1998
+ var TokenIcon = ({ src, alt }) => /* @__PURE__ */ jsx(
1999
+ "img",
2000
+ {
2001
+ "data-test-id": "token-icon",
2002
+ src,
2003
+ alt,
2004
+ className: "w-8 h-8 rounded-full",
2005
+ onError: (e) => {
2006
+ const fallbackText = encodeURIComponent((alt || "TOK").slice(0, 3).toUpperCase());
2007
+ e.target.src = `https://placehold.co/40x40?text=${fallbackText}`;
2008
+ }
2009
+ }
2010
+ );
2011
+ var SuccessBadge = ({ children }) => /* @__PURE__ */ jsxs("div", { "data-test-id": "success-badge", className: "bg-[rgba(43,161,118,0.12)] flex items-center gap-xs px-[8px] py-[2px] rounded-[24px]", children: [
2012
+ /* @__PURE__ */ jsx("span", { className: "w-2 h-2 rounded-full bg-state-success" }),
2013
+ /* @__PURE__ */ jsx("span", { className: "text-text-sm-mobile text-text-primary dark:text-text-primary-dark", children })
2014
+ ] });
2015
+ var truncateHash = (hash, chars = 6) => {
2016
+ if (hash.length <= chars * 2 + 3) return hash;
2017
+ return `${hash.slice(0, chars + 2)}...${hash.slice(-chars)}`;
2018
+ };
2019
+ var TransactionId = ({ hash }) => {
2020
+ if (!hash) {
2021
+ return /* @__PURE__ */ jsx("span", { "data-test-id": "transaction-id", className: "text-text-sm-mobile text-text-primary dark:text-text-primary-dark", children: "-" });
2022
+ }
2023
+ return /* @__PURE__ */ jsxs("div", { "data-test-id": "transaction-id", className: "flex items-center gap-xs", children: [
2024
+ /* @__PURE__ */ jsx("span", { className: "text-text-sm-mobile text-text-primary dark:text-text-primary-dark", children: truncateHash(hash) }),
2025
+ /* @__PURE__ */ jsx(
2026
+ AddressDisplay,
2027
+ {
2028
+ address: hash,
2029
+ className: "border-none bg-transparent p-0 gap-0",
2030
+ textClassName: "hidden"
2031
+ }
2032
+ )
2033
+ ] });
2034
+ };
2035
+ var ExplorerLink = ({ href, children }) => /* @__PURE__ */ jsx(
2036
+ "a",
2037
+ {
2038
+ "data-test-id": "explorer-link",
2039
+ href,
2040
+ target: "_blank",
2041
+ rel: "noopener noreferrer",
2042
+ className: "text-brand-primary underline text-sm font-semibold font-poppins",
2043
+ children
2044
+ }
2045
+ );
2046
+ var TwoLineValue = ({ primary, secondary }) => /* @__PURE__ */ jsxs(HistoryFlexCol, { className: "items-end", children: [
2047
+ /* @__PURE__ */ jsx("p", { "data-test-id": "two-line-value-primary", className: "text-text-sm-mobile text-text-secondary dark:text-text-secondary-dark font-semibold", children: primary }),
2048
+ /* @__PURE__ */ jsx("p", { "data-test-id": "two-line-value-secondary", className: "text-text-sm-mobile text-text-secondary dark:text-text-secondary-dark", children: secondary })
2049
+ ] });
2050
+ var HistoryDepositDetailsView = ({
2051
+ transactionTypeLabel,
2052
+ symbol,
2053
+ amountWithSymbol,
2054
+ amountInUsdFormatted,
2055
+ shouldShowFlow,
2056
+ assetIn,
2057
+ assetOut,
2058
+ primaryAssetIconUrl,
2059
+ protocolLabel,
2060
+ statusLabel,
2061
+ txHash,
2062
+ date,
2063
+ explorerUrl,
2064
+ onClose,
2065
+ labels
2066
+ }) => {
2067
+ return /* @__PURE__ */ jsxs(BackgroundContainer, { children: [
2068
+ /* @__PURE__ */ jsx(DetailsHeader, { title: labels.transactionDetailsTitle, onBack: onClose }),
2069
+ /* @__PURE__ */ jsx(ScrollableContent, { children: /* @__PURE__ */ jsxs(FlexCol, { gap: "lg", children: [
2070
+ /* @__PURE__ */ jsx(SectionCard, { className: "!p-[24px]", children: /* @__PURE__ */ jsxs(FlexCol, { gap: "xs", children: [
2071
+ /* @__PURE__ */ jsx(TransactionTypeLabel, { children: transactionTypeLabel }),
2072
+ shouldShowFlow && assetIn && assetOut ? /* @__PURE__ */ jsxs(FlexCol, { gap: "sm", children: [
2073
+ /* @__PURE__ */ jsxs(FlexRow, { gap: "sm", children: [
2074
+ /* @__PURE__ */ jsx(TokenIcon, { src: assetIn.iconUrl, alt: assetIn.symbol }),
2075
+ /* @__PURE__ */ jsxs(FlexCol, { children: [
2076
+ /* @__PURE__ */ jsxs(Amount, { children: [
2077
+ assetIn.amount,
2078
+ " ",
2079
+ assetIn.symbol
2080
+ ] }),
2081
+ assetIn.amountInUSD ? /* @__PURE__ */ jsx(AmountInUsd, { children: assetIn.amountInUSD }) : null
2082
+ ] })
2083
+ ] }),
2084
+ /* @__PURE__ */ jsxs(FlexRow, { gap: "sm", children: [
2085
+ /* @__PURE__ */ jsx(TokenIcon, { src: assetOut.iconUrl, alt: assetOut.symbol }),
2086
+ /* @__PURE__ */ jsxs(FlexCol, { children: [
2087
+ /* @__PURE__ */ jsxs(Amount, { children: [
2088
+ assetOut.amount,
2089
+ " ",
2090
+ assetOut.symbol
2091
+ ] }),
2092
+ assetOut.amountInUSD ? /* @__PURE__ */ jsx(AmountInUsd, { children: assetOut.amountInUSD }) : null
2093
+ ] })
2094
+ ] })
2095
+ ] }) : /* @__PURE__ */ jsxs(FlexRow, { gap: "sm", children: [
2096
+ /* @__PURE__ */ jsx(TokenIcon, { src: primaryAssetIconUrl, alt: symbol }),
2097
+ /* @__PURE__ */ jsx(FlexCol, { children: /* @__PURE__ */ jsxs(FlexRow, { gap: "xs", children: [
2098
+ /* @__PURE__ */ jsx(Amount, { children: amountWithSymbol }),
2099
+ amountInUsdFormatted !== "-" ? /* @__PURE__ */ jsx(AmountInUsd, { children: amountInUsdFormatted }) : null
2100
+ ] }) })
2101
+ ] })
2102
+ ] }) }),
2103
+ /* @__PURE__ */ jsx(SectionCard, { className: "!p-md", children: /* @__PURE__ */ jsxs(FlexCol, { gap: "sm", children: [
2104
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2105
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.currencyLabel }),
2106
+ /* @__PURE__ */ jsx(InfoValue, { children: symbol })
2107
+ ] }),
2108
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2109
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.totalAmountLabel }),
2110
+ /* @__PURE__ */ jsx(TwoLineValue, { primary: amountInUsdFormatted, secondary: amountWithSymbol })
2111
+ ] }),
2112
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2113
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.operationCostLabel }),
2114
+ /* @__PURE__ */ jsx(InfoValue, { children: labels.operationCostSponsoredLabel })
2115
+ ] }),
2116
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2117
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.protocolLabel }),
2118
+ /* @__PURE__ */ jsx(InfoValue, { children: protocolLabel })
2119
+ ] }),
2120
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2121
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.statusLabel }),
2122
+ /* @__PURE__ */ jsx(SuccessBadge, { children: statusLabel })
2123
+ ] }),
2124
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2125
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.transactionIdLabel }),
2126
+ /* @__PURE__ */ jsx(TransactionId, { hash: txHash })
2127
+ ] }),
2128
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2129
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.dateLabel }),
2130
+ /* @__PURE__ */ jsx(InfoValue, { children: date })
2131
+ ] }),
2132
+ explorerUrl && /* @__PURE__ */ jsxs(InfoRow, { children: [
2133
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.transactionLabel }),
2134
+ /* @__PURE__ */ jsx(ExplorerLink, { href: explorerUrl, children: labels.viewOnExplorerLabel })
2135
+ ] })
2136
+ ] }) })
2137
+ ] }) })
2138
+ ] });
2139
+ };
2140
+ var HistoryWithdrawDetailsView = ({
2141
+ transactionTypeLabel,
2142
+ symbol,
2143
+ amountWithSymbol,
2144
+ amountInUsdFormatted,
2145
+ shouldShowFlow,
2146
+ assetIn,
2147
+ assetOut,
2148
+ primaryAssetIconUrl,
2149
+ protocolLabel,
2150
+ statusLabel,
2151
+ txHash,
2152
+ date,
2153
+ explorerUrl,
2154
+ onClose,
2155
+ labels
2156
+ }) => {
2157
+ return /* @__PURE__ */ jsxs(BackgroundContainer, { children: [
2158
+ /* @__PURE__ */ jsx(DetailsHeader, { title: labels.transactionDetailsTitle, onBack: onClose }),
2159
+ /* @__PURE__ */ jsx(ScrollableContent, { children: /* @__PURE__ */ jsxs(FlexCol, { gap: "lg", children: [
2160
+ /* @__PURE__ */ jsx(SectionCard, { className: "!p-[24px]", children: /* @__PURE__ */ jsxs(FlexCol, { gap: "xs", children: [
2161
+ /* @__PURE__ */ jsx(TransactionTypeLabel, { children: transactionTypeLabel }),
2162
+ shouldShowFlow && assetIn && assetOut ? /* @__PURE__ */ jsxs(FlexCol, { gap: "sm", children: [
2163
+ /* @__PURE__ */ jsxs(FlexRow, { gap: "sm", children: [
2164
+ /* @__PURE__ */ jsx(TokenIcon, { src: assetIn.iconUrl, alt: assetIn.symbol }),
2165
+ /* @__PURE__ */ jsxs(FlexCol, { children: [
2166
+ /* @__PURE__ */ jsxs(Amount, { children: [
2167
+ assetIn.amount,
2168
+ " ",
2169
+ assetIn.symbol
2170
+ ] }),
2171
+ assetIn.amountInUSD ? /* @__PURE__ */ jsx(AmountInUsd, { children: assetIn.amountInUSD }) : null
2172
+ ] })
2173
+ ] }),
2174
+ /* @__PURE__ */ jsxs(FlexRow, { gap: "sm", children: [
2175
+ /* @__PURE__ */ jsx(TokenIcon, { src: assetOut.iconUrl, alt: assetOut.symbol }),
2176
+ /* @__PURE__ */ jsxs(FlexCol, { children: [
2177
+ /* @__PURE__ */ jsxs(Amount, { children: [
2178
+ assetOut.amount,
2179
+ " ",
2180
+ assetOut.symbol
2181
+ ] }),
2182
+ assetOut.amountInUSD ? /* @__PURE__ */ jsx(AmountInUsd, { children: assetOut.amountInUSD }) : null
2183
+ ] })
2184
+ ] })
2185
+ ] }) : /* @__PURE__ */ jsxs(FlexRow, { gap: "sm", children: [
2186
+ /* @__PURE__ */ jsx(TokenIcon, { src: primaryAssetIconUrl, alt: symbol }),
2187
+ /* @__PURE__ */ jsx(FlexCol, { children: /* @__PURE__ */ jsxs(FlexRow, { gap: "xs", children: [
2188
+ /* @__PURE__ */ jsx(Amount, { children: amountWithSymbol }),
2189
+ amountInUsdFormatted !== "-" ? /* @__PURE__ */ jsx(AmountInUsd, { children: amountInUsdFormatted }) : null
2190
+ ] }) })
2191
+ ] })
2192
+ ] }) }),
2193
+ /* @__PURE__ */ jsx(SectionCard, { className: "!p-md", children: /* @__PURE__ */ jsxs(FlexCol, { gap: "sm", children: [
2194
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2195
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.currencyLabel }),
2196
+ /* @__PURE__ */ jsx(InfoValue, { children: symbol })
2197
+ ] }),
2198
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2199
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.totalAmountLabel }),
2200
+ /* @__PURE__ */ jsx(TwoLineValue, { primary: amountInUsdFormatted, secondary: amountWithSymbol })
2201
+ ] }),
2202
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2203
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.operationCostLabel }),
2204
+ /* @__PURE__ */ jsx(InfoValue, { children: labels.operationCostSponsoredLabel })
2205
+ ] }),
2206
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2207
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.protocolLabel }),
2208
+ /* @__PURE__ */ jsx(InfoValue, { children: protocolLabel })
2209
+ ] }),
2210
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2211
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.statusLabel }),
2212
+ /* @__PURE__ */ jsx(SuccessBadge, { children: statusLabel })
2213
+ ] }),
2214
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2215
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.transactionIdLabel }),
2216
+ /* @__PURE__ */ jsx(TransactionId, { hash: txHash })
2217
+ ] }),
2218
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2219
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.dateLabel }),
2220
+ /* @__PURE__ */ jsx(InfoValue, { children: date })
2221
+ ] }),
2222
+ explorerUrl && /* @__PURE__ */ jsxs(InfoRow, { children: [
2223
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.transactionLabel }),
2224
+ /* @__PURE__ */ jsx(ExplorerLink, { href: explorerUrl, children: labels.viewOnExplorerLabel })
2225
+ ] })
2226
+ ] }) })
2227
+ ] }) })
2228
+ ] });
2229
+ };
2230
+ var SwapNetworkSelectorView = ({
2231
+ chainLabel,
2232
+ chainImage,
2233
+ onClick,
2234
+ directionLabel = "De",
2235
+ testId = "swap-network-selector",
2236
+ className
2237
+ }) => {
2238
+ const baseClasses = "flex flex-row items-center gap-xs";
2239
+ return /* @__PURE__ */ jsxs("div", { "data-test-id": testId, className: twMerge(baseClasses, className), children: [
2240
+ /* @__PURE__ */ jsx(TextBody_default, { as: "span", variant: "text-small", className: "tracking-wide text-text-tertiary dark:text-text-tertiary-dark", children: directionLabel }),
2241
+ /* @__PURE__ */ jsxs(
2242
+ "button",
2243
+ {
2244
+ "data-testid": testId,
2245
+ type: "button",
2246
+ onClick,
2247
+ className: "ml-6 bg-bg-muted dark:bg-bg-muted-dark border border-border-subtle dark:border-border-subtle-dark rounded-lg flex items-center gap-xs px-sm py-xs hover:border-border-default dark:hover:border-border-default-dark transition-colors text-text-sm text-text-secondary dark:text-text-secondary-dark cursor-pointer",
2248
+ "aria-label": `${directionLabel} ${chainLabel}`,
2249
+ children: [
2250
+ chainImage ? /* @__PURE__ */ jsx("img", { src: chainImage, alt: chainLabel, className: "w-3 h-3 rounded-full" }) : null,
2251
+ /* @__PURE__ */ jsx("span", { children: chainLabel }),
2252
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-[18px] h-[18px]", children: /* @__PURE__ */ jsx(HiChevronDown, { className: "w-3 h-3 text-text-tertiary dark:text-text-tertiary-dark" }) })
2253
+ ]
2254
+ }
2255
+ )
2256
+ ] });
2257
+ };
2258
+ var SwapQuoteHeaderView = ({
2259
+ label,
2260
+ timerElement,
2261
+ className
2262
+ }) => {
2263
+ const baseClasses = "border-b border-border-default dark:border-border-default-dark pb-sm";
2264
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "swap-quote-header", className: twMerge(baseClasses, className), children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
2265
+ /* @__PURE__ */ jsx(TextBody_default, { as: "span", variant: "text-small", className: "font-semibold text-text-secondary dark:text-text-secondary-dark inline-flex items-center", children: label }),
2266
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-md", children: timerElement })
2267
+ ] }) });
2268
+ };
2269
+ var SwapAmountInputView = ({
2270
+ value,
2271
+ hasError,
2272
+ onChange,
2273
+ maxFractionDigits = 6,
2274
+ field,
2275
+ ariaLabel = "Amount to swap",
2276
+ className
2277
+ }) => {
2278
+ const normalizeAmountInput = (raw) => {
2279
+ let val = raw.replace(/[^\d.,]/g, "");
2280
+ const endsWithSeparator = /[.,]$/.test(val);
2281
+ val = val.replace(/,/g, ".");
2282
+ const firstDot = val.indexOf(".");
2283
+ if (firstDot !== -1) {
2284
+ const intPart = val.slice(0, firstDot);
2285
+ const fractional = val.slice(firstDot + 1).replace(/\./g, "").slice(0, maxFractionDigits);
2286
+ if (fractional.length > 0) {
2287
+ val = `${intPart}.${fractional}`;
2288
+ } else {
2289
+ val = endsWithSeparator ? `${intPart}.` : intPart;
2290
+ }
2291
+ }
2292
+ if (val.startsWith(".")) {
2293
+ val = `0${val}`;
2294
+ }
2295
+ return val;
2296
+ };
2297
+ const baseClasses = "text-h2-mobile font-extrabold bg-transparent outline-none text-right w-full min-w-[120px] placeholder:text-text-disabled dark:placeholder:text-text-disabled-dark";
2298
+ const colorClasses = hasError ? "text-state-error dark:text-state-error" : "text-text-primary dark:text-text-primary-dark";
2299
+ return /* @__PURE__ */ jsx(
2300
+ "input",
2301
+ __spreadProps(__spreadValues({
2302
+ "data-test-id": "swap-flow-amount-input",
2303
+ placeholder: "0.00",
2304
+ type: "text",
2305
+ inputMode: "decimal",
2306
+ autoComplete: "off",
2307
+ "aria-label": ariaLabel,
2308
+ min: "0",
2309
+ step: "any",
2310
+ value,
2311
+ className: twMerge(baseClasses, colorClasses, className)
2312
+ }, field), {
2313
+ onChange: (event) => {
2314
+ let normalized = normalizeAmountInput(event.target.value);
2315
+ if (normalized && parseFloat(normalized) < 0) {
2316
+ normalized = "0";
2317
+ }
2318
+ onChange(normalized);
2319
+ },
2320
+ onWheel: (event) => {
2321
+ event.currentTarget.blur();
2322
+ }
2323
+ })
2324
+ );
2325
+ };
2326
+ var SwapOutputAmountView = ({
2327
+ displayOutput,
2328
+ isLoading,
2329
+ loadingElement,
2330
+ searchingQuoteLabel = "Searching quote...",
2331
+ className
2332
+ }) => {
2333
+ const baseClasses = "text-h2-mobile font-extrabold text-right w-full min-w-[120px] text-text-primary dark:text-text-primary-dark";
2334
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "swap-flow-output-amount", className: twMerge(baseClasses, className), children: isLoading ? /* @__PURE__ */ jsx(TextBody_default, { as: "span", variant: "text-small", className: "text-text-disabled dark:text-text-disabled-dark inline-flex items-center", children: loadingElement != null ? loadingElement : searchingQuoteLabel }) : displayOutput });
2335
+ };
2336
+ var SwapQuoteErrorsView = ({
2337
+ hasQuoteError,
2338
+ hasBytecodeError,
2339
+ quoteErrorMessage = "Unable to get quote for this transaction",
2340
+ bytecodeErrorMessage = "Error building transaction"
2341
+ }) => {
2342
+ return /* @__PURE__ */ jsxs("div", { "data-test-id": "swap-quote-errors", children: [
2343
+ hasQuoteError && /* @__PURE__ */ jsx("div", { className: "mt-sm", children: /* @__PURE__ */ jsx(
2344
+ BannerNotification,
2345
+ {
2346
+ type: "inline",
2347
+ variant: "error",
2348
+ message: quoteErrorMessage
2349
+ }
2350
+ ) }),
2351
+ hasBytecodeError && /* @__PURE__ */ jsx("div", { className: "mt-sm", children: /* @__PURE__ */ jsx(
2352
+ BannerNotification,
2353
+ {
2354
+ type: "inline",
2355
+ variant: "error",
2356
+ message: bytecodeErrorMessage
2357
+ }
2358
+ ) })
2359
+ ] });
2360
+ };
2361
+ var SLIPPAGE_OPTIONS = [10, 50, 100];
2362
+ var SwapSlippageToleranceButtonsView = ({
2363
+ slippageBps,
2364
+ onSelect,
2365
+ formatPercentage,
2366
+ className
2367
+ }) => {
2368
+ const baseClasses = "flex gap-xs";
2369
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "swap-slippage-tolerance-buttons", className: twMerge(baseClasses, className), children: SLIPPAGE_OPTIONS.map((option) => {
2370
+ const isActive = slippageBps === option;
2371
+ const activeClasses = "border-brand-primary text-brand-primary bg-brand-tint dark:bg-brand-tint-dark";
2372
+ const inactiveClasses = "border-border-subtle dark:border-border-subtle-dark text-text-secondary dark:text-text-secondary-dark bg-bg-default dark:bg-bg-default-dark";
2373
+ const buttonBase = "px-sm py-xs rounded border text-text-sm cursor-pointer";
2374
+ return /* @__PURE__ */ jsxs(
2375
+ "button",
2376
+ {
2377
+ "data-test-id": `slippage-option-${option}`,
2378
+ type: "button",
2379
+ onClick: () => onSelect(option),
2380
+ className: twMerge(buttonBase, isActive ? activeClasses : inactiveClasses),
2381
+ "aria-label": `${formatPercentage(option)}% slippage`,
2382
+ "aria-pressed": isActive,
2383
+ children: [
2384
+ formatPercentage(option),
2385
+ "%"
2386
+ ]
2387
+ },
2388
+ option
2389
+ );
2390
+ }) });
2391
+ };
2392
+ var SwapTokenSelectorView = ({
2393
+ token,
2394
+ onClick,
2395
+ testId = "swap-token-selector",
2396
+ selectTokenLabel = "Select token",
2397
+ className
2398
+ }) => {
2399
+ const baseClasses = "h-[56px] border border-border-default dark:border-border-default-dark rounded overflow-hidden hover:border-border-strong dark:hover:border-border-strong-dark transition-colors flex items-center px-sm py-[6px] w-full cursor-pointer";
2400
+ return /* @__PURE__ */ jsxs(
2401
+ "button",
2402
+ {
2403
+ "data-test-id": testId,
2404
+ type: "button",
2405
+ onClick,
2406
+ className: twMerge(baseClasses, className),
2407
+ "aria-label": token ? token.symbol : selectTokenLabel,
2408
+ children: [
2409
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-sm flex-1", children: token ? /* @__PURE__ */ jsxs(Fragment, { children: [
2410
+ token.logoURI ? /* @__PURE__ */ jsx("img", { src: token.logoURI, alt: token.symbol, className: "w-6 h-6 rounded-full" }) : /* @__PURE__ */ jsx("div", { className: "w-6 h-6 rounded-full bg-bg-raised dark:bg-bg-raised-dark text-text-secondary dark:text-text-secondary-dark flex items-center justify-center text-[10px] font-semibold", children: (token.symbol || "").slice(0, 3).toUpperCase() }),
2411
+ /* @__PURE__ */ jsx(TextBody_default, { as: "span", className: "text-text-primary dark:text-text-primary-dark", children: token.symbol })
2412
+ ] }) : /* @__PURE__ */ jsx(TextBody_default, { as: "span", className: "text-text-secondary dark:text-text-secondary-dark", children: selectTokenLabel }) }),
2413
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-[18px] h-[18px]", children: /* @__PURE__ */ jsx(HiChevronDown, { className: "w-3 h-3 text-text-tertiary dark:text-text-tertiary-dark" }) })
2414
+ ]
2415
+ }
2416
+ );
2417
+ };
2418
+ var SwapQuoteBlockchainCostsView = ({
2419
+ totalCostFormatted,
2420
+ feePercentage,
2421
+ gasCostFormatted,
2422
+ protocolFee,
2423
+ blockchainCostsLabel = "Blockchain Costs",
2424
+ networkGasLabel = "Network Gas",
2425
+ protocolFeeLabel = "Protocol Fee",
2426
+ collapseLabel = "Collapse",
2427
+ expandLabel = "Expand"
2428
+ }) => {
2429
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "swap-quote-blockchain-costs", children: /* @__PURE__ */ jsx(
2430
+ CollapsibleInfoRow,
2431
+ {
2432
+ label: blockchainCostsLabel,
2433
+ value: `${totalCostFormatted} ~ ${feePercentage}%`,
2434
+ defaultOpen: true,
2435
+ collapseLabel,
2436
+ expandLabel,
2437
+ children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-sm", children: [
2438
+ /* @__PURE__ */ jsxs(InfoRowWithIcon, { children: [
2439
+ /* @__PURE__ */ jsx(InfoRowIconLabel, { children: networkGasLabel }),
2440
+ /* @__PURE__ */ jsx(InfoRowIconValue, { children: gasCostFormatted })
2441
+ ] }),
2442
+ /* @__PURE__ */ jsxs(InfoRowWithIcon, { borderBottom: true, children: [
2443
+ /* @__PURE__ */ jsx(InfoRowIconLabel, { children: protocolFeeLabel }),
2444
+ /* @__PURE__ */ jsx(InfoRowIconValue, { children: protocolFee })
2445
+ ] })
2446
+ ] })
2447
+ }
2448
+ ) });
2449
+ };
2450
+ var ChooseAStrategyActionsheetView = ({
2451
+ isOpen,
2452
+ currentActionSheetId,
2453
+ assetName,
2454
+ apy,
2455
+ logoUrl,
2456
+ riskLevel,
2457
+ onStrategyClick,
2458
+ onClose,
2459
+ yieldLabel,
2460
+ apyLabel = "APY",
2461
+ riskBadgeLabels,
2462
+ closeAriaLabel = "Close"
2463
+ }) => {
2464
+ const resolvedYieldLabel = yieldLabel != null ? yieldLabel : `Yield ${assetName}`;
2465
+ const badges = {
2466
+ low: /* @__PURE__ */ jsx(LowRiskBadge, { label: riskBadgeLabels.low }),
2467
+ medium: /* @__PURE__ */ jsx(MediumRiskBadge, { label: riskBadgeLabels.medium }),
2468
+ high: /* @__PURE__ */ jsx(HighRiskBadge, { label: riskBadgeLabels.high })
2469
+ };
2470
+ const Badge = badges[riskLevel];
2471
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "choose-strategy-actionsheet", className: "flex justify-center", children: /* @__PURE__ */ jsx(
2472
+ ActionSheet,
2473
+ {
2474
+ id: "choose-strategy",
2475
+ currentActionSheetId,
2476
+ isOpen,
2477
+ onClose,
2478
+ position: "bottom",
2479
+ height: "full",
2480
+ contentClassName: "w-full max-w-[620px] mx-auto",
2481
+ children: /* @__PURE__ */ jsxs(BackgroundContainer, { className: "flex flex-col h-full", children: [
2482
+ /* @__PURE__ */ jsx(Navbar, { children: /* @__PURE__ */ jsx(CloseButton, { onClick: onClose, ariaLabel: closeAriaLabel }) }),
2483
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 w-full p-6 overflow-hidden", children: [
2484
+ /* @__PURE__ */ jsxs("div", { className: "flex-shrink-0", children: [
2485
+ /* @__PURE__ */ jsx(TextHeading_default, { children: resolvedYieldLabel }),
2486
+ /* @__PURE__ */ jsx("br", {})
2487
+ ] }),
2488
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2 w-full mt-4 overflow-y-auto flex-1 min-h-0", children: /* @__PURE__ */ jsxs(ListItem, { className: "flex-shrink-0", onClick: onStrategyClick, children: [
2489
+ /* @__PURE__ */ jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsx("img", { src: logoUrl, alt: assetName, className: "w-10 h-10 rounded-full" }) }),
2490
+ /* @__PURE__ */ jsxs(ListItemContent, { className: "gap-1", children: [
2491
+ /* @__PURE__ */ jsx(TextBody_default, { children: resolvedYieldLabel }),
2492
+ /* @__PURE__ */ jsx(TextBody_default, { variant: "text-small", children: Badge })
2493
+ ] }),
2494
+ /* @__PURE__ */ jsx(ListItemRightSide, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-center items-center gap-1", children: [
2495
+ /* @__PURE__ */ jsxs("span", { className: "text-state-success", children: [
2496
+ apy,
2497
+ "% ",
2498
+ apyLabel
2499
+ ] }),
2500
+ /* @__PURE__ */ jsx(HiArrowRight, { className: "w-4 h-4" })
2501
+ ] }) })
2502
+ ] }) })
2503
+ ] })
2504
+ ] })
2505
+ }
2506
+ ) });
2507
+ };
2508
+ var StrategyDetailsView = ({
2509
+ logoUrl,
2510
+ title,
2511
+ description,
2512
+ strategyInfo,
2513
+ onBack,
2514
+ onDeposit,
2515
+ headerTitle = "Details",
2516
+ strategyInfoTitle = "Strategy Info",
2517
+ depositButtonLabel = "Deposit",
2518
+ backAriaLabel = "Back"
2519
+ }) => {
2520
+ return /* @__PURE__ */ jsxs(BackgroundContainer, { children: [
2521
+ /* @__PURE__ */ jsx(DetailsHeader, { title: headerTitle, onBack, backAriaLabel }),
2522
+ /* @__PURE__ */ jsx("div", { "data-test-id": "strategy-details-content", className: "flex-1 min-h-0 overflow-y-auto p-md py-lg pb-24", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-lg min-h-full", children: [
2523
+ /* @__PURE__ */ jsxs("div", { className: "inline-flex flex-col items-start gap-sm", children: [
2524
+ /* @__PURE__ */ jsx("img", { "data-test-id": "strategy-logo", src: logoUrl, alt: title, className: "w-20 h-20 rounded-full" }),
2525
+ /* @__PURE__ */ jsx(TextHeading_default, { variant: "h5", children: title })
2526
+ ] }),
2527
+ /* @__PURE__ */ jsx(TextBody_default, { variant: "text-small", children: description }),
2528
+ /* @__PURE__ */ jsx(
2529
+ SummaryDetails,
2530
+ {
2531
+ title: strategyInfoTitle,
2532
+ items: strategyInfo,
2533
+ defaultOpen: true,
2534
+ className: "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised"
2535
+ }
2536
+ )
2537
+ ] }) }),
2538
+ /* @__PURE__ */ 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__ */ jsx(PrimaryButton, { onClick: onDeposit, className: "w-full", children: depositButtonLabel }) })
2539
+ ] });
2540
+ };
2541
+ var ProgressIndicator = ({
2542
+ progress,
2543
+ className = ""
2544
+ }) => {
2545
+ const clampedProgress = Math.min(100, Math.max(0, progress));
2546
+ return /* @__PURE__ */ jsx("div", { className: `relative h-[12px] w-full ${className}`, children: /* @__PURE__ */ jsxs("div", { className: "absolute left-0 right-0 top-1/2 -translate-y-1/2 flex items-center", children: [
2547
+ /* @__PURE__ */ jsx(
2548
+ "div",
2549
+ {
2550
+ className: "h-[4px] bg-brand-primary rounded-lg transition-all duration-300",
2551
+ style: { width: `${clampedProgress}%` }
2552
+ }
2553
+ ),
2554
+ /* @__PURE__ */ jsx("div", { className: "flex-1 h-[4px] bg-bg-muted dark:bg-bg-muted-dark rounded-lg ml-1" })
2555
+ ] }) });
2556
+ };
2557
+ var LoadingDots = ({ className = "" }) => {
2558
+ return /* @__PURE__ */ jsxs("span", { className: `flex gap-0.5 ${className}`, children: [
2559
+ /* @__PURE__ */ jsx("span", { className: "animate-bounce", style: { animationDelay: "0ms", animationDuration: "1.4s" }, children: "." }),
2560
+ /* @__PURE__ */ jsx("span", { className: "animate-bounce", style: { animationDelay: "200ms", animationDuration: "1.4s" }, children: "." }),
2561
+ /* @__PURE__ */ jsx("span", { className: "animate-bounce", style: { animationDelay: "400ms", animationDuration: "1.4s" }, children: "." })
2562
+ ] });
2563
+ };
2564
+ var SearchInput = ({
2565
+ placeholder = "Search",
2566
+ value: controlledValue,
2567
+ disabled = false,
2568
+ onChange,
2569
+ onSearch,
2570
+ className = "",
2571
+ inputClassName,
2572
+ autoFocus = false,
2573
+ containerTestId,
2574
+ inputTestId
2575
+ }) => {
2576
+ const [internalValue, setInternalValue] = useState(controlledValue || "");
2577
+ useEffect(() => {
2578
+ if (controlledValue !== void 0) {
2579
+ setInternalValue(controlledValue);
2580
+ }
2581
+ }, [controlledValue]);
2582
+ const handleInputChange = (newValue) => {
2583
+ setInternalValue(newValue);
2584
+ onChange == null ? void 0 : onChange(newValue);
2585
+ onSearch == null ? void 0 : onSearch(newValue);
2586
+ };
2587
+ return /* @__PURE__ */ jsxs("div", { className: `flex-1 flex items-center relative ${className}`, "data-testid": containerTestId, children: [
2588
+ /* @__PURE__ */ jsx(
2589
+ "input",
2590
+ {
2591
+ "data-testid": inputTestId,
2592
+ type: "text",
2593
+ value: internalValue,
2594
+ placeholder,
2595
+ disabled,
2596
+ autoFocus,
2597
+ onChange: (e) => handleInputChange(e.target.value),
2598
+ className: [
2599
+ "w-full h-full rounded p-4 pr-12 leading-normal tracking-wide",
2600
+ !inputClassName ? "bg-bg-subtle dark:bg-bg-subtle-dark" : "",
2601
+ "placeholder:text-text-disabled dark:placeholder:text-text-disabled-dark text-text-primary dark:text-text-primary-dark",
2602
+ "focus:outline-none focus:ring-2 focus:ring-brand-primary",
2603
+ disabled ? "cursor-not-allowed opacity-50" : "",
2604
+ inputClassName || ""
2605
+ ].filter(Boolean).join(" ")
2606
+ }
2607
+ ),
2608
+ /* @__PURE__ */ jsx(MdOutlineSearch, { className: "w-4 h-4 text-text-secondary absolute right-4" })
2609
+ ] });
2610
+ };
2611
+ var SearchEmptyState = ({
2612
+ title,
2613
+ description
2614
+ }) => {
2615
+ return /* @__PURE__ */ 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__ */ jsxs("div", { className: "w-full flex flex-col justify-center items-center gap-md py-20", children: [
2616
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col justify-center items-center gap-md text-center", children: [
2617
+ /* @__PURE__ */ jsx("div", { className: "w-20 h-20 bg-bg-muted dark:bg-bg-muted-dark rounded-full flex justify-center items-center", children: /* @__PURE__ */ jsx(MdOutlineSearchOff, { className: "w-10 h-10 text-text-tertiary dark:text-text-tertiary-dark" }) }),
2618
+ /* @__PURE__ */ jsx(TextHeading_default, { variant: "h3", children: title })
2619
+ ] }),
2620
+ /* @__PURE__ */ jsx("div", { className: "self-stretch text-center", children: /* @__PURE__ */ jsx(TextBody_default, { variant: "text-small", children: description }) })
2621
+ ] }) });
2622
+ };
2623
+ var CollapsibleSection = ({
2624
+ title,
2625
+ subtitle,
2626
+ children,
2627
+ defaultOpen = false,
2628
+ open: controlledOpen,
2629
+ onOpenChange,
2630
+ className = "",
2631
+ collapseText,
2632
+ expandText
2633
+ }) => {
2634
+ const [internalOpen, setInternalOpen] = React6__default.useState(defaultOpen);
2635
+ const isOpen = controlledOpen !== void 0 ? controlledOpen : internalOpen;
2636
+ const handleToggle = () => {
2637
+ const newOpenState = !isOpen;
2638
+ if (controlledOpen === void 0) {
2639
+ setInternalOpen(newOpenState);
2640
+ }
2641
+ onOpenChange == null ? void 0 : onOpenChange(newOpenState);
2642
+ };
2643
+ return /* @__PURE__ */ jsxs("div", { className: `flex flex-col gap-sm w-full ${className}`, children: [
2644
+ /* @__PURE__ */ jsxs(
2645
+ "button",
2646
+ {
2647
+ type: "button",
2648
+ onClick: handleToggle,
2649
+ className: "flex items-center justify-between w-full text-left cursor-pointer",
2650
+ "aria-expanded": isOpen,
2651
+ "aria-label": `${isOpen ? collapseText : expandText} ${title}`,
2652
+ children: [
2653
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-xs", children: /* @__PURE__ */ jsx(TextBody_default, { className: "text-white font-medium", children: title }) }),
2654
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-xs", children: [
2655
+ subtitle && /* @__PURE__ */ jsx(TextBody_default, { variant: "text-small", children: subtitle }),
2656
+ /* @__PURE__ */ jsx(
2657
+ motion.svg,
2658
+ {
2659
+ className: "w-5 h-5 text-gray-400",
2660
+ fill: "none",
2661
+ stroke: "currentColor",
2662
+ viewBox: "0 0 24 24",
2663
+ animate: { rotate: isOpen ? 180 : 0 },
2664
+ transition: { duration: 0.2, ease: "easeInOut" },
2665
+ children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 9l7 7 7-7" })
2666
+ }
2667
+ )
2668
+ ] })
2669
+ ]
2670
+ }
2671
+ ),
2672
+ /* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsx(
2673
+ motion.div,
2674
+ {
2675
+ initial: { height: 0, opacity: 0 },
2676
+ animate: { height: "auto", opacity: 1 },
2677
+ exit: { height: 0, opacity: 0 },
2678
+ transition: { duration: 0.2, ease: "easeInOut" },
2679
+ style: { overflow: "hidden" },
2680
+ children
2681
+ }
2682
+ ) })
2683
+ ] });
2684
+ };
2685
+ var TransactionScreenIcon = ({
2686
+ type,
2687
+ gradient = "linear-gradient(135deg, #F6A700 0%, #F59E0B 100%)"
2688
+ }) => {
2689
+ if (type === "success") {
2690
+ return /* @__PURE__ */ jsx("div", { className: "relative w-20 h-20", children: /* @__PURE__ */ jsx("div", { className: "w-full h-full rounded-full bg-brand-primary flex items-center justify-center", children: /* @__PURE__ */ jsx("svg", { className: "w-8 h-8 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 3, children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }) });
2691
+ }
2692
+ if (type === "warning") {
2693
+ return /* @__PURE__ */ jsx("div", { className: "relative w-[83px] h-[83px]", children: /* @__PURE__ */ jsx("div", { className: "w-full h-full rounded-full flex items-center justify-center", style: { background: gradient }, children: /* @__PURE__ */ 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__ */ 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" }) }) }) });
2694
+ }
2695
+ return /* @__PURE__ */ jsx("div", { className: "relative w-[83px] h-[83px]", children: /* @__PURE__ */ jsx("div", { className: "w-full h-full rounded-full flex items-center justify-center", style: { background: gradient }, children: /* @__PURE__ */ 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__ */ 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" }) }) }) });
2696
+ };
2697
+ var TransactionScreen = ({
2698
+ progress,
2699
+ iconType,
2700
+ iconGradient,
2701
+ title,
2702
+ description,
2703
+ onClose,
2704
+ onBack,
2705
+ backTitle = "",
2706
+ actions,
2707
+ children,
2708
+ testId
2709
+ }) => {
2710
+ return /* @__PURE__ */ jsx(BackgroundContainer, { children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col h-full", children: [
2711
+ onBack && /* @__PURE__ */ jsx(DetailsHeader, { title: backTitle, onBack }),
2712
+ onClose && /* @__PURE__ */ jsx("div", { "data-testid": testId, className: "flex justify-start px-md pt-md", children: /* @__PURE__ */ jsx(CloseButton, { onClick: onClose }) }),
2713
+ /* @__PURE__ */ jsx("div", { className: "w-full px-md pt-sm", children: /* @__PURE__ */ jsx(ProgressIndicator, { progress }) }),
2714
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto px-md py-lg flex flex-col gap-lg", children: [
2715
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-md pt-lg", children: [
2716
+ /* @__PURE__ */ jsx(TransactionScreenIcon, { type: iconType, gradient: iconGradient }),
2717
+ /* @__PURE__ */ jsx(TextHeading_default, { variant: "h-large", children: title }),
2718
+ /* @__PURE__ */ jsx("div", { className: "text-text-md-mobile font-poppins text-text-secondary dark:text-text-secondary-dark text-center", style: { maxWidth: "350px" }, children: description })
2719
+ ] }),
2720
+ children,
2721
+ /* @__PURE__ */ jsx("div", { className: "flex-1" })
2722
+ ] }),
2723
+ actions && /* @__PURE__ */ jsx("div", { className: "px-md pb-md", children: actions })
2724
+ ] }) });
2725
+ };
2726
+ var TransactionScreenInvestmentCard = ({
2727
+ strategyName,
2728
+ apyLabel,
2729
+ apyValue,
2730
+ iconSrc,
2731
+ iconAlt,
2732
+ amountUSD,
2733
+ amountToken
2734
+ }) => {
2735
+ const [hasImageError, setHasImageError] = React6__default.useState(false);
2736
+ React6__default.useEffect(() => {
2737
+ setHasImageError(false);
2738
+ }, [iconSrc]);
2739
+ const shouldShowImage = Boolean(iconSrc) && !hasImageError;
2740
+ const fallbackLabel = (iconAlt || "?").slice(0, 1).toUpperCase();
2741
+ return /* @__PURE__ */ jsx(SectionCard, { className: "!p-[22px]", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
2742
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start gap-xs", children: [
2743
+ /* @__PURE__ */ jsx("div", { className: "text-accent-lg-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: strategyName }),
2744
+ /* @__PURE__ */ jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
2745
+ apyLabel,
2746
+ " ",
2747
+ /* @__PURE__ */ jsx(TextBody_default, { as: "span", className: "text-state-success", children: apyValue })
2748
+ ] })
2749
+ ] }),
2750
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-sm", children: [
2751
+ /* @__PURE__ */ 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__ */ jsx("img", { src: iconSrc, alt: iconAlt, className: "w-6 h-6 rounded-full", onError: () => setHasImageError(true) }) : /* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-text-secondary dark:text-text-secondary-dark", children: fallbackLabel }) }),
2752
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-end", children: [
2753
+ /* @__PURE__ */ jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: amountUSD }),
2754
+ /* @__PURE__ */ jsx("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: amountToken })
2755
+ ] })
2756
+ ] })
2757
+ ] }) });
2758
+ };
2759
+ function StepStatusIcon({ status }) {
2760
+ switch (status) {
2761
+ case "completed":
2762
+ return /* @__PURE__ */ 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__ */ jsx(IoCheckmarkOutline, { className: "w-4 h-4", style: { color: "var(--color-state-success, #2BA176)" } }) });
2763
+ case "processing":
2764
+ return /* @__PURE__ */ 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__ */ jsx(IoTimeOutline, { className: "w-4 h-4", style: { color: "var(--color-state-warning, #F6A700)" } }) });
2765
+ case "failed":
2766
+ return /* @__PURE__ */ 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__ */ jsx(IoAlertCircleOutline, { className: "w-4 h-4", style: { color: "var(--color-state-error, #FF4D4F)" } }) });
2767
+ }
2768
+ }
2769
+ function StepStatusText({
2770
+ step,
2771
+ completedText,
2772
+ processingText,
2773
+ failedText,
2774
+ viewOnExplorerText
2775
+ }) {
2776
+ if (step.statusText) {
2777
+ 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";
2778
+ return /* @__PURE__ */ jsx("span", { className: `text-sm ${textColorClass2}`, children: step.statusText });
2779
+ }
2780
+ if (step.status === "completed" && step.explorerUrl) {
2781
+ return /* @__PURE__ */ jsx(
2782
+ "a",
2783
+ {
2784
+ href: step.explorerUrl,
2785
+ target: "_blank",
2786
+ rel: "noopener noreferrer",
2787
+ className: "text-sm text-brand-primary dark:text-brand-primary-dark underline hover:no-underline",
2788
+ children: viewOnExplorerText
2789
+ }
2790
+ );
2791
+ }
2792
+ const defaultText = step.status === "completed" ? completedText : step.status === "processing" ? processingText : failedText;
2793
+ 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";
2794
+ return /* @__PURE__ */ jsx("span", { className: `text-sm ${textColorClass}`, children: defaultText });
2795
+ }
2796
+ function StepDisplay({ step, completedText, processingText, failedText, viewOnExplorerText }) {
2797
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4 w-full", children: [
2798
+ /* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsx("p", { className: "text-sm text-text-primary dark:text-text-primary-dark font-medium", children: step.label }) }),
2799
+ /* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: step.value ? /* @__PURE__ */ jsx("span", { className: "text-sm text-text-secondary dark:text-text-secondary-dark", children: step.value }) : /* @__PURE__ */ jsx(StepStatusText, { step, completedText, processingText, failedText, viewOnExplorerText }) })
2800
+ ] });
2801
+ }
2802
+ function TransactionProcessingDetails({
2803
+ steps,
2804
+ className = "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised",
2805
+ defaultOpen = true,
2806
+ labels
2807
+ }) {
2808
+ if (!steps || steps.length === 0) {
2809
+ return null;
2810
+ }
2811
+ const getProcessingSteps = () => {
2812
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-col w-full", children: steps.map((step, index) => /* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
2813
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
2814
+ step.status && /* @__PURE__ */ jsx(StepStatusIcon, { status: step.status }),
2815
+ index < steps.length - 1 && step.status && /* @__PURE__ */ jsx("div", { className: "w-px flex-1 min-h-[16px] bg-white my-1" })
2816
+ ] }),
2817
+ /* @__PURE__ */ jsx("div", { className: "flex-1 pb-2 min-w-0", children: /* @__PURE__ */ jsx(StepDisplay, { step, completedText: labels.completedText, processingText: labels.processingText, failedText: labels.failedText, viewOnExplorerText: labels.viewOnExplorerText }) })
2818
+ ] }, `step-${index}`)) });
2819
+ };
2820
+ const items = [
2821
+ {
2822
+ label: "",
2823
+ value: getProcessingSteps(),
2824
+ valueClassName: "flex flex-col gap-0 w-full"
2825
+ }
2826
+ ];
2827
+ return /* @__PURE__ */ jsx(
2828
+ SummaryDetails,
2829
+ {
2830
+ title: labels.title,
2831
+ items,
2832
+ defaultOpen,
2833
+ className
2834
+ }
2835
+ );
2836
+ }
2837
+ var TokenWithChainBadge = ({
2838
+ tokenLogoUrl,
2839
+ tokenAlt,
2840
+ chainLogoUrl,
2841
+ chainName
2842
+ }) => {
2843
+ const fallbackText = encodeURIComponent((tokenAlt || "TOK").slice(0, 3).toUpperCase());
2844
+ const fallbackSrc = `https://placehold.co/40x40?text=${fallbackText}`;
2845
+ return /* @__PURE__ */ jsxs("div", { className: "relative w-10 h-10", children: [
2846
+ /* @__PURE__ */ jsx(
2847
+ "img",
2848
+ {
2849
+ src: tokenLogoUrl || fallbackSrc,
2850
+ alt: tokenAlt || "",
2851
+ className: "object-cover w-10 h-10 rounded-full",
2852
+ onError: (e) => {
2853
+ e.target.src = fallbackSrc;
2854
+ }
2855
+ }
2856
+ ),
2857
+ chainLogoUrl && /* @__PURE__ */ jsx(
2858
+ "img",
2859
+ {
2860
+ src: chainLogoUrl,
2861
+ alt: chainName,
2862
+ className: "absolute object-cover w-6 h-6 p-px bg-white border rounded-full -bottom-1 -right-1 border-bg-default",
2863
+ onError: (e) => {
2864
+ e.target.style.display = "none";
2865
+ }
2866
+ }
2867
+ )
2868
+ ] });
2869
+ };
2870
+ var SwapProcessingView = ({
2871
+ fromTokenSymbol,
2872
+ fromTokenIcon,
2873
+ toTokenSymbol,
2874
+ toTokenIcon,
2875
+ formattedInputAmount,
2876
+ formattedOutputAmount,
2877
+ formattedInputAmountUSD,
2878
+ formattedOutputAmountUSD,
2879
+ progress,
2880
+ transactionSteps,
2881
+ onClose,
2882
+ onGoToHistory,
2883
+ titleText,
2884
+ descriptionPrefix,
2885
+ activityHistoryText,
2886
+ processingDetailsLabels
2887
+ }) => {
2888
+ return /* @__PURE__ */ jsxs(
2889
+ TransactionScreen,
2890
+ {
2891
+ testId: "swap-processing-screen",
2892
+ onClose,
2893
+ progress,
2894
+ iconType: "processing",
2895
+ title: /* @__PURE__ */ jsx("span", { "data-testid": "swap-processing-title", children: titleText }),
2896
+ description: /* @__PURE__ */ jsxs(Fragment, { children: [
2897
+ descriptionPrefix,
2898
+ " ",
2899
+ /* @__PURE__ */ jsxs(
2900
+ "span",
2901
+ {
2902
+ className: "font-semibold underline underline-offset-2 cursor-pointer text-brand-primary",
2903
+ onClick: onGoToHistory,
2904
+ children: [
2905
+ activityHistoryText,
2906
+ "."
2907
+ ]
2908
+ }
2909
+ )
2910
+ ] }),
2911
+ children: [
2912
+ /* @__PURE__ */ jsx(SectionCard, { className: "!p-[22px]", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full relative px-md", children: [
2913
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
2914
+ /* @__PURE__ */ jsx("img", { src: fromTokenIcon, alt: fromTokenSymbol, className: "w-8 h-8 rounded-full" }),
2915
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
2916
+ /* @__PURE__ */ jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
2917
+ formattedInputAmount,
2918
+ " ",
2919
+ fromTokenSymbol
2920
+ ] }),
2921
+ /* @__PURE__ */ jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedInputAmountUSD })
2922
+ ] })
2923
+ ] }),
2924
+ /* @__PURE__ */ 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__ */ jsx(MdOutlineSwapHoriz, { className: "w-5 h-5" }) }),
2925
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
2926
+ /* @__PURE__ */ jsx("img", { src: toTokenIcon, alt: toTokenSymbol, className: "w-8 h-8 rounded-full" }),
2927
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
2928
+ /* @__PURE__ */ jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
2929
+ "~",
2930
+ formattedOutputAmount,
2931
+ " ",
2932
+ toTokenSymbol
2933
+ ] }),
2934
+ /* @__PURE__ */ jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedOutputAmountUSD })
2935
+ ] })
2936
+ ] })
2937
+ ] }) }),
2938
+ /* @__PURE__ */ jsx(
2939
+ TransactionProcessingDetails,
2940
+ {
2941
+ steps: transactionSteps,
2942
+ className: "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised dark:lg:!bg-bg-raised-dark",
2943
+ labels: processingDetailsLabels
2944
+ }
2945
+ )
2946
+ ]
2947
+ }
2948
+ );
2949
+ };
2950
+ var SwapCrossChainProcessingView = ({
2951
+ fromTokenSymbol,
2952
+ fromTokenIcon,
2953
+ toTokenSymbol,
2954
+ toTokenIcon,
2955
+ originChainId,
2956
+ destinationChainId,
2957
+ originChainLogoUrl,
2958
+ originChainName,
2959
+ destinationChainLogoUrl,
2960
+ destinationChainName,
2961
+ formattedInputAmount,
2962
+ formattedOutputAmount,
2963
+ formattedInputAmountUSD,
2964
+ formattedOutputAmountUSD,
2965
+ progress,
2966
+ title,
2967
+ description,
2968
+ transactionSteps,
2969
+ onClose,
2970
+ onGoToHistory,
2971
+ viewHistoryText,
2972
+ processingDetailsLabels
2973
+ }) => {
2974
+ return /* @__PURE__ */ jsxs(
2975
+ TransactionScreen,
2976
+ {
2977
+ onClose,
2978
+ progress,
2979
+ iconType: "processing",
2980
+ title,
2981
+ description: /* @__PURE__ */ jsxs(Fragment, { children: [
2982
+ description,
2983
+ " ",
2984
+ /* @__PURE__ */ jsx(
2985
+ "span",
2986
+ {
2987
+ className: "font-semibold underline cursor-pointer underline-offset-2 text-brand-primary",
2988
+ onClick: onGoToHistory,
2989
+ children: viewHistoryText
2990
+ }
2991
+ ),
2992
+ "."
2993
+ ] }),
2994
+ children: [
2995
+ /* @__PURE__ */ jsx(SectionCard, { className: "!p-[22px]", children: /* @__PURE__ */ jsxs("div", { className: "relative flex items-center justify-between w-full px-md", children: [
2996
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
2997
+ /* @__PURE__ */ jsx(
2998
+ TokenWithChainBadge,
2999
+ {
3000
+ tokenLogoUrl: fromTokenIcon,
3001
+ tokenAlt: fromTokenSymbol,
3002
+ chainId: originChainId,
3003
+ chainLogoUrl: originChainLogoUrl,
3004
+ chainName: originChainName
3005
+ }
3006
+ ),
3007
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
3008
+ /* @__PURE__ */ jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
3009
+ formattedInputAmount,
3010
+ " ",
3011
+ fromTokenSymbol
3012
+ ] }),
3013
+ /* @__PURE__ */ jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedInputAmountUSD })
3014
+ ] })
3015
+ ] }),
3016
+ /* @__PURE__ */ 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__ */ jsx(MdOutlineSwapHoriz, { className: "w-5 h-5" }) }),
3017
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
3018
+ /* @__PURE__ */ jsx(
3019
+ TokenWithChainBadge,
3020
+ {
3021
+ tokenLogoUrl: toTokenIcon,
3022
+ tokenAlt: toTokenSymbol,
3023
+ chainId: destinationChainId,
3024
+ chainLogoUrl: destinationChainLogoUrl,
3025
+ chainName: destinationChainName
3026
+ }
3027
+ ),
3028
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
3029
+ /* @__PURE__ */ jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
3030
+ "~",
3031
+ formattedOutputAmount,
3032
+ " ",
3033
+ toTokenSymbol
3034
+ ] }),
3035
+ /* @__PURE__ */ jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedOutputAmountUSD })
3036
+ ] })
3037
+ ] })
3038
+ ] }) }),
3039
+ /* @__PURE__ */ jsx(
3040
+ TransactionProcessingDetails,
3041
+ {
3042
+ steps: transactionSteps,
3043
+ className: "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised dark:lg:!bg-bg-raised-dark",
3044
+ labels: processingDetailsLabels
3045
+ }
3046
+ )
3047
+ ]
3048
+ }
3049
+ );
3050
+ };
3051
+ var SwapSignatureWarningView = ({
3052
+ fromTokenSymbol,
3053
+ fromTokenIcon,
3054
+ toTokenSymbol,
3055
+ toTokenIcon,
3056
+ formattedInputAmount,
3057
+ formattedOutputAmount,
3058
+ formattedInputAmountUSD,
3059
+ formattedOutputAmountUSD,
3060
+ progress,
3061
+ errorTitle,
3062
+ errorDescription,
3063
+ transactionSteps,
3064
+ onCancel,
3065
+ onTryAgain,
3066
+ cancelButtonText,
3067
+ retryButtonText,
3068
+ processingDetailsLabels
3069
+ }) => {
3070
+ return /* @__PURE__ */ jsxs(
3071
+ TransactionScreen,
3072
+ {
3073
+ testId: "swap-signature-warning-screen",
3074
+ onClose: onCancel,
3075
+ progress,
3076
+ iconType: "warning",
3077
+ title: /* @__PURE__ */ jsx("span", { "data-testid": "swap-signature-warning-title", children: errorTitle }),
3078
+ description: errorDescription,
3079
+ actions: /* @__PURE__ */ jsxs("div", { "data-testid": "swap-signature-warning-actions", className: "flex gap-sm w-full", children: [
3080
+ /* @__PURE__ */ jsx(SecondaryButton, { "data-testid": "swap-signature-warning-cancel", className: "flex-1", onClick: onCancel, children: cancelButtonText }),
3081
+ /* @__PURE__ */ jsx(PrimaryButton, { "data-testid": "swap-signature-warning-retry", className: "flex-1", onClick: onTryAgain, children: retryButtonText })
3082
+ ] }),
3083
+ children: [
3084
+ /* @__PURE__ */ jsx(SectionCard, { className: "!p-[22px]", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full relative px-md", children: [
3085
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
3086
+ /* @__PURE__ */ jsx("img", { src: fromTokenIcon, alt: fromTokenSymbol, className: "w-8 h-8 rounded-full" }),
3087
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
3088
+ /* @__PURE__ */ jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
3089
+ formattedInputAmount,
3090
+ " ",
3091
+ fromTokenSymbol
3092
+ ] }),
3093
+ /* @__PURE__ */ jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedInputAmountUSD })
3094
+ ] })
3095
+ ] }),
3096
+ /* @__PURE__ */ 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__ */ jsx(MdOutlineSwapHoriz, { className: "w-5 h-5" }) }),
3097
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
3098
+ /* @__PURE__ */ jsx("img", { src: toTokenIcon, alt: toTokenSymbol, className: "w-8 h-8 rounded-full" }),
3099
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
3100
+ /* @__PURE__ */ jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
3101
+ "~",
3102
+ formattedOutputAmount,
3103
+ " ",
3104
+ toTokenSymbol
3105
+ ] }),
3106
+ /* @__PURE__ */ jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedOutputAmountUSD })
3107
+ ] })
3108
+ ] })
3109
+ ] }) }),
3110
+ /* @__PURE__ */ jsx(
3111
+ TransactionProcessingDetails,
3112
+ {
3113
+ steps: transactionSteps,
3114
+ defaultOpen: true,
3115
+ className: "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised dark:lg:!bg-bg-raised-dark",
3116
+ labels: processingDetailsLabels
3117
+ }
3118
+ )
3119
+ ]
3120
+ }
3121
+ );
3122
+ };
3123
+ var SwapSuccessView = ({
3124
+ fromTokenSymbol,
3125
+ fromTokenIcon,
3126
+ toTokenSymbol,
3127
+ toTokenIcon,
3128
+ formattedInputAmount,
3129
+ formattedOutputAmount,
3130
+ formattedInputAmountUSD,
3131
+ formattedOutputAmountUSD,
3132
+ transactionSteps,
3133
+ onClose,
3134
+ onStartNewSwap,
3135
+ onGoToWallet,
3136
+ labels,
3137
+ processingDetailsLabels
3138
+ }) => {
3139
+ return /* @__PURE__ */ jsxs(
3140
+ TransactionScreen,
3141
+ {
3142
+ testId: "swap-success-screen",
3143
+ onClose,
3144
+ progress: 100,
3145
+ iconType: "success",
3146
+ title: /* @__PURE__ */ jsx("span", { "data-testid": "swap-success-title", children: labels.title }),
3147
+ description: /* @__PURE__ */ jsxs(Fragment, { children: [
3148
+ labels.descriptionPrefix,
3149
+ " ",
3150
+ /* @__PURE__ */ jsxs("strong", { className: "font-semibold", children: [
3151
+ formattedInputAmount,
3152
+ " ",
3153
+ fromTokenSymbol
3154
+ ] }),
3155
+ " ",
3156
+ labels.descriptionMiddle,
3157
+ " ",
3158
+ /* @__PURE__ */ jsxs("strong", { className: "font-semibold", children: [
3159
+ formattedOutputAmount,
3160
+ " ",
3161
+ toTokenSymbol
3162
+ ] }),
3163
+ /* @__PURE__ */ jsx("br", {}),
3164
+ labels.descriptionSuffix,
3165
+ " ",
3166
+ /* @__PURE__ */ jsx("strong", { className: "font-semibold text-brand-primary cursor-pointer", onClick: onGoToWallet, children: labels.walletLinkText })
3167
+ ] }),
3168
+ actions: /* @__PURE__ */ jsx("div", { "data-testid": "swap-start-new-wrapper", className: "w-full", children: /* @__PURE__ */ jsx(PrimaryButton, { "data-testid": "swap-start-new-button", className: "w-full", onClick: onStartNewSwap, children: labels.startNewSwapButton }) }),
3169
+ children: [
3170
+ /* @__PURE__ */ jsx(SectionCard, { className: "!p-[22px]", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full relative px-md", children: [
3171
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
3172
+ /* @__PURE__ */ jsx("img", { src: fromTokenIcon, alt: fromTokenSymbol, className: "w-8 h-8 rounded-full" }),
3173
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
3174
+ /* @__PURE__ */ jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
3175
+ formattedInputAmount,
3176
+ " ",
3177
+ fromTokenSymbol
3178
+ ] }),
3179
+ /* @__PURE__ */ jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedInputAmountUSD })
3180
+ ] })
3181
+ ] }),
3182
+ /* @__PURE__ */ 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__ */ jsx(MdOutlineSwapHoriz, { className: "w-5 h-5" }) }),
3183
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
3184
+ /* @__PURE__ */ jsx("img", { src: toTokenIcon, alt: toTokenSymbol, className: "w-8 h-8 rounded-full" }),
3185
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
3186
+ /* @__PURE__ */ jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
3187
+ "~",
3188
+ formattedOutputAmount,
3189
+ " ",
3190
+ toTokenSymbol
3191
+ ] }),
3192
+ /* @__PURE__ */ jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedOutputAmountUSD })
3193
+ ] })
3194
+ ] })
3195
+ ] }) }),
3196
+ /* @__PURE__ */ jsx(
3197
+ TransactionProcessingDetails,
3198
+ {
3199
+ steps: transactionSteps,
3200
+ defaultOpen: true,
3201
+ className: "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised dark:lg:!bg-bg-raised-dark",
3202
+ labels: processingDetailsLabels
3203
+ }
3204
+ )
3205
+ ]
3206
+ }
3207
+ );
3208
+ };
3209
+ var SwapTransactionFailedView = ({
3210
+ fromTokenSymbol,
3211
+ fromTokenIcon,
3212
+ toTokenSymbol,
3213
+ toTokenIcon,
3214
+ formattedInputAmount,
3215
+ formattedOutputAmount,
3216
+ formattedInputAmountUSD,
3217
+ formattedOutputAmountUSD,
3218
+ progress,
3219
+ errorTitle,
3220
+ errorDescription,
3221
+ transactionSteps,
3222
+ hasExplorerLink,
3223
+ onBack,
3224
+ onViewExplorer,
3225
+ onTryAgain,
3226
+ viewOnExplorerText,
3227
+ retryButtonText,
3228
+ processingDetailsLabels
3229
+ }) => {
3230
+ return /* @__PURE__ */ jsxs(
3231
+ TransactionScreen,
3232
+ {
3233
+ testId: "swap-failed-screen",
3234
+ onClose: onBack,
3235
+ progress,
3236
+ iconType: "warning",
3237
+ iconGradient: "linear-gradient(135deg, #EF4444 0%, #DC2626 100%)",
3238
+ title: /* @__PURE__ */ jsx("span", { "data-testid": "swap-failed-title", children: errorTitle }),
3239
+ description: errorDescription,
3240
+ actions: /* @__PURE__ */ jsxs("div", { "data-testid": "swap-failed-actions", className: "flex gap-sm w-full", children: [
3241
+ /* @__PURE__ */ jsx(SecondaryButton, { "data-testid": "swap-failed-view-explorer", className: "flex-1", onClick: onViewExplorer, disabled: !hasExplorerLink, children: viewOnExplorerText }),
3242
+ /* @__PURE__ */ jsx(PrimaryButton, { "data-testid": "swap-failed-retry", className: "flex-1", onClick: onTryAgain, children: retryButtonText })
3243
+ ] }),
3244
+ children: [
3245
+ /* @__PURE__ */ jsx(SectionCard, { className: "!p-[22px]", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full relative px-md", children: [
3246
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
3247
+ /* @__PURE__ */ jsx("img", { src: fromTokenIcon, alt: fromTokenSymbol, className: "w-8 h-8 rounded-full" }),
3248
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
3249
+ /* @__PURE__ */ jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
3250
+ "~",
3251
+ formattedInputAmount,
3252
+ " ",
3253
+ fromTokenSymbol
3254
+ ] }),
3255
+ /* @__PURE__ */ jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedInputAmountUSD })
3256
+ ] })
3257
+ ] }),
3258
+ /* @__PURE__ */ 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__ */ jsx(MdOutlineSwapHoriz, { className: "w-5 h-5" }) }),
3259
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-sm", children: [
3260
+ /* @__PURE__ */ jsx("img", { src: toTokenIcon, alt: toTokenSymbol, className: "w-8 h-8 rounded-full" }),
3261
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-xs", children: [
3262
+ /* @__PURE__ */ jsxs("div", { className: "text-text-sm-mobile font-poppins text-text-secondary dark:text-text-secondary-dark", children: [
3263
+ "~",
3264
+ formattedOutputAmount,
3265
+ " ",
3266
+ toTokenSymbol
3267
+ ] }),
3268
+ /* @__PURE__ */ jsx("div", { className: "text-h2-mobile font-extrabold font-poppins text-text-primary dark:text-text-primary-dark", children: formattedOutputAmountUSD })
3269
+ ] })
3270
+ ] })
3271
+ ] }) }),
3272
+ /* @__PURE__ */ jsx(
3273
+ TransactionProcessingDetails,
3274
+ {
3275
+ steps: transactionSteps,
3276
+ defaultOpen: true,
3277
+ className: "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised dark:lg:!bg-bg-raised-dark",
3278
+ labels: processingDetailsLabels
3279
+ }
3280
+ )
3281
+ ]
3282
+ }
3283
+ );
3284
+ };
3285
+ var ChooseAnAssetSwapView = ({
3286
+ actionSheetId,
3287
+ isOpen,
3288
+ currentActionSheetId,
3289
+ onClose,
3290
+ onSearch,
3291
+ autoFocus,
3292
+ displayedTokens,
3293
+ hasMore,
3294
+ onLoadMore,
3295
+ findBalance,
3296
+ isFetching,
3297
+ onAssetClick,
3298
+ labels,
3299
+ formatTokenAmount,
3300
+ formatCurrencyValue
3301
+ }) => {
3302
+ const [searchValue, setSearchValue] = React6__default.useState("");
3303
+ const handleSearch = (value) => {
3304
+ setSearchValue(value);
3305
+ onSearch(value);
3306
+ };
3307
+ return /* @__PURE__ */ jsx("div", { className: "flex justify-center", "data-testid": `swap-token-actionsheet-wrapper-${actionSheetId}`, children: /* @__PURE__ */ jsx(
3308
+ ActionSheet,
3309
+ {
3310
+ id: actionSheetId,
3311
+ currentActionSheetId,
3312
+ isOpen,
3313
+ onClose,
3314
+ position: "bottom",
3315
+ height: "full",
3316
+ contentClassName: "w-full max-w-[620px] mx-auto",
3317
+ children: /* @__PURE__ */ jsxs(BackgroundContainer, { className: "flex flex-col h-full", children: [
3318
+ /* @__PURE__ */ jsx(Navbar, { children: /* @__PURE__ */ jsx(CloseButton, { testId: `swap-token-actionsheet-close-${actionSheetId}`, onClick: onClose }) }),
3319
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 w-full p-6 overflow-hidden", children: [
3320
+ /* @__PURE__ */ jsxs("div", { className: "flex-shrink-0", children: [
3321
+ /* @__PURE__ */ jsx(TextHeading_default, { children: labels.title }),
3322
+ /* @__PURE__ */ jsx("br", {}),
3323
+ /* @__PURE__ */ jsx(
3324
+ SearchInput,
3325
+ {
3326
+ onSearch: handleSearch,
3327
+ placeholder: labels.searchPlaceholder,
3328
+ autoFocus,
3329
+ inputClassName: "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised lg:dark:!bg-bg-raised-dark",
3330
+ containerTestId: `swap-token-search-container-${actionSheetId}`,
3331
+ inputTestId: `swap-token-search-input-${actionSheetId}`
3332
+ }
3333
+ )
3334
+ ] }),
3335
+ searchValue && displayedTokens.length === 0 && !isFetching ? /* @__PURE__ */ jsx(SearchEmptyState, { title: labels.searchEmptyTitle, description: labels.searchEmptyDescription }) : /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 w-full mt-4 overflow-y-auto flex-1 min-h-0", children: [
3336
+ isFetching && /* @__PURE__ */ jsx("div", { className: "flex justify-center items-center w-full py-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
3337
+ /* @__PURE__ */ jsx(TextBody_default, { variant: "text-small", className: "text-text-secondary dark:text-text-secondary-dark", children: labels.searchingText }),
3338
+ /* @__PURE__ */ jsx(LoadingDots, {})
3339
+ ] }) }),
3340
+ displayedTokens.map((token, index) => {
3341
+ const balance = findBalance(token);
3342
+ const tokenPriceUSD = Number(balance == null ? void 0 : balance.priceUSD) || 0;
3343
+ const formattedBalance = (balance == null ? void 0 : balance.amountUI) ? formatTokenAmount(balance.amountUI, tokenPriceUSD, 2) : "0";
3344
+ return /* @__PURE__ */ jsxs(
3345
+ ListItem,
3346
+ {
3347
+ className: "w-full flex-shrink-0",
3348
+ onClick: () => onAssetClick(token),
3349
+ "data-testid": `swap-token-item-${token.symbol.toLowerCase()}-${token.chainId}`,
3350
+ "data-address": token.address,
3351
+ "data-chain-id": token.chainId,
3352
+ "data-symbol": token.symbol,
3353
+ children: [
3354
+ /* @__PURE__ */ jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsx("img", { src: token.logoURI || "", alt: token.name, className: "w-10 h-10 rounded-full" }) }),
3355
+ /* @__PURE__ */ jsxs(ListItemContent, { children: [
3356
+ /* @__PURE__ */ jsx(TextBody_default, { children: token.name }),
3357
+ /* @__PURE__ */ jsx(TextBody_default, { variant: "text-small", children: token.symbol })
3358
+ ] }),
3359
+ /* @__PURE__ */ jsxs(ListItemRightSide, { children: [
3360
+ /* @__PURE__ */ jsx(TextBody_default, { children: formattedBalance }),
3361
+ /* @__PURE__ */ jsx(TextBody_default, { variant: "text-small", children: formatCurrencyValue(Number(balance == null ? void 0 : balance.amountInUSD) || 0) })
3362
+ ] })
3363
+ ]
3364
+ },
3365
+ `token-${token.address}-${index}`
3366
+ );
3367
+ }),
3368
+ hasMore && /* @__PURE__ */ jsx("div", { className: "flex justify-center items-center w-full py-4 flex-shrink-0", children: /* @__PURE__ */ jsx(TertiaryButton, { onClick: onLoadMore, children: labels.loadMoreButton }) })
3369
+ ] })
3370
+ ] })
3371
+ ] })
3372
+ }
3373
+ ) });
3374
+ };
1691
3375
 
1692
- export { ActionButton, ActionSheet, AddressDisplay, BannerNotification, ConnectWalletList, Currency, DeframeComponentsProvider, Currency as Fiat, Input, Link, ListItem, ListItemContent, ListItemLeftSide, ListItemRightSide, PercentageButton, PrimaryButton, SecondaryButton, Select, SelectContent, SelectItem, SelectTrigger, Skeleton, SummaryDetails, Tabs, TabsContent, TabsList, TabsTrigger, TertiaryButton, Text_default as Text, TextAccent_default as TextAccent, TextBody_default as TextBody, TextHeading_default as TextHeading, Title, WalletItem, ConnectWalletList as WalletList, WalletListContainer, cryptocontrolThemeColors, darkThemeColors, defaultThemeColors, themeToCSS };
3376
+ export { ActionButton, ActionSheet, AddressDisplay, BackgroundContainer, BannerNotification, ChooseAStrategyActionsheetView, ChooseAnAssetSwapView, CloseButton, CollapsibleInfoRow, CollapsibleSection, ConnectWalletList, Currency, DeframeComponentsProvider, DetailsHeader, Currency as Fiat, FlexCol, FlexRow, HighRiskBadge, HistoryDepositDetailsView, HistoryWithdrawDetailsView, InfoLabel, InfoRow, InfoRowIconLabel, InfoRowIconValue, InfoRowWithIcon, InfoValue, Input, Link, ListItem, ListItemContent, ListItemLeftSide, ListItemRightSide, LoadingDots, LowRiskBadge, MediumRiskBadge, Navbar, PercentageButton, PrimaryButton, ProgressIndicator, ScrollableContent, SearchEmptyState, SearchInput, SecondaryButton, SectionCard, Select, SelectContent, SelectItem, SelectTrigger, Skeleton, StepDisplay, StepStatusIcon, StepStatusText, StrategyDetailsView, SummaryDetails, SummaryDetailsCryptoControlV2, SwapAmountInputView, SwapCrossChainProcessingView, SwapNetworkSelectorView, SwapOutputAmountView, SwapProcessingView, SwapQuoteBlockchainCostsView, SwapQuoteErrorsView, SwapQuoteHeaderView, SwapSignatureWarningView, SwapSlippageToleranceButtonsView, SwapSuccessView, SwapTokenSelectorView, SwapTransactionFailedView, Tabs, TabsContent, TabsList, TabsTrigger, TertiaryButton, Text_default as Text, TextAccent_default as TextAccent, TextBody_default as TextBody, TextHeading_default as TextHeading, Title, TokenWithChainBadge, TransactionProcessingDetails, TransactionScreen, TransactionScreenIcon, TransactionScreenInvestmentCard, WalletItem, ConnectWalletList as WalletList, WalletListContainer, cryptocontrolThemeColors, darkThemeColors, defaultThemeColors, themeToCSS };
1693
3377
  //# sourceMappingURL=index.mjs.map
1694
3378
  //# sourceMappingURL=index.mjs.map