@deframe-sdk/components 0.1.47 → 0.1.48
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 +54 -12
- package/dist/index.d.ts +54 -12
- package/dist/index.js +138 -97
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +138 -98
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4876,7 +4876,10 @@ function LoadingIcon() {
|
|
|
4876
4876
|
}
|
|
4877
4877
|
);
|
|
4878
4878
|
}
|
|
4879
|
-
var SwapProcessingViewSimple = (
|
|
4879
|
+
var SwapProcessingViewSimple = ({
|
|
4880
|
+
titleText,
|
|
4881
|
+
descriptionPrefix
|
|
4882
|
+
}) => {
|
|
4880
4883
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4881
4884
|
"div",
|
|
4882
4885
|
{
|
|
@@ -4923,7 +4926,7 @@ var SwapProcessingViewSimple = () => {
|
|
|
4923
4926
|
"font-[var(--deframe-widget-font-family)]",
|
|
4924
4927
|
"text-[color:var(--deframe-widget-color-brand-primary)]"
|
|
4925
4928
|
),
|
|
4926
|
-
children:
|
|
4929
|
+
children: titleText
|
|
4927
4930
|
}
|
|
4928
4931
|
),
|
|
4929
4932
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4937,7 +4940,7 @@ var SwapProcessingViewSimple = () => {
|
|
|
4937
4940
|
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
4938
4941
|
"max-w-[260px]"
|
|
4939
4942
|
),
|
|
4940
|
-
children:
|
|
4943
|
+
children: descriptionPrefix
|
|
4941
4944
|
}
|
|
4942
4945
|
)
|
|
4943
4946
|
]
|
|
@@ -5418,7 +5421,7 @@ function SuccessIcon() {
|
|
|
5418
5421
|
}
|
|
5419
5422
|
);
|
|
5420
5423
|
}
|
|
5421
|
-
var SwapSuccessViewSimple = () => {
|
|
5424
|
+
var SwapSuccessViewSimple = ({ labels }) => {
|
|
5422
5425
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5423
5426
|
"div",
|
|
5424
5427
|
{
|
|
@@ -5466,7 +5469,7 @@ var SwapSuccessViewSimple = () => {
|
|
|
5466
5469
|
"font-[var(--deframe-widget-font-family)]",
|
|
5467
5470
|
"text-[color:var(--deframe-widget-color-text-primary)]"
|
|
5468
5471
|
),
|
|
5469
|
-
children:
|
|
5472
|
+
children: labels == null ? void 0 : labels.title
|
|
5470
5473
|
}
|
|
5471
5474
|
),
|
|
5472
5475
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5480,7 +5483,7 @@ var SwapSuccessViewSimple = () => {
|
|
|
5480
5483
|
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
5481
5484
|
"max-w-[260px]"
|
|
5482
5485
|
),
|
|
5483
|
-
children:
|
|
5486
|
+
children: labels == null ? void 0 : labels.descriptionPrefix
|
|
5484
5487
|
}
|
|
5485
5488
|
)
|
|
5486
5489
|
]
|
|
@@ -5668,7 +5671,7 @@ var SwapTransactionFailedViewSimple = ({
|
|
|
5668
5671
|
"font-[var(--deframe-widget-font-family)]",
|
|
5669
5672
|
"text-[color:var(--deframe-widget-color-text-primary)]"
|
|
5670
5673
|
),
|
|
5671
|
-
children:
|
|
5674
|
+
children: errorTitle
|
|
5672
5675
|
}
|
|
5673
5676
|
),
|
|
5674
5677
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5682,7 +5685,7 @@ var SwapTransactionFailedViewSimple = ({
|
|
|
5682
5685
|
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
5683
5686
|
"max-w-[260px]"
|
|
5684
5687
|
),
|
|
5685
|
-
children:
|
|
5688
|
+
children: errorDescription
|
|
5686
5689
|
}
|
|
5687
5690
|
)
|
|
5688
5691
|
]
|
|
@@ -6393,8 +6396,8 @@ var SwapFromCardViewSimple = ({
|
|
|
6393
6396
|
onPercentageClick,
|
|
6394
6397
|
selectedPercentage = null,
|
|
6395
6398
|
maxLabel = "Max.",
|
|
6396
|
-
errorMessage
|
|
6397
|
-
errorActionLabel
|
|
6399
|
+
errorMessage,
|
|
6400
|
+
errorActionLabel,
|
|
6398
6401
|
onErrorAction
|
|
6399
6402
|
}) => {
|
|
6400
6403
|
const fontSizeClass = useResponsiveFontSize(amountValue || "");
|
|
@@ -7337,7 +7340,7 @@ var SwapFormViewSimple = ({
|
|
|
7337
7340
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7338
7341
|
AdvancedPill,
|
|
7339
7342
|
{
|
|
7340
|
-
label:
|
|
7343
|
+
label: advancedSettings.title,
|
|
7341
7344
|
isOpen: showPanel,
|
|
7342
7345
|
onClick: () => {
|
|
7343
7346
|
const next = !showPanel;
|
|
@@ -7541,7 +7544,7 @@ function AdvancedPanelContent({ advancedSettings, transactionDetails }) {
|
|
|
7541
7544
|
{
|
|
7542
7545
|
"data-test-id": "swap-form-simple-advanced-panel-title",
|
|
7543
7546
|
className: "text-[15px] [font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-primary)] font-[inherit]",
|
|
7544
|
-
children:
|
|
7547
|
+
children: advancedSettings.title
|
|
7545
7548
|
}
|
|
7546
7549
|
),
|
|
7547
7550
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9138,12 +9141,11 @@ var DashboardTransactionsPlaceholder = () => {
|
|
|
9138
9141
|
] });
|
|
9139
9142
|
};
|
|
9140
9143
|
var SwapHistoryViewSimple = ({
|
|
9144
|
+
labels,
|
|
9141
9145
|
isLoading,
|
|
9142
9146
|
items,
|
|
9143
9147
|
onClose,
|
|
9144
|
-
className
|
|
9145
|
-
title = "Hist\xF3rico de Swap",
|
|
9146
|
-
subtitle = "Todas as transa\xE7\xF5es de swap"
|
|
9148
|
+
className
|
|
9147
9149
|
}) => {
|
|
9148
9150
|
const [query, setQuery] = React6.useState("");
|
|
9149
9151
|
const filtered = React6.useMemo(() => {
|
|
@@ -9182,7 +9184,7 @@ var SwapHistoryViewSimple = ({
|
|
|
9182
9184
|
"[font-weight:var(--deframe-widget-font-weight-bold)]",
|
|
9183
9185
|
"text-[color:var(--deframe-widget-color-text-primary)]"
|
|
9184
9186
|
),
|
|
9185
|
-
children: title
|
|
9187
|
+
children: labels == null ? void 0 : labels.title
|
|
9186
9188
|
}
|
|
9187
9189
|
),
|
|
9188
9190
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9190,7 +9192,7 @@ var SwapHistoryViewSimple = ({
|
|
|
9190
9192
|
{
|
|
9191
9193
|
"data-test-id": "swap-history-view-simple-subtitle",
|
|
9192
9194
|
className: "m-0 text-[13px] text-[color:var(--deframe-widget-color-text-secondary)] leading-[1.4]",
|
|
9193
|
-
children: subtitle
|
|
9195
|
+
children: labels == null ? void 0 : labels.subtitle
|
|
9194
9196
|
}
|
|
9195
9197
|
)
|
|
9196
9198
|
] }),
|
|
@@ -9198,7 +9200,7 @@ var SwapHistoryViewSimple = ({
|
|
|
9198
9200
|
CloseButton_default,
|
|
9199
9201
|
{
|
|
9200
9202
|
onClick: onClose,
|
|
9201
|
-
ariaLabel:
|
|
9203
|
+
ariaLabel: labels == null ? void 0 : labels.closeAriaLabel,
|
|
9202
9204
|
className: "flex-shrink-0 mt-[-4px]"
|
|
9203
9205
|
}
|
|
9204
9206
|
)
|
|
@@ -9219,8 +9221,8 @@ var SwapHistoryViewSimple = ({
|
|
|
9219
9221
|
type: "text",
|
|
9220
9222
|
value: query,
|
|
9221
9223
|
onChange: (e) => setQuery(e.target.value),
|
|
9222
|
-
placeholder:
|
|
9223
|
-
"aria-label":
|
|
9224
|
+
placeholder: labels == null ? void 0 : labels.searchPlaceholder,
|
|
9225
|
+
"aria-label": labels == null ? void 0 : labels.searchAriaLabel,
|
|
9224
9226
|
className: [
|
|
9225
9227
|
"w-full box-border h-10",
|
|
9226
9228
|
"bg-[var(--deframe-widget-color-bg-tertiary)]",
|
|
@@ -9290,7 +9292,7 @@ var SwapHistoryViewSimple = ({
|
|
|
9290
9292
|
{
|
|
9291
9293
|
"data-test-id": "swap-history-view-simple-no-results",
|
|
9292
9294
|
className: "py-[var(--deframe-widget-size-padding-y-xl)] text-center text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)]",
|
|
9293
|
-
children:
|
|
9295
|
+
children: labels == null ? void 0 : labels.emptyTitle
|
|
9294
9296
|
}
|
|
9295
9297
|
) : filtered.map((item) => /* @__PURE__ */ jsxRuntime.jsx(HistoryListItemSimple, { item }, item.id))
|
|
9296
9298
|
}
|
|
@@ -9533,16 +9535,16 @@ var StrategyGridCardSimple = ({
|
|
|
9533
9535
|
title,
|
|
9534
9536
|
chainName,
|
|
9535
9537
|
apyFormatted,
|
|
9538
|
+
apyLabel,
|
|
9536
9539
|
riskLevel,
|
|
9537
9540
|
onInvestClick,
|
|
9538
9541
|
labels
|
|
9539
9542
|
}) => {
|
|
9540
|
-
|
|
9541
|
-
const investLabel = (_a = labels == null ? void 0 : labels.investLabel) != null ? _a : "Depositar";
|
|
9543
|
+
const investLabel = labels == null ? void 0 : labels.investLabel;
|
|
9542
9544
|
const riskBadgeMap = {
|
|
9543
|
-
low: /* @__PURE__ */ jsxRuntime.jsx(LowRiskBadge, { label:
|
|
9544
|
-
medium: /* @__PURE__ */ jsxRuntime.jsx(MediumRiskBadge, { label:
|
|
9545
|
-
high: /* @__PURE__ */ jsxRuntime.jsx(HighRiskBadge, { label:
|
|
9545
|
+
low: /* @__PURE__ */ jsxRuntime.jsx(LowRiskBadge, { label: labels == null ? void 0 : labels.riskLow }),
|
|
9546
|
+
medium: /* @__PURE__ */ jsxRuntime.jsx(MediumRiskBadge, { label: labels == null ? void 0 : labels.riskMedium }),
|
|
9547
|
+
high: /* @__PURE__ */ jsxRuntime.jsx(HighRiskBadge, { label: labels == null ? void 0 : labels.riskHigh })
|
|
9546
9548
|
};
|
|
9547
9549
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9548
9550
|
"article",
|
|
@@ -9560,7 +9562,7 @@ var StrategyGridCardSimple = ({
|
|
|
9560
9562
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0", children: riskBadgeMap[riskLevel] })
|
|
9561
9563
|
] }),
|
|
9562
9564
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline gap-[var(--deframe-widget-size-gap-sm)]", children: [
|
|
9563
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] [font-weight:var(--deframe-widget-font-weight-medium)] uppercase tracking-[0.08em] text-[color:var(--deframe-widget-color-text-tertiary)]", children:
|
|
9565
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] [font-weight:var(--deframe-widget-font-weight-medium)] uppercase tracking-[0.08em] text-[color:var(--deframe-widget-color-text-tertiary)]", children: apyLabel }),
|
|
9564
9566
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9565
9567
|
"span",
|
|
9566
9568
|
{
|
|
@@ -10022,7 +10024,7 @@ var EarnHubStrategyCard = ({
|
|
|
10022
10024
|
}
|
|
10023
10025
|
);
|
|
10024
10026
|
};
|
|
10025
|
-
var SimpleEmptyState = () => {
|
|
10027
|
+
var SimpleEmptyState = ({ title, description }) => {
|
|
10026
10028
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10027
10029
|
"div",
|
|
10028
10030
|
{
|
|
@@ -10045,8 +10047,8 @@ var SimpleEmptyState = () => {
|
|
|
10045
10047
|
}
|
|
10046
10048
|
),
|
|
10047
10049
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-[var(--deframe-widget-size-gap-xs)] text-center", children: [
|
|
10048
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[length:var(--deframe-widget-font-size-md)] [font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-primary)] font-[var(--deframe-widget-font-family)]", children:
|
|
10049
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "max-w-[240px] text-[length:var(--deframe-widget-font-size-sm)] leading-[var(--deframe-widget-font-leading-sm)] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)]", children:
|
|
10050
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[length:var(--deframe-widget-font-size-md)] [font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-primary)] font-[var(--deframe-widget-font-family)]", children: title }),
|
|
10051
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "max-w-[240px] text-[length:var(--deframe-widget-font-size-sm)] leading-[var(--deframe-widget-font-leading-sm)] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)]", children: description })
|
|
10050
10052
|
] })
|
|
10051
10053
|
]
|
|
10052
10054
|
}
|
|
@@ -10143,35 +10145,37 @@ var EarnDesktopViewSimple = ({
|
|
|
10143
10145
|
onHistoryDetail,
|
|
10144
10146
|
onHistory,
|
|
10145
10147
|
isLoading,
|
|
10146
|
-
className
|
|
10148
|
+
className,
|
|
10149
|
+
labels,
|
|
10150
|
+
categories = EARN_CATEGORY_DEFINITIONS
|
|
10147
10151
|
}) => {
|
|
10148
10152
|
const [activeCategoryId, setActiveCategoryId] = React6__namespace.default.useState(null);
|
|
10149
10153
|
const totalEarnings = positions.summary.totalProfitInUSD;
|
|
10150
10154
|
const statsCards = React6__namespace.default.useMemo(() => [
|
|
10151
|
-
{ label:
|
|
10152
|
-
{ label:
|
|
10153
|
-
], [positions.summary.totalUnderlyingBalanceUSD, totalEarnings, formatCurrency]);
|
|
10155
|
+
{ label: labels == null ? void 0 : labels.totalInvestedLabel, value: formatCurrency(positions.summary.totalUnderlyingBalanceUSD), badge: labels == null ? void 0 : labels.totalInvestedDescription },
|
|
10156
|
+
{ label: labels == null ? void 0 : labels.accumulatedEarningsLabel, value: formatCurrency(totalEarnings), badge: labels == null ? void 0 : labels.accumulatedEarningsDescription }
|
|
10157
|
+
], [positions.summary.totalUnderlyingBalanceUSD, totalEarnings, formatCurrency, labels == null ? void 0 : labels.totalInvestedLabel, labels == null ? void 0 : labels.totalInvestedDescription, labels == null ? void 0 : labels.accumulatedEarningsLabel, labels == null ? void 0 : labels.accumulatedEarningsDescription]);
|
|
10154
10158
|
const categoryBanners = React6__namespace.default.useMemo(() => {
|
|
10155
|
-
return
|
|
10159
|
+
return categories.map((category) => {
|
|
10156
10160
|
var _a;
|
|
10157
|
-
const upperFilter = new Set(
|
|
10161
|
+
const upperFilter = new Set(category.assetFilter.map((a) => a.toUpperCase()));
|
|
10158
10162
|
let bestApy = null;
|
|
10159
|
-
for (const
|
|
10160
|
-
if (upperFilter.has(
|
|
10161
|
-
bestApy =
|
|
10163
|
+
for (const strategy of strategies) {
|
|
10164
|
+
if (upperFilter.has(strategy.assetName.toUpperCase()) && strategy.apy > ((_a = bestApy == null ? void 0 : bestApy.apy) != null ? _a : 0)) {
|
|
10165
|
+
bestApy = strategy;
|
|
10162
10166
|
}
|
|
10163
10167
|
}
|
|
10164
|
-
const isStablecoin =
|
|
10168
|
+
const isStablecoin = category.assetFilter.some((a) => STABLECOIN_SYMBOLS.has(a.toUpperCase()));
|
|
10165
10169
|
return {
|
|
10166
|
-
id:
|
|
10167
|
-
imageUrl:
|
|
10168
|
-
alt:
|
|
10170
|
+
id: category.id,
|
|
10171
|
+
imageUrl: category.imageUrl,
|
|
10172
|
+
alt: category.alt,
|
|
10169
10173
|
apyFormatted: bestApy == null ? void 0 : bestApy.apyFormatted,
|
|
10170
|
-
description: isStablecoin ?
|
|
10171
|
-
handleClick: () => setActiveCategoryId(
|
|
10174
|
+
description: isStablecoin ? labels == null ? void 0 : labels.stablecoinsBannerDescription : labels == null ? void 0 : labels.realsBannerDescription,
|
|
10175
|
+
handleClick: () => setActiveCategoryId(category.id)
|
|
10172
10176
|
};
|
|
10173
10177
|
});
|
|
10174
|
-
}, [strategies]);
|
|
10178
|
+
}, [categories, strategies, labels == null ? void 0 : labels.stablecoinsBannerDescription, labels == null ? void 0 : labels.realsBannerDescription]);
|
|
10175
10179
|
const historyByAsset = React6__namespace.default.useMemo(() => {
|
|
10176
10180
|
var _a, _b, _c, _d;
|
|
10177
10181
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -10237,7 +10241,16 @@ var EarnDesktopViewSimple = ({
|
|
|
10237
10241
|
onBack: () => setActiveCategoryId(null),
|
|
10238
10242
|
onDeposit,
|
|
10239
10243
|
onWithdraw,
|
|
10240
|
-
className
|
|
10244
|
+
className,
|
|
10245
|
+
backLabel: labels == null ? void 0 : labels.groupedBackLabel,
|
|
10246
|
+
subtitle: labels == null ? void 0 : labels.groupedSubtitle,
|
|
10247
|
+
emptyMessage: labels == null ? void 0 : labels.groupedEmptyMessage,
|
|
10248
|
+
yieldLabel: labels == null ? void 0 : labels.groupedYieldLabel,
|
|
10249
|
+
investLabel: labels == null ? void 0 : labels.investLabel,
|
|
10250
|
+
riskLow: labels == null ? void 0 : labels.riskLow,
|
|
10251
|
+
riskMedium: labels == null ? void 0 : labels.riskMedium,
|
|
10252
|
+
riskHigh: labels == null ? void 0 : labels.riskHigh,
|
|
10253
|
+
categories
|
|
10241
10254
|
}
|
|
10242
10255
|
);
|
|
10243
10256
|
}
|
|
@@ -10253,7 +10266,7 @@ var EarnDesktopViewSimple = ({
|
|
|
10253
10266
|
{
|
|
10254
10267
|
"data-test-id": "earn-hub-view-simple-title",
|
|
10255
10268
|
className: "text-[color:var(--deframe-widget-color-text-primary)] text-[length:var(--deframe-widget-font-size-xxl)] [font-weight:var(--deframe-widget-font-weight-bold)] leading-[var(--deframe-widget-font-leading-xxl)] font-[var(--deframe-widget-font-family)]",
|
|
10256
|
-
children:
|
|
10269
|
+
children: labels == null ? void 0 : labels.pageTitle
|
|
10257
10270
|
}
|
|
10258
10271
|
),
|
|
10259
10272
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -10261,7 +10274,7 @@ var EarnDesktopViewSimple = ({
|
|
|
10261
10274
|
{
|
|
10262
10275
|
"data-test-id": "earn-hub-view-simple-subtitle",
|
|
10263
10276
|
className: "text-[color:var(--deframe-widget-color-text-secondary)] text-[length:var(--deframe-widget-font-size-sm)] leading-[var(--deframe-widget-font-leading-sm)] font-[var(--deframe-widget-font-family)]",
|
|
10264
|
-
children:
|
|
10277
|
+
children: labels == null ? void 0 : labels.pageSubtitle
|
|
10265
10278
|
}
|
|
10266
10279
|
)
|
|
10267
10280
|
] })
|
|
@@ -10300,12 +10313,12 @@ var EarnDesktopViewSimple = ({
|
|
|
10300
10313
|
),
|
|
10301
10314
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: listPanelClasses, children: [
|
|
10302
10315
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: sectionHeaderClasses, children: [
|
|
10303
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { "data-test-id": "earn-hub-view-simple-strategies-title", className: sectionTitleClasses, children:
|
|
10316
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { "data-test-id": "earn-hub-view-simple-strategies-title", className: sectionTitleClasses, children: labels == null ? void 0 : labels.yourStrategiesLabel }),
|
|
10304
10317
|
onHistory && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)] flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10305
10318
|
"button",
|
|
10306
10319
|
{
|
|
10307
10320
|
type: "button",
|
|
10308
|
-
"aria-label":
|
|
10321
|
+
"aria-label": labels == null ? void 0 : labels.historyAriaLabel,
|
|
10309
10322
|
"data-test-id": "earn-hub-simple-history-button",
|
|
10310
10323
|
onClick: onHistory,
|
|
10311
10324
|
className: tailwindMerge.twMerge(
|
|
@@ -10339,7 +10352,7 @@ var EarnDesktopViewSimple = ({
|
|
|
10339
10352
|
}
|
|
10340
10353
|
) })
|
|
10341
10354
|
] }),
|
|
10342
|
-
strategyRows.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(SimpleEmptyState, {}) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10355
|
+
strategyRows.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(SimpleEmptyState, { title: labels == null ? void 0 : labels.emptyStateTitle, description: labels == null ? void 0 : labels.emptyStateDescription }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10343
10356
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10344
10357
|
"div",
|
|
10345
10358
|
{
|
|
@@ -10349,7 +10362,7 @@ var EarnDesktopViewSimple = ({
|
|
|
10349
10362
|
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-sm)]",
|
|
10350
10363
|
"border-t border-[color:var(--deframe-widget-color-border-secondary)]"
|
|
10351
10364
|
),
|
|
10352
|
-
children: [
|
|
10365
|
+
children: [labels == null ? void 0 : labels.columnStrategy, labels == null ? void 0 : labels.columnYield, labels == null ? void 0 : labels.columnInvested].map((label, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10353
10366
|
"span",
|
|
10354
10367
|
{
|
|
10355
10368
|
className: tailwindMerge.twMerge(
|
|
@@ -10406,22 +10419,30 @@ var GroupedStrategyListViewSimple = ({
|
|
|
10406
10419
|
onBack,
|
|
10407
10420
|
onDeposit,
|
|
10408
10421
|
onWithdraw,
|
|
10409
|
-
className
|
|
10422
|
+
className,
|
|
10423
|
+
backLabel,
|
|
10424
|
+
subtitle,
|
|
10425
|
+
emptyMessage,
|
|
10426
|
+
yieldLabel,
|
|
10427
|
+
investLabel,
|
|
10428
|
+
riskLow,
|
|
10429
|
+
riskMedium,
|
|
10430
|
+
riskHigh,
|
|
10431
|
+
categories = EARN_CATEGORY_DEFINITIONS
|
|
10410
10432
|
}) => {
|
|
10411
|
-
|
|
10412
|
-
const
|
|
10413
|
-
const categoryTitle = (_a = category == null ? void 0 : category.title) != null ? _a : "Estrat\xE9gias";
|
|
10433
|
+
const category = categories.find((c) => c.id === categoryId);
|
|
10434
|
+
const categoryTitle = category == null ? void 0 : category.title;
|
|
10414
10435
|
const allClaimedAssets = React6__namespace.default.useMemo(() => {
|
|
10415
10436
|
const claimed = /* @__PURE__ */ new Set();
|
|
10416
|
-
for (const
|
|
10417
|
-
if (
|
|
10418
|
-
for (const symbol of
|
|
10437
|
+
for (const category2 of categories) {
|
|
10438
|
+
if (category2.assetFilter.length > 0) {
|
|
10439
|
+
for (const symbol of category2.assetFilter) {
|
|
10419
10440
|
claimed.add(symbol.toUpperCase());
|
|
10420
10441
|
}
|
|
10421
10442
|
}
|
|
10422
10443
|
}
|
|
10423
10444
|
return claimed;
|
|
10424
|
-
}, []);
|
|
10445
|
+
}, [categories]);
|
|
10425
10446
|
const filteredStrategies = React6__namespace.default.useMemo(() => {
|
|
10426
10447
|
const assetFilter = category == null ? void 0 : category.assetFilter;
|
|
10427
10448
|
if (!assetFilter || assetFilter.length === 0) {
|
|
@@ -10444,12 +10465,12 @@ var GroupedStrategyListViewSimple = ({
|
|
|
10444
10465
|
{
|
|
10445
10466
|
type: "button",
|
|
10446
10467
|
"data-test-id": "grouped-strategy-list-view-simple-back",
|
|
10447
|
-
"aria-label":
|
|
10468
|
+
"aria-label": backLabel,
|
|
10448
10469
|
onClick: onBack,
|
|
10449
10470
|
className: backButtonClasses,
|
|
10450
10471
|
children: [
|
|
10451
10472
|
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 4L6 8L10 12", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }),
|
|
10452
|
-
|
|
10473
|
+
backLabel
|
|
10453
10474
|
]
|
|
10454
10475
|
}
|
|
10455
10476
|
),
|
|
@@ -10460,11 +10481,11 @@ var GroupedStrategyListViewSimple = ({
|
|
|
10460
10481
|
"data-test-id": "grouped-strategy-list-view-simple-subtitle",
|
|
10461
10482
|
variant: "text-small",
|
|
10462
10483
|
className: "text-[color:var(--deframe-widget-color-text-secondary)] mt-[var(--deframe-widget-size-gap-xs)]",
|
|
10463
|
-
children:
|
|
10484
|
+
children: subtitle
|
|
10464
10485
|
}
|
|
10465
10486
|
)
|
|
10466
10487
|
] }),
|
|
10467
|
-
filteredStrategies.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "grouped-strategy-list-view-simple-empty", className: emptyBoxClasses, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[length:var(--deframe-widget-font-size-sm)] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)]", children:
|
|
10488
|
+
filteredStrategies.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "grouped-strategy-list-view-simple-empty", className: emptyBoxClasses, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[length:var(--deframe-widget-font-size-sm)] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)]", children: emptyMessage }) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
10468
10489
|
"div",
|
|
10469
10490
|
{
|
|
10470
10491
|
"data-test-id": "grouped-strategy-list-view-simple-items",
|
|
@@ -10477,12 +10498,13 @@ var GroupedStrategyListViewSimple = ({
|
|
|
10477
10498
|
subtitle: s.assetName,
|
|
10478
10499
|
chainName: s.network,
|
|
10479
10500
|
apyFormatted: s.apyFormatted,
|
|
10480
|
-
apyLabel:
|
|
10501
|
+
apyLabel: yieldLabel,
|
|
10481
10502
|
riskLevel: "low",
|
|
10482
10503
|
onInvestClick: onDeposit ? () => onDeposit(s.id) : () => {
|
|
10483
10504
|
},
|
|
10484
10505
|
onWithdrawClick: onWithdraw ? () => onWithdraw(s.id) : () => {
|
|
10485
|
-
}
|
|
10506
|
+
},
|
|
10507
|
+
labels: { investLabel, riskLow, riskMedium, riskHigh }
|
|
10486
10508
|
},
|
|
10487
10509
|
s.id
|
|
10488
10510
|
))
|
|
@@ -11801,7 +11823,10 @@ var EarnDepositFormViewSimple = ({
|
|
|
11801
11823
|
bytecodeErrorMessage,
|
|
11802
11824
|
// Submit button
|
|
11803
11825
|
submitDisabled,
|
|
11804
|
-
submitButtonText
|
|
11826
|
+
submitButtonText,
|
|
11827
|
+
// Cancel / History
|
|
11828
|
+
cancelLabel,
|
|
11829
|
+
historyAriaLabel
|
|
11805
11830
|
}) => {
|
|
11806
11831
|
const hasToken = selectedToken != null;
|
|
11807
11832
|
const hasError = !!insufficientBalanceMessage || !!bytecodeErrorMessage;
|
|
@@ -11875,7 +11900,7 @@ var EarnDepositFormViewSimple = ({
|
|
|
11875
11900
|
children: pageTitle
|
|
11876
11901
|
}
|
|
11877
11902
|
),
|
|
11878
|
-
onHistoryClick && /* @__PURE__ */ jsxRuntime.jsx(HistoryButton2, { onClick: onHistoryClick })
|
|
11903
|
+
onHistoryClick && /* @__PURE__ */ jsxRuntime.jsx(HistoryButton2, { onClick: onHistoryClick, ariaLabel: historyAriaLabel })
|
|
11879
11904
|
]
|
|
11880
11905
|
}
|
|
11881
11906
|
),
|
|
@@ -12030,8 +12055,8 @@ var EarnDepositFormViewSimple = ({
|
|
|
12030
12055
|
"hover:text-[color:var(--deframe-widget-color-text-primary)]"
|
|
12031
12056
|
].join(" "),
|
|
12032
12057
|
onClick: onBack,
|
|
12033
|
-
"aria-label":
|
|
12034
|
-
children:
|
|
12058
|
+
"aria-label": cancelLabel,
|
|
12059
|
+
children: cancelLabel
|
|
12035
12060
|
}
|
|
12036
12061
|
),
|
|
12037
12062
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -12081,14 +12106,14 @@ var EarnDepositFormViewSimple = ({
|
|
|
12081
12106
|
}
|
|
12082
12107
|
);
|
|
12083
12108
|
};
|
|
12084
|
-
function HistoryButton2({ onClick }) {
|
|
12109
|
+
function HistoryButton2({ onClick, ariaLabel }) {
|
|
12085
12110
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12086
12111
|
"button",
|
|
12087
12112
|
{
|
|
12088
12113
|
"data-test-id": "earn-deposit-form-simple-history-button",
|
|
12089
12114
|
type: "button",
|
|
12090
12115
|
onClick,
|
|
12091
|
-
"aria-label":
|
|
12116
|
+
"aria-label": ariaLabel,
|
|
12092
12117
|
className: tailwindMerge.twMerge(
|
|
12093
12118
|
"inline-flex items-center justify-center",
|
|
12094
12119
|
"w-9 h-9",
|
|
@@ -12289,7 +12314,10 @@ var EarnWithdrawFormViewSimple = ({
|
|
|
12289
12314
|
bytecodeErrorMessage,
|
|
12290
12315
|
// Submit button
|
|
12291
12316
|
submitDisabled,
|
|
12292
|
-
submitButtonText
|
|
12317
|
+
submitButtonText,
|
|
12318
|
+
// Cancel / History
|
|
12319
|
+
cancelLabel,
|
|
12320
|
+
historyAriaLabel
|
|
12293
12321
|
}) => {
|
|
12294
12322
|
const hasToken = selectedToken != null;
|
|
12295
12323
|
const hasError = !!insufficientBalanceMessage || !!bytecodeErrorMessage;
|
|
@@ -12363,7 +12391,7 @@ var EarnWithdrawFormViewSimple = ({
|
|
|
12363
12391
|
children: pageTitle
|
|
12364
12392
|
}
|
|
12365
12393
|
),
|
|
12366
|
-
onHistoryClick && /* @__PURE__ */ jsxRuntime.jsx(HistoryButton3, { onClick: onHistoryClick })
|
|
12394
|
+
onHistoryClick && /* @__PURE__ */ jsxRuntime.jsx(HistoryButton3, { onClick: onHistoryClick, ariaLabel: historyAriaLabel })
|
|
12367
12395
|
]
|
|
12368
12396
|
}
|
|
12369
12397
|
),
|
|
@@ -12508,8 +12536,8 @@ var EarnWithdrawFormViewSimple = ({
|
|
|
12508
12536
|
"hover:text-[color:var(--deframe-widget-color-text-primary)]"
|
|
12509
12537
|
].join(" "),
|
|
12510
12538
|
onClick: onBack,
|
|
12511
|
-
"aria-label":
|
|
12512
|
-
children:
|
|
12539
|
+
"aria-label": cancelLabel,
|
|
12540
|
+
children: cancelLabel
|
|
12513
12541
|
}
|
|
12514
12542
|
),
|
|
12515
12543
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -12559,14 +12587,14 @@ var EarnWithdrawFormViewSimple = ({
|
|
|
12559
12587
|
}
|
|
12560
12588
|
);
|
|
12561
12589
|
};
|
|
12562
|
-
function HistoryButton3({ onClick }) {
|
|
12590
|
+
function HistoryButton3({ onClick, ariaLabel }) {
|
|
12563
12591
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12564
12592
|
"button",
|
|
12565
12593
|
{
|
|
12566
12594
|
"data-test-id": "earn-withdraw-form-simple-history-button",
|
|
12567
12595
|
type: "button",
|
|
12568
12596
|
onClick,
|
|
12569
|
-
"aria-label":
|
|
12597
|
+
"aria-label": ariaLabel,
|
|
12570
12598
|
className: tailwindMerge.twMerge(
|
|
12571
12599
|
"inline-flex items-center justify-center",
|
|
12572
12600
|
"w-9 h-9",
|
|
@@ -13111,6 +13139,8 @@ function WarningIcon2() {
|
|
|
13111
13139
|
);
|
|
13112
13140
|
}
|
|
13113
13141
|
var EarnDepositProcessingSimpleView = ({
|
|
13142
|
+
title,
|
|
13143
|
+
descriptionPrefix,
|
|
13114
13144
|
amountToken,
|
|
13115
13145
|
amountUSD,
|
|
13116
13146
|
iconSrc,
|
|
@@ -13120,10 +13150,10 @@ var EarnDepositProcessingSimpleView = ({
|
|
|
13120
13150
|
EarnFeedbackOverlaySimpleView,
|
|
13121
13151
|
{
|
|
13122
13152
|
variant: "loading",
|
|
13123
|
-
title
|
|
13124
|
-
subtitle:
|
|
13153
|
+
title,
|
|
13154
|
+
subtitle: descriptionPrefix,
|
|
13125
13155
|
formData: {
|
|
13126
|
-
headerTitle:
|
|
13156
|
+
headerTitle: title,
|
|
13127
13157
|
tokenSymbol: strategyName,
|
|
13128
13158
|
tokenLogoURI: iconSrc,
|
|
13129
13159
|
amount: amountToken,
|
|
@@ -13206,6 +13236,8 @@ var EarnDepositSuccessView = ({
|
|
|
13206
13236
|
);
|
|
13207
13237
|
};
|
|
13208
13238
|
var EarnDepositSuccessSimpleView = ({
|
|
13239
|
+
title,
|
|
13240
|
+
descriptionPrefix,
|
|
13209
13241
|
onClose,
|
|
13210
13242
|
tokenSymbol,
|
|
13211
13243
|
amountToken,
|
|
@@ -13222,10 +13254,10 @@ var EarnDepositSuccessSimpleView = ({
|
|
|
13222
13254
|
EarnFeedbackOverlaySimpleView,
|
|
13223
13255
|
{
|
|
13224
13256
|
variant: "success",
|
|
13225
|
-
title
|
|
13226
|
-
subtitle:
|
|
13257
|
+
title,
|
|
13258
|
+
subtitle: descriptionPrefix,
|
|
13227
13259
|
formData: {
|
|
13228
|
-
headerTitle:
|
|
13260
|
+
headerTitle: title,
|
|
13229
13261
|
tokenSymbol: tokenSymbol || strategyName,
|
|
13230
13262
|
tokenLogoURI: iconSrc,
|
|
13231
13263
|
amount: amountToken,
|
|
@@ -13384,6 +13416,8 @@ var EarnDepositFailedView = ({
|
|
|
13384
13416
|
);
|
|
13385
13417
|
};
|
|
13386
13418
|
var EarnDepositFailedSimpleView = ({
|
|
13419
|
+
title,
|
|
13420
|
+
description,
|
|
13387
13421
|
onBack,
|
|
13388
13422
|
amountToken,
|
|
13389
13423
|
amountUSD,
|
|
@@ -13399,10 +13433,10 @@ var EarnDepositFailedSimpleView = ({
|
|
|
13399
13433
|
EarnFeedbackOverlaySimpleView,
|
|
13400
13434
|
{
|
|
13401
13435
|
variant: "error",
|
|
13402
|
-
title
|
|
13403
|
-
subtitle:
|
|
13436
|
+
title,
|
|
13437
|
+
subtitle: description,
|
|
13404
13438
|
formData: {
|
|
13405
|
-
headerTitle:
|
|
13439
|
+
headerTitle: title,
|
|
13406
13440
|
tokenSymbol: strategyName,
|
|
13407
13441
|
tokenLogoURI: iconSrc,
|
|
13408
13442
|
amount: amountToken,
|
|
@@ -13477,6 +13511,8 @@ var EarnWithdrawProcessingView = ({
|
|
|
13477
13511
|
);
|
|
13478
13512
|
};
|
|
13479
13513
|
var EarnWithdrawProcessingSimpleView = ({
|
|
13514
|
+
title,
|
|
13515
|
+
descriptionPrefix,
|
|
13480
13516
|
amountToken,
|
|
13481
13517
|
amountUSD,
|
|
13482
13518
|
iconSrc,
|
|
@@ -13486,10 +13522,10 @@ var EarnWithdrawProcessingSimpleView = ({
|
|
|
13486
13522
|
EarnFeedbackOverlaySimpleView,
|
|
13487
13523
|
{
|
|
13488
13524
|
variant: "loading",
|
|
13489
|
-
title
|
|
13490
|
-
subtitle:
|
|
13525
|
+
title,
|
|
13526
|
+
subtitle: descriptionPrefix,
|
|
13491
13527
|
formData: {
|
|
13492
|
-
headerTitle:
|
|
13528
|
+
headerTitle: title,
|
|
13493
13529
|
tokenSymbol: strategyName,
|
|
13494
13530
|
tokenLogoURI: iconSrc,
|
|
13495
13531
|
amount: amountToken,
|
|
@@ -13565,6 +13601,8 @@ var EarnWithdrawSuccessView = ({
|
|
|
13565
13601
|
);
|
|
13566
13602
|
};
|
|
13567
13603
|
var EarnWithdrawSuccessSimpleView = ({
|
|
13604
|
+
title,
|
|
13605
|
+
descriptionPrefix,
|
|
13568
13606
|
onClose,
|
|
13569
13607
|
tokenSymbol,
|
|
13570
13608
|
amountToken,
|
|
@@ -13581,10 +13619,10 @@ var EarnWithdrawSuccessSimpleView = ({
|
|
|
13581
13619
|
EarnFeedbackOverlaySimpleView,
|
|
13582
13620
|
{
|
|
13583
13621
|
variant: "success",
|
|
13584
|
-
title
|
|
13585
|
-
subtitle:
|
|
13622
|
+
title,
|
|
13623
|
+
subtitle: descriptionPrefix,
|
|
13586
13624
|
formData: {
|
|
13587
|
-
headerTitle:
|
|
13625
|
+
headerTitle: title,
|
|
13588
13626
|
tokenSymbol: tokenSymbol || strategyName,
|
|
13589
13627
|
tokenLogoURI: iconSrc,
|
|
13590
13628
|
amount: amountToken,
|
|
@@ -13743,6 +13781,8 @@ var EarnWithdrawFailedView = ({
|
|
|
13743
13781
|
);
|
|
13744
13782
|
};
|
|
13745
13783
|
var EarnWithdrawFailedSimpleView = ({
|
|
13784
|
+
title,
|
|
13785
|
+
description,
|
|
13746
13786
|
onBack,
|
|
13747
13787
|
amountToken,
|
|
13748
13788
|
amountUSD,
|
|
@@ -13758,10 +13798,10 @@ var EarnWithdrawFailedSimpleView = ({
|
|
|
13758
13798
|
EarnFeedbackOverlaySimpleView,
|
|
13759
13799
|
{
|
|
13760
13800
|
variant: "error",
|
|
13761
|
-
title
|
|
13762
|
-
subtitle:
|
|
13801
|
+
title,
|
|
13802
|
+
subtitle: description,
|
|
13763
13803
|
formData: {
|
|
13764
|
-
headerTitle:
|
|
13804
|
+
headerTitle: title,
|
|
13765
13805
|
tokenSymbol: strategyName,
|
|
13766
13806
|
tokenLogoURI: iconSrc,
|
|
13767
13807
|
amount: amountToken,
|
|
@@ -18973,6 +19013,7 @@ exports.DashboardViewSimple = DashboardViewSimple;
|
|
|
18973
19013
|
exports.DeframeComponentsProvider = DeframeComponentsProvider;
|
|
18974
19014
|
exports.DepositSuccessIcon = DepositSuccessIcon;
|
|
18975
19015
|
exports.DetailsHeader = DetailsHeader;
|
|
19016
|
+
exports.EARN_CATEGORY_DEFINITIONS = EARN_CATEGORY_DEFINITIONS;
|
|
18976
19017
|
exports.EarnAmountInputView = EarnAmountInputView;
|
|
18977
19018
|
exports.EarnBalanceCard = EarnBalanceCard;
|
|
18978
19019
|
exports.EarnBytecodeErrorView = EarnBytecodeErrorView;
|