@gearbox-protocol/ui-kit 3.6.0-next.1 → 3.6.0-next.3

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/compound-apy/compound-apy.cjs +1 -1
  2. package/dist/cjs/components/index.cjs +1 -1
  3. package/dist/cjs/components/pool-apy-tooltip/pool-apy-tooltip.cjs +1 -1
  4. package/dist/cjs/components/pool-assets-table/index.cjs +1 -0
  5. package/dist/cjs/components/{PoolsAssetsTable/TableHead.cjs → pool-assets-table/pool-assets-table-head.cjs} +1 -1
  6. package/dist/cjs/components/{PoolsAssetsTable/PoolAssetsLine.cjs → pool-assets-table/pool-assets-table-row.cjs} +1 -1
  7. package/dist/cjs/components/pool-assets-table/pool-assets-table.cjs +1 -0
  8. package/dist/cjs/components/pool-credit-managers-table/index.cjs +1 -0
  9. package/dist/cjs/components/pool-credit-managers-table/pool-credit-managers-table-head.cjs +1 -0
  10. package/dist/cjs/components/pool-credit-managers-table/pool-credit-managers-table-row.cjs +1 -0
  11. package/dist/cjs/components/pool-credit-managers-table/pool-credit-managers-table.cjs +1 -0
  12. package/dist/cjs/components/pool-credit-managers-table/pool-credit-managers-table.test-ids.cjs +1 -0
  13. package/dist/cjs/components/pool-credit-managers-table/types.cjs +1 -0
  14. package/dist/cjs/index.cjs +1 -1
  15. package/dist/cjs/locale/en.json.cjs +1 -1
  16. package/dist/esm/components/compound-apy/compound-apy.js +1 -1
  17. package/dist/esm/components/index.js +384 -372
  18. package/dist/esm/components/pool-apy-tooltip/pool-apy-tooltip.js +75 -69
  19. package/dist/esm/components/pool-assets-table/index.js +8 -0
  20. package/dist/esm/components/{PoolsAssetsTable/TableHead.js → pool-assets-table/pool-assets-table-head.js} +4 -2
  21. package/dist/esm/components/{PoolsAssetsTable/PoolAssetsLine.js → pool-assets-table/pool-assets-table-row.js} +5 -5
  22. package/dist/esm/components/pool-assets-table/pool-assets-table.js +43 -0
  23. package/dist/esm/components/pool-credit-managers-table/index.js +10 -0
  24. package/dist/esm/components/pool-credit-managers-table/pool-credit-managers-table-head.js +54 -0
  25. package/dist/esm/components/pool-credit-managers-table/pool-credit-managers-table-row.js +71 -0
  26. package/dist/esm/components/pool-credit-managers-table/pool-credit-managers-table.js +42 -0
  27. package/dist/esm/components/pool-credit-managers-table/pool-credit-managers-table.test-ids.js +6 -0
  28. package/dist/esm/components/pool-credit-managers-table/types.js +1 -0
  29. package/dist/esm/index.js +511 -499
  30. package/dist/esm/locale/en.json.js +5 -1
  31. package/dist/types/components/composites/pool-table/pool-table-backend-contract.types.d.ts +168 -17
  32. package/dist/types/components/index.d.ts +2 -1
  33. package/dist/types/components/pool-apy-tooltip/pool-apy-tooltip.d.ts +2 -1
  34. package/dist/types/components/pool-assets-table/index.d.ts +7 -0
  35. package/dist/types/components/pool-assets-table/pool-assets-table-head.d.ts +6 -0
  36. package/dist/types/components/pool-assets-table/pool-assets-table-row.d.ts +11 -0
  37. package/dist/types/components/{PoolsAssetsTable/index.d.ts → pool-assets-table/pool-assets-table.d.ts} +2 -3
  38. package/dist/types/components/{PoolsAssetsTable → pool-assets-table}/types.d.ts +2 -1
  39. package/dist/types/components/pool-credit-managers-table/index.d.ts +8 -0
  40. package/dist/types/components/pool-credit-managers-table/pool-credit-managers-table-head.d.ts +6 -0
  41. package/dist/types/components/pool-credit-managers-table/pool-credit-managers-table-row.d.ts +11 -0
  42. package/dist/types/components/pool-credit-managers-table/pool-credit-managers-table.d.ts +10 -0
  43. package/dist/types/components/pool-credit-managers-table/pool-credit-managers-table.test-ids.d.ts +4 -0
  44. package/dist/types/components/pool-credit-managers-table/types.d.ts +24 -0
  45. package/dist/types/index.d.ts +2 -1
  46. package/dist/types/locale/en.json.d.ts +6 -1
  47. package/package.json +1 -1
  48. package/dist/cjs/components/PoolsAssetsTable/index.cjs +0 -1
  49. package/dist/esm/components/PoolsAssetsTable/index.js +0 -43
  50. package/dist/types/components/PoolsAssetsTable/PoolAssetsLine.d.ts +0 -12
  51. package/dist/types/components/PoolsAssetsTable/TableHead.d.ts +0 -7
  52. /package/dist/cjs/components/{PoolsAssetsTable → pool-assets-table}/types.cjs +0 -0
  53. /package/dist/esm/components/{PoolsAssetsTable → pool-assets-table}/types.js +0 -0
@@ -1,5 +1,5 @@
1
- import { jsx as e, jsxs as o, Fragment as b } from "react/jsx-runtime";
2
- import { faPlus as N } from "@fortawesome/free-solid-svg-icons";
1
+ import { jsx as e, jsxs as n, Fragment as b } from "react/jsx-runtime";
2
+ import { faPlus as P } from "@fortawesome/free-solid-svg-icons";
3
3
  import { IconLighting as T } from "@gearbox-protocol/static";
4
4
  import { getRewardTokenSymbol as k } from "../compound-apy/compound-apy.js";
5
5
  import { FaIcon as S } from "../icons/fa-icon.js";
@@ -7,22 +7,22 @@ import { PointsIcon as _ } from "../points-icon/points-icon.js";
7
7
  import { Skeleton as z } from "../skeleton/skeleton.js";
8
8
  import "react";
9
9
  import "@gearbox-protocol/sdk";
10
- import { cn as y } from "../../utils/cn.js";
10
+ import { cn as u } from "../../utils/cn.js";
11
11
  import "sonner";
12
12
  import { percentTemplate as r } from "../../utils/format-money.js";
13
13
  import "@gearbox-protocol/sdk/common-utils";
14
14
  import "luxon";
15
15
  import "../../utils/z-index.js";
16
16
  import { TokenIcon as C } from "../token-icon/token-icon.js";
17
- import { SimpleTooltip as Y } from "../tooltip/simple-tooltip.js";
17
+ import { SimpleTooltip as L } from "../tooltip/simple-tooltip.js";
18
18
  import "../tooltip/tooltip.js";
19
- import { FormattedMessageTyped as n } from "../typed-intl/index.js";
20
- import { VerticalIndicator as l } from "../vertical-indicator/vertical-indicator.js";
21
- import { VerticalList as u } from "../vertical-list/vertical-list.js";
22
- const A = {
19
+ import { FormattedMessageTyped as o } from "../typed-intl/index.js";
20
+ import { VerticalIndicator as d } from "../vertical-indicator/vertical-indicator.js";
21
+ import { VerticalList as y } from "../vertical-list/vertical-list.js";
22
+ const $ = {
23
23
  supplyAPY: "components.apyParts.supplyAPY",
24
24
  tokenYield: "components.apyParts.tokenYield"
25
- }, L = {
25
+ }, O = {
26
26
  supplyAPY: "components.apyParts.supplyAPY.tip",
27
27
  tokenYield: "components.apyParts.tokenYield.tip"
28
28
  }, v = {
@@ -30,29 +30,29 @@ const A = {
30
30
  "cross-chain-deposit": "components.apyParts.points.condition.crossDeposit",
31
31
  holding: void 0
32
32
  };
33
- function $({ children: d }) {
34
- return /* @__PURE__ */ e("div", { className: "w-[110px] grid grid-cols-2 items-end text-end", children: d });
33
+ function Y({ children: m }) {
34
+ return /* @__PURE__ */ e("div", { className: "w-[110px] grid grid-cols-2 items-end text-end", children: m });
35
35
  }
36
- function ne({
37
- children: d,
36
+ function oe({
37
+ children: m,
38
38
  totalAPY: f,
39
39
  baseAPY: c,
40
40
  extraAPY: h,
41
- points: s,
41
+ points: i,
42
42
  apy7DAgo: a,
43
- externalAPY: m,
43
+ externalAPY: s,
44
44
  tokensList: w,
45
45
  className: g
46
46
  }) {
47
- if (!(f !== void 0 || c && c.length > 0 || h && h.length > 0 || s && s.length > 0))
48
- return /* @__PURE__ */ e("span", { className: g, children: d });
49
- const I = !a || !!a.totalAPYLoading || !!a.loading7DAgo, x = !!a, p = (t, i) => x ? /* @__PURE__ */ o($, { children: [
47
+ if (!(f !== void 0 || c && c.length > 0 || h && h.length > 0 || i && i.length > 0))
48
+ return /* @__PURE__ */ e("span", { className: g, children: m });
49
+ const I = !a || !!a.totalAPYLoading || !!a.loading7DAgo, x = !!a, p = (t, l) => x ? /* @__PURE__ */ n(Y, { children: [
50
50
  /* @__PURE__ */ e("span", { children: t }),
51
- /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(z, { width: 30, height: 14, loading: I, children: i }) })
52
- ] }) : t, P = /* @__PURE__ */ o(
51
+ /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(z, { width: 30, height: 14, loading: I, children: l }) })
52
+ ] }) : t, N = /* @__PURE__ */ n(
53
53
  "div",
54
54
  {
55
- className: y(
55
+ className: u(
56
56
  "w-[370px] max-w-[calc(100vw-32px)] p-6",
57
57
  "bg-popover",
58
58
  "border border-border",
@@ -61,13 +61,13 @@ function ne({
61
61
  "text-left font-normal"
62
62
  ),
63
63
  children: [
64
- /* @__PURE__ */ o(u, { children: [
64
+ /* @__PURE__ */ n(y, { children: [
65
65
  x && /* @__PURE__ */ e(
66
- l,
66
+ d,
67
67
  {
68
68
  size: "sm",
69
69
  label: /* @__PURE__ */ e("span", { className: "uppercase text-muted-foreground text-xs", children: /* @__PURE__ */ e(
70
- n,
70
+ o,
71
71
  {
72
72
  messageId: "components.apyParts.title"
73
73
  }
@@ -75,33 +75,33 @@ function ne({
75
75
  value: /* @__PURE__ */ e("span", { className: "text-muted-foreground text-xs", children: p("1D", "7D") })
76
76
  }
77
77
  ),
78
- c?.map((t, i) => /* @__PURE__ */ e(
79
- l,
78
+ c?.map((t, l) => /* @__PURE__ */ e(
79
+ d,
80
80
  {
81
81
  size: "sm",
82
- label: /* @__PURE__ */ e(n, { messageId: A[t.type] }),
82
+ label: /* @__PURE__ */ e(o, { messageId: $[t.type] }),
83
83
  description: /* @__PURE__ */ e(
84
- n,
84
+ o,
85
85
  {
86
- messageId: L[t.type]
86
+ messageId: O[t.type]
87
87
  }
88
88
  ),
89
89
  value: p(
90
90
  r(t.apy),
91
- r(a?.baseAPY?.[i]?.apy || 0)
91
+ r(a?.baseAPY?.[l]?.apy || 0)
92
92
  )
93
93
  },
94
94
  `base-${t.type}-${t.apy}`
95
95
  )),
96
96
  h?.map((t) => {
97
- const i = w?.[t.rewardToken];
97
+ const l = w?.[t.rewardToken];
98
98
  return /* @__PURE__ */ e(
99
- l,
99
+ d,
100
100
  {
101
101
  size: "sm",
102
- label: /* @__PURE__ */ o("span", { className: "inline-flex items-center", children: [
102
+ label: /* @__PURE__ */ n("span", { className: "inline-flex items-center", children: [
103
103
  /* @__PURE__ */ e(
104
- n,
104
+ o,
105
105
  {
106
106
  messageId: "components.apyParts.extraAPY",
107
107
  values: { symbol: t.rewardTokenSymbol }
@@ -110,13 +110,13 @@ function ne({
110
110
  /* @__PURE__ */ e("span", { className: "ml-1 inline-flex", children: /* @__PURE__ */ e(
111
111
  C,
112
112
  {
113
- symbol: k(i, t.rewardTokenSymbol),
113
+ symbol: k(l, t.rewardTokenSymbol),
114
114
  size: 14
115
115
  }
116
116
  ) })
117
117
  ] }),
118
118
  description: /* @__PURE__ */ e(
119
- n,
119
+ o,
120
120
  {
121
121
  messageId: "components.apyParts.extraAPY.tip"
122
122
  }
@@ -131,12 +131,12 @@ function ne({
131
131
  })
132
132
  ] }),
133
133
  /* @__PURE__ */ e("div", { className: "my-5 border-t border-border" }),
134
- /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(
135
- l,
134
+ /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(
135
+ d,
136
136
  {
137
137
  size: "sm",
138
138
  label: /* @__PURE__ */ e("span", { className: "font-bold", children: /* @__PURE__ */ e(
139
- n,
139
+ o,
140
140
  {
141
141
  messageId: "components.apyParts.totalAPY"
142
142
  }
@@ -147,55 +147,61 @@ function ne({
147
147
  )
148
148
  }
149
149
  ) }),
150
- m && /* @__PURE__ */ e(
150
+ s && /* @__PURE__ */ e(
151
151
  "div",
152
152
  {
153
- className: y(
153
+ className: u(
154
154
  "mt-5 px-8 pt-[18px] pb-4",
155
155
  "rounded-[10px]",
156
156
  "text-[13px] leading-[120%] text-center",
157
157
  "border border-dashed border-gray-40"
158
158
  ),
159
- children: /* @__PURE__ */ e(
160
- n,
161
- {
162
- messageId: m.tooltip,
163
- values: {
164
- name: m.name,
165
- value: /* @__PURE__ */ o(b, { children: [
166
- /* @__PURE__ */ e("span", { className: "text-gray-90 mr-1.5", children: /* @__PURE__ */ e(T, { size: 14, style: { verticalAlign: "top" } }) }),
167
- /* @__PURE__ */ o("span", { className: "font-bold", children: [
168
- "+",
169
- r(m.apy)
170
- ] })
171
- ] })
159
+ children: (() => {
160
+ const t = /* @__PURE__ */ n(b, { children: [
161
+ /* @__PURE__ */ e("span", { className: "text-gray-90 mr-1.5", children: /* @__PURE__ */ e(T, { size: 14, style: { verticalAlign: "top" } }) }),
162
+ /* @__PURE__ */ n("span", { className: "font-bold", children: [
163
+ "+",
164
+ r(s.apy)
165
+ ] })
166
+ ] });
167
+ return s.tooltip ? /* @__PURE__ */ e(
168
+ o,
169
+ {
170
+ messageId: s.tooltip,
171
+ values: {
172
+ name: s.name,
173
+ value: t
174
+ }
172
175
  }
173
- }
174
- )
176
+ ) : /* @__PURE__ */ n("span", { className: "inline-flex flex-wrap items-center justify-center gap-x-1", children: [
177
+ /* @__PURE__ */ e("span", { children: s.name }),
178
+ t
179
+ ] });
180
+ })()
175
181
  }
176
182
  ),
177
- s && s.length > 0 && /* @__PURE__ */ o(b, { children: [
183
+ i && i.length > 0 && /* @__PURE__ */ n(b, { children: [
178
184
  /* @__PURE__ */ e("div", { className: "relative my-2.5 mx-6 border-t-2 border-border", children: /* @__PURE__ */ e(
179
185
  "div",
180
186
  {
181
- className: y(
187
+ className: u(
182
188
  "absolute -top-[10px] left-0",
183
189
  "w-5 h-5",
184
190
  "flex items-center justify-center",
185
191
  "rounded-full",
186
192
  "bg-gray-20"
187
193
  ),
188
- children: /* @__PURE__ */ e(S, { icon: N, className: "size-2.5 text-white" })
194
+ children: /* @__PURE__ */ e(S, { icon: P, className: "size-2.5 text-white" })
189
195
  }
190
196
  ) }),
191
197
  /* @__PURE__ */ e("div", { className: "h-6" }),
192
- /* @__PURE__ */ e(u, { children: s.map((t) => /* @__PURE__ */ e(
193
- l,
198
+ /* @__PURE__ */ e(y, { children: i.map((t) => /* @__PURE__ */ e(
199
+ d,
194
200
  {
195
201
  size: "sm",
196
- label: /* @__PURE__ */ o("span", { className: "inline-flex items-center", children: [
202
+ label: /* @__PURE__ */ n("span", { className: "inline-flex items-center", children: [
197
203
  /* @__PURE__ */ e(
198
- n,
204
+ o,
199
205
  {
200
206
  messageId: "components.apyParts.points",
201
207
  values: { symbol: t.name }
@@ -212,13 +218,13 @@ function ne({
212
218
  }
213
219
  ) })
214
220
  ] }),
215
- description: /* @__PURE__ */ o("div", { children: [
221
+ description: /* @__PURE__ */ n("div", { children: [
216
222
  /* @__PURE__ */ e("div", { children: `Per ${[
217
223
  ...t.reward?.duration ? [t.reward.duration] : [],
218
224
  ...t.tokenTitle ? [`1 ${t.tokenTitle}`] : []
219
225
  ].join(" per ")}` }),
220
226
  t.reward?.condition && v[t.reward.condition] && /* @__PURE__ */ e("span", { className: "text-warning", children: /* @__PURE__ */ e(
221
- n,
227
+ o,
222
228
  {
223
229
  messageId: v[t.reward.condition]
224
230
  }
@@ -233,19 +239,19 @@ function ne({
233
239
  }
234
240
  );
235
241
  return /* @__PURE__ */ e(
236
- Y,
242
+ L,
237
243
  {
238
244
  placement: "bottom",
239
245
  triangle: !1,
240
246
  type: "modal-tooltip",
241
247
  minWidth: "100%",
242
248
  maxWidth: "100%",
243
- title: /* @__PURE__ */ e("span", { className: g, children: d }),
249
+ title: /* @__PURE__ */ e("span", { className: g, children: m }),
244
250
  triggerClassName: g,
245
- children: P
251
+ children: N
246
252
  }
247
253
  );
248
254
  }
249
255
  export {
250
- ne as PoolAPYTooltip
256
+ oe as PoolAPYTooltip
251
257
  };
@@ -0,0 +1,8 @@
1
+ import { PoolAssetsTable as s } from "./pool-assets-table.js";
2
+ import { PoolAssetsTableHead as r } from "./pool-assets-table-head.js";
3
+ import { PoolAssetsTableRow as a } from "./pool-assets-table-row.js";
4
+ export {
5
+ s as PoolAssetsTable,
6
+ r as PoolAssetsTableHead,
7
+ a as PoolAssetsTableRow
8
+ };
@@ -6,7 +6,9 @@ import "@gearbox-protocol/sdk";
6
6
  import { HeadCell as a } from "../head-cell/head-cell.js";
7
7
  import { GridTableRow as g, GridTableHead as i } from "../table/grid-table.js";
8
8
  import { useIntlTyped as f, FormattedMessageTyped as n } from "../typed-intl/index.js";
9
- function j({ sort: l }) {
9
+ function j({
10
+ sort: l
11
+ }) {
10
12
  const s = f(), { state: t, set: o } = l, m = () => o("usage", "desc"), d = () => o("rate", "desc"), p = () => o("name", "desc");
11
13
  return /* @__PURE__ */ c(g, { noHover: !0, height: "35px", children: [
12
14
  /* @__PURE__ */ e(i, { justify: "start", size: "sm", className: "pl-4", children: /* @__PURE__ */ e(
@@ -48,5 +50,5 @@ function j({ sort: l }) {
48
50
  ] });
49
51
  }
50
52
  export {
51
- j as TableHead
53
+ j as PoolAssetsTableHead
52
54
  };
@@ -9,9 +9,9 @@ import "sonner";
9
9
  import { percentageTemplate as A } from "../../utils/format-money.js";
10
10
  import "luxon";
11
11
  import "../../utils/z-index.js";
12
- import { Description as k } from "../description/description.js";
12
+ import { Description as w } from "../description/description.js";
13
13
  import { ShortString as c } from "../short-string/short-string.js";
14
- import { GridTableRow as w, GridTableCell as s } from "../table/grid-table.js";
14
+ import { GridTableRow as k, GridTableCell as s } from "../table/grid-table.js";
15
15
  import { TableLineSm as y, TableCellSm as p } from "../table/table-sm.js";
16
16
  import { TokenSymbol as z } from "../token-symbol/token-symbol.js";
17
17
  import { TokenTemplate as d } from "../token-template/token-template.js";
@@ -27,7 +27,7 @@ function O({
27
27
  /* @__PURE__ */ e(z, { token: l, size: 32 }),
28
28
  /* @__PURE__ */ t("span", { className: "ml-1.5 md:ml-2.5 text-left", children: [
29
29
  /* @__PURE__ */ e(c, { maxLength: b, children: l?.title }),
30
- /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(c, { maxLength: 20, children: h }) })
30
+ /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(c, { maxLength: 20, children: h }) })
31
31
  ] })
32
32
  ] }), a = () => A(T), n = () => /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
33
33
  o,
@@ -60,7 +60,7 @@ function O({
60
60
  }
61
61
  ) });
62
62
  return /* @__PURE__ */ e(
63
- w,
63
+ k,
64
64
  {
65
65
  last: u,
66
66
  height: "auto",
@@ -103,5 +103,5 @@ function O({
103
103
  );
104
104
  }
105
105
  export {
106
- O as PoolAssetsLine
106
+ O as PoolAssetsTableRow
107
107
  };
@@ -0,0 +1,43 @@
1
+ import { jsxs as p, jsx as o } from "react/jsx-runtime";
2
+ import "react";
3
+ import "@gearbox-protocol/sdk/common-utils";
4
+ import "@gearbox-protocol/sdk";
5
+ import { useIsMobile as n } from "../../hooks/use-media-query.js";
6
+ import { GridTable as d, GridTableHeader as f, GridTableBody as b } from "../table/grid-table.js";
7
+ import { PoolAssetsTableHead as c } from "./pool-assets-table-head.js";
8
+ import { PoolAssetsTableRow as T } from "./pool-assets-table-row.js";
9
+ function P({
10
+ list: e,
11
+ poolName: l,
12
+ sort: t,
13
+ tokensList: i,
14
+ underlyingToken: a
15
+ }) {
16
+ const s = n();
17
+ return /* @__PURE__ */ p(
18
+ d,
19
+ {
20
+ cols: s ? "1fr" : "1fr 180px 1fr",
21
+ gap: 0,
22
+ size: "lg",
23
+ wrapperClassName: "overflow-visible",
24
+ children: [
25
+ !s && /* @__PURE__ */ o(f, { children: /* @__PURE__ */ o(c, { sort: t }) }),
26
+ /* @__PURE__ */ o(b, { children: e.map((r, m) => /* @__PURE__ */ o(
27
+ T,
28
+ {
29
+ poolName: l,
30
+ currentQuota: r,
31
+ token: i[r.token],
32
+ underlyingToken: a,
33
+ last: m === e.length - 1
34
+ },
35
+ r.token
36
+ )) })
37
+ ]
38
+ }
39
+ );
40
+ }
41
+ export {
42
+ P as PoolAssetsTable
43
+ };
@@ -0,0 +1,10 @@
1
+ import { PoolCreditManagersTable as r } from "./pool-credit-managers-table.js";
2
+ import { poolCreditManagersTableTestIds as t } from "./pool-credit-managers-table.test-ids.js";
3
+ import { PoolCreditManagersTableHead as d } from "./pool-credit-managers-table-head.js";
4
+ import { PoolCreditManagersTableRow as p } from "./pool-credit-managers-table-row.js";
5
+ export {
6
+ r as PoolCreditManagersTable,
7
+ d as PoolCreditManagersTableHead,
8
+ p as PoolCreditManagersTableRow,
9
+ t as poolCreditManagersTableTestIds
10
+ };
@@ -0,0 +1,54 @@
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
+ import "react";
3
+ import { getSortForField as r } from "../../hooks/use-filter.js";
4
+ import "@gearbox-protocol/sdk/common-utils";
5
+ import "@gearbox-protocol/sdk";
6
+ import { HeadCell as a } from "../head-cell/head-cell.js";
7
+ import { GridTableRow as d, GridTableHead as i } from "../table/grid-table.js";
8
+ import { useIntlTyped as p, FormattedMessageTyped as n } from "../typed-intl/index.js";
9
+ function I({
10
+ sort: m
11
+ }) {
12
+ const s = p(), { state: t, set: o } = m;
13
+ return /* @__PURE__ */ l(d, { noHover: !0, height: "35px", children: [
14
+ /* @__PURE__ */ e(i, { justify: "start", size: "sm", className: "pl-4", children: /* @__PURE__ */ e(
15
+ a,
16
+ {
17
+ arrowPosition: "right",
18
+ title: /* @__PURE__ */ e(n, { messageId: "components.poolAssetsTable.head.name" }),
19
+ sortDirection: r("name", t),
20
+ sortField: s.formatMessage({
21
+ messageId: "components.poolAssetsTable.head.name"
22
+ }),
23
+ onSort: () => o("name")
24
+ }
25
+ ) }),
26
+ /* @__PURE__ */ e(i, { justify: "end", size: "sm", children: /* @__PURE__ */ e(
27
+ a,
28
+ {
29
+ arrowPosition: "left",
30
+ title: /* @__PURE__ */ e(n, { messageId: "components.poolAssetsTable.head.currentDebt" }),
31
+ sortDirection: r("currentDebt", t),
32
+ sortField: s.formatMessage({
33
+ messageId: "components.poolAssetsTable.head.currentDebt"
34
+ }),
35
+ onSort: () => o("currentDebt", "desc")
36
+ }
37
+ ) }),
38
+ /* @__PURE__ */ e(i, { justify: "end", size: "sm", className: "pr-4", children: /* @__PURE__ */ e(
39
+ a,
40
+ {
41
+ arrowPosition: "left",
42
+ title: /* @__PURE__ */ e(n, { messageId: "components.poolAssetsTable.head.assets" }),
43
+ sortDirection: r("assets", t),
44
+ sortField: s.formatMessage({
45
+ messageId: "components.poolAssetsTable.head.assets"
46
+ }),
47
+ onSort: () => o("assets", "desc")
48
+ }
49
+ ) })
50
+ ] });
51
+ }
52
+ export {
53
+ I as PoolCreditManagersTableHead
54
+ };
@@ -0,0 +1,71 @@
1
+ import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
+ import { shortAddress as n } from "@gearbox-protocol/sdk";
3
+ import "react";
4
+ import "clsx";
5
+ import "tailwind-merge";
6
+ import "sonner";
7
+ import { formatMoney as d } from "../../utils/format-money.js";
8
+ import "@gearbox-protocol/sdk/common-utils";
9
+ import "luxon";
10
+ import "../../utils/z-index.js";
11
+ import { GridTableRow as p, GridTableCell as t } from "../table/grid-table.js";
12
+ import { TextButton as c } from "../text-button/text-button.js";
13
+ import { TokenTemplate as f } from "../token-template/token-template.js";
14
+ import { FormattedMessageTyped as h } from "../typed-intl/index.js";
15
+ import { VerticalIndicator as l } from "../vertical-indicator/vertical-indicator.js";
16
+ import { poolCreditManagersTableTestIds as u } from "./pool-credit-managers-table.test-ids.js";
17
+ function D({
18
+ creditManager: o,
19
+ last: i,
20
+ onClick: r,
21
+ totalDebtMoney: s,
22
+ underlyingToken: a
23
+ }) {
24
+ return /* @__PURE__ */ m(
25
+ p,
26
+ {
27
+ last: i,
28
+ height: "75px",
29
+ onRowClick: r,
30
+ "data-testid": u.creditManagerLine,
31
+ children: [
32
+ /* @__PURE__ */ e(t, { textAlign: "left", className: "pl-4", size: "sm", children: /* @__PURE__ */ e(
33
+ l,
34
+ {
35
+ label: o.name,
36
+ description: n(o.address)
37
+ }
38
+ ) }),
39
+ /* @__PURE__ */ e(t, { textAlign: "right", size: "sm", children: /* @__PURE__ */ e("div", { className: "flex justify-end flex-col-auto", children: /* @__PURE__ */ e("div", { className: "flex-col-auto", children: /* @__PURE__ */ e(
40
+ l,
41
+ {
42
+ value: /* @__PURE__ */ e(
43
+ f,
44
+ {
45
+ value: o.totalDebt,
46
+ token: a
47
+ }
48
+ ),
49
+ valueDescription: d(s)
50
+ }
51
+ ) }) }) }),
52
+ /* @__PURE__ */ e(t, { textAlign: "right", className: "pr-4", size: "sm", children: /* @__PURE__ */ e("div", { className: "flex justify-end flex-col-auto", children: /* @__PURE__ */ e("div", { className: "flex-col-auto", children: /* @__PURE__ */ e(
53
+ l,
54
+ {
55
+ label: /* @__PURE__ */ e(c, { as: "span", children: /* @__PURE__ */ e(
56
+ h,
57
+ {
58
+ messageId: "components.poolCreditManagersTable.assets",
59
+ values: { amount: o.collateralTokens.length }
60
+ }
61
+ ) }),
62
+ description: " "
63
+ }
64
+ ) }) }) })
65
+ ]
66
+ }
67
+ );
68
+ }
69
+ export {
70
+ D as PoolCreditManagersTableRow
71
+ };
@@ -0,0 +1,42 @@
1
+ import { jsxs as p, jsx as r } from "react/jsx-runtime";
2
+ import "react";
3
+ import "@gearbox-protocol/sdk/common-utils";
4
+ import "@gearbox-protocol/sdk";
5
+ import { useIsMobile as d } from "../../hooks/use-media-query.js";
6
+ import { GridTable as f, GridTableHeader as n, GridTableBody as b } from "../table/grid-table.js";
7
+ import { PoolCreditManagersTableHead as c } from "./pool-credit-managers-table-head.js";
8
+ import { PoolCreditManagersTableRow as C } from "./pool-credit-managers-table-row.js";
9
+ function w({
10
+ handleSelectCM: e,
11
+ rows: l,
12
+ sort: i,
13
+ underlyingToken: s
14
+ }) {
15
+ const a = d() ? "1fr 120px 0.75fr" : "2fr 1fr 1fr";
16
+ return /* @__PURE__ */ p(
17
+ f,
18
+ {
19
+ cols: a,
20
+ gap: 0,
21
+ size: "lg",
22
+ wrapperClassName: "overflow-visible",
23
+ children: [
24
+ /* @__PURE__ */ r(n, { children: /* @__PURE__ */ r(c, { sort: i }) }),
25
+ /* @__PURE__ */ r(b, { children: l.map(({ creditManager: o, totalDebtMoney: m }, t) => /* @__PURE__ */ r(
26
+ C,
27
+ {
28
+ creditManager: o,
29
+ last: t === l.length - 1,
30
+ onClick: e(o),
31
+ totalDebtMoney: m,
32
+ underlyingToken: s
33
+ },
34
+ o.address
35
+ )) })
36
+ ]
37
+ }
38
+ );
39
+ }
40
+ export {
41
+ w as PoolCreditManagersTable
42
+ };
@@ -0,0 +1,6 @@
1
+ const e = {
2
+ creditManagerLine: "pool-credit-managers-line"
3
+ };
4
+ export {
5
+ e as poolCreditManagersTableTestIds
6
+ };