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

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 (68) 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/liquidation-price-block/liquidation-price-block.cjs +1 -1
  5. package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
  6. package/dist/cjs/components/base/position-assets/position-assets.cjs +1 -1
  7. package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
  8. package/dist/cjs/components/base/time-to-liquidation-block/time-to-liquidation-block.cjs +1 -1
  9. package/dist/cjs/components/base/token-amount/token-amount.cjs +1 -1
  10. package/dist/cjs/components/base/values/constants.cjs +1 -1
  11. package/dist/cjs/components/base/values/index.cjs +1 -1
  12. package/dist/cjs/components/base/values/no-value.cjs +1 -0
  13. package/dist/cjs/components/base/values/pnl-value.cjs +1 -1
  14. package/dist/cjs/components/base/values/price-impact-value.cjs +1 -1
  15. package/dist/cjs/components/base/values/scalars.cjs +1 -1
  16. package/dist/cjs/components/base-table/base-table-line.cjs +1 -1
  17. package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
  18. package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
  19. package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
  20. package/dist/cjs/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.cjs +1 -1
  21. package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
  22. package/dist/cjs/components/help-tip/help-tip.cjs +1 -1
  23. package/dist/cjs/components/index.cjs +1 -1
  24. package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
  25. package/dist/cjs/index.cjs +1 -1
  26. package/dist/cjs/locale/en.json.cjs +1 -1
  27. package/dist/cjs/utils/format.cjs +1 -1
  28. package/dist/cjs/utils/index.cjs +1 -1
  29. package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +3 -2
  30. package/dist/esm/components/base/index.js +63 -61
  31. package/dist/esm/components/base/info-list/info-list.js +8 -7
  32. package/dist/esm/components/base/liquidation-price-block/liquidation-price-block.js +46 -38
  33. package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +74 -61
  34. package/dist/esm/components/base/position-assets/position-assets.js +45 -41
  35. package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +86 -74
  36. package/dist/esm/components/base/time-to-liquidation-block/time-to-liquidation-block.js +40 -32
  37. package/dist/esm/components/base/token-amount/token-amount.js +32 -16
  38. package/dist/esm/components/base/values/constants.js +1 -0
  39. package/dist/esm/components/base/values/index.js +21 -19
  40. package/dist/esm/components/base/values/no-value.js +34 -0
  41. package/dist/esm/components/base/values/pnl-value.js +10 -9
  42. package/dist/esm/components/base/values/price-impact-value.js +6 -5
  43. package/dist/esm/components/base/values/scalars.js +23 -26
  44. package/dist/esm/components/base-table/base-table-line.js +44 -36
  45. package/dist/esm/components/checkbox/checkbox-labeled.js +1 -1
  46. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +1 -1
  47. package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +47 -46
  48. package/dist/esm/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.js +26 -25
  49. package/dist/esm/components/compound-apy/compound-apy.js +48 -40
  50. package/dist/esm/components/help-tip/help-tip.js +64 -59
  51. package/dist/esm/components/index.js +624 -622
  52. package/dist/esm/components/with-copy/with-copy.js +1 -1
  53. package/dist/esm/index.js +814 -811
  54. package/dist/esm/locale/en.json.js +1 -0
  55. package/dist/esm/utils/format.js +14 -12
  56. package/dist/esm/utils/index.js +76 -75
  57. package/dist/globals.css +1 -1
  58. package/dist/types/components/base/apy-breakdown-body/apy-breakdown-body.d.ts +4 -3
  59. package/dist/types/components/base/liquidation-price-block/liquidation-price-block.d.ts +8 -1
  60. package/dist/types/components/base/position-assets/position-assets.d.ts +7 -1
  61. package/dist/types/components/base/time-to-liquidation-block/time-to-liquidation-block.d.ts +8 -1
  62. package/dist/types/components/base/values/constants.d.ts +1 -0
  63. package/dist/types/components/base/values/index.d.ts +1 -0
  64. package/dist/types/components/base/values/no-value.d.ts +25 -0
  65. package/dist/types/components/base/values/scalars.d.ts +7 -2
  66. package/dist/types/locale/en.json.d.ts +1 -0
  67. package/dist/types/utils/format.d.ts +8 -0
  68. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
- import { jsx as e, jsxs as a, Fragment as y } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as m, Fragment as y } from "react/jsx-runtime";
2
+ import { NoValue as b } from "../../base/values/no-value.js";
2
3
  import "react";
3
4
  import "@gearbox-protocol/sdk/onchain";
4
5
  import "clsx";
@@ -8,84 +9,84 @@ import { formatMoney as C } from "../../../utils/format-money.js";
8
9
  import "luxon";
9
10
  import "../../../utils/z-index.js";
10
11
  import "../../points-icon/points-icon.js";
11
- import { UtilizationValue as N } from "../../base/values/scalars.js";
12
+ import { UtilizationValue as S } from "../../base/values/scalars.js";
12
13
  import "../../badge/badge.js";
13
14
  import "../../badge/chip.js";
14
- import { FormattedMessageTyped as m } from "../../typed-intl/index.js";
15
- import { AllocationWheel as S } from "../../collateral-allocation-tooltip/allocation-wheel.js";
15
+ import { FormattedMessageTyped as a } from "../../typed-intl/index.js";
16
+ import { AllocationWheel as k } from "../../collateral-allocation-tooltip/allocation-wheel.js";
16
17
  import "@fortawesome/free-solid-svg-icons";
17
18
  import "../../icons/fa-icon.js";
18
19
  import "../../token-icon/token-icon.js";
19
20
  import "../../tooltip/simple-tooltip.js";
20
21
  import "../../tooltip/tooltip.js";
21
- import { NameCell as k } from "../../name-cell/name-cell.js";
22
- import { ShortString as w } from "../../short-string/short-string.js";
22
+ import { NameCell as w } from "../../name-cell/name-cell.js";
23
+ import { ShortString as L } from "../../short-string/short-string.js";
23
24
  import "react-intl";
24
25
  import "../../buttons/button/button.js";
25
- import { GridTableRow as L, GridTableCell as o } from "../../table/grid-table.js";
26
+ import { GridTableRow as U, GridTableCell as l } from "../../table/grid-table.js";
26
27
  import "../../skeleton/skeleton.js";
27
28
  import "../../table/table.js";
28
- import { TableLineSm as U, TableCellSm as n } from "../../table/table-sm.js";
29
- import { TokenSymbol as I } from "../../token-symbol/token-symbol.js";
30
- import { TokenTemplate as b } from "../../token-template/token-template.js";
31
- import { VerticalIndicator as P } from "../../vertical-indicator/vertical-indicator.js";
29
+ import { TableLineSm as I, TableCellSm as n } from "../../table/table-sm.js";
30
+ import { TokenSymbol as P } from "../../token-symbol/token-symbol.js";
31
+ import { TokenTemplate as x } from "../../token-template/token-template.js";
32
+ import { VerticalIndicator as j } from "../../vertical-indicator/vertical-indicator.js";
32
33
  import { PoolAssetsTableTest as p } from "./constants.js";
33
- function j(i, t) {
34
+ function V(i, t) {
34
35
  if (t !== 0n)
35
36
  return Number(i * 10000n / t);
36
37
  }
37
38
  function B(i, t) {
38
39
  return t <= 0n || i <= 0n ? 0 : Number(i * 10000n / t) / 1e4;
39
40
  }
40
- function he({
41
+ function fe({
41
42
  asset: i,
42
43
  underlyingToken: t,
43
- last: x,
44
+ last: T,
44
45
  isCompact: c,
45
- totalUsed: T,
46
- colorIndex: z,
46
+ totalUsed: z,
47
+ colorIndex: A,
47
48
  explorerUrl: d
48
49
  }) {
49
- const { token: r, limit: s, used: l } = i, A = c ? 40 : 21, h = B(l.value, T), u = () => /* @__PURE__ */ e(
50
- k,
50
+ const { token: r, limit: s, used: o } = i, N = c ? 40 : 21, u = B(o.value, z), h = () => /* @__PURE__ */ e(
51
+ w,
51
52
  {
52
- leading: /* @__PURE__ */ e(I, { size: 32, token: r }),
53
- title: /* @__PURE__ */ e(w, { maxLength: A, children: r.symbol })
53
+ leading: /* @__PURE__ */ e(P, { size: 32, token: r }),
54
+ title: /* @__PURE__ */ e(L, { maxLength: N, children: r.symbol })
54
55
  }
55
- ), f = () => /* @__PURE__ */ a(
56
+ ), f = () => /* @__PURE__ */ m(
56
57
  "div",
57
58
  {
58
59
  className: "flex items-center justify-end gap-2",
59
60
  "data-testid": p.exposureCell,
60
61
  children: [
61
62
  /* @__PURE__ */ e(
62
- S,
63
+ k,
63
64
  {
64
- share: h,
65
- colorIndex: z,
66
- idle: h === 0
65
+ share: u,
66
+ colorIndex: A,
67
+ idle: u === 0
67
68
  }
68
69
  ),
69
70
  /* @__PURE__ */ e(
70
- P,
71
+ j,
71
72
  {
72
73
  value: /* @__PURE__ */ e(
73
- b,
74
+ x,
74
75
  {
75
76
  decimalPartLength: 2,
76
77
  precision: 2,
77
78
  showSymbol: !1,
78
79
  token: t,
79
- value: l.value
80
+ value: o.value
80
81
  }
81
82
  ),
82
- valueDescription: l.valueUsd === null ? "—" : C(l.valueUsd)
83
+ valueDescription: o.valueUsd === null ? /* @__PURE__ */ e(b, {}) : C(o.valueUsd)
83
84
  }
84
85
  )
85
86
  ]
86
87
  }
87
- ), g = () => /* @__PURE__ */ e("div", { "data-testid": p.capCell, children: s.value === 0n ? /* @__PURE__ */ e("span", { children: "—" }) : /* @__PURE__ */ e(
88
- b,
88
+ ), g = () => /* @__PURE__ */ e("div", { "data-testid": p.capCell, children: s.value === 0n ? /* @__PURE__ */ e(b, {}) : /* @__PURE__ */ e(
89
+ x,
89
90
  {
90
91
  decimalPartLength: 2,
91
92
  precision: 2,
@@ -93,55 +94,55 @@ function he({
93
94
  token: t,
94
95
  value: s.value
95
96
  }
96
- ) }), v = () => /* @__PURE__ */ e("div", { "data-testid": p.capUtilizationCell, children: /* @__PURE__ */ e(N, { data: j(l.value, s.value) }) });
97
+ ) }), v = () => /* @__PURE__ */ e("div", { "data-testid": p.capUtilizationCell, children: /* @__PURE__ */ e(S, { data: V(o.value, s.value) }) });
97
98
  return /* @__PURE__ */ e(
98
- L,
99
+ U,
99
100
  {
100
- last: x,
101
+ last: T,
101
102
  height: "auto",
102
103
  href: d ? `${d}/address/${r.address}` : void 0,
103
104
  target: "_blank",
104
105
  style: { minHeight: "75px" },
105
- children: c ? /* @__PURE__ */ e(o, { className: "px-3 py-0!", size: "sm", span: "full", children: /* @__PURE__ */ a(
106
- U,
106
+ children: c ? /* @__PURE__ */ e(l, { className: "px-3 py-0!", size: "sm", span: "full", children: /* @__PURE__ */ m(
107
+ I,
107
108
  {
108
109
  className: "w-full",
109
110
  columns: 3,
110
111
  columnsXs: 3,
111
- title: u(),
112
+ title: h(),
112
113
  children: [
113
114
  /* @__PURE__ */ e(
114
115
  n,
115
116
  {
116
- title: /* @__PURE__ */ e(m, { messageId: "components.poolAssetsTable.exposure" }),
117
+ title: /* @__PURE__ */ e(a, { messageId: "components.poolAssetsTable.exposure" }),
117
118
  children: f()
118
119
  }
119
120
  ),
120
121
  /* @__PURE__ */ e(
121
122
  n,
122
123
  {
123
- title: /* @__PURE__ */ e(m, { messageId: "components.poolAssetsTable.cap" }),
124
+ title: /* @__PURE__ */ e(a, { messageId: "components.poolAssetsTable.cap" }),
124
125
  children: g()
125
126
  }
126
127
  ),
127
128
  /* @__PURE__ */ e(
128
129
  n,
129
130
  {
130
- title: /* @__PURE__ */ e(m, { messageId: "components.poolAssetsTable.capUtilization" }),
131
+ title: /* @__PURE__ */ e(a, { messageId: "components.poolAssetsTable.capUtilization" }),
131
132
  children: v()
132
133
  }
133
134
  )
134
135
  ]
135
136
  }
136
- ) }) : /* @__PURE__ */ a(y, { children: [
137
- /* @__PURE__ */ e(o, { className: "pl-4", size: "sm", textAlign: "left", children: u() }),
138
- /* @__PURE__ */ e(o, { size: "sm", textAlign: "right", children: f() }),
139
- /* @__PURE__ */ e(o, { size: "sm", textAlign: "right", children: g() }),
140
- /* @__PURE__ */ e(o, { className: "pr-4", size: "sm", textAlign: "right", children: v() })
137
+ ) }) : /* @__PURE__ */ m(y, { children: [
138
+ /* @__PURE__ */ e(l, { className: "pl-4", size: "sm", textAlign: "left", children: h() }),
139
+ /* @__PURE__ */ e(l, { size: "sm", textAlign: "right", children: f() }),
140
+ /* @__PURE__ */ e(l, { size: "sm", textAlign: "right", children: g() }),
141
+ /* @__PURE__ */ e(l, { className: "pr-4", size: "sm", textAlign: "right", children: v() })
141
142
  ] })
142
143
  }
143
144
  );
144
145
  }
145
146
  export {
146
- he as PoolAssetsTableRow
147
+ fe as PoolAssetsTableRow
147
148
  };
@@ -1,4 +1,4 @@
1
- import { jsxs as i, Fragment as d, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as i, Fragment as d, jsx as o } from "react/jsx-runtime";
2
2
  import { cva as y } from "class-variance-authority";
3
3
  import { FadeoutLoading as g } from "../../../../fadeout-loading/fadeout-loading.js";
4
4
  import { TokenIcon as v } from "../../../../token-icon/token-icon.js";
@@ -7,11 +7,12 @@ import "react";
7
7
  import "@gearbox-protocol/sdk/onchain";
8
8
  import { cn as h } from "../../../../../utils/cn.js";
9
9
  import "sonner";
10
- import { formatMoney as k } from "../../../../../utils/format-money.js";
10
+ import { APPROXIMATE_SYMBOL as k } from "../../../../../utils/format.js";
11
+ import { formatMoney as N } from "../../../../../utils/format-money.js";
11
12
  import "luxon";
12
13
  import "../../../../../utils/z-index.js";
13
- import { TransactionConfirmAmountFieldTest as N } from "./constants.js";
14
- const T = "≈", b = y(
14
+ import { TransactionConfirmAmountFieldTest as T } from "./constants.js";
15
+ const b = y(
15
16
  "flex w-full items-center justify-between bg-gray-20 px-4 py-3",
16
17
  {
17
18
  variants: {
@@ -29,59 +30,59 @@ const T = "≈", b = y(
29
30
  defaultVariants: { position: "first", size: "md" }
30
31
  }
31
32
  );
32
- function S(o) {
33
- if (o.primaryAmount !== void 0)
33
+ function S(n) {
34
+ if (n.primaryAmount !== void 0)
34
35
  return {
35
- primaryAmount: o.primaryAmount,
36
- secondaryAmount: o.secondaryAmount
36
+ primaryAmount: n.primaryAmount,
37
+ secondaryAmount: n.secondaryAmount
37
38
  };
38
- const { amount: t } = o;
39
+ const { amount: t } = n;
39
40
  return {
40
41
  primaryAmount: { value: t?.value, token: t?.token },
41
42
  secondaryAmount: { valueUSD: t?.valueUsd ?? void 0 }
42
43
  };
43
44
  }
44
- function V(o) {
45
+ function E(n) {
45
46
  const {
46
47
  label: t,
47
48
  loading: l = !1,
48
49
  position: p,
49
- size: c = "md",
50
- maxLength: u,
50
+ size: u = "md",
51
+ maxLength: c,
51
52
  approximate: f
52
- } = o, { isApproximate: a = !1, approximateSymbol: m = T } = f || {}, { primaryAmount: e, secondaryAmount: r } = S(o), x = e && "node" in e ? e.node : /* @__PURE__ */ i(d, { children: [
53
- e.token && /* @__PURE__ */ n(v, { token: e.token, size: 16 }),
53
+ } = n, { isApproximate: m = !1, approximateSymbol: a = k } = f || {}, { primaryAmount: e, secondaryAmount: r } = S(n), x = e && "node" in e ? e.node : /* @__PURE__ */ i(d, { children: [
54
+ e.token && /* @__PURE__ */ o(v, { token: e.token, size: 16 }),
54
55
  /* @__PURE__ */ i("span", { children: [
55
- a && /* @__PURE__ */ n("span", { children: m }),
56
- /* @__PURE__ */ n(
56
+ m && /* @__PURE__ */ o("span", { children: a }),
57
+ /* @__PURE__ */ o(
57
58
  A,
58
59
  {
59
60
  value: e?.value,
60
61
  token: e.token,
61
- maxLength: u
62
+ maxLength: c
62
63
  }
63
64
  )
64
65
  ] })
65
66
  ] }), s = r && "node" in r ? r.node : r?.valueUSD ? /* @__PURE__ */ i(d, { children: [
66
- a && /* @__PURE__ */ n("span", { children: m }),
67
- k(r.valueUSD)
67
+ m && /* @__PURE__ */ o("span", { children: a }),
68
+ N(r.valueUSD)
68
69
  ] }) : null;
69
70
  return /* @__PURE__ */ i(
70
71
  "div",
71
72
  {
72
- className: h(b({ position: p, size: c })),
73
- "data-testid": N.root,
73
+ className: h(b({ position: p, size: u })),
74
+ "data-testid": T.root,
74
75
  children: [
75
- /* @__PURE__ */ n("span", { className: "text-sm font-medium text-foreground", children: t }),
76
+ /* @__PURE__ */ o("span", { className: "text-sm font-medium text-foreground", children: t }),
76
77
  /* @__PURE__ */ i("div", { className: "flex flex-col items-end gap-0.5", children: [
77
- /* @__PURE__ */ n(g, { loading: l, children: /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1.5 text-sm font-medium text-foreground", children: x }) }),
78
- s && /* @__PURE__ */ n("span", { className: "text-xs leading-[130%] text-secondary-foreground", children: s })
78
+ /* @__PURE__ */ o(g, { loading: l, children: /* @__PURE__ */ o("span", { className: "inline-flex items-center gap-1.5 text-sm font-medium text-foreground", children: x }) }),
79
+ s && /* @__PURE__ */ o("span", { className: "text-xs leading-[130%] text-secondary-foreground", children: s })
79
80
  ] })
80
81
  ]
81
82
  }
82
83
  );
83
84
  }
84
85
  export {
85
- V as TransactionConfirmAmountField,
86
+ E as TransactionConfirmAmountField,
86
87
  S as resolveAmountSlots
87
88
  };
@@ -1,6 +1,6 @@
1
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
2
- import { useId as x } from "react";
3
- import { YieldBreakdownTooltip as v } from "../yield-breakdown-tooltip/yield-breakdown-tooltip.js";
1
+ import { jsx as r, jsxs as o } from "react/jsx-runtime";
2
+ import { useId as v } from "react";
3
+ import { NoValue as x } from "../base/values/no-value.js";
4
4
  import { totalApyOf as C, positiveTokenRewardsOf as I, pointProgramsOf as k } from "../../utils/apy-breakdown.js";
5
5
  import "@gearbox-protocol/sdk/onchain";
6
6
  import { bpsToPercent as P } from "../../utils/bps.js";
@@ -9,10 +9,18 @@ import "sonner";
9
9
  import { formatCompactPercent as O } from "../../utils/format-money.js";
10
10
  import "luxon";
11
11
  import "../../utils/z-index.js";
12
+ import "../points-icon/points-icon.js";
13
+ import "viem";
14
+ import "../tooltip/simple-tooltip.js";
15
+ import "../tooltip/tooltip.js";
16
+ import "../badge/badge.js";
17
+ import "../badge/chip.js";
18
+ import "react-intl";
19
+ import { YieldBreakdownTooltip as F } from "../yield-breakdown-tooltip/yield-breakdown-tooltip.js";
12
20
  const l = 14;
13
- function F() {
14
- const e = `additional-incentives-${x().replace(/:/g, "")}`;
15
- return /* @__PURE__ */ n(
21
+ function N() {
22
+ const t = `additional-incentives-${v().replace(/:/g, "")}`;
23
+ return /* @__PURE__ */ o(
16
24
  "svg",
17
25
  {
18
26
  width: l,
@@ -24,15 +32,15 @@ function F() {
24
32
  role: "img",
25
33
  "aria-label": "Incentives",
26
34
  children: [
27
- /* @__PURE__ */ t("title", { children: "Incentives" }),
28
- /* @__PURE__ */ t(
35
+ /* @__PURE__ */ r("title", { children: "Incentives" }),
36
+ /* @__PURE__ */ r(
29
37
  "path",
30
38
  {
31
39
  d: "M7 14C10.866 14 14 10.866 14 7C14 3.13401 10.866 0 7 0C3.13401 0 0 3.13401 0 7C0 10.866 3.13401 14 7 14Z",
32
- fill: `url(#${e})`
40
+ fill: `url(#${t})`
33
41
  }
34
42
  ),
35
- /* @__PURE__ */ t(
43
+ /* @__PURE__ */ r(
36
44
  "path",
37
45
  {
38
46
  d: "M7 3.75V10.25M3.75 7H10.25",
@@ -41,18 +49,18 @@ function F() {
41
49
  strokeLinecap: "round"
42
50
  }
43
51
  ),
44
- /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ n(
52
+ /* @__PURE__ */ r("defs", { children: /* @__PURE__ */ o(
45
53
  "linearGradient",
46
54
  {
47
- id: e,
55
+ id: t,
48
56
  x1: "0",
49
57
  y1: "7",
50
58
  x2: "14",
51
59
  y2: "7",
52
60
  gradientUnits: "userSpaceOnUse",
53
61
  children: [
54
- /* @__PURE__ */ t("stop", { stopColor: "#FF2D8D" }),
55
- /* @__PURE__ */ t("stop", { offset: "1", stopColor: "#FF6C20" })
62
+ /* @__PURE__ */ r("stop", { stopColor: "#FF2D8D" }),
63
+ /* @__PURE__ */ r("stop", { offset: "1", stopColor: "#FF6C20" })
56
64
  ]
57
65
  }
58
66
  ) })
@@ -60,43 +68,43 @@ function F() {
60
68
  }
61
69
  );
62
70
  }
63
- function c(e) {
64
- return e == null ? !1 : I(e).length > 0 || k(e).length > 0;
71
+ function p(t) {
72
+ return t == null ? !1 : I(t).length > 0 || k(t).length > 0;
65
73
  }
66
- function U({
67
- apy: e,
68
- maxLeverage: p,
69
- collateralApy: r,
70
- borrowApy: d,
71
- quotaRate: a,
72
- decimals: m = 2,
74
+ function W({
75
+ apy: t,
76
+ maxLeverage: m,
77
+ collateralApy: e,
78
+ borrowApy: c,
79
+ quotaRate: d,
80
+ decimals: a = 2,
73
81
  tooltip: f = !0,
74
82
  period: h,
75
- className: o
83
+ className: i
76
84
  }) {
77
- if (!e)
78
- return /* @__PURE__ */ t("span", { className: "text-secondary-foreground", children: "—" });
79
- const i = C(e), u = c(e) || c(r), g = f && i >= 1, s = () => {
80
- const w = O(P(i), m);
81
- return /* @__PURE__ */ n("div", { className: A("inline-flex items-center gap-1.5", o), children: [
82
- /* @__PURE__ */ t("span", { className: "inline-flex items-center", children: w }),
83
- u ? /* @__PURE__ */ t(F, {}) : null
85
+ if (!t)
86
+ return /* @__PURE__ */ r(x, {});
87
+ const n = C(t), u = p(t) || p(e), g = f && n >= 1, s = () => {
88
+ const w = O(P(n), a);
89
+ return /* @__PURE__ */ o("div", { className: A("inline-flex items-center gap-1.5", i), children: [
90
+ /* @__PURE__ */ r("span", { className: "inline-flex items-center", children: w }),
91
+ u ? /* @__PURE__ */ r(N, {}) : null
84
92
  ] });
85
93
  };
86
- return g ? /* @__PURE__ */ t(
87
- v,
94
+ return g ? /* @__PURE__ */ r(
95
+ F,
88
96
  {
89
- supplyApy: e,
90
- maxLeverage: p,
91
- collateralApy: r,
92
- borrowApy: d,
93
- quotaRate: a,
97
+ supplyApy: t,
98
+ maxLeverage: m,
99
+ collateralApy: e,
100
+ borrowApy: c,
101
+ quotaRate: d,
94
102
  period: h,
95
- className: o,
103
+ className: i,
96
104
  children: s()
97
105
  }
98
106
  ) : s();
99
107
  }
100
108
  export {
101
- U as CompoundAPY
109
+ W as CompoundAPY
102
110
  };
@@ -1,14 +1,16 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { IconQuestionCircle as v, IconInfo as h } from "@gearbox-protocol/static";
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { faCircleQuestion as u } from "@fortawesome/free-solid-svg-icons";
3
+ import { IconInfo as v } from "@gearbox-protocol/static";
3
4
  import { cva as T } from "class-variance-authority";
4
- import * as c from "react";
5
+ import * as p from "react";
6
+ import { FaIcon as C } from "../icons/fa-icon.js";
5
7
  import "@gearbox-protocol/sdk/onchain";
6
- import { cn as s } from "../../utils/cn.js";
8
+ import { cn as m } from "../../utils/cn.js";
7
9
  import "sonner";
8
10
  import "luxon";
9
11
  import "../../utils/z-index.js";
10
- import { SimpleTooltip as C } from "../tooltip/simple-tooltip.js";
11
- const H = T("transition-colors", {
12
+ import { SimpleTooltip as H } from "../tooltip/simple-tooltip.js";
13
+ const I = T("transition-colors", {
12
14
  variants: {
13
15
  iconColor: {
14
16
  "gray-10": "text-gray-10",
@@ -42,89 +44,92 @@ const H = T("transition-colors", {
42
44
  }
43
45
  },
44
46
  defaultVariants: { iconColor: "gray-90", iconHoverColor: "gray-110" }
45
- }), I = c.forwardRef(
47
+ }), N = p.forwardRef(
46
48
  ({
47
- className: r,
48
- children: o,
49
- maxWidth: t,
50
- minWidth: a,
49
+ className: o,
50
+ children: r,
51
+ maxWidth: a,
52
+ minWidth: e,
51
53
  delayShow: g = 200,
52
54
  placement: y = "bottom",
53
55
  iconSize: i = 14,
54
56
  iconColor: n = "gray-90",
55
- iconHoverColor: p = "gray-110",
57
+ iconHoverColor: s = "gray-110",
56
58
  iconVariant: x = "question",
57
- onPointerEnter: m,
58
- ...d
59
- }, f) => {
60
- const u = /* @__PURE__ */ e(
59
+ onPointerEnter: c,
60
+ ...f
61
+ }, d) => {
62
+ const h = /* @__PURE__ */ t(
61
63
  l,
62
64
  {
63
- ref: f,
65
+ ref: d,
64
66
  iconSize: i,
65
67
  iconColor: n,
66
- iconHoverColor: p,
68
+ iconHoverColor: s,
67
69
  iconVariant: x,
68
- onPointerEnter: m,
69
- className: r,
70
- ...d
70
+ onPointerEnter: c,
71
+ className: o,
72
+ ...f
71
73
  }
72
74
  );
73
- return /* @__PURE__ */ e(
74
- C,
75
+ return /* @__PURE__ */ t(
76
+ H,
75
77
  {
76
- title: u,
78
+ title: h,
77
79
  placement: y,
78
80
  delayShow: g,
79
- maxWidth: t,
80
- minWidth: a,
81
- children: o
81
+ maxWidth: a,
82
+ minWidth: e,
83
+ children: r
82
84
  }
83
85
  );
84
86
  }
85
87
  );
86
- I.displayName = "HelpTip";
87
- const l = c.forwardRef(
88
+ N.displayName = "HelpTip";
89
+ const l = p.forwardRef(
88
90
  ({
89
- className: r,
90
- iconSize: o = 14,
91
- iconColor: t = "gray-90",
92
- iconHoverColor: a = "gray-110",
91
+ className: o,
92
+ iconSize: r = 14,
93
+ iconColor: a = "gray-90",
94
+ iconHoverColor: e = "gray-110",
93
95
  iconVariant: g = "question",
94
96
  onPointerEnter: y,
95
97
  ...i
96
- }, n) => {
97
- const p = g === "question" ? v : h;
98
- return /* @__PURE__ */ e(
99
- "span",
100
- {
101
- ref: n,
102
- role: "img",
103
- "aria-hidden": !0,
104
- className: s(
105
- "inline-block cursor-help",
106
- H({ iconColor: t, iconHoverColor: a }),
107
- r
108
- ),
109
- onPointerEnter: y,
110
- ...i,
111
- children: /* @__PURE__ */ e(p, { size: o })
112
- }
113
- );
114
- }
98
+ }, n) => /* @__PURE__ */ t(
99
+ "span",
100
+ {
101
+ ref: n,
102
+ role: "img",
103
+ "aria-hidden": !0,
104
+ className: m(
105
+ "inline-block cursor-help",
106
+ I({ iconColor: a, iconHoverColor: e }),
107
+ o
108
+ ),
109
+ onPointerEnter: y,
110
+ ...i,
111
+ children: g === "question" ? /* @__PURE__ */ t(
112
+ C,
113
+ {
114
+ icon: u,
115
+ style: { width: r, height: r }
116
+ }
117
+ ) : /* @__PURE__ */ t(v, { size: r })
118
+ }
119
+ )
115
120
  );
116
121
  l.displayName = "HelpTipIcon";
117
- const N = c.forwardRef(({ className: r, ...o }, t) => /* @__PURE__ */ e(
122
+ const w = p.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
118
123
  "span",
119
124
  {
120
- ref: t,
121
- className: s("ml-1.5 inline-block leading-[0]", r),
122
- ...o
125
+ ref: a,
126
+ className: m("ml-1.5 inline-block leading-[0]", o),
127
+ ...r
123
128
  }
124
129
  ));
125
- N.displayName = "TipWrap";
130
+ w.displayName = "TipWrap";
126
131
  export {
127
- I as HelpTip,
132
+ N as HelpTip,
128
133
  l as HelpTipIcon,
129
- N as TipWrap
134
+ w as TipWrap
130
135
  };