@gearbox-protocol/ui-kit 3.13.1 → 3.14.0-next.10
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/buttons/button/button.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-button/styled-button.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.cjs +1 -1
- package/dist/cjs/components/graph/formatters.cjs +1 -1
- package/dist/cjs/components/graph/graph.cjs +1 -1
- package/dist/cjs/components/layout/main-aside-layout/main-aside-layout.cjs +1 -1
- package/dist/cjs/components/smart-number-input/smart-number-input.cjs +1 -1
- package/dist/cjs/components/trading-view/trading-view.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/esm/components/buttons/button/button.js +1 -0
- package/dist/esm/components/client-adapters/styled-button/styled-button.js +11 -11
- package/dist/esm/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.js +131 -122
- package/dist/esm/components/graph/formatters.js +127 -132
- package/dist/esm/components/graph/graph.js +339 -293
- package/dist/esm/components/health-factor/health-factor.js +3 -3
- package/dist/esm/components/layout/main-aside-layout/main-aside-layout.js +104 -21
- package/dist/esm/components/smart-number-input/smart-number-input.js +253 -104
- package/dist/esm/components/trading-view/trading-view.js +58 -58
- package/dist/esm/locale/en.json.js +2 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/buttons/button/button.d.ts +4 -3
- package/dist/types/components/graph/graph.d.ts +8 -1
- package/dist/types/components/help-tip/help-tip.d.ts +2 -2
- package/dist/types/components/layout/main-aside-layout/main-aside-layout.d.ts +80 -5
- package/dist/types/components/smart-number-input/smart-number-input.d.ts +52 -0
- package/dist/types/components/tip-card/tip-card.d.ts +1 -1
- package/dist/types/components/trading-view/trading-view.d.ts +7 -0
- package/dist/types/locale/en.json.d.ts +2 -0
- package/package.json +3 -3
- package/src/styles/base.css +4 -2
|
@@ -1,160 +1,169 @@
|
|
|
1
|
-
import { jsxs as r, jsx as e, Fragment as
|
|
2
|
-
import { faXmark as
|
|
1
|
+
import { jsxs as r, jsx as e, Fragment as I } from "react/jsx-runtime";
|
|
2
|
+
import { faXmark as W } from "@fortawesome/free-solid-svg-icons";
|
|
3
3
|
import { formatPercentage as s, formatLeverage as _ } from "@gearbox-protocol/sdk";
|
|
4
|
-
import { zeroAddress as
|
|
4
|
+
import { zeroAddress as j } from "viem";
|
|
5
5
|
import { IconButton as H } from "../../../../icon-button/icon-button.js";
|
|
6
6
|
import { FaIcon as U } from "../../../../icons/fa-icon.js";
|
|
7
|
-
import { SeparateLine as
|
|
8
|
-
import { Skeleton as
|
|
7
|
+
import { SeparateLine as X } from "../../../../separate-line/separate-line.js";
|
|
8
|
+
import { Skeleton as v } from "../../../../skeleton/skeleton.js";
|
|
9
9
|
import "react";
|
|
10
|
-
import { cn as
|
|
10
|
+
import { cn as G } from "../../../../../utils/cn.js";
|
|
11
11
|
import "sonner";
|
|
12
12
|
import "@gearbox-protocol/sdk/common-utils";
|
|
13
13
|
import "luxon";
|
|
14
14
|
import "../../../../../utils/z-index.js";
|
|
15
|
-
import { TipCard as
|
|
15
|
+
import { TipCard as y } from "../../../../tip-card/tip-card.js";
|
|
16
16
|
import { FormattedMessageTyped as o } from "../../../../typed-intl/index.js";
|
|
17
|
-
import { Typography as
|
|
18
|
-
import { VerticalIndicator as
|
|
19
|
-
import { VerticalList as
|
|
20
|
-
import { VSpace as
|
|
21
|
-
import { APYFeatureTooltip as
|
|
22
|
-
import { PointsFeatureTooltip as
|
|
23
|
-
import { RewardsTooltipRoot as
|
|
24
|
-
const
|
|
25
|
-
function
|
|
17
|
+
import { Typography as p } from "../../../../typography/typography.js";
|
|
18
|
+
import { VerticalIndicator as R } from "../../../../vertical-indicator/vertical-indicator.js";
|
|
19
|
+
import { VerticalList as N } from "../../../../vertical-list/vertical-list.js";
|
|
20
|
+
import { VSpace as L } from "../../../../vspace/vspace.js";
|
|
21
|
+
import { APYFeatureTooltip as d } from "../apy-feature/apy-feature.js";
|
|
22
|
+
import { PointsFeatureTooltip as c } from "../points-feature/points-feature.js";
|
|
23
|
+
import { RewardsTooltipRoot as J } from "./rewards-tooltip-root.js";
|
|
24
|
+
const K = 0;
|
|
25
|
+
function ye({
|
|
26
26
|
cellInfo: a,
|
|
27
27
|
targetToken: n,
|
|
28
28
|
apyListByNetwork: i,
|
|
29
|
-
tokensList:
|
|
30
|
-
strategyCreditManagers:
|
|
31
|
-
onClose:
|
|
29
|
+
tokensList: h,
|
|
30
|
+
strategyCreditManagers: P,
|
|
31
|
+
onClose: A,
|
|
32
32
|
theme: F = "modal"
|
|
33
33
|
}) {
|
|
34
34
|
const {
|
|
35
35
|
maxAPY: S,
|
|
36
36
|
minCreditManager: l,
|
|
37
|
-
bonusAPY:
|
|
38
|
-
maxLeverage:
|
|
37
|
+
bonusAPY: C,
|
|
38
|
+
maxLeverage: Y,
|
|
39
39
|
apyLoading: u,
|
|
40
40
|
hasPoints: z,
|
|
41
41
|
isPointsWithAPY: D,
|
|
42
|
-
rewards:
|
|
43
|
-
debtRewards:
|
|
42
|
+
rewards: g,
|
|
43
|
+
debtRewards: w,
|
|
44
44
|
rewardRates: V,
|
|
45
45
|
debtRewardRates: q,
|
|
46
46
|
quotaRate: B
|
|
47
|
-
} = a,
|
|
48
|
-
return /* @__PURE__ */ r(
|
|
49
|
-
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
b
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
d,
|
|
90
|
-
{
|
|
91
|
-
reward: t,
|
|
92
|
-
points: t.multiplier,
|
|
93
|
-
tip: /* @__PURE__ */ e(
|
|
94
|
-
$,
|
|
95
|
-
{
|
|
96
|
-
tokensList: c,
|
|
97
|
-
strategyCreditManagers: y,
|
|
98
|
-
reward: t
|
|
99
|
-
}
|
|
47
|
+
} = a, k = l?.chainId || K, b = i?.[k]?.apyList?.[n] || 0, m = i?.[k]?.extraCollateralAPYList?.[l?.pool || j]?.[n], E = D || !z, M = b > 0 || m !== void 0 && m.value > 0 || g.length > 0 || w.length > 0;
|
|
48
|
+
return /* @__PURE__ */ r(J, { theme: F, children: [
|
|
49
|
+
A && /* @__PURE__ */ e("div", { style: { position: "absolute", top: "-10px", right: "-10px" }, children: /* @__PURE__ */ e(H, { size: 26, buttonType: "filledDark", onClick: A, children: /* @__PURE__ */ e(U, { icon: W, style: { width: "12px", height: "12px" } }) }) }),
|
|
50
|
+
M && /* @__PURE__ */ r(I, { children: [
|
|
51
|
+
/* @__PURE__ */ e(y, { textColor: "dark", children: /* @__PURE__ */ r(
|
|
52
|
+
T,
|
|
53
|
+
{
|
|
54
|
+
title: /* @__PURE__ */ e(o, { messageId: "components.rewardsTooltip.without.title" }),
|
|
55
|
+
children: [
|
|
56
|
+
b > 0 && /* @__PURE__ */ e(
|
|
57
|
+
v,
|
|
58
|
+
{
|
|
59
|
+
className: "inline-block align-text-bottom",
|
|
60
|
+
width: 50,
|
|
61
|
+
loading: u,
|
|
62
|
+
children: /* @__PURE__ */ e(d, { value: `${s(b)}%` })
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
m && m.value > 0 && /* @__PURE__ */ e(
|
|
66
|
+
v,
|
|
67
|
+
{
|
|
68
|
+
className: "inline-block align-text-bottom",
|
|
69
|
+
width: 50,
|
|
70
|
+
loading: u,
|
|
71
|
+
children: /* @__PURE__ */ e(
|
|
72
|
+
d,
|
|
73
|
+
{
|
|
74
|
+
title: /* @__PURE__ */ e(o, { messageId: "components.rewardsTooltip.without.extra" }),
|
|
75
|
+
tip: /* @__PURE__ */ e(o, { messageId: "components.rewardsTooltip.without.extra.tip" }),
|
|
76
|
+
value: `${s(m.value)}%`
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
g.map((t) => /* @__PURE__ */ e(
|
|
82
|
+
c,
|
|
83
|
+
{
|
|
84
|
+
reward: t,
|
|
85
|
+
points: t.multiplier
|
|
86
|
+
},
|
|
87
|
+
["base", t.multiplier, t.name, t.type, t.units].join(
|
|
88
|
+
"-"
|
|
100
89
|
)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
90
|
+
)),
|
|
91
|
+
w.map((t) => /* @__PURE__ */ e(
|
|
92
|
+
c,
|
|
93
|
+
{
|
|
94
|
+
reward: t,
|
|
95
|
+
points: t.multiplier,
|
|
96
|
+
tip: /* @__PURE__ */ e(
|
|
97
|
+
$,
|
|
98
|
+
{
|
|
99
|
+
tokensList: h,
|
|
100
|
+
strategyCreditManagers: P,
|
|
101
|
+
reward: t
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
},
|
|
105
|
+
[
|
|
106
|
+
"debt",
|
|
107
|
+
t.multiplier,
|
|
108
|
+
t.name,
|
|
109
|
+
t.type,
|
|
110
|
+
t.units,
|
|
111
|
+
t.cm
|
|
112
|
+
].join("-")
|
|
113
|
+
))
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
) }),
|
|
117
|
+
/* @__PURE__ */ e(L, { height: 16 })
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ r(y, { textColor: "dark", borderColor: "gradient", children: [
|
|
120
|
+
/* @__PURE__ */ e(N, { children: /* @__PURE__ */ r(
|
|
121
|
+
T,
|
|
113
122
|
{
|
|
114
123
|
title: /* @__PURE__ */ e(
|
|
115
124
|
o,
|
|
116
125
|
{
|
|
117
126
|
messageId: "components.rewardsTooltip.with.title",
|
|
118
127
|
values: {
|
|
119
|
-
leverage:
|
|
128
|
+
leverage: Y > 0 ? `${_(Number(Y))}×` : ""
|
|
120
129
|
}
|
|
121
130
|
}
|
|
122
131
|
),
|
|
123
132
|
children: [
|
|
124
133
|
E && /* @__PURE__ */ e(
|
|
125
|
-
|
|
134
|
+
v,
|
|
126
135
|
{
|
|
127
136
|
className: "inline-block align-text-bottom",
|
|
128
137
|
width: 50,
|
|
129
138
|
loading: u,
|
|
130
|
-
children: /* @__PURE__ */ e(
|
|
139
|
+
children: /* @__PURE__ */ e(d, { value: `${s(S)}%` })
|
|
131
140
|
}
|
|
132
141
|
),
|
|
133
|
-
|
|
134
|
-
const
|
|
142
|
+
g.map((t, f) => {
|
|
143
|
+
const x = V?.[f] || 0n;
|
|
135
144
|
return /* @__PURE__ */ e(
|
|
136
|
-
|
|
145
|
+
c,
|
|
137
146
|
{
|
|
138
147
|
reward: t,
|
|
139
|
-
points:
|
|
148
|
+
points: x
|
|
140
149
|
},
|
|
141
150
|
["base", t.multiplier, t.name, t.type, t.units].join(
|
|
142
151
|
"-"
|
|
143
152
|
)
|
|
144
153
|
);
|
|
145
154
|
}),
|
|
146
|
-
|
|
147
|
-
const
|
|
155
|
+
w.map((t, f) => {
|
|
156
|
+
const x = q?.[f] || 0n;
|
|
148
157
|
return /* @__PURE__ */ e(
|
|
149
|
-
|
|
158
|
+
c,
|
|
150
159
|
{
|
|
151
160
|
reward: t,
|
|
152
|
-
points:
|
|
161
|
+
points: x,
|
|
153
162
|
tip: /* @__PURE__ */ e(
|
|
154
163
|
$,
|
|
155
164
|
{
|
|
156
|
-
tokensList:
|
|
157
|
-
strategyCreditManagers:
|
|
165
|
+
tokensList: h,
|
|
166
|
+
strategyCreditManagers: P,
|
|
158
167
|
reward: t
|
|
159
168
|
}
|
|
160
169
|
)
|
|
@@ -172,52 +181,52 @@ function xe({
|
|
|
172
181
|
]
|
|
173
182
|
}
|
|
174
183
|
) }),
|
|
175
|
-
/* @__PURE__ */ e(
|
|
176
|
-
/* @__PURE__ */ r(
|
|
184
|
+
/* @__PURE__ */ e(X, { margin: 16 }),
|
|
185
|
+
/* @__PURE__ */ r(N, { children: [
|
|
177
186
|
l && /* @__PURE__ */ e(
|
|
178
|
-
|
|
187
|
+
R,
|
|
179
188
|
{
|
|
180
|
-
label: /* @__PURE__ */ e(
|
|
189
|
+
label: /* @__PURE__ */ e(p, { as: "span", color: "secondary", children: /* @__PURE__ */ e(
|
|
181
190
|
o,
|
|
182
191
|
{
|
|
183
192
|
values: {
|
|
184
|
-
symbol:
|
|
193
|
+
symbol: h?.[l.underlyingToken]?.title || "Utilization"
|
|
185
194
|
},
|
|
186
195
|
messageId: "components.rewardsTooltip.with.borrowRate"
|
|
187
196
|
}
|
|
188
197
|
) }),
|
|
189
|
-
value: /* @__PURE__ */ e(
|
|
198
|
+
value: /* @__PURE__ */ e(p, { as: "span", color: "secondary", children: `${s(
|
|
190
199
|
l.baseBorrowRate
|
|
191
200
|
)}%` })
|
|
192
201
|
}
|
|
193
202
|
),
|
|
194
203
|
l && /* @__PURE__ */ e(
|
|
195
|
-
|
|
204
|
+
R,
|
|
196
205
|
{
|
|
197
|
-
label: /* @__PURE__ */ e(
|
|
198
|
-
value: /* @__PURE__ */ e(
|
|
206
|
+
label: /* @__PURE__ */ e(p, { as: "span", color: "secondary", children: /* @__PURE__ */ e(o, { messageId: "components.rewardsTooltip.with.quotaRate" }) }),
|
|
207
|
+
value: /* @__PURE__ */ e(p, { as: "span", color: "secondary", children: `${s(Number(B))}%` })
|
|
199
208
|
}
|
|
200
209
|
)
|
|
201
210
|
] })
|
|
202
211
|
] }),
|
|
203
|
-
|
|
204
|
-
/* @__PURE__ */ e(
|
|
212
|
+
C && /* @__PURE__ */ r(I, { children: [
|
|
213
|
+
/* @__PURE__ */ e(L, { height: 16 }),
|
|
205
214
|
/* @__PURE__ */ e(
|
|
206
|
-
|
|
215
|
+
y,
|
|
207
216
|
{
|
|
208
217
|
backgroundColor: "gray-10",
|
|
209
218
|
textColor: "light",
|
|
210
219
|
borderColor: "dark",
|
|
211
220
|
children: /* @__PURE__ */ e(
|
|
212
|
-
|
|
221
|
+
T,
|
|
213
222
|
{
|
|
214
223
|
title: /* @__PURE__ */ e(o, { messageId: "components.rewardsTooltip.with.bonusAPY.title" }),
|
|
215
224
|
children: /* @__PURE__ */ e("div", { className: "flex-col-12", children: /* @__PURE__ */ e(
|
|
216
|
-
|
|
225
|
+
d,
|
|
217
226
|
{
|
|
218
227
|
theme: "light",
|
|
219
228
|
tip: /* @__PURE__ */ e(o, { messageId: "components.rewardsTooltip.with.bonusAPY.tip" }),
|
|
220
|
-
value: `${s(
|
|
229
|
+
value: `${s(C.value)}%`
|
|
221
230
|
}
|
|
222
231
|
) })
|
|
223
232
|
}
|
|
@@ -227,10 +236,10 @@ function xe({
|
|
|
227
236
|
] })
|
|
228
237
|
] });
|
|
229
238
|
}
|
|
230
|
-
function
|
|
231
|
-
return /* @__PURE__ */ r(
|
|
232
|
-
/* @__PURE__ */ e("div", { className:
|
|
233
|
-
|
|
239
|
+
function T({ title: a, children: n, theme: i = "main" }) {
|
|
240
|
+
return /* @__PURE__ */ r(I, { children: [
|
|
241
|
+
/* @__PURE__ */ e("div", { className: G("flex-col-12", i === "main" ? "mb-3" : "mb-2"), children: /* @__PURE__ */ e(
|
|
242
|
+
p,
|
|
234
243
|
{
|
|
235
244
|
as: "span",
|
|
236
245
|
variant: "bodySmall",
|
|
@@ -252,11 +261,11 @@ function $({
|
|
|
252
261
|
{
|
|
253
262
|
messageId: "components.strategiesTable.line.points.tip",
|
|
254
263
|
values: {
|
|
255
|
-
symbol: i?.[n[a.cm]?.underlyingToken ||
|
|
264
|
+
symbol: i?.[n[a.cm]?.underlyingToken || j]?.title || "unknown"
|
|
256
265
|
}
|
|
257
266
|
}
|
|
258
267
|
);
|
|
259
268
|
}
|
|
260
269
|
export {
|
|
261
|
-
|
|
270
|
+
ye as RewardsTooltipContent
|
|
262
271
|
};
|