@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
|
@@ -1,63 +1,82 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as r, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { formatUnits as m } from "viem";
|
|
3
|
+
import { CompoundAPY as p } from "../../compound-apy/compound-apy.js";
|
|
4
|
+
import { SimpleTooltip as u } from "../../tooltip/simple-tooltip.js";
|
|
5
|
+
import "../../tooltip/tooltip.js";
|
|
3
6
|
import "react";
|
|
4
7
|
import "@gearbox-protocol/sdk";
|
|
5
8
|
import { cn as a } from "../../../utils/cn.js";
|
|
6
9
|
import "sonner";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
10
|
+
import { formatAssetAmount as c } from "../../../utils/format-asset-amount.js";
|
|
11
|
+
import { formatLeverage as d } from "../../../utils/format-leverage.js";
|
|
12
|
+
import { formatPercentAmount as f, formatMoney as h } from "../../../utils/format-money.js";
|
|
9
13
|
import "@gearbox-protocol/sdk/common-utils";
|
|
10
14
|
import "luxon";
|
|
11
15
|
import "../../../utils/z-index.js";
|
|
12
|
-
import { ValueTest as
|
|
13
|
-
const
|
|
14
|
-
function
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
+
import { ValueTest as e } from "./constants.js";
|
|
17
|
+
const v = "—";
|
|
18
|
+
function n() {
|
|
19
|
+
return /* @__PURE__ */ r("span", { "data-testid": e.placeholder, children: v });
|
|
16
20
|
}
|
|
17
|
-
function
|
|
18
|
-
return `${
|
|
21
|
+
function l(t) {
|
|
22
|
+
return `${f(t / 100, 2)}%`;
|
|
19
23
|
}
|
|
20
|
-
function
|
|
21
|
-
return t === void 0 ? /* @__PURE__ */
|
|
24
|
+
function E({ data: t }) {
|
|
25
|
+
return t === void 0 ? /* @__PURE__ */ r(n, {}) : typeof t == "number" ? /* @__PURE__ */ r("span", { "data-testid": e.apy, children: l(t) }) : /* @__PURE__ */ r("span", { "data-testid": e.apy, children: /* @__PURE__ */ r(p, { apy: t }) });
|
|
22
26
|
}
|
|
23
|
-
function
|
|
27
|
+
function H({
|
|
24
28
|
data: t
|
|
25
29
|
}) {
|
|
26
|
-
return t == null ? /* @__PURE__ */
|
|
30
|
+
return t == null ? /* @__PURE__ */ r(n, {}) : /* @__PURE__ */ r("span", { "data-testid": e.usd, children: h(t) });
|
|
27
31
|
}
|
|
28
|
-
function
|
|
32
|
+
function N({
|
|
29
33
|
data: t
|
|
30
34
|
}) {
|
|
31
|
-
return t === void 0 ? /* @__PURE__ */
|
|
35
|
+
return t === void 0 ? /* @__PURE__ */ r(n, {}) : /* @__PURE__ */ r("span", { "data-testid": e.leverage, children: `${d(t)}x` });
|
|
32
36
|
}
|
|
33
37
|
function w({
|
|
34
38
|
data: t
|
|
35
39
|
}) {
|
|
36
|
-
return t === void 0 ? /* @__PURE__ */
|
|
40
|
+
return t === void 0 ? /* @__PURE__ */ r(n, {}) : /* @__PURE__ */ r("span", { "data-testid": e.utilization, children: l(t) });
|
|
37
41
|
}
|
|
38
|
-
function
|
|
42
|
+
function D({
|
|
39
43
|
data: t
|
|
40
44
|
}) {
|
|
41
45
|
if (t === void 0)
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
const
|
|
44
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ r(n, {});
|
|
47
|
+
const i = t < 1e4 ? "text-destructive" : t < 11e3 ? "text-warning" : "text-success";
|
|
48
|
+
return /* @__PURE__ */ r("span", { "data-testid": e.healthFactor, className: a(i), children: (t / 1e4).toFixed(2) });
|
|
45
49
|
}
|
|
46
|
-
function
|
|
50
|
+
function M({
|
|
47
51
|
data: t,
|
|
48
|
-
token:
|
|
52
|
+
token: i
|
|
49
53
|
}) {
|
|
50
|
-
if (t === void 0 ||
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
const
|
|
53
|
-
return
|
|
54
|
+
if (t === void 0 || i === void 0)
|
|
55
|
+
return /* @__PURE__ */ r(n, {});
|
|
56
|
+
const o = m(t, i.decimals);
|
|
57
|
+
return (
|
|
58
|
+
// `title` also keeps the amount where a hover tooltip cannot reach:
|
|
59
|
+
// keyboard, touch, and the browser's own find
|
|
60
|
+
/* @__PURE__ */ s("span", { "data-testid": e.tokenBigint, title: `${o} ${i.symbol}`, children: [
|
|
61
|
+
/* @__PURE__ */ r(
|
|
62
|
+
u,
|
|
63
|
+
{
|
|
64
|
+
placement: "top",
|
|
65
|
+
className: "break-all",
|
|
66
|
+
title: /* @__PURE__ */ r("span", { children: c(t, i.decimals) }),
|
|
67
|
+
children: /* @__PURE__ */ r("span", { children: o })
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
` ${i.symbol}`
|
|
71
|
+
] })
|
|
72
|
+
);
|
|
54
73
|
}
|
|
55
74
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
75
|
+
E as ApyValue,
|
|
76
|
+
D as HealthFactorValue,
|
|
77
|
+
N as LeverageValue,
|
|
78
|
+
M as TokenBigint,
|
|
79
|
+
H as UsdValue,
|
|
61
80
|
w as UtilizationValue,
|
|
62
|
-
|
|
81
|
+
l as bps
|
|
63
82
|
};
|
|
@@ -37,6 +37,7 @@ import "../simple-accordion/simple-accordion.js";
|
|
|
37
37
|
import "../tip-card/tip-card.js";
|
|
38
38
|
import "../typography/typography.js";
|
|
39
39
|
import "../points-icon/points-icon.js";
|
|
40
|
+
import "viem";
|
|
40
41
|
import "../vertical-indicator/vertical-indicator.js";
|
|
41
42
|
import "../base/page-title/page-title.js";
|
|
42
43
|
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 as k } from "../label/label.js";
|
|
78
78
|
import "../simple-dropdown/simple-dropdown.js";
|
|
@@ -37,6 +37,7 @@ import "../../simple-accordion/simple-accordion.js";
|
|
|
37
37
|
import "../../tip-card/tip-card.js";
|
|
38
38
|
import "../../typography/typography.js";
|
|
39
39
|
import "../../points-icon/points-icon.js";
|
|
40
|
+
import "viem";
|
|
40
41
|
import "../../vertical-indicator/vertical-indicator.js";
|
|
41
42
|
import "../../base/page-title/page-title.js";
|
|
42
43
|
import "../../detailed-page-title/detailed-page-title-copy-button.js";
|
|
@@ -73,7 +74,6 @@ import "../../dialog/dialog-header.js";
|
|
|
73
74
|
import "../../dialog/dialog-title.js";
|
|
74
75
|
import "../../dialog/dialog-modal-container.js";
|
|
75
76
|
import "../../dialog/dialog-overlay.js";
|
|
76
|
-
import "viem";
|
|
77
77
|
import "../../input/input.js";
|
|
78
78
|
import "../../label/label.js";
|
|
79
79
|
import "../../simple-dropdown/simple-dropdown.js";
|