@gearbox-protocol/ui-kit 4.1.3 → 4.2.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/base/borrow-rate-block/borrow-rate-block.cjs +1 -1
- package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
- package/dist/cjs/components/base/position-assets/position-assets.cjs +1 -1
- package/dist/cjs/components/base/values/price-impact-value.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
- package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +4 -2
- package/dist/esm/components/base/info-list/info-list.js +17 -16
- package/dist/esm/components/base/position-assets/position-assets.js +23 -21
- package/dist/esm/components/base/values/price-impact-value.js +14 -7
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +12 -9
- package/dist/types/components/base/values/price-impact-value.d.ts +3 -1
- package/package.json +1 -1
|
@@ -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("../../simple-accordion/simple-accordion.cjs"),l=require("../../tip-card/tip-card.cjs"),n=require("../../typed-intl/index.cjs"),p=require("../../typography/typography.cjs"),d=require("../../vspace/vspace.cjs"),t=require("../info-list/info-list.cjs");require("../../help-tip/help-tip.cjs");require("clsx");require("tailwind-merge");require("@gearbox-protocol/sdk/onchain");require("../../../utils/z-index.cjs");const i=require("../values/scalars.cjs");require("../../badge/badge.cjs");require("../../badge/chip.cjs");require("../../tooltip/simple-tooltip.cjs");require("../../tooltip/tooltip.cjs");const r=require("./constants.cjs");function c(o){return typeof o=="number"?o:o?.total}function u(o){return typeof o=="number"?o:o?.base}function m({data:o,dataTo:s}){return e.jsx("div",{"data-testid":r.BorrowRateBlockTest.root,children:e.jsx(a.SimpleAccordion,{children:e.jsx(a.SimpleAccordionItem,{value:"borrow-rate",last:!0,triggerClassName:"flex-nowrap py-0 font-normal",className:"[&_[role=region]_>div]:pb-0 border-b-0",title:e.jsx("div",{className:"min-w-0 flex-1 pr-1.5","data-testid":r.BorrowRateBlockTest.trigger,children:e.jsx(t.InfoLine,{title:"components.borrowRateBlock.label",tip:e.jsx(n.FormattedMessageTyped,{messageId:"components.borrowRateBlock.tip"}),value:e.jsx(i.ApyValue,{data:c(o)}),valueTo:s!==void 0?e.jsx(i.ApyValue,{data:c(s)}):void 0})}),description:e.jsxs("div",{"data-testid":r.BorrowRateBlockTest.details,children:[e.jsx(d.VSpace,{size:16}),e.jsx(l.TipCard,{backgroundColor:"transparent",textColor:"unset",children:e.jsxs(t.InfoList,{children:[e.jsx(p.Typography,{as:"span",variant:"caption",color:"secondary",children:e.jsx(n.FormattedMessageTyped,{messageId:"components.borrowRateBlock.description"})}),e.jsx(t.InfoLine,{title:"components.borrowRateBlock.baseRate",value:e.jsx(i.ApyValue,{data:u(s??o)})}),e.jsx(t.InfoLine,{title:"components.borrowRateBlock.normalization",tip:e.jsx(n.FormattedMessageTyped,{messageId:"components.borrowRateBlock.normalization.tip",values:{quota:"Quota Rates",utilization:"Utilization Rate"}}),value:"—"})]})})]})})})})}exports.BorrowRateBlockTest=r.BorrowRateBlockTest;exports.BorrowRateBlock=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("../stack/stack.cjs"),l=require("../text/use-title-text.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("../stack/stack.cjs"),l=require("../text/use-title-text.cjs"),q=require("../values/constants.cjs");require("../../help-tip/help-tip.cjs");require("react");require("react-intl");require("clsx");require("tailwind-merge");require("@gearbox-protocol/sdk/onchain");require("../../../utils/z-index.cjs");require("viem");const d=require("../../points-icon/points-icon.cjs");require("../../token-icon/token-icon.cjs");const p=require("../../../utils/internal/apy-breakdown.cjs");require("../../tooltip/simple-tooltip.cjs");require("../../tooltip/tooltip.cjs");require("../../badge/badge.cjs");require("../../badge/chip.cjs");require("../../typography/typography.cjs");const f=require("../../vertical-indicator/vertical-indicator.cjs"),r=require("./constants.cjs");function _({children:t}){return e.jsx(u.Stack,{gap:"sm","data-testid":r.InfoListTest.root,children:t})}function o({title:t,size:i="sm",align:s="start","data-testid":n=r.InfoListTest.line,...a}){const c=l.useTitleText();return e.jsx(f.VerticalIndicator,{label:c(t),size:i,align:s,"data-testid":n,...a})}function m({data:t,title:i="components.yieldBreakdown.points"}){const s=t?p.pointProgramsOf(t):[];return s.length===0?null:e.jsx(o,{title:i,value:e.jsx("span",{className:"inline-flex flex-wrap items-center gap-1.5","data-testid":q.ValueTest.points,children:s.map(n=>e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(d.PointsIcon,{reward:{name:n.name,type:n.id},size:16}),e.jsx("span",{children:n.name})]},n.id))})})}exports.InfoListTest=r.InfoListTest;exports.InfoLine=o;exports.InfoList=_;exports.PointsInfoLine=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("./position-asset-rows.cjs"),h=require("../stack/stack.cjs"),_=require("../../no-value/no-value.cjs");require("clsx");require("tailwind-merge");const x=require("../../../utils/format.cjs"),y=require("../../../utils/format-money.cjs");require("@gearbox-protocol/sdk/onchain");require("../../../utils/z-index.cjs");const c=require("../values/scalars.cjs");require("../../badge/badge.cjs");require("../../badge/chip.cjs");require("react");require("react-intl");require("../../tooltip/simple-tooltip.cjs");require("../../tooltip/tooltip.cjs");const g=require("../../short-string/short-string.cjs"),l=require("../../typography/typography.cjs"),q=require("../../token-symbol/token-symbol.cjs"),t=require("./constants.cjs"),j=20;function k({assets:u,to:o,empty:r,approximate:d,testId:p}){const i=m.visibleAssets(u,o),n=o!==void 0;return e.jsx(h.Stack,{gap:"sm",align:"end","data-testid":p??t.PositionAssetsTest.root,children:i.length===0?r!==void 0&&e.jsx(l.Typography,{variant:"caption",color:"secondary",as:"div","data-testid":t.PositionAssetsTest.empty,children:r}):i.map(s=>{const a=n?s.valueToUsd:s.valueUsd;return e.jsxs("span",{className:"flex flex-col items-end","data-testid":t.PositionAssetsTest.row,children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(q.TokenSymbol,{size:20,token:s.token}),e.jsxs("span",{className:"flex items-center",children:[n&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-secondary-foreground line-through [&_*]:text-secondary-foreground [&_*]:line-through",children:e.jsx(c.TokenBigint,{data:s.value,token:s.token,showSymbol:!1})}),e.jsx("span",{className:"px-1.5 text-gray-70",children:"→"})]}),d?e.jsx("span",{children:x.APPROXIMATE_SYMBOL}):null,e.jsx(c.TokenBigint,{data:n?s.valueTo:s.value,token:s.token,showSymbol:!1}),e.jsx(g.ShortString,{className:"ml-1",maxLength:j,children:s.token.symbol})]})]}),e.jsx(l.Typography,{as:"span",variant:"caption",color:"secondary","data-testid":t.PositionAssetsTest.worth,children:a===null?e.jsx(_.NoValue,{}):y.formatMoney(a)})]},s.token.address)})})}exports.PositionAssetsTest=t.PositionAssetsTest;exports.PositionAssets=k;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("../token-amount/token-amount.cjs"),i=require("../../no-value/no-value.cjs"),s=require("../../tooltip/simple-tooltip.cjs");require("../../tooltip/tooltip.cjs");const c=require("./constants.cjs"),a=require("./price-impact.cjs");function u({data:t,absoluteValue:n}){if(t===void 0)return e.jsx(i.NoValue,{});const o=e.jsx("span",{"data-testid":c.ValueTest.priceImpact,children:a.priceImpact(t)});return n?e.jsx(s.SimpleTooltip,{placement:"top",triangle:!1,title:o,children:e.jsx(r.TokenAmount,{data:n,align:"start"})}):o}exports.PriceImpactValue=u;
|
|
@@ -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 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"),
|
|
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"),g=require("../../token-template/token-template.cjs");require("../../typography/typography.cjs");require("../../tooltip/simple-tooltip.cjs");require("../../tooltip/tooltip.cjs");const 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"),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:q,colorIndex:f,explorerUrl:m}){const v=o.useIntlTyped(),{token:r,limit:c,used:t}=l,y=p?40:21,u=B(t.value,q),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:f,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;
|
|
@@ -13,6 +13,8 @@ import "../../../utils/z-index.js";
|
|
|
13
13
|
import { ApyValue as a } from "../values/scalars.js";
|
|
14
14
|
import "../../badge/badge.js";
|
|
15
15
|
import "../../badge/chip.js";
|
|
16
|
+
import "../../tooltip/simple-tooltip.js";
|
|
17
|
+
import "../../tooltip/tooltip.js";
|
|
16
18
|
import { BorrowRateBlockTest as n } from "./constants.js";
|
|
17
19
|
function p(t) {
|
|
18
20
|
return typeof t == "number" ? t : t?.total;
|
|
@@ -20,7 +22,7 @@ function p(t) {
|
|
|
20
22
|
function u(t) {
|
|
21
23
|
return typeof t == "number" ? t : t?.base;
|
|
22
24
|
}
|
|
23
|
-
function
|
|
25
|
+
function V({
|
|
24
26
|
data: t,
|
|
25
27
|
dataTo: r
|
|
26
28
|
}) {
|
|
@@ -81,6 +83,6 @@ function j({
|
|
|
81
83
|
) }) });
|
|
82
84
|
}
|
|
83
85
|
export {
|
|
84
|
-
|
|
86
|
+
V as BorrowRateBlock,
|
|
85
87
|
n as BorrowRateBlockTest
|
|
86
88
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
1
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import { Stack as a } from "../stack/stack.js";
|
|
3
3
|
import { useTitleText as l } from "../text/use-title-text.js";
|
|
4
4
|
import { ValueTest as f } from "../values/constants.js";
|
|
@@ -17,47 +17,48 @@ import "../../tooltip/simple-tooltip.js";
|
|
|
17
17
|
import "../../tooltip/tooltip.js";
|
|
18
18
|
import "../../badge/badge.js";
|
|
19
19
|
import "../../badge/chip.js";
|
|
20
|
+
import "../../typography/typography.js";
|
|
20
21
|
import { VerticalIndicator as u } from "../../vertical-indicator/vertical-indicator.js";
|
|
21
|
-
import { InfoListTest as
|
|
22
|
-
function
|
|
22
|
+
import { InfoListTest as n } from "./constants.js";
|
|
23
|
+
function E({
|
|
23
24
|
children: t
|
|
24
25
|
}) {
|
|
25
|
-
return /* @__PURE__ */ o(a, { gap: "sm", "data-testid":
|
|
26
|
+
return /* @__PURE__ */ o(a, { gap: "sm", "data-testid": n.root, children: t });
|
|
26
27
|
}
|
|
27
28
|
function x({
|
|
28
29
|
title: t,
|
|
29
|
-
size:
|
|
30
|
+
size: r = "sm",
|
|
30
31
|
align: e = "start",
|
|
31
|
-
"data-testid": i =
|
|
32
|
+
"data-testid": i = n.line,
|
|
32
33
|
...m
|
|
33
34
|
}) {
|
|
34
|
-
const
|
|
35
|
+
const p = l();
|
|
35
36
|
return /* @__PURE__ */ o(
|
|
36
37
|
u,
|
|
37
38
|
{
|
|
38
|
-
label:
|
|
39
|
-
size:
|
|
39
|
+
label: p(t),
|
|
40
|
+
size: r,
|
|
40
41
|
align: e,
|
|
41
42
|
"data-testid": i,
|
|
42
43
|
...m
|
|
43
44
|
}
|
|
44
45
|
);
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
+
function F({
|
|
47
48
|
data: t,
|
|
48
|
-
title:
|
|
49
|
+
title: r = "components.yieldBreakdown.points"
|
|
49
50
|
}) {
|
|
50
51
|
const e = t ? d(t) : [];
|
|
51
52
|
return e.length === 0 ? null : /* @__PURE__ */ o(
|
|
52
53
|
x,
|
|
53
54
|
{
|
|
54
|
-
title:
|
|
55
|
+
title: r,
|
|
55
56
|
value: /* @__PURE__ */ o(
|
|
56
57
|
"span",
|
|
57
58
|
{
|
|
58
59
|
className: "inline-flex flex-wrap items-center gap-1.5",
|
|
59
60
|
"data-testid": f.points,
|
|
60
|
-
children: e.map((i) => /* @__PURE__ */
|
|
61
|
+
children: e.map((i) => /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1", children: [
|
|
61
62
|
/* @__PURE__ */ o(
|
|
62
63
|
c,
|
|
63
64
|
{
|
|
@@ -74,7 +75,7 @@ function E({
|
|
|
74
75
|
}
|
|
75
76
|
export {
|
|
76
77
|
x as InfoLine,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
E as InfoList,
|
|
79
|
+
n as InfoListTest,
|
|
80
|
+
F as PointsInfoLine
|
|
80
81
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
1
|
+
import { jsx as t, jsxs as e, Fragment as f } from "react/jsx-runtime";
|
|
2
2
|
import { visibleAssets as u } from "./position-asset-rows.js";
|
|
3
3
|
import { Stack as g } from "../stack/stack.js";
|
|
4
4
|
import { NoValue as x } from "../../no-value/no-value.js";
|
|
@@ -13,21 +13,23 @@ import "../../badge/badge.js";
|
|
|
13
13
|
import "../../badge/chip.js";
|
|
14
14
|
import "react";
|
|
15
15
|
import "react-intl";
|
|
16
|
+
import "../../tooltip/simple-tooltip.js";
|
|
17
|
+
import "../../tooltip/tooltip.js";
|
|
16
18
|
import { ShortString as v } from "../../short-string/short-string.js";
|
|
19
|
+
import { Typography as p } from "../../typography/typography.js";
|
|
17
20
|
import { TokenSymbol as S } from "../../token-symbol/token-symbol.js";
|
|
18
|
-
import { Typography as d } from "../../typography/typography.js";
|
|
19
21
|
import { PositionAssetsTest as r } from "./constants.js";
|
|
20
22
|
const N = 20;
|
|
21
|
-
function
|
|
22
|
-
assets:
|
|
23
|
+
function D({
|
|
24
|
+
assets: d,
|
|
23
25
|
to: n,
|
|
24
26
|
empty: a,
|
|
25
27
|
approximate: c,
|
|
26
28
|
testId: h
|
|
27
29
|
}) {
|
|
28
|
-
const i = u(
|
|
30
|
+
const i = u(d, n), s = n !== void 0;
|
|
29
31
|
return /* @__PURE__ */ t(g, { gap: "sm", align: "end", "data-testid": h ?? r.root, children: i.length === 0 ? a !== void 0 && /* @__PURE__ */ t(
|
|
30
|
-
|
|
32
|
+
p,
|
|
31
33
|
{
|
|
32
34
|
variant: "caption",
|
|
33
35
|
color: "secondary",
|
|
@@ -35,23 +37,23 @@ function q({
|
|
|
35
37
|
"data-testid": r.empty,
|
|
36
38
|
children: a
|
|
37
39
|
}
|
|
38
|
-
) : i.map((
|
|
39
|
-
const m = s ?
|
|
40
|
-
return /* @__PURE__ */
|
|
40
|
+
) : i.map((o) => {
|
|
41
|
+
const m = s ? o.valueToUsd : o.valueUsd;
|
|
42
|
+
return /* @__PURE__ */ e(
|
|
41
43
|
"span",
|
|
42
44
|
{
|
|
43
45
|
className: "flex flex-col items-end",
|
|
44
46
|
"data-testid": r.row,
|
|
45
47
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */ t(S, { size: 20, token:
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
s && /* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ e("span", { className: "flex items-center gap-2", children: [
|
|
49
|
+
/* @__PURE__ */ t(S, { size: 20, token: o.token }),
|
|
50
|
+
/* @__PURE__ */ e("span", { className: "flex items-center", children: [
|
|
51
|
+
s && /* @__PURE__ */ e(f, { children: [
|
|
50
52
|
/* @__PURE__ */ t("span", { className: "text-secondary-foreground line-through [&_*]:text-secondary-foreground [&_*]:line-through", children: /* @__PURE__ */ t(
|
|
51
53
|
l,
|
|
52
54
|
{
|
|
53
|
-
data:
|
|
54
|
-
token:
|
|
55
|
+
data: o.value,
|
|
56
|
+
token: o.token,
|
|
55
57
|
showSymbol: !1
|
|
56
58
|
}
|
|
57
59
|
) }),
|
|
@@ -61,16 +63,16 @@ function q({
|
|
|
61
63
|
/* @__PURE__ */ t(
|
|
62
64
|
l,
|
|
63
65
|
{
|
|
64
|
-
data: s ?
|
|
65
|
-
token:
|
|
66
|
+
data: s ? o.valueTo : o.value,
|
|
67
|
+
token: o.token,
|
|
66
68
|
showSymbol: !1
|
|
67
69
|
}
|
|
68
70
|
),
|
|
69
|
-
/* @__PURE__ */ t(v, { className: "ml-1", maxLength: N, children:
|
|
71
|
+
/* @__PURE__ */ t(v, { className: "ml-1", maxLength: N, children: o.token.symbol })
|
|
70
72
|
] })
|
|
71
73
|
] }),
|
|
72
74
|
/* @__PURE__ */ t(
|
|
73
|
-
|
|
75
|
+
p,
|
|
74
76
|
{
|
|
75
77
|
as: "span",
|
|
76
78
|
variant: "caption",
|
|
@@ -81,11 +83,11 @@ function q({
|
|
|
81
83
|
)
|
|
82
84
|
]
|
|
83
85
|
},
|
|
84
|
-
|
|
86
|
+
o.token.address
|
|
85
87
|
);
|
|
86
88
|
}) });
|
|
87
89
|
}
|
|
88
90
|
export {
|
|
89
|
-
|
|
91
|
+
D as PositionAssets,
|
|
90
92
|
r as PositionAssetsTest
|
|
91
93
|
};
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { TokenAmount as e } from "../token-amount/token-amount.js";
|
|
3
|
+
import { NoValue as m } from "../../no-value/no-value.js";
|
|
4
|
+
import { SimpleTooltip as p } from "../../tooltip/simple-tooltip.js";
|
|
5
|
+
import "../../tooltip/tooltip.js";
|
|
6
|
+
import { ValueTest as n } from "./constants.js";
|
|
7
|
+
import { priceImpact as a } from "./price-impact.js";
|
|
8
|
+
function T({
|
|
9
|
+
data: r,
|
|
10
|
+
absoluteValue: i
|
|
7
11
|
}) {
|
|
8
|
-
|
|
12
|
+
if (r === void 0)
|
|
13
|
+
return /* @__PURE__ */ t(m, {});
|
|
14
|
+
const o = /* @__PURE__ */ t("span", { "data-testid": n.priceImpact, children: a(r) });
|
|
15
|
+
return i ? /* @__PURE__ */ t(p, { placement: "top", triangle: !1, title: o, children: /* @__PURE__ */ t(e, { data: i, align: "start" }) }) : o;
|
|
9
16
|
}
|
|
10
17
|
export {
|
|
11
|
-
|
|
18
|
+
T as PriceImpactValue
|
|
12
19
|
};
|
|
@@ -9,6 +9,10 @@ import { UtilizationValue as B } from "../../base/values/scalars.js";
|
|
|
9
9
|
import "../../badge/badge.js";
|
|
10
10
|
import "../../badge/chip.js";
|
|
11
11
|
import { useIntlTyped as L, FormattedMessageTyped as m } from "../../typed-intl/index.js";
|
|
12
|
+
import { TokenTemplate as N } from "../../token-template/token-template.js";
|
|
13
|
+
import "../../typography/typography.js";
|
|
14
|
+
import "../../tooltip/simple-tooltip.js";
|
|
15
|
+
import "../../tooltip/tooltip.js";
|
|
12
16
|
import { AllocationWheel as P } from "../../collateral-allocation-tooltip/allocation-wheel.js";
|
|
13
17
|
import { HelpTip as U } from "../../help-tip/help-tip.js";
|
|
14
18
|
import { NameCell as j } from "../../name-cell/name-cell.js";
|
|
@@ -16,7 +20,6 @@ import { ShortString as E } from "../../short-string/short-string.js";
|
|
|
16
20
|
import { GridTableRow as M, GridTableCell as s } from "../../table/grid-table.js";
|
|
17
21
|
import { TableLineSm as V, TableCellSm as p } from "../../table/table-sm.js";
|
|
18
22
|
import { TokenSymbol as D } from "../../token-symbol/token-symbol.js";
|
|
19
|
-
import { TokenTemplate as N } from "../../token-template/token-template.js";
|
|
20
23
|
import { VerticalIndicator as F } from "../../vertical-indicator/vertical-indicator.js";
|
|
21
24
|
import { PoolAssetsTableTest as a } from "./constants.js";
|
|
22
25
|
function G(l, t) {
|
|
@@ -25,7 +28,7 @@ function G(l, t) {
|
|
|
25
28
|
function H(l, t) {
|
|
26
29
|
return t <= 0n || l <= 0n ? 0 : Number(l * 10000n / t) / 1e4;
|
|
27
30
|
}
|
|
28
|
-
function
|
|
31
|
+
function de({
|
|
29
32
|
asset: l,
|
|
30
33
|
underlyingToken: t,
|
|
31
34
|
last: y,
|
|
@@ -34,13 +37,13 @@ function me({
|
|
|
34
37
|
colorIndex: A,
|
|
35
38
|
explorerUrl: d
|
|
36
39
|
}) {
|
|
37
|
-
const w = L(), { token:
|
|
40
|
+
const w = L(), { token: r, limit: n, used: i } = l, C = c ? 40 : 21, u = H(i.value, z), k = n.value < i.value, h = w.formatMessage({
|
|
38
41
|
messageId: "components.poolAssetsTable.capBelowExposure.tip"
|
|
39
42
|
}), f = () => /* @__PURE__ */ e(
|
|
40
43
|
j,
|
|
41
44
|
{
|
|
42
|
-
leading: /* @__PURE__ */ e(D, { size: 32, token:
|
|
43
|
-
title: /* @__PURE__ */ e(E, { maxLength: C, children:
|
|
45
|
+
leading: /* @__PURE__ */ e(D, { size: 32, token: r }),
|
|
46
|
+
title: /* @__PURE__ */ e(E, { maxLength: C, children: r.symbol })
|
|
44
47
|
}
|
|
45
48
|
), g = () => /* @__PURE__ */ o(
|
|
46
49
|
"div",
|
|
@@ -87,7 +90,7 @@ function me({
|
|
|
87
90
|
precision: 2,
|
|
88
91
|
showSymbol: !1,
|
|
89
92
|
token: t,
|
|
90
|
-
value:
|
|
93
|
+
value: n.value
|
|
91
94
|
}
|
|
92
95
|
),
|
|
93
96
|
/* @__PURE__ */ e("span", { className: "inline-flex w-3.5 shrink-0 justify-center", children: k && /* @__PURE__ */ o(v, { children: [
|
|
@@ -106,13 +109,13 @@ function me({
|
|
|
106
109
|
] }) })
|
|
107
110
|
]
|
|
108
111
|
}
|
|
109
|
-
), T = () => /* @__PURE__ */ e("div", { "data-testid": a.capUtilizationCell, children: /* @__PURE__ */ e(B, { data: G(i.value,
|
|
112
|
+
), T = () => /* @__PURE__ */ e("div", { "data-testid": a.capUtilizationCell, children: /* @__PURE__ */ e(B, { data: G(i.value, n.value) }) });
|
|
110
113
|
return /* @__PURE__ */ e(
|
|
111
114
|
M,
|
|
112
115
|
{
|
|
113
116
|
last: y,
|
|
114
117
|
height: "auto",
|
|
115
|
-
href: d ? `${d}/address/${
|
|
118
|
+
href: d ? `${d}/address/${r.address}` : void 0,
|
|
116
119
|
target: "_blank",
|
|
117
120
|
style: { minHeight: "75px" },
|
|
118
121
|
children: c ? /* @__PURE__ */ e(s, { className: "px-3 py-0!", size: "sm", span: "full", children: /* @__PURE__ */ o(
|
|
@@ -156,5 +159,5 @@ function me({
|
|
|
156
159
|
);
|
|
157
160
|
}
|
|
158
161
|
export {
|
|
159
|
-
|
|
162
|
+
de as PoolAssetsTableRow
|
|
160
163
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TokenAmount as TokenAmountModel } from '@gearbox-protocol/sdk/model';
|
|
1
2
|
import { default as React } from 'react';
|
|
2
3
|
/**
|
|
3
4
|
* What a routed operation gave up to market depth.
|
|
@@ -6,6 +7,7 @@ import { default as React } from 'react';
|
|
|
6
7
|
* equity or the position — is the caller's choice; this renders the one it is
|
|
7
8
|
* handed.
|
|
8
9
|
*/
|
|
9
|
-
export declare function PriceImpactValue({ data, }: {
|
|
10
|
+
export declare function PriceImpactValue({ data, absoluteValue, }: {
|
|
10
11
|
readonly data: bigint | undefined;
|
|
12
|
+
readonly absoluteValue?: TokenAmountModel;
|
|
11
13
|
}): React.ReactElement;
|