@gearbox-protocol/ui-kit 4.0.0-next.20 → 4.0.0-next.22
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/cjs/components/base/position-assets/position-assets.cjs +1 -1
- package/dist/cjs/components/base/strategy-apy-breakdown-card/constants.cjs +1 -1
- package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/values/scalars.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/yield-breakdown-tooltip/yield-breakdown-tooltip.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/esm/components/base/position-assets/position-assets.js +62 -39
- package/dist/esm/components/base/strategy-apy-breakdown-card/constants.js +7 -3
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +140 -166
- package/dist/esm/components/base/values/scalars.js +40 -35
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +60 -61
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table.js +22 -24
- package/dist/esm/components/compound-apy/compound-apy.js +24 -23
- package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown-tooltip.js +15 -15
- package/dist/esm/index.js +88 -91
- package/dist/esm/locale/en.json.js +3 -7
- package/dist/esm/utils/index.js +48 -51
- package/dist/globals.css +1 -1
- package/dist/types/components/base/position-assets/position-assets.d.ts +19 -13
- package/dist/types/components/base/strategy-apy-breakdown-card/constants.d.ts +5 -1
- package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts +39 -14
- package/dist/types/components/base/values/scalars.d.ts +17 -2
- package/dist/types/components/composites/pool-assets-table/pool-assets-table-row.d.ts +1 -2
- package/dist/types/components/composites/pool-assets-table/pool-assets-table.d.ts +1 -2
- package/dist/types/components/compound-apy/compound-apy.d.ts +11 -1
- package/dist/types/locale/en.json.d.ts +1 -6
- package/dist/types/utils/index.d.ts +0 -1
- package/package.json +1 -1
- package/dist/cjs/utils/strategy-apy.cjs +0 -1
- package/dist/esm/utils/strategy-apy.js +0 -51
- package/dist/types/utils/strategy-apy.d.ts +0 -40
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Stack as
|
|
1
|
+
import { jsx as n, jsxs as m, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { Stack as h } from "../stack/stack.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "@gearbox-protocol/sdk";
|
|
5
5
|
import "clsx";
|
|
@@ -9,65 +9,88 @@ import "@gearbox-protocol/sdk/common-utils";
|
|
|
9
9
|
import "luxon";
|
|
10
10
|
import "../../../utils/z-index.js";
|
|
11
11
|
import "../../points-icon/points-icon.js";
|
|
12
|
-
import { TokenBigint as
|
|
12
|
+
import { TokenBigint as d } from "../values/scalars.js";
|
|
13
13
|
import "../../badge/badge.js";
|
|
14
14
|
import "../../badge/chip.js";
|
|
15
15
|
import "react-intl";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
import { ShortString as f } from "../../short-string/short-string.js";
|
|
17
|
+
import { TokenSymbol as u } from "../../token-symbol/token-symbol.js";
|
|
18
|
+
import { Typography as k } from "../../typography/typography.js";
|
|
19
|
+
import { PositionAssetsTest as c } from "./constants.js";
|
|
20
|
+
const v = 1, g = 20;
|
|
21
|
+
function Y({
|
|
22
|
+
assets: s,
|
|
23
|
+
to: e,
|
|
24
|
+
empty: a,
|
|
25
|
+
testId: i
|
|
25
26
|
}) {
|
|
26
|
-
const t =
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
|
|
27
|
+
const t = y(s, e), r = e !== void 0;
|
|
28
|
+
return /* @__PURE__ */ n(h, { gap: "sm", align: "end", "data-testid": i ?? c.root, children: t.length === 0 ? a !== void 0 && /* @__PURE__ */ n(
|
|
29
|
+
k,
|
|
29
30
|
{
|
|
30
31
|
variant: "caption",
|
|
31
32
|
color: "secondary",
|
|
32
33
|
as: "div",
|
|
33
|
-
"data-testid":
|
|
34
|
-
children:
|
|
34
|
+
"data-testid": c.empty,
|
|
35
|
+
children: a
|
|
35
36
|
}
|
|
36
|
-
) : t.map((o) => /* @__PURE__ */
|
|
37
|
+
) : t.map((o) => /* @__PURE__ */ m(
|
|
37
38
|
"span",
|
|
38
39
|
{
|
|
39
40
|
className: "flex items-center gap-2",
|
|
40
|
-
"data-testid":
|
|
41
|
+
"data-testid": c.row,
|
|
41
42
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ n(u, { size: 20, token: o.token }),
|
|
44
|
+
/* @__PURE__ */ m("span", { className: "flex items-center", children: [
|
|
45
|
+
r && /* @__PURE__ */ m(p, { children: [
|
|
46
|
+
/* @__PURE__ */ n("span", { className: "text-secondary-foreground line-through [&_*]:text-secondary-foreground [&_*]:line-through", children: /* @__PURE__ */ n(
|
|
47
|
+
d,
|
|
48
|
+
{
|
|
49
|
+
data: o.value,
|
|
50
|
+
token: o.token,
|
|
51
|
+
showSymbol: !1
|
|
52
|
+
}
|
|
53
|
+
) }),
|
|
54
|
+
/* @__PURE__ */ n("span", { className: "px-1.5 text-gray-70", children: "→" })
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ n(
|
|
57
|
+
d,
|
|
58
|
+
{
|
|
59
|
+
data: r ? o.valueTo : o.value,
|
|
60
|
+
token: o.token,
|
|
61
|
+
showSymbol: !1
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
/* @__PURE__ */ n(f, { className: "ml-1", maxLength: g, children: o.token.symbol })
|
|
65
|
+
] })
|
|
44
66
|
]
|
|
45
67
|
},
|
|
46
68
|
o.token.address
|
|
47
69
|
)) });
|
|
48
70
|
}
|
|
49
|
-
function
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
token:
|
|
54
|
-
// a token the other side
|
|
55
|
-
value:
|
|
56
|
-
|
|
71
|
+
function y(s, e) {
|
|
72
|
+
const a = /* @__PURE__ */ new Map(), i = (t, r) => {
|
|
73
|
+
const o = t.token.address.toLowerCase(), l = a.get(o);
|
|
74
|
+
a.set(o, {
|
|
75
|
+
token: l?.token ?? t.token,
|
|
76
|
+
// a token only the other side holds is a zero here, not a gap
|
|
77
|
+
value: r === "from" ? t.value : l?.value ?? 0n,
|
|
78
|
+
valueTo: r === "to" ? t.value : l?.valueTo ?? 0n,
|
|
79
|
+
worth: x(l?.worth, t.valueUsd)
|
|
57
80
|
});
|
|
58
81
|
};
|
|
59
|
-
for (const t of
|
|
60
|
-
for (const t of e ?? [])
|
|
61
|
-
return [...
|
|
62
|
-
(t,
|
|
63
|
-
t.token.address.localeCompare(
|
|
82
|
+
for (const t of s ?? []) i(t, "from");
|
|
83
|
+
for (const t of e ?? []) i(t, "to");
|
|
84
|
+
return [...a.values()].filter((t) => t.worth === null || t.worth >= v).sort(
|
|
85
|
+
(t, r) => (r.worth ?? 0) - (t.worth ?? 0) || // a tie has to break the same way every render, or the rows drift
|
|
86
|
+
t.token.address.localeCompare(r.token.address)
|
|
64
87
|
);
|
|
65
88
|
}
|
|
66
|
-
function
|
|
67
|
-
return
|
|
89
|
+
function x(s, e) {
|
|
90
|
+
return s === void 0 ? e : s === null || e === null ? null : Math.max(s, e);
|
|
68
91
|
}
|
|
69
92
|
export {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
93
|
+
Y as PositionAssets,
|
|
94
|
+
c as PositionAssetsTest,
|
|
95
|
+
y as visibleAssets
|
|
73
96
|
};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
class
|
|
1
|
+
class t {
|
|
2
2
|
static root = "strategy-apy-breakdown-card-root";
|
|
3
|
-
static row = "strategy-apy-breakdown-card-row";
|
|
4
3
|
static net = "strategy-apy-breakdown-card-net";
|
|
4
|
+
static collateral = "strategy-apy-breakdown-card-collateral";
|
|
5
|
+
static borrow = "strategy-apy-breakdown-card-borrow";
|
|
6
|
+
static value = "strategy-apy-breakdown-card-value";
|
|
7
|
+
static points = "strategy-apy-breakdown-card-points";
|
|
8
|
+
static caption = "strategy-apy-breakdown-card-caption";
|
|
5
9
|
}
|
|
6
10
|
export {
|
|
7
|
-
|
|
11
|
+
t as StrategyApyBreakdownCardTest
|
|
8
12
|
};
|
|
@@ -1,239 +1,213 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { PointsIcon as
|
|
3
|
-
import { TokenIcon as
|
|
4
|
-
import { FormattedMessageTyped as
|
|
1
|
+
import { jsxs as n, jsx as e, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { PointsIcon as w } from "../../points-icon/points-icon.js";
|
|
3
|
+
import { TokenIcon as N } from "../../token-icon/token-icon.js";
|
|
4
|
+
import { FormattedMessageTyped as l } from "../../typed-intl/index.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import {
|
|
6
|
+
import { totalApyOf as A, positiveTokenRewardsOf as I, pointProgramsOf as B } from "../../../utils/apy-breakdown.js";
|
|
7
7
|
import "@gearbox-protocol/sdk";
|
|
8
|
-
import { bpsToPercent as
|
|
9
|
-
import { cn as
|
|
8
|
+
import { bpsToPercent as C } from "../../../utils/bps.js";
|
|
9
|
+
import { cn as g } from "../../../utils/cn.js";
|
|
10
10
|
import "sonner";
|
|
11
|
-
import { formatLeverage as
|
|
12
|
-
import { formatCompactPercent as F } from "../../../utils/format-money.js";
|
|
13
|
-
import { strategyApyPartsAtLeverage as j } from "../../../utils/strategy-apy.js";
|
|
11
|
+
import { formatLeverage as d } from "../../../utils/format-leverage.js";
|
|
14
12
|
import "@gearbox-protocol/sdk/common-utils";
|
|
15
13
|
import "luxon";
|
|
16
14
|
import "../../../utils/z-index.js";
|
|
17
|
-
import { StrategyApyBreakdownCardTest as
|
|
18
|
-
const
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const d = F(Math.abs(n));
|
|
23
|
-
return n < 0 ? `−${d}` : d;
|
|
24
|
-
}
|
|
25
|
-
const m = Math.abs(n).toFixed(2);
|
|
26
|
-
return n < 0 ? `−${m}%` : `${m}%`;
|
|
27
|
-
}
|
|
28
|
-
function S(e) {
|
|
29
|
-
return e == null || e <= 0 ? "bg-muted text-muted-foreground" : "bg-success/20 text-success";
|
|
30
|
-
}
|
|
31
|
-
function g({
|
|
32
|
-
base: e,
|
|
33
|
-
leverage: n
|
|
15
|
+
import { StrategyApyBreakdownCardTest as i } from "./constants.js";
|
|
16
|
+
const T = "—";
|
|
17
|
+
function G({
|
|
18
|
+
data: s,
|
|
19
|
+
showFormula: o = !1
|
|
34
20
|
}) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
function te({
|
|
44
|
-
data: e,
|
|
45
|
-
leverage: n
|
|
46
|
-
}) {
|
|
47
|
-
const o = n ?? (e.maxLeverage != null && e.maxLeverage > 0 ? e.maxLeverage : void 0), m = o != null ? a(o) : u, d = e.collateralApy ? M(e.collateralApy) : [], k = e.collateralApy ? L(e.collateralApy) : [], r = o != null ? j({
|
|
48
|
-
leverage: o,
|
|
49
|
-
borrowApy: e.borrowApy,
|
|
50
|
-
quotaRate: e.quotaRate,
|
|
51
|
-
liquidationThreshold: e.liquidationThreshold,
|
|
52
|
-
quotaMode: e.quotaMode
|
|
53
|
-
}) : void 0, f = e.collateralApy?.organicApy, y = f != null && o != null ? f * o : void 0, v = d.map(
|
|
54
|
-
(l) => l.supplyApr != null && o != null ? l.supplyApr * o : void 0
|
|
55
|
-
), N = e.borrowApy != null && r != null ? -r.borrowCost : void 0, x = e.quotaRate != null && e.quotaRate !== 0, q = x && r != null ? r.quotaRate : void 0, R = x && r != null ? -r.quotaCost : void 0, C = y != null && r != null && v.every((l) => l != null) ? y + v.reduce((l, c) => l + (c ?? 0), 0) - r.totalCost : void 0, A = e.netApy != null ? T(e.netApy) : C;
|
|
56
|
-
return /* @__PURE__ */ i(
|
|
21
|
+
const { leverage: a, collateralApy: r } = s, c = A(s.netApy), u = c + s.borrowCost, h = r ? I(r) : [], b = r ? B(r) : [], v = h.map((t) => ({
|
|
22
|
+
reward: t,
|
|
23
|
+
value: Math.round(a * (t.supplyApr ?? 0))
|
|
24
|
+
})), x = u - v.reduce((t, f) => t + f.value, 0), y = a > 0 ? x / a : void 0;
|
|
25
|
+
return /* @__PURE__ */ n(
|
|
57
26
|
"div",
|
|
58
27
|
{
|
|
59
28
|
className: "flex w-full min-w-0 flex-col gap-4 rounded-xl border border-border bg-card p-4",
|
|
60
|
-
"data-testid":
|
|
29
|
+
"data-testid": i.root,
|
|
61
30
|
children: [
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
|
|
31
|
+
/* @__PURE__ */ n("div", { className: "flex h-6 items-center justify-between gap-3", children: [
|
|
32
|
+
/* @__PURE__ */ e("span", { className: "text-base font-semibold leading-4 text-foreground", children: /* @__PURE__ */ e(
|
|
33
|
+
l,
|
|
65
34
|
{
|
|
66
|
-
messageId: "components.
|
|
67
|
-
values: { leverage:
|
|
35
|
+
messageId: "components.yieldBreakdown.titleNetAtLeverage",
|
|
36
|
+
values: { leverage: d(a) }
|
|
68
37
|
}
|
|
69
38
|
) }),
|
|
70
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ e(
|
|
71
40
|
"span",
|
|
72
41
|
{
|
|
73
|
-
className:
|
|
42
|
+
className: g(
|
|
74
43
|
"rounded-md px-2 py-0.5 text-sm font-semibold tabular-nums",
|
|
75
|
-
|
|
44
|
+
c > 0 ? "bg-success/20 text-success" : "bg-muted text-muted-foreground"
|
|
76
45
|
),
|
|
77
|
-
"data-testid":
|
|
78
|
-
children:
|
|
46
|
+
"data-testid": i.net,
|
|
47
|
+
children: m(c)
|
|
79
48
|
}
|
|
80
49
|
)
|
|
81
50
|
] }),
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
|
|
51
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-3", children: [
|
|
52
|
+
/* @__PURE__ */ e(
|
|
53
|
+
p,
|
|
85
54
|
{
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
55
|
+
testId: i.collateral,
|
|
56
|
+
label: /* @__PURE__ */ e(l, { messageId: "components.yieldBreakdown.collateralApy" }),
|
|
57
|
+
value: m(x),
|
|
58
|
+
subtext: o && y !== void 0 ? /* @__PURE__ */ e(
|
|
59
|
+
l,
|
|
90
60
|
{
|
|
91
|
-
|
|
92
|
-
|
|
61
|
+
messageId: "components.strategyApyBreakdownCard.formula",
|
|
62
|
+
values: {
|
|
63
|
+
leverage: d(a),
|
|
64
|
+
base: m(y)
|
|
65
|
+
}
|
|
93
66
|
}
|
|
94
67
|
) : void 0
|
|
95
68
|
}
|
|
96
69
|
),
|
|
97
|
-
|
|
98
|
-
|
|
70
|
+
v.map(({ reward: t, value: f }) => /* @__PURE__ */ e(
|
|
71
|
+
p,
|
|
99
72
|
{
|
|
100
|
-
label: /* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
|
|
73
|
+
label: /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
74
|
+
/* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
|
|
75
|
+
l,
|
|
103
76
|
{
|
|
104
77
|
messageId: "components.apyParts.extraAPY",
|
|
105
|
-
values: { symbol:
|
|
78
|
+
values: { symbol: t.token.symbol }
|
|
106
79
|
}
|
|
107
80
|
) }),
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
|
|
81
|
+
/* @__PURE__ */ e(
|
|
82
|
+
N,
|
|
110
83
|
{
|
|
111
|
-
token:
|
|
112
|
-
symbol:
|
|
84
|
+
token: t.token,
|
|
85
|
+
symbol: t.token.symbol,
|
|
113
86
|
size: 16,
|
|
114
87
|
className: "shrink-0"
|
|
115
88
|
}
|
|
116
89
|
)
|
|
117
90
|
] }),
|
|
118
|
-
value:
|
|
119
|
-
subtext:
|
|
120
|
-
|
|
91
|
+
value: m(f),
|
|
92
|
+
subtext: o ? /* @__PURE__ */ e(
|
|
93
|
+
l,
|
|
121
94
|
{
|
|
122
|
-
|
|
123
|
-
|
|
95
|
+
messageId: "components.strategyApyBreakdownCard.formula",
|
|
96
|
+
values: {
|
|
97
|
+
leverage: d(a),
|
|
98
|
+
base: m(t.supplyApr ?? 0)
|
|
99
|
+
}
|
|
124
100
|
}
|
|
125
101
|
) : void 0
|
|
126
102
|
},
|
|
127
|
-
`incentive-${
|
|
103
|
+
`incentive-${t.token.address}-${t.supplyApr ?? 0}`
|
|
128
104
|
)),
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
|
|
105
|
+
/* @__PURE__ */ e(
|
|
106
|
+
p,
|
|
131
107
|
{
|
|
132
108
|
muted: !0,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
g,
|
|
137
|
-
{
|
|
138
|
-
base: s(-e.borrowApy),
|
|
139
|
-
leverage: a(r.debtMultiplier)
|
|
140
|
-
}
|
|
141
|
-
) : void 0
|
|
109
|
+
testId: i.borrow,
|
|
110
|
+
label: /* @__PURE__ */ e(l, { messageId: "components.yieldBreakdown.borrowRate" }),
|
|
111
|
+
value: m(-s.borrowCost)
|
|
142
112
|
}
|
|
143
113
|
),
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
) : void 0
|
|
161
|
-
}
|
|
162
|
-
) : null,
|
|
163
|
-
k.length > 0 ? /* @__PURE__ */ i(B, { children: [
|
|
164
|
-
/* @__PURE__ */ t("div", { className: "h-px w-full bg-divider" }),
|
|
165
|
-
k.map((l) => {
|
|
166
|
-
const c = l.multiplier != null && o != null ? l.multiplier * o : void 0;
|
|
167
|
-
return /* @__PURE__ */ t(
|
|
168
|
-
b,
|
|
169
|
-
{
|
|
170
|
-
label: /* @__PURE__ */ i("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
171
|
-
/* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(
|
|
172
|
-
p,
|
|
173
|
-
{
|
|
174
|
-
messageId: "components.yieldBreakdown.programPoints",
|
|
175
|
-
values: { name: l.name }
|
|
176
|
-
}
|
|
177
|
-
) }),
|
|
178
|
-
/* @__PURE__ */ t(
|
|
179
|
-
I,
|
|
180
|
-
{
|
|
181
|
-
reward: { name: l.name, type: l.id },
|
|
182
|
-
size: 16,
|
|
183
|
-
className: "shrink-0"
|
|
184
|
-
}
|
|
185
|
-
)
|
|
186
|
-
] }),
|
|
187
|
-
value: c != null ? `${a(c)}×` : u,
|
|
188
|
-
subtext: l.multiplier != null && o != null ? /* @__PURE__ */ t(
|
|
189
|
-
g,
|
|
114
|
+
b.length > 0 ? /* @__PURE__ */ n(k, { children: [
|
|
115
|
+
/* @__PURE__ */ e("div", { className: "h-px w-full bg-divider" }),
|
|
116
|
+
b.map((t) => /* @__PURE__ */ e(
|
|
117
|
+
p,
|
|
118
|
+
{
|
|
119
|
+
valueTestId: i.points,
|
|
120
|
+
label: /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
121
|
+
/* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
|
|
122
|
+
l,
|
|
123
|
+
{
|
|
124
|
+
messageId: "components.yieldBreakdown.programPoints",
|
|
125
|
+
values: { name: t.name }
|
|
126
|
+
}
|
|
127
|
+
) }),
|
|
128
|
+
/* @__PURE__ */ e(
|
|
129
|
+
w,
|
|
190
130
|
{
|
|
191
|
-
|
|
192
|
-
|
|
131
|
+
reward: { name: t.name, type: t.id },
|
|
132
|
+
size: 16,
|
|
133
|
+
className: "shrink-0"
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
] }),
|
|
137
|
+
value: t.multiplier != null ? `${d(t.multiplier * a)}×` : T,
|
|
138
|
+
subtext: o && t.multiplier != null ? /* @__PURE__ */ e(
|
|
139
|
+
l,
|
|
140
|
+
{
|
|
141
|
+
messageId: "components.strategyApyBreakdownCard.formula",
|
|
142
|
+
values: {
|
|
143
|
+
leverage: d(a),
|
|
144
|
+
base: d(t.multiplier)
|
|
193
145
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
146
|
+
}
|
|
147
|
+
) : void 0
|
|
148
|
+
},
|
|
149
|
+
t.id
|
|
150
|
+
))
|
|
199
151
|
] }) : null
|
|
200
152
|
] })
|
|
201
153
|
]
|
|
202
154
|
}
|
|
203
155
|
);
|
|
204
156
|
}
|
|
205
|
-
function
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
157
|
+
function m(s) {
|
|
158
|
+
const o = C(s), a = `${Math.abs(o).toFixed(2)}%`;
|
|
159
|
+
return o < 0 ? `−${a}` : a;
|
|
160
|
+
}
|
|
161
|
+
function p({
|
|
162
|
+
label: s,
|
|
163
|
+
value: o,
|
|
164
|
+
subtext: a,
|
|
165
|
+
muted: r = !1,
|
|
166
|
+
testId: c,
|
|
167
|
+
valueTestId: u = i.value
|
|
210
168
|
}) {
|
|
211
|
-
|
|
212
|
-
return /* @__PURE__ */ i(
|
|
169
|
+
return /* @__PURE__ */ n(
|
|
213
170
|
"div",
|
|
214
171
|
{
|
|
215
172
|
className: "flex items-start justify-between gap-3",
|
|
216
|
-
"data-testid":
|
|
173
|
+
"data-testid": c,
|
|
217
174
|
children: [
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
-
|
|
220
|
-
|
|
175
|
+
/* @__PURE__ */ e(
|
|
176
|
+
"span",
|
|
177
|
+
{
|
|
178
|
+
className: g(
|
|
179
|
+
"min-w-0 text-sm font-semibold leading-5",
|
|
180
|
+
r ? "text-muted-foreground" : "text-foreground"
|
|
181
|
+
),
|
|
182
|
+
children: s
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
/* @__PURE__ */ n("span", { className: "flex shrink-0 flex-col items-end", children: [
|
|
186
|
+
/* @__PURE__ */ e(
|
|
221
187
|
"span",
|
|
222
188
|
{
|
|
223
|
-
className:
|
|
189
|
+
className: g(
|
|
224
190
|
"text-sm font-semibold leading-5 tabular-nums",
|
|
225
|
-
|
|
191
|
+
r ? "text-muted-foreground" : "text-foreground"
|
|
226
192
|
),
|
|
227
|
-
|
|
193
|
+
"data-testid": u,
|
|
194
|
+
children: o
|
|
228
195
|
}
|
|
229
196
|
),
|
|
230
|
-
|
|
197
|
+
a != null ? /* @__PURE__ */ e(
|
|
198
|
+
"span",
|
|
199
|
+
{
|
|
200
|
+
className: "text-xs leading-4 text-muted-foreground",
|
|
201
|
+
"data-testid": i.caption,
|
|
202
|
+
children: a
|
|
203
|
+
}
|
|
204
|
+
) : null
|
|
231
205
|
] })
|
|
232
206
|
]
|
|
233
207
|
}
|
|
234
208
|
);
|
|
235
209
|
}
|
|
236
210
|
export {
|
|
237
|
-
|
|
238
|
-
|
|
211
|
+
G as StrategyApyBreakdownCard,
|
|
212
|
+
i as StrategyApyBreakdownCardTest
|
|
239
213
|
};
|