@gearbox-protocol/ui-kit 4.0.0-next.50 → 4.0.0-next.52
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/copy-button.cjs +1 -0
- package/dist/cjs/components/base/detailed-page-title/detailed-page-title.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/manage-pane/manage-pane.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/tabber/tabber.cjs +1 -1
- package/dist/cjs/components/base/token-amount/token-amount.cjs +1 -1
- package/dist/cjs/components/base/values/index.cjs +1 -1
- package/dist/cjs/components/base-table/base-table-line.cjs +1 -1
- package/dist/cjs/components/base-table/base-table.cjs +1 -1
- package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/detailed-page-title/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/loading/loading.cjs +1 -1
- package/dist/cjs/components/sdk-status-pill/sdk-status-pill.cjs +1 -1
- package/dist/cjs/components/table/index.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +2 -3
- package/dist/esm/components/{detailed-page-title/detailed-page-title-copy-button.js → base/detailed-page-title/copy-button.js} +8 -8
- package/dist/esm/components/base/detailed-page-title/detailed-page-title.js +6 -6
- package/dist/esm/components/base/index.js +144 -153
- package/dist/esm/components/base/info-list/info-list.js +51 -25
- package/dist/esm/components/base/leverage-input/leverage-input.js +65 -47
- package/dist/esm/components/base/manage-pane/manage-pane.js +83 -73
- package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +1 -1
- package/dist/esm/components/base/position-assets/position-assets.js +2 -3
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +1 -1
- package/dist/esm/components/base/tabber/tabber.js +51 -39
- package/dist/esm/components/base/token-amount/token-amount.js +1 -1
- package/dist/esm/components/base/values/index.js +17 -19
- package/dist/esm/components/base-table/base-table-line.js +1 -1
- package/dist/esm/components/base-table/base-table.js +60 -55
- package/dist/esm/components/checkbox/checkbox-labeled.js +17 -20
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +2 -3
- package/dist/esm/components/compound-apy/compound-apy.js +2 -3
- package/dist/esm/components/detailed-page-title/index.js +2 -4
- package/dist/esm/components/index.js +581 -603
- package/dist/esm/components/loading/loading.js +22 -15
- package/dist/esm/components/sdk-status-pill/sdk-status-pill.js +19 -14
- package/dist/esm/components/table/index.js +16 -20
- package/dist/esm/components/with-copy/with-copy.js +19 -22
- package/dist/esm/index.js +712 -734
- package/dist/globals.css +1 -1
- package/dist/types/components/base/index.d.ts +0 -2
- package/dist/types/components/base/info-list/info-list.d.ts +3 -14
- package/dist/types/components/base/leverage-input/leverage-input.d.ts +2 -2
- package/dist/types/components/base/values/index.d.ts +0 -1
- package/dist/types/components/detailed-page-title/index.d.ts +0 -1
- package/dist/types/components/index.d.ts +0 -3
- package/dist/types/components/spinner-loader/spinner-loader.d.ts +1 -1
- package/dist/types/components/table/index.d.ts +0 -2
- package/dist/types/index.d.ts +0 -3
- package/package.json +1 -1
- package/dist/cjs/components/base/info-portal/index.cjs +0 -1
- package/dist/cjs/components/base/info-portal/info-portal.cjs +0 -1
- package/dist/cjs/components/base/sticky-bar/constants.cjs +0 -1
- package/dist/cjs/components/base/sticky-bar/index.cjs +0 -1
- package/dist/cjs/components/base/sticky-bar/sticky-bar.cjs +0 -1
- package/dist/cjs/components/base/values/points-value.cjs +0 -1
- package/dist/cjs/components/detailed-page-title/detailed-page-title-copy-button.cjs +0 -1
- package/dist/cjs/components/loading-bar/index.cjs +0 -1
- package/dist/cjs/components/loading-bar/loading-bar.cjs +0 -1
- package/dist/cjs/components/status-dot/index.cjs +0 -1
- package/dist/cjs/components/status-dot/status-dot.cjs +0 -1
- package/dist/cjs/components/table/table-loader-guard.cjs +0 -1
- package/dist/cjs/components/table/table-loader.cjs +0 -1
- package/dist/cjs/components/with-title/index.cjs +0 -1
- package/dist/cjs/components/with-title/with-title.cjs +0 -1
- package/dist/esm/components/base/info-portal/index.js +0 -5
- package/dist/esm/components/base/info-portal/info-portal.js +0 -20
- package/dist/esm/components/base/sticky-bar/constants.js +0 -6
- package/dist/esm/components/base/sticky-bar/index.js +0 -6
- package/dist/esm/components/base/sticky-bar/sticky-bar.js +0 -28
- package/dist/esm/components/base/values/points-value.js +0 -30
- package/dist/esm/components/loading-bar/index.js +0 -4
- package/dist/esm/components/loading-bar/loading-bar.js +0 -27
- package/dist/esm/components/status-dot/index.js +0 -5
- package/dist/esm/components/status-dot/status-dot.js +0 -49
- package/dist/esm/components/table/table-loader-guard.js +0 -31
- package/dist/esm/components/table/table-loader.js +0 -25
- package/dist/esm/components/with-title/index.js +0 -4
- package/dist/esm/components/with-title/with-title.js +0 -43
- package/dist/types/components/base/info-portal/index.d.ts +0 -1
- package/dist/types/components/base/info-portal/info-portal.d.ts +0 -8
- package/dist/types/components/base/sticky-bar/constants.d.ts +0 -3
- package/dist/types/components/base/sticky-bar/index.d.ts +0 -1
- package/dist/types/components/base/sticky-bar/sticky-bar.d.ts +0 -9
- package/dist/types/components/base/values/points-value.d.ts +0 -11
- package/dist/types/components/loading-bar/index.d.ts +0 -1
- package/dist/types/components/loading-bar/loading-bar.d.ts +0 -25
- package/dist/types/components/status-dot/index.d.ts +0 -1
- package/dist/types/components/status-dot/status-dot.d.ts +0 -47
- package/dist/types/components/table/table-loader-guard.d.ts +0 -45
- package/dist/types/components/table/table-loader.d.ts +0 -50
- package/dist/types/components/with-title/index.d.ts +0 -1
- package/dist/types/components/with-title/with-title.d.ts +0 -31
- /package/dist/types/components/{detailed-page-title/detailed-page-title-copy-button.d.ts → base/detailed-page-title/copy-button.d.ts} +0 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsxs as r, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { faEllipsis as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { ConfirmMenu as F } from "../../confirm-menu/confirm-menu.js";
|
|
2
|
+
import { faEllipsis as _ } from "@fortawesome/free-solid-svg-icons";
|
|
3
|
+
import { createContext as E, useState as N, Children as O, isValidElement as g, useRef as k, useContext as B } from "react";
|
|
4
|
+
import { SegmentedTabs as j, SEGMENTED_TABS_INACTIVE_BUTTON_CLASS as z } from "../segmented-tabs/segmented-tabs.js";
|
|
5
|
+
import { Stack as i } from "../stack/stack.js";
|
|
6
|
+
import { useTitleText as R } from "../text/use-title-text.js";
|
|
7
|
+
import { Button as V } from "../../buttons/button/button.js";
|
|
8
|
+
import { StyledDialogContainer as F } from "../../client-adapters/styled-dialog-container/styled-dialog-container.js";
|
|
9
|
+
import { ConfirmMenu as G } from "../../confirm-menu/confirm-menu.js";
|
|
11
10
|
import "../../modal/modal.js";
|
|
12
11
|
import "@radix-ui/react-dialog";
|
|
13
12
|
import "../../dialog/dialog-container.js";
|
|
@@ -21,103 +20,114 @@ import "luxon";
|
|
|
21
20
|
import "../../../utils/z-index.js";
|
|
22
21
|
import "../../dialog/dialog-header.js";
|
|
23
22
|
import "../../dialog/dialog-title.js";
|
|
24
|
-
import { DialogModalContainer as
|
|
23
|
+
import { DialogModalContainer as L } from "../../dialog/dialog-modal-container.js";
|
|
25
24
|
import "../../dialog/dialog-overlay.js";
|
|
26
25
|
import "viem";
|
|
27
26
|
import "../../input/input.js";
|
|
28
27
|
import "../../label/label.js";
|
|
29
|
-
import { FaIcon as
|
|
30
|
-
import { SimpleDropdown as
|
|
31
|
-
import { SimpleDropdownMenuItem as
|
|
32
|
-
import { ManagePaneTest as
|
|
33
|
-
|
|
28
|
+
import { FaIcon as U } from "../../icons/fa-icon.js";
|
|
29
|
+
import { SimpleDropdown as q } from "../../simple-dropdown/simple-dropdown.js";
|
|
30
|
+
import { SimpleDropdownMenuItem as H } from "../../simple-dropdown/simple-dropdown-menu-item.js";
|
|
31
|
+
import { ManagePaneTest as e } from "./constants.js";
|
|
32
|
+
const C = E({
|
|
33
|
+
current: null
|
|
34
|
+
});
|
|
35
|
+
function J({ children: o }) {
|
|
36
|
+
const p = k(null);
|
|
37
|
+
return /* @__PURE__ */ n(C.Provider, { value: p, children: o });
|
|
38
|
+
}
|
|
39
|
+
function K() {
|
|
40
|
+
const o = B(C);
|
|
41
|
+
return /* @__PURE__ */ n("div", { ref: o });
|
|
42
|
+
}
|
|
43
|
+
function Q(o) {
|
|
34
44
|
return null;
|
|
35
45
|
}
|
|
36
|
-
function
|
|
46
|
+
function W(o) {
|
|
37
47
|
return null;
|
|
38
48
|
}
|
|
39
|
-
function
|
|
49
|
+
function X(o) {
|
|
40
50
|
return null;
|
|
41
51
|
}
|
|
42
|
-
function
|
|
43
|
-
return
|
|
52
|
+
function Y(o) {
|
|
53
|
+
return g(o) && o.type === Q;
|
|
44
54
|
}
|
|
45
|
-
function
|
|
46
|
-
return
|
|
55
|
+
function Z(o) {
|
|
56
|
+
return g(o) && o.type === W;
|
|
47
57
|
}
|
|
48
|
-
function
|
|
49
|
-
return
|
|
58
|
+
function $(o) {
|
|
59
|
+
return g(o) && o.type === X;
|
|
50
60
|
}
|
|
51
|
-
function
|
|
61
|
+
function Et({
|
|
52
62
|
children: o,
|
|
53
|
-
activeTab:
|
|
63
|
+
activeTab: p,
|
|
54
64
|
onTabChange: M,
|
|
55
65
|
header: I,
|
|
56
|
-
footer:
|
|
57
|
-
actions:
|
|
58
|
-
testId:
|
|
66
|
+
footer: P,
|
|
67
|
+
actions: d,
|
|
68
|
+
testId: S
|
|
59
69
|
}) {
|
|
60
|
-
const
|
|
61
|
-
...
|
|
70
|
+
const m = R(), [w, h] = N(null), c = O.toArray(o), T = c.filter(Y), A = c.find(Z), a = c.filter($), x = T.filter((t) => !t.props.hidden), D = T.find((t) => t.props.id === p)?.props.children, l = A?.props.items ?? [], y = new Set(a.map((t) => t.props.id)), u = a.find((t) => t.props.id === w), b = () => h(null), f = [
|
|
71
|
+
...x.map((t) => ({
|
|
62
72
|
id: t.props.id,
|
|
63
|
-
item:
|
|
73
|
+
item: m(t.props.title),
|
|
64
74
|
disabled: t.props.disabled,
|
|
65
|
-
testId:
|
|
75
|
+
testId: e.tab(t.props.id)
|
|
66
76
|
})),
|
|
67
|
-
...
|
|
77
|
+
...a.map((t) => ({
|
|
68
78
|
id: t.props.id,
|
|
69
|
-
item:
|
|
70
|
-
testId:
|
|
79
|
+
item: m(t.props.title),
|
|
80
|
+
testId: e.tab(t.props.id)
|
|
71
81
|
}))
|
|
72
82
|
];
|
|
73
|
-
return /* @__PURE__ */ r(
|
|
74
|
-
/* @__PURE__ */ r(
|
|
83
|
+
return /* @__PURE__ */ r(J, { children: [
|
|
84
|
+
/* @__PURE__ */ r(i, { gap: "md", "data-testid": S ?? e.root, children: [
|
|
75
85
|
I,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
86
|
+
f.length > 0 || l.length > 0 || d ? /* @__PURE__ */ r(i, { direction: "row", align: "center", gap: "sm", children: [
|
|
87
|
+
f.length > 0 ? /* @__PURE__ */ n(
|
|
88
|
+
j,
|
|
79
89
|
{
|
|
80
|
-
items:
|
|
81
|
-
activeTab:
|
|
90
|
+
items: f,
|
|
91
|
+
activeTab: p,
|
|
82
92
|
onTabChange: (t) => {
|
|
83
|
-
const s =
|
|
93
|
+
const s = a.find((v) => v.props.id === t);
|
|
84
94
|
if (s) {
|
|
85
95
|
s.props.children != null && h(s.props.id), s.props.onClick?.();
|
|
86
96
|
return;
|
|
87
97
|
}
|
|
88
98
|
y.has(t) || M(t);
|
|
89
99
|
},
|
|
90
|
-
testId:
|
|
100
|
+
testId: e.tabs
|
|
91
101
|
}
|
|
92
102
|
) : null,
|
|
93
|
-
|
|
94
|
-
|
|
103
|
+
l.length > 0 || d ? /* @__PURE__ */ r(
|
|
104
|
+
i,
|
|
95
105
|
{
|
|
96
106
|
direction: "row",
|
|
97
107
|
align: "center",
|
|
98
108
|
gap: "sm",
|
|
99
109
|
className: "ml-auto",
|
|
100
110
|
children: [
|
|
101
|
-
|
|
102
|
-
|
|
111
|
+
l.length > 0 ? /* @__PURE__ */ n(
|
|
112
|
+
q,
|
|
103
113
|
{
|
|
104
114
|
title: /* @__PURE__ */ n(
|
|
105
|
-
|
|
115
|
+
V,
|
|
106
116
|
{
|
|
107
117
|
type: "button",
|
|
108
118
|
variant: "ghost",
|
|
109
119
|
size: "md",
|
|
110
|
-
className:
|
|
120
|
+
className: z,
|
|
111
121
|
"aria-label": "More actions",
|
|
112
|
-
"data-testid":
|
|
113
|
-
children: /* @__PURE__ */ n(
|
|
122
|
+
"data-testid": e.dropdown,
|
|
123
|
+
children: /* @__PURE__ */ n(U, { icon: _, className: "size-4" })
|
|
114
124
|
}
|
|
115
125
|
),
|
|
116
126
|
asChild: !0,
|
|
117
127
|
placement: "bottom",
|
|
118
128
|
align: "end",
|
|
119
|
-
children:
|
|
120
|
-
|
|
129
|
+
children: l.map((t) => /* @__PURE__ */ n(
|
|
130
|
+
H,
|
|
121
131
|
{
|
|
122
132
|
onSelect: t.onSelect,
|
|
123
133
|
children: t.title
|
|
@@ -126,54 +136,54 @@ function _t({
|
|
|
126
136
|
))
|
|
127
137
|
}
|
|
128
138
|
) : null,
|
|
129
|
-
|
|
139
|
+
d
|
|
130
140
|
]
|
|
131
141
|
}
|
|
132
142
|
) : null
|
|
133
143
|
] }) : null,
|
|
134
144
|
/* @__PURE__ */ r(
|
|
135
|
-
|
|
145
|
+
F,
|
|
136
146
|
{
|
|
137
|
-
"data-testid":
|
|
147
|
+
"data-testid": e.body,
|
|
138
148
|
"data-aside-form-top": !0,
|
|
139
149
|
children: [
|
|
140
|
-
/* @__PURE__ */ n(
|
|
150
|
+
/* @__PURE__ */ n(i, { children: /* @__PURE__ */ n(K, {}) }),
|
|
141
151
|
D
|
|
142
152
|
]
|
|
143
153
|
}
|
|
144
154
|
),
|
|
145
|
-
|
|
155
|
+
P
|
|
146
156
|
] }),
|
|
147
|
-
|
|
148
|
-
|
|
157
|
+
u?.props.children != null ? /* @__PURE__ */ n(
|
|
158
|
+
L,
|
|
149
159
|
{
|
|
150
160
|
show: !0,
|
|
151
161
|
onClickOutside: b,
|
|
152
162
|
dialog: { padding: "xl" },
|
|
153
|
-
children: /* @__PURE__ */ r("div", { "data-testid":
|
|
163
|
+
children: /* @__PURE__ */ r("div", { "data-testid": e.actionDialog, children: [
|
|
154
164
|
/* @__PURE__ */ n(
|
|
155
|
-
|
|
165
|
+
G,
|
|
156
166
|
{
|
|
157
167
|
onClose: b,
|
|
158
|
-
title:
|
|
168
|
+
title: m(u.props.title)
|
|
159
169
|
}
|
|
160
170
|
),
|
|
161
|
-
|
|
171
|
+
u.props.children
|
|
162
172
|
] })
|
|
163
173
|
}
|
|
164
174
|
) : null
|
|
165
175
|
] });
|
|
166
176
|
}
|
|
167
|
-
function
|
|
177
|
+
function Nt({
|
|
168
178
|
children: o
|
|
169
179
|
}) {
|
|
170
|
-
return /* @__PURE__ */ n(
|
|
180
|
+
return /* @__PURE__ */ n(i, { gap: "sm", "data-testid": e.message, children: o });
|
|
171
181
|
}
|
|
172
182
|
export {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
183
|
+
Et as ManagePane,
|
|
184
|
+
X as ManagePaneActionTab,
|
|
185
|
+
Nt as ManagePaneMessage,
|
|
186
|
+
Q as ManagePaneTab,
|
|
187
|
+
W as ManagePaneTabDropdown,
|
|
188
|
+
e as ManagePaneTest
|
|
179
189
|
};
|
|
@@ -7,10 +7,10 @@ import "clsx";
|
|
|
7
7
|
import "tailwind-merge";
|
|
8
8
|
import "luxon";
|
|
9
9
|
import "../../../utils/z-index.js";
|
|
10
|
-
import { PointsIcon as b } from "../../points-icon/points-icon.js";
|
|
11
10
|
import "viem";
|
|
12
11
|
import "react";
|
|
13
12
|
import { PoolApyBreakdownCardTest as l } from "./constants.js";
|
|
13
|
+
import { PointsIcon as b } from "../../points-icon/points-icon.js";
|
|
14
14
|
import { TokenIcon as C } from "../../token-icon/token-icon.js";
|
|
15
15
|
import "../../tooltip/simple-tooltip.js";
|
|
16
16
|
import "../../tooltip/tooltip.js";
|
|
@@ -8,7 +8,6 @@ import { APPROXIMATE_SYMBOL as k } from "../../../utils/format.js";
|
|
|
8
8
|
import { formatMoney as g } from "../../../utils/format-money.js";
|
|
9
9
|
import "luxon";
|
|
10
10
|
import "../../../utils/z-index.js";
|
|
11
|
-
import "../../points-icon/points-icon.js";
|
|
12
11
|
import { TokenBigint as p } from "../values/scalars.js";
|
|
13
12
|
import "../../badge/badge.js";
|
|
14
13
|
import "../../badge/chip.js";
|
|
@@ -19,7 +18,7 @@ import { TokenSymbol as T } from "../../token-symbol/token-symbol.js";
|
|
|
19
18
|
import { Typography as u } from "../../typography/typography.js";
|
|
20
19
|
import { PositionAssetsTest as d } from "./constants.js";
|
|
21
20
|
const x = 1, U = 20;
|
|
22
|
-
function
|
|
21
|
+
function V({
|
|
23
22
|
assets: s,
|
|
24
23
|
to: n,
|
|
25
24
|
empty: a,
|
|
@@ -110,7 +109,7 @@ function M(s, n) {
|
|
|
110
109
|
return s === void 0 ? n : s === null || n === null ? null : Math.max(s, n);
|
|
111
110
|
}
|
|
112
111
|
export {
|
|
113
|
-
|
|
112
|
+
V as PositionAssets,
|
|
114
113
|
d as PositionAssetsTest,
|
|
115
114
|
S as visibleAssets
|
|
116
115
|
};
|
|
@@ -8,9 +8,9 @@ import "tailwind-merge";
|
|
|
8
8
|
import { formatLeverage as d } from "../../../utils/format-leverage.js";
|
|
9
9
|
import "luxon";
|
|
10
10
|
import "../../../utils/z-index.js";
|
|
11
|
-
import { PointsIcon as $ } from "../../points-icon/points-icon.js";
|
|
12
11
|
import "viem";
|
|
13
12
|
import "react";
|
|
13
|
+
import { PointsIcon as $ } from "../../points-icon/points-icon.js";
|
|
14
14
|
import { TokenIcon as j } from "../../token-icon/token-icon.js";
|
|
15
15
|
import { FormattedMessageTyped as r } from "../../typed-intl/index.js";
|
|
16
16
|
import "../../tooltip/simple-tooltip.js";
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as E, useContext as q, useMemo as
|
|
3
|
-
import { SectionHeading as
|
|
2
|
+
import { createContext as E, useContext as q, useMemo as f, Children as B, useRef as g, useEffect as z, isValidElement as N } from "react";
|
|
3
|
+
import { SectionHeading as D } from "../section-heading/section-heading.js";
|
|
4
4
|
import { Stack as u } from "../stack/stack.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { TabItem as P, TabControl as V } from "../../tab-control/tab-control.js";
|
|
5
|
+
import { useTitleText as R } from "../text/use-title-text.js";
|
|
6
|
+
import { TabItem as F, TabControl as M } from "../../tab-control/tab-control.js";
|
|
8
7
|
import { TabberTest as S } from "./constants.js";
|
|
9
|
-
import { useDetailScrollSpy as
|
|
10
|
-
const
|
|
8
|
+
import { useDetailScrollSpy as P } from "./use-detail-scroll-spy.js";
|
|
9
|
+
const j = E({});
|
|
11
10
|
function A({
|
|
12
11
|
id: e,
|
|
13
12
|
title: o,
|
|
@@ -16,7 +15,7 @@ function A({
|
|
|
16
15
|
children: m,
|
|
17
16
|
hideHeading: a = !1
|
|
18
17
|
}) {
|
|
19
|
-
const l = q(
|
|
18
|
+
const l = q(j), i = R(), n = !a;
|
|
20
19
|
return /* @__PURE__ */ r(
|
|
21
20
|
"section",
|
|
22
21
|
{
|
|
@@ -26,7 +25,7 @@ function A({
|
|
|
26
25
|
"data-testid": S.section,
|
|
27
26
|
children: /* @__PURE__ */ p(u, { gap: "md", children: [
|
|
28
27
|
n || c ? /* @__PURE__ */ p("div", { className: "flex items-center justify-between gap-3", children: [
|
|
29
|
-
n ? /* @__PURE__ */ r(
|
|
28
|
+
n ? /* @__PURE__ */ r(D, { children: i(s) }) : /* @__PURE__ */ r("span", {}),
|
|
30
29
|
c
|
|
31
30
|
] }) : null,
|
|
32
31
|
m
|
|
@@ -35,72 +34,72 @@ function A({
|
|
|
35
34
|
);
|
|
36
35
|
}
|
|
37
36
|
A.displayName = "TabberSection";
|
|
38
|
-
function
|
|
39
|
-
return
|
|
37
|
+
function T(e) {
|
|
38
|
+
return N(e) && e.type === A;
|
|
40
39
|
}
|
|
41
|
-
function
|
|
40
|
+
function V({
|
|
42
41
|
item: e,
|
|
43
42
|
...o
|
|
44
43
|
}) {
|
|
45
44
|
return /* @__PURE__ */ p("div", { className: "flex items-stretch overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:h-0 [scrollbar-width:none]", children: [
|
|
46
|
-
/* @__PURE__ */ r("div", { className: "min-w-0 basis-0 grow pb-px", children: /* @__PURE__ */ r(
|
|
45
|
+
/* @__PURE__ */ r("div", { className: "min-w-0 basis-0 grow pb-px", children: /* @__PURE__ */ r(M, { ...o, showBorder: !0 }) }),
|
|
47
46
|
e && /* @__PURE__ */ r("div", { className: "w-auto shrink-0 grow-0 basis-auto", children: e })
|
|
48
47
|
] });
|
|
49
48
|
}
|
|
50
|
-
function
|
|
49
|
+
function W({
|
|
51
50
|
children: e,
|
|
52
51
|
observeKey: o,
|
|
53
52
|
initialSection: s,
|
|
54
53
|
testId: c,
|
|
55
54
|
mobileManagePane: m
|
|
56
55
|
}) {
|
|
57
|
-
const a =
|
|
58
|
-
() =>
|
|
56
|
+
const a = f(
|
|
57
|
+
() => B.toArray(e).filter(T),
|
|
59
58
|
[e]
|
|
60
|
-
), l =
|
|
59
|
+
), l = f(
|
|
61
60
|
() => a.filter((t) => t.props.beforeBar !== !0),
|
|
62
61
|
[a]
|
|
63
|
-
), i = l.map((t) => t.props.id).join("|"), n =
|
|
62
|
+
), i = l.map((t) => t.props.id).join("|"), n = f(
|
|
64
63
|
() => i === "" ? [] : i.split("|"),
|
|
65
64
|
[i]
|
|
66
|
-
), w =
|
|
65
|
+
), w = g({}), d = f(() => {
|
|
67
66
|
const t = {
|
|
68
67
|
...w.current
|
|
69
68
|
};
|
|
70
|
-
for (const
|
|
71
|
-
t[
|
|
69
|
+
for (const y of n)
|
|
70
|
+
t[y] === void 0 && (t[y] = { current: null });
|
|
72
71
|
return w.current = t, t;
|
|
73
|
-
}, [n]), I =
|
|
74
|
-
|
|
72
|
+
}, [n]), I = R(), { activeSection: b, scrollToSection: h } = P(
|
|
73
|
+
d,
|
|
75
74
|
n,
|
|
76
75
|
o
|
|
77
|
-
), x =
|
|
78
|
-
|
|
76
|
+
), x = g(!1), v = g(o);
|
|
77
|
+
z(() => {
|
|
79
78
|
if (o !== v.current && (v.current = o, x.current = !1), x.current || !o) return;
|
|
80
79
|
const t = s ?? n[0];
|
|
81
|
-
x.current = !0, !(t === void 0 || t === n[0]) &&
|
|
80
|
+
x.current = !0, !(t === void 0 || t === n[0]) && d[t] !== void 0 && requestAnimationFrame(() => {
|
|
82
81
|
h(t);
|
|
83
82
|
});
|
|
84
|
-
}, [o, s, h, n,
|
|
83
|
+
}, [o, s, h, n, d]);
|
|
85
84
|
const H = l.map((t) => ({
|
|
86
85
|
id: t.props.id,
|
|
87
86
|
item: /* @__PURE__ */ r(
|
|
88
|
-
|
|
87
|
+
F,
|
|
89
88
|
{
|
|
90
89
|
selected: b === t.props.id,
|
|
91
90
|
label: I(t.props.title)
|
|
92
91
|
}
|
|
93
92
|
)
|
|
94
|
-
})), C =
|
|
95
|
-
(t) =>
|
|
93
|
+
})), C = B.toArray(e), k = C.filter(
|
|
94
|
+
(t) => T(t) && t.props.beforeBar === !0
|
|
96
95
|
), O = C.filter(
|
|
97
|
-
(t) => !(
|
|
96
|
+
(t) => !(T(t) && t.props.beforeBar === !0)
|
|
98
97
|
);
|
|
99
|
-
return /* @__PURE__ */ r(u, { gap: "lg", "data-testid": c ?? S.root, children: /* @__PURE__ */ p(
|
|
100
|
-
|
|
98
|
+
return /* @__PURE__ */ r(u, { gap: "lg", "data-testid": c ?? S.root, children: /* @__PURE__ */ p(j.Provider, { value: d, children: [
|
|
99
|
+
k.length > 0 ? /* @__PURE__ */ r(u, { gap: "xl", children: k }) : null,
|
|
101
100
|
m,
|
|
102
|
-
/* @__PURE__ */ r(
|
|
103
|
-
|
|
101
|
+
/* @__PURE__ */ r(G, { testId: S.bar, children: /* @__PURE__ */ r(
|
|
102
|
+
V,
|
|
104
103
|
{
|
|
105
104
|
state: {
|
|
106
105
|
id: b,
|
|
@@ -116,12 +115,25 @@ function G({
|
|
|
116
115
|
/* @__PURE__ */ r(u, { gap: "xl", children: O })
|
|
117
116
|
] }) });
|
|
118
117
|
}
|
|
119
|
-
function
|
|
120
|
-
|
|
118
|
+
function G({
|
|
119
|
+
children: e,
|
|
120
|
+
testId: o
|
|
121
|
+
}) {
|
|
122
|
+
return /* @__PURE__ */ r(
|
|
123
|
+
"div",
|
|
124
|
+
{
|
|
125
|
+
className: "sticky top-0 z-20 -mx-1 px-1 pt-3 sm:pt-4 bg-background/75 backdrop-blur-md backdrop-saturate-150",
|
|
126
|
+
"data-testid": o,
|
|
127
|
+
children: e
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
function $(e) {
|
|
132
|
+
return N(e) && e.type === W;
|
|
121
133
|
}
|
|
122
134
|
export {
|
|
123
|
-
|
|
135
|
+
W as Tabber,
|
|
124
136
|
A as TabberSection,
|
|
125
137
|
S as TabberTest,
|
|
126
|
-
|
|
138
|
+
$ as isTabber
|
|
127
139
|
};
|
|
@@ -8,9 +8,9 @@ import { APPROXIMATE_SYMBOL as l } from "../../../utils/format.js";
|
|
|
8
8
|
import { formatMoney as c } from "../../../utils/format-money.js";
|
|
9
9
|
import "luxon";
|
|
10
10
|
import "../../../utils/z-index.js";
|
|
11
|
-
import "../../points-icon/points-icon.js";
|
|
12
11
|
import "viem";
|
|
13
12
|
import "react";
|
|
13
|
+
import "../../points-icon/points-icon.js";
|
|
14
14
|
import "../../token-icon/token-icon.js";
|
|
15
15
|
import "react-intl";
|
|
16
16
|
import "../../tooltip/simple-tooltip.js";
|
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
import { PositionShortLabelTest as t, ValueTest as r } from "./constants.js";
|
|
2
2
|
import { NoValue as i } from "./no-value.js";
|
|
3
3
|
import { PnlValue as p } from "./pnl-value.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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";
|
|
4
|
+
import { PositionShortLabel as u } from "./position-short-label.js";
|
|
5
|
+
import { PositionStatusBadge as V } from "./position-status-badge.js";
|
|
6
|
+
import { PositionTypeBadge as n } from "./position-type-badge.js";
|
|
7
|
+
import { PriceImpactValue as P, priceImpact as c } from "./price-impact-value.js";
|
|
8
|
+
import { ApyValue as T, HealthFactorValue as b, LeverageValue as d, TokenBigint as h, UsdValue as B, UtilizationValue as L, bps as S } from "./scalars.js";
|
|
10
9
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
T as ApyValue,
|
|
11
|
+
b as HealthFactorValue,
|
|
12
|
+
d as LeverageValue,
|
|
14
13
|
i as NoValue,
|
|
15
14
|
p as PnlValue,
|
|
16
|
-
u as
|
|
17
|
-
V as PositionShortLabel,
|
|
15
|
+
u as PositionShortLabel,
|
|
18
16
|
t as PositionShortLabelTest,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
V as PositionStatusBadge,
|
|
18
|
+
n as PositionTypeBadge,
|
|
19
|
+
P as PriceImpactValue,
|
|
20
|
+
h as TokenBigint,
|
|
21
|
+
B as UsdValue,
|
|
22
|
+
L as UtilizationValue,
|
|
25
23
|
r as ValueTest,
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
S as bps,
|
|
25
|
+
c as priceImpact
|
|
28
26
|
};
|
|
@@ -4,9 +4,9 @@ import "@gearbox-protocol/sdk/onchain";
|
|
|
4
4
|
import { cn as s } from "../../utils/cn.js";
|
|
5
5
|
import "luxon";
|
|
6
6
|
import "../../utils/z-index.js";
|
|
7
|
-
import "../points-icon/points-icon.js";
|
|
8
7
|
import "viem";
|
|
9
8
|
import "react";
|
|
9
|
+
import "../points-icon/points-icon.js";
|
|
10
10
|
import "../token-icon/token-icon.js";
|
|
11
11
|
import "react-intl";
|
|
12
12
|
import "../tooltip/simple-tooltip.js";
|