@gearbox-protocol/ui-kit 4.0.0-next.16 → 4.0.0-next.18
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/index.cjs +1 -1
- package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
- package/dist/cjs/components/base/position-assets/constants.cjs +1 -0
- package/dist/cjs/components/base/position-assets/index.cjs +1 -0
- package/dist/cjs/components/base/position-assets/position-assets.cjs +1 -0
- 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/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.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/utils/index.cjs +1 -1
- package/dist/cjs/utils/strategy-apy.cjs +1 -1
- package/dist/esm/components/base/index.js +112 -108
- package/dist/esm/components/base/info-list/info-list.js +7 -6
- package/dist/esm/components/base/position-assets/constants.js +8 -0
- package/dist/esm/components/base/position-assets/index.js +6 -0
- package/dist/esm/components/base/position-assets/position-assets.js +73 -0
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +121 -116
- package/dist/esm/components/base/values/scalars.js +52 -33
- package/dist/esm/components/checkbox/checkbox-labeled.js +1 -1
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +1 -1
- package/dist/esm/components/compound-apy/compound-apy.js +2 -2
- package/dist/esm/components/index.js +662 -658
- package/dist/esm/components/with-copy/with-copy.js +1 -1
- package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown-tooltip.js +20 -21
- package/dist/esm/index.js +851 -848
- package/dist/esm/utils/index.js +29 -30
- package/dist/esm/utils/strategy-apy.js +41 -31
- package/dist/types/components/base/index.d.ts +1 -0
- package/dist/types/components/base/position-assets/constants.d.ts +5 -0
- package/dist/types/components/base/position-assets/index.d.ts +2 -0
- package/dist/types/components/base/position-assets/position-assets.d.ts +49 -0
- package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts +7 -13
- package/dist/types/components/base/values/scalars.d.ts +4 -0
- package/dist/types/components/compound-apy/compound-apy.d.ts +2 -2
- package/dist/types/components/yield-breakdown-tooltip/yield-breakdown-tooltip.d.ts +3 -3
- package/dist/types/utils/strategy-apy.d.ts +21 -18
- package/package.json +2 -2
|
@@ -36,6 +36,7 @@ import "../simple-accordion/simple-accordion.js";
|
|
|
36
36
|
import "../tip-card/tip-card.js";
|
|
37
37
|
import "../typography/typography.js";
|
|
38
38
|
import "../points-icon/points-icon.js";
|
|
39
|
+
import "viem";
|
|
39
40
|
import "../vertical-indicator/vertical-indicator.js";
|
|
40
41
|
import "../base/page-title/page-title.js";
|
|
41
42
|
import "../detailed-page-title/detailed-page-title-copy-button.js";
|
|
@@ -72,7 +73,6 @@ import "../dialog/dialog-header.js";
|
|
|
72
73
|
import "../dialog/dialog-title.js";
|
|
73
74
|
import "../dialog/dialog-modal-container.js";
|
|
74
75
|
import "../dialog/dialog-overlay.js";
|
|
75
|
-
import "viem";
|
|
76
76
|
import "../input/input.js";
|
|
77
77
|
import "../label/label.js";
|
|
78
78
|
import "../simple-dropdown/simple-dropdown.js";
|
|
@@ -1,35 +1,34 @@
|
|
|
1
|
-
import { jsxs as a, jsx as e, Fragment as
|
|
2
|
-
import { PointsIcon as
|
|
3
|
-
import { TokenIcon as
|
|
4
|
-
import { SimpleTooltip as
|
|
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";
|
|
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
|
|
8
|
+
import { tokenRewardsOf as I, pointProgramsOf as B, totalApyOf as T } from "../../utils/apy-breakdown.js";
|
|
9
9
|
import "@gearbox-protocol/sdk";
|
|
10
|
-
import { bpsToPercent as
|
|
10
|
+
import { bpsToPercent as $ } from "../../utils/bps.js";
|
|
11
11
|
import { cn as p } from "../../utils/cn.js";
|
|
12
12
|
import "sonner";
|
|
13
|
-
import { formatLeverage as
|
|
14
|
-
import { formatCompactPercent as
|
|
15
|
-
import { strategyQuotaRate as O } from "../../utils/strategy-apy.js";
|
|
13
|
+
import { formatLeverage as j } from "../../utils/format-leverage.js";
|
|
14
|
+
import { formatCompactPercent as S } from "../../utils/format-money.js";
|
|
16
15
|
import "@gearbox-protocol/sdk/common-utils";
|
|
17
16
|
import "luxon";
|
|
18
17
|
import "../../utils/z-index.js";
|
|
19
18
|
function i(n) {
|
|
20
|
-
const o =
|
|
19
|
+
const o = $(n), r = S(Math.abs(o));
|
|
21
20
|
return o < 0 ? `-${r}` : r;
|
|
22
21
|
}
|
|
23
|
-
function
|
|
22
|
+
function V({
|
|
24
23
|
supplyApy: n,
|
|
25
24
|
maxLeverage: o,
|
|
26
25
|
collateralApy: r,
|
|
27
26
|
borrowApy: c,
|
|
28
|
-
|
|
27
|
+
quotaRate: u,
|
|
29
28
|
children: h,
|
|
30
29
|
className: f
|
|
31
30
|
}) {
|
|
32
|
-
const g = o !== void 0 && o > 0, l = r ?? n,
|
|
31
|
+
const g = o !== void 0 && o > 0, l = r ?? n, w = I(l), y = B(n), b = T(n), d = c != null || u != null ? -((c ?? 0) + (u ?? 0)) : void 0, x = y.filter((t) => t.multiplier != null), v = /* @__PURE__ */ a(
|
|
33
32
|
"div",
|
|
34
33
|
{
|
|
35
34
|
className: p(
|
|
@@ -47,7 +46,7 @@ function L({
|
|
|
47
46
|
{
|
|
48
47
|
messageId: "components.yieldBreakdown.titleNetAtLeverage",
|
|
49
48
|
values: {
|
|
50
|
-
leverage:
|
|
49
|
+
leverage: j(o)
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
52
|
) : /* @__PURE__ */ e(s, { messageId: "components.apyParts.totalAPY" }) }),
|
|
@@ -70,7 +69,7 @@ function L({
|
|
|
70
69
|
value: i(l.organicApy)
|
|
71
70
|
}
|
|
72
71
|
),
|
|
73
|
-
|
|
72
|
+
w.map((t) => t.supplyApr == null ? null : /* @__PURE__ */ e(
|
|
74
73
|
m,
|
|
75
74
|
{
|
|
76
75
|
muted: t.supplyApr < 0,
|
|
@@ -82,7 +81,7 @@ function L({
|
|
|
82
81
|
values: { symbol: t.token.symbol }
|
|
83
82
|
}
|
|
84
83
|
) }),
|
|
85
|
-
/* @__PURE__ */ e(
|
|
84
|
+
/* @__PURE__ */ e(P, { token: t.token, size: 20 })
|
|
86
85
|
] }),
|
|
87
86
|
value: i(t.supplyApr)
|
|
88
87
|
},
|
|
@@ -96,7 +95,7 @@ function L({
|
|
|
96
95
|
value: i(d)
|
|
97
96
|
}
|
|
98
97
|
),
|
|
99
|
-
x.length > 0 && /* @__PURE__ */ a(
|
|
98
|
+
x.length > 0 && /* @__PURE__ */ a(k, { children: [
|
|
100
99
|
/* @__PURE__ */ e("div", { className: "h-px w-full bg-divider" }),
|
|
101
100
|
x.map((t) => /* @__PURE__ */ e(
|
|
102
101
|
m,
|
|
@@ -110,7 +109,7 @@ function L({
|
|
|
110
109
|
}
|
|
111
110
|
) }),
|
|
112
111
|
/* @__PURE__ */ e(
|
|
113
|
-
|
|
112
|
+
N,
|
|
114
113
|
{
|
|
115
114
|
reward: {
|
|
116
115
|
name: t.name,
|
|
@@ -129,7 +128,7 @@ function L({
|
|
|
129
128
|
}
|
|
130
129
|
);
|
|
131
130
|
return /* @__PURE__ */ e(
|
|
132
|
-
|
|
131
|
+
A,
|
|
133
132
|
{
|
|
134
133
|
placement: "bottom",
|
|
135
134
|
triangle: !1,
|
|
@@ -138,7 +137,7 @@ function L({
|
|
|
138
137
|
maxWidth: "100%",
|
|
139
138
|
title: /* @__PURE__ */ e("span", { className: f, children: h }),
|
|
140
139
|
triggerClassName: f,
|
|
141
|
-
children:
|
|
140
|
+
children: v
|
|
142
141
|
}
|
|
143
142
|
);
|
|
144
143
|
}
|
|
@@ -162,5 +161,5 @@ function m({
|
|
|
162
161
|
] });
|
|
163
162
|
}
|
|
164
163
|
export {
|
|
165
|
-
|
|
164
|
+
V as YieldBreakdownTooltip
|
|
166
165
|
};
|