@deframe-sdk/components 0.1.38 → 0.1.40
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.d.mts +74 -46
- package/dist/index.d.ts +74 -46
- package/dist/index.js +633 -317
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +631 -318
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +26 -0
- package/package.json +1 -1
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(
|
|
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
|
|
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(
|
|
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:
|
|
8788
|
-
groupItems.map((item) => /* @__PURE__ */ jsxRuntime.
|
|
8789
|
-
|
|
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
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
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" }),
|
|
@@ -10013,58 +10495,12 @@ var GroupedStrategyListViewSimple = ({
|
|
|
10013
10495
|
var DateLabel = ({ children }) => {
|
|
10014
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 });
|
|
10015
10497
|
};
|
|
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
|
|
10061
|
-
] });
|
|
10062
|
-
};
|
|
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.
|
|
10077
|
-
|
|
10512
|
+
group.items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10513
|
+
HistoryListItem,
|
|
10078
10514
|
{
|
|
10079
|
-
|
|
10080
|
-
|
|
10081
|
-
|
|
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
|
))
|
|
@@ -11294,6 +11708,7 @@ var EarnDepositFormViewSimple = ({
|
|
|
11294
11708
|
// Header / Layout
|
|
11295
11709
|
pageTitle,
|
|
11296
11710
|
onBack,
|
|
11711
|
+
onHistoryClick,
|
|
11297
11712
|
onSubmit,
|
|
11298
11713
|
// Token selector
|
|
11299
11714
|
selectedToken,
|
|
@@ -11390,21 +11805,24 @@ var EarnDepositFormViewSimple = ({
|
|
|
11390
11805
|
"data-test-id": "earn-deposit-form-view-simple",
|
|
11391
11806
|
className: panelBaseClasses,
|
|
11392
11807
|
children: [
|
|
11393
|
-
/* @__PURE__ */ jsxRuntime.
|
|
11808
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11394
11809
|
"header",
|
|
11395
11810
|
{
|
|
11396
11811
|
"data-slot": "deposit-panel-simple-header",
|
|
11397
11812
|
"data-test-id": "earn-deposit-form-view-simple-header",
|
|
11398
11813
|
className: headerBaseClasses,
|
|
11399
|
-
children:
|
|
11400
|
-
|
|
11401
|
-
|
|
11402
|
-
|
|
11403
|
-
|
|
11404
|
-
|
|
11405
|
-
|
|
11406
|
-
|
|
11407
|
-
|
|
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
|
+
]
|
|
11408
11826
|
}
|
|
11409
11827
|
),
|
|
11410
11828
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -11609,6 +12027,31 @@ var EarnDepositFormViewSimple = ({
|
|
|
11609
12027
|
}
|
|
11610
12028
|
);
|
|
11611
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
|
+
}
|
|
11612
12055
|
var EarnWithdrawFormView = ({
|
|
11613
12056
|
// Header / Layout
|
|
11614
12057
|
headerTitle,
|
|
@@ -11758,6 +12201,7 @@ var EarnWithdrawFormViewSimple = ({
|
|
|
11758
12201
|
// Header / Layout
|
|
11759
12202
|
pageTitle,
|
|
11760
12203
|
onBack,
|
|
12204
|
+
onHistoryClick,
|
|
11761
12205
|
onSubmit,
|
|
11762
12206
|
// Position card (used for inline balance row)
|
|
11763
12207
|
positionBalanceToken,
|
|
@@ -11849,21 +12293,24 @@ var EarnWithdrawFormViewSimple = ({
|
|
|
11849
12293
|
"data-test-id": "earn-withdraw-form-view-simple",
|
|
11850
12294
|
className: panelBaseClasses,
|
|
11851
12295
|
children: [
|
|
11852
|
-
/* @__PURE__ */ jsxRuntime.
|
|
12296
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11853
12297
|
"header",
|
|
11854
12298
|
{
|
|
11855
12299
|
"data-slot": "withdraw-panel-simple-header",
|
|
11856
12300
|
"data-test-id": "earn-withdraw-form-view-simple-header",
|
|
11857
12301
|
className: headerBaseClasses,
|
|
11858
|
-
children:
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
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
|
+
]
|
|
11867
12314
|
}
|
|
11868
12315
|
),
|
|
11869
12316
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -12058,6 +12505,31 @@ var EarnWithdrawFormViewSimple = ({
|
|
|
12058
12505
|
}
|
|
12059
12506
|
);
|
|
12060
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
|
+
}
|
|
12061
12533
|
var EarnDepositProcessingView = ({
|
|
12062
12534
|
progress,
|
|
12063
12535
|
title,
|
|
@@ -17228,13 +17700,6 @@ var OfframpFailedSimpleView = () => {
|
|
|
17228
17700
|
var DashboardCard = ({ children, className }) => {
|
|
17229
17701
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "dashboard-card", className: tailwindMerge.twMerge("bg-[var(--deframe-widget-color-bg-subtle)] rounded", className), children });
|
|
17230
17702
|
};
|
|
17231
|
-
var DashboardTransactionsPlaceholder = () => {
|
|
17232
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "dashboard-transactions-placeholder", className: "flex flex-col items-center justify-center py-16 gap-4", children: [
|
|
17233
|
-
/* @__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)]" }) }),
|
|
17234
|
-
/* @__PURE__ */ jsxRuntime.jsx(TextHeading, { variant: "h3", children: "Nenhuma transa\xE7\xE3o ainda" }),
|
|
17235
|
-
/* @__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." })
|
|
17236
|
-
] });
|
|
17237
|
-
};
|
|
17238
17703
|
var DashboardBalancesBreakdown = ({
|
|
17239
17704
|
isLoadingBalances,
|
|
17240
17705
|
formattedTokenPositions,
|
|
@@ -17687,7 +18152,7 @@ var DUST_THRESHOLD_USD = 0.01;
|
|
|
17687
18152
|
function isDustValue(amountInUSD) {
|
|
17688
18153
|
return isNaN(amountInUSD) || amountInUSD < DUST_THRESHOLD_USD;
|
|
17689
18154
|
}
|
|
17690
|
-
function
|
|
18155
|
+
function HistoryButton4({ onClick }) {
|
|
17691
18156
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17692
18157
|
"button",
|
|
17693
18158
|
{
|
|
@@ -17938,7 +18403,7 @@ var DashboardTokensViewSimple = ({
|
|
|
17938
18403
|
children: "Seus ativos"
|
|
17939
18404
|
}
|
|
17940
18405
|
),
|
|
17941
|
-
onHistoryClick != null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
18406
|
+
onHistoryClick != null && /* @__PURE__ */ jsxRuntime.jsx(HistoryButton4, { onClick: onHistoryClick })
|
|
17942
18407
|
]
|
|
17943
18408
|
}
|
|
17944
18409
|
),
|
|
@@ -18045,12 +18510,13 @@ var DashboardRecentTransactionsView = ({
|
|
|
18045
18510
|
isLoading,
|
|
18046
18511
|
isEmpty,
|
|
18047
18512
|
transactions,
|
|
18048
|
-
onViewAllClick
|
|
18513
|
+
onViewAllClick,
|
|
18514
|
+
onItemClick
|
|
18049
18515
|
}) => {
|
|
18050
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: [
|
|
18051
18517
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-start", children: [
|
|
18052
18518
|
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "mb-6", children: "Transa\xE7\xF5es recentes" }),
|
|
18053
|
-
/* @__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" }) })
|
|
18054
18520
|
] }),
|
|
18055
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: [
|
|
18056
18522
|
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { variant: "circle", width: "40px", height: "40px", shimmer: true }),
|
|
@@ -18059,106 +18525,17 @@ var DashboardRecentTransactionsView = ({
|
|
|
18059
18525
|
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: "220px", height: "12px", shimmer: true })
|
|
18060
18526
|
] }),
|
|
18061
18527
|
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: "96px", height: "14px", shimmer: true })
|
|
18062
|
-
] }, i)) }) : isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(DashboardTransactionsPlaceholder, {}) : transactions.map((item) =>
|
|
18063
|
-
|
|
18064
|
-
|
|
18065
|
-
|
|
18066
|
-
|
|
18067
|
-
|
|
18068
|
-
|
|
18069
|
-
|
|
18070
|
-
|
|
18071
|
-
/* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
18072
|
-
/* @__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 }) }),
|
|
18073
|
-
/* @__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 }) })
|
|
18074
|
-
] }) }),
|
|
18075
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ListItemContent, { className: "ml-4", children: [
|
|
18076
|
-
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", children: item.formattedDate }),
|
|
18077
|
-
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "text-xs text-[var(--deframe-widget-color-text-secondary)]", children: item.label })
|
|
18078
|
-
] }),
|
|
18079
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ListItemRightSide, { className: "text-right", children: [
|
|
18080
|
-
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", children: item.rightPrimary }),
|
|
18081
|
-
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "text-xs text-[var(--deframe-widget-color-text-secondary)]", children: item.rightSecondary })
|
|
18082
|
-
] })
|
|
18083
|
-
]
|
|
18084
|
-
},
|
|
18085
|
-
item.id
|
|
18086
|
-
);
|
|
18087
|
-
}) })
|
|
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
|
+
)) })
|
|
18088
18537
|
] }) });
|
|
18089
18538
|
};
|
|
18090
|
-
var variantConfig = {
|
|
18091
|
-
pending: {
|
|
18092
|
-
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)]",
|
|
18093
|
-
dotClass: "bg-[var(--deframe-widget-color-state-warning)]",
|
|
18094
|
-
labelClass: "text-[color:var(--deframe-widget-color-state-warning)]",
|
|
18095
|
-
label: "Pendente"
|
|
18096
|
-
},
|
|
18097
|
-
confirmed: {
|
|
18098
|
-
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)]",
|
|
18099
|
-
dotClass: "bg-[var(--deframe-widget-color-brand-primary)]",
|
|
18100
|
-
labelClass: "text-[color:var(--deframe-widget-color-brand-primary)]",
|
|
18101
|
-
label: "Confirmado"
|
|
18102
|
-
},
|
|
18103
|
-
approved: {
|
|
18104
|
-
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)]",
|
|
18105
|
-
dotClass: "bg-[var(--deframe-widget-color-brand-primary)]",
|
|
18106
|
-
labelClass: "text-[color:var(--deframe-widget-color-brand-primary)]",
|
|
18107
|
-
label: "Aprovada"
|
|
18108
|
-
},
|
|
18109
|
-
failed: {
|
|
18110
|
-
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)]",
|
|
18111
|
-
dotClass: "bg-[var(--deframe-widget-color-state-error)]",
|
|
18112
|
-
labelClass: "text-[color:var(--deframe-widget-color-state-error)]",
|
|
18113
|
-
label: "Falhou"
|
|
18114
|
-
},
|
|
18115
|
-
processing: {
|
|
18116
|
-
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)]",
|
|
18117
|
-
dotClass: "bg-[var(--deframe-widget-color-brand-secondary)]",
|
|
18118
|
-
labelClass: "text-[color:var(--deframe-widget-color-brand-secondary)]",
|
|
18119
|
-
label: "Processando"
|
|
18120
|
-
}
|
|
18121
|
-
};
|
|
18122
|
-
function StatusBadge2({ status, label, className }) {
|
|
18123
|
-
const config = variantConfig[status];
|
|
18124
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18125
|
-
"span",
|
|
18126
|
-
{
|
|
18127
|
-
"data-test-id": "status-badge",
|
|
18128
|
-
className: tailwindMerge.twMerge(
|
|
18129
|
-
"inline-flex items-center gap-[5px]",
|
|
18130
|
-
"py-[3px] pr-[10px] pl-[7px]",
|
|
18131
|
-
"rounded-[var(--deframe-widget-size-radius-full)]",
|
|
18132
|
-
"border",
|
|
18133
|
-
config.wrapper,
|
|
18134
|
-
className
|
|
18135
|
-
),
|
|
18136
|
-
children: [
|
|
18137
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18138
|
-
"span",
|
|
18139
|
-
{
|
|
18140
|
-
"data-test-id": "status-badge-dot",
|
|
18141
|
-
className: tailwindMerge.twMerge(
|
|
18142
|
-
"w-[7px] h-[7px] rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0 inline-block",
|
|
18143
|
-
config.dotClass
|
|
18144
|
-
)
|
|
18145
|
-
}
|
|
18146
|
-
),
|
|
18147
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18148
|
-
"span",
|
|
18149
|
-
{
|
|
18150
|
-
"data-test-id": "status-badge-label",
|
|
18151
|
-
className: tailwindMerge.twMerge(
|
|
18152
|
-
"text-[11px] [font-weight:var(--deframe-widget-font-weight-medium)] font-[var(--deframe-widget-font-family)]",
|
|
18153
|
-
config.labelClass
|
|
18154
|
-
),
|
|
18155
|
-
children: label != null ? label : config.label
|
|
18156
|
-
}
|
|
18157
|
-
)
|
|
18158
|
-
]
|
|
18159
|
-
}
|
|
18160
|
-
);
|
|
18161
|
-
}
|
|
18162
18539
|
var DashboardRecentTransactionsViewSimple = ({
|
|
18163
18540
|
isLoading,
|
|
18164
18541
|
isEmpty,
|
|
@@ -18169,9 +18546,7 @@ var DashboardRecentTransactionsViewSimple = ({
|
|
|
18169
18546
|
const filtered = React6.useMemo(() => {
|
|
18170
18547
|
const q = query.trim().toLowerCase();
|
|
18171
18548
|
if (!q) return transactions;
|
|
18172
|
-
return transactions.filter(
|
|
18173
|
-
(tx) => tx.label.toLowerCase().includes(q) || tx.formattedDate.toLowerCase().includes(q) || tx.rightPrimary.toLowerCase().includes(q) || tx.rightSecondary.toLowerCase().includes(q)
|
|
18174
|
-
);
|
|
18549
|
+
return transactions.filter((item) => historyResolveSearchableText(item).includes(q));
|
|
18175
18550
|
}, [transactions, query]);
|
|
18176
18551
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18177
18552
|
"div",
|
|
@@ -18182,7 +18557,7 @@ var DashboardRecentTransactionsViewSimple = ({
|
|
|
18182
18557
|
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
18183
18558
|
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
18184
18559
|
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
|
|
18185
|
-
"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)]",
|
|
18186
18561
|
"font-[var(--deframe-widget-font-family)]"
|
|
18187
18562
|
),
|
|
18188
18563
|
children: [
|
|
@@ -18280,7 +18655,7 @@ var DashboardRecentTransactionsViewSimple = ({
|
|
|
18280
18655
|
"div",
|
|
18281
18656
|
{
|
|
18282
18657
|
"data-test-id": "dashboard-recent-transactions-simple-list",
|
|
18283
|
-
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",
|
|
18284
18659
|
children: isLoading ? [1, 2, 3].map((i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18285
18660
|
"div",
|
|
18286
18661
|
{
|
|
@@ -18312,69 +18687,7 @@ var DashboardRecentTransactionsViewSimple = ({
|
|
|
18312
18687
|
className: "py-[var(--deframe-widget-size-padding-y-xl)] text-center text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)]",
|
|
18313
18688
|
children: "Nenhuma transa\xE7\xE3o encontrada"
|
|
18314
18689
|
}
|
|
18315
|
-
) : filtered.map((item) => /* @__PURE__ */ jsxRuntime.
|
|
18316
|
-
"div",
|
|
18317
|
-
{
|
|
18318
|
-
"data-test-id": "dashboard-recent-transactions-simple-item",
|
|
18319
|
-
className: tailwindMerge.twMerge(
|
|
18320
|
-
"w-full flex flex-col gap-[6px]",
|
|
18321
|
-
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
18322
|
-
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
18323
|
-
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
18324
|
-
"px-[var(--deframe-widget-size-padding-x-md)] py-[14px]"
|
|
18325
|
-
),
|
|
18326
|
-
children: [
|
|
18327
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-[var(--deframe-widget-size-gap-sm)]", children: [
|
|
18328
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18329
|
-
"span",
|
|
18330
|
-
{
|
|
18331
|
-
"data-test-id": "dashboard-recent-transactions-simple-item-date",
|
|
18332
|
-
className: "text-[12px] text-[color:var(--deframe-widget-color-text-tertiary)] leading-none",
|
|
18333
|
-
children: item.formattedDate
|
|
18334
|
-
}
|
|
18335
|
-
),
|
|
18336
|
-
/* @__PURE__ */ jsxRuntime.jsx(StatusBadge2, { status: "approved" })
|
|
18337
|
-
] }),
|
|
18338
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-[var(--deframe-widget-size-gap-sm)]", children: [
|
|
18339
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18340
|
-
"span",
|
|
18341
|
-
{
|
|
18342
|
-
"data-test-id": "dashboard-recent-transactions-simple-item-label",
|
|
18343
|
-
className: tailwindMerge.twMerge(
|
|
18344
|
-
"text-[18px] leading-[1.2]",
|
|
18345
|
-
"[font-weight:var(--deframe-widget-font-weight-bold)]",
|
|
18346
|
-
"text-[color:var(--deframe-widget-color-text-primary)]"
|
|
18347
|
-
),
|
|
18348
|
-
children: item.label
|
|
18349
|
-
}
|
|
18350
|
-
),
|
|
18351
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-end gap-[2px] flex-shrink-0", children: [
|
|
18352
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18353
|
-
"span",
|
|
18354
|
-
{
|
|
18355
|
-
"data-test-id": "dashboard-recent-transactions-simple-item-primary",
|
|
18356
|
-
className: tailwindMerge.twMerge(
|
|
18357
|
-
"text-[13px] leading-[1.3]",
|
|
18358
|
-
"[font-weight:var(--deframe-widget-font-weight-semibold)]",
|
|
18359
|
-
"text-[color:var(--deframe-widget-color-text-primary)]"
|
|
18360
|
-
),
|
|
18361
|
-
children: item.rightPrimary
|
|
18362
|
-
}
|
|
18363
|
-
),
|
|
18364
|
-
item.rightSecondary && /* @__PURE__ */ jsxRuntime.jsx(
|
|
18365
|
-
"span",
|
|
18366
|
-
{
|
|
18367
|
-
"data-test-id": "dashboard-recent-transactions-simple-item-secondary",
|
|
18368
|
-
className: "text-[12px] text-[color:var(--deframe-widget-color-text-secondary)] leading-none",
|
|
18369
|
-
children: item.rightSecondary
|
|
18370
|
-
}
|
|
18371
|
-
)
|
|
18372
|
-
] })
|
|
18373
|
-
] })
|
|
18374
|
-
]
|
|
18375
|
-
},
|
|
18376
|
-
item.id
|
|
18377
|
-
))
|
|
18690
|
+
) : filtered.map((item) => /* @__PURE__ */ jsxRuntime.jsx(HistoryListItemSimple, { item }, item.id))
|
|
18378
18691
|
}
|
|
18379
18692
|
)
|
|
18380
18693
|
]
|
|
@@ -18592,6 +18905,8 @@ exports.FlexRow = FlexRow;
|
|
|
18592
18905
|
exports.GroupedStrategyListView = GroupedStrategyListView;
|
|
18593
18906
|
exports.HighRiskBadge = HighRiskBadge;
|
|
18594
18907
|
exports.HistoryDepositDetailsView = HistoryDepositDetailsView;
|
|
18908
|
+
exports.HistoryListItem = HistoryListItem;
|
|
18909
|
+
exports.HistoryListItemSimple = HistoryListItemSimple;
|
|
18595
18910
|
exports.HistoryListSkeleton = HistoryListSkeleton;
|
|
18596
18911
|
exports.HistoryListView = HistoryListView;
|
|
18597
18912
|
exports.HistorySwapDetailsView = HistorySwapDetailsView;
|
|
@@ -18697,6 +19012,7 @@ exports.SwapFormViewSimple = SwapFormViewSimple;
|
|
|
18697
19012
|
exports.SwapFromCardView = SwapFromCardView;
|
|
18698
19013
|
exports.SwapFromCardViewSimple = SwapFromCardViewSimple;
|
|
18699
19014
|
exports.SwapHistoryView = SwapHistoryView;
|
|
19015
|
+
exports.SwapHistoryViewSimple = SwapHistoryViewSimple;
|
|
18700
19016
|
exports.SwapProcessingView = SwapProcessingView;
|
|
18701
19017
|
exports.SwapProcessingViewSimple = SwapProcessingViewSimple;
|
|
18702
19018
|
exports.SwapQuoteDetailsView = SwapQuoteDetailsView;
|