@gearbox-protocol/ui-kit 4.0.0-next.3 → 4.0.0-next.5

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 (232) hide show
  1. package/dist/cjs/components/assets-list-cell/assets-list-cell.cjs +1 -1
  2. package/dist/cjs/components/badge/badge.cjs +1 -1
  3. package/dist/cjs/components/badge/chip.cjs +1 -0
  4. package/dist/cjs/components/badge/index.cjs +1 -1
  5. package/dist/cjs/components/base/borrow-rate-block/borrow-rate-block.cjs +1 -1
  6. package/dist/cjs/components/base/chart-with-side-card/chart-with-side-card.cjs +1 -1
  7. package/dist/cjs/components/base/detailed-page-title/detailed-page-title.cjs +1 -1
  8. package/dist/cjs/components/base/health-factor-block/health-factor-block.cjs +1 -1
  9. package/dist/cjs/components/base/history-chart/history-chart.cjs +1 -1
  10. package/dist/cjs/components/base/index.cjs +1 -1
  11. package/dist/cjs/components/base/info-list/index.cjs +1 -1
  12. package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
  13. package/dist/cjs/components/base/leverage-input/leverage-input.cjs +1 -1
  14. package/dist/cjs/components/base/leverage-preset-chips/constants.cjs +1 -0
  15. package/dist/cjs/components/base/leverage-preset-chips/index.cjs +1 -0
  16. package/dist/cjs/components/base/leverage-preset-chips/leverage-preset-chips.cjs +1 -0
  17. package/dist/cjs/components/base/liquidation-price-block/liquidation-price-block.cjs +1 -1
  18. package/dist/cjs/components/base/manage-pane/constants.cjs +1 -1
  19. package/dist/cjs/components/base/manage-pane/manage-pane.cjs +1 -1
  20. package/dist/cjs/components/base/page-title/index.cjs +1 -1
  21. package/dist/cjs/components/base/page-title/page-title.cjs +1 -1
  22. package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
  23. package/dist/cjs/components/base/stat-badge/stat-badge.cjs +1 -1
  24. package/dist/cjs/components/base/strategy-apy-breakdown-card/constants.cjs +1 -1
  25. package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
  26. package/dist/cjs/components/base/time-to-liquidation-block/time-to-liquidation-block.cjs +1 -1
  27. package/dist/cjs/components/base/title-meta/constants.cjs +1 -1
  28. package/dist/cjs/components/base/title-meta/title-meta.cjs +1 -1
  29. package/dist/cjs/components/base/token-amount/token-amount.cjs +1 -1
  30. package/dist/cjs/components/base/values/constants.cjs +1 -1
  31. package/dist/cjs/components/base/values/index.cjs +1 -1
  32. package/dist/cjs/components/base/values/points-value.cjs +1 -0
  33. package/dist/cjs/components/base/values/position-status-badge.cjs +1 -0
  34. package/dist/cjs/components/base/values/position-type-badge.cjs +1 -1
  35. package/dist/cjs/components/base/values/scalars.cjs +1 -1
  36. package/dist/cjs/components/base-table/base-table-line.cjs +1 -0
  37. package/dist/cjs/components/base-table/base-table.cjs +1 -0
  38. package/dist/cjs/components/base-table/constants.cjs +1 -0
  39. package/dist/cjs/components/base-table/index.cjs +1 -0
  40. package/dist/cjs/components/base-table/types.cjs +1 -0
  41. package/dist/cjs/components/block-sync-pill/block-sync-pill.cjs +1 -1
  42. package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
  43. package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
  44. package/dist/cjs/components/collateral-allocation-tooltip/allocation-wheel.cjs +1 -0
  45. package/dist/cjs/components/collateral-allocation-tooltip/collateral-allocation-tooltip.cjs +1 -0
  46. package/dist/cjs/components/collateral-allocation-tooltip/constants.cjs +1 -0
  47. package/dist/cjs/components/collateral-allocation-tooltip/index.cjs +1 -0
  48. package/dist/cjs/components/composites/index.cjs +1 -1
  49. package/dist/cjs/components/composites/pool-assets-table/constants.cjs +1 -0
  50. package/dist/cjs/components/composites/pool-assets-table/index.cjs +1 -1
  51. package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-head.cjs +1 -1
  52. package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
  53. package/dist/cjs/components/composites/pool-assets-table/pool-assets-table.cjs +1 -1
  54. package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.cjs +1 -1
  55. package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
  56. package/dist/cjs/components/filter/filter-chip.cjs +1 -1
  57. package/dist/cjs/components/graph/default-config.cjs +1 -1
  58. package/dist/cjs/components/graph/graph-view.cjs +1 -1
  59. package/dist/cjs/components/graph/graph.cjs +1 -1
  60. package/dist/cjs/components/hf-indicator/hf-indicator.cjs +1 -0
  61. package/dist/cjs/components/hf-indicator/index.cjs +1 -0
  62. package/dist/cjs/components/index.cjs +1 -1
  63. package/dist/cjs/components/infinite-scroll/index.cjs +1 -0
  64. package/dist/cjs/components/infinite-scroll/infinite-scroll-wrapper.cjs +1 -0
  65. package/dist/cjs/components/name-cell/index.cjs +1 -0
  66. package/dist/cjs/components/name-cell/name-cell.cjs +1 -0
  67. package/dist/cjs/components/network-icon/index.cjs +1 -1
  68. package/dist/cjs/components/network-icon/network-indicator.cjs +1 -0
  69. package/dist/cjs/components/trading-view/trading-view.cjs +1 -1
  70. package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
  71. package/dist/cjs/components/yield-breakdown-tooltip/yield-breakdown-tooltip.cjs +1 -1
  72. package/dist/cjs/configs/tailwind-preset.cjs +1 -1
  73. package/dist/cjs/hooks/index.cjs +1 -1
  74. package/dist/cjs/hooks/use-observed-width-key.cjs +1 -0
  75. package/dist/cjs/index.cjs +1 -1
  76. package/dist/cjs/locale/en.json.cjs +1 -1
  77. package/dist/cjs/utils/format-leverage.cjs +1 -0
  78. package/dist/cjs/utils/format-money.cjs +1 -1
  79. package/dist/cjs/utils/index.cjs +1 -1
  80. package/dist/cjs/utils/leverage-presets.cjs +1 -0
  81. package/dist/esm/components/assets-list-cell/assets-list-cell.js +161 -159
  82. package/dist/esm/components/badge/badge.js +14 -8
  83. package/dist/esm/components/badge/chip.js +47 -0
  84. package/dist/esm/components/badge/index.js +8 -3
  85. package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +4 -2
  86. package/dist/esm/components/base/chart-with-side-card/chart-with-side-card.js +6 -6
  87. package/dist/esm/components/base/detailed-page-title/detailed-page-title.js +26 -27
  88. package/dist/esm/components/base/health-factor-block/health-factor-block.js +25 -25
  89. package/dist/esm/components/base/history-chart/history-chart.js +86 -46
  90. package/dist/esm/components/base/index.js +148 -138
  91. package/dist/esm/components/base/info-list/index.js +5 -4
  92. package/dist/esm/components/base/info-list/info-list.js +51 -27
  93. package/dist/esm/components/base/leverage-input/leverage-input.js +18 -20
  94. package/dist/esm/components/base/leverage-preset-chips/constants.js +7 -0
  95. package/dist/esm/components/base/leverage-preset-chips/index.js +6 -0
  96. package/dist/esm/components/base/leverage-preset-chips/leverage-preset-chips.js +39 -0
  97. package/dist/esm/components/base/liquidation-price-block/liquidation-price-block.js +33 -28
  98. package/dist/esm/components/base/manage-pane/constants.js +3 -2
  99. package/dist/esm/components/base/manage-pane/manage-pane.js +154 -113
  100. package/dist/esm/components/base/page-title/index.js +5 -4
  101. package/dist/esm/components/base/page-title/page-title.js +31 -23
  102. package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +23 -30
  103. package/dist/esm/components/base/stat-badge/stat-badge.js +18 -9
  104. package/dist/esm/components/base/strategy-apy-breakdown-card/constants.js +3 -2
  105. package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +194 -31
  106. package/dist/esm/components/base/time-to-liquidation-block/time-to-liquidation-block.js +31 -31
  107. package/dist/esm/components/base/title-meta/constants.js +1 -0
  108. package/dist/esm/components/base/title-meta/title-meta.js +53 -33
  109. package/dist/esm/components/base/token-amount/token-amount.js +17 -16
  110. package/dist/esm/components/base/values/constants.js +1 -0
  111. package/dist/esm/components/base/values/index.js +20 -16
  112. package/dist/esm/components/base/values/points-value.js +30 -0
  113. package/dist/esm/components/base/values/position-status-badge.js +26 -0
  114. package/dist/esm/components/base/values/position-type-badge.js +7 -6
  115. package/dist/esm/components/base/values/scalars.js +18 -17
  116. package/dist/esm/components/base-table/base-table-line.js +117 -0
  117. package/dist/esm/components/base-table/base-table.js +110 -0
  118. package/dist/esm/components/base-table/constants.js +12 -0
  119. package/dist/esm/components/base-table/index.js +9 -0
  120. package/dist/esm/components/base-table/types.js +1 -0
  121. package/dist/esm/components/block-sync-pill/block-sync-pill.js +24 -20
  122. package/dist/esm/components/checkbox/checkbox-labeled.js +22 -18
  123. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +22 -18
  124. package/dist/esm/components/collateral-allocation-tooltip/allocation-wheel.js +71 -0
  125. package/dist/esm/components/collateral-allocation-tooltip/collateral-allocation-tooltip.js +102 -0
  126. package/dist/esm/components/collateral-allocation-tooltip/constants.js +12 -0
  127. package/dist/esm/components/collateral-allocation-tooltip/index.js +9 -0
  128. package/dist/esm/components/composites/index.js +46 -44
  129. package/dist/esm/components/composites/pool-assets-table/constants.js +9 -0
  130. package/dist/esm/components/composites/pool-assets-table/index.js +8 -6
  131. package/dist/esm/components/composites/pool-assets-table/pool-assets-table-head.js +52 -30
  132. package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +109 -76
  133. package/dist/esm/components/composites/pool-assets-table/pool-assets-table.js +44 -26
  134. package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.js +31 -27
  135. package/dist/esm/components/compound-apy/compound-apy.js +85 -80
  136. package/dist/esm/components/filter/filter-chip.js +1 -0
  137. package/dist/esm/components/graph/default-config.js +20 -18
  138. package/dist/esm/components/graph/graph-view.js +72 -88
  139. package/dist/esm/components/graph/graph.js +459 -458
  140. package/dist/esm/components/hf-indicator/hf-indicator.js +33 -0
  141. package/dist/esm/components/hf-indicator/index.js +4 -0
  142. package/dist/esm/components/index.js +734 -697
  143. package/dist/esm/components/infinite-scroll/index.js +4 -0
  144. package/dist/esm/components/infinite-scroll/infinite-scroll-wrapper.js +30 -0
  145. package/dist/esm/components/name-cell/index.js +4 -0
  146. package/dist/esm/components/name-cell/name-cell.js +35 -0
  147. package/dist/esm/components/network-icon/index.js +4 -2
  148. package/dist/esm/components/network-icon/network-indicator.js +82 -0
  149. package/dist/esm/components/trading-view/trading-view.js +193 -155
  150. package/dist/esm/components/with-copy/with-copy.js +22 -18
  151. package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown-tooltip.js +112 -169
  152. package/dist/esm/configs/tailwind-preset.js +13 -1
  153. package/dist/esm/hooks/index.js +20 -18
  154. package/dist/esm/hooks/use-observed-width-key.js +24 -0
  155. package/dist/esm/index.js +888 -841
  156. package/dist/esm/locale/en.json.js +21 -18
  157. package/dist/esm/utils/format-leverage.js +6 -0
  158. package/dist/esm/utils/format-money.js +59 -41
  159. package/dist/esm/utils/index.js +91 -85
  160. package/dist/esm/utils/leverage-presets.js +13 -0
  161. package/dist/globals.css +1 -1
  162. package/dist/types/components/assets-list-cell/assets-list-cell.d.ts +3 -0
  163. package/dist/types/components/badge/badge.d.ts +2 -1
  164. package/dist/types/components/badge/chip.d.ts +22 -0
  165. package/dist/types/components/badge/index.d.ts +1 -0
  166. package/dist/types/components/base/detailed-page-title/detailed-page-title.d.ts +1 -3
  167. package/dist/types/components/base/health-factor-block/health-factor-block.d.ts +6 -6
  168. package/dist/types/components/base/history-chart/history-chart.d.ts +13 -3
  169. package/dist/types/components/base/index.d.ts +1 -0
  170. package/dist/types/components/base/info-list/info-list.d.ts +7 -0
  171. package/dist/types/components/base/leverage-input/leverage-input.d.ts +1 -1
  172. package/dist/types/components/base/leverage-preset-chips/constants.d.ts +4 -0
  173. package/dist/types/components/base/leverage-preset-chips/index.d.ts +2 -0
  174. package/dist/types/components/base/leverage-preset-chips/leverage-preset-chips.d.ts +13 -0
  175. package/dist/types/components/base/liquidation-params-table/liquidation-params-table.d.ts +2 -2
  176. package/dist/types/components/base/liquidation-price-block/liquidation-price-block.d.ts +6 -4
  177. package/dist/types/components/base/manage-pane/constants.d.ts +1 -0
  178. package/dist/types/components/base/manage-pane/manage-pane.d.ts +3 -1
  179. package/dist/types/components/base/page-title/page-title.d.ts +12 -6
  180. package/dist/types/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.d.ts +4 -5
  181. package/dist/types/components/base/strategy-apy-breakdown-card/constants.d.ts +1 -0
  182. package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts +12 -4
  183. package/dist/types/components/base/time-to-liquidation-block/time-to-liquidation-block.d.ts +5 -6
  184. package/dist/types/components/base/title-meta/constants.d.ts +1 -0
  185. package/dist/types/components/base/title-meta/title-meta.d.ts +9 -1
  186. package/dist/types/components/base/token-amount/token-amount.d.ts +8 -2
  187. package/dist/types/components/base/values/constants.d.ts +1 -0
  188. package/dist/types/components/base/values/index.d.ts +2 -0
  189. package/dist/types/components/base/values/points-value.d.ts +11 -0
  190. package/dist/types/components/base/values/position-short-label.d.ts +1 -1
  191. package/dist/types/components/base/values/position-status-badge.d.ts +7 -0
  192. package/dist/types/components/base/values/position-type-badge.d.ts +1 -1
  193. package/dist/types/components/base-table/base-table-line.d.ts +21 -0
  194. package/dist/types/components/base-table/base-table.d.ts +19 -0
  195. package/dist/types/components/base-table/constants.d.ts +8 -0
  196. package/dist/types/components/base-table/index.d.ts +3 -0
  197. package/dist/types/components/base-table/types.d.ts +37 -0
  198. package/dist/types/components/collateral-allocation-tooltip/allocation-wheel.d.ts +10 -0
  199. package/dist/types/components/collateral-allocation-tooltip/collateral-allocation-tooltip.d.ts +23 -0
  200. package/dist/types/components/collateral-allocation-tooltip/constants.d.ts +8 -0
  201. package/dist/types/components/collateral-allocation-tooltip/index.d.ts +3 -0
  202. package/dist/types/components/composites/pool-assets-table/constants.d.ts +6 -0
  203. package/dist/types/components/composites/pool-assets-table/index.d.ts +1 -0
  204. package/dist/types/components/composites/pool-assets-table/pool-assets-table-head.d.ts +1 -2
  205. package/dist/types/components/composites/pool-assets-table/pool-assets-table-row.d.ts +8 -8
  206. package/dist/types/components/composites/pool-assets-table/pool-assets-table.d.ts +7 -20
  207. package/dist/types/components/composites/pool-assets-table/types.d.ts +4 -12
  208. package/dist/types/components/graph/graph-view.d.ts +1 -1
  209. package/dist/types/components/graph/graph.d.ts +4 -0
  210. package/dist/types/components/hf-indicator/hf-indicator.d.ts +8 -0
  211. package/dist/types/components/hf-indicator/index.d.ts +1 -0
  212. package/dist/types/components/index.d.ts +5 -0
  213. package/dist/types/components/infinite-scroll/index.d.ts +1 -0
  214. package/dist/types/components/infinite-scroll/infinite-scroll-wrapper.d.ts +11 -0
  215. package/dist/types/components/name-cell/index.d.ts +1 -0
  216. package/dist/types/components/name-cell/name-cell.d.ts +13 -0
  217. package/dist/types/components/network-icon/index.d.ts +1 -0
  218. package/dist/types/components/network-icon/network-indicator.d.ts +23 -0
  219. package/dist/types/components/trading-view/trading-view.d.ts +10 -3
  220. package/dist/types/components/yield-breakdown-tooltip/yield-breakdown-tooltip.d.ts +6 -8
  221. package/dist/types/configs/tailwind-preset.d.ts +12 -0
  222. package/dist/types/hooks/index.d.ts +1 -0
  223. package/dist/types/hooks/use-observed-width-key.d.ts +8 -0
  224. package/dist/types/index.d.ts +6 -1
  225. package/dist/types/locale/en.json.d.ts +23 -18
  226. package/dist/types/utils/format-leverage.d.ts +5 -0
  227. package/dist/types/utils/format-money.d.ts +11 -5
  228. package/dist/types/utils/index.d.ts +3 -1
  229. package/dist/types/utils/leverage-presets.d.ts +7 -0
  230. package/package.json +1 -1
  231. package/src/styles/base.css +30 -0
  232. package/src/styles/theme.css +16 -0
@@ -1,51 +1,214 @@
1
- import { jsxs as d, jsx as r } from "react/jsx-runtime";
2
- import { HelpTip as m } from "../../help-tip/help-tip.js";
3
- import { FormattedMessageTyped as a } from "../../typed-intl/index.js";
4
- import { VerticalIndicator as n } from "../../vertical-indicator/vertical-indicator.js";
5
- import { SideCard as l } from "../side-card/side-card.js";
1
+ import { jsxs as a, jsx as n, Fragment as I } from "react/jsx-runtime";
2
+ import { PointsIcon as P } from "../../points-icon/points-icon.js";
3
+ import { TokenIcon as L } from "../../token-icon/token-icon.js";
4
+ import { FormattedMessageTyped as p } from "../../typed-intl/index.js";
6
5
  import "react";
6
+ import { positiveTokenRewardsOf as R, pointProgramsOf as M } from "../../../utils/apy-breakdown.js";
7
7
  import "@gearbox-protocol/sdk";
8
- import "clsx";
9
- import "tailwind-merge";
8
+ import { bpsToPercent as T } from "../../../utils/bps.js";
9
+ import { cn as w } from "../../../utils/cn.js";
10
10
  import "sonner";
11
+ import { formatLeverage as g } from "../../../utils/format-leverage.js";
12
+ import { formatCompactPercent as $ } from "../../../utils/format-money.js";
13
+ import { formatChipLeverage as C } from "../../../utils/leverage-presets.js";
11
14
  import "@gearbox-protocol/sdk/common-utils";
12
15
  import "luxon";
13
16
  import "../../../utils/z-index.js";
14
- import { ApyValue as o } from "../values/scalars.js";
15
- import "../../badge/badge.js";
16
- import { StrategyApyBreakdownCardTest as i } from "./constants.js";
17
- function e({
18
- title: t,
19
- children: p
17
+ import { StrategyApyBreakdownCardTest as A } from "./constants.js";
18
+ const u = "";
19
+ function m(r) {
20
+ const t = T(r);
21
+ if (Math.abs(t) >= 1e3) {
22
+ const i = $(Math.abs(t));
23
+ return t < 0 ? `−${i}` : i;
24
+ }
25
+ const l = Math.abs(t), s = l % 1 === 0 ? String(l) : l.toFixed(1);
26
+ return t < 0 ? `−${s}%` : `${s}%`;
27
+ }
28
+ function F(r) {
29
+ return r == null || r <= 0 ? "bg-muted text-muted-foreground" : "bg-success/20 text-success";
30
+ }
31
+ function y({
32
+ base: r,
33
+ leverage: t
20
34
  }) {
21
- return /* @__PURE__ */ r(
22
- n,
35
+ return /* @__PURE__ */ n(
36
+ p,
23
37
  {
24
- size: "sm",
25
- "data-testid": i.row,
26
- label: /* @__PURE__ */ r(a, { messageId: t }),
27
- value: p
38
+ messageId: "components.strategyApyBreakdownCard.formula",
39
+ values: { base: r, leverage: t }
40
+ }
41
+ );
42
+ }
43
+ function Z({
44
+ data: r,
45
+ leverage: t
46
+ }) {
47
+ const l = t ?? (r.maxLeverage != null && r.maxLeverage > 0 ? r.maxLeverage : void 0), s = l != null ? g(l) : u, i = r.collateralApy ? R(r.collateralApy) : [], k = r.collateralApy ? M(r.collateralApy) : [], N = r.borrowApy != null || r.additionalBorrowApy != null, f = N ? (r.borrowApy ?? 0) + (r.additionalBorrowApy ?? 0) : void 0, B = l != null ? Math.max(l - 1, 0) : void 0, v = r.collateralApy?.organicApy, d = v != null && l != null ? v * l : void 0, c = i.map(
48
+ (e) => e.supplyApr != null && l != null ? e.supplyApr * l : void 0
49
+ ), b = f != null && B != null ? -(f * B) : void 0, h = d != null && b != null && c.every((e) => e != null) ? d + c.reduce((e, o) => e + (o ?? 0), 0) + b : d != null && c.every((e) => e != null) && !N ? d + c.reduce((e, o) => e + (o ?? 0), 0) : void 0;
50
+ return /* @__PURE__ */ a(
51
+ "div",
52
+ {
53
+ className: "flex w-full min-w-0 flex-col gap-4 rounded-xl border border-border bg-card p-4",
54
+ "data-testid": A.root,
55
+ children: [
56
+ /* @__PURE__ */ a("div", { className: "flex h-6 items-center justify-between gap-3", children: [
57
+ /* @__PURE__ */ n("span", { className: "text-base font-semibold leading-4 text-foreground", children: /* @__PURE__ */ n(
58
+ p,
59
+ {
60
+ messageId: "components.strategyApyBreakdownCard.titleAtLeverage",
61
+ values: { leverage: s }
62
+ }
63
+ ) }),
64
+ /* @__PURE__ */ n(
65
+ "span",
66
+ {
67
+ className: w(
68
+ "rounded-md px-2 py-0.5 text-sm font-semibold tabular-nums",
69
+ F(h)
70
+ ),
71
+ "data-testid": A.net,
72
+ children: h == null ? u : m(h)
73
+ }
74
+ )
75
+ ] }),
76
+ /* @__PURE__ */ a("div", { className: "flex flex-col gap-3", children: [
77
+ /* @__PURE__ */ n(
78
+ x,
79
+ {
80
+ label: /* @__PURE__ */ n(p, { messageId: "components.strategyApyBreakdownCard.collateralApy" }),
81
+ value: d == null ? u : m(d),
82
+ subtext: v != null && l != null ? /* @__PURE__ */ n(
83
+ y,
84
+ {
85
+ base: m(v),
86
+ leverage: g(l)
87
+ }
88
+ ) : void 0
89
+ }
90
+ ),
91
+ i.map((e, o) => /* @__PURE__ */ n(
92
+ x,
93
+ {
94
+ label: /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", children: [
95
+ /* @__PURE__ */ n("span", { children: /* @__PURE__ */ n(
96
+ p,
97
+ {
98
+ messageId: "components.apyParts.extraAPY",
99
+ values: { symbol: e.token.symbol }
100
+ }
101
+ ) }),
102
+ /* @__PURE__ */ n(
103
+ L,
104
+ {
105
+ token: e.token,
106
+ symbol: e.token.symbol,
107
+ size: 16,
108
+ className: "shrink-0"
109
+ }
110
+ )
111
+ ] }),
112
+ value: c[o] == null ? u : m(c[o]),
113
+ subtext: e.supplyApr != null && l != null ? /* @__PURE__ */ n(
114
+ y,
115
+ {
116
+ base: m(e.supplyApr),
117
+ leverage: g(l)
118
+ }
119
+ ) : void 0
120
+ },
121
+ `incentive-${e.token.address}-${e.supplyApr ?? 0}`
122
+ )),
123
+ /* @__PURE__ */ n(
124
+ x,
125
+ {
126
+ muted: !0,
127
+ label: /* @__PURE__ */ n(p, { messageId: "components.strategyApyBreakdownCard.borrowRate" }),
128
+ value: b == null ? u : m(b),
129
+ subtext: f != null && l != null ? /* @__PURE__ */ n(
130
+ y,
131
+ {
132
+ base: m(f),
133
+ leverage: g(l)
134
+ }
135
+ ) : void 0
136
+ }
137
+ ),
138
+ k.length > 0 ? /* @__PURE__ */ a(I, { children: [
139
+ /* @__PURE__ */ n("div", { className: "h-px w-full bg-divider" }),
140
+ k.map((e) => {
141
+ const o = e.multiplier != null && l != null ? e.multiplier * l : void 0;
142
+ return /* @__PURE__ */ n(
143
+ x,
144
+ {
145
+ label: /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", children: [
146
+ /* @__PURE__ */ n("span", { children: /* @__PURE__ */ n(
147
+ p,
148
+ {
149
+ messageId: "components.yieldBreakdown.programPoints",
150
+ values: { name: e.name }
151
+ }
152
+ ) }),
153
+ /* @__PURE__ */ n(
154
+ P,
155
+ {
156
+ reward: { name: e.name, type: e.id },
157
+ size: 16,
158
+ className: "shrink-0"
159
+ }
160
+ )
161
+ ] }),
162
+ value: o != null ? `${C(o)}×` : u,
163
+ subtext: e.multiplier != null && l != null ? /* @__PURE__ */ n(
164
+ y,
165
+ {
166
+ base: C(e.multiplier),
167
+ leverage: g(l)
168
+ }
169
+ ) : void 0
170
+ },
171
+ e.id
172
+ );
173
+ })
174
+ ] }) : null
175
+ ] })
176
+ ]
28
177
  }
29
178
  );
30
179
  }
31
- function R({
32
- data: t
180
+ function x({
181
+ label: r,
182
+ value: t,
183
+ subtext: l,
184
+ muted: s = !1
33
185
  }) {
34
- return /* @__PURE__ */ d(
35
- l,
186
+ const i = s ? "text-muted-foreground" : "text-foreground";
187
+ return /* @__PURE__ */ a(
188
+ "div",
36
189
  {
37
- title: "components.strategyApyBreakdownCard.title",
38
- testId: i.root,
39
- tip: /* @__PURE__ */ r(m, { iconSize: 14, placement: "top", children: /* @__PURE__ */ r(a, { messageId: "components.strategyApyBreakdownCard.formula" }) }),
190
+ className: "flex items-start justify-between gap-3",
191
+ "data-testid": A.row,
40
192
  children: [
41
- /* @__PURE__ */ r(e, { title: "components.strategyApyBreakdownCard.collateralApy", children: /* @__PURE__ */ r(o, { data: t.collateralApy }) }),
42
- /* @__PURE__ */ r(e, { title: "components.strategyApyBreakdownCard.baseBorrowRate", children: /* @__PURE__ */ r(o, { data: t.borrowApy }) }),
43
- /* @__PURE__ */ r(e, { title: "components.strategyApyBreakdownCard.additionalBorrowRate", children: /* @__PURE__ */ r(o, { data: t.additionalBorrowApy }) })
193
+ /* @__PURE__ */ n("span", { className: w("min-w-0 text-sm font-semibold leading-5", i), children: r }),
194
+ /* @__PURE__ */ a("span", { className: "flex shrink-0 flex-col items-end", children: [
195
+ /* @__PURE__ */ n(
196
+ "span",
197
+ {
198
+ className: w(
199
+ "text-sm font-semibold leading-5 tabular-nums",
200
+ t === u || s ? "text-muted-foreground" : "text-foreground"
201
+ ),
202
+ children: t
203
+ }
204
+ ),
205
+ l != null ? /* @__PURE__ */ n("span", { className: "text-xs leading-4 text-muted-foreground", children: l }) : null
206
+ ] })
44
207
  ]
45
208
  }
46
209
  );
47
210
  }
48
211
  export {
49
- R as StrategyApyBreakdownCard,
50
- i as StrategyApyBreakdownCardTest
212
+ Z as StrategyApyBreakdownCard,
213
+ A as StrategyApyBreakdownCardTest
51
214
  };
@@ -1,60 +1,60 @@
1
- import { jsx as t, jsxs as v } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as c } from "react/jsx-runtime";
2
2
  import { useTitleText as T } from "../text/use-title-text.js";
3
- import { FadeoutLoading as r } from "../../fadeout-loading/fadeout-loading.js";
3
+ import { FadeoutLoading as l } from "../../fadeout-loading/fadeout-loading.js";
4
4
  import { HealthDot as f } from "../../status-elements/status-elements.js";
5
- import { FormattedMessageTyped as s } from "../../typed-intl/index.js";
5
+ import { FormattedMessageTyped as m } from "../../typed-intl/index.js";
6
6
  import { VerticalIndicator as h } from "../../vertical-indicator/vertical-indicator.js";
7
7
  import { ttlLeft as g, getTTLZones as x } from "../../../utils/ttl.js";
8
- import { TimeToLiquidationBlockTest as d } from "./constants.js";
8
+ import { TimeToLiquidationBlockTest as r } from "./constants.js";
9
9
  function j({
10
- seconds: i,
11
- secondsTo: l,
12
- zone: n,
13
- isLoading: o,
14
- title: e,
15
- tip: a,
16
- testId: c
10
+ data: o,
11
+ dataTo: n,
12
+ zone: a,
13
+ isLoading: e,
14
+ title: i,
15
+ tip: s,
16
+ testId: v
17
17
  }) {
18
- const p = T(), m = l !== void 0;
18
+ const p = T(), d = n !== void 0;
19
19
  return /* @__PURE__ */ t(
20
20
  h,
21
21
  {
22
22
  align: "center",
23
23
  dimPreviousValue: !1,
24
- "data-testid": c ?? d.root,
25
- label: e !== void 0 ? p(e) : /* @__PURE__ */ t(s, { messageId: "components.timeToLiquidationBlock.label" }),
26
- tip: a ?? /* @__PURE__ */ t(s, { messageId: "components.timeToLiquidationBlock.tip" }),
27
- value: /* @__PURE__ */ t(r, { loading: o, children: /* @__PURE__ */ t(
24
+ "data-testid": v ?? r.root,
25
+ label: i !== void 0 ? p(i) : /* @__PURE__ */ t(m, { messageId: "components.timeToLiquidationBlock.label" }),
26
+ tip: s ?? /* @__PURE__ */ t(m, { messageId: "components.timeToLiquidationBlock.tip" }),
27
+ value: /* @__PURE__ */ t(l, { loading: e, children: /* @__PURE__ */ t(
28
28
  u,
29
29
  {
30
- seconds: i,
31
- zone: m ? void 0 : n,
32
- testId: d.value
30
+ milliseconds: o,
31
+ zone: d ? void 0 : a,
32
+ testId: r.value
33
33
  }
34
34
  ) }),
35
- valueTo: m ? /* @__PURE__ */ t(r, { loading: o, children: /* @__PURE__ */ t(
35
+ valueTo: d ? /* @__PURE__ */ t(l, { loading: e, children: /* @__PURE__ */ t(
36
36
  u,
37
37
  {
38
- seconds: l ?? null,
39
- zone: n,
40
- testId: d.valueTo
38
+ milliseconds: n ?? null,
39
+ zone: a,
40
+ testId: r.valueTo
41
41
  }
42
42
  ) }) : void 0
43
43
  }
44
44
  );
45
45
  }
46
46
  function u({
47
- seconds: i,
48
- zone: l,
49
- testId: n
47
+ milliseconds: o,
48
+ zone: n,
49
+ testId: a
50
50
  }) {
51
- const o = i == null ? null : i * 1e3, e = o === null ? void 0 : g(o), a = l ?? (o === null ? void 0 : x(o));
52
- return /* @__PURE__ */ v("span", { className: "inline-flex items-center", "data-testid": n, children: [
53
- i === void 0 ? "—" : o === null ? "N/A" : e?.months !== void 0 ? `${e.months}mo` : e?.day !== void 0 ? `${e.day}d` : "<1d",
54
- o !== null && a ? /* @__PURE__ */ t("span", { className: "ml-1.5", children: /* @__PURE__ */ t(f, { zone: a }) }) : null
51
+ const e = o == null ? void 0 : g(o), i = n ?? (o == null ? void 0 : x(o));
52
+ return /* @__PURE__ */ c("span", { className: "inline-flex items-center", "data-testid": a, children: [
53
+ o === void 0 ? "—" : o === null ? "N/A" : e?.months !== void 0 ? `${e.months}mo` : e?.day !== void 0 ? `${e.day}d` : "<1d",
54
+ o != null && i ? /* @__PURE__ */ t("span", { className: "ml-1.5", children: /* @__PURE__ */ t(f, { zone: i }) }) : null
55
55
  ] });
56
56
  }
57
57
  export {
58
58
  j as TimeToLiquidationBlock,
59
- d as TimeToLiquidationBlockTest
59
+ r as TimeToLiquidationBlockTest
60
60
  };
@@ -2,6 +2,7 @@ class e {
2
2
  static root = "title-meta-root";
3
3
  static network = "title-meta-network";
4
4
  static curator = "title-meta-curator";
5
+ static link = "title-meta-link";
5
6
  }
6
7
  export {
7
8
  e as TitleMetaTest
@@ -1,68 +1,88 @@
1
- import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
- import { Link as p } from "../../link/link.js";
1
+ import { jsxs as a, jsx as t } from "react/jsx-runtime";
2
+ import { Link as l } from "../../link/link.js";
3
3
  import { NetworkIcon as g } from "../../network-icon/network-icon.js";
4
- import { FormattedMessageTyped as f } from "../../typed-intl/index.js";
4
+ import "../../network-icon/network-indicator.js";
5
+ import { TokenIcon as h } from "../../token-icon/token-icon.js";
6
+ import { FormattedMessageTyped as u } from "../../typed-intl/index.js";
5
7
  import { Typography as r } from "../../typography/typography.js";
6
- import { Stack as o } from "../stack/stack.js";
7
- import { TitleMetaTest as s } from "./constants.js";
8
- function N({
9
- network: a,
10
- curatorName: e,
11
- curatorLink: n,
12
- onCuratorLinkClick: m,
13
- testId: d = s.root,
14
- networkTestId: c = s.network,
15
- curatorTestId: l = s.curator
8
+ import { Stack as n } from "../stack/stack.js";
9
+ import { TitleMetaTest as o } from "./constants.js";
10
+ function I({
11
+ network: m,
12
+ curatorName: s,
13
+ curatorLink: i,
14
+ onCuratorLinkClick: d,
15
+ links: c,
16
+ testId: p = o.root,
17
+ networkTestId: f = o.network,
18
+ curatorTestId: x = o.curator
16
19
  }) {
17
- return /* @__PURE__ */ i(
18
- o,
20
+ return /* @__PURE__ */ a(
21
+ n,
19
22
  {
20
23
  direction: "row",
21
24
  align: "center",
22
25
  gap: "md",
23
26
  wrap: !0,
24
27
  className: "text-sm text-foreground",
25
- "data-testid": d,
28
+ "data-testid": p,
26
29
  children: [
27
- /* @__PURE__ */ i(
28
- o,
30
+ /* @__PURE__ */ a(
31
+ n,
29
32
  {
30
33
  direction: "row",
31
34
  align: "center",
32
35
  gap: "sm",
33
- "data-testid": c,
36
+ "data-testid": f,
34
37
  children: [
35
- /* @__PURE__ */ t(g, { network: a, size: 16 }),
36
- /* @__PURE__ */ t(r, { as: "span", className: "text-sm text-foreground", children: a })
38
+ /* @__PURE__ */ t(g, { network: m, size: 16 }),
39
+ /* @__PURE__ */ t(r, { as: "span", className: "text-sm text-foreground", children: m })
37
40
  ]
38
41
  }
39
42
  ),
40
- e ? /* @__PURE__ */ t(
41
- o,
43
+ s ? /* @__PURE__ */ t(
44
+ n,
42
45
  {
43
46
  direction: "row",
44
47
  align: "center",
45
48
  gap: "sm",
46
- "data-testid": l,
47
- children: n ? /* @__PURE__ */ t(
48
- p,
49
+ "data-testid": x,
50
+ children: i ? /* @__PURE__ */ t(
51
+ l,
49
52
  {
50
53
  className: "text-sm text-foreground",
51
- href: n,
54
+ href: i,
52
55
  external: !0,
53
56
  target: "_blank",
54
57
  size: "sm",
55
- onClick: m,
56
- children: e
58
+ onClick: d,
59
+ children: s
57
60
  }
58
- ) : /* @__PURE__ */ t(r, { as: "span", className: "text-sm text-foreground", children: e })
61
+ ) : /* @__PURE__ */ t(r, { as: "span", className: "text-sm text-foreground", children: s })
59
62
  }
60
- ) : /* @__PURE__ */ t(r, { as: "span", className: "text-sm text-foreground", children: /* @__PURE__ */ t(f, { messageId: "components.titleMeta.unknownCurator" }) })
63
+ ) : /* @__PURE__ */ t(r, { as: "span", className: "text-sm text-foreground", children: /* @__PURE__ */ t(u, { messageId: "components.titleMeta.unknownCurator" }) }),
64
+ c?.map((e) => /* @__PURE__ */ a(
65
+ l,
66
+ {
67
+ className: "inline-flex items-center gap-2 text-sm text-foreground",
68
+ href: e.href,
69
+ external: !0,
70
+ target: "_blank",
71
+ size: "sm",
72
+ onClick: e.onClick,
73
+ "data-testid": o.link,
74
+ children: [
75
+ e.token ? /* @__PURE__ */ t(h, { token: e.token, size: 16, className: "shrink-0" }) : null,
76
+ e.label || e.token?.symbol ? /* @__PURE__ */ t(r, { as: "span", className: "text-sm text-foreground", children: e.label ?? e.token?.symbol }) : null
77
+ ]
78
+ },
79
+ e.href
80
+ ))
61
81
  ]
62
82
  }
63
83
  );
64
84
  }
65
85
  export {
66
- N as TitleMeta,
67
- s as TitleMetaTest
86
+ I as TitleMeta,
87
+ o as TitleMetaTest
68
88
  };
@@ -1,29 +1,30 @@
1
- import { jsx as n, jsxs as i } from "react/jsx-runtime";
2
- import { Stack as m } from "../stack/stack.js";
3
- import { TokenTemplate as a } from "../../token-template/token-template.js";
4
- import { Typography as s } from "../../typography/typography.js";
5
- import { formatMoney as l } from "../../../utils/format-money.js";
6
- import { TokenAmountTest as r } from "./constants.js";
7
- function T({
1
+ import { jsx as r, jsxs as s } from "react/jsx-runtime";
2
+ import { Stack as a } from "../stack/stack.js";
3
+ import { TokenTemplate as i } from "../../token-template/token-template.js";
4
+ import { Typography as l } from "../../typography/typography.js";
5
+ import { formatMoney as p } from "../../../utils/format-money.js";
6
+ import { TokenAmountTest as t } from "./constants.js";
7
+ function v({
8
8
  data: o,
9
- token: e
9
+ token: n,
10
+ align: e = "start"
10
11
  }) {
11
12
  if (o === null)
12
- return /* @__PURE__ */ n(
13
+ return /* @__PURE__ */ r(
13
14
  "span",
14
15
  {
15
16
  className: "text-secondary-foreground",
16
- "data-testid": r.root,
17
+ "data-testid": t.root,
17
18
  children: "—"
18
19
  }
19
20
  );
20
- const t = e ?? o.token;
21
- return /* @__PURE__ */ i(m, { gap: "xs", align: "end", "data-testid": r.root, children: [
22
- /* @__PURE__ */ n(a, { value: o.value, token: t }),
23
- /* @__PURE__ */ n(s, { as: "span", variant: "caption", color: "secondary", children: o.valueUsd === null ? "—" : l(o.valueUsd) })
21
+ const m = n ?? o.token;
22
+ return /* @__PURE__ */ s(a, { gap: "xs", align: e, "data-testid": t.root, children: [
23
+ /* @__PURE__ */ r(i, { value: o.value, token: m }),
24
+ /* @__PURE__ */ r(l, { as: "span", variant: "caption", color: "secondary", children: o.valueUsd === null ? "—" : p(o.valueUsd) })
24
25
  ] });
25
26
  }
26
27
  export {
27
- T as TokenAmount,
28
- r as TokenAmountTest
28
+ v as TokenAmount,
29
+ t as TokenAmountTest
29
30
  };
@@ -6,6 +6,7 @@ class a {
6
6
  static healthFactor = "value-health-factor";
7
7
  static pnl = "value-pnl";
8
8
  static tokenBigint = "value-token-bigint";
9
+ static points = "value-points";
9
10
  static placeholder = "value-placeholder";
10
11
  }
11
12
  class e {
@@ -1,19 +1,23 @@
1
- import { PositionShortLabelTest as t, ValueTest as a } from "./constants.js";
2
- import { PnlValue as l } from "./pnl-value.js";
3
- import { PositionShortLabel as p } from "./position-short-label.js";
4
- import { PositionTypeBadge as s } from "./position-type-badge.js";
5
- import { ApyValue as V, HealthFactorValue as f, LeverageValue as m, TokenBigint as x, UsdValue as P, UtilizationValue as T, bps as b } from "./scalars.js";
1
+ import { PositionShortLabelTest as t, ValueTest as r } from "./constants.js";
2
+ import { PnlValue as i } from "./pnl-value.js";
3
+ import { PointsValue as p } from "./points-value.js";
4
+ import { PositionShortLabel as n } from "./position-short-label.js";
5
+ import { PositionStatusBadge as V } from "./position-status-badge.js";
6
+ import { PositionTypeBadge as m } from "./position-type-badge.js";
7
+ import { ApyValue as P, HealthFactorValue as g, LeverageValue as T, TokenBigint as b, UsdValue as d, UtilizationValue as h, bps as B } from "./scalars.js";
6
8
  export {
7
- V as ApyValue,
8
- f as HealthFactorValue,
9
- m as LeverageValue,
10
- l as PnlValue,
11
- p as PositionShortLabel,
9
+ P as ApyValue,
10
+ g as HealthFactorValue,
11
+ T as LeverageValue,
12
+ i as PnlValue,
13
+ p as PointsValue,
14
+ n as PositionShortLabel,
12
15
  t as PositionShortLabelTest,
13
- s as PositionTypeBadge,
14
- x as TokenBigint,
15
- P as UsdValue,
16
- T as UtilizationValue,
17
- a as ValueTest,
18
- b as bps
16
+ V as PositionStatusBadge,
17
+ m as PositionTypeBadge,
18
+ b as TokenBigint,
19
+ d as UsdValue,
20
+ h as UtilizationValue,
21
+ r as ValueTest,
22
+ B as bps
19
23
  };
@@ -0,0 +1,30 @@
1
+ import { jsx as n, jsxs as s } from "react/jsx-runtime";
2
+ import { PointsIcon as r } from "../../points-icon/points-icon.js";
3
+ import { pointProgramsOf as l } from "../../../utils/apy-breakdown.js";
4
+ import { ValueTest as a } from "./constants.js";
5
+ function c({
6
+ data: i
7
+ }) {
8
+ if (!i) return null;
9
+ const t = l(i);
10
+ return t.length === 0 ? null : /* @__PURE__ */ n(
11
+ "span",
12
+ {
13
+ className: "inline-flex flex-wrap items-center gap-1.5",
14
+ "data-testid": a.points,
15
+ children: t.map((e) => /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1", children: [
16
+ /* @__PURE__ */ n(
17
+ r,
18
+ {
19
+ reward: { name: e.name, type: e.id },
20
+ size: 16
21
+ }
22
+ ),
23
+ /* @__PURE__ */ n("span", { children: e.name })
24
+ ] }, e.id))
25
+ }
26
+ );
27
+ }
28
+ export {
29
+ c as PointsValue
30
+ };
@@ -0,0 +1,26 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { Badge as r } from "../../badge/badge.js";
3
+ import "../../badge/chip.js";
4
+ import { FormattedMessageTyped as o } from "../../typed-intl/index.js";
5
+ import "react";
6
+ import "@gearbox-protocol/sdk";
7
+ import { cn as i } from "../../../utils/cn.js";
8
+ import "sonner";
9
+ import "@gearbox-protocol/sdk/common-utils";
10
+ import "luxon";
11
+ import "../../../utils/z-index.js";
12
+ const m = {
13
+ active: "shrink-0 border-transparent bg-emerald-500/15 font-medium text-emerald-400 hover:bg-emerald-500/15",
14
+ repaid: "shrink-0 border-transparent bg-muted font-medium text-muted-foreground hover:bg-muted"
15
+ }, a = {
16
+ active: "components.positionStatusBadge.active",
17
+ repaid: "components.positionStatusBadge.repaid"
18
+ };
19
+ function v({
20
+ data: t
21
+ }) {
22
+ return /* @__PURE__ */ e(r, { variant: "secondary", className: i(m[t]), children: /* @__PURE__ */ e(o, { messageId: a[t] }) });
23
+ }
24
+ export {
25
+ v as PositionStatusBadge
26
+ };