@gearbox-protocol/ui-kit 4.0.0-next.69 → 4.0.0-next.70
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),C=require("../../no-value/no-value.cjs");require("clsx");require("tailwind-merge");const S=require("../../../utils/format-money.cjs");require("@gearbox-protocol/sdk/onchain");require("../../../utils/z-index.cjs");const k=require("../../base/values/scalars.cjs");require("../../badge/badge.cjs");require("../../badge/chip.cjs");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),C=require("../../no-value/no-value.cjs");require("clsx");require("tailwind-merge");const S=require("../../../utils/format-money.cjs");require("@gearbox-protocol/sdk/onchain");require("../../../utils/z-index.cjs");const k=require("../../base/values/scalars.cjs");require("../../badge/badge.cjs");require("../../badge/chip.cjs");const o=require("../../typed-intl/index.cjs"),N=require("../../collateral-allocation-tooltip/allocation-wheel.cjs"),z=require("../../help-tip/help-tip.cjs"),w=require("../../name-cell/name-cell.cjs"),I=require("../../short-string/short-string.cjs"),n=require("../../table/grid-table.cjs"),a=require("../../table/table-sm.cjs"),P=require("../../token-symbol/token-symbol.cjs"),g=require("../../token-template/token-template.cjs"),M=require("../../vertical-indicator/vertical-indicator.cjs"),i=require("./constants.cjs");function G(l,s){return l>=s?1e4:Number(l*10000n/s)}function B(l,s){return s<=0n||l<=0n?0:Number(l*10000n/s)/1e4}function F({asset:l,underlyingToken:s,last:_,isCompact:p,totalUsed:f,colorIndex:q,explorerUrl:m}){const v=o.useIntlTyped(),{token:r,limit:c,used:t}=l,y=p?40:21,u=B(t.value,f),A=c.value<t.value,d=v.formatMessage({messageId:"components.poolAssetsTable.capBelowExposure.tip"}),x=()=>e.jsx(w.NameCell,{leading:e.jsx(P.TokenSymbol,{size:32,token:r}),title:e.jsx(I.ShortString,{maxLength:y,children:r.symbol})}),T=()=>e.jsxs("div",{className:"flex items-center justify-end gap-2","data-testid":i.PoolAssetsTableTest.exposureCell,children:[e.jsx(N.AllocationWheel,{share:u,colorIndex:q,idle:u===0}),e.jsx(M.VerticalIndicator,{value:e.jsx(g.TokenTemplate,{decimalPartLength:2,precision:2,showSymbol:!1,token:s,value:t.value}),valueDescription:t.valueUsd===null?e.jsx(C.NoValue,{}):S.formatMoney(t.valueUsd)})]}),h=()=>e.jsxs("span",{className:"inline-flex items-center gap-1","data-testid":i.PoolAssetsTableTest.capCell,children:[e.jsx(g.TokenTemplate,{decimalPartLength:2,precision:2,showSymbol:!1,token:s,value:c.value}),e.jsx("span",{className:"inline-flex w-3.5 shrink-0 justify-center",children:A&&e.jsxs(e.Fragment,{children:[e.jsx(z.HelpTip,{"data-testid":i.PoolAssetsTableTest.capBelowExposureTip,tabIndex:0,onClick:j=>{j.preventDefault(),j.stopPropagation()},children:d}),e.jsx("span",{className:"sr-only",children:d})]})})]}),b=()=>e.jsx("div",{"data-testid":i.PoolAssetsTableTest.capUtilizationCell,children:e.jsx(k.UtilizationValue,{data:G(t.value,c.value)})});return e.jsx(n.GridTableRow,{last:_,height:"auto",href:m?`${m}/address/${r.address}`:void 0,target:"_blank",style:{minHeight:"75px"},children:p?e.jsx(n.GridTableCell,{className:"px-3 py-0!",size:"sm",span:"full",children:e.jsxs(a.TableLineSm,{className:"w-full",columns:3,columnsXs:3,title:x(),children:[e.jsx(a.TableCellSm,{title:e.jsx(o.FormattedMessageTyped,{messageId:"components.poolAssetsTable.exposure"}),children:T()}),e.jsx(a.TableCellSm,{title:e.jsx(o.FormattedMessageTyped,{messageId:"components.poolAssetsTable.cap"}),children:h()}),e.jsx(a.TableCellSm,{title:e.jsx(o.FormattedMessageTyped,{messageId:"components.poolAssetsTable.capUtilization"}),children:b()})]})}):e.jsxs(e.Fragment,{children:[e.jsx(n.GridTableCell,{className:"pl-4",size:"sm",textAlign:"left",children:x()}),e.jsx(n.GridTableCell,{size:"sm",textAlign:"right",children:T()}),e.jsx(n.GridTableCell,{size:"sm",textAlign:"right",children:h()}),e.jsx(n.GridTableCell,{className:"pr-4",size:"sm",textAlign:"right",children:b()})]})})}exports.PoolAssetsTableRow=F;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as o, Fragment as v } from "react/jsx-runtime";
|
|
2
|
-
import { NoValue as
|
|
2
|
+
import { NoValue as S } from "../../no-value/no-value.js";
|
|
3
3
|
import "clsx";
|
|
4
4
|
import "tailwind-merge";
|
|
5
5
|
import { formatMoney as I } from "../../../utils/format-money.js";
|
|
@@ -16,7 +16,7 @@ import { ShortString as E } from "../../short-string/short-string.js";
|
|
|
16
16
|
import { GridTableRow as M, GridTableCell as s } from "../../table/grid-table.js";
|
|
17
17
|
import { TableLineSm as V, TableCellSm as p } from "../../table/table-sm.js";
|
|
18
18
|
import { TokenSymbol as D } from "../../token-symbol/token-symbol.js";
|
|
19
|
-
import { TokenTemplate as
|
|
19
|
+
import { TokenTemplate as N } from "../../token-template/token-template.js";
|
|
20
20
|
import { VerticalIndicator as F } from "../../vertical-indicator/vertical-indicator.js";
|
|
21
21
|
import { PoolAssetsTableTest as a } from "./constants.js";
|
|
22
22
|
function G(l, t) {
|
|
@@ -28,19 +28,19 @@ function H(l, t) {
|
|
|
28
28
|
function me({
|
|
29
29
|
asset: l,
|
|
30
30
|
underlyingToken: t,
|
|
31
|
-
last:
|
|
31
|
+
last: y,
|
|
32
32
|
isCompact: c,
|
|
33
|
-
totalUsed:
|
|
34
|
-
colorIndex:
|
|
33
|
+
totalUsed: z,
|
|
34
|
+
colorIndex: A,
|
|
35
35
|
explorerUrl: d
|
|
36
36
|
}) {
|
|
37
|
-
const
|
|
37
|
+
const w = L(), { token: n, limit: r, used: i } = l, C = c ? 40 : 21, u = H(i.value, z), k = r.value < i.value, h = w.formatMessage({
|
|
38
38
|
messageId: "components.poolAssetsTable.capBelowExposure.tip"
|
|
39
39
|
}), f = () => /* @__PURE__ */ e(
|
|
40
40
|
j,
|
|
41
41
|
{
|
|
42
|
-
leading: /* @__PURE__ */ e(D, { size: 32, token:
|
|
43
|
-
title: /* @__PURE__ */ e(E, { maxLength:
|
|
42
|
+
leading: /* @__PURE__ */ e(D, { size: 32, token: n }),
|
|
43
|
+
title: /* @__PURE__ */ e(E, { maxLength: C, children: n.symbol })
|
|
44
44
|
}
|
|
45
45
|
), g = () => /* @__PURE__ */ o(
|
|
46
46
|
"div",
|
|
@@ -52,7 +52,7 @@ function me({
|
|
|
52
52
|
P,
|
|
53
53
|
{
|
|
54
54
|
share: u,
|
|
55
|
-
colorIndex:
|
|
55
|
+
colorIndex: A,
|
|
56
56
|
idle: u === 0
|
|
57
57
|
}
|
|
58
58
|
),
|
|
@@ -60,7 +60,7 @@ function me({
|
|
|
60
60
|
F,
|
|
61
61
|
{
|
|
62
62
|
value: /* @__PURE__ */ e(
|
|
63
|
-
|
|
63
|
+
N,
|
|
64
64
|
{
|
|
65
65
|
decimalPartLength: 2,
|
|
66
66
|
precision: 2,
|
|
@@ -69,7 +69,7 @@ function me({
|
|
|
69
69
|
value: i.value
|
|
70
70
|
}
|
|
71
71
|
),
|
|
72
|
-
valueDescription: i.valueUsd === null ? /* @__PURE__ */ e(
|
|
72
|
+
valueDescription: i.valueUsd === null ? /* @__PURE__ */ e(S, {}) : I(i.valueUsd)
|
|
73
73
|
}
|
|
74
74
|
)
|
|
75
75
|
]
|
|
@@ -80,7 +80,17 @@ function me({
|
|
|
80
80
|
className: "inline-flex items-center gap-1",
|
|
81
81
|
"data-testid": a.capCell,
|
|
82
82
|
children: [
|
|
83
|
-
|
|
83
|
+
/* @__PURE__ */ e(
|
|
84
|
+
N,
|
|
85
|
+
{
|
|
86
|
+
decimalPartLength: 2,
|
|
87
|
+
precision: 2,
|
|
88
|
+
showSymbol: !1,
|
|
89
|
+
token: t,
|
|
90
|
+
value: r.value
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
/* @__PURE__ */ e("span", { className: "inline-flex w-3.5 shrink-0 justify-center", children: k && /* @__PURE__ */ o(v, { children: [
|
|
84
94
|
/* @__PURE__ */ e(
|
|
85
95
|
U,
|
|
86
96
|
{
|
|
@@ -93,26 +103,16 @@ function me({
|
|
|
93
103
|
}
|
|
94
104
|
),
|
|
95
105
|
/* @__PURE__ */ e("span", { className: "sr-only", children: h })
|
|
96
|
-
] })
|
|
97
|
-
/* @__PURE__ */ e(
|
|
98
|
-
z,
|
|
99
|
-
{
|
|
100
|
-
decimalPartLength: 2,
|
|
101
|
-
precision: 2,
|
|
102
|
-
showSymbol: !1,
|
|
103
|
-
token: t,
|
|
104
|
-
value: n.value
|
|
105
|
-
}
|
|
106
|
-
)
|
|
106
|
+
] }) })
|
|
107
107
|
]
|
|
108
108
|
}
|
|
109
|
-
), T = () => /* @__PURE__ */ e("div", { "data-testid": a.capUtilizationCell, children: /* @__PURE__ */ e(B, { data: G(i.value,
|
|
109
|
+
), T = () => /* @__PURE__ */ e("div", { "data-testid": a.capUtilizationCell, children: /* @__PURE__ */ e(B, { data: G(i.value, r.value) }) });
|
|
110
110
|
return /* @__PURE__ */ e(
|
|
111
111
|
M,
|
|
112
112
|
{
|
|
113
|
-
last:
|
|
113
|
+
last: y,
|
|
114
114
|
height: "auto",
|
|
115
|
-
href: d ? `${d}/address/${
|
|
115
|
+
href: d ? `${d}/address/${n.address}` : void 0,
|
|
116
116
|
target: "_blank",
|
|
117
117
|
style: { minHeight: "75px" },
|
|
118
118
|
children: c ? /* @__PURE__ */ e(s, { className: "px-3 py-0!", size: "sm", span: "full", children: /* @__PURE__ */ o(
|