@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.js CHANGED
@@ -9377,7 +9377,6 @@ var ImageBannerCard = ({
9377
9377
  );
9378
9378
  };
9379
9379
  var GRID_COLS = "grid grid-cols-[1fr_100px_130px] gap-x-[var(--deframe-widget-size-gap-md)]";
9380
- var HISTORY_PAGE_SIZE = 5;
9381
9380
  var HISTORY_CONFIG = {
9382
9381
  deposit: { label: "Depositado", color: "var(--deframe-widget-color-state-info)" },
9383
9382
  withdraw: { label: "Sacado", color: "var(--deframe-widget-color-text-secondary)" },
@@ -9395,14 +9394,11 @@ var EarnHubStrategyCard = ({
9395
9394
  history = [],
9396
9395
  labels
9397
9396
  }) => {
9398
- var _a, _b, _c, _d, _e;
9397
+ var _a, _b, _c, _d;
9399
9398
  const [expanded, setExpanded] = React6__namespace.default.useState(false);
9400
- const [showAll, setShowAll] = React6__namespace.default.useState(false);
9401
9399
  const investLabel = (_a = labels == null ? void 0 : labels.investLabel) != null ? _a : "Depositar";
9402
9400
  const withdrawLabel = (_b = labels == null ? void 0 : labels.withdrawLabel) != null ? _b : "Sacar";
9403
9401
  const historyTitle = (_c = labels == null ? void 0 : labels.historyTitle) != null ? _c : "Hist\xF3rico";
9404
- const visibleHistory = showAll ? history : history.slice(0, HISTORY_PAGE_SIZE);
9405
- const hasMore = history.length > HISTORY_PAGE_SIZE && !showAll;
9406
9402
  return /* @__PURE__ */ jsxRuntime.jsxs(
9407
9403
  "li",
9408
9404
  {
@@ -9495,7 +9491,7 @@ var EarnHubStrategyCard = ({
9495
9491
  ),
9496
9492
  history.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "earn-hub-strategy-card-history", children: [
9497
9493
  /* @__PURE__ */ jsxRuntime.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 }),
9498
- /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "list-none m-0 p-0", children: visibleHistory.map((entry) => {
9494
+ /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "list-none m-0 p-0 max-h-[200px] overflow-y-auto", children: history.map((entry) => {
9499
9495
  var _a2;
9500
9496
  const config = (_a2 = HISTORY_CONFIG[entry.type]) != null ? _a2 : HISTORY_CONFIG.deposit;
9501
9497
  const isClickable = !!entry.onClick;
@@ -9534,26 +9530,7 @@ var EarnHubStrategyCard = ({
9534
9530
  },
9535
9531
  entry.id
9536
9532
  );
9537
- }) }),
9538
- hasMore && /* @__PURE__ */ jsxRuntime.jsx(
9539
- "button",
9540
- {
9541
- type: "button",
9542
- onClick: () => setShowAll(true),
9543
- className: tailwindMerge.twMerge(
9544
- "mt-[var(--deframe-widget-size-gap-sm)] w-full",
9545
- "text-[length:var(--deframe-widget-font-size-xs)] [font-weight:var(--deframe-widget-font-weight-medium)]",
9546
- "text-[color:var(--deframe-widget-color-text-secondary)]",
9547
- "font-[var(--deframe-widget-font-family)]",
9548
- "hover:text-[color:var(--deframe-widget-color-brand-primary)]",
9549
- "transition-colors duration-150 cursor-pointer",
9550
- "py-[var(--deframe-widget-size-padding-y-xs)]",
9551
- "border-t border-[color:var(--deframe-widget-color-border-tertiary)]",
9552
- "outline-none bg-transparent border-x-0 border-b-0"
9553
- ),
9554
- children: (_e = labels == null ? void 0 : labels.showMoreLabel) != null ? _e : `Ver mais (${history.length - HISTORY_PAGE_SIZE} itens)`
9555
- }
9556
- )
9533
+ }) })
9557
9534
  ] })
9558
9535
  ]
9559
9536
  }