@gearbox-protocol/ui-kit 4.5.2 → 4.6.0

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 (20) hide show
  1. package/dist/cjs/components/base/apy-breakdown-body/apy-breakdown-body.cjs +1 -1
  2. package/dist/cjs/components/base/apy-breakdown-body/index.cjs +1 -1
  3. package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
  4. package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
  5. package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
  6. package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
  7. package/dist/cjs/components/yield-breakdown-tooltip/yield-breakdown.cjs +1 -1
  8. package/dist/esm/components/base/apy-breakdown-body/apy-breakdown-body.js +70 -45
  9. package/dist/esm/components/base/apy-breakdown-body/index.js +8 -7
  10. package/dist/esm/components/base/info-list/info-list.js +14 -13
  11. package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +68 -64
  12. package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +109 -105
  13. package/dist/esm/components/compound-apy/compound-apy.js +22 -20
  14. package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown.js +92 -79
  15. package/dist/types/components/base/apy-breakdown-body/apy-breakdown-body.d.ts +5 -0
  16. package/dist/types/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.d.ts +3 -1
  17. package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts +3 -1
  18. package/dist/types/components/compound-apy/compound-apy.d.ts +3 -1
  19. package/dist/types/components/yield-breakdown-tooltip/yield-breakdown.d.ts +3 -1
  20. package/package.json +2 -2
@@ -1,129 +1,133 @@
1
- import { jsxs as w, jsx as e, Fragment as $ } from "react/jsx-runtime";
2
- import { calcNetStrategyApy as M, calcEffectiveBorrowApy as q } from "@gearbox-protocol/sdk/onchain";
3
- import { breakdownRateValue as P, ApyBreakdownBody as O, formatBreakdownRate as m, ApyBreakdownRow as b, periodMessageId as k, ApyBreakdownDivider as S, BREAKDOWN_DASH as E } from "../apy-breakdown-body/apy-breakdown-body.js";
4
- import { NoValue as g } from "../../no-value/no-value.js";
5
- import { PointsIcon as j } from "../../points-icon/points-icon.js";
6
- import { TokenIcon as z } from "../../token-icon/token-icon.js";
1
+ import { jsxs as y, jsx as o, Fragment as q } from "react/jsx-runtime";
2
+ import { calcNetStrategyApy as M, calcEffectiveBorrowApy as O } from "@gearbox-protocol/sdk/onchain";
3
+ import { breakdownRateValue as P, ApyBreakdownBody as S, formatBreakdownRate as m, ApyBreakdownRow as k, periodMessageId as g, RewardLinks as E, ApyBreakdownDivider as j, BREAKDOWN_DASH as z } from "../apy-breakdown-body/apy-breakdown-body.js";
4
+ import { NoValue as I } from "../../no-value/no-value.js";
5
+ import { PointsIcon as F } from "../../points-icon/points-icon.js";
6
+ import { TokenIcon as V } from "../../token-icon/token-icon.js";
7
7
  import { FormattedMessageTyped as i } from "../../typed-intl/index.js";
8
- import { formatLeverageExact as p, formatLeverage as F } from "../../../utils/format-leverage.js";
9
- import { totalApyOf as V, positiveTokenRewardsOf as H, pointProgramsOf as K } from "../../../utils/internal/apy-breakdown.js";
10
- import { StrategyApyBreakdownCardTest as l } from "./constants.js";
11
- function W(c) {
12
- const { borrowApyAvg7D: o, quotaRateAvg7D: r, liquidationThreshold: n } = c;
13
- return o === void 0 || r === void 0 ? null : {
14
- borrowApy: o,
8
+ import { formatLeverageExact as p, formatLeverage as H } from "../../../utils/format-leverage.js";
9
+ import { totalApyOf as K, positiveTokenRewardsOf as W, pointProgramsOf as Y } from "../../../utils/internal/apy-breakdown.js";
10
+ import { StrategyApyBreakdownCardTest as n } from "./constants.js";
11
+ function _(c) {
12
+ const { borrowApyAvg7D: e, quotaRateAvg7D: r, liquidationThreshold: a } = c;
13
+ return e === void 0 || r === void 0 ? null : {
14
+ borrowApy: e,
15
15
  quotaRate: r,
16
- liquidationThreshold: n
16
+ liquidationThreshold: a
17
17
  };
18
18
  }
19
- function Y(c, o, r) {
20
- const n = P(c), a = r - o * n;
21
- return a > 0 && o > 0 ? n + Math.ceil(a / o * 100) / 100 : n;
19
+ function G(c, e, r) {
20
+ const a = P(c), v = r - e * a;
21
+ return v > 0 && e > 0 ? a + Math.ceil(v / e * 100) / 100 : a;
22
22
  }
23
- function ao({
23
+ function le({
24
24
  data: c,
25
- leverage: o,
25
+ leverage: e,
26
26
  showFormula: r = !1,
27
- period: n
27
+ period: a,
28
+ hideRewardLinks: v = !1
28
29
  }) {
29
- const a = W(c), s = a && c.collateralApyAvg7D ? c.collateralApyAvg7D : void 0, I = a !== null && s !== void 0, B = I && a && s ? {
30
+ const l = _(c), s = l && c.collateralApyAvg7D ? c.collateralApyAvg7D : void 0, B = l !== null && s !== void 0, h = B && l && s ? {
30
31
  organicApy: M(
31
- a,
32
+ l,
32
33
  s.organicApy,
33
- o
34
+ e
34
35
  ),
35
36
  totalApy: M(
36
- a,
37
+ l,
37
38
  s.totalApy ?? s.organicApy,
38
- o
39
+ e
39
40
  ),
40
41
  ...s.rewards ? { rewards: s.rewards } : {}
41
- } : null, d = I && a ? q(a, o) : null, u = B === null ? null : V(B), h = u === null || d === null ? null : u + d, L = s ? H(s) : [], R = s ? K(s) : [], T = L.map((t) => ({
42
+ } : null, d = B && l ? O(l, e) : null, u = h === null ? null : K(h), R = u === null || d === null ? null : u + d, $ = s ? W(s) : [], x = s ? Y(s) : [], T = $.map((t) => ({
42
43
  reward: t,
43
- value: Math.round(o * (t.supplyApr ?? 0))
44
- })), y = h === null ? null : h - T.reduce((t, f) => t + f.value, 0), x = y !== null && o > 0 ? y / o : void 0, N = a && d !== null && o > 0 ? (d - a.borrowApy * (o - 1)) / o : void 0, C = Number(p(o)), v = d === null ? void 0 : P(d), A = a && N !== void 0 && v !== void 0 ? Y(
45
- a.borrowApy + N,
46
- C,
47
- v
48
- ) : void 0, D = A !== void 0 && v !== void 0 ? C * A - v : void 0;
49
- return /* @__PURE__ */ w(
50
- O,
44
+ value: Math.round(e * (t.supplyApr ?? 0))
45
+ })), A = R === null ? null : R - T.reduce((t, b) => t + b.value, 0), N = A !== null && e > 0 ? A / e : void 0, C = l && d !== null && e > 0 ? (d - l.borrowApy * (e - 1)) / e : void 0, D = Number(p(e)), w = d === null ? void 0 : P(d), f = l && C !== void 0 && w !== void 0 ? G(
46
+ l.borrowApy + C,
47
+ D,
48
+ w
49
+ ) : void 0, L = f !== void 0 && w !== void 0 ? D * f - w : void 0;
50
+ return /* @__PURE__ */ y(
51
+ S,
51
52
  {
52
- testId: l.root,
53
- title: /* @__PURE__ */ e(
53
+ testId: n.root,
54
+ title: /* @__PURE__ */ o(
54
55
  i,
55
56
  {
56
- messageId: k(
57
- n,
57
+ messageId: g(
58
+ a,
58
59
  "components.yieldBreakdown.titleNetAtLeverage",
59
60
  "components.yieldBreakdown.titleNetAtLeverage7d"
60
61
  ),
61
- values: { leverage: F(o) }
62
+ values: { leverage: H(e) }
62
63
  }
63
64
  ),
64
- chip: u === null ? /* @__PURE__ */ e(g, { reason: n }) : m(u, !0),
65
+ chip: u === null ? /* @__PURE__ */ o(I, { reason: a }) : m(u, !0),
65
66
  chipPositive: (u ?? 0) > 0,
66
- chipTestId: l.net,
67
+ chipTestId: n.net,
67
68
  children: [
68
- /* @__PURE__ */ e(
69
- b,
69
+ /* @__PURE__ */ o(
70
+ k,
70
71
  {
71
- testId: l.collateral,
72
- valueTestId: l.value,
73
- captionTestId: l.caption,
74
- label: /* @__PURE__ */ e(
72
+ testId: n.collateral,
73
+ valueTestId: n.value,
74
+ captionTestId: n.caption,
75
+ label: /* @__PURE__ */ o(
75
76
  i,
76
77
  {
77
- messageId: k(
78
- n,
78
+ messageId: g(
79
+ a,
79
80
  "components.yieldBreakdown.collateralApy",
80
81
  "components.yieldBreakdown.collateralApy7d"
81
82
  )
82
83
  }
83
84
  ),
84
- value: y === null ? /* @__PURE__ */ e(g, { reason: n }) : m(y),
85
- subtext: r && x !== void 0 ? /* @__PURE__ */ e(
85
+ value: A === null ? /* @__PURE__ */ o(I, { reason: a }) : m(A),
86
+ subtext: r && N !== void 0 ? /* @__PURE__ */ o(
86
87
  i,
87
88
  {
88
89
  messageId: "components.strategyApyBreakdownCard.formula",
89
90
  values: {
90
- leverage: p(o),
91
- base: m(x)
91
+ leverage: p(e),
92
+ base: m(N)
92
93
  }
93
94
  }
94
95
  ) : void 0
95
96
  }
96
97
  ),
97
- T.map(({ reward: t, value: f }) => /* @__PURE__ */ e(
98
- b,
98
+ T.map(({ reward: t, value: b }) => /* @__PURE__ */ o(
99
+ k,
99
100
  {
100
- valueTestId: l.value,
101
- captionTestId: l.caption,
102
- label: /* @__PURE__ */ w("span", { className: "inline-flex items-center gap-1.5", children: [
103
- /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
104
- i,
105
- {
106
- messageId: "components.apyParts.extraAPY",
107
- values: { symbol: t.token.symbol }
108
- }
109
- ) }),
110
- /* @__PURE__ */ e(
111
- z,
112
- {
113
- token: t.token,
114
- symbol: t.token.symbol,
115
- size: 16,
116
- className: "shrink-0"
117
- }
118
- )
101
+ valueTestId: n.value,
102
+ captionTestId: n.caption,
103
+ label: /* @__PURE__ */ y("span", { className: "flex flex-col gap-0.5", children: [
104
+ /* @__PURE__ */ y("span", { className: "inline-flex items-center gap-1.5", children: [
105
+ /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(
106
+ i,
107
+ {
108
+ messageId: "components.apyParts.extraAPY",
109
+ values: { symbol: t.token.symbol }
110
+ }
111
+ ) }),
112
+ /* @__PURE__ */ o(
113
+ V,
114
+ {
115
+ token: t.token,
116
+ symbol: t.token.symbol,
117
+ size: 16,
118
+ className: "shrink-0"
119
+ }
120
+ )
121
+ ] }),
122
+ v ? null : /* @__PURE__ */ o(E, { links: t.links })
119
123
  ] }),
120
- value: m(f),
121
- subtext: r ? /* @__PURE__ */ e(
124
+ value: m(b),
125
+ subtext: r ? /* @__PURE__ */ o(
122
126
  i,
123
127
  {
124
128
  messageId: "components.strategyApyBreakdownCard.formula",
125
129
  values: {
126
- leverage: p(o),
130
+ leverage: p(e),
127
131
  base: m(t.supplyApr ?? 0)
128
132
  }
129
133
  }
@@ -131,54 +135,54 @@ function ao({
131
135
  },
132
136
  `incentive-${t.token.address}-${t.supplyApr ?? 0}`
133
137
  )),
134
- /* @__PURE__ */ e(
135
- b,
138
+ /* @__PURE__ */ o(
139
+ k,
136
140
  {
137
141
  muted: !0,
138
- testId: l.borrow,
139
- valueTestId: l.value,
140
- captionTestId: l.caption,
141
- label: /* @__PURE__ */ e(
142
+ testId: n.borrow,
143
+ valueTestId: n.value,
144
+ captionTestId: n.caption,
145
+ label: /* @__PURE__ */ o(
142
146
  i,
143
147
  {
144
- messageId: k(
145
- n,
148
+ messageId: g(
149
+ a,
146
150
  "components.yieldBreakdown.borrowRate",
147
151
  "components.yieldBreakdown.borrowRate7d"
148
152
  )
149
153
  }
150
154
  ),
151
- value: d === null ? /* @__PURE__ */ e(g, { reason: n }) : m(d),
152
- subtext: r && A !== void 0 && D !== void 0 ? /* @__PURE__ */ e(
155
+ value: d === null ? /* @__PURE__ */ o(I, { reason: a }) : m(d),
156
+ subtext: r && f !== void 0 && L !== void 0 ? /* @__PURE__ */ o(
153
157
  i,
154
158
  {
155
159
  messageId: "components.strategyApyBreakdownCard.borrowFormula",
156
160
  values: {
157
- leverage: p(o),
158
- totalRate: `${A.toFixed(2)}%`,
159
- borrowRate: `${Math.abs(D).toFixed(2)}%`
161
+ leverage: p(e),
162
+ totalRate: `${f.toFixed(2)}%`,
163
+ borrowRate: `${Math.abs(L).toFixed(2)}%`
160
164
  }
161
165
  }
162
166
  ) : void 0
163
167
  }
164
168
  ),
165
- R.length > 0 ? /* @__PURE__ */ w($, { children: [
166
- /* @__PURE__ */ e(S, {}),
167
- R.map((t) => /* @__PURE__ */ e(
168
- b,
169
+ x.length > 0 ? /* @__PURE__ */ y(q, { children: [
170
+ /* @__PURE__ */ o(j, {}),
171
+ x.map((t) => /* @__PURE__ */ o(
172
+ k,
169
173
  {
170
- valueTestId: l.points,
171
- captionTestId: l.caption,
172
- label: /* @__PURE__ */ w("span", { className: "inline-flex items-center gap-1.5", children: [
173
- /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
174
+ valueTestId: n.points,
175
+ captionTestId: n.caption,
176
+ label: /* @__PURE__ */ y("span", { className: "inline-flex items-center gap-1.5", children: [
177
+ /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(
174
178
  i,
175
179
  {
176
180
  messageId: "components.yieldBreakdown.programPoints",
177
181
  values: { name: t.name }
178
182
  }
179
183
  ) }),
180
- /* @__PURE__ */ e(
181
- j,
184
+ /* @__PURE__ */ o(
185
+ F,
182
186
  {
183
187
  reward: { name: t.name, type: t.id },
184
188
  size: 16,
@@ -186,13 +190,13 @@ function ao({
186
190
  }
187
191
  )
188
192
  ] }),
189
- value: t.multiplier != null ? `${p(t.multiplier * o)}×` : E,
190
- subtext: r && t.multiplier != null ? /* @__PURE__ */ e(
193
+ value: t.multiplier != null ? `${p(t.multiplier * e)}×` : z,
194
+ subtext: r && t.multiplier != null ? /* @__PURE__ */ o(
191
195
  i,
192
196
  {
193
197
  messageId: "components.strategyApyBreakdownCard.formula",
194
198
  values: {
195
- leverage: p(o),
199
+ leverage: p(e),
196
200
  base: p(t.multiplier)
197
201
  }
198
202
  }
@@ -206,6 +210,6 @@ function ao({
206
210
  );
207
211
  }
208
212
  export {
209
- ao as StrategyApyBreakdownCard,
210
- l as StrategyApyBreakdownCardTest
213
+ le as StrategyApyBreakdownCard,
214
+ n as StrategyApyBreakdownCardTest
211
215
  };
@@ -1,16 +1,16 @@
1
1
  import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
- import { useId as v } from "react";
3
- import { NoValue as x } from "../no-value/no-value.js";
4
- import { YieldBreakdownTooltip as C } from "../yield-breakdown-tooltip/yield-breakdown.js";
5
- import { cn as I } from "../../utils/cn.js";
2
+ import { useId as x } from "react";
3
+ import { NoValue as C } from "../no-value/no-value.js";
4
+ import { YieldBreakdownTooltip as I } from "../yield-breakdown-tooltip/yield-breakdown.js";
5
+ import { cn as k } from "../../utils/cn.js";
6
6
  import "@gearbox-protocol/sdk/onchain";
7
- import { formatCompactPercent as k } from "../../utils/internal/format-percent.js";
7
+ import { formatCompactPercent as P } from "../../utils/internal/format-percent.js";
8
8
  import "../../utils/z-index.js";
9
- import { totalApyOf as P, positiveTokenRewardsOf as A, pointProgramsOf as O } from "../../utils/internal/apy-breakdown.js";
10
- import { bpsToPercent as F } from "../../utils/internal/bps-to-percent.js";
9
+ import { totalApyOf as A, positiveTokenRewardsOf as O, pointProgramsOf as F } from "../../utils/internal/apy-breakdown.js";
10
+ import { bpsToPercent as N } from "../../utils/internal/bps-to-percent.js";
11
11
  const l = 14;
12
- function N() {
13
- const t = `additional-incentives-${v().replace(/:/g, "")}`;
12
+ function T() {
13
+ const t = `additional-incentives-${x().replace(/:/g, "")}`;
14
14
  return /* @__PURE__ */ n(
15
15
  "svg",
16
16
  {
@@ -60,9 +60,9 @@ function N() {
60
60
  );
61
61
  }
62
62
  function c(t) {
63
- return t == null ? !1 : A(t).length > 0 || O(t).length > 0;
63
+ return t == null ? !1 : O(t).length > 0 || F(t).length > 0;
64
64
  }
65
- function V({
65
+ function Z({
66
66
  apy: t,
67
67
  maxLeverage: p,
68
68
  collateralApy: r,
@@ -71,19 +71,20 @@ function V({
71
71
  decimals: a = 2,
72
72
  tooltip: f = !0,
73
73
  period: h,
74
+ hideRewardLinks: u,
74
75
  className: o
75
76
  }) {
76
77
  if (!t)
77
- return /* @__PURE__ */ e(x, {});
78
- const i = P(t), u = c(t) || c(r), g = f && i >= 1, s = () => {
79
- const w = k(F(i), a);
80
- return /* @__PURE__ */ n("div", { className: I("inline-flex items-center gap-1.5", o), children: [
81
- /* @__PURE__ */ e("span", { className: "inline-flex items-center", children: w }),
82
- u ? /* @__PURE__ */ e(N, {}) : null
78
+ return /* @__PURE__ */ e(C, {});
79
+ const i = A(t), g = c(t) || c(r), w = f && i >= 1, s = () => {
80
+ const v = P(N(i), a);
81
+ return /* @__PURE__ */ n("div", { className: k("inline-flex items-center gap-1.5", o), children: [
82
+ /* @__PURE__ */ e("span", { className: "inline-flex items-center", children: v }),
83
+ g ? /* @__PURE__ */ e(T, {}) : null
83
84
  ] });
84
85
  };
85
- return g ? /* @__PURE__ */ e(
86
- C,
86
+ return w ? /* @__PURE__ */ e(
87
+ I,
87
88
  {
88
89
  supplyApy: t,
89
90
  maxLeverage: p,
@@ -91,11 +92,12 @@ function V({
91
92
  borrowApy: d,
92
93
  quotaRate: m,
93
94
  period: h,
95
+ hideRewardLinks: u,
94
96
  className: o,
95
97
  children: s()
96
98
  }
97
99
  ) : s();
98
100
  }
99
101
  export {
100
- V as CompoundAPY
102
+ Z as CompoundAPY
101
103
  };
@@ -1,140 +1,153 @@
1
- import { jsx as e, jsxs as p, Fragment as B } from "react/jsx-runtime";
2
- import { ApyBreakdownBody as A, formatBreakdownRate as c, ApyBreakdownRow as u, periodMessageId as w, ApyBreakdownDivider as v } from "../base/apy-breakdown-body/apy-breakdown-body.js";
3
- import { PoolApyBreakdownCard as h } from "../base/pool-apy-breakdown-card/pool-apy-breakdown-card.js";
4
- import { PointsIcon as b } from "../points-icon/points-icon.js";
5
- import { TokenIcon as I } from "../token-icon/token-icon.js";
6
- import { FormattedMessageTyped as a } from "../typed-intl/index.js";
7
- import { formatLeverage as P } from "../../utils/format-leverage.js";
8
- import { tokenRewardsOf as R, pointProgramsOf as T, totalApyOf as x } from "../../utils/internal/apy-breakdown.js";
9
- import { ApyBreakdownTooltip as N } from "./yield-breakdown-tooltip.js";
10
- function E({
11
- supplyApy: l,
12
- maxLeverage: r,
13
- collateralApy: y,
14
- borrowApy: s,
15
- quotaRate: i,
16
- period: t,
1
+ import { jsx as e, jsxs as r, Fragment as A } from "react/jsx-runtime";
2
+ import { ApyBreakdownBody as v, formatBreakdownRate as u, ApyBreakdownRow as y, periodMessageId as f, RewardLinks as h, ApyBreakdownDivider as b } from "../base/apy-breakdown-body/apy-breakdown-body.js";
3
+ import { PoolApyBreakdownCard as I } from "../base/pool-apy-breakdown-card/pool-apy-breakdown-card.js";
4
+ import { PointsIcon as P } from "../points-icon/points-icon.js";
5
+ import { TokenIcon as x } from "../token-icon/token-icon.js";
6
+ import { FormattedMessageTyped as s } from "../typed-intl/index.js";
7
+ import { formatLeverage as N } from "../../utils/format-leverage.js";
8
+ import { tokenRewardsOf as R, pointProgramsOf as T, totalApyOf as $ } from "../../utils/internal/apy-breakdown.js";
9
+ import { ApyBreakdownTooltip as O } from "./yield-breakdown-tooltip.js";
10
+ function H({
11
+ supplyApy: t,
12
+ maxLeverage: a,
13
+ collateralApy: g,
14
+ borrowApy: i,
15
+ quotaRate: d,
16
+ period: l,
17
+ hideRewardLinks: m = !1,
17
18
  children: n,
18
- className: d,
19
- open: g
19
+ className: p,
20
+ open: k
20
21
  }) {
21
- const m = r !== void 0 && r > 0;
22
+ const c = a !== void 0 && a > 0;
22
23
  return /* @__PURE__ */ e(
23
- N,
24
+ O,
24
25
  {
25
26
  placement: "bottom",
26
- title: /* @__PURE__ */ e("span", { className: d, children: n }),
27
- triggerClassName: d,
28
- open: g,
29
- children: m ? /* @__PURE__ */ e(
30
- $,
27
+ title: /* @__PURE__ */ e("span", { className: p, children: n }),
28
+ triggerClassName: p,
29
+ open: k,
30
+ children: c ? /* @__PURE__ */ e(
31
+ S,
31
32
  {
32
- supplyApy: l,
33
- maxLeverage: r,
34
- collateralApy: y,
35
- borrowApy: s,
36
- quotaRate: i,
37
- period: t
33
+ supplyApy: t,
34
+ maxLeverage: a,
35
+ collateralApy: g,
36
+ borrowApy: i,
37
+ quotaRate: d,
38
+ period: l,
39
+ hideRewardLinks: m
38
40
  }
39
- ) : /* @__PURE__ */ e(h, { data: l, period: t })
41
+ ) : /* @__PURE__ */ e(
42
+ I,
43
+ {
44
+ data: t,
45
+ period: l,
46
+ hideRewardLinks: m
47
+ }
48
+ )
40
49
  }
41
50
  );
42
51
  }
43
- function $({
44
- supplyApy: l,
45
- maxLeverage: r,
46
- collateralApy: y,
47
- borrowApy: s,
48
- quotaRate: i,
49
- period: t
52
+ function S({
53
+ supplyApy: t,
54
+ maxLeverage: a,
55
+ collateralApy: g,
56
+ borrowApy: i,
57
+ quotaRate: d,
58
+ period: l,
59
+ hideRewardLinks: m
50
60
  }) {
51
- const n = y, d = n ? R(n) : [], g = T(l), m = x(l), k = s != null || i != null ? (s ?? 0) + (i ?? 0) : void 0, f = g.filter((o) => o.multiplier != null);
52
- return /* @__PURE__ */ p(
53
- A,
61
+ const n = g, p = n ? R(n) : [], k = T(t), c = $(t), w = i != null || d != null ? (i ?? 0) + (d ?? 0) : void 0, B = k.filter((o) => o.multiplier != null);
62
+ return /* @__PURE__ */ r(
63
+ v,
54
64
  {
55
65
  title: /* @__PURE__ */ e(
56
- a,
66
+ s,
57
67
  {
58
- messageId: w(
59
- t,
68
+ messageId: f(
69
+ l,
60
70
  "components.yieldBreakdown.titleNetAtLeverage",
61
71
  "components.yieldBreakdown.titleNetAtLeverage7d"
62
72
  ),
63
- values: { leverage: P(r) }
73
+ values: { leverage: N(a) }
64
74
  }
65
75
  ),
66
- chip: c(m, !0),
67
- chipPositive: m > 0,
76
+ chip: u(c, !0),
77
+ chipPositive: c > 0,
68
78
  children: [
69
79
  n?.organicApy != null ? /* @__PURE__ */ e(
70
- u,
80
+ y,
71
81
  {
72
82
  muted: n.organicApy < 0,
73
83
  label: /* @__PURE__ */ e(
74
- a,
84
+ s,
75
85
  {
76
- messageId: w(
77
- t,
86
+ messageId: f(
87
+ l,
78
88
  "components.yieldBreakdown.collateralApy",
79
89
  "components.yieldBreakdown.collateralApy7d"
80
90
  )
81
91
  }
82
92
  ),
83
- value: c(n.organicApy)
93
+ value: u(n.organicApy)
84
94
  }
85
95
  ) : null,
86
- d.map(
96
+ p.map(
87
97
  (o) => o.supplyApr == null ? null : /* @__PURE__ */ e(
88
- u,
98
+ y,
89
99
  {
90
100
  muted: o.supplyApr < 0,
91
- label: /* @__PURE__ */ p("span", { className: "inline-flex items-center gap-1.5", children: [
92
- /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
93
- a,
94
- {
95
- messageId: "components.apyParts.extraAPY",
96
- values: { symbol: o.token.symbol }
97
- }
98
- ) }),
99
- /* @__PURE__ */ e(I, { token: o.token, size: 20 })
101
+ label: /* @__PURE__ */ r("span", { className: "flex flex-col gap-0.5", children: [
102
+ /* @__PURE__ */ r("span", { className: "inline-flex items-center gap-1.5", children: [
103
+ /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
104
+ s,
105
+ {
106
+ messageId: "components.apyParts.extraAPY",
107
+ values: { symbol: o.token.symbol }
108
+ }
109
+ ) }),
110
+ /* @__PURE__ */ e(x, { token: o.token, size: 20 })
111
+ ] }),
112
+ m ? null : /* @__PURE__ */ e(h, { links: o.links })
100
113
  ] }),
101
- value: c(o.supplyApr)
114
+ value: u(o.supplyApr)
102
115
  },
103
116
  `incentive-${o.token.address}-${o.supplyApr}`
104
117
  )
105
118
  ),
106
- k != null ? /* @__PURE__ */ e(
107
- u,
119
+ w != null ? /* @__PURE__ */ e(
120
+ y,
108
121
  {
109
122
  muted: !0,
110
123
  label: /* @__PURE__ */ e(
111
- a,
124
+ s,
112
125
  {
113
- messageId: w(
114
- t,
126
+ messageId: f(
127
+ l,
115
128
  "components.yieldBreakdown.borrowRate",
116
129
  "components.yieldBreakdown.borrowRate7d"
117
130
  )
118
131
  }
119
132
  ),
120
- value: c(k)
133
+ value: u(w)
121
134
  }
122
135
  ) : null,
123
- f.length > 0 ? /* @__PURE__ */ p(B, { children: [
124
- /* @__PURE__ */ e(v, {}),
125
- f.map((o) => /* @__PURE__ */ e(
126
- u,
136
+ B.length > 0 ? /* @__PURE__ */ r(A, { children: [
137
+ /* @__PURE__ */ e(b, {}),
138
+ B.map((o) => /* @__PURE__ */ e(
139
+ y,
127
140
  {
128
- label: /* @__PURE__ */ p("span", { className: "inline-flex items-center gap-1.5", children: [
141
+ label: /* @__PURE__ */ r("span", { className: "inline-flex items-center gap-1.5", children: [
129
142
  /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
130
- a,
143
+ s,
131
144
  {
132
145
  messageId: "components.yieldBreakdown.programPoints",
133
146
  values: { name: o.name }
134
147
  }
135
148
  ) }),
136
149
  /* @__PURE__ */ e(
137
- b,
150
+ P,
138
151
  {
139
152
  reward: {
140
153
  name: o.name,
@@ -154,5 +167,5 @@ function $({
154
167
  );
155
168
  }
156
169
  export {
157
- E as YieldBreakdownTooltip
170
+ H as YieldBreakdownTooltip
158
171
  };
@@ -44,4 +44,9 @@ export interface ApyBreakdownRowProps {
44
44
  readonly captionTestId?: string;
45
45
  }
46
46
  export declare function ApyBreakdownRow({ label, value, subtext, muted, testId, valueTestId, captionTestId, }: ApyBreakdownRowProps): React.ReactElement;
47
+ export interface RewardLinksProps {
48
+ readonly links?: readonly string[];
49
+ }
50
+ /** "merkl.xyz ↗" under an incentive row, one link per campaign page. */
51
+ export declare function RewardLinks({ links, }: RewardLinksProps): React.ReactElement | null;
47
52
  export declare function ApyBreakdownDivider(): React.ReactElement;