@gearbox-protocol/ui-kit 3.14.0-next.66 → 3.14.0-next.67
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/assets-list-cell/assets-list-cell.cjs +1 -1
- package/dist/cjs/components/block-sync/block-sync.cjs +1 -1
- package/dist/cjs/components/block-sync-pill/block-sync-pill.cjs +1 -1
- package/dist/cjs/components/breakpoint-provider.cjs +1 -0
- 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/complex-input/complex-input.cjs +1 -1
- package/dist/cjs/components/composites/index.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-head.cjs +1 -1
- package/dist/cjs/components/composites/pool-credit-managers-table/pool-credit-managers-table-head.cjs +1 -1
- package/dist/cjs/components/composites/pool-table/columns.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/columns.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/cells/cells.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/cells/index.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/index.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/points-feature/points-feature.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/strategies-table.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/index.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/types/index.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/types/rewards-cell.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy-legacy.cjs +1 -0
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/compound-apy/index.cjs +1 -1
- package/dist/cjs/components/detailed-page-title/detailed-page-title.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/markdown-viewer/markdown-viewer.cjs +1 -1
- package/dist/cjs/components/pool-apy-tooltip/apy-tooltip.cjs +1 -0
- package/dist/cjs/components/pool-apy-tooltip/index.cjs +1 -1
- package/dist/cjs/components/pool-apy-tooltip/pool-apy-tooltip.cjs +1 -1
- package/dist/cjs/components/time-to-liquidation/time-to-liquidation.cjs +1 -1
- package/dist/cjs/components/token-icon/token-icon.cjs +1 -1
- package/dist/cjs/components/token-symbol/index.cjs +1 -1
- package/dist/cjs/components/token-symbol/token-symbol.cjs +1 -1
- package/dist/cjs/components/tokens-list-cell/tokens-list-cell.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/components/yield-breakdown-tooltip/index.cjs +1 -0
- package/dist/cjs/components/yield-breakdown-tooltip/yield-breakdown-tooltip.cjs +1 -0
- package/dist/cjs/hooks/use-debounce-call.cjs +1 -1
- package/dist/cjs/hooks/use-media-query.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/cjs/types/common.cjs +1 -1
- package/dist/cjs/utils/apy-breakdown.cjs +1 -0
- package/dist/cjs/utils/bps.cjs +1 -0
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/cjs/utils/token-icon-source.cjs +1 -0
- package/dist/esm/components/assets-list-cell/assets-list-cell.js +132 -206
- package/dist/esm/components/block-sync/block-sync.js +5 -4
- package/dist/esm/components/block-sync-pill/block-sync-pill.js +5 -4
- package/dist/esm/components/breakpoint-provider.js +67 -0
- package/dist/esm/components/checkbox/checkbox-labeled.js +3 -2
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +3 -2
- package/dist/esm/components/complex-input/complex-input.js +5 -4
- package/dist/esm/components/composites/index.js +86 -81
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-head.js +3 -2
- package/dist/esm/components/composites/pool-credit-managers-table/pool-credit-managers-table-head.js +3 -2
- package/dist/esm/components/composites/pool-table/columns.js +61 -60
- package/dist/esm/components/composites/strategies-table/columns.js +55 -86
- package/dist/esm/components/composites/strategies-table/components/cells/cells.js +150 -110
- package/dist/esm/components/composites/strategies-table/components/cells/index.js +7 -5
- package/dist/esm/components/composites/strategies-table/components/index.js +32 -30
- package/dist/esm/components/composites/strategies-table/components/points-feature/points-feature.js +35 -32
- package/dist/esm/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.js +91 -224
- package/dist/esm/components/composites/strategies-table/components/strategies-table.js +26 -24
- package/dist/esm/components/composites/strategies-table/index.js +36 -31
- package/dist/esm/components/composites/strategies-table/types/index.js +5 -1
- package/dist/esm/components/composites/strategies-table/types/rewards-cell.js +40 -0
- package/dist/esm/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.js +32 -189
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.js +5 -4
- package/dist/esm/components/compound-apy/compound-apy-legacy.js +127 -0
- package/dist/esm/components/compound-apy/compound-apy.js +56 -245
- package/dist/esm/components/compound-apy/index.js +4 -2
- package/dist/esm/components/detailed-page-title/detailed-page-title.js +25 -180
- package/dist/esm/components/index.js +805 -787
- package/dist/esm/components/markdown-viewer/markdown-viewer.js +5 -4
- package/dist/esm/components/pool-apy-tooltip/apy-tooltip.js +155 -0
- package/dist/esm/components/pool-apy-tooltip/index.js +4 -2
- package/dist/esm/components/pool-apy-tooltip/pool-apy-tooltip.js +3 -3
- package/dist/esm/components/time-to-liquidation/time-to-liquidation.js +3 -2
- package/dist/esm/components/token-icon/token-icon.js +72 -58
- package/dist/esm/components/token-symbol/index.js +2 -3
- package/dist/esm/components/token-symbol/token-symbol.js +41 -62
- package/dist/esm/components/tokens-list-cell/tokens-list-cell.js +35 -192
- package/dist/esm/components/with-copy/with-copy.js +5 -4
- package/dist/esm/components/yield-breakdown-tooltip/index.js +4 -0
- package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown-tooltip.js +222 -0
- package/dist/esm/hooks/use-debounce-call.js +3 -2
- package/dist/esm/hooks/use-media-query.js +49 -16
- package/dist/esm/index.js +974 -946
- package/dist/esm/locale/en.json.js +9 -2
- package/dist/esm/types/common.js +1 -6
- package/dist/esm/utils/apy-breakdown.js +18 -0
- package/dist/esm/utils/bps.js +4 -0
- package/dist/esm/utils/index.js +105 -95
- package/dist/esm/utils/token-icon-source.js +48 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/assets-list-cell/assets-list-cell.d.ts +44 -4
- package/dist/types/components/breakpoint-provider.d.ts +56 -0
- package/dist/types/components/composites/pool-table/pool-table-backend-contract.types.d.ts +1 -1
- package/dist/types/components/composites/strategies-table/components/cells/cells.d.ts +34 -3
- package/dist/types/components/composites/strategies-table/components/points-feature/points-feature.d.ts +14 -10
- package/dist/types/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.d.ts +10 -13
- package/dist/types/components/composites/strategies-table/index.d.ts +1 -1
- package/dist/types/components/composites/strategies-table/types/index.d.ts +1 -0
- package/dist/types/components/composites/strategies-table/types/rewards-cell.d.ts +48 -0
- package/dist/types/components/composites/strategies-table/types/rewards-tooltip.d.ts +37 -32
- package/dist/types/components/composites/strategies-table/types/table.d.ts +27 -12
- package/dist/types/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.d.ts +3 -3
- package/dist/types/components/compound-apy/compound-apy-legacy.d.ts +109 -0
- package/dist/types/components/compound-apy/compound-apy.d.ts +18 -94
- package/dist/types/components/compound-apy/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +3 -1
- package/dist/types/components/points-icon/index.d.ts +1 -1
- package/dist/types/components/points-icon/points-icon.d.ts +13 -2
- package/dist/types/components/pool-apy-tooltip/apy-tooltip.d.ts +20 -0
- package/dist/types/components/pool-apy-tooltip/index.d.ts +1 -0
- package/dist/types/components/pool-apy-tooltip/pool-apy-tooltip.d.ts +18 -1
- package/dist/types/components/token-icon/token-icon.d.ts +11 -2
- package/dist/types/components/token-symbol/token-symbol.d.ts +4 -4
- package/dist/types/components/yield-breakdown-tooltip/index.d.ts +1 -0
- package/dist/types/components/yield-breakdown-tooltip/yield-breakdown-tooltip.d.ts +32 -0
- package/dist/types/hooks/use-media-query.d.ts +5 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/locale/en.json.d.ts +10 -2
- package/dist/types/types/common.d.ts +5 -11
- package/dist/types/utils/apy-breakdown.d.ts +18 -0
- package/dist/types/utils/bps.d.ts +3 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/token-icon-source.d.ts +28 -0
- package/package.json +2 -2
package/dist/esm/components/composites/strategies-table/components/points-feature/points-feature.js
CHANGED
|
@@ -1,66 +1,69 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { formatLeverage as
|
|
3
|
-
import { PointsIcon as
|
|
1
|
+
import { jsx as n, jsxs as l, Fragment as o } from "react/jsx-runtime";
|
|
2
|
+
import { formatLeverage as p } from "@gearbox-protocol/sdk";
|
|
3
|
+
import { PointsIcon as s } from "../../../../points-icon/points-icon.js";
|
|
4
4
|
import { Typography as a } from "../../../../typography/typography.js";
|
|
5
|
-
import { Feature as
|
|
5
|
+
import { Feature as m } from "../feature/feature.js";
|
|
6
6
|
import "../feature/feature.styles.js";
|
|
7
7
|
function b({
|
|
8
8
|
reward: e,
|
|
9
|
-
points:
|
|
10
|
-
precision:
|
|
11
|
-
theme:
|
|
9
|
+
points: r,
|
|
10
|
+
precision: t,
|
|
11
|
+
theme: i
|
|
12
12
|
}) {
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
|
|
13
|
+
return /* @__PURE__ */ n(
|
|
14
|
+
m,
|
|
15
15
|
{
|
|
16
|
-
theme:
|
|
17
|
-
title: /* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
16
|
+
theme: i,
|
|
17
|
+
title: /* @__PURE__ */ l("div", { className: "flex items-center gap-1 pr-2", children: [
|
|
18
|
+
/* @__PURE__ */ n(s, { reward: e }),
|
|
19
|
+
/* @__PURE__ */ n(a, { as: "span", variant: "caption", children: /* @__PURE__ */ n(c, { points: r, precision: t }) })
|
|
20
20
|
] })
|
|
21
21
|
}
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
24
|
function y({
|
|
25
25
|
reward: e,
|
|
26
|
-
points:
|
|
27
|
-
precision:
|
|
28
|
-
tip:
|
|
29
|
-
theme:
|
|
26
|
+
points: r,
|
|
27
|
+
precision: t,
|
|
28
|
+
tip: i,
|
|
29
|
+
theme: u
|
|
30
30
|
}) {
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
|
|
31
|
+
return /* @__PURE__ */ n(
|
|
32
|
+
m,
|
|
33
33
|
{
|
|
34
|
-
theme:
|
|
34
|
+
theme: u,
|
|
35
35
|
size: "md",
|
|
36
36
|
padding: "8px",
|
|
37
|
-
title: /* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
37
|
+
title: /* @__PURE__ */ l("div", { className: "flex items-center gap-1", children: [
|
|
38
|
+
/* @__PURE__ */ n(s, { reward: e, size: 16 }),
|
|
39
|
+
/* @__PURE__ */ n(a, { as: "span", variant: "bodySmall", children: /* @__PURE__ */ n(d, { reward: e }) })
|
|
40
40
|
] }),
|
|
41
|
-
value: /* @__PURE__ */
|
|
41
|
+
value: /* @__PURE__ */ n(a, { as: "span", variant: "bodySmall", children: /* @__PURE__ */ n(
|
|
42
42
|
c,
|
|
43
43
|
{
|
|
44
|
-
points:
|
|
45
|
-
precision:
|
|
44
|
+
points: r,
|
|
45
|
+
precision: t,
|
|
46
46
|
startWith: "×",
|
|
47
47
|
endWith: ""
|
|
48
48
|
}
|
|
49
49
|
) }),
|
|
50
|
-
tip:
|
|
50
|
+
tip: i
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
54
|
function d({ reward: e }) {
|
|
55
|
-
|
|
55
|
+
const r = [e.name, e.units].filter(
|
|
56
|
+
(t) => !!t && t.length > 0
|
|
57
|
+
);
|
|
58
|
+
return /* @__PURE__ */ n(o, { children: r.join(" ") });
|
|
56
59
|
}
|
|
57
60
|
function c({
|
|
58
61
|
points: e,
|
|
59
|
-
precision:
|
|
60
|
-
startWith:
|
|
61
|
-
endWith:
|
|
62
|
+
precision: r = 1,
|
|
63
|
+
startWith: t = "",
|
|
64
|
+
endWith: i = "×"
|
|
62
65
|
}) {
|
|
63
|
-
return /* @__PURE__ */
|
|
66
|
+
return e === "soon" ? /* @__PURE__ */ n(o, { children: "soon" }) : e == null ? /* @__PURE__ */ n(o, { children: "—" }) : /* @__PURE__ */ n(o, { children: `${t}${p(Number(e), r)}${i}` });
|
|
64
67
|
}
|
|
65
68
|
export {
|
|
66
69
|
b as PointsFeature,
|
|
@@ -1,271 +1,138 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { faXmark as
|
|
3
|
-
import { formatPercentage as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import "
|
|
10
|
-
import {
|
|
11
|
-
import "
|
|
12
|
-
import "
|
|
13
|
-
import "
|
|
14
|
-
import "../../../../../utils/
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
strategyCreditManagers: P,
|
|
31
|
-
onClose: A,
|
|
32
|
-
theme: F = "modal"
|
|
1
|
+
import { jsxs as i, jsx as o, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import { faXmark as P } from "@fortawesome/free-solid-svg-icons";
|
|
3
|
+
import { formatPercentage as l, formatLeverage as N } from "@gearbox-protocol/sdk";
|
|
4
|
+
import { IconButton as L } from "../../../../icon-button/icon-button.js";
|
|
5
|
+
import { FaIcon as S } from "../../../../icons/fa-icon.js";
|
|
6
|
+
import { SeparateLine as V } from "../../../../separate-line/separate-line.js";
|
|
7
|
+
import { TipCard as g } from "../../../../tip-card/tip-card.js";
|
|
8
|
+
import { FormattedMessageTyped as a } from "../../../../typed-intl/index.js";
|
|
9
|
+
import { Typography as m } from "../../../../typography/typography.js";
|
|
10
|
+
import { VerticalIndicator as w } from "../../../../vertical-indicator/vertical-indicator.js";
|
|
11
|
+
import { VerticalList as v } from "../../../../vertical-list/vertical-list.js";
|
|
12
|
+
import { VSpace as j } from "../../../../vspace/vspace.js";
|
|
13
|
+
import { bpsToPercent as z } from "../../../../../utils/bps.js";
|
|
14
|
+
import { cn as B } from "../../../../../utils/cn.js";
|
|
15
|
+
import { APYFeatureTooltip as s } from "../apy-feature/apy-feature.js";
|
|
16
|
+
import { PointsFeatureTooltip as R } from "../points-feature/points-feature.js";
|
|
17
|
+
import { RewardsTooltipRoot as Y } from "./rewards-tooltip-root.js";
|
|
18
|
+
function ro({
|
|
19
|
+
totalApy: r,
|
|
20
|
+
baseApy: n,
|
|
21
|
+
baseRewards: e,
|
|
22
|
+
basePoints: d,
|
|
23
|
+
points: p,
|
|
24
|
+
maxLeverage: c,
|
|
25
|
+
borrowRate: h,
|
|
26
|
+
underlyingTokenSymbol: b,
|
|
27
|
+
quotaRate: u,
|
|
28
|
+
onClose: f,
|
|
29
|
+
theme: I = "modal"
|
|
33
30
|
}) {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
debtRewards: w,
|
|
44
|
-
rewardRates: V,
|
|
45
|
-
debtRewardRates: q,
|
|
46
|
-
quotaRate: B
|
|
47
|
-
} = a, k = l?.chainId || K, b = i?.[k]?.apyList?.[n] || 0, m = i?.[k]?.extraCollateralAPYList?.[l?.pool || j]?.[n], E = D || !z, M = b > 0 || m !== void 0 && m.value > 0 || g.length > 0 || w.length > 0;
|
|
48
|
-
return /* @__PURE__ */ r(J, { theme: F, children: [
|
|
49
|
-
A && /* @__PURE__ */ e("div", { style: { position: "absolute", top: "-10px", right: "-10px" }, children: /* @__PURE__ */ e(H, { size: 26, buttonType: "filledDark", onClick: A, children: /* @__PURE__ */ e(U, { icon: W, style: { width: "12px", height: "12px" } }) }) }),
|
|
50
|
-
M && /* @__PURE__ */ r(I, { children: [
|
|
51
|
-
/* @__PURE__ */ e(y, { textColor: "dark", children: /* @__PURE__ */ r(
|
|
52
|
-
T,
|
|
31
|
+
const $ = n > 0 || e.length > 0 || d.length > 0, k = r > 0 || p.length === 0, C = e.reduce(
|
|
32
|
+
(t, F) => t + z(F.supplyApr ?? 0),
|
|
33
|
+
0
|
|
34
|
+
);
|
|
35
|
+
return /* @__PURE__ */ i(Y, { theme: I, children: [
|
|
36
|
+
f && /* @__PURE__ */ o("div", { style: { position: "absolute", top: "-10px", right: "-10px" }, children: /* @__PURE__ */ o(L, { size: 26, buttonType: "filledDark", onClick: f, children: /* @__PURE__ */ o(S, { icon: P, style: { width: "12px", height: "12px" } }) }) }),
|
|
37
|
+
$ && /* @__PURE__ */ i(y, { children: [
|
|
38
|
+
/* @__PURE__ */ o(g, { textColor: "dark", children: /* @__PURE__ */ i(
|
|
39
|
+
x,
|
|
53
40
|
{
|
|
54
|
-
title: /* @__PURE__ */
|
|
41
|
+
title: /* @__PURE__ */ o(a, { messageId: "components.rewardsTooltip.without.title" }),
|
|
55
42
|
children: [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
className: "inline-block align-text-bottom",
|
|
60
|
-
width: 50,
|
|
61
|
-
loading: u,
|
|
62
|
-
children: /* @__PURE__ */ e(d, { value: `${s(b)}%` })
|
|
63
|
-
}
|
|
64
|
-
),
|
|
65
|
-
m && m.value > 0 && /* @__PURE__ */ e(
|
|
66
|
-
v,
|
|
43
|
+
n > 0 && /* @__PURE__ */ o(s, { value: `${l(n)}%` }),
|
|
44
|
+
e.length > 0 && /* @__PURE__ */ o(
|
|
45
|
+
s,
|
|
67
46
|
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
children: /* @__PURE__ */ e(
|
|
72
|
-
d,
|
|
73
|
-
{
|
|
74
|
-
title: /* @__PURE__ */ e(o, { messageId: "components.rewardsTooltip.without.extra" }),
|
|
75
|
-
tip: /* @__PURE__ */ e(o, { messageId: "components.rewardsTooltip.without.extra.tip" }),
|
|
76
|
-
value: `${s(m.value)}%`
|
|
77
|
-
}
|
|
78
|
-
)
|
|
47
|
+
title: /* @__PURE__ */ o(a, { messageId: "components.rewardsTooltip.without.extra" }),
|
|
48
|
+
tip: /* @__PURE__ */ o(a, { messageId: "components.rewardsTooltip.without.extra.tip" }),
|
|
49
|
+
value: `${l(C)}%`
|
|
79
50
|
}
|
|
80
51
|
),
|
|
81
|
-
|
|
82
|
-
c,
|
|
83
|
-
{
|
|
84
|
-
reward: t,
|
|
85
|
-
points: t.multiplier
|
|
86
|
-
},
|
|
87
|
-
["base", t.multiplier, t.name, t.type, t.units].join(
|
|
88
|
-
"-"
|
|
89
|
-
)
|
|
90
|
-
)),
|
|
91
|
-
w.map((t) => /* @__PURE__ */ e(
|
|
92
|
-
c,
|
|
93
|
-
{
|
|
94
|
-
reward: t,
|
|
95
|
-
points: t.multiplier,
|
|
96
|
-
tip: /* @__PURE__ */ e(
|
|
97
|
-
$,
|
|
98
|
-
{
|
|
99
|
-
tokensList: h,
|
|
100
|
-
strategyCreditManagers: P,
|
|
101
|
-
reward: t
|
|
102
|
-
}
|
|
103
|
-
)
|
|
104
|
-
},
|
|
105
|
-
[
|
|
106
|
-
"debt",
|
|
107
|
-
t.multiplier,
|
|
108
|
-
t.name,
|
|
109
|
-
t.type,
|
|
110
|
-
t.units,
|
|
111
|
-
t.cm
|
|
112
|
-
].join("-")
|
|
113
|
-
))
|
|
52
|
+
d.map((t) => /* @__PURE__ */ o(T, { program: t }, `base-${t.id}`))
|
|
114
53
|
]
|
|
115
54
|
}
|
|
116
55
|
) }),
|
|
117
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ o(j, { height: 16 })
|
|
118
57
|
] }),
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
|
|
58
|
+
/* @__PURE__ */ i(g, { textColor: "dark", borderColor: "gradient", children: [
|
|
59
|
+
/* @__PURE__ */ o(v, { children: /* @__PURE__ */ i(
|
|
60
|
+
x,
|
|
122
61
|
{
|
|
123
|
-
title: /* @__PURE__ */
|
|
124
|
-
|
|
62
|
+
title: /* @__PURE__ */ o(
|
|
63
|
+
a,
|
|
125
64
|
{
|
|
126
65
|
messageId: "components.rewardsTooltip.with.title",
|
|
127
66
|
values: {
|
|
128
|
-
leverage:
|
|
67
|
+
leverage: Number(c) > 0 ? `${N(Number(c))}×` : ""
|
|
129
68
|
}
|
|
130
69
|
}
|
|
131
70
|
),
|
|
132
71
|
children: [
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
{
|
|
136
|
-
className: "inline-block align-text-bottom",
|
|
137
|
-
width: 50,
|
|
138
|
-
loading: u,
|
|
139
|
-
children: /* @__PURE__ */ e(d, { value: `${s(S)}%` })
|
|
140
|
-
}
|
|
141
|
-
),
|
|
142
|
-
g.map((t, f) => {
|
|
143
|
-
const x = V?.[f] || 0n;
|
|
144
|
-
return /* @__PURE__ */ e(
|
|
145
|
-
c,
|
|
146
|
-
{
|
|
147
|
-
reward: t,
|
|
148
|
-
points: x
|
|
149
|
-
},
|
|
150
|
-
["base", t.multiplier, t.name, t.type, t.units].join(
|
|
151
|
-
"-"
|
|
152
|
-
)
|
|
153
|
-
);
|
|
154
|
-
}),
|
|
155
|
-
w.map((t, f) => {
|
|
156
|
-
const x = q?.[f] || 0n;
|
|
157
|
-
return /* @__PURE__ */ e(
|
|
158
|
-
c,
|
|
159
|
-
{
|
|
160
|
-
reward: t,
|
|
161
|
-
points: x,
|
|
162
|
-
tip: /* @__PURE__ */ e(
|
|
163
|
-
$,
|
|
164
|
-
{
|
|
165
|
-
tokensList: h,
|
|
166
|
-
strategyCreditManagers: P,
|
|
167
|
-
reward: t
|
|
168
|
-
}
|
|
169
|
-
)
|
|
170
|
-
},
|
|
171
|
-
[
|
|
172
|
-
"debt",
|
|
173
|
-
t.multiplier,
|
|
174
|
-
t.name,
|
|
175
|
-
t.type,
|
|
176
|
-
t.units,
|
|
177
|
-
t.cm
|
|
178
|
-
].join("-")
|
|
179
|
-
);
|
|
180
|
-
})
|
|
72
|
+
k && /* @__PURE__ */ o(s, { value: `${l(r)}%` }),
|
|
73
|
+
p.map((t) => /* @__PURE__ */ o(T, { program: t }, `levered-${t.id}`))
|
|
181
74
|
]
|
|
182
75
|
}
|
|
183
76
|
) }),
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
|
|
187
|
-
|
|
77
|
+
/* @__PURE__ */ o(V, { margin: 16 }),
|
|
78
|
+
/* @__PURE__ */ i(v, { children: [
|
|
79
|
+
h !== void 0 && /* @__PURE__ */ o(
|
|
80
|
+
w,
|
|
188
81
|
{
|
|
189
|
-
label: /* @__PURE__ */
|
|
190
|
-
|
|
82
|
+
label: /* @__PURE__ */ o(m, { as: "span", color: "secondary", children: /* @__PURE__ */ o(
|
|
83
|
+
a,
|
|
191
84
|
{
|
|
192
85
|
values: {
|
|
193
|
-
symbol:
|
|
86
|
+
symbol: b || "Utilization"
|
|
194
87
|
},
|
|
195
88
|
messageId: "components.rewardsTooltip.with.borrowRate"
|
|
196
89
|
}
|
|
197
90
|
) }),
|
|
198
|
-
value: /* @__PURE__ */
|
|
199
|
-
|
|
91
|
+
value: /* @__PURE__ */ o(m, { as: "span", color: "secondary", children: `${l(
|
|
92
|
+
h
|
|
200
93
|
)}%` })
|
|
201
94
|
}
|
|
202
95
|
),
|
|
203
|
-
|
|
204
|
-
|
|
96
|
+
u !== void 0 && /* @__PURE__ */ o(
|
|
97
|
+
w,
|
|
205
98
|
{
|
|
206
|
-
label: /* @__PURE__ */
|
|
207
|
-
value: /* @__PURE__ */
|
|
99
|
+
label: /* @__PURE__ */ o(m, { as: "span", color: "secondary", children: /* @__PURE__ */ o(a, { messageId: "components.rewardsTooltip.with.quotaRate" }) }),
|
|
100
|
+
value: /* @__PURE__ */ o(m, { as: "span", color: "secondary", children: `${l(u)}%` })
|
|
208
101
|
}
|
|
209
102
|
)
|
|
210
103
|
] })
|
|
211
|
-
] }),
|
|
212
|
-
C && /* @__PURE__ */ r(I, { children: [
|
|
213
|
-
/* @__PURE__ */ e(L, { height: 16 }),
|
|
214
|
-
/* @__PURE__ */ e(
|
|
215
|
-
y,
|
|
216
|
-
{
|
|
217
|
-
backgroundColor: "gray-10",
|
|
218
|
-
textColor: "light",
|
|
219
|
-
borderColor: "dark",
|
|
220
|
-
children: /* @__PURE__ */ e(
|
|
221
|
-
T,
|
|
222
|
-
{
|
|
223
|
-
title: /* @__PURE__ */ e(o, { messageId: "components.rewardsTooltip.with.bonusAPY.title" }),
|
|
224
|
-
children: /* @__PURE__ */ e("div", { className: "flex-col-12", children: /* @__PURE__ */ e(
|
|
225
|
-
d,
|
|
226
|
-
{
|
|
227
|
-
theme: "light",
|
|
228
|
-
tip: /* @__PURE__ */ e(o, { messageId: "components.rewardsTooltip.with.bonusAPY.tip" }),
|
|
229
|
-
value: `${s(C.value)}%`
|
|
230
|
-
}
|
|
231
|
-
) })
|
|
232
|
-
}
|
|
233
|
-
)
|
|
234
|
-
}
|
|
235
|
-
)
|
|
236
104
|
] })
|
|
237
105
|
] });
|
|
238
106
|
}
|
|
239
|
-
function T({
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
107
|
+
function T({
|
|
108
|
+
program: r
|
|
109
|
+
}) {
|
|
110
|
+
return /* @__PURE__ */ o(
|
|
111
|
+
R,
|
|
112
|
+
{
|
|
113
|
+
reward: {
|
|
114
|
+
name: r.name,
|
|
115
|
+
type: r.id
|
|
116
|
+
},
|
|
117
|
+
points: r.multiplier
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
function x({ title: r, children: n, theme: e = "main" }) {
|
|
122
|
+
return /* @__PURE__ */ i(y, { children: [
|
|
123
|
+
/* @__PURE__ */ o("div", { className: B("flex-col-12", e === "main" ? "mb-3" : "mb-2"), children: /* @__PURE__ */ o(
|
|
124
|
+
m,
|
|
243
125
|
{
|
|
244
126
|
as: "span",
|
|
245
127
|
variant: "bodySmall",
|
|
246
|
-
weight:
|
|
247
|
-
color:
|
|
248
|
-
children:
|
|
128
|
+
weight: e === "main" ? "bold" : "normal",
|
|
129
|
+
color: e === "main" ? "default" : "secondary",
|
|
130
|
+
children: r
|
|
249
131
|
}
|
|
250
132
|
) }),
|
|
251
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ o("div", { className: "flex-row-row gap-2 w-full", children: n })
|
|
252
134
|
] });
|
|
253
135
|
}
|
|
254
|
-
function $({
|
|
255
|
-
reward: a,
|
|
256
|
-
strategyCreditManagers: n,
|
|
257
|
-
tokensList: i
|
|
258
|
-
}) {
|
|
259
|
-
return a.cm === "any" ? /* @__PURE__ */ e(o, { messageId: "components.strategiesTable.line.points.tipAny" }) : /* @__PURE__ */ e(
|
|
260
|
-
o,
|
|
261
|
-
{
|
|
262
|
-
messageId: "components.strategiesTable.line.points.tip",
|
|
263
|
-
values: {
|
|
264
|
-
symbol: i?.[n[a.cm]?.underlyingToken || j]?.title || "unknown"
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
);
|
|
268
|
-
}
|
|
269
136
|
export {
|
|
270
|
-
|
|
137
|
+
ro as RewardsTooltipContent
|
|
271
138
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as t, Fragment as
|
|
1
|
+
import { jsx as t, Fragment as B, jsxs as M } from "react/jsx-runtime";
|
|
2
2
|
import * as L from "react";
|
|
3
3
|
import { HeadCell as J } from "../../../head-cell/head-cell.js";
|
|
4
4
|
import { HelpTip as A } from "../../../help-tip/help-tip.js";
|
|
@@ -12,29 +12,29 @@ import { FormattedMessageTyped as ie } from "../../../typed-intl/index.js";
|
|
|
12
12
|
import "@gearbox-protocol/sdk/common-utils";
|
|
13
13
|
import "@gearbox-protocol/sdk";
|
|
14
14
|
import { useIsMobile as re, useIsMedium as se, useIsDesktop as ae } from "../../../../hooks/use-media-query.js";
|
|
15
|
-
import { strategiesTableTestIds as
|
|
15
|
+
import { strategiesTableTestIds as w } from "../../../../test-ids/strategies-table.js";
|
|
16
16
|
import { cn as h } from "../../../../utils/cn.js";
|
|
17
17
|
import { StrategiesTableNotFoundLine as le } from "./not-found-line.js";
|
|
18
18
|
function F({
|
|
19
19
|
last: e,
|
|
20
20
|
className: s,
|
|
21
|
-
...
|
|
21
|
+
...c
|
|
22
22
|
}) {
|
|
23
23
|
return /* @__PURE__ */ t(
|
|
24
24
|
P,
|
|
25
25
|
{
|
|
26
26
|
className: h(e && "*:after:hidden", s),
|
|
27
|
-
...
|
|
27
|
+
...c
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
31
|
function ne({
|
|
32
32
|
columns: e,
|
|
33
33
|
sort: s,
|
|
34
|
-
isMedium:
|
|
34
|
+
isMedium: c
|
|
35
35
|
}) {
|
|
36
36
|
return /* @__PURE__ */ t(P, { noHover: !0, height: "32px", children: e.map((i) => {
|
|
37
|
-
if (i.hideOnMedium &&
|
|
37
|
+
if (i.hideOnMedium && c) return null;
|
|
38
38
|
const d = i.sort, m = d && s ? {
|
|
39
39
|
direction: s.state?.field === d.field ? s.state.sort : null,
|
|
40
40
|
onSort: () => s.set(d.field, d.defaultDirection ?? "desc")
|
|
@@ -46,7 +46,7 @@ function ne({
|
|
|
46
46
|
size: "sm",
|
|
47
47
|
gapBefore: i.gapBefore,
|
|
48
48
|
className: h(i.className, i.headerClassName),
|
|
49
|
-
children: m ? /* @__PURE__ */ M(
|
|
49
|
+
children: m ? /* @__PURE__ */ M(B, { children: [
|
|
50
50
|
/* @__PURE__ */ t(
|
|
51
51
|
J,
|
|
52
52
|
{
|
|
@@ -57,7 +57,7 @@ function ne({
|
|
|
57
57
|
}
|
|
58
58
|
),
|
|
59
59
|
i.headerTip && /* @__PURE__ */ t(A, { className: "ml-1.5", children: i.headerTip })
|
|
60
|
-
] }) : /* @__PURE__ */ M(
|
|
60
|
+
] }) : /* @__PURE__ */ M(B, { children: [
|
|
61
61
|
f,
|
|
62
62
|
i.headerTip && /* @__PURE__ */ t(A, { className: "ml-1.5", children: i.headerTip })
|
|
63
63
|
] })
|
|
@@ -69,7 +69,7 @@ function ne({
|
|
|
69
69
|
function oe({
|
|
70
70
|
row: e,
|
|
71
71
|
columns: s,
|
|
72
|
-
last:
|
|
72
|
+
last: c,
|
|
73
73
|
rowHeight: i,
|
|
74
74
|
isSmall: d,
|
|
75
75
|
isMedium: m,
|
|
@@ -86,17 +86,19 @@ function oe({
|
|
|
86
86
|
tokensList: e.tokensList,
|
|
87
87
|
targetToken: e.tokensList?.[g],
|
|
88
88
|
targetTokenAddress: g,
|
|
89
|
+
rewardsCell: e.rewardsCell,
|
|
89
90
|
rewardsCellInfo: e.rewardsCellInfo,
|
|
91
|
+
rewardsTooltip: e.rewardsTooltip,
|
|
90
92
|
isMobile: d,
|
|
91
93
|
isDesktop: f
|
|
92
94
|
}),
|
|
93
95
|
[e, g, d, f]
|
|
94
96
|
), x = m ? s.filter((r) => !r.hideOnMedium) : s, a = !!e.disabled, T = !!e.disabledStyle, v = () => S?.(e), C = d ? (() => {
|
|
95
|
-
const r = s.filter((n) => !n.hideOnMobile), [
|
|
97
|
+
const r = s.filter((n) => !n.hideOnMobile), [p, ...R] = r, l = (n) => n.mobileCell ? n.mobileCell(b) : n.cell(b);
|
|
96
98
|
return /* @__PURE__ */ t(
|
|
97
99
|
F,
|
|
98
100
|
{
|
|
99
|
-
last:
|
|
101
|
+
last: c,
|
|
100
102
|
href: a ? void 0 : e.href,
|
|
101
103
|
noHover: a,
|
|
102
104
|
"data-disabled": a,
|
|
@@ -113,7 +115,7 @@ function oe({
|
|
|
113
115
|
columns: N,
|
|
114
116
|
columnsXs: u,
|
|
115
117
|
columnsMd: N,
|
|
116
|
-
title:
|
|
118
|
+
title: p ? l(p) : void 0,
|
|
117
119
|
className: "w-full",
|
|
118
120
|
children: R.map((n) => /* @__PURE__ */ t(ee, { title: n.mobileTitle, children: l(n) }, n.id))
|
|
119
121
|
}
|
|
@@ -123,7 +125,7 @@ function oe({
|
|
|
123
125
|
})() : /* @__PURE__ */ t(
|
|
124
126
|
F,
|
|
125
127
|
{
|
|
126
|
-
last:
|
|
128
|
+
last: c,
|
|
127
129
|
href: a ? void 0 : e.href,
|
|
128
130
|
height: `${i}px`,
|
|
129
131
|
noHover: a,
|
|
@@ -153,7 +155,7 @@ function oe({
|
|
|
153
155
|
function Se({
|
|
154
156
|
columns: e,
|
|
155
157
|
rows: s,
|
|
156
|
-
loading:
|
|
158
|
+
loading: c = !1,
|
|
157
159
|
partialLoading: i = !1,
|
|
158
160
|
error: d,
|
|
159
161
|
emptyContent: m = /* @__PURE__ */ t(le, {}),
|
|
@@ -168,12 +170,12 @@ function Se({
|
|
|
168
170
|
onStrategyClick: a,
|
|
169
171
|
rootTestId: T,
|
|
170
172
|
rowTestId: v,
|
|
171
|
-
loaderTestId:
|
|
173
|
+
loaderTestId: $
|
|
172
174
|
}) {
|
|
173
|
-
const H = v ??
|
|
174
|
-
() =>
|
|
175
|
-
[e,
|
|
176
|
-
), n = L.useMemo(() => r ? "1fr" : l.map((o) => (
|
|
175
|
+
const H = v ?? w.activeLine, C = $ ?? w.activeLineLoading, r = re(), p = se(), R = ae(), l = L.useMemo(
|
|
176
|
+
() => p ? e.filter((o) => !o.hideOnMedium) : e,
|
|
177
|
+
[e, p]
|
|
178
|
+
), n = L.useMemo(() => r ? "1fr" : l.map((o) => (p ? o.mediumWidth ?? o.width : o.width) ?? "1fr").join(" "), [r, p, l]), j = L.useMemo(() => {
|
|
177
179
|
const o = l.map((W, X) => {
|
|
178
180
|
const G = W.gapBefore;
|
|
179
181
|
if (!G || G === "none") return null;
|
|
@@ -181,8 +183,8 @@ function Se({
|
|
|
181
183
|
return `[&:nth-child(${X + 1})]:${q}`;
|
|
182
184
|
}).filter(Boolean).join(" "), I = l[l.length - 1]?.className?.includes("pr-4") ? "last:pr-4" : "";
|
|
183
185
|
return h("px-1 py-2 first:pl-4", I, o);
|
|
184
|
-
}, [l]), k =
|
|
185
|
-
return d ? null : E && m ? /* @__PURE__ */ t(
|
|
186
|
+
}, [l]), k = c || !s, E = !k && s && s.length === 0, D = i && !k;
|
|
187
|
+
return d ? null : E && m ? /* @__PURE__ */ t(B, { children: m }) : /* @__PURE__ */ M(
|
|
186
188
|
Q,
|
|
187
189
|
{
|
|
188
190
|
cols: n,
|
|
@@ -190,14 +192,14 @@ function Se({
|
|
|
190
192
|
size: N,
|
|
191
193
|
wrapperClassName: h("overflow-visible", b),
|
|
192
194
|
className: g,
|
|
193
|
-
"data-testid": T ??
|
|
195
|
+
"data-testid": T ?? w.root,
|
|
194
196
|
children: [
|
|
195
197
|
!r && /* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(
|
|
196
198
|
ne,
|
|
197
199
|
{
|
|
198
200
|
columns: e,
|
|
199
201
|
sort: x,
|
|
200
|
-
isMedium:
|
|
202
|
+
isMedium: p
|
|
201
203
|
}
|
|
202
204
|
) }),
|
|
203
205
|
/* @__PURE__ */ t(
|
|
@@ -218,7 +220,7 @@ function Se({
|
|
|
218
220
|
last: O === I.length - 1 && !D,
|
|
219
221
|
rowHeight: u,
|
|
220
222
|
isSmall: r,
|
|
221
|
-
isMedium:
|
|
223
|
+
isMedium: p,
|
|
222
224
|
isDesktop: R,
|
|
223
225
|
mobileColumnsXs: y,
|
|
224
226
|
mobileColumnsMd: S,
|