@gearbox-protocol/ui-kit 4.0.0-next.2 → 4.0.0-next.4
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/detailed-page-title/detailed-page-title.cjs +1 -1
- package/dist/cjs/components/base/health-factor-block/health-factor-block.cjs +1 -1
- package/dist/cjs/components/base/index.cjs +1 -1
- package/dist/cjs/components/base/info-list/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/liquidation-price-block/liquidation-price-block.cjs +1 -1
- package/dist/cjs/components/base/manage-pane/constants.cjs +1 -1
- package/dist/cjs/components/base/manage-pane/manage-pane.cjs +1 -1
- package/dist/cjs/components/base/page-title/index.cjs +1 -1
- package/dist/cjs/components/base/page-title/page-title.cjs +1 -1
- package/dist/cjs/components/base/stat-badge/stat-badge.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/points-value.cjs +1 -0
- package/dist/cjs/components/base/values/scalars.cjs +1 -1
- 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/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.cjs +1 -1
- package/dist/cjs/components/graph/graph-view.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/utils/format-leverage.cjs +1 -0
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +31 -25
- package/dist/esm/components/base/detailed-page-title/detailed-page-title.js +26 -27
- package/dist/esm/components/base/health-factor-block/health-factor-block.js +25 -25
- package/dist/esm/components/base/index.js +141 -136
- package/dist/esm/components/base/info-list/index.js +5 -4
- package/dist/esm/components/base/info-list/info-list.js +52 -27
- package/dist/esm/components/base/leverage-input/leverage-input.js +17 -19
- package/dist/esm/components/base/liquidation-price-block/liquidation-price-block.js +33 -28
- package/dist/esm/components/base/manage-pane/constants.js +3 -2
- package/dist/esm/components/base/manage-pane/manage-pane.js +154 -113
- package/dist/esm/components/base/page-title/index.js +5 -4
- package/dist/esm/components/base/page-title/page-title.js +31 -23
- package/dist/esm/components/base/stat-badge/stat-badge.js +18 -9
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +3 -2
- package/dist/esm/components/base/time-to-liquidation-block/time-to-liquidation-block.js +31 -31
- package/dist/esm/components/base/token-amount/token-amount.js +17 -16
- package/dist/esm/components/base/values/constants.js +1 -0
- package/dist/esm/components/base/values/index.js +16 -13
- package/dist/esm/components/base/values/points-value.js +30 -0
- package/dist/esm/components/base/values/scalars.js +29 -27
- package/dist/esm/components/block-sync-pill/block-sync-pill.js +17 -16
- package/dist/esm/components/checkbox/checkbox-labeled.js +15 -14
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +15 -14
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +17 -15
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.js +24 -23
- package/dist/esm/components/graph/graph-view.js +78 -95
- package/dist/esm/components/index.js +665 -660
- package/dist/esm/components/with-copy/with-copy.js +17 -16
- package/dist/esm/index.js +843 -836
- package/dist/esm/utils/format-leverage.js +6 -0
- package/dist/esm/utils/index.js +80 -78
- package/dist/globals.css +1 -1
- package/dist/types/components/base/borrow-rate-block/borrow-rate-block.d.ts +10 -5
- package/dist/types/components/base/detailed-page-title/detailed-page-title.d.ts +1 -3
- package/dist/types/components/base/health-factor-block/health-factor-block.d.ts +6 -6
- package/dist/types/components/base/info-list/info-list.d.ts +7 -0
- package/dist/types/components/base/liquidation-price-block/liquidation-price-block.d.ts +6 -4
- package/dist/types/components/base/manage-pane/constants.d.ts +1 -0
- package/dist/types/components/base/manage-pane/manage-pane.d.ts +3 -1
- package/dist/types/components/base/page-title/page-title.d.ts +12 -6
- package/dist/types/components/base/time-to-liquidation-block/time-to-liquidation-block.d.ts +5 -6
- package/dist/types/components/base/token-amount/token-amount.d.ts +8 -2
- package/dist/types/components/base/values/constants.d.ts +1 -0
- package/dist/types/components/base/values/index.d.ts +2 -1
- package/dist/types/components/base/values/points-value.d.ts +11 -0
- package/dist/types/components/base/values/position-short-label.d.ts +1 -1
- package/dist/types/components/base/values/scalars.d.ts +9 -0
- package/dist/types/components/composites/pool-assets-table/pool-assets-table-row.d.ts +1 -1
- package/dist/types/utils/format-leverage.d.ts +5 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,43 +1,61 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Stack as
|
|
3
|
-
import { useTitleText as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Stack as c } from "../stack/stack.js";
|
|
3
|
+
import { useTitleText as n } from "../text/use-title-text.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { pointProgramsOf as f } from "../../../utils/apy-breakdown.js";
|
|
6
|
+
import "@gearbox-protocol/sdk";
|
|
7
|
+
import "clsx";
|
|
8
|
+
import "tailwind-merge";
|
|
9
|
+
import "sonner";
|
|
10
|
+
import "@gearbox-protocol/sdk/common-utils";
|
|
11
|
+
import "luxon";
|
|
12
|
+
import "../../../utils/z-index.js";
|
|
13
|
+
import { PointsValue as l } from "../values/points-value.js";
|
|
14
|
+
import "../../points-icon/points-icon.js";
|
|
15
|
+
import "../../token-icon/token-icon.js";
|
|
16
|
+
import "@fortawesome/free-solid-svg-icons";
|
|
17
|
+
import "../../icons/fa-icon.js";
|
|
18
|
+
import "../../tooltip/simple-tooltip.js";
|
|
19
|
+
import "../../tooltip/tooltip.js";
|
|
20
|
+
import "react-intl";
|
|
21
|
+
import "../../badge/badge.js";
|
|
22
|
+
import { Typography as u } from "../../typography/typography.js";
|
|
23
|
+
import { VerticalIndicator as d } from "../../vertical-indicator/vertical-indicator.js";
|
|
6
24
|
import { InfoListTest as i } from "./constants.js";
|
|
7
|
-
function
|
|
25
|
+
function G({
|
|
8
26
|
children: t
|
|
9
27
|
}) {
|
|
10
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ r(c, { gap: "sm", "data-testid": i.root, children: t });
|
|
11
29
|
}
|
|
12
|
-
function
|
|
30
|
+
function g({
|
|
13
31
|
title: t,
|
|
14
32
|
value: o,
|
|
15
|
-
tip:
|
|
16
|
-
valueDescription:
|
|
17
|
-
valueTo:
|
|
18
|
-
testId:
|
|
33
|
+
tip: e,
|
|
34
|
+
valueDescription: m,
|
|
35
|
+
valueTo: p,
|
|
36
|
+
testId: s
|
|
19
37
|
}) {
|
|
20
|
-
const
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
|
|
38
|
+
const a = n();
|
|
39
|
+
return /* @__PURE__ */ r(
|
|
40
|
+
d,
|
|
23
41
|
{
|
|
24
|
-
label:
|
|
25
|
-
tip:
|
|
42
|
+
label: a(t),
|
|
43
|
+
tip: e,
|
|
26
44
|
value: o,
|
|
27
|
-
valueTo:
|
|
28
|
-
valueDescription:
|
|
45
|
+
valueTo: p,
|
|
46
|
+
valueDescription: m,
|
|
29
47
|
size: "sm",
|
|
30
48
|
align: "center",
|
|
31
|
-
"data-testid":
|
|
49
|
+
"data-testid": s ?? i.line
|
|
32
50
|
}
|
|
33
51
|
);
|
|
34
52
|
}
|
|
35
|
-
function
|
|
53
|
+
function H({
|
|
36
54
|
title: t
|
|
37
55
|
}) {
|
|
38
|
-
const o =
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
|
|
56
|
+
const o = n();
|
|
57
|
+
return /* @__PURE__ */ r(
|
|
58
|
+
u,
|
|
41
59
|
{
|
|
42
60
|
as: "span",
|
|
43
61
|
color: "secondary",
|
|
@@ -49,9 +67,16 @@ function L({
|
|
|
49
67
|
}
|
|
50
68
|
);
|
|
51
69
|
}
|
|
70
|
+
function J({
|
|
71
|
+
data: t,
|
|
72
|
+
title: o = "components.yieldBreakdown.points"
|
|
73
|
+
}) {
|
|
74
|
+
return !t || f(t).length === 0 ? null : /* @__PURE__ */ r(g, { title: o, value: /* @__PURE__ */ r(l, { data: t }) });
|
|
75
|
+
}
|
|
52
76
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
77
|
+
g as InfoLine,
|
|
78
|
+
G as InfoList,
|
|
55
79
|
i as InfoListTest,
|
|
56
|
-
|
|
80
|
+
H as InfoSectionTitle,
|
|
81
|
+
J as PointsInfoLine
|
|
57
82
|
};
|
|
@@ -2,20 +2,21 @@ import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as I } from "react";
|
|
3
3
|
import { Stack as x } from "../stack/stack.js";
|
|
4
4
|
import { useTitleText as y } from "../text/use-title-text.js";
|
|
5
|
-
import { EditInput as
|
|
6
|
-
import { Slider as
|
|
5
|
+
import { EditInput as j } from "../../edit-input/edit-input.js";
|
|
6
|
+
import { Slider as F } from "../../slider/slider.js";
|
|
7
7
|
import "../../slider/slider-context.js";
|
|
8
8
|
import { TextButton as O } from "../../text-button/text-button.js";
|
|
9
9
|
import { SimpleTooltip as R } from "../../tooltip/simple-tooltip.js";
|
|
10
10
|
import "../../tooltip/tooltip.js";
|
|
11
11
|
import { useIntlTyped as B, FormattedMessageTyped as T } from "../../typed-intl/index.js";
|
|
12
12
|
import { WithTitle as D } from "../../with-title/with-title.js";
|
|
13
|
+
import { formatLeverage as b } from "../../../utils/format-leverage.js";
|
|
13
14
|
import { LeverageInputTest as i } from "./constants.js";
|
|
14
15
|
const o = 100, P = 10;
|
|
15
|
-
function
|
|
16
|
-
value:
|
|
16
|
+
function ee({
|
|
17
|
+
value: n,
|
|
17
18
|
onChange: s,
|
|
18
|
-
max:
|
|
19
|
+
max: r,
|
|
19
20
|
min: l = 1,
|
|
20
21
|
title: c,
|
|
21
22
|
hint: d,
|
|
@@ -25,11 +26,11 @@ function Z({
|
|
|
25
26
|
size: S = "sm"
|
|
26
27
|
}) {
|
|
27
28
|
const E = B(), C = y(), p = w ?? [
|
|
28
|
-
{ start: l, end:
|
|
29
|
+
{ start: l, end: r, color: "additionalSuccess" }
|
|
29
30
|
], L = N ?? (p.length > 0 ? E.formatMessage({
|
|
30
31
|
messageId: "components.leverageInput.available"
|
|
31
|
-
}) : void 0), [M, u] = I(void 0), [f, g] = I(""), h = M ??
|
|
32
|
-
s(_(e, l,
|
|
32
|
+
}) : void 0), [M, u] = I(void 0), [f, g] = I(""), h = M ?? n, v = (e) => {
|
|
33
|
+
s(_(e, l, r)), u(void 0);
|
|
33
34
|
}, k = () => {
|
|
34
35
|
const e = Number.parseFloat(f.replace(",", "."));
|
|
35
36
|
Number.isFinite(e) && v(e);
|
|
@@ -49,7 +50,7 @@ function Z({
|
|
|
49
50
|
] }),
|
|
50
51
|
/* @__PURE__ */ m(x, { direction: "row", align: "center", gap: "sm", children: [
|
|
51
52
|
/* @__PURE__ */ t("div", { className: "flex w-[90px] flex-row flex-nowrap items-center", children: /* @__PURE__ */ t(
|
|
52
|
-
|
|
53
|
+
j,
|
|
53
54
|
{
|
|
54
55
|
value: f,
|
|
55
56
|
placeholder: "0",
|
|
@@ -59,7 +60,7 @@ function Z({
|
|
|
59
60
|
},
|
|
60
61
|
"data-testid": i.value,
|
|
61
62
|
onEditModeChange: (e) => {
|
|
62
|
-
e && g(b(
|
|
63
|
+
e && g(b(n));
|
|
63
64
|
},
|
|
64
65
|
onChange: (e) => g(e.target.value),
|
|
65
66
|
onSubmit: k
|
|
@@ -88,15 +89,15 @@ function Z({
|
|
|
88
89
|
] })
|
|
89
90
|
] }),
|
|
90
91
|
children: /* @__PURE__ */ t(
|
|
91
|
-
|
|
92
|
+
F,
|
|
92
93
|
{
|
|
93
94
|
from: l * o,
|
|
94
|
-
to:
|
|
95
|
+
to: r * o,
|
|
95
96
|
precision: o,
|
|
96
97
|
value: h * o,
|
|
97
98
|
colorIntervals: V,
|
|
98
99
|
colorIntervalLabel: L,
|
|
99
|
-
markerStep:
|
|
100
|
+
markerStep: r > P ? 200 : 100,
|
|
100
101
|
"data-testid": i.slider,
|
|
101
102
|
onChangeValue: (e) => u(e / o),
|
|
102
103
|
onSubmitValue: (e) => v(e / o)
|
|
@@ -105,13 +106,10 @@ function Z({
|
|
|
105
106
|
}
|
|
106
107
|
) });
|
|
107
108
|
}
|
|
108
|
-
function _(
|
|
109
|
-
return Math.min(Math.max(
|
|
110
|
-
}
|
|
111
|
-
function b(r) {
|
|
112
|
-
return (Math.round(r * 100) / 100).toFixed(2);
|
|
109
|
+
function _(n, s, r) {
|
|
110
|
+
return Math.min(Math.max(n, s), r);
|
|
113
111
|
}
|
|
114
112
|
export {
|
|
115
|
-
|
|
113
|
+
ee as LeverageInput,
|
|
116
114
|
i as LeverageInputTest
|
|
117
115
|
};
|
|
@@ -1,40 +1,45 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useTitleText as
|
|
3
|
-
import { FadeoutLoading as
|
|
4
|
-
import { FormattedNumberString as
|
|
5
|
-
import { HealthDot as
|
|
6
|
-
import { FormattedMessageTyped as
|
|
1
|
+
import { jsx as i, jsxs as P } from "react/jsx-runtime";
|
|
2
|
+
import { useTitleText as b } from "../text/use-title-text.js";
|
|
3
|
+
import { FadeoutLoading as s } from "../../fadeout-loading/fadeout-loading.js";
|
|
4
|
+
import { FormattedNumberString as T } from "../../formatted-number/formatted-number.js";
|
|
5
|
+
import { HealthDot as g } from "../../status-elements/status-elements.js";
|
|
6
|
+
import { FormattedMessageTyped as d } from "../../typed-intl/index.js";
|
|
7
7
|
import { VerticalIndicator as h } from "../../vertical-indicator/vertical-indicator.js";
|
|
8
8
|
import { bnToLiquidationPriceView as x } from "../../../utils/parse-input-to-bn.js";
|
|
9
9
|
import { LiquidationPriceBlockTest as r } from "./constants.js";
|
|
10
|
-
function
|
|
11
|
-
|
|
10
|
+
function q(e, o) {
|
|
11
|
+
if (!(!e || !o))
|
|
12
|
+
return `${e.symbol} / ${o.symbol}`;
|
|
13
|
+
}
|
|
14
|
+
function D({
|
|
15
|
+
price: e,
|
|
12
16
|
priceTo: o,
|
|
13
|
-
|
|
17
|
+
collateral: t,
|
|
18
|
+
underlying: u,
|
|
14
19
|
zone: l,
|
|
15
|
-
isLoading:
|
|
16
|
-
title:
|
|
17
|
-
tip:
|
|
18
|
-
testId:
|
|
20
|
+
isLoading: n,
|
|
21
|
+
title: a,
|
|
22
|
+
tip: p,
|
|
23
|
+
testId: f
|
|
19
24
|
}) {
|
|
20
|
-
const
|
|
21
|
-
return /* @__PURE__ */
|
|
25
|
+
const v = b(), m = o !== void 0;
|
|
26
|
+
return /* @__PURE__ */ i(
|
|
22
27
|
h,
|
|
23
28
|
{
|
|
24
29
|
align: "center",
|
|
25
30
|
dimPreviousValue: !1,
|
|
26
|
-
"data-testid":
|
|
27
|
-
label:
|
|
28
|
-
tip:
|
|
29
|
-
value: /* @__PURE__ */
|
|
31
|
+
"data-testid": f ?? r.root,
|
|
32
|
+
label: a !== void 0 ? v(a) : /* @__PURE__ */ i(d, { messageId: "components.liquidationPriceBlock.label" }),
|
|
33
|
+
tip: p ?? /* @__PURE__ */ i(d, { messageId: "components.liquidationPriceBlock.tip" }),
|
|
34
|
+
value: /* @__PURE__ */ i(s, { loading: n, children: /* @__PURE__ */ i(
|
|
30
35
|
c,
|
|
31
36
|
{
|
|
32
|
-
price:
|
|
33
|
-
zone:
|
|
37
|
+
price: e,
|
|
38
|
+
zone: m ? void 0 : l,
|
|
34
39
|
testId: r.value
|
|
35
40
|
}
|
|
36
41
|
) }),
|
|
37
|
-
valueTo:
|
|
42
|
+
valueTo: m ? /* @__PURE__ */ i(s, { loading: n, children: /* @__PURE__ */ i(
|
|
38
43
|
c,
|
|
39
44
|
{
|
|
40
45
|
price: o ?? null,
|
|
@@ -42,21 +47,21 @@ function j({
|
|
|
42
47
|
testId: r.valueTo
|
|
43
48
|
}
|
|
44
49
|
) }) : void 0,
|
|
45
|
-
valueDescription: t
|
|
50
|
+
valueDescription: q(t, u)
|
|
46
51
|
}
|
|
47
52
|
);
|
|
48
53
|
}
|
|
49
54
|
function c({
|
|
50
|
-
price:
|
|
55
|
+
price: e,
|
|
51
56
|
zone: o,
|
|
52
57
|
testId: t
|
|
53
58
|
}) {
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
|
|
56
|
-
o ? /* @__PURE__ */
|
|
59
|
+
return /* @__PURE__ */ P("span", { className: "inline-flex items-center", "data-testid": t, children: [
|
|
60
|
+
e === void 0 ? "—" : e === null || e === 0n ? "N/A" : /* @__PURE__ */ i(T, { value: x(e) }),
|
|
61
|
+
o ? /* @__PURE__ */ i("span", { className: "ml-1.5", children: /* @__PURE__ */ i(g, { zone: o }) }) : null
|
|
57
62
|
] });
|
|
58
63
|
}
|
|
59
64
|
export {
|
|
60
|
-
|
|
65
|
+
D as LiquidationPriceBlock,
|
|
61
66
|
r as LiquidationPriceBlockTest
|
|
62
67
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
class
|
|
1
|
+
class e {
|
|
2
2
|
static root = "manage-pane-root";
|
|
3
3
|
static tabs = "manage-pane-tabs";
|
|
4
4
|
static dropdown = "manage-pane-dropdown";
|
|
5
5
|
static body = "manage-pane-body";
|
|
6
6
|
static message = "manage-pane-message";
|
|
7
|
+
static actionDialog = "manage-pane-action-dialog";
|
|
7
8
|
static tab = (a) => `manage-pane-tab-${a}`;
|
|
8
9
|
}
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
+
e as ManagePaneTest
|
|
11
12
|
};
|
|
@@ -1,140 +1,181 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { faEllipsis as
|
|
3
|
-
import { Children as
|
|
4
|
-
import { InfoPortalProvider as
|
|
5
|
-
import { SegmentedTabs as
|
|
6
|
-
import { Stack as
|
|
7
|
-
import { useTitleText as
|
|
8
|
-
import { Button as
|
|
9
|
-
import { StyledDialogContainer as
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
1
|
+
import { jsxs as r, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { faEllipsis as x } from "@fortawesome/free-solid-svg-icons";
|
|
3
|
+
import { useState as E, Children as N, isValidElement as f } from "react";
|
|
4
|
+
import { InfoPortalProvider as v, InfoPortalOut as O } from "../info-portal/info-portal.js";
|
|
5
|
+
import { SegmentedTabs as k, SEGMENTED_TABS_INACTIVE_BUTTON_CLASS as B } from "../segmented-tabs/segmented-tabs.js";
|
|
6
|
+
import { Stack as e } from "../stack/stack.js";
|
|
7
|
+
import { useTitleText as j } from "../text/use-title-text.js";
|
|
8
|
+
import { Button as z } from "../../buttons/button/button.js";
|
|
9
|
+
import { StyledDialogContainer as V } from "../../client-adapters/styled-dialog-container/styled-dialog-container.js";
|
|
10
|
+
import { ConfirmMenu as F } from "../../confirm-menu/confirm-menu.js";
|
|
11
|
+
import "../../modal/modal.js";
|
|
12
|
+
import "@radix-ui/react-dialog";
|
|
13
|
+
import "../../dialog/dialog-container.js";
|
|
14
|
+
import "../../dialog/dialog-content.js";
|
|
15
|
+
import "../../dialog/dialog-description.js";
|
|
16
|
+
import "../../dialog/dialog-footer.js";
|
|
17
|
+
import "@gearbox-protocol/sdk";
|
|
18
|
+
import "clsx";
|
|
19
|
+
import "tailwind-merge";
|
|
20
|
+
import "sonner";
|
|
21
|
+
import "@gearbox-protocol/sdk/common-utils";
|
|
22
|
+
import "luxon";
|
|
23
|
+
import "../../../utils/z-index.js";
|
|
24
|
+
import "../../dialog/dialog-header.js";
|
|
25
|
+
import "../../dialog/dialog-title.js";
|
|
26
|
+
import { DialogModalContainer as G } from "../../dialog/dialog-modal-container.js";
|
|
27
|
+
import "../../dialog/dialog-overlay.js";
|
|
28
|
+
import "viem";
|
|
29
|
+
import "../../input/input.js";
|
|
30
|
+
import "../../label/label.js";
|
|
31
|
+
import { FaIcon as L } from "../../icons/fa-icon.js";
|
|
32
|
+
import { SimpleDropdown as U } from "../../simple-dropdown/simple-dropdown.js";
|
|
33
|
+
import { SimpleDropdownMenuItem as q } from "../../simple-dropdown/simple-dropdown-menu-item.js";
|
|
34
|
+
import { ManagePaneTest as i } from "./constants.js";
|
|
35
|
+
function H(o) {
|
|
15
36
|
return null;
|
|
16
37
|
}
|
|
17
|
-
function
|
|
38
|
+
function J(o) {
|
|
18
39
|
return null;
|
|
19
40
|
}
|
|
20
|
-
function
|
|
41
|
+
function K(o) {
|
|
21
42
|
return null;
|
|
22
43
|
}
|
|
23
|
-
function
|
|
24
|
-
return
|
|
44
|
+
function Q(o) {
|
|
45
|
+
return f(o) && o.type === H;
|
|
25
46
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
47
|
+
function R(o) {
|
|
48
|
+
return f(o) && o.type === J;
|
|
28
49
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
50
|
+
function W(o) {
|
|
51
|
+
return f(o) && o.type === K;
|
|
31
52
|
}
|
|
32
|
-
function
|
|
33
|
-
children:
|
|
34
|
-
activeTab:
|
|
35
|
-
onTabChange:
|
|
36
|
-
header:
|
|
37
|
-
footer:
|
|
38
|
-
actions:
|
|
39
|
-
testId:
|
|
53
|
+
function Et({
|
|
54
|
+
children: o,
|
|
55
|
+
activeTab: g,
|
|
56
|
+
onTabChange: M,
|
|
57
|
+
header: I,
|
|
58
|
+
footer: S,
|
|
59
|
+
actions: l,
|
|
60
|
+
testId: C
|
|
40
61
|
}) {
|
|
41
|
-
const
|
|
42
|
-
...
|
|
62
|
+
const d = j(), [P, h] = E(null), m = N.toArray(o), T = m.filter(Q), w = m.find(R), p = m.filter(W), A = T.filter((t) => !t.props.hidden), D = T.find((t) => t.props.id === g)?.props.children, a = w?.props.items ?? [], y = new Set(p.map((t) => t.props.id)), c = p.find((t) => t.props.id === P), b = () => h(null), u = [
|
|
63
|
+
...A.map((t) => ({
|
|
43
64
|
id: t.props.id,
|
|
44
|
-
item:
|
|
65
|
+
item: d(t.props.title),
|
|
45
66
|
disabled: t.props.disabled,
|
|
46
|
-
testId:
|
|
67
|
+
testId: i.tab(t.props.id)
|
|
47
68
|
})),
|
|
48
|
-
...
|
|
69
|
+
...p.map((t) => ({
|
|
49
70
|
id: t.props.id,
|
|
50
|
-
item:
|
|
51
|
-
testId:
|
|
71
|
+
item: d(t.props.title),
|
|
72
|
+
testId: i.tab(t.props.id)
|
|
52
73
|
}))
|
|
53
74
|
];
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
r
|
|
75
|
+
return /* @__PURE__ */ r(v, { children: [
|
|
76
|
+
/* @__PURE__ */ r(e, { gap: "md", "data-testid": C ?? i.root, children: [
|
|
77
|
+
I,
|
|
78
|
+
u.length > 0 || a.length > 0 || l ? /* @__PURE__ */ r(e, { direction: "row", align: "center", gap: "sm", children: [
|
|
79
|
+
u.length > 0 ? /* @__PURE__ */ n(
|
|
80
|
+
k,
|
|
81
|
+
{
|
|
82
|
+
items: u,
|
|
83
|
+
activeTab: g,
|
|
84
|
+
onTabChange: (t) => {
|
|
85
|
+
const s = p.find((_) => _.props.id === t);
|
|
86
|
+
if (s) {
|
|
87
|
+
s.props.children != null && h(s.props.id), s.props.onClick?.();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
y.has(t) || M(t);
|
|
91
|
+
},
|
|
92
|
+
testId: i.tabs
|
|
93
|
+
}
|
|
94
|
+
) : null,
|
|
95
|
+
a.length > 0 || l ? /* @__PURE__ */ r(
|
|
96
|
+
e,
|
|
97
|
+
{
|
|
98
|
+
direction: "row",
|
|
99
|
+
align: "center",
|
|
100
|
+
gap: "sm",
|
|
101
|
+
className: "ml-auto",
|
|
102
|
+
children: [
|
|
103
|
+
a.length > 0 ? /* @__PURE__ */ n(
|
|
104
|
+
U,
|
|
105
|
+
{
|
|
106
|
+
title: /* @__PURE__ */ n(
|
|
107
|
+
z,
|
|
108
|
+
{
|
|
109
|
+
type: "button",
|
|
110
|
+
variant: "ghost",
|
|
111
|
+
size: "md",
|
|
112
|
+
className: B,
|
|
113
|
+
"aria-label": "More actions",
|
|
114
|
+
"data-testid": i.dropdown,
|
|
115
|
+
children: /* @__PURE__ */ n(L, { icon: x, className: "size-4" })
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
asChild: !0,
|
|
119
|
+
placement: "bottom",
|
|
120
|
+
align: "end",
|
|
121
|
+
children: a.map((t) => /* @__PURE__ */ n(
|
|
122
|
+
q,
|
|
123
|
+
{
|
|
124
|
+
onSelect: t.onSelect,
|
|
125
|
+
children: t.title
|
|
126
|
+
},
|
|
127
|
+
t.id
|
|
128
|
+
))
|
|
129
|
+
}
|
|
130
|
+
) : null,
|
|
131
|
+
l
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
) : null
|
|
135
|
+
] }) : null,
|
|
136
|
+
/* @__PURE__ */ r(
|
|
137
|
+
V,
|
|
75
138
|
{
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
gap: "sm",
|
|
79
|
-
className: "ml-auto",
|
|
139
|
+
"data-testid": i.body,
|
|
140
|
+
"data-aside-form-top": !0,
|
|
80
141
|
children: [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
{
|
|
84
|
-
title: /* @__PURE__ */ e(
|
|
85
|
-
v,
|
|
86
|
-
{
|
|
87
|
-
type: "button",
|
|
88
|
-
variant: "ghost",
|
|
89
|
-
size: "md",
|
|
90
|
-
className: N,
|
|
91
|
-
"aria-label": "More actions",
|
|
92
|
-
"data-testid": o.dropdown,
|
|
93
|
-
children: /* @__PURE__ */ e(j, { icon: C, className: "size-4" })
|
|
94
|
-
}
|
|
95
|
-
),
|
|
96
|
-
asChild: !0,
|
|
97
|
-
placement: "bottom",
|
|
98
|
-
align: "end",
|
|
99
|
-
children: i.map((t) => /* @__PURE__ */ e(
|
|
100
|
-
z,
|
|
101
|
-
{
|
|
102
|
-
onSelect: t.onSelect,
|
|
103
|
-
children: t.title
|
|
104
|
-
},
|
|
105
|
-
t.id
|
|
106
|
-
))
|
|
107
|
-
}
|
|
108
|
-
) : null,
|
|
109
|
-
s
|
|
142
|
+
/* @__PURE__ */ n(e, { children: /* @__PURE__ */ n(O, {}) }),
|
|
143
|
+
D
|
|
110
144
|
]
|
|
111
145
|
}
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
146
|
+
),
|
|
147
|
+
S
|
|
148
|
+
] }),
|
|
149
|
+
c?.props.children != null ? /* @__PURE__ */ n(
|
|
150
|
+
G,
|
|
116
151
|
{
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
152
|
+
show: !0,
|
|
153
|
+
onClickOutside: b,
|
|
154
|
+
dialog: { padding: "xl" },
|
|
155
|
+
children: /* @__PURE__ */ r("div", { "data-testid": i.actionDialog, children: [
|
|
156
|
+
/* @__PURE__ */ n(
|
|
157
|
+
F,
|
|
158
|
+
{
|
|
159
|
+
onClose: b,
|
|
160
|
+
title: d(c.props.title)
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
c.props.children
|
|
164
|
+
] })
|
|
123
165
|
}
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
] }) });
|
|
166
|
+
) : null
|
|
167
|
+
] });
|
|
127
168
|
}
|
|
128
|
-
function
|
|
129
|
-
children:
|
|
169
|
+
function Nt({
|
|
170
|
+
children: o
|
|
130
171
|
}) {
|
|
131
|
-
return /* @__PURE__ */ e
|
|
172
|
+
return /* @__PURE__ */ n(e, { gap: "sm", "data-testid": i.message, children: o });
|
|
132
173
|
}
|
|
133
174
|
export {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
175
|
+
Et as ManagePane,
|
|
176
|
+
K as ManagePaneActionTab,
|
|
177
|
+
Nt as ManagePaneMessage,
|
|
178
|
+
H as ManagePaneTab,
|
|
179
|
+
J as ManagePaneTabDropdown,
|
|
180
|
+
i as ManagePaneTest
|
|
140
181
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PageTitleTest as
|
|
1
|
+
import { PageHeadProvider as o, PageTitle as t } from "./page-title.js";
|
|
2
|
+
import { PageTitleTest as P } from "./constants.js";
|
|
3
3
|
export {
|
|
4
|
-
o as
|
|
5
|
-
|
|
4
|
+
o as PageHeadProvider,
|
|
5
|
+
t as PageTitle,
|
|
6
|
+
P as PageTitleTest
|
|
6
7
|
};
|