@gearbox-protocol/ui-kit 3.10.5 → 3.11.1

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 (57) hide show
  1. package/dist/cjs/components/assets-list-cell/assets-list-cell.cjs +1 -1
  2. package/dist/cjs/components/block-sync/block-sync.cjs +1 -1
  3. package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
  4. package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
  5. package/dist/cjs/components/complex-input/complex-input.cjs +1 -1
  6. package/dist/cjs/components/composites/index.cjs +1 -1
  7. package/dist/cjs/components/composites/oracles-and-lt-table/index.cjs +1 -0
  8. package/dist/cjs/components/composites/oracles-and-lt-table/oracle-component.cjs +1 -0
  9. package/dist/cjs/components/composites/oracles-and-lt-table/oracles-and-lt-line-view.cjs +1 -0
  10. package/dist/cjs/components/composites/oracles-and-lt-table/oracles-and-lt-table-head.cjs +1 -0
  11. package/dist/cjs/components/composites/oracles-and-lt-table/oracles-and-lt-table.cjs +1 -0
  12. package/dist/cjs/components/composites/oracles-and-lt-table/oracles-list.cjs +1 -0
  13. package/dist/cjs/components/composites/oracles-and-lt-table/types.cjs +1 -0
  14. package/dist/cjs/components/composites/pool-credit-manager-info/pool-credit-manager-info.cjs +1 -1
  15. package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
  16. package/dist/cjs/components/detailed-page-title/detailed-page-title.cjs +1 -1
  17. package/dist/cjs/components/index.cjs +1 -1
  18. package/dist/cjs/components/markdown-viewer/markdown-viewer.cjs +1 -1
  19. package/dist/cjs/components/time-to-liquidation/time-to-liquidation.cjs +1 -1
  20. package/dist/cjs/components/tokens-list-cell/tokens-list-cell.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/assets-list-cell/assets-list-cell.js +2 -2
  25. package/dist/esm/components/block-sync/block-sync.js +2 -2
  26. package/dist/esm/components/checkbox/checkbox-labeled.js +2 -2
  27. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +2 -2
  28. package/dist/esm/components/complex-input/complex-input.js +2 -2
  29. package/dist/esm/components/composites/index.js +41 -30
  30. package/dist/esm/components/composites/oracles-and-lt-table/index.js +13 -0
  31. package/dist/esm/components/composites/oracles-and-lt-table/oracle-component.js +37 -0
  32. package/dist/esm/components/composites/oracles-and-lt-table/oracles-and-lt-line-view.js +84 -0
  33. package/dist/esm/components/composites/oracles-and-lt-table/oracles-and-lt-table-head.js +21 -0
  34. package/dist/esm/components/composites/oracles-and-lt-table/oracles-and-lt-table.js +42 -0
  35. package/dist/esm/components/composites/oracles-and-lt-table/oracles-list.js +169 -0
  36. package/dist/esm/components/composites/oracles-and-lt-table/types.js +1 -0
  37. package/dist/esm/components/composites/pool-credit-manager-info/pool-credit-manager-info.js +7 -12
  38. package/dist/esm/components/compound-apy/compound-apy.js +2 -2
  39. package/dist/esm/components/detailed-page-title/detailed-page-title.js +2 -2
  40. package/dist/esm/components/index.js +615 -604
  41. package/dist/esm/components/markdown-viewer/markdown-viewer.js +2 -2
  42. package/dist/esm/components/time-to-liquidation/time-to-liquidation.js +2 -2
  43. package/dist/esm/components/tokens-list-cell/tokens-list-cell.js +2 -2
  44. package/dist/esm/components/with-copy/with-copy.js +2 -2
  45. package/dist/esm/index.js +829 -818
  46. package/dist/esm/locale/en.json.js +4 -0
  47. package/dist/types/components/composites/index.d.ts +1 -0
  48. package/dist/types/components/composites/oracles-and-lt-table/index.d.ts +5 -0
  49. package/dist/types/components/composites/oracles-and-lt-table/oracle-component.d.ts +16 -0
  50. package/dist/types/components/composites/oracles-and-lt-table/oracles-and-lt-line-view.d.ts +19 -0
  51. package/dist/types/components/composites/oracles-and-lt-table/oracles-and-lt-table-head.d.ts +3 -0
  52. package/dist/types/components/composites/oracles-and-lt-table/oracles-and-lt-table.d.ts +16 -0
  53. package/dist/types/components/composites/oracles-and-lt-table/oracles-list.d.ts +18 -0
  54. package/dist/types/components/composites/oracles-and-lt-table/types.d.ts +8 -0
  55. package/dist/types/locale/en.json.d.ts +6 -0
  56. package/dist/types/types/footer.d.ts +1 -1
  57. package/package.json +1 -1
@@ -0,0 +1,42 @@
1
+ import { jsxs as a, 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 n } from "../../../hooks/use-media-query.js";
6
+ import { GridTable as m, GridTableHeader as p, GridTableBody as d } from "../../table/grid-table.js";
7
+ import { OraclesAndLTLineView as c } from "./oracles-and-lt-line-view.js";
8
+ import { OraclesAndLTTableHead as f } from "./oracles-and-lt-table-head.js";
9
+ function A({
10
+ sdk: l,
11
+ explorerInfo: s,
12
+ rows: o
13
+ }) {
14
+ const i = n();
15
+ return /* @__PURE__ */ a(
16
+ m,
17
+ {
18
+ cols: i ? "1fr" : "188px 1fr 66px",
19
+ gap: 0,
20
+ size: "sm",
21
+ wrapperClassName: "overflow-visible",
22
+ children: [
23
+ !i && /* @__PURE__ */ r(p, { children: /* @__PURE__ */ r(f, {}) }),
24
+ /* @__PURE__ */ r(d, { children: o.map((e, t) => /* @__PURE__ */ r(
25
+ c,
26
+ {
27
+ sdk: l,
28
+ explorerInfo: s,
29
+ token: e.token,
30
+ pool: e.pool,
31
+ lt: e.lt,
32
+ last: t === o.length - 1
33
+ },
34
+ ["token", e.token?.address].join("-")
35
+ )) })
36
+ ]
37
+ }
38
+ );
39
+ }
40
+ export {
41
+ A as OraclesAndLTTableView
42
+ };
@@ -0,0 +1,169 @@
1
+ import { jsxs as E, jsx as t } from "react/jsx-runtime";
2
+ import { faChevronRight as p } from "@fortawesome/free-solid-svg-icons";
3
+ import { FaIcon as l } from "../../icons/fa-icon.js";
4
+ import { OracleComponent as c } from "./oracle-component.js";
5
+ function m({ info: n, explorerInfo: a }) {
6
+ const s = n.underlying && n.underlying.length > 0;
7
+ return /* @__PURE__ */ E("div", { className: "flex items-center gap-2 flex-col-auto", children: [
8
+ /* @__PURE__ */ t(c, { info: n, explorerInfo: a }),
9
+ s && /* @__PURE__ */ t(
10
+ l,
11
+ {
12
+ icon: p,
13
+ className: "text-gray-50",
14
+ style: { width: "10px", height: "10px" }
15
+ }
16
+ ),
17
+ s && /* @__PURE__ */ t("div", { className: "grid gap-2", children: n.underlying?.map((r, e) => /* @__PURE__ */ t(
18
+ "div",
19
+ {
20
+ className: "flex-col-auto",
21
+ children: /* @__PURE__ */ t(m, { info: r, explorerInfo: a })
22
+ },
23
+ [
24
+ "underlying",
25
+ r.address,
26
+ r.name,
27
+ r.type,
28
+ r.address
29
+ ].join("-")
30
+ )) })
31
+ ] });
32
+ }
33
+ function d({
34
+ pfRef: n
35
+ }) {
36
+ const a = n.priceFeed, s = a.underlyingPriceFeeds, r = a.priceFeedType;
37
+ switch (r) {
38
+ case "PRICE_FEED::EXTERNAL":
39
+ return {
40
+ type: r,
41
+ name: "External Oracle",
42
+ address: a.address,
43
+ underlying: s.map((e) => d({ pfRef: e }))
44
+ };
45
+ case "PRICE_FEED::ZERO":
46
+ return {
47
+ type: r,
48
+ name: "Zero Oracle",
49
+ address: a.address,
50
+ underlying: s.map((e) => d({ pfRef: e }))
51
+ };
52
+ case "PRICE_FEED::YEARN":
53
+ return {
54
+ type: r,
55
+ name: "Yearn Oracle",
56
+ address: a.address,
57
+ underlying: s.map((e) => d({ pfRef: e }))
58
+ };
59
+ case "PRICE_FEED::CURVE_CRYPTO":
60
+ return {
61
+ type: r,
62
+ name: "Curve Crypto LP Oracle",
63
+ address: a.address,
64
+ underlying: s.map((e) => d({ pfRef: e }))
65
+ };
66
+ case "PRICE_FEED::CURVE_STABLE":
67
+ return {
68
+ type: r,
69
+ name: "Curve Crypto Stable Oracle",
70
+ address: a.address,
71
+ underlying: s.map((e) => d({ pfRef: e }))
72
+ };
73
+ case "PRICE_FEED::CURVE_USD":
74
+ return {
75
+ type: r,
76
+ name: "Curve Crypto USD Oracle",
77
+ address: a.address,
78
+ underlying: s.map((e) => d({ pfRef: e }))
79
+ };
80
+ case "PRICE_FEED::WSTETH":
81
+ return {
82
+ type: r,
83
+ name: "wstETH Oracle",
84
+ address: a.address,
85
+ underlying: s.map((e) => d({ pfRef: e }))
86
+ };
87
+ case "PRICE_FEED::BALANCER_STABLE":
88
+ return {
89
+ type: r,
90
+ name: "Balancer Stable Oracle",
91
+ address: a.address,
92
+ underlying: s.map((e) => d({ pfRef: e }))
93
+ };
94
+ case "PRICE_FEED::BALANCER_WEIGHTED":
95
+ return {
96
+ type: r,
97
+ name: "Balancer Weighted Oracle",
98
+ address: a.address,
99
+ underlying: s.map((e) => d({ pfRef: e }))
100
+ };
101
+ case "PRICE_FEED::ERC4626":
102
+ return {
103
+ type: r,
104
+ name: "ERC4626 Vault Oracle",
105
+ address: a.address,
106
+ underlying: s.map((e) => d({ pfRef: e }))
107
+ };
108
+ case "PRICE_FEED::MELLOW_LRT":
109
+ return {
110
+ type: r,
111
+ name: "Mellow LRT Oracle",
112
+ address: a.address,
113
+ underlying: s.map((e) => d({ pfRef: e }))
114
+ };
115
+ case "PRICE_FEED::PENDLE_PT_TWAP":
116
+ return {
117
+ type: r,
118
+ name: "Pendle PT TWAP Oracle",
119
+ address: a.address,
120
+ underlying: s.map((e) => d({ pfRef: e }))
121
+ };
122
+ case "PRICE_FEED::PYTH":
123
+ return {
124
+ type: r,
125
+ name: "Pyth Oracle",
126
+ address: a.address,
127
+ underlying: s.map((e) => d({ pfRef: e }))
128
+ };
129
+ case "PRICE_FEED::REDSTONE":
130
+ return {
131
+ type: r,
132
+ name: "Redstone Oracle",
133
+ address: a.address,
134
+ underlying: s.map((e) => d({ pfRef: e }))
135
+ };
136
+ case "PRICE_FEED::BOUNDED":
137
+ return {
138
+ type: r,
139
+ name: "Bounded Oracle",
140
+ address: a.address,
141
+ underlying: s.map((e) => d({ pfRef: e }))
142
+ };
143
+ case "PRICE_FEED::COMPOSITE":
144
+ return {
145
+ type: r,
146
+ name: "Composite Oracle",
147
+ address: a.address,
148
+ underlying: s.map((e) => d({ pfRef: e }))
149
+ };
150
+ case "PRICE_FEED::CONSTANT":
151
+ return {
152
+ type: r,
153
+ name: "Constant Oracle",
154
+ address: a.address,
155
+ underlying: s.map((e) => d({ pfRef: e }))
156
+ };
157
+ default:
158
+ return {
159
+ type: r,
160
+ name: "UNKNOWN Oracle",
161
+ address: a.address,
162
+ underlying: s.map((e) => d({ pfRef: e }))
163
+ };
164
+ }
165
+ }
166
+ export {
167
+ m as OraclesList,
168
+ d as getPriceFeedInfo
169
+ };
@@ -4,13 +4,8 @@ import "react";
4
4
  import "@gearbox-protocol/sdk/common-utils";
5
5
  import { useIsMobile as N } from "../../../hooks/use-media-query.js";
6
6
  import { poolCreditManagerInfoTestIds as A } from "../../../test-ids/pool-credit-manager-info.js";
7
- import "clsx";
8
- import "tailwind-merge";
9
- import "sonner";
10
7
  import { percentageTemplate as s } from "../../../utils/format-money.js";
11
- import "luxon";
12
- import "../../../utils/z-index.js";
13
- import { CardGrid as p } from "../../card-grid/card-grid.js";
8
+ import { CardGrid as f } from "../../card-grid/card-grid.js";
14
9
  import { CheckboxLabeled as P } from "../../checkbox/checkbox-labeled.js";
15
10
  import { ConfirmMenu as q } from "../../confirm-menu/confirm-menu.js";
16
11
  import { DialogModalContainer as F } from "../../dialog/dialog-modal-container.js";
@@ -22,15 +17,15 @@ import { FormattedMessageTyped as o } from "../../typed-intl/index.js";
22
17
  import { VSpace as d } from "../../vspace/vspace.js";
23
18
  import { WithCopy as j } from "../../with-copy/with-copy.js";
24
19
  import { overflowContainerClassName as B, overflowWrapClassName as G } from "./overflow-layout.js";
25
- function de({
20
+ function re({
26
21
  creditManager: t,
27
- tokensList: f,
22
+ tokensList: p,
28
23
  underlyingTable: u,
29
24
  onClose: a,
30
25
  hideZeroQuota: c,
31
26
  setHideZeroQuota: g
32
27
  }) {
33
- const I = N(), i = f[t.underlyingToken], h = () => /* @__PURE__ */ e(
28
+ const I = N(), i = p[t.underlyingToken], h = () => /* @__PURE__ */ e(
34
29
  n,
35
30
  {
36
31
  title: /* @__PURE__ */ e(o, { messageId: "components.creditManagerInfo.info.title" }),
@@ -120,7 +115,7 @@ function de({
120
115
  /* @__PURE__ */ e(d, { height: 32 })
121
116
  ] }),
122
117
  /* @__PURE__ */ r(
123
- p,
118
+ f,
124
119
  {
125
120
  gap: "sm",
126
121
  justifyItemContent: "start",
@@ -131,7 +126,7 @@ function de({
131
126
  children: [
132
127
  h(),
133
128
  /* @__PURE__ */ r(
134
- p,
129
+ f,
135
130
  {
136
131
  gap: "sm",
137
132
  justifyItemContent: "start",
@@ -183,5 +178,5 @@ function de({
183
178
  );
184
179
  }
185
180
  export {
186
- de as PoolCreditManagerInfo
181
+ re as PoolCreditManagerInfo
187
182
  };
@@ -53,9 +53,10 @@ import "../with-title/with-title.js";
53
53
  import "../smart-number-input/balance-indicator.js";
54
54
  import "../smart-number-input/smart-number-input.js";
55
55
  import "../table/grid-table.js";
56
+ import { getSymbolOrIcon as C } from "../token-symbol/token-symbol.js";
57
+ import "../typography/typography.js";
56
58
  import "../help-tip/help-tip.js";
57
59
  import "../description/description.js";
58
- import { getSymbolOrIcon as C } from "../token-symbol/token-symbol.js";
59
60
  import "../confirm-menu/confirm-menu.js";
60
61
  import "../dialog/dialog-modal-container.js";
61
62
  import "../text-button/text-button.js";
@@ -159,7 +160,6 @@ import "../theme-provider.js";
159
160
  import "../time-to-liquidation/time-to-liquidation.js";
160
161
  import "../tip-card/tip-card.js";
161
162
  import "../toggle/toggle.js";
162
- import "../typography/typography.js";
163
163
  import "../vertical-list/vertical-list.js";
164
164
  import "../with-filter-button/with-filter-button.js";
165
165
  function G(i, p) {
@@ -49,9 +49,10 @@ import "../with-title/with-title.js";
49
49
  import "../smart-number-input/balance-indicator.js";
50
50
  import "../smart-number-input/smart-number-input.js";
51
51
  import "../table/grid-table.js";
52
+ import { getSymbolOrIcon as P } from "../token-symbol/token-symbol.js";
53
+ import "../typography/typography.js";
52
54
  import "../help-tip/help-tip.js";
53
55
  import "../description/description.js";
54
- import { getSymbolOrIcon as P } from "../token-symbol/token-symbol.js";
55
56
  import "../confirm-menu/confirm-menu.js";
56
57
  import "../dialog/dialog-modal-container.js";
57
58
  import "../text-button/text-button.js";
@@ -155,7 +156,6 @@ import "../theme-provider.js";
155
156
  import "../time-to-liquidation/time-to-liquidation.js";
156
157
  import "../tip-card/tip-card.js";
157
158
  import "../toggle/toggle.js";
158
- import "../typography/typography.js";
159
159
  import "../with-filter-button/with-filter-button.js";
160
160
  const b = g.forwardRef(function({
161
161
  title: p,