@gearbox-protocol/ui-kit 4.0.0-next.43 → 4.0.0-next.45
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/liquidation-price-block/liquidation-price-block.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/time-to-liquidation-block/time-to-liquidation-block.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-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/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.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/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/cjs/utils/format.cjs +1 -1
- package/dist/cjs/utils/index.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/liquidation-price-block/liquidation-price-block.js +46 -38
- 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 +45 -41
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +86 -74
- package/dist/esm/components/base/time-to-liquidation-block/time-to-liquidation-block.js +40 -32
- 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-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/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.js +26 -25
- 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/with-copy/with-copy.js +1 -1
- package/dist/esm/index.js +814 -811
- package/dist/esm/locale/en.json.js +1 -0
- package/dist/esm/utils/format.js +14 -12
- package/dist/esm/utils/index.js +76 -75
- 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/liquidation-price-block/liquidation-price-block.d.ts +8 -1
- package/dist/types/components/base/position-assets/position-assets.d.ts +7 -1
- package/dist/types/components/base/time-to-liquidation-block/time-to-liquidation-block.d.ts +8 -1
- 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/locale/en.json.d.ts +1 -0
- package/dist/types/utils/format.d.ts +8 -0
- package/package.json +1 -1
|
@@ -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
|
};
|
package/dist/esm/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as i, Fragment as d, jsx as
|
|
1
|
+
import { jsxs as i, Fragment as d, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { cva as y } from "class-variance-authority";
|
|
3
3
|
import { FadeoutLoading as g } from "../../../../fadeout-loading/fadeout-loading.js";
|
|
4
4
|
import { TokenIcon as v } from "../../../../token-icon/token-icon.js";
|
|
@@ -7,11 +7,12 @@ import "react";
|
|
|
7
7
|
import "@gearbox-protocol/sdk/onchain";
|
|
8
8
|
import { cn as h } from "../../../../../utils/cn.js";
|
|
9
9
|
import "sonner";
|
|
10
|
-
import {
|
|
10
|
+
import { APPROXIMATE_SYMBOL as k } from "../../../../../utils/format.js";
|
|
11
|
+
import { formatMoney as N } from "../../../../../utils/format-money.js";
|
|
11
12
|
import "luxon";
|
|
12
13
|
import "../../../../../utils/z-index.js";
|
|
13
|
-
import { TransactionConfirmAmountFieldTest as
|
|
14
|
-
const
|
|
14
|
+
import { TransactionConfirmAmountFieldTest as T } from "./constants.js";
|
|
15
|
+
const b = y(
|
|
15
16
|
"flex w-full items-center justify-between bg-gray-20 px-4 py-3",
|
|
16
17
|
{
|
|
17
18
|
variants: {
|
|
@@ -29,59 +30,59 @@ const T = "≈", b = y(
|
|
|
29
30
|
defaultVariants: { position: "first", size: "md" }
|
|
30
31
|
}
|
|
31
32
|
);
|
|
32
|
-
function S(
|
|
33
|
-
if (
|
|
33
|
+
function S(n) {
|
|
34
|
+
if (n.primaryAmount !== void 0)
|
|
34
35
|
return {
|
|
35
|
-
primaryAmount:
|
|
36
|
-
secondaryAmount:
|
|
36
|
+
primaryAmount: n.primaryAmount,
|
|
37
|
+
secondaryAmount: n.secondaryAmount
|
|
37
38
|
};
|
|
38
|
-
const { amount: t } =
|
|
39
|
+
const { amount: t } = n;
|
|
39
40
|
return {
|
|
40
41
|
primaryAmount: { value: t?.value, token: t?.token },
|
|
41
42
|
secondaryAmount: { valueUSD: t?.valueUsd ?? void 0 }
|
|
42
43
|
};
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
+
function E(n) {
|
|
45
46
|
const {
|
|
46
47
|
label: t,
|
|
47
48
|
loading: l = !1,
|
|
48
49
|
position: p,
|
|
49
|
-
size:
|
|
50
|
-
maxLength:
|
|
50
|
+
size: u = "md",
|
|
51
|
+
maxLength: c,
|
|
51
52
|
approximate: f
|
|
52
|
-
} =
|
|
53
|
-
e.token && /* @__PURE__ */
|
|
53
|
+
} = n, { isApproximate: m = !1, approximateSymbol: a = k } = f || {}, { primaryAmount: e, secondaryAmount: r } = S(n), x = e && "node" in e ? e.node : /* @__PURE__ */ i(d, { children: [
|
|
54
|
+
e.token && /* @__PURE__ */ o(v, { token: e.token, size: 16 }),
|
|
54
55
|
/* @__PURE__ */ i("span", { children: [
|
|
55
|
-
|
|
56
|
-
/* @__PURE__ */
|
|
56
|
+
m && /* @__PURE__ */ o("span", { children: a }),
|
|
57
|
+
/* @__PURE__ */ o(
|
|
57
58
|
A,
|
|
58
59
|
{
|
|
59
60
|
value: e?.value,
|
|
60
61
|
token: e.token,
|
|
61
|
-
maxLength:
|
|
62
|
+
maxLength: c
|
|
62
63
|
}
|
|
63
64
|
)
|
|
64
65
|
] })
|
|
65
66
|
] }), s = r && "node" in r ? r.node : r?.valueUSD ? /* @__PURE__ */ i(d, { children: [
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
m && /* @__PURE__ */ o("span", { children: a }),
|
|
68
|
+
N(r.valueUSD)
|
|
68
69
|
] }) : null;
|
|
69
70
|
return /* @__PURE__ */ i(
|
|
70
71
|
"div",
|
|
71
72
|
{
|
|
72
|
-
className: h(b({ position: p, size:
|
|
73
|
-
"data-testid":
|
|
73
|
+
className: h(b({ position: p, size: u })),
|
|
74
|
+
"data-testid": T.root,
|
|
74
75
|
children: [
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ o("span", { className: "text-sm font-medium text-foreground", children: t }),
|
|
76
77
|
/* @__PURE__ */ i("div", { className: "flex flex-col items-end gap-0.5", children: [
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
s && /* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ o(g, { loading: l, children: /* @__PURE__ */ o("span", { className: "inline-flex items-center gap-1.5 text-sm font-medium text-foreground", children: x }) }),
|
|
79
|
+
s && /* @__PURE__ */ o("span", { className: "text-xs leading-[130%] text-secondary-foreground", children: s })
|
|
79
80
|
] })
|
|
80
81
|
]
|
|
81
82
|
}
|
|
82
83
|
);
|
|
83
84
|
}
|
|
84
85
|
export {
|
|
85
|
-
|
|
86
|
+
E as TransactionConfirmAmountField,
|
|
86
87
|
S as resolveAmountSlots
|
|
87
88
|
};
|
|
@@ -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
|
};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { faCircleQuestion as u } from "@fortawesome/free-solid-svg-icons";
|
|
3
|
+
import { IconInfo as v } from "@gearbox-protocol/static";
|
|
3
4
|
import { cva as T } from "class-variance-authority";
|
|
4
|
-
import * as
|
|
5
|
+
import * as p from "react";
|
|
6
|
+
import { FaIcon as C } from "../icons/fa-icon.js";
|
|
5
7
|
import "@gearbox-protocol/sdk/onchain";
|
|
6
|
-
import { cn as
|
|
8
|
+
import { cn as m } from "../../utils/cn.js";
|
|
7
9
|
import "sonner";
|
|
8
10
|
import "luxon";
|
|
9
11
|
import "../../utils/z-index.js";
|
|
10
|
-
import { SimpleTooltip as
|
|
11
|
-
const
|
|
12
|
+
import { SimpleTooltip as H } from "../tooltip/simple-tooltip.js";
|
|
13
|
+
const I = T("transition-colors", {
|
|
12
14
|
variants: {
|
|
13
15
|
iconColor: {
|
|
14
16
|
"gray-10": "text-gray-10",
|
|
@@ -42,89 +44,92 @@ const H = T("transition-colors", {
|
|
|
42
44
|
}
|
|
43
45
|
},
|
|
44
46
|
defaultVariants: { iconColor: "gray-90", iconHoverColor: "gray-110" }
|
|
45
|
-
}),
|
|
47
|
+
}), N = p.forwardRef(
|
|
46
48
|
({
|
|
47
|
-
className:
|
|
48
|
-
children:
|
|
49
|
-
maxWidth:
|
|
50
|
-
minWidth:
|
|
49
|
+
className: o,
|
|
50
|
+
children: r,
|
|
51
|
+
maxWidth: a,
|
|
52
|
+
minWidth: e,
|
|
51
53
|
delayShow: g = 200,
|
|
52
54
|
placement: y = "bottom",
|
|
53
55
|
iconSize: i = 14,
|
|
54
56
|
iconColor: n = "gray-90",
|
|
55
|
-
iconHoverColor:
|
|
57
|
+
iconHoverColor: s = "gray-110",
|
|
56
58
|
iconVariant: x = "question",
|
|
57
|
-
onPointerEnter:
|
|
58
|
-
...
|
|
59
|
-
},
|
|
60
|
-
const
|
|
59
|
+
onPointerEnter: c,
|
|
60
|
+
...f
|
|
61
|
+
}, d) => {
|
|
62
|
+
const h = /* @__PURE__ */ t(
|
|
61
63
|
l,
|
|
62
64
|
{
|
|
63
|
-
ref:
|
|
65
|
+
ref: d,
|
|
64
66
|
iconSize: i,
|
|
65
67
|
iconColor: n,
|
|
66
|
-
iconHoverColor:
|
|
68
|
+
iconHoverColor: s,
|
|
67
69
|
iconVariant: x,
|
|
68
|
-
onPointerEnter:
|
|
69
|
-
className:
|
|
70
|
-
...
|
|
70
|
+
onPointerEnter: c,
|
|
71
|
+
className: o,
|
|
72
|
+
...f
|
|
71
73
|
}
|
|
72
74
|
);
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
-
|
|
75
|
+
return /* @__PURE__ */ t(
|
|
76
|
+
H,
|
|
75
77
|
{
|
|
76
|
-
title:
|
|
78
|
+
title: h,
|
|
77
79
|
placement: y,
|
|
78
80
|
delayShow: g,
|
|
79
|
-
maxWidth:
|
|
80
|
-
minWidth:
|
|
81
|
-
children:
|
|
81
|
+
maxWidth: a,
|
|
82
|
+
minWidth: e,
|
|
83
|
+
children: r
|
|
82
84
|
}
|
|
83
85
|
);
|
|
84
86
|
}
|
|
85
87
|
);
|
|
86
|
-
|
|
87
|
-
const l =
|
|
88
|
+
N.displayName = "HelpTip";
|
|
89
|
+
const l = p.forwardRef(
|
|
88
90
|
({
|
|
89
|
-
className:
|
|
90
|
-
iconSize:
|
|
91
|
-
iconColor:
|
|
92
|
-
iconHoverColor:
|
|
91
|
+
className: o,
|
|
92
|
+
iconSize: r = 14,
|
|
93
|
+
iconColor: a = "gray-90",
|
|
94
|
+
iconHoverColor: e = "gray-110",
|
|
93
95
|
iconVariant: g = "question",
|
|
94
96
|
onPointerEnter: y,
|
|
95
97
|
...i
|
|
96
|
-
}, n) =>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
"
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
98
|
+
}, n) => /* @__PURE__ */ t(
|
|
99
|
+
"span",
|
|
100
|
+
{
|
|
101
|
+
ref: n,
|
|
102
|
+
role: "img",
|
|
103
|
+
"aria-hidden": !0,
|
|
104
|
+
className: m(
|
|
105
|
+
"inline-block cursor-help",
|
|
106
|
+
I({ iconColor: a, iconHoverColor: e }),
|
|
107
|
+
o
|
|
108
|
+
),
|
|
109
|
+
onPointerEnter: y,
|
|
110
|
+
...i,
|
|
111
|
+
children: g === "question" ? /* @__PURE__ */ t(
|
|
112
|
+
C,
|
|
113
|
+
{
|
|
114
|
+
icon: u,
|
|
115
|
+
style: { width: r, height: r }
|
|
116
|
+
}
|
|
117
|
+
) : /* @__PURE__ */ t(v, { size: r })
|
|
118
|
+
}
|
|
119
|
+
)
|
|
115
120
|
);
|
|
116
121
|
l.displayName = "HelpTipIcon";
|
|
117
|
-
const
|
|
122
|
+
const w = p.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
|
|
118
123
|
"span",
|
|
119
124
|
{
|
|
120
|
-
ref:
|
|
121
|
-
className:
|
|
122
|
-
...
|
|
125
|
+
ref: a,
|
|
126
|
+
className: m("ml-1.5 inline-block leading-[0]", o),
|
|
127
|
+
...r
|
|
123
128
|
}
|
|
124
129
|
));
|
|
125
|
-
|
|
130
|
+
w.displayName = "TipWrap";
|
|
126
131
|
export {
|
|
127
|
-
|
|
132
|
+
N as HelpTip,
|
|
128
133
|
l as HelpTipIcon,
|
|
129
|
-
|
|
134
|
+
w as TipWrap
|
|
130
135
|
};
|