@gearbox-protocol/ui-kit 4.0.0-next.43 → 4.0.0-next.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/base/borrow-rate-block/borrow-rate-block.cjs +1 -1
- package/dist/cjs/components/base/index.cjs +1 -1
- package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
- package/dist/cjs/components/base/liquidation-price-block/liquidation-price-block.cjs +1 -1
- package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/position-assets/position-assets.cjs +1 -1
- package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/time-to-liquidation-block/time-to-liquidation-block.cjs +1 -1
- package/dist/cjs/components/base/token-amount/token-amount.cjs +1 -1
- package/dist/cjs/components/base/values/constants.cjs +1 -1
- package/dist/cjs/components/base/values/index.cjs +1 -1
- package/dist/cjs/components/base/values/no-value.cjs +1 -0
- package/dist/cjs/components/base/values/pnl-value.cjs +1 -1
- package/dist/cjs/components/base/values/price-impact-value.cjs +1 -1
- package/dist/cjs/components/base/values/scalars.cjs +1 -1
- package/dist/cjs/components/base-table/base-table-line.cjs +1 -1
- package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/help-tip/help-tip.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/cjs/utils/format.cjs +1 -1
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +3 -2
- package/dist/esm/components/base/index.js +63 -61
- package/dist/esm/components/base/info-list/info-list.js +8 -7
- package/dist/esm/components/base/liquidation-price-block/liquidation-price-block.js +46 -38
- package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +74 -61
- package/dist/esm/components/base/position-assets/position-assets.js +45 -41
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +86 -74
- package/dist/esm/components/base/time-to-liquidation-block/time-to-liquidation-block.js +40 -32
- package/dist/esm/components/base/token-amount/token-amount.js +32 -16
- package/dist/esm/components/base/values/constants.js +1 -0
- package/dist/esm/components/base/values/index.js +21 -19
- package/dist/esm/components/base/values/no-value.js +34 -0
- package/dist/esm/components/base/values/pnl-value.js +10 -9
- package/dist/esm/components/base/values/price-impact-value.js +6 -5
- package/dist/esm/components/base/values/scalars.js +23 -26
- package/dist/esm/components/base-table/base-table-line.js +44 -36
- package/dist/esm/components/checkbox/checkbox-labeled.js +1 -1
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +1 -1
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +47 -46
- package/dist/esm/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.js +26 -25
- package/dist/esm/components/compound-apy/compound-apy.js +48 -40
- package/dist/esm/components/help-tip/help-tip.js +64 -59
- package/dist/esm/components/index.js +624 -622
- package/dist/esm/components/with-copy/with-copy.js +1 -1
- package/dist/esm/index.js +814 -811
- package/dist/esm/locale/en.json.js +1 -0
- package/dist/esm/utils/format.js +14 -12
- package/dist/esm/utils/index.js +76 -75
- package/dist/globals.css +1 -1
- package/dist/types/components/base/apy-breakdown-body/apy-breakdown-body.d.ts +4 -3
- package/dist/types/components/base/liquidation-price-block/liquidation-price-block.d.ts +8 -1
- package/dist/types/components/base/position-assets/position-assets.d.ts +7 -1
- package/dist/types/components/base/time-to-liquidation-block/time-to-liquidation-block.d.ts +8 -1
- package/dist/types/components/base/values/constants.d.ts +1 -0
- package/dist/types/components/base/values/index.d.ts +1 -0
- package/dist/types/components/base/values/no-value.d.ts +25 -0
- package/dist/types/components/base/values/scalars.d.ts +7 -2
- package/dist/types/locale/en.json.d.ts +1 -0
- package/dist/types/utils/format.d.ts +8 -0
- package/package.json +1 -1
|
@@ -1,60 +1,68 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useTitleText as
|
|
3
|
-
import { FadeoutLoading as
|
|
4
|
-
import { HealthDot as
|
|
5
|
-
import { FormattedMessageTyped as
|
|
6
|
-
import { VerticalIndicator as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { jsx as t, jsxs as m, Fragment as f } from "react/jsx-runtime";
|
|
2
|
+
import { useTitleText as h } from "../text/use-title-text.js";
|
|
3
|
+
import { FadeoutLoading as s } from "../../fadeout-loading/fadeout-loading.js";
|
|
4
|
+
import { HealthDot as g } from "../../status-elements/status-elements.js";
|
|
5
|
+
import { FormattedMessageTyped as u } from "../../typed-intl/index.js";
|
|
6
|
+
import { VerticalIndicator as L } from "../../vertical-indicator/vertical-indicator.js";
|
|
7
|
+
import { APPROXIMATE_SYMBOL as I } from "../../../utils/format.js";
|
|
8
|
+
import { ttlLeft as x, getTTLZones as B } from "../../../utils/ttl.js";
|
|
9
|
+
import { TimeToLiquidationBlockTest as a } from "./constants.js";
|
|
9
10
|
function j({
|
|
10
11
|
data: o,
|
|
11
12
|
dataTo: n,
|
|
12
|
-
|
|
13
|
+
approximate: r,
|
|
14
|
+
zone: l,
|
|
13
15
|
isLoading: e,
|
|
14
16
|
title: i,
|
|
15
|
-
tip:
|
|
16
|
-
testId:
|
|
17
|
+
tip: v,
|
|
18
|
+
testId: p
|
|
17
19
|
}) {
|
|
18
|
-
const
|
|
20
|
+
const T = h(), d = n !== void 0;
|
|
19
21
|
return /* @__PURE__ */ t(
|
|
20
|
-
|
|
22
|
+
L,
|
|
21
23
|
{
|
|
22
24
|
align: "center",
|
|
23
25
|
dimPreviousValue: !1,
|
|
24
|
-
"data-testid":
|
|
25
|
-
label: i !== void 0 ?
|
|
26
|
-
tip:
|
|
27
|
-
value: /* @__PURE__ */ t(
|
|
28
|
-
|
|
26
|
+
"data-testid": p ?? a.root,
|
|
27
|
+
label: i !== void 0 ? T(i) : /* @__PURE__ */ t(u, { messageId: "components.timeToLiquidationBlock.label" }),
|
|
28
|
+
tip: v ?? /* @__PURE__ */ t(u, { messageId: "components.timeToLiquidationBlock.tip" }),
|
|
29
|
+
value: /* @__PURE__ */ t(s, { loading: e, children: /* @__PURE__ */ t(
|
|
30
|
+
c,
|
|
29
31
|
{
|
|
30
32
|
milliseconds: o,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
approximate: r,
|
|
34
|
+
zone: d ? void 0 : l,
|
|
35
|
+
testId: a.value
|
|
33
36
|
}
|
|
34
37
|
) }),
|
|
35
|
-
valueTo: d ? /* @__PURE__ */ t(
|
|
36
|
-
|
|
38
|
+
valueTo: d ? /* @__PURE__ */ t(s, { loading: e, children: /* @__PURE__ */ t(
|
|
39
|
+
c,
|
|
37
40
|
{
|
|
38
41
|
milliseconds: n ?? null,
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
approximate: r,
|
|
43
|
+
zone: l,
|
|
44
|
+
testId: a.valueTo
|
|
41
45
|
}
|
|
42
46
|
) }) : void 0
|
|
43
47
|
}
|
|
44
48
|
);
|
|
45
49
|
}
|
|
46
|
-
function
|
|
50
|
+
function c({
|
|
47
51
|
milliseconds: o,
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
approximate: n,
|
|
53
|
+
zone: r,
|
|
54
|
+
testId: l
|
|
50
55
|
}) {
|
|
51
|
-
const e = o == null ? void 0 :
|
|
52
|
-
return /* @__PURE__ */
|
|
53
|
-
o === void 0 ? "—" : o === null ? "N/A" :
|
|
54
|
-
|
|
56
|
+
const e = o == null ? void 0 : x(o), i = r ?? (o == null ? void 0 : B(o));
|
|
57
|
+
return /* @__PURE__ */ m("span", { className: "inline-flex items-center", "data-testid": l, children: [
|
|
58
|
+
o === void 0 ? "—" : o === null ? "N/A" : /* @__PURE__ */ m(f, { children: [
|
|
59
|
+
n ? /* @__PURE__ */ t("span", { className: "mr-0.5", children: I }) : null,
|
|
60
|
+
e?.months !== void 0 ? `${e.months}mo` : e?.day !== void 0 ? `${e.day}d` : "<1d"
|
|
61
|
+
] }),
|
|
62
|
+
o != null && i ? /* @__PURE__ */ t("span", { className: "ml-1.5", children: /* @__PURE__ */ t(g, { zone: i }) }) : null
|
|
55
63
|
] });
|
|
56
64
|
}
|
|
57
65
|
export {
|
|
58
66
|
j as TimeToLiquidationBlock,
|
|
59
|
-
|
|
67
|
+
a as TimeToLiquidationBlockTest
|
|
60
68
|
};
|
|
@@ -1,30 +1,46 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { Stack as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
1
|
+
import { jsx as r, jsxs as e } from "react/jsx-runtime";
|
|
2
|
+
import { Stack as n } from "../stack/stack.js";
|
|
3
|
+
import { NoValue as a } from "../values/no-value.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "@gearbox-protocol/sdk/onchain";
|
|
6
|
+
import "clsx";
|
|
7
|
+
import "tailwind-merge";
|
|
8
|
+
import "sonner";
|
|
9
|
+
import { formatMoney as s } from "../../../utils/format-money.js";
|
|
10
|
+
import "luxon";
|
|
11
|
+
import "../../../utils/z-index.js";
|
|
12
|
+
import "../../points-icon/points-icon.js";
|
|
13
|
+
import "viem";
|
|
14
|
+
import "../../token-icon/token-icon.js";
|
|
15
|
+
import "react-intl";
|
|
16
|
+
import "../../tooltip/simple-tooltip.js";
|
|
17
|
+
import "../../tooltip/tooltip.js";
|
|
18
|
+
import "../../badge/badge.js";
|
|
19
|
+
import "../../badge/chip.js";
|
|
20
|
+
import { TokenTemplate as l } from "../../token-template/token-template.js";
|
|
21
|
+
import { Typography as u } from "../../typography/typography.js";
|
|
22
|
+
import { TokenAmountTest as t } from "./constants.js";
|
|
23
|
+
function C({
|
|
8
24
|
data: o,
|
|
9
|
-
token:
|
|
10
|
-
align:
|
|
25
|
+
token: m,
|
|
26
|
+
align: i = "end"
|
|
11
27
|
}) {
|
|
12
28
|
if (o === null)
|
|
13
29
|
return /* @__PURE__ */ r(
|
|
14
30
|
"span",
|
|
15
31
|
{
|
|
16
32
|
className: "text-secondary-foreground",
|
|
17
|
-
"data-testid":
|
|
33
|
+
"data-testid": t.root,
|
|
18
34
|
children: "—"
|
|
19
35
|
}
|
|
20
36
|
);
|
|
21
|
-
const
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */ r(
|
|
24
|
-
/* @__PURE__ */ r(
|
|
37
|
+
const p = m ?? o.token;
|
|
38
|
+
return /* @__PURE__ */ e(n, { gap: "xs", align: i, "data-testid": t.root, children: [
|
|
39
|
+
/* @__PURE__ */ r(l, { value: o.value, token: p }),
|
|
40
|
+
/* @__PURE__ */ r(u, { as: "span", variant: "caption", color: "secondary", children: o.valueUsd === null ? /* @__PURE__ */ r(a, {}) : s(o.valueUsd) })
|
|
25
41
|
] });
|
|
26
42
|
}
|
|
27
43
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
44
|
+
C as TokenAmount,
|
|
45
|
+
t as TokenAmountTest
|
|
30
46
|
};
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { PositionShortLabelTest as t, ValueTest as r } from "./constants.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { NoValue as i } from "./no-value.js";
|
|
3
|
+
import { PnlValue as p } from "./pnl-value.js";
|
|
4
|
+
import { PointsValue as u } from "./points-value.js";
|
|
5
|
+
import { PositionShortLabel as V } from "./position-short-label.js";
|
|
5
6
|
import { PositionStatusBadge as n } from "./position-status-badge.js";
|
|
6
|
-
import { PositionTypeBadge as
|
|
7
|
-
import { PriceImpactValue as
|
|
8
|
-
import { ApyValue as
|
|
7
|
+
import { PositionTypeBadge as P } from "./position-type-badge.js";
|
|
8
|
+
import { PriceImpactValue as g, priceImpact as T } from "./price-impact-value.js";
|
|
9
|
+
import { ApyValue as d, HealthFactorValue as h, LeverageValue as B, TokenBigint as L, UsdValue as S, UtilizationValue as y, bps as I } from "./scalars.js";
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
i as
|
|
14
|
-
p as
|
|
15
|
-
|
|
11
|
+
d as ApyValue,
|
|
12
|
+
h as HealthFactorValue,
|
|
13
|
+
B as LeverageValue,
|
|
14
|
+
i as NoValue,
|
|
15
|
+
p as PnlValue,
|
|
16
|
+
u as PointsValue,
|
|
17
|
+
V as PositionShortLabel,
|
|
16
18
|
t as PositionShortLabelTest,
|
|
17
19
|
n as PositionStatusBadge,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
P as PositionTypeBadge,
|
|
21
|
+
g as PriceImpactValue,
|
|
22
|
+
L as TokenBigint,
|
|
23
|
+
S as UsdValue,
|
|
24
|
+
y as UtilizationValue,
|
|
23
25
|
r as ValueTest,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
I as bps,
|
|
27
|
+
T as priceImpact
|
|
26
28
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { HelpTip as o } from "../../help-tip/help-tip.js";
|
|
3
|
+
import { useIntlTyped as i } from "../../typed-intl/index.js";
|
|
4
|
+
import { ValueTest as n } from "./constants.js";
|
|
5
|
+
const c = "—";
|
|
6
|
+
function u({ reason: r }) {
|
|
7
|
+
const t = i();
|
|
8
|
+
if (r === void 0)
|
|
9
|
+
return /* @__PURE__ */ e(
|
|
10
|
+
"span",
|
|
11
|
+
{
|
|
12
|
+
className: "text-secondary-foreground",
|
|
13
|
+
"data-testid": n.placeholder,
|
|
14
|
+
children: c
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
const s = t.formatMessage({
|
|
18
|
+
messageId: "components.value.accruing"
|
|
19
|
+
});
|
|
20
|
+
return /* @__PURE__ */ a(
|
|
21
|
+
"span",
|
|
22
|
+
{
|
|
23
|
+
className: "inline-flex items-center leading-[0]",
|
|
24
|
+
"data-testid": n.accruing,
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ e(o, { iconSize: 18, children: s }),
|
|
27
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: s })
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
u as NoValue
|
|
34
|
+
};
|
|
@@ -5,23 +5,24 @@ import { cn as i } from "../../../utils/cn.js";
|
|
|
5
5
|
import "sonner";
|
|
6
6
|
import "luxon";
|
|
7
7
|
import "../../../utils/z-index.js";
|
|
8
|
-
import { ValueTest as
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import { ValueTest as s } from "./constants.js";
|
|
9
|
+
import { NoValue as m } from "./no-value.js";
|
|
10
|
+
function V({
|
|
11
|
+
data: o
|
|
11
12
|
}) {
|
|
12
|
-
const t = typeof
|
|
13
|
+
const t = typeof o == "number" ? o : o?.total.valueUsd ?? null;
|
|
13
14
|
if (t === null)
|
|
14
|
-
return /* @__PURE__ */ r(
|
|
15
|
-
const
|
|
15
|
+
return /* @__PURE__ */ r(m, {});
|
|
16
|
+
const e = t > 0 ? "+" : t < 0 ? "−" : "";
|
|
16
17
|
return /* @__PURE__ */ r(
|
|
17
18
|
"span",
|
|
18
19
|
{
|
|
19
|
-
"data-testid":
|
|
20
|
+
"data-testid": s.pnl,
|
|
20
21
|
className: i(t > 0 && "text-success", t < 0 && "text-destructive"),
|
|
21
|
-
children: `${
|
|
22
|
+
children: `${e}$${Math.abs(t).toFixed(2)}`
|
|
22
23
|
}
|
|
23
24
|
);
|
|
24
25
|
}
|
|
25
26
|
export {
|
|
26
|
-
|
|
27
|
+
V as PnlValue
|
|
27
28
|
};
|
|
@@ -8,15 +8,16 @@ import { formatPercentAmount as o } from "../../../utils/format-money.js";
|
|
|
8
8
|
import "luxon";
|
|
9
9
|
import "../../../utils/z-index.js";
|
|
10
10
|
import { ValueTest as i } from "./constants.js";
|
|
11
|
-
|
|
11
|
+
import { NoValue as m } from "./no-value.js";
|
|
12
|
+
function p(r) {
|
|
12
13
|
return `${r > 0n ? "+" : ""}${o(Number(r) / 1e4, 2)}%`;
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
+
function x({
|
|
15
16
|
data: r
|
|
16
17
|
}) {
|
|
17
|
-
return r === void 0 ? /* @__PURE__ */ t(
|
|
18
|
+
return r === void 0 ? /* @__PURE__ */ t(m, {}) : /* @__PURE__ */ t("span", { "data-testid": i.priceImpact, children: p(r) });
|
|
18
19
|
}
|
|
19
20
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
x as PriceImpactValue,
|
|
22
|
+
p as priceImpact
|
|
22
23
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { formatUnits as
|
|
1
|
+
import { jsx as r, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { formatUnits as l } from "viem";
|
|
3
3
|
import { CompoundAPY as p } from "../../compound-apy/compound-apy.js";
|
|
4
4
|
import { SimpleTooltip as a } from "../../tooltip/simple-tooltip.js";
|
|
5
5
|
import "../../tooltip/tooltip.js";
|
|
@@ -7,42 +7,39 @@ import "react";
|
|
|
7
7
|
import "@gearbox-protocol/sdk/onchain";
|
|
8
8
|
import { cn as c } from "../../../utils/cn.js";
|
|
9
9
|
import "sonner";
|
|
10
|
-
import { formatAssetAmount as
|
|
11
|
-
import { formatLeverage as
|
|
10
|
+
import { formatAssetAmount as f } from "../../../utils/format-asset-amount.js";
|
|
11
|
+
import { formatLeverage as d } from "../../../utils/format-leverage.js";
|
|
12
12
|
import { formatPercentAmount as h, formatMoney as v } from "../../../utils/format-money.js";
|
|
13
13
|
import "luxon";
|
|
14
14
|
import "../../../utils/z-index.js";
|
|
15
15
|
import { ValueTest as i } from "./constants.js";
|
|
16
|
-
|
|
17
|
-
function n() {
|
|
18
|
-
return /* @__PURE__ */ r("span", { "data-testid": i.placeholder, children: x });
|
|
19
|
-
}
|
|
16
|
+
import { NoValue as n } from "./no-value.js";
|
|
20
17
|
function s(t) {
|
|
21
18
|
return `${h(t / 100, 2)}%`;
|
|
22
19
|
}
|
|
23
|
-
function
|
|
20
|
+
function w({
|
|
24
21
|
data: t,
|
|
25
22
|
tooltip: e = !0,
|
|
26
23
|
period: o
|
|
27
24
|
}) {
|
|
28
|
-
return t === void 0 ? /* @__PURE__ */ r(n, {}) : typeof t == "number" ? /* @__PURE__ */ r("span", { "data-testid": i.apy, children: s(t) }) : /* @__PURE__ */ r("span", { "data-testid": i.apy, children: /* @__PURE__ */ r(p, { apy: t, tooltip: e, period: o }) });
|
|
25
|
+
return t === void 0 ? /* @__PURE__ */ r(n, { reason: o }) : typeof t == "number" ? /* @__PURE__ */ r("span", { "data-testid": i.apy, children: s(t) }) : /* @__PURE__ */ r("span", { "data-testid": i.apy, children: /* @__PURE__ */ r(p, { apy: t, tooltip: e, period: o }) });
|
|
29
26
|
}
|
|
30
|
-
function
|
|
27
|
+
function C({
|
|
31
28
|
data: t
|
|
32
29
|
}) {
|
|
33
30
|
return t == null ? /* @__PURE__ */ r(n, {}) : /* @__PURE__ */ r("span", { "data-testid": i.usd, children: v(t) });
|
|
34
31
|
}
|
|
35
|
-
function
|
|
32
|
+
function H({
|
|
36
33
|
data: t
|
|
37
34
|
}) {
|
|
38
|
-
return t === void 0 ? /* @__PURE__ */ r(n, {}) : /* @__PURE__ */ r("span", { "data-testid": i.leverage, children: `${
|
|
35
|
+
return t === void 0 ? /* @__PURE__ */ r(n, {}) : /* @__PURE__ */ r("span", { "data-testid": i.leverage, children: `${d(t)}x` });
|
|
39
36
|
}
|
|
40
|
-
function
|
|
37
|
+
function M({
|
|
41
38
|
data: t
|
|
42
39
|
}) {
|
|
43
40
|
return t === void 0 ? /* @__PURE__ */ r(n, {}) : /* @__PURE__ */ r("span", { "data-testid": i.utilization, children: s(t) });
|
|
44
41
|
}
|
|
45
|
-
function
|
|
42
|
+
function S({
|
|
46
43
|
data: t
|
|
47
44
|
}) {
|
|
48
45
|
if (t === void 0)
|
|
@@ -50,26 +47,26 @@ function D({
|
|
|
50
47
|
const e = t < 1e4 ? "text-destructive" : t < 11e3 ? "text-warning" : "text-success";
|
|
51
48
|
return /* @__PURE__ */ r("span", { "data-testid": i.healthFactor, className: c(e), children: (t / 1e4).toFixed(2) });
|
|
52
49
|
}
|
|
53
|
-
function
|
|
50
|
+
function Y({
|
|
54
51
|
data: t,
|
|
55
52
|
token: e,
|
|
56
53
|
showSymbol: o = !0
|
|
57
54
|
}) {
|
|
58
55
|
if (t === void 0 || e === void 0)
|
|
59
56
|
return /* @__PURE__ */ r(n, {});
|
|
60
|
-
const
|
|
57
|
+
const m = l(t, e.decimals);
|
|
61
58
|
return (
|
|
62
59
|
// `title` also keeps the amount where a hover tooltip cannot reach:
|
|
63
60
|
// keyboard, touch, and the browser's own find — and keeps the symbol
|
|
64
61
|
// reachable there even when the row is the one printing it
|
|
65
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ u("span", { "data-testid": i.tokenBigint, title: `${m} ${e.symbol}`, children: [
|
|
66
63
|
/* @__PURE__ */ r(
|
|
67
64
|
a,
|
|
68
65
|
{
|
|
69
66
|
placement: "top",
|
|
70
67
|
className: "break-all",
|
|
71
|
-
title: /* @__PURE__ */ r("span", { children:
|
|
72
|
-
children: /* @__PURE__ */ r("span", { children:
|
|
68
|
+
title: /* @__PURE__ */ r("span", { children: f(t, e.decimals) }),
|
|
69
|
+
children: /* @__PURE__ */ r("span", { children: m })
|
|
73
70
|
}
|
|
74
71
|
),
|
|
75
72
|
o && ` ${e.symbol}`
|
|
@@ -77,11 +74,11 @@ function M({
|
|
|
77
74
|
);
|
|
78
75
|
}
|
|
79
76
|
export {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
w as ApyValue,
|
|
78
|
+
S as HealthFactorValue,
|
|
79
|
+
H as LeverageValue,
|
|
80
|
+
Y as TokenBigint,
|
|
81
|
+
C as UsdValue,
|
|
82
|
+
M as UtilizationValue,
|
|
86
83
|
s as bps
|
|
87
84
|
};
|
|
@@ -1,30 +1,38 @@
|
|
|
1
1
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
import "../buttons/button/button.js";
|
|
2
|
+
import { NoValue as G } from "../base/values/no-value.js";
|
|
4
3
|
import "react";
|
|
5
4
|
import "@gearbox-protocol/sdk/onchain";
|
|
6
|
-
import { cn as
|
|
5
|
+
import { cn as s } from "../../utils/cn.js";
|
|
7
6
|
import "sonner";
|
|
8
7
|
import "luxon";
|
|
9
8
|
import "../../utils/z-index.js";
|
|
9
|
+
import "../points-icon/points-icon.js";
|
|
10
|
+
import "viem";
|
|
11
|
+
import "../token-icon/token-icon.js";
|
|
12
|
+
import "react-intl";
|
|
13
|
+
import "../tooltip/simple-tooltip.js";
|
|
14
|
+
import "../tooltip/tooltip.js";
|
|
15
|
+
import "../badge/badge.js";
|
|
16
|
+
import "../badge/chip.js";
|
|
17
|
+
import "../buttons/button/button.js";
|
|
10
18
|
import { GridTableRow as h, GridTableCell as u } from "../table/grid-table.js";
|
|
11
19
|
import "../skeleton/skeleton.js";
|
|
12
20
|
import "../table/table.js";
|
|
13
|
-
import { Typography as
|
|
14
|
-
import { useIsMedium as
|
|
15
|
-
import { BaseTableLineTest as
|
|
16
|
-
const
|
|
21
|
+
import { Typography as k } from "../typography/typography.js";
|
|
22
|
+
import { useIsMedium as z, useIsMobile as D } from "../../hooks/use-media-query.js";
|
|
23
|
+
import { BaseTableLineTest as O } from "./constants.js";
|
|
24
|
+
const P = "min-w-0 max-w-full overflow-hidden", S = s(
|
|
17
25
|
"min-w-0 max-w-full self-stretch items-center overflow-x-clip py-2 pl-4",
|
|
18
26
|
"[&_span.truncate]:whitespace-normal",
|
|
19
27
|
"[&_div.overflow-hidden]:overflow-visible"
|
|
20
|
-
),
|
|
28
|
+
), F = "min-w-0 max-w-full overflow-visible whitespace-nowrap";
|
|
21
29
|
function v({
|
|
22
30
|
label: t,
|
|
23
31
|
children: r
|
|
24
32
|
}) {
|
|
25
33
|
return /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
26
34
|
/* @__PURE__ */ i(
|
|
27
|
-
|
|
35
|
+
k,
|
|
28
36
|
{
|
|
29
37
|
as: "span",
|
|
30
38
|
variant: "caption",
|
|
@@ -36,62 +44,62 @@ function v({
|
|
|
36
44
|
/* @__PURE__ */ i("div", { className: "min-w-0 text-sm", children: r })
|
|
37
45
|
] });
|
|
38
46
|
}
|
|
39
|
-
function
|
|
47
|
+
function pe({
|
|
40
48
|
columns: t,
|
|
41
49
|
cells: r,
|
|
42
|
-
last:
|
|
43
|
-
href:
|
|
50
|
+
last: b,
|
|
51
|
+
href: x,
|
|
44
52
|
disabled: l = !1,
|
|
45
53
|
disabledStyle: g = !1,
|
|
46
54
|
accentClassName: C,
|
|
47
|
-
onRowClick:
|
|
55
|
+
onRowClick: m,
|
|
48
56
|
"data-testid": N,
|
|
49
57
|
minHeightClassName: L = "min-h-[66px]"
|
|
50
58
|
}) {
|
|
51
|
-
const _ =
|
|
59
|
+
const _ = z(), T = D(), n = t.filter((e) => e.mobile === "title"), p = n.length > 0 ? n : t.slice(0, 1), y = t.filter((e) => e.mobile === "badge"), B = new Set(p.map((e) => e.id)), d = t.filter(
|
|
52
60
|
(e) => !B.has(e.id) && (e.mobile ?? "stat") === "stat"
|
|
53
|
-
), j = t.filter((e) => e.mobile === "block"),
|
|
54
|
-
last:
|
|
55
|
-
href:
|
|
61
|
+
), j = t.filter((e) => e.mobile === "block"), f = {
|
|
62
|
+
last: b,
|
|
63
|
+
href: x,
|
|
56
64
|
noHover: l,
|
|
57
65
|
"data-disabled": l,
|
|
58
|
-
"data-testid": N ??
|
|
59
|
-
onRowClick: l ? void 0 :
|
|
60
|
-
},
|
|
61
|
-
|
|
66
|
+
"data-testid": N ?? O.root,
|
|
67
|
+
onRowClick: l ? void 0 : m
|
|
68
|
+
}, c = s(
|
|
69
|
+
m && !l && "cursor-pointer",
|
|
62
70
|
g && "text-secondary-foreground!",
|
|
63
71
|
l && "cursor-not-allowed",
|
|
64
72
|
C
|
|
65
73
|
);
|
|
66
|
-
return
|
|
74
|
+
return T ? /* @__PURE__ */ i(h, { ...f, className: c, children: /* @__PURE__ */ a(
|
|
67
75
|
u,
|
|
68
76
|
{
|
|
69
77
|
span: "full",
|
|
70
78
|
size: "sm",
|
|
71
|
-
className:
|
|
79
|
+
className: s(
|
|
72
80
|
"flex min-w-0 max-w-full flex-col items-start gap-3 overflow-x-clip py-3",
|
|
73
81
|
"[&_span.truncate]:whitespace-normal [&_div.overflow-hidden]:overflow-visible"
|
|
74
82
|
),
|
|
75
83
|
children: [
|
|
76
84
|
/* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [
|
|
77
|
-
|
|
78
|
-
|
|
85
|
+
p.map((e) => /* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: r[e.id] }, e.id)),
|
|
86
|
+
y.map((e) => /* @__PURE__ */ i("div", { children: r[e.id] }, e.id))
|
|
79
87
|
] }),
|
|
80
|
-
|
|
88
|
+
d.length > 0 && /* @__PURE__ */ i("div", { className: "grid w-full min-w-0 grid-cols-3 gap-x-2 gap-y-3 [&_*]:text-left [&_*]:justify-start", children: d.map((e) => /* @__PURE__ */ i(v, { label: e.title, children: r[e.id] }, e.id)) }),
|
|
81
89
|
j.map((e) => {
|
|
82
|
-
const
|
|
83
|
-
return
|
|
90
|
+
const o = r[e.id];
|
|
91
|
+
return o == null || o === !1 ? null : /* @__PURE__ */ i(v, { label: e.title, children: o }, e.id);
|
|
84
92
|
})
|
|
85
93
|
]
|
|
86
94
|
}
|
|
87
95
|
) }) : /* @__PURE__ */ i(
|
|
88
96
|
h,
|
|
89
97
|
{
|
|
90
|
-
...
|
|
91
|
-
className:
|
|
92
|
-
children: t.map((e,
|
|
93
|
-
const I = e.justify ?? "start", M =
|
|
94
|
-
M ?
|
|
98
|
+
...f,
|
|
99
|
+
className: s(L, c),
|
|
100
|
+
children: t.map((e, o) => {
|
|
101
|
+
const I = e.justify ?? "start", M = o === 0, w = o === t.length - 1, A = e.mobile === "badge", E = s(
|
|
102
|
+
M ? S : A ? F : P,
|
|
95
103
|
w && "pr-4",
|
|
96
104
|
e.cellClassName
|
|
97
105
|
);
|
|
@@ -102,7 +110,7 @@ function ie({
|
|
|
102
110
|
textAlign: I === "end" ? "right" : "left",
|
|
103
111
|
gapBefore: w ? _ ? "sm" : "md" : void 0,
|
|
104
112
|
className: E,
|
|
105
|
-
children: r[e.id] ?? /* @__PURE__ */ i(
|
|
113
|
+
children: r[e.id] ?? /* @__PURE__ */ i(G, {})
|
|
106
114
|
},
|
|
107
115
|
e.id
|
|
108
116
|
);
|
|
@@ -111,6 +119,6 @@ function ie({
|
|
|
111
119
|
);
|
|
112
120
|
}
|
|
113
121
|
export {
|
|
114
|
-
|
|
115
|
-
|
|
122
|
+
pe as BaseTableLine,
|
|
123
|
+
O as BaseTableLineTest
|
|
116
124
|
};
|
|
@@ -35,6 +35,7 @@ import "../token-symbol/token-symbol.js";
|
|
|
35
35
|
import "../simple-accordion/simple-accordion.js";
|
|
36
36
|
import "../tip-card/tip-card.js";
|
|
37
37
|
import "../typography/typography.js";
|
|
38
|
+
import "../help-tip/help-tip.js";
|
|
38
39
|
import "../points-icon/points-icon.js";
|
|
39
40
|
import "viem";
|
|
40
41
|
import "../vertical-indicator/vertical-indicator.js";
|
|
@@ -81,7 +82,6 @@ import "../link/link.js";
|
|
|
81
82
|
import "../rounded-image/rounded-image.js";
|
|
82
83
|
import "../network-icon/network-indicator.js";
|
|
83
84
|
import "../base-link/base-link.js";
|
|
84
|
-
import "../help-tip/help-tip.js";
|
|
85
85
|
import "../base-table/base-table-line.js";
|
|
86
86
|
import "../navigation-context/navigation-context.js";
|
|
87
87
|
import "../cards/card/card.js";
|
|
@@ -35,6 +35,7 @@ import "../../token-symbol/token-symbol.js";
|
|
|
35
35
|
import "../../simple-accordion/simple-accordion.js";
|
|
36
36
|
import "../../tip-card/tip-card.js";
|
|
37
37
|
import "../../typography/typography.js";
|
|
38
|
+
import "../../help-tip/help-tip.js";
|
|
38
39
|
import "../../points-icon/points-icon.js";
|
|
39
40
|
import "viem";
|
|
40
41
|
import "../../vertical-indicator/vertical-indicator.js";
|
|
@@ -82,7 +83,6 @@ import "../../link/link.js";
|
|
|
82
83
|
import { RoundedImage as d } from "../../rounded-image/rounded-image.js";
|
|
83
84
|
import "../../network-icon/network-indicator.js";
|
|
84
85
|
import "../../base-link/base-link.js";
|
|
85
|
-
import "../../help-tip/help-tip.js";
|
|
86
86
|
import "../../base-table/base-table-line.js";
|
|
87
87
|
import "../../navigation-context/navigation-context.js";
|
|
88
88
|
import "../../cards/card/card.js";
|