@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.mjs CHANGED
@@ -8682,6 +8682,213 @@ function ChooseNetworkAndAssetViewSimple({
8682
8682
  );
8683
8683
  }
8684
8684
  }
8685
+
8686
+ // src/types/history-list-item-data.ts
8687
+ function isAssetAmount(asset) {
8688
+ return "symbol" in asset;
8689
+ }
8690
+ function isFiatAmount(asset) {
8691
+ return "currency" in asset;
8692
+ }
8693
+
8694
+ // src/utils/history-item-display.ts
8695
+ function getAssetSymbol(asset) {
8696
+ if (!asset) return "\u2014";
8697
+ if (isAssetAmount(asset)) return asset.symbol;
8698
+ if (isFiatAmount(asset)) return asset.currency;
8699
+ return "\u2014";
8700
+ }
8701
+ function getChainName(asset) {
8702
+ var _a, _b;
8703
+ if (!asset) return "";
8704
+ if (isAssetAmount(asset)) return (_b = (_a = asset.chain) == null ? void 0 : _a.name) != null ? _b : "";
8705
+ return "";
8706
+ }
8707
+ function historyResolveLabel(item) {
8708
+ var _a, _b;
8709
+ const assetIn = (_a = item.amounts) == null ? void 0 : _a.assetIn;
8710
+ const assetOut = (_b = item.amounts) == null ? void 0 : _b.assetOut;
8711
+ const fromSymbol = getAssetSymbol(assetIn);
8712
+ const toSymbol = getAssetSymbol(assetOut);
8713
+ const fromChain = getChainName(assetIn);
8714
+ const toChain = getChainName(assetOut);
8715
+ const labelMap = {
8716
+ SAMECHAIN_SWAP: () => `Swap ${fromSymbol} \u2192 ${toSymbol}`,
8717
+ CROSSCHAIN_SWAP: () => {
8718
+ const route = fromChain && toChain ? ` (${fromChain} \u2192 ${toChain})` : "";
8719
+ return `Swap ${fromSymbol} \u2192 ${toSymbol}${route}`;
8720
+ },
8721
+ TRANSFER_IN: () => `Recebimento ${toSymbol}`,
8722
+ TRANSFER_OUT: () => `Envio ${fromSymbol}`,
8723
+ ON_RAMP_FIAT: () => `Dep\xF3sito ${fromSymbol} \u2192 ${toSymbol}`,
8724
+ OFF_RAMP_FIAT: () => `Saque ${fromSymbol} \u2192 ${toSymbol}`,
8725
+ SAMECHAIN_INVESTMENT_DEPOSIT: () => `Dep\xF3sito ${fromSymbol}`,
8726
+ SAMECHAIN_INVESTMENT_WITHDRAW: () => `Resgate ${toSymbol}`,
8727
+ CROSSCHAIN_INVESTMENT_DEPOSIT: () => {
8728
+ const route = fromChain && toChain ? ` (${fromChain} \u2192 ${toChain})` : "";
8729
+ return `Dep\xF3sito ${fromSymbol}${route}`;
8730
+ },
8731
+ CROSSCHAIN_INVESTMENT_WITHDRAW: () => {
8732
+ const route = fromChain && toChain ? ` (${fromChain} \u2192 ${toChain})` : "";
8733
+ return `Resgate ${toSymbol}${route}`;
8734
+ }
8735
+ };
8736
+ return labelMap[item.type]();
8737
+ }
8738
+ function historyResolveAmounts(item) {
8739
+ var _a, _b;
8740
+ const assetOut = (_a = item.amounts) == null ? void 0 : _a.assetOut;
8741
+ const assetIn = (_b = item.amounts) == null ? void 0 : _b.assetIn;
8742
+ const displayAsset = item.type === "TRANSFER_OUT" || item.type === "OFF_RAMP_FIAT" ? assetIn : assetOut;
8743
+ if (!displayAsset) return { primary: "\u2014", secondary: "" };
8744
+ if (isAssetAmount(displayAsset)) {
8745
+ const primary = `${displayAsset.amountHumanized} ${displayAsset.symbol}`;
8746
+ const secondary = displayAsset.amountInUSD ? `~$${displayAsset.amountInUSD}` : "";
8747
+ return { primary, secondary };
8748
+ }
8749
+ if (isFiatAmount(displayAsset)) {
8750
+ return { primary: `${displayAsset.amountHumanized} ${displayAsset.currency}`, secondary: "" };
8751
+ }
8752
+ return { primary: "\u2014", secondary: "" };
8753
+ }
8754
+ function historyFormatDate(isoDate) {
8755
+ const d = new Date(isoDate);
8756
+ if (isNaN(d.getTime())) return isoDate;
8757
+ return d.toLocaleDateString("pt-BR", {
8758
+ day: "2-digit",
8759
+ month: "short",
8760
+ year: "numeric",
8761
+ hour: "2-digit",
8762
+ minute: "2-digit"
8763
+ });
8764
+ }
8765
+ var SWAP_TYPES = ["SAMECHAIN_SWAP", "CROSSCHAIN_SWAP"];
8766
+ var DEPOSIT_TYPES = [
8767
+ "TRANSFER_IN",
8768
+ "ON_RAMP_FIAT",
8769
+ "SAMECHAIN_INVESTMENT_DEPOSIT",
8770
+ "CROSSCHAIN_INVESTMENT_DEPOSIT"
8771
+ ];
8772
+ function historyIsSwap(type) {
8773
+ return SWAP_TYPES.includes(type);
8774
+ }
8775
+ function historyIsDeposit(type) {
8776
+ return DEPOSIT_TYPES.includes(type);
8777
+ }
8778
+ function historyResolveIconUrl(item) {
8779
+ var _a, _b, _c, _d;
8780
+ const assetOut = (_a = item.amounts) == null ? void 0 : _a.assetOut;
8781
+ const assetIn = (_b = item.amounts) == null ? void 0 : _b.assetIn;
8782
+ const displayAsset = item.type === "TRANSFER_OUT" || item.type === "OFF_RAMP_FIAT" ? assetIn : assetOut;
8783
+ if (displayAsset && isAssetAmount(displayAsset)) return (_d = (_c = displayAsset.token) == null ? void 0 : _c.logoURI) != null ? _d : "";
8784
+ return "";
8785
+ }
8786
+ function historyResolveIconAlt(item) {
8787
+ var _a, _b;
8788
+ const assetOut = (_a = item.amounts) == null ? void 0 : _a.assetOut;
8789
+ const assetIn = (_b = item.amounts) == null ? void 0 : _b.assetIn;
8790
+ const displayAsset = item.type === "TRANSFER_OUT" || item.type === "OFF_RAMP_FIAT" ? assetIn : assetOut;
8791
+ if (displayAsset && isAssetAmount(displayAsset)) return displayAsset.symbol;
8792
+ if (displayAsset && isFiatAmount(displayAsset)) return displayAsset.currency;
8793
+ return "";
8794
+ }
8795
+ function historyResolveSubtitle(item) {
8796
+ var _a, _b;
8797
+ const assetIn = (_a = item.amounts) == null ? void 0 : _a.assetIn;
8798
+ const assetOut = (_b = item.amounts) == null ? void 0 : _b.assetOut;
8799
+ const fromChain = getChainName(assetIn);
8800
+ const toChain = getChainName(assetOut);
8801
+ if (historyIsSwap(item.type) && fromChain && toChain && fromChain !== toChain) {
8802
+ return `${fromChain} \u2192 ${toChain}`;
8803
+ }
8804
+ return fromChain || toChain || "";
8805
+ }
8806
+ function historyResolveSearchableText(item) {
8807
+ const label = historyResolveLabel(item);
8808
+ const { primary, secondary } = historyResolveAmounts(item);
8809
+ const date = historyFormatDate(item.createdAt);
8810
+ const status = item.status;
8811
+ return `${label} ${primary} ${secondary} ${date} ${status}`.toLowerCase();
8812
+ }
8813
+ var variantStyles = {
8814
+ primary: "text-[color:var(--deframe-widget-color-text-primary)] dark:text-[color:var(--deframe-widget-color-text-primary-dark)] text-text-md",
8815
+ secondary: "text-[color:var(--deframe-widget-color-text-secondary)] dark:text-[color:var(--deframe-widget-color-text-secondary-dark)] text-text-sm font-poppins"
8816
+ };
8817
+ var Label = ({ children, variant = "primary", className }) => {
8818
+ return /* @__PURE__ */ jsx("div", { className: twMerge(variantStyles[variant], className), children });
8819
+ };
8820
+ var SwapIconWithBadge = ({ src, alt }) => {
8821
+ const fallbackText = encodeURIComponent((alt || "TOK").slice(0, 3).toUpperCase());
8822
+ const fallbackSrc = `https://placehold.co/40x40?text=${fallbackText}`;
8823
+ const resolvedSrc = src || fallbackSrc;
8824
+ return /* @__PURE__ */ jsxs("div", { className: "relative flex-shrink-0", children: [
8825
+ /* @__PURE__ */ 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__ */ jsx(
8826
+ "img",
8827
+ {
8828
+ src: resolvedSrc,
8829
+ alt,
8830
+ className: "w-full h-full object-cover",
8831
+ onError: (e) => {
8832
+ e.target.src = fallbackSrc;
8833
+ }
8834
+ }
8835
+ ) }),
8836
+ /* @__PURE__ */ 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__ */ jsx(MdArrowUpward, { className: "w-3 h-3 text-[color:var(--deframe-widget-color-text-primary)] dark:text-[color:var(--deframe-widget-color-text-primary-dark)]" }) })
8837
+ ] });
8838
+ };
8839
+ var ArrowBadge = ({ isDeposit }) => {
8840
+ return /* @__PURE__ */ 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__ */ jsx(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__ */ jsx(MdArrowUpward, { className: "w-3 h-3 text-[color:var(--deframe-widget-color-text-primary)] dark:text-[color:var(--deframe-widget-color-text-primary-dark)]" }) });
8841
+ };
8842
+ var TokenIconWithBadge2 = ({ src, alt, isDeposit }) => {
8843
+ const fallbackText = encodeURIComponent((alt || "TOK").slice(0, 3).toUpperCase());
8844
+ const fallbackSrc = `https://placehold.co/40x40?text=${fallbackText}`;
8845
+ const resolvedSrc = src || fallbackSrc;
8846
+ return /* @__PURE__ */ jsxs("div", { className: "relative flex-shrink-0", children: [
8847
+ /* @__PURE__ */ 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__ */ jsx(
8848
+ "img",
8849
+ {
8850
+ src: resolvedSrc,
8851
+ alt,
8852
+ className: "w-full h-full object-cover",
8853
+ onError: (e) => {
8854
+ e.target.src = fallbackSrc;
8855
+ }
8856
+ }
8857
+ ) }),
8858
+ /* @__PURE__ */ jsx(ArrowBadge, { isDeposit })
8859
+ ] });
8860
+ };
8861
+ var AmountDisplay = ({ amount, usdAmount }) => {
8862
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
8863
+ /* @__PURE__ */ jsx(Label, { className: "text-accent-sm-mobile whitespace-nowrap", children: amount }),
8864
+ usdAmount ? /* @__PURE__ */ jsx(Label, { variant: "secondary", className: "whitespace-nowrap", children: usdAmount }) : null
8865
+ ] });
8866
+ };
8867
+ var HistoryListItem = ({ item, onClick, className, statusLabel, statusTitle }) => {
8868
+ const label = historyResolveLabel(item);
8869
+ const subtitle = historyResolveSubtitle(item);
8870
+ const { primary, secondary } = historyResolveAmounts(item);
8871
+ const iconUrl = historyResolveIconUrl(item);
8872
+ const iconAlt = historyResolveIconAlt(item);
8873
+ const isSwap = historyIsSwap(item.type);
8874
+ const isDeposit = historyIsDeposit(item.type);
8875
+ return /* @__PURE__ */ jsxs(
8876
+ ListItem,
8877
+ {
8878
+ onClick,
8879
+ containerClassName: twMerge("!rounded-xs !border-0 !min-h-[72px]", className),
8880
+ children: [
8881
+ /* @__PURE__ */ jsx(ListItemLeftSide, { children: isSwap ? /* @__PURE__ */ jsx(SwapIconWithBadge, { src: iconUrl, alt: iconAlt }) : /* @__PURE__ */ jsx(TokenIconWithBadge2, { src: iconUrl, alt: iconAlt, isDeposit }) }),
8882
+ /* @__PURE__ */ jsxs(ListItemContent, { children: [
8883
+ /* @__PURE__ */ jsx(Label, { className: "text-text-lg-mobile", children: label }),
8884
+ subtitle && /* @__PURE__ */ 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 }),
8885
+ item.status === "PENDING" && statusLabel ? /* @__PURE__ */ jsx("div", { className: "mt-[6px]", children: /* @__PURE__ */ jsx(ProcessingBadge, { label: statusLabel, title: statusTitle, size: "compact" }) }) : null
8886
+ ] }),
8887
+ /* @__PURE__ */ jsx(ListItemRightSide, { children: /* @__PURE__ */ jsx(AmountDisplay, { amount: primary, usdAmount: secondary || void 0 }) })
8888
+ ]
8889
+ }
8890
+ );
8891
+ };
8685
8892
  var SkeletonItem = () => /* @__PURE__ */ 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: [
8686
8893
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)] flex-1 min-w-0", children: [
8687
8894
  /* @__PURE__ */ jsx("div", { className: "w-10 h-10 rounded-xl bg-[var(--deframe-widget-color-bg-tertiary)] animate-pulse flex-shrink-0" }),
@@ -8711,25 +8918,6 @@ var EmptyState = ({ title, description }) => /* @__PURE__ */ jsx("div", { classN
8711
8918
  ] }),
8712
8919
  /* @__PURE__ */ jsx("div", { className: "self-stretch text-center", children: /* @__PURE__ */ jsx(TextBody, { variant: "text-small", children: description }) })
8713
8920
  ] }) });
8714
- var SwapItemIcon = ({ src, alt }) => {
8715
- const fallbackText = encodeURIComponent((alt || "TOK").slice(0, 3).toUpperCase());
8716
- const fallbackSrc = `https://placehold.co/40x40?text=${fallbackText}`;
8717
- const resolvedSrc = src || fallbackSrc;
8718
- return /* @__PURE__ */ jsxs("div", { className: "relative flex-shrink-0", children: [
8719
- /* @__PURE__ */ 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__ */ jsx(
8720
- "img",
8721
- {
8722
- src: resolvedSrc,
8723
- alt,
8724
- className: "w-full h-full object-cover",
8725
- onError: (e) => {
8726
- e.target.src = fallbackSrc;
8727
- }
8728
- }
8729
- ) }),
8730
- /* @__PURE__ */ 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__ */ jsx(MdArrowUpward, { className: "w-3 h-3 text-[var(--deframe-widget-color-text-primary)]" }) })
8731
- ] });
8732
- };
8733
8921
  var SwapHistoryView = ({
8734
8922
  labels,
8735
8923
  isLoading,
@@ -8737,21 +8925,29 @@ var SwapHistoryView = ({
8737
8925
  onItemClick,
8738
8926
  pageSize = 10
8739
8927
  }) => {
8928
+ var _a, _b;
8740
8929
  const [visibleCount, setVisibleCount] = React6__default.useState(pageSize);
8741
8930
  if (isLoading) {
8742
8931
  return /* @__PURE__ */ 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__ */ jsx(LoadingSkeleton, {}) });
8743
8932
  }
8744
8933
  if (items.length === 0) {
8745
- return /* @__PURE__ */ 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__ */ jsx(EmptyState, { title: labels.emptyTitle, description: labels.emptyDescription }) });
8934
+ return /* @__PURE__ */ 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__ */ jsx(
8935
+ EmptyState,
8936
+ {
8937
+ title: (_a = labels == null ? void 0 : labels.emptyTitle) != null ? _a : "Nenhuma transa\xE7\xE3o",
8938
+ description: (_b = labels == null ? void 0 : labels.emptyDescription) != null ? _b : "Quando voc\xEA realizar transa\xE7\xF5es, elas aparecer\xE3o aqui."
8939
+ }
8940
+ ) });
8746
8941
  }
8747
8942
  const visibleItems = items.slice(0, visibleCount);
8748
8943
  const grouped = /* @__PURE__ */ new Map();
8749
8944
  for (const item of visibleItems) {
8750
- const group = grouped.get(item.dateKey);
8945
+ const dateKey = item.createdAt.slice(0, 10);
8946
+ const group = grouped.get(dateKey);
8751
8947
  if (group) {
8752
8948
  group.push(item);
8753
8949
  } else {
8754
- grouped.set(item.dateKey, [item]);
8950
+ grouped.set(dateKey, [item]);
8755
8951
  }
8756
8952
  }
8757
8953
  const sortedDates = Array.from(grouped.keys()).sort((a, b) => b.localeCompare(a));
@@ -8759,32 +8955,325 @@ var SwapHistoryView = ({
8759
8955
  return /* @__PURE__ */ 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__ */ jsxs("div", { className: "self-stretch flex flex-col gap-[16px]", children: [
8760
8956
  sortedDates.map((dateKey) => {
8761
8957
  const groupItems = grouped.get(dateKey);
8958
+ const dateLabel = historyFormatDate(groupItems[0].createdAt);
8762
8959
  return /* @__PURE__ */ jsxs("div", { className: "self-stretch flex flex-col gap-[var(--deframe-widget-size-gap-sm)]", children: [
8763
- /* @__PURE__ */ 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 }),
8764
- groupItems.map((item) => /* @__PURE__ */ jsxs(
8765
- ListItem,
8960
+ /* @__PURE__ */ 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 }),
8961
+ groupItems.map((item) => /* @__PURE__ */ jsx(
8962
+ HistoryListItem,
8766
8963
  {
8767
- onClick: () => onItemClick(item.id),
8768
- containerClassName: "!rounded-[var(--deframe-widget-size-radius-xs)] !border-0 !min-h-[72px]",
8769
- children: [
8770
- /* @__PURE__ */ jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsx(SwapItemIcon, { src: item.iconUrl, alt: item.iconAlt }) }),
8771
- /* @__PURE__ */ jsxs(ListItemContent, { children: [
8772
- /* @__PURE__ */ 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 }),
8773
- /* @__PURE__ */ 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 })
8774
- ] }),
8775
- /* @__PURE__ */ jsxs(ListItemRightSide, { children: [
8776
- /* @__PURE__ */ 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 }),
8777
- item.amountUsd && /* @__PURE__ */ 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 })
8778
- ] })
8779
- ]
8964
+ item,
8965
+ onClick: onItemClick ? () => onItemClick(item.id) : void 0,
8966
+ className: "!rounded-[var(--deframe-widget-size-radius-xs)] !border-0 !min-h-[72px]"
8780
8967
  },
8781
8968
  item.id
8782
8969
  ))
8783
8970
  ] }, dateKey);
8784
8971
  }),
8785
- hasMore && /* @__PURE__ */ jsx("div", { className: "flex justify-center pt-[var(--deframe-widget-size-padding-y-sm)]", children: /* @__PURE__ */ jsx(TertiaryButton, { onClick: () => setVisibleCount((c) => c + pageSize), children: labels.loadMoreLabel }) })
8972
+ hasMore && (labels == null ? void 0 : labels.loadMoreLabel) && /* @__PURE__ */ jsx("div", { className: "flex justify-center pt-[var(--deframe-widget-size-padding-y-sm)]", children: /* @__PURE__ */ jsx(TertiaryButton, { onClick: () => setVisibleCount((c) => c + pageSize), children: labels.loadMoreLabel }) })
8786
8973
  ] }) });
8787
8974
  };
8975
+ var variantConfig = {
8976
+ SUCCESS: {
8977
+ 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)]",
8978
+ dotClass: "bg-[var(--deframe-widget-color-brand-primary)]",
8979
+ labelClass: "text-[color:var(--deframe-widget-color-brand-primary)]",
8980
+ label: "Aprovado"
8981
+ },
8982
+ PENDING: {
8983
+ 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)]",
8984
+ dotClass: "bg-[var(--deframe-widget-color-state-warning)]",
8985
+ labelClass: "text-[color:var(--deframe-widget-color-state-warning)]",
8986
+ label: "Pendente"
8987
+ },
8988
+ FAILED: {
8989
+ 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)]",
8990
+ dotClass: "bg-[var(--deframe-widget-color-state-error)]",
8991
+ labelClass: "text-[color:var(--deframe-widget-color-state-error)]",
8992
+ label: "Falhou"
8993
+ },
8994
+ REFUNDED: {
8995
+ 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)]",
8996
+ dotClass: "bg-[var(--deframe-widget-color-brand-secondary)]",
8997
+ labelClass: "text-[color:var(--deframe-widget-color-brand-secondary)]",
8998
+ label: "Reembolsado"
8999
+ }
9000
+ };
9001
+ function StatusBadge2({ status, className }) {
9002
+ const config = variantConfig[status];
9003
+ return /* @__PURE__ */ jsxs(
9004
+ "span",
9005
+ {
9006
+ "data-test-id": "history-status-badge",
9007
+ className: twMerge(
9008
+ "inline-flex items-center gap-[5px]",
9009
+ "py-[3px] pr-[10px] pl-[7px]",
9010
+ "rounded-[var(--deframe-widget-size-radius-full)]",
9011
+ "border",
9012
+ config.wrapper,
9013
+ className
9014
+ ),
9015
+ children: [
9016
+ /* @__PURE__ */ jsx(
9017
+ "span",
9018
+ {
9019
+ "data-test-id": "history-status-badge-dot",
9020
+ className: twMerge(
9021
+ "w-[7px] h-[7px] rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0 inline-block",
9022
+ config.dotClass
9023
+ )
9024
+ }
9025
+ ),
9026
+ /* @__PURE__ */ jsx(
9027
+ "span",
9028
+ {
9029
+ "data-test-id": "history-status-badge-label",
9030
+ className: twMerge(
9031
+ "text-[11px] [font-weight:var(--deframe-widget-font-weight-medium)] font-[var(--deframe-widget-font-family)]",
9032
+ config.labelClass
9033
+ ),
9034
+ children: config.label
9035
+ }
9036
+ )
9037
+ ]
9038
+ }
9039
+ );
9040
+ }
9041
+ var HistoryListItemSimple = ({ item }) => {
9042
+ const label = historyResolveLabel(item);
9043
+ const { primary, secondary } = historyResolveAmounts(item);
9044
+ const date = historyFormatDate(item.createdAt);
9045
+ return /* @__PURE__ */ jsxs(
9046
+ "div",
9047
+ {
9048
+ "data-test-id": "history-list-item-simple",
9049
+ className: twMerge(
9050
+ "w-full flex flex-col gap-[6px]",
9051
+ "bg-[var(--deframe-widget-color-bg-secondary)]",
9052
+ "border border-[color:var(--deframe-widget-color-border-secondary)]",
9053
+ "rounded-[var(--deframe-widget-size-radius-sm)]",
9054
+ "px-[var(--deframe-widget-size-padding-x-md)] py-[14px]"
9055
+ ),
9056
+ children: [
9057
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-[var(--deframe-widget-size-gap-sm)]", children: [
9058
+ /* @__PURE__ */ jsx(
9059
+ "span",
9060
+ {
9061
+ "data-test-id": "history-list-item-simple-date",
9062
+ className: "text-[12px] text-[color:var(--deframe-widget-color-text-tertiary)] leading-none",
9063
+ children: date
9064
+ }
9065
+ ),
9066
+ /* @__PURE__ */ jsx(StatusBadge2, { status: item.status })
9067
+ ] }),
9068
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-[var(--deframe-widget-size-gap-sm)]", children: [
9069
+ /* @__PURE__ */ jsx(
9070
+ "span",
9071
+ {
9072
+ "data-test-id": "history-list-item-simple-label",
9073
+ className: twMerge(
9074
+ "text-[18px] leading-[1.2]",
9075
+ "[font-weight:var(--deframe-widget-font-weight-bold)]",
9076
+ "text-[color:var(--deframe-widget-color-text-primary)]"
9077
+ ),
9078
+ children: label
9079
+ }
9080
+ ),
9081
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-end gap-[2px] flex-shrink-0", children: [
9082
+ /* @__PURE__ */ jsx(
9083
+ "span",
9084
+ {
9085
+ "data-test-id": "history-list-item-simple-primary",
9086
+ className: twMerge(
9087
+ "text-[13px] leading-[1.3]",
9088
+ "[font-weight:var(--deframe-widget-font-weight-semibold)]",
9089
+ "text-[color:var(--deframe-widget-color-text-primary)]"
9090
+ ),
9091
+ children: primary
9092
+ }
9093
+ ),
9094
+ secondary && /* @__PURE__ */ jsx(
9095
+ "span",
9096
+ {
9097
+ "data-test-id": "history-list-item-simple-secondary",
9098
+ className: "text-[12px] text-[color:var(--deframe-widget-color-text-secondary)] leading-none",
9099
+ children: secondary
9100
+ }
9101
+ )
9102
+ ] })
9103
+ ] })
9104
+ ]
9105
+ }
9106
+ );
9107
+ };
9108
+ var DashboardTransactionsPlaceholder = () => {
9109
+ return /* @__PURE__ */ jsxs("div", { "data-test-id": "dashboard-transactions-placeholder", className: "flex flex-col items-center justify-center py-16 gap-4", children: [
9110
+ /* @__PURE__ */ jsx("div", { className: "w-20 h-20 bg-[var(--deframe-widget-color-bg-muted)] rounded-full flex justify-center items-center", children: /* @__PURE__ */ jsx(PiClockCountdownBold, { className: "w-10 h-10 text-[var(--deframe-widget-color-text-tertiary)]" }) }),
9111
+ /* @__PURE__ */ jsx(TextHeading, { variant: "h3", children: "Nenhuma transa\xE7\xE3o ainda" }),
9112
+ /* @__PURE__ */ 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." })
9113
+ ] });
9114
+ };
9115
+ var SwapHistoryViewSimple = ({
9116
+ isLoading,
9117
+ items,
9118
+ onClose,
9119
+ className,
9120
+ title = "Hist\xF3rico de Swap",
9121
+ subtitle = "Todas as transa\xE7\xF5es de swap"
9122
+ }) => {
9123
+ const [query, setQuery] = useState("");
9124
+ const filtered = useMemo(() => {
9125
+ const q = query.trim().toLowerCase();
9126
+ if (!q) return items;
9127
+ return items.filter((item) => historyResolveSearchableText(item).includes(q));
9128
+ }, [items, query]);
9129
+ return /* @__PURE__ */ jsxs(
9130
+ "div",
9131
+ {
9132
+ "data-test-id": "swap-history-view-simple",
9133
+ className: twMerge(
9134
+ "bg-[var(--deframe-widget-color-bg-secondary)]",
9135
+ "rounded-[var(--deframe-widget-size-radius-md)]",
9136
+ "border border-[color:var(--deframe-widget-color-border-secondary)]",
9137
+ "px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
9138
+ "flex flex-col gap-[var(--deframe-widget-size-gap-md)] h-[calc(100vh-48px)]",
9139
+ "font-[var(--deframe-widget-font-family)]",
9140
+ `w-[${SWAP_SIMPLE_WIDTH}px] max-w-[calc(100%-32px)] shrink-0 box-border`,
9141
+ className
9142
+ ),
9143
+ children: [
9144
+ /* @__PURE__ */ jsxs(
9145
+ "div",
9146
+ {
9147
+ "data-test-id": "swap-history-view-simple-header",
9148
+ className: "flex items-start justify-between gap-[var(--deframe-widget-size-gap-sm)]",
9149
+ children: [
9150
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-[4px]", children: [
9151
+ /* @__PURE__ */ jsx(
9152
+ "h2",
9153
+ {
9154
+ "data-test-id": "swap-history-view-simple-title",
9155
+ className: twMerge(
9156
+ "m-0 text-[20px] leading-[1.25]",
9157
+ "[font-weight:var(--deframe-widget-font-weight-bold)]",
9158
+ "text-[color:var(--deframe-widget-color-text-primary)]"
9159
+ ),
9160
+ children: title
9161
+ }
9162
+ ),
9163
+ /* @__PURE__ */ jsx(
9164
+ "p",
9165
+ {
9166
+ "data-test-id": "swap-history-view-simple-subtitle",
9167
+ className: "m-0 text-[13px] text-[color:var(--deframe-widget-color-text-secondary)] leading-[1.4]",
9168
+ children: subtitle
9169
+ }
9170
+ )
9171
+ ] }),
9172
+ /* @__PURE__ */ jsx(
9173
+ CloseButton_default,
9174
+ {
9175
+ onClick: onClose,
9176
+ ariaLabel: "Fechar",
9177
+ className: "flex-shrink-0 mt-[-4px]"
9178
+ }
9179
+ )
9180
+ ]
9181
+ }
9182
+ ),
9183
+ /* @__PURE__ */ jsx("div", { className: "h-px bg-[var(--deframe-widget-color-border-secondary)]" }),
9184
+ /* @__PURE__ */ jsxs(
9185
+ "div",
9186
+ {
9187
+ "data-test-id": "swap-history-view-simple-search",
9188
+ className: "relative",
9189
+ children: [
9190
+ /* @__PURE__ */ jsx(
9191
+ "input",
9192
+ {
9193
+ "data-test-id": "swap-history-view-simple-search-input",
9194
+ type: "text",
9195
+ value: query,
9196
+ onChange: (e) => setQuery(e.target.value),
9197
+ placeholder: "Buscar por moeda, rede ou status...",
9198
+ "aria-label": "Buscar transa\xE7\xE3o",
9199
+ className: [
9200
+ "w-full box-border h-10",
9201
+ "bg-[var(--deframe-widget-color-bg-tertiary)]",
9202
+ "border border-[color:var(--deframe-widget-color-border-secondary)]",
9203
+ "rounded-[var(--deframe-widget-size-radius-sm)]",
9204
+ "py-0 pr-[var(--deframe-widget-size-padding-x-xl)] pl-[14px]",
9205
+ "text-[14px] text-[color:var(--deframe-widget-color-text-primary)]",
9206
+ "outline-none focus:outline-none",
9207
+ "focus:border-[color:var(--deframe-widget-color-brand-primary)]",
9208
+ "transition-colors duration-150",
9209
+ "font-[var(--deframe-widget-font-family)]",
9210
+ "placeholder:text-[color:var(--deframe-widget-color-text-tertiary)]"
9211
+ ].join(" ")
9212
+ }
9213
+ ),
9214
+ /* @__PURE__ */ 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__ */ jsxs(
9215
+ "svg",
9216
+ {
9217
+ width: "15",
9218
+ height: "15",
9219
+ viewBox: "0 0 24 24",
9220
+ fill: "none",
9221
+ stroke: "currentColor",
9222
+ strokeWidth: "2",
9223
+ strokeLinecap: "round",
9224
+ "aria-hidden": "true",
9225
+ children: [
9226
+ /* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "8" }),
9227
+ /* @__PURE__ */ jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
9228
+ ]
9229
+ }
9230
+ ) })
9231
+ ]
9232
+ }
9233
+ ),
9234
+ /* @__PURE__ */ jsx(
9235
+ "div",
9236
+ {
9237
+ "data-test-id": "swap-history-view-simple-list",
9238
+ 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",
9239
+ children: isLoading ? [1, 2, 3].map((i) => /* @__PURE__ */ jsxs(
9240
+ "div",
9241
+ {
9242
+ className: twMerge(
9243
+ "flex flex-col gap-[6px]",
9244
+ "px-[var(--deframe-widget-size-padding-x-md)] py-[14px]",
9245
+ "rounded-[var(--deframe-widget-size-radius-sm)]",
9246
+ "border border-[color:var(--deframe-widget-color-border-secondary)]"
9247
+ ),
9248
+ children: [
9249
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
9250
+ /* @__PURE__ */ jsx(Skeleton, { width: "100px", height: "12px", shimmer: true }),
9251
+ /* @__PURE__ */ jsx(Skeleton, { width: "80px", height: "20px", shimmer: true, className: "rounded-full" })
9252
+ ] }),
9253
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
9254
+ /* @__PURE__ */ jsx(Skeleton, { width: "160px", height: "18px", shimmer: true }),
9255
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-end gap-[4px]", children: [
9256
+ /* @__PURE__ */ jsx(Skeleton, { width: "96px", height: "14px", shimmer: true }),
9257
+ /* @__PURE__ */ jsx(Skeleton, { width: "72px", height: "12px", shimmer: true })
9258
+ ] })
9259
+ ] })
9260
+ ]
9261
+ },
9262
+ i
9263
+ )) : items.length === 0 ? /* @__PURE__ */ jsx(DashboardTransactionsPlaceholder, {}) : filtered.length === 0 ? /* @__PURE__ */ jsx(
9264
+ "div",
9265
+ {
9266
+ "data-test-id": "swap-history-view-simple-no-results",
9267
+ className: "py-[var(--deframe-widget-size-padding-y-xl)] text-center text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)]",
9268
+ children: "Nenhuma transa\xE7\xE3o encontrada"
9269
+ }
9270
+ ) : filtered.map((item) => /* @__PURE__ */ jsx(HistoryListItemSimple, { item }, item.id))
9271
+ }
9272
+ )
9273
+ ]
9274
+ }
9275
+ );
9276
+ };
8788
9277
  var HistorySwapDetailsView = (props) => {
8789
9278
  const { labels, onBack, status } = props;
8790
9279
  if (status === "not-found") {
@@ -8933,13 +9422,6 @@ var ChipGroup = ({
8933
9422
  var ApyRange = ({ children }) => {
8934
9423
  return /* @__PURE__ */ jsx("div", { className: "text-right justify-center text-text-highlight text-xs font-normal leading-4", children });
8935
9424
  };
8936
- var variantStyles = {
8937
- primary: "text-[color:var(--deframe-widget-color-text-primary)] dark:text-[color:var(--deframe-widget-color-text-primary-dark)] text-text-md",
8938
- secondary: "text-[color:var(--deframe-widget-color-text-secondary)] dark:text-[color:var(--deframe-widget-color-text-secondary-dark)] text-text-sm font-poppins"
8939
- };
8940
- var Label = ({ children, variant = "primary", className }) => {
8941
- return /* @__PURE__ */ jsx("div", { className: twMerge(variantStyles[variant], className), children });
8942
- };
8943
9425
  var HistoryItemSkeleton = () => /* @__PURE__ */ 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: [
8944
9426
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-sm flex-1 min-w-0", children: [
8945
9427
  /* @__PURE__ */ 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" }),
@@ -9982,65 +10464,19 @@ var GroupedStrategyListViewSimple = ({
9982
10464
  },
9983
10465
  s.id
9984
10466
  ))
9985
- }
9986
- )
9987
- ] });
9988
- };
9989
- var DateLabel = ({ children }) => {
9990
- return /* @__PURE__ */ 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 });
9991
- };
9992
- var ArrowBadge = ({ isDeposit }) => {
9993
- return /* @__PURE__ */ 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__ */ jsx(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__ */ jsx(MdArrowUpward, { className: "w-3 h-3 text-[color:var(--deframe-widget-color-text-primary)] dark:text-[color:var(--deframe-widget-color-text-primary-dark)]" }) });
9994
- };
9995
- var TokenIconWithBadge2 = ({ src, alt, isDeposit }) => {
9996
- const fallbackText = encodeURIComponent((alt || "TOK").slice(0, 3).toUpperCase());
9997
- const fallbackSrc = `https://placehold.co/40x40?text=${fallbackText}`;
9998
- const resolvedSrc = src || fallbackSrc;
9999
- return /* @__PURE__ */ jsxs("div", { className: "relative flex-shrink-0", children: [
10000
- /* @__PURE__ */ 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__ */ jsx(
10001
- "img",
10002
- {
10003
- src: resolvedSrc,
10004
- alt,
10005
- className: "w-full h-full object-cover",
10006
- onError: (e) => {
10007
- e.target.src = fallbackSrc;
10008
- }
10009
- }
10010
- ) }),
10011
- /* @__PURE__ */ jsx(ArrowBadge, { isDeposit })
10012
- ] });
10013
- };
10014
- var SwapIconWithBadge = ({ src, alt }) => {
10015
- const fallbackText = encodeURIComponent((alt || "TOK").slice(0, 3).toUpperCase());
10016
- const fallbackSrc = `https://placehold.co/40x40?text=${fallbackText}`;
10017
- const resolvedSrc = src || fallbackSrc;
10018
- return /* @__PURE__ */ jsxs("div", { className: "relative flex-shrink-0", children: [
10019
- /* @__PURE__ */ 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__ */ jsx(
10020
- "img",
10021
- {
10022
- src: resolvedSrc,
10023
- alt,
10024
- className: "w-full h-full object-cover",
10025
- onError: (e) => {
10026
- e.target.src = fallbackSrc;
10027
- }
10028
- }
10029
- ) }),
10030
- /* @__PURE__ */ 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__ */ jsx(MdArrowUpward, { className: "w-3 h-3 text-[color:var(--deframe-widget-color-text-primary)] dark:text-[color:var(--deframe-widget-color-text-primary-dark)]" }) })
10031
- ] });
10032
- };
10033
- var AmountDisplay = ({ amount, usdAmount }) => {
10034
- return /* @__PURE__ */ jsxs(Fragment, { children: [
10035
- /* @__PURE__ */ jsx(Label, { className: "text-accent-sm-mobile whitespace-nowrap", children: amount }),
10036
- usdAmount ? /* @__PURE__ */ jsx(Label, { variant: "secondary", className: "whitespace-nowrap", children: usdAmount }) : null
10467
+ }
10468
+ )
10037
10469
  ] });
10038
10470
  };
10471
+ var DateLabel = ({ children }) => {
10472
+ return /* @__PURE__ */ 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 });
10473
+ };
10039
10474
  var HistoryListView = ({
10040
10475
  groups,
10041
10476
  showLoadMore,
10042
10477
  onLoadMore,
10043
10478
  loadMoreLabel,
10479
+ onItemClick,
10044
10480
  itemClassName
10045
10481
  }) => {
10046
10482
  if (groups.length === 0) {
@@ -10049,34 +10485,12 @@ var HistoryListView = ({
10049
10485
  return /* @__PURE__ */ jsxs("div", { className: "self-stretch flex flex-col gap-[16px]", children: [
10050
10486
  groups.map((group) => /* @__PURE__ */ jsxs("div", { className: "self-stretch flex flex-col gap-sm", children: [
10051
10487
  /* @__PURE__ */ jsx(DateLabel, { children: group.dateLabel }),
10052
- group.items.map((item) => /* @__PURE__ */ jsxs(
10053
- ListItem,
10488
+ group.items.map((item) => /* @__PURE__ */ jsx(
10489
+ HistoryListItem,
10054
10490
  {
10055
- onClick: () => item.onClick(),
10056
- containerClassName: twMerge("!rounded-xs !border-0 !min-h-[72px]", itemClassName),
10057
- children: [
10058
- /* @__PURE__ */ jsx(ListItemLeftSide, { children: item.isSwap ? /* @__PURE__ */ jsx(SwapIconWithBadge, { src: item.iconUrl, alt: item.iconAlt }) : /* @__PURE__ */ jsx(
10059
- TokenIconWithBadge2,
10060
- {
10061
- src: item.iconUrl,
10062
- alt: item.iconAlt,
10063
- isDeposit: item.isDeposit
10064
- }
10065
- ) }),
10066
- /* @__PURE__ */ jsxs(ListItemContent, { children: [
10067
- /* @__PURE__ */ jsx(Label, { className: "text-text-lg-mobile", children: item.title }),
10068
- /* @__PURE__ */ 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 }),
10069
- item.status === "PENDING" && item.statusLabel ? /* @__PURE__ */ jsx("div", { className: "mt-[6px]", children: /* @__PURE__ */ jsx(
10070
- ProcessingBadge,
10071
- {
10072
- label: item.statusLabel,
10073
- title: item.statusTitle,
10074
- size: "compact"
10075
- }
10076
- ) }) : null
10077
- ] }),
10078
- /* @__PURE__ */ jsx(ListItemRightSide, { children: /* @__PURE__ */ jsx(AmountDisplay, { amount: item.amountFormatted, usdAmount: item.amountUsd }) })
10079
- ]
10491
+ item,
10492
+ onClick: onItemClick ? () => onItemClick(item.id) : void 0,
10493
+ className: itemClassName
10080
10494
  },
10081
10495
  item.id
10082
10496
  ))
@@ -10669,21 +11083,33 @@ var EarnNoBalanceNotificationView = ({
10669
11083
  prompt,
10670
11084
  actionLabel,
10671
11085
  onAction
10672
- }) => /* @__PURE__ */ jsx("div", { className: "px-[var(--deframe-widget-size-padding-x-md)] mt-[var(--deframe-widget-size-gap-md)]", children: /* @__PURE__ */ jsx(SectionCard, { className: "bg-[var(--deframe-widget-color-state-warning)]/10 border border-[var(--deframe-widget-color-state-warning)]/20", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-[var(--deframe-widget-size-gap-sm)]", children: [
10673
- /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-[var(--deframe-widget-size-gap-sm)]", children: [
10674
- /* @__PURE__ */ 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__ */ 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" }) }),
10675
- /* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(TextBody, { variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-primary)]", children: prompt }) })
10676
- ] }),
10677
- /* @__PURE__ */ jsx(
10678
- PrimaryButton,
10679
- {
10680
- type: "button",
10681
- onClick: onAction,
10682
- className: "w-full mt-[var(--deframe-widget-size-gap-sm)]",
10683
- children: actionLabel
10684
- }
10685
- )
10686
- ] }) }) });
11086
+ }) => /* @__PURE__ */ jsx("div", { className: "mt-[var(--deframe-widget-size-gap-md)]", children: /* @__PURE__ */ jsxs(
11087
+ "div",
11088
+ {
11089
+ "data-test-id": "earn-no-balance-notification",
11090
+ className: [
11091
+ "bg-[color-mix(in_srgb,var(--deframe-widget-color-state-warning)_16%,transparent)]",
11092
+ "border border-[var(--deframe-widget-color-state-warning)]",
11093
+ "rounded-[var(--deframe-widget-size-radius-sm)]",
11094
+ "px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
11095
+ "flex flex-col gap-[var(--deframe-widget-size-gap-md)]"
11096
+ ].join(" "),
11097
+ children: [
11098
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-[var(--deframe-widget-size-gap-sm)]", children: [
11099
+ /* @__PURE__ */ 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__ */ 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" }) }),
11100
+ /* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(TextBody, { variant: "text-small", children: prompt }) })
11101
+ ] }),
11102
+ /* @__PURE__ */ jsx(
11103
+ PrimaryButton,
11104
+ {
11105
+ type: "button",
11106
+ onClick: onAction,
11107
+ children: actionLabel
11108
+ }
11109
+ )
11110
+ ]
11111
+ }
11112
+ ) });
10687
11113
  var EarnTxStatusCardView = ({
10688
11114
  statusLabel,
10689
11115
  isProcessing,
@@ -11258,6 +11684,7 @@ var EarnDepositFormViewSimple = ({
11258
11684
  // Header / Layout
11259
11685
  pageTitle,
11260
11686
  onBack,
11687
+ onHistoryClick,
11261
11688
  onSubmit,
11262
11689
  // Token selector
11263
11690
  selectedToken,
@@ -11290,6 +11717,8 @@ var EarnDepositFormViewSimple = ({
11290
11717
  isTxError,
11291
11718
  txSuccessMessage,
11292
11719
  txErrorMessage,
11720
+ // Insufficient balance
11721
+ insufficientBalanceMessage,
11293
11722
  // Bytecode error
11294
11723
  bytecodeErrorMessage,
11295
11724
  // Submit button
@@ -11297,7 +11726,7 @@ var EarnDepositFormViewSimple = ({
11297
11726
  submitButtonText
11298
11727
  }) => {
11299
11728
  const hasToken = selectedToken != null;
11300
- const hasError = !!bytecodeErrorMessage;
11729
+ const hasError = !!insufficientBalanceMessage || !!bytecodeErrorMessage;
11301
11730
  const isSubmitDisabled = !hasToken || submitDisabled || !amountValue || amountValue === "0" || amountValue === "";
11302
11731
  const [cardHovered, setCardHovered] = React6__default.useState(false);
11303
11732
  const hideTimerRef = React6__default.useRef(void 0);
@@ -11352,21 +11781,24 @@ var EarnDepositFormViewSimple = ({
11352
11781
  "data-test-id": "earn-deposit-form-view-simple",
11353
11782
  className: panelBaseClasses,
11354
11783
  children: [
11355
- /* @__PURE__ */ jsx(
11784
+ /* @__PURE__ */ jsxs(
11356
11785
  "header",
11357
11786
  {
11358
11787
  "data-slot": "deposit-panel-simple-header",
11359
11788
  "data-test-id": "earn-deposit-form-view-simple-header",
11360
11789
  className: headerBaseClasses,
11361
- children: /* @__PURE__ */ jsx(
11362
- "span",
11363
- {
11364
- "data-slot": "deposit-panel-simple-title",
11365
- "data-test-id": "earn-deposit-form-view-simple-title",
11366
- className: titleBaseClasses,
11367
- children: pageTitle
11368
- }
11369
- )
11790
+ children: [
11791
+ /* @__PURE__ */ jsx(
11792
+ "span",
11793
+ {
11794
+ "data-slot": "deposit-panel-simple-title",
11795
+ "data-test-id": "earn-deposit-form-view-simple-title",
11796
+ className: titleBaseClasses,
11797
+ children: pageTitle
11798
+ }
11799
+ ),
11800
+ onHistoryClick && /* @__PURE__ */ jsx(HistoryButton2, { onClick: onHistoryClick })
11801
+ ]
11370
11802
  }
11371
11803
  ),
11372
11804
  /* @__PURE__ */ jsx(
@@ -11458,7 +11890,21 @@ var EarnDepositFormViewSimple = ({
11458
11890
  children: selectTokenLabel
11459
11891
  }
11460
11892
  ),
11461
- /* @__PURE__ */ jsx(AnimatePresence, { children: hasToken && cardHovered && /* @__PURE__ */ jsx(
11893
+ hasError && /* @__PURE__ */ jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsx(
11894
+ EarnInlineNotificationSimpleView,
11895
+ {
11896
+ variant: "error",
11897
+ message: insufficientBalanceMessage || bytecodeErrorMessage
11898
+ }
11899
+ ) }),
11900
+ showNoBalanceNotification ? /* @__PURE__ */ jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsx(
11901
+ EarnNoBalanceNotificationView,
11902
+ {
11903
+ prompt: noBalancePrompt,
11904
+ actionLabel: goToSwapLabel,
11905
+ onAction: onGoToSwap
11906
+ }
11907
+ ) }) : /* @__PURE__ */ jsx(AnimatePresence, { children: hasToken && cardHovered && /* @__PURE__ */ jsx(
11462
11908
  motion.div,
11463
11909
  {
11464
11910
  "data-slot": "deposit-simple-chips-row",
@@ -11478,21 +11924,6 @@ var EarnDepositFormViewSimple = ({
11478
11924
  }
11479
11925
  )
11480
11926
  }
11481
- ) }),
11482
- showNoBalanceNotification && /* @__PURE__ */ jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsx(
11483
- EarnNoBalanceNotificationView,
11484
- {
11485
- prompt: noBalancePrompt,
11486
- actionLabel: goToSwapLabel,
11487
- onAction: onGoToSwap
11488
- }
11489
- ) }),
11490
- bytecodeErrorMessage && /* @__PURE__ */ jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsx(
11491
- EarnInlineNotificationSimpleView,
11492
- {
11493
- variant: "error",
11494
- message: bytecodeErrorMessage
11495
- }
11496
11927
  ) })
11497
11928
  ]
11498
11929
  }
@@ -11572,6 +12003,31 @@ var EarnDepositFormViewSimple = ({
11572
12003
  }
11573
12004
  );
11574
12005
  };
12006
+ function HistoryButton2({ onClick }) {
12007
+ return /* @__PURE__ */ jsx(
12008
+ "button",
12009
+ {
12010
+ "data-test-id": "earn-deposit-form-simple-history-button",
12011
+ type: "button",
12012
+ onClick,
12013
+ "aria-label": "Hist\xF3rico de transa\xE7\xF5es",
12014
+ className: twMerge(
12015
+ "inline-flex items-center justify-center",
12016
+ "w-9 h-9",
12017
+ "rounded-[var(--deframe-widget-size-radius-sm)]",
12018
+ "border-none cursor-pointer bg-transparent",
12019
+ "hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_92%,transparent)]",
12020
+ "transition-[background] duration-150",
12021
+ "flex-shrink-0 outline-none",
12022
+ "text-[color:var(--deframe-widget-color-text-secondary)]"
12023
+ ),
12024
+ children: /* @__PURE__ */ 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: [
12025
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
12026
+ /* @__PURE__ */ jsx("polyline", { points: "12 6 12 12 16 14" })
12027
+ ] })
12028
+ }
12029
+ );
12030
+ }
11575
12031
  var EarnWithdrawFormView = ({
11576
12032
  // Header / Layout
11577
12033
  headerTitle,
@@ -11721,6 +12177,7 @@ var EarnWithdrawFormViewSimple = ({
11721
12177
  // Header / Layout
11722
12178
  pageTitle,
11723
12179
  onBack,
12180
+ onHistoryClick,
11724
12181
  onSubmit,
11725
12182
  // Position card (used for inline balance row)
11726
12183
  positionBalanceToken,
@@ -11748,6 +12205,8 @@ var EarnWithdrawFormViewSimple = ({
11748
12205
  isTxError,
11749
12206
  txSuccessMessage,
11750
12207
  txErrorMessage,
12208
+ // Insufficient balance
12209
+ insufficientBalanceMessage,
11751
12210
  // Bytecode error
11752
12211
  bytecodeErrorMessage,
11753
12212
  // Submit button
@@ -11755,7 +12214,7 @@ var EarnWithdrawFormViewSimple = ({
11755
12214
  submitButtonText
11756
12215
  }) => {
11757
12216
  const hasToken = selectedToken != null;
11758
- const hasError = !!bytecodeErrorMessage;
12217
+ const hasError = !!insufficientBalanceMessage || !!bytecodeErrorMessage;
11759
12218
  const isSubmitDisabled = !hasToken || submitDisabled || !amountValue || amountValue === "0" || amountValue === "";
11760
12219
  const [cardHovered, setCardHovered] = React6__default.useState(false);
11761
12220
  const hideTimerRef = React6__default.useRef(void 0);
@@ -11810,21 +12269,24 @@ var EarnWithdrawFormViewSimple = ({
11810
12269
  "data-test-id": "earn-withdraw-form-view-simple",
11811
12270
  className: panelBaseClasses,
11812
12271
  children: [
11813
- /* @__PURE__ */ jsx(
12272
+ /* @__PURE__ */ jsxs(
11814
12273
  "header",
11815
12274
  {
11816
12275
  "data-slot": "withdraw-panel-simple-header",
11817
12276
  "data-test-id": "earn-withdraw-form-view-simple-header",
11818
12277
  className: headerBaseClasses,
11819
- children: /* @__PURE__ */ jsx(
11820
- "span",
11821
- {
11822
- "data-slot": "withdraw-panel-simple-title",
11823
- "data-test-id": "earn-withdraw-form-view-simple-title",
11824
- className: titleBaseClasses,
11825
- children: pageTitle
11826
- }
11827
- )
12278
+ children: [
12279
+ /* @__PURE__ */ jsx(
12280
+ "span",
12281
+ {
12282
+ "data-slot": "withdraw-panel-simple-title",
12283
+ "data-test-id": "earn-withdraw-form-view-simple-title",
12284
+ className: titleBaseClasses,
12285
+ children: pageTitle
12286
+ }
12287
+ ),
12288
+ onHistoryClick && /* @__PURE__ */ jsx(HistoryButton3, { onClick: onHistoryClick })
12289
+ ]
11828
12290
  }
11829
12291
  ),
11830
12292
  /* @__PURE__ */ jsx(
@@ -11934,11 +12396,11 @@ var EarnWithdrawFormViewSimple = ({
11934
12396
  )
11935
12397
  }
11936
12398
  ) }),
11937
- bytecodeErrorMessage && /* @__PURE__ */ jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsx(
12399
+ hasError && /* @__PURE__ */ jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsx(
11938
12400
  EarnInlineNotificationSimpleView,
11939
12401
  {
11940
12402
  variant: "error",
11941
- message: bytecodeErrorMessage
12403
+ message: insufficientBalanceMessage || bytecodeErrorMessage
11942
12404
  }
11943
12405
  ) })
11944
12406
  ]
@@ -12019,6 +12481,31 @@ var EarnWithdrawFormViewSimple = ({
12019
12481
  }
12020
12482
  );
12021
12483
  };
12484
+ function HistoryButton3({ onClick }) {
12485
+ return /* @__PURE__ */ jsx(
12486
+ "button",
12487
+ {
12488
+ "data-test-id": "earn-withdraw-form-simple-history-button",
12489
+ type: "button",
12490
+ onClick,
12491
+ "aria-label": "Hist\xF3rico de transa\xE7\xF5es",
12492
+ className: twMerge(
12493
+ "inline-flex items-center justify-center",
12494
+ "w-9 h-9",
12495
+ "rounded-[var(--deframe-widget-size-radius-sm)]",
12496
+ "border-none cursor-pointer bg-transparent",
12497
+ "hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_92%,transparent)]",
12498
+ "transition-[background] duration-150",
12499
+ "flex-shrink-0 outline-none",
12500
+ "text-[color:var(--deframe-widget-color-text-secondary)]"
12501
+ ),
12502
+ children: /* @__PURE__ */ 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: [
12503
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
12504
+ /* @__PURE__ */ jsx("polyline", { points: "12 6 12 12 16 14" })
12505
+ ] })
12506
+ }
12507
+ );
12508
+ }
12022
12509
  var EarnDepositProcessingView = ({
12023
12510
  progress,
12024
12511
  title,
@@ -17189,13 +17676,6 @@ var OfframpFailedSimpleView = () => {
17189
17676
  var DashboardCard = ({ children, className }) => {
17190
17677
  return /* @__PURE__ */ jsx("div", { "data-test-id": "dashboard-card", className: twMerge("bg-[var(--deframe-widget-color-bg-subtle)] rounded", className), children });
17191
17678
  };
17192
- var DashboardTransactionsPlaceholder = () => {
17193
- return /* @__PURE__ */ jsxs("div", { "data-test-id": "dashboard-transactions-placeholder", className: "flex flex-col items-center justify-center py-16 gap-4", children: [
17194
- /* @__PURE__ */ jsx("div", { className: "w-20 h-20 bg-[var(--deframe-widget-color-bg-muted)] rounded-full flex justify-center items-center", children: /* @__PURE__ */ jsx(PiClockCountdownBold, { className: "w-10 h-10 text-[var(--deframe-widget-color-text-tertiary)]" }) }),
17195
- /* @__PURE__ */ jsx(TextHeading, { variant: "h3", children: "Nenhuma transa\xE7\xE3o ainda" }),
17196
- /* @__PURE__ */ 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." })
17197
- ] });
17198
- };
17199
17679
  var DashboardBalancesBreakdown = ({
17200
17680
  isLoadingBalances,
17201
17681
  formattedTokenPositions,
@@ -17648,7 +18128,7 @@ var DUST_THRESHOLD_USD = 0.01;
17648
18128
  function isDustValue(amountInUSD) {
17649
18129
  return isNaN(amountInUSD) || amountInUSD < DUST_THRESHOLD_USD;
17650
18130
  }
17651
- function HistoryButton2({ onClick }) {
18131
+ function HistoryButton4({ onClick }) {
17652
18132
  return /* @__PURE__ */ jsx(
17653
18133
  "button",
17654
18134
  {
@@ -17899,7 +18379,7 @@ var DashboardTokensViewSimple = ({
17899
18379
  children: "Seus ativos"
17900
18380
  }
17901
18381
  ),
17902
- onHistoryClick != null && /* @__PURE__ */ jsx(HistoryButton2, { onClick: onHistoryClick })
18382
+ onHistoryClick != null && /* @__PURE__ */ jsx(HistoryButton4, { onClick: onHistoryClick })
17903
18383
  ]
17904
18384
  }
17905
18385
  ),
@@ -18006,12 +18486,13 @@ var DashboardRecentTransactionsView = ({
18006
18486
  isLoading,
18007
18487
  isEmpty,
18008
18488
  transactions,
18009
- onViewAllClick
18489
+ onViewAllClick,
18490
+ onItemClick
18010
18491
  }) => {
18011
18492
  return /* @__PURE__ */ jsx(DashboardCard, { className: "p-6 bg-[var(--deframe-widget-color-bg-subtle)]", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
18012
18493
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-start", children: [
18013
18494
  /* @__PURE__ */ jsx(TextBody, { className: "mb-6", children: "Transa\xE7\xF5es recentes" }),
18014
- /* @__PURE__ */ jsx("button", { type: "button", onClick: onViewAllClick, children: /* @__PURE__ */ jsx(TextBody, { className: "text-[var(--deframe-widget-color-brand-primary)] cursor-pointer hover:underline", children: "Ver todas" }) })
18495
+ onViewAllClick && /* @__PURE__ */ jsx("button", { type: "button", onClick: onViewAllClick, children: /* @__PURE__ */ jsx(TextBody, { className: "text-[var(--deframe-widget-color-brand-primary)] cursor-pointer hover:underline", children: "Ver todas" }) })
18015
18496
  ] }),
18016
18497
  /* @__PURE__ */ jsx("div", { className: "space-y-2 mt-[-16px]", children: isLoading ? /* @__PURE__ */ jsx("div", { className: "space-y-4", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 p-2", children: [
18017
18498
  /* @__PURE__ */ jsx(Skeleton, { variant: "circle", width: "40px", height: "40px", shimmer: true }),
@@ -18020,106 +18501,17 @@ var DashboardRecentTransactionsView = ({
18020
18501
  /* @__PURE__ */ jsx(Skeleton, { width: "220px", height: "12px", shimmer: true })
18021
18502
  ] }),
18022
18503
  /* @__PURE__ */ jsx(Skeleton, { width: "96px", height: "14px", shimmer: true })
18023
- ] }, i)) }) : isEmpty ? /* @__PURE__ */ jsx(DashboardTransactionsPlaceholder, {}) : transactions.map((item) => {
18024
- const MainIcon = item.mainIcon;
18025
- const TypeIcon = item.typeIcon;
18026
- return /* @__PURE__ */ jsxs(
18027
- ListItem,
18028
- {
18029
- containerClassName: "p-2 mt-4 bg-[var(--deframe-widget-color-bg-raised)] cursor-pointer",
18030
- onClick: () => item.onClick(),
18031
- children: [
18032
- /* @__PURE__ */ jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
18033
- /* @__PURE__ */ jsx("div", { className: `w-10 h-10 rounded-full ${item.iconBgColor} flex items-center justify-center`, children: /* @__PURE__ */ jsx(MainIcon, { className: `${item.iconColor}`, size: 20 }) }),
18034
- /* @__PURE__ */ 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__ */ jsx(TypeIcon, { className: `${item.iconColor}`, size: 12 }) })
18035
- ] }) }),
18036
- /* @__PURE__ */ jsxs(ListItemContent, { className: "ml-4", children: [
18037
- /* @__PURE__ */ jsx(TextBody, { variant: "text-small", children: item.formattedDate }),
18038
- /* @__PURE__ */ jsx(TextBody, { className: "text-xs text-[var(--deframe-widget-color-text-secondary)]", children: item.label })
18039
- ] }),
18040
- /* @__PURE__ */ jsxs(ListItemRightSide, { className: "text-right", children: [
18041
- /* @__PURE__ */ jsx(TextBody, { variant: "text-small", children: item.rightPrimary }),
18042
- /* @__PURE__ */ jsx(TextBody, { className: "text-xs text-[var(--deframe-widget-color-text-secondary)]", children: item.rightSecondary })
18043
- ] })
18044
- ]
18045
- },
18046
- item.id
18047
- );
18048
- }) })
18504
+ ] }, i)) }) : isEmpty ? /* @__PURE__ */ jsx(DashboardTransactionsPlaceholder, {}) : transactions.map((item) => /* @__PURE__ */ jsx(
18505
+ HistoryListItem,
18506
+ {
18507
+ item,
18508
+ onClick: onItemClick ? () => onItemClick(item.id) : void 0,
18509
+ className: "p-2 mt-4 bg-[var(--deframe-widget-color-bg-raised)] cursor-pointer"
18510
+ },
18511
+ item.id
18512
+ )) })
18049
18513
  ] }) });
18050
18514
  };
18051
- var variantConfig = {
18052
- pending: {
18053
- 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)]",
18054
- dotClass: "bg-[var(--deframe-widget-color-state-warning)]",
18055
- labelClass: "text-[color:var(--deframe-widget-color-state-warning)]",
18056
- label: "Pendente"
18057
- },
18058
- confirmed: {
18059
- 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)]",
18060
- dotClass: "bg-[var(--deframe-widget-color-brand-primary)]",
18061
- labelClass: "text-[color:var(--deframe-widget-color-brand-primary)]",
18062
- label: "Confirmado"
18063
- },
18064
- approved: {
18065
- 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)]",
18066
- dotClass: "bg-[var(--deframe-widget-color-brand-primary)]",
18067
- labelClass: "text-[color:var(--deframe-widget-color-brand-primary)]",
18068
- label: "Aprovada"
18069
- },
18070
- failed: {
18071
- 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)]",
18072
- dotClass: "bg-[var(--deframe-widget-color-state-error)]",
18073
- labelClass: "text-[color:var(--deframe-widget-color-state-error)]",
18074
- label: "Falhou"
18075
- },
18076
- processing: {
18077
- 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)]",
18078
- dotClass: "bg-[var(--deframe-widget-color-brand-secondary)]",
18079
- labelClass: "text-[color:var(--deframe-widget-color-brand-secondary)]",
18080
- label: "Processando"
18081
- }
18082
- };
18083
- function StatusBadge2({ status, label, className }) {
18084
- const config = variantConfig[status];
18085
- return /* @__PURE__ */ jsxs(
18086
- "span",
18087
- {
18088
- "data-test-id": "status-badge",
18089
- className: twMerge(
18090
- "inline-flex items-center gap-[5px]",
18091
- "py-[3px] pr-[10px] pl-[7px]",
18092
- "rounded-[var(--deframe-widget-size-radius-full)]",
18093
- "border",
18094
- config.wrapper,
18095
- className
18096
- ),
18097
- children: [
18098
- /* @__PURE__ */ jsx(
18099
- "span",
18100
- {
18101
- "data-test-id": "status-badge-dot",
18102
- className: twMerge(
18103
- "w-[7px] h-[7px] rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0 inline-block",
18104
- config.dotClass
18105
- )
18106
- }
18107
- ),
18108
- /* @__PURE__ */ jsx(
18109
- "span",
18110
- {
18111
- "data-test-id": "status-badge-label",
18112
- className: twMerge(
18113
- "text-[11px] [font-weight:var(--deframe-widget-font-weight-medium)] font-[var(--deframe-widget-font-family)]",
18114
- config.labelClass
18115
- ),
18116
- children: label != null ? label : config.label
18117
- }
18118
- )
18119
- ]
18120
- }
18121
- );
18122
- }
18123
18515
  var DashboardRecentTransactionsViewSimple = ({
18124
18516
  isLoading,
18125
18517
  isEmpty,
@@ -18130,9 +18522,7 @@ var DashboardRecentTransactionsViewSimple = ({
18130
18522
  const filtered = useMemo(() => {
18131
18523
  const q = query.trim().toLowerCase();
18132
18524
  if (!q) return transactions;
18133
- return transactions.filter(
18134
- (tx) => tx.label.toLowerCase().includes(q) || tx.formattedDate.toLowerCase().includes(q) || tx.rightPrimary.toLowerCase().includes(q) || tx.rightSecondary.toLowerCase().includes(q)
18135
- );
18525
+ return transactions.filter((item) => historyResolveSearchableText(item).includes(q));
18136
18526
  }, [transactions, query]);
18137
18527
  return /* @__PURE__ */ jsxs(
18138
18528
  "div",
@@ -18143,7 +18533,7 @@ var DashboardRecentTransactionsViewSimple = ({
18143
18533
  "rounded-[var(--deframe-widget-size-radius-md)]",
18144
18534
  "border border-[color:var(--deframe-widget-color-border-secondary)]",
18145
18535
  "px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
18146
- "flex flex-col gap-[var(--deframe-widget-size-gap-md)] w-full",
18536
+ "flex flex-col gap-[var(--deframe-widget-size-gap-md)] w-full h-[calc(100vh-48px)]",
18147
18537
  "font-[var(--deframe-widget-font-family)]"
18148
18538
  ),
18149
18539
  children: [
@@ -18241,7 +18631,7 @@ var DashboardRecentTransactionsViewSimple = ({
18241
18631
  "div",
18242
18632
  {
18243
18633
  "data-test-id": "dashboard-recent-transactions-simple-list",
18244
- className: "flex flex-col gap-[var(--deframe-widget-size-gap-sm)]",
18634
+ 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",
18245
18635
  children: isLoading ? [1, 2, 3].map((i) => /* @__PURE__ */ jsxs(
18246
18636
  "div",
18247
18637
  {
@@ -18273,69 +18663,7 @@ var DashboardRecentTransactionsViewSimple = ({
18273
18663
  className: "py-[var(--deframe-widget-size-padding-y-xl)] text-center text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)]",
18274
18664
  children: "Nenhuma transa\xE7\xE3o encontrada"
18275
18665
  }
18276
- ) : filtered.map((item) => /* @__PURE__ */ jsxs(
18277
- "div",
18278
- {
18279
- "data-test-id": "dashboard-recent-transactions-simple-item",
18280
- className: twMerge(
18281
- "w-full flex flex-col gap-[6px]",
18282
- "bg-[var(--deframe-widget-color-bg-secondary)]",
18283
- "border border-[color:var(--deframe-widget-color-border-secondary)]",
18284
- "rounded-[var(--deframe-widget-size-radius-sm)]",
18285
- "px-[var(--deframe-widget-size-padding-x-md)] py-[14px]"
18286
- ),
18287
- children: [
18288
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-[var(--deframe-widget-size-gap-sm)]", children: [
18289
- /* @__PURE__ */ jsx(
18290
- "span",
18291
- {
18292
- "data-test-id": "dashboard-recent-transactions-simple-item-date",
18293
- className: "text-[12px] text-[color:var(--deframe-widget-color-text-tertiary)] leading-none",
18294
- children: item.formattedDate
18295
- }
18296
- ),
18297
- /* @__PURE__ */ jsx(StatusBadge2, { status: "approved" })
18298
- ] }),
18299
- /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-[var(--deframe-widget-size-gap-sm)]", children: [
18300
- /* @__PURE__ */ jsx(
18301
- "span",
18302
- {
18303
- "data-test-id": "dashboard-recent-transactions-simple-item-label",
18304
- className: twMerge(
18305
- "text-[18px] leading-[1.2]",
18306
- "[font-weight:var(--deframe-widget-font-weight-bold)]",
18307
- "text-[color:var(--deframe-widget-color-text-primary)]"
18308
- ),
18309
- children: item.label
18310
- }
18311
- ),
18312
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-end gap-[2px] flex-shrink-0", children: [
18313
- /* @__PURE__ */ jsx(
18314
- "span",
18315
- {
18316
- "data-test-id": "dashboard-recent-transactions-simple-item-primary",
18317
- className: twMerge(
18318
- "text-[13px] leading-[1.3]",
18319
- "[font-weight:var(--deframe-widget-font-weight-semibold)]",
18320
- "text-[color:var(--deframe-widget-color-text-primary)]"
18321
- ),
18322
- children: item.rightPrimary
18323
- }
18324
- ),
18325
- item.rightSecondary && /* @__PURE__ */ jsx(
18326
- "span",
18327
- {
18328
- "data-test-id": "dashboard-recent-transactions-simple-item-secondary",
18329
- className: "text-[12px] text-[color:var(--deframe-widget-color-text-secondary)] leading-none",
18330
- children: item.rightSecondary
18331
- }
18332
- )
18333
- ] })
18334
- ] })
18335
- ]
18336
- },
18337
- item.id
18338
- ))
18666
+ ) : filtered.map((item) => /* @__PURE__ */ jsx(HistoryListItemSimple, { item }, item.id))
18339
18667
  }
18340
18668
  )
18341
18669
  ]
@@ -18471,6 +18799,6 @@ var DashboardViewSimple = ({
18471
18799
  );
18472
18800
  };
18473
18801
 
18474
- export { ActionButton, ActionSheet, AddressDisplay, ApyRange, BackButton, BackgroundContainer, BannerNotification, Chip, ChipGroup, ChoiceCard, ChooseANetworkView, ChooseAStrategyActionsheetView, ChooseAnAssetSwapView, ChooseNetworkAndAssetViewSimple, CloseButton_default as CloseButton, CollapsibleInfoRow, CollapsibleSection, ConfirmSwapButtonView, ConfirmSwapButtonViewSimple, ConnectWalletList, Currency, DashboardBalancesBreakdown, DashboardCard, DashboardInvestmentOpportunitiesView, DashboardPortfolioView, DashboardPortfolioViewSimple, DashboardRecentTransactionsView, DashboardRecentTransactionsViewSimple, DashboardStrategiesListView, DashboardTokenListView, DashboardTokensView, DashboardTokensViewSimple, DashboardTransactionsPlaceholder, DashboardView, DashboardViewSimple, DeframeComponentsProvider, DepositSuccessIcon, DetailsHeader, EarnAmountInputView, EarnBalanceCard, EarnBytecodeErrorView, EarnDepositFailedSimpleView, EarnDepositFailedView, EarnDepositFormView, EarnDepositFormViewSimple, EarnDepositProcessingSimpleView, EarnDepositProcessingView, EarnDepositSuccessSimpleView, EarnDepositSuccessView, EarnDepositWarningSimpleView, EarnDepositWarningView, EarnDesktopView, EarnDesktopViewSimple, EarnExploreGridView, EarnFlowSkeletonSimple, EarnInvestedSectionView, EarnInvestmentDetailsView, EarnInvestmentSummaryView, EarnNoBalanceNotificationView, EarnOverviewView, EarnPercentageButtonsView, EarnPositionCardView, EarnRecentTransactionsView, EarnTokenSelectorView, EarnTxStatusCardView, EarnWithdrawFailedSimpleView, EarnWithdrawFailedView, EarnWithdrawFormView, EarnWithdrawFormViewSimple, EarnWithdrawProcessingSimpleView, EarnWithdrawProcessingView, EarnWithdrawSuccessSimpleView, EarnWithdrawSuccessView, EarnWithdrawTokenSelectorView, EarnWithdrawWarningSimpleView, EarnWithdrawWarningView, Currency as Fiat, FlexCol, FlexRow, GroupedStrategyListView, HighRiskBadge, HistoryDepositDetailsView, HistoryListSkeleton, HistoryListView, HistorySwapDetailsView, HistoryTabEmpty, HistoryWithdrawDetailsView, InfoLabel, InfoRow, InfoRowIconLabel, InfoRowIconValue, InfoRowWithIcon, InfoValue, Input2 as Input, InputField, InputLabel, Input as InputRoot, InvestmentCrossChainProcessingView, KYCActionRow, KYCAddressPage, KYCBasicDataPage, KYCChecklistCard, KYCChecklistItem, KYCDataCard, KYCDocumentPage, KYCEditPage, KYCFieldMessage, KYCFormPage, KYCInfoRow, KYCIntroPage, KYCLoadingPage, KYCMessageBanner, KYCPageHeader, KYCPageSection, KYCPageShell, KYCReviewPage, KYCReviewPageSkeleton, KYCStatusItemCard, KYCStatusPage, KYCStatusPanel, KYCStepIndicator, KycLoadingView, KycRequiredView, Label, Link, ListItem, ListItemContent, ListItemLeftSide, ListItemRightSide, LoadingDots, LowRiskBadge, MediumRiskBadge, Navbar, OffchainMethodSelectionView, OfframpFailedSimpleView, OfframpInputFormSimpleView, OfframpInputFormView, OfframpProcessingSimpleView, OfframpProcessingView, OfframpSuccessSimpleView, OfframpSuccessView, OnchainDepositFormSimpleView, OnchainDepositFormView, OnchainDepositSuccessSimpleView, OnchainDepositSuccessView, OnchainWithdrawChainSelectorView, OnchainWithdrawFailedView, OnchainWithdrawFormSimpleView, OnchainWithdrawFormView, OnchainWithdrawProcessingSimpleView, OnchainWithdrawSignatureWarningSimpleView, OnchainWithdrawSignatureWarningView, OnchainWithdrawSuccessView, OnrampFormSimpleView, OnrampFormView, OnrampPixcodeView, OnrampSuccessSimpleView, OnrampSuccessView, PercentageButton, PrimaryButton, ProcessingBadge, ProgressIndicator, ScrollableContent, SearchEmptyState, SearchInput, SecondaryButton, SectionCard, Select, SelectContent, SelectItem, SelectTrigger, Skeleton, StepDisplay, StepStatusIcon, StepStatusText, StrategyDetailsView, StrategyGridCard, SummaryDetails, SummaryDetailsCryptoControlV2, SwapAdvancedSettingsView, SwapAmountInputView, SwapCrossChainProcessingView, SwapFormView, SwapFormViewSimple, SwapFromCardView, SwapFromCardViewSimple, SwapHistoryView, SwapProcessingView, SwapProcessingViewSimple, SwapQuoteDetailsView, SwapSignatureWarningView, SwapSignatureWarningViewSimple, SwapSuccessView, SwapSuccessViewSimple, SwapToCardView, SwapToCardViewSimple, SwapTransactionFailedView, SwapTransactionFailedViewSimple, SwapWidgetFallbackView, Tabs, TabsContent, TabsList, TabsTrigger, TertiaryButton, Text_default as Text, TextAccent, TextBody, TextHeading, Title, TokenWithChainBadge, TransactionProcessingDetails, TransactionScreen, TransactionScreenIcon, TransactionScreenInvestmentCard, WalletBalances, WalletConnectPanel, WalletItem, ConnectWalletList as WalletList, WalletListContainer, WithdrawFailedIcon, WithdrawSuccessIcon, isDustValue, truncateAddress };
18802
+ export { ActionButton, ActionSheet, AddressDisplay, ApyRange, BackButton, BackgroundContainer, BannerNotification, Chip, ChipGroup, ChoiceCard, ChooseANetworkView, ChooseAStrategyActionsheetView, ChooseAnAssetSwapView, ChooseNetworkAndAssetViewSimple, CloseButton_default as CloseButton, CollapsibleInfoRow, CollapsibleSection, ConfirmSwapButtonView, ConfirmSwapButtonViewSimple, ConnectWalletList, Currency, DashboardBalancesBreakdown, DashboardCard, DashboardInvestmentOpportunitiesView, DashboardPortfolioView, DashboardPortfolioViewSimple, DashboardRecentTransactionsView, DashboardRecentTransactionsViewSimple, DashboardStrategiesListView, DashboardTokenListView, DashboardTokensView, DashboardTokensViewSimple, DashboardTransactionsPlaceholder, DashboardView, DashboardViewSimple, DeframeComponentsProvider, DepositSuccessIcon, DetailsHeader, EarnAmountInputView, EarnBalanceCard, EarnBytecodeErrorView, EarnDepositFailedSimpleView, EarnDepositFailedView, EarnDepositFormView, EarnDepositFormViewSimple, EarnDepositProcessingSimpleView, EarnDepositProcessingView, EarnDepositSuccessSimpleView, EarnDepositSuccessView, EarnDepositWarningSimpleView, EarnDepositWarningView, EarnDesktopView, EarnDesktopViewSimple, EarnExploreGridView, EarnFlowSkeletonSimple, EarnInvestedSectionView, EarnInvestmentDetailsView, EarnInvestmentSummaryView, EarnNoBalanceNotificationView, EarnOverviewView, EarnPercentageButtonsView, EarnPositionCardView, EarnRecentTransactionsView, EarnTokenSelectorView, EarnTxStatusCardView, EarnWithdrawFailedSimpleView, EarnWithdrawFailedView, EarnWithdrawFormView, EarnWithdrawFormViewSimple, EarnWithdrawProcessingSimpleView, EarnWithdrawProcessingView, EarnWithdrawSuccessSimpleView, EarnWithdrawSuccessView, EarnWithdrawTokenSelectorView, EarnWithdrawWarningSimpleView, EarnWithdrawWarningView, Currency as Fiat, FlexCol, FlexRow, GroupedStrategyListView, HighRiskBadge, HistoryDepositDetailsView, HistoryListItem, HistoryListItemSimple, HistoryListSkeleton, HistoryListView, HistorySwapDetailsView, HistoryTabEmpty, HistoryWithdrawDetailsView, InfoLabel, InfoRow, InfoRowIconLabel, InfoRowIconValue, InfoRowWithIcon, InfoValue, Input2 as Input, InputField, InputLabel, Input as InputRoot, InvestmentCrossChainProcessingView, KYCActionRow, KYCAddressPage, KYCBasicDataPage, KYCChecklistCard, KYCChecklistItem, KYCDataCard, KYCDocumentPage, KYCEditPage, KYCFieldMessage, KYCFormPage, KYCInfoRow, KYCIntroPage, KYCLoadingPage, KYCMessageBanner, KYCPageHeader, KYCPageSection, KYCPageShell, KYCReviewPage, KYCReviewPageSkeleton, KYCStatusItemCard, KYCStatusPage, KYCStatusPanel, KYCStepIndicator, KycLoadingView, KycRequiredView, Label, Link, ListItem, ListItemContent, ListItemLeftSide, ListItemRightSide, LoadingDots, LowRiskBadge, MediumRiskBadge, Navbar, OffchainMethodSelectionView, OfframpFailedSimpleView, OfframpInputFormSimpleView, OfframpInputFormView, OfframpProcessingSimpleView, OfframpProcessingView, OfframpSuccessSimpleView, OfframpSuccessView, OnchainDepositFormSimpleView, OnchainDepositFormView, OnchainDepositSuccessSimpleView, OnchainDepositSuccessView, OnchainWithdrawChainSelectorView, OnchainWithdrawFailedView, OnchainWithdrawFormSimpleView, OnchainWithdrawFormView, OnchainWithdrawProcessingSimpleView, OnchainWithdrawSignatureWarningSimpleView, OnchainWithdrawSignatureWarningView, OnchainWithdrawSuccessView, OnrampFormSimpleView, OnrampFormView, OnrampPixcodeView, OnrampSuccessSimpleView, OnrampSuccessView, PercentageButton, PrimaryButton, ProcessingBadge, ProgressIndicator, ScrollableContent, SearchEmptyState, SearchInput, SecondaryButton, SectionCard, Select, SelectContent, SelectItem, SelectTrigger, Skeleton, StepDisplay, StepStatusIcon, StepStatusText, StrategyDetailsView, StrategyGridCard, SummaryDetails, SummaryDetailsCryptoControlV2, SwapAdvancedSettingsView, SwapAmountInputView, SwapCrossChainProcessingView, SwapFormView, SwapFormViewSimple, SwapFromCardView, SwapFromCardViewSimple, SwapHistoryView, SwapHistoryViewSimple, SwapProcessingView, SwapProcessingViewSimple, SwapQuoteDetailsView, SwapSignatureWarningView, SwapSignatureWarningViewSimple, SwapSuccessView, SwapSuccessViewSimple, SwapToCardView, SwapToCardViewSimple, SwapTransactionFailedView, SwapTransactionFailedViewSimple, SwapWidgetFallbackView, Tabs, TabsContent, TabsList, TabsTrigger, TertiaryButton, Text_default as Text, TextAccent, TextBody, TextHeading, Title, TokenWithChainBadge, TransactionProcessingDetails, TransactionScreen, TransactionScreenIcon, TransactionScreenInvestmentCard, WalletBalances, WalletConnectPanel, WalletItem, ConnectWalletList as WalletList, WalletListContainer, WithdrawFailedIcon, WithdrawSuccessIcon, isDustValue, truncateAddress };
18475
18803
  //# sourceMappingURL=index.mjs.map
18476
18804
  //# sourceMappingURL=index.mjs.map