@deframe-sdk/components 0.1.58 → 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 CHANGED
@@ -2193,6 +2193,8 @@ interface EarnDesktopLabels {
2193
2193
  historyAriaLabel?: string;
2194
2194
  columnStrategy?: string;
2195
2195
  columnYield?: string;
2196
+ columnApy?: string;
2197
+ columnProfit?: string;
2196
2198
  columnInvested?: string;
2197
2199
  totalInvestedLabel?: string;
2198
2200
  totalInvestedDescription?: string;
package/dist/index.d.ts CHANGED
@@ -2193,6 +2193,8 @@ interface EarnDesktopLabels {
2193
2193
  historyAriaLabel?: string;
2194
2194
  columnStrategy?: string;
2195
2195
  columnYield?: string;
2196
+ columnApy?: string;
2197
+ columnProfit?: string;
2196
2198
  columnInvested?: string;
2197
2199
  totalInvestedLabel?: string;
2198
2200
  totalInvestedDescription?: string;
package/dist/index.js CHANGED
@@ -10532,7 +10532,7 @@ var ImageBannerCard = ({
10532
10532
  }
10533
10533
  );
10534
10534
  };
10535
- var GRID_COLS = "grid grid-cols-[1fr_100px_130px] gap-x-[var(--deframe-widget-size-gap-md)]";
10535
+ var GRID_COLS = "grid grid-cols-[1fr_100px_100px_100px] gap-x-[var(--deframe-widget-size-gap-md)]";
10536
10536
  var HISTORY_COLORS = {
10537
10537
  deposit: "var(--deframe-widget-color-state-info)",
10538
10538
  withdraw: "var(--deframe-widget-color-text-secondary)",
@@ -10544,6 +10544,7 @@ var EarnHubStrategyCard = ({
10544
10544
  network,
10545
10545
  investedFormatted,
10546
10546
  earningsFormatted,
10547
+ profitFormatted,
10547
10548
  isLoading,
10548
10549
  onInvestClick,
10549
10550
  onWithdrawClick,
@@ -10594,6 +10595,7 @@ var EarnHubStrategyCard = ({
10594
10595
  children: earningsFormatted
10595
10596
  }
10596
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" }) }),
10597
10599
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-[var(--deframe-widget-size-gap-xs)]", children: [
10598
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: [
10599
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 }),
@@ -10797,7 +10799,7 @@ var columnHeaderClasses = [
10797
10799
  "text-[color:var(--deframe-widget-color-text-tertiary)]",
10798
10800
  "leading-[var(--deframe-widget-font-leading-xs)]"
10799
10801
  ].join(" ");
10800
- var GRID_COLS2 = "grid grid-cols-[1fr_100px_130px] gap-x-[var(--deframe-widget-size-gap-md)]";
10802
+ var GRID_COLS2 = "grid grid-cols-[1fr_100px_100px_100px] gap-x-[var(--deframe-widget-size-gap-md)]";
10801
10803
  var BANNER_COLORS = [
10802
10804
  "var(--deframe-widget-color-brand-primary)",
10803
10805
  "var(--deframe-widget-color-brand-secondary)"
@@ -10894,6 +10896,7 @@ var EarnDesktopViewSimple = ({
10894
10896
  network: p.strategy.network,
10895
10897
  investedFormatted: formatCurrency(p.spotPosition.underlyingBalanceUSD),
10896
10898
  earningsFormatted: `${(p.spotPosition.apy * 100).toFixed(2)}%`,
10899
+ profitFormatted: formatCurrency(p.spotPosition.profitInUSD),
10897
10900
  isLoading: false,
10898
10901
  history: (_a = historyByAsset.get(p.strategy.assetName.toUpperCase())) != null ? _a : [],
10899
10902
  onInvestClick: onDeposit ? () => onDeposit(p.strategy.id) : () => {
@@ -11044,13 +11047,13 @@ var EarnDesktopViewSimple = ({
11044
11047
  "px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-sm)]",
11045
11048
  "border-t border-[color:var(--deframe-widget-color-border-secondary)]"
11046
11049
  ),
11047
- 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(
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(
11048
11051
  "span",
11049
11052
  {
11050
11053
  className: tailwindMerge.twMerge(
11051
11054
  columnHeaderClasses,
11052
- i === 1 && "text-center",
11053
- i === 2 && "text-right"
11055
+ (i === 1 || i === 2) && "text-center",
11056
+ i === 3 && "text-right"
11054
11057
  ),
11055
11058
  children: label
11056
11059
  },
@@ -16390,6 +16393,7 @@ var OnrampFormSimpleView = ({
16390
16393
  error
16391
16394
  }) => {
16392
16395
  const hasPixCode = !!pixCode;
16396
+ const isWaitingForPixPayment = hasPixCode && !isExpired;
16393
16397
  const isSubmitDisabled = !amount || amount === "0" || amount === "" || isBelowMinAmount || hasNoAmount || isProcessing;
16394
16398
  const panelBaseClasses = [
16395
16399
  "relative flex flex-col overflow-hidden w-[420px]",
@@ -16436,6 +16440,61 @@ var OnrampFormSimpleView = ({
16436
16440
  "hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_60%,transparent)]",
16437
16441
  "hover:text-[color:var(--deframe-widget-color-text-primary)]"
16438
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
+ }
16439
16498
  return /* @__PURE__ */ jsxRuntime.jsxs(
16440
16499
  "div",
16441
16500
  {
@@ -16772,41 +16831,7 @@ var OnrampFormSimpleView = ({
16772
16831
  "data-slot": "onramp-form-simple-footer",
16773
16832
  "data-test-id": "onramp-form-simple-view-footer",
16774
16833
  className: footerBaseClasses,
16775
- children: !hasPixCode ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
16776
- /* @__PURE__ */ jsxRuntime.jsx(
16777
- SecondaryButton,
16778
- {
16779
- type: "button",
16780
- className: secondaryButtonClasses,
16781
- onClick: onBack,
16782
- "aria-label": "Cancelar dep\xF3sito",
16783
- "data-test-id": "onramp-form-simple-view-cancel",
16784
- children: "Cancelar"
16785
- }
16786
- ),
16787
- /* @__PURE__ */ jsxRuntime.jsx(
16788
- PrimaryButton,
16789
- {
16790
- type: "button",
16791
- className: "flex-1 h-12 rounded-[var(--deframe-widget-size-radius-sm)] text-[15px]",
16792
- onClick: onSubmit,
16793
- disabled: isSubmitDisabled,
16794
- "aria-label": submitLabel,
16795
- "data-test-id": "onramp-form-simple-view-submit",
16796
- children: isProcessing ? "Processando..." : submitLabel
16797
- }
16798
- )
16799
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(
16800
- SecondaryButton,
16801
- {
16802
- type: "button",
16803
- className: tailwindMerge.twMerge(secondaryButtonClasses, "w-full"),
16804
- onClick: onBack,
16805
- "aria-label": "Cancelar",
16806
- "data-test-id": "onramp-form-simple-view-cancel",
16807
- children: "Cancelar"
16808
- }
16809
- )
16834
+ children: footerContent
16810
16835
  }
16811
16836
  )
16812
16837
  ]