@gearbox-protocol/ui-kit 4.0.0-next.43 → 4.0.0-next.44

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 (53) hide show
  1. package/dist/cjs/components/base/borrow-rate-block/borrow-rate-block.cjs +1 -1
  2. package/dist/cjs/components/base/index.cjs +1 -1
  3. package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
  4. package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
  5. package/dist/cjs/components/base/position-assets/position-assets.cjs +1 -1
  6. package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
  7. package/dist/cjs/components/base/token-amount/token-amount.cjs +1 -1
  8. package/dist/cjs/components/base/values/constants.cjs +1 -1
  9. package/dist/cjs/components/base/values/index.cjs +1 -1
  10. package/dist/cjs/components/base/values/no-value.cjs +1 -0
  11. package/dist/cjs/components/base/values/pnl-value.cjs +1 -1
  12. package/dist/cjs/components/base/values/price-impact-value.cjs +1 -1
  13. package/dist/cjs/components/base/values/scalars.cjs +1 -1
  14. package/dist/cjs/components/base-table/base-table-line.cjs +1 -1
  15. package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
  16. package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
  17. package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
  18. package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
  19. package/dist/cjs/components/help-tip/help-tip.cjs +1 -1
  20. package/dist/cjs/components/index.cjs +1 -1
  21. package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
  22. package/dist/cjs/index.cjs +1 -1
  23. package/dist/cjs/locale/en.json.cjs +1 -1
  24. package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +3 -2
  25. package/dist/esm/components/base/index.js +63 -61
  26. package/dist/esm/components/base/info-list/info-list.js +8 -7
  27. package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +74 -61
  28. package/dist/esm/components/base/position-assets/position-assets.js +4 -3
  29. package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +86 -74
  30. package/dist/esm/components/base/token-amount/token-amount.js +32 -16
  31. package/dist/esm/components/base/values/constants.js +1 -0
  32. package/dist/esm/components/base/values/index.js +21 -19
  33. package/dist/esm/components/base/values/no-value.js +34 -0
  34. package/dist/esm/components/base/values/pnl-value.js +10 -9
  35. package/dist/esm/components/base/values/price-impact-value.js +6 -5
  36. package/dist/esm/components/base/values/scalars.js +23 -26
  37. package/dist/esm/components/base-table/base-table-line.js +44 -36
  38. package/dist/esm/components/checkbox/checkbox-labeled.js +1 -1
  39. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +1 -1
  40. package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +47 -46
  41. package/dist/esm/components/compound-apy/compound-apy.js +48 -40
  42. package/dist/esm/components/help-tip/help-tip.js +64 -59
  43. package/dist/esm/components/index.js +624 -622
  44. package/dist/esm/components/with-copy/with-copy.js +1 -1
  45. package/dist/esm/index.js +805 -803
  46. package/dist/esm/locale/en.json.js +1 -0
  47. package/dist/types/components/base/apy-breakdown-body/apy-breakdown-body.d.ts +4 -3
  48. package/dist/types/components/base/values/constants.d.ts +1 -0
  49. package/dist/types/components/base/values/index.d.ts +1 -0
  50. package/dist/types/components/base/values/no-value.d.ts +25 -0
  51. package/dist/types/components/base/values/scalars.d.ts +7 -2
  52. package/dist/types/locale/en.json.d.ts +1 -0
  53. package/package.json +1 -1
@@ -1,105 +1,117 @@
1
- import { jsxs as A, jsx as t, Fragment as C } from "react/jsx-runtime";
1
+ import { jsxs as A, jsx as o, Fragment as C } from "react/jsx-runtime";
2
2
  import { calcNetStrategyApy as x, calcEffectiveBorrowApy as D } from "@gearbox-protocol/sdk/onchain";
3
- import { ApyBreakdownBody as P, BREAKDOWN_DASH as v, formatBreakdownRate as r, ApyBreakdownRow as w, periodMessageId as b, ApyBreakdownDivider as q } from "../apy-breakdown-body/apy-breakdown-body.js";
4
- import { PointsIcon as O } from "../../points-icon/points-icon.js";
5
- import { TokenIcon as S } from "../../token-icon/token-icon.js";
6
- import { FormattedMessageTyped as s } from "../../typed-intl/index.js";
7
- import { totalApyOf as L, positiveTokenRewardsOf as M, pointProgramsOf as $ } from "../../../utils/apy-breakdown.js";
3
+ import { ApyBreakdownBody as P, formatBreakdownRate as i, ApyBreakdownRow as v, periodMessageId as k, ApyBreakdownDivider as q, BREAKDOWN_DASH as O } from "../apy-breakdown-body/apy-breakdown-body.js";
4
+ import { NoValue as b } from "../values/no-value.js";
5
+ import "react";
6
+ import { totalApyOf as S, positiveTokenRewardsOf as L, pointProgramsOf as M } from "../../../utils/apy-breakdown.js";
7
+ import "clsx";
8
+ import "tailwind-merge";
9
+ import "sonner";
8
10
  import { formatLeverage as d } from "../../../utils/format-leverage.js";
11
+ import "luxon";
12
+ import "../../../utils/z-index.js";
13
+ import { PointsIcon as $ } from "../../points-icon/points-icon.js";
14
+ import "viem";
15
+ import { TokenIcon as j } from "../../token-icon/token-icon.js";
16
+ import { FormattedMessageTyped as r } from "../../typed-intl/index.js";
17
+ import "../../tooltip/simple-tooltip.js";
18
+ import "../../tooltip/tooltip.js";
19
+ import "../../badge/badge.js";
20
+ import "../../badge/chip.js";
9
21
  import { StrategyApyBreakdownCardTest as n } from "./constants.js";
10
- function j(c) {
11
- const { borrowApyAvg7D: o, quotaRateAvg7D: i, liquidationThreshold: m } = c;
12
- return o === void 0 || i === void 0 ? null : {
13
- borrowApy: o,
14
- quotaRate: i,
15
- liquidationThreshold: m
22
+ function z(c) {
23
+ const { borrowApyAvg7D: t, quotaRateAvg7D: p, liquidationThreshold: s } = c;
24
+ return t === void 0 || p === void 0 ? null : {
25
+ borrowApy: t,
26
+ quotaRate: p,
27
+ liquidationThreshold: s
16
28
  };
17
29
  }
18
- function J({
30
+ function so({
19
31
  data: c,
20
- leverage: o,
21
- showFormula: i = !1,
22
- period: m
32
+ leverage: t,
33
+ showFormula: p = !1,
34
+ period: s
23
35
  }) {
24
- const a = j(c), l = a && c.collateralApyAvg7D ? c.collateralApyAvg7D : void 0, f = a !== null && l !== void 0, g = f && a && l ? {
36
+ const a = z(c), l = a && c.collateralApyAvg7D ? c.collateralApyAvg7D : void 0, f = a !== null && l !== void 0, g = f && a && l ? {
25
37
  organicApy: x(
26
38
  a,
27
39
  l.organicApy,
28
- o
40
+ t
29
41
  ),
30
42
  totalApy: x(
31
43
  a,
32
44
  l.totalApy ?? l.organicApy,
33
- o
45
+ t
34
46
  ),
35
47
  ...l.rewards ? { rewards: l.rewards } : {}
36
- } : null, p = f && a ? D(a, o) : null, u = g === null ? null : L(g), I = u === null || p === null ? null : u + p, N = l ? M(l) : [], B = l ? $(l) : [], T = N.map((e) => ({
48
+ } : null, m = f && a ? D(a, t) : null, u = g === null ? null : S(g), I = u === null || m === null ? null : u + m, N = l ? L(l) : [], B = l ? M(l) : [], T = N.map((e) => ({
37
49
  reward: e,
38
- value: Math.round(o * (e.supplyApr ?? 0))
39
- })), y = I === null ? null : I - T.reduce((e, k) => e + k.value, 0), h = y !== null && o > 0 ? y / o : void 0, R = a && p !== null && o > 0 ? (p - a.borrowApy * (o - 1)) / o : void 0;
50
+ value: Math.round(t * (e.supplyApr ?? 0))
51
+ })), y = I === null ? null : I - T.reduce((e, w) => e + w.value, 0), h = y !== null && t > 0 ? y / t : void 0, R = a && m !== null && t > 0 ? (m - a.borrowApy * (t - 1)) / t : void 0;
40
52
  return /* @__PURE__ */ A(
41
53
  P,
42
54
  {
43
55
  testId: n.root,
44
- title: /* @__PURE__ */ t(
45
- s,
56
+ title: /* @__PURE__ */ o(
57
+ r,
46
58
  {
47
- messageId: b(
48
- m,
59
+ messageId: k(
60
+ s,
49
61
  "components.yieldBreakdown.titleNetAtLeverage",
50
62
  "components.yieldBreakdown.titleNetAtLeverage7d"
51
63
  ),
52
- values: { leverage: d(o) }
64
+ values: { leverage: d(t) }
53
65
  }
54
66
  ),
55
- chip: u === null ? v : r(u),
67
+ chip: u === null ? /* @__PURE__ */ o(b, { reason: s }) : i(u),
56
68
  chipPositive: (u ?? 0) > 0,
57
69
  chipTestId: n.net,
58
70
  children: [
59
- /* @__PURE__ */ t(
60
- w,
71
+ /* @__PURE__ */ o(
72
+ v,
61
73
  {
62
74
  testId: n.collateral,
63
75
  valueTestId: n.value,
64
76
  captionTestId: n.caption,
65
- label: /* @__PURE__ */ t(
66
- s,
77
+ label: /* @__PURE__ */ o(
78
+ r,
67
79
  {
68
- messageId: b(
69
- m,
80
+ messageId: k(
81
+ s,
70
82
  "components.yieldBreakdown.collateralApy",
71
83
  "components.yieldBreakdown.collateralApy7d"
72
84
  )
73
85
  }
74
86
  ),
75
- value: y === null ? v : r(y),
76
- subtext: i && h !== void 0 ? /* @__PURE__ */ t(
77
- s,
87
+ value: y === null ? /* @__PURE__ */ o(b, { reason: s }) : i(y),
88
+ subtext: p && h !== void 0 ? /* @__PURE__ */ o(
89
+ r,
78
90
  {
79
91
  messageId: "components.strategyApyBreakdownCard.formula",
80
92
  values: {
81
- leverage: d(o),
82
- base: r(h)
93
+ leverage: d(t),
94
+ base: i(h)
83
95
  }
84
96
  }
85
97
  ) : void 0
86
98
  }
87
99
  ),
88
- T.map(({ reward: e, value: k }) => /* @__PURE__ */ t(
89
- w,
100
+ T.map(({ reward: e, value: w }) => /* @__PURE__ */ o(
101
+ v,
90
102
  {
91
103
  valueTestId: n.value,
92
104
  captionTestId: n.caption,
93
105
  label: /* @__PURE__ */ A("span", { className: "inline-flex items-center gap-1.5", children: [
94
- /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(
95
- s,
106
+ /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(
107
+ r,
96
108
  {
97
109
  messageId: "components.apyParts.extraAPY",
98
110
  values: { symbol: e.token.symbol }
99
111
  }
100
112
  ) }),
101
- /* @__PURE__ */ t(
102
- S,
113
+ /* @__PURE__ */ o(
114
+ j,
103
115
  {
104
116
  token: e.token,
105
117
  symbol: e.token.symbol,
@@ -108,74 +120,74 @@ function J({
108
120
  }
109
121
  )
110
122
  ] }),
111
- value: r(k),
112
- subtext: i ? /* @__PURE__ */ t(
113
- s,
123
+ value: i(w),
124
+ subtext: p ? /* @__PURE__ */ o(
125
+ r,
114
126
  {
115
127
  messageId: "components.strategyApyBreakdownCard.formula",
116
128
  values: {
117
- leverage: d(o),
118
- base: r(e.supplyApr ?? 0)
129
+ leverage: d(t),
130
+ base: i(e.supplyApr ?? 0)
119
131
  }
120
132
  }
121
133
  ) : void 0
122
134
  },
123
135
  `incentive-${e.token.address}-${e.supplyApr ?? 0}`
124
136
  )),
125
- /* @__PURE__ */ t(
126
- w,
137
+ /* @__PURE__ */ o(
138
+ v,
127
139
  {
128
140
  muted: !0,
129
141
  testId: n.borrow,
130
142
  valueTestId: n.value,
131
143
  captionTestId: n.caption,
132
- label: /* @__PURE__ */ t(
133
- s,
144
+ label: /* @__PURE__ */ o(
145
+ r,
134
146
  {
135
- messageId: b(
136
- m,
147
+ messageId: k(
148
+ s,
137
149
  "components.yieldBreakdown.borrowRate",
138
150
  "components.yieldBreakdown.borrowRate7d"
139
151
  )
140
152
  }
141
153
  ),
142
- value: p === null ? v : r(-p),
143
- subtext: i && a && R !== void 0 ? /* @__PURE__ */ t(
144
- s,
154
+ value: m === null ? /* @__PURE__ */ o(b, { reason: s }) : i(-m),
155
+ subtext: p && a && R !== void 0 ? /* @__PURE__ */ o(
156
+ r,
145
157
  {
146
158
  messageId: "components.strategyApyBreakdownCard.borrowFormula",
147
159
  values: {
148
- leverage: d(o),
160
+ leverage: d(t),
149
161
  // What the position is charged per unit of itself: base
150
162
  // interest plus the quota, added before either is rounded, so
151
163
  // the caption is not the sum of two figures it also printed.
152
- totalRate: r(a.borrowApy + R),
164
+ totalRate: i(a.borrowApy + R),
153
165
  // Magnitudes, not signed rates: the row above already carries
154
166
  // the minus, and `− −0.88%` reads as arithmetic to decode
155
167
  // rather than a cost to understand.
156
- borrowRate: r(a.borrowApy)
168
+ borrowRate: i(a.borrowApy)
157
169
  }
158
170
  }
159
171
  ) : void 0
160
172
  }
161
173
  ),
162
174
  B.length > 0 ? /* @__PURE__ */ A(C, { children: [
163
- /* @__PURE__ */ t(q, {}),
164
- B.map((e) => /* @__PURE__ */ t(
165
- w,
175
+ /* @__PURE__ */ o(q, {}),
176
+ B.map((e) => /* @__PURE__ */ o(
177
+ v,
166
178
  {
167
179
  valueTestId: n.points,
168
180
  captionTestId: n.caption,
169
181
  label: /* @__PURE__ */ A("span", { className: "inline-flex items-center gap-1.5", children: [
170
- /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(
171
- s,
182
+ /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(
183
+ r,
172
184
  {
173
185
  messageId: "components.yieldBreakdown.programPoints",
174
186
  values: { name: e.name }
175
187
  }
176
188
  ) }),
177
- /* @__PURE__ */ t(
178
- O,
189
+ /* @__PURE__ */ o(
190
+ $,
179
191
  {
180
192
  reward: { name: e.name, type: e.id },
181
193
  size: 16,
@@ -183,13 +195,13 @@ function J({
183
195
  }
184
196
  )
185
197
  ] }),
186
- value: e.multiplier != null ? `${d(e.multiplier * o)}×` : v,
187
- subtext: i && e.multiplier != null ? /* @__PURE__ */ t(
188
- s,
198
+ value: e.multiplier != null ? `${d(e.multiplier * t)}×` : O,
199
+ subtext: p && e.multiplier != null ? /* @__PURE__ */ o(
200
+ r,
189
201
  {
190
202
  messageId: "components.strategyApyBreakdownCard.formula",
191
203
  values: {
192
- leverage: d(o),
204
+ leverage: d(t),
193
205
  base: d(e.multiplier)
194
206
  }
195
207
  }
@@ -203,6 +215,6 @@ function J({
203
215
  );
204
216
  }
205
217
  export {
206
- J as StrategyApyBreakdownCard,
218
+ so as StrategyApyBreakdownCard,
207
219
  n as StrategyApyBreakdownCardTest
208
220
  };
@@ -1,30 +1,46 @@
1
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
- import { Stack as s } from "../stack/stack.js";
3
- import { TokenTemplate as a } 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 n } from "./constants.js";
7
- function v({
1
+ import { jsx as r, jsxs as e } from "react/jsx-runtime";
2
+ import { Stack as n } from "../stack/stack.js";
3
+ import { NoValue as a } from "../values/no-value.js";
4
+ import "react";
5
+ import "@gearbox-protocol/sdk/onchain";
6
+ import "clsx";
7
+ import "tailwind-merge";
8
+ import "sonner";
9
+ import { formatMoney as s } from "../../../utils/format-money.js";
10
+ import "luxon";
11
+ import "../../../utils/z-index.js";
12
+ import "../../points-icon/points-icon.js";
13
+ import "viem";
14
+ import "../../token-icon/token-icon.js";
15
+ import "react-intl";
16
+ import "../../tooltip/simple-tooltip.js";
17
+ import "../../tooltip/tooltip.js";
18
+ import "../../badge/badge.js";
19
+ import "../../badge/chip.js";
20
+ import { TokenTemplate as l } from "../../token-template/token-template.js";
21
+ import { Typography as u } from "../../typography/typography.js";
22
+ import { TokenAmountTest as t } from "./constants.js";
23
+ function C({
8
24
  data: o,
9
- token: e,
10
- align: t = "end"
25
+ token: m,
26
+ align: i = "end"
11
27
  }) {
12
28
  if (o === null)
13
29
  return /* @__PURE__ */ r(
14
30
  "span",
15
31
  {
16
32
  className: "text-secondary-foreground",
17
- "data-testid": n.root,
33
+ "data-testid": t.root,
18
34
  children: "—"
19
35
  }
20
36
  );
21
- const m = e ?? o.token;
22
- return /* @__PURE__ */ i(s, { gap: "xs", align: t, "data-testid": n.root, children: [
23
- /* @__PURE__ */ r(a, { value: o.value, token: m }),
24
- /* @__PURE__ */ r(l, { as: "span", variant: "caption", color: "secondary", children: o.valueUsd === null ? "—" : p(o.valueUsd) })
37
+ const p = m ?? o.token;
38
+ return /* @__PURE__ */ e(n, { gap: "xs", align: i, "data-testid": t.root, children: [
39
+ /* @__PURE__ */ r(l, { value: o.value, token: p }),
40
+ /* @__PURE__ */ r(u, { as: "span", variant: "caption", color: "secondary", children: o.valueUsd === null ? /* @__PURE__ */ r(a, {}) : s(o.valueUsd) })
25
41
  ] });
26
42
  }
27
43
  export {
28
- v as TokenAmount,
29
- n as TokenAmountTest
44
+ C as TokenAmount,
45
+ t as TokenAmountTest
30
46
  };
@@ -9,6 +9,7 @@ class a {
9
9
  static tokenBigint = "value-token-bigint";
10
10
  static points = "value-points";
11
11
  static placeholder = "value-placeholder";
12
+ static accruing = "value-accruing";
12
13
  }
13
14
  class e {
14
15
  static root = "position-short-label";
@@ -1,26 +1,28 @@
1
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 s } from "./position-short-label.js";
2
+ import { NoValue as i } from "./no-value.js";
3
+ import { PnlValue as p } from "./pnl-value.js";
4
+ import { PointsValue as u } from "./points-value.js";
5
+ import { PositionShortLabel as V } from "./position-short-label.js";
5
6
  import { PositionStatusBadge as n } from "./position-status-badge.js";
6
- import { PositionTypeBadge as f } from "./position-type-badge.js";
7
- import { PriceImpactValue as P, priceImpact as c } from "./price-impact-value.js";
8
- import { ApyValue as T, HealthFactorValue as b, LeverageValue as d, TokenBigint as h, UsdValue as B, UtilizationValue as L, bps as S } from "./scalars.js";
7
+ import { PositionTypeBadge as P } from "./position-type-badge.js";
8
+ import { PriceImpactValue as g, priceImpact as T } from "./price-impact-value.js";
9
+ import { ApyValue as d, HealthFactorValue as h, LeverageValue as B, TokenBigint as L, UsdValue as S, UtilizationValue as y, bps as I } from "./scalars.js";
9
10
  export {
10
- T as ApyValue,
11
- b as HealthFactorValue,
12
- d as LeverageValue,
13
- i as PnlValue,
14
- p as PointsValue,
15
- s as PositionShortLabel,
11
+ d as ApyValue,
12
+ h as HealthFactorValue,
13
+ B as LeverageValue,
14
+ i as NoValue,
15
+ p as PnlValue,
16
+ u as PointsValue,
17
+ V as PositionShortLabel,
16
18
  t as PositionShortLabelTest,
17
19
  n as PositionStatusBadge,
18
- f as PositionTypeBadge,
19
- P as PriceImpactValue,
20
- h as TokenBigint,
21
- B as UsdValue,
22
- L as UtilizationValue,
20
+ P as PositionTypeBadge,
21
+ g as PriceImpactValue,
22
+ L as TokenBigint,
23
+ S as UsdValue,
24
+ y as UtilizationValue,
23
25
  r as ValueTest,
24
- S as bps,
25
- c as priceImpact
26
+ I as bps,
27
+ T as priceImpact
26
28
  };
@@ -0,0 +1,34 @@
1
+ import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
+ import { HelpTip as o } from "../../help-tip/help-tip.js";
3
+ import { useIntlTyped as i } from "../../typed-intl/index.js";
4
+ import { ValueTest as n } from "./constants.js";
5
+ const c = "—";
6
+ function u({ reason: r }) {
7
+ const t = i();
8
+ if (r === void 0)
9
+ return /* @__PURE__ */ e(
10
+ "span",
11
+ {
12
+ className: "text-secondary-foreground",
13
+ "data-testid": n.placeholder,
14
+ children: c
15
+ }
16
+ );
17
+ const s = t.formatMessage({
18
+ messageId: "components.value.accruing"
19
+ });
20
+ return /* @__PURE__ */ a(
21
+ "span",
22
+ {
23
+ className: "inline-flex items-center leading-[0]",
24
+ "data-testid": n.accruing,
25
+ children: [
26
+ /* @__PURE__ */ e(o, { iconSize: 18, children: s }),
27
+ /* @__PURE__ */ e("span", { className: "sr-only", children: s })
28
+ ]
29
+ }
30
+ );
31
+ }
32
+ export {
33
+ u as NoValue
34
+ };
@@ -5,23 +5,24 @@ import { cn as i } from "../../../utils/cn.js";
5
5
  import "sonner";
6
6
  import "luxon";
7
7
  import "../../../utils/z-index.js";
8
- import { ValueTest as o } from "./constants.js";
9
- function f({
10
- data: e
8
+ import { ValueTest as s } from "./constants.js";
9
+ import { NoValue as m } from "./no-value.js";
10
+ function V({
11
+ data: o
11
12
  }) {
12
- const t = typeof e == "number" ? e : e?.total.valueUsd ?? null;
13
+ const t = typeof o == "number" ? o : o?.total.valueUsd ?? null;
13
14
  if (t === null)
14
- return /* @__PURE__ */ r("span", { "data-testid": o.placeholder, children: "—" });
15
- const s = t > 0 ? "+" : t < 0 ? "−" : "";
15
+ return /* @__PURE__ */ r(m, {});
16
+ const e = t > 0 ? "+" : t < 0 ? "−" : "";
16
17
  return /* @__PURE__ */ r(
17
18
  "span",
18
19
  {
19
- "data-testid": o.pnl,
20
+ "data-testid": s.pnl,
20
21
  className: i(t > 0 && "text-success", t < 0 && "text-destructive"),
21
- children: `${s}$${Math.abs(t).toFixed(2)}`
22
+ children: `${e}$${Math.abs(t).toFixed(2)}`
22
23
  }
23
24
  );
24
25
  }
25
26
  export {
26
- f as PnlValue
27
+ V as PnlValue
27
28
  };
@@ -8,15 +8,16 @@ import { formatPercentAmount as o } from "../../../utils/format-money.js";
8
8
  import "luxon";
9
9
  import "../../../utils/z-index.js";
10
10
  import { ValueTest as i } from "./constants.js";
11
- function e(r) {
11
+ import { NoValue as m } from "./no-value.js";
12
+ function p(r) {
12
13
  return `${r > 0n ? "+" : ""}${o(Number(r) / 1e4, 2)}%`;
13
14
  }
14
- function I({
15
+ function x({
15
16
  data: r
16
17
  }) {
17
- return r === void 0 ? /* @__PURE__ */ t("span", { "data-testid": i.placeholder, children: "—" }) : /* @__PURE__ */ t("span", { "data-testid": i.priceImpact, children: e(r) });
18
+ return r === void 0 ? /* @__PURE__ */ t(m, {}) : /* @__PURE__ */ t("span", { "data-testid": i.priceImpact, children: p(r) });
18
19
  }
19
20
  export {
20
- I as PriceImpactValue,
21
- e as priceImpact
21
+ x as PriceImpactValue,
22
+ p as priceImpact
22
23
  };
@@ -1,5 +1,5 @@
1
- import { jsx as r, jsxs as m } from "react/jsx-runtime";
2
- import { formatUnits as u } from "viem";
1
+ import { jsx as r, jsxs as u } from "react/jsx-runtime";
2
+ import { formatUnits as l } from "viem";
3
3
  import { CompoundAPY as p } from "../../compound-apy/compound-apy.js";
4
4
  import { SimpleTooltip as a } from "../../tooltip/simple-tooltip.js";
5
5
  import "../../tooltip/tooltip.js";
@@ -7,42 +7,39 @@ import "react";
7
7
  import "@gearbox-protocol/sdk/onchain";
8
8
  import { cn as c } from "../../../utils/cn.js";
9
9
  import "sonner";
10
- import { formatAssetAmount as d } from "../../../utils/format-asset-amount.js";
11
- import { formatLeverage as f } from "../../../utils/format-leverage.js";
10
+ import { formatAssetAmount as f } from "../../../utils/format-asset-amount.js";
11
+ import { formatLeverage as d } from "../../../utils/format-leverage.js";
12
12
  import { formatPercentAmount as h, formatMoney as v } from "../../../utils/format-money.js";
13
13
  import "luxon";
14
14
  import "../../../utils/z-index.js";
15
15
  import { ValueTest as i } from "./constants.js";
16
- const x = "";
17
- function n() {
18
- return /* @__PURE__ */ r("span", { "data-testid": i.placeholder, children: x });
19
- }
16
+ import { NoValue as n } from "./no-value.js";
20
17
  function s(t) {
21
18
  return `${h(t / 100, 2)}%`;
22
19
  }
23
- function E({
20
+ function w({
24
21
  data: t,
25
22
  tooltip: e = !0,
26
23
  period: o
27
24
  }) {
28
- return t === void 0 ? /* @__PURE__ */ r(n, {}) : typeof t == "number" ? /* @__PURE__ */ r("span", { "data-testid": i.apy, children: s(t) }) : /* @__PURE__ */ r("span", { "data-testid": i.apy, children: /* @__PURE__ */ r(p, { apy: t, tooltip: e, period: o }) });
25
+ return t === void 0 ? /* @__PURE__ */ r(n, { reason: o }) : typeof t == "number" ? /* @__PURE__ */ r("span", { "data-testid": i.apy, children: s(t) }) : /* @__PURE__ */ r("span", { "data-testid": i.apy, children: /* @__PURE__ */ r(p, { apy: t, tooltip: e, period: o }) });
29
26
  }
30
- function H({
27
+ function C({
31
28
  data: t
32
29
  }) {
33
30
  return t == null ? /* @__PURE__ */ r(n, {}) : /* @__PURE__ */ r("span", { "data-testid": i.usd, children: v(t) });
34
31
  }
35
- function N({
32
+ function H({
36
33
  data: t
37
34
  }) {
38
- return t === void 0 ? /* @__PURE__ */ r(n, {}) : /* @__PURE__ */ r("span", { "data-testid": i.leverage, children: `${f(t)}x` });
35
+ return t === void 0 ? /* @__PURE__ */ r(n, {}) : /* @__PURE__ */ r("span", { "data-testid": i.leverage, children: `${d(t)}x` });
39
36
  }
40
- function w({
37
+ function M({
41
38
  data: t
42
39
  }) {
43
40
  return t === void 0 ? /* @__PURE__ */ r(n, {}) : /* @__PURE__ */ r("span", { "data-testid": i.utilization, children: s(t) });
44
41
  }
45
- function D({
42
+ function S({
46
43
  data: t
47
44
  }) {
48
45
  if (t === void 0)
@@ -50,26 +47,26 @@ function D({
50
47
  const e = t < 1e4 ? "text-destructive" : t < 11e3 ? "text-warning" : "text-success";
51
48
  return /* @__PURE__ */ r("span", { "data-testid": i.healthFactor, className: c(e), children: (t / 1e4).toFixed(2) });
52
49
  }
53
- function M({
50
+ function Y({
54
51
  data: t,
55
52
  token: e,
56
53
  showSymbol: o = !0
57
54
  }) {
58
55
  if (t === void 0 || e === void 0)
59
56
  return /* @__PURE__ */ r(n, {});
60
- const l = u(t, e.decimals);
57
+ const m = l(t, e.decimals);
61
58
  return (
62
59
  // `title` also keeps the amount where a hover tooltip cannot reach:
63
60
  // keyboard, touch, and the browser's own find — and keeps the symbol
64
61
  // reachable there even when the row is the one printing it
65
- /* @__PURE__ */ m("span", { "data-testid": i.tokenBigint, title: `${l} ${e.symbol}`, children: [
62
+ /* @__PURE__ */ u("span", { "data-testid": i.tokenBigint, title: `${m} ${e.symbol}`, children: [
66
63
  /* @__PURE__ */ r(
67
64
  a,
68
65
  {
69
66
  placement: "top",
70
67
  className: "break-all",
71
- title: /* @__PURE__ */ r("span", { children: d(t, e.decimals) }),
72
- children: /* @__PURE__ */ r("span", { children: l })
68
+ title: /* @__PURE__ */ r("span", { children: f(t, e.decimals) }),
69
+ children: /* @__PURE__ */ r("span", { children: m })
73
70
  }
74
71
  ),
75
72
  o && ` ${e.symbol}`
@@ -77,11 +74,11 @@ function M({
77
74
  );
78
75
  }
79
76
  export {
80
- E as ApyValue,
81
- D as HealthFactorValue,
82
- N as LeverageValue,
83
- M as TokenBigint,
84
- H as UsdValue,
85
- w as UtilizationValue,
77
+ w as ApyValue,
78
+ S as HealthFactorValue,
79
+ H as LeverageValue,
80
+ Y as TokenBigint,
81
+ C as UsdValue,
82
+ M as UtilizationValue,
86
83
  s as bps
87
84
  };