@gearbox-protocol/ui-kit 4.0.0-next.71 → 4.0.0-next.76

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"),o=require("../../../utils/cn.cjs"),l=require("../../../utils/internal/bps-to-percent.cjs"),c="—",u="400px";function x(n,s,t){return n==="7d"?t:s}function m(n){const s=l.bpsToPercent(n),t=`${Math.abs(s).toFixed(2)}%`;return s<0?`−${t}`:t}function f({title:n,chip:s,chipPositive:t=!1,chipTestId:d,children:r,testId:a}){return e.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-4 rounded-xl border border-border bg-card p-4","data-testid":a,children:[e.jsxs("div",{className:"flex min-h-6 items-center justify-between gap-3",children:[e.jsx("span",{className:"min-w-0 text-base font-semibold leading-5 text-foreground",children:n}),e.jsx("span",{className:o.cn("shrink-0 rounded-md px-2 py-0.5 text-sm font-semibold tabular-nums",t?"bg-success/20 text-success":"bg-muted text-muted-foreground"),"data-testid":d,children:s})]}),e.jsx("div",{className:"flex flex-col gap-3",children:r})]})}function p({label:n,value:s,subtext:t,muted:d=!1,testId:r,valueTestId:a,captionTestId:i}){return e.jsxs("div",{className:"flex items-start justify-between gap-3","data-testid":r,children:[e.jsx("span",{className:o.cn("min-w-0 text-sm font-semibold leading-5",d?"text-muted-foreground":"text-foreground"),children:n}),e.jsxs("span",{className:"flex shrink-0 flex-col items-end",children:[e.jsx("span",{className:o.cn("text-sm font-semibold leading-5 tabular-nums",d?"text-muted-foreground":"text-foreground"),"data-testid":a,children:s}),t!=null?e.jsx("span",{className:"text-xs leading-4 text-muted-foreground","data-testid":i,children:t}):null]})]})}function g(){return e.jsx("div",{className:"h-px w-full bg-divider"})}exports.APY_BREAKDOWN_TOOLTIP_WIDTH=u;exports.ApyBreakdownBody=f;exports.ApyBreakdownDivider=g;exports.ApyBreakdownRow=p;exports.BREAKDOWN_DASH=c;exports.formatBreakdownRate=m;exports.periodMessageId=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("../../../utils/cn.cjs"),l=require("../../../utils/internal/bps-to-percent.cjs"),c="—",u="400px";function x(s,n,t){return s==="7d"?t:n}function m(s,n=!1){const t=l.bpsToPercent(s),d=`${Math.abs(t).toFixed(2)}%`;return n&&t<0?`−${d}`:d}function f({title:s,chip:n,chipPositive:t=!1,chipTestId:d,children:r,testId:a}){return e.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-4 rounded-xl border border-border bg-card p-4","data-testid":a,children:[e.jsxs("div",{className:"flex min-h-6 items-center justify-between gap-3",children:[e.jsx("span",{className:"min-w-0 text-base font-semibold leading-5 text-foreground",children:s}),e.jsx("span",{className:o.cn("shrink-0 rounded-md px-2 py-0.5 text-sm font-semibold tabular-nums",t?"bg-success/20 text-success":"bg-muted text-muted-foreground"),"data-testid":d,children:n})]}),e.jsx("div",{className:"flex flex-col gap-3",children:r})]})}function p({label:s,value:n,subtext:t,muted:d=!1,testId:r,valueTestId:a,captionTestId:i}){return e.jsxs("div",{className:"flex items-start justify-between gap-3","data-testid":r,children:[e.jsx("span",{className:o.cn("min-w-0 text-sm font-semibold leading-5",d?"text-muted-foreground":"text-foreground"),children:s}),e.jsxs("span",{className:"flex shrink-0 flex-col items-end",children:[e.jsx("span",{className:o.cn("text-sm font-semibold leading-5 tabular-nums",d?"text-muted-foreground":"text-foreground"),"data-testid":a,children:n}),t!=null?e.jsx("span",{className:"text-xs leading-4 text-muted-foreground","data-testid":i,children:t}):null]})]})}function g(){return e.jsx("div",{className:"h-px w-full bg-divider"})}exports.APY_BREAKDOWN_TOOLTIP_WIDTH=u;exports.ApyBreakdownBody=f;exports.ApyBreakdownDivider=g;exports.ApyBreakdownRow=p;exports.BREAKDOWN_DASH=c;exports.formatBreakdownRate=m;exports.periodMessageId=x;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("../apy-breakdown-body/apy-breakdown-body.cjs"),l=require("../../no-value/no-value.cjs"),m=require("../../points-icon/points-icon.cjs"),k=require("../../token-icon/token-icon.cjs"),r=require("../../typed-intl/index.cjs"),p=require("../../../utils/internal/apy-breakdown.cjs"),t=require("./constants.cjs");function u({data:s,period:a}){const d=s?p.totalApyOf(s):void 0,i=s?.organicApy,c=s?p.tokenRewardsOf(s):[],y=s?p.pointProgramsOf(s):[];return e.jsxs(o.ApyBreakdownBody,{testId:t.PoolApyBreakdownCardTest.root,title:e.jsx(r.FormattedMessageTyped,{messageId:o.periodMessageId(a,"components.poolApyBreakdownCard.title","components.poolApyBreakdownCard.title7d")}),chip:d==null?e.jsx(l.NoValue,{reason:a}):o.formatBreakdownRate(d),chipPositive:(d??0)>0,chipTestId:t.PoolApyBreakdownCardTest.net,children:[e.jsx(o.ApyBreakdownRow,{valueTestId:t.PoolApyBreakdownCardTest.value,label:e.jsx(r.FormattedMessageTyped,{messageId:o.periodMessageId(a,"components.poolApyBreakdownCard.organicApy","components.poolApyBreakdownCard.organicApy7d")}),value:i==null?e.jsx(l.NoValue,{reason:a}):o.formatBreakdownRate(i)}),c.length>0?c.map(n=>e.jsx(o.ApyBreakdownRow,{valueTestId:t.PoolApyBreakdownCardTest.value,label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(r.FormattedMessageTyped,{messageId:o.periodMessageId(a,"components.poolApyBreakdownCard.tokenIncentiveApy","components.poolApyBreakdownCard.tokenIncentiveApy7d"),values:{symbol:n.token.symbol}})}),e.jsx(k.TokenIcon,{token:n.token,symbol:n.token.symbol,size:16,className:"shrink-0"})]}),value:o.formatBreakdownRate(n.supplyApr??0)},`incentive-${n.token.address}`)):e.jsx(o.ApyBreakdownRow,{valueTestId:t.PoolApyBreakdownCardTest.value,label:e.jsx(r.FormattedMessageTyped,{messageId:o.periodMessageId(a,"components.poolApyBreakdownCard.incentiveApy","components.poolApyBreakdownCard.incentiveApy7d")}),value:s==null?e.jsx(l.NoValue,{reason:a}):o.formatBreakdownRate(0)}),y.length>0?e.jsxs(e.Fragment,{children:[e.jsx(o.ApyBreakdownDivider,{}),y.map(n=>e.jsx(o.ApyBreakdownRow,{valueTestId:t.PoolApyBreakdownCardTest.points,label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(r.FormattedMessageTyped,{messageId:"components.yieldBreakdown.programPoints",values:{name:n.name}})}),e.jsx(m.PointsIcon,{reward:{name:n.name,type:n.id},size:16,className:"shrink-0"})]}),value:n.multiplier!=null?`${n.multiplier}×`:o.BREAKDOWN_DASH},n.id))]}):null]})}exports.PoolApyBreakdownCardTest=t.PoolApyBreakdownCardTest;exports.PoolApyBreakdownCard=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("../apy-breakdown-body/apy-breakdown-body.cjs"),l=require("../../no-value/no-value.cjs"),m=require("../../points-icon/points-icon.cjs"),k=require("../../token-icon/token-icon.cjs"),r=require("../../typed-intl/index.cjs"),p=require("../../../utils/internal/apy-breakdown.cjs"),t=require("./constants.cjs");function u({data:s,period:a}){const d=s?p.totalApyOf(s):void 0,i=s?.organicApy,c=s?p.tokenRewardsOf(s):[],y=s?p.pointProgramsOf(s):[];return e.jsxs(o.ApyBreakdownBody,{testId:t.PoolApyBreakdownCardTest.root,title:e.jsx(r.FormattedMessageTyped,{messageId:o.periodMessageId(a,"components.poolApyBreakdownCard.title","components.poolApyBreakdownCard.title7d")}),chip:d==null?e.jsx(l.NoValue,{reason:a}):o.formatBreakdownRate(d,!0),chipPositive:(d??0)>0,chipTestId:t.PoolApyBreakdownCardTest.net,children:[e.jsx(o.ApyBreakdownRow,{valueTestId:t.PoolApyBreakdownCardTest.value,label:e.jsx(r.FormattedMessageTyped,{messageId:o.periodMessageId(a,"components.poolApyBreakdownCard.organicApy","components.poolApyBreakdownCard.organicApy7d")}),value:i==null?e.jsx(l.NoValue,{reason:a}):o.formatBreakdownRate(i)}),c.length>0?c.map(n=>e.jsx(o.ApyBreakdownRow,{valueTestId:t.PoolApyBreakdownCardTest.value,label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(r.FormattedMessageTyped,{messageId:o.periodMessageId(a,"components.poolApyBreakdownCard.tokenIncentiveApy","components.poolApyBreakdownCard.tokenIncentiveApy7d"),values:{symbol:n.token.symbol}})}),e.jsx(k.TokenIcon,{token:n.token,symbol:n.token.symbol,size:16,className:"shrink-0"})]}),value:o.formatBreakdownRate(n.supplyApr??0)},`incentive-${n.token.address}`)):e.jsx(o.ApyBreakdownRow,{valueTestId:t.PoolApyBreakdownCardTest.value,label:e.jsx(r.FormattedMessageTyped,{messageId:o.periodMessageId(a,"components.poolApyBreakdownCard.incentiveApy","components.poolApyBreakdownCard.incentiveApy7d")}),value:s==null?e.jsx(l.NoValue,{reason:a}):o.formatBreakdownRate(0)}),y.length>0?e.jsxs(e.Fragment,{children:[e.jsx(o.ApyBreakdownDivider,{}),y.map(n=>e.jsx(o.ApyBreakdownRow,{valueTestId:t.PoolApyBreakdownCardTest.points,label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(r.FormattedMessageTyped,{messageId:"components.yieldBreakdown.programPoints",values:{name:n.name}})}),e.jsx(m.PointsIcon,{reward:{name:n.name,type:n.id},size:16,className:"shrink-0"})]}),value:n.multiplier!=null?`${n.multiplier}×`:o.BREAKDOWN_DASH},n.id))]}):null]})}exports.PoolApyBreakdownCardTest=t.PoolApyBreakdownCardTest;exports.PoolApyBreakdownCard=u;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("@gearbox-protocol/sdk/onchain"),o=require("../apy-breakdown-body/apy-breakdown-body.cjs"),A=require("../../no-value/no-value.cjs"),C=require("../../points-icon/points-icon.cjs"),R=require("../../token-icon/token-icon.cjs"),d=require("../../typed-intl/index.cjs"),c=require("../../../utils/format-leverage.cjs"),k=require("../../../utils/internal/apy-breakdown.cjs"),r=require("./constants.cjs");function S(i){const{borrowApyAvg7D:a,quotaRateAvg7D:p,liquidationThreshold:l}=i;return a===void 0||p===void 0?null:{borrowApy:a,quotaRate:p,liquidationThreshold:l}}function _({data:i,leverage:a,showFormula:p=!1,period:l}){const s=S(i),n=s&&i.collateralApyAvg7D?i.collateralApyAvg7D:void 0,B=s!==null&&n!==void 0,v=B&&s&&n?{organicApy:g.calcNetStrategyApy(s,n.organicApy,a),totalApy:g.calcNetStrategyApy(s,n.totalApy??n.organicApy,a),...n.rewards?{rewards:n.rewards}:{}}:null,y=B&&s?g.calcEffectiveBorrowApy(s,a):null,u=v===null?null:k.totalApyOf(v),x=u===null||y===null?null:u+y,j=n?k.positiveTokenRewardsOf(n):[],T=n?k.pointProgramsOf(n):[],f=j.map(t=>({reward:t,value:Math.round(a*(t.supplyApr??0))})),m=x===null?null:x-f.reduce((t,w)=>t+w.value,0),I=m!==null&&a>0?m/a:void 0,b=s&&y!==null&&a>0?(y-s.borrowApy*(a-1))/a:void 0;return e.jsxs(o.ApyBreakdownBody,{testId:r.StrategyApyBreakdownCardTest.root,title:e.jsx(d.FormattedMessageTyped,{messageId:o.periodMessageId(l,"components.yieldBreakdown.titleNetAtLeverage","components.yieldBreakdown.titleNetAtLeverage7d"),values:{leverage:c.formatLeverage(a)}}),chip:u===null?e.jsx(A.NoValue,{reason:l}):o.formatBreakdownRate(u),chipPositive:(u??0)>0,chipTestId:r.StrategyApyBreakdownCardTest.net,children:[e.jsx(o.ApyBreakdownRow,{testId:r.StrategyApyBreakdownCardTest.collateral,valueTestId:r.StrategyApyBreakdownCardTest.value,captionTestId:r.StrategyApyBreakdownCardTest.caption,label:e.jsx(d.FormattedMessageTyped,{messageId:o.periodMessageId(l,"components.yieldBreakdown.collateralApy","components.yieldBreakdown.collateralApy7d")}),value:m===null?e.jsx(A.NoValue,{reason:l}):o.formatBreakdownRate(m),subtext:p&&I!==void 0?e.jsx(d.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:c.formatLeverageExact(a),base:o.formatBreakdownRate(I)}}):void 0}),f.map(({reward:t,value:w})=>e.jsx(o.ApyBreakdownRow,{valueTestId:r.StrategyApyBreakdownCardTest.value,captionTestId:r.StrategyApyBreakdownCardTest.caption,label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(d.FormattedMessageTyped,{messageId:"components.apyParts.extraAPY",values:{symbol:t.token.symbol}})}),e.jsx(R.TokenIcon,{token:t.token,symbol:t.token.symbol,size:16,className:"shrink-0"})]}),value:o.formatBreakdownRate(w),subtext:p?e.jsx(d.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:c.formatLeverageExact(a),base:o.formatBreakdownRate(t.supplyApr??0)}}):void 0},`incentive-${t.token.address}-${t.supplyApr??0}`)),e.jsx(o.ApyBreakdownRow,{muted:!0,testId:r.StrategyApyBreakdownCardTest.borrow,valueTestId:r.StrategyApyBreakdownCardTest.value,captionTestId:r.StrategyApyBreakdownCardTest.caption,label:e.jsx(d.FormattedMessageTyped,{messageId:o.periodMessageId(l,"components.yieldBreakdown.borrowRate","components.yieldBreakdown.borrowRate7d")}),value:y===null?e.jsx(A.NoValue,{reason:l}):o.formatBreakdownRate(-y),subtext:p&&s&&b!==void 0?e.jsx(d.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.borrowFormula",values:{leverage:c.formatLeverageExact(a),totalRate:o.formatBreakdownRate(s.borrowApy+b),borrowRate:o.formatBreakdownRate(s.borrowApy)}}):void 0}),T.length>0?e.jsxs(e.Fragment,{children:[e.jsx(o.ApyBreakdownDivider,{}),T.map(t=>e.jsx(o.ApyBreakdownRow,{valueTestId:r.StrategyApyBreakdownCardTest.points,captionTestId:r.StrategyApyBreakdownCardTest.caption,label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(d.FormattedMessageTyped,{messageId:"components.yieldBreakdown.programPoints",values:{name:t.name}})}),e.jsx(C.PointsIcon,{reward:{name:t.name,type:t.id},size:16,className:"shrink-0"})]}),value:t.multiplier!=null?`${c.formatLeverageExact(t.multiplier*a)}×`:o.BREAKDOWN_DASH,subtext:p&&t.multiplier!=null?e.jsx(d.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:c.formatLeverageExact(a),base:c.formatLeverageExact(t.multiplier)}}):void 0},t.id))]}):null]})}exports.StrategyApyBreakdownCardTest=r.StrategyApyBreakdownCardTest;exports.StrategyApyBreakdownCard=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("@gearbox-protocol/sdk/onchain"),o=require("../apy-breakdown-body/apy-breakdown-body.cjs"),A=require("../../no-value/no-value.cjs"),C=require("../../points-icon/points-icon.cjs"),R=require("../../token-icon/token-icon.cjs"),d=require("../../typed-intl/index.cjs"),c=require("../../../utils/format-leverage.cjs"),k=require("../../../utils/internal/apy-breakdown.cjs"),r=require("./constants.cjs");function S(i){const{borrowApyAvg7D:a,quotaRateAvg7D:p,liquidationThreshold:l}=i;return a===void 0||p===void 0?null:{borrowApy:a,quotaRate:p,liquidationThreshold:l}}function _({data:i,leverage:a,showFormula:p=!1,period:l}){const s=S(i),n=s&&i.collateralApyAvg7D?i.collateralApyAvg7D:void 0,B=s!==null&&n!==void 0,v=B&&s&&n?{organicApy:g.calcNetStrategyApy(s,n.organicApy,a),totalApy:g.calcNetStrategyApy(s,n.totalApy??n.organicApy,a),...n.rewards?{rewards:n.rewards}:{}}:null,y=B&&s?g.calcEffectiveBorrowApy(s,a):null,u=v===null?null:k.totalApyOf(v),x=u===null||y===null?null:u+y,j=n?k.positiveTokenRewardsOf(n):[],T=n?k.pointProgramsOf(n):[],f=j.map(t=>({reward:t,value:Math.round(a*(t.supplyApr??0))})),m=x===null?null:x-f.reduce((t,w)=>t+w.value,0),I=m!==null&&a>0?m/a:void 0,b=s&&y!==null&&a>0?(y-s.borrowApy*(a-1))/a:void 0;return e.jsxs(o.ApyBreakdownBody,{testId:r.StrategyApyBreakdownCardTest.root,title:e.jsx(d.FormattedMessageTyped,{messageId:o.periodMessageId(l,"components.yieldBreakdown.titleNetAtLeverage","components.yieldBreakdown.titleNetAtLeverage7d"),values:{leverage:c.formatLeverage(a)}}),chip:u===null?e.jsx(A.NoValue,{reason:l}):o.formatBreakdownRate(u,!0),chipPositive:(u??0)>0,chipTestId:r.StrategyApyBreakdownCardTest.net,children:[e.jsx(o.ApyBreakdownRow,{testId:r.StrategyApyBreakdownCardTest.collateral,valueTestId:r.StrategyApyBreakdownCardTest.value,captionTestId:r.StrategyApyBreakdownCardTest.caption,label:e.jsx(d.FormattedMessageTyped,{messageId:o.periodMessageId(l,"components.yieldBreakdown.collateralApy","components.yieldBreakdown.collateralApy7d")}),value:m===null?e.jsx(A.NoValue,{reason:l}):o.formatBreakdownRate(m),subtext:p&&I!==void 0?e.jsx(d.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:c.formatLeverageExact(a),base:o.formatBreakdownRate(I)}}):void 0}),f.map(({reward:t,value:w})=>e.jsx(o.ApyBreakdownRow,{valueTestId:r.StrategyApyBreakdownCardTest.value,captionTestId:r.StrategyApyBreakdownCardTest.caption,label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(d.FormattedMessageTyped,{messageId:"components.apyParts.extraAPY",values:{symbol:t.token.symbol}})}),e.jsx(R.TokenIcon,{token:t.token,symbol:t.token.symbol,size:16,className:"shrink-0"})]}),value:o.formatBreakdownRate(w),subtext:p?e.jsx(d.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:c.formatLeverageExact(a),base:o.formatBreakdownRate(t.supplyApr??0)}}):void 0},`incentive-${t.token.address}-${t.supplyApr??0}`)),e.jsx(o.ApyBreakdownRow,{muted:!0,testId:r.StrategyApyBreakdownCardTest.borrow,valueTestId:r.StrategyApyBreakdownCardTest.value,captionTestId:r.StrategyApyBreakdownCardTest.caption,label:e.jsx(d.FormattedMessageTyped,{messageId:o.periodMessageId(l,"components.yieldBreakdown.borrowRate","components.yieldBreakdown.borrowRate7d")}),value:y===null?e.jsx(A.NoValue,{reason:l}):o.formatBreakdownRate(y),subtext:p&&s&&b!==void 0?e.jsx(d.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.borrowFormula",values:{leverage:c.formatLeverageExact(a),totalRate:o.formatBreakdownRate(s.borrowApy+b),borrowRate:o.formatBreakdownRate(s.borrowApy)}}):void 0}),T.length>0?e.jsxs(e.Fragment,{children:[e.jsx(o.ApyBreakdownDivider,{}),T.map(t=>e.jsx(o.ApyBreakdownRow,{valueTestId:r.StrategyApyBreakdownCardTest.points,captionTestId:r.StrategyApyBreakdownCardTest.caption,label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(d.FormattedMessageTyped,{messageId:"components.yieldBreakdown.programPoints",values:{name:t.name}})}),e.jsx(C.PointsIcon,{reward:{name:t.name,type:t.id},size:16,className:"shrink-0"})]}),value:t.multiplier!=null?`${c.formatLeverageExact(t.multiplier*a)}×`:o.BREAKDOWN_DASH,subtext:p&&t.multiplier!=null?e.jsx(d.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:c.formatLeverageExact(a),base:c.formatLeverageExact(t.multiplier)}}):void 0},t.id))]}):null]})}exports.StrategyApyBreakdownCardTest=r.StrategyApyBreakdownCardTest;exports.StrategyApyBreakdownCard=_;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("viem"),a=require("../../compound-apy/compound-apy.cjs"),r=require("../../no-value/no-value.cjs"),c=require("../../tooltip/simple-tooltip.cjs");require("../../tooltip/tooltip.cjs");const p=require("../../../utils/cn.cjs"),d=require("../../../utils/format-leverage.cjs"),m=require("../../../utils/format-money.cjs");require("@gearbox-protocol/sdk/onchain");require("../../../utils/z-index.cjs");const V=require("../../../utils/internal/format-asset-amount.cjs"),u=require("../../../utils/internal/format-bps.cjs"),s=require("./constants.cjs");function f({data:e,tooltip:n=!0,period:i}){return e===void 0?t.jsx(r.NoValue,{reason:i}):typeof e=="number"?t.jsx("span",{"data-testid":s.ValueTest.apy,children:u.bps(e)}):t.jsx("span",{"data-testid":s.ValueTest.apy,children:t.jsx(a.CompoundAPY,{apy:e,tooltip:n,period:i})})}function x({data:e}){return e==null?t.jsx(r.NoValue,{}):t.jsx("span",{"data-testid":s.ValueTest.usd,children:m.formatMoney(e)})}function j({data:e}){return e===void 0?t.jsx(r.NoValue,{}):t.jsx("span",{"data-testid":s.ValueTest.leverage,children:`${d.formatLeverage(e)}x`})}function v({data:e}){return e===void 0?t.jsx(r.NoValue,{}):t.jsx("span",{"data-testid":s.ValueTest.utilization,children:u.bps(e)})}function _({data:e}){if(e===void 0)return t.jsx(r.NoValue,{});const n=e<1e4?"text-destructive":e<11e3?"text-warning":"text-success";return t.jsx("span",{"data-testid":s.ValueTest.healthFactor,className:p.cn(n),children:(e/1e4).toFixed(2)})}function h({data:e,token:n,showSymbol:i=!0}){if(e===void 0||n===void 0)return t.jsx(r.NoValue,{});const o=l.formatUnits(e,n.decimals);return t.jsxs("span",{"data-testid":s.ValueTest.tokenBigint,title:`${o} ${n.symbol}`,children:[t.jsx(c.SimpleTooltip,{placement:"top",className:"break-all",title:t.jsx("span",{children:V.formatAssetAmount(e,n.decimals)}),children:t.jsx("span",{children:o})}),i&&` ${n.symbol}`]})}exports.ApyValue=f;exports.HealthFactorValue=_;exports.LeverageValue=j;exports.TokenBigint=h;exports.UsdValue=x;exports.UtilizationValue=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("viem"),a=require("../../compound-apy/compound-apy.cjs"),i=require("../../no-value/no-value.cjs"),c=require("../../tooltip/simple-tooltip.cjs");require("../../tooltip/tooltip.cjs");const p=require("../../../utils/cn.cjs"),d=require("../../../utils/format-leverage.cjs"),m=require("../../../utils/format-money.cjs");require("@gearbox-protocol/sdk/onchain");require("../../../utils/z-index.cjs");const V=require("../../../utils/internal/format-asset-amount.cjs"),u=require("../../../utils/internal/format-bps.cjs"),s=require("./constants.cjs");function f({data:e,tooltip:n=!0,period:r}){return e===void 0?t.jsx(i.NoValue,{reason:r}):typeof e=="number"?t.jsx("span",{"data-testid":s.ValueTest.apy,children:u.bps(e)}):t.jsx("span",{"data-testid":s.ValueTest.apy,children:t.jsx(a.CompoundAPY,{apy:e,tooltip:n,period:r})})}function x({data:e}){return e==null?t.jsx(i.NoValue,{}):t.jsx("span",{"data-testid":s.ValueTest.usd,children:m.formatMoney(e)})}function j({data:e}){return e===void 0?t.jsx(i.NoValue,{}):t.jsx("span",{"data-testid":s.ValueTest.leverage,children:`${d.formatLeverage(e)}x`})}function v({data:e}){return e===void 0?t.jsx(i.NoValue,{}):t.jsx("span",{"data-testid":s.ValueTest.utilization,children:u.bps(e)})}function _({data:e,debt:n}){if(e===void 0)return t.jsx(i.NoValue,{});const r=n===0n?void 0:e<1e4?"text-destructive":e<11e3?"text-warning":"text-success";return t.jsx("span",{"data-testid":s.ValueTest.healthFactor,className:p.cn(r),children:(e/1e4).toFixed(2)})}function h({data:e,token:n,showSymbol:r=!0}){if(e===void 0||n===void 0)return t.jsx(i.NoValue,{});const o=l.formatUnits(e,n.decimals);return t.jsxs("span",{"data-testid":s.ValueTest.tokenBigint,title:`${o} ${n.symbol}`,children:[t.jsx(c.SimpleTooltip,{placement:"top",className:"break-all",title:t.jsx("span",{children:V.formatAssetAmount(e,n.decimals)}),children:t.jsx("span",{children:o})}),r&&` ${n.symbol}`]})}exports.ApyValue=f;exports.HealthFactorValue=_;exports.LeverageValue=j;exports.TokenBigint=h;exports.UsdValue=x;exports.UtilizationValue=v;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("../base/apy-breakdown-body/apy-breakdown-body.cjs"),B=require("../base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs"),g=require("../points-icon/points-icon.cjs"),x=require("../token-icon/token-icon.cjs"),l=require("../typed-intl/index.cjs"),j=require("../../utils/format-leverage.cjs"),w=require("../../utils/internal/apy-breakdown.cjs"),A=require("./yield-breakdown-tooltip.cjs");function v({supplyApy:a,maxLeverage:r,collateralApy:m,borrowApy:d,quotaRate:i,period:s,children:t,className:p,open:y}){const c=r!==void 0&&r>0;return e.jsx(A.ApyBreakdownTooltip,{placement:"bottom",title:e.jsx("span",{className:p,children:t}),triggerClassName:p,open:y,children:c?e.jsx(_,{supplyApy:a,maxLeverage:r,collateralApy:m,borrowApy:d,quotaRate:i,period:s}):e.jsx(B.PoolApyBreakdownCard,{data:a,period:s})})}function _({supplyApy:a,maxLeverage:r,collateralApy:m,borrowApy:d,quotaRate:i,period:s}){const t=m,p=t?w.tokenRewardsOf(t):[],y=w.pointProgramsOf(a),c=w.totalApyOf(a),u=d!=null||i!=null?-((d??0)+(i??0)):void 0,k=y.filter(o=>o.multiplier!=null);return e.jsxs(n.ApyBreakdownBody,{title:e.jsx(l.FormattedMessageTyped,{messageId:n.periodMessageId(s,"components.yieldBreakdown.titleNetAtLeverage","components.yieldBreakdown.titleNetAtLeverage7d"),values:{leverage:j.formatLeverage(r)}}),chip:n.formatBreakdownRate(c),chipPositive:c>0,children:[t?.organicApy!=null?e.jsx(n.ApyBreakdownRow,{muted:t.organicApy<0,label:e.jsx(l.FormattedMessageTyped,{messageId:n.periodMessageId(s,"components.yieldBreakdown.collateralApy","components.yieldBreakdown.collateralApy7d")}),value:n.formatBreakdownRate(t.organicApy)}):null,p.map(o=>o.supplyApr==null?null:e.jsx(n.ApyBreakdownRow,{muted:o.supplyApr<0,label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(l.FormattedMessageTyped,{messageId:"components.apyParts.extraAPY",values:{symbol:o.token.symbol}})}),e.jsx(x.TokenIcon,{token:o.token,size:20})]}),value:n.formatBreakdownRate(o.supplyApr)},`incentive-${o.token.address}-${o.supplyApr}`)),u!=null?e.jsx(n.ApyBreakdownRow,{muted:u<0,label:e.jsx(l.FormattedMessageTyped,{messageId:n.periodMessageId(s,"components.yieldBreakdown.borrowRate","components.yieldBreakdown.borrowRate7d")}),value:n.formatBreakdownRate(u)}):null,k.length>0?e.jsxs(e.Fragment,{children:[e.jsx(n.ApyBreakdownDivider,{}),k.map(o=>e.jsx(n.ApyBreakdownRow,{label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(l.FormattedMessageTyped,{messageId:"components.yieldBreakdown.programPoints",values:{name:o.name}})}),e.jsx(g.PointsIcon,{reward:{name:o.name,type:o.id},size:20})]}),value:`${o.multiplier}×`},`points-${o.id}`))]}):null]})}exports.YieldBreakdownTooltip=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("../base/apy-breakdown-body/apy-breakdown-body.cjs"),B=require("../base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs"),g=require("../points-icon/points-icon.cjs"),x=require("../token-icon/token-icon.cjs"),l=require("../typed-intl/index.cjs"),j=require("../../utils/format-leverage.cjs"),u=require("../../utils/internal/apy-breakdown.cjs"),A=require("./yield-breakdown-tooltip.cjs");function v({supplyApy:a,maxLeverage:r,collateralApy:m,borrowApy:d,quotaRate:i,period:s,children:t,className:p,open:y}){const c=r!==void 0&&r>0;return e.jsx(A.ApyBreakdownTooltip,{placement:"bottom",title:e.jsx("span",{className:p,children:t}),triggerClassName:p,open:y,children:c?e.jsx(_,{supplyApy:a,maxLeverage:r,collateralApy:m,borrowApy:d,quotaRate:i,period:s}):e.jsx(B.PoolApyBreakdownCard,{data:a,period:s})})}function _({supplyApy:a,maxLeverage:r,collateralApy:m,borrowApy:d,quotaRate:i,period:s}){const t=m,p=t?u.tokenRewardsOf(t):[],y=u.pointProgramsOf(a),c=u.totalApyOf(a),w=d!=null||i!=null?(d??0)+(i??0):void 0,k=y.filter(o=>o.multiplier!=null);return e.jsxs(n.ApyBreakdownBody,{title:e.jsx(l.FormattedMessageTyped,{messageId:n.periodMessageId(s,"components.yieldBreakdown.titleNetAtLeverage","components.yieldBreakdown.titleNetAtLeverage7d"),values:{leverage:j.formatLeverage(r)}}),chip:n.formatBreakdownRate(c,!0),chipPositive:c>0,children:[t?.organicApy!=null?e.jsx(n.ApyBreakdownRow,{muted:t.organicApy<0,label:e.jsx(l.FormattedMessageTyped,{messageId:n.periodMessageId(s,"components.yieldBreakdown.collateralApy","components.yieldBreakdown.collateralApy7d")}),value:n.formatBreakdownRate(t.organicApy)}):null,p.map(o=>o.supplyApr==null?null:e.jsx(n.ApyBreakdownRow,{muted:o.supplyApr<0,label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(l.FormattedMessageTyped,{messageId:"components.apyParts.extraAPY",values:{symbol:o.token.symbol}})}),e.jsx(x.TokenIcon,{token:o.token,size:20})]}),value:n.formatBreakdownRate(o.supplyApr)},`incentive-${o.token.address}-${o.supplyApr}`)),w!=null?e.jsx(n.ApyBreakdownRow,{muted:!0,label:e.jsx(l.FormattedMessageTyped,{messageId:n.periodMessageId(s,"components.yieldBreakdown.borrowRate","components.yieldBreakdown.borrowRate7d")}),value:n.formatBreakdownRate(w)}):null,k.length>0?e.jsxs(e.Fragment,{children:[e.jsx(n.ApyBreakdownDivider,{}),k.map(o=>e.jsx(n.ApyBreakdownRow,{label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(l.FormattedMessageTyped,{messageId:"components.yieldBreakdown.programPoints",values:{name:o.name}})}),e.jsx(g.PointsIcon,{reward:{name:o.name,type:o.id},size:20})]}),value:`${o.multiplier}×`},`points-${o.id}`))]}):null]})}exports.YieldBreakdownTooltip=v;
@@ -1,19 +1,19 @@
1
- import { jsxs as a, jsx as s } from "react/jsx-runtime";
2
- import { cn as i } from "../../../utils/cn.js";
1
+ import { jsxs as a, jsx as d } from "react/jsx-runtime";
2
+ import { cn as l } from "../../../utils/cn.js";
3
3
  import { bpsToPercent as c } from "../../../utils/internal/bps-to-percent.js";
4
4
  const x = "—", p = "400px";
5
- function g(n, t, e) {
6
- return n === "7d" ? e : t;
5
+ function g(t, n, e) {
6
+ return t === "7d" ? e : n;
7
7
  }
8
- function b(n) {
9
- const t = c(n), e = `${Math.abs(t).toFixed(2)}%`;
10
- return t < 0 ? `−${e}` : e;
8
+ function b(t, n = !1) {
9
+ const e = c(t), s = `${Math.abs(e).toFixed(2)}%`;
10
+ return n && e < 0 ? `−${s}` : s;
11
11
  }
12
12
  function h({
13
- title: n,
14
- chip: t,
13
+ title: t,
14
+ chip: n,
15
15
  chipPositive: e = !1,
16
- chipTestId: d,
16
+ chipTestId: s,
17
17
  children: r,
18
18
  testId: o
19
19
  }) {
@@ -24,32 +24,32 @@ function h({
24
24
  "data-testid": o,
25
25
  children: [
26
26
  /* @__PURE__ */ a("div", { className: "flex min-h-6 items-center justify-between gap-3", children: [
27
- /* @__PURE__ */ s("span", { className: "min-w-0 text-base font-semibold leading-5 text-foreground", children: n }),
28
- /* @__PURE__ */ s(
27
+ /* @__PURE__ */ d("span", { className: "min-w-0 text-base font-semibold leading-5 text-foreground", children: t }),
28
+ /* @__PURE__ */ d(
29
29
  "span",
30
30
  {
31
- className: i(
31
+ className: l(
32
32
  "shrink-0 rounded-md px-2 py-0.5 text-sm font-semibold tabular-nums",
33
33
  e ? "bg-success/20 text-success" : "bg-muted text-muted-foreground"
34
34
  ),
35
- "data-testid": d,
36
- children: t
35
+ "data-testid": s,
36
+ children: n
37
37
  }
38
38
  )
39
39
  ] }),
40
- /* @__PURE__ */ s("div", { className: "flex flex-col gap-3", children: r })
40
+ /* @__PURE__ */ d("div", { className: "flex flex-col gap-3", children: r })
41
41
  ]
42
42
  }
43
43
  );
44
44
  }
45
45
  function N({
46
- label: n,
47
- value: t,
46
+ label: t,
47
+ value: n,
48
48
  subtext: e,
49
- muted: d = !1,
49
+ muted: s = !1,
50
50
  testId: r,
51
51
  valueTestId: o,
52
- captionTestId: l
52
+ captionTestId: i
53
53
  }) {
54
54
  return /* @__PURE__ */ a(
55
55
  "div",
@@ -57,33 +57,33 @@ function N({
57
57
  className: "flex items-start justify-between gap-3",
58
58
  "data-testid": r,
59
59
  children: [
60
- /* @__PURE__ */ s(
60
+ /* @__PURE__ */ d(
61
61
  "span",
62
62
  {
63
- className: i(
63
+ className: l(
64
64
  "min-w-0 text-sm font-semibold leading-5",
65
- d ? "text-muted-foreground" : "text-foreground"
65
+ s ? "text-muted-foreground" : "text-foreground"
66
66
  ),
67
- children: n
67
+ children: t
68
68
  }
69
69
  ),
70
70
  /* @__PURE__ */ a("span", { className: "flex shrink-0 flex-col items-end", children: [
71
- /* @__PURE__ */ s(
71
+ /* @__PURE__ */ d(
72
72
  "span",
73
73
  {
74
- className: i(
74
+ className: l(
75
75
  "text-sm font-semibold leading-5 tabular-nums",
76
- d ? "text-muted-foreground" : "text-foreground"
76
+ s ? "text-muted-foreground" : "text-foreground"
77
77
  ),
78
78
  "data-testid": o,
79
- children: t
79
+ children: n
80
80
  }
81
81
  ),
82
- e != null ? /* @__PURE__ */ s(
82
+ e != null ? /* @__PURE__ */ d(
83
83
  "span",
84
84
  {
85
85
  className: "text-xs leading-4 text-muted-foreground",
86
- "data-testid": l,
86
+ "data-testid": i,
87
87
  children: e
88
88
  }
89
89
  ) : null
@@ -93,7 +93,7 @@ function N({
93
93
  );
94
94
  }
95
95
  function w() {
96
- return /* @__PURE__ */ s("div", { className: "h-px w-full bg-divider" });
96
+ return /* @__PURE__ */ d("div", { className: "h-px w-full bg-divider" });
97
97
  }
98
98
  export {
99
99
  p as APY_BREAKDOWN_TOOLTIP_WIDTH,
@@ -25,7 +25,7 @@ function D({
25
25
  )
26
26
  }
27
27
  ),
28
- chip: m == null ? /* @__PURE__ */ e(d, { reason: s }) : t(m),
28
+ chip: m == null ? /* @__PURE__ */ e(d, { reason: s }) : t(m, !0),
29
29
  chipPositive: (m ?? 0) > 0,
30
30
  chipTestId: a.net,
31
31
  children: [
@@ -53,7 +53,7 @@ function U({
53
53
  values: { leverage: E(t) }
54
54
  }
55
55
  ),
56
- chip: u === null ? /* @__PURE__ */ e(k, { reason: r }) : i(u),
56
+ chip: u === null ? /* @__PURE__ */ e(k, { reason: r }) : i(u, !0),
57
57
  chipPositive: (u ?? 0) > 0,
58
58
  chipTestId: n.net,
59
59
  children: [
@@ -140,7 +140,7 @@ function U({
140
140
  )
141
141
  }
142
142
  ),
143
- value: p === null ? /* @__PURE__ */ e(k, { reason: r }) : i(-p),
143
+ value: p === null ? /* @__PURE__ */ e(k, { reason: r }) : i(p),
144
144
  subtext: d && a && x !== void 0 ? /* @__PURE__ */ e(
145
145
  s,
146
146
  {
@@ -151,9 +151,6 @@ function U({
151
151
  // interest plus the quota, added before either is rounded, so
152
152
  // the caption is not the sum of two figures it also printed.
153
153
  totalRate: i(a.borrowApy + x),
154
- // Magnitudes, not signed rates: the row above already carries
155
- // the minus, and `− −0.88%` reads as arithmetic to decode
156
- // rather than a cost to understand.
157
154
  borrowRate: i(a.borrowApy)
158
155
  }
159
156
  }
@@ -1,7 +1,7 @@
1
1
  import { jsx as r, jsxs as l } from "react/jsx-runtime";
2
2
  import { formatUnits as u } from "viem";
3
3
  import { CompoundAPY as p } from "../../compound-apy/compound-apy.js";
4
- import { NoValue as n } from "../../no-value/no-value.js";
4
+ import { NoValue as o } from "../../no-value/no-value.js";
5
5
  import { SimpleTooltip as a } from "../../tooltip/simple-tooltip.js";
6
6
  import "../../tooltip/tooltip.js";
7
7
  import { cn as f } from "../../../utils/cn.js";
@@ -15,40 +15,41 @@ import { ValueTest as i } from "./constants.js";
15
15
  function B({
16
16
  data: t,
17
17
  tooltip: e = !0,
18
- period: o
18
+ period: n
19
19
  }) {
20
- return t === void 0 ? /* @__PURE__ */ r(n, { reason: o }) : typeof t == "number" ? /* @__PURE__ */ r("span", { "data-testid": i.apy, children: m(t) }) : /* @__PURE__ */ r("span", { "data-testid": i.apy, children: /* @__PURE__ */ r(p, { apy: t, tooltip: e, period: o }) });
20
+ return t === void 0 ? /* @__PURE__ */ r(o, { reason: n }) : typeof t == "number" ? /* @__PURE__ */ r("span", { "data-testid": i.apy, children: m(t) }) : /* @__PURE__ */ r("span", { "data-testid": i.apy, children: /* @__PURE__ */ r(p, { apy: t, tooltip: e, period: n }) });
21
21
  }
22
22
  function L({
23
23
  data: t
24
24
  }) {
25
- return t == null ? /* @__PURE__ */ r(n, {}) : /* @__PURE__ */ r("span", { "data-testid": i.usd, children: d(t) });
25
+ return t == null ? /* @__PURE__ */ r(o, {}) : /* @__PURE__ */ r("span", { "data-testid": i.usd, children: d(t) });
26
26
  }
27
27
  function w({
28
28
  data: t
29
29
  }) {
30
- return t === void 0 ? /* @__PURE__ */ r(n, {}) : /* @__PURE__ */ r("span", { "data-testid": i.leverage, children: `${c(t)}x` });
30
+ return t === void 0 ? /* @__PURE__ */ r(o, {}) : /* @__PURE__ */ r("span", { "data-testid": i.leverage, children: `${c(t)}x` });
31
31
  }
32
32
  function C({
33
33
  data: t
34
34
  }) {
35
- return t === void 0 ? /* @__PURE__ */ r(n, {}) : /* @__PURE__ */ r("span", { "data-testid": i.utilization, children: m(t) });
35
+ return t === void 0 ? /* @__PURE__ */ r(o, {}) : /* @__PURE__ */ r("span", { "data-testid": i.utilization, children: m(t) });
36
36
  }
37
37
  function H({
38
- data: t
38
+ data: t,
39
+ debt: e
39
40
  }) {
40
41
  if (t === void 0)
41
- return /* @__PURE__ */ r(n, {});
42
- const e = t < 1e4 ? "text-destructive" : t < 11e3 ? "text-warning" : "text-success";
43
- return /* @__PURE__ */ r("span", { "data-testid": i.healthFactor, className: f(e), children: (t / 1e4).toFixed(2) });
42
+ return /* @__PURE__ */ r(o, {});
43
+ const n = e === 0n ? void 0 : t < 1e4 ? "text-destructive" : t < 11e3 ? "text-warning" : "text-success";
44
+ return /* @__PURE__ */ r("span", { "data-testid": i.healthFactor, className: f(n), children: (t / 1e4).toFixed(2) });
44
45
  }
45
46
  function M({
46
47
  data: t,
47
48
  token: e,
48
- showSymbol: o = !0
49
+ showSymbol: n = !0
49
50
  }) {
50
51
  if (t === void 0 || e === void 0)
51
- return /* @__PURE__ */ r(n, {});
52
+ return /* @__PURE__ */ r(o, {});
52
53
  const s = u(t, e.decimals);
53
54
  return (
54
55
  // `title` also keeps the amount where a hover tooltip cannot reach:
@@ -64,7 +65,7 @@ function M({
64
65
  children: /* @__PURE__ */ r("span", { children: s })
65
66
  }
66
67
  ),
67
- o && ` ${e.symbol}`
68
+ n && ` ${e.symbol}`
68
69
  ] })
69
70
  );
70
71
  }
@@ -1,5 +1,5 @@
1
1
  import { jsx as e, jsxs as p, Fragment as B } from "react/jsx-runtime";
2
- import { ApyBreakdownBody as A, formatBreakdownRate as c, ApyBreakdownRow as u, periodMessageId as k, ApyBreakdownDivider as v } from "../base/apy-breakdown-body/apy-breakdown-body.js";
2
+ import { ApyBreakdownBody as A, formatBreakdownRate as c, ApyBreakdownRow as u, periodMessageId as w, ApyBreakdownDivider as v } from "../base/apy-breakdown-body/apy-breakdown-body.js";
3
3
  import { PoolApyBreakdownCard as h } from "../base/pool-apy-breakdown-card/pool-apy-breakdown-card.js";
4
4
  import { PointsIcon as b } from "../points-icon/points-icon.js";
5
5
  import { TokenIcon as I } from "../token-icon/token-icon.js";
@@ -48,14 +48,14 @@ function $({
48
48
  quotaRate: i,
49
49
  period: t
50
50
  }) {
51
- const n = y, d = n ? R(n) : [], g = T(l), m = x(l), w = s != null || i != null ? -((s ?? 0) + (i ?? 0)) : void 0, f = g.filter((o) => o.multiplier != null);
51
+ const n = y, d = n ? R(n) : [], g = T(l), m = x(l), k = s != null || i != null ? (s ?? 0) + (i ?? 0) : void 0, f = g.filter((o) => o.multiplier != null);
52
52
  return /* @__PURE__ */ p(
53
53
  A,
54
54
  {
55
55
  title: /* @__PURE__ */ e(
56
56
  a,
57
57
  {
58
- messageId: k(
58
+ messageId: w(
59
59
  t,
60
60
  "components.yieldBreakdown.titleNetAtLeverage",
61
61
  "components.yieldBreakdown.titleNetAtLeverage7d"
@@ -63,7 +63,7 @@ function $({
63
63
  values: { leverage: P(r) }
64
64
  }
65
65
  ),
66
- chip: c(m),
66
+ chip: c(m, !0),
67
67
  chipPositive: m > 0,
68
68
  children: [
69
69
  n?.organicApy != null ? /* @__PURE__ */ e(
@@ -73,7 +73,7 @@ function $({
73
73
  label: /* @__PURE__ */ e(
74
74
  a,
75
75
  {
76
- messageId: k(
76
+ messageId: w(
77
77
  t,
78
78
  "components.yieldBreakdown.collateralApy",
79
79
  "components.yieldBreakdown.collateralApy7d"
@@ -103,21 +103,21 @@ function $({
103
103
  `incentive-${o.token.address}-${o.supplyApr}`
104
104
  )
105
105
  ),
106
- w != null ? /* @__PURE__ */ e(
106
+ k != null ? /* @__PURE__ */ e(
107
107
  u,
108
108
  {
109
- muted: w < 0,
109
+ muted: !0,
110
110
  label: /* @__PURE__ */ e(
111
111
  a,
112
112
  {
113
- messageId: k(
113
+ messageId: w(
114
114
  t,
115
115
  "components.yieldBreakdown.borrowRate",
116
116
  "components.yieldBreakdown.borrowRate7d"
117
117
  )
118
118
  }
119
119
  ),
120
- value: c(w)
120
+ value: c(k)
121
121
  }
122
122
  ) : null,
123
123
  f.length > 0 ? /* @__PURE__ */ p(B, { children: [
@@ -6,13 +6,16 @@ export declare const BREAKDOWN_DASH = "\u2014";
6
6
  export declare const APY_BREAKDOWN_TOOLTIP_WIDTH = "400px";
7
7
  export declare function periodMessageId(period: "7d" | undefined, base: LocaleKeys, with7d: LocaleKeys): LocaleKeys;
8
8
  /**
9
- * A rate as the rows write it: two decimals, and a real minus sign.
9
+ * A rate as the rows write it: two decimals, magnitude only.
10
10
  *
11
11
  * Two decimals at every scale, unlike the compact form the rest of the kit
12
12
  * uses above 1000%. A breakdown is read by adding it up, and `1.2K%` carries
13
13
  * three significant figures — enough to make a correct column look wrong.
14
+ *
15
+ * `signed` is for the net chip, the one figure whose direction is not already
16
+ * stated by the row it sits on.
14
17
  */
15
- export declare function formatBreakdownRate(value: Bps): string;
18
+ export declare function formatBreakdownRate(value: Bps, signed?: boolean): string;
16
19
  export interface ApyBreakdownBodyProps {
17
20
  /** Heading to the left of the chip — "Net APY (7d)" and the like. */
18
21
  readonly title: React.ReactNode;
@@ -36,9 +36,19 @@ export declare function LeverageValue({ data, }: {
36
36
  export declare function UtilizationValue({ data, }: {
37
37
  readonly data: Bps | undefined;
38
38
  }): React.ReactElement;
39
- /** Health factor with its zone: below 1 the account is liquidatable. */
40
- export declare function HealthFactorValue({ data, }: {
39
+ /**
40
+ * Health factor with its zone: below 1 the account is liquidatable.
41
+ *
42
+ * Pass `debt` wherever a repaid account can reach this: with nothing to
43
+ * liquidate the figure has no zone, and the SDK reports one that would read as
44
+ * the worst there is — `0` bps from the on-chain `MAX_UINT256` sentinel, or
45
+ * `65535` down the price-failed path. The figure still shows; only the colour
46
+ * goes. ({@link HealthFactor}, the block, takes the same prop and answers
47
+ * "N/A" instead — a table cell that blanks out loses its column's alignment.)
48
+ */
49
+ export declare function HealthFactorValue({ data, debt, }: {
41
50
  readonly data: Bps | undefined;
51
+ readonly debt?: bigint;
42
52
  }): React.ReactElement;
43
53
  /**
44
54
  * A bare `bigint` in token units (simulate previews carry these): the only
@@ -20,7 +20,7 @@ export interface YieldBreakdownTooltipProps {
20
20
  * to {@link supplyApy} when omitted.
21
21
  */
22
22
  collateralApy?: ApyBreakdown;
23
- /** Strategy base borrow cost in bps (shown as a negative rate). */
23
+ /** Strategy base borrow cost in bps (the row prints its magnitude). */
24
24
  borrowApy?: Bps;
25
25
  /** Strategy quota rate in bps, at 1x (folded into Borrow Rate). */
26
26
  quotaRate?: Bps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/ui-kit",
3
- "version": "4.0.0-next.71",
3
+ "version": "4.0.0-next.76",
4
4
  "description": "Internal UI components",
5
5
  "repository": {
6
6
  "type": "git",
@@ -162,7 +162,7 @@
162
162
  "biome check --no-errors-on-unmatched --write"
163
163
  ]
164
164
  },
165
- "packageManager": "pnpm@10.4.1+sha512.c753b6c3ad7afa13af388fa6d808035a008e30ea9993f58c6663e2bc5ff21679aa834db094987129aa4d488b86df57f7b634981b2f827cdcacc698cc0cfb88af",
165
+ "packageManager": "pnpm@12.3.1",
166
166
  "browserslist": [
167
167
  ">0.3%",
168
168
  "not dead",
@@ -171,15 +171,5 @@
171
171
  "Firefox >= 80",
172
172
  "Safari >= 13",
173
173
  "Edge >= 80"
174
- ],
175
- "pnpm": {
176
- "onlyBuiltDependencies": [
177
- "bufferutil",
178
- "esbuild",
179
- "keccak",
180
- "secp256k1",
181
- "sharp",
182
- "utf-8-validate"
183
- ]
184
- }
174
+ ]
185
175
  }