@gearbox-protocol/ui-kit 4.0.0-next.25 → 4.0.0-next.27

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.
Files changed (21) hide show
  1. package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
  2. package/dist/cjs/components/base/title-meta/title-meta.cjs +1 -1
  3. package/dist/cjs/components/base/token-amount/token-amount.cjs +1 -1
  4. package/dist/cjs/components/base/values/scalars.cjs +1 -1
  5. package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
  6. package/dist/cjs/components/composites/pool-assets-table/pool-assets-table.cjs +1 -1
  7. package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
  8. package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +99 -73
  9. package/dist/esm/components/base/title-meta/title-meta.js +37 -37
  10. package/dist/esm/components/base/token-amount/token-amount.js +11 -11
  11. package/dist/esm/components/base/values/scalars.js +11 -10
  12. package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +51 -49
  13. package/dist/esm/components/composites/pool-assets-table/pool-assets-table.js +23 -21
  14. package/dist/esm/components/compound-apy/compound-apy.js +20 -18
  15. package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts +3 -1
  16. package/dist/types/components/base/token-amount/token-amount.d.ts +6 -1
  17. package/dist/types/components/base/values/scalars.d.ts +3 -1
  18. package/dist/types/components/composites/pool-assets-table/pool-assets-table-row.d.ts +3 -1
  19. package/dist/types/components/composites/pool-assets-table/pool-assets-table.d.ts +6 -1
  20. package/dist/types/components/compound-apy/compound-apy.d.ts +3 -1
  21. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),k=require("../../points-icon/points-icon.cjs"),w=require("../../token-icon/token-icon.cjs"),n=require("../../typed-intl/index.cjs");require("react");const g=require("../../../utils/apy-breakdown.cjs");require("@gearbox-protocol/sdk/onchain");const A=require("../../../utils/bps.cjs"),x=require("../../../utils/cn.cjs");require("sonner");const d=require("../../../utils/format-leverage.cjs");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../../utils/z-index.cjs");const o=require("./constants.cjs"),T="—";function B({data:a,showFormula:r=!1}){const{leverage:s,collateralApy:l}=a,c=g.totalApyOf(a.netApy),u=c+a.borrowCost,j=l?g.positiveTokenRewardsOf(l):[],y=l?g.pointProgramsOf(l):[],f=j.map(t=>({reward:t,value:Math.round(s*(t.supplyApr??0))})),v=u-f.reduce((t,p)=>t+p.value,0),b=s>0?v/s:void 0;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":o.StrategyApyBreakdownCardTest.root,children:[e.jsxs("div",{className:"flex h-6 items-center justify-between gap-3",children:[e.jsx("span",{className:"text-base font-semibold leading-4 text-foreground",children:e.jsx(n.FormattedMessageTyped,{messageId:"components.yieldBreakdown.titleNetAtLeverage",values:{leverage:d.formatLeverage(s)}})}),e.jsx("span",{className:x.cn("rounded-md px-2 py-0.5 text-sm font-semibold tabular-nums",c>0?"bg-success/20 text-success":"bg-muted text-muted-foreground"),"data-testid":o.StrategyApyBreakdownCardTest.net,children:i(c)})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(m,{testId:o.StrategyApyBreakdownCardTest.collateral,label:e.jsx(n.FormattedMessageTyped,{messageId:"components.yieldBreakdown.collateralApy"}),value:i(v),subtext:r&&b!==void 0?e.jsx(n.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:d.formatLeverage(s),base:i(b)}}):void 0}),f.map(({reward:t,value:p})=>e.jsx(m,{label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(n.FormattedMessageTyped,{messageId:"components.apyParts.extraAPY",values:{symbol:t.token.symbol}})}),e.jsx(w.TokenIcon,{token:t.token,symbol:t.token.symbol,size:16,className:"shrink-0"})]}),value:i(p),subtext:r?e.jsx(n.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:d.formatLeverage(s),base:i(t.supplyApr??0)}}):void 0},`incentive-${t.token.address}-${t.supplyApr??0}`)),e.jsx(m,{muted:!0,testId:o.StrategyApyBreakdownCardTest.borrow,label:e.jsx(n.FormattedMessageTyped,{messageId:"components.yieldBreakdown.borrowRate"}),value:i(-a.borrowCost)}),y.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-px w-full bg-divider"}),y.map(t=>e.jsx(m,{valueTestId:o.StrategyApyBreakdownCardTest.points,label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(n.FormattedMessageTyped,{messageId:"components.yieldBreakdown.programPoints",values:{name:t.name}})}),e.jsx(k.PointsIcon,{reward:{name:t.name,type:t.id},size:16,className:"shrink-0"})]}),value:t.multiplier!=null?`${d.formatLeverage(t.multiplier*s)}×`:T,subtext:r&&t.multiplier!=null?e.jsx(n.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:d.formatLeverage(s),base:d.formatLeverage(t.multiplier)}}):void 0},t.id))]}):null]})]})}function i(a){const r=A.bpsToPercent(a),s=`${Math.abs(r).toFixed(2)}%`;return r<0?`−${s}`:s}function m({label:a,value:r,subtext:s,muted:l=!1,testId:c,valueTestId:u=o.StrategyApyBreakdownCardTest.value}){return e.jsxs("div",{className:"flex items-start justify-between gap-3","data-testid":c,children:[e.jsx("span",{className:x.cn("min-w-0 text-sm font-semibold leading-5",l?"text-muted-foreground":"text-foreground"),children:a}),e.jsxs("span",{className:"flex shrink-0 flex-col items-end",children:[e.jsx("span",{className:x.cn("text-sm font-semibold leading-5 tabular-nums",l?"text-muted-foreground":"text-foreground"),"data-testid":u,children:r}),s!=null?e.jsx("span",{className:"text-xs leading-4 text-muted-foreground","data-testid":o.StrategyApyBreakdownCardTest.caption,children:s}):null]})]})}exports.StrategyApyBreakdownCardTest=o.StrategyApyBreakdownCardTest;exports.StrategyApyBreakdownCard=B;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),A=require("../../points-icon/points-icon.cjs"),B=require("../../token-icon/token-icon.cjs"),o=require("../../typed-intl/index.cjs");require("react");const g=require("../../../utils/apy-breakdown.cjs");require("@gearbox-protocol/sdk/onchain");const T=require("../../../utils/bps.cjs"),x=require("../../../utils/cn.cjs");require("sonner");const i=require("../../../utils/format-leverage.cjs");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../../utils/z-index.cjs");const l=require("./constants.cjs"),h="—";function y(r,n,s){return r==="7d"?s:n}function I({data:r,showFormula:n=!1,period:s}){const{leverage:a,collateralApy:d}=r,m=g.totalApyOf(r.netApy),j=m+r.borrowCost,w=d?g.positiveTokenRewardsOf(d):[],f=d?g.pointProgramsOf(d):[],v=w.map(t=>({reward:t,value:Math.round(a*(t.supplyApr??0))})),b=j-v.reduce((t,u)=>t+u.value,0),k=a>0?b/a:void 0;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":l.StrategyApyBreakdownCardTest.root,children:[e.jsxs("div",{className:"flex h-6 items-center justify-between gap-3",children:[e.jsx("span",{className:"text-base font-semibold leading-4 text-foreground",children:e.jsx(o.FormattedMessageTyped,{messageId:y(s,"components.yieldBreakdown.titleNetAtLeverage","components.yieldBreakdown.titleNetAtLeverage7d"),values:{leverage:i.formatLeverage(a)}})}),e.jsx("span",{className:x.cn("rounded-md px-2 py-0.5 text-sm font-semibold tabular-nums",m>0?"bg-success/20 text-success":"bg-muted text-muted-foreground"),"data-testid":l.StrategyApyBreakdownCardTest.net,children:c(m)})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(p,{testId:l.StrategyApyBreakdownCardTest.collateral,label:e.jsx(o.FormattedMessageTyped,{messageId:y(s,"components.yieldBreakdown.collateralApy","components.yieldBreakdown.collateralApy7d")}),value:c(b),subtext:n&&k!==void 0?e.jsx(o.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:i.formatLeverage(a),base:c(k)}}):void 0}),v.map(({reward:t,value:u})=>e.jsx(p,{label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(o.FormattedMessageTyped,{messageId:"components.apyParts.extraAPY",values:{symbol:t.token.symbol}})}),e.jsx(B.TokenIcon,{token:t.token,symbol:t.token.symbol,size:16,className:"shrink-0"})]}),value:c(u),subtext:n?e.jsx(o.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:i.formatLeverage(a),base:c(t.supplyApr??0)}}):void 0},`incentive-${t.token.address}-${t.supplyApr??0}`)),e.jsx(p,{muted:!0,testId:l.StrategyApyBreakdownCardTest.borrow,label:e.jsx(o.FormattedMessageTyped,{messageId:y(s,"components.yieldBreakdown.borrowRate","components.yieldBreakdown.borrowRate7d")}),value:c(-r.borrowCost)}),f.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-px w-full bg-divider"}),f.map(t=>e.jsx(p,{valueTestId:l.StrategyApyBreakdownCardTest.points,label:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:e.jsx(o.FormattedMessageTyped,{messageId:"components.yieldBreakdown.programPoints",values:{name:t.name}})}),e.jsx(A.PointsIcon,{reward:{name:t.name,type:t.id},size:16,className:"shrink-0"})]}),value:t.multiplier!=null?`${i.formatLeverage(t.multiplier*a)}×`:h,subtext:n&&t.multiplier!=null?e.jsx(o.FormattedMessageTyped,{messageId:"components.strategyApyBreakdownCard.formula",values:{leverage:i.formatLeverage(a),base:i.formatLeverage(t.multiplier)}}):void 0},t.id))]}):null]})]})}function c(r){const n=T.bpsToPercent(r),s=`${Math.abs(n).toFixed(2)}%`;return n<0?`−${s}`:s}function p({label:r,value:n,subtext:s,muted:a=!1,testId:d,valueTestId:m=l.StrategyApyBreakdownCardTest.value}){return e.jsxs("div",{className:"flex items-start justify-between gap-3","data-testid":d,children:[e.jsx("span",{className:x.cn("min-w-0 text-sm font-semibold leading-5",a?"text-muted-foreground":"text-foreground"),children:r}),e.jsxs("span",{className:"flex shrink-0 flex-col items-end",children:[e.jsx("span",{className:x.cn("text-sm font-semibold leading-5 tabular-nums",a?"text-muted-foreground":"text-foreground"),"data-testid":m,children:n}),s!=null?e.jsx("span",{className:"text-xs leading-4 text-muted-foreground","data-testid":l.StrategyApyBreakdownCardTest.caption,children:s}):null]})]})}exports.StrategyApyBreakdownCardTest=l.StrategyApyBreakdownCardTest;exports.StrategyApyBreakdownCard=I;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("../../link/link.cjs"),u=require("../../network-icon/network-icon.cjs");require("../../network-icon/network-indicator.cjs");const g=require("../../token-icon/token-icon.cjs"),T=require("../../typed-intl/index.cjs"),n=require("../../typography/typography.cjs"),r=require("../stack/stack.cjs"),s=require("./constants.cjs");function h({network:a,curatorName:o,curatorLink:c,onCuratorLinkClick:l,links:d,testId:m=s.TitleMetaTest.root,networkTestId:p=s.TitleMetaTest.network,curatorTestId:x=s.TitleMetaTest.curator}){return e.jsxs(r.Stack,{direction:"row",align:"center",gap:"md",wrap:!0,className:"text-sm text-foreground","data-testid":m,children:[e.jsxs(r.Stack,{direction:"row",align:"center",gap:"sm","data-testid":p,children:[e.jsx(u.NetworkIcon,{network:a,size:16}),e.jsx(n.Typography,{as:"span",className:"text-sm text-foreground",children:a})]}),o?e.jsx(r.Stack,{direction:"row",align:"center",gap:"sm","data-testid":x,children:c?e.jsx(i.Link,{className:"text-sm text-foreground",href:c,external:!0,target:"_blank",size:"sm",onClick:l,children:o}):e.jsx(n.Typography,{as:"span",className:"text-sm text-foreground",children:o})}):e.jsx(n.Typography,{as:"span",className:"text-sm text-foreground",children:e.jsx(T.FormattedMessageTyped,{messageId:"components.titleMeta.unknownCurator"})}),d?.map(t=>e.jsxs(i.Link,{className:"inline-flex items-center gap-2 text-sm text-foreground",href:t.href,external:!0,target:"_blank",size:"sm",onClick:t.onClick,"data-testid":s.TitleMetaTest.link,children:[t.token?e.jsx(g.TokenIcon,{token:t.token,size:16,className:"shrink-0"}):null,t.label||t.token?.symbol?e.jsx(n.Typography,{as:"span",className:"text-sm text-foreground",children:t.label??t.token?.symbol}):null]},t.href))]})}exports.TitleMetaTest=s.TitleMetaTest;exports.TitleMeta=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("../../link/link.cjs"),g=require("../../network-icon/network-icon.cjs");require("../../network-icon/network-indicator.cjs");const u=require("../../token-icon/token-icon.cjs"),h=require("../../typed-intl/index.cjs"),n=require("../../typography/typography.cjs"),o=require("../stack/stack.cjs"),s=require("./constants.cjs");function T({network:a,curatorName:r,curatorLink:c,onCuratorLinkClick:l,links:d,testId:m=s.TitleMetaTest.root,networkTestId:p=s.TitleMetaTest.network,curatorTestId:x=s.TitleMetaTest.curator}){return e.jsxs(o.Stack,{direction:"row",align:"center",gap:"md",wrap:!0,className:"text-sm text-foreground","data-testid":m,children:[e.jsxs(o.Stack,{direction:"row",align:"center",gap:"sm","data-testid":p,children:[e.jsx(g.NetworkIcon,{network:a,size:16}),e.jsx(n.Typography,{as:"span",className:"text-sm text-foreground",children:a})]}),r?e.jsx(o.Stack,{direction:"row",align:"center",gap:"sm","data-testid":x,children:c?e.jsx(i.Link,{className:"text-sm text-foreground",href:c,external:!0,target:"_blank",size:"sm",onClick:l,children:r}):e.jsx(n.Typography,{as:"span",className:"text-sm text-foreground",children:r})}):e.jsx(n.Typography,{as:"span",className:"text-sm text-foreground",children:e.jsx(h.FormattedMessageTyped,{messageId:"components.titleMeta.unknownCurator"})}),d?.map(t=>e.jsx(i.Link,{className:"inline-flex items-center gap-2 text-sm text-foreground",href:t.href,external:!0,target:"_blank",size:"sm",onClick:t.onClick,"data-testid":s.TitleMetaTest.link,children:e.jsxs(o.Stack,{direction:"row",align:"center",gap:"sm",children:[t.token?e.jsx(u.TokenIcon,{token:t.token,size:16,className:"shrink-0"}):null,t.label||t.token?.symbol?e.jsx(n.Typography,{as:"span",className:"text-sm text-foreground",children:t.label??t.token?.symbol}):null]})},t.href))]})}exports.TitleMetaTest=s.TitleMetaTest;exports.TitleMeta=T;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("../stack/stack.cjs"),u=require("../../token-template/token-template.cjs"),c=require("../../typography/typography.cjs"),i=require("../../../utils/format-money.cjs"),n=require("./constants.cjs");function l({data:e,token:o,align:s="start"}){if(e===null)return t.jsx("span",{className:"text-secondary-foreground","data-testid":n.TokenAmountTest.root,children:"—"});const r=o??e.token;return t.jsxs(a.Stack,{gap:"xs",align:s,"data-testid":n.TokenAmountTest.root,children:[t.jsx(u.TokenTemplate,{value:e.value,token:r}),t.jsx(c.Typography,{as:"span",variant:"caption",color:"secondary",children:e.valueUsd===null?"—":i.formatMoney(e.valueUsd)})]})}exports.TokenAmountTest=n.TokenAmountTest;exports.TokenAmount=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),a=require("../stack/stack.cjs"),u=require("../../token-template/token-template.cjs"),c=require("../../typography/typography.cjs"),i=require("../../../utils/format-money.cjs"),o=require("./constants.cjs");function l({data:e,token:t,align:s="end"}){if(e===null)return n.jsx("span",{className:"text-secondary-foreground","data-testid":o.TokenAmountTest.root,children:"—"});const r=t??e.token;return n.jsxs(a.Stack,{gap:"xs",align:s,"data-testid":o.TokenAmountTest.root,children:[n.jsx(u.TokenTemplate,{value:e.value,token:r}),n.jsx(c.Typography,{as:"span",variant:"caption",color:"secondary",children:e.valueUsd===null?"—":i.formatMoney(e.valueUsd)})]})}exports.TokenAmountTest=o.TokenAmountTest;exports.TokenAmount=l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("viem"),c=require("../../compound-apy/compound-apy.cjs"),d=require("../../tooltip/simple-tooltip.cjs");require("../../tooltip/tooltip.cjs");require("react");require("@gearbox-protocol/sdk/onchain");const p=require("../../../utils/cn.cjs");require("sonner");const m=require("../../../utils/format-asset-amount.cjs"),f=require("../../../utils/format-leverage.cjs"),o=require("../../../utils/format-money.cjs");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../../utils/z-index.cjs");const n=require("./constants.cjs"),x="—";function i(){return t.jsx("span",{"data-testid":n.ValueTest.placeholder,children:x})}function s(e){return`${o.formatPercentAmount(e/100,2)}%`}function j({data:e,tooltip:r=!0}){return e===void 0?t.jsx(i,{}):typeof e=="number"?t.jsx("span",{"data-testid":n.ValueTest.apy,children:s(e)}):t.jsx("span",{"data-testid":n.ValueTest.apy,children:t.jsx(c.CompoundAPY,{apy:e,tooltip:r})})}function V({data:e}){return e==null?t.jsx(i,{}):t.jsx("span",{"data-testid":n.ValueTest.usd,children:o.formatMoney(e)})}function h({data:e}){return e===void 0?t.jsx(i,{}):t.jsx("span",{"data-testid":n.ValueTest.leverage,children:`${f.formatLeverage(e)}x`})}function q({data:e}){return e===void 0?t.jsx(i,{}):t.jsx("span",{"data-testid":n.ValueTest.utilization,children:s(e)})}function v({data:e}){if(e===void 0)return t.jsx(i,{});const r=e<1e4?"text-destructive":e<11e3?"text-warning":"text-success";return t.jsx("span",{"data-testid":n.ValueTest.healthFactor,className:p.cn(r),children:(e/1e4).toFixed(2)})}function y({data:e,token:r,showSymbol:l=!0}){if(e===void 0||r===void 0)return t.jsx(i,{});const u=a.formatUnits(e,r.decimals);return t.jsxs("span",{"data-testid":n.ValueTest.tokenBigint,title:`${u} ${r.symbol}`,children:[t.jsx(d.SimpleTooltip,{placement:"top",className:"break-all",title:t.jsx("span",{children:m.formatAssetAmount(e,r.decimals)}),children:t.jsx("span",{children:u})}),l&&` ${r.symbol}`]})}exports.ApyValue=j;exports.HealthFactorValue=v;exports.LeverageValue=h;exports.TokenBigint=y;exports.UsdValue=V;exports.UtilizationValue=q;exports.bps=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("viem"),c=require("../../compound-apy/compound-apy.cjs"),d=require("../../tooltip/simple-tooltip.cjs");require("../../tooltip/tooltip.cjs");require("react");require("@gearbox-protocol/sdk/onchain");const p=require("../../../utils/cn.cjs");require("sonner");const m=require("../../../utils/format-asset-amount.cjs"),f=require("../../../utils/format-leverage.cjs"),l=require("../../../utils/format-money.cjs");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../../utils/z-index.cjs");const n=require("./constants.cjs"),x="—";function i(){return t.jsx("span",{"data-testid":n.ValueTest.placeholder,children:x})}function u(e){return`${l.formatPercentAmount(e/100,2)}%`}function j({data:e,tooltip:r=!0,period:s}){return e===void 0?t.jsx(i,{}):typeof e=="number"?t.jsx("span",{"data-testid":n.ValueTest.apy,children:u(e)}):t.jsx("span",{"data-testid":n.ValueTest.apy,children:t.jsx(c.CompoundAPY,{apy:e,tooltip:r,period:s})})}function V({data:e}){return e==null?t.jsx(i,{}):t.jsx("span",{"data-testid":n.ValueTest.usd,children:l.formatMoney(e)})}function h({data:e}){return e===void 0?t.jsx(i,{}):t.jsx("span",{"data-testid":n.ValueTest.leverage,children:`${f.formatLeverage(e)}x`})}function q({data:e}){return e===void 0?t.jsx(i,{}):t.jsx("span",{"data-testid":n.ValueTest.utilization,children:u(e)})}function v({data:e}){if(e===void 0)return t.jsx(i,{});const r=e<1e4?"text-destructive":e<11e3?"text-warning":"text-success";return t.jsx("span",{"data-testid":n.ValueTest.healthFactor,className:p.cn(r),children:(e/1e4).toFixed(2)})}function y({data:e,token:r,showSymbol:s=!0}){if(e===void 0||r===void 0)return t.jsx(i,{});const o=a.formatUnits(e,r.decimals);return t.jsxs("span",{"data-testid":n.ValueTest.tokenBigint,title:`${o} ${r.symbol}`,children:[t.jsx(d.SimpleTooltip,{placement:"top",className:"break-all",title:t.jsx("span",{children:m.formatAssetAmount(e,r.decimals)}),children:t.jsx("span",{children:o})}),s&&` ${r.symbol}`]})}exports.ApyValue=j;exports.HealthFactorValue=v;exports.LeverageValue=h;exports.TokenBigint=y;exports.UsdValue=V;exports.UtilizationValue=q;exports.bps=u;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");require("@gearbox-protocol/sdk/onchain");require("clsx");require("tailwind-merge");require("sonner");const _=require("../../../utils/format-money.cjs");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../../utils/z-index.cjs");require("../../points-icon/points-icon.cjs");const v=require("../../base/values/scalars.cjs");require("../../badge/badge.cjs");require("../../badge/chip.cjs");const o=require("../../typed-intl/index.cjs"),S=require("../../collateral-allocation-tooltip/allocation-wheel.cjs");require("@fortawesome/free-solid-svg-icons");require("../../icons/fa-icon.cjs");require("../../token-icon/token-icon.cjs");require("../../tooltip/simple-tooltip.cjs");require("../../tooltip/tooltip.cjs");const f=require("../../name-cell/name-cell.cjs"),y=require("../../short-string/short-string.cjs");require("react-intl");require("../../buttons/button/button.cjs");const t=require("../../table/grid-table.cjs");require("../../skeleton/skeleton.cjs");require("../../table/table.cjs");const i=require("../../table/table-sm.cjs"),C=require("../../token-symbol/token-symbol.cjs"),b=require("../../token-template/token-template.cjs"),A=require("../../vertical-indicator/vertical-indicator.cjs"),a=require("./constants.cjs");function z(s,l){if(l!==0n)return Number(s*10000n/l)}function k(s,l){return l<=0n||s<=0n?0:Number(s*10000n/l)/1e4}function N({asset:s,underlyingToken:l,last:h,isCompact:c,totalUsed:q,colorIndex:j}){const{token:u,limit:n,used:r}=s,g=c?40:21,m=k(r.value,q),d=()=>e.jsx(f.NameCell,{leading:e.jsx(C.TokenSymbol,{size:32,token:u}),title:e.jsx(y.ShortString,{maxLength:g,children:u.symbol})}),p=()=>e.jsxs("div",{className:"flex items-center justify-end gap-2","data-testid":a.PoolAssetsTableTest.exposureCell,children:[e.jsx(S.AllocationWheel,{share:m,colorIndex:j,idle:m===0}),e.jsx(A.VerticalIndicator,{value:e.jsx(b.TokenTemplate,{decimalPartLength:2,precision:2,showSymbol:!1,token:l,value:r.value}),valueDescription:r.valueUsd===null?"—":_.formatMoney(r.valueUsd)})]}),x=()=>e.jsx("div",{"data-testid":a.PoolAssetsTableTest.capCell,children:n.value===0n?e.jsx("span",{children:"—"}):e.jsx(b.TokenTemplate,{decimalPartLength:2,precision:2,showSymbol:!1,token:l,value:n.value})}),T=()=>e.jsx("div",{"data-testid":a.PoolAssetsTableTest.capUtilizationCell,children:e.jsx(v.UtilizationValue,{data:z(r.value,n.value)})});return e.jsx(t.GridTableRow,{last:h,height:"auto",className:"cursor-default",style:{minHeight:"75px"},children:c?e.jsx(t.GridTableCell,{className:"px-3 py-0!",size:"sm",span:"full",children:e.jsxs(i.TableLineSm,{className:"w-full",columns:3,columnsXs:3,title:d(),children:[e.jsx(i.TableCellSm,{title:e.jsx(o.FormattedMessageTyped,{messageId:"components.poolAssetsTable.exposure"}),children:p()}),e.jsx(i.TableCellSm,{title:e.jsx(o.FormattedMessageTyped,{messageId:"components.poolAssetsTable.cap"}),children:x()}),e.jsx(i.TableCellSm,{title:e.jsx(o.FormattedMessageTyped,{messageId:"components.poolAssetsTable.capUtilization"}),children:T()})]})}):e.jsxs(e.Fragment,{children:[e.jsx(t.GridTableCell,{className:"pl-4",size:"sm",textAlign:"left",children:d()}),e.jsx(t.GridTableCell,{size:"sm",textAlign:"right",children:p()}),e.jsx(t.GridTableCell,{size:"sm",textAlign:"right",children:x()}),e.jsx(t.GridTableCell,{className:"pr-4",size:"sm",textAlign:"right",children:T()})]})})}exports.PoolAssetsTableRow=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");require("@gearbox-protocol/sdk/onchain");require("clsx");require("tailwind-merge");require("sonner");const v=require("../../../utils/format-money.cjs");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../../utils/z-index.cjs");require("../../points-icon/points-icon.cjs");const S=require("../../base/values/scalars.cjs");require("../../badge/badge.cjs");require("../../badge/chip.cjs");const a=require("../../typed-intl/index.cjs"),f=require("../../collateral-allocation-tooltip/allocation-wheel.cjs");require("@fortawesome/free-solid-svg-icons");require("../../icons/fa-icon.cjs");require("../../token-icon/token-icon.cjs");require("../../tooltip/simple-tooltip.cjs");require("../../tooltip/tooltip.cjs");const y=require("../../name-cell/name-cell.cjs"),C=require("../../short-string/short-string.cjs");require("react-intl");require("../../buttons/button/button.cjs");const t=require("../../table/grid-table.cjs");require("../../skeleton/skeleton.cjs");require("../../table/table.cjs");const r=require("../../table/table-sm.cjs"),A=require("../../token-symbol/token-symbol.cjs"),T=require("../../token-template/token-template.cjs"),k=require("../../vertical-indicator/vertical-indicator.cjs"),c=require("./constants.cjs");function z(l,s){if(s!==0n)return Number(l*10000n/s)}function N(l,s){return s<=0n||l<=0n?0:Number(l*10000n/s)/1e4}function P({asset:l,underlyingToken:s,last:q,isCompact:u,totalUsed:j,colorIndex:g,explorerUrl:m}){const{token:n,limit:o,used:i}=l,_=u?40:21,d=N(i.value,j),p=()=>e.jsx(y.NameCell,{leading:e.jsx(A.TokenSymbol,{size:32,token:n}),title:e.jsx(C.ShortString,{maxLength:_,children:n.symbol})}),x=()=>e.jsxs("div",{className:"flex items-center justify-end gap-2","data-testid":c.PoolAssetsTableTest.exposureCell,children:[e.jsx(f.AllocationWheel,{share:d,colorIndex:g,idle:d===0}),e.jsx(k.VerticalIndicator,{value:e.jsx(T.TokenTemplate,{decimalPartLength:2,precision:2,showSymbol:!1,token:s,value:i.value}),valueDescription:i.valueUsd===null?"—":v.formatMoney(i.valueUsd)})]}),b=()=>e.jsx("div",{"data-testid":c.PoolAssetsTableTest.capCell,children:o.value===0n?e.jsx("span",{children:"—"}):e.jsx(T.TokenTemplate,{decimalPartLength:2,precision:2,showSymbol:!1,token:s,value:o.value})}),h=()=>e.jsx("div",{"data-testid":c.PoolAssetsTableTest.capUtilizationCell,children:e.jsx(S.UtilizationValue,{data:z(i.value,o.value)})});return e.jsx(t.GridTableRow,{last:q,height:"auto",href:m?`${m}/address/${n.address}`:void 0,target:"_blank",style:{minHeight:"75px"},children:u?e.jsx(t.GridTableCell,{className:"px-3 py-0!",size:"sm",span:"full",children:e.jsxs(r.TableLineSm,{className:"w-full",columns:3,columnsXs:3,title:p(),children:[e.jsx(r.TableCellSm,{title:e.jsx(a.FormattedMessageTyped,{messageId:"components.poolAssetsTable.exposure"}),children:x()}),e.jsx(r.TableCellSm,{title:e.jsx(a.FormattedMessageTyped,{messageId:"components.poolAssetsTable.cap"}),children:b()}),e.jsx(r.TableCellSm,{title:e.jsx(a.FormattedMessageTyped,{messageId:"components.poolAssetsTable.capUtilization"}),children:h()})]})}):e.jsxs(e.Fragment,{children:[e.jsx(t.GridTableCell,{className:"pl-4",size:"sm",textAlign:"left",children:p()}),e.jsx(t.GridTableCell,{size:"sm",textAlign:"right",children:x()}),e.jsx(t.GridTableCell,{size:"sm",textAlign:"right",children:b()}),e.jsx(t.GridTableCell,{className:"pr-4",size:"sm",textAlign:"right",children:h()})]})})}exports.PoolAssetsTableRow=P;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("../../cards/card/card.cjs");require("clsx");require("tailwind-merge");require("react");require("@fortawesome/free-solid-svg-icons");require("../../icons/fa-icon.cjs");require("@gearbox-protocol/sdk/onchain");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../../utils/z-index.cjs");require("react-intl");require("../../buttons/button/button.cjs");const i=require("../../table/grid-table.cjs");require("../../skeleton/skeleton.cjs");require("../../table/table.cjs");const q=require("../../../hooks/use-media-query.cjs"),p=require("../../../hooks/use-observed-width-key.cjs"),T=require("./constants.cjs"),m=require("./pool-assets-table-head.cjs"),_=require("./pool-assets-table-row.cjs"),h=680;function A({list:r,sort:n,underlyingToken:a}){const c=q.useIsMobile(),{ref:u,widthKey:l}=p.useObservedWidthKey(),t=l>0?l<h:c,d=r.reduce((s,o)=>s+o.used.value,0n);return e.jsx(b.Card,{ref:u,className:"overflow-hidden rounded-lg p-2",children:e.jsxs(i.GridTable,{cols:t?"1fr":"1fr max-content max-content minmax(0,1fr)","data-testid":T.PoolAssetsTableTest.root,gap:0,size:"lg",wrapperClassName:"overflow-visible",children:[!t&&e.jsx(i.GridTableHeader,{children:e.jsx(m.PoolAssetsTableHead,{sort:n})}),e.jsx(i.GridTableBody,{children:r.map((s,o)=>e.jsx(_.PoolAssetsTableRow,{asset:s,underlyingToken:a,last:o===r.length-1,isCompact:t,totalUsed:d,colorIndex:o},s.token.address))})]})})}exports.PoolAssetsTable=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),q=require("../../cards/card/card.cjs");require("clsx");require("tailwind-merge");require("react");require("@fortawesome/free-solid-svg-icons");require("../../icons/fa-icon.cjs");require("@gearbox-protocol/sdk/onchain");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../../utils/z-index.cjs");require("react-intl");require("../../buttons/button/button.cjs");const i=require("../../table/grid-table.cjs");require("../../skeleton/skeleton.cjs");require("../../table/table.cjs");const p=require("../../../hooks/use-media-query.cjs"),T=require("../../../hooks/use-observed-width-key.cjs"),m=require("./constants.cjs"),_=require("./pool-assets-table-head.cjs"),h=require("./pool-assets-table-row.cjs"),A=680;function x({list:r,sort:n,underlyingToken:a,explorerUrl:c}){const u=p.useIsMobile(),{ref:d,widthKey:l}=T.useObservedWidthKey(),t=l>0?l<A:u,b=r.reduce((s,o)=>s+o.used.value,0n);return e.jsx(q.Card,{ref:d,className:"overflow-hidden rounded-lg p-2",children:e.jsxs(i.GridTable,{cols:t?"1fr":"1fr max-content max-content minmax(0,1fr)","data-testid":m.PoolAssetsTableTest.root,gap:0,size:"lg",wrapperClassName:"overflow-visible",children:[!t&&e.jsx(i.GridTableHeader,{children:e.jsx(_.PoolAssetsTableHead,{sort:n})}),e.jsx(i.GridTableBody,{children:r.map((s,o)=>e.jsx(h.PoolAssetsTableRow,{asset:s,underlyingToken:a,last:o===r.length-1,isCompact:t,totalUsed:b,colorIndex:o,explorerUrl:c},s.token.address))})]})})}exports.PoolAssetsTable=x;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),j=require("../yield-breakdown-tooltip/yield-breakdown-tooltip.cjs"),t=require("../../utils/apy-breakdown.cjs");require("@gearbox-protocol/sdk/onchain");const w=require("../../utils/bps.cjs"),q=require("../../utils/cn.cjs");require("sonner");const v=require("../../utils/format-money.cjs");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../utils/z-index.cjs");const l=14;function C(){const n=`additional-incentives-${m.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 k({apy:n,maxLeverage:u,collateralApy:r,borrowApy:d,quotaRate:a,decimals:p=2,tooltip:h=!0,className:s}){if(!n)return e.jsx("span",{className:"text-secondary-foreground",children:"—"});const i=t.totalApyOf(n),x=c(n)||c(r),f=h&&i>=1,o=()=>{const g=v.formatCompactPercent(w.bpsToPercent(i),p);return e.jsxs("div",{className:q.cn("inline-flex items-center gap-1.5",s),children:[e.jsx("span",{className:"inline-flex items-center",children:g}),x?e.jsx(C,{}):null]})};return f?e.jsx(j.YieldBreakdownTooltip,{supplyApy:n,maxLeverage:u,collateralApy:r,borrowApy:d,quotaRate:a,className:s,children:o()}):o()}exports.CompoundAPY=k;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("react"),w=require("../yield-breakdown-tooltip/yield-breakdown-tooltip.cjs"),t=require("../../utils/apy-breakdown.cjs");require("@gearbox-protocol/sdk/onchain");const q=require("../../utils/bps.cjs"),v=require("../../utils/cn.cjs");require("sonner");const C=require("../../utils/format-money.cjs");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../utils/z-index.cjs");const l=14;function k(){const n=`additional-incentives-${j.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 y({apy:n,maxLeverage:u,collateralApy:r,borrowApy:d,quotaRate:a,decimals:p=2,tooltip:h=!0,period:x,className:s}){if(!n)return e.jsx("span",{className:"text-secondary-foreground",children:"—"});const i=t.totalApyOf(n),f=c(n)||c(r),g=h&&i>=1,o=()=>{const m=C.formatCompactPercent(q.bpsToPercent(i),p);return e.jsxs("div",{className:v.cn("inline-flex items-center gap-1.5",s),children:[e.jsx("span",{className:"inline-flex items-center",children:m}),f?e.jsx(k,{}):null]})};return g?e.jsx(w.YieldBreakdownTooltip,{supplyApy:n,maxLeverage:u,collateralApy:r,borrowApy:d,quotaRate:a,period:x,className:s,children:o()}):o()}exports.CompoundAPY=y;
@@ -1,76 +1,93 @@
1
- import { jsxs as n, jsx as e, Fragment as k } from "react/jsx-runtime";
2
- import { PointsIcon as w } from "../../points-icon/points-icon.js";
3
- import { TokenIcon as N } from "../../token-icon/token-icon.js";
1
+ import { jsxs as r, jsx as e, Fragment as A } from "react/jsx-runtime";
2
+ import { PointsIcon as N } from "../../points-icon/points-icon.js";
3
+ import { TokenIcon as B } from "../../token-icon/token-icon.js";
4
4
  import { FormattedMessageTyped as l } from "../../typed-intl/index.js";
5
5
  import "react";
6
- import { totalApyOf as A, positiveTokenRewardsOf as I, pointProgramsOf as B } from "../../../utils/apy-breakdown.js";
6
+ import { totalApyOf as I, positiveTokenRewardsOf as C, pointProgramsOf as T } from "../../../utils/apy-breakdown.js";
7
7
  import "@gearbox-protocol/sdk/onchain";
8
- import { bpsToPercent as C } from "../../../utils/bps.js";
9
- import { cn as g } from "../../../utils/cn.js";
8
+ import { bpsToPercent as P } from "../../../utils/bps.js";
9
+ import { cn as b } from "../../../utils/cn.js";
10
10
  import "sonner";
11
- import { formatLeverage as d } from "../../../utils/format-leverage.js";
11
+ import { formatLeverage as m } from "../../../utils/format-leverage.js";
12
12
  import "@gearbox-protocol/sdk/common-utils";
13
13
  import "luxon";
14
14
  import "../../../utils/z-index.js";
15
- import { StrategyApyBreakdownCardTest as i } from "./constants.js";
16
- const T = "—";
17
- function G({
15
+ import { StrategyApyBreakdownCardTest as d } from "./constants.js";
16
+ const R = "—";
17
+ function g(s, n, a) {
18
+ return s === "7d" ? a : n;
19
+ }
20
+ function K({
18
21
  data: s,
19
- showFormula: o = !1
22
+ showFormula: n = !1,
23
+ period: a
20
24
  }) {
21
- const { leverage: a, collateralApy: r } = s, c = A(s.netApy), u = c + s.borrowCost, h = r ? I(r) : [], b = r ? B(r) : [], v = h.map((t) => ({
25
+ const { leverage: o, collateralApy: i } = s, p = I(s.netApy), w = p + s.borrowCost, h = i ? C(i) : [], v = i ? T(i) : [], y = h.map((t) => ({
22
26
  reward: t,
23
- value: Math.round(a * (t.supplyApr ?? 0))
24
- })), x = u - v.reduce((t, f) => t + f.value, 0), y = a > 0 ? x / a : void 0;
25
- return /* @__PURE__ */ n(
27
+ value: Math.round(o * (t.supplyApr ?? 0))
28
+ })), x = w - y.reduce((t, f) => t + f.value, 0), k = o > 0 ? x / o : void 0;
29
+ return /* @__PURE__ */ r(
26
30
  "div",
27
31
  {
28
32
  className: "flex w-full min-w-0 flex-col gap-4 rounded-xl border border-border bg-card p-4",
29
- "data-testid": i.root,
33
+ "data-testid": d.root,
30
34
  children: [
31
- /* @__PURE__ */ n("div", { className: "flex h-6 items-center justify-between gap-3", children: [
35
+ /* @__PURE__ */ r("div", { className: "flex h-6 items-center justify-between gap-3", children: [
32
36
  /* @__PURE__ */ e("span", { className: "text-base font-semibold leading-4 text-foreground", children: /* @__PURE__ */ e(
33
37
  l,
34
38
  {
35
- messageId: "components.yieldBreakdown.titleNetAtLeverage",
36
- values: { leverage: d(a) }
39
+ messageId: g(
40
+ a,
41
+ "components.yieldBreakdown.titleNetAtLeverage",
42
+ "components.yieldBreakdown.titleNetAtLeverage7d"
43
+ ),
44
+ values: { leverage: m(o) }
37
45
  }
38
46
  ) }),
39
47
  /* @__PURE__ */ e(
40
48
  "span",
41
49
  {
42
- className: g(
50
+ className: b(
43
51
  "rounded-md px-2 py-0.5 text-sm font-semibold tabular-nums",
44
- c > 0 ? "bg-success/20 text-success" : "bg-muted text-muted-foreground"
52
+ p > 0 ? "bg-success/20 text-success" : "bg-muted text-muted-foreground"
45
53
  ),
46
- "data-testid": i.net,
47
- children: m(c)
54
+ "data-testid": d.net,
55
+ children: c(p)
48
56
  }
49
57
  )
50
58
  ] }),
51
- /* @__PURE__ */ n("div", { className: "flex flex-col gap-3", children: [
59
+ /* @__PURE__ */ r("div", { className: "flex flex-col gap-3", children: [
52
60
  /* @__PURE__ */ e(
53
- p,
61
+ u,
54
62
  {
55
- testId: i.collateral,
56
- label: /* @__PURE__ */ e(l, { messageId: "components.yieldBreakdown.collateralApy" }),
57
- value: m(x),
58
- subtext: o && y !== void 0 ? /* @__PURE__ */ e(
63
+ testId: d.collateral,
64
+ label: /* @__PURE__ */ e(
65
+ l,
66
+ {
67
+ messageId: g(
68
+ a,
69
+ "components.yieldBreakdown.collateralApy",
70
+ "components.yieldBreakdown.collateralApy7d"
71
+ )
72
+ }
73
+ ),
74
+ value: c(x),
75
+ subtext: n && k !== void 0 ? /* @__PURE__ */ e(
59
76
  l,
60
77
  {
61
78
  messageId: "components.strategyApyBreakdownCard.formula",
62
79
  values: {
63
- leverage: d(a),
64
- base: m(y)
80
+ leverage: m(o),
81
+ base: c(k)
65
82
  }
66
83
  }
67
84
  ) : void 0
68
85
  }
69
86
  ),
70
- v.map(({ reward: t, value: f }) => /* @__PURE__ */ e(
71
- p,
87
+ y.map(({ reward: t, value: f }) => /* @__PURE__ */ e(
88
+ u,
72
89
  {
73
- label: /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1.5", children: [
90
+ label: /* @__PURE__ */ r("span", { className: "inline-flex items-center gap-1.5", children: [
74
91
  /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
75
92
  l,
76
93
  {
@@ -79,7 +96,7 @@ function G({
79
96
  }
80
97
  ) }),
81
98
  /* @__PURE__ */ e(
82
- N,
99
+ B,
83
100
  {
84
101
  token: t.token,
85
102
  symbol: t.token.symbol,
@@ -88,14 +105,14 @@ function G({
88
105
  }
89
106
  )
90
107
  ] }),
91
- value: m(f),
92
- subtext: o ? /* @__PURE__ */ e(
108
+ value: c(f),
109
+ subtext: n ? /* @__PURE__ */ e(
93
110
  l,
94
111
  {
95
112
  messageId: "components.strategyApyBreakdownCard.formula",
96
113
  values: {
97
- leverage: d(a),
98
- base: m(t.supplyApr ?? 0)
114
+ leverage: m(o),
115
+ base: c(t.supplyApr ?? 0)
99
116
  }
100
117
  }
101
118
  ) : void 0
@@ -103,21 +120,30 @@ function G({
103
120
  `incentive-${t.token.address}-${t.supplyApr ?? 0}`
104
121
  )),
105
122
  /* @__PURE__ */ e(
106
- p,
123
+ u,
107
124
  {
108
125
  muted: !0,
109
- testId: i.borrow,
110
- label: /* @__PURE__ */ e(l, { messageId: "components.yieldBreakdown.borrowRate" }),
111
- value: m(-s.borrowCost)
126
+ testId: d.borrow,
127
+ label: /* @__PURE__ */ e(
128
+ l,
129
+ {
130
+ messageId: g(
131
+ a,
132
+ "components.yieldBreakdown.borrowRate",
133
+ "components.yieldBreakdown.borrowRate7d"
134
+ )
135
+ }
136
+ ),
137
+ value: c(-s.borrowCost)
112
138
  }
113
139
  ),
114
- b.length > 0 ? /* @__PURE__ */ n(k, { children: [
140
+ v.length > 0 ? /* @__PURE__ */ r(A, { children: [
115
141
  /* @__PURE__ */ e("div", { className: "h-px w-full bg-divider" }),
116
- b.map((t) => /* @__PURE__ */ e(
117
- p,
142
+ v.map((t) => /* @__PURE__ */ e(
143
+ u,
118
144
  {
119
- valueTestId: i.points,
120
- label: /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1.5", children: [
145
+ valueTestId: d.points,
146
+ label: /* @__PURE__ */ r("span", { className: "inline-flex items-center gap-1.5", children: [
121
147
  /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
122
148
  l,
123
149
  {
@@ -126,7 +152,7 @@ function G({
126
152
  }
127
153
  ) }),
128
154
  /* @__PURE__ */ e(
129
- w,
155
+ N,
130
156
  {
131
157
  reward: { name: t.name, type: t.id },
132
158
  size: 16,
@@ -134,14 +160,14 @@ function G({
134
160
  }
135
161
  )
136
162
  ] }),
137
- value: t.multiplier != null ? `${d(t.multiplier * a)}×` : T,
138
- subtext: o && t.multiplier != null ? /* @__PURE__ */ e(
163
+ value: t.multiplier != null ? `${m(t.multiplier * o)}×` : R,
164
+ subtext: n && t.multiplier != null ? /* @__PURE__ */ e(
139
165
  l,
140
166
  {
141
167
  messageId: "components.strategyApyBreakdownCard.formula",
142
168
  values: {
143
- leverage: d(a),
144
- base: d(t.multiplier)
169
+ leverage: m(o),
170
+ base: m(t.multiplier)
145
171
  }
146
172
  }
147
173
  ) : void 0
@@ -154,51 +180,51 @@ function G({
154
180
  }
155
181
  );
156
182
  }
157
- function m(s) {
158
- const o = C(s), a = `${Math.abs(o).toFixed(2)}%`;
159
- return o < 0 ? `−${a}` : a;
183
+ function c(s) {
184
+ const n = P(s), a = `${Math.abs(n).toFixed(2)}%`;
185
+ return n < 0 ? `−${a}` : a;
160
186
  }
161
- function p({
187
+ function u({
162
188
  label: s,
163
- value: o,
189
+ value: n,
164
190
  subtext: a,
165
- muted: r = !1,
166
- testId: c,
167
- valueTestId: u = i.value
191
+ muted: o = !1,
192
+ testId: i,
193
+ valueTestId: p = d.value
168
194
  }) {
169
- return /* @__PURE__ */ n(
195
+ return /* @__PURE__ */ r(
170
196
  "div",
171
197
  {
172
198
  className: "flex items-start justify-between gap-3",
173
- "data-testid": c,
199
+ "data-testid": i,
174
200
  children: [
175
201
  /* @__PURE__ */ e(
176
202
  "span",
177
203
  {
178
- className: g(
204
+ className: b(
179
205
  "min-w-0 text-sm font-semibold leading-5",
180
- r ? "text-muted-foreground" : "text-foreground"
206
+ o ? "text-muted-foreground" : "text-foreground"
181
207
  ),
182
208
  children: s
183
209
  }
184
210
  ),
185
- /* @__PURE__ */ n("span", { className: "flex shrink-0 flex-col items-end", children: [
211
+ /* @__PURE__ */ r("span", { className: "flex shrink-0 flex-col items-end", children: [
186
212
  /* @__PURE__ */ e(
187
213
  "span",
188
214
  {
189
- className: g(
215
+ className: b(
190
216
  "text-sm font-semibold leading-5 tabular-nums",
191
- r ? "text-muted-foreground" : "text-foreground"
217
+ o ? "text-muted-foreground" : "text-foreground"
192
218
  ),
193
- "data-testid": u,
194
- children: o
219
+ "data-testid": p,
220
+ children: n
195
221
  }
196
222
  ),
197
223
  a != null ? /* @__PURE__ */ e(
198
224
  "span",
199
225
  {
200
226
  className: "text-xs leading-4 text-muted-foreground",
201
- "data-testid": i.caption,
227
+ "data-testid": d.caption,
202
228
  children: a
203
229
  }
204
230
  ) : null
@@ -208,6 +234,6 @@ function p({
208
234
  );
209
235
  }
210
236
  export {
211
- G as StrategyApyBreakdownCard,
212
- i as StrategyApyBreakdownCardTest
237
+ K as StrategyApyBreakdownCard,
238
+ d as StrategyApyBreakdownCardTest
213
239
  };
@@ -1,24 +1,24 @@
1
- import { jsxs as a, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
2
  import { Link as l } from "../../link/link.js";
3
- import { NetworkIcon as g } from "../../network-icon/network-icon.js";
3
+ import { NetworkIcon as x } from "../../network-icon/network-icon.js";
4
4
  import "../../network-icon/network-indicator.js";
5
5
  import { TokenIcon as h } from "../../token-icon/token-icon.js";
6
6
  import { FormattedMessageTyped as u } from "../../typed-intl/index.js";
7
7
  import { Typography as r } from "../../typography/typography.js";
8
- import { Stack as n } from "../stack/stack.js";
9
- import { TitleMetaTest as o } from "./constants.js";
8
+ import { Stack as o } from "../stack/stack.js";
9
+ import { TitleMetaTest as s } from "./constants.js";
10
10
  function I({
11
- network: m,
12
- curatorName: s,
13
- curatorLink: i,
14
- onCuratorLinkClick: d,
15
- links: c,
16
- testId: p = o.root,
17
- networkTestId: f = o.network,
18
- curatorTestId: x = o.curator
11
+ network: i,
12
+ curatorName: a,
13
+ curatorLink: m,
14
+ onCuratorLinkClick: c,
15
+ links: d,
16
+ testId: p = s.root,
17
+ networkTestId: f = s.network,
18
+ curatorTestId: g = s.curator
19
19
  }) {
20
- return /* @__PURE__ */ a(
21
- n,
20
+ return /* @__PURE__ */ n(
21
+ o,
22
22
  {
23
23
  direction: "row",
24
24
  align: "center",
@@ -27,56 +27,56 @@ function I({
27
27
  className: "text-sm text-foreground",
28
28
  "data-testid": p,
29
29
  children: [
30
- /* @__PURE__ */ a(
31
- n,
30
+ /* @__PURE__ */ n(
31
+ o,
32
32
  {
33
33
  direction: "row",
34
34
  align: "center",
35
35
  gap: "sm",
36
36
  "data-testid": f,
37
37
  children: [
38
- /* @__PURE__ */ t(g, { network: m, size: 16 }),
39
- /* @__PURE__ */ t(r, { as: "span", className: "text-sm text-foreground", children: m })
38
+ /* @__PURE__ */ e(x, { network: i, size: 16 }),
39
+ /* @__PURE__ */ e(r, { as: "span", className: "text-sm text-foreground", children: i })
40
40
  ]
41
41
  }
42
42
  ),
43
- s ? /* @__PURE__ */ t(
44
- n,
43
+ a ? /* @__PURE__ */ e(
44
+ o,
45
45
  {
46
46
  direction: "row",
47
47
  align: "center",
48
48
  gap: "sm",
49
- "data-testid": x,
50
- children: i ? /* @__PURE__ */ t(
49
+ "data-testid": g,
50
+ children: m ? /* @__PURE__ */ e(
51
51
  l,
52
52
  {
53
53
  className: "text-sm text-foreground",
54
- href: i,
54
+ href: m,
55
55
  external: !0,
56
56
  target: "_blank",
57
57
  size: "sm",
58
- onClick: d,
59
- children: s
58
+ onClick: c,
59
+ children: a
60
60
  }
61
- ) : /* @__PURE__ */ t(r, { as: "span", className: "text-sm text-foreground", children: s })
61
+ ) : /* @__PURE__ */ e(r, { as: "span", className: "text-sm text-foreground", children: a })
62
62
  }
63
- ) : /* @__PURE__ */ t(r, { as: "span", className: "text-sm text-foreground", children: /* @__PURE__ */ t(u, { messageId: "components.titleMeta.unknownCurator" }) }),
64
- c?.map((e) => /* @__PURE__ */ a(
63
+ ) : /* @__PURE__ */ e(r, { as: "span", className: "text-sm text-foreground", children: /* @__PURE__ */ e(u, { messageId: "components.titleMeta.unknownCurator" }) }),
64
+ d?.map((t) => /* @__PURE__ */ e(
65
65
  l,
66
66
  {
67
67
  className: "inline-flex items-center gap-2 text-sm text-foreground",
68
- href: e.href,
68
+ href: t.href,
69
69
  external: !0,
70
70
  target: "_blank",
71
71
  size: "sm",
72
- onClick: e.onClick,
73
- "data-testid": o.link,
74
- children: [
75
- e.token ? /* @__PURE__ */ t(h, { token: e.token, size: 16, className: "shrink-0" }) : null,
76
- e.label || e.token?.symbol ? /* @__PURE__ */ t(r, { as: "span", className: "text-sm text-foreground", children: e.label ?? e.token?.symbol }) : null
77
- ]
72
+ onClick: t.onClick,
73
+ "data-testid": s.link,
74
+ children: /* @__PURE__ */ n(o, { direction: "row", align: "center", gap: "sm", children: [
75
+ t.token ? /* @__PURE__ */ e(h, { token: t.token, size: 16, className: "shrink-0" }) : null,
76
+ t.label || t.token?.symbol ? /* @__PURE__ */ e(r, { as: "span", className: "text-sm text-foreground", children: t.label ?? t.token?.symbol }) : null
77
+ ] })
78
78
  },
79
- e.href
79
+ t.href
80
80
  ))
81
81
  ]
82
82
  }
@@ -84,5 +84,5 @@ function I({
84
84
  }
85
85
  export {
86
86
  I as TitleMeta,
87
- o as TitleMetaTest
87
+ s as TitleMetaTest
88
88
  };
@@ -1,30 +1,30 @@
1
- import { jsx as r, jsxs as s } from "react/jsx-runtime";
2
- import { Stack as a } from "../stack/stack.js";
3
- import { TokenTemplate as i } from "../../token-template/token-template.js";
1
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
+ import { Stack as s } from "../stack/stack.js";
3
+ import { TokenTemplate as a } from "../../token-template/token-template.js";
4
4
  import { Typography as l } from "../../typography/typography.js";
5
5
  import { formatMoney as p } from "../../../utils/format-money.js";
6
- import { TokenAmountTest as t } from "./constants.js";
6
+ import { TokenAmountTest as n } from "./constants.js";
7
7
  function v({
8
8
  data: o,
9
- token: n,
10
- align: e = "start"
9
+ token: e,
10
+ align: t = "end"
11
11
  }) {
12
12
  if (o === null)
13
13
  return /* @__PURE__ */ r(
14
14
  "span",
15
15
  {
16
16
  className: "text-secondary-foreground",
17
- "data-testid": t.root,
17
+ "data-testid": n.root,
18
18
  children: "—"
19
19
  }
20
20
  );
21
- const m = n ?? o.token;
22
- return /* @__PURE__ */ s(a, { gap: "xs", align: e, "data-testid": t.root, children: [
23
- /* @__PURE__ */ r(i, { value: o.value, token: m }),
21
+ const m = e ?? o.token;
22
+ return /* @__PURE__ */ i(s, { gap: "xs", align: t, "data-testid": n.root, children: [
23
+ /* @__PURE__ */ r(a, { value: o.value, token: m }),
24
24
  /* @__PURE__ */ r(l, { as: "span", variant: "caption", color: "secondary", children: o.valueUsd === null ? "—" : p(o.valueUsd) })
25
25
  ] });
26
26
  }
27
27
  export {
28
28
  v as TokenAmount,
29
- t as TokenAmountTest
29
+ n as TokenAmountTest
30
30
  };
@@ -18,14 +18,15 @@ const x = "—";
18
18
  function n() {
19
19
  return /* @__PURE__ */ r("span", { "data-testid": i.placeholder, children: x });
20
20
  }
21
- function l(t) {
21
+ function s(t) {
22
22
  return `${h(t / 100, 2)}%`;
23
23
  }
24
24
  function H({
25
25
  data: t,
26
- tooltip: e = !0
26
+ tooltip: e = !0,
27
+ period: o
27
28
  }) {
28
- return t === void 0 ? /* @__PURE__ */ r(n, {}) : typeof t == "number" ? /* @__PURE__ */ r("span", { "data-testid": i.apy, children: l(t) }) : /* @__PURE__ */ r("span", { "data-testid": i.apy, children: /* @__PURE__ */ r(p, { apy: t, tooltip: e }) });
29
+ return t === void 0 ? /* @__PURE__ */ r(n, {}) : typeof t == "number" ? /* @__PURE__ */ r("span", { "data-testid": i.apy, children: s(t) }) : /* @__PURE__ */ r("span", { "data-testid": i.apy, children: /* @__PURE__ */ r(p, { apy: t, tooltip: e, period: o }) });
29
30
  }
30
31
  function N({
31
32
  data: t
@@ -40,7 +41,7 @@ function w({
40
41
  function D({
41
42
  data: t
42
43
  }) {
43
- return t === void 0 ? /* @__PURE__ */ r(n, {}) : /* @__PURE__ */ r("span", { "data-testid": i.utilization, children: l(t) });
44
+ return t === void 0 ? /* @__PURE__ */ r(n, {}) : /* @__PURE__ */ r("span", { "data-testid": i.utilization, children: s(t) });
44
45
  }
45
46
  function M({
46
47
  data: t
@@ -53,26 +54,26 @@ function M({
53
54
  function O({
54
55
  data: t,
55
56
  token: e,
56
- showSymbol: s = !0
57
+ showSymbol: o = !0
57
58
  }) {
58
59
  if (t === void 0 || e === void 0)
59
60
  return /* @__PURE__ */ r(n, {});
60
- const o = u(t, e.decimals);
61
+ const l = u(t, e.decimals);
61
62
  return (
62
63
  // `title` also keeps the amount where a hover tooltip cannot reach:
63
64
  // keyboard, touch, and the browser's own find — and keeps the symbol
64
65
  // reachable there even when the row is the one printing it
65
- /* @__PURE__ */ m("span", { "data-testid": i.tokenBigint, title: `${o} ${e.symbol}`, children: [
66
+ /* @__PURE__ */ m("span", { "data-testid": i.tokenBigint, title: `${l} ${e.symbol}`, children: [
66
67
  /* @__PURE__ */ r(
67
68
  a,
68
69
  {
69
70
  placement: "top",
70
71
  className: "break-all",
71
72
  title: /* @__PURE__ */ r("span", { children: d(t, e.decimals) }),
72
- children: /* @__PURE__ */ r("span", { children: o })
73
+ children: /* @__PURE__ */ r("span", { children: l })
73
74
  }
74
75
  ),
75
- s && ` ${e.symbol}`
76
+ o && ` ${e.symbol}`
76
77
  ] })
77
78
  );
78
79
  }
@@ -83,5 +84,5 @@ export {
83
84
  O as TokenBigint,
84
85
  N as UsdValue,
85
86
  D as UtilizationValue,
86
- l as bps
87
+ s as bps
87
88
  };
@@ -1,76 +1,77 @@
1
- import { jsx as e, jsxs as s, Fragment as A } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as a, Fragment as y } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import "@gearbox-protocol/sdk/onchain";
4
4
  import "clsx";
5
5
  import "tailwind-merge";
6
6
  import "sonner";
7
- import { formatMoney as N } from "../../../utils/format-money.js";
7
+ import { formatMoney as C } from "../../../utils/format-money.js";
8
8
  import "@gearbox-protocol/sdk/common-utils";
9
9
  import "luxon";
10
10
  import "../../../utils/z-index.js";
11
11
  import "../../points-icon/points-icon.js";
12
- import { UtilizationValue as y } from "../../base/values/scalars.js";
12
+ import { UtilizationValue as N } from "../../base/values/scalars.js";
13
13
  import "../../badge/badge.js";
14
14
  import "../../badge/chip.js";
15
15
  import { FormattedMessageTyped as m } from "../../typed-intl/index.js";
16
- import { AllocationWheel as C } from "../../collateral-allocation-tooltip/allocation-wheel.js";
16
+ import { AllocationWheel as S } from "../../collateral-allocation-tooltip/allocation-wheel.js";
17
17
  import "@fortawesome/free-solid-svg-icons";
18
18
  import "../../icons/fa-icon.js";
19
19
  import "../../token-icon/token-icon.js";
20
20
  import "../../tooltip/simple-tooltip.js";
21
21
  import "../../tooltip/tooltip.js";
22
- import { NameCell as S } from "../../name-cell/name-cell.js";
23
- import { ShortString as U } from "../../short-string/short-string.js";
22
+ import { NameCell as k } from "../../name-cell/name-cell.js";
23
+ import { ShortString as w } from "../../short-string/short-string.js";
24
24
  import "react-intl";
25
25
  import "../../buttons/button/button.js";
26
- import { GridTableRow as k, GridTableCell as o } from "../../table/grid-table.js";
26
+ import { GridTableRow as L, GridTableCell as o } from "../../table/grid-table.js";
27
27
  import "../../skeleton/skeleton.js";
28
28
  import "../../table/table.js";
29
- import { TableLineSm as w, TableCellSm as a } from "../../table/table-sm.js";
30
- import { TokenSymbol as L } from "../../token-symbol/token-symbol.js";
31
- import { TokenTemplate as v } from "../../token-template/token-template.js";
32
- import { VerticalIndicator as I } from "../../vertical-indicator/vertical-indicator.js";
33
- import { PoolAssetsTableTest as n } from "./constants.js";
34
- function P(i, t) {
29
+ import { TableLineSm as U, TableCellSm as n } from "../../table/table-sm.js";
30
+ import { TokenSymbol as I } from "../../token-symbol/token-symbol.js";
31
+ import { TokenTemplate as b } from "../../token-template/token-template.js";
32
+ import { VerticalIndicator as P } from "../../vertical-indicator/vertical-indicator.js";
33
+ import { PoolAssetsTableTest as p } from "./constants.js";
34
+ function j(i, t) {
35
35
  if (t !== 0n)
36
36
  return Number(i * 10000n / t);
37
37
  }
38
- function j(i, t) {
38
+ function B(i, t) {
39
39
  return t <= 0n || i <= 0n ? 0 : Number(i * 10000n / t) / 1e4;
40
40
  }
41
41
  function ue({
42
42
  asset: i,
43
43
  underlyingToken: t,
44
- last: b,
45
- isCompact: p,
46
- totalUsed: x,
47
- colorIndex: T
44
+ last: x,
45
+ isCompact: c,
46
+ totalUsed: T,
47
+ colorIndex: z,
48
+ explorerUrl: d
48
49
  }) {
49
- const { token: c, limit: r, used: l } = i, z = p ? 40 : 21, d = j(l.value, x), u = () => /* @__PURE__ */ e(
50
- S,
50
+ const { token: r, limit: s, used: l } = i, A = c ? 40 : 21, h = B(l.value, T), u = () => /* @__PURE__ */ e(
51
+ k,
51
52
  {
52
- leading: /* @__PURE__ */ e(L, { size: 32, token: c }),
53
- title: /* @__PURE__ */ e(U, { maxLength: z, children: c.symbol })
53
+ leading: /* @__PURE__ */ e(I, { size: 32, token: r }),
54
+ title: /* @__PURE__ */ e(w, { maxLength: A, children: r.symbol })
54
55
  }
55
- ), h = () => /* @__PURE__ */ s(
56
+ ), f = () => /* @__PURE__ */ a(
56
57
  "div",
57
58
  {
58
59
  className: "flex items-center justify-end gap-2",
59
- "data-testid": n.exposureCell,
60
+ "data-testid": p.exposureCell,
60
61
  children: [
61
62
  /* @__PURE__ */ e(
62
- C,
63
+ S,
63
64
  {
64
- share: d,
65
- colorIndex: T,
66
- idle: d === 0
65
+ share: h,
66
+ colorIndex: z,
67
+ idle: h === 0
67
68
  }
68
69
  ),
69
70
  /* @__PURE__ */ e(
70
- I,
71
+ P,
71
72
  {
72
73
  value: /* @__PURE__ */ e(
73
- v,
74
+ b,
74
75
  {
75
76
  decimalPartLength: 2,
76
77
  precision: 2,
@@ -79,30 +80,31 @@ function ue({
79
80
  value: l.value
80
81
  }
81
82
  ),
82
- valueDescription: l.valueUsd === null ? "—" : N(l.valueUsd)
83
+ valueDescription: l.valueUsd === null ? "—" : C(l.valueUsd)
83
84
  }
84
85
  )
85
86
  ]
86
87
  }
87
- ), f = () => /* @__PURE__ */ e("div", { "data-testid": n.capCell, children: r.value === 0n ? /* @__PURE__ */ e("span", { children: "—" }) : /* @__PURE__ */ e(
88
- v,
88
+ ), g = () => /* @__PURE__ */ e("div", { "data-testid": p.capCell, children: s.value === 0n ? /* @__PURE__ */ e("span", { children: "—" }) : /* @__PURE__ */ e(
89
+ b,
89
90
  {
90
91
  decimalPartLength: 2,
91
92
  precision: 2,
92
93
  showSymbol: !1,
93
94
  token: t,
94
- value: r.value
95
+ value: s.value
95
96
  }
96
- ) }), g = () => /* @__PURE__ */ e("div", { "data-testid": n.capUtilizationCell, children: /* @__PURE__ */ e(y, { data: P(l.value, r.value) }) });
97
+ ) }), v = () => /* @__PURE__ */ e("div", { "data-testid": p.capUtilizationCell, children: /* @__PURE__ */ e(N, { data: j(l.value, s.value) }) });
97
98
  return /* @__PURE__ */ e(
98
- k,
99
+ L,
99
100
  {
100
- last: b,
101
+ last: x,
101
102
  height: "auto",
102
- className: "cursor-default",
103
+ href: d ? `${d}/address/${r.address}` : void 0,
104
+ target: "_blank",
103
105
  style: { minHeight: "75px" },
104
- children: p ? /* @__PURE__ */ e(o, { className: "px-3 py-0!", size: "sm", span: "full", children: /* @__PURE__ */ s(
105
- w,
106
+ children: c ? /* @__PURE__ */ e(o, { className: "px-3 py-0!", size: "sm", span: "full", children: /* @__PURE__ */ a(
107
+ U,
106
108
  {
107
109
  className: "w-full",
108
110
  columns: 3,
@@ -110,33 +112,33 @@ function ue({
110
112
  title: u(),
111
113
  children: [
112
114
  /* @__PURE__ */ e(
113
- a,
115
+ n,
114
116
  {
115
117
  title: /* @__PURE__ */ e(m, { messageId: "components.poolAssetsTable.exposure" }),
116
- children: h()
118
+ children: f()
117
119
  }
118
120
  ),
119
121
  /* @__PURE__ */ e(
120
- a,
122
+ n,
121
123
  {
122
124
  title: /* @__PURE__ */ e(m, { messageId: "components.poolAssetsTable.cap" }),
123
- children: f()
125
+ children: g()
124
126
  }
125
127
  ),
126
128
  /* @__PURE__ */ e(
127
- a,
129
+ n,
128
130
  {
129
131
  title: /* @__PURE__ */ e(m, { messageId: "components.poolAssetsTable.capUtilization" }),
130
- children: g()
132
+ children: v()
131
133
  }
132
134
  )
133
135
  ]
134
136
  }
135
- ) }) : /* @__PURE__ */ s(A, { children: [
137
+ ) }) : /* @__PURE__ */ a(y, { children: [
136
138
  /* @__PURE__ */ e(o, { className: "pl-4", size: "sm", textAlign: "left", children: u() }),
137
- /* @__PURE__ */ e(o, { size: "sm", textAlign: "right", children: h() }),
138
139
  /* @__PURE__ */ e(o, { size: "sm", textAlign: "right", children: f() }),
139
- /* @__PURE__ */ e(o, { className: "pr-4", size: "sm", textAlign: "right", children: g() })
140
+ /* @__PURE__ */ e(o, { size: "sm", textAlign: "right", children: g() }),
141
+ /* @__PURE__ */ e(o, { className: "pr-4", size: "sm", textAlign: "right", children: v() })
140
142
  ] })
141
143
  }
142
144
  );
@@ -1,5 +1,5 @@
1
- import { jsx as o, jsxs as n } from "react/jsx-runtime";
2
- import { Card as c } from "../../cards/card/card.js";
1
+ import { jsx as o, jsxs as c } from "react/jsx-runtime";
2
+ import { Card as f } from "../../cards/card/card.js";
3
3
  import "clsx";
4
4
  import "tailwind-merge";
5
5
  import "react";
@@ -12,40 +12,42 @@ import "luxon";
12
12
  import "../../../utils/z-index.js";
13
13
  import "react-intl";
14
14
  import "../../buttons/button/button.js";
15
- import { GridTable as f, GridTableHeader as b, GridTableBody as T } from "../../table/grid-table.js";
15
+ import { GridTable as b, GridTableHeader as T, GridTableBody as h } from "../../table/grid-table.js";
16
16
  import "../../skeleton/skeleton.js";
17
17
  import "../../table/table.js";
18
- import { useIsMobile as h } from "../../../hooks/use-media-query.js";
19
- import { useObservedWidthKey as u } from "../../../hooks/use-observed-width-key.js";
20
- import { PoolAssetsTableTest as x } from "./constants.js";
21
- import { PoolAssetsTableHead as v } from "./pool-assets-table-head.js";
22
- import { PoolAssetsTableRow as w } from "./pool-assets-table-row.js";
23
- const A = 680;
24
- function U({
18
+ import { useIsMobile as u } from "../../../hooks/use-media-query.js";
19
+ import { useObservedWidthKey as x } from "../../../hooks/use-observed-width-key.js";
20
+ import { PoolAssetsTableTest as v } from "./constants.js";
21
+ import { PoolAssetsTableHead as w } from "./pool-assets-table-head.js";
22
+ import { PoolAssetsTableRow as A } from "./pool-assets-table-row.js";
23
+ const C = 680;
24
+ function q({
25
25
  list: t,
26
26
  sort: s,
27
- underlyingToken: p
27
+ underlyingToken: p,
28
+ explorerUrl: l
28
29
  }) {
29
- const l = h(), { ref: a, widthKey: m } = u(), i = m > 0 ? m < A : l, d = t.reduce((r, e) => r + e.used.value, 0n);
30
- return /* @__PURE__ */ o(c, { ref: a, className: "overflow-hidden rounded-lg p-2", children: /* @__PURE__ */ n(
31
- f,
30
+ const a = u(), { ref: d, widthKey: m } = x(), i = m > 0 ? m < C : a, n = t.reduce((r, e) => r + e.used.value, 0n);
31
+ return /* @__PURE__ */ o(f, { ref: d, className: "overflow-hidden rounded-lg p-2", children: /* @__PURE__ */ c(
32
+ b,
32
33
  {
33
34
  cols: i ? "1fr" : "1fr max-content max-content minmax(0,1fr)",
34
- "data-testid": x.root,
35
+ "data-testid": v.root,
35
36
  gap: 0,
36
37
  size: "lg",
37
38
  wrapperClassName: "overflow-visible",
38
39
  children: [
39
- !i && /* @__PURE__ */ o(b, { children: /* @__PURE__ */ o(v, { sort: s }) }),
40
- /* @__PURE__ */ o(T, { children: t.map((r, e) => /* @__PURE__ */ o(
41
- w,
40
+ !i && /* @__PURE__ */ o(T, { children: /* @__PURE__ */ o(w, { sort: s }) }),
41
+ /* @__PURE__ */ o(h, { children: t.map((r, e) => /* @__PURE__ */ o(
42
+ A,
42
43
  {
43
44
  asset: r,
44
45
  underlyingToken: p,
45
46
  last: e === t.length - 1,
46
47
  isCompact: i,
47
- totalUsed: d,
48
- colorIndex: e
48
+ totalUsed: n,
49
+ colorIndex: e,
50
+ explorerUrl: l
49
51
  },
50
52
  r.token.address
51
53
  )) })
@@ -54,5 +56,5 @@ function U({
54
56
  ) });
55
57
  }
56
58
  export {
57
- U as PoolAssetsTable
59
+ q as PoolAssetsTable
58
60
  };
@@ -1,18 +1,18 @@
1
1
  import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
- import { useId as w } from "react";
3
- import { YieldBreakdownTooltip as x } from "../yield-breakdown-tooltip/yield-breakdown-tooltip.js";
4
- import { totalApyOf as v, positiveTokenRewardsOf as C, pointProgramsOf as I } from "../../utils/apy-breakdown.js";
2
+ import { useId as x } from "react";
3
+ import { YieldBreakdownTooltip as v } from "../yield-breakdown-tooltip/yield-breakdown-tooltip.js";
4
+ import { totalApyOf as C, positiveTokenRewardsOf as I, pointProgramsOf as k } from "../../utils/apy-breakdown.js";
5
5
  import "@gearbox-protocol/sdk/onchain";
6
- import { bpsToPercent as k } from "../../utils/bps.js";
7
- import { cn as P } from "../../utils/cn.js";
6
+ import { bpsToPercent as P } from "../../utils/bps.js";
7
+ import { cn as A } from "../../utils/cn.js";
8
8
  import "sonner";
9
- import { formatCompactPercent as A } from "../../utils/format-money.js";
9
+ import { formatCompactPercent as O } from "../../utils/format-money.js";
10
10
  import "@gearbox-protocol/sdk/common-utils";
11
11
  import "luxon";
12
12
  import "../../utils/z-index.js";
13
13
  const l = 14;
14
- function O() {
15
- const t = `additional-incentives-${w().replace(/:/g, "")}`;
14
+ function F() {
15
+ const t = `additional-incentives-${x().replace(/:/g, "")}`;
16
16
  return /* @__PURE__ */ r(
17
17
  "svg",
18
18
  {
@@ -62,9 +62,9 @@ function O() {
62
62
  );
63
63
  }
64
64
  function c(t) {
65
- return t == null ? !1 : C(t).length > 0 || I(t).length > 0;
65
+ return t == null ? !1 : I(t).length > 0 || k(t).length > 0;
66
66
  }
67
- function U({
67
+ function Z({
68
68
  apy: t,
69
69
  maxLeverage: p,
70
70
  collateralApy: n,
@@ -72,30 +72,32 @@ function U({
72
72
  quotaRate: a,
73
73
  decimals: m = 2,
74
74
  tooltip: f = !0,
75
+ period: h,
75
76
  className: o
76
77
  }) {
77
78
  if (!t)
78
79
  return /* @__PURE__ */ e("span", { className: "text-secondary-foreground", children: "—" });
79
- const i = v(t), h = c(t) || c(n), u = f && i >= 1, s = () => {
80
- const g = A(k(i), m);
81
- return /* @__PURE__ */ r("div", { className: P("inline-flex items-center gap-1.5", o), children: [
82
- /* @__PURE__ */ e("span", { className: "inline-flex items-center", children: g }),
83
- h ? /* @__PURE__ */ e(O, {}) : null
80
+ const i = C(t), u = c(t) || c(n), g = f && i >= 1, s = () => {
81
+ const w = O(P(i), m);
82
+ return /* @__PURE__ */ r("div", { className: A("inline-flex items-center gap-1.5", o), children: [
83
+ /* @__PURE__ */ e("span", { className: "inline-flex items-center", children: w }),
84
+ u ? /* @__PURE__ */ e(F, {}) : null
84
85
  ] });
85
86
  };
86
- return u ? /* @__PURE__ */ e(
87
- x,
87
+ return g ? /* @__PURE__ */ e(
88
+ v,
88
89
  {
89
90
  supplyApy: t,
90
91
  maxLeverage: p,
91
92
  collateralApy: n,
92
93
  borrowApy: d,
93
94
  quotaRate: a,
95
+ period: h,
94
96
  className: o,
95
97
  children: s()
96
98
  }
97
99
  ) : s();
98
100
  }
99
101
  export {
100
- U as CompoundAPY
102
+ Z as CompoundAPY
101
103
  };
@@ -29,6 +29,8 @@ export interface StrategyApyBreakdownCardProps {
29
29
  * it. Off in a tooltip, where it is a glance.
30
30
  */
31
31
  readonly showFormula?: boolean;
32
+ /** When `"7d"`, labels carry the averaging-window suffix. */
33
+ readonly period?: "7d";
32
34
  }
33
35
  /**
34
36
  * How a strategy's net APY is arrived at: collateral yield on the leveraged
@@ -45,4 +47,4 @@ export interface StrategyApyBreakdownCardProps {
45
47
  * remainder, so the column adds up to the chip even when each reward rounds
46
48
  * its own way.
47
49
  */
48
- export declare function StrategyApyBreakdownCard({ data, showFormula, }: StrategyApyBreakdownCardProps): React.ReactElement;
50
+ export declare function StrategyApyBreakdownCard({ data, showFormula, period, }: StrategyApyBreakdownCardProps): React.ReactElement;
@@ -21,7 +21,12 @@ type TokenAmountDataProps = {
21
21
  readonly token: Token;
22
22
  };
23
23
  export type TokenAmountProps = TokenAmountDataProps & {
24
- /** Cross-axis alignment of the token line and the USD caption. */
24
+ /**
25
+ * Cross-axis alignment of the token line and the USD caption. Defaults to
26
+ * `end`: nearly every slot this lands in — table cells, info lines, metric
27
+ * rows — is right-aligned, and a flex column ignores the `text-right` its
28
+ * wrapper sets. Pass `start` inside a card, where the left edge is right.
29
+ */
25
30
  readonly align?: TokenAmountAlign;
26
31
  };
27
32
  export declare function TokenAmount({ data, token, align, }: TokenAmountProps): React.ReactElement;
@@ -22,13 +22,15 @@ export interface ApyValueProps {
22
22
  * @default true
23
23
  */
24
24
  readonly tooltip?: boolean;
25
+ /** When `"7d"`, the breakdown tooltip labels carry the averaging-window suffix. */
26
+ readonly period?: "7d";
25
27
  }
26
28
  /**
27
29
  * Any APY the model carries, in one place: `supplyApy`, `netApy`, `borrowApy`.
28
30
  * A breakdown renders the reference chip (reward icons + breakdown tooltip)
29
31
  * via `CompoundAPY`; a bare `Bps` stays a plain percentage.
30
32
  */
31
- export declare function ApyValue({ data, tooltip, }: ApyValueProps): React.ReactElement;
33
+ export declare function ApyValue({ data, tooltip, period, }: ApyValueProps): React.ReactElement;
32
34
  export declare function UsdValue({ data, }: {
33
35
  readonly data: number | null | undefined;
34
36
  }): React.ReactElement;
@@ -7,8 +7,10 @@ export interface PoolAssetsTableRowProps {
7
7
  readonly isCompact: boolean;
8
8
  readonly totalUsed: bigint;
9
9
  readonly colorIndex: number;
10
+ /** Base URL of the chain's explorer; absent leaves the row inert. */
11
+ readonly explorerUrl?: string;
10
12
  }
11
13
  /**
12
14
  * Single data row: token name, exposure (amount + pie), cap, and cap utilization.
13
15
  */
14
- export declare function PoolAssetsTableRow({ asset, underlyingToken, last, isCompact, totalUsed, colorIndex, }: PoolAssetsTableRowProps): React.ReactElement;
16
+ export declare function PoolAssetsTableRow({ asset, underlyingToken, last, isCompact, totalUsed, colorIndex, explorerUrl, }: PoolAssetsTableRowProps): React.ReactElement;
@@ -5,9 +5,14 @@ export interface PoolAssetsTableProps {
5
5
  readonly list: ReadonlyArray<QuotaAsset>;
6
6
  readonly sort: PoolAssetsTableSort;
7
7
  readonly underlyingToken: Token;
8
+ /**
9
+ * Block explorer base URL of the pool's chain. Given one, each row links to
10
+ * its token's address there; without one the rows stay inert.
11
+ */
12
+ readonly explorerUrl?: string;
8
13
  }
9
14
  /**
10
15
  * Grid table of pool asset quotas: exposure, cap, and cap utilization.
11
16
  * Collapses into stacked cards below {@link COMPACT_WIDTH_THRESHOLD}.
12
17
  */
13
- export declare function PoolAssetsTable({ list, sort, underlyingToken, }: PoolAssetsTableProps): React.ReactElement | null;
18
+ export declare function PoolAssetsTable({ list, sort, underlyingToken, explorerUrl, }: PoolAssetsTableProps): React.ReactElement | null;
@@ -33,6 +33,8 @@ export interface CompoundAPYProps {
33
33
  * @default true
34
34
  */
35
35
  tooltip?: boolean;
36
+ /** When `"7d"`, tooltip labels carry the averaging-window suffix. */
37
+ period?: "7d";
36
38
  className?: string;
37
39
  }
38
40
  /**
@@ -41,4 +43,4 @@ export interface CompoundAPYProps {
41
43
  * No `tokensList`, no external APY, no 7D history, no "soon" points state.
42
44
  * For the legacy percent-based API see {@link CompoundAPYLegacy}.
43
45
  */
44
- export declare function CompoundAPY({ apy, maxLeverage, collateralApy, borrowApy, quotaRate, decimals, tooltip, className, }: CompoundAPYProps): import("react").JSX.Element;
46
+ export declare function CompoundAPY({ apy, maxLeverage, collateralApy, borrowApy, quotaRate, decimals, tooltip, period, className, }: CompoundAPYProps): import("react").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/ui-kit",
3
- "version": "4.0.0-next.25",
3
+ "version": "4.0.0-next.27",
4
4
  "description": "Internal UI components",
5
5
  "repository": {
6
6
  "type": "git",