@deframe-sdk/components 0.1.21 → 0.1.23

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
@@ -8,6 +8,9 @@ var framerMotion = require('framer-motion');
8
8
  var md = require('react-icons/md');
9
9
  var io5 = require('react-icons/io5');
10
10
  var pi = require('react-icons/pi');
11
+ var Link2 = require('next/link');
12
+
13
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
14
 
12
15
  function _interopNamespace(e) {
13
16
  if (e && e.__esModule) return e;
@@ -28,6 +31,7 @@ function _interopNamespace(e) {
28
31
  }
29
32
 
30
33
  var React6__namespace = /*#__PURE__*/_interopNamespace(React6);
34
+ var Link2__default = /*#__PURE__*/_interopDefault(Link2);
31
35
 
32
36
  var __defProp = Object.defineProperty;
33
37
  var __defProps = Object.defineProperties;
@@ -7449,7 +7453,7 @@ var variantStyles = {
7449
7453
  var Label = ({ children, variant = "primary", className }) => {
7450
7454
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: tailwindMerge.twMerge(variantStyles[variant], className), children });
7451
7455
  };
7452
- var HistoryItemSkeleton = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full bg-bg-subtle dark:bg-bg-subtle-dark rounded-xs min-h-[72px] flex items-center justify-between px-md py-sm", children: [
7456
+ var HistoryItemSkeleton = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full bg-[var(--deframe-widget-color-bg-subtle)] rounded-xs min-h-[72px] flex items-center justify-between px-md py-sm", children: [
7453
7457
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-sm flex-1 min-w-0", children: [
7454
7458
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-10 h-10 rounded-xl bg-bg-muted dark:bg-bg-muted-dark animate-pulse flex-shrink-0" }),
7455
7459
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-xs flex-1 min-w-0", children: [
@@ -7504,8 +7508,7 @@ var StrategyGridCard = ({
7504
7508
  "data-test-id": "strategy-grid-card",
7505
7509
  className: tailwindMerge.twMerge(
7506
7510
  "flex flex-col gap-[var(--deframe-widget-size-gap-md)] p-[var(--deframe-widget-size-padding-x-md)] rounded-[var(--deframe-widget-size-radius-sm)] h-[136px] min-h-[136px] flex-shrink-0",
7507
- "bg-[var(--deframe-widget-color-bg-primary)]",
7508
- "hover:bg-[var(--deframe-widget-color-bg-tertiary)]",
7511
+ "bg-[var(--deframe-widget-color-bg-raised)]",
7509
7512
  "transition-colors cursor-pointer text-left w-full",
7510
7513
  className
7511
7514
  ),
@@ -7575,7 +7578,7 @@ var EarnInvestmentSummaryView = ({
7575
7578
  processingBadgeTitle,
7576
7579
  className
7577
7580
  }) => {
7578
- return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: tailwindMerge.twMerge("flex flex-col gap-md p-lg bg-bg-subtle dark:bg-bg-subtle-dark rounded", className), children: [
7581
+ return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: tailwindMerge.twMerge("flex flex-col gap-md p-lg bg-[var(--deframe-widget-color-bg-subtle)] rounded", className), children: [
7579
7582
  /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "text-text-secondary dark:text-text-secondary-dark", children: overviewDescription }),
7580
7583
  /* @__PURE__ */ jsxRuntime.jsx(
7581
7584
  WalletBalances,
@@ -7614,7 +7617,7 @@ var EarnInvestedSectionView = ({
7614
7617
  {
7615
7618
  className: tailwindMerge.twMerge(
7616
7619
  "flex flex-col gap-[var(--deframe-widget-size-gap-md)] p-[var(--deframe-widget-size-padding-x-lg)]",
7617
- "bg-[var(--deframe-widget-color-bg-secondary)] rounded-[var(--deframe-widget-size-radius-sm)]",
7620
+ "bg-[var(--deframe-widget-color-bg-subtle)] rounded-[var(--deframe-widget-size-radius-sm)]",
7618
7621
  className
7619
7622
  ),
7620
7623
  children: [
@@ -7627,8 +7630,7 @@ var EarnInvestedSectionView = ({
7627
7630
  type: "button",
7628
7631
  onClick: () => onItemClick == null ? void 0 : onItemClick(item.strategyId),
7629
7632
  className: tailwindMerge.twMerge(
7630
- "flex items-center gap-[var(--deframe-widget-size-gap-md)] p-[var(--deframe-widget-size-padding-x-md)] bg-[var(--deframe-widget-color-bg-primary)] rounded-[var(--deframe-widget-size-radius-sm)]",
7631
- "hover:bg-[var(--deframe-widget-color-bg-tertiary)]",
7633
+ "flex items-center gap-[var(--deframe-widget-size-gap-md)] p-[var(--deframe-widget-size-padding-x-md)] bg-[var(--deframe-widget-color-bg-raised)] rounded-[var(--deframe-widget-size-radius-sm)]",
7632
7634
  "transition-colors cursor-pointer text-left w-full",
7633
7635
  !isLast && "border-b border-[var(--deframe-widget-color-border-secondary)]"
7634
7636
  ),
@@ -7680,7 +7682,7 @@ var EarnExploreGridView = ({
7680
7682
  {
7681
7683
  className: tailwindMerge.twMerge(
7682
7684
  "flex flex-col gap-[var(--deframe-widget-size-gap-md)] p-[var(--deframe-widget-size-padding-x-lg)]",
7683
- "bg-[var(--deframe-widget-color-bg-secondary)] rounded-[var(--deframe-widget-size-radius-sm)]",
7685
+ "bg-[var(--deframe-widget-color-bg-subtle)] rounded-[var(--deframe-widget-size-radius-sm)]",
7684
7686
  className
7685
7687
  ),
7686
7688
  children: [
@@ -7699,7 +7701,7 @@ var EarnExploreGridView = ({
7699
7701
  {
7700
7702
  className: tailwindMerge.twMerge(
7701
7703
  "flex flex-col gap-[var(--deframe-widget-size-gap-md)] p-[var(--deframe-widget-size-padding-x-lg)]",
7702
- "bg-[var(--deframe-widget-color-bg-secondary)] rounded-[var(--deframe-widget-size-radius-sm)]",
7704
+ "bg-[var(--deframe-widget-color-bg-subtle)] rounded-[var(--deframe-widget-size-radius-sm)]",
7703
7705
  className
7704
7706
  ),
7705
7707
  children: [
@@ -7714,7 +7716,7 @@ var EarnExploreGridView = ({
7714
7716
  {
7715
7717
  className: tailwindMerge.twMerge(
7716
7718
  "flex flex-col gap-[var(--deframe-widget-size-gap-md)] p-[var(--deframe-widget-size-padding-x-lg)]",
7717
- "bg-[var(--deframe-widget-color-bg-secondary)] rounded-[var(--deframe-widget-size-radius-sm)]",
7719
+ "bg-[var(--deframe-widget-color-bg-subtle)] rounded-[var(--deframe-widget-size-radius-sm)]",
7718
7720
  className
7719
7721
  ),
7720
7722
  children: [
@@ -7763,7 +7765,7 @@ var EarnRecentTransactionsView = ({
7763
7765
  {
7764
7766
  className: tailwindMerge.twMerge(
7765
7767
  "flex flex-col gap-md p-lg",
7766
- "bg-bg-subtle dark:bg-bg-subtle-dark rounded",
7768
+ "bg-[var(--deframe-widget-color-bg-subtle)] rounded",
7767
7769
  className
7768
7770
  ),
7769
7771
  children: [
@@ -9113,6 +9115,471 @@ var EarnWithdrawFailedView = ({
9113
9115
  }
9114
9116
  );
9115
9117
  };
9118
+ var DashboardCard = ({ children, className }) => {
9119
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "dashboard-card", className: tailwindMerge.twMerge("bg-[var(--deframe-widget-color-bg-subtle)] rounded", className), children });
9120
+ };
9121
+ var DashboardTransactionsPlaceholder = () => {
9122
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "dashboard-transactions-placeholder", className: "flex flex-col items-center justify-center py-16 gap-4", children: [
9123
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-20 h-20 bg-[var(--deframe-widget-color-bg-muted)] rounded-full flex justify-center items-center", children: /* @__PURE__ */ jsxRuntime.jsx(pi.PiClockCountdownBold, { className: "w-10 h-10 text-[var(--deframe-widget-color-text-tertiary)]" }) }),
9124
+ /* @__PURE__ */ jsxRuntime.jsx(TextHeading, { variant: "h3", children: "Nenhuma transa\xE7\xE3o ainda" }),
9125
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-medium", className: "text-center text-[var(--deframe-widget-color-text-secondary)]", children: "Assim que voc\xEA come\xE7ar a movimentar fundos, seu hist\xF3rico de transa\xE7\xF5es aparecer\xE1 aqui." })
9126
+ ] });
9127
+ };
9128
+ var DashboardBalancesBreakdown = ({
9129
+ isLoadingBalances,
9130
+ formattedTokenPositions,
9131
+ formattedEarnPositions,
9132
+ layout = "vertical"
9133
+ }) => {
9134
+ if (layout === "horizontal") {
9135
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "dashboard-balances-breakdown-horizontal", className: "hidden lg:block w-full mt-8", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full gap-4 items-stretch", children: [
9136
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 basis-0 min-w-0 bg-[var(--deframe-widget-color-bg-secondary)] rounded p-4 flex flex-col", children: [
9137
+ /* @__PURE__ */ jsxRuntime.jsx(Text_default, { children: "Cripto" }),
9138
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: isLoadingBalances ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-5 bg-[var(--deframe-widget-color-bg-muted)] rounded w-32 animate-pulse mt-2" }, "skeleton-crypto") : /* @__PURE__ */ jsxRuntime.jsx(
9139
+ framerMotion.motion.div,
9140
+ {
9141
+ initial: { opacity: 0, x: 10 },
9142
+ animate: { opacity: 1, x: 0 },
9143
+ exit: { opacity: 0, x: -10 },
9144
+ transition: { duration: 0.4, delay: 0.1, ease: "easeOut" },
9145
+ className: "mt-2",
9146
+ children: /* @__PURE__ */ jsxRuntime.jsx(Text_default, { children: formattedTokenPositions })
9147
+ },
9148
+ "crypto-value"
9149
+ ) })
9150
+ ] }),
9151
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 basis-0 min-w-0 bg-[var(--deframe-widget-color-bg-secondary)] rounded p-4 flex flex-col", children: [
9152
+ /* @__PURE__ */ jsxRuntime.jsx(Text_default, { children: "Investimentos" }),
9153
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: isLoadingBalances ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-5 bg-[var(--deframe-widget-color-bg-muted)] rounded w-32 animate-pulse mt-2" }, "skeleton-earn") : /* @__PURE__ */ jsxRuntime.jsx(
9154
+ framerMotion.motion.div,
9155
+ {
9156
+ initial: { opacity: 0, x: 10 },
9157
+ animate: { opacity: 1, x: 0 },
9158
+ exit: { opacity: 0, x: -10 },
9159
+ transition: { duration: 0.4, delay: 0.2, ease: "easeOut" },
9160
+ className: "mt-2",
9161
+ children: /* @__PURE__ */ jsxRuntime.jsx(Text_default, { children: formattedEarnPositions })
9162
+ },
9163
+ "earn-value"
9164
+ ) })
9165
+ ] })
9166
+ ] }) });
9167
+ }
9168
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "dashboard-balances-breakdown-vertical", className: "lg:hidden w-full mt-8", children: [
9169
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center w-full mb-6", children: [
9170
+ /* @__PURE__ */ jsxRuntime.jsx(Text_default, { children: "Cripto" }),
9171
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: isLoadingBalances ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-5 bg-[var(--deframe-widget-color-bg-muted)] rounded w-32 animate-pulse" }, "skeleton-crypto") : /* @__PURE__ */ jsxRuntime.jsx(
9172
+ framerMotion.motion.div,
9173
+ {
9174
+ initial: { opacity: 0, x: 10 },
9175
+ animate: { opacity: 1, x: 0 },
9176
+ exit: { opacity: 0, x: -10 },
9177
+ transition: { duration: 0.4, delay: 0.1, ease: "easeOut" },
9178
+ children: /* @__PURE__ */ jsxRuntime.jsx(Text_default, { children: formattedTokenPositions })
9179
+ },
9180
+ "crypto-value"
9181
+ ) })
9182
+ ] }),
9183
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center w-full", children: [
9184
+ /* @__PURE__ */ jsxRuntime.jsx(Text_default, { children: "Investimentos" }),
9185
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: isLoadingBalances ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-5 bg-[var(--deframe-widget-color-bg-muted)] rounded w-32 animate-pulse" }, "skeleton-earn") : /* @__PURE__ */ jsxRuntime.jsx(
9186
+ framerMotion.motion.div,
9187
+ {
9188
+ initial: { opacity: 0, x: 10 },
9189
+ animate: { opacity: 1, x: 0 },
9190
+ exit: { opacity: 0, x: -10 },
9191
+ transition: { duration: 0.4, delay: 0.2, ease: "easeOut" },
9192
+ children: /* @__PURE__ */ jsxRuntime.jsx(Text_default, { children: formattedEarnPositions })
9193
+ },
9194
+ "earn-value"
9195
+ ) })
9196
+ ] })
9197
+ ] });
9198
+ };
9199
+ var DashboardTokenListView = ({
9200
+ tokens,
9201
+ isLoading,
9202
+ className,
9203
+ showCard = true,
9204
+ onDepositClick
9205
+ }) => {
9206
+ const [searchQuery, setSearchQuery] = React6.useState("");
9207
+ const filteredTokens = tokens.filter((token) => {
9208
+ if (isNaN(token.amountInUSD) || token.amountInUSD < 0.01) return false;
9209
+ if (!searchQuery) return true;
9210
+ const query = searchQuery.toLowerCase();
9211
+ return token.symbol.toLowerCase().includes(query) || token.name.toLowerCase().includes(query);
9212
+ });
9213
+ const content = /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "dashboard-token-list", children: [
9214
+ showCard && /* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "mb-6", children: "Seus tokens" }),
9215
+ !isLoading && tokens.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "dashboard-token-search", className: `${showCard ? "mb-6" : "mt-6 mb-6"} h-14 bg-[var(--deframe-widget-color-bg-raised)] flex items-center justify-center w-full border border-[var(--deframe-widget-color-border-default)] px-2 py-0.5 rounded gap-1`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 flex items-center relative", children: [
9216
+ /* @__PURE__ */ jsxRuntime.jsx(
9217
+ Input2,
9218
+ {
9219
+ "data-test-id": "dashboard-token-search-input",
9220
+ type: "text",
9221
+ placeholder: "Pesquisar aqui...",
9222
+ value: searchQuery,
9223
+ onChange: (e) => setSearchQuery(e.target.value),
9224
+ className: "w-full h-full p-4 pr-12"
9225
+ }
9226
+ ),
9227
+ /* @__PURE__ */ jsxRuntime.jsx(md.MdOutlineSearch, { className: "w-4 h-4 text-[var(--deframe-widget-color-text-secondary)] absolute right-4" })
9228
+ ] }) }),
9229
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 p-2", children: [
9230
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { variant: "circle", width: "40px", height: "40px", shimmer: true }),
9231
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
9232
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: "80px", height: "16px", shimmer: true, className: "mb-2" }),
9233
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: "128px", height: "12px", shimmer: true })
9234
+ ] }),
9235
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: "64px", height: "16px", shimmer: true })
9236
+ ] }, i)) }) : filteredTokens.length > 0 ? filteredTokens.map((token, index) => /* @__PURE__ */ jsxRuntime.jsx(
9237
+ framerMotion.motion.div,
9238
+ {
9239
+ initial: { opacity: 0, y: 20 },
9240
+ animate: { opacity: 1, y: 0 },
9241
+ transition: {
9242
+ duration: 0.4,
9243
+ delay: index * 0.1,
9244
+ ease: "easeOut"
9245
+ },
9246
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
9247
+ ListItem,
9248
+ {
9249
+ "data-test-id": `dashboard-token-item-${token.symbol.toLowerCase()}`,
9250
+ containerClassName: `p-2 ${index > 0 ? "mt-4" : ""} bg-[var(--deframe-widget-color-bg-raised)] cursor-pointer`,
9251
+ children: [
9252
+ /* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-10 h-10", children: [
9253
+ /* @__PURE__ */ jsxRuntime.jsx(
9254
+ "img",
9255
+ {
9256
+ src: token.logoUrl,
9257
+ alt: token.name,
9258
+ className: "w-10 h-10 rounded-full object-cover"
9259
+ }
9260
+ ),
9261
+ token.networkLogoUrl && /* @__PURE__ */ jsxRuntime.jsx(
9262
+ "img",
9263
+ {
9264
+ src: token.networkLogoUrl,
9265
+ alt: token.networkName || "",
9266
+ className: "absolute -bottom-1 border border-bg-default p-px -right-1 w-6 h-6 rounded-full object-cover bg-white"
9267
+ }
9268
+ )
9269
+ ] }) }),
9270
+ /* @__PURE__ */ jsxRuntime.jsxs(ListItemContent, { className: "ml-4", children: [
9271
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody, { children: token.symbol }),
9272
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "text-[var(--deframe-widget-color-text-secondary)]", children: token.name })
9273
+ ] }),
9274
+ /* @__PURE__ */ jsxRuntime.jsx(ListItemRightSide, { className: "flex flex-col items-end", children: token.isUpdating ? /* @__PURE__ */ jsxRuntime.jsx(LoadingDots, {}) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9275
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "font-semibold", children: token.formattedFiatValue }),
9276
+ /* @__PURE__ */ jsxRuntime.jsxs(TextBody, { variant: "text-small", className: "text-[var(--deframe-widget-color-text-secondary)]", children: [
9277
+ token.formattedAmount,
9278
+ " ",
9279
+ token.symbol
9280
+ ] })
9281
+ ] }) })
9282
+ ]
9283
+ }
9284
+ )
9285
+ },
9286
+ token.id || index
9287
+ )) : /* @__PURE__ */ jsxRuntime.jsx(
9288
+ framerMotion.motion.div,
9289
+ {
9290
+ initial: { opacity: 0, y: 20 },
9291
+ animate: { opacity: 1, y: 0 },
9292
+ transition: { duration: 0.4 },
9293
+ className: "flex flex-col items-center justify-center",
9294
+ children: searchQuery ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9295
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-20 h-20 rounded-full bg-[var(--deframe-widget-color-bg-muted)] flex items-center justify-center mb-4", children: /* @__PURE__ */ jsxRuntime.jsx(md.MdOutlineSearch, { className: "w-10 h-10 text-[var(--deframe-widget-color-text-secondary)]" }) }),
9296
+ /* @__PURE__ */ jsxRuntime.jsx(TextHeading, { className: "text-center mb-4", children: "Nenhum token encontrado" }),
9297
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-large", className: "text-center mb-4", children: "Tente buscar por outro nome ou s\xEDmbolo." })
9298
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9299
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-20 h-20 rounded-full bg-[var(--deframe-widget-color-bg-muted)] flex items-center justify-center mb-4", children: /* @__PURE__ */ jsxRuntime.jsx(md.MdQrCodeScanner, { className: "w-10 h-10 text-[var(--deframe-widget-color-text-secondary)]" }) }),
9300
+ /* @__PURE__ */ jsxRuntime.jsx(TextHeading, { className: "text-center mb-4", children: "Deposite e comece a usar a wallet" }),
9301
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-large", className: "text-center mb-4", children: "Use Pix para adicionar saldo instantaneamente na sua carteira." }),
9302
+ onDepositClick && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onDepositClick, children: /* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { children: "Depositar via Pix" }) })
9303
+ ] })
9304
+ }
9305
+ ) })
9306
+ ] });
9307
+ if (showCard) {
9308
+ return /* @__PURE__ */ jsxRuntime.jsx(DashboardCard, { className: `p-6 bg-[var(--deframe-widget-color-bg-subtle)] ${className || ""}`, children: content });
9309
+ }
9310
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: content });
9311
+ };
9312
+ var DashboardStrategiesListView = ({
9313
+ strategies,
9314
+ isLoading,
9315
+ searchQuery = "",
9316
+ limit = 5,
9317
+ onStrategyClick
9318
+ }) => {
9319
+ if (isLoading) {
9320
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "dashboard-strategies-list-loading", className: "space-y-4", children: Array.from({ length: limit }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 p-2", children: [
9321
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-10 h-10 rounded-full bg-[var(--deframe-widget-color-bg-muted)] animate-pulse" }),
9322
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
9323
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 bg-[var(--deframe-widget-color-bg-muted)] rounded w-20 mb-2 animate-pulse" }),
9324
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-3 bg-[var(--deframe-widget-color-bg-muted)] rounded w-32 animate-pulse" })
9325
+ ] }),
9326
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 bg-[var(--deframe-widget-color-bg-muted)] rounded w-16 animate-pulse" })
9327
+ ] }, i)) });
9328
+ }
9329
+ const query = searchQuery.trim().toLowerCase();
9330
+ const filteredStrategies = strategies.filter((strategy) => {
9331
+ if (!query) return true;
9332
+ return strategy.assetName.toLowerCase().includes(query) || strategy.protocol.toLowerCase().includes(query);
9333
+ });
9334
+ const displayStrategies = filteredStrategies.slice(0, limit);
9335
+ if (displayStrategies.length === 0) {
9336
+ return /* @__PURE__ */ jsxRuntime.jsx(
9337
+ framerMotion.motion.div,
9338
+ {
9339
+ initial: { opacity: 0, y: 20 },
9340
+ animate: { opacity: 1, y: 0 },
9341
+ transition: { duration: 0.4 },
9342
+ className: "flex flex-col items-center justify-center py-12",
9343
+ children: /* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "text-[var(--deframe-widget-color-text-secondary)]", children: searchQuery ? "Nenhuma estrat\xE9gia encontrada" : "Nenhum investimento encontrado" })
9344
+ }
9345
+ );
9346
+ }
9347
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "dashboard-strategies-list", children: displayStrategies.map((strategy, index) => /* @__PURE__ */ jsxRuntime.jsx(
9348
+ framerMotion.motion.div,
9349
+ {
9350
+ initial: { opacity: 0, y: 20 },
9351
+ animate: { opacity: 1, y: 0 },
9352
+ transition: {
9353
+ duration: 0.4,
9354
+ delay: index * 0.1,
9355
+ ease: "easeOut"
9356
+ },
9357
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
9358
+ ListItem,
9359
+ {
9360
+ containerClassName: `${index > 0 ? "mt-4" : ""}`,
9361
+ onClick: () => onStrategyClick(strategy.id),
9362
+ children: [
9363
+ /* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsxRuntime.jsx(
9364
+ "img",
9365
+ {
9366
+ src: strategy.logoUrl,
9367
+ alt: strategy.assetName,
9368
+ className: "w-10 h-10 rounded-full object-cover"
9369
+ }
9370
+ ) }),
9371
+ /* @__PURE__ */ jsxRuntime.jsxs(ListItemContent, { className: "ml-4", children: [
9372
+ /* @__PURE__ */ jsxRuntime.jsxs(TextBody, { children: [
9373
+ "Rendimento ",
9374
+ strategy.assetName
9375
+ ] }),
9376
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "text-[var(--deframe-widget-color-text-secondary)]", children: strategy.protocol })
9377
+ ] }),
9378
+ /* @__PURE__ */ jsxRuntime.jsxs(ListItemRightSide, { className: "flex flex-col items-end", children: [
9379
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "text-[var(--deframe-widget-color-text-secondary)]" }),
9380
+ strategy.apyFormatted !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs(TextBody, { variant: "text-small", className: "text-[var(--deframe-widget-color-brand-primary)]", children: [
9381
+ "APY ",
9382
+ strategy.apyFormatted
9383
+ ] })
9384
+ ] })
9385
+ ]
9386
+ }
9387
+ )
9388
+ },
9389
+ strategy.id || index
9390
+ )) });
9391
+ };
9392
+ var DashboardPortfolioView = ({
9393
+ formattedTotalValue,
9394
+ isLoading,
9395
+ onDepositClick,
9396
+ onWithdrawClick,
9397
+ onSwapClick,
9398
+ formattedTokenPositions,
9399
+ formattedEarnPositions
9400
+ }) => {
9401
+ return /* @__PURE__ */ jsxRuntime.jsx(DashboardCard, { className: "p-6 bg-[var(--deframe-widget-color-bg-subtle)]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col w-full h-full", children: [
9402
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "mb-6", children: "Portf\xF3lio" }),
9403
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 mb-2", children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 bg-[var(--deframe-widget-color-bg-muted)] rounded w-64 animate-pulse" }, "skeleton") : /* @__PURE__ */ jsxRuntime.jsx(
9404
+ framerMotion.motion.p,
9405
+ {
9406
+ initial: { opacity: 0, y: 10 },
9407
+ animate: { opacity: 1, y: 0 },
9408
+ exit: { opacity: 0, y: -10 },
9409
+ transition: { duration: 0.5, ease: "easeOut" },
9410
+ className: "text-2xl font-bold text-[var(--deframe-widget-color-text-primary)] flex items-center gap-2",
9411
+ children: formattedTotalValue
9412
+ },
9413
+ "value"
9414
+ ) }) }),
9415
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex lg:hidden flex-row gap-2 sm:gap-4 mt-6 w-full", children: [
9416
+ /* @__PURE__ */ jsxRuntime.jsx(Link2__default.default, { "data-testid": "dashboard-quick-action-deposit-mobile", href: "/dashboard/deposit", className: "flex-1 min-w-0 cursor-pointer", onClick: onDepositClick, children: /* @__PURE__ */ jsxRuntime.jsxs(PrimaryButton, { children: [
9417
+ /* @__PURE__ */ jsxRuntime.jsx(md.MdOutlineArrowUpward, { className: "w-4 h-4 shrink-0" }),
9418
+ "Depositar"
9419
+ ] }) }),
9420
+ /* @__PURE__ */ jsxRuntime.jsx(Link2__default.default, { "data-testid": "dashboard-quick-action-withdraw-mobile", href: "/dashboard/withdraw", className: "flex-1 min-w-0 cursor-pointer", onClick: onWithdrawClick, children: /* @__PURE__ */ jsxRuntime.jsxs(PrimaryButton, { children: [
9421
+ /* @__PURE__ */ jsxRuntime.jsx(md.MdOutlineArrowDownward, { className: "w-4 h-4 shrink-0" }),
9422
+ "Sacar"
9423
+ ] }) }),
9424
+ /* @__PURE__ */ jsxRuntime.jsx(Link2__default.default, { "data-testid": "dashboard-quick-action-swap-mobile", href: "/dashboard/swap", className: "flex-1 min-w-0 cursor-pointer", onClick: onSwapClick, children: /* @__PURE__ */ jsxRuntime.jsxs(PrimaryButton, { children: [
9425
+ /* @__PURE__ */ jsxRuntime.jsx(md.MdOutlineSwapHoriz, { className: "w-4 h-4 shrink-0" }),
9426
+ "Trocar"
9427
+ ] }) })
9428
+ ] }),
9429
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
9430
+ DashboardBalancesBreakdown,
9431
+ {
9432
+ isLoadingBalances: isLoading,
9433
+ formattedTokenPositions,
9434
+ formattedEarnPositions,
9435
+ layout: "vertical"
9436
+ }
9437
+ ) }),
9438
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hidden lg:block", children: /* @__PURE__ */ jsxRuntime.jsx(
9439
+ DashboardBalancesBreakdown,
9440
+ {
9441
+ isLoadingBalances: isLoading,
9442
+ formattedTokenPositions,
9443
+ formattedEarnPositions,
9444
+ layout: "horizontal"
9445
+ }
9446
+ ) })
9447
+ ] }) });
9448
+ };
9449
+ var DashboardTokensView = ({
9450
+ sortedRegularTokens,
9451
+ regularTokens,
9452
+ isLoadingBalances,
9453
+ activeTab,
9454
+ onTabChange,
9455
+ strategiesContent
9456
+ }) => {
9457
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9458
+ /* @__PURE__ */ jsxRuntime.jsx(DashboardTokenListView, { tokens: sortedRegularTokens, isLoading: isLoadingBalances, className: "hidden lg:block" }),
9459
+ /* @__PURE__ */ jsxRuntime.jsx(DashboardCard, { className: "lg:hidden p-6 bg-[var(--deframe-widget-color-bg-subtle)]", children: /* @__PURE__ */ jsxRuntime.jsxs(
9460
+ Tabs,
9461
+ {
9462
+ value: activeTab,
9463
+ onValueChange: (value) => onTabChange(value),
9464
+ children: [
9465
+ /* @__PURE__ */ jsxRuntime.jsxs(TabsList, { className: "w-full mb-3 flex justify-center", children: [
9466
+ /* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "tokens", children: "Cripto" }),
9467
+ /* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "strategies", children: "Investimentos" })
9468
+ ] }),
9469
+ /* @__PURE__ */ jsxRuntime.jsxs(TabsContent, { value: "tokens", children: [
9470
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "mb-6", children: "Seus tokens" }),
9471
+ /* @__PURE__ */ jsxRuntime.jsx(DashboardTokenListView, { tokens: regularTokens, isLoading: isLoadingBalances, showCard: false })
9472
+ ] }),
9473
+ /* @__PURE__ */ jsxRuntime.jsx(TabsContent, { value: "strategies", children: strategiesContent })
9474
+ ]
9475
+ }
9476
+ ) })
9477
+ ] });
9478
+ };
9479
+ var DashboardRecentTransactionsView = ({
9480
+ isLoading,
9481
+ isEmpty,
9482
+ transactions,
9483
+ onViewAllClick
9484
+ }) => {
9485
+ return /* @__PURE__ */ jsxRuntime.jsx(DashboardCard, { className: "p-6 bg-[var(--deframe-widget-color-bg-subtle)]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
9486
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-start", children: [
9487
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "mb-6", children: "Transa\xE7\xF5es recentes" }),
9488
+ /* @__PURE__ */ jsxRuntime.jsx(Link2__default.default, { href: "/dashboard/history", onClick: onViewAllClick, children: /* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "text-[var(--deframe-widget-color-brand-primary)] cursor-pointer hover:underline", children: "Ver todas" }) })
9489
+ ] }),
9490
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2 mt-[-16px]", children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 p-2", children: [
9491
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { variant: "circle", width: "40px", height: "40px", shimmer: true }),
9492
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
9493
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: "160px", height: "14px", shimmer: true, className: "mb-2" }),
9494
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: "220px", height: "12px", shimmer: true })
9495
+ ] }),
9496
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: "96px", height: "14px", shimmer: true })
9497
+ ] }, i)) }) : isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(DashboardTransactionsPlaceholder, {}) : transactions.map((item) => {
9498
+ const MainIcon = item.mainIcon;
9499
+ const TypeIcon = item.typeIcon;
9500
+ return /* @__PURE__ */ jsxRuntime.jsxs(
9501
+ ListItem,
9502
+ {
9503
+ containerClassName: "p-2 mt-4 bg-[var(--deframe-widget-color-bg-secondary)] cursor-pointer",
9504
+ onClick: () => item.onClick(),
9505
+ children: [
9506
+ /* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
9507
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-10 h-10 rounded-full ${item.iconBgColor} flex items-center justify-center`, children: /* @__PURE__ */ jsxRuntime.jsx(MainIcon, { className: `${item.iconColor}`, size: 20 }) }),
9508
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute -bottom-1 -right-1 w-5 h-5 rounded-full bg-[var(--deframe-widget-color-bg-secondary)] flex items-center justify-center border border-[var(--deframe-widget-color-border-secondary)]", children: /* @__PURE__ */ jsxRuntime.jsx(TypeIcon, { className: `${item.iconColor}`, size: 12 }) })
9509
+ ] }) }),
9510
+ /* @__PURE__ */ jsxRuntime.jsxs(ListItemContent, { className: "ml-4", children: [
9511
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", children: item.formattedDate }),
9512
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "text-xs text-[var(--deframe-widget-color-text-secondary)]", children: item.label })
9513
+ ] }),
9514
+ /* @__PURE__ */ jsxRuntime.jsxs(ListItemRightSide, { className: "text-right", children: [
9515
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", children: item.rightPrimary }),
9516
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "text-xs text-[var(--deframe-widget-color-text-secondary)]", children: item.rightSecondary })
9517
+ ] })
9518
+ ]
9519
+ },
9520
+ item.id
9521
+ );
9522
+ }) })
9523
+ ] }) });
9524
+ };
9525
+ var DashboardInvestmentOpportunitiesView = ({
9526
+ isLoadingBalances,
9527
+ formattedTotalProfit,
9528
+ strategiesContent,
9529
+ onViewAllStrategiesClick
9530
+ }) => {
9531
+ return /* @__PURE__ */ jsxRuntime.jsx(DashboardCard, { className: "hidden lg:block p-6", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col space-y-4", children: [
9532
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-large", children: "Oportunidades de investimento" }),
9533
+ /* @__PURE__ */ jsxRuntime.jsxs(DashboardCard, { className: "bg-[var(--deframe-widget-color-bg-secondary)] flex flex-col space-y-2 p-4", children: [
9534
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody, { children: "Rendimentos" }),
9535
+ isLoadingBalances ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-baseline gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: "80px", height: "24px", shimmer: true }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-baseline gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-large", children: formattedTotalProfit }) })
9536
+ ] }),
9537
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col", children: strategiesContent }),
9538
+ /* @__PURE__ */ jsxRuntime.jsx(Link2__default.default, { href: "/dashboard/earn", className: "w-full", onClick: onViewAllStrategiesClick, children: /* @__PURE__ */ jsxRuntime.jsx(SecondaryButton, { children: "Ver todas as estrat\xE9gias" }) })
9539
+ ] }) });
9540
+ };
9541
+ var DashboardView = ({
9542
+ portfolio,
9543
+ tokens,
9544
+ recentTransactions,
9545
+ investmentOpportunities,
9546
+ quickActions,
9547
+ banner
9548
+ }) => {
9549
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "dashboard-page", className: "w-full relative overflow-hidden mx-auto rounded p-6 lg:p-12", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6 max-w-[1400px] mx-auto", children: [
9550
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lg:col-span-2 space-y-6", children: [
9551
+ /* @__PURE__ */ jsxRuntime.jsx(DashboardPortfolioView, __spreadValues({}, portfolio)),
9552
+ /* @__PURE__ */ jsxRuntime.jsx(DashboardCard, { "data-testid": "dashboard-quick-actions-card", className: "hidden lg:block p-6", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col space-y-3", children: [
9553
+ /* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "mb-6", children: "A\xE7\xF5es r\xE1pidas" }),
9554
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row gap-4 w-full", children: [
9555
+ /* @__PURE__ */ jsxRuntime.jsx(Link2__default.default, { "data-testid": "dashboard-quick-action-deposit", href: "/dashboard/deposit", className: "flex-1 min-w-0 cursor-pointer", onClick: () => quickActions.onDepositClick(), children: /* @__PURE__ */ jsxRuntime.jsxs(PrimaryButton, { children: [
9556
+ /* @__PURE__ */ jsxRuntime.jsx(md.MdOutlineArrowUpward, { className: "w-4 h-4 shrink-0" }),
9557
+ "Depositar"
9558
+ ] }) }),
9559
+ /* @__PURE__ */ jsxRuntime.jsx(Link2__default.default, { "data-testid": "dashboard-quick-action-withdraw", href: "/dashboard/withdraw", className: "flex-1 min-w-0 cursor-pointer", onClick: () => quickActions.onWithdrawClick(), children: /* @__PURE__ */ jsxRuntime.jsxs(PrimaryButton, { children: [
9560
+ /* @__PURE__ */ jsxRuntime.jsx(md.MdOutlineArrowDownward, { className: "w-4 h-4 shrink-0" }),
9561
+ "Sacar"
9562
+ ] }) }),
9563
+ /* @__PURE__ */ jsxRuntime.jsx(Link2__default.default, { "data-testid": "dashboard-quick-action-swap", href: "/dashboard/swap", className: "flex-1 min-w-0 cursor-pointer", onClick: () => quickActions.onSwapClick(), children: /* @__PURE__ */ jsxRuntime.jsxs(PrimaryButton, { children: [
9564
+ /* @__PURE__ */ jsxRuntime.jsx(md.MdOutlineSwapHoriz, { className: "w-4 h-4 shrink-0" }),
9565
+ "Trocar"
9566
+ ] }) })
9567
+ ] })
9568
+ ] }) }),
9569
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full bg-[#002608] rounded shadow-[0px_1px_3px_0px_rgba(0,0,0,0.1)] flex items-center justify-between cursor-pointer", children: /* @__PURE__ */ jsxRuntime.jsx(
9570
+ "img",
9571
+ {
9572
+ src: banner.imageUrl,
9573
+ alt: banner.altText,
9574
+ className: "w-full h-[90%] object-cover rounded"
9575
+ }
9576
+ ) }),
9577
+ /* @__PURE__ */ jsxRuntime.jsx(DashboardTokensView, __spreadValues({}, tokens)),
9578
+ /* @__PURE__ */ jsxRuntime.jsx(DashboardRecentTransactionsView, __spreadValues({}, recentTransactions))
9579
+ ] }),
9580
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:col-span-1 space-y-6", children: /* @__PURE__ */ jsxRuntime.jsx(DashboardInvestmentOpportunitiesView, __spreadValues({}, investmentOpportunities)) })
9581
+ ] }) });
9582
+ };
9116
9583
 
9117
9584
  exports.ActionButton = ActionButton;
9118
9585
  exports.ActionSheet = ActionSheet;
@@ -9132,6 +9599,16 @@ exports.ConfirmSwapButtonView = ConfirmSwapButtonView;
9132
9599
  exports.ConfirmSwapButtonViewSimple = ConfirmSwapButtonViewSimple;
9133
9600
  exports.ConnectWalletList = ConnectWalletList;
9134
9601
  exports.Currency = Currency;
9602
+ exports.DashboardBalancesBreakdown = DashboardBalancesBreakdown;
9603
+ exports.DashboardCard = DashboardCard;
9604
+ exports.DashboardInvestmentOpportunitiesView = DashboardInvestmentOpportunitiesView;
9605
+ exports.DashboardPortfolioView = DashboardPortfolioView;
9606
+ exports.DashboardRecentTransactionsView = DashboardRecentTransactionsView;
9607
+ exports.DashboardStrategiesListView = DashboardStrategiesListView;
9608
+ exports.DashboardTokenListView = DashboardTokenListView;
9609
+ exports.DashboardTokensView = DashboardTokensView;
9610
+ exports.DashboardTransactionsPlaceholder = DashboardTransactionsPlaceholder;
9611
+ exports.DashboardView = DashboardView;
9135
9612
  exports.DeframeComponentsProvider = DeframeComponentsProvider;
9136
9613
  exports.DetailsHeader = DetailsHeader;
9137
9614
  exports.EarnAmountInputView = EarnAmountInputView;