@gearbox-protocol/ui-kit 3.11.2 → 3.12.0-next.2
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/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/strategies-table/columns.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/apy-feature/apy-feature.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/apy-feature/index.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/cells/cells.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/cells/cells.styles.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/cells/index.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/feature/feature.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/feature/feature.styles.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/feature/index.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/index.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/not-found-line.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/points-feature/index.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/points-feature/points-feature.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/rewards-tooltip/index.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/rewards-tooltip/rewards-tooltip-root.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/rewards-tooltip/rewards-tooltip-view.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/rewards-tooltip/rewards-tooltip.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/components/strategies-table.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/index.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/types/cells.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/types/index.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/types/points-reward.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/types/rewards-tooltip.cjs +1 -0
- package/dist/cjs/components/composites/strategies-table/types/table.cjs +1 -0
- package/dist/cjs/components/compound-apy/compound-apy.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/time-to-liquidation/time-to-liquidation.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/index.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/cjs/test-ids/index.cjs +1 -1
- package/dist/cjs/test-ids/strategies-table.cjs +1 -0
- package/dist/esm/components/assets-list-cell/assets-list-cell.js +8 -6
- package/dist/esm/components/block-sync/block-sync.js +8 -6
- package/dist/esm/components/checkbox/checkbox-labeled.js +6 -4
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +6 -4
- package/dist/esm/components/complex-input/complex-input.js +8 -6
- package/dist/esm/components/composites/index.js +72 -34
- package/dist/esm/components/composites/strategies-table/columns.js +176 -0
- package/dist/esm/components/composites/strategies-table/components/apy-feature/apy-feature.js +39 -0
- package/dist/esm/components/composites/strategies-table/components/apy-feature/index.js +5 -0
- package/dist/esm/components/composites/strategies-table/components/cells/cells.js +168 -0
- package/dist/esm/components/composites/strategies-table/components/cells/cells.styles.js +46 -0
- package/dist/esm/components/composites/strategies-table/components/cells/index.js +11 -0
- package/dist/esm/components/composites/strategies-table/components/feature/feature.js +39 -0
- package/dist/esm/components/composites/strategies-table/components/feature/feature.styles.js +43 -0
- package/dist/esm/components/composites/strategies-table/components/feature/index.js +6 -0
- package/dist/esm/components/composites/strategies-table/components/index.js +35 -0
- package/dist/esm/components/composites/strategies-table/components/not-found-line.js +19 -0
- package/dist/esm/components/composites/strategies-table/components/points-feature/index.js +6 -0
- package/dist/esm/components/composites/strategies-table/components/points-feature/points-feature.js +69 -0
- package/dist/esm/components/composites/strategies-table/components/rewards-tooltip/index.js +11 -0
- package/dist/esm/components/composites/strategies-table/components/rewards-tooltip/rewards-tooltip-root.js +30 -0
- package/dist/esm/components/composites/strategies-table/components/rewards-tooltip/rewards-tooltip-view.js +78 -0
- package/dist/esm/components/composites/strategies-table/components/rewards-tooltip/rewards-tooltip.js +44 -0
- package/dist/esm/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.js +263 -0
- package/dist/esm/components/composites/strategies-table/components/strategies-table.js +249 -0
- package/dist/esm/components/composites/strategies-table/index.js +40 -0
- package/dist/esm/components/composites/strategies-table/types/cells.js +1 -0
- package/dist/esm/components/composites/strategies-table/types/index.js +1 -0
- package/dist/esm/components/composites/strategies-table/types/points-reward.js +1 -0
- package/dist/esm/components/composites/strategies-table/types/rewards-tooltip.js +1 -0
- package/dist/esm/components/composites/strategies-table/types/table.js +1 -0
- package/dist/esm/components/compound-apy/compound-apy.js +9 -7
- package/dist/esm/components/detailed-page-title/detailed-page-title.js +6 -4
- package/dist/esm/components/index.js +682 -644
- package/dist/esm/components/markdown-viewer/markdown-viewer.js +8 -6
- package/dist/esm/components/time-to-liquidation/time-to-liquidation.js +6 -4
- package/dist/esm/components/tokens-list-cell/tokens-list-cell.js +8 -6
- package/dist/esm/components/with-copy/with-copy.js +8 -6
- package/dist/esm/index.js +888 -848
- package/dist/esm/locale/en.json.js +26 -3
- package/dist/esm/test-ids/index.js +7 -5
- package/dist/esm/test-ids/strategies-table.js +8 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/composites/index.d.ts +1 -0
- package/dist/types/components/composites/oracles-and-lt-table/oracles-and-lt-line-view.d.ts +2 -2
- package/dist/types/components/composites/oracles-and-lt-table/oracles-and-lt-table.d.ts +2 -2
- package/dist/types/components/composites/strategies-table/columns.d.ts +50 -0
- package/dist/types/components/composites/strategies-table/components/apy-feature/apy-feature.d.ts +13 -0
- package/dist/types/components/composites/strategies-table/components/apy-feature/index.d.ts +1 -0
- package/dist/types/components/composites/strategies-table/components/cells/cells.d.ts +38 -0
- package/dist/types/components/composites/strategies-table/components/cells/cells.styles.d.ts +7 -0
- package/dist/types/components/composites/strategies-table/components/cells/index.d.ts +2 -0
- package/dist/types/components/composites/strategies-table/components/feature/feature.d.ts +11 -0
- package/dist/types/components/composites/strategies-table/components/feature/feature.styles.d.ts +14 -0
- package/dist/types/components/composites/strategies-table/components/feature/index.d.ts +2 -0
- package/dist/types/components/composites/strategies-table/components/index.d.ts +7 -0
- package/dist/types/components/composites/strategies-table/components/not-found-line.d.ts +2 -0
- package/dist/types/components/composites/strategies-table/components/points-feature/index.d.ts +1 -0
- package/dist/types/components/composites/strategies-table/components/points-feature/points-feature.d.ts +24 -0
- package/dist/types/components/composites/strategies-table/components/rewards-tooltip/index.d.ts +4 -0
- package/dist/types/components/composites/strategies-table/components/rewards-tooltip/rewards-tooltip-root.d.ts +17 -0
- package/dist/types/components/composites/strategies-table/components/rewards-tooltip/rewards-tooltip-view.d.ts +10 -0
- package/dist/types/components/composites/strategies-table/components/rewards-tooltip/rewards-tooltip.d.ts +7 -0
- package/dist/types/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.d.ts +14 -0
- package/dist/types/components/composites/strategies-table/components/strategies-table.d.ts +35 -0
- package/dist/types/components/composites/strategies-table/index.d.ts +3 -0
- package/dist/types/components/composites/strategies-table/types/cells.d.ts +10 -0
- package/dist/types/components/composites/strategies-table/types/index.d.ts +4 -0
- package/dist/types/components/composites/strategies-table/types/points-reward.d.ts +11 -0
- package/dist/types/components/composites/strategies-table/types/rewards-tooltip.d.ts +53 -0
- package/dist/types/components/composites/strategies-table/types/table.d.ts +99 -0
- package/dist/types/locale/en.json.d.ts +27 -1
- package/dist/types/test-ids/index.d.ts +1 -0
- package/dist/types/test-ids/strategies-table.d.ts +5 -0
- package/package.json +2 -2
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { APYFeature as r, APYFeatureTooltip as t } from "./apy-feature/apy-feature.js";
|
|
2
|
+
import { RWAFeature as p, StrategiesRewardsCell as i, StrategyPoints as l, ZeroSlippageFeature as s } from "./cells/cells.js";
|
|
3
|
+
import { DisabledWrap as m, Plus as x, TitleGrid as u } from "./cells/cells.styles.js";
|
|
4
|
+
import { Feature as d } from "./feature/feature.js";
|
|
5
|
+
import { FeatureRoot as R } from "./feature/feature.styles.js";
|
|
6
|
+
import { StrategiesTableNotFoundLine as w } from "./not-found-line.js";
|
|
7
|
+
import { PointsFeature as g, PointsFeatureTooltip as S, PointsLabel as b } from "./points-feature/points-feature.js";
|
|
8
|
+
import { RewardsTooltip as C, RewardsTooltipHover as L } from "./rewards-tooltip/rewards-tooltip.js";
|
|
9
|
+
import { RewardsTooltipRoot as Y } from "./rewards-tooltip/rewards-tooltip-root.js";
|
|
10
|
+
import { RewardsTooltipView as y } from "./rewards-tooltip/rewards-tooltip-view.js";
|
|
11
|
+
import { RewardsTooltipContent as G } from "./rewards-tooltip/tooltip-content.js";
|
|
12
|
+
import { StrategiesTable as N } from "./strategies-table.js";
|
|
13
|
+
export {
|
|
14
|
+
r as APYFeature,
|
|
15
|
+
t as APYFeatureTooltip,
|
|
16
|
+
m as DisabledWrap,
|
|
17
|
+
d as Feature,
|
|
18
|
+
R as FeatureRoot,
|
|
19
|
+
x as Plus,
|
|
20
|
+
g as PointsFeature,
|
|
21
|
+
S as PointsFeatureTooltip,
|
|
22
|
+
b as PointsLabel,
|
|
23
|
+
p as RWAFeature,
|
|
24
|
+
C as RewardsTooltip,
|
|
25
|
+
G as RewardsTooltipContent,
|
|
26
|
+
L as RewardsTooltipHover,
|
|
27
|
+
Y as RewardsTooltipRoot,
|
|
28
|
+
y as RewardsTooltipView,
|
|
29
|
+
i as StrategiesRewardsCell,
|
|
30
|
+
N as StrategiesTable,
|
|
31
|
+
w as StrategiesTableNotFoundLine,
|
|
32
|
+
l as StrategyPoints,
|
|
33
|
+
u as TitleGrid,
|
|
34
|
+
s as ZeroSlippageFeature
|
|
35
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { GridTableRow as r, GridTableCell as o } from "../../../table/grid-table.js";
|
|
3
|
+
import { FormattedMessageTyped as t } from "../../../typed-intl/index.js";
|
|
4
|
+
import { Typography as a } from "../../../typography/typography.js";
|
|
5
|
+
function d() {
|
|
6
|
+
return /* @__PURE__ */ e(r, { noHover: !0, last: !0, children: /* @__PURE__ */ e(o, { span: "full", textAlign: "center", children: /* @__PURE__ */ e(
|
|
7
|
+
a,
|
|
8
|
+
{
|
|
9
|
+
as: "span",
|
|
10
|
+
color: "secondary",
|
|
11
|
+
variant: "body",
|
|
12
|
+
className: "py-0 sm:py-5",
|
|
13
|
+
children: /* @__PURE__ */ e(t, { messageId: "components.strategiesTable.body.notFound" })
|
|
14
|
+
}
|
|
15
|
+
) }) });
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
d as StrategiesTableNotFoundLine
|
|
19
|
+
};
|
package/dist/esm/components/composites/strategies-table/components/points-feature/points-feature.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as t, jsxs as o, Fragment as s } from "react/jsx-runtime";
|
|
2
|
+
import { formatLeverage as u } from "@gearbox-protocol/sdk";
|
|
3
|
+
import { PointsIcon as m } from "../../../../points-icon/points-icon.js";
|
|
4
|
+
import { Typography as a } from "../../../../typography/typography.js";
|
|
5
|
+
import { Feature as l } from "../feature/feature.js";
|
|
6
|
+
import "../feature/feature.styles.js";
|
|
7
|
+
function b({
|
|
8
|
+
reward: e,
|
|
9
|
+
points: n,
|
|
10
|
+
precision: i,
|
|
11
|
+
theme: r
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ t(
|
|
14
|
+
l,
|
|
15
|
+
{
|
|
16
|
+
theme: r,
|
|
17
|
+
title: /* @__PURE__ */ o("div", { className: "flex items-center gap-1 pr-2", children: [
|
|
18
|
+
/* @__PURE__ */ t(m, { reward: e }),
|
|
19
|
+
/* @__PURE__ */ t(a, { as: "span", variant: "caption", children: /* @__PURE__ */ t(c, { points: n, precision: i }) })
|
|
20
|
+
] })
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
function y({
|
|
25
|
+
reward: e,
|
|
26
|
+
points: n,
|
|
27
|
+
precision: i,
|
|
28
|
+
tip: r,
|
|
29
|
+
theme: p
|
|
30
|
+
}) {
|
|
31
|
+
return /* @__PURE__ */ t(
|
|
32
|
+
l,
|
|
33
|
+
{
|
|
34
|
+
theme: p,
|
|
35
|
+
size: "md",
|
|
36
|
+
padding: "8px",
|
|
37
|
+
title: /* @__PURE__ */ o("div", { className: "flex items-center gap-1", children: [
|
|
38
|
+
/* @__PURE__ */ t(m, { reward: e, size: 16 }),
|
|
39
|
+
/* @__PURE__ */ t(a, { as: "span", variant: "bodySmall", children: /* @__PURE__ */ t(d, { reward: e }) })
|
|
40
|
+
] }),
|
|
41
|
+
value: /* @__PURE__ */ t(a, { as: "span", variant: "bodySmall", children: /* @__PURE__ */ t(
|
|
42
|
+
c,
|
|
43
|
+
{
|
|
44
|
+
points: n,
|
|
45
|
+
precision: i,
|
|
46
|
+
startWith: "×",
|
|
47
|
+
endWith: ""
|
|
48
|
+
}
|
|
49
|
+
) }),
|
|
50
|
+
tip: r
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function d({ reward: e }) {
|
|
55
|
+
return /* @__PURE__ */ t(s, { children: [e.name, e.units].join(" ") });
|
|
56
|
+
}
|
|
57
|
+
function c({
|
|
58
|
+
points: e,
|
|
59
|
+
precision: n = 1,
|
|
60
|
+
startWith: i = "",
|
|
61
|
+
endWith: r = "×"
|
|
62
|
+
}) {
|
|
63
|
+
return /* @__PURE__ */ t(s, { children: e === "soon" ? e : `${i}${u(Number(e), n)}${r}` });
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
b as PointsFeature,
|
|
67
|
+
y as PointsFeatureTooltip,
|
|
68
|
+
d as PointsLabel
|
|
69
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RewardsTooltip as e, RewardsTooltipHover as t } from "./rewards-tooltip.js";
|
|
2
|
+
import { RewardsTooltipRoot as i } from "./rewards-tooltip-root.js";
|
|
3
|
+
import { RewardsTooltipView as R } from "./rewards-tooltip-view.js";
|
|
4
|
+
import { RewardsTooltipContent as d } from "./tooltip-content.js";
|
|
5
|
+
export {
|
|
6
|
+
e as RewardsTooltip,
|
|
7
|
+
d as RewardsTooltipContent,
|
|
8
|
+
t as RewardsTooltipHover,
|
|
9
|
+
i as RewardsTooltipRoot,
|
|
10
|
+
R as RewardsTooltipView
|
|
11
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cva as d } from "class-variance-authority";
|
|
3
|
+
import { forwardRef as m } from "react";
|
|
4
|
+
import { cn as p } from "../../../../../utils/cn.js";
|
|
5
|
+
const s = d("", {
|
|
6
|
+
variants: {
|
|
7
|
+
theme: {
|
|
8
|
+
modal: "bg-modal",
|
|
9
|
+
box: "bg-card"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
theme: "modal"
|
|
14
|
+
}
|
|
15
|
+
}), n = m(({ theme: o, children: r, className: t }, a) => /* @__PURE__ */ e(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
ref: a,
|
|
19
|
+
className: p(
|
|
20
|
+
"relative p-4 w-[300px] xs:w-[400px] text-left font-normal",
|
|
21
|
+
"rounded-lg border border-border shadow-[0_4px_28px_4px_rgba(0,0,0,0.15)]",
|
|
22
|
+
s({ theme: o }),
|
|
23
|
+
t
|
|
24
|
+
),
|
|
25
|
+
children: r
|
|
26
|
+
}
|
|
27
|
+
));
|
|
28
|
+
export {
|
|
29
|
+
n as RewardsTooltipRoot
|
|
30
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { SimpleTooltip as n } from "../../../../tooltip/simple-tooltip.js";
|
|
3
|
+
import "../../../../tooltip/tooltip.js";
|
|
4
|
+
import { FormattedMessageTyped as s } from "../../../../typed-intl/index.js";
|
|
5
|
+
import { RewardsTooltipContent as p } from "./tooltip-content.js";
|
|
6
|
+
function x({
|
|
7
|
+
children: a,
|
|
8
|
+
handleTooltipChangeState: o,
|
|
9
|
+
handleTooltipChange: l,
|
|
10
|
+
open: r,
|
|
11
|
+
props: f
|
|
12
|
+
}) {
|
|
13
|
+
const i = () => (
|
|
14
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: nested tooltip trigger behavior preserved from legacy UI
|
|
15
|
+
/* @__PURE__ */ t(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
className: "flex h-full flex-col justify-center",
|
|
19
|
+
onClick: (e) => {
|
|
20
|
+
e.preventDefault(), e.stopPropagation(), o();
|
|
21
|
+
},
|
|
22
|
+
onKeyDown: (e) => {
|
|
23
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), o());
|
|
24
|
+
},
|
|
25
|
+
children: a
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
);
|
|
29
|
+
return (
|
|
30
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: nested tooltip trigger behavior preserved from legacy UI
|
|
31
|
+
/* @__PURE__ */ t(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: "flex h-full w-max flex-col justify-center",
|
|
35
|
+
onClick: (e) => {
|
|
36
|
+
e.preventDefault(), e.stopPropagation();
|
|
37
|
+
},
|
|
38
|
+
onKeyDown: (e) => {
|
|
39
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation());
|
|
40
|
+
},
|
|
41
|
+
children: /* @__PURE__ */ t(
|
|
42
|
+
n,
|
|
43
|
+
{
|
|
44
|
+
placement: "bottom",
|
|
45
|
+
trigger: "click",
|
|
46
|
+
triangle: !1,
|
|
47
|
+
triggerClassName: "h-full flex flex-col justify-center",
|
|
48
|
+
title: r ? i() : /* @__PURE__ */ t(
|
|
49
|
+
n,
|
|
50
|
+
{
|
|
51
|
+
title: i(),
|
|
52
|
+
placement: "top",
|
|
53
|
+
triangle: !1,
|
|
54
|
+
triggerClassName: "h-full flex flex-col justify-center",
|
|
55
|
+
children: /* @__PURE__ */ t(s, { messageId: "components.rewardsTooltip.button" })
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
minWidth: "100%",
|
|
59
|
+
maxWidth: "100%",
|
|
60
|
+
type: "modal-tooltip",
|
|
61
|
+
open: r,
|
|
62
|
+
onOpenChange: l,
|
|
63
|
+
children: /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
64
|
+
p,
|
|
65
|
+
{
|
|
66
|
+
onClose: () => l(!1),
|
|
67
|
+
...f
|
|
68
|
+
}
|
|
69
|
+
) })
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
x as RewardsTooltipView
|
|
78
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l } from "react";
|
|
3
|
+
import { SimpleTooltip as p } from "../../../../tooltip/simple-tooltip.js";
|
|
4
|
+
import "../../../../tooltip/tooltip.js";
|
|
5
|
+
import { RewardsTooltipView as a } from "./rewards-tooltip-view.js";
|
|
6
|
+
import { RewardsTooltipContent as m } from "./tooltip-content.js";
|
|
7
|
+
function w({ children: o, ...e }) {
|
|
8
|
+
const [n, i] = l(!1);
|
|
9
|
+
return /* @__PURE__ */ t(
|
|
10
|
+
a,
|
|
11
|
+
{
|
|
12
|
+
handleTooltipChangeState: () => {
|
|
13
|
+
i(!0);
|
|
14
|
+
},
|
|
15
|
+
handleTooltipChange: (r) => {
|
|
16
|
+
i(r);
|
|
17
|
+
},
|
|
18
|
+
open: n,
|
|
19
|
+
props: e,
|
|
20
|
+
children: o
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
function C({
|
|
25
|
+
children: o,
|
|
26
|
+
...e
|
|
27
|
+
}) {
|
|
28
|
+
return /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
29
|
+
p,
|
|
30
|
+
{
|
|
31
|
+
placement: "bottom",
|
|
32
|
+
triangle: !1,
|
|
33
|
+
title: o,
|
|
34
|
+
minWidth: "100%",
|
|
35
|
+
maxWidth: "100%",
|
|
36
|
+
type: "modal-tooltip",
|
|
37
|
+
children: /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(m, { theme: "box", ...e }) })
|
|
38
|
+
}
|
|
39
|
+
) });
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
w as RewardsTooltip,
|
|
43
|
+
C as RewardsTooltipHover
|
|
44
|
+
};
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { jsxs as r, jsx as e, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import { faXmark as M } from "@fortawesome/free-solid-svg-icons";
|
|
3
|
+
import { formatPercentage as s, formatLeverage as _ } from "@gearbox-protocol/sdk";
|
|
4
|
+
import { zeroAddress as $ } from "viem";
|
|
5
|
+
import { IconButton as H } from "../../../../icon-button/icon-button.js";
|
|
6
|
+
import { FaIcon as U } from "../../../../icons/fa-icon.js";
|
|
7
|
+
import { SeparateLine as W } from "../../../../separate-line/separate-line.js";
|
|
8
|
+
import { Skeleton as b } from "../../../../skeleton/skeleton.js";
|
|
9
|
+
import "react";
|
|
10
|
+
import { cn as X } from "../../../../../utils/cn.js";
|
|
11
|
+
import "sonner";
|
|
12
|
+
import "@gearbox-protocol/sdk/common-utils";
|
|
13
|
+
import "luxon";
|
|
14
|
+
import "../../../../../utils/z-index.js";
|
|
15
|
+
import { TipCard as f } from "../../../../tip-card/tip-card.js";
|
|
16
|
+
import { FormattedMessageTyped as o } from "../../../../typed-intl/index.js";
|
|
17
|
+
import { Typography as m } from "../../../../typography/typography.js";
|
|
18
|
+
import { VerticalIndicator as C } from "../../../../vertical-indicator/vertical-indicator.js";
|
|
19
|
+
import { VerticalList as Y } from "../../../../vertical-list/vertical-list.js";
|
|
20
|
+
import { VSpace as R } from "../../../../vspace/vspace.js";
|
|
21
|
+
import { APYFeatureTooltip as p } from "../apy-feature/apy-feature.js";
|
|
22
|
+
import { PointsFeatureTooltip as d } from "../points-feature/points-feature.js";
|
|
23
|
+
import { RewardsTooltipRoot as G } from "./rewards-tooltip-root.js";
|
|
24
|
+
const J = 0;
|
|
25
|
+
function xe({
|
|
26
|
+
cellInfo: a,
|
|
27
|
+
targetToken: n,
|
|
28
|
+
apyList: i,
|
|
29
|
+
tokensList: c,
|
|
30
|
+
strategyCreditManagers: x,
|
|
31
|
+
onClose: T,
|
|
32
|
+
theme: j = "modal"
|
|
33
|
+
}) {
|
|
34
|
+
const {
|
|
35
|
+
maxAPY: F,
|
|
36
|
+
minCreditManager: l,
|
|
37
|
+
bonusAPY: v,
|
|
38
|
+
maxLeverage: P,
|
|
39
|
+
apyLoading: u,
|
|
40
|
+
hasPoints: B,
|
|
41
|
+
isPointsWithAPY: S,
|
|
42
|
+
rewards: I,
|
|
43
|
+
debtRewards: A,
|
|
44
|
+
rewardRates: z,
|
|
45
|
+
debtRewardRates: D,
|
|
46
|
+
apyListByNetwork: V,
|
|
47
|
+
quotaRate: q
|
|
48
|
+
} = a, k = i?.[n] || 0, h = V?.[l?.chainId || J]?.extraCollateralAPYList?.[l?.pool || $]?.[n], E = S || !B;
|
|
49
|
+
return /* @__PURE__ */ r(G, { theme: j, children: [
|
|
50
|
+
T && /* @__PURE__ */ e("div", { style: { position: "absolute", top: "-10px", right: "-10px" }, children: /* @__PURE__ */ e(H, { size: 26, buttonType: "filledDark", onClick: T, children: /* @__PURE__ */ e(U, { icon: M, style: { width: "12px", height: "12px" } }) }) }),
|
|
51
|
+
/* @__PURE__ */ e(f, { textColor: "dark", children: /* @__PURE__ */ r(
|
|
52
|
+
y,
|
|
53
|
+
{
|
|
54
|
+
title: /* @__PURE__ */ e(o, { messageId: "components.rewardsTooltip.without.title" }),
|
|
55
|
+
children: [
|
|
56
|
+
k > 0 && /* @__PURE__ */ e(
|
|
57
|
+
b,
|
|
58
|
+
{
|
|
59
|
+
className: "inline-block align-text-bottom",
|
|
60
|
+
width: 50,
|
|
61
|
+
loading: u,
|
|
62
|
+
children: /* @__PURE__ */ e(p, { value: `${s(k)}%` })
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
h && h.value > 0 && /* @__PURE__ */ e(
|
|
66
|
+
b,
|
|
67
|
+
{
|
|
68
|
+
className: "inline-block align-text-bottom",
|
|
69
|
+
width: 50,
|
|
70
|
+
loading: u,
|
|
71
|
+
children: /* @__PURE__ */ e(
|
|
72
|
+
p,
|
|
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(h.value)}%`
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
I.map((t) => /* @__PURE__ */ e(
|
|
82
|
+
d,
|
|
83
|
+
{
|
|
84
|
+
reward: t,
|
|
85
|
+
points: t.multiplier
|
|
86
|
+
},
|
|
87
|
+
["base", t.multiplier, t.name, t.type, t.units].join("-")
|
|
88
|
+
)),
|
|
89
|
+
A.map((t) => /* @__PURE__ */ e(
|
|
90
|
+
d,
|
|
91
|
+
{
|
|
92
|
+
reward: t,
|
|
93
|
+
points: t.multiplier,
|
|
94
|
+
tip: /* @__PURE__ */ e(
|
|
95
|
+
N,
|
|
96
|
+
{
|
|
97
|
+
tokensList: c,
|
|
98
|
+
strategyCreditManagers: x,
|
|
99
|
+
reward: t
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
},
|
|
103
|
+
["debt", t.multiplier, t.name, t.type, t.units, t.cm].join(
|
|
104
|
+
"-"
|
|
105
|
+
)
|
|
106
|
+
))
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
) }),
|
|
110
|
+
/* @__PURE__ */ e(R, { height: 16 }),
|
|
111
|
+
/* @__PURE__ */ r(f, { textColor: "dark", borderColor: "gradient", children: [
|
|
112
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ r(
|
|
113
|
+
y,
|
|
114
|
+
{
|
|
115
|
+
title: /* @__PURE__ */ e(
|
|
116
|
+
o,
|
|
117
|
+
{
|
|
118
|
+
messageId: "components.rewardsTooltip.with.title",
|
|
119
|
+
values: {
|
|
120
|
+
leverage: P > 0 ? `${_(Number(P))}×` : ""
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
children: [
|
|
125
|
+
E && /* @__PURE__ */ e(
|
|
126
|
+
b,
|
|
127
|
+
{
|
|
128
|
+
className: "inline-block align-text-bottom",
|
|
129
|
+
width: 50,
|
|
130
|
+
loading: u,
|
|
131
|
+
children: /* @__PURE__ */ e(p, { value: `${s(F)}%` })
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
I.map((t, w) => {
|
|
135
|
+
const g = z?.[w] || 0n;
|
|
136
|
+
return /* @__PURE__ */ e(
|
|
137
|
+
d,
|
|
138
|
+
{
|
|
139
|
+
reward: t,
|
|
140
|
+
points: g
|
|
141
|
+
},
|
|
142
|
+
["base", t.multiplier, t.name, t.type, t.units].join(
|
|
143
|
+
"-"
|
|
144
|
+
)
|
|
145
|
+
);
|
|
146
|
+
}),
|
|
147
|
+
A.map((t, w) => {
|
|
148
|
+
const g = D?.[w] || 0n;
|
|
149
|
+
return /* @__PURE__ */ e(
|
|
150
|
+
d,
|
|
151
|
+
{
|
|
152
|
+
reward: t,
|
|
153
|
+
points: g,
|
|
154
|
+
tip: /* @__PURE__ */ e(
|
|
155
|
+
N,
|
|
156
|
+
{
|
|
157
|
+
tokensList: c,
|
|
158
|
+
strategyCreditManagers: x,
|
|
159
|
+
reward: t
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
},
|
|
163
|
+
[
|
|
164
|
+
"debt",
|
|
165
|
+
t.multiplier,
|
|
166
|
+
t.name,
|
|
167
|
+
t.type,
|
|
168
|
+
t.units,
|
|
169
|
+
t.cm
|
|
170
|
+
].join("-")
|
|
171
|
+
);
|
|
172
|
+
})
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
) }),
|
|
176
|
+
/* @__PURE__ */ e(W, { margin: 16 }),
|
|
177
|
+
/* @__PURE__ */ r(Y, { children: [
|
|
178
|
+
l && /* @__PURE__ */ e(
|
|
179
|
+
C,
|
|
180
|
+
{
|
|
181
|
+
label: /* @__PURE__ */ e(m, { as: "span", color: "secondary", children: /* @__PURE__ */ e(
|
|
182
|
+
o,
|
|
183
|
+
{
|
|
184
|
+
values: {
|
|
185
|
+
symbol: c?.[l.underlyingToken]?.title || "Utilization"
|
|
186
|
+
},
|
|
187
|
+
messageId: "components.rewardsTooltip.with.borrowRate"
|
|
188
|
+
}
|
|
189
|
+
) }),
|
|
190
|
+
value: /* @__PURE__ */ e(m, { as: "span", color: "secondary", children: `${s(
|
|
191
|
+
l.baseBorrowRate
|
|
192
|
+
)}%` })
|
|
193
|
+
}
|
|
194
|
+
),
|
|
195
|
+
l && /* @__PURE__ */ e(
|
|
196
|
+
C,
|
|
197
|
+
{
|
|
198
|
+
label: /* @__PURE__ */ e(m, { as: "span", color: "secondary", children: /* @__PURE__ */ e(o, { messageId: "components.rewardsTooltip.with.quotaRate" }) }),
|
|
199
|
+
value: /* @__PURE__ */ e(m, { as: "span", color: "secondary", children: `${s(Number(q))}%` })
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
] })
|
|
203
|
+
] }),
|
|
204
|
+
v && /* @__PURE__ */ r(L, { children: [
|
|
205
|
+
/* @__PURE__ */ e(R, { height: 16 }),
|
|
206
|
+
/* @__PURE__ */ e(
|
|
207
|
+
f,
|
|
208
|
+
{
|
|
209
|
+
backgroundColor: "gray-10",
|
|
210
|
+
textColor: "light",
|
|
211
|
+
borderColor: "dark",
|
|
212
|
+
children: /* @__PURE__ */ e(
|
|
213
|
+
y,
|
|
214
|
+
{
|
|
215
|
+
title: /* @__PURE__ */ e(o, { messageId: "components.rewardsTooltip.with.bonusAPY.title" }),
|
|
216
|
+
children: /* @__PURE__ */ e("div", { className: "flex-col-12", children: /* @__PURE__ */ e(
|
|
217
|
+
p,
|
|
218
|
+
{
|
|
219
|
+
theme: "light",
|
|
220
|
+
tip: /* @__PURE__ */ e(o, { messageId: "components.rewardsTooltip.with.bonusAPY.tip" }),
|
|
221
|
+
value: `${s(v.value)}%`
|
|
222
|
+
}
|
|
223
|
+
) })
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
] })
|
|
229
|
+
] });
|
|
230
|
+
}
|
|
231
|
+
function y({ title: a, children: n, theme: i = "main" }) {
|
|
232
|
+
return /* @__PURE__ */ r(L, { children: [
|
|
233
|
+
/* @__PURE__ */ e("div", { className: X("flex-col-12", i === "main" ? "mb-3" : "mb-2"), children: /* @__PURE__ */ e(
|
|
234
|
+
m,
|
|
235
|
+
{
|
|
236
|
+
as: "span",
|
|
237
|
+
variant: "bodySmall",
|
|
238
|
+
weight: i === "main" ? "bold" : "normal",
|
|
239
|
+
color: i === "main" ? "default" : "secondary",
|
|
240
|
+
children: a
|
|
241
|
+
}
|
|
242
|
+
) }),
|
|
243
|
+
/* @__PURE__ */ e("div", { className: "flex-row-row gap-2 w-full", children: n })
|
|
244
|
+
] });
|
|
245
|
+
}
|
|
246
|
+
function N({
|
|
247
|
+
reward: a,
|
|
248
|
+
strategyCreditManagers: n,
|
|
249
|
+
tokensList: i
|
|
250
|
+
}) {
|
|
251
|
+
return a.cm === "any" ? /* @__PURE__ */ e(o, { messageId: "components.strategiesTable.line.points.tipAny" }) : /* @__PURE__ */ e(
|
|
252
|
+
o,
|
|
253
|
+
{
|
|
254
|
+
messageId: "components.strategiesTable.line.points.tip",
|
|
255
|
+
values: {
|
|
256
|
+
symbol: i?.[n[a.cm]?.underlyingToken || $]?.title || "unknown"
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
export {
|
|
262
|
+
xe as RewardsTooltipContent
|
|
263
|
+
};
|