@gearbox-protocol/ui-kit 4.0.0-next.42 → 4.0.0-next.44
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/borrow-rate-block/borrow-rate-block.cjs +1 -1
- 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/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/position-assets/position-assets.cjs +1 -1
- package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/token-amount/token-amount.cjs +1 -1
- package/dist/cjs/components/base/values/constants.cjs +1 -1
- package/dist/cjs/components/base/values/index.cjs +1 -1
- package/dist/cjs/components/base/values/no-value.cjs +1 -0
- package/dist/cjs/components/base/values/pnl-value.cjs +1 -1
- package/dist/cjs/components/base/values/price-impact-value.cjs +1 -1
- package/dist/cjs/components/base/values/scalars.cjs +1 -1
- package/dist/cjs/components/base-table/base-table-line.cjs +1 -1
- package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-button/styled-button.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/help-tip/help-tip.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/link/link.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +3 -2
- package/dist/esm/components/base/index.js +63 -61
- package/dist/esm/components/base/info-list/info-list.js +8 -7
- package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +74 -61
- package/dist/esm/components/base/position-assets/position-assets.js +4 -3
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +86 -74
- package/dist/esm/components/base/token-amount/token-amount.js +32 -16
- package/dist/esm/components/base/values/constants.js +1 -0
- package/dist/esm/components/base/values/index.js +21 -19
- package/dist/esm/components/base/values/no-value.js +34 -0
- package/dist/esm/components/base/values/pnl-value.js +10 -9
- package/dist/esm/components/base/values/price-impact-value.js +6 -5
- package/dist/esm/components/base/values/scalars.js +23 -26
- package/dist/esm/components/base-table/base-table-line.js +44 -36
- package/dist/esm/components/checkbox/checkbox-labeled.js +1 -1
- package/dist/esm/components/client-adapters/styled-button/styled-button.js +5 -11
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +1 -1
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +47 -46
- package/dist/esm/components/compound-apy/compound-apy.js +48 -40
- package/dist/esm/components/help-tip/help-tip.js +64 -59
- package/dist/esm/components/index.js +624 -622
- package/dist/esm/components/link/link.js +48 -34
- package/dist/esm/components/with-copy/with-copy.js +1 -1
- package/dist/esm/index.js +805 -803
- package/dist/esm/locale/en.json.js +1 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/base/apy-breakdown-body/apy-breakdown-body.d.ts +4 -3
- package/dist/types/components/base/values/constants.d.ts +1 -0
- package/dist/types/components/base/values/index.d.ts +1 -0
- package/dist/types/components/base/values/no-value.d.ts +25 -0
- package/dist/types/components/base/values/scalars.d.ts +7 -2
- package/dist/types/components/client-adapters/styled-button/styled-button.d.ts +10 -5
- package/dist/types/locale/en.json.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,30 +1,38 @@
|
|
|
1
1
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
import "../buttons/button/button.js";
|
|
2
|
+
import { NoValue as G } from "../base/values/no-value.js";
|
|
4
3
|
import "react";
|
|
5
4
|
import "@gearbox-protocol/sdk/onchain";
|
|
6
|
-
import { cn as
|
|
5
|
+
import { cn as s } from "../../utils/cn.js";
|
|
7
6
|
import "sonner";
|
|
8
7
|
import "luxon";
|
|
9
8
|
import "../../utils/z-index.js";
|
|
9
|
+
import "../points-icon/points-icon.js";
|
|
10
|
+
import "viem";
|
|
11
|
+
import "../token-icon/token-icon.js";
|
|
12
|
+
import "react-intl";
|
|
13
|
+
import "../tooltip/simple-tooltip.js";
|
|
14
|
+
import "../tooltip/tooltip.js";
|
|
15
|
+
import "../badge/badge.js";
|
|
16
|
+
import "../badge/chip.js";
|
|
17
|
+
import "../buttons/button/button.js";
|
|
10
18
|
import { GridTableRow as h, GridTableCell as u } from "../table/grid-table.js";
|
|
11
19
|
import "../skeleton/skeleton.js";
|
|
12
20
|
import "../table/table.js";
|
|
13
|
-
import { Typography as
|
|
14
|
-
import { useIsMedium as
|
|
15
|
-
import { BaseTableLineTest as
|
|
16
|
-
const
|
|
21
|
+
import { Typography as k } from "../typography/typography.js";
|
|
22
|
+
import { useIsMedium as z, useIsMobile as D } from "../../hooks/use-media-query.js";
|
|
23
|
+
import { BaseTableLineTest as O } from "./constants.js";
|
|
24
|
+
const P = "min-w-0 max-w-full overflow-hidden", S = s(
|
|
17
25
|
"min-w-0 max-w-full self-stretch items-center overflow-x-clip py-2 pl-4",
|
|
18
26
|
"[&_span.truncate]:whitespace-normal",
|
|
19
27
|
"[&_div.overflow-hidden]:overflow-visible"
|
|
20
|
-
),
|
|
28
|
+
), F = "min-w-0 max-w-full overflow-visible whitespace-nowrap";
|
|
21
29
|
function v({
|
|
22
30
|
label: t,
|
|
23
31
|
children: r
|
|
24
32
|
}) {
|
|
25
33
|
return /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
26
34
|
/* @__PURE__ */ i(
|
|
27
|
-
|
|
35
|
+
k,
|
|
28
36
|
{
|
|
29
37
|
as: "span",
|
|
30
38
|
variant: "caption",
|
|
@@ -36,62 +44,62 @@ function v({
|
|
|
36
44
|
/* @__PURE__ */ i("div", { className: "min-w-0 text-sm", children: r })
|
|
37
45
|
] });
|
|
38
46
|
}
|
|
39
|
-
function
|
|
47
|
+
function pe({
|
|
40
48
|
columns: t,
|
|
41
49
|
cells: r,
|
|
42
|
-
last:
|
|
43
|
-
href:
|
|
50
|
+
last: b,
|
|
51
|
+
href: x,
|
|
44
52
|
disabled: l = !1,
|
|
45
53
|
disabledStyle: g = !1,
|
|
46
54
|
accentClassName: C,
|
|
47
|
-
onRowClick:
|
|
55
|
+
onRowClick: m,
|
|
48
56
|
"data-testid": N,
|
|
49
57
|
minHeightClassName: L = "min-h-[66px]"
|
|
50
58
|
}) {
|
|
51
|
-
const _ =
|
|
59
|
+
const _ = z(), T = D(), n = t.filter((e) => e.mobile === "title"), p = n.length > 0 ? n : t.slice(0, 1), y = t.filter((e) => e.mobile === "badge"), B = new Set(p.map((e) => e.id)), d = t.filter(
|
|
52
60
|
(e) => !B.has(e.id) && (e.mobile ?? "stat") === "stat"
|
|
53
|
-
), j = t.filter((e) => e.mobile === "block"),
|
|
54
|
-
last:
|
|
55
|
-
href:
|
|
61
|
+
), j = t.filter((e) => e.mobile === "block"), f = {
|
|
62
|
+
last: b,
|
|
63
|
+
href: x,
|
|
56
64
|
noHover: l,
|
|
57
65
|
"data-disabled": l,
|
|
58
|
-
"data-testid": N ??
|
|
59
|
-
onRowClick: l ? void 0 :
|
|
60
|
-
},
|
|
61
|
-
|
|
66
|
+
"data-testid": N ?? O.root,
|
|
67
|
+
onRowClick: l ? void 0 : m
|
|
68
|
+
}, c = s(
|
|
69
|
+
m && !l && "cursor-pointer",
|
|
62
70
|
g && "text-secondary-foreground!",
|
|
63
71
|
l && "cursor-not-allowed",
|
|
64
72
|
C
|
|
65
73
|
);
|
|
66
|
-
return
|
|
74
|
+
return T ? /* @__PURE__ */ i(h, { ...f, className: c, children: /* @__PURE__ */ a(
|
|
67
75
|
u,
|
|
68
76
|
{
|
|
69
77
|
span: "full",
|
|
70
78
|
size: "sm",
|
|
71
|
-
className:
|
|
79
|
+
className: s(
|
|
72
80
|
"flex min-w-0 max-w-full flex-col items-start gap-3 overflow-x-clip py-3",
|
|
73
81
|
"[&_span.truncate]:whitespace-normal [&_div.overflow-hidden]:overflow-visible"
|
|
74
82
|
),
|
|
75
83
|
children: [
|
|
76
84
|
/* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [
|
|
77
|
-
|
|
78
|
-
|
|
85
|
+
p.map((e) => /* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: r[e.id] }, e.id)),
|
|
86
|
+
y.map((e) => /* @__PURE__ */ i("div", { children: r[e.id] }, e.id))
|
|
79
87
|
] }),
|
|
80
|
-
|
|
88
|
+
d.length > 0 && /* @__PURE__ */ i("div", { className: "grid w-full min-w-0 grid-cols-3 gap-x-2 gap-y-3 [&_*]:text-left [&_*]:justify-start", children: d.map((e) => /* @__PURE__ */ i(v, { label: e.title, children: r[e.id] }, e.id)) }),
|
|
81
89
|
j.map((e) => {
|
|
82
|
-
const
|
|
83
|
-
return
|
|
90
|
+
const o = r[e.id];
|
|
91
|
+
return o == null || o === !1 ? null : /* @__PURE__ */ i(v, { label: e.title, children: o }, e.id);
|
|
84
92
|
})
|
|
85
93
|
]
|
|
86
94
|
}
|
|
87
95
|
) }) : /* @__PURE__ */ i(
|
|
88
96
|
h,
|
|
89
97
|
{
|
|
90
|
-
...
|
|
91
|
-
className:
|
|
92
|
-
children: t.map((e,
|
|
93
|
-
const I = e.justify ?? "start", M =
|
|
94
|
-
M ?
|
|
98
|
+
...f,
|
|
99
|
+
className: s(L, c),
|
|
100
|
+
children: t.map((e, o) => {
|
|
101
|
+
const I = e.justify ?? "start", M = o === 0, w = o === t.length - 1, A = e.mobile === "badge", E = s(
|
|
102
|
+
M ? S : A ? F : P,
|
|
95
103
|
w && "pr-4",
|
|
96
104
|
e.cellClassName
|
|
97
105
|
);
|
|
@@ -102,7 +110,7 @@ function ie({
|
|
|
102
110
|
textAlign: I === "end" ? "right" : "left",
|
|
103
111
|
gapBefore: w ? _ ? "sm" : "md" : void 0,
|
|
104
112
|
className: E,
|
|
105
|
-
children: r[e.id] ?? /* @__PURE__ */ i(
|
|
113
|
+
children: r[e.id] ?? /* @__PURE__ */ i(G, {})
|
|
106
114
|
},
|
|
107
115
|
e.id
|
|
108
116
|
);
|
|
@@ -111,6 +119,6 @@ function ie({
|
|
|
111
119
|
);
|
|
112
120
|
}
|
|
113
121
|
export {
|
|
114
|
-
|
|
115
|
-
|
|
122
|
+
pe as BaseTableLine,
|
|
123
|
+
O as BaseTableLineTest
|
|
116
124
|
};
|
|
@@ -35,6 +35,7 @@ import "../token-symbol/token-symbol.js";
|
|
|
35
35
|
import "../simple-accordion/simple-accordion.js";
|
|
36
36
|
import "../tip-card/tip-card.js";
|
|
37
37
|
import "../typography/typography.js";
|
|
38
|
+
import "../help-tip/help-tip.js";
|
|
38
39
|
import "../points-icon/points-icon.js";
|
|
39
40
|
import "viem";
|
|
40
41
|
import "../vertical-indicator/vertical-indicator.js";
|
|
@@ -81,7 +82,6 @@ import "../link/link.js";
|
|
|
81
82
|
import "../rounded-image/rounded-image.js";
|
|
82
83
|
import "../network-icon/network-indicator.js";
|
|
83
84
|
import "../base-link/base-link.js";
|
|
84
|
-
import "../help-tip/help-tip.js";
|
|
85
85
|
import "../base-table/base-table-line.js";
|
|
86
86
|
import "../navigation-context/navigation-context.js";
|
|
87
87
|
import "../cards/card/card.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
|
-
import { Button as
|
|
3
|
+
import { Button as p } from "../../buttons/button/button.js";
|
|
4
4
|
import "@gearbox-protocol/sdk/onchain";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as s } from "../../../utils/cn.js";
|
|
6
6
|
import "sonner";
|
|
7
7
|
import "luxon";
|
|
8
8
|
import "../../../utils/z-index.js";
|
|
@@ -13,20 +13,14 @@ const c = {
|
|
|
13
13
|
white: "white",
|
|
14
14
|
success: "success"
|
|
15
15
|
}, l = n.forwardRef(
|
|
16
|
-
({
|
|
17
|
-
|
|
18
|
-
$width: r = "compact",
|
|
19
|
-
$color: o = "primary",
|
|
20
|
-
className: e,
|
|
21
|
-
...i
|
|
22
|
-
}, m) => /* @__PURE__ */ a(
|
|
23
|
-
s,
|
|
16
|
+
({ size: t = "lg", width: r = "compact", color: o = "primary", className: e, ...i }, m) => /* @__PURE__ */ a(
|
|
17
|
+
p,
|
|
24
18
|
{
|
|
25
19
|
ref: m,
|
|
26
20
|
size: t,
|
|
27
21
|
width: r,
|
|
28
22
|
variant: c[o],
|
|
29
|
-
className:
|
|
23
|
+
className: s("inline-block whitespace-normal", e),
|
|
30
24
|
...i
|
|
31
25
|
}
|
|
32
26
|
)
|
|
@@ -35,6 +35,7 @@ import "../../token-symbol/token-symbol.js";
|
|
|
35
35
|
import "../../simple-accordion/simple-accordion.js";
|
|
36
36
|
import "../../tip-card/tip-card.js";
|
|
37
37
|
import "../../typography/typography.js";
|
|
38
|
+
import "../../help-tip/help-tip.js";
|
|
38
39
|
import "../../points-icon/points-icon.js";
|
|
39
40
|
import "viem";
|
|
40
41
|
import "../../vertical-indicator/vertical-indicator.js";
|
|
@@ -82,7 +83,6 @@ import "../../link/link.js";
|
|
|
82
83
|
import { RoundedImage as d } from "../../rounded-image/rounded-image.js";
|
|
83
84
|
import "../../network-icon/network-indicator.js";
|
|
84
85
|
import "../../base-link/base-link.js";
|
|
85
|
-
import "../../help-tip/help-tip.js";
|
|
86
86
|
import "../../base-table/base-table-line.js";
|
|
87
87
|
import "../../navigation-context/navigation-context.js";
|
|
88
88
|
import "../../cards/card/card.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as m, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import { NoValue as b } from "../../base/values/no-value.js";
|
|
2
3
|
import "react";
|
|
3
4
|
import "@gearbox-protocol/sdk/onchain";
|
|
4
5
|
import "clsx";
|
|
@@ -8,84 +9,84 @@ import { formatMoney as C } from "../../../utils/format-money.js";
|
|
|
8
9
|
import "luxon";
|
|
9
10
|
import "../../../utils/z-index.js";
|
|
10
11
|
import "../../points-icon/points-icon.js";
|
|
11
|
-
import { UtilizationValue as
|
|
12
|
+
import { UtilizationValue as S } from "../../base/values/scalars.js";
|
|
12
13
|
import "../../badge/badge.js";
|
|
13
14
|
import "../../badge/chip.js";
|
|
14
|
-
import { FormattedMessageTyped as
|
|
15
|
-
import { AllocationWheel as
|
|
15
|
+
import { FormattedMessageTyped as a } from "../../typed-intl/index.js";
|
|
16
|
+
import { AllocationWheel as k } from "../../collateral-allocation-tooltip/allocation-wheel.js";
|
|
16
17
|
import "@fortawesome/free-solid-svg-icons";
|
|
17
18
|
import "../../icons/fa-icon.js";
|
|
18
19
|
import "../../token-icon/token-icon.js";
|
|
19
20
|
import "../../tooltip/simple-tooltip.js";
|
|
20
21
|
import "../../tooltip/tooltip.js";
|
|
21
|
-
import { NameCell as
|
|
22
|
-
import { ShortString as
|
|
22
|
+
import { NameCell as w } from "../../name-cell/name-cell.js";
|
|
23
|
+
import { ShortString as L } from "../../short-string/short-string.js";
|
|
23
24
|
import "react-intl";
|
|
24
25
|
import "../../buttons/button/button.js";
|
|
25
|
-
import { GridTableRow as
|
|
26
|
+
import { GridTableRow as U, GridTableCell as l } from "../../table/grid-table.js";
|
|
26
27
|
import "../../skeleton/skeleton.js";
|
|
27
28
|
import "../../table/table.js";
|
|
28
|
-
import { TableLineSm as
|
|
29
|
-
import { TokenSymbol as
|
|
30
|
-
import { TokenTemplate as
|
|
31
|
-
import { VerticalIndicator as
|
|
29
|
+
import { TableLineSm as I, TableCellSm as n } from "../../table/table-sm.js";
|
|
30
|
+
import { TokenSymbol as P } from "../../token-symbol/token-symbol.js";
|
|
31
|
+
import { TokenTemplate as x } from "../../token-template/token-template.js";
|
|
32
|
+
import { VerticalIndicator as j } from "../../vertical-indicator/vertical-indicator.js";
|
|
32
33
|
import { PoolAssetsTableTest as p } from "./constants.js";
|
|
33
|
-
function
|
|
34
|
+
function V(i, t) {
|
|
34
35
|
if (t !== 0n)
|
|
35
36
|
return Number(i * 10000n / t);
|
|
36
37
|
}
|
|
37
38
|
function B(i, t) {
|
|
38
39
|
return t <= 0n || i <= 0n ? 0 : Number(i * 10000n / t) / 1e4;
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
+
function fe({
|
|
41
42
|
asset: i,
|
|
42
43
|
underlyingToken: t,
|
|
43
|
-
last:
|
|
44
|
+
last: T,
|
|
44
45
|
isCompact: c,
|
|
45
|
-
totalUsed:
|
|
46
|
-
colorIndex:
|
|
46
|
+
totalUsed: z,
|
|
47
|
+
colorIndex: A,
|
|
47
48
|
explorerUrl: d
|
|
48
49
|
}) {
|
|
49
|
-
const { token: r, limit: s, used:
|
|
50
|
-
|
|
50
|
+
const { token: r, limit: s, used: o } = i, N = c ? 40 : 21, u = B(o.value, z), h = () => /* @__PURE__ */ e(
|
|
51
|
+
w,
|
|
51
52
|
{
|
|
52
|
-
leading: /* @__PURE__ */ e(
|
|
53
|
-
title: /* @__PURE__ */ e(
|
|
53
|
+
leading: /* @__PURE__ */ e(P, { size: 32, token: r }),
|
|
54
|
+
title: /* @__PURE__ */ e(L, { maxLength: N, children: r.symbol })
|
|
54
55
|
}
|
|
55
|
-
), f = () => /* @__PURE__ */
|
|
56
|
+
), f = () => /* @__PURE__ */ m(
|
|
56
57
|
"div",
|
|
57
58
|
{
|
|
58
59
|
className: "flex items-center justify-end gap-2",
|
|
59
60
|
"data-testid": p.exposureCell,
|
|
60
61
|
children: [
|
|
61
62
|
/* @__PURE__ */ e(
|
|
62
|
-
|
|
63
|
+
k,
|
|
63
64
|
{
|
|
64
|
-
share:
|
|
65
|
-
colorIndex:
|
|
66
|
-
idle:
|
|
65
|
+
share: u,
|
|
66
|
+
colorIndex: A,
|
|
67
|
+
idle: u === 0
|
|
67
68
|
}
|
|
68
69
|
),
|
|
69
70
|
/* @__PURE__ */ e(
|
|
70
|
-
|
|
71
|
+
j,
|
|
71
72
|
{
|
|
72
73
|
value: /* @__PURE__ */ e(
|
|
73
|
-
|
|
74
|
+
x,
|
|
74
75
|
{
|
|
75
76
|
decimalPartLength: 2,
|
|
76
77
|
precision: 2,
|
|
77
78
|
showSymbol: !1,
|
|
78
79
|
token: t,
|
|
79
|
-
value:
|
|
80
|
+
value: o.value
|
|
80
81
|
}
|
|
81
82
|
),
|
|
82
|
-
valueDescription:
|
|
83
|
+
valueDescription: o.valueUsd === null ? /* @__PURE__ */ e(b, {}) : C(o.valueUsd)
|
|
83
84
|
}
|
|
84
85
|
)
|
|
85
86
|
]
|
|
86
87
|
}
|
|
87
|
-
), g = () => /* @__PURE__ */ e("div", { "data-testid": p.capCell, children: s.value === 0n ? /* @__PURE__ */ e(
|
|
88
|
-
|
|
88
|
+
), g = () => /* @__PURE__ */ e("div", { "data-testid": p.capCell, children: s.value === 0n ? /* @__PURE__ */ e(b, {}) : /* @__PURE__ */ e(
|
|
89
|
+
x,
|
|
89
90
|
{
|
|
90
91
|
decimalPartLength: 2,
|
|
91
92
|
precision: 2,
|
|
@@ -93,55 +94,55 @@ function he({
|
|
|
93
94
|
token: t,
|
|
94
95
|
value: s.value
|
|
95
96
|
}
|
|
96
|
-
) }), v = () => /* @__PURE__ */ e("div", { "data-testid": p.capUtilizationCell, children: /* @__PURE__ */ e(
|
|
97
|
+
) }), v = () => /* @__PURE__ */ e("div", { "data-testid": p.capUtilizationCell, children: /* @__PURE__ */ e(S, { data: V(o.value, s.value) }) });
|
|
97
98
|
return /* @__PURE__ */ e(
|
|
98
|
-
|
|
99
|
+
U,
|
|
99
100
|
{
|
|
100
|
-
last:
|
|
101
|
+
last: T,
|
|
101
102
|
height: "auto",
|
|
102
103
|
href: d ? `${d}/address/${r.address}` : void 0,
|
|
103
104
|
target: "_blank",
|
|
104
105
|
style: { minHeight: "75px" },
|
|
105
|
-
children: c ? /* @__PURE__ */ e(
|
|
106
|
-
|
|
106
|
+
children: c ? /* @__PURE__ */ e(l, { className: "px-3 py-0!", size: "sm", span: "full", children: /* @__PURE__ */ m(
|
|
107
|
+
I,
|
|
107
108
|
{
|
|
108
109
|
className: "w-full",
|
|
109
110
|
columns: 3,
|
|
110
111
|
columnsXs: 3,
|
|
111
|
-
title:
|
|
112
|
+
title: h(),
|
|
112
113
|
children: [
|
|
113
114
|
/* @__PURE__ */ e(
|
|
114
115
|
n,
|
|
115
116
|
{
|
|
116
|
-
title: /* @__PURE__ */ e(
|
|
117
|
+
title: /* @__PURE__ */ e(a, { messageId: "components.poolAssetsTable.exposure" }),
|
|
117
118
|
children: f()
|
|
118
119
|
}
|
|
119
120
|
),
|
|
120
121
|
/* @__PURE__ */ e(
|
|
121
122
|
n,
|
|
122
123
|
{
|
|
123
|
-
title: /* @__PURE__ */ e(
|
|
124
|
+
title: /* @__PURE__ */ e(a, { messageId: "components.poolAssetsTable.cap" }),
|
|
124
125
|
children: g()
|
|
125
126
|
}
|
|
126
127
|
),
|
|
127
128
|
/* @__PURE__ */ e(
|
|
128
129
|
n,
|
|
129
130
|
{
|
|
130
|
-
title: /* @__PURE__ */ e(
|
|
131
|
+
title: /* @__PURE__ */ e(a, { messageId: "components.poolAssetsTable.capUtilization" }),
|
|
131
132
|
children: v()
|
|
132
133
|
}
|
|
133
134
|
)
|
|
134
135
|
]
|
|
135
136
|
}
|
|
136
|
-
) }) : /* @__PURE__ */
|
|
137
|
-
/* @__PURE__ */ e(
|
|
138
|
-
/* @__PURE__ */ e(
|
|
139
|
-
/* @__PURE__ */ e(
|
|
140
|
-
/* @__PURE__ */ e(
|
|
137
|
+
) }) : /* @__PURE__ */ m(y, { children: [
|
|
138
|
+
/* @__PURE__ */ e(l, { className: "pl-4", size: "sm", textAlign: "left", children: h() }),
|
|
139
|
+
/* @__PURE__ */ e(l, { size: "sm", textAlign: "right", children: f() }),
|
|
140
|
+
/* @__PURE__ */ e(l, { size: "sm", textAlign: "right", children: g() }),
|
|
141
|
+
/* @__PURE__ */ e(l, { className: "pr-4", size: "sm", textAlign: "right", children: v() })
|
|
141
142
|
] })
|
|
142
143
|
}
|
|
143
144
|
);
|
|
144
145
|
}
|
|
145
146
|
export {
|
|
146
|
-
|
|
147
|
+
fe as PoolAssetsTableRow
|
|
147
148
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useId as
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { useId as v } from "react";
|
|
3
|
+
import { NoValue as x } from "../base/values/no-value.js";
|
|
4
4
|
import { totalApyOf as C, positiveTokenRewardsOf as I, pointProgramsOf as k } from "../../utils/apy-breakdown.js";
|
|
5
5
|
import "@gearbox-protocol/sdk/onchain";
|
|
6
6
|
import { bpsToPercent as P } from "../../utils/bps.js";
|
|
@@ -9,10 +9,18 @@ import "sonner";
|
|
|
9
9
|
import { formatCompactPercent as O } from "../../utils/format-money.js";
|
|
10
10
|
import "luxon";
|
|
11
11
|
import "../../utils/z-index.js";
|
|
12
|
+
import "../points-icon/points-icon.js";
|
|
13
|
+
import "viem";
|
|
14
|
+
import "../tooltip/simple-tooltip.js";
|
|
15
|
+
import "../tooltip/tooltip.js";
|
|
16
|
+
import "../badge/badge.js";
|
|
17
|
+
import "../badge/chip.js";
|
|
18
|
+
import "react-intl";
|
|
19
|
+
import { YieldBreakdownTooltip as F } from "../yield-breakdown-tooltip/yield-breakdown-tooltip.js";
|
|
12
20
|
const l = 14;
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
return /* @__PURE__ */
|
|
21
|
+
function N() {
|
|
22
|
+
const t = `additional-incentives-${v().replace(/:/g, "")}`;
|
|
23
|
+
return /* @__PURE__ */ o(
|
|
16
24
|
"svg",
|
|
17
25
|
{
|
|
18
26
|
width: l,
|
|
@@ -24,15 +32,15 @@ function F() {
|
|
|
24
32
|
role: "img",
|
|
25
33
|
"aria-label": "Incentives",
|
|
26
34
|
children: [
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ r("title", { children: "Incentives" }),
|
|
36
|
+
/* @__PURE__ */ r(
|
|
29
37
|
"path",
|
|
30
38
|
{
|
|
31
39
|
d: "M7 14C10.866 14 14 10.866 14 7C14 3.13401 10.866 0 7 0C3.13401 0 0 3.13401 0 7C0 10.866 3.13401 14 7 14Z",
|
|
32
|
-
fill: `url(#${
|
|
40
|
+
fill: `url(#${t})`
|
|
33
41
|
}
|
|
34
42
|
),
|
|
35
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ r(
|
|
36
44
|
"path",
|
|
37
45
|
{
|
|
38
46
|
d: "M7 3.75V10.25M3.75 7H10.25",
|
|
@@ -41,18 +49,18 @@ function F() {
|
|
|
41
49
|
strokeLinecap: "round"
|
|
42
50
|
}
|
|
43
51
|
),
|
|
44
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ r("defs", { children: /* @__PURE__ */ o(
|
|
45
53
|
"linearGradient",
|
|
46
54
|
{
|
|
47
|
-
id:
|
|
55
|
+
id: t,
|
|
48
56
|
x1: "0",
|
|
49
57
|
y1: "7",
|
|
50
58
|
x2: "14",
|
|
51
59
|
y2: "7",
|
|
52
60
|
gradientUnits: "userSpaceOnUse",
|
|
53
61
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ r("stop", { stopColor: "#FF2D8D" }),
|
|
63
|
+
/* @__PURE__ */ r("stop", { offset: "1", stopColor: "#FF6C20" })
|
|
56
64
|
]
|
|
57
65
|
}
|
|
58
66
|
) })
|
|
@@ -60,43 +68,43 @@ function F() {
|
|
|
60
68
|
}
|
|
61
69
|
);
|
|
62
70
|
}
|
|
63
|
-
function
|
|
64
|
-
return
|
|
71
|
+
function p(t) {
|
|
72
|
+
return t == null ? !1 : I(t).length > 0 || k(t).length > 0;
|
|
65
73
|
}
|
|
66
|
-
function
|
|
67
|
-
apy:
|
|
68
|
-
maxLeverage:
|
|
69
|
-
collateralApy:
|
|
70
|
-
borrowApy:
|
|
71
|
-
quotaRate:
|
|
72
|
-
decimals:
|
|
74
|
+
function W({
|
|
75
|
+
apy: t,
|
|
76
|
+
maxLeverage: m,
|
|
77
|
+
collateralApy: e,
|
|
78
|
+
borrowApy: c,
|
|
79
|
+
quotaRate: d,
|
|
80
|
+
decimals: a = 2,
|
|
73
81
|
tooltip: f = !0,
|
|
74
82
|
period: h,
|
|
75
|
-
className:
|
|
83
|
+
className: i
|
|
76
84
|
}) {
|
|
77
|
-
if (!
|
|
78
|
-
return /* @__PURE__ */
|
|
79
|
-
const
|
|
80
|
-
const w = O(P(
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
u ? /* @__PURE__ */
|
|
85
|
+
if (!t)
|
|
86
|
+
return /* @__PURE__ */ r(x, {});
|
|
87
|
+
const n = C(t), u = p(t) || p(e), g = f && n >= 1, s = () => {
|
|
88
|
+
const w = O(P(n), a);
|
|
89
|
+
return /* @__PURE__ */ o("div", { className: A("inline-flex items-center gap-1.5", i), children: [
|
|
90
|
+
/* @__PURE__ */ r("span", { className: "inline-flex items-center", children: w }),
|
|
91
|
+
u ? /* @__PURE__ */ r(N, {}) : null
|
|
84
92
|
] });
|
|
85
93
|
};
|
|
86
|
-
return g ? /* @__PURE__ */
|
|
87
|
-
|
|
94
|
+
return g ? /* @__PURE__ */ r(
|
|
95
|
+
F,
|
|
88
96
|
{
|
|
89
|
-
supplyApy:
|
|
90
|
-
maxLeverage:
|
|
91
|
-
collateralApy:
|
|
92
|
-
borrowApy:
|
|
93
|
-
quotaRate:
|
|
97
|
+
supplyApy: t,
|
|
98
|
+
maxLeverage: m,
|
|
99
|
+
collateralApy: e,
|
|
100
|
+
borrowApy: c,
|
|
101
|
+
quotaRate: d,
|
|
94
102
|
period: h,
|
|
95
|
-
className:
|
|
103
|
+
className: i,
|
|
96
104
|
children: s()
|
|
97
105
|
}
|
|
98
106
|
) : s();
|
|
99
107
|
}
|
|
100
108
|
export {
|
|
101
|
-
|
|
109
|
+
W as CompoundAPY
|
|
102
110
|
};
|