@gearbox-protocol/ui-kit 4.5.2 → 4.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/base/apy-breakdown-body/apy-breakdown-body.cjs +1 -1
- package/dist/cjs/components/base/apy-breakdown-body/index.cjs +1 -1
- package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
- package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/link/link.cjs +1 -1
- package/dist/cjs/components/yield-breakdown-tooltip/yield-breakdown.cjs +1 -1
- package/dist/esm/components/base/apy-breakdown-body/apy-breakdown-body.js +70 -45
- package/dist/esm/components/base/apy-breakdown-body/index.js +8 -7
- package/dist/esm/components/base/info-list/info-list.js +14 -13
- package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +68 -64
- package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +109 -105
- package/dist/esm/components/compound-apy/compound-apy.js +22 -20
- package/dist/esm/components/link/link.js +14 -14
- package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown.js +92 -79
- package/dist/types/components/base/apy-breakdown-body/apy-breakdown-body.d.ts +5 -0
- package/dist/types/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.d.ts +3 -1
- package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts +3 -1
- package/dist/types/components/compound-apy/compound-apy.d.ts +3 -1
- package/dist/types/components/yield-breakdown-tooltip/yield-breakdown.d.ts +3 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),c=require("react"),u=require("../../link/link.cjs"),d=require("../../../utils/cn.cjs"),i=require("../../../utils/internal/bps-to-percent.cjs"),m="—",x="400px";function f(s,e,t){return s==="7d"?t:e}function p(s,e=!1){const t=i.bpsToPercent(s),r=`${Math.abs(t).toFixed(2)}%`;return e&&t<0?`−${r}`:r}function g(s){return Number(Math.abs(i.bpsToPercent(s)).toFixed(2))}function b({title:s,chip:e,chipPositive:t=!1,chipTestId:r,children:a,testId:o}){return n.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-4 rounded-xl border border-border bg-card p-4","data-testid":o,children:[n.jsxs("div",{className:"flex min-h-6 items-center justify-between gap-3",children:[n.jsx("span",{className:"min-w-0 text-base font-semibold leading-5 text-foreground",children:s}),n.jsx("span",{className:d.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":r,children:e})]}),n.jsx("div",{className:"flex flex-col gap-3",children:a})]})}function w({label:s,value:e,subtext:t,muted:r=!1,testId:a,valueTestId:o,captionTestId:l}){return n.jsxs("div",{className:"flex items-start justify-between gap-3","data-testid":a,children:[n.jsx("span",{className:d.cn("min-w-0 text-sm font-semibold leading-5",r?"text-muted-foreground":"text-foreground"),children:s}),n.jsxs("span",{className:"flex shrink-0 flex-col items-end",children:[n.jsx("span",{className:d.cn("text-sm font-semibold leading-5 tabular-nums",r?"text-muted-foreground":"text-foreground"),"data-testid":o,children:e}),t!=null?n.jsx("span",{className:"text-xs leading-4 text-muted-foreground","data-testid":l,children:t}):null]})]})}function h(s){let e;try{e=new URL(s)}catch{return}if(!(e.protocol!=="https:"&&e.protocol!=="http:"))return e.hostname.split(".").slice(-2).join(".")}function j({links:s}){const e=(s??[]).flatMap(t=>{const r=h(t);return r?[{href:t,domain:r}]:[]});return e.length===0?null:n.jsx("span",{className:"block text-xs font-normal leading-4 text-muted-foreground",children:e.map(({href:t,domain:r},a)=>n.jsxs(c.Fragment,{children:[a>0?", ":null,n.jsx(u.Link,{href:t,external:!0,size:"unset",color:"secondary",children:r})]},t))})}function k(){return n.jsx("div",{className:"h-px w-full bg-divider"})}exports.APY_BREAKDOWN_TOOLTIP_WIDTH=x;exports.ApyBreakdownBody=b;exports.ApyBreakdownDivider=k;exports.ApyBreakdownRow=w;exports.BREAKDOWN_DASH=m;exports.RewardLinks=j;exports.breakdownRateValue=g;exports.formatBreakdownRate=p;exports.periodMessageId=f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./apy-breakdown-body.cjs");exports.APY_BREAKDOWN_TOOLTIP_WIDTH=e.APY_BREAKDOWN_TOOLTIP_WIDTH;exports.ApyBreakdownBody=e.ApyBreakdownBody;exports.ApyBreakdownDivider=e.ApyBreakdownDivider;exports.ApyBreakdownRow=e.ApyBreakdownRow;exports.BREAKDOWN_DASH=e.BREAKDOWN_DASH;exports.breakdownRateValue=e.breakdownRateValue;exports.formatBreakdownRate=e.formatBreakdownRate;exports.periodMessageId=e.periodMessageId;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./apy-breakdown-body.cjs");exports.APY_BREAKDOWN_TOOLTIP_WIDTH=e.APY_BREAKDOWN_TOOLTIP_WIDTH;exports.ApyBreakdownBody=e.ApyBreakdownBody;exports.ApyBreakdownDivider=e.ApyBreakdownDivider;exports.ApyBreakdownRow=e.ApyBreakdownRow;exports.BREAKDOWN_DASH=e.BREAKDOWN_DASH;exports.RewardLinks=e.RewardLinks;exports.breakdownRateValue=e.breakdownRateValue;exports.formatBreakdownRate=e.formatBreakdownRate;exports.periodMessageId=e.periodMessageId;
|
|
@@ -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"),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:
|
|
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");require("../../link/link.cjs");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:s="sm",align:i="start","data-testid":n=r.InfoListTest.line,...a}){const c=l.useTitleText();return e.jsx(f.VerticalIndicator,{label:c(t),size:s,align:i,"data-testid":n,...a})}function m({data:t,title:s="components.yieldBreakdown.points"}){const i=t?p.pointProgramsOf(t):[];return i.length===0?null:e.jsx(o,{title:s,value:e.jsx("span",{className:"inline-flex flex-wrap items-center gap-1.5","data-testid":q.ValueTest.points,children:i.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 e=require("react/jsx-runtime"),o=require("../apy-breakdown-body/apy-breakdown-body.cjs"),
|
|
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"),d=require("../../no-value/no-value.cjs"),k=require("../../points-icon/points-icon.cjs"),u=require("../../token-icon/token-icon.cjs"),t=require("../../typed-intl/index.cjs"),p=require("../../../utils/internal/apy-breakdown.cjs"),r=require("./constants.cjs");function w({data:s,period:a,hideRewardLinks:m=!1}){const l=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:r.PoolApyBreakdownCardTest.root,title:e.jsx(t.FormattedMessageTyped,{messageId:o.periodMessageId(a,"components.poolApyBreakdownCard.title","components.poolApyBreakdownCard.title7d")}),chip:l==null?e.jsx(d.NoValue,{reason:a}):o.formatBreakdownRate(l,!0),chipPositive:(l??0)>0,chipTestId:r.PoolApyBreakdownCardTest.net,children:[e.jsx(o.ApyBreakdownRow,{valueTestId:r.PoolApyBreakdownCardTest.value,label:e.jsx(t.FormattedMessageTyped,{messageId:o.periodMessageId(a,"components.poolApyBreakdownCard.organicApy","components.poolApyBreakdownCard.organicApy7d")}),value:i==null?e.jsx(d.NoValue,{reason:a}):o.formatBreakdownRate(i)}),c.length>0?c.map(n=>e.jsx(o.ApyBreakdownRow,{valueTestId:r.PoolApyBreakdownCardTest.value,label:e.jsxs("span",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(t.FormattedMessageTyped,{messageId:o.periodMessageId(a,"components.poolApyBreakdownCard.tokenIncentiveApy","components.poolApyBreakdownCard.tokenIncentiveApy7d"),values:{symbol:n.token.symbol}})}),e.jsx(u.TokenIcon,{token:n.token,symbol:n.token.symbol,size:16,className:"shrink-0"})]}),m?null:e.jsx(o.RewardLinks,{links:n.links})]}),value:o.formatBreakdownRate(n.supplyApr??0)},`incentive-${n.token.address}`)):e.jsx(o.ApyBreakdownRow,{valueTestId:r.PoolApyBreakdownCardTest.value,label:e.jsx(t.FormattedMessageTyped,{messageId:o.periodMessageId(a,"components.poolApyBreakdownCard.incentiveApy","components.poolApyBreakdownCard.incentiveApy7d")}),value:s==null?e.jsx(d.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:r.PoolApyBreakdownCardTest.points,label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(t.FormattedMessageTyped,{messageId:"components.yieldBreakdown.programPoints",values:{name:n.name}})}),e.jsx(k.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=r.PoolApyBreakdownCardTest;exports.PoolApyBreakdownCard=w;
|
package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.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"),v=require("@gearbox-protocol/sdk/onchain"),o=require("../apy-breakdown-body/apy-breakdown-body.cjs"),B=require("../../no-value/no-value.cjs"),M=require("../../points-icon/points-icon.cjs"),q=require("../../token-icon/token-icon.cjs"),i=require("../../typed-intl/index.cjs"),p=require("../../../utils/format-leverage.cjs"),x=require("../../../utils/internal/apy-breakdown.cjs"),n=require("./constants.cjs");function N(y){const{borrowApyAvg7D:t,quotaRateAvg7D:l,liquidationThreshold:s}=y;return t===void 0||l===void 0?null:{borrowApy:t,quotaRate:l,liquidationThreshold:s}}function L(y,t,l){const s=o.breakdownRateValue(y),m=l-t*s;return m>0&&t>0?s+Math.ceil(m/t*100)/100:s}function F({data:y,leverage:t,showFormula:l=!1,period:s,hideRewardLinks:m=!1}){const r=N(y),d=r&&y.collateralApyAvg7D?y.collateralApyAvg7D:void 0,T=r!==null&&d!==void 0,b=T&&r&&d?{organicApy:v.calcNetStrategyApy(r,d.organicApy,t),totalApy:v.calcNetStrategyApy(r,d.totalApy??d.organicApy,t),...d.rewards?{rewards:d.rewards}:{}}:null,c=T&&r?v.calcEffectiveBorrowApy(r,t):null,u=b===null?null:x.totalApyOf(b),f=u===null||c===null?null:u+c,h=d?x.positiveTokenRewardsOf(d):[],I=d?x.pointProgramsOf(d):[],j=h.map(a=>({reward:a,value:Math.round(t*(a.supplyApr??0))})),w=f===null?null:f-j.reduce((a,A)=>a+A.value,0),R=w!==null&&t>0?w/t:void 0,C=r&&c!==null&&t>0?(c-r.borrowApy*(t-1))/t:void 0,S=Number(p.formatLeverageExact(t)),g=c===null?void 0:o.breakdownRateValue(c),k=r&&C!==void 0&&g!==void 0?L(r.borrowApy+C,S,g):void 0,_=k!==void 0&&g!==void 0?S*k-g:void 0;return e.jsxs(o.ApyBreakdownBody,{testId:n.StrategyApyBreakdownCardTest.root,title:e.jsx(i.FormattedMessageTyped,{messageId:o.periodMessageId(s,"components.yieldBreakdown.titleNetAtLeverage","components.yieldBreakdown.titleNetAtLeverage7d"),values:{leverage:p.formatLeverage(t)}}),chip:u===null?e.jsx(B.NoValue,{reason:s}):o.formatBreakdownRate(u,!0),chipPositive:(u??0)>0,chipTestId:n.StrategyApyBreakdownCardTest.net,children:[e.jsx(o.ApyBreakdownRow,{testId:n.StrategyApyBreakdownCardTest.collateral,valueTestId:n.StrategyApyBreakdownCardTest.value,captionTestId:n.StrategyApyBreakdownCardTest.caption,label:e.jsx(i.FormattedMessageTyped,{messageId:o.periodMessageId(s,"components.yieldBreakdown.collateralApy","components.yieldBreakdown.collateralApy7d")}),value:w===null?e.jsx(B.NoValue,{reason:s}):o.formatBreakdownRate(w),subtext:l&&R!==void 0?e.jsx(i.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:p.formatLeverageExact(t),base:o.formatBreakdownRate(R)}}):void 0}),j.map(({reward:a,value:A})=>e.jsx(o.ApyBreakdownRow,{valueTestId:n.StrategyApyBreakdownCardTest.value,captionTestId:n.StrategyApyBreakdownCardTest.caption,label:e.jsxs("span",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(i.FormattedMessageTyped,{messageId:"components.apyParts.extraAPY",values:{symbol:a.token.symbol}})}),e.jsx(q.TokenIcon,{token:a.token,symbol:a.token.symbol,size:16,className:"shrink-0"})]}),m?null:e.jsx(o.RewardLinks,{links:a.links})]}),value:o.formatBreakdownRate(A),subtext:l?e.jsx(i.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:p.formatLeverageExact(t),base:o.formatBreakdownRate(a.supplyApr??0)}}):void 0},`incentive-${a.token.address}-${a.supplyApr??0}`)),e.jsx(o.ApyBreakdownRow,{muted:!0,testId:n.StrategyApyBreakdownCardTest.borrow,valueTestId:n.StrategyApyBreakdownCardTest.value,captionTestId:n.StrategyApyBreakdownCardTest.caption,label:e.jsx(i.FormattedMessageTyped,{messageId:o.periodMessageId(s,"components.yieldBreakdown.borrowRate","components.yieldBreakdown.borrowRate7d")}),value:c===null?e.jsx(B.NoValue,{reason:s}):o.formatBreakdownRate(c),subtext:l&&k!==void 0&&_!==void 0?e.jsx(i.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.borrowFormula",values:{leverage:p.formatLeverageExact(t),totalRate:`${k.toFixed(2)}%`,borrowRate:`${Math.abs(_).toFixed(2)}%`}}):void 0}),I.length>0?e.jsxs(e.Fragment,{children:[e.jsx(o.ApyBreakdownDivider,{}),I.map(a=>e.jsx(o.ApyBreakdownRow,{valueTestId:n.StrategyApyBreakdownCardTest.points,captionTestId:n.StrategyApyBreakdownCardTest.caption,label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(i.FormattedMessageTyped,{messageId:"components.yieldBreakdown.programPoints",values:{name:a.name}})}),e.jsx(M.PointsIcon,{reward:{name:a.name,type:a.id},size:16,className:"shrink-0"})]}),value:a.multiplier!=null?`${p.formatLeverageExact(a.multiplier*t)}×`:o.BREAKDOWN_DASH,subtext:l&&a.multiplier!=null?e.jsx(i.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:p.formatLeverageExact(t),base:p.formatLeverageExact(a.multiplier)}}):void 0},a.id))]}):null]})}exports.StrategyApyBreakdownCardTest=n.StrategyApyBreakdownCardTest;exports.StrategyApyBreakdownCard=F;
|
|
@@ -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"),w=require("react"),_=require("../no-value/no-value.cjs"),v=require("../yield-breakdown-tooltip/yield-breakdown.cjs"),C=require("../../utils/cn.cjs");require("@gearbox-protocol/sdk/onchain");const q=require("../../utils/internal/format-percent.cjs");require("../../utils/z-index.cjs");const t=require("../../utils/internal/apy-breakdown.cjs"),P=require("../../utils/internal/bps-to-percent.cjs"),l=14;function k(){const n=`additional-incentives-${w.useId().replace(/:/g,"")}`;return e.jsxs("svg",{width:l,height:l,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-3.5 shrink-0 overflow-clip",role:"img","aria-label":"Incentives",children:[e.jsx("title",{children:"Incentives"}),e.jsx("path",{d:"M7 14C10.866 14 14 10.866 14 7C14 3.13401 10.866 0 7 0C3.13401 0 0 3.13401 0 7C0 10.866 3.13401 14 7 14Z",fill:`url(#${n})`}),e.jsx("path",{d:"M7 3.75V10.25M3.75 7H10.25",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("defs",{children:e.jsxs("linearGradient",{id:n,x1:"0",y1:"7",x2:"14",y2:"7",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#FF2D8D"}),e.jsx("stop",{offset:"1",stopColor:"#FF6C20"})]})})]})}function c(n){return n==null?!1:t.positiveTokenRewardsOf(n).length>0||t.pointProgramsOf(n).length>0}function I({apy:n,maxLeverage:u,collateralApy:r,borrowApy:a,quotaRate:d,decimals:p=2,tooltip:h=!0,period:x,hideRewardLinks:f,className:s}){if(!n)return e.jsx(_.NoValue,{});const i=t.totalApyOf(n),m=c(n)||c(r),g=h&&i>=1,o=()=>{const j=q.formatCompactPercent(P.bpsToPercent(i),p);return e.jsxs("div",{className:C.cn("inline-flex items-center gap-1.5",s),children:[e.jsx("span",{className:"inline-flex items-center",children:j}),m?e.jsx(k,{}):null]})};return g?e.jsx(v.YieldBreakdownTooltip,{supplyApy:n,maxLeverage:u,collateralApy:r,borrowApy:a,quotaRate:d,period:x,hideRewardLinks:f,className:s,children:o()}):o()}exports.CompoundAPY=I;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),b=require("@gearbox-protocol/static"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),b=require("@gearbox-protocol/static"),N=require("class-variance-authority"),g=require("../base-link/base-link.cjs"),h=require("../../utils/cn.cjs");require("@gearbox-protocol/sdk/onchain");require("../../utils/z-index.cjs");const k=N.cva("[&_.icon-wrap]:-mt-px [&_.icon-wrap]:pl-1.5 [&_.icon-wrap]:leading-none [&_.icon-wrap]:text-secondary-foreground hover:[&_.icon-wrap]:text-foreground",{variants:{variant:{default:"[&_.content-wrap]:border-b [&_.content-wrap]:border-transparent hover:[&_.content-wrap]:border-foreground",underlined:"[&_.content-wrap]:border-b [&_.content-wrap]:border-gray-110 hover:[&_.content-wrap]:border-foreground",unset:"[&_.content-wrap]:border-0"}},defaultVariants:{variant:"default"}});function p({className:d,children:e,href:u,target:m,variant:r="default",size:x="default",color:w="main",external:t=!1,asChild:f=!1,leadingIcon:c,...j}){const a=t?n.jsx("span",{className:"icon-wrap -mt-px pl-1.5 leading-none",children:n.jsx(b.IconExternal,{size:14})}):null,o=c?n.jsx("span",{className:"icon-wrap-start -mt-px pr-1.5 leading-none",children:c}):null,i=o?n.jsxs("span",{className:"inline-flex items-center",children:[o,n.jsx("span",{className:"content-wrap",children:e}),a]}):t&&typeof e=="string"?(()=>{const s=e.trimEnd().lastIndexOf(" "),l=s===-1?"":e.slice(0,s+1),_=s===-1?e:e.slice(s+1);return n.jsxs(n.Fragment,{children:[l?n.jsx("span",{className:"content-wrap",children:l}):null,n.jsxs("span",{className:"inline-flex items-center whitespace-nowrap",children:[n.jsx("span",{className:"pb-px",children:n.jsx("span",{className:"content-wrap",children:_})}),a]})]})})():a?n.jsxs("span",{className:"inline-flex items-center",children:[n.jsx("span",{className:"content-wrap",children:e}),a]}):n.jsx("span",{className:"content-wrap",children:e});return n.jsx(g.BaseLink,{href:u,target:m,external:t,variant:r==="underlined"?"default":r,size:x,color:w,className:h.cn(k({variant:r}),d),...j,children:f?n.jsx("span",{children:i}):i})}p.displayName="Link";exports.Link=p;
|
|
@@ -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"),
|
|
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"),g=require("../base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs"),x=require("../points-icon/points-icon.cjs"),j=require("../token-icon/token-icon.cjs"),l=require("../typed-intl/index.cjs"),A=require("../../utils/format-leverage.cjs"),k=require("../../utils/internal/apy-breakdown.cjs"),f=require("./yield-breakdown-tooltip.cjs");function v({supplyApy:a,maxLeverage:r,collateralApy:u,borrowApy:d,quotaRate:i,period:t,hideRewardLinks:p=!1,children:s,className:c,open:y}){const m=r!==void 0&&r>0;return e.jsx(f.ApyBreakdownTooltip,{placement:"bottom",title:e.jsx("span",{className:c,children:s}),triggerClassName:c,open:y,children:m?e.jsx(_,{supplyApy:a,maxLeverage:r,collateralApy:u,borrowApy:d,quotaRate:i,period:t,hideRewardLinks:p}):e.jsx(g.PoolApyBreakdownCard,{data:a,period:t,hideRewardLinks:p})})}function _({supplyApy:a,maxLeverage:r,collateralApy:u,borrowApy:d,quotaRate:i,period:t,hideRewardLinks:p}){const s=u,c=s?k.tokenRewardsOf(s):[],y=k.pointProgramsOf(a),m=k.totalApyOf(a),w=d!=null||i!=null?(d??0)+(i??0):void 0,B=y.filter(o=>o.multiplier!=null);return e.jsxs(n.ApyBreakdownBody,{title:e.jsx(l.FormattedMessageTyped,{messageId:n.periodMessageId(t,"components.yieldBreakdown.titleNetAtLeverage","components.yieldBreakdown.titleNetAtLeverage7d"),values:{leverage:A.formatLeverage(r)}}),chip:n.formatBreakdownRate(m,!0),chipPositive:m>0,children:[s?.organicApy!=null?e.jsx(n.ApyBreakdownRow,{muted:s.organicApy<0,label:e.jsx(l.FormattedMessageTyped,{messageId:n.periodMessageId(t,"components.yieldBreakdown.collateralApy","components.yieldBreakdown.collateralApy7d")}),value:n.formatBreakdownRate(s.organicApy)}):null,c.map(o=>o.supplyApr==null?null:e.jsx(n.ApyBreakdownRow,{muted:o.supplyApr<0,label:e.jsxs("span",{className:"flex flex-col gap-0.5",children:[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(j.TokenIcon,{token:o.token,size:20})]}),p?null:e.jsx(n.RewardLinks,{links:o.links})]}),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(t,"components.yieldBreakdown.borrowRate","components.yieldBreakdown.borrowRate7d")}),value:n.formatBreakdownRate(w)}):null,B.length>0?e.jsxs(e.Fragment,{children:[e.jsx(n.ApyBreakdownDivider,{}),B.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(x.PointsIcon,{reward:{name:o.name,type:o.id},size:20})]}),value:`${o.multiplier}×`},`points-${o.id}`))]}):null]})}exports.YieldBreakdownTooltip=v;
|
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as s, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment as m } from "react";
|
|
3
|
+
import { Link as u } from "../../link/link.js";
|
|
2
4
|
import { cn as i } from "../../../utils/cn.js";
|
|
3
5
|
import { bpsToPercent as l } from "../../../utils/internal/bps-to-percent.js";
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
return
|
|
6
|
+
const w = "—", N = "400px";
|
|
7
|
+
function k(n, e, t) {
|
|
8
|
+
return n === "7d" ? t : e;
|
|
7
9
|
}
|
|
8
|
-
function
|
|
9
|
-
const t = l(
|
|
10
|
-
return
|
|
10
|
+
function y(n, e = !1) {
|
|
11
|
+
const t = l(n), r = `${Math.abs(t).toFixed(2)}%`;
|
|
12
|
+
return e && t < 0 ? `−${r}` : r;
|
|
11
13
|
}
|
|
12
|
-
function
|
|
13
|
-
return Number(Math.abs(l(
|
|
14
|
+
function v(n) {
|
|
15
|
+
return Number(Math.abs(l(n)).toFixed(2));
|
|
14
16
|
}
|
|
15
|
-
function
|
|
16
|
-
title:
|
|
17
|
-
chip:
|
|
17
|
+
function A({
|
|
18
|
+
title: n,
|
|
19
|
+
chip: e,
|
|
18
20
|
chipPositive: t = !1,
|
|
19
|
-
chipTestId:
|
|
20
|
-
children:
|
|
21
|
-
testId:
|
|
21
|
+
chipTestId: r,
|
|
22
|
+
children: o,
|
|
23
|
+
testId: d
|
|
22
24
|
}) {
|
|
23
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ s(
|
|
24
26
|
"div",
|
|
25
27
|
{
|
|
26
28
|
className: "flex w-full min-w-0 flex-col gap-4 rounded-xl border border-border bg-card p-4",
|
|
27
|
-
"data-testid":
|
|
29
|
+
"data-testid": d,
|
|
28
30
|
children: [
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */ a("span", { className: "min-w-0 text-base font-semibold leading-5 text-foreground", children:
|
|
31
|
+
/* @__PURE__ */ s("div", { className: "flex min-h-6 items-center justify-between gap-3", children: [
|
|
32
|
+
/* @__PURE__ */ a("span", { className: "min-w-0 text-base font-semibold leading-5 text-foreground", children: n }),
|
|
31
33
|
/* @__PURE__ */ a(
|
|
32
34
|
"span",
|
|
33
35
|
{
|
|
@@ -35,51 +37,51 @@ function N({
|
|
|
35
37
|
"shrink-0 rounded-md px-2 py-0.5 text-sm font-semibold tabular-nums",
|
|
36
38
|
t ? "bg-success/20 text-success" : "bg-muted text-muted-foreground"
|
|
37
39
|
),
|
|
38
|
-
"data-testid":
|
|
39
|
-
children:
|
|
40
|
+
"data-testid": r,
|
|
41
|
+
children: e
|
|
40
42
|
}
|
|
41
43
|
)
|
|
42
44
|
] }),
|
|
43
|
-
/* @__PURE__ */ a("div", { className: "flex flex-col gap-3", children:
|
|
45
|
+
/* @__PURE__ */ a("div", { className: "flex flex-col gap-3", children: o })
|
|
44
46
|
]
|
|
45
47
|
}
|
|
46
48
|
);
|
|
47
49
|
}
|
|
48
|
-
function
|
|
49
|
-
label:
|
|
50
|
-
value:
|
|
50
|
+
function B({
|
|
51
|
+
label: n,
|
|
52
|
+
value: e,
|
|
51
53
|
subtext: t,
|
|
52
|
-
muted:
|
|
53
|
-
testId:
|
|
54
|
-
valueTestId:
|
|
54
|
+
muted: r = !1,
|
|
55
|
+
testId: o,
|
|
56
|
+
valueTestId: d,
|
|
55
57
|
captionTestId: c
|
|
56
58
|
}) {
|
|
57
|
-
return /* @__PURE__ */
|
|
59
|
+
return /* @__PURE__ */ s(
|
|
58
60
|
"div",
|
|
59
61
|
{
|
|
60
62
|
className: "flex items-start justify-between gap-3",
|
|
61
|
-
"data-testid":
|
|
63
|
+
"data-testid": o,
|
|
62
64
|
children: [
|
|
63
65
|
/* @__PURE__ */ a(
|
|
64
66
|
"span",
|
|
65
67
|
{
|
|
66
68
|
className: i(
|
|
67
69
|
"min-w-0 text-sm font-semibold leading-5",
|
|
68
|
-
|
|
70
|
+
r ? "text-muted-foreground" : "text-foreground"
|
|
69
71
|
),
|
|
70
|
-
children:
|
|
72
|
+
children: n
|
|
71
73
|
}
|
|
72
74
|
),
|
|
73
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ s("span", { className: "flex shrink-0 flex-col items-end", children: [
|
|
74
76
|
/* @__PURE__ */ a(
|
|
75
77
|
"span",
|
|
76
78
|
{
|
|
77
79
|
className: i(
|
|
78
80
|
"text-sm font-semibold leading-5 tabular-nums",
|
|
79
|
-
|
|
81
|
+
r ? "text-muted-foreground" : "text-foreground"
|
|
80
82
|
),
|
|
81
|
-
"data-testid":
|
|
82
|
-
children:
|
|
83
|
+
"data-testid": d,
|
|
84
|
+
children: e
|
|
83
85
|
}
|
|
84
86
|
),
|
|
85
87
|
t != null ? /* @__PURE__ */ a(
|
|
@@ -95,16 +97,39 @@ function w({
|
|
|
95
97
|
}
|
|
96
98
|
);
|
|
97
99
|
}
|
|
98
|
-
function
|
|
100
|
+
function f(n) {
|
|
101
|
+
let e;
|
|
102
|
+
try {
|
|
103
|
+
e = new URL(n);
|
|
104
|
+
} catch {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (!(e.protocol !== "https:" && e.protocol !== "http:"))
|
|
108
|
+
return e.hostname.split(".").slice(-2).join(".");
|
|
109
|
+
}
|
|
110
|
+
function R({
|
|
111
|
+
links: n
|
|
112
|
+
}) {
|
|
113
|
+
const e = (n ?? []).flatMap((t) => {
|
|
114
|
+
const r = f(t);
|
|
115
|
+
return r ? [{ href: t, domain: r }] : [];
|
|
116
|
+
});
|
|
117
|
+
return e.length === 0 ? null : /* @__PURE__ */ a("span", { className: "block text-xs font-normal leading-4 text-muted-foreground", children: e.map(({ href: t, domain: r }, o) => /* @__PURE__ */ s(m, { children: [
|
|
118
|
+
o > 0 ? ", " : null,
|
|
119
|
+
/* @__PURE__ */ a(u, { href: t, external: !0, size: "unset", color: "secondary", children: r })
|
|
120
|
+
] }, t)) });
|
|
121
|
+
}
|
|
122
|
+
function D() {
|
|
99
123
|
return /* @__PURE__ */ a("div", { className: "h-px w-full bg-divider" });
|
|
100
124
|
}
|
|
101
125
|
export {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
126
|
+
N as APY_BREAKDOWN_TOOLTIP_WIDTH,
|
|
127
|
+
A as ApyBreakdownBody,
|
|
128
|
+
D as ApyBreakdownDivider,
|
|
129
|
+
B as ApyBreakdownRow,
|
|
130
|
+
w as BREAKDOWN_DASH,
|
|
131
|
+
R as RewardLinks,
|
|
132
|
+
v as breakdownRateValue,
|
|
133
|
+
y as formatBreakdownRate,
|
|
134
|
+
k as periodMessageId
|
|
110
135
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { APY_BREAKDOWN_TOOLTIP_WIDTH as
|
|
1
|
+
import { APY_BREAKDOWN_TOOLTIP_WIDTH as o, ApyBreakdownBody as r, ApyBreakdownDivider as d, ApyBreakdownRow as w, BREAKDOWN_DASH as A, RewardLinks as B, breakdownRateValue as k, formatBreakdownRate as n, periodMessageId as R } from "./apy-breakdown-body.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
o as APY_BREAKDOWN_TOOLTIP_WIDTH,
|
|
4
4
|
r as ApyBreakdownBody,
|
|
5
5
|
d as ApyBreakdownDivider,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
k as
|
|
10
|
-
n as
|
|
6
|
+
w as ApyBreakdownRow,
|
|
7
|
+
A as BREAKDOWN_DASH,
|
|
8
|
+
B as RewardLinks,
|
|
9
|
+
k as breakdownRateValue,
|
|
10
|
+
n as formatBreakdownRate,
|
|
11
|
+
R as periodMessageId
|
|
11
12
|
};
|
|
@@ -10,6 +10,7 @@ import "tailwind-merge";
|
|
|
10
10
|
import "@gearbox-protocol/sdk/onchain";
|
|
11
11
|
import "../../../utils/z-index.js";
|
|
12
12
|
import "viem";
|
|
13
|
+
import "../../link/link.js";
|
|
13
14
|
import { PointsIcon as c } from "../../points-icon/points-icon.js";
|
|
14
15
|
import "../../token-icon/token-icon.js";
|
|
15
16
|
import { pointProgramsOf as d } from "../../../utils/internal/apy-breakdown.js";
|
|
@@ -20,15 +21,15 @@ import "../../badge/chip.js";
|
|
|
20
21
|
import "../../typography/typography.js";
|
|
21
22
|
import { VerticalIndicator as u } from "../../vertical-indicator/vertical-indicator.js";
|
|
22
23
|
import { InfoListTest as n } from "./constants.js";
|
|
23
|
-
function
|
|
24
|
+
function F({
|
|
24
25
|
children: t
|
|
25
26
|
}) {
|
|
26
27
|
return /* @__PURE__ */ o(a, { gap: "sm", "data-testid": n.root, children: t });
|
|
27
28
|
}
|
|
28
29
|
function x({
|
|
29
30
|
title: t,
|
|
30
|
-
size:
|
|
31
|
-
align:
|
|
31
|
+
size: e = "sm",
|
|
32
|
+
align: r = "start",
|
|
32
33
|
"data-testid": i = n.line,
|
|
33
34
|
...m
|
|
34
35
|
}) {
|
|
@@ -37,28 +38,28 @@ function x({
|
|
|
37
38
|
u,
|
|
38
39
|
{
|
|
39
40
|
label: p(t),
|
|
40
|
-
size:
|
|
41
|
-
align:
|
|
41
|
+
size: e,
|
|
42
|
+
align: r,
|
|
42
43
|
"data-testid": i,
|
|
43
44
|
...m
|
|
44
45
|
}
|
|
45
46
|
);
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
+
function G({
|
|
48
49
|
data: t,
|
|
49
|
-
title:
|
|
50
|
+
title: e = "components.yieldBreakdown.points"
|
|
50
51
|
}) {
|
|
51
|
-
const
|
|
52
|
-
return
|
|
52
|
+
const r = t ? d(t) : [];
|
|
53
|
+
return r.length === 0 ? null : /* @__PURE__ */ o(
|
|
53
54
|
x,
|
|
54
55
|
{
|
|
55
|
-
title:
|
|
56
|
+
title: e,
|
|
56
57
|
value: /* @__PURE__ */ o(
|
|
57
58
|
"span",
|
|
58
59
|
{
|
|
59
60
|
className: "inline-flex flex-wrap items-center gap-1.5",
|
|
60
61
|
"data-testid": f.points,
|
|
61
|
-
children:
|
|
62
|
+
children: r.map((i) => /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1", children: [
|
|
62
63
|
/* @__PURE__ */ o(
|
|
63
64
|
c,
|
|
64
65
|
{
|
|
@@ -75,7 +76,7 @@ function F({
|
|
|
75
76
|
}
|
|
76
77
|
export {
|
|
77
78
|
x as InfoLine,
|
|
78
|
-
|
|
79
|
+
F as InfoList,
|
|
79
80
|
n as InfoListTest,
|
|
80
|
-
|
|
81
|
+
G as PointsInfoLine
|
|
81
82
|
};
|
|
@@ -1,123 +1,127 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { ApyBreakdownBody as
|
|
1
|
+
import { jsxs as a, jsx as e, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { ApyBreakdownBody as v, formatBreakdownRate as t, ApyBreakdownRow as p, periodMessageId as i, RewardLinks as w, ApyBreakdownDivider as g, BREAKDOWN_DASH as f } from "../apy-breakdown-body/apy-breakdown-body.js";
|
|
3
3
|
import { NoValue as d } from "../../no-value/no-value.js";
|
|
4
|
-
import { PointsIcon as
|
|
5
|
-
import { TokenIcon as
|
|
6
|
-
import { FormattedMessageTyped as
|
|
7
|
-
import { totalApyOf as
|
|
8
|
-
import { PoolApyBreakdownCardTest as
|
|
9
|
-
function
|
|
10
|
-
data:
|
|
11
|
-
period:
|
|
4
|
+
import { PointsIcon as B } from "../../points-icon/points-icon.js";
|
|
5
|
+
import { TokenIcon as I } from "../../token-icon/token-icon.js";
|
|
6
|
+
import { FormattedMessageTyped as r } from "../../typed-intl/index.js";
|
|
7
|
+
import { totalApyOf as h, tokenRewardsOf as C, pointProgramsOf as b } from "../../../utils/internal/apy-breakdown.js";
|
|
8
|
+
import { PoolApyBreakdownCardTest as s } from "./constants.js";
|
|
9
|
+
function z({
|
|
10
|
+
data: o,
|
|
11
|
+
period: l,
|
|
12
|
+
hideRewardLinks: u = !1
|
|
12
13
|
}) {
|
|
13
|
-
const m =
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
|
|
14
|
+
const m = o ? h(o) : void 0, c = o?.organicApy, y = o ? C(o) : [], k = o ? b(o) : [];
|
|
15
|
+
return /* @__PURE__ */ a(
|
|
16
|
+
v,
|
|
16
17
|
{
|
|
17
|
-
testId:
|
|
18
|
+
testId: s.root,
|
|
18
19
|
title: /* @__PURE__ */ e(
|
|
19
|
-
|
|
20
|
+
r,
|
|
20
21
|
{
|
|
21
22
|
messageId: i(
|
|
22
|
-
|
|
23
|
+
l,
|
|
23
24
|
"components.poolApyBreakdownCard.title",
|
|
24
25
|
"components.poolApyBreakdownCard.title7d"
|
|
25
26
|
)
|
|
26
27
|
}
|
|
27
28
|
),
|
|
28
|
-
chip: m == null ? /* @__PURE__ */ e(d, { reason:
|
|
29
|
+
chip: m == null ? /* @__PURE__ */ e(d, { reason: l }) : t(m, !0),
|
|
29
30
|
chipPositive: (m ?? 0) > 0,
|
|
30
|
-
chipTestId:
|
|
31
|
+
chipTestId: s.net,
|
|
31
32
|
children: [
|
|
32
33
|
/* @__PURE__ */ e(
|
|
33
34
|
p,
|
|
34
35
|
{
|
|
35
|
-
valueTestId:
|
|
36
|
+
valueTestId: s.value,
|
|
36
37
|
label: /* @__PURE__ */ e(
|
|
37
|
-
|
|
38
|
+
r,
|
|
38
39
|
{
|
|
39
40
|
messageId: i(
|
|
40
|
-
|
|
41
|
+
l,
|
|
41
42
|
"components.poolApyBreakdownCard.organicApy",
|
|
42
43
|
"components.poolApyBreakdownCard.organicApy7d"
|
|
43
44
|
)
|
|
44
45
|
}
|
|
45
46
|
),
|
|
46
|
-
value: c == null ? /* @__PURE__ */ e(d, { reason:
|
|
47
|
+
value: c == null ? /* @__PURE__ */ e(d, { reason: l }) : t(c)
|
|
47
48
|
}
|
|
48
49
|
),
|
|
49
|
-
y.length > 0 ? y.map((
|
|
50
|
+
y.length > 0 ? y.map((n) => /* @__PURE__ */ e(
|
|
50
51
|
p,
|
|
51
52
|
{
|
|
52
|
-
valueTestId:
|
|
53
|
-
label: /* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
53
|
+
valueTestId: s.value,
|
|
54
|
+
label: /* @__PURE__ */ a("span", { className: "flex flex-col gap-0.5", children: [
|
|
55
|
+
/* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
56
|
+
/* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
|
|
57
|
+
r,
|
|
58
|
+
{
|
|
59
|
+
messageId: i(
|
|
60
|
+
l,
|
|
61
|
+
"components.poolApyBreakdownCard.tokenIncentiveApy",
|
|
62
|
+
"components.poolApyBreakdownCard.tokenIncentiveApy7d"
|
|
63
|
+
),
|
|
64
|
+
values: { symbol: n.token.symbol }
|
|
65
|
+
}
|
|
66
|
+
) }),
|
|
67
|
+
/* @__PURE__ */ e(
|
|
68
|
+
I,
|
|
69
|
+
{
|
|
70
|
+
token: n.token,
|
|
71
|
+
symbol: n.token.symbol,
|
|
72
|
+
size: 16,
|
|
73
|
+
className: "shrink-0"
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
] }),
|
|
77
|
+
u ? null : /* @__PURE__ */ e(w, { links: n.links })
|
|
74
78
|
] }),
|
|
75
|
-
value: t(
|
|
79
|
+
value: t(n.supplyApr ?? 0)
|
|
76
80
|
},
|
|
77
|
-
`incentive-${
|
|
81
|
+
`incentive-${n.token.address}`
|
|
78
82
|
)) : /* @__PURE__ */ e(
|
|
79
83
|
p,
|
|
80
84
|
{
|
|
81
|
-
valueTestId:
|
|
85
|
+
valueTestId: s.value,
|
|
82
86
|
label: /* @__PURE__ */ e(
|
|
83
|
-
|
|
87
|
+
r,
|
|
84
88
|
{
|
|
85
89
|
messageId: i(
|
|
86
|
-
|
|
90
|
+
l,
|
|
87
91
|
"components.poolApyBreakdownCard.incentiveApy",
|
|
88
92
|
"components.poolApyBreakdownCard.incentiveApy7d"
|
|
89
93
|
)
|
|
90
94
|
}
|
|
91
95
|
),
|
|
92
|
-
value:
|
|
96
|
+
value: o == null ? /* @__PURE__ */ e(d, { reason: l }) : t(0)
|
|
93
97
|
}
|
|
94
98
|
),
|
|
95
|
-
k.length > 0 ? /* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */ e(
|
|
97
|
-
k.map((
|
|
99
|
+
k.length > 0 ? /* @__PURE__ */ a(A, { children: [
|
|
100
|
+
/* @__PURE__ */ e(g, {}),
|
|
101
|
+
k.map((n) => /* @__PURE__ */ e(
|
|
98
102
|
p,
|
|
99
103
|
{
|
|
100
|
-
valueTestId:
|
|
101
|
-
label: /* @__PURE__ */
|
|
104
|
+
valueTestId: s.points,
|
|
105
|
+
label: /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
102
106
|
/* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
|
|
103
|
-
|
|
107
|
+
r,
|
|
104
108
|
{
|
|
105
109
|
messageId: "components.yieldBreakdown.programPoints",
|
|
106
|
-
values: { name:
|
|
110
|
+
values: { name: n.name }
|
|
107
111
|
}
|
|
108
112
|
) }),
|
|
109
113
|
/* @__PURE__ */ e(
|
|
110
|
-
|
|
114
|
+
B,
|
|
111
115
|
{
|
|
112
|
-
reward: { name:
|
|
116
|
+
reward: { name: n.name, type: n.id },
|
|
113
117
|
size: 16,
|
|
114
118
|
className: "shrink-0"
|
|
115
119
|
}
|
|
116
120
|
)
|
|
117
121
|
] }),
|
|
118
|
-
value:
|
|
122
|
+
value: n.multiplier != null ? `${n.multiplier}×` : f
|
|
119
123
|
},
|
|
120
|
-
|
|
124
|
+
n.id
|
|
121
125
|
))
|
|
122
126
|
] }) : null
|
|
123
127
|
]
|
|
@@ -125,6 +129,6 @@ function D({
|
|
|
125
129
|
);
|
|
126
130
|
}
|
|
127
131
|
export {
|
|
128
|
-
|
|
129
|
-
|
|
132
|
+
z as PoolApyBreakdownCard,
|
|
133
|
+
s as PoolApyBreakdownCardTest
|
|
130
134
|
};
|