@gearbox-protocol/ui-kit 4.0.0-next.15 → 4.0.0-next.17
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/stat-badge/constants.cjs +1 -1
- package/dist/cjs/components/base/stat-badge/stat-badge.cjs +1 -1
- package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/tabber/tabber.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/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/locale/en.json.cjs +1 -1
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/cjs/utils/strategy-apy.cjs +1 -0
- 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/stat-badge/constants.js +1 -0
- package/dist/esm/components/base/stat-badge/stat-badge.js +87 -52
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +130 -110
- package/dist/esm/components/base/tabber/tabber.js +67 -64
- 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/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 -19
- package/dist/esm/index.js +858 -850
- package/dist/esm/locale/en.json.js +2 -1
- package/dist/esm/utils/index.js +64 -60
- package/dist/esm/utils/strategy-apy.js +41 -0
- 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/stat-badge/constants.d.ts +1 -0
- package/dist/types/components/base/stat-badge/stat-badge.d.ts +11 -1
- package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts +12 -0
- package/dist/types/components/base/tabber/tabber.d.ts +2 -2
- package/dist/types/components/base/values/scalars.d.ts +4 -0
- package/dist/types/locale/en.json.d.ts +2 -1
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/strategy-apy.d.ts +37 -0
- package/package.json +1 -1
|
@@ -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,25 +1,26 @@
|
|
|
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 P } 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 T } 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 B, pointProgramsOf as R, totalApyOf as $ } from "../../utils/apy-breakdown.js";
|
|
9
9
|
import "@gearbox-protocol/sdk";
|
|
10
|
-
import { bpsToPercent as
|
|
10
|
+
import { bpsToPercent as j } 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
|
|
13
|
+
import { formatLeverage as S } from "../../utils/format-leverage.js";
|
|
14
|
+
import { formatCompactPercent as C } from "../../utils/format-money.js";
|
|
15
|
+
import { strategyQuotaRate as O } from "../../utils/strategy-apy.js";
|
|
15
16
|
import "@gearbox-protocol/sdk/common-utils";
|
|
16
17
|
import "luxon";
|
|
17
18
|
import "../../utils/z-index.js";
|
|
18
19
|
function i(n) {
|
|
19
|
-
const o =
|
|
20
|
+
const o = j(n), r = C(Math.abs(o));
|
|
20
21
|
return o < 0 ? `-${r}` : r;
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
+
function L({
|
|
23
24
|
supplyApy: n,
|
|
24
25
|
maxLeverage: o,
|
|
25
26
|
collateralApy: r,
|
|
@@ -28,7 +29,7 @@ function U({
|
|
|
28
29
|
children: h,
|
|
29
30
|
className: f
|
|
30
31
|
}) {
|
|
31
|
-
const g = o !== void 0 && o > 0, l = r ?? n,
|
|
32
|
+
const g = o !== void 0 && o > 0, l = r ?? n, y = B(l), w = R(n), b = $(n), v = c != null || u != null, k = O({ additionalBorrowApy: u, maxLeverage: o }), d = v ? -((c ?? 0) + k) : void 0, x = w.filter((t) => t.multiplier != null), N = /* @__PURE__ */ a(
|
|
32
33
|
"div",
|
|
33
34
|
{
|
|
34
35
|
className: p(
|
|
@@ -46,7 +47,7 @@ function U({
|
|
|
46
47
|
{
|
|
47
48
|
messageId: "components.yieldBreakdown.titleNetAtLeverage",
|
|
48
49
|
values: {
|
|
49
|
-
leverage:
|
|
50
|
+
leverage: S(o)
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
) : /* @__PURE__ */ e(s, { messageId: "components.apyParts.totalAPY" }) }),
|
|
@@ -69,7 +70,7 @@ function U({
|
|
|
69
70
|
value: i(l.organicApy)
|
|
70
71
|
}
|
|
71
72
|
),
|
|
72
|
-
|
|
73
|
+
y.map((t) => t.supplyApr == null ? null : /* @__PURE__ */ e(
|
|
73
74
|
m,
|
|
74
75
|
{
|
|
75
76
|
muted: t.supplyApr < 0,
|
|
@@ -81,7 +82,7 @@ function U({
|
|
|
81
82
|
values: { symbol: t.token.symbol }
|
|
82
83
|
}
|
|
83
84
|
) }),
|
|
84
|
-
/* @__PURE__ */ e(
|
|
85
|
+
/* @__PURE__ */ e(I, { token: t.token, size: 20 })
|
|
85
86
|
] }),
|
|
86
87
|
value: i(t.supplyApr)
|
|
87
88
|
},
|
|
@@ -95,7 +96,7 @@ function U({
|
|
|
95
96
|
value: i(d)
|
|
96
97
|
}
|
|
97
98
|
),
|
|
98
|
-
x.length > 0 && /* @__PURE__ */ a(
|
|
99
|
+
x.length > 0 && /* @__PURE__ */ a(P, { children: [
|
|
99
100
|
/* @__PURE__ */ e("div", { className: "h-px w-full bg-divider" }),
|
|
100
101
|
x.map((t) => /* @__PURE__ */ e(
|
|
101
102
|
m,
|
|
@@ -109,7 +110,7 @@ function U({
|
|
|
109
110
|
}
|
|
110
111
|
) }),
|
|
111
112
|
/* @__PURE__ */ e(
|
|
112
|
-
|
|
113
|
+
A,
|
|
113
114
|
{
|
|
114
115
|
reward: {
|
|
115
116
|
name: t.name,
|
|
@@ -128,7 +129,7 @@ function U({
|
|
|
128
129
|
}
|
|
129
130
|
);
|
|
130
131
|
return /* @__PURE__ */ e(
|
|
131
|
-
|
|
132
|
+
T,
|
|
132
133
|
{
|
|
133
134
|
placement: "bottom",
|
|
134
135
|
triangle: !1,
|
|
@@ -137,7 +138,7 @@ function U({
|
|
|
137
138
|
maxWidth: "100%",
|
|
138
139
|
title: /* @__PURE__ */ e("span", { className: f, children: h }),
|
|
139
140
|
triggerClassName: f,
|
|
140
|
-
children:
|
|
141
|
+
children: N
|
|
141
142
|
}
|
|
142
143
|
);
|
|
143
144
|
}
|
|
@@ -161,5 +162,5 @@ function m({
|
|
|
161
162
|
] });
|
|
162
163
|
}
|
|
163
164
|
export {
|
|
164
|
-
|
|
165
|
+
L as YieldBreakdownTooltip
|
|
165
166
|
};
|