@gearbox-protocol/ui-kit 4.0.0-next.15 → 4.0.0-next.17

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 (51) hide show
  1. package/dist/cjs/components/base/index.cjs +1 -1
  2. package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
  3. package/dist/cjs/components/base/position-assets/constants.cjs +1 -0
  4. package/dist/cjs/components/base/position-assets/index.cjs +1 -0
  5. package/dist/cjs/components/base/position-assets/position-assets.cjs +1 -0
  6. package/dist/cjs/components/base/stat-badge/constants.cjs +1 -1
  7. package/dist/cjs/components/base/stat-badge/stat-badge.cjs +1 -1
  8. package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
  9. package/dist/cjs/components/base/tabber/tabber.cjs +1 -1
  10. package/dist/cjs/components/base/values/scalars.cjs +1 -1
  11. package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
  12. package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
  13. package/dist/cjs/components/index.cjs +1 -1
  14. package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
  15. package/dist/cjs/components/yield-breakdown-tooltip/yield-breakdown-tooltip.cjs +1 -1
  16. package/dist/cjs/index.cjs +1 -1
  17. package/dist/cjs/locale/en.json.cjs +1 -1
  18. package/dist/cjs/utils/index.cjs +1 -1
  19. package/dist/cjs/utils/strategy-apy.cjs +1 -0
  20. package/dist/esm/components/base/index.js +112 -108
  21. package/dist/esm/components/base/info-list/info-list.js +7 -6
  22. package/dist/esm/components/base/position-assets/constants.js +8 -0
  23. package/dist/esm/components/base/position-assets/index.js +6 -0
  24. package/dist/esm/components/base/position-assets/position-assets.js +73 -0
  25. package/dist/esm/components/base/stat-badge/constants.js +1 -0
  26. package/dist/esm/components/base/stat-badge/stat-badge.js +87 -52
  27. package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +130 -110
  28. package/dist/esm/components/base/tabber/tabber.js +67 -64
  29. package/dist/esm/components/base/values/scalars.js +52 -33
  30. package/dist/esm/components/checkbox/checkbox-labeled.js +1 -1
  31. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +1 -1
  32. package/dist/esm/components/index.js +662 -658
  33. package/dist/esm/components/with-copy/with-copy.js +1 -1
  34. package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown-tooltip.js +20 -19
  35. package/dist/esm/index.js +858 -850
  36. package/dist/esm/locale/en.json.js +2 -1
  37. package/dist/esm/utils/index.js +64 -60
  38. package/dist/esm/utils/strategy-apy.js +41 -0
  39. package/dist/types/components/base/index.d.ts +1 -0
  40. package/dist/types/components/base/position-assets/constants.d.ts +5 -0
  41. package/dist/types/components/base/position-assets/index.d.ts +2 -0
  42. package/dist/types/components/base/position-assets/position-assets.d.ts +49 -0
  43. package/dist/types/components/base/stat-badge/constants.d.ts +1 -0
  44. package/dist/types/components/base/stat-badge/stat-badge.d.ts +11 -1
  45. package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts +12 -0
  46. package/dist/types/components/base/tabber/tabber.d.ts +2 -2
  47. package/dist/types/components/base/values/scalars.d.ts +4 -0
  48. package/dist/types/locale/en.json.d.ts +2 -1
  49. package/dist/types/utils/index.d.ts +1 -0
  50. package/dist/types/utils/strategy-apy.d.ts +37 -0
  51. package/package.json +1 -1
@@ -36,6 +36,7 @@ import "../simple-accordion/simple-accordion.js";
36
36
  import "../tip-card/tip-card.js";
37
37
  import "../typography/typography.js";
38
38
  import "../points-icon/points-icon.js";
39
+ import "viem";
39
40
  import "../vertical-indicator/vertical-indicator.js";
40
41
  import "../base/page-title/page-title.js";
41
42
  import "../detailed-page-title/detailed-page-title-copy-button.js";
@@ -72,7 +73,6 @@ import "../dialog/dialog-header.js";
72
73
  import "../dialog/dialog-title.js";
73
74
  import "../dialog/dialog-modal-container.js";
74
75
  import "../dialog/dialog-overlay.js";
75
- import "viem";
76
76
  import "../input/input.js";
77
77
  import "../label/label.js";
78
78
  import "../simple-dropdown/simple-dropdown.js";
@@ -1,25 +1,26 @@
1
- import { jsxs as a, jsx as e, Fragment as k } from "react/jsx-runtime";
2
- import { PointsIcon as N } from "../points-icon/points-icon.js";
3
- import { TokenIcon as P } from "../token-icon/token-icon.js";
4
- import { SimpleTooltip as A } from "../tooltip/simple-tooltip.js";
1
+ import { jsxs as a, jsx as e, Fragment as P } from "react/jsx-runtime";
2
+ import { PointsIcon as A } from "../points-icon/points-icon.js";
3
+ import { TokenIcon as I } from "../token-icon/token-icon.js";
4
+ import { SimpleTooltip as T } from "../tooltip/simple-tooltip.js";
5
5
  import "../tooltip/tooltip.js";
6
6
  import { FormattedMessageTyped as s } from "../typed-intl/index.js";
7
7
  import "react";
8
- import { tokenRewardsOf as I, pointProgramsOf as B, totalApyOf as T } from "../../utils/apy-breakdown.js";
8
+ import { tokenRewardsOf as B, pointProgramsOf as R, totalApyOf as $ } from "../../utils/apy-breakdown.js";
9
9
  import "@gearbox-protocol/sdk";
10
- import { bpsToPercent as $ } from "../../utils/bps.js";
10
+ import { bpsToPercent as j } from "../../utils/bps.js";
11
11
  import { cn as p } from "../../utils/cn.js";
12
12
  import "sonner";
13
- import { formatLeverage as j } from "../../utils/format-leverage.js";
14
- import { formatCompactPercent as R } from "../../utils/format-money.js";
13
+ import { formatLeverage as S } from "../../utils/format-leverage.js";
14
+ import { formatCompactPercent as C } from "../../utils/format-money.js";
15
+ import { strategyQuotaRate as O } from "../../utils/strategy-apy.js";
15
16
  import "@gearbox-protocol/sdk/common-utils";
16
17
  import "luxon";
17
18
  import "../../utils/z-index.js";
18
19
  function i(n) {
19
- const o = $(n), r = R(Math.abs(o));
20
+ const o = j(n), r = C(Math.abs(o));
20
21
  return o < 0 ? `-${r}` : r;
21
22
  }
22
- function U({
23
+ function L({
23
24
  supplyApy: n,
24
25
  maxLeverage: o,
25
26
  collateralApy: r,
@@ -28,7 +29,7 @@ function U({
28
29
  children: h,
29
30
  className: f
30
31
  }) {
31
- const g = o !== void 0 && o > 0, l = r ?? n, w = I(l), y = B(n), b = T(n), d = c != null || u != null ? -((c ?? 0) + (u ?? 0)) : void 0, x = y.filter((t) => t.multiplier != null), v = /* @__PURE__ */ a(
32
+ const g = o !== void 0 && o > 0, l = r ?? n, y = B(l), w = R(n), b = $(n), v = c != null || u != null, k = O({ additionalBorrowApy: u, maxLeverage: o }), d = v ? -((c ?? 0) + k) : void 0, x = w.filter((t) => t.multiplier != null), N = /* @__PURE__ */ a(
32
33
  "div",
33
34
  {
34
35
  className: p(
@@ -46,7 +47,7 @@ function U({
46
47
  {
47
48
  messageId: "components.yieldBreakdown.titleNetAtLeverage",
48
49
  values: {
49
- leverage: j(o)
50
+ leverage: S(o)
50
51
  }
51
52
  }
52
53
  ) : /* @__PURE__ */ e(s, { messageId: "components.apyParts.totalAPY" }) }),
@@ -69,7 +70,7 @@ function U({
69
70
  value: i(l.organicApy)
70
71
  }
71
72
  ),
72
- w.map((t) => t.supplyApr == null ? null : /* @__PURE__ */ e(
73
+ y.map((t) => t.supplyApr == null ? null : /* @__PURE__ */ e(
73
74
  m,
74
75
  {
75
76
  muted: t.supplyApr < 0,
@@ -81,7 +82,7 @@ function U({
81
82
  values: { symbol: t.token.symbol }
82
83
  }
83
84
  ) }),
84
- /* @__PURE__ */ e(P, { token: t.token, size: 20 })
85
+ /* @__PURE__ */ e(I, { token: t.token, size: 20 })
85
86
  ] }),
86
87
  value: i(t.supplyApr)
87
88
  },
@@ -95,7 +96,7 @@ function U({
95
96
  value: i(d)
96
97
  }
97
98
  ),
98
- x.length > 0 && /* @__PURE__ */ a(k, { children: [
99
+ x.length > 0 && /* @__PURE__ */ a(P, { children: [
99
100
  /* @__PURE__ */ e("div", { className: "h-px w-full bg-divider" }),
100
101
  x.map((t) => /* @__PURE__ */ e(
101
102
  m,
@@ -109,7 +110,7 @@ function U({
109
110
  }
110
111
  ) }),
111
112
  /* @__PURE__ */ e(
112
- N,
113
+ A,
113
114
  {
114
115
  reward: {
115
116
  name: t.name,
@@ -128,7 +129,7 @@ function U({
128
129
  }
129
130
  );
130
131
  return /* @__PURE__ */ e(
131
- A,
132
+ T,
132
133
  {
133
134
  placement: "bottom",
134
135
  triangle: !1,
@@ -137,7 +138,7 @@ function U({
137
138
  maxWidth: "100%",
138
139
  title: /* @__PURE__ */ e("span", { className: f, children: h }),
139
140
  triggerClassName: f,
140
- children: v
141
+ children: N
141
142
  }
142
143
  );
143
144
  }
@@ -161,5 +162,5 @@ function m({
161
162
  ] });
162
163
  }
163
164
  export {
164
- U as YieldBreakdownTooltip
165
+ L as YieldBreakdownTooltip
165
166
  };