@gearbox-protocol/ui-kit 4.0.0-next.4 → 4.0.0-next.6

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 (207) 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/history-chart/history-chart.cjs +1 -1
  8. package/dist/cjs/components/base/index.cjs +1 -1
  9. package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
  10. package/dist/cjs/components/base/leverage-input/leverage-input.cjs +1 -1
  11. package/dist/cjs/components/base/leverage-preset-chips/constants.cjs +1 -0
  12. package/dist/cjs/components/base/leverage-preset-chips/index.cjs +1 -0
  13. package/dist/cjs/components/base/leverage-preset-chips/leverage-preset-chips.cjs +1 -0
  14. package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
  15. package/dist/cjs/components/base/strategy-apy-breakdown-card/constants.cjs +1 -1
  16. package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
  17. package/dist/cjs/components/base/title-meta/constants.cjs +1 -1
  18. package/dist/cjs/components/base/title-meta/title-meta.cjs +1 -1
  19. package/dist/cjs/components/base/values/index.cjs +1 -1
  20. package/dist/cjs/components/base/values/position-status-badge.cjs +1 -0
  21. package/dist/cjs/components/base/values/position-type-badge.cjs +1 -1
  22. package/dist/cjs/components/base-table/base-table-line.cjs +1 -0
  23. package/dist/cjs/components/base-table/base-table.cjs +1 -0
  24. package/dist/cjs/components/base-table/constants.cjs +1 -0
  25. package/dist/cjs/components/base-table/index.cjs +1 -0
  26. package/dist/cjs/components/base-table/types.cjs +1 -0
  27. package/dist/cjs/components/block-sync-pill/block-sync-pill.cjs +1 -1
  28. package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
  29. package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
  30. package/dist/cjs/components/collateral-allocation-tooltip/allocation-wheel.cjs +1 -0
  31. package/dist/cjs/components/collateral-allocation-tooltip/collateral-allocation-tooltip.cjs +1 -0
  32. package/dist/cjs/components/collateral-allocation-tooltip/constants.cjs +1 -0
  33. package/dist/cjs/components/collateral-allocation-tooltip/index.cjs +1 -0
  34. package/dist/cjs/components/composites/index.cjs +1 -1
  35. package/dist/cjs/components/composites/pool-assets-table/constants.cjs +1 -0
  36. package/dist/cjs/components/composites/pool-assets-table/index.cjs +1 -1
  37. package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-head.cjs +1 -1
  38. package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
  39. package/dist/cjs/components/composites/pool-assets-table/pool-assets-table.cjs +1 -1
  40. package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.cjs +1 -1
  41. package/dist/cjs/components/composites/tx-preview/confirm/dialog/index.cjs +1 -1
  42. package/dist/cjs/components/composites/tx-preview/confirm/dialog/transactionConfirmShellTypes.cjs +1 -0
  43. package/dist/cjs/components/composites/tx-preview/confirm/index.cjs +1 -1
  44. package/dist/cjs/components/composites/tx-preview/index.cjs +1 -1
  45. package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
  46. package/dist/cjs/components/filter/filter-chip.cjs +1 -1
  47. package/dist/cjs/components/graph/default-config.cjs +1 -1
  48. package/dist/cjs/components/graph/graph-view.cjs +1 -1
  49. package/dist/cjs/components/graph/graph.cjs +1 -1
  50. package/dist/cjs/components/hf-indicator/hf-indicator.cjs +1 -0
  51. package/dist/cjs/components/hf-indicator/index.cjs +1 -0
  52. package/dist/cjs/components/index.cjs +1 -1
  53. package/dist/cjs/components/infinite-scroll/index.cjs +1 -0
  54. package/dist/cjs/components/infinite-scroll/infinite-scroll-wrapper.cjs +1 -0
  55. package/dist/cjs/components/name-cell/index.cjs +1 -0
  56. package/dist/cjs/components/name-cell/name-cell.cjs +1 -0
  57. package/dist/cjs/components/network-icon/index.cjs +1 -1
  58. package/dist/cjs/components/network-icon/network-indicator.cjs +1 -0
  59. package/dist/cjs/components/trading-view/trading-view.cjs +1 -1
  60. package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
  61. package/dist/cjs/components/yield-breakdown-tooltip/yield-breakdown-tooltip.cjs +1 -1
  62. package/dist/cjs/configs/tailwind-preset.cjs +1 -1
  63. package/dist/cjs/hooks/index.cjs +1 -1
  64. package/dist/cjs/hooks/use-observed-width-key.cjs +1 -0
  65. package/dist/cjs/index.cjs +1 -1
  66. package/dist/cjs/locale/en.json.cjs +1 -1
  67. package/dist/cjs/utils/format-money.cjs +1 -1
  68. package/dist/cjs/utils/index.cjs +1 -1
  69. package/dist/cjs/utils/leverage-presets.cjs +1 -0
  70. package/dist/esm/components/assets-list-cell/assets-list-cell.js +161 -159
  71. package/dist/esm/components/badge/badge.js +14 -8
  72. package/dist/esm/components/badge/chip.js +47 -0
  73. package/dist/esm/components/badge/index.js +8 -3
  74. package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +3 -2
  75. package/dist/esm/components/base/chart-with-side-card/chart-with-side-card.js +6 -6
  76. package/dist/esm/components/base/history-chart/history-chart.js +86 -46
  77. package/dist/esm/components/base/index.js +144 -138
  78. package/dist/esm/components/base/info-list/info-list.js +7 -8
  79. package/dist/esm/components/base/leverage-input/leverage-input.js +1 -1
  80. package/dist/esm/components/base/leverage-preset-chips/constants.js +7 -0
  81. package/dist/esm/components/base/leverage-preset-chips/index.js +6 -0
  82. package/dist/esm/components/base/leverage-preset-chips/leverage-preset-chips.js +39 -0
  83. package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +23 -30
  84. package/dist/esm/components/base/strategy-apy-breakdown-card/constants.js +3 -2
  85. package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +194 -32
  86. package/dist/esm/components/base/title-meta/constants.js +1 -0
  87. package/dist/esm/components/base/title-meta/title-meta.js +53 -33
  88. package/dist/esm/components/base/values/index.js +16 -14
  89. package/dist/esm/components/base/values/position-status-badge.js +26 -0
  90. package/dist/esm/components/base/values/position-type-badge.js +7 -6
  91. package/dist/esm/components/base-table/base-table-line.js +117 -0
  92. package/dist/esm/components/base-table/base-table.js +110 -0
  93. package/dist/esm/components/base-table/constants.js +12 -0
  94. package/dist/esm/components/base-table/index.js +9 -0
  95. package/dist/esm/components/base-table/types.js +1 -0
  96. package/dist/esm/components/block-sync-pill/block-sync-pill.js +9 -6
  97. package/dist/esm/components/checkbox/checkbox-labeled.js +7 -4
  98. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +7 -4
  99. package/dist/esm/components/collateral-allocation-tooltip/allocation-wheel.js +71 -0
  100. package/dist/esm/components/collateral-allocation-tooltip/collateral-allocation-tooltip.js +102 -0
  101. package/dist/esm/components/collateral-allocation-tooltip/constants.js +12 -0
  102. package/dist/esm/components/collateral-allocation-tooltip/index.js +9 -0
  103. package/dist/esm/components/composites/index.js +31 -31
  104. package/dist/esm/components/composites/pool-assets-table/constants.js +9 -0
  105. package/dist/esm/components/composites/pool-assets-table/index.js +8 -6
  106. package/dist/esm/components/composites/pool-assets-table/pool-assets-table-head.js +52 -30
  107. package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +108 -76
  108. package/dist/esm/components/composites/pool-assets-table/pool-assets-table.js +44 -26
  109. package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.js +109 -52
  110. package/dist/esm/components/composites/tx-preview/confirm/dialog/index.js +8 -10
  111. package/dist/esm/components/composites/tx-preview/confirm/dialog/transactionConfirmShellTypes.js +1 -0
  112. package/dist/esm/components/composites/tx-preview/confirm/index.js +24 -26
  113. package/dist/esm/components/composites/tx-preview/index.js +24 -26
  114. package/dist/esm/components/compound-apy/compound-apy.js +85 -80
  115. package/dist/esm/components/filter/filter-chip.js +1 -0
  116. package/dist/esm/components/graph/default-config.js +20 -18
  117. package/dist/esm/components/graph/graph-view.js +32 -31
  118. package/dist/esm/components/graph/graph.js +459 -458
  119. package/dist/esm/components/hf-indicator/hf-indicator.js +33 -0
  120. package/dist/esm/components/hf-indicator/index.js +4 -0
  121. package/dist/esm/components/index.js +732 -701
  122. package/dist/esm/components/infinite-scroll/index.js +4 -0
  123. package/dist/esm/components/infinite-scroll/infinite-scroll-wrapper.js +30 -0
  124. package/dist/esm/components/name-cell/index.js +4 -0
  125. package/dist/esm/components/name-cell/name-cell.js +35 -0
  126. package/dist/esm/components/network-icon/index.js +4 -2
  127. package/dist/esm/components/network-icon/network-indicator.js +82 -0
  128. package/dist/esm/components/trading-view/trading-view.js +193 -155
  129. package/dist/esm/components/with-copy/with-copy.js +7 -4
  130. package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown-tooltip.js +112 -169
  131. package/dist/esm/configs/tailwind-preset.js +13 -1
  132. package/dist/esm/hooks/index.js +20 -18
  133. package/dist/esm/hooks/use-observed-width-key.js +24 -0
  134. package/dist/esm/index.js +881 -842
  135. package/dist/esm/locale/en.json.js +21 -18
  136. package/dist/esm/utils/format-money.js +59 -41
  137. package/dist/esm/utils/index.js +87 -83
  138. package/dist/esm/utils/leverage-presets.js +13 -0
  139. package/dist/globals.css +1 -1
  140. package/dist/types/components/assets-list-cell/assets-list-cell.d.ts +3 -0
  141. package/dist/types/components/badge/badge.d.ts +2 -1
  142. package/dist/types/components/badge/chip.d.ts +22 -0
  143. package/dist/types/components/badge/index.d.ts +1 -0
  144. package/dist/types/components/base/history-chart/history-chart.d.ts +13 -3
  145. package/dist/types/components/base/index.d.ts +1 -0
  146. package/dist/types/components/base/leverage-input/leverage-input.d.ts +1 -1
  147. package/dist/types/components/base/leverage-preset-chips/constants.d.ts +4 -0
  148. package/dist/types/components/base/leverage-preset-chips/index.d.ts +2 -0
  149. package/dist/types/components/base/leverage-preset-chips/leverage-preset-chips.d.ts +13 -0
  150. package/dist/types/components/base/liquidation-params-table/liquidation-params-table.d.ts +2 -2
  151. package/dist/types/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.d.ts +4 -5
  152. package/dist/types/components/base/strategy-apy-breakdown-card/constants.d.ts +1 -0
  153. package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts +12 -4
  154. package/dist/types/components/base/title-meta/constants.d.ts +1 -0
  155. package/dist/types/components/base/title-meta/title-meta.d.ts +9 -1
  156. package/dist/types/components/base/values/index.d.ts +1 -0
  157. package/dist/types/components/base/values/position-status-badge.d.ts +7 -0
  158. package/dist/types/components/base/values/position-type-badge.d.ts +1 -1
  159. package/dist/types/components/base-table/base-table-line.d.ts +21 -0
  160. package/dist/types/components/base-table/base-table.d.ts +19 -0
  161. package/dist/types/components/base-table/constants.d.ts +8 -0
  162. package/dist/types/components/base-table/index.d.ts +3 -0
  163. package/dist/types/components/base-table/types.d.ts +37 -0
  164. package/dist/types/components/collateral-allocation-tooltip/allocation-wheel.d.ts +10 -0
  165. package/dist/types/components/collateral-allocation-tooltip/collateral-allocation-tooltip.d.ts +23 -0
  166. package/dist/types/components/collateral-allocation-tooltip/constants.d.ts +8 -0
  167. package/dist/types/components/collateral-allocation-tooltip/index.d.ts +3 -0
  168. package/dist/types/components/composites/pool-assets-table/constants.d.ts +6 -0
  169. package/dist/types/components/composites/pool-assets-table/index.d.ts +1 -0
  170. package/dist/types/components/composites/pool-assets-table/pool-assets-table-head.d.ts +1 -2
  171. package/dist/types/components/composites/pool-assets-table/pool-assets-table-row.d.ts +8 -8
  172. package/dist/types/components/composites/pool-assets-table/pool-assets-table.d.ts +7 -20
  173. package/dist/types/components/composites/pool-assets-table/types.d.ts +4 -12
  174. package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.d.ts +23 -19
  175. package/dist/types/components/composites/tx-preview/confirm/dialog/index.d.ts +2 -2
  176. package/dist/types/components/composites/tx-preview/confirm/dialog/transactionConfirmPhase.d.ts +0 -3
  177. package/dist/types/components/composites/tx-preview/confirm/dialog/transactionConfirmShellTypes.d.ts +97 -0
  178. package/dist/types/components/graph/graph-view.d.ts +1 -1
  179. package/dist/types/components/graph/graph.d.ts +4 -0
  180. package/dist/types/components/hf-indicator/hf-indicator.d.ts +8 -0
  181. package/dist/types/components/hf-indicator/index.d.ts +1 -0
  182. package/dist/types/components/index.d.ts +5 -0
  183. package/dist/types/components/infinite-scroll/index.d.ts +1 -0
  184. package/dist/types/components/infinite-scroll/infinite-scroll-wrapper.d.ts +11 -0
  185. package/dist/types/components/name-cell/index.d.ts +1 -0
  186. package/dist/types/components/name-cell/name-cell.d.ts +13 -0
  187. package/dist/types/components/network-icon/index.d.ts +1 -0
  188. package/dist/types/components/network-icon/network-indicator.d.ts +23 -0
  189. package/dist/types/components/trading-view/trading-view.d.ts +10 -3
  190. package/dist/types/components/yield-breakdown-tooltip/yield-breakdown-tooltip.d.ts +6 -8
  191. package/dist/types/configs/tailwind-preset.d.ts +12 -0
  192. package/dist/types/hooks/index.d.ts +1 -0
  193. package/dist/types/hooks/use-observed-width-key.d.ts +8 -0
  194. package/dist/types/index.d.ts +6 -1
  195. package/dist/types/locale/en.json.d.ts +23 -18
  196. package/dist/types/utils/format-money.d.ts +11 -5
  197. package/dist/types/utils/index.d.ts +2 -1
  198. package/dist/types/utils/leverage-presets.d.ts +7 -0
  199. package/package.json +1 -1
  200. package/src/styles/base.css +30 -0
  201. package/src/styles/theme.css +16 -0
  202. package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.cjs +0 -1
  203. package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.cjs +0 -1
  204. package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.js +0 -177
  205. package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.js +0 -54
  206. package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.d.ts +0 -17
  207. package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.d.ts +0 -16
@@ -1,58 +1,51 @@
1
- import { jsxs as a, jsx as o } from "react/jsx-runtime";
2
- import { FormattedMessageTyped as d } from "../../typed-intl/index.js";
3
- import { VerticalIndicator as i } from "../../vertical-indicator/vertical-indicator.js";
1
+ import { jsxs as p, jsx as o } from "react/jsx-runtime";
2
+ import { FormattedMessageTyped as n } from "../../typed-intl/index.js";
3
+ import { VerticalIndicator as m } from "../../vertical-indicator/vertical-indicator.js";
4
4
  import "react";
5
5
  import "@gearbox-protocol/sdk";
6
6
  import "clsx";
7
7
  import "tailwind-merge";
8
8
  import "sonner";
9
- import { percentTemplate as m } from "../../../utils/format-money.js";
9
+ import { percentTemplate as a } from "../../../utils/format-money.js";
10
10
  import "@gearbox-protocol/sdk/common-utils";
11
11
  import "luxon";
12
12
  import "../../../utils/z-index.js";
13
- import { SideCard as n } from "../side-card/side-card.js";
14
- import { PoolApyBreakdownCardTest as p } from "./constants.js";
15
- function t({
13
+ import { SideCard as d } from "../side-card/side-card.js";
14
+ import { PoolApyBreakdownCardTest as i } from "./constants.js";
15
+ function e({
16
16
  title: r,
17
- value: e
17
+ value: t
18
18
  }) {
19
19
  return /* @__PURE__ */ o(
20
- i,
20
+ m,
21
21
  {
22
22
  size: "sm",
23
- label: /* @__PURE__ */ o(d, { messageId: r }),
24
- value: /* @__PURE__ */ o("span", { "data-testid": p.value, children: e === void 0 ? "—" : m(e / 100) })
23
+ label: /* @__PURE__ */ o(n, { messageId: r }),
24
+ value: /* @__PURE__ */ o("span", { "data-testid": i.value, children: t === void 0 ? "—" : a(t / 100) })
25
25
  }
26
26
  );
27
27
  }
28
- function T({
28
+ function I({
29
29
  data: r
30
30
  }) {
31
- return /* @__PURE__ */ a(
32
- n,
31
+ return /* @__PURE__ */ p(
32
+ d,
33
33
  {
34
34
  title: "components.poolApyBreakdownCard.title",
35
- testId: p.root,
35
+ testId: i.root,
36
36
  children: [
37
37
  /* @__PURE__ */ o(
38
- t,
38
+ e,
39
39
  {
40
- title: "components.poolApyBreakdownCard.apy1d",
41
- value: r?.apy1d
40
+ title: "components.poolApyBreakdownCard.organicApy",
41
+ value: r?.organicApy
42
42
  }
43
43
  ),
44
44
  /* @__PURE__ */ o(
45
- t,
45
+ e,
46
46
  {
47
- title: "components.poolApyBreakdownCard.apy7d",
48
- value: r?.apy7d
49
- }
50
- ),
51
- /* @__PURE__ */ o(
52
- t,
53
- {
54
- title: "components.poolApyBreakdownCard.apy30d",
55
- value: r?.apy30d
47
+ title: "components.poolApyBreakdownCard.incentiveApy",
48
+ value: r?.incentiveApy
56
49
  }
57
50
  )
58
51
  ]
@@ -60,6 +53,6 @@ function T({
60
53
  );
61
54
  }
62
55
  export {
63
- T as PoolApyBreakdownCard,
64
- p as PoolApyBreakdownCardTest
56
+ I as PoolApyBreakdownCard,
57
+ i as PoolApyBreakdownCardTest
65
58
  };
@@ -1,7 +1,8 @@
1
- class r {
1
+ class a {
2
2
  static root = "strategy-apy-breakdown-card-root";
3
3
  static row = "strategy-apy-breakdown-card-row";
4
+ static net = "strategy-apy-breakdown-card-net";
4
5
  }
5
6
  export {
6
- r as StrategyApyBreakdownCardTest
7
+ a as StrategyApyBreakdownCardTest
7
8
  };
@@ -1,52 +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 "../../points-icon/points-icon.js";
15
- import { ApyValue as o } from "../values/scalars.js";
16
- import "../../badge/badge.js";
17
- import { StrategyApyBreakdownCardTest as i } from "./constants.js";
18
- function e({
19
- title: t,
20
- 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
21
34
  }) {
22
- return /* @__PURE__ */ r(
23
- n,
35
+ return /* @__PURE__ */ n(
36
+ p,
24
37
  {
25
- size: "sm",
26
- "data-testid": i.row,
27
- label: /* @__PURE__ */ r(a, { messageId: t }),
28
- 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
+ ]
29
177
  }
30
178
  );
31
179
  }
32
- function T({
33
- data: t
180
+ function x({
181
+ label: r,
182
+ value: t,
183
+ subtext: l,
184
+ muted: s = !1
34
185
  }) {
35
- return /* @__PURE__ */ d(
36
- l,
186
+ const i = s ? "text-muted-foreground" : "text-foreground";
187
+ return /* @__PURE__ */ a(
188
+ "div",
37
189
  {
38
- title: "components.strategyApyBreakdownCard.title",
39
- testId: i.root,
40
- 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,
41
192
  children: [
42
- /* @__PURE__ */ r(e, { title: "components.strategyApyBreakdownCard.collateralApy", children: /* @__PURE__ */ r(o, { data: t.collateralApy }) }),
43
- /* @__PURE__ */ r(e, { title: "components.strategyApyBreakdownCard.baseBorrowRate", children: /* @__PURE__ */ r(o, { data: t.borrowApy }) }),
44
- /* @__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
+ ] })
45
207
  ]
46
208
  }
47
209
  );
48
210
  }
49
211
  export {
50
- T as StrategyApyBreakdownCard,
51
- i as StrategyApyBreakdownCardTest
212
+ Z as StrategyApyBreakdownCard,
213
+ A as StrategyApyBreakdownCardTest
52
214
  };
@@ -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,21 +1,23 @@
1
1
  import { PositionShortLabelTest as t, ValueTest as r } from "./constants.js";
2
- import { PnlValue as l } from "./pnl-value.js";
2
+ import { PnlValue as i } from "./pnl-value.js";
3
3
  import { PointsValue as p } from "./points-value.js";
4
- import { PositionShortLabel as s } from "./position-short-label.js";
5
- import { PositionTypeBadge as V } from "./position-type-badge.js";
6
- import { ApyValue as m, HealthFactorValue as x, LeverageValue as P, TokenBigint as T, UsdValue as b, UtilizationValue as g, bps as h } from "./scalars.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";
7
8
  export {
8
- m as ApyValue,
9
- x as HealthFactorValue,
10
- P as LeverageValue,
11
- l as PnlValue,
9
+ P as ApyValue,
10
+ g as HealthFactorValue,
11
+ T as LeverageValue,
12
+ i as PnlValue,
12
13
  p as PointsValue,
13
- s as PositionShortLabel,
14
+ n as PositionShortLabel,
14
15
  t as PositionShortLabelTest,
15
- V as PositionTypeBadge,
16
- T as TokenBigint,
17
- b as UsdValue,
18
- g as UtilizationValue,
16
+ V as PositionStatusBadge,
17
+ m as PositionTypeBadge,
18
+ b as TokenBigint,
19
+ d as UsdValue,
20
+ h as UtilizationValue,
19
21
  r as ValueTest,
20
- h as bps
22
+ B as bps
21
23
  };
@@ -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
+ };
@@ -1,9 +1,10 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { Badge as r } from "../../badge/badge.js";
3
- import { FormattedMessageTyped as n } from "../../typed-intl/index.js";
3
+ import "../../badge/chip.js";
4
+ import { FormattedMessageTyped as i } from "../../typed-intl/index.js";
4
5
  import "react";
5
6
  import "@gearbox-protocol/sdk";
6
- import { cn as i } from "../../../utils/cn.js";
7
+ import { cn as n } from "../../../utils/cn.js";
7
8
  import "sonner";
8
9
  import "@gearbox-protocol/sdk/common-utils";
9
10
  import "luxon";
@@ -17,7 +18,7 @@ const p = {
17
18
  strategy: "components.positionTypeBadge.strategy",
18
19
  liquidation: "components.positionTypeBadge.liquidation"
19
20
  }, a = "text-[10px] leading-none px-1.5 py-0.5 rounded-md";
20
- function f({
21
+ function x({
21
22
  data: e,
22
23
  size: t = "table"
23
24
  }) {
@@ -25,14 +26,14 @@ function f({
25
26
  r,
26
27
  {
27
28
  variant: "secondary",
28
- className: i(
29
+ className: n(
29
30
  p[e],
30
31
  t === "aside" && a
31
32
  ),
32
- children: /* @__PURE__ */ o(n, { messageId: m[e] })
33
+ children: /* @__PURE__ */ o(i, { messageId: m[e] })
33
34
  }
34
35
  );
35
36
  }
36
37
  export {
37
- f as PositionTypeBadge
38
+ x as PositionTypeBadge
38
39
  };