@deframe-sdk/components 0.1.58 → 0.1.60
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 +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +90 -54
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +90 -54
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +3 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -5245,7 +5245,7 @@ var SwapSignatureWarningViewSimple = ({
|
|
|
5245
5245
|
useEffect(() => {
|
|
5246
5246
|
const timer = setTimeout(() => {
|
|
5247
5247
|
onCancel == null ? void 0 : onCancel();
|
|
5248
|
-
},
|
|
5248
|
+
}, 2e3);
|
|
5249
5249
|
return () => clearTimeout(timer);
|
|
5250
5250
|
}, [onCancel]);
|
|
5251
5251
|
return /* @__PURE__ */ jsxs(
|
|
@@ -5437,7 +5437,12 @@ function SuccessIcon() {
|
|
|
5437
5437
|
}
|
|
5438
5438
|
);
|
|
5439
5439
|
}
|
|
5440
|
-
var SwapSuccessViewSimple = ({ labels }) => {
|
|
5440
|
+
var SwapSuccessViewSimple = ({ labels, onClose }) => {
|
|
5441
|
+
React6__default.useEffect(() => {
|
|
5442
|
+
if (!onClose) return;
|
|
5443
|
+
const timer = setTimeout(onClose, 2e3);
|
|
5444
|
+
return () => clearTimeout(timer);
|
|
5445
|
+
}, [onClose]);
|
|
5441
5446
|
return /* @__PURE__ */ jsxs(
|
|
5442
5447
|
"div",
|
|
5443
5448
|
{
|
|
@@ -5639,8 +5644,14 @@ function ErrorIcon() {
|
|
|
5639
5644
|
}
|
|
5640
5645
|
var SwapTransactionFailedViewSimple = ({
|
|
5641
5646
|
errorTitle,
|
|
5642
|
-
errorDescription
|
|
5647
|
+
errorDescription,
|
|
5648
|
+
onBack
|
|
5643
5649
|
}) => {
|
|
5650
|
+
React6__default.useEffect(() => {
|
|
5651
|
+
if (!onBack) return;
|
|
5652
|
+
const timer = setTimeout(onBack, 2e3);
|
|
5653
|
+
return () => clearTimeout(timer);
|
|
5654
|
+
}, [onBack]);
|
|
5644
5655
|
return /* @__PURE__ */ jsxs(
|
|
5645
5656
|
"div",
|
|
5646
5657
|
{
|
|
@@ -10508,7 +10519,7 @@ var ImageBannerCard = ({
|
|
|
10508
10519
|
}
|
|
10509
10520
|
);
|
|
10510
10521
|
};
|
|
10511
|
-
var GRID_COLS = "grid grid-cols-[
|
|
10522
|
+
var GRID_COLS = "grid grid-cols-[1fr_100px_100px_100px] gap-x-[var(--deframe-widget-size-gap-md)]";
|
|
10512
10523
|
var HISTORY_COLORS = {
|
|
10513
10524
|
deposit: "var(--deframe-widget-color-state-info)",
|
|
10514
10525
|
withdraw: "var(--deframe-widget-color-text-secondary)",
|
|
@@ -10520,6 +10531,7 @@ var EarnHubStrategyCard = ({
|
|
|
10520
10531
|
network,
|
|
10521
10532
|
investedFormatted,
|
|
10522
10533
|
earningsFormatted,
|
|
10534
|
+
profitFormatted,
|
|
10523
10535
|
isLoading,
|
|
10524
10536
|
onInvestClick,
|
|
10525
10537
|
onWithdrawClick,
|
|
@@ -10570,6 +10582,7 @@ var EarnHubStrategyCard = ({
|
|
|
10570
10582
|
children: earningsFormatted
|
|
10571
10583
|
}
|
|
10572
10584
|
) }),
|
|
10585
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-center", children: isLoading ? /* @__PURE__ */ jsx(Skeleton, { variant: "rect", width: 50, height: 16 }) : profitFormatted ? /* @__PURE__ */ 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__ */ jsx("span", { className: "text-[length:var(--deframe-widget-font-size-xs)] text-[color:var(--deframe-widget-color-text-tertiary)]", children: "\u2014" }) }),
|
|
10573
10586
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-[var(--deframe-widget-size-gap-xs)]", children: [
|
|
10574
10587
|
/* @__PURE__ */ jsx("div", { className: "flex flex-col items-end", children: isLoading ? /* @__PURE__ */ jsx(Skeleton, { variant: "rect", width: 60, height: 16 }) : investedFormatted ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10575
10588
|
/* @__PURE__ */ 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 }),
|
|
@@ -10773,7 +10786,7 @@ var columnHeaderClasses = [
|
|
|
10773
10786
|
"text-[color:var(--deframe-widget-color-text-tertiary)]",
|
|
10774
10787
|
"leading-[var(--deframe-widget-font-leading-xs)]"
|
|
10775
10788
|
].join(" ");
|
|
10776
|
-
var GRID_COLS2 = "grid grid-cols-[
|
|
10789
|
+
var GRID_COLS2 = "grid grid-cols-[1fr_100px_100px_100px] gap-x-[var(--deframe-widget-size-gap-md)]";
|
|
10777
10790
|
var BANNER_COLORS = [
|
|
10778
10791
|
"var(--deframe-widget-color-brand-primary)",
|
|
10779
10792
|
"var(--deframe-widget-color-brand-secondary)"
|
|
@@ -10870,6 +10883,7 @@ var EarnDesktopViewSimple = ({
|
|
|
10870
10883
|
network: p.strategy.network,
|
|
10871
10884
|
investedFormatted: formatCurrency(p.spotPosition.underlyingBalanceUSD),
|
|
10872
10885
|
earningsFormatted: `${(p.spotPosition.apy * 100).toFixed(2)}%`,
|
|
10886
|
+
profitFormatted: formatCurrency(p.spotPosition.profitInUSD),
|
|
10873
10887
|
isLoading: false,
|
|
10874
10888
|
history: (_a = historyByAsset.get(p.strategy.assetName.toUpperCase())) != null ? _a : [],
|
|
10875
10889
|
onInvestClick: onDeposit ? () => onDeposit(p.strategy.id) : () => {
|
|
@@ -11020,13 +11034,13 @@ var EarnDesktopViewSimple = ({
|
|
|
11020
11034
|
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-sm)]",
|
|
11021
11035
|
"border-t border-[color:var(--deframe-widget-color-border-secondary)]"
|
|
11022
11036
|
),
|
|
11023
|
-
children: [labels == null ? void 0 : labels.columnStrategy, labels == null ? void 0 : labels.
|
|
11037
|
+
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__ */ jsx(
|
|
11024
11038
|
"span",
|
|
11025
11039
|
{
|
|
11026
11040
|
className: twMerge(
|
|
11027
11041
|
columnHeaderClasses,
|
|
11028
|
-
i === 1 && "text-center",
|
|
11029
|
-
i ===
|
|
11042
|
+
(i === 1 || i === 2) && "text-center",
|
|
11043
|
+
i === 3 && "text-right"
|
|
11030
11044
|
),
|
|
11031
11045
|
children: label
|
|
11032
11046
|
},
|
|
@@ -13395,7 +13409,7 @@ var EarnDepositSuccessSimpleView = ({
|
|
|
13395
13409
|
}) => {
|
|
13396
13410
|
React6__default.useEffect(() => {
|
|
13397
13411
|
if (!onClose) return;
|
|
13398
|
-
const timer = setTimeout(onClose,
|
|
13412
|
+
const timer = setTimeout(onClose, 2e3);
|
|
13399
13413
|
return () => clearTimeout(timer);
|
|
13400
13414
|
}, [onClose]);
|
|
13401
13415
|
return /* @__PURE__ */ jsx("div", { "data-test-id": "earn-deposit-success-simple-view", children: /* @__PURE__ */ jsx(
|
|
@@ -13485,7 +13499,7 @@ var EarnDepositWarningSimpleView = ({
|
|
|
13485
13499
|
}) => {
|
|
13486
13500
|
React6__default.useEffect(() => {
|
|
13487
13501
|
if (!onBack) return;
|
|
13488
|
-
const timer = setTimeout(onBack,
|
|
13502
|
+
const timer = setTimeout(onBack, 2e3);
|
|
13489
13503
|
return () => clearTimeout(timer);
|
|
13490
13504
|
}, [onBack]);
|
|
13491
13505
|
return /* @__PURE__ */ jsx("div", { "data-test-id": "earn-deposit-warning-simple-view", children: /* @__PURE__ */ jsx(
|
|
@@ -13577,7 +13591,7 @@ var EarnDepositFailedSimpleView = ({
|
|
|
13577
13591
|
}) => {
|
|
13578
13592
|
React6__default.useEffect(() => {
|
|
13579
13593
|
if (!onBack) return;
|
|
13580
|
-
const timer = setTimeout(onBack,
|
|
13594
|
+
const timer = setTimeout(onBack, 2e3);
|
|
13581
13595
|
return () => clearTimeout(timer);
|
|
13582
13596
|
}, [onBack]);
|
|
13583
13597
|
return /* @__PURE__ */ jsx("div", { "data-test-id": "earn-deposit-failed-simple-view", children: /* @__PURE__ */ jsx(
|
|
@@ -13763,7 +13777,7 @@ var EarnWithdrawSuccessSimpleView = ({
|
|
|
13763
13777
|
}) => {
|
|
13764
13778
|
React6__default.useEffect(() => {
|
|
13765
13779
|
if (!onClose) return;
|
|
13766
|
-
const timer = setTimeout(onClose,
|
|
13780
|
+
const timer = setTimeout(onClose, 2e3);
|
|
13767
13781
|
return () => clearTimeout(timer);
|
|
13768
13782
|
}, [onClose]);
|
|
13769
13783
|
return /* @__PURE__ */ jsx("div", { "data-test-id": "earn-withdraw-success-simple-view", children: /* @__PURE__ */ jsx(
|
|
@@ -13853,7 +13867,7 @@ var EarnWithdrawWarningSimpleView = ({
|
|
|
13853
13867
|
}) => {
|
|
13854
13868
|
React6__default.useEffect(() => {
|
|
13855
13869
|
if (!onBack) return;
|
|
13856
|
-
const timer = setTimeout(onBack,
|
|
13870
|
+
const timer = setTimeout(onBack, 2e3);
|
|
13857
13871
|
return () => clearTimeout(timer);
|
|
13858
13872
|
}, [onBack]);
|
|
13859
13873
|
return /* @__PURE__ */ jsx("div", { "data-test-id": "earn-withdraw-warning-simple-view", children: /* @__PURE__ */ jsx(
|
|
@@ -13945,7 +13959,7 @@ var EarnWithdrawFailedSimpleView = ({
|
|
|
13945
13959
|
}) => {
|
|
13946
13960
|
React6__default.useEffect(() => {
|
|
13947
13961
|
if (!onBack) return;
|
|
13948
|
-
const timer = setTimeout(onBack,
|
|
13962
|
+
const timer = setTimeout(onBack, 2e3);
|
|
13949
13963
|
return () => clearTimeout(timer);
|
|
13950
13964
|
}, [onBack]);
|
|
13951
13965
|
return /* @__PURE__ */ jsx("div", { "data-test-id": "earn-withdraw-failed-simple-view", children: /* @__PURE__ */ jsx(
|
|
@@ -14666,7 +14680,7 @@ var OnchainDepositSuccessSimpleView = ({
|
|
|
14666
14680
|
}) => {
|
|
14667
14681
|
React6.useEffect(() => {
|
|
14668
14682
|
if (!onClose) return;
|
|
14669
|
-
const timer = setTimeout(onClose,
|
|
14683
|
+
const timer = setTimeout(onClose, 2e3);
|
|
14670
14684
|
return () => clearTimeout(timer);
|
|
14671
14685
|
}, [onClose]);
|
|
14672
14686
|
return /* @__PURE__ */ jsx("div", { "data-test-id": "onchain-deposit-success-simple-view", children: /* @__PURE__ */ jsx(
|
|
@@ -15579,7 +15593,7 @@ var OnchainWithdrawSuccessSimpleView = ({
|
|
|
15579
15593
|
}) => {
|
|
15580
15594
|
React6.useEffect(() => {
|
|
15581
15595
|
if (!onClose) return;
|
|
15582
|
-
const timer = setTimeout(onClose,
|
|
15596
|
+
const timer = setTimeout(onClose, 2e3);
|
|
15583
15597
|
return () => clearTimeout(timer);
|
|
15584
15598
|
}, [onClose]);
|
|
15585
15599
|
return /* @__PURE__ */ jsx("div", { "data-test-id": "onchain-withdraw-success-simple-view", children: /* @__PURE__ */ jsx(
|
|
@@ -16059,7 +16073,7 @@ var OnchainWithdrawSignatureWarningSimpleView = ({
|
|
|
16059
16073
|
}) => {
|
|
16060
16074
|
React6.useEffect(() => {
|
|
16061
16075
|
if (!onCancel) return;
|
|
16062
|
-
const timer = setTimeout(onCancel,
|
|
16076
|
+
const timer = setTimeout(onCancel, 2e3);
|
|
16063
16077
|
return () => clearTimeout(timer);
|
|
16064
16078
|
}, [onCancel]);
|
|
16065
16079
|
return /* @__PURE__ */ jsx("div", { "data-test-id": "onchain-withdraw-signature-warning-simple-view", children: /* @__PURE__ */ jsx(
|
|
@@ -16366,6 +16380,7 @@ var OnrampFormSimpleView = ({
|
|
|
16366
16380
|
error
|
|
16367
16381
|
}) => {
|
|
16368
16382
|
const hasPixCode = !!pixCode;
|
|
16383
|
+
const isWaitingForPixPayment = hasPixCode && !isExpired;
|
|
16369
16384
|
const isSubmitDisabled = !amount || amount === "0" || amount === "" || isBelowMinAmount || hasNoAmount || isProcessing;
|
|
16370
16385
|
const panelBaseClasses = [
|
|
16371
16386
|
"relative flex flex-col overflow-hidden w-[420px]",
|
|
@@ -16412,6 +16427,61 @@ var OnrampFormSimpleView = ({
|
|
|
16412
16427
|
"hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_60%,transparent)]",
|
|
16413
16428
|
"hover:text-[color:var(--deframe-widget-color-text-primary)]"
|
|
16414
16429
|
].join(" ");
|
|
16430
|
+
let footerContent;
|
|
16431
|
+
if (!hasPixCode) {
|
|
16432
|
+
footerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16433
|
+
/* @__PURE__ */ jsx(
|
|
16434
|
+
SecondaryButton,
|
|
16435
|
+
{
|
|
16436
|
+
type: "button",
|
|
16437
|
+
className: secondaryButtonClasses,
|
|
16438
|
+
onClick: onBack,
|
|
16439
|
+
"aria-label": "Cancelar dep\xF3sito",
|
|
16440
|
+
"data-test-id": "onramp-form-simple-view-cancel",
|
|
16441
|
+
children: "Cancelar"
|
|
16442
|
+
}
|
|
16443
|
+
),
|
|
16444
|
+
/* @__PURE__ */ jsx(
|
|
16445
|
+
PrimaryButton,
|
|
16446
|
+
{
|
|
16447
|
+
type: "button",
|
|
16448
|
+
className: "flex-1 h-12 rounded-[var(--deframe-widget-size-radius-sm)] text-[15px]",
|
|
16449
|
+
onClick: onSubmit,
|
|
16450
|
+
disabled: isSubmitDisabled,
|
|
16451
|
+
"aria-label": submitLabel,
|
|
16452
|
+
"data-test-id": "onramp-form-simple-view-submit",
|
|
16453
|
+
children: isProcessing ? "Processando..." : submitLabel
|
|
16454
|
+
}
|
|
16455
|
+
)
|
|
16456
|
+
] });
|
|
16457
|
+
} else if (isWaitingForPixPayment) {
|
|
16458
|
+
footerContent = /* @__PURE__ */ jsxs(
|
|
16459
|
+
PrimaryButton,
|
|
16460
|
+
{
|
|
16461
|
+
type: "button",
|
|
16462
|
+
className: "w-full h-12 rounded-[var(--deframe-widget-size-radius-sm)] text-[15px]",
|
|
16463
|
+
disabled: true,
|
|
16464
|
+
"aria-label": "Aguardando pagamento PIX",
|
|
16465
|
+
"data-test-id": "onramp-form-simple-view-waiting-payment",
|
|
16466
|
+
children: [
|
|
16467
|
+
"Aguardando pagamento ",
|
|
16468
|
+
/* @__PURE__ */ jsx(LoadingDots, {})
|
|
16469
|
+
]
|
|
16470
|
+
}
|
|
16471
|
+
);
|
|
16472
|
+
} else {
|
|
16473
|
+
footerContent = /* @__PURE__ */ jsx(
|
|
16474
|
+
SecondaryButton,
|
|
16475
|
+
{
|
|
16476
|
+
type: "button",
|
|
16477
|
+
className: twMerge(secondaryButtonClasses, "w-full"),
|
|
16478
|
+
onClick: onBack,
|
|
16479
|
+
"aria-label": "Cancelar",
|
|
16480
|
+
"data-test-id": "onramp-form-simple-view-cancel",
|
|
16481
|
+
children: "Cancelar"
|
|
16482
|
+
}
|
|
16483
|
+
);
|
|
16484
|
+
}
|
|
16415
16485
|
return /* @__PURE__ */ jsxs(
|
|
16416
16486
|
"div",
|
|
16417
16487
|
{
|
|
@@ -16748,41 +16818,7 @@ var OnrampFormSimpleView = ({
|
|
|
16748
16818
|
"data-slot": "onramp-form-simple-footer",
|
|
16749
16819
|
"data-test-id": "onramp-form-simple-view-footer",
|
|
16750
16820
|
className: footerBaseClasses,
|
|
16751
|
-
children:
|
|
16752
|
-
/* @__PURE__ */ jsx(
|
|
16753
|
-
SecondaryButton,
|
|
16754
|
-
{
|
|
16755
|
-
type: "button",
|
|
16756
|
-
className: secondaryButtonClasses,
|
|
16757
|
-
onClick: onBack,
|
|
16758
|
-
"aria-label": "Cancelar dep\xF3sito",
|
|
16759
|
-
"data-test-id": "onramp-form-simple-view-cancel",
|
|
16760
|
-
children: "Cancelar"
|
|
16761
|
-
}
|
|
16762
|
-
),
|
|
16763
|
-
/* @__PURE__ */ jsx(
|
|
16764
|
-
PrimaryButton,
|
|
16765
|
-
{
|
|
16766
|
-
type: "button",
|
|
16767
|
-
className: "flex-1 h-12 rounded-[var(--deframe-widget-size-radius-sm)] text-[15px]",
|
|
16768
|
-
onClick: onSubmit,
|
|
16769
|
-
disabled: isSubmitDisabled,
|
|
16770
|
-
"aria-label": submitLabel,
|
|
16771
|
-
"data-test-id": "onramp-form-simple-view-submit",
|
|
16772
|
-
children: isProcessing ? "Processando..." : submitLabel
|
|
16773
|
-
}
|
|
16774
|
-
)
|
|
16775
|
-
] }) : /* @__PURE__ */ jsx(
|
|
16776
|
-
SecondaryButton,
|
|
16777
|
-
{
|
|
16778
|
-
type: "button",
|
|
16779
|
-
className: twMerge(secondaryButtonClasses, "w-full"),
|
|
16780
|
-
onClick: onBack,
|
|
16781
|
-
"aria-label": "Cancelar",
|
|
16782
|
-
"data-test-id": "onramp-form-simple-view-cancel",
|
|
16783
|
-
children: "Cancelar"
|
|
16784
|
-
}
|
|
16785
|
-
)
|
|
16821
|
+
children: footerContent
|
|
16786
16822
|
}
|
|
16787
16823
|
)
|
|
16788
16824
|
]
|
|
@@ -16988,7 +17024,7 @@ var OnrampSuccessSimpleView = ({
|
|
|
16988
17024
|
}) => {
|
|
16989
17025
|
React6.useEffect(() => {
|
|
16990
17026
|
if (!onGoToDashboard) return;
|
|
16991
|
-
const timer = setTimeout(onGoToDashboard,
|
|
17027
|
+
const timer = setTimeout(onGoToDashboard, 2e3);
|
|
16992
17028
|
return () => clearTimeout(timer);
|
|
16993
17029
|
}, [onGoToDashboard]);
|
|
16994
17030
|
return /* @__PURE__ */ jsx("div", { "data-test-id": "onramp-success-simple-view", children: /* @__PURE__ */ jsx(
|
|
@@ -17986,7 +18022,7 @@ var OfframpSuccessSimpleView = ({
|
|
|
17986
18022
|
}) => {
|
|
17987
18023
|
React6.useEffect(() => {
|
|
17988
18024
|
if (!onClose) return;
|
|
17989
|
-
const timer = setTimeout(onClose,
|
|
18025
|
+
const timer = setTimeout(onClose, 2e3);
|
|
17990
18026
|
return () => clearTimeout(timer);
|
|
17991
18027
|
}, [onClose]);
|
|
17992
18028
|
return /* @__PURE__ */ jsx("div", { "data-test-id": "offramp-success-simple-view", children: /* @__PURE__ */ jsx(
|