@gearbox-protocol/ui-kit 4.0.0-next.22 → 4.0.0-next.24

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.
Files changed (40) hide show
  1. package/dist/cjs/components/base/history-chart/history-chart.cjs +1 -1
  2. package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
  3. package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
  4. package/dist/cjs/components/graph/default-config.cjs +1 -1
  5. package/dist/cjs/components/graph/formatters.cjs +1 -1
  6. package/dist/cjs/components/graph/graph-current-value.cjs +1 -1
  7. package/dist/cjs/components/graph/graph-tooltip.cjs +1 -1
  8. package/dist/cjs/components/graph/graph.cjs +1 -1
  9. package/dist/cjs/components/graph/index.cjs +1 -1
  10. package/dist/cjs/components/graph/y-axis-scale.cjs +1 -0
  11. package/dist/cjs/components/index.cjs +1 -1
  12. package/dist/cjs/components/trading-view/trading-view.cjs +1 -1
  13. package/dist/cjs/components/yield-breakdown-tooltip/yield-breakdown-tooltip.cjs +1 -1
  14. package/dist/cjs/index.cjs +1 -1
  15. package/dist/cjs/locale/en.json.cjs +1 -1
  16. package/dist/esm/components/base/history-chart/history-chart.js +16 -15
  17. package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +41 -25
  18. package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +38 -39
  19. package/dist/esm/components/graph/default-config.js +44 -24
  20. package/dist/esm/components/graph/formatters.js +123 -128
  21. package/dist/esm/components/graph/graph-current-value.js +11 -11
  22. package/dist/esm/components/graph/graph-tooltip.js +6 -6
  23. package/dist/esm/components/graph/graph.js +597 -547
  24. package/dist/esm/components/graph/index.js +32 -27
  25. package/dist/esm/components/graph/y-axis-scale.js +112 -0
  26. package/dist/esm/components/index.js +496 -491
  27. package/dist/esm/components/trading-view/trading-view.js +83 -82
  28. package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown-tooltip.js +94 -55
  29. package/dist/esm/index.js +649 -644
  30. package/dist/esm/locale/en.json.js +16 -4
  31. package/dist/types/components/base/history-chart/history-chart.d.ts +2 -1
  32. package/dist/types/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.d.ts +4 -2
  33. package/dist/types/components/graph/default-config.d.ts +23 -0
  34. package/dist/types/components/graph/formatters.d.ts +5 -1
  35. package/dist/types/components/graph/graph.d.ts +12 -4
  36. package/dist/types/components/graph/y-axis-scale.d.ts +48 -0
  37. package/dist/types/components/trading-view/trading-view.d.ts +5 -1
  38. package/dist/types/components/yield-breakdown-tooltip/yield-breakdown-tooltip.d.ts +4 -2
  39. package/dist/types/locale/en.json.d.ts +14 -2
  40. package/package.json +3 -3
@@ -1,22 +1,22 @@
1
- import { jsxs as p, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as v, jsx as o } from "react/jsx-runtime";
2
2
  import { useMemo as I, useCallback as fe, useRef as C } from "react";
3
3
  import { toast as be } from "sonner";
4
4
  import { SectionHeading as we } from "../base/section-heading/section-heading.js";
5
5
  import { useIsMobile as he } from "../../hooks/use-media-query.js";
6
6
  import "@gearbox-protocol/sdk";
7
- import { cn as pe } from "../../utils/cn.js";
7
+ import { cn as ve } from "../../utils/cn.js";
8
8
  import "@gearbox-protocol/sdk/common-utils";
9
9
  import "luxon";
10
10
  import "../../utils/z-index.js";
11
- import { DEFAULT_SERIES_COLORS as T, getSeriesColorPalette as ve, GraphLegend as ge } from "../graph/graph.js";
12
- import { GraphViewWithData as xe } from "../graph/graph-view.js";
11
+ import { DEFAULT_SERIES_COLORS as T, getSeriesColorPalette as pe, GraphLegend as xe } from "../graph/graph.js";
12
+ import { GraphViewWithData as ge } from "../graph/graph-view.js";
13
13
  import { Select as Se, SelectTrigger as ye, SelectValue as Ae, SelectContent as Ie, SelectItem as Ce } from "../select/select.js";
14
14
  import { GraphDropdown as Ne } from "./graph-dropdown.js";
15
- const Me = ({ size: e = 16 }) => /* @__PURE__ */ p(
15
+ const Me = ({ size: t = 16 }) => /* @__PURE__ */ v(
16
16
  "svg",
17
17
  {
18
- width: e,
19
- height: e,
18
+ width: t,
19
+ height: t,
20
20
  viewBox: "0 0 24 24",
21
21
  fill: "none",
22
22
  stroke: "currentColor",
@@ -25,15 +25,15 @@ const Me = ({ size: e = 16 }) => /* @__PURE__ */ p(
25
25
  strokeLinejoin: "round",
26
26
  "aria-label": "Expand fullscreen",
27
27
  children: [
28
- /* @__PURE__ */ n("title", { children: "Expand fullscreen" }),
29
- /* @__PURE__ */ n("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" })
28
+ /* @__PURE__ */ o("title", { children: "Expand fullscreen" }),
29
+ /* @__PURE__ */ o("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" })
30
30
  ]
31
31
  }
32
- ), ke = ({ size: e = 16 }) => /* @__PURE__ */ p(
32
+ ), ke = ({ size: t = 16 }) => /* @__PURE__ */ v(
33
33
  "svg",
34
34
  {
35
- width: e,
36
- height: e,
35
+ width: t,
36
+ height: t,
37
37
  viewBox: "0 0 24 24",
38
38
  fill: "none",
39
39
  stroke: "currentColor",
@@ -42,8 +42,8 @@ const Me = ({ size: e = 16 }) => /* @__PURE__ */ p(
42
42
  strokeLinejoin: "round",
43
43
  "aria-label": "Exit fullscreen",
44
44
  children: [
45
- /* @__PURE__ */ n("title", { children: "Exit fullscreen" }),
46
- /* @__PURE__ */ n("path", { d: "M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3" })
45
+ /* @__PURE__ */ o("title", { children: "Exit fullscreen" }),
46
+ /* @__PURE__ */ o("path", { d: "M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3" })
47
47
  ]
48
48
  }
49
49
  ), Ee = {
@@ -51,45 +51,45 @@ const Me = ({ size: e = 16 }) => /* @__PURE__ */ p(
51
51
  rightPriceScale: { borderVisible: !1 },
52
52
  leftPriceScale: { borderVisible: !1 }
53
53
  }, X = "ui-kit:tradingview-series-colors:";
54
- function j(e) {
54
+ function j(t) {
55
55
  if (typeof window > "u" || !window.localStorage)
56
56
  return /* @__PURE__ */ new Map();
57
57
  try {
58
- const r = window.localStorage.getItem(X + e);
58
+ const r = window.localStorage.getItem(X + t);
59
59
  if (!r) return /* @__PURE__ */ new Map();
60
60
  const c = JSON.parse(r);
61
61
  return c == null || typeof c != "object" ? /* @__PURE__ */ new Map() : new Map(
62
62
  Object.entries(c).filter(
63
- ([, o]) => typeof o == "number" && o >= 0 && o < T.length
63
+ ([, n]) => typeof n == "number" && n >= 0 && n < T.length
64
64
  )
65
65
  );
66
66
  } catch {
67
67
  return /* @__PURE__ */ new Map();
68
68
  }
69
69
  }
70
- function Re(e, r) {
70
+ function Re(t, r) {
71
71
  if (!(typeof window > "u" || !window.localStorage))
72
72
  try {
73
73
  window.localStorage.setItem(
74
- X + e,
74
+ X + t,
75
75
  JSON.stringify(Object.fromEntries(r))
76
76
  );
77
77
  } catch {
78
78
  }
79
79
  }
80
- function $(e, r) {
80
+ function $(t, r) {
81
81
  if (r.size === 0) return;
82
- const c = j(e);
83
- for (const [o, v] of r)
84
- c.set(o, v);
85
- Re(e, c);
82
+ const c = j(t);
83
+ for (const [n, p] of r)
84
+ c.set(n, p);
85
+ Re(t, c);
86
86
  }
87
87
  function Ze({
88
- data: e,
88
+ data: t,
89
89
  yMeasureUnit: r,
90
90
  height: c = 306,
91
- defaultGraph: o,
92
- onGraphSelected: v,
91
+ defaultGraph: n,
92
+ onGraphSelected: p,
93
93
  graphs: f,
94
94
  isMultipleSelect: q,
95
95
  range: Q,
@@ -111,9 +111,9 @@ function Ze({
111
111
  seriesColorPersistenceKey: d,
112
112
  title: re,
113
113
  trailing: k,
114
- ...oe
114
+ ...ne
115
115
  }) {
116
- const g = I(() => Array.isArray(e) ? e : e ? [e] : [], [e]), ne = I(() => Array.isArray(e) && e.length > 1, [e]), z = he(), le = fe(
116
+ const x = I(() => Array.isArray(t) ? t : t ? [t] : [], [t]), oe = I(() => Array.isArray(t) && t.length > 1, [t]), z = he(), le = fe(
117
117
  (u, y) => {
118
118
  be.error(_);
119
119
  },
@@ -121,16 +121,16 @@ function Ze({
121
121
  ), ie = I(() => {
122
122
  if (r)
123
123
  return Array.isArray(r) ? r[0] : r;
124
- }, [r]), se = !!(v && f && o), i = C(/* @__PURE__ */ new Map()), b = C(0), F = C(!1);
124
+ }, [r]), se = !!(p && f && n), i = C(/* @__PURE__ */ new Map()), b = C(0), F = C(!1);
125
125
  if (f && f.length > 0 && !F.current) {
126
126
  F.current = !0;
127
127
  const u = d ? j(d) : /* @__PURE__ */ new Map(), y = String(f[0].value);
128
128
  i.current.set(y, 0), b.current = 1;
129
- for (let t = 1; t < f.length; t++) {
130
- const a = String(f[t].value);
131
- if (i.current.has(a)) continue;
132
- const x = u.get(a) ?? t;
133
- i.current.set(a, x), b.current = Math.max(b.current, x + 1);
129
+ for (let e = 1; e < f.length; e++) {
130
+ const m = String(f[e].value);
131
+ if (i.current.has(m)) continue;
132
+ const g = u.get(m) ?? e;
133
+ i.current.set(m, g), b.current = Math.max(b.current, g + 1);
134
134
  }
135
135
  d && $(
136
136
  d,
@@ -140,22 +140,22 @@ function Ze({
140
140
  const w = I(() => {
141
141
  const u = Array.isArray(r) ? r : void 0;
142
142
  if (d) {
143
- const t = j(d);
144
- for (const [a, h] of t)
145
- i.current.has(a) || (i.current.set(a, h), b.current = Math.max(
143
+ const e = j(d);
144
+ for (const [m, h] of e)
145
+ i.current.has(m) || (i.current.set(m, h), b.current = Math.max(
146
146
  b.current,
147
147
  h + 1
148
148
  ));
149
149
  }
150
- const y = g.map((t, a) => {
151
- const h = t?.title || `Series ${a + 1}`, x = o != null ? Array.isArray(o) ? o[0]?.value ?? o[0] : typeof o == "object" && "value" in o ? o.value : o : null, R = g.length === 1 ? x != null ? String(x) : "single" : t?.id || h;
150
+ const y = x.map((e, m) => {
151
+ const h = e?.title || `Series ${m + 1}`, g = n != null ? Array.isArray(n) ? n[0]?.value ?? n[0] : typeof n == "object" && "value" in n ? n.value : n : null, R = x.length === 1 ? g != null ? String(g) : "single" : e?.id || h;
152
152
  if (!i.current.has(R)) {
153
153
  const l = new Set(
154
154
  Array.from(i.current.values())
155
155
  );
156
156
  let s = b.current;
157
- for (let m = 0; m < T.length; m++) {
158
- const A = (b.current + m) % T.length;
157
+ for (let a = 0; a < T.length; a++) {
158
+ const A = (b.current + a) % T.length;
159
159
  if (!l.has(A)) {
160
160
  s = A;
161
161
  break;
@@ -163,33 +163,34 @@ function Ze({
163
163
  }
164
164
  i.current.set(R, s), b.current = s + 1;
165
165
  }
166
- const ae = i.current.get(R) ?? 0, O = ve(ae), me = [...t?.data || []].sort((l, s) => {
167
- const m = typeof l.time == "number" ? l.time : Number(l.time), A = typeof s.time == "number" ? s.time : Number(s.time);
168
- return m - A;
166
+ const me = i.current.get(R) ?? 0, O = pe(me), ae = [...e?.data || []].sort((l, s) => {
167
+ const a = typeof l.time == "number" ? l.time : Number(l.time), A = typeof s.time == "number" ? s.time : Number(s.time);
168
+ return a - A;
169
169
  }).reduce((l, s) => {
170
- const m = s.time;
171
- return l.length === 0 || l[l.length - 1].time !== m ? l.push({ time: m, value: s.value }) : l[l.length - 1] = { time: m, value: s.value }, l;
172
- }, []), J = t?.lineColor ?? t?.color ?? void 0;
170
+ const a = s.time;
171
+ return l.length === 0 || l[l.length - 1].time !== a ? l.push({ time: a, value: s.value }) : l[l.length - 1] = { time: a, value: s.value }, l;
172
+ }, []), J = e?.lineColor ?? e?.color ?? void 0;
173
173
  return {
174
- data: me,
174
+ data: ae,
175
175
  label: h,
176
- yMeasureUnit: u?.[a] ?? (Array.isArray(r) ? void 0 : r),
177
- ...t?.priceScaleId != null && {
178
- priceScaleId: t.priceScaleId
176
+ ...e?.id != null && { id: e.id },
177
+ yMeasureUnit: u?.[m] ?? (Array.isArray(r) ? void 0 : r),
178
+ ...e?.priceScaleId != null && {
179
+ priceScaleId: e.priceScaleId
179
180
  },
180
- ...t?.seriesType != null && {
181
- seriesType: t.seriesType
181
+ ...e?.seriesType != null && {
182
+ seriesType: e.seriesType
182
183
  },
183
- ...t?.lineStyle != null && {
184
- lineStyle: t.lineStyle
184
+ ...e?.lineStyle != null && {
185
+ lineStyle: e.lineStyle
185
186
  },
186
187
  ...J != null ? {
187
188
  lineColor: J,
188
- ...t?.topColor != null && {
189
- topColor: t.topColor
189
+ ...e?.topColor != null && {
190
+ topColor: e.topColor
190
191
  },
191
- ...t?.bottomColor != null && {
192
- bottomColor: t.bottomColor
192
+ ...e?.bottomColor != null && {
193
+ bottomColor: e.bottomColor
193
194
  }
194
195
  } : {
195
196
  color: O.line,
@@ -202,56 +203,56 @@ function Ze({
202
203
  d,
203
204
  i.current
204
205
  ), y;
205
- }, [g, o, r, d]), H = V !== void 0 ? V : M !== void 0 ? M.size > 0 : ne && g.length > 0 ? g.some((u) => !u) : !e, B = C(w);
206
+ }, [x, n, r, d]), H = V !== void 0 ? V : M !== void 0 ? M.size > 0 : oe && x.length > 0 ? x.some((u) => !u) : !t, B = C(w);
206
207
  w.length > 0 && (B.current = w);
207
- const W = w.length > 0 ? w : H ? B.current : w, E = re, ce = !z && N ? !0 : S.length > 0 || se || E != null || k != null, ue = v && f && o ? /* @__PURE__ */ n(
208
+ const W = w.length > 0 ? w : H ? B.current : w, E = re, ce = !z && N ? !0 : S.length > 0 || se || E != null || k != null, ue = p && f && n ? /* @__PURE__ */ o(
208
209
  Ne,
209
210
  {
210
- onSelected: v,
211
+ onSelected: p,
211
212
  items: f,
212
- defaultItem: o,
213
+ defaultItem: n,
213
214
  multiple: q,
214
215
  graphsWithNoData: D,
215
216
  loadingGraphs: M,
216
217
  onNoDataSelected: le
217
218
  }
218
- ) : E != null ? /* @__PURE__ */ n(we, { className: "min-w-0 truncate", children: E }) : null, de = ce && /* @__PURE__ */ p("div", { className: "flex w-full flex-row flex-wrap items-center justify-between gap-3", children: [
219
- /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: ue }),
220
- /* @__PURE__ */ p("div", { className: "flex shrink-0 flex-row flex-nowrap items-center gap-3", children: [
219
+ ) : E != null ? /* @__PURE__ */ o(we, { className: "min-w-0 truncate", children: E }) : null, de = ce && /* @__PURE__ */ v("div", { className: "flex w-full flex-row flex-wrap items-center justify-between gap-3", children: [
220
+ /* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: ue }),
221
+ /* @__PURE__ */ v("div", { className: "flex shrink-0 flex-row flex-nowrap items-center gap-3", children: [
221
222
  k,
222
- k != null && S.length > 0 ? /* @__PURE__ */ n("div", { className: "h-4 w-px shrink-0 bg-border" }) : null,
223
- S.length > 0 ? /* @__PURE__ */ p(Se, { value: Q, onValueChange: Y, children: [
224
- /* @__PURE__ */ n(
223
+ k != null && S.length > 0 ? /* @__PURE__ */ o("div", { className: "h-4 w-px shrink-0 bg-border" }) : null,
224
+ S.length > 0 ? /* @__PURE__ */ v(Se, { value: Q, onValueChange: Y, children: [
225
+ /* @__PURE__ */ o(
225
226
  ye,
226
227
  {
227
228
  size: "sm",
228
229
  className: "h-8 w-auto min-w-[4.5rem] gap-1.5 border-border bg-muted shadow-none",
229
- children: /* @__PURE__ */ n(Ae, {})
230
+ children: /* @__PURE__ */ o(Ae, {})
230
231
  }
231
232
  ),
232
- /* @__PURE__ */ n(Ie, { align: "end", children: S.map((u) => /* @__PURE__ */ n(Ce, { value: u.value, children: u.label }, u.value)) })
233
+ /* @__PURE__ */ o(Ie, { align: "end", children: S.map((u) => /* @__PURE__ */ o(Ce, { value: u.value, children: u.label }, u.value)) })
233
234
  ] }) : null,
234
- !z && N && /* @__PURE__ */ n(
235
+ !z && N && /* @__PURE__ */ o(
235
236
  "button",
236
237
  {
237
238
  type: "button",
238
239
  className: "flex min-h-[26px] min-w-[44px] cursor-pointer items-center justify-center rounded-md border border-muted bg-muted px-2.5 py-1.5 text-center text-xs font-medium leading-[14px] text-muted-foreground transition-colors hover:border-secondary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
239
240
  onClick: N,
240
- children: Z ? /* @__PURE__ */ n(ke, { size: 16 }) : /* @__PURE__ */ n(Me, { size: 16 })
241
+ children: Z ? /* @__PURE__ */ o(ke, { size: 16 }) : /* @__PURE__ */ o(Me, { size: 16 })
241
242
  }
242
243
  )
243
244
  ] })
244
245
  ] });
245
- return /* @__PURE__ */ p(
246
+ return /* @__PURE__ */ v(
246
247
  "div",
247
248
  {
248
- className: pe(
249
+ className: ve(
249
250
  "flex w-full flex-col gap-3 rounded-lg border border-border bg-card p-4 shadow-none",
250
251
  U
251
252
  ),
252
253
  children: [
253
254
  de,
254
- /* @__PURE__ */ n(
255
+ /* @__PURE__ */ o(
255
256
  "div",
256
257
  {
257
258
  style: {
@@ -259,10 +260,10 @@ function Ze({
259
260
  height: c ? `${c}px` : void 0
260
261
  },
261
262
  className: "w-full",
262
- children: /* @__PURE__ */ n(
263
- xe,
263
+ children: /* @__PURE__ */ o(
264
+ ge,
264
265
  {
265
- ...oe,
266
+ ...ne,
266
267
  series: w,
267
268
  loading: H,
268
269
  size: c ? "full" : "default",
@@ -284,8 +285,8 @@ function Ze({
284
285
  )
285
286
  }
286
287
  ),
287
- W.length > 0 ? /* @__PURE__ */ n(
288
- ge,
288
+ W.length > 0 ? /* @__PURE__ */ o(
289
+ xe,
289
290
  {
290
291
  series: W,
291
292
  onUnselect: L,
@@ -1,37 +1,41 @@
1
- import { jsxs as a, jsx as e, Fragment as k } from "react/jsx-runtime";
2
- import { PointsIcon as N } from "../points-icon/points-icon.js";
3
- import { TokenIcon as P } from "../token-icon/token-icon.js";
4
- import { SimpleTooltip as A } from "../tooltip/simple-tooltip.js";
1
+ import { jsxs as a, jsx as e, Fragment as N } from "react/jsx-runtime";
2
+ import { PointsIcon as A } from "../points-icon/points-icon.js";
3
+ import { TokenIcon as I } from "../token-icon/token-icon.js";
4
+ import { SimpleTooltip as P } from "../tooltip/simple-tooltip.js";
5
5
  import "../tooltip/tooltip.js";
6
6
  import { FormattedMessageTyped as s } from "../typed-intl/index.js";
7
7
  import "react";
8
- import { tokenRewardsOf as I, pointProgramsOf as B, totalApyOf as T } from "../../utils/apy-breakdown.js";
8
+ import { tokenRewardsOf as T, pointProgramsOf as $, totalApyOf as j } from "../../utils/apy-breakdown.js";
9
9
  import "@gearbox-protocol/sdk";
10
- import { bpsToPercent as $ } from "../../utils/bps.js";
11
- import { cn as c } from "../../utils/cn.js";
10
+ import { bpsToPercent as R } from "../../utils/bps.js";
11
+ import { cn as f } from "../../utils/cn.js";
12
12
  import "sonner";
13
- import { formatLeverage as j } from "../../utils/format-leverage.js";
14
- import { formatCompactPercent as S } from "../../utils/format-money.js";
13
+ import { formatLeverage as S } from "../../utils/format-leverage.js";
14
+ import { formatCompactPercent as C } from "../../utils/format-money.js";
15
15
  import "@gearbox-protocol/sdk/common-utils";
16
16
  import "luxon";
17
17
  import "../../utils/z-index.js";
18
- function i(n) {
19
- const o = $(n), r = S(Math.abs(o));
20
- return o < 0 ? `-${r}` : r;
18
+ function p(o) {
19
+ const n = R(o), r = C(Math.abs(n));
20
+ return n < 0 ? `-${r}` : r;
21
21
  }
22
- function V({
23
- supplyApy: n,
24
- maxLeverage: o,
22
+ function m(o, n, r) {
23
+ return o === "7d" ? r : n;
24
+ }
25
+ function Z({
26
+ supplyApy: o,
27
+ maxLeverage: n,
25
28
  collateralApy: r,
26
- borrowApy: u,
27
- quotaRate: f,
29
+ borrowApy: g,
30
+ quotaRate: b,
31
+ period: l,
28
32
  children: h,
29
- className: g
33
+ className: w
30
34
  }) {
31
- const d = o !== void 0 && o > 0, l = d ? r : r ?? n, w = l ? I(l) : [], y = B(n), b = T(n), p = u != null || f != null ? -((u ?? 0) + (f ?? 0)) : void 0, x = y.filter((t) => t.multiplier != null), v = /* @__PURE__ */ a(
35
+ const d = n !== void 0 && n > 0, i = d ? r : r ?? o, k = i ? T(i) : [], v = $(o), x = j(o), u = g != null || b != null ? -((g ?? 0) + (b ?? 0)) : void 0, y = v.filter((t) => t.multiplier != null), B = /* @__PURE__ */ a(
32
36
  "div",
33
37
  {
34
- className: c(
38
+ className: f(
35
39
  "flex w-[400px] max-w-[calc(100vw-32px)] flex-col gap-4 p-4",
36
40
  "rounded-xl",
37
41
  "bg-card text-card-foreground",
@@ -44,33 +48,59 @@ function V({
44
48
  /* @__PURE__ */ e("span", { className: "text-base font-semibold leading-4 text-foreground", children: d ? /* @__PURE__ */ e(
45
49
  s,
46
50
  {
47
- messageId: "components.yieldBreakdown.titleNetAtLeverage",
51
+ messageId: m(
52
+ l,
53
+ "components.yieldBreakdown.titleNetAtLeverage",
54
+ "components.yieldBreakdown.titleNetAtLeverage7d"
55
+ ),
48
56
  values: {
49
- leverage: j(o)
57
+ leverage: S(n)
50
58
  }
51
59
  }
52
- ) : /* @__PURE__ */ e(s, { messageId: "components.apyParts.totalAPY" }) }),
60
+ ) : /* @__PURE__ */ e(
61
+ s,
62
+ {
63
+ messageId: m(
64
+ l,
65
+ "components.yieldBreakdown.titleNet",
66
+ "components.yieldBreakdown.titleNet7d"
67
+ )
68
+ }
69
+ ) }),
53
70
  /* @__PURE__ */ e(
54
71
  "span",
55
72
  {
56
- className: c(
73
+ className: f(
57
74
  "rounded-md px-2 py-0.5 text-sm font-semibold tabular-nums",
58
- b > 0 ? "bg-success/20 text-success" : "bg-muted text-muted-foreground"
75
+ x > 0 ? "bg-success/20 text-success" : "bg-muted text-muted-foreground"
59
76
  ),
60
- children: i(b)
77
+ children: p(x)
61
78
  }
62
79
  )
63
80
  ] }),
64
- l?.organicApy != null && /* @__PURE__ */ e(
65
- m,
81
+ i?.organicApy != null && /* @__PURE__ */ e(
82
+ c,
66
83
  {
67
- muted: l.organicApy < 0,
68
- label: /* @__PURE__ */ e(s, { messageId: "components.yieldBreakdown.collateralApy" }),
69
- value: i(l.organicApy)
84
+ muted: i.organicApy < 0,
85
+ label: /* @__PURE__ */ e(
86
+ s,
87
+ {
88
+ messageId: d ? m(
89
+ l,
90
+ "components.yieldBreakdown.collateralApy",
91
+ "components.yieldBreakdown.collateralApy7d"
92
+ ) : m(
93
+ l,
94
+ "components.yieldBreakdown.baseApy",
95
+ "components.yieldBreakdown.baseApy7d"
96
+ )
97
+ }
98
+ ),
99
+ value: p(i.organicApy)
70
100
  }
71
101
  ),
72
- w.map((t) => t.supplyApr == null ? null : /* @__PURE__ */ e(
73
- m,
102
+ k.map((t) => t.supplyApr == null ? null : /* @__PURE__ */ e(
103
+ c,
74
104
  {
75
105
  muted: t.supplyApr < 0,
76
106
  label: /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", children: [
@@ -81,24 +111,33 @@ function V({
81
111
  values: { symbol: t.token.symbol }
82
112
  }
83
113
  ) }),
84
- /* @__PURE__ */ e(P, { token: t.token, size: 20 })
114
+ /* @__PURE__ */ e(I, { token: t.token, size: 20 })
85
115
  ] }),
86
- value: i(t.supplyApr)
116
+ value: p(t.supplyApr)
87
117
  },
88
118
  `incentive-${t.token.address}-${t.supplyApr}`
89
119
  )),
90
- d && p != null && /* @__PURE__ */ e(
91
- m,
120
+ d && u != null && /* @__PURE__ */ e(
121
+ c,
92
122
  {
93
- muted: p < 0,
94
- label: /* @__PURE__ */ e(s, { messageId: "components.yieldBreakdown.borrowRate" }),
95
- value: i(p)
123
+ muted: u < 0,
124
+ label: /* @__PURE__ */ e(
125
+ s,
126
+ {
127
+ messageId: m(
128
+ l,
129
+ "components.yieldBreakdown.borrowRate",
130
+ "components.yieldBreakdown.borrowRate7d"
131
+ )
132
+ }
133
+ ),
134
+ value: p(u)
96
135
  }
97
136
  ),
98
- x.length > 0 && /* @__PURE__ */ a(k, { children: [
137
+ y.length > 0 && /* @__PURE__ */ a(N, { children: [
99
138
  /* @__PURE__ */ e("div", { className: "h-px w-full bg-divider" }),
100
- x.map((t) => /* @__PURE__ */ e(
101
- m,
139
+ y.map((t) => /* @__PURE__ */ e(
140
+ c,
102
141
  {
103
142
  label: /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", children: [
104
143
  /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
@@ -109,7 +148,7 @@ function V({
109
148
  }
110
149
  ) }),
111
150
  /* @__PURE__ */ e(
112
- N,
151
+ A,
113
152
  {
114
153
  reward: {
115
154
  name: t.name,
@@ -128,38 +167,38 @@ function V({
128
167
  }
129
168
  );
130
169
  return /* @__PURE__ */ e(
131
- A,
170
+ P,
132
171
  {
133
172
  placement: "bottom",
134
173
  triangle: !1,
135
174
  type: "modal-tooltip",
136
175
  minWidth: "100%",
137
176
  maxWidth: "100%",
138
- title: /* @__PURE__ */ e("span", { className: g, children: h }),
139
- triggerClassName: g,
140
- children: v
177
+ title: /* @__PURE__ */ e("span", { className: w, children: h }),
178
+ triggerClassName: w,
179
+ children: B
141
180
  }
142
181
  );
143
182
  }
144
- function m({
145
- label: n,
146
- value: o,
183
+ function c({
184
+ label: o,
185
+ value: n,
147
186
  muted: r = !1
148
187
  }) {
149
188
  return /* @__PURE__ */ a("div", { className: "flex h-6 items-center justify-between gap-3 text-sm leading-5", children: [
150
- /* @__PURE__ */ e("span", { className: "min-w-0 font-normal text-muted-foreground", children: n }),
189
+ /* @__PURE__ */ e("span", { className: "min-w-0 font-normal text-muted-foreground", children: o }),
151
190
  /* @__PURE__ */ e(
152
191
  "span",
153
192
  {
154
- className: c(
193
+ className: f(
155
194
  "shrink-0 font-semibold tabular-nums",
156
195
  r ? "text-muted-foreground" : "text-foreground"
157
196
  ),
158
- children: o
197
+ children: n
159
198
  }
160
199
  )
161
200
  ] });
162
201
  }
163
202
  export {
164
- V as YieldBreakdownTooltip
203
+ Z as YieldBreakdownTooltip
165
204
  };