@deframe-sdk/components 0.1.37 → 0.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8706,6 +8706,213 @@ function ChooseNetworkAndAssetViewSimple({
8706
8706
  );
8707
8707
  }
8708
8708
  }
8709
+
8710
+ // src/types/history-list-item-data.ts
8711
+ function isAssetAmount(asset) {
8712
+ return "symbol" in asset;
8713
+ }
8714
+ function isFiatAmount(asset) {
8715
+ return "currency" in asset;
8716
+ }
8717
+
8718
+ // src/utils/history-item-display.ts
8719
+ function getAssetSymbol(asset) {
8720
+ if (!asset) return "\u2014";
8721
+ if (isAssetAmount(asset)) return asset.symbol;
8722
+ if (isFiatAmount(asset)) return asset.currency;
8723
+ return "\u2014";
8724
+ }
8725
+ function getChainName(asset) {
8726
+ var _a, _b;
8727
+ if (!asset) return "";
8728
+ if (isAssetAmount(asset)) return (_b = (_a = asset.chain) == null ? void 0 : _a.name) != null ? _b : "";
8729
+ return "";
8730
+ }
8731
+ function historyResolveLabel(item) {
8732
+ var _a, _b;
8733
+ const assetIn = (_a = item.amounts) == null ? void 0 : _a.assetIn;
8734
+ const assetOut = (_b = item.amounts) == null ? void 0 : _b.assetOut;
8735
+ const fromSymbol = getAssetSymbol(assetIn);
8736
+ const toSymbol = getAssetSymbol(assetOut);
8737
+ const fromChain = getChainName(assetIn);
8738
+ const toChain = getChainName(assetOut);
8739
+ const labelMap = {
8740
+ SAMECHAIN_SWAP: () => `Swap ${fromSymbol} \u2192 ${toSymbol}`,
8741
+ CROSSCHAIN_SWAP: () => {
8742
+ const route = fromChain && toChain ? ` (${fromChain} \u2192 ${toChain})` : "";
8743
+ return `Swap ${fromSymbol} \u2192 ${toSymbol}${route}`;
8744
+ },
8745
+ TRANSFER_IN: () => `Recebimento ${toSymbol}`,
8746
+ TRANSFER_OUT: () => `Envio ${fromSymbol}`,
8747
+ ON_RAMP_FIAT: () => `Dep\xF3sito ${fromSymbol} \u2192 ${toSymbol}`,
8748
+ OFF_RAMP_FIAT: () => `Saque ${fromSymbol} \u2192 ${toSymbol}`,
8749
+ SAMECHAIN_INVESTMENT_DEPOSIT: () => `Dep\xF3sito ${fromSymbol}`,
8750
+ SAMECHAIN_INVESTMENT_WITHDRAW: () => `Resgate ${toSymbol}`,
8751
+ CROSSCHAIN_INVESTMENT_DEPOSIT: () => {
8752
+ const route = fromChain && toChain ? ` (${fromChain} \u2192 ${toChain})` : "";
8753
+ return `Dep\xF3sito ${fromSymbol}${route}`;
8754
+ },
8755
+ CROSSCHAIN_INVESTMENT_WITHDRAW: () => {
8756
+ const route = fromChain && toChain ? ` (${fromChain} \u2192 ${toChain})` : "";
8757
+ return `Resgate ${toSymbol}${route}`;
8758
+ }
8759
+ };
8760
+ return labelMap[item.type]();
8761
+ }
8762
+ function historyResolveAmounts(item) {
8763
+ var _a, _b;
8764
+ const assetOut = (_a = item.amounts) == null ? void 0 : _a.assetOut;
8765
+ const assetIn = (_b = item.amounts) == null ? void 0 : _b.assetIn;
8766
+ const displayAsset = item.type === "TRANSFER_OUT" || item.type === "OFF_RAMP_FIAT" ? assetIn : assetOut;
8767
+ if (!displayAsset) return { primary: "\u2014", secondary: "" };
8768
+ if (isAssetAmount(displayAsset)) {
8769
+ const primary = `${displayAsset.amountHumanized} ${displayAsset.symbol}`;
8770
+ const secondary = displayAsset.amountInUSD ? `~$${displayAsset.amountInUSD}` : "";
8771
+ return { primary, secondary };
8772
+ }
8773
+ if (isFiatAmount(displayAsset)) {
8774
+ return { primary: `${displayAsset.amountHumanized} ${displayAsset.currency}`, secondary: "" };
8775
+ }
8776
+ return { primary: "\u2014", secondary: "" };
8777
+ }
8778
+ function historyFormatDate(isoDate) {
8779
+ const d = new Date(isoDate);
8780
+ if (isNaN(d.getTime())) return isoDate;
8781
+ return d.toLocaleDateString("pt-BR", {
8782
+ day: "2-digit",
8783
+ month: "short",
8784
+ year: "numeric",
8785
+ hour: "2-digit",
8786
+ minute: "2-digit"
8787
+ });
8788
+ }
8789
+ var SWAP_TYPES = ["SAMECHAIN_SWAP", "CROSSCHAIN_SWAP"];
8790
+ var DEPOSIT_TYPES = [
8791
+ "TRANSFER_IN",
8792
+ "ON_RAMP_FIAT",
8793
+ "SAMECHAIN_INVESTMENT_DEPOSIT",
8794
+ "CROSSCHAIN_INVESTMENT_DEPOSIT"
8795
+ ];
8796
+ function historyIsSwap(type) {
8797
+ return SWAP_TYPES.includes(type);
8798
+ }
8799
+ function historyIsDeposit(type) {
8800
+ return DEPOSIT_TYPES.includes(type);
8801
+ }
8802
+ function historyResolveIconUrl(item) {
8803
+ var _a, _b, _c, _d;
8804
+ const assetOut = (_a = item.amounts) == null ? void 0 : _a.assetOut;
8805
+ const assetIn = (_b = item.amounts) == null ? void 0 : _b.assetIn;
8806
+ const displayAsset = item.type === "TRANSFER_OUT" || item.type === "OFF_RAMP_FIAT" ? assetIn : assetOut;
8807
+ if (displayAsset && isAssetAmount(displayAsset)) return (_d = (_c = displayAsset.token) == null ? void 0 : _c.logoURI) != null ? _d : "";
8808
+ return "";
8809
+ }
8810
+ function historyResolveIconAlt(item) {
8811
+ var _a, _b;
8812
+ const assetOut = (_a = item.amounts) == null ? void 0 : _a.assetOut;
8813
+ const assetIn = (_b = item.amounts) == null ? void 0 : _b.assetIn;
8814
+ const displayAsset = item.type === "TRANSFER_OUT" || item.type === "OFF_RAMP_FIAT" ? assetIn : assetOut;
8815
+ if (displayAsset && isAssetAmount(displayAsset)) return displayAsset.symbol;
8816
+ if (displayAsset && isFiatAmount(displayAsset)) return displayAsset.currency;
8817
+ return "";
8818
+ }
8819
+ function historyResolveSubtitle(item) {
8820
+ var _a, _b;
8821
+ const assetIn = (_a = item.amounts) == null ? void 0 : _a.assetIn;
8822
+ const assetOut = (_b = item.amounts) == null ? void 0 : _b.assetOut;
8823
+ const fromChain = getChainName(assetIn);
8824
+ const toChain = getChainName(assetOut);
8825
+ if (historyIsSwap(item.type) && fromChain && toChain && fromChain !== toChain) {
8826
+ return `${fromChain} \u2192 ${toChain}`;
8827
+ }
8828
+ return fromChain || toChain || "";
8829
+ }
8830
+ function historyResolveSearchableText(item) {
8831
+ const label = historyResolveLabel(item);
8832
+ const { primary, secondary } = historyResolveAmounts(item);
8833
+ const date = historyFormatDate(item.createdAt);
8834
+ const status = item.status;
8835
+ return `${label} ${primary} ${secondary} ${date} ${status}`.toLowerCase();
8836
+ }
8837
+ var variantStyles = {
8838
+ primary: "text-[color:var(--deframe-widget-color-text-primary)] dark:text-[color:var(--deframe-widget-color-text-primary-dark)] text-text-md",
8839
+ secondary: "text-[color:var(--deframe-widget-color-text-secondary)] dark:text-[color:var(--deframe-widget-color-text-secondary-dark)] text-text-sm font-poppins"
8840
+ };
8841
+ var Label = ({ children, variant = "primary", className }) => {
8842
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: tailwindMerge.twMerge(variantStyles[variant], className), children });
8843
+ };
8844
+ var SwapIconWithBadge = ({ src, alt }) => {
8845
+ const fallbackText = encodeURIComponent((alt || "TOK").slice(0, 3).toUpperCase());
8846
+ const fallbackSrc = `https://placehold.co/40x40?text=${fallbackText}`;
8847
+ const resolvedSrc = src || fallbackSrc;
8848
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-shrink-0", children: [
8849
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-10 h-10 rounded-xl bg-[var(--deframe-widget-color-bg-tertiary)] dark:bg-[var(--deframe-widget-color-bg-tertiary-dark)] flex items-center justify-center overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
8850
+ "img",
8851
+ {
8852
+ src: resolvedSrc,
8853
+ alt,
8854
+ className: "w-full h-full object-cover",
8855
+ onError: (e) => {
8856
+ e.target.src = fallbackSrc;
8857
+ }
8858
+ }
8859
+ ) }),
8860
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute bottom-[-2px] right-[-2px] w-[15px] h-[15px] rounded-full bg-[var(--deframe-widget-color-bg-secondary)] dark:bg-[var(--deframe-widget-color-bg-secondary-dark)] flex items-center justify-center border border-[color:var(--deframe-widget-color-bg-secondary)] dark:border-[color:var(--deframe-widget-color-bg-secondary-dark)]", children: /* @__PURE__ */ jsxRuntime.jsx(md.MdArrowUpward, { className: "w-3 h-3 text-[color:var(--deframe-widget-color-text-primary)] dark:text-[color:var(--deframe-widget-color-text-primary-dark)]" }) })
8861
+ ] });
8862
+ };
8863
+ var ArrowBadge = ({ isDeposit }) => {
8864
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute bottom-[-2px] right-[-2px] w-[15px] h-[15px] rounded-full bg-[var(--deframe-widget-color-bg-secondary)] dark:bg-[var(--deframe-widget-color-bg-secondary-dark)] flex items-center justify-center border border-[color:var(--deframe-widget-color-bg-secondary)] dark:border-[color:var(--deframe-widget-color-bg-secondary-dark)]", children: isDeposit ? /* @__PURE__ */ jsxRuntime.jsx(md.MdArrowDownward, { className: "w-3 h-3 text-[color:var(--deframe-widget-color-text-primary)] dark:text-[color:var(--deframe-widget-color-text-primary-dark)]" }) : /* @__PURE__ */ jsxRuntime.jsx(md.MdArrowUpward, { className: "w-3 h-3 text-[color:var(--deframe-widget-color-text-primary)] dark:text-[color:var(--deframe-widget-color-text-primary-dark)]" }) });
8865
+ };
8866
+ var TokenIconWithBadge2 = ({ src, alt, isDeposit }) => {
8867
+ const fallbackText = encodeURIComponent((alt || "TOK").slice(0, 3).toUpperCase());
8868
+ const fallbackSrc = `https://placehold.co/40x40?text=${fallbackText}`;
8869
+ const resolvedSrc = src || fallbackSrc;
8870
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-shrink-0", children: [
8871
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-10 h-10 rounded-xl bg-[var(--deframe-widget-color-bg-tertiary)] dark:bg-[var(--deframe-widget-color-bg-tertiary-dark)] flex items-center justify-center overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
8872
+ "img",
8873
+ {
8874
+ src: resolvedSrc,
8875
+ alt,
8876
+ className: "w-full h-full object-cover",
8877
+ onError: (e) => {
8878
+ e.target.src = fallbackSrc;
8879
+ }
8880
+ }
8881
+ ) }),
8882
+ /* @__PURE__ */ jsxRuntime.jsx(ArrowBadge, { isDeposit })
8883
+ ] });
8884
+ };
8885
+ var AmountDisplay = ({ amount, usdAmount }) => {
8886
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8887
+ /* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-accent-sm-mobile whitespace-nowrap", children: amount }),
8888
+ usdAmount ? /* @__PURE__ */ jsxRuntime.jsx(Label, { variant: "secondary", className: "whitespace-nowrap", children: usdAmount }) : null
8889
+ ] });
8890
+ };
8891
+ var HistoryListItem = ({ item, onClick, className, statusLabel, statusTitle }) => {
8892
+ const label = historyResolveLabel(item);
8893
+ const subtitle = historyResolveSubtitle(item);
8894
+ const { primary, secondary } = historyResolveAmounts(item);
8895
+ const iconUrl = historyResolveIconUrl(item);
8896
+ const iconAlt = historyResolveIconAlt(item);
8897
+ const isSwap = historyIsSwap(item.type);
8898
+ const isDeposit = historyIsDeposit(item.type);
8899
+ return /* @__PURE__ */ jsxRuntime.jsxs(
8900
+ ListItem,
8901
+ {
8902
+ onClick,
8903
+ containerClassName: tailwindMerge.twMerge("!rounded-xs !border-0 !min-h-[72px]", className),
8904
+ children: [
8905
+ /* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: isSwap ? /* @__PURE__ */ jsxRuntime.jsx(SwapIconWithBadge, { src: iconUrl, alt: iconAlt }) : /* @__PURE__ */ jsxRuntime.jsx(TokenIconWithBadge2, { src: iconUrl, alt: iconAlt, isDeposit }) }),
8906
+ /* @__PURE__ */ jsxRuntime.jsxs(ListItemContent, { children: [
8907
+ /* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-text-lg-mobile", children: label }),
8908
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx(Label, { variant: "secondary", className: "text-[color:var(--deframe-widget-color-text-tertiary)] dark:text-[color:var(--deframe-widget-color-text-tertiary-dark)]", children: subtitle }),
8909
+ item.status === "PENDING" && statusLabel ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[6px]", children: /* @__PURE__ */ jsxRuntime.jsx(ProcessingBadge, { label: statusLabel, title: statusTitle, size: "compact" }) }) : null
8910
+ ] }),
8911
+ /* @__PURE__ */ jsxRuntime.jsx(ListItemRightSide, { children: /* @__PURE__ */ jsxRuntime.jsx(AmountDisplay, { amount: primary, usdAmount: secondary || void 0 }) })
8912
+ ]
8913
+ }
8914
+ );
8915
+ };
8709
8916
  var SkeletonItem = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full bg-[var(--deframe-widget-color-bg-secondary)] rounded-[var(--deframe-widget-size-radius-xs)] min-h-[72px] flex items-center justify-between px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-sm)]", children: [
8710
8917
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)] flex-1 min-w-0", children: [
8711
8918
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-10 h-10 rounded-xl bg-[var(--deframe-widget-color-bg-tertiary)] animate-pulse flex-shrink-0" }),
@@ -8735,25 +8942,6 @@ var EmptyState = ({ title, description }) => /* @__PURE__ */ jsxRuntime.jsx("div
8735
8942
  ] }),
8736
8943
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "self-stretch text-center", children: /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", children: description }) })
8737
8944
  ] }) });
8738
- var SwapItemIcon = ({ src, alt }) => {
8739
- const fallbackText = encodeURIComponent((alt || "TOK").slice(0, 3).toUpperCase());
8740
- const fallbackSrc = `https://placehold.co/40x40?text=${fallbackText}`;
8741
- const resolvedSrc = src || fallbackSrc;
8742
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-shrink-0", children: [
8743
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-10 h-10 rounded-xl bg-[var(--deframe-widget-color-bg-tertiary)] flex items-center justify-center overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
8744
- "img",
8745
- {
8746
- src: resolvedSrc,
8747
- alt,
8748
- className: "w-full h-full object-cover",
8749
- onError: (e) => {
8750
- e.target.src = fallbackSrc;
8751
- }
8752
- }
8753
- ) }),
8754
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute bottom-[-2px] right-[-2px] w-[15px] h-[15px] rounded-[var(--deframe-widget-size-radius-full)] bg-[var(--deframe-widget-color-bg-secondary)] flex items-center justify-center border border-[var(--deframe-widget-color-bg-secondary)]", children: /* @__PURE__ */ jsxRuntime.jsx(md.MdArrowUpward, { className: "w-3 h-3 text-[var(--deframe-widget-color-text-primary)]" }) })
8755
- ] });
8756
- };
8757
8945
  var SwapHistoryView = ({
8758
8946
  labels,
8759
8947
  isLoading,
@@ -8761,21 +8949,29 @@ var SwapHistoryView = ({
8761
8949
  onItemClick,
8762
8950
  pageSize = 10
8763
8951
  }) => {
8952
+ var _a, _b;
8764
8953
  const [visibleCount, setVisibleCount] = React6__namespace.default.useState(pageSize);
8765
8954
  if (isLoading) {
8766
8955
  return /* @__PURE__ */ jsxRuntime.jsx(BackgroundContainer, { className: "px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)] flex flex-col min-h-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(LoadingSkeleton, {}) });
8767
8956
  }
8768
8957
  if (items.length === 0) {
8769
- return /* @__PURE__ */ jsxRuntime.jsx(BackgroundContainer, { className: "px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)] flex flex-col min-h-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(EmptyState, { title: labels.emptyTitle, description: labels.emptyDescription }) });
8958
+ return /* @__PURE__ */ jsxRuntime.jsx(BackgroundContainer, { className: "px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)] flex flex-col min-h-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
8959
+ EmptyState,
8960
+ {
8961
+ title: (_a = labels == null ? void 0 : labels.emptyTitle) != null ? _a : "Nenhuma transa\xE7\xE3o",
8962
+ description: (_b = labels == null ? void 0 : labels.emptyDescription) != null ? _b : "Quando voc\xEA realizar transa\xE7\xF5es, elas aparecer\xE3o aqui."
8963
+ }
8964
+ ) });
8770
8965
  }
8771
8966
  const visibleItems = items.slice(0, visibleCount);
8772
8967
  const grouped = /* @__PURE__ */ new Map();
8773
8968
  for (const item of visibleItems) {
8774
- const group = grouped.get(item.dateKey);
8969
+ const dateKey = item.createdAt.slice(0, 10);
8970
+ const group = grouped.get(dateKey);
8775
8971
  if (group) {
8776
8972
  group.push(item);
8777
8973
  } else {
8778
- grouped.set(item.dateKey, [item]);
8974
+ grouped.set(dateKey, [item]);
8779
8975
  }
8780
8976
  }
8781
8977
  const sortedDates = Array.from(grouped.keys()).sort((a, b) => b.localeCompare(a));
@@ -8783,32 +8979,325 @@ var SwapHistoryView = ({
8783
8979
  return /* @__PURE__ */ jsxRuntime.jsx(BackgroundContainer, { className: "px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)] flex flex-col min-h-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "self-stretch flex flex-col gap-[16px]", children: [
8784
8980
  sortedDates.map((dateKey) => {
8785
8981
  const groupItems = grouped.get(dateKey);
8982
+ const dateLabel = historyFormatDate(groupItems[0].createdAt);
8786
8983
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "self-stretch flex flex-col gap-[var(--deframe-widget-size-gap-sm)]", children: [
8787
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] text-[color:var(--deframe-widget-color-text-secondary)]", children: groupItems[0].dateLabel }),
8788
- groupItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
8789
- ListItem,
8984
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] text-[color:var(--deframe-widget-color-text-secondary)]", children: dateLabel }),
8985
+ groupItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
8986
+ HistoryListItem,
8790
8987
  {
8791
- onClick: () => onItemClick(item.id),
8792
- containerClassName: "!rounded-[var(--deframe-widget-size-radius-xs)] !border-0 !min-h-[72px]",
8793
- children: [
8794
- /* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsxRuntime.jsx(SwapItemIcon, { src: item.iconUrl, alt: item.iconAlt }) }),
8795
- /* @__PURE__ */ jsxRuntime.jsxs(ListItemContent, { children: [
8796
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "[font-size:var(--deframe-widget-font-size-md)] [line-height:var(--deframe-widget-font-leading-md)] [font-weight:var(--deframe-widget-font-weight-medium)] text-[color:var(--deframe-widget-color-text-primary)]", children: item.title }),
8797
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] text-[color:var(--deframe-widget-color-text-tertiary)]", children: item.subtitle })
8798
- ] }),
8799
- /* @__PURE__ */ jsxRuntime.jsxs(ListItemRightSide, { children: [
8800
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] [font-weight:var(--deframe-widget-font-weight-medium)] text-[color:var(--deframe-widget-color-text-primary)] whitespace-nowrap", children: item.amountFormatted }),
8801
- item.amountUsd && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] text-[color:var(--deframe-widget-color-text-secondary)] whitespace-nowrap", children: item.amountUsd })
8802
- ] })
8803
- ]
8988
+ item,
8989
+ onClick: onItemClick ? () => onItemClick(item.id) : void 0,
8990
+ className: "!rounded-[var(--deframe-widget-size-radius-xs)] !border-0 !min-h-[72px]"
8804
8991
  },
8805
8992
  item.id
8806
8993
  ))
8807
8994
  ] }, dateKey);
8808
8995
  }),
8809
- hasMore && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center pt-[var(--deframe-widget-size-padding-y-sm)]", children: /* @__PURE__ */ jsxRuntime.jsx(TertiaryButton, { onClick: () => setVisibleCount((c) => c + pageSize), children: labels.loadMoreLabel }) })
8996
+ hasMore && (labels == null ? void 0 : labels.loadMoreLabel) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center pt-[var(--deframe-widget-size-padding-y-sm)]", children: /* @__PURE__ */ jsxRuntime.jsx(TertiaryButton, { onClick: () => setVisibleCount((c) => c + pageSize), children: labels.loadMoreLabel }) })
8810
8997
  ] }) });
8811
8998
  };
8999
+ var variantConfig = {
9000
+ SUCCESS: {
9001
+ wrapper: "bg-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_12%,transparent)] border-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_32%,transparent)]",
9002
+ dotClass: "bg-[var(--deframe-widget-color-brand-primary)]",
9003
+ labelClass: "text-[color:var(--deframe-widget-color-brand-primary)]",
9004
+ label: "Aprovado"
9005
+ },
9006
+ PENDING: {
9007
+ wrapper: "bg-[color:color-mix(in_srgb,var(--deframe-widget-color-state-warning)_16%,transparent)] border-[color:color-mix(in_srgb,var(--deframe-widget-color-state-warning)_32%,transparent)]",
9008
+ dotClass: "bg-[var(--deframe-widget-color-state-warning)]",
9009
+ labelClass: "text-[color:var(--deframe-widget-color-state-warning)]",
9010
+ label: "Pendente"
9011
+ },
9012
+ FAILED: {
9013
+ wrapper: "bg-[color:color-mix(in_srgb,var(--deframe-widget-color-state-error)_16%,transparent)] border-[color:color-mix(in_srgb,var(--deframe-widget-color-state-error)_32%,transparent)]",
9014
+ dotClass: "bg-[var(--deframe-widget-color-state-error)]",
9015
+ labelClass: "text-[color:var(--deframe-widget-color-state-error)]",
9016
+ label: "Falhou"
9017
+ },
9018
+ REFUNDED: {
9019
+ wrapper: "bg-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-secondary)_12%,transparent)] border-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-secondary)_32%,transparent)]",
9020
+ dotClass: "bg-[var(--deframe-widget-color-brand-secondary)]",
9021
+ labelClass: "text-[color:var(--deframe-widget-color-brand-secondary)]",
9022
+ label: "Reembolsado"
9023
+ }
9024
+ };
9025
+ function StatusBadge2({ status, className }) {
9026
+ const config = variantConfig[status];
9027
+ return /* @__PURE__ */ jsxRuntime.jsxs(
9028
+ "span",
9029
+ {
9030
+ "data-test-id": "history-status-badge",
9031
+ className: tailwindMerge.twMerge(
9032
+ "inline-flex items-center gap-[5px]",
9033
+ "py-[3px] pr-[10px] pl-[7px]",
9034
+ "rounded-[var(--deframe-widget-size-radius-full)]",
9035
+ "border",
9036
+ config.wrapper,
9037
+ className
9038
+ ),
9039
+ children: [
9040
+ /* @__PURE__ */ jsxRuntime.jsx(
9041
+ "span",
9042
+ {
9043
+ "data-test-id": "history-status-badge-dot",
9044
+ className: tailwindMerge.twMerge(
9045
+ "w-[7px] h-[7px] rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0 inline-block",
9046
+ config.dotClass
9047
+ )
9048
+ }
9049
+ ),
9050
+ /* @__PURE__ */ jsxRuntime.jsx(
9051
+ "span",
9052
+ {
9053
+ "data-test-id": "history-status-badge-label",
9054
+ className: tailwindMerge.twMerge(
9055
+ "text-[11px] [font-weight:var(--deframe-widget-font-weight-medium)] font-[var(--deframe-widget-font-family)]",
9056
+ config.labelClass
9057
+ ),
9058
+ children: config.label
9059
+ }
9060
+ )
9061
+ ]
9062
+ }
9063
+ );
9064
+ }
9065
+ var HistoryListItemSimple = ({ item }) => {
9066
+ const label = historyResolveLabel(item);
9067
+ const { primary, secondary } = historyResolveAmounts(item);
9068
+ const date = historyFormatDate(item.createdAt);
9069
+ return /* @__PURE__ */ jsxRuntime.jsxs(
9070
+ "div",
9071
+ {
9072
+ "data-test-id": "history-list-item-simple",
9073
+ className: tailwindMerge.twMerge(
9074
+ "w-full flex flex-col gap-[6px]",
9075
+ "bg-[var(--deframe-widget-color-bg-secondary)]",
9076
+ "border border-[color:var(--deframe-widget-color-border-secondary)]",
9077
+ "rounded-[var(--deframe-widget-size-radius-sm)]",
9078
+ "px-[var(--deframe-widget-size-padding-x-md)] py-[14px]"
9079
+ ),
9080
+ children: [
9081
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-[var(--deframe-widget-size-gap-sm)]", children: [
9082
+ /* @__PURE__ */ jsxRuntime.jsx(
9083
+ "span",
9084
+ {
9085
+ "data-test-id": "history-list-item-simple-date",
9086
+ className: "text-[12px] text-[color:var(--deframe-widget-color-text-tertiary)] leading-none",
9087
+ children: date
9088
+ }
9089
+ ),
9090
+ /* @__PURE__ */ jsxRuntime.jsx(StatusBadge2, { status: item.status })
9091
+ ] }),
9092
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-[var(--deframe-widget-size-gap-sm)]", children: [
9093
+ /* @__PURE__ */ jsxRuntime.jsx(
9094
+ "span",
9095
+ {
9096
+ "data-test-id": "history-list-item-simple-label",
9097
+ className: tailwindMerge.twMerge(
9098
+ "text-[18px] leading-[1.2]",
9099
+ "[font-weight:var(--deframe-widget-font-weight-bold)]",
9100
+ "text-[color:var(--deframe-widget-color-text-primary)]"
9101
+ ),
9102
+ children: label
9103
+ }
9104
+ ),
9105
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-end gap-[2px] flex-shrink-0", children: [
9106
+ /* @__PURE__ */ jsxRuntime.jsx(
9107
+ "span",
9108
+ {
9109
+ "data-test-id": "history-list-item-simple-primary",
9110
+ className: tailwindMerge.twMerge(
9111
+ "text-[13px] leading-[1.3]",
9112
+ "[font-weight:var(--deframe-widget-font-weight-semibold)]",
9113
+ "text-[color:var(--deframe-widget-color-text-primary)]"
9114
+ ),
9115
+ children: primary
9116
+ }
9117
+ ),
9118
+ secondary && /* @__PURE__ */ jsxRuntime.jsx(
9119
+ "span",
9120
+ {
9121
+ "data-test-id": "history-list-item-simple-secondary",
9122
+ className: "text-[12px] text-[color:var(--deframe-widget-color-text-secondary)] leading-none",
9123
+ children: secondary
9124
+ }
9125
+ )
9126
+ ] })
9127
+ ] })
9128
+ ]
9129
+ }
9130
+ );
9131
+ };
9132
+ var DashboardTransactionsPlaceholder = () => {
9133
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "dashboard-transactions-placeholder", className: "flex flex-col items-center justify-center py-16 gap-4", children: [
9134
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-20 h-20 bg-[var(--deframe-widget-color-bg-muted)] rounded-full flex justify-center items-center", children: /* @__PURE__ */ jsxRuntime.jsx(pi.PiClockCountdownBold, { className: "w-10 h-10 text-[var(--deframe-widget-color-text-tertiary)]" }) }),
9135
+ /* @__PURE__ */ jsxRuntime.jsx(TextHeading, { variant: "h3", children: "Nenhuma transa\xE7\xE3o ainda" }),
9136
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-medium", className: "text-center text-[var(--deframe-widget-color-text-secondary)]", children: "Assim que voc\xEA come\xE7ar a movimentar fundos, seu hist\xF3rico de transa\xE7\xF5es aparecer\xE1 aqui." })
9137
+ ] });
9138
+ };
9139
+ var SwapHistoryViewSimple = ({
9140
+ isLoading,
9141
+ items,
9142
+ onClose,
9143
+ className,
9144
+ title = "Hist\xF3rico de Swap",
9145
+ subtitle = "Todas as transa\xE7\xF5es de swap"
9146
+ }) => {
9147
+ const [query, setQuery] = React6.useState("");
9148
+ const filtered = React6.useMemo(() => {
9149
+ const q = query.trim().toLowerCase();
9150
+ if (!q) return items;
9151
+ return items.filter((item) => historyResolveSearchableText(item).includes(q));
9152
+ }, [items, query]);
9153
+ return /* @__PURE__ */ jsxRuntime.jsxs(
9154
+ "div",
9155
+ {
9156
+ "data-test-id": "swap-history-view-simple",
9157
+ className: tailwindMerge.twMerge(
9158
+ "bg-[var(--deframe-widget-color-bg-secondary)]",
9159
+ "rounded-[var(--deframe-widget-size-radius-md)]",
9160
+ "border border-[color:var(--deframe-widget-color-border-secondary)]",
9161
+ "px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
9162
+ "flex flex-col gap-[var(--deframe-widget-size-gap-md)] h-[calc(100vh-48px)]",
9163
+ "font-[var(--deframe-widget-font-family)]",
9164
+ `w-[${SWAP_SIMPLE_WIDTH}px] max-w-[calc(100%-32px)] shrink-0 box-border`,
9165
+ className
9166
+ ),
9167
+ children: [
9168
+ /* @__PURE__ */ jsxRuntime.jsxs(
9169
+ "div",
9170
+ {
9171
+ "data-test-id": "swap-history-view-simple-header",
9172
+ className: "flex items-start justify-between gap-[var(--deframe-widget-size-gap-sm)]",
9173
+ children: [
9174
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-[4px]", children: [
9175
+ /* @__PURE__ */ jsxRuntime.jsx(
9176
+ "h2",
9177
+ {
9178
+ "data-test-id": "swap-history-view-simple-title",
9179
+ className: tailwindMerge.twMerge(
9180
+ "m-0 text-[20px] leading-[1.25]",
9181
+ "[font-weight:var(--deframe-widget-font-weight-bold)]",
9182
+ "text-[color:var(--deframe-widget-color-text-primary)]"
9183
+ ),
9184
+ children: title
9185
+ }
9186
+ ),
9187
+ /* @__PURE__ */ jsxRuntime.jsx(
9188
+ "p",
9189
+ {
9190
+ "data-test-id": "swap-history-view-simple-subtitle",
9191
+ className: "m-0 text-[13px] text-[color:var(--deframe-widget-color-text-secondary)] leading-[1.4]",
9192
+ children: subtitle
9193
+ }
9194
+ )
9195
+ ] }),
9196
+ /* @__PURE__ */ jsxRuntime.jsx(
9197
+ CloseButton_default,
9198
+ {
9199
+ onClick: onClose,
9200
+ ariaLabel: "Fechar",
9201
+ className: "flex-shrink-0 mt-[-4px]"
9202
+ }
9203
+ )
9204
+ ]
9205
+ }
9206
+ ),
9207
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-px bg-[var(--deframe-widget-color-border-secondary)]" }),
9208
+ /* @__PURE__ */ jsxRuntime.jsxs(
9209
+ "div",
9210
+ {
9211
+ "data-test-id": "swap-history-view-simple-search",
9212
+ className: "relative",
9213
+ children: [
9214
+ /* @__PURE__ */ jsxRuntime.jsx(
9215
+ "input",
9216
+ {
9217
+ "data-test-id": "swap-history-view-simple-search-input",
9218
+ type: "text",
9219
+ value: query,
9220
+ onChange: (e) => setQuery(e.target.value),
9221
+ placeholder: "Buscar por moeda, rede ou status...",
9222
+ "aria-label": "Buscar transa\xE7\xE3o",
9223
+ className: [
9224
+ "w-full box-border h-10",
9225
+ "bg-[var(--deframe-widget-color-bg-tertiary)]",
9226
+ "border border-[color:var(--deframe-widget-color-border-secondary)]",
9227
+ "rounded-[var(--deframe-widget-size-radius-sm)]",
9228
+ "py-0 pr-[var(--deframe-widget-size-padding-x-xl)] pl-[14px]",
9229
+ "text-[14px] text-[color:var(--deframe-widget-color-text-primary)]",
9230
+ "outline-none focus:outline-none",
9231
+ "focus:border-[color:var(--deframe-widget-color-brand-primary)]",
9232
+ "transition-colors duration-150",
9233
+ "font-[var(--deframe-widget-font-family)]",
9234
+ "placeholder:text-[color:var(--deframe-widget-color-text-tertiary)]"
9235
+ ].join(" ")
9236
+ }
9237
+ ),
9238
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-[color:var(--deframe-widget-color-text-tertiary)]", children: /* @__PURE__ */ jsxRuntime.jsxs(
9239
+ "svg",
9240
+ {
9241
+ width: "15",
9242
+ height: "15",
9243
+ viewBox: "0 0 24 24",
9244
+ fill: "none",
9245
+ stroke: "currentColor",
9246
+ strokeWidth: "2",
9247
+ strokeLinecap: "round",
9248
+ "aria-hidden": "true",
9249
+ children: [
9250
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "11", cy: "11", r: "8" }),
9251
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
9252
+ ]
9253
+ }
9254
+ ) })
9255
+ ]
9256
+ }
9257
+ ),
9258
+ /* @__PURE__ */ jsxRuntime.jsx(
9259
+ "div",
9260
+ {
9261
+ "data-test-id": "swap-history-view-simple-list",
9262
+ className: "flex flex-col gap-[var(--deframe-widget-size-gap-sm)] flex-1 min-h-0 overflow-y-auto [&::-webkit-scrollbar]:w-[6px] [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-[color:var(--deframe-widget-color-border-secondary)] [&::-webkit-scrollbar-thumb]:rounded-full",
9263
+ children: isLoading ? [1, 2, 3].map((i) => /* @__PURE__ */ jsxRuntime.jsxs(
9264
+ "div",
9265
+ {
9266
+ className: tailwindMerge.twMerge(
9267
+ "flex flex-col gap-[6px]",
9268
+ "px-[var(--deframe-widget-size-padding-x-md)] py-[14px]",
9269
+ "rounded-[var(--deframe-widget-size-radius-sm)]",
9270
+ "border border-[color:var(--deframe-widget-color-border-secondary)]"
9271
+ ),
9272
+ children: [
9273
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
9274
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: "100px", height: "12px", shimmer: true }),
9275
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: "80px", height: "20px", shimmer: true, className: "rounded-full" })
9276
+ ] }),
9277
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between", children: [
9278
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: "160px", height: "18px", shimmer: true }),
9279
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-end gap-[4px]", children: [
9280
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: "96px", height: "14px", shimmer: true }),
9281
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: "72px", height: "12px", shimmer: true })
9282
+ ] })
9283
+ ] })
9284
+ ]
9285
+ },
9286
+ i
9287
+ )) : items.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(DashboardTransactionsPlaceholder, {}) : filtered.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(
9288
+ "div",
9289
+ {
9290
+ "data-test-id": "swap-history-view-simple-no-results",
9291
+ className: "py-[var(--deframe-widget-size-padding-y-xl)] text-center text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)]",
9292
+ children: "Nenhuma transa\xE7\xE3o encontrada"
9293
+ }
9294
+ ) : filtered.map((item) => /* @__PURE__ */ jsxRuntime.jsx(HistoryListItemSimple, { item }, item.id))
9295
+ }
9296
+ )
9297
+ ]
9298
+ }
9299
+ );
9300
+ };
8812
9301
  var HistorySwapDetailsView = (props) => {
8813
9302
  const { labels, onBack, status } = props;
8814
9303
  if (status === "not-found") {
@@ -8957,13 +9446,6 @@ var ChipGroup = ({
8957
9446
  var ApyRange = ({ children }) => {
8958
9447
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-right justify-center text-text-highlight text-xs font-normal leading-4", children });
8959
9448
  };
8960
- var variantStyles = {
8961
- primary: "text-[color:var(--deframe-widget-color-text-primary)] dark:text-[color:var(--deframe-widget-color-text-primary-dark)] text-text-md",
8962
- secondary: "text-[color:var(--deframe-widget-color-text-secondary)] dark:text-[color:var(--deframe-widget-color-text-secondary-dark)] text-text-sm font-poppins"
8963
- };
8964
- var Label = ({ children, variant = "primary", className }) => {
8965
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: tailwindMerge.twMerge(variantStyles[variant], className), children });
8966
- };
8967
9449
  var HistoryItemSkeleton = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full bg-[var(--deframe-widget-color-bg-subtle)] rounded-xs min-h-[72px] flex items-center justify-between px-md py-sm", children: [
8968
9450
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-sm flex-1 min-w-0", children: [
8969
9451
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-10 h-10 rounded-xl bg-[var(--deframe-widget-color-bg-tertiary)] dark:bg-[var(--deframe-widget-color-bg-tertiary-dark)] animate-pulse flex-shrink-0" }),
@@ -10006,65 +10488,19 @@ var GroupedStrategyListViewSimple = ({
10006
10488
  },
10007
10489
  s.id
10008
10490
  ))
10009
- }
10010
- )
10011
- ] });
10012
- };
10013
- var DateLabel = ({ children }) => {
10014
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-text-sm-mobile font-poppins text-[color:var(--deframe-widget-color-text-secondary)] dark:text-[color:var(--deframe-widget-color-text-secondary-dark)]", children });
10015
- };
10016
- var ArrowBadge = ({ isDeposit }) => {
10017
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute bottom-[-2px] right-[-2px] w-[15px] h-[15px] rounded-full bg-[var(--deframe-widget-color-bg-secondary)] dark:bg-[var(--deframe-widget-color-bg-secondary-dark)] flex items-center justify-center border border-[color:var(--deframe-widget-color-bg-secondary)] dark:border-[color:var(--deframe-widget-color-bg-secondary-dark)]", children: isDeposit ? /* @__PURE__ */ jsxRuntime.jsx(md.MdArrowDownward, { className: "w-3 h-3 text-[color:var(--deframe-widget-color-text-primary)] dark:text-[color:var(--deframe-widget-color-text-primary-dark)]" }) : /* @__PURE__ */ jsxRuntime.jsx(md.MdArrowUpward, { className: "w-3 h-3 text-[color:var(--deframe-widget-color-text-primary)] dark:text-[color:var(--deframe-widget-color-text-primary-dark)]" }) });
10018
- };
10019
- var TokenIconWithBadge2 = ({ src, alt, isDeposit }) => {
10020
- const fallbackText = encodeURIComponent((alt || "TOK").slice(0, 3).toUpperCase());
10021
- const fallbackSrc = `https://placehold.co/40x40?text=${fallbackText}`;
10022
- const resolvedSrc = src || fallbackSrc;
10023
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-shrink-0", children: [
10024
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-10 h-10 rounded-xl bg-[var(--deframe-widget-color-bg-tertiary)] dark:bg-[var(--deframe-widget-color-bg-tertiary-dark)] flex items-center justify-center overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
10025
- "img",
10026
- {
10027
- src: resolvedSrc,
10028
- alt,
10029
- className: "w-full h-full object-cover",
10030
- onError: (e) => {
10031
- e.target.src = fallbackSrc;
10032
- }
10033
- }
10034
- ) }),
10035
- /* @__PURE__ */ jsxRuntime.jsx(ArrowBadge, { isDeposit })
10036
- ] });
10037
- };
10038
- var SwapIconWithBadge = ({ src, alt }) => {
10039
- const fallbackText = encodeURIComponent((alt || "TOK").slice(0, 3).toUpperCase());
10040
- const fallbackSrc = `https://placehold.co/40x40?text=${fallbackText}`;
10041
- const resolvedSrc = src || fallbackSrc;
10042
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-shrink-0", children: [
10043
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-10 h-10 rounded-xl bg-[var(--deframe-widget-color-bg-tertiary)] dark:bg-[var(--deframe-widget-color-bg-tertiary-dark)] flex items-center justify-center overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
10044
- "img",
10045
- {
10046
- src: resolvedSrc,
10047
- alt,
10048
- className: "w-full h-full object-cover",
10049
- onError: (e) => {
10050
- e.target.src = fallbackSrc;
10051
- }
10052
- }
10053
- ) }),
10054
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute bottom-[-2px] right-[-2px] w-[15px] h-[15px] rounded-full bg-[var(--deframe-widget-color-bg-secondary)] dark:bg-[var(--deframe-widget-color-bg-secondary-dark)] flex items-center justify-center border border-[color:var(--deframe-widget-color-bg-secondary)] dark:border-[color:var(--deframe-widget-color-bg-secondary-dark)]", children: /* @__PURE__ */ jsxRuntime.jsx(md.MdArrowUpward, { className: "w-3 h-3 text-[color:var(--deframe-widget-color-text-primary)] dark:text-[color:var(--deframe-widget-color-text-primary-dark)]" }) })
10055
- ] });
10056
- };
10057
- var AmountDisplay = ({ amount, usdAmount }) => {
10058
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10059
- /* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-accent-sm-mobile whitespace-nowrap", children: amount }),
10060
- usdAmount ? /* @__PURE__ */ jsxRuntime.jsx(Label, { variant: "secondary", className: "whitespace-nowrap", children: usdAmount }) : null
10491
+ }
10492
+ )
10061
10493
  ] });
10062
10494
  };
10495
+ var DateLabel = ({ children }) => {
10496
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-text-sm-mobile font-poppins text-[color:var(--deframe-widget-color-text-secondary)] dark:text-[color:var(--deframe-widget-color-text-secondary-dark)]", children });
10497
+ };
10063
10498
  var HistoryListView = ({
10064
10499
  groups,
10065
10500
  showLoadMore,
10066
10501
  onLoadMore,
10067
10502
  loadMoreLabel,
10503
+ onItemClick,
10068
10504
  itemClassName
10069
10505
  }) => {
10070
10506
  if (groups.length === 0) {
@@ -10073,34 +10509,12 @@ var HistoryListView = ({
10073
10509
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "self-stretch flex flex-col gap-[16px]", children: [
10074
10510
  groups.map((group) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "self-stretch flex flex-col gap-sm", children: [
10075
10511
  /* @__PURE__ */ jsxRuntime.jsx(DateLabel, { children: group.dateLabel }),
10076
- group.items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
10077
- ListItem,
10512
+ group.items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
10513
+ HistoryListItem,
10078
10514
  {
10079
- onClick: () => item.onClick(),
10080
- containerClassName: tailwindMerge.twMerge("!rounded-xs !border-0 !min-h-[72px]", itemClassName),
10081
- children: [
10082
- /* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: item.isSwap ? /* @__PURE__ */ jsxRuntime.jsx(SwapIconWithBadge, { src: item.iconUrl, alt: item.iconAlt }) : /* @__PURE__ */ jsxRuntime.jsx(
10083
- TokenIconWithBadge2,
10084
- {
10085
- src: item.iconUrl,
10086
- alt: item.iconAlt,
10087
- isDeposit: item.isDeposit
10088
- }
10089
- ) }),
10090
- /* @__PURE__ */ jsxRuntime.jsxs(ListItemContent, { children: [
10091
- /* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-text-lg-mobile", children: item.title }),
10092
- /* @__PURE__ */ jsxRuntime.jsx(Label, { variant: "secondary", className: "text-[color:var(--deframe-widget-color-text-tertiary)] dark:text-[color:var(--deframe-widget-color-text-tertiary-dark)]", children: item.subtitle }),
10093
- item.status === "PENDING" && item.statusLabel ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[6px]", children: /* @__PURE__ */ jsxRuntime.jsx(
10094
- ProcessingBadge,
10095
- {
10096
- label: item.statusLabel,
10097
- title: item.statusTitle,
10098
- size: "compact"
10099
- }
10100
- ) }) : null
10101
- ] }),
10102
- /* @__PURE__ */ jsxRuntime.jsx(ListItemRightSide, { children: /* @__PURE__ */ jsxRuntime.jsx(AmountDisplay, { amount: item.amountFormatted, usdAmount: item.amountUsd }) })
10103
- ]
10515
+ item,
10516
+ onClick: onItemClick ? () => onItemClick(item.id) : void 0,
10517
+ className: itemClassName
10104
10518
  },
10105
10519
  item.id
10106
10520
  ))
@@ -10693,21 +11107,33 @@ var EarnNoBalanceNotificationView = ({
10693
11107
  prompt,
10694
11108
  actionLabel,
10695
11109
  onAction
10696
- }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-[var(--deframe-widget-size-padding-x-md)] mt-[var(--deframe-widget-size-gap-md)]", children: /* @__PURE__ */ jsxRuntime.jsx(SectionCard, { className: "bg-[var(--deframe-widget-color-state-warning)]/10 border border-[var(--deframe-widget-color-state-warning)]/20", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-[var(--deframe-widget-size-gap-sm)]", children: [
10697
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-[var(--deframe-widget-size-gap-sm)]", children: [
10698
- /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-5 h-5 text-[color:var(--deframe-widget-color-state-warning)] flex-shrink-0 mt-0.5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }),
10699
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-primary)]", children: prompt }) })
10700
- ] }),
10701
- /* @__PURE__ */ jsxRuntime.jsx(
10702
- PrimaryButton,
10703
- {
10704
- type: "button",
10705
- onClick: onAction,
10706
- className: "w-full mt-[var(--deframe-widget-size-gap-sm)]",
10707
- children: actionLabel
10708
- }
10709
- )
10710
- ] }) }) });
11110
+ }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[var(--deframe-widget-size-gap-md)]", children: /* @__PURE__ */ jsxRuntime.jsxs(
11111
+ "div",
11112
+ {
11113
+ "data-test-id": "earn-no-balance-notification",
11114
+ className: [
11115
+ "bg-[color-mix(in_srgb,var(--deframe-widget-color-state-warning)_16%,transparent)]",
11116
+ "border border-[var(--deframe-widget-color-state-warning)]",
11117
+ "rounded-[var(--deframe-widget-size-radius-sm)]",
11118
+ "px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
11119
+ "flex flex-col gap-[var(--deframe-widget-size-gap-md)]"
11120
+ ].join(" "),
11121
+ children: [
11122
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-[var(--deframe-widget-size-gap-sm)]", children: [
11123
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-5 h-5 text-[color:var(--deframe-widget-color-state-warning)] flex-shrink-0 mt-0.5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }),
11124
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", children: prompt }) })
11125
+ ] }),
11126
+ /* @__PURE__ */ jsxRuntime.jsx(
11127
+ PrimaryButton,
11128
+ {
11129
+ type: "button",
11130
+ onClick: onAction,
11131
+ children: actionLabel
11132
+ }
11133
+ )
11134
+ ]
11135
+ }
11136
+ ) });
10711
11137
  var EarnTxStatusCardView = ({
10712
11138
  statusLabel,
10713
11139
  isProcessing,
@@ -11282,6 +11708,7 @@ var EarnDepositFormViewSimple = ({
11282
11708
  // Header / Layout
11283
11709
  pageTitle,
11284
11710
  onBack,
11711
+ onHistoryClick,
11285
11712
  onSubmit,
11286
11713
  // Token selector
11287
11714
  selectedToken,
@@ -11314,6 +11741,8 @@ var EarnDepositFormViewSimple = ({
11314
11741
  isTxError,
11315
11742
  txSuccessMessage,
11316
11743
  txErrorMessage,
11744
+ // Insufficient balance
11745
+ insufficientBalanceMessage,
11317
11746
  // Bytecode error
11318
11747
  bytecodeErrorMessage,
11319
11748
  // Submit button
@@ -11321,7 +11750,7 @@ var EarnDepositFormViewSimple = ({
11321
11750
  submitButtonText
11322
11751
  }) => {
11323
11752
  const hasToken = selectedToken != null;
11324
- const hasError = !!bytecodeErrorMessage;
11753
+ const hasError = !!insufficientBalanceMessage || !!bytecodeErrorMessage;
11325
11754
  const isSubmitDisabled = !hasToken || submitDisabled || !amountValue || amountValue === "0" || amountValue === "";
11326
11755
  const [cardHovered, setCardHovered] = React6__namespace.default.useState(false);
11327
11756
  const hideTimerRef = React6__namespace.default.useRef(void 0);
@@ -11376,21 +11805,24 @@ var EarnDepositFormViewSimple = ({
11376
11805
  "data-test-id": "earn-deposit-form-view-simple",
11377
11806
  className: panelBaseClasses,
11378
11807
  children: [
11379
- /* @__PURE__ */ jsxRuntime.jsx(
11808
+ /* @__PURE__ */ jsxRuntime.jsxs(
11380
11809
  "header",
11381
11810
  {
11382
11811
  "data-slot": "deposit-panel-simple-header",
11383
11812
  "data-test-id": "earn-deposit-form-view-simple-header",
11384
11813
  className: headerBaseClasses,
11385
- children: /* @__PURE__ */ jsxRuntime.jsx(
11386
- "span",
11387
- {
11388
- "data-slot": "deposit-panel-simple-title",
11389
- "data-test-id": "earn-deposit-form-view-simple-title",
11390
- className: titleBaseClasses,
11391
- children: pageTitle
11392
- }
11393
- )
11814
+ children: [
11815
+ /* @__PURE__ */ jsxRuntime.jsx(
11816
+ "span",
11817
+ {
11818
+ "data-slot": "deposit-panel-simple-title",
11819
+ "data-test-id": "earn-deposit-form-view-simple-title",
11820
+ className: titleBaseClasses,
11821
+ children: pageTitle
11822
+ }
11823
+ ),
11824
+ onHistoryClick && /* @__PURE__ */ jsxRuntime.jsx(HistoryButton2, { onClick: onHistoryClick })
11825
+ ]
11394
11826
  }
11395
11827
  ),
11396
11828
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -11482,7 +11914,21 @@ var EarnDepositFormViewSimple = ({
11482
11914
  children: selectTokenLabel
11483
11915
  }
11484
11916
  ),
11485
- /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: hasToken && cardHovered && /* @__PURE__ */ jsxRuntime.jsx(
11917
+ hasError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsxRuntime.jsx(
11918
+ EarnInlineNotificationSimpleView,
11919
+ {
11920
+ variant: "error",
11921
+ message: insufficientBalanceMessage || bytecodeErrorMessage
11922
+ }
11923
+ ) }),
11924
+ showNoBalanceNotification ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsxRuntime.jsx(
11925
+ EarnNoBalanceNotificationView,
11926
+ {
11927
+ prompt: noBalancePrompt,
11928
+ actionLabel: goToSwapLabel,
11929
+ onAction: onGoToSwap
11930
+ }
11931
+ ) }) : /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: hasToken && cardHovered && /* @__PURE__ */ jsxRuntime.jsx(
11486
11932
  framerMotion.motion.div,
11487
11933
  {
11488
11934
  "data-slot": "deposit-simple-chips-row",
@@ -11502,21 +11948,6 @@ var EarnDepositFormViewSimple = ({
11502
11948
  }
11503
11949
  )
11504
11950
  }
11505
- ) }),
11506
- showNoBalanceNotification && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsxRuntime.jsx(
11507
- EarnNoBalanceNotificationView,
11508
- {
11509
- prompt: noBalancePrompt,
11510
- actionLabel: goToSwapLabel,
11511
- onAction: onGoToSwap
11512
- }
11513
- ) }),
11514
- bytecodeErrorMessage && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsxRuntime.jsx(
11515
- EarnInlineNotificationSimpleView,
11516
- {
11517
- variant: "error",
11518
- message: bytecodeErrorMessage
11519
- }
11520
11951
  ) })
11521
11952
  ]
11522
11953
  }
@@ -11596,6 +12027,31 @@ var EarnDepositFormViewSimple = ({
11596
12027
  }
11597
12028
  );
11598
12029
  };
12030
+ function HistoryButton2({ onClick }) {
12031
+ return /* @__PURE__ */ jsxRuntime.jsx(
12032
+ "button",
12033
+ {
12034
+ "data-test-id": "earn-deposit-form-simple-history-button",
12035
+ type: "button",
12036
+ onClick,
12037
+ "aria-label": "Hist\xF3rico de transa\xE7\xF5es",
12038
+ className: tailwindMerge.twMerge(
12039
+ "inline-flex items-center justify-center",
12040
+ "w-9 h-9",
12041
+ "rounded-[var(--deframe-widget-size-radius-sm)]",
12042
+ "border-none cursor-pointer bg-transparent",
12043
+ "hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_92%,transparent)]",
12044
+ "transition-[background] duration-150",
12045
+ "flex-shrink-0 outline-none",
12046
+ "text-[color:var(--deframe-widget-color-text-secondary)]"
12047
+ ),
12048
+ children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 24 24", width: "20", height: "20", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
12049
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
12050
+ /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "12 6 12 12 16 14" })
12051
+ ] })
12052
+ }
12053
+ );
12054
+ }
11599
12055
  var EarnWithdrawFormView = ({
11600
12056
  // Header / Layout
11601
12057
  headerTitle,
@@ -11745,6 +12201,7 @@ var EarnWithdrawFormViewSimple = ({
11745
12201
  // Header / Layout
11746
12202
  pageTitle,
11747
12203
  onBack,
12204
+ onHistoryClick,
11748
12205
  onSubmit,
11749
12206
  // Position card (used for inline balance row)
11750
12207
  positionBalanceToken,
@@ -11772,6 +12229,8 @@ var EarnWithdrawFormViewSimple = ({
11772
12229
  isTxError,
11773
12230
  txSuccessMessage,
11774
12231
  txErrorMessage,
12232
+ // Insufficient balance
12233
+ insufficientBalanceMessage,
11775
12234
  // Bytecode error
11776
12235
  bytecodeErrorMessage,
11777
12236
  // Submit button
@@ -11779,7 +12238,7 @@ var EarnWithdrawFormViewSimple = ({
11779
12238
  submitButtonText
11780
12239
  }) => {
11781
12240
  const hasToken = selectedToken != null;
11782
- const hasError = !!bytecodeErrorMessage;
12241
+ const hasError = !!insufficientBalanceMessage || !!bytecodeErrorMessage;
11783
12242
  const isSubmitDisabled = !hasToken || submitDisabled || !amountValue || amountValue === "0" || amountValue === "";
11784
12243
  const [cardHovered, setCardHovered] = React6__namespace.default.useState(false);
11785
12244
  const hideTimerRef = React6__namespace.default.useRef(void 0);
@@ -11834,21 +12293,24 @@ var EarnWithdrawFormViewSimple = ({
11834
12293
  "data-test-id": "earn-withdraw-form-view-simple",
11835
12294
  className: panelBaseClasses,
11836
12295
  children: [
11837
- /* @__PURE__ */ jsxRuntime.jsx(
12296
+ /* @__PURE__ */ jsxRuntime.jsxs(
11838
12297
  "header",
11839
12298
  {
11840
12299
  "data-slot": "withdraw-panel-simple-header",
11841
12300
  "data-test-id": "earn-withdraw-form-view-simple-header",
11842
12301
  className: headerBaseClasses,
11843
- children: /* @__PURE__ */ jsxRuntime.jsx(
11844
- "span",
11845
- {
11846
- "data-slot": "withdraw-panel-simple-title",
11847
- "data-test-id": "earn-withdraw-form-view-simple-title",
11848
- className: titleBaseClasses,
11849
- children: pageTitle
11850
- }
11851
- )
12302
+ children: [
12303
+ /* @__PURE__ */ jsxRuntime.jsx(
12304
+ "span",
12305
+ {
12306
+ "data-slot": "withdraw-panel-simple-title",
12307
+ "data-test-id": "earn-withdraw-form-view-simple-title",
12308
+ className: titleBaseClasses,
12309
+ children: pageTitle
12310
+ }
12311
+ ),
12312
+ onHistoryClick && /* @__PURE__ */ jsxRuntime.jsx(HistoryButton3, { onClick: onHistoryClick })
12313
+ ]
11852
12314
  }
11853
12315
  ),
11854
12316
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -11958,11 +12420,11 @@ var EarnWithdrawFormViewSimple = ({
11958
12420
  )
11959
12421
  }
11960
12422
  ) }),
11961
- bytecodeErrorMessage && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsxRuntime.jsx(
12423
+ hasError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsxRuntime.jsx(
11962
12424
  EarnInlineNotificationSimpleView,
11963
12425
  {
11964
12426
  variant: "error",
11965
- message: bytecodeErrorMessage
12427
+ message: insufficientBalanceMessage || bytecodeErrorMessage
11966
12428
  }
11967
12429
  ) })
11968
12430
  ]
@@ -12043,6 +12505,31 @@ var EarnWithdrawFormViewSimple = ({
12043
12505
  }
12044
12506
  );
12045
12507
  };
12508
+ function HistoryButton3({ onClick }) {
12509
+ return /* @__PURE__ */ jsxRuntime.jsx(
12510
+ "button",
12511
+ {
12512
+ "data-test-id": "earn-withdraw-form-simple-history-button",
12513
+ type: "button",
12514
+ onClick,
12515
+ "aria-label": "Hist\xF3rico de transa\xE7\xF5es",
12516
+ className: tailwindMerge.twMerge(
12517
+ "inline-flex items-center justify-center",
12518
+ "w-9 h-9",
12519
+ "rounded-[var(--deframe-widget-size-radius-sm)]",
12520
+ "border-none cursor-pointer bg-transparent",
12521
+ "hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_92%,transparent)]",
12522
+ "transition-[background] duration-150",
12523
+ "flex-shrink-0 outline-none",
12524
+ "text-[color:var(--deframe-widget-color-text-secondary)]"
12525
+ ),
12526
+ children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 24 24", width: "20", height: "20", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
12527
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
12528
+ /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "12 6 12 12 16 14" })
12529
+ ] })
12530
+ }
12531
+ );
12532
+ }
12046
12533
  var EarnDepositProcessingView = ({
12047
12534
  progress,
12048
12535
  title,
@@ -17213,13 +17700,6 @@ var OfframpFailedSimpleView = () => {
17213
17700
  var DashboardCard = ({ children, className }) => {
17214
17701
  return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "dashboard-card", className: tailwindMerge.twMerge("bg-[var(--deframe-widget-color-bg-subtle)] rounded", className), children });
17215
17702
  };
17216
- var DashboardTransactionsPlaceholder = () => {
17217
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "dashboard-transactions-placeholder", className: "flex flex-col items-center justify-center py-16 gap-4", children: [
17218
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-20 h-20 bg-[var(--deframe-widget-color-bg-muted)] rounded-full flex justify-center items-center", children: /* @__PURE__ */ jsxRuntime.jsx(pi.PiClockCountdownBold, { className: "w-10 h-10 text-[var(--deframe-widget-color-text-tertiary)]" }) }),
17219
- /* @__PURE__ */ jsxRuntime.jsx(TextHeading, { variant: "h3", children: "Nenhuma transa\xE7\xE3o ainda" }),
17220
- /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-medium", className: "text-center text-[var(--deframe-widget-color-text-secondary)]", children: "Assim que voc\xEA come\xE7ar a movimentar fundos, seu hist\xF3rico de transa\xE7\xF5es aparecer\xE1 aqui." })
17221
- ] });
17222
- };
17223
17703
  var DashboardBalancesBreakdown = ({
17224
17704
  isLoadingBalances,
17225
17705
  formattedTokenPositions,
@@ -17672,7 +18152,7 @@ var DUST_THRESHOLD_USD = 0.01;
17672
18152
  function isDustValue(amountInUSD) {
17673
18153
  return isNaN(amountInUSD) || amountInUSD < DUST_THRESHOLD_USD;
17674
18154
  }
17675
- function HistoryButton2({ onClick }) {
18155
+ function HistoryButton4({ onClick }) {
17676
18156
  return /* @__PURE__ */ jsxRuntime.jsx(
17677
18157
  "button",
17678
18158
  {
@@ -17923,7 +18403,7 @@ var DashboardTokensViewSimple = ({
17923
18403
  children: "Seus ativos"
17924
18404
  }
17925
18405
  ),
17926
- onHistoryClick != null && /* @__PURE__ */ jsxRuntime.jsx(HistoryButton2, { onClick: onHistoryClick })
18406
+ onHistoryClick != null && /* @__PURE__ */ jsxRuntime.jsx(HistoryButton4, { onClick: onHistoryClick })
17927
18407
  ]
17928
18408
  }
17929
18409
  ),
@@ -18030,12 +18510,13 @@ var DashboardRecentTransactionsView = ({
18030
18510
  isLoading,
18031
18511
  isEmpty,
18032
18512
  transactions,
18033
- onViewAllClick
18513
+ onViewAllClick,
18514
+ onItemClick
18034
18515
  }) => {
18035
18516
  return /* @__PURE__ */ jsxRuntime.jsx(DashboardCard, { className: "p-6 bg-[var(--deframe-widget-color-bg-subtle)]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
18036
18517
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-start", children: [
18037
18518
  /* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "mb-6", children: "Transa\xE7\xF5es recentes" }),
18038
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onViewAllClick, children: /* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "text-[var(--deframe-widget-color-brand-primary)] cursor-pointer hover:underline", children: "Ver todas" }) })
18519
+ onViewAllClick && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onViewAllClick, children: /* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "text-[var(--deframe-widget-color-brand-primary)] cursor-pointer hover:underline", children: "Ver todas" }) })
18039
18520
  ] }),
18040
18521
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2 mt-[-16px]", children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 p-2", children: [
18041
18522
  /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { variant: "circle", width: "40px", height: "40px", shimmer: true }),
@@ -18044,106 +18525,17 @@ var DashboardRecentTransactionsView = ({
18044
18525
  /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: "220px", height: "12px", shimmer: true })
18045
18526
  ] }),
18046
18527
  /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: "96px", height: "14px", shimmer: true })
18047
- ] }, i)) }) : isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(DashboardTransactionsPlaceholder, {}) : transactions.map((item) => {
18048
- const MainIcon = item.mainIcon;
18049
- const TypeIcon = item.typeIcon;
18050
- return /* @__PURE__ */ jsxRuntime.jsxs(
18051
- ListItem,
18052
- {
18053
- containerClassName: "p-2 mt-4 bg-[var(--deframe-widget-color-bg-raised)] cursor-pointer",
18054
- onClick: () => item.onClick(),
18055
- children: [
18056
- /* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
18057
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-10 h-10 rounded-full ${item.iconBgColor} flex items-center justify-center`, children: /* @__PURE__ */ jsxRuntime.jsx(MainIcon, { className: `${item.iconColor}`, size: 20 }) }),
18058
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute -bottom-1 -right-1 w-5 h-5 rounded-full flex items-center justify-center border border-[var(--deframe-widget-color-border-secondary)]", children: /* @__PURE__ */ jsxRuntime.jsx(TypeIcon, { className: `${item.iconColor}`, size: 12 }) })
18059
- ] }) }),
18060
- /* @__PURE__ */ jsxRuntime.jsxs(ListItemContent, { className: "ml-4", children: [
18061
- /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", children: item.formattedDate }),
18062
- /* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "text-xs text-[var(--deframe-widget-color-text-secondary)]", children: item.label })
18063
- ] }),
18064
- /* @__PURE__ */ jsxRuntime.jsxs(ListItemRightSide, { className: "text-right", children: [
18065
- /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", children: item.rightPrimary }),
18066
- /* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "text-xs text-[var(--deframe-widget-color-text-secondary)]", children: item.rightSecondary })
18067
- ] })
18068
- ]
18069
- },
18070
- item.id
18071
- );
18072
- }) })
18528
+ ] }, i)) }) : isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(DashboardTransactionsPlaceholder, {}) : transactions.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
18529
+ HistoryListItem,
18530
+ {
18531
+ item,
18532
+ onClick: onItemClick ? () => onItemClick(item.id) : void 0,
18533
+ className: "p-2 mt-4 bg-[var(--deframe-widget-color-bg-raised)] cursor-pointer"
18534
+ },
18535
+ item.id
18536
+ )) })
18073
18537
  ] }) });
18074
18538
  };
18075
- var variantConfig = {
18076
- pending: {
18077
- wrapper: "bg-[color:color-mix(in_srgb,var(--deframe-widget-color-state-warning)_16%,transparent)] border-[color:color-mix(in_srgb,var(--deframe-widget-color-state-warning)_32%,transparent)]",
18078
- dotClass: "bg-[var(--deframe-widget-color-state-warning)]",
18079
- labelClass: "text-[color:var(--deframe-widget-color-state-warning)]",
18080
- label: "Pendente"
18081
- },
18082
- confirmed: {
18083
- wrapper: "bg-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_12%,transparent)] border-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_32%,transparent)]",
18084
- dotClass: "bg-[var(--deframe-widget-color-brand-primary)]",
18085
- labelClass: "text-[color:var(--deframe-widget-color-brand-primary)]",
18086
- label: "Confirmado"
18087
- },
18088
- approved: {
18089
- wrapper: "bg-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_12%,transparent)] border-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_32%,transparent)]",
18090
- dotClass: "bg-[var(--deframe-widget-color-brand-primary)]",
18091
- labelClass: "text-[color:var(--deframe-widget-color-brand-primary)]",
18092
- label: "Aprovada"
18093
- },
18094
- failed: {
18095
- wrapper: "bg-[color:color-mix(in_srgb,var(--deframe-widget-color-state-error)_16%,transparent)] border-[color:color-mix(in_srgb,var(--deframe-widget-color-state-error)_32%,transparent)]",
18096
- dotClass: "bg-[var(--deframe-widget-color-state-error)]",
18097
- labelClass: "text-[color:var(--deframe-widget-color-state-error)]",
18098
- label: "Falhou"
18099
- },
18100
- processing: {
18101
- wrapper: "bg-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-secondary)_12%,transparent)] border-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-secondary)_32%,transparent)]",
18102
- dotClass: "bg-[var(--deframe-widget-color-brand-secondary)]",
18103
- labelClass: "text-[color:var(--deframe-widget-color-brand-secondary)]",
18104
- label: "Processando"
18105
- }
18106
- };
18107
- function StatusBadge2({ status, label, className }) {
18108
- const config = variantConfig[status];
18109
- return /* @__PURE__ */ jsxRuntime.jsxs(
18110
- "span",
18111
- {
18112
- "data-test-id": "status-badge",
18113
- className: tailwindMerge.twMerge(
18114
- "inline-flex items-center gap-[5px]",
18115
- "py-[3px] pr-[10px] pl-[7px]",
18116
- "rounded-[var(--deframe-widget-size-radius-full)]",
18117
- "border",
18118
- config.wrapper,
18119
- className
18120
- ),
18121
- children: [
18122
- /* @__PURE__ */ jsxRuntime.jsx(
18123
- "span",
18124
- {
18125
- "data-test-id": "status-badge-dot",
18126
- className: tailwindMerge.twMerge(
18127
- "w-[7px] h-[7px] rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0 inline-block",
18128
- config.dotClass
18129
- )
18130
- }
18131
- ),
18132
- /* @__PURE__ */ jsxRuntime.jsx(
18133
- "span",
18134
- {
18135
- "data-test-id": "status-badge-label",
18136
- className: tailwindMerge.twMerge(
18137
- "text-[11px] [font-weight:var(--deframe-widget-font-weight-medium)] font-[var(--deframe-widget-font-family)]",
18138
- config.labelClass
18139
- ),
18140
- children: label != null ? label : config.label
18141
- }
18142
- )
18143
- ]
18144
- }
18145
- );
18146
- }
18147
18539
  var DashboardRecentTransactionsViewSimple = ({
18148
18540
  isLoading,
18149
18541
  isEmpty,
@@ -18154,9 +18546,7 @@ var DashboardRecentTransactionsViewSimple = ({
18154
18546
  const filtered = React6.useMemo(() => {
18155
18547
  const q = query.trim().toLowerCase();
18156
18548
  if (!q) return transactions;
18157
- return transactions.filter(
18158
- (tx) => tx.label.toLowerCase().includes(q) || tx.formattedDate.toLowerCase().includes(q) || tx.rightPrimary.toLowerCase().includes(q) || tx.rightSecondary.toLowerCase().includes(q)
18159
- );
18549
+ return transactions.filter((item) => historyResolveSearchableText(item).includes(q));
18160
18550
  }, [transactions, query]);
18161
18551
  return /* @__PURE__ */ jsxRuntime.jsxs(
18162
18552
  "div",
@@ -18167,7 +18557,7 @@ var DashboardRecentTransactionsViewSimple = ({
18167
18557
  "rounded-[var(--deframe-widget-size-radius-md)]",
18168
18558
  "border border-[color:var(--deframe-widget-color-border-secondary)]",
18169
18559
  "px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
18170
- "flex flex-col gap-[var(--deframe-widget-size-gap-md)] w-full",
18560
+ "flex flex-col gap-[var(--deframe-widget-size-gap-md)] w-full h-[calc(100vh-48px)]",
18171
18561
  "font-[var(--deframe-widget-font-family)]"
18172
18562
  ),
18173
18563
  children: [
@@ -18265,7 +18655,7 @@ var DashboardRecentTransactionsViewSimple = ({
18265
18655
  "div",
18266
18656
  {
18267
18657
  "data-test-id": "dashboard-recent-transactions-simple-list",
18268
- className: "flex flex-col gap-[var(--deframe-widget-size-gap-sm)]",
18658
+ className: "flex flex-col gap-[var(--deframe-widget-size-gap-sm)] flex-1 min-h-0 overflow-y-auto [&::-webkit-scrollbar]:w-[6px] [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-[color:var(--deframe-widget-color-border-secondary)] [&::-webkit-scrollbar-thumb]:rounded-full",
18269
18659
  children: isLoading ? [1, 2, 3].map((i) => /* @__PURE__ */ jsxRuntime.jsxs(
18270
18660
  "div",
18271
18661
  {
@@ -18297,69 +18687,7 @@ var DashboardRecentTransactionsViewSimple = ({
18297
18687
  className: "py-[var(--deframe-widget-size-padding-y-xl)] text-center text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)]",
18298
18688
  children: "Nenhuma transa\xE7\xE3o encontrada"
18299
18689
  }
18300
- ) : filtered.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
18301
- "div",
18302
- {
18303
- "data-test-id": "dashboard-recent-transactions-simple-item",
18304
- className: tailwindMerge.twMerge(
18305
- "w-full flex flex-col gap-[6px]",
18306
- "bg-[var(--deframe-widget-color-bg-secondary)]",
18307
- "border border-[color:var(--deframe-widget-color-border-secondary)]",
18308
- "rounded-[var(--deframe-widget-size-radius-sm)]",
18309
- "px-[var(--deframe-widget-size-padding-x-md)] py-[14px]"
18310
- ),
18311
- children: [
18312
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-[var(--deframe-widget-size-gap-sm)]", children: [
18313
- /* @__PURE__ */ jsxRuntime.jsx(
18314
- "span",
18315
- {
18316
- "data-test-id": "dashboard-recent-transactions-simple-item-date",
18317
- className: "text-[12px] text-[color:var(--deframe-widget-color-text-tertiary)] leading-none",
18318
- children: item.formattedDate
18319
- }
18320
- ),
18321
- /* @__PURE__ */ jsxRuntime.jsx(StatusBadge2, { status: "approved" })
18322
- ] }),
18323
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-[var(--deframe-widget-size-gap-sm)]", children: [
18324
- /* @__PURE__ */ jsxRuntime.jsx(
18325
- "span",
18326
- {
18327
- "data-test-id": "dashboard-recent-transactions-simple-item-label",
18328
- className: tailwindMerge.twMerge(
18329
- "text-[18px] leading-[1.2]",
18330
- "[font-weight:var(--deframe-widget-font-weight-bold)]",
18331
- "text-[color:var(--deframe-widget-color-text-primary)]"
18332
- ),
18333
- children: item.label
18334
- }
18335
- ),
18336
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-end gap-[2px] flex-shrink-0", children: [
18337
- /* @__PURE__ */ jsxRuntime.jsx(
18338
- "span",
18339
- {
18340
- "data-test-id": "dashboard-recent-transactions-simple-item-primary",
18341
- className: tailwindMerge.twMerge(
18342
- "text-[13px] leading-[1.3]",
18343
- "[font-weight:var(--deframe-widget-font-weight-semibold)]",
18344
- "text-[color:var(--deframe-widget-color-text-primary)]"
18345
- ),
18346
- children: item.rightPrimary
18347
- }
18348
- ),
18349
- item.rightSecondary && /* @__PURE__ */ jsxRuntime.jsx(
18350
- "span",
18351
- {
18352
- "data-test-id": "dashboard-recent-transactions-simple-item-secondary",
18353
- className: "text-[12px] text-[color:var(--deframe-widget-color-text-secondary)] leading-none",
18354
- children: item.rightSecondary
18355
- }
18356
- )
18357
- ] })
18358
- ] })
18359
- ]
18360
- },
18361
- item.id
18362
- ))
18690
+ ) : filtered.map((item) => /* @__PURE__ */ jsxRuntime.jsx(HistoryListItemSimple, { item }, item.id))
18363
18691
  }
18364
18692
  )
18365
18693
  ]
@@ -18577,6 +18905,8 @@ exports.FlexRow = FlexRow;
18577
18905
  exports.GroupedStrategyListView = GroupedStrategyListView;
18578
18906
  exports.HighRiskBadge = HighRiskBadge;
18579
18907
  exports.HistoryDepositDetailsView = HistoryDepositDetailsView;
18908
+ exports.HistoryListItem = HistoryListItem;
18909
+ exports.HistoryListItemSimple = HistoryListItemSimple;
18580
18910
  exports.HistoryListSkeleton = HistoryListSkeleton;
18581
18911
  exports.HistoryListView = HistoryListView;
18582
18912
  exports.HistorySwapDetailsView = HistorySwapDetailsView;
@@ -18682,6 +19012,7 @@ exports.SwapFormViewSimple = SwapFormViewSimple;
18682
19012
  exports.SwapFromCardView = SwapFromCardView;
18683
19013
  exports.SwapFromCardViewSimple = SwapFromCardViewSimple;
18684
19014
  exports.SwapHistoryView = SwapHistoryView;
19015
+ exports.SwapHistoryViewSimple = SwapHistoryViewSimple;
18685
19016
  exports.SwapProcessingView = SwapProcessingView;
18686
19017
  exports.SwapProcessingViewSimple = SwapProcessingViewSimple;
18687
19018
  exports.SwapQuoteDetailsView = SwapQuoteDetailsView;