@deframe-sdk/components 0.1.36 → 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
@@ -9353,7 +9353,6 @@ var ImageBannerCard = ({
9353
9353
  );
9354
9354
  };
9355
9355
  var GRID_COLS = "grid grid-cols-[1fr_100px_130px] gap-x-[var(--deframe-widget-size-gap-md)]";
9356
- var HISTORY_PAGE_SIZE = 5;
9357
9356
  var HISTORY_CONFIG = {
9358
9357
  deposit: { label: "Depositado", color: "var(--deframe-widget-color-state-info)" },
9359
9358
  withdraw: { label: "Sacado", color: "var(--deframe-widget-color-text-secondary)" },
@@ -9371,14 +9370,11 @@ var EarnHubStrategyCard = ({
9371
9370
  history = [],
9372
9371
  labels
9373
9372
  }) => {
9374
- var _a, _b, _c, _d, _e;
9373
+ var _a, _b, _c, _d;
9375
9374
  const [expanded, setExpanded] = React6__default.useState(false);
9376
- const [showAll, setShowAll] = React6__default.useState(false);
9377
9375
  const investLabel = (_a = labels == null ? void 0 : labels.investLabel) != null ? _a : "Depositar";
9378
9376
  const withdrawLabel = (_b = labels == null ? void 0 : labels.withdrawLabel) != null ? _b : "Sacar";
9379
9377
  const historyTitle = (_c = labels == null ? void 0 : labels.historyTitle) != null ? _c : "Hist\xF3rico";
9380
- const visibleHistory = showAll ? history : history.slice(0, HISTORY_PAGE_SIZE);
9381
- const hasMore = history.length > HISTORY_PAGE_SIZE && !showAll;
9382
9378
  return /* @__PURE__ */ jsxs(
9383
9379
  "li",
9384
9380
  {
@@ -9471,7 +9467,7 @@ var EarnHubStrategyCard = ({
9471
9467
  ),
9472
9468
  history.length > 0 && /* @__PURE__ */ jsxs("div", { "data-test-id": "earn-hub-strategy-card-history", children: [
9473
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 }),
9474
- /* @__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) => {
9475
9471
  var _a2;
9476
9472
  const config = (_a2 = HISTORY_CONFIG[entry.type]) != null ? _a2 : HISTORY_CONFIG.deposit;
9477
9473
  const isClickable = !!entry.onClick;
@@ -9510,26 +9506,7 @@ var EarnHubStrategyCard = ({
9510
9506
  },
9511
9507
  entry.id
9512
9508
  );
9513
- }) }),
9514
- hasMore && /* @__PURE__ */ jsx(
9515
- "button",
9516
- {
9517
- type: "button",
9518
- onClick: () => setShowAll(true),
9519
- className: twMerge(
9520
- "mt-[var(--deframe-widget-size-gap-sm)] w-full",
9521
- "text-[length:var(--deframe-widget-font-size-xs)] [font-weight:var(--deframe-widget-font-weight-medium)]",
9522
- "text-[color:var(--deframe-widget-color-text-secondary)]",
9523
- "font-[var(--deframe-widget-font-family)]",
9524
- "hover:text-[color:var(--deframe-widget-color-brand-primary)]",
9525
- "transition-colors duration-150 cursor-pointer",
9526
- "py-[var(--deframe-widget-size-padding-y-xs)]",
9527
- "border-t border-[color:var(--deframe-widget-color-border-tertiary)]",
9528
- "outline-none bg-transparent border-x-0 border-b-0"
9529
- ),
9530
- children: (_e = labels == null ? void 0 : labels.showMoreLabel) != null ? _e : `Ver mais (${history.length - HISTORY_PAGE_SIZE} itens)`
9531
- }
9532
- )
9509
+ }) })
9533
9510
  ] })
9534
9511
  ]
9535
9512
  }