@deframe-sdk/components 0.1.35 → 0.1.37

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.mjs CHANGED
@@ -9014,16 +9014,12 @@ var StrategyGridCard = ({
9014
9014
  ]
9015
9015
  }
9016
9016
  );
9017
- var strategyCardClasses = [
9018
- "w-full",
9017
+ var cardClasses = [
9018
+ "w-full flex flex-col gap-[var(--deframe-widget-size-gap-sm)]",
9019
+ "px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
9019
9020
  "bg-[var(--deframe-widget-color-bg-secondary)]",
9020
9021
  "border border-[color:var(--deframe-widget-color-border-secondary)]",
9021
- "rounded-[var(--deframe-widget-size-radius-md)]",
9022
- "p-[var(--deframe-widget-size-padding-x-md)]",
9023
- "flex flex-row items-center justify-between",
9024
- "gap-[var(--deframe-widget-size-gap-md)]",
9025
- "hover:border-[color:var(--deframe-widget-color-border-primary)]",
9026
- "transition-colors"
9022
+ "rounded-[var(--deframe-widget-size-radius-md)]"
9027
9023
  ].join(" ");
9028
9024
  var StrategyGridCardSimple = ({
9029
9025
  logoUrl,
@@ -9037,41 +9033,49 @@ var StrategyGridCardSimple = ({
9037
9033
  var _a, _b, _c, _d, _e;
9038
9034
  const investLabel = (_a = labels == null ? void 0 : labels.investLabel) != null ? _a : "Depositar";
9039
9035
  const riskBadgeMap = {
9040
- low: /* @__PURE__ */ jsx(LowRiskBadge, { label: (_b = labels == null ? void 0 : labels.riskLow) != null ? _b : "Risco Baixo" }),
9041
- medium: /* @__PURE__ */ jsx(MediumRiskBadge, { label: (_c = labels == null ? void 0 : labels.riskMedium) != null ? _c : "Risco M\xE9dio" }),
9042
- high: /* @__PURE__ */ jsx(HighRiskBadge, { label: (_d = labels == null ? void 0 : labels.riskHigh) != null ? _d : "Risco Alto" })
9036
+ low: /* @__PURE__ */ jsx(LowRiskBadge, { label: (_b = labels == null ? void 0 : labels.riskLow) != null ? _b : "Baixo" }),
9037
+ medium: /* @__PURE__ */ jsx(MediumRiskBadge, { label: (_c = labels == null ? void 0 : labels.riskMedium) != null ? _c : "M\xE9dio" }),
9038
+ high: /* @__PURE__ */ jsx(HighRiskBadge, { label: (_d = labels == null ? void 0 : labels.riskHigh) != null ? _d : "Alto" })
9043
9039
  };
9044
9040
  return /* @__PURE__ */ jsxs(
9045
9041
  "article",
9046
9042
  {
9047
9043
  "data-slot": "strategy-grid-card-simple",
9048
9044
  "data-test-id": "strategy-grid-card-simple",
9049
- className: strategyCardClasses,
9045
+ className: cardClasses,
9050
9046
  children: [
9051
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)] min-w-0", children: [
9047
+ /* @__PURE__ */ jsxs("div", { className: "w-full flex items-center gap-[var(--deframe-widget-size-gap-sm)]", children: [
9052
9048
  /* @__PURE__ */ jsx("div", { className: "w-10 h-10 rounded-full bg-[var(--deframe-widget-color-bg-tertiary)] flex items-center justify-center overflow-hidden shrink-0", children: /* @__PURE__ */ jsx("img", { alt: title, src: logoUrl, referrerPolicy: "no-referrer", className: "w-full h-full object-contain" }) }),
9053
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col min-w-0", children: [
9054
- /* @__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)] truncate", children: title }),
9055
- /* @__PURE__ */ jsx("span", { className: "text-[length:var(--deframe-widget-font-size-xs)] text-[color:var(--deframe-widget-color-text-secondary)] leading-[var(--deframe-widget-font-leading-xs)]", children: chainName })
9056
- ] })
9057
- ] }),
9058
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
9059
- /* @__PURE__ */ jsx("span", { className: "text-[length:var(--deframe-widget-font-size-xs)] [font-weight:var(--deframe-widget-font-weight-medium)] uppercase tracking-[0.08em] text-[color:var(--deframe-widget-color-text-tertiary)]", children: (_e = labels == null ? void 0 : labels.apyLabel) != null ? _e : "Rendimento" }),
9060
- /* @__PURE__ */ jsx("span", { className: "text-[length:var(--deframe-widget-font-size-lg)] [font-weight:var(--deframe-widget-font-weight-bold)] text-[color:var(--deframe-widget-color-brand-primary)] font-[var(--deframe-widget-font-family)] leading-none mt-[2px]", children: apyFormatted })
9049
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 min-w-0", children: [
9050
+ /* @__PURE__ */ jsx("span", { className: "text-[14px] [font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-primary)] leading-[1.3] font-[var(--deframe-widget-font-family)] truncate", children: title }),
9051
+ /* @__PURE__ */ jsx("span", { className: "text-[12px] text-[color:var(--deframe-widget-color-text-secondary)] leading-[1.4]", children: chainName })
9052
+ ] }),
9053
+ /* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: riskBadgeMap[riskLevel] })
9061
9054
  ] }),
9062
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)] flex-shrink-0", children: [
9063
- /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 whitespace-nowrap", children: riskBadgeMap[riskLevel] }),
9055
+ /* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-[var(--deframe-widget-size-gap-sm)]", children: [
9056
+ /* @__PURE__ */ 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: (_e = labels == null ? void 0 : labels.apyLabel) != null ? _e : "Rendimento" }),
9064
9057
  /* @__PURE__ */ jsx(
9065
- PrimaryButton,
9058
+ "span",
9066
9059
  {
9067
- "data-test-id": "strategy-grid-card-simple-invest",
9068
- "aria-label": `${investLabel} ${title}`,
9069
- onClick: onInvestClick,
9070
- className: "h-9 text-[13px] px-[var(--deframe-widget-size-padding-x-md)]",
9071
- children: investLabel
9060
+ className: twMerge(
9061
+ "text-[22px] [font-weight:var(--deframe-widget-font-weight-bold)]",
9062
+ "text-[color:var(--deframe-widget-color-brand-primary)]",
9063
+ "font-[var(--deframe-widget-font-family)] leading-[1.1]"
9064
+ ),
9065
+ children: apyFormatted
9072
9066
  }
9073
9067
  )
9074
- ] })
9068
+ ] }),
9069
+ /* @__PURE__ */ jsx(
9070
+ PrimaryButton,
9071
+ {
9072
+ "data-test-id": "strategy-grid-card-simple-invest",
9073
+ "aria-label": `${investLabel} ${title}`,
9074
+ onClick: onInvestClick,
9075
+ className: "h-9 text-[13px] w-full",
9076
+ children: investLabel
9077
+ }
9078
+ )
9075
9079
  ]
9076
9080
  }
9077
9081
  );
@@ -9349,7 +9353,6 @@ var ImageBannerCard = ({
9349
9353
  );
9350
9354
  };
9351
9355
  var GRID_COLS = "grid grid-cols-[1fr_100px_130px] gap-x-[var(--deframe-widget-size-gap-md)]";
9352
- var HISTORY_PAGE_SIZE = 5;
9353
9356
  var HISTORY_CONFIG = {
9354
9357
  deposit: { label: "Depositado", color: "var(--deframe-widget-color-state-info)" },
9355
9358
  withdraw: { label: "Sacado", color: "var(--deframe-widget-color-text-secondary)" },
@@ -9367,14 +9370,11 @@ var EarnHubStrategyCard = ({
9367
9370
  history = [],
9368
9371
  labels
9369
9372
  }) => {
9370
- var _a, _b, _c, _d, _e;
9373
+ var _a, _b, _c, _d;
9371
9374
  const [expanded, setExpanded] = React6__default.useState(false);
9372
- const [showAll, setShowAll] = React6__default.useState(false);
9373
9375
  const investLabel = (_a = labels == null ? void 0 : labels.investLabel) != null ? _a : "Depositar";
9374
9376
  const withdrawLabel = (_b = labels == null ? void 0 : labels.withdrawLabel) != null ? _b : "Sacar";
9375
9377
  const historyTitle = (_c = labels == null ? void 0 : labels.historyTitle) != null ? _c : "Hist\xF3rico";
9376
- const visibleHistory = showAll ? history : history.slice(0, HISTORY_PAGE_SIZE);
9377
- const hasMore = history.length > HISTORY_PAGE_SIZE && !showAll;
9378
9378
  return /* @__PURE__ */ jsxs(
9379
9379
  "li",
9380
9380
  {
@@ -9467,7 +9467,7 @@ var EarnHubStrategyCard = ({
9467
9467
  ),
9468
9468
  history.length > 0 && /* @__PURE__ */ jsxs("div", { "data-test-id": "earn-hub-strategy-card-history", children: [
9469
9469
  /* @__PURE__ */ jsx("span", { className: "text-[length:var(--deframe-widget-font-size-xs)] [font-weight:var(--deframe-widget-font-weight-medium)] uppercase tracking-[0.08em] text-[color:var(--deframe-widget-color-text-tertiary)]", children: historyTitle }),
9470
- /* @__PURE__ */ jsx("ol", { className: "list-none m-0 p-0", children: visibleHistory.map((entry) => {
9470
+ /* @__PURE__ */ jsx("ol", { className: "list-none m-0 p-0 max-h-[200px] overflow-y-auto", children: history.map((entry) => {
9471
9471
  var _a2;
9472
9472
  const config = (_a2 = HISTORY_CONFIG[entry.type]) != null ? _a2 : HISTORY_CONFIG.deposit;
9473
9473
  const isClickable = !!entry.onClick;
@@ -9506,26 +9506,7 @@ var EarnHubStrategyCard = ({
9506
9506
  },
9507
9507
  entry.id
9508
9508
  );
9509
- }) }),
9510
- hasMore && /* @__PURE__ */ jsx(
9511
- "button",
9512
- {
9513
- type: "button",
9514
- onClick: () => setShowAll(true),
9515
- className: twMerge(
9516
- "mt-[var(--deframe-widget-size-gap-sm)] w-full",
9517
- "text-[length:var(--deframe-widget-font-size-xs)] [font-weight:var(--deframe-widget-font-weight-medium)]",
9518
- "text-[color:var(--deframe-widget-color-text-secondary)]",
9519
- "font-[var(--deframe-widget-font-family)]",
9520
- "hover:text-[color:var(--deframe-widget-color-brand-primary)]",
9521
- "transition-colors duration-150 cursor-pointer",
9522
- "py-[var(--deframe-widget-size-padding-y-xs)]",
9523
- "border-t border-[color:var(--deframe-widget-color-border-tertiary)]",
9524
- "outline-none bg-transparent border-x-0 border-b-0"
9525
- ),
9526
- children: (_e = labels == null ? void 0 : labels.showMoreLabel) != null ? _e : `Ver mais (${history.length - HISTORY_PAGE_SIZE} itens)`
9527
- }
9528
- )
9509
+ }) })
9529
9510
  ] })
9530
9511
  ]
9531
9512
  }
@@ -11121,7 +11102,7 @@ var EarnAmountInputSimpleView = ({
11121
11102
  {
11122
11103
  "data-slot": "amount-input-simple-conversion",
11123
11104
  "data-test-id": "earn-amount-input-simple-view-conversion",
11124
- className: "text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)]",
11105
+ className: "text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)] overflow-hidden text-ellipsis whitespace-nowrap max-w-full",
11125
11106
  children: dollarAmountFormatted
11126
11107
  }
11127
11108
  )
@@ -11275,7 +11256,7 @@ var EarnInlineNotificationSimpleView = ({
11275
11256
  };
11276
11257
  var EarnDepositFormViewSimple = ({
11277
11258
  // Header / Layout
11278
- headerTitle,
11259
+ pageTitle,
11279
11260
  onBack,
11280
11261
  onSubmit,
11281
11262
  // Token selector
@@ -11383,7 +11364,7 @@ var EarnDepositFormViewSimple = ({
11383
11364
  "data-slot": "deposit-panel-simple-title",
11384
11365
  "data-test-id": "earn-deposit-form-view-simple-title",
11385
11366
  className: titleBaseClasses,
11386
- children: headerTitle
11367
+ children: pageTitle
11387
11368
  }
11388
11369
  )
11389
11370
  }
@@ -11738,7 +11719,7 @@ var EarnWithdrawFormView = ({
11738
11719
  ] });
11739
11720
  var EarnWithdrawFormViewSimple = ({
11740
11721
  // Header / Layout
11741
- headerTitle,
11722
+ pageTitle,
11742
11723
  onBack,
11743
11724
  onSubmit,
11744
11725
  // Position card (used for inline balance row)
@@ -11841,7 +11822,7 @@ var EarnWithdrawFormViewSimple = ({
11841
11822
  "data-slot": "withdraw-panel-simple-title",
11842
11823
  "data-test-id": "earn-withdraw-form-view-simple-title",
11843
11824
  className: titleBaseClasses,
11844
- children: headerTitle
11825
+ children: pageTitle
11845
11826
  }
11846
11827
  )
11847
11828
  }
@@ -15596,7 +15577,7 @@ var OnrampFormSimpleView = ({
15596
15577
  "px-[var(--deframe-widget-size-padding-x-md)]",
15597
15578
  "pb-[var(--deframe-widget-size-padding-y-md)]"
15598
15579
  ].join(" ");
15599
- const cardClasses2 = twMerge(
15580
+ const cardClasses3 = twMerge(
15600
15581
  "rounded-[var(--deframe-widget-size-radius-sm)]",
15601
15582
  "border border-[color:var(--deframe-widget-color-border-secondary)]",
15602
15583
  "bg-[var(--deframe-widget-color-bg-secondary)]",
@@ -15694,7 +15675,7 @@ var OnrampFormSimpleView = ({
15694
15675
  {
15695
15676
  "data-slot": "onramp-form-simple-amount-card",
15696
15677
  "data-test-id": "onramp-form-simple-view-amount-card",
15697
- className: cardClasses2,
15678
+ className: cardClasses3,
15698
15679
  children: /* @__PURE__ */ jsxs(
15699
15680
  "div",
15700
15681
  {
@@ -15753,7 +15734,7 @@ var OnrampFormSimpleView = ({
15753
15734
  "div",
15754
15735
  {
15755
15736
  "data-test-id": "onramp-form-simple-view-skeleton",
15756
- className: twMerge(cardClasses2, "space-y-3"),
15737
+ className: twMerge(cardClasses3, "space-y-3"),
15757
15738
  children: [
15758
15739
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
15759
15740
  /* @__PURE__ */ jsx(Skeleton, { width: 96, height: 16, shimmer: true }),
@@ -17536,7 +17517,7 @@ var DashboardPortfolioView = ({
17536
17517
  ) })
17537
17518
  ] }) });
17538
17519
  };
17539
- var cardClasses = twMerge(
17520
+ var cardClasses2 = twMerge(
17540
17521
  "w-full self-start flex flex-col gap-[var(--deframe-widget-size-gap-sm)]",
17541
17522
  "bg-[var(--deframe-widget-color-bg-secondary)] border border-[color:var(--deframe-widget-color-border-secondary)]",
17542
17523
  "rounded-[var(--deframe-widget-size-radius-md)]",
@@ -17558,7 +17539,7 @@ function StatCardSkeletonBlock({ showDescription, className }) {
17558
17539
  {
17559
17540
  "data-test-id": "stat-card-skeleton",
17560
17541
  "aria-busy": "true",
17561
- className: twMerge(cardClasses, "self-stretch", className),
17542
+ className: twMerge(cardClasses2, "self-stretch", className),
17562
17543
  children: [
17563
17544
  /* @__PURE__ */ jsx(Skeleton, { variant: "rect", width: 140, height: 11 }),
17564
17545
  /* @__PURE__ */ jsx(Skeleton, { variant: "rect", width: "60%", height: 44 }),
@@ -17594,7 +17575,7 @@ var DashboardPortfolioViewSimple = ({
17594
17575
  assetCount != null ? "grid-cols-[1fr_auto]" : "grid-cols-1"
17595
17576
  ),
17596
17577
  children: [
17597
- /* @__PURE__ */ jsxs("article", { className: twMerge(cardClasses, "self-stretch"), children: [
17578
+ /* @__PURE__ */ jsxs("article", { className: twMerge(cardClasses2, "self-stretch"), children: [
17598
17579
  /* @__PURE__ */ jsx("p", { "data-test-id": "stat-card-label", className: labelClasses, children: "Total da Carteira (USD)" }),
17599
17580
  /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsx(
17600
17581
  motion.p,
@@ -17611,7 +17592,7 @@ var DashboardPortfolioViewSimple = ({
17611
17592
  ) }),
17612
17593
  /* @__PURE__ */ jsx("p", { "data-test-id": "stat-card-description", className: descriptionClasses, children: "Soma do saldo por token (em USD)." })
17613
17594
  ] }),
17614
- assetCount != null && /* @__PURE__ */ jsxs("article", { className: twMerge(cardClasses, "self-stretch min-w-[160px]"), children: [
17595
+ assetCount != null && /* @__PURE__ */ jsxs("article", { className: twMerge(cardClasses2, "self-stretch min-w-[160px]"), children: [
17615
17596
  /* @__PURE__ */ jsx("p", { "data-test-id": "stat-card-label", className: labelClasses, children: "Ativos" }),
17616
17597
  /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsx(
17617
17598
  motion.p,