@gearbox-protocol/ui-kit 3.7.0-next.1 → 3.7.0
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.
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
- package/dist/cjs/components/composites/pool-credit-managers-table/pool-credit-managers-table-row.cjs +1 -1
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +12 -14
- package/dist/esm/components/composites/pool-credit-managers-table/pool-credit-managers-table-row.js +29 -29
- package/dist/types/components/composites/pool-assets-table/index.d.ts +0 -3
- package/dist/types/components/composites/pool-assets-table/pool-assets-table-row.d.ts +1 -1
- package/dist/types/components/composites/pool-assets-table/pool-assets-table.d.ts +1 -1
- package/dist/types/components/composites/pool-credit-manager-info/index.d.ts +0 -2
- package/dist/types/components/composites/pool-credit-managers-table/index.d.ts +0 -3
- package/dist/types/components/composites/pool-credit-managers-table/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");require("@gearbox-protocol/sdk/common-utils");require("@gearbox-protocol/sdk");const m=require("../../../hooks/use-media-query.cjs");require("clsx");require("tailwind-merge");require("sonner");const q=require("../../../utils/format-money.cjs");require("luxon");require("../../../utils/z-index.cjs");const S=require("../../description/description.cjs"),u=require("../../short-string/short-string.cjs"),s=require("../../table/grid-table.cjs"),t=require("../../table/table-sm.cjs"),_=require("../../token-symbol/token-symbol.cjs"),d=require("../../token-template/token-template.cjs"),l=require("../../typed-intl/index.cjs");function y({poolName:p,token:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");require("@gearbox-protocol/sdk/common-utils");require("@gearbox-protocol/sdk");const m=require("../../../hooks/use-media-query.cjs");require("clsx");require("tailwind-merge");require("sonner");const q=require("../../../utils/format-money.cjs");require("luxon");require("../../../utils/z-index.cjs");const S=require("../../description/description.cjs"),u=require("../../short-string/short-string.cjs"),s=require("../../table/grid-table.cjs"),t=require("../../table/table-sm.cjs"),_=require("../../token-symbol/token-symbol.cjs"),d=require("../../token-template/token-template.cjs"),l=require("../../typed-intl/index.cjs");function y({poolName:p,token:r,currentQuota:x,underlyingToken:n,last:g}){const{limit:h,totalQuoted:T,rate:b}=x,o=m.useIsMobile(),j=m.useIsDesktop()?21:o?40:16,i=()=>e.jsxs("div",{className:"flex items-center flex-col-auto",children:[e.jsx(_.TokenSymbol,{token:r,size:32}),e.jsxs("span",{className:"ml-1.5 md:ml-2.5 text-left",children:[e.jsx(u.ShortString,{maxLength:j,children:r?.title}),e.jsx(S.Description,{children:e.jsx(u.ShortString,{maxLength:20,children:p})})]})]}),a=()=>q.percentageTemplate(b),c=()=>e.jsx("span",{children:e.jsx(l.FormattedMessageTyped,{messageId:"components.poolAssetsTable.usage",values:{amount:e.jsx(d.TokenTemplate,{value:T,token:n,decimalPartLength:2,precision:2,showSymbol:!1},"pool-assets-line-usage-amount"),total:e.jsx(d.TokenTemplate,{value:h,token:n,decimalPartLength:2,precision:2,showSymbol:!1},"pool-assets-line-usage-total")}})});return e.jsx(s.GridTableRow,{last:g,height:"auto",className:"cursor-default",style:{minHeight:"75px"},children:o?e.jsx(s.GridTableCell,{span:"full",size:"sm",className:"px-3 py-0!",children:e.jsxs(t.TableLineSm,{columns:2,columnsXs:2,title:i(),className:"w-full",children:[e.jsx(t.TableCellSm,{title:e.jsx(l.FormattedMessageTyped,{messageId:"components.poolAssetsTable.rate"}),children:a()}),e.jsx(t.TableCellSm,{title:e.jsx(l.FormattedMessageTyped,{messageId:"components.poolAssetsTable.limits"}),children:c()})]})}):e.jsxs(e.Fragment,{children:[e.jsx(s.GridTableCell,{textAlign:"left",className:"pl-4",size:"sm",children:i()}),e.jsx(s.GridTableCell,{textAlign:"right",size:"sm",children:a()}),e.jsx(s.GridTableCell,{textAlign:"right",className:"pr-4",size:"sm",children:c()})]})})}exports.PoolAssetsTableRow=y;
|
package/dist/cjs/components/composites/pool-credit-managers-table/pool-credit-managers-table-row.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("@gearbox-protocol/sdk");require("react");require("clsx");require("tailwind-merge");require("sonner");const c=require("../../../utils/format-money.cjs");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../../utils/z-index.cjs");const s=require("../../table/grid-table.cjs"),d=require("../../text-button/text-button.cjs"),u=require("../../token-template/token-template.cjs"),x=require("../../typed-intl/index.cjs"),r=require("../../vertical-indicator/vertical-indicator.cjs"),m=require("./pool-credit-managers-table.test-ids.cjs");function p({creditManager:t,last:l,onClick:o,totalDebtMoney:i,underlyingToken:n}){return e.jsxs(s.GridTableRow,{last:l,height:"75px",onRowClick:o,"data-testid":m.poolCreditManagersTableTestIds.creditManagerLine,children:[e.jsx(s.GridTableCell,{textAlign:"left",className:"pl-4",size:"sm",children:e.jsx(r.VerticalIndicator,{label:t.name,description:a.shortAddress(t.address)})}),e.jsx(s.GridTableCell,{textAlign:"right",size:"sm",children:e.jsx("div",{className:"flex justify-end flex-col-auto",children:e.jsx("div",{className:"flex-col-auto",children:e.jsx(r.VerticalIndicator,{value:e.jsx(u.TokenTemplate,{value:t.totalDebt,token:n}),valueDescription:c.formatMoney(i)})})})}),e.jsx(s.GridTableCell,{textAlign:"right",className:"pr-4",size:"sm",children:e.jsx("div",{className:"flex justify-end flex-col-auto",children:e.jsx("div",{className:"flex-col-auto",children:e.jsx(r.VerticalIndicator,{label:e.jsx(d.TextButton,{as:"span",children:e.jsx(x.FormattedMessageTyped,{messageId:"components.poolCreditManagersTable.assets",values:{amount:t.collateralTokens.length}})}),description:e.jsx(e.Fragment,{children:" "})})})})})]})}exports.PoolCreditManagersTableRow=p;
|
|
@@ -11,26 +11,26 @@ import "luxon";
|
|
|
11
11
|
import "../../../utils/z-index.js";
|
|
12
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
|
|
15
|
-
import { TableLineSm as
|
|
16
|
-
import { TokenSymbol as
|
|
14
|
+
import { GridTableRow as y, GridTableCell as s } from "../../table/grid-table.js";
|
|
15
|
+
import { TableLineSm as z, TableCellSm as p } from "../../table/table-sm.js";
|
|
16
|
+
import { TokenSymbol as I } from "../../token-symbol/token-symbol.js";
|
|
17
17
|
import { TokenTemplate as d } from "../../token-template/token-template.js";
|
|
18
|
-
import { FormattedMessageTyped as
|
|
18
|
+
import { FormattedMessageTyped as l } from "../../typed-intl/index.js";
|
|
19
19
|
function O({
|
|
20
20
|
poolName: h,
|
|
21
|
-
token:
|
|
21
|
+
token: o,
|
|
22
22
|
currentQuota: g,
|
|
23
23
|
underlyingToken: r,
|
|
24
24
|
last: u
|
|
25
25
|
}) {
|
|
26
26
|
const { limit: f, totalQuoted: x, rate: T } = g, i = N(), b = S() ? 21 : i ? 40 : 16, m = () => /* @__PURE__ */ t("div", { className: "flex items-center flex-col-auto", children: [
|
|
27
|
-
/* @__PURE__ */ e(
|
|
27
|
+
/* @__PURE__ */ e(I, { token: o, size: 32 }),
|
|
28
28
|
/* @__PURE__ */ t("span", { className: "ml-1.5 md:ml-2.5 text-left", children: [
|
|
29
|
-
/* @__PURE__ */ e(c, { maxLength: b, children:
|
|
29
|
+
/* @__PURE__ */ e(c, { maxLength: b, children: o?.title }),
|
|
30
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
|
+
l,
|
|
34
34
|
{
|
|
35
35
|
messageId: "components.poolAssetsTable.usage",
|
|
36
36
|
values: {
|
|
@@ -60,18 +60,16 @@ function O({
|
|
|
60
60
|
}
|
|
61
61
|
) });
|
|
62
62
|
return /* @__PURE__ */ e(
|
|
63
|
-
|
|
63
|
+
y,
|
|
64
64
|
{
|
|
65
65
|
last: u,
|
|
66
66
|
height: "auto",
|
|
67
67
|
className: "cursor-default",
|
|
68
|
-
onRowClick: () => {
|
|
69
|
-
},
|
|
70
68
|
style: {
|
|
71
69
|
minHeight: "75px"
|
|
72
70
|
},
|
|
73
71
|
children: i ? /* @__PURE__ */ e(s, { span: "full", size: "sm", className: "px-3 py-0!", children: /* @__PURE__ */ t(
|
|
74
|
-
|
|
72
|
+
z,
|
|
75
73
|
{
|
|
76
74
|
columns: 2,
|
|
77
75
|
columnsXs: 2,
|
|
@@ -81,14 +79,14 @@ function O({
|
|
|
81
79
|
/* @__PURE__ */ e(
|
|
82
80
|
p,
|
|
83
81
|
{
|
|
84
|
-
title: /* @__PURE__ */ e(
|
|
82
|
+
title: /* @__PURE__ */ e(l, { messageId: "components.poolAssetsTable.rate" }),
|
|
85
83
|
children: a()
|
|
86
84
|
}
|
|
87
85
|
),
|
|
88
86
|
/* @__PURE__ */ e(
|
|
89
87
|
p,
|
|
90
88
|
{
|
|
91
|
-
title: /* @__PURE__ */ e(
|
|
89
|
+
title: /* @__PURE__ */ e(l, { messageId: "components.poolAssetsTable.limits" }),
|
|
92
90
|
children: n()
|
|
93
91
|
}
|
|
94
92
|
)
|
package/dist/esm/components/composites/pool-credit-managers-table/pool-credit-managers-table-row.js
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { shortAddress as
|
|
1
|
+
import { jsxs as m, jsx as e, Fragment as n } from "react/jsx-runtime";
|
|
2
|
+
import { shortAddress as d } from "@gearbox-protocol/sdk";
|
|
3
3
|
import "react";
|
|
4
4
|
import "clsx";
|
|
5
5
|
import "tailwind-merge";
|
|
6
6
|
import "sonner";
|
|
7
|
-
import { formatMoney as
|
|
7
|
+
import { formatMoney as p } from "../../../utils/format-money.js";
|
|
8
8
|
import "@gearbox-protocol/sdk/common-utils";
|
|
9
9
|
import "luxon";
|
|
10
10
|
import "../../../utils/z-index.js";
|
|
11
|
-
import { GridTableRow as
|
|
12
|
-
import { TextButton as
|
|
13
|
-
import { TokenTemplate as
|
|
14
|
-
import { FormattedMessageTyped as
|
|
11
|
+
import { GridTableRow as c, GridTableCell as o } from "../../table/grid-table.js";
|
|
12
|
+
import { TextButton as f } from "../../text-button/text-button.js";
|
|
13
|
+
import { TokenTemplate as h } from "../../token-template/token-template.js";
|
|
14
|
+
import { FormattedMessageTyped as u } from "../../typed-intl/index.js";
|
|
15
15
|
import { VerticalIndicator as l } from "../../vertical-indicator/vertical-indicator.js";
|
|
16
|
-
import { poolCreditManagersTableTestIds as
|
|
17
|
-
function
|
|
18
|
-
creditManager:
|
|
19
|
-
last:
|
|
20
|
-
onClick:
|
|
16
|
+
import { poolCreditManagersTableTestIds as x } from "./pool-credit-managers-table.test-ids.js";
|
|
17
|
+
function F({
|
|
18
|
+
creditManager: t,
|
|
19
|
+
last: r,
|
|
20
|
+
onClick: i,
|
|
21
21
|
totalDebtMoney: s,
|
|
22
22
|
underlyingToken: a
|
|
23
23
|
}) {
|
|
24
24
|
return /* @__PURE__ */ m(
|
|
25
|
-
|
|
25
|
+
c,
|
|
26
26
|
{
|
|
27
|
-
last:
|
|
27
|
+
last: r,
|
|
28
28
|
height: "75px",
|
|
29
|
-
onRowClick:
|
|
30
|
-
"data-testid":
|
|
29
|
+
onRowClick: i,
|
|
30
|
+
"data-testid": x.creditManagerLine,
|
|
31
31
|
children: [
|
|
32
|
-
/* @__PURE__ */ e(
|
|
32
|
+
/* @__PURE__ */ e(o, { textAlign: "left", className: "pl-4", size: "sm", children: /* @__PURE__ */ e(
|
|
33
33
|
l,
|
|
34
34
|
{
|
|
35
|
-
label:
|
|
36
|
-
description:
|
|
35
|
+
label: t.name,
|
|
36
|
+
description: d(t.address)
|
|
37
37
|
}
|
|
38
38
|
) }),
|
|
39
|
-
/* @__PURE__ */ e(
|
|
39
|
+
/* @__PURE__ */ e(o, { 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
40
|
l,
|
|
41
41
|
{
|
|
42
42
|
value: /* @__PURE__ */ e(
|
|
43
|
-
|
|
43
|
+
h,
|
|
44
44
|
{
|
|
45
|
-
value:
|
|
45
|
+
value: t.totalDebt,
|
|
46
46
|
token: a
|
|
47
47
|
}
|
|
48
48
|
),
|
|
49
|
-
valueDescription:
|
|
49
|
+
valueDescription: p(s)
|
|
50
50
|
}
|
|
51
51
|
) }) }) }),
|
|
52
|
-
/* @__PURE__ */ e(
|
|
52
|
+
/* @__PURE__ */ e(o, { 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
53
|
l,
|
|
54
54
|
{
|
|
55
|
-
label: /* @__PURE__ */ e(
|
|
56
|
-
|
|
55
|
+
label: /* @__PURE__ */ e(f, { as: "span", children: /* @__PURE__ */ e(
|
|
56
|
+
u,
|
|
57
57
|
{
|
|
58
58
|
messageId: "components.poolCreditManagersTable.assets",
|
|
59
|
-
values: { amount:
|
|
59
|
+
values: { amount: t.collateralTokens.length }
|
|
60
60
|
}
|
|
61
61
|
) }),
|
|
62
|
-
description: " "
|
|
62
|
+
description: /* @__PURE__ */ e(n, { children: " " })
|
|
63
63
|
}
|
|
64
64
|
) }) }) })
|
|
65
65
|
]
|
|
@@ -67,5 +67,5 @@ function D({
|
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
69
|
export {
|
|
70
|
-
|
|
70
|
+
F as PoolCreditManagersTableRow
|
|
71
71
|
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
export type * from './pool-assets-table';
|
|
2
1
|
export * from './pool-assets-table';
|
|
3
|
-
export type * from './pool-assets-table-head';
|
|
4
2
|
export * from './pool-assets-table-head';
|
|
5
|
-
export type * from './pool-assets-table-row';
|
|
6
3
|
export * from './pool-assets-table-row';
|
|
7
4
|
export type * from './types';
|
|
@@ -4,7 +4,7 @@ import { PoolAssetsTableQuotaRow } from './types';
|
|
|
4
4
|
/** Props for {@link PoolAssetsTableRow}. */
|
|
5
5
|
export interface PoolAssetsTableRowProps {
|
|
6
6
|
readonly poolName: string;
|
|
7
|
-
readonly token: TokenData;
|
|
7
|
+
readonly token: TokenData | undefined;
|
|
8
8
|
readonly currentQuota: PoolAssetsTableQuotaRow;
|
|
9
9
|
readonly underlyingToken: TokenData;
|
|
10
10
|
readonly last: boolean;
|
|
@@ -12,7 +12,7 @@ export interface PoolAssetsTableProps {
|
|
|
12
12
|
readonly poolName: string;
|
|
13
13
|
readonly sort: PoolAssetsTableSort;
|
|
14
14
|
/** Token metadata keyed by token address (must include every `quota.token`). */
|
|
15
|
-
readonly tokensList: Record<Address, TokenData
|
|
15
|
+
readonly tokensList: Partial<Record<Address, TokenData>>;
|
|
16
16
|
/** Underlying asset used for `TokenTemplate` amounts in the usage column. */
|
|
17
17
|
readonly underlyingToken: TokenData;
|
|
18
18
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
export type * from './pool-credit-managers-table';
|
|
2
1
|
export * from './pool-credit-managers-table';
|
|
3
2
|
export * from './pool-credit-managers-table.test-ids';
|
|
4
|
-
export type * from './pool-credit-managers-table-head';
|
|
5
3
|
export * from './pool-credit-managers-table-head';
|
|
6
|
-
export type * from './pool-credit-managers-table-row';
|
|
7
4
|
export * from './pool-credit-managers-table-row';
|
|
8
5
|
export type * from './types';
|
|
@@ -20,7 +20,7 @@ export interface PoolCreditManagerRow {
|
|
|
20
20
|
readonly address: Address;
|
|
21
21
|
readonly name: string;
|
|
22
22
|
readonly totalDebt: bigint;
|
|
23
|
-
readonly collateralTokens: readonly
|
|
23
|
+
readonly collateralTokens: readonly Address[];
|
|
24
24
|
readonly underlyingToken: Address;
|
|
25
25
|
}
|
|
26
26
|
/**
|