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