@deframe-sdk/components 0.1.5 → 0.1.6

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,10 @@
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
6
  import { MdCheckCircleOutline, MdErrorOutline, MdWarningAmber, MdInfoOutline, MdClose } from 'react-icons/md';
7
+ import { HiChevronUp, HiChevronDown, HiChevronLeft, HiXMark, HiArrowRight } from 'react-icons/hi2';
7
8
 
8
9
  var __defProp = Object.defineProperty;
9
10
  var __defProps = Object.defineProperties;
@@ -1422,6 +1423,130 @@ var SummaryDetails = ({
1422
1423
  }
1423
1424
  );
1424
1425
  };
1426
+ var SummaryDetailsCryptoControlV2 = ({
1427
+ title,
1428
+ items,
1429
+ defaultOpen = false,
1430
+ className = "",
1431
+ summaryClassName = "",
1432
+ contentClassName = "",
1433
+ showDividers = true
1434
+ }) => {
1435
+ return /* @__PURE__ */ jsxs(
1436
+ "details",
1437
+ {
1438
+ "data-test-id": "summary-details-v2",
1439
+ "data-slot": "summary-details-v2",
1440
+ className: twMerge(
1441
+ "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",
1442
+ className
1443
+ ),
1444
+ open: defaultOpen,
1445
+ children: [
1446
+ /* @__PURE__ */ jsx(
1447
+ "summary",
1448
+ {
1449
+ "data-test-id": "summary-details-v2-summary",
1450
+ "data-slot": "summary-details-v2-summary",
1451
+ className: twMerge("cursor-pointer list-none", summaryClassName),
1452
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
1453
+ /* @__PURE__ */ jsx(
1454
+ "span",
1455
+ {
1456
+ "data-test-id": "summary-details-v2-title",
1457
+ "data-slot": "summary-details-v2-title",
1458
+ className: "text-[15px] font-semibold text-text-primary dark:text-text-primary-dark",
1459
+ children: title
1460
+ }
1461
+ ),
1462
+ /* @__PURE__ */ jsx(
1463
+ "svg",
1464
+ {
1465
+ "data-test-id": "summary-details-v2-chevron",
1466
+ "data-slot": "summary-details-v2-chevron",
1467
+ className: "w-4 h-4 text-text-secondary dark:text-text-secondary-dark transition-transform duration-300 group-open:rotate-180 flex-shrink-0",
1468
+ viewBox: "0 0 24 24",
1469
+ fill: "none",
1470
+ stroke: "currentColor",
1471
+ "aria-hidden": "true",
1472
+ children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 9l7 7 7-7" })
1473
+ }
1474
+ )
1475
+ ] })
1476
+ }
1477
+ ),
1478
+ /* @__PURE__ */ jsx(
1479
+ "div",
1480
+ {
1481
+ "data-test-id": "summary-details-v2-top-divider",
1482
+ "data-slot": "summary-details-v2-top-divider",
1483
+ className: "h-px bg-border-default dark:bg-border-default-dark mt-3"
1484
+ }
1485
+ ),
1486
+ /* @__PURE__ */ jsx(
1487
+ "div",
1488
+ {
1489
+ "data-test-id": "summary-details-v2-content",
1490
+ "data-slot": "summary-details-v2-content",
1491
+ className: twMerge("mt-0", contentClassName),
1492
+ children: items.map((item, i) => /* @__PURE__ */ jsxs(React6.Fragment, { children: [
1493
+ /* @__PURE__ */ jsxs(
1494
+ "div",
1495
+ {
1496
+ "data-test-id": "summary-details-v2-row",
1497
+ "data-slot": "summary-details-v2-row",
1498
+ className: "flex justify-between items-center py-[10px] gap-3",
1499
+ children: [
1500
+ /* @__PURE__ */ jsx(
1501
+ "span",
1502
+ {
1503
+ "data-test-id": "summary-details-v2-row-label",
1504
+ "data-slot": "summary-details-v2-row-label",
1505
+ className: twMerge(
1506
+ "text-[11px] font-medium uppercase tracking-[0.07em] text-text-tertiary dark:text-text-tertiary-dark flex-shrink-0",
1507
+ item.labelClassName
1508
+ ),
1509
+ children: item.label
1510
+ }
1511
+ ),
1512
+ typeof item.value === "string" ? /* @__PURE__ */ jsx(
1513
+ "span",
1514
+ {
1515
+ "data-test-id": "summary-details-v2-row-value",
1516
+ "data-slot": "summary-details-v2-row-value",
1517
+ className: twMerge(
1518
+ "text-[13px] font-semibold text-text-primary dark:text-text-primary-dark text-right",
1519
+ item.valueClassName
1520
+ ),
1521
+ children: item.value
1522
+ }
1523
+ ) : /* @__PURE__ */ jsx(
1524
+ "div",
1525
+ {
1526
+ "data-test-id": "summary-details-v2-row-value",
1527
+ "data-slot": "summary-details-v2-row-value",
1528
+ className: twMerge("text-right", item.valueClassName),
1529
+ children: item.value
1530
+ }
1531
+ )
1532
+ ]
1533
+ }
1534
+ ),
1535
+ showDividers && i < items.length - 1 && /* @__PURE__ */ jsx(
1536
+ "div",
1537
+ {
1538
+ "data-test-id": "summary-details-v2-row-divider",
1539
+ "data-slot": "summary-details-v2-row-divider",
1540
+ className: "h-px bg-border-default dark:bg-border-default-dark"
1541
+ }
1542
+ )
1543
+ ] }, i))
1544
+ }
1545
+ )
1546
+ ]
1547
+ }
1548
+ );
1549
+ };
1425
1550
  var ActionSheet = ({
1426
1551
  id,
1427
1552
  currentActionSheetId,
@@ -1688,7 +1813,731 @@ function DeframeComponentsProvider({
1688
1813
  }
1689
1814
  );
1690
1815
  }
1816
+ var InfoRow = ({ children, borderBottom, className }) => {
1817
+ const baseClasses = "self-stretch inline-flex justify-between items-start";
1818
+ const borderClasses = borderBottom ? "border-b border-border-default dark:border-border-default-dark pb-sm" : "";
1819
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "info-row", className: twMerge(baseClasses, borderClasses, className), children });
1820
+ };
1821
+ var InfoLabel = ({ children, className }) => {
1822
+ const baseClasses = "text-sm text-text-secondary dark:text-text-secondary-dark";
1823
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "info-label", className: twMerge(baseClasses, className), children });
1824
+ };
1825
+ var variantClasses = {
1826
+ default: "text-text-primary dark:text-text-primary-dark",
1827
+ success: "text-state-success",
1828
+ warning: "text-state-warning",
1829
+ error: "text-state-error"
1830
+ };
1831
+ var InfoValue = ({ children, variant = "default", className }) => {
1832
+ const baseClasses = "text-sm font-semibold";
1833
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "info-value", className: twMerge(baseClasses, variantClasses[variant], className), children });
1834
+ };
1835
+ var InfoRowWithIcon = ({ children, borderBottom, className }) => {
1836
+ const baseClasses = "flex items-start justify-between h-[17px]";
1837
+ const borderClasses = borderBottom ? "border-b border-border-default dark:border-border-default-dark pb-sm" : "";
1838
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "info-row-with-icon", className: twMerge(baseClasses, borderClasses, className), children });
1839
+ };
1840
+ var InfoRowIconLabel = ({ children, className }) => {
1841
+ const baseClasses = "text-sm text-text-secondary dark:text-text-secondary-dark";
1842
+ return /* @__PURE__ */ jsxs("div", { "data-test-id": "info-row-icon-label", className: twMerge(baseClasses, className), children: [
1843
+ "\u2022 ",
1844
+ children
1845
+ ] });
1846
+ };
1847
+ var InfoRowIconValue = ({ children, className }) => {
1848
+ const baseClasses = "text-sm font-semibold text-text-primary dark:text-text-primary-dark";
1849
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "info-row-icon-value", className: twMerge(baseClasses, className), children });
1850
+ };
1851
+ var CollapsibleInfoRow = ({
1852
+ label,
1853
+ value,
1854
+ children,
1855
+ defaultOpen = false,
1856
+ className,
1857
+ collapseLabel,
1858
+ expandLabel
1859
+ }) => {
1860
+ const [isOpen, setIsOpen] = React6__default.useState(defaultOpen);
1861
+ const baseClasses = "flex flex-col gap-sm w-full";
1862
+ return /* @__PURE__ */ jsxs("div", { "data-test-id": "collapsible-info-row", className: twMerge(baseClasses, className), children: [
1863
+ /* @__PURE__ */ jsxs(
1864
+ "button",
1865
+ {
1866
+ type: "button",
1867
+ onClick: () => setIsOpen(!isOpen),
1868
+ className: "flex items-start justify-between w-full text-left h-[18px] cursor-pointer",
1869
+ "aria-expanded": isOpen,
1870
+ "aria-label": `${isOpen ? collapseLabel : expandLabel} ${label}`,
1871
+ children: [
1872
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-[2px]", children: [
1873
+ /* @__PURE__ */ jsx("span", { className: "text-text-sm text-text-secondary dark:text-text-secondary-dark", children: label }),
1874
+ /* @__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" }) })
1875
+ ] }),
1876
+ /* @__PURE__ */ jsx("span", { className: "text-text-sm font-semibold text-text-secondary dark:text-text-secondary-dark", children: value })
1877
+ ]
1878
+ }
1879
+ ),
1880
+ isOpen && children
1881
+ ] });
1882
+ };
1883
+ var BackgroundContainer = ({ children, className }) => {
1884
+ 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";
1885
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "background-container", className: twMerge(baseClasses, className), children });
1886
+ };
1887
+ var SectionCard = ({ children, className }) => {
1888
+ const baseClasses = "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised rounded shadow-sm p-md flex flex-col gap-sm";
1889
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "section-card", className: twMerge(baseClasses, className), children });
1890
+ };
1891
+ var Navbar = ({ children, className }) => {
1892
+ 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";
1893
+ return /* @__PURE__ */ jsx("nav", { "data-test-id": "navbar", className: twMerge(baseClasses, className), children });
1894
+ };
1895
+ var gapClasses = {
1896
+ xs: "gap-xs",
1897
+ sm: "gap-sm",
1898
+ md: "gap-md",
1899
+ lg: "gap-lg"
1900
+ };
1901
+ var FlexCol = ({ children, className, gap = "xs" }) => {
1902
+ const baseClasses = "flex flex-col";
1903
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "flex-col", className: twMerge(baseClasses, gapClasses[gap], className), children });
1904
+ };
1905
+ var gapClasses2 = {
1906
+ xs: "gap-xs",
1907
+ sm: "gap-sm",
1908
+ md: "gap-md",
1909
+ lg: "gap-lg"
1910
+ };
1911
+ var FlexRow = ({ children, className, gap = "xs" }) => {
1912
+ const baseClasses = "flex items-center";
1913
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "flex-row", className: twMerge(baseClasses, gapClasses2[gap], className), children });
1914
+ };
1915
+ var ScrollableContent = ({ children, className }) => {
1916
+ const baseClasses = "flex-1 overflow-y-auto px-md py-lg";
1917
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "scrollable-content", className: twMerge(baseClasses, className), children });
1918
+ };
1919
+ var DetailsHeader = ({ title, onBack, className, backAriaLabel = "Back" }) => {
1920
+ 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";
1921
+ return /* @__PURE__ */ jsxs("div", { "data-test-id": "details-header", className: twMerge(baseClasses, className), children: [
1922
+ /* @__PURE__ */ jsx(
1923
+ "button",
1924
+ {
1925
+ "data-test-id": "details-header-back-button",
1926
+ onClick: onBack,
1927
+ 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",
1928
+ "aria-label": backAriaLabel,
1929
+ children: /* @__PURE__ */ jsx(HiChevronLeft, { className: "w-6 h-6 text-text-tertiary dark:text-text-tertiary-dark" })
1930
+ }
1931
+ ),
1932
+ /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center", children: /* @__PURE__ */ jsx(TextHeading_default, { variant: "h-large", children: title }) })
1933
+ ] });
1934
+ };
1935
+ var CloseButton = ({ onClick, testId, ariaLabel = "Close", className }) => {
1936
+ 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";
1937
+ return /* @__PURE__ */ jsx(
1938
+ "button",
1939
+ {
1940
+ "data-test-id": testId != null ? testId : "close-button",
1941
+ onClick,
1942
+ className: twMerge(baseClasses, className),
1943
+ "aria-label": ariaLabel,
1944
+ children: /* @__PURE__ */ jsx(HiXMark, { className: "w-6 h-6" })
1945
+ }
1946
+ );
1947
+ };
1948
+ var HighRiskBadge = ({ className, label }) => {
1949
+ const baseClasses = "inline-flex justify-start items-start gap-1";
1950
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "high-risk-badge", className: twMerge(baseClasses, className), children: /* @__PURE__ */ jsx(
1951
+ "div",
1952
+ {
1953
+ "data-size": "Small",
1954
+ "data-type": "Failed",
1955
+ 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",
1956
+ 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 }) })
1957
+ }
1958
+ ) });
1959
+ };
1960
+ var MediumRiskBadge = ({ className, label }) => {
1961
+ const baseClasses = "inline-flex justify-start items-start gap-1";
1962
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "medium-risk-badge", className: twMerge(baseClasses, className), children: /* @__PURE__ */ jsx(
1963
+ "div",
1964
+ {
1965
+ "data-size": "Small",
1966
+ "data-type": "Warning",
1967
+ 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",
1968
+ 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 }) })
1969
+ }
1970
+ ) });
1971
+ };
1972
+ var LowRiskBadge = ({ className, label }) => {
1973
+ const baseClasses = "inline-flex justify-start items-start gap-1";
1974
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "low-risk-badge", className: twMerge(baseClasses, className), children: /* @__PURE__ */ jsx(
1975
+ "div",
1976
+ {
1977
+ "data-size": "Small",
1978
+ "data-type": "Completed",
1979
+ 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",
1980
+ 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 }) })
1981
+ }
1982
+ ) });
1983
+ };
1984
+ var gapClasses3 = {
1985
+ xs: "gap-xs",
1986
+ sm: "gap-sm",
1987
+ md: "gap-md",
1988
+ lg: "gap-lg"
1989
+ };
1990
+ var HistoryFlexCol = ({ children, className, gap = "xs" }) => /* @__PURE__ */ jsx("div", { "data-test-id": "history-flex-col", className: twMerge("flex flex-col", gapClasses3[gap], className), children });
1991
+ 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 });
1992
+ var Amount = ({ children }) => /* @__PURE__ */ jsx("p", { "data-test-id": "amount", className: "text-accent-md-mobile text-text-secondary dark:text-text-secondary-dark", children });
1993
+ 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: [
1994
+ "~ ",
1995
+ children
1996
+ ] });
1997
+ var TokenIcon = ({ src, alt }) => /* @__PURE__ */ jsx(
1998
+ "img",
1999
+ {
2000
+ "data-test-id": "token-icon",
2001
+ src,
2002
+ alt,
2003
+ className: "w-8 h-8 rounded-full",
2004
+ onError: (e) => {
2005
+ const fallbackText = encodeURIComponent((alt || "TOK").slice(0, 3).toUpperCase());
2006
+ e.target.src = `https://placehold.co/40x40?text=${fallbackText}`;
2007
+ }
2008
+ }
2009
+ );
2010
+ 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: [
2011
+ /* @__PURE__ */ jsx("span", { className: "w-2 h-2 rounded-full bg-state-success" }),
2012
+ /* @__PURE__ */ jsx("span", { className: "text-text-sm-mobile text-text-primary dark:text-text-primary-dark", children })
2013
+ ] });
2014
+ var truncateHash = (hash, chars = 6) => {
2015
+ if (hash.length <= chars * 2 + 3) return hash;
2016
+ return `${hash.slice(0, chars + 2)}...${hash.slice(-chars)}`;
2017
+ };
2018
+ var TransactionId = ({ hash }) => {
2019
+ if (!hash) {
2020
+ return /* @__PURE__ */ jsx("span", { "data-test-id": "transaction-id", className: "text-text-sm-mobile text-text-primary dark:text-text-primary-dark", children: "-" });
2021
+ }
2022
+ return /* @__PURE__ */ jsxs("div", { "data-test-id": "transaction-id", className: "flex items-center gap-xs", children: [
2023
+ /* @__PURE__ */ jsx("span", { className: "text-text-sm-mobile text-text-primary dark:text-text-primary-dark", children: truncateHash(hash) }),
2024
+ /* @__PURE__ */ jsx(
2025
+ AddressDisplay,
2026
+ {
2027
+ address: hash,
2028
+ className: "border-none bg-transparent p-0 gap-0",
2029
+ textClassName: "hidden"
2030
+ }
2031
+ )
2032
+ ] });
2033
+ };
2034
+ var ExplorerLink = ({ href, children }) => /* @__PURE__ */ jsx(
2035
+ "a",
2036
+ {
2037
+ "data-test-id": "explorer-link",
2038
+ href,
2039
+ target: "_blank",
2040
+ rel: "noopener noreferrer",
2041
+ className: "text-brand-primary underline text-sm font-semibold font-poppins",
2042
+ children
2043
+ }
2044
+ );
2045
+ var TwoLineValue = ({ primary, secondary }) => /* @__PURE__ */ jsxs(HistoryFlexCol, { className: "items-end", children: [
2046
+ /* @__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 }),
2047
+ /* @__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 })
2048
+ ] });
2049
+ var HistoryDepositDetailsView = ({
2050
+ transactionTypeLabel,
2051
+ symbol,
2052
+ amountWithSymbol,
2053
+ amountInUsdFormatted,
2054
+ shouldShowFlow,
2055
+ assetIn,
2056
+ assetOut,
2057
+ primaryAssetIconUrl,
2058
+ protocolLabel,
2059
+ statusLabel,
2060
+ txHash,
2061
+ date,
2062
+ explorerUrl,
2063
+ onClose,
2064
+ labels
2065
+ }) => {
2066
+ return /* @__PURE__ */ jsxs(BackgroundContainer, { children: [
2067
+ /* @__PURE__ */ jsx(DetailsHeader, { title: labels.transactionDetailsTitle, onBack: onClose }),
2068
+ /* @__PURE__ */ jsx(ScrollableContent, { children: /* @__PURE__ */ jsxs(FlexCol, { gap: "lg", children: [
2069
+ /* @__PURE__ */ jsx(SectionCard, { className: "!p-[24px]", children: /* @__PURE__ */ jsxs(FlexCol, { gap: "xs", children: [
2070
+ /* @__PURE__ */ jsx(TransactionTypeLabel, { children: transactionTypeLabel }),
2071
+ shouldShowFlow && assetIn && assetOut ? /* @__PURE__ */ jsxs(FlexCol, { gap: "sm", children: [
2072
+ /* @__PURE__ */ jsxs(FlexRow, { gap: "sm", children: [
2073
+ /* @__PURE__ */ jsx(TokenIcon, { src: assetIn.iconUrl, alt: assetIn.symbol }),
2074
+ /* @__PURE__ */ jsxs(FlexCol, { children: [
2075
+ /* @__PURE__ */ jsxs(Amount, { children: [
2076
+ assetIn.amount,
2077
+ " ",
2078
+ assetIn.symbol
2079
+ ] }),
2080
+ assetIn.amountInUSD ? /* @__PURE__ */ jsx(AmountInUsd, { children: assetIn.amountInUSD }) : null
2081
+ ] })
2082
+ ] }),
2083
+ /* @__PURE__ */ jsxs(FlexRow, { gap: "sm", children: [
2084
+ /* @__PURE__ */ jsx(TokenIcon, { src: assetOut.iconUrl, alt: assetOut.symbol }),
2085
+ /* @__PURE__ */ jsxs(FlexCol, { children: [
2086
+ /* @__PURE__ */ jsxs(Amount, { children: [
2087
+ assetOut.amount,
2088
+ " ",
2089
+ assetOut.symbol
2090
+ ] }),
2091
+ assetOut.amountInUSD ? /* @__PURE__ */ jsx(AmountInUsd, { children: assetOut.amountInUSD }) : null
2092
+ ] })
2093
+ ] })
2094
+ ] }) : /* @__PURE__ */ jsxs(FlexRow, { gap: "sm", children: [
2095
+ /* @__PURE__ */ jsx(TokenIcon, { src: primaryAssetIconUrl, alt: symbol }),
2096
+ /* @__PURE__ */ jsx(FlexCol, { children: /* @__PURE__ */ jsxs(FlexRow, { gap: "xs", children: [
2097
+ /* @__PURE__ */ jsx(Amount, { children: amountWithSymbol }),
2098
+ amountInUsdFormatted !== "-" ? /* @__PURE__ */ jsx(AmountInUsd, { children: amountInUsdFormatted }) : null
2099
+ ] }) })
2100
+ ] })
2101
+ ] }) }),
2102
+ /* @__PURE__ */ jsx(SectionCard, { className: "!p-md", children: /* @__PURE__ */ jsxs(FlexCol, { gap: "sm", children: [
2103
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2104
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.currencyLabel }),
2105
+ /* @__PURE__ */ jsx(InfoValue, { children: symbol })
2106
+ ] }),
2107
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2108
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.totalAmountLabel }),
2109
+ /* @__PURE__ */ jsx(TwoLineValue, { primary: amountInUsdFormatted, secondary: amountWithSymbol })
2110
+ ] }),
2111
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2112
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.operationCostLabel }),
2113
+ /* @__PURE__ */ jsx(InfoValue, { children: labels.operationCostSponsoredLabel })
2114
+ ] }),
2115
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2116
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.protocolLabel }),
2117
+ /* @__PURE__ */ jsx(InfoValue, { children: protocolLabel })
2118
+ ] }),
2119
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2120
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.statusLabel }),
2121
+ /* @__PURE__ */ jsx(SuccessBadge, { children: statusLabel })
2122
+ ] }),
2123
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2124
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.transactionIdLabel }),
2125
+ /* @__PURE__ */ jsx(TransactionId, { hash: txHash })
2126
+ ] }),
2127
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2128
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.dateLabel }),
2129
+ /* @__PURE__ */ jsx(InfoValue, { children: date })
2130
+ ] }),
2131
+ explorerUrl && /* @__PURE__ */ jsxs(InfoRow, { children: [
2132
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.transactionLabel }),
2133
+ /* @__PURE__ */ jsx(ExplorerLink, { href: explorerUrl, children: labels.viewOnExplorerLabel })
2134
+ ] })
2135
+ ] }) })
2136
+ ] }) })
2137
+ ] });
2138
+ };
2139
+ var HistoryWithdrawDetailsView = ({
2140
+ transactionTypeLabel,
2141
+ symbol,
2142
+ amountWithSymbol,
2143
+ amountInUsdFormatted,
2144
+ shouldShowFlow,
2145
+ assetIn,
2146
+ assetOut,
2147
+ primaryAssetIconUrl,
2148
+ protocolLabel,
2149
+ statusLabel,
2150
+ txHash,
2151
+ date,
2152
+ explorerUrl,
2153
+ onClose,
2154
+ labels
2155
+ }) => {
2156
+ return /* @__PURE__ */ jsxs(BackgroundContainer, { children: [
2157
+ /* @__PURE__ */ jsx(DetailsHeader, { title: labels.transactionDetailsTitle, onBack: onClose }),
2158
+ /* @__PURE__ */ jsx(ScrollableContent, { children: /* @__PURE__ */ jsxs(FlexCol, { gap: "lg", children: [
2159
+ /* @__PURE__ */ jsx(SectionCard, { className: "!p-[24px]", children: /* @__PURE__ */ jsxs(FlexCol, { gap: "xs", children: [
2160
+ /* @__PURE__ */ jsx(TransactionTypeLabel, { children: transactionTypeLabel }),
2161
+ shouldShowFlow && assetIn && assetOut ? /* @__PURE__ */ jsxs(FlexCol, { gap: "sm", children: [
2162
+ /* @__PURE__ */ jsxs(FlexRow, { gap: "sm", children: [
2163
+ /* @__PURE__ */ jsx(TokenIcon, { src: assetIn.iconUrl, alt: assetIn.symbol }),
2164
+ /* @__PURE__ */ jsxs(FlexCol, { children: [
2165
+ /* @__PURE__ */ jsxs(Amount, { children: [
2166
+ assetIn.amount,
2167
+ " ",
2168
+ assetIn.symbol
2169
+ ] }),
2170
+ assetIn.amountInUSD ? /* @__PURE__ */ jsx(AmountInUsd, { children: assetIn.amountInUSD }) : null
2171
+ ] })
2172
+ ] }),
2173
+ /* @__PURE__ */ jsxs(FlexRow, { gap: "sm", children: [
2174
+ /* @__PURE__ */ jsx(TokenIcon, { src: assetOut.iconUrl, alt: assetOut.symbol }),
2175
+ /* @__PURE__ */ jsxs(FlexCol, { children: [
2176
+ /* @__PURE__ */ jsxs(Amount, { children: [
2177
+ assetOut.amount,
2178
+ " ",
2179
+ assetOut.symbol
2180
+ ] }),
2181
+ assetOut.amountInUSD ? /* @__PURE__ */ jsx(AmountInUsd, { children: assetOut.amountInUSD }) : null
2182
+ ] })
2183
+ ] })
2184
+ ] }) : /* @__PURE__ */ jsxs(FlexRow, { gap: "sm", children: [
2185
+ /* @__PURE__ */ jsx(TokenIcon, { src: primaryAssetIconUrl, alt: symbol }),
2186
+ /* @__PURE__ */ jsx(FlexCol, { children: /* @__PURE__ */ jsxs(FlexRow, { gap: "xs", children: [
2187
+ /* @__PURE__ */ jsx(Amount, { children: amountWithSymbol }),
2188
+ amountInUsdFormatted !== "-" ? /* @__PURE__ */ jsx(AmountInUsd, { children: amountInUsdFormatted }) : null
2189
+ ] }) })
2190
+ ] })
2191
+ ] }) }),
2192
+ /* @__PURE__ */ jsx(SectionCard, { className: "!p-md", children: /* @__PURE__ */ jsxs(FlexCol, { gap: "sm", children: [
2193
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2194
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.currencyLabel }),
2195
+ /* @__PURE__ */ jsx(InfoValue, { children: symbol })
2196
+ ] }),
2197
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2198
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.totalAmountLabel }),
2199
+ /* @__PURE__ */ jsx(TwoLineValue, { primary: amountInUsdFormatted, secondary: amountWithSymbol })
2200
+ ] }),
2201
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2202
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.operationCostLabel }),
2203
+ /* @__PURE__ */ jsx(InfoValue, { children: labels.operationCostSponsoredLabel })
2204
+ ] }),
2205
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2206
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.protocolLabel }),
2207
+ /* @__PURE__ */ jsx(InfoValue, { children: protocolLabel })
2208
+ ] }),
2209
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2210
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.statusLabel }),
2211
+ /* @__PURE__ */ jsx(SuccessBadge, { children: statusLabel })
2212
+ ] }),
2213
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2214
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.transactionIdLabel }),
2215
+ /* @__PURE__ */ jsx(TransactionId, { hash: txHash })
2216
+ ] }),
2217
+ /* @__PURE__ */ jsxs(InfoRow, { borderBottom: true, children: [
2218
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.dateLabel }),
2219
+ /* @__PURE__ */ jsx(InfoValue, { children: date })
2220
+ ] }),
2221
+ explorerUrl && /* @__PURE__ */ jsxs(InfoRow, { children: [
2222
+ /* @__PURE__ */ jsx(InfoLabel, { children: labels.transactionLabel }),
2223
+ /* @__PURE__ */ jsx(ExplorerLink, { href: explorerUrl, children: labels.viewOnExplorerLabel })
2224
+ ] })
2225
+ ] }) })
2226
+ ] }) })
2227
+ ] });
2228
+ };
2229
+ var SwapNetworkSelectorView = ({
2230
+ chainLabel,
2231
+ chainImage,
2232
+ onClick,
2233
+ directionLabel = "De",
2234
+ testId = "swap-network-selector",
2235
+ className
2236
+ }) => {
2237
+ const baseClasses = "flex flex-row items-center gap-xs";
2238
+ return /* @__PURE__ */ jsxs("div", { "data-test-id": testId, className: twMerge(baseClasses, className), children: [
2239
+ /* @__PURE__ */ jsx(TextBody_default, { as: "span", variant: "text-small", className: "tracking-wide text-text-tertiary dark:text-text-tertiary-dark", children: directionLabel }),
2240
+ /* @__PURE__ */ jsxs(
2241
+ "button",
2242
+ {
2243
+ "data-testid": testId,
2244
+ type: "button",
2245
+ onClick,
2246
+ 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",
2247
+ "aria-label": `${directionLabel} ${chainLabel}`,
2248
+ children: [
2249
+ chainImage ? /* @__PURE__ */ jsx("img", { src: chainImage, alt: chainLabel, className: "w-3 h-3 rounded-full" }) : null,
2250
+ /* @__PURE__ */ jsx("span", { children: chainLabel }),
2251
+ /* @__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" }) })
2252
+ ]
2253
+ }
2254
+ )
2255
+ ] });
2256
+ };
2257
+ var SwapQuoteHeaderView = ({
2258
+ label,
2259
+ timerElement,
2260
+ className
2261
+ }) => {
2262
+ const baseClasses = "border-b border-border-default dark:border-border-default-dark pb-sm";
2263
+ 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: [
2264
+ /* @__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 }),
2265
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-md", children: timerElement })
2266
+ ] }) });
2267
+ };
2268
+ var SwapAmountInputView = ({
2269
+ value,
2270
+ hasError,
2271
+ onChange,
2272
+ maxFractionDigits = 6,
2273
+ field,
2274
+ ariaLabel = "Amount to swap",
2275
+ className
2276
+ }) => {
2277
+ const normalizeAmountInput = (raw) => {
2278
+ let val = raw.replace(/[^\d.,]/g, "");
2279
+ const endsWithSeparator = /[.,]$/.test(val);
2280
+ val = val.replace(/,/g, ".");
2281
+ const firstDot = val.indexOf(".");
2282
+ if (firstDot !== -1) {
2283
+ const intPart = val.slice(0, firstDot);
2284
+ const fractional = val.slice(firstDot + 1).replace(/\./g, "").slice(0, maxFractionDigits);
2285
+ if (fractional.length > 0) {
2286
+ val = `${intPart}.${fractional}`;
2287
+ } else {
2288
+ val = endsWithSeparator ? `${intPart}.` : intPart;
2289
+ }
2290
+ }
2291
+ if (val.startsWith(".")) {
2292
+ val = `0${val}`;
2293
+ }
2294
+ return val;
2295
+ };
2296
+ 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";
2297
+ const colorClasses = hasError ? "text-state-error dark:text-state-error" : "text-text-primary dark:text-text-primary-dark";
2298
+ return /* @__PURE__ */ jsx(
2299
+ "input",
2300
+ __spreadProps(__spreadValues({
2301
+ "data-test-id": "swap-flow-amount-input",
2302
+ placeholder: "0.00",
2303
+ type: "text",
2304
+ inputMode: "decimal",
2305
+ autoComplete: "off",
2306
+ "aria-label": ariaLabel,
2307
+ min: "0",
2308
+ step: "any",
2309
+ value,
2310
+ className: twMerge(baseClasses, colorClasses, className)
2311
+ }, field), {
2312
+ onChange: (event) => {
2313
+ let normalized = normalizeAmountInput(event.target.value);
2314
+ if (normalized && parseFloat(normalized) < 0) {
2315
+ normalized = "0";
2316
+ }
2317
+ onChange(normalized);
2318
+ },
2319
+ onWheel: (event) => {
2320
+ event.currentTarget.blur();
2321
+ }
2322
+ })
2323
+ );
2324
+ };
2325
+ var SwapOutputAmountView = ({
2326
+ displayOutput,
2327
+ isLoading,
2328
+ loadingElement,
2329
+ searchingQuoteLabel = "Searching quote...",
2330
+ className
2331
+ }) => {
2332
+ const baseClasses = "text-h2-mobile font-extrabold text-right w-full min-w-[120px] text-text-primary dark:text-text-primary-dark";
2333
+ 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 });
2334
+ };
2335
+ var SwapQuoteErrorsView = ({
2336
+ hasQuoteError,
2337
+ hasBytecodeError,
2338
+ quoteErrorMessage = "Unable to get quote for this transaction",
2339
+ bytecodeErrorMessage = "Error building transaction"
2340
+ }) => {
2341
+ return /* @__PURE__ */ jsxs("div", { "data-test-id": "swap-quote-errors", children: [
2342
+ hasQuoteError && /* @__PURE__ */ jsx("div", { className: "mt-sm", children: /* @__PURE__ */ jsx(
2343
+ BannerNotification,
2344
+ {
2345
+ type: "inline",
2346
+ variant: "error",
2347
+ message: quoteErrorMessage
2348
+ }
2349
+ ) }),
2350
+ hasBytecodeError && /* @__PURE__ */ jsx("div", { className: "mt-sm", children: /* @__PURE__ */ jsx(
2351
+ BannerNotification,
2352
+ {
2353
+ type: "inline",
2354
+ variant: "error",
2355
+ message: bytecodeErrorMessage
2356
+ }
2357
+ ) })
2358
+ ] });
2359
+ };
2360
+ var SLIPPAGE_OPTIONS = [10, 50, 100];
2361
+ var SwapSlippageToleranceButtonsView = ({
2362
+ slippageBps,
2363
+ onSelect,
2364
+ formatPercentage,
2365
+ className
2366
+ }) => {
2367
+ const baseClasses = "flex gap-xs";
2368
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "swap-slippage-tolerance-buttons", className: twMerge(baseClasses, className), children: SLIPPAGE_OPTIONS.map((option) => {
2369
+ const isActive = slippageBps === option;
2370
+ const activeClasses = "border-brand-primary text-brand-primary bg-brand-tint dark:bg-brand-tint-dark";
2371
+ 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";
2372
+ const buttonBase = "px-sm py-xs rounded border text-text-sm cursor-pointer";
2373
+ return /* @__PURE__ */ jsxs(
2374
+ "button",
2375
+ {
2376
+ "data-test-id": `slippage-option-${option}`,
2377
+ type: "button",
2378
+ onClick: () => onSelect(option),
2379
+ className: twMerge(buttonBase, isActive ? activeClasses : inactiveClasses),
2380
+ "aria-label": `${formatPercentage(option)}% slippage`,
2381
+ "aria-pressed": isActive,
2382
+ children: [
2383
+ formatPercentage(option),
2384
+ "%"
2385
+ ]
2386
+ },
2387
+ option
2388
+ );
2389
+ }) });
2390
+ };
2391
+ var SwapTokenSelectorView = ({
2392
+ token,
2393
+ onClick,
2394
+ testId = "swap-token-selector",
2395
+ selectTokenLabel = "Select token",
2396
+ className
2397
+ }) => {
2398
+ 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";
2399
+ return /* @__PURE__ */ jsxs(
2400
+ "button",
2401
+ {
2402
+ "data-test-id": testId,
2403
+ type: "button",
2404
+ onClick,
2405
+ className: twMerge(baseClasses, className),
2406
+ "aria-label": token ? token.symbol : selectTokenLabel,
2407
+ children: [
2408
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-sm flex-1", children: token ? /* @__PURE__ */ jsxs(Fragment, { children: [
2409
+ 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() }),
2410
+ /* @__PURE__ */ jsx(TextBody_default, { as: "span", className: "text-text-primary dark:text-text-primary-dark", children: token.symbol })
2411
+ ] }) : /* @__PURE__ */ jsx(TextBody_default, { as: "span", className: "text-text-secondary dark:text-text-secondary-dark", children: selectTokenLabel }) }),
2412
+ /* @__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" }) })
2413
+ ]
2414
+ }
2415
+ );
2416
+ };
2417
+ var SwapQuoteBlockchainCostsView = ({
2418
+ totalCostFormatted,
2419
+ feePercentage,
2420
+ gasCostFormatted,
2421
+ protocolFee,
2422
+ blockchainCostsLabel = "Blockchain Costs",
2423
+ networkGasLabel = "Network Gas",
2424
+ protocolFeeLabel = "Protocol Fee",
2425
+ collapseLabel = "Collapse",
2426
+ expandLabel = "Expand"
2427
+ }) => {
2428
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "swap-quote-blockchain-costs", children: /* @__PURE__ */ jsx(
2429
+ CollapsibleInfoRow,
2430
+ {
2431
+ label: blockchainCostsLabel,
2432
+ value: `${totalCostFormatted} ~ ${feePercentage}%`,
2433
+ defaultOpen: true,
2434
+ collapseLabel,
2435
+ expandLabel,
2436
+ children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-sm", children: [
2437
+ /* @__PURE__ */ jsxs(InfoRowWithIcon, { children: [
2438
+ /* @__PURE__ */ jsx(InfoRowIconLabel, { children: networkGasLabel }),
2439
+ /* @__PURE__ */ jsx(InfoRowIconValue, { children: gasCostFormatted })
2440
+ ] }),
2441
+ /* @__PURE__ */ jsxs(InfoRowWithIcon, { borderBottom: true, children: [
2442
+ /* @__PURE__ */ jsx(InfoRowIconLabel, { children: protocolFeeLabel }),
2443
+ /* @__PURE__ */ jsx(InfoRowIconValue, { children: protocolFee })
2444
+ ] })
2445
+ ] })
2446
+ }
2447
+ ) });
2448
+ };
2449
+ var ChooseAStrategyActionsheetView = ({
2450
+ isOpen,
2451
+ currentActionSheetId,
2452
+ assetName,
2453
+ apy,
2454
+ logoUrl,
2455
+ riskLevel,
2456
+ onStrategyClick,
2457
+ onClose,
2458
+ yieldLabel,
2459
+ apyLabel = "APY",
2460
+ riskBadgeLabels,
2461
+ closeAriaLabel = "Close"
2462
+ }) => {
2463
+ const resolvedYieldLabel = yieldLabel != null ? yieldLabel : `Yield ${assetName}`;
2464
+ const badges = {
2465
+ low: /* @__PURE__ */ jsx(LowRiskBadge, { label: riskBadgeLabels.low }),
2466
+ medium: /* @__PURE__ */ jsx(MediumRiskBadge, { label: riskBadgeLabels.medium }),
2467
+ high: /* @__PURE__ */ jsx(HighRiskBadge, { label: riskBadgeLabels.high })
2468
+ };
2469
+ const Badge = badges[riskLevel];
2470
+ return /* @__PURE__ */ jsx("div", { "data-test-id": "choose-strategy-actionsheet", className: "flex justify-center", children: /* @__PURE__ */ jsx(
2471
+ ActionSheet,
2472
+ {
2473
+ id: "choose-strategy",
2474
+ currentActionSheetId,
2475
+ isOpen,
2476
+ onClose,
2477
+ position: "bottom",
2478
+ height: "full",
2479
+ contentClassName: "w-full max-w-[620px] mx-auto",
2480
+ children: /* @__PURE__ */ jsxs(BackgroundContainer, { className: "flex flex-col h-full", children: [
2481
+ /* @__PURE__ */ jsx(Navbar, { children: /* @__PURE__ */ jsx(CloseButton, { onClick: onClose, ariaLabel: closeAriaLabel }) }),
2482
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 w-full p-6 overflow-hidden", children: [
2483
+ /* @__PURE__ */ jsxs("div", { className: "flex-shrink-0", children: [
2484
+ /* @__PURE__ */ jsx(TextHeading_default, { children: resolvedYieldLabel }),
2485
+ /* @__PURE__ */ jsx("br", {})
2486
+ ] }),
2487
+ /* @__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: [
2488
+ /* @__PURE__ */ jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsx("img", { src: logoUrl, alt: assetName, className: "w-10 h-10 rounded-full" }) }),
2489
+ /* @__PURE__ */ jsxs(ListItemContent, { className: "gap-1", children: [
2490
+ /* @__PURE__ */ jsx(TextBody_default, { children: resolvedYieldLabel }),
2491
+ /* @__PURE__ */ jsx(TextBody_default, { variant: "text-small", children: Badge })
2492
+ ] }),
2493
+ /* @__PURE__ */ jsx(ListItemRightSide, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-center items-center gap-1", children: [
2494
+ /* @__PURE__ */ jsxs("span", { className: "text-state-success", children: [
2495
+ apy,
2496
+ "% ",
2497
+ apyLabel
2498
+ ] }),
2499
+ /* @__PURE__ */ jsx(HiArrowRight, { className: "w-4 h-4" })
2500
+ ] }) })
2501
+ ] }) })
2502
+ ] })
2503
+ ] })
2504
+ }
2505
+ ) });
2506
+ };
2507
+ var StrategyDetailsView = ({
2508
+ logoUrl,
2509
+ title,
2510
+ description,
2511
+ strategyInfo,
2512
+ onBack,
2513
+ onDeposit,
2514
+ headerTitle = "Details",
2515
+ strategyInfoTitle = "Strategy Info",
2516
+ depositButtonLabel = "Deposit",
2517
+ backAriaLabel = "Back"
2518
+ }) => {
2519
+ return /* @__PURE__ */ jsxs(BackgroundContainer, { children: [
2520
+ /* @__PURE__ */ jsx(DetailsHeader, { title: headerTitle, onBack, backAriaLabel }),
2521
+ /* @__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: [
2522
+ /* @__PURE__ */ jsxs("div", { className: "inline-flex flex-col items-start gap-sm", children: [
2523
+ /* @__PURE__ */ jsx("img", { "data-test-id": "strategy-logo", src: logoUrl, alt: title, className: "w-20 h-20 rounded-full" }),
2524
+ /* @__PURE__ */ jsx(TextHeading_default, { variant: "h5", children: title })
2525
+ ] }),
2526
+ /* @__PURE__ */ jsx(TextBody_default, { variant: "text-small", children: description }),
2527
+ /* @__PURE__ */ jsx(
2528
+ SummaryDetails,
2529
+ {
2530
+ title: strategyInfoTitle,
2531
+ items: strategyInfo,
2532
+ defaultOpen: true,
2533
+ className: "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised"
2534
+ }
2535
+ )
2536
+ ] }) }),
2537
+ /* @__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 }) })
2538
+ ] });
2539
+ };
1691
2540
 
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 };
2541
+ export { ActionButton, ActionSheet, AddressDisplay, BackgroundContainer, BannerNotification, ChooseAStrategyActionsheetView, CloseButton, CollapsibleInfoRow, ConnectWalletList, Currency, DeframeComponentsProvider, DetailsHeader, Currency as Fiat, FlexCol, FlexRow, HighRiskBadge, HistoryDepositDetailsView, HistoryWithdrawDetailsView, InfoLabel, InfoRow, InfoRowIconLabel, InfoRowIconValue, InfoRowWithIcon, InfoValue, Input, Link, ListItem, ListItemContent, ListItemLeftSide, ListItemRightSide, LowRiskBadge, MediumRiskBadge, Navbar, PercentageButton, PrimaryButton, ScrollableContent, SecondaryButton, SectionCard, Select, SelectContent, SelectItem, SelectTrigger, Skeleton, StrategyDetailsView, SummaryDetails, SummaryDetailsCryptoControlV2, SwapAmountInputView, SwapNetworkSelectorView, SwapOutputAmountView, SwapQuoteBlockchainCostsView, SwapQuoteErrorsView, SwapQuoteHeaderView, SwapSlippageToleranceButtonsView, SwapTokenSelectorView, 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 };
1693
2542
  //# sourceMappingURL=index.mjs.map
1694
2543
  //# sourceMappingURL=index.mjs.map