@gearbox-protocol/ui-kit 4.0.0-next.4 → 4.0.0-next.6
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/badge/badge.cjs +1 -1
- package/dist/cjs/components/badge/chip.cjs +1 -0
- package/dist/cjs/components/badge/index.cjs +1 -1
- package/dist/cjs/components/base/borrow-rate-block/borrow-rate-block.cjs +1 -1
- package/dist/cjs/components/base/chart-with-side-card/chart-with-side-card.cjs +1 -1
- package/dist/cjs/components/base/history-chart/history-chart.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/leverage-input/leverage-input.cjs +1 -1
- package/dist/cjs/components/base/leverage-preset-chips/constants.cjs +1 -0
- package/dist/cjs/components/base/leverage-preset-chips/index.cjs +1 -0
- package/dist/cjs/components/base/leverage-preset-chips/leverage-preset-chips.cjs +1 -0
- package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/strategy-apy-breakdown-card/constants.cjs +1 -1
- package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/title-meta/constants.cjs +1 -1
- package/dist/cjs/components/base/title-meta/title-meta.cjs +1 -1
- package/dist/cjs/components/base/values/index.cjs +1 -1
- package/dist/cjs/components/base/values/position-status-badge.cjs +1 -0
- package/dist/cjs/components/base/values/position-type-badge.cjs +1 -1
- package/dist/cjs/components/base-table/base-table-line.cjs +1 -0
- package/dist/cjs/components/base-table/base-table.cjs +1 -0
- package/dist/cjs/components/base-table/constants.cjs +1 -0
- package/dist/cjs/components/base-table/index.cjs +1 -0
- package/dist/cjs/components/base-table/types.cjs +1 -0
- package/dist/cjs/components/block-sync-pill/block-sync-pill.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/collateral-allocation-tooltip/allocation-wheel.cjs +1 -0
- package/dist/cjs/components/collateral-allocation-tooltip/collateral-allocation-tooltip.cjs +1 -0
- package/dist/cjs/components/collateral-allocation-tooltip/constants.cjs +1 -0
- package/dist/cjs/components/collateral-allocation-tooltip/index.cjs +1 -0
- package/dist/cjs/components/composites/index.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/constants.cjs +1 -0
- package/dist/cjs/components/composites/pool-assets-table/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-assets-table/pool-assets-table-row.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/index.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/transactionConfirmShellTypes.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/index.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/index.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/filter/filter-chip.cjs +1 -1
- package/dist/cjs/components/graph/default-config.cjs +1 -1
- package/dist/cjs/components/graph/graph-view.cjs +1 -1
- package/dist/cjs/components/graph/graph.cjs +1 -1
- package/dist/cjs/components/hf-indicator/hf-indicator.cjs +1 -0
- package/dist/cjs/components/hf-indicator/index.cjs +1 -0
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/infinite-scroll/index.cjs +1 -0
- package/dist/cjs/components/infinite-scroll/infinite-scroll-wrapper.cjs +1 -0
- package/dist/cjs/components/name-cell/index.cjs +1 -0
- package/dist/cjs/components/name-cell/name-cell.cjs +1 -0
- package/dist/cjs/components/network-icon/index.cjs +1 -1
- package/dist/cjs/components/network-icon/network-indicator.cjs +1 -0
- package/dist/cjs/components/trading-view/trading-view.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/components/yield-breakdown-tooltip/yield-breakdown-tooltip.cjs +1 -1
- package/dist/cjs/configs/tailwind-preset.cjs +1 -1
- package/dist/cjs/hooks/index.cjs +1 -1
- package/dist/cjs/hooks/use-observed-width-key.cjs +1 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/cjs/utils/format-money.cjs +1 -1
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/cjs/utils/leverage-presets.cjs +1 -0
- package/dist/esm/components/assets-list-cell/assets-list-cell.js +161 -159
- package/dist/esm/components/badge/badge.js +14 -8
- package/dist/esm/components/badge/chip.js +47 -0
- package/dist/esm/components/badge/index.js +8 -3
- package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +3 -2
- package/dist/esm/components/base/chart-with-side-card/chart-with-side-card.js +6 -6
- package/dist/esm/components/base/history-chart/history-chart.js +86 -46
- package/dist/esm/components/base/index.js +144 -138
- package/dist/esm/components/base/info-list/info-list.js +7 -8
- package/dist/esm/components/base/leverage-input/leverage-input.js +1 -1
- package/dist/esm/components/base/leverage-preset-chips/constants.js +7 -0
- package/dist/esm/components/base/leverage-preset-chips/index.js +6 -0
- package/dist/esm/components/base/leverage-preset-chips/leverage-preset-chips.js +39 -0
- package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +23 -30
- package/dist/esm/components/base/strategy-apy-breakdown-card/constants.js +3 -2
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +194 -32
- package/dist/esm/components/base/title-meta/constants.js +1 -0
- package/dist/esm/components/base/title-meta/title-meta.js +53 -33
- package/dist/esm/components/base/values/index.js +16 -14
- package/dist/esm/components/base/values/position-status-badge.js +26 -0
- package/dist/esm/components/base/values/position-type-badge.js +7 -6
- package/dist/esm/components/base-table/base-table-line.js +117 -0
- package/dist/esm/components/base-table/base-table.js +110 -0
- package/dist/esm/components/base-table/constants.js +12 -0
- package/dist/esm/components/base-table/index.js +9 -0
- package/dist/esm/components/base-table/types.js +1 -0
- package/dist/esm/components/block-sync-pill/block-sync-pill.js +9 -6
- package/dist/esm/components/checkbox/checkbox-labeled.js +7 -4
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +7 -4
- package/dist/esm/components/collateral-allocation-tooltip/allocation-wheel.js +71 -0
- package/dist/esm/components/collateral-allocation-tooltip/collateral-allocation-tooltip.js +102 -0
- package/dist/esm/components/collateral-allocation-tooltip/constants.js +12 -0
- package/dist/esm/components/collateral-allocation-tooltip/index.js +9 -0
- package/dist/esm/components/composites/index.js +31 -31
- package/dist/esm/components/composites/pool-assets-table/constants.js +9 -0
- package/dist/esm/components/composites/pool-assets-table/index.js +8 -6
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-head.js +52 -30
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +108 -76
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table.js +44 -26
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.js +109 -52
- package/dist/esm/components/composites/tx-preview/confirm/dialog/index.js +8 -10
- package/dist/esm/components/composites/tx-preview/confirm/dialog/transactionConfirmShellTypes.js +1 -0
- package/dist/esm/components/composites/tx-preview/confirm/index.js +24 -26
- package/dist/esm/components/composites/tx-preview/index.js +24 -26
- package/dist/esm/components/compound-apy/compound-apy.js +85 -80
- package/dist/esm/components/filter/filter-chip.js +1 -0
- package/dist/esm/components/graph/default-config.js +20 -18
- package/dist/esm/components/graph/graph-view.js +32 -31
- package/dist/esm/components/graph/graph.js +459 -458
- package/dist/esm/components/hf-indicator/hf-indicator.js +33 -0
- package/dist/esm/components/hf-indicator/index.js +4 -0
- package/dist/esm/components/index.js +732 -701
- package/dist/esm/components/infinite-scroll/index.js +4 -0
- package/dist/esm/components/infinite-scroll/infinite-scroll-wrapper.js +30 -0
- package/dist/esm/components/name-cell/index.js +4 -0
- package/dist/esm/components/name-cell/name-cell.js +35 -0
- package/dist/esm/components/network-icon/index.js +4 -2
- package/dist/esm/components/network-icon/network-indicator.js +82 -0
- package/dist/esm/components/trading-view/trading-view.js +193 -155
- package/dist/esm/components/with-copy/with-copy.js +7 -4
- package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown-tooltip.js +112 -169
- package/dist/esm/configs/tailwind-preset.js +13 -1
- package/dist/esm/hooks/index.js +20 -18
- package/dist/esm/hooks/use-observed-width-key.js +24 -0
- package/dist/esm/index.js +881 -842
- package/dist/esm/locale/en.json.js +21 -18
- package/dist/esm/utils/format-money.js +59 -41
- package/dist/esm/utils/index.js +87 -83
- package/dist/esm/utils/leverage-presets.js +13 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/assets-list-cell/assets-list-cell.d.ts +3 -0
- package/dist/types/components/badge/badge.d.ts +2 -1
- package/dist/types/components/badge/chip.d.ts +22 -0
- package/dist/types/components/badge/index.d.ts +1 -0
- package/dist/types/components/base/history-chart/history-chart.d.ts +13 -3
- package/dist/types/components/base/index.d.ts +1 -0
- package/dist/types/components/base/leverage-input/leverage-input.d.ts +1 -1
- package/dist/types/components/base/leverage-preset-chips/constants.d.ts +4 -0
- package/dist/types/components/base/leverage-preset-chips/index.d.ts +2 -0
- package/dist/types/components/base/leverage-preset-chips/leverage-preset-chips.d.ts +13 -0
- package/dist/types/components/base/liquidation-params-table/liquidation-params-table.d.ts +2 -2
- package/dist/types/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.d.ts +4 -5
- package/dist/types/components/base/strategy-apy-breakdown-card/constants.d.ts +1 -0
- package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts +12 -4
- package/dist/types/components/base/title-meta/constants.d.ts +1 -0
- package/dist/types/components/base/title-meta/title-meta.d.ts +9 -1
- package/dist/types/components/base/values/index.d.ts +1 -0
- package/dist/types/components/base/values/position-status-badge.d.ts +7 -0
- package/dist/types/components/base/values/position-type-badge.d.ts +1 -1
- package/dist/types/components/base-table/base-table-line.d.ts +21 -0
- package/dist/types/components/base-table/base-table.d.ts +19 -0
- package/dist/types/components/base-table/constants.d.ts +8 -0
- package/dist/types/components/base-table/index.d.ts +3 -0
- package/dist/types/components/base-table/types.d.ts +37 -0
- package/dist/types/components/collateral-allocation-tooltip/allocation-wheel.d.ts +10 -0
- package/dist/types/components/collateral-allocation-tooltip/collateral-allocation-tooltip.d.ts +23 -0
- package/dist/types/components/collateral-allocation-tooltip/constants.d.ts +8 -0
- package/dist/types/components/collateral-allocation-tooltip/index.d.ts +3 -0
- package/dist/types/components/composites/pool-assets-table/constants.d.ts +6 -0
- package/dist/types/components/composites/pool-assets-table/index.d.ts +1 -0
- package/dist/types/components/composites/pool-assets-table/pool-assets-table-head.d.ts +1 -2
- package/dist/types/components/composites/pool-assets-table/pool-assets-table-row.d.ts +8 -8
- package/dist/types/components/composites/pool-assets-table/pool-assets-table.d.ts +7 -20
- package/dist/types/components/composites/pool-assets-table/types.d.ts +4 -12
- package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.d.ts +23 -19
- package/dist/types/components/composites/tx-preview/confirm/dialog/index.d.ts +2 -2
- package/dist/types/components/composites/tx-preview/confirm/dialog/transactionConfirmPhase.d.ts +0 -3
- package/dist/types/components/composites/tx-preview/confirm/dialog/transactionConfirmShellTypes.d.ts +97 -0
- package/dist/types/components/graph/graph-view.d.ts +1 -1
- package/dist/types/components/graph/graph.d.ts +4 -0
- package/dist/types/components/hf-indicator/hf-indicator.d.ts +8 -0
- package/dist/types/components/hf-indicator/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +5 -0
- package/dist/types/components/infinite-scroll/index.d.ts +1 -0
- package/dist/types/components/infinite-scroll/infinite-scroll-wrapper.d.ts +11 -0
- package/dist/types/components/name-cell/index.d.ts +1 -0
- package/dist/types/components/name-cell/name-cell.d.ts +13 -0
- package/dist/types/components/network-icon/index.d.ts +1 -0
- package/dist/types/components/network-icon/network-indicator.d.ts +23 -0
- package/dist/types/components/trading-view/trading-view.d.ts +10 -3
- package/dist/types/components/yield-breakdown-tooltip/yield-breakdown-tooltip.d.ts +6 -8
- package/dist/types/configs/tailwind-preset.d.ts +12 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/use-observed-width-key.d.ts +8 -0
- package/dist/types/index.d.ts +6 -1
- package/dist/types/locale/en.json.d.ts +23 -18
- package/dist/types/utils/format-money.d.ts +11 -5
- package/dist/types/utils/index.d.ts +2 -1
- package/dist/types/utils/leverage-presets.d.ts +7 -0
- package/package.json +1 -1
- package/src/styles/base.css +30 -0
- package/src/styles/theme.css +16 -0
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.cjs +0 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.cjs +0 -1
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.js +0 -177
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.js +0 -54
- package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.d.ts +0 -17
- package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.d.ts +0 -16
|
@@ -1,58 +1,51 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { FormattedMessageTyped as
|
|
3
|
-
import { VerticalIndicator as
|
|
1
|
+
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { FormattedMessageTyped as n } from "../../typed-intl/index.js";
|
|
3
|
+
import { VerticalIndicator as m } from "../../vertical-indicator/vertical-indicator.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@gearbox-protocol/sdk";
|
|
6
6
|
import "clsx";
|
|
7
7
|
import "tailwind-merge";
|
|
8
8
|
import "sonner";
|
|
9
|
-
import { percentTemplate as
|
|
9
|
+
import { percentTemplate as a } from "../../../utils/format-money.js";
|
|
10
10
|
import "@gearbox-protocol/sdk/common-utils";
|
|
11
11
|
import "luxon";
|
|
12
12
|
import "../../../utils/z-index.js";
|
|
13
|
-
import { SideCard as
|
|
14
|
-
import { PoolApyBreakdownCardTest as
|
|
15
|
-
function
|
|
13
|
+
import { SideCard as d } from "../side-card/side-card.js";
|
|
14
|
+
import { PoolApyBreakdownCardTest as i } from "./constants.js";
|
|
15
|
+
function e({
|
|
16
16
|
title: r,
|
|
17
|
-
value:
|
|
17
|
+
value: t
|
|
18
18
|
}) {
|
|
19
19
|
return /* @__PURE__ */ o(
|
|
20
|
-
|
|
20
|
+
m,
|
|
21
21
|
{
|
|
22
22
|
size: "sm",
|
|
23
|
-
label: /* @__PURE__ */ o(
|
|
24
|
-
value: /* @__PURE__ */ o("span", { "data-testid":
|
|
23
|
+
label: /* @__PURE__ */ o(n, { messageId: r }),
|
|
24
|
+
value: /* @__PURE__ */ o("span", { "data-testid": i.value, children: t === void 0 ? "—" : a(t / 100) })
|
|
25
25
|
}
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function I({
|
|
29
29
|
data: r
|
|
30
30
|
}) {
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
|
|
31
|
+
return /* @__PURE__ */ p(
|
|
32
|
+
d,
|
|
33
33
|
{
|
|
34
34
|
title: "components.poolApyBreakdownCard.title",
|
|
35
|
-
testId:
|
|
35
|
+
testId: i.root,
|
|
36
36
|
children: [
|
|
37
37
|
/* @__PURE__ */ o(
|
|
38
|
-
|
|
38
|
+
e,
|
|
39
39
|
{
|
|
40
|
-
title: "components.poolApyBreakdownCard.
|
|
41
|
-
value: r?.
|
|
40
|
+
title: "components.poolApyBreakdownCard.organicApy",
|
|
41
|
+
value: r?.organicApy
|
|
42
42
|
}
|
|
43
43
|
),
|
|
44
44
|
/* @__PURE__ */ o(
|
|
45
|
-
|
|
45
|
+
e,
|
|
46
46
|
{
|
|
47
|
-
title: "components.poolApyBreakdownCard.
|
|
48
|
-
value: r?.
|
|
49
|
-
}
|
|
50
|
-
),
|
|
51
|
-
/* @__PURE__ */ o(
|
|
52
|
-
t,
|
|
53
|
-
{
|
|
54
|
-
title: "components.poolApyBreakdownCard.apy30d",
|
|
55
|
-
value: r?.apy30d
|
|
47
|
+
title: "components.poolApyBreakdownCard.incentiveApy",
|
|
48
|
+
value: r?.incentiveApy
|
|
56
49
|
}
|
|
57
50
|
)
|
|
58
51
|
]
|
|
@@ -60,6 +53,6 @@ function T({
|
|
|
60
53
|
);
|
|
61
54
|
}
|
|
62
55
|
export {
|
|
63
|
-
|
|
64
|
-
|
|
56
|
+
I as PoolApyBreakdownCard,
|
|
57
|
+
i as PoolApyBreakdownCardTest
|
|
65
58
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
class
|
|
1
|
+
class a {
|
|
2
2
|
static root = "strategy-apy-breakdown-card-root";
|
|
3
3
|
static row = "strategy-apy-breakdown-card-row";
|
|
4
|
+
static net = "strategy-apy-breakdown-card-net";
|
|
4
5
|
}
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
+
a as StrategyApyBreakdownCardTest
|
|
7
8
|
};
|
|
@@ -1,52 +1,214 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { SideCard as l } from "../side-card/side-card.js";
|
|
1
|
+
import { jsxs as a, jsx as n, Fragment as I } from "react/jsx-runtime";
|
|
2
|
+
import { PointsIcon as P } from "../../points-icon/points-icon.js";
|
|
3
|
+
import { TokenIcon as L } from "../../token-icon/token-icon.js";
|
|
4
|
+
import { FormattedMessageTyped as p } from "../../typed-intl/index.js";
|
|
6
5
|
import "react";
|
|
6
|
+
import { positiveTokenRewardsOf as R, pointProgramsOf as M } from "../../../utils/apy-breakdown.js";
|
|
7
7
|
import "@gearbox-protocol/sdk";
|
|
8
|
-
import "
|
|
9
|
-
import "
|
|
8
|
+
import { bpsToPercent as T } from "../../../utils/bps.js";
|
|
9
|
+
import { cn as w } from "../../../utils/cn.js";
|
|
10
10
|
import "sonner";
|
|
11
|
+
import { formatLeverage as g } from "../../../utils/format-leverage.js";
|
|
12
|
+
import { formatCompactPercent as $ } from "../../../utils/format-money.js";
|
|
13
|
+
import { formatChipLeverage as C } from "../../../utils/leverage-presets.js";
|
|
11
14
|
import "@gearbox-protocol/sdk/common-utils";
|
|
12
15
|
import "luxon";
|
|
13
16
|
import "../../../utils/z-index.js";
|
|
14
|
-
import "
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
import { StrategyApyBreakdownCardTest as A } from "./constants.js";
|
|
18
|
+
const u = "—";
|
|
19
|
+
function m(r) {
|
|
20
|
+
const t = T(r);
|
|
21
|
+
if (Math.abs(t) >= 1e3) {
|
|
22
|
+
const i = $(Math.abs(t));
|
|
23
|
+
return t < 0 ? `−${i}` : i;
|
|
24
|
+
}
|
|
25
|
+
const l = Math.abs(t), s = l % 1 === 0 ? String(l) : l.toFixed(1);
|
|
26
|
+
return t < 0 ? `−${s}%` : `${s}%`;
|
|
27
|
+
}
|
|
28
|
+
function F(r) {
|
|
29
|
+
return r == null || r <= 0 ? "bg-muted text-muted-foreground" : "bg-success/20 text-success";
|
|
30
|
+
}
|
|
31
|
+
function y({
|
|
32
|
+
base: r,
|
|
33
|
+
leverage: t
|
|
21
34
|
}) {
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
|
|
35
|
+
return /* @__PURE__ */ n(
|
|
36
|
+
p,
|
|
24
37
|
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
38
|
+
messageId: "components.strategyApyBreakdownCard.formula",
|
|
39
|
+
values: { base: r, leverage: t }
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
function Z({
|
|
44
|
+
data: r,
|
|
45
|
+
leverage: t
|
|
46
|
+
}) {
|
|
47
|
+
const l = t ?? (r.maxLeverage != null && r.maxLeverage > 0 ? r.maxLeverage : void 0), s = l != null ? g(l) : u, i = r.collateralApy ? R(r.collateralApy) : [], k = r.collateralApy ? M(r.collateralApy) : [], N = r.borrowApy != null || r.additionalBorrowApy != null, f = N ? (r.borrowApy ?? 0) + (r.additionalBorrowApy ?? 0) : void 0, B = l != null ? Math.max(l - 1, 0) : void 0, v = r.collateralApy?.organicApy, d = v != null && l != null ? v * l : void 0, c = i.map(
|
|
48
|
+
(e) => e.supplyApr != null && l != null ? e.supplyApr * l : void 0
|
|
49
|
+
), b = f != null && B != null ? -(f * B) : void 0, h = d != null && b != null && c.every((e) => e != null) ? d + c.reduce((e, o) => e + (o ?? 0), 0) + b : d != null && c.every((e) => e != null) && !N ? d + c.reduce((e, o) => e + (o ?? 0), 0) : void 0;
|
|
50
|
+
return /* @__PURE__ */ a(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
className: "flex w-full min-w-0 flex-col gap-4 rounded-xl border border-border bg-card p-4",
|
|
54
|
+
"data-testid": A.root,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ a("div", { className: "flex h-6 items-center justify-between gap-3", children: [
|
|
57
|
+
/* @__PURE__ */ n("span", { className: "text-base font-semibold leading-4 text-foreground", children: /* @__PURE__ */ n(
|
|
58
|
+
p,
|
|
59
|
+
{
|
|
60
|
+
messageId: "components.strategyApyBreakdownCard.titleAtLeverage",
|
|
61
|
+
values: { leverage: s }
|
|
62
|
+
}
|
|
63
|
+
) }),
|
|
64
|
+
/* @__PURE__ */ n(
|
|
65
|
+
"span",
|
|
66
|
+
{
|
|
67
|
+
className: w(
|
|
68
|
+
"rounded-md px-2 py-0.5 text-sm font-semibold tabular-nums",
|
|
69
|
+
F(h)
|
|
70
|
+
),
|
|
71
|
+
"data-testid": A.net,
|
|
72
|
+
children: h == null ? u : m(h)
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
] }),
|
|
76
|
+
/* @__PURE__ */ a("div", { className: "flex flex-col gap-3", children: [
|
|
77
|
+
/* @__PURE__ */ n(
|
|
78
|
+
x,
|
|
79
|
+
{
|
|
80
|
+
label: /* @__PURE__ */ n(p, { messageId: "components.strategyApyBreakdownCard.collateralApy" }),
|
|
81
|
+
value: d == null ? u : m(d),
|
|
82
|
+
subtext: v != null && l != null ? /* @__PURE__ */ n(
|
|
83
|
+
y,
|
|
84
|
+
{
|
|
85
|
+
base: m(v),
|
|
86
|
+
leverage: g(l)
|
|
87
|
+
}
|
|
88
|
+
) : void 0
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
i.map((e, o) => /* @__PURE__ */ n(
|
|
92
|
+
x,
|
|
93
|
+
{
|
|
94
|
+
label: /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
95
|
+
/* @__PURE__ */ n("span", { children: /* @__PURE__ */ n(
|
|
96
|
+
p,
|
|
97
|
+
{
|
|
98
|
+
messageId: "components.apyParts.extraAPY",
|
|
99
|
+
values: { symbol: e.token.symbol }
|
|
100
|
+
}
|
|
101
|
+
) }),
|
|
102
|
+
/* @__PURE__ */ n(
|
|
103
|
+
L,
|
|
104
|
+
{
|
|
105
|
+
token: e.token,
|
|
106
|
+
symbol: e.token.symbol,
|
|
107
|
+
size: 16,
|
|
108
|
+
className: "shrink-0"
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
] }),
|
|
112
|
+
value: c[o] == null ? u : m(c[o]),
|
|
113
|
+
subtext: e.supplyApr != null && l != null ? /* @__PURE__ */ n(
|
|
114
|
+
y,
|
|
115
|
+
{
|
|
116
|
+
base: m(e.supplyApr),
|
|
117
|
+
leverage: g(l)
|
|
118
|
+
}
|
|
119
|
+
) : void 0
|
|
120
|
+
},
|
|
121
|
+
`incentive-${e.token.address}-${e.supplyApr ?? 0}`
|
|
122
|
+
)),
|
|
123
|
+
/* @__PURE__ */ n(
|
|
124
|
+
x,
|
|
125
|
+
{
|
|
126
|
+
muted: !0,
|
|
127
|
+
label: /* @__PURE__ */ n(p, { messageId: "components.strategyApyBreakdownCard.borrowRate" }),
|
|
128
|
+
value: b == null ? u : m(b),
|
|
129
|
+
subtext: f != null && l != null ? /* @__PURE__ */ n(
|
|
130
|
+
y,
|
|
131
|
+
{
|
|
132
|
+
base: m(f),
|
|
133
|
+
leverage: g(l)
|
|
134
|
+
}
|
|
135
|
+
) : void 0
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
k.length > 0 ? /* @__PURE__ */ a(I, { children: [
|
|
139
|
+
/* @__PURE__ */ n("div", { className: "h-px w-full bg-divider" }),
|
|
140
|
+
k.map((e) => {
|
|
141
|
+
const o = e.multiplier != null && l != null ? e.multiplier * l : void 0;
|
|
142
|
+
return /* @__PURE__ */ n(
|
|
143
|
+
x,
|
|
144
|
+
{
|
|
145
|
+
label: /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
146
|
+
/* @__PURE__ */ n("span", { children: /* @__PURE__ */ n(
|
|
147
|
+
p,
|
|
148
|
+
{
|
|
149
|
+
messageId: "components.yieldBreakdown.programPoints",
|
|
150
|
+
values: { name: e.name }
|
|
151
|
+
}
|
|
152
|
+
) }),
|
|
153
|
+
/* @__PURE__ */ n(
|
|
154
|
+
P,
|
|
155
|
+
{
|
|
156
|
+
reward: { name: e.name, type: e.id },
|
|
157
|
+
size: 16,
|
|
158
|
+
className: "shrink-0"
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
] }),
|
|
162
|
+
value: o != null ? `${C(o)}×` : u,
|
|
163
|
+
subtext: e.multiplier != null && l != null ? /* @__PURE__ */ n(
|
|
164
|
+
y,
|
|
165
|
+
{
|
|
166
|
+
base: C(e.multiplier),
|
|
167
|
+
leverage: g(l)
|
|
168
|
+
}
|
|
169
|
+
) : void 0
|
|
170
|
+
},
|
|
171
|
+
e.id
|
|
172
|
+
);
|
|
173
|
+
})
|
|
174
|
+
] }) : null
|
|
175
|
+
] })
|
|
176
|
+
]
|
|
29
177
|
}
|
|
30
178
|
);
|
|
31
179
|
}
|
|
32
|
-
function
|
|
33
|
-
|
|
180
|
+
function x({
|
|
181
|
+
label: r,
|
|
182
|
+
value: t,
|
|
183
|
+
subtext: l,
|
|
184
|
+
muted: s = !1
|
|
34
185
|
}) {
|
|
35
|
-
|
|
36
|
-
|
|
186
|
+
const i = s ? "text-muted-foreground" : "text-foreground";
|
|
187
|
+
return /* @__PURE__ */ a(
|
|
188
|
+
"div",
|
|
37
189
|
{
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
tip: /* @__PURE__ */ r(m, { iconSize: 14, placement: "top", children: /* @__PURE__ */ r(a, { messageId: "components.strategyApyBreakdownCard.formula" }) }),
|
|
190
|
+
className: "flex items-start justify-between gap-3",
|
|
191
|
+
"data-testid": A.row,
|
|
41
192
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
|
|
193
|
+
/* @__PURE__ */ n("span", { className: w("min-w-0 text-sm font-semibold leading-5", i), children: r }),
|
|
194
|
+
/* @__PURE__ */ a("span", { className: "flex shrink-0 flex-col items-end", children: [
|
|
195
|
+
/* @__PURE__ */ n(
|
|
196
|
+
"span",
|
|
197
|
+
{
|
|
198
|
+
className: w(
|
|
199
|
+
"text-sm font-semibold leading-5 tabular-nums",
|
|
200
|
+
t === u || s ? "text-muted-foreground" : "text-foreground"
|
|
201
|
+
),
|
|
202
|
+
children: t
|
|
203
|
+
}
|
|
204
|
+
),
|
|
205
|
+
l != null ? /* @__PURE__ */ n("span", { className: "text-xs leading-4 text-muted-foreground", children: l }) : null
|
|
206
|
+
] })
|
|
45
207
|
]
|
|
46
208
|
}
|
|
47
209
|
);
|
|
48
210
|
}
|
|
49
211
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
212
|
+
Z as StrategyApyBreakdownCard,
|
|
213
|
+
A as StrategyApyBreakdownCardTest
|
|
52
214
|
};
|
|
@@ -1,68 +1,88 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Link as
|
|
1
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Link as l } from "../../link/link.js";
|
|
3
3
|
import { NetworkIcon as g } from "../../network-icon/network-icon.js";
|
|
4
|
-
import
|
|
4
|
+
import "../../network-icon/network-indicator.js";
|
|
5
|
+
import { TokenIcon as h } from "../../token-icon/token-icon.js";
|
|
6
|
+
import { FormattedMessageTyped as u } from "../../typed-intl/index.js";
|
|
5
7
|
import { Typography as r } from "../../typography/typography.js";
|
|
6
|
-
import { Stack as
|
|
7
|
-
import { TitleMetaTest as
|
|
8
|
-
function
|
|
9
|
-
network:
|
|
10
|
-
curatorName:
|
|
11
|
-
curatorLink:
|
|
12
|
-
onCuratorLinkClick:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
import { Stack as n } from "../stack/stack.js";
|
|
9
|
+
import { TitleMetaTest as o } from "./constants.js";
|
|
10
|
+
function I({
|
|
11
|
+
network: m,
|
|
12
|
+
curatorName: s,
|
|
13
|
+
curatorLink: i,
|
|
14
|
+
onCuratorLinkClick: d,
|
|
15
|
+
links: c,
|
|
16
|
+
testId: p = o.root,
|
|
17
|
+
networkTestId: f = o.network,
|
|
18
|
+
curatorTestId: x = o.curator
|
|
16
19
|
}) {
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
|
|
20
|
+
return /* @__PURE__ */ a(
|
|
21
|
+
n,
|
|
19
22
|
{
|
|
20
23
|
direction: "row",
|
|
21
24
|
align: "center",
|
|
22
25
|
gap: "md",
|
|
23
26
|
wrap: !0,
|
|
24
27
|
className: "text-sm text-foreground",
|
|
25
|
-
"data-testid":
|
|
28
|
+
"data-testid": p,
|
|
26
29
|
children: [
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
|
|
30
|
+
/* @__PURE__ */ a(
|
|
31
|
+
n,
|
|
29
32
|
{
|
|
30
33
|
direction: "row",
|
|
31
34
|
align: "center",
|
|
32
35
|
gap: "sm",
|
|
33
|
-
"data-testid":
|
|
36
|
+
"data-testid": f,
|
|
34
37
|
children: [
|
|
35
|
-
/* @__PURE__ */ t(g, { network:
|
|
36
|
-
/* @__PURE__ */ t(r, { as: "span", className: "text-sm text-foreground", children:
|
|
38
|
+
/* @__PURE__ */ t(g, { network: m, size: 16 }),
|
|
39
|
+
/* @__PURE__ */ t(r, { as: "span", className: "text-sm text-foreground", children: m })
|
|
37
40
|
]
|
|
38
41
|
}
|
|
39
42
|
),
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
s ? /* @__PURE__ */ t(
|
|
44
|
+
n,
|
|
42
45
|
{
|
|
43
46
|
direction: "row",
|
|
44
47
|
align: "center",
|
|
45
48
|
gap: "sm",
|
|
46
|
-
"data-testid":
|
|
47
|
-
children:
|
|
48
|
-
|
|
49
|
+
"data-testid": x,
|
|
50
|
+
children: i ? /* @__PURE__ */ t(
|
|
51
|
+
l,
|
|
49
52
|
{
|
|
50
53
|
className: "text-sm text-foreground",
|
|
51
|
-
href:
|
|
54
|
+
href: i,
|
|
52
55
|
external: !0,
|
|
53
56
|
target: "_blank",
|
|
54
57
|
size: "sm",
|
|
55
|
-
onClick:
|
|
56
|
-
children:
|
|
58
|
+
onClick: d,
|
|
59
|
+
children: s
|
|
57
60
|
}
|
|
58
|
-
) : /* @__PURE__ */ t(r, { as: "span", className: "text-sm text-foreground", children:
|
|
61
|
+
) : /* @__PURE__ */ t(r, { as: "span", className: "text-sm text-foreground", children: s })
|
|
59
62
|
}
|
|
60
|
-
) : /* @__PURE__ */ t(r, { as: "span", className: "text-sm text-foreground", children: /* @__PURE__ */ t(
|
|
63
|
+
) : /* @__PURE__ */ t(r, { as: "span", className: "text-sm text-foreground", children: /* @__PURE__ */ t(u, { messageId: "components.titleMeta.unknownCurator" }) }),
|
|
64
|
+
c?.map((e) => /* @__PURE__ */ a(
|
|
65
|
+
l,
|
|
66
|
+
{
|
|
67
|
+
className: "inline-flex items-center gap-2 text-sm text-foreground",
|
|
68
|
+
href: e.href,
|
|
69
|
+
external: !0,
|
|
70
|
+
target: "_blank",
|
|
71
|
+
size: "sm",
|
|
72
|
+
onClick: e.onClick,
|
|
73
|
+
"data-testid": o.link,
|
|
74
|
+
children: [
|
|
75
|
+
e.token ? /* @__PURE__ */ t(h, { token: e.token, size: 16, className: "shrink-0" }) : null,
|
|
76
|
+
e.label || e.token?.symbol ? /* @__PURE__ */ t(r, { as: "span", className: "text-sm text-foreground", children: e.label ?? e.token?.symbol }) : null
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
e.href
|
|
80
|
+
))
|
|
61
81
|
]
|
|
62
82
|
}
|
|
63
83
|
);
|
|
64
84
|
}
|
|
65
85
|
export {
|
|
66
|
-
|
|
67
|
-
|
|
86
|
+
I as TitleMeta,
|
|
87
|
+
o as TitleMetaTest
|
|
68
88
|
};
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { PositionShortLabelTest as t, ValueTest as r } from "./constants.js";
|
|
2
|
-
import { PnlValue as
|
|
2
|
+
import { PnlValue as i } from "./pnl-value.js";
|
|
3
3
|
import { PointsValue as p } from "./points-value.js";
|
|
4
|
-
import { PositionShortLabel as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { PositionShortLabel as n } from "./position-short-label.js";
|
|
5
|
+
import { PositionStatusBadge as V } from "./position-status-badge.js";
|
|
6
|
+
import { PositionTypeBadge as m } from "./position-type-badge.js";
|
|
7
|
+
import { ApyValue as P, HealthFactorValue as g, LeverageValue as T, TokenBigint as b, UsdValue as d, UtilizationValue as h, bps as B } from "./scalars.js";
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
P as ApyValue,
|
|
10
|
+
g as HealthFactorValue,
|
|
11
|
+
T as LeverageValue,
|
|
12
|
+
i as PnlValue,
|
|
12
13
|
p as PointsValue,
|
|
13
|
-
|
|
14
|
+
n as PositionShortLabel,
|
|
14
15
|
t as PositionShortLabelTest,
|
|
15
|
-
V as
|
|
16
|
-
|
|
17
|
-
b as
|
|
18
|
-
|
|
16
|
+
V as PositionStatusBadge,
|
|
17
|
+
m as PositionTypeBadge,
|
|
18
|
+
b as TokenBigint,
|
|
19
|
+
d as UsdValue,
|
|
20
|
+
h as UtilizationValue,
|
|
19
21
|
r as ValueTest,
|
|
20
|
-
|
|
22
|
+
B as bps
|
|
21
23
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Badge as r } from "../../badge/badge.js";
|
|
3
|
+
import "../../badge/chip.js";
|
|
4
|
+
import { FormattedMessageTyped as o } from "../../typed-intl/index.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "@gearbox-protocol/sdk";
|
|
7
|
+
import { cn as i } from "../../../utils/cn.js";
|
|
8
|
+
import "sonner";
|
|
9
|
+
import "@gearbox-protocol/sdk/common-utils";
|
|
10
|
+
import "luxon";
|
|
11
|
+
import "../../../utils/z-index.js";
|
|
12
|
+
const m = {
|
|
13
|
+
active: "shrink-0 border-transparent bg-emerald-500/15 font-medium text-emerald-400 hover:bg-emerald-500/15",
|
|
14
|
+
repaid: "shrink-0 border-transparent bg-muted font-medium text-muted-foreground hover:bg-muted"
|
|
15
|
+
}, a = {
|
|
16
|
+
active: "components.positionStatusBadge.active",
|
|
17
|
+
repaid: "components.positionStatusBadge.repaid"
|
|
18
|
+
};
|
|
19
|
+
function v({
|
|
20
|
+
data: t
|
|
21
|
+
}) {
|
|
22
|
+
return /* @__PURE__ */ e(r, { variant: "secondary", className: i(m[t]), children: /* @__PURE__ */ e(o, { messageId: a[t] }) });
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
v as PositionStatusBadge
|
|
26
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { Badge as r } from "../../badge/badge.js";
|
|
3
|
-
import
|
|
3
|
+
import "../../badge/chip.js";
|
|
4
|
+
import { FormattedMessageTyped as i } from "../../typed-intl/index.js";
|
|
4
5
|
import "react";
|
|
5
6
|
import "@gearbox-protocol/sdk";
|
|
6
|
-
import { cn as
|
|
7
|
+
import { cn as n } from "../../../utils/cn.js";
|
|
7
8
|
import "sonner";
|
|
8
9
|
import "@gearbox-protocol/sdk/common-utils";
|
|
9
10
|
import "luxon";
|
|
@@ -17,7 +18,7 @@ const p = {
|
|
|
17
18
|
strategy: "components.positionTypeBadge.strategy",
|
|
18
19
|
liquidation: "components.positionTypeBadge.liquidation"
|
|
19
20
|
}, a = "text-[10px] leading-none px-1.5 py-0.5 rounded-md";
|
|
20
|
-
function
|
|
21
|
+
function x({
|
|
21
22
|
data: e,
|
|
22
23
|
size: t = "table"
|
|
23
24
|
}) {
|
|
@@ -25,14 +26,14 @@ function f({
|
|
|
25
26
|
r,
|
|
26
27
|
{
|
|
27
28
|
variant: "secondary",
|
|
28
|
-
className:
|
|
29
|
+
className: n(
|
|
29
30
|
p[e],
|
|
30
31
|
t === "aside" && a
|
|
31
32
|
),
|
|
32
|
-
children: /* @__PURE__ */ o(
|
|
33
|
+
children: /* @__PURE__ */ o(i, { messageId: m[e] })
|
|
33
34
|
}
|
|
34
35
|
);
|
|
35
36
|
}
|
|
36
37
|
export {
|
|
37
|
-
|
|
38
|
+
x as PositionTypeBadge
|
|
38
39
|
};
|