@deframe-sdk/components 0.1.57 → 0.1.59
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 +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +86 -57
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +86 -57
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +3 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1594,10 +1594,11 @@ interface SwapAdvancedSettingsViewProps {
|
|
|
1594
1594
|
title: string;
|
|
1595
1595
|
isOpen: boolean;
|
|
1596
1596
|
onOpenChange: (open: boolean) => void;
|
|
1597
|
-
slippageBps: number;
|
|
1598
|
-
onSlippageSelect: (bps: number) => void;
|
|
1599
|
-
formatPercentage: (bps: number) => string;
|
|
1600
|
-
slippageOptions: number[];
|
|
1597
|
+
slippageBps: number | undefined;
|
|
1598
|
+
onSlippageSelect: (bps: number | undefined) => void;
|
|
1599
|
+
formatPercentage: (bps: number | undefined) => string;
|
|
1600
|
+
slippageOptions: (number | undefined)[];
|
|
1601
|
+
slippageLabel: string;
|
|
1601
1602
|
percentageOptions: number[];
|
|
1602
1603
|
onPercentageClick: (pct: number) => void;
|
|
1603
1604
|
slippageFormatted: string;
|
|
@@ -2192,6 +2193,8 @@ interface EarnDesktopLabels {
|
|
|
2192
2193
|
historyAriaLabel?: string;
|
|
2193
2194
|
columnStrategy?: string;
|
|
2194
2195
|
columnYield?: string;
|
|
2196
|
+
columnApy?: string;
|
|
2197
|
+
columnProfit?: string;
|
|
2195
2198
|
columnInvested?: string;
|
|
2196
2199
|
totalInvestedLabel?: string;
|
|
2197
2200
|
totalInvestedDescription?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1594,10 +1594,11 @@ interface SwapAdvancedSettingsViewProps {
|
|
|
1594
1594
|
title: string;
|
|
1595
1595
|
isOpen: boolean;
|
|
1596
1596
|
onOpenChange: (open: boolean) => void;
|
|
1597
|
-
slippageBps: number;
|
|
1598
|
-
onSlippageSelect: (bps: number) => void;
|
|
1599
|
-
formatPercentage: (bps: number) => string;
|
|
1600
|
-
slippageOptions: number[];
|
|
1597
|
+
slippageBps: number | undefined;
|
|
1598
|
+
onSlippageSelect: (bps: number | undefined) => void;
|
|
1599
|
+
formatPercentage: (bps: number | undefined) => string;
|
|
1600
|
+
slippageOptions: (number | undefined)[];
|
|
1601
|
+
slippageLabel: string;
|
|
1601
1602
|
percentageOptions: number[];
|
|
1602
1603
|
onPercentageClick: (pct: number) => void;
|
|
1603
1604
|
slippageFormatted: string;
|
|
@@ -2192,6 +2193,8 @@ interface EarnDesktopLabels {
|
|
|
2192
2193
|
historyAriaLabel?: string;
|
|
2193
2194
|
columnStrategy?: string;
|
|
2194
2195
|
columnYield?: string;
|
|
2196
|
+
columnApy?: string;
|
|
2197
|
+
columnProfit?: string;
|
|
2195
2198
|
columnInvested?: string;
|
|
2196
2199
|
totalInvestedLabel?: string;
|
|
2197
2200
|
totalInvestedDescription?: string;
|
package/dist/index.js
CHANGED
|
@@ -6072,7 +6072,7 @@ var SwapToCardView = ({
|
|
|
6072
6072
|
] }) });
|
|
6073
6073
|
};
|
|
6074
6074
|
var baseClasses = [
|
|
6075
|
-
"inline-flex items-center justify-center",
|
|
6075
|
+
"flex-1 inline-flex items-center justify-center",
|
|
6076
6076
|
"py-[3px] px-[10px]",
|
|
6077
6077
|
"rounded-[var(--deframe-widget-size-radius-full)]",
|
|
6078
6078
|
"cursor-pointer text-[12px] transition-all duration-150 outline-none",
|
|
@@ -6097,7 +6097,7 @@ var stateClasses = {
|
|
|
6097
6097
|
};
|
|
6098
6098
|
function SlippageChip({
|
|
6099
6099
|
options = [],
|
|
6100
|
-
selected =
|
|
6100
|
+
selected = void 0,
|
|
6101
6101
|
onSelect,
|
|
6102
6102
|
formatLabel,
|
|
6103
6103
|
className
|
|
@@ -6107,7 +6107,7 @@ function SlippageChip({
|
|
|
6107
6107
|
{
|
|
6108
6108
|
"data-test-id": "slippage-chips",
|
|
6109
6109
|
"data-slot": "slippage-chips",
|
|
6110
|
-
className: tailwindMerge.twMerge("flex
|
|
6110
|
+
className: tailwindMerge.twMerge("flex w-full gap-sm", className),
|
|
6111
6111
|
children: options.map((bps) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6112
6112
|
"button",
|
|
6113
6113
|
{
|
|
@@ -6118,7 +6118,7 @@ function SlippageChip({
|
|
|
6118
6118
|
className: tailwindMerge.twMerge(baseClasses, stateClasses[bps === selected ? "active" : "default"]),
|
|
6119
6119
|
children: formatLabel(bps)
|
|
6120
6120
|
},
|
|
6121
|
-
bps
|
|
6121
|
+
String(bps)
|
|
6122
6122
|
))
|
|
6123
6123
|
}
|
|
6124
6124
|
);
|
|
@@ -6131,6 +6131,7 @@ var SwapAdvancedSettingsView = ({
|
|
|
6131
6131
|
onSlippageSelect,
|
|
6132
6132
|
formatPercentage,
|
|
6133
6133
|
slippageOptions,
|
|
6134
|
+
slippageLabel,
|
|
6134
6135
|
percentageOptions,
|
|
6135
6136
|
onPercentageClick,
|
|
6136
6137
|
slippageFormatted,
|
|
@@ -6148,15 +6149,6 @@ var SwapAdvancedSettingsView = ({
|
|
|
6148
6149
|
collapseText,
|
|
6149
6150
|
expandText,
|
|
6150
6151
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full flex flex-col gap-sm", children: [
|
|
6151
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6152
|
-
SlippageChip,
|
|
6153
|
-
{
|
|
6154
|
-
options: slippageOptions,
|
|
6155
|
-
selected: slippageBps,
|
|
6156
|
-
onSelect: onSlippageSelect,
|
|
6157
|
-
formatLabel: formatPercentage
|
|
6158
|
-
}
|
|
6159
|
-
),
|
|
6160
6152
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full gap-sm", children: percentageOptions.map((pct, index) => {
|
|
6161
6153
|
const isMax = index === percentageOptions.length - 1;
|
|
6162
6154
|
const label = isMax ? maxLabel : `${pct / 100}%`;
|
|
@@ -6169,7 +6161,19 @@ var SwapAdvancedSettingsView = ({
|
|
|
6169
6161
|
},
|
|
6170
6162
|
pct
|
|
6171
6163
|
);
|
|
6172
|
-
}) })
|
|
6164
|
+
}) }),
|
|
6165
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-xs w-full", children: [
|
|
6166
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] [font-weight:var(--deframe-widget-font-weight-medium)] text-[color:var(--deframe-widget-color-text-secondary)] font-[var(--deframe-widget-font-family)]", children: slippageLabel }),
|
|
6167
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6168
|
+
SlippageChip,
|
|
6169
|
+
{
|
|
6170
|
+
options: slippageOptions,
|
|
6171
|
+
selected: slippageBps,
|
|
6172
|
+
onSelect: onSlippageSelect,
|
|
6173
|
+
formatLabel: formatPercentage
|
|
6174
|
+
}
|
|
6175
|
+
)
|
|
6176
|
+
] })
|
|
6173
6177
|
] })
|
|
6174
6178
|
}
|
|
6175
6179
|
) }) });
|
|
@@ -7772,13 +7776,13 @@ function SlippageDetailRow({ label, options, selected, onSelect: handleSelect, f
|
|
|
7772
7776
|
"div",
|
|
7773
7777
|
{
|
|
7774
7778
|
"data-test-id": "swap-form-simple-slippage-row",
|
|
7775
|
-
className: "flex
|
|
7779
|
+
className: "flex flex-col py-[10px] gap-[var(--deframe-widget-size-gap-sm)]",
|
|
7776
7780
|
children: [
|
|
7777
7781
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7778
7782
|
"span",
|
|
7779
7783
|
{
|
|
7780
7784
|
"data-test-id": "swap-form-simple-detail-row-label",
|
|
7781
|
-
className: "text-[11px] [font-weight:var(--deframe-widget-font-weight-medium)] uppercase tracking-[0.07em] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)]
|
|
7785
|
+
className: "text-[11px] [font-weight:var(--deframe-widget-font-weight-medium)] uppercase tracking-[0.07em] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)]",
|
|
7782
7786
|
children: label
|
|
7783
7787
|
}
|
|
7784
7788
|
),
|
|
@@ -7789,7 +7793,7 @@ function SlippageDetailRow({ label, options, selected, onSelect: handleSelect, f
|
|
|
7789
7793
|
selected,
|
|
7790
7794
|
onSelect: handleSelect,
|
|
7791
7795
|
formatLabel,
|
|
7792
|
-
className: "gap-[4px] [&_button]:py-[2px] [&_button]:px-[7px] [&_button]:text-[11px]"
|
|
7796
|
+
className: "w-full gap-[4px] [&_button]:py-[2px] [&_button]:px-[7px] [&_button]:text-[11px]"
|
|
7793
7797
|
}
|
|
7794
7798
|
)
|
|
7795
7799
|
]
|
|
@@ -10528,7 +10532,7 @@ var ImageBannerCard = ({
|
|
|
10528
10532
|
}
|
|
10529
10533
|
);
|
|
10530
10534
|
};
|
|
10531
|
-
var GRID_COLS = "grid grid-cols-[
|
|
10535
|
+
var GRID_COLS = "grid grid-cols-[1fr_100px_100px_100px] gap-x-[var(--deframe-widget-size-gap-md)]";
|
|
10532
10536
|
var HISTORY_COLORS = {
|
|
10533
10537
|
deposit: "var(--deframe-widget-color-state-info)",
|
|
10534
10538
|
withdraw: "var(--deframe-widget-color-text-secondary)",
|
|
@@ -10540,6 +10544,7 @@ var EarnHubStrategyCard = ({
|
|
|
10540
10544
|
network,
|
|
10541
10545
|
investedFormatted,
|
|
10542
10546
|
earningsFormatted,
|
|
10547
|
+
profitFormatted,
|
|
10543
10548
|
isLoading,
|
|
10544
10549
|
onInvestClick,
|
|
10545
10550
|
onWithdrawClick,
|
|
@@ -10590,6 +10595,7 @@ var EarnHubStrategyCard = ({
|
|
|
10590
10595
|
children: earningsFormatted
|
|
10591
10596
|
}
|
|
10592
10597
|
) }),
|
|
10598
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center", children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { variant: "rect", width: 50, height: 16 }) : profitFormatted ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[length:var(--deframe-widget-font-size-sm)] [font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-primary)] font-[var(--deframe-widget-font-family)] leading-none", children: profitFormatted }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[length:var(--deframe-widget-font-size-xs)] text-[color:var(--deframe-widget-color-text-tertiary)]", children: "\u2014" }) }),
|
|
10593
10599
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-[var(--deframe-widget-size-gap-xs)]", children: [
|
|
10594
10600
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-end", children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { variant: "rect", width: 60, height: 16 }) : investedFormatted ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10595
10601
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[length:var(--deframe-widget-font-size-sm)] [font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-primary)] leading-[var(--deframe-widget-font-leading-sm)] font-[var(--deframe-widget-font-family)]", children: investedFormatted }),
|
|
@@ -10793,7 +10799,7 @@ var columnHeaderClasses = [
|
|
|
10793
10799
|
"text-[color:var(--deframe-widget-color-text-tertiary)]",
|
|
10794
10800
|
"leading-[var(--deframe-widget-font-leading-xs)]"
|
|
10795
10801
|
].join(" ");
|
|
10796
|
-
var GRID_COLS2 = "grid grid-cols-[
|
|
10802
|
+
var GRID_COLS2 = "grid grid-cols-[1fr_100px_100px_100px] gap-x-[var(--deframe-widget-size-gap-md)]";
|
|
10797
10803
|
var BANNER_COLORS = [
|
|
10798
10804
|
"var(--deframe-widget-color-brand-primary)",
|
|
10799
10805
|
"var(--deframe-widget-color-brand-secondary)"
|
|
@@ -10890,6 +10896,7 @@ var EarnDesktopViewSimple = ({
|
|
|
10890
10896
|
network: p.strategy.network,
|
|
10891
10897
|
investedFormatted: formatCurrency(p.spotPosition.underlyingBalanceUSD),
|
|
10892
10898
|
earningsFormatted: `${(p.spotPosition.apy * 100).toFixed(2)}%`,
|
|
10899
|
+
profitFormatted: formatCurrency(p.spotPosition.profitInUSD),
|
|
10893
10900
|
isLoading: false,
|
|
10894
10901
|
history: (_a = historyByAsset.get(p.strategy.assetName.toUpperCase())) != null ? _a : [],
|
|
10895
10902
|
onInvestClick: onDeposit ? () => onDeposit(p.strategy.id) : () => {
|
|
@@ -11040,13 +11047,13 @@ var EarnDesktopViewSimple = ({
|
|
|
11040
11047
|
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-sm)]",
|
|
11041
11048
|
"border-t border-[color:var(--deframe-widget-color-border-secondary)]"
|
|
11042
11049
|
),
|
|
11043
|
-
children: [labels == null ? void 0 : labels.columnStrategy, labels == null ? void 0 : labels.
|
|
11050
|
+
children: [labels == null ? void 0 : labels.columnStrategy, labels == null ? void 0 : labels.columnApy, labels == null ? void 0 : labels.columnProfit, labels == null ? void 0 : labels.columnInvested].map((label, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11044
11051
|
"span",
|
|
11045
11052
|
{
|
|
11046
11053
|
className: tailwindMerge.twMerge(
|
|
11047
11054
|
columnHeaderClasses,
|
|
11048
|
-
i === 1 && "text-center",
|
|
11049
|
-
i ===
|
|
11055
|
+
(i === 1 || i === 2) && "text-center",
|
|
11056
|
+
i === 3 && "text-right"
|
|
11050
11057
|
),
|
|
11051
11058
|
children: label
|
|
11052
11059
|
},
|
|
@@ -16386,6 +16393,7 @@ var OnrampFormSimpleView = ({
|
|
|
16386
16393
|
error
|
|
16387
16394
|
}) => {
|
|
16388
16395
|
const hasPixCode = !!pixCode;
|
|
16396
|
+
const isWaitingForPixPayment = hasPixCode && !isExpired;
|
|
16389
16397
|
const isSubmitDisabled = !amount || amount === "0" || amount === "" || isBelowMinAmount || hasNoAmount || isProcessing;
|
|
16390
16398
|
const panelBaseClasses = [
|
|
16391
16399
|
"relative flex flex-col overflow-hidden w-[420px]",
|
|
@@ -16432,6 +16440,61 @@ var OnrampFormSimpleView = ({
|
|
|
16432
16440
|
"hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_60%,transparent)]",
|
|
16433
16441
|
"hover:text-[color:var(--deframe-widget-color-text-primary)]"
|
|
16434
16442
|
].join(" ");
|
|
16443
|
+
let footerContent;
|
|
16444
|
+
if (!hasPixCode) {
|
|
16445
|
+
footerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
16446
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16447
|
+
SecondaryButton,
|
|
16448
|
+
{
|
|
16449
|
+
type: "button",
|
|
16450
|
+
className: secondaryButtonClasses,
|
|
16451
|
+
onClick: onBack,
|
|
16452
|
+
"aria-label": "Cancelar dep\xF3sito",
|
|
16453
|
+
"data-test-id": "onramp-form-simple-view-cancel",
|
|
16454
|
+
children: "Cancelar"
|
|
16455
|
+
}
|
|
16456
|
+
),
|
|
16457
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16458
|
+
PrimaryButton,
|
|
16459
|
+
{
|
|
16460
|
+
type: "button",
|
|
16461
|
+
className: "flex-1 h-12 rounded-[var(--deframe-widget-size-radius-sm)] text-[15px]",
|
|
16462
|
+
onClick: onSubmit,
|
|
16463
|
+
disabled: isSubmitDisabled,
|
|
16464
|
+
"aria-label": submitLabel,
|
|
16465
|
+
"data-test-id": "onramp-form-simple-view-submit",
|
|
16466
|
+
children: isProcessing ? "Processando..." : submitLabel
|
|
16467
|
+
}
|
|
16468
|
+
)
|
|
16469
|
+
] });
|
|
16470
|
+
} else if (isWaitingForPixPayment) {
|
|
16471
|
+
footerContent = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16472
|
+
PrimaryButton,
|
|
16473
|
+
{
|
|
16474
|
+
type: "button",
|
|
16475
|
+
className: "w-full h-12 rounded-[var(--deframe-widget-size-radius-sm)] text-[15px]",
|
|
16476
|
+
disabled: true,
|
|
16477
|
+
"aria-label": "Aguardando pagamento PIX",
|
|
16478
|
+
"data-test-id": "onramp-form-simple-view-waiting-payment",
|
|
16479
|
+
children: [
|
|
16480
|
+
"Aguardando pagamento ",
|
|
16481
|
+
/* @__PURE__ */ jsxRuntime.jsx(LoadingDots, {})
|
|
16482
|
+
]
|
|
16483
|
+
}
|
|
16484
|
+
);
|
|
16485
|
+
} else {
|
|
16486
|
+
footerContent = /* @__PURE__ */ jsxRuntime.jsx(
|
|
16487
|
+
SecondaryButton,
|
|
16488
|
+
{
|
|
16489
|
+
type: "button",
|
|
16490
|
+
className: tailwindMerge.twMerge(secondaryButtonClasses, "w-full"),
|
|
16491
|
+
onClick: onBack,
|
|
16492
|
+
"aria-label": "Cancelar",
|
|
16493
|
+
"data-test-id": "onramp-form-simple-view-cancel",
|
|
16494
|
+
children: "Cancelar"
|
|
16495
|
+
}
|
|
16496
|
+
);
|
|
16497
|
+
}
|
|
16435
16498
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16436
16499
|
"div",
|
|
16437
16500
|
{
|
|
@@ -16768,41 +16831,7 @@ var OnrampFormSimpleView = ({
|
|
|
16768
16831
|
"data-slot": "onramp-form-simple-footer",
|
|
16769
16832
|
"data-test-id": "onramp-form-simple-view-footer",
|
|
16770
16833
|
className: footerBaseClasses,
|
|
16771
|
-
children:
|
|
16772
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16773
|
-
SecondaryButton,
|
|
16774
|
-
{
|
|
16775
|
-
type: "button",
|
|
16776
|
-
className: secondaryButtonClasses,
|
|
16777
|
-
onClick: onBack,
|
|
16778
|
-
"aria-label": "Cancelar dep\xF3sito",
|
|
16779
|
-
"data-test-id": "onramp-form-simple-view-cancel",
|
|
16780
|
-
children: "Cancelar"
|
|
16781
|
-
}
|
|
16782
|
-
),
|
|
16783
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16784
|
-
PrimaryButton,
|
|
16785
|
-
{
|
|
16786
|
-
type: "button",
|
|
16787
|
-
className: "flex-1 h-12 rounded-[var(--deframe-widget-size-radius-sm)] text-[15px]",
|
|
16788
|
-
onClick: onSubmit,
|
|
16789
|
-
disabled: isSubmitDisabled,
|
|
16790
|
-
"aria-label": submitLabel,
|
|
16791
|
-
"data-test-id": "onramp-form-simple-view-submit",
|
|
16792
|
-
children: isProcessing ? "Processando..." : submitLabel
|
|
16793
|
-
}
|
|
16794
|
-
)
|
|
16795
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
16796
|
-
SecondaryButton,
|
|
16797
|
-
{
|
|
16798
|
-
type: "button",
|
|
16799
|
-
className: tailwindMerge.twMerge(secondaryButtonClasses, "w-full"),
|
|
16800
|
-
onClick: onBack,
|
|
16801
|
-
"aria-label": "Cancelar",
|
|
16802
|
-
"data-test-id": "onramp-form-simple-view-cancel",
|
|
16803
|
-
children: "Cancelar"
|
|
16804
|
-
}
|
|
16805
|
-
)
|
|
16834
|
+
children: footerContent
|
|
16806
16835
|
}
|
|
16807
16836
|
)
|
|
16808
16837
|
]
|