@gearbox-protocol/ui-kit 3.11.0 → 3.11.2-next.1
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/composites/pool-table/columns.cjs +1 -1
- package/dist/cjs/components/composites/pool-table/pool-table.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/rwa-styles/index.cjs +1 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/components/composites/pool-table/columns.js +130 -105
- package/dist/esm/components/composites/pool-table/pool-table.js +102 -94
- package/dist/esm/components/index.js +313 -310
- package/dist/esm/components/rwa-styles/index.js +5 -0
- package/dist/esm/index.js +464 -461
- package/dist/globals.css +1 -1
- package/dist/types/components/composites/pool-table/columns.d.ts +2 -0
- package/dist/types/components/composites/pool-table/types.d.ts +2 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/rwa-styles/index.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types/footer.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,133 +1,157 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { AssetsListCell as
|
|
1
|
+
import { jsx as i, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { AssetsListCell as k } from "../../assets-list-cell/assets-list-cell.js";
|
|
3
3
|
import { CompoundAPY as C } from "../../compound-apy/compound-apy.js";
|
|
4
|
-
import { Description as
|
|
5
|
-
import { NetworkIcon as
|
|
6
|
-
import { PercentIndicator as
|
|
7
|
-
import { PoolAPYTooltip as
|
|
8
|
-
import { PoolIndicatorIcon as
|
|
4
|
+
import { Description as p } from "../../description/description.js";
|
|
5
|
+
import { NetworkIcon as N } from "../../network-icon/network-icon.js";
|
|
6
|
+
import { PercentIndicator as v } from "../../percent-indicator/percent-indicator.js";
|
|
7
|
+
import { PoolAPYTooltip as P } from "../../pool-apy-tooltip/pool-apy-tooltip.js";
|
|
8
|
+
import { PoolIndicatorIcon as x } from "../../pool-indicator-icon/pool-indicator-icon.js";
|
|
9
9
|
import { PoolPointsIndicator as D } from "../../pool-points-indicator/pool-points-indicator.js";
|
|
10
|
-
import {
|
|
10
|
+
import { RWA_GRADIENT_BORDER_CLASS as I } from "../../rwa-styles/index.js";
|
|
11
|
+
import { Skeleton as f } from "../../skeleton/skeleton.js";
|
|
11
12
|
import "react";
|
|
12
13
|
import "@gearbox-protocol/sdk";
|
|
13
|
-
import "
|
|
14
|
-
import "tailwind-merge";
|
|
14
|
+
import { cn as Y } from "../../../utils/cn.js";
|
|
15
15
|
import "sonner";
|
|
16
|
-
import { percentageTemplate as
|
|
17
|
-
import { tokenTemplate as
|
|
16
|
+
import { percentageTemplate as z, formatMoney as g } from "../../../utils/format-money.js";
|
|
17
|
+
import { tokenTemplate as T } from "../../../utils/templates.js";
|
|
18
18
|
import "luxon";
|
|
19
19
|
import "../../../utils/z-index.js";
|
|
20
|
-
import { TokenSymbol as
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
20
|
+
import { TokenSymbol as S } from "../../token-symbol/token-symbol.js";
|
|
21
|
+
import { SimpleTooltip as B } from "../../tooltip/simple-tooltip.js";
|
|
22
|
+
import "../../tooltip/tooltip.js";
|
|
23
|
+
import { FormattedMessageTyped as w } from "../../typed-intl/index.js";
|
|
24
|
+
import { poolTableTestIds as L } from "../../../test-ids/pool-table.js";
|
|
23
25
|
function d(e, l, o) {
|
|
24
26
|
const t = e?.header ?? /* @__PURE__ */ i(
|
|
25
|
-
|
|
27
|
+
w,
|
|
26
28
|
{
|
|
27
29
|
messageId: e?.headerMessageId ?? l
|
|
28
30
|
}
|
|
29
31
|
);
|
|
30
|
-
let
|
|
32
|
+
let r;
|
|
31
33
|
if (e?.headerTip !== null) {
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
+
const n = e?.headerTipMessageId ?? o;
|
|
35
|
+
r = e?.headerTip ?? (n && /* @__PURE__ */ i(w, { messageId: n }));
|
|
34
36
|
}
|
|
35
|
-
return { header: t, headerTip:
|
|
37
|
+
return { header: t, headerTip: r, mobileTitle: e?.mobileTitle ?? t };
|
|
36
38
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
function M({
|
|
40
|
+
ctx: e,
|
|
41
|
+
rwaTooltip: l
|
|
42
|
+
}) {
|
|
43
|
+
const { pool: o, underlyingToken: t, points: r, apy: n, isMobile: a } = e, s = a ? 20 : 24, c = /* @__PURE__ */ i(S, { token: t, size: s }), h = o.poolType === "rwa", u = r && r.length > 0 && n ? /* @__PURE__ */ i(
|
|
44
|
+
P,
|
|
41
45
|
{
|
|
42
46
|
totalAPY: n.totalAPY,
|
|
43
47
|
baseAPY: n.baseAPY,
|
|
44
48
|
extraAPY: n.extraAPY,
|
|
45
|
-
points:
|
|
49
|
+
points: r,
|
|
46
50
|
tokensList: e.tokensList,
|
|
47
|
-
children: /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
|
|
51
|
+
children: /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(x, { size: s, children: c }) })
|
|
48
52
|
}
|
|
49
|
-
) :
|
|
53
|
+
) : o.hasPoints ? /* @__PURE__ */ i(D, { size: s, children: c }) : c;
|
|
54
|
+
return h ? /* @__PURE__ */ i(
|
|
55
|
+
B,
|
|
56
|
+
{
|
|
57
|
+
placement: "top",
|
|
58
|
+
useTitleAsTrigger: !0,
|
|
59
|
+
title: /* @__PURE__ */ i(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: Y(
|
|
63
|
+
"relative inline-flex rounded-full p-1",
|
|
64
|
+
I
|
|
65
|
+
),
|
|
66
|
+
children: /* @__PURE__ */ i("div", { className: "relative z-10", children: u })
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
children: l ?? "RWA market"
|
|
70
|
+
}
|
|
71
|
+
) : u;
|
|
50
72
|
}
|
|
51
|
-
function
|
|
73
|
+
function F(e) {
|
|
52
74
|
const l = e.underlyingToken?.title ?? e.underlyingToken?.symbol ?? "", o = e.pool.version;
|
|
53
75
|
return o && o >= 300 && o < 310 ? `${l} v${Math.floor(o / 100)}` : l;
|
|
54
76
|
}
|
|
55
|
-
function
|
|
77
|
+
function R({
|
|
56
78
|
ctx: e,
|
|
57
79
|
renderDescription: l,
|
|
58
|
-
getPoolName: o
|
|
80
|
+
getPoolName: o,
|
|
81
|
+
rwaTooltip: t
|
|
59
82
|
}) {
|
|
60
|
-
const { pool:
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
64
|
-
|
|
83
|
+
const { pool: r } = e, n = o ? o(e) : F(e), a = r.poolType === "rwa";
|
|
84
|
+
return /* @__PURE__ */ m("div", { className: "grid grid-cols-[auto_1fr] gap-x-3", children: [
|
|
85
|
+
a && /* @__PURE__ */ i("span", { className: "hidden", "data-rwa-pool-marker": "true" }),
|
|
86
|
+
/* @__PURE__ */ m("div", { className: "flex items-center gap-3 shrink-0 leading-0", children: [
|
|
87
|
+
r.network && /* @__PURE__ */ i(
|
|
88
|
+
N,
|
|
65
89
|
{
|
|
66
|
-
network:
|
|
90
|
+
network: r.network,
|
|
67
91
|
isTest: !1,
|
|
68
92
|
size: 14,
|
|
69
93
|
showTooltip: !0
|
|
70
94
|
}
|
|
71
95
|
),
|
|
72
|
-
/* @__PURE__ */ i(
|
|
96
|
+
/* @__PURE__ */ i(M, { ctx: e, rwaTooltip: t })
|
|
73
97
|
] }),
|
|
74
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ m("div", { className: "flex md:flex-col min-w-0 overflow-hidden items-center md:items-start gap-2 md:gap-0", children: [
|
|
75
99
|
/* @__PURE__ */ i("span", { className: "truncate max-w-full", children: n }),
|
|
76
|
-
l && /* @__PURE__ */ i(
|
|
100
|
+
l && /* @__PURE__ */ i(p, { className: "min-w-0 text-xs", children: l(e) })
|
|
77
101
|
] })
|
|
78
102
|
] });
|
|
79
103
|
}
|
|
80
|
-
function
|
|
104
|
+
function j({ ctx: e }) {
|
|
81
105
|
const { pool: l, underlyingToken: o, loading: t } = e;
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
-
/* @__PURE__ */ i(
|
|
84
|
-
/* @__PURE__ */ i(
|
|
106
|
+
return /* @__PURE__ */ m("div", { className: "flex flex-col items-start md:items-end", children: [
|
|
107
|
+
/* @__PURE__ */ i(f, { loading: !!t, width: 60, children: g(l.expectedLiquidityInUSD ?? 0) }),
|
|
108
|
+
/* @__PURE__ */ i(p, { children: T(
|
|
85
109
|
l.expectedLiquidity,
|
|
86
110
|
o
|
|
87
111
|
) })
|
|
88
112
|
] });
|
|
89
113
|
}
|
|
90
|
-
function
|
|
114
|
+
function O({ ctx: e }) {
|
|
91
115
|
const { pool: l, underlyingToken: o, loading: t } = e;
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */ i(
|
|
94
|
-
/* @__PURE__ */ i(
|
|
116
|
+
return /* @__PURE__ */ m("div", { className: "flex flex-col items-start md:items-end", children: [
|
|
117
|
+
/* @__PURE__ */ i(f, { loading: !!t, width: 60, children: g(l.totalBorrowedInUSD ?? 0) }),
|
|
118
|
+
/* @__PURE__ */ i(p, { children: T(
|
|
95
119
|
l.totalBorrowed,
|
|
96
120
|
o
|
|
97
121
|
) })
|
|
98
122
|
] });
|
|
99
123
|
}
|
|
100
|
-
function
|
|
101
|
-
const { pool: l, loading: o, underlyingToken: t } = e,
|
|
124
|
+
function _({ ctx: e }) {
|
|
125
|
+
const { pool: l, loading: o, underlyingToken: t } = e, r = t?.decimals ?? 18, n = l.poolTokenSymbol != null ? {
|
|
102
126
|
title: l.poolTokenSymbol,
|
|
103
|
-
decimals:
|
|
127
|
+
decimals: r
|
|
104
128
|
} : t;
|
|
105
|
-
return /* @__PURE__ */
|
|
129
|
+
return /* @__PURE__ */ m(
|
|
106
130
|
"div",
|
|
107
131
|
{
|
|
108
132
|
className: "flex flex-col items-start md:items-end",
|
|
109
|
-
"data-testid":
|
|
133
|
+
"data-testid": L.poolLineCellBalance,
|
|
110
134
|
children: [
|
|
111
|
-
/* @__PURE__ */ i(
|
|
112
|
-
l.userBalance !== void 0 &&
|
|
135
|
+
/* @__PURE__ */ i(f, { loading: !!o, width: 60, children: g(l.userBalanceInUSD ?? 0) }),
|
|
136
|
+
l.userBalance !== void 0 && n && /* @__PURE__ */ i(p, { children: T(l.userBalance, n) })
|
|
113
137
|
]
|
|
114
138
|
}
|
|
115
139
|
);
|
|
116
140
|
}
|
|
117
|
-
function
|
|
118
|
-
const t = e.pool.collateralTokens, { tokensList:
|
|
119
|
-
return !t?.length || !
|
|
120
|
-
|
|
141
|
+
function U(e, l, o) {
|
|
142
|
+
const t = e.pool.collateralTokens, { tokensList: r, isMobile: n } = e, { mode: a = "cascade", ...s } = o ?? {};
|
|
143
|
+
return !t?.length || !r ? null : /* @__PURE__ */ i(
|
|
144
|
+
k,
|
|
121
145
|
{
|
|
122
146
|
maxAssets: l,
|
|
123
|
-
tokensList:
|
|
124
|
-
balances: t.map((
|
|
125
|
-
iconSize:
|
|
147
|
+
tokensList: r,
|
|
148
|
+
balances: t.map((c) => ({ token: c })),
|
|
149
|
+
iconSize: n ? 20 : 24,
|
|
126
150
|
options: { mode: a, ...s }
|
|
127
151
|
}
|
|
128
152
|
);
|
|
129
153
|
}
|
|
130
|
-
function
|
|
154
|
+
function ue(e) {
|
|
131
155
|
const { header: l, mobileTitle: o } = d(
|
|
132
156
|
e,
|
|
133
157
|
"components.poolTable.pool"
|
|
@@ -139,17 +163,18 @@ function ae(e) {
|
|
|
139
163
|
align: "left",
|
|
140
164
|
className: "pl-4",
|
|
141
165
|
cell: (t) => /* @__PURE__ */ i(
|
|
142
|
-
|
|
166
|
+
R,
|
|
143
167
|
{
|
|
144
168
|
ctx: t,
|
|
145
169
|
renderDescription: e?.renderDescription,
|
|
146
|
-
getPoolName: e?.getPoolName
|
|
170
|
+
getPoolName: e?.getPoolName,
|
|
171
|
+
rwaTooltip: e?.rwaTooltip
|
|
147
172
|
}
|
|
148
173
|
),
|
|
149
174
|
mobileTitle: o
|
|
150
175
|
};
|
|
151
176
|
}
|
|
152
|
-
function
|
|
177
|
+
function pe(e) {
|
|
153
178
|
const { header: l, mobileTitle: o } = d(
|
|
154
179
|
e,
|
|
155
180
|
"components.poolTable.supply"
|
|
@@ -161,11 +186,11 @@ function de(e) {
|
|
|
161
186
|
align: "right",
|
|
162
187
|
hideOnMedium: e?.hideOnMedium,
|
|
163
188
|
sort: e?.sortField !== void 0 ? { field: e.sortField, defaultDirection: "desc" } : { field: "supply", defaultDirection: "desc" },
|
|
164
|
-
cell: (t) => /* @__PURE__ */ i(
|
|
189
|
+
cell: (t) => /* @__PURE__ */ i(j, { ctx: t }),
|
|
165
190
|
mobileTitle: o
|
|
166
191
|
};
|
|
167
192
|
}
|
|
168
|
-
function
|
|
193
|
+
function fe(e) {
|
|
169
194
|
const { header: l, headerTip: o, mobileTitle: t } = d(
|
|
170
195
|
e,
|
|
171
196
|
"components.poolTable.supplyApy",
|
|
@@ -178,24 +203,24 @@ function se(e) {
|
|
|
178
203
|
width: e?.width ?? "1.25fr",
|
|
179
204
|
align: "right",
|
|
180
205
|
sort: e?.sortField !== void 0 ? { field: e.sortField, defaultDirection: "desc" } : { field: "apy", defaultDirection: "desc" },
|
|
181
|
-
cell: (
|
|
182
|
-
const { apy:
|
|
183
|
-
totalAPY:
|
|
184
|
-
baseAPY:
|
|
185
|
-
extraAPY:
|
|
206
|
+
cell: (r) => {
|
|
207
|
+
const { apy: n, loading: a, points: s, tokensList: c } = r, {
|
|
208
|
+
totalAPY: h = 0,
|
|
209
|
+
baseAPY: u = [],
|
|
210
|
+
extraAPY: b = [],
|
|
186
211
|
externalAPY: y,
|
|
187
|
-
apy7DAgo:
|
|
188
|
-
} =
|
|
189
|
-
return /* @__PURE__ */ i(
|
|
212
|
+
apy7DAgo: A
|
|
213
|
+
} = n ?? {};
|
|
214
|
+
return /* @__PURE__ */ i(f, { width: 60, loading: !!a, children: /* @__PURE__ */ i(
|
|
190
215
|
C,
|
|
191
216
|
{
|
|
192
|
-
totalAPY:
|
|
217
|
+
totalAPY: h,
|
|
193
218
|
totalAPYLoading: !!a,
|
|
194
|
-
baseAPY:
|
|
195
|
-
extraAPY:
|
|
219
|
+
baseAPY: u,
|
|
220
|
+
extraAPY: b,
|
|
196
221
|
points: s,
|
|
197
|
-
apy7DAgo:
|
|
198
|
-
tokensList:
|
|
222
|
+
apy7DAgo: A,
|
|
223
|
+
tokensList: c,
|
|
199
224
|
externalAPY: y
|
|
200
225
|
}
|
|
201
226
|
) });
|
|
@@ -203,7 +228,7 @@ function se(e) {
|
|
|
203
228
|
mobileTitle: t
|
|
204
229
|
};
|
|
205
230
|
}
|
|
206
|
-
function
|
|
231
|
+
function he(e) {
|
|
207
232
|
const { header: l, mobileTitle: o } = d(
|
|
208
233
|
e,
|
|
209
234
|
"components.poolTable.borrowed"
|
|
@@ -213,11 +238,11 @@ function ce(e) {
|
|
|
213
238
|
header: l,
|
|
214
239
|
width: e?.width ?? "1.15fr",
|
|
215
240
|
align: "right",
|
|
216
|
-
cell: (t) => /* @__PURE__ */ i(
|
|
241
|
+
cell: (t) => /* @__PURE__ */ i(O, { ctx: t }),
|
|
217
242
|
mobileTitle: o
|
|
218
243
|
};
|
|
219
244
|
}
|
|
220
|
-
function
|
|
245
|
+
function ge(e) {
|
|
221
246
|
const { header: l, headerTip: o, mobileTitle: t } = d(
|
|
222
247
|
e,
|
|
223
248
|
"components.poolTable.borrowApy"
|
|
@@ -228,14 +253,14 @@ function me(e) {
|
|
|
228
253
|
headerTip: o,
|
|
229
254
|
width: e?.width ?? "150px",
|
|
230
255
|
align: "right",
|
|
231
|
-
cell: (
|
|
232
|
-
const
|
|
233
|
-
return /* @__PURE__ */ i("div", { className: "flex justify-start md:justify-end", children:
|
|
256
|
+
cell: (r) => {
|
|
257
|
+
const n = r.pool.borrowAPY ?? e?.getBorrowRate?.(r.pool) ?? 0;
|
|
258
|
+
return /* @__PURE__ */ i("div", { className: "flex justify-start md:justify-end", children: z(n) });
|
|
234
259
|
},
|
|
235
260
|
mobileTitle: t
|
|
236
261
|
};
|
|
237
262
|
}
|
|
238
|
-
function
|
|
263
|
+
function Te(e) {
|
|
239
264
|
const { header: l, mobileTitle: o } = d(
|
|
240
265
|
e,
|
|
241
266
|
"components.poolTable.utilization"
|
|
@@ -248,14 +273,14 @@ function ue(e) {
|
|
|
248
273
|
className: "pr-4",
|
|
249
274
|
sort: e?.sortField !== void 0 ? { field: e.sortField, defaultDirection: "desc" } : { field: "utilization", defaultDirection: "desc" },
|
|
250
275
|
cell: (t) => {
|
|
251
|
-
const
|
|
252
|
-
return /* @__PURE__ */ i("div", { className: "flex justify-start md:justify-end", children: /* @__PURE__ */ i(
|
|
276
|
+
const r = t.pool.utilization ?? 0;
|
|
277
|
+
return /* @__PURE__ */ i("div", { className: "flex justify-start md:justify-end", children: /* @__PURE__ */ i(v, { percent: r }) });
|
|
253
278
|
},
|
|
254
279
|
mobileTitle: o
|
|
255
280
|
};
|
|
256
281
|
}
|
|
257
|
-
function
|
|
258
|
-
const l = e?.maxAssets ?? 5, o = (
|
|
282
|
+
function we(e) {
|
|
283
|
+
const l = e?.maxAssets ?? 5, o = (n) => U(n, l, e?.options), { header: t, mobileTitle: r } = d(
|
|
259
284
|
e,
|
|
260
285
|
"components.poolTable.collateral"
|
|
261
286
|
);
|
|
@@ -267,10 +292,10 @@ function pe(e) {
|
|
|
267
292
|
gapBefore: e?.gapBefore ?? "md",
|
|
268
293
|
cell: e?.cell ?? o,
|
|
269
294
|
mobileCell: e?.mobileCell ?? e?.cell ?? o,
|
|
270
|
-
mobileTitle:
|
|
295
|
+
mobileTitle: r
|
|
271
296
|
};
|
|
272
297
|
}
|
|
273
|
-
function
|
|
298
|
+
function be(e) {
|
|
274
299
|
const { header: l, mobileTitle: o } = d(
|
|
275
300
|
e,
|
|
276
301
|
"components.poolTable.balance"
|
|
@@ -283,22 +308,22 @@ function fe(e) {
|
|
|
283
308
|
className: e?.className ?? "pr-4",
|
|
284
309
|
headerClassName: e?.headerClassName ?? "pr-4",
|
|
285
310
|
sort: e?.sortField !== void 0 ? { field: e.sortField, defaultDirection: "desc" } : { field: "balance", defaultDirection: "desc" },
|
|
286
|
-
cell: e?.cell ?? ((t) => /* @__PURE__ */ i(
|
|
311
|
+
cell: e?.cell ?? ((t) => /* @__PURE__ */ i(_, { ctx: t })),
|
|
287
312
|
mobileTitle: o
|
|
288
313
|
};
|
|
289
314
|
}
|
|
290
|
-
function
|
|
315
|
+
function ye(e) {
|
|
291
316
|
return e;
|
|
292
317
|
}
|
|
293
318
|
export {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
319
|
+
be as balanceColumn,
|
|
320
|
+
ge as borrowApyColumn,
|
|
321
|
+
he as borrowedColumn,
|
|
322
|
+
we as collateralColumn,
|
|
323
|
+
ye as customColumn,
|
|
324
|
+
F as defaultPoolName,
|
|
325
|
+
ue as poolColumn,
|
|
326
|
+
fe as supplyApyColumn,
|
|
327
|
+
pe as supplyColumn,
|
|
328
|
+
Te as utilizationColumn
|
|
304
329
|
};
|