@gearbox-protocol/permissionless-ui 1.26.9 → 1.26.11-next.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.
Files changed (34) hide show
  1. package/dist/cjs/components/table/table.cjs +1 -1
  2. package/dist/cjs/hooks/use-hf.cjs +1 -1
  3. package/dist/cjs/hooks/use-liquidation/index.cjs +1 -1
  4. package/dist/cjs/types/common.cjs +1 -0
  5. package/dist/esm/components/table/table.js +94 -97
  6. package/dist/esm/hooks/use-hf.js +3 -3
  7. package/dist/esm/hooks/use-liquidation/index.js +38 -38
  8. package/dist/esm/types/common.js +1 -0
  9. package/dist/globals.css +1 -1
  10. package/dist/types/components/asset-line/asset-line.d.ts +4 -3
  11. package/dist/types/components/compound-apy/compound-apy.d.ts +3 -4
  12. package/dist/types/components/credit-session-status/credit-session-status.d.ts +1 -1
  13. package/dist/types/components/currency-button/currency-button.d.ts +2 -2
  14. package/dist/types/components/detailed-apy/detailed-apy.d.ts +5 -5
  15. package/dist/types/components/detailed-page-title/detailed-page-title.d.ts +2 -2
  16. package/dist/types/components/liquidation/liquidation-assets-table/liquidation-assets-table.d.ts +2 -2
  17. package/dist/types/components/liquidation/liquidation-graph/liquidation-graph.d.ts +5 -4
  18. package/dist/types/components/liquidation/liquidation-graph-tip/liquidation-graph-tip.d.ts +2 -2
  19. package/dist/types/components/pool-apy-tooltip/pool-apy-tooltip.d.ts +3 -3
  20. package/dist/types/components/slider-token/slider-token.d.ts +2 -2
  21. package/dist/types/components/smart-number-input/balance-indicator.d.ts +2 -2
  22. package/dist/types/components/smart-number-input/smart-number-input.d.ts +2 -10
  23. package/dist/types/components/token-symbol/token-symbol.d.ts +2 -6
  24. package/dist/types/components/token-template/token-template.d.ts +2 -2
  25. package/dist/types/components/tokens-list-cell/tokens-list-cell.d.ts +2 -2
  26. package/dist/types/hooks/use-hf.d.ts +4 -3
  27. package/dist/types/hooks/use-liquidation/index.d.ts +9 -8
  28. package/dist/types/hooks/use-liquidation/types.d.ts +2 -2
  29. package/dist/types/hooks/use-liquidation/utils.d.ts +11 -10
  30. package/dist/types/types/common.d.ts +23 -0
  31. package/dist/types/utils/interface.d.ts +0 -9
  32. package/dist/types/utils/search-in-token.d.ts +4 -4
  33. package/dist/types/utils/templates.d.ts +6 -8
  34. package/package.json +3 -3
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("class-variance-authority"),C=require("react"),q=require("../buttons/button/button.cjs"),d=require("@fortawesome/free-solid-svg-icons"),H=require("../icons/fa-icon.cjs");require("../tooltip/simple-tooltip.cjs");const n=require("../tooltip/tooltip.cjs");require("@gearbox-protocol/sdk");const s=require("../../utils/cn.cjs");require("sonner");require("luxon");require("../../utils/z-index.cjs");function z(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const l=z(C),f=c.cva("w-full caption-bottom",{variants:{size:{sm:"text-xs",default:"text-sm",lg:"text-base"}},defaultVariants:{size:"default"}}),u=l.forwardRef(({className:e,size:a,wrapperClassName:t,...o},i)=>r.jsx("div",{className:s.cn("relative w-full overflow-auto rounded-lg border border-input bg-card",t),children:r.jsx("table",{ref:i,className:s.cn(f({size:a,className:e})),...o})}));u.displayName="Table";const p=l.forwardRef(({className:e,...a},t)=>r.jsx("thead",{ref:t,className:s.cn("[&_tr]:after:inset-x-0 [&_tr]:after:bg-input [&_tr]:hover:bg-transparent [&_tr]:hover:before:opacity-0",e),...a}));p.displayName="TableHeader";const m=l.forwardRef(({className:e,...a},t)=>r.jsx("tbody",{ref:t,className:s.cn("[&_tr:last-child]:after:hidden",e),...a}));m.displayName="TableBody";const x=l.forwardRef(({className:e,...a},t)=>r.jsx("tfoot",{ref:t,className:s.cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...a}));x.displayName="TableFooter";const g=l.forwardRef(({className:e,...a},t)=>r.jsx("tr",{ref:t,className:s.cn("relative isolate transition-colors data-[state=selected]:bg-muted","before:absolute before:inset-0 before:-z-10 before:rounded-lg before:bg-muted/50 before:opacity-0 before:transition-opacity before:pointer-events-none","hover:before:opacity-100","after:absolute after:bottom-0 after:inset-x-3 after:h-px after:bg-border",e),...a}));g.displayName="TableRow";const T=c.cva("border-b bg-muted/50 text-left align-middle font-medium text-muted-foreground border-input",{variants:{size:{sm:"h-8 px-1 text-xs",default:"h-10 px-2",lg:"h-12 px-4"}},defaultVariants:{size:"default"}}),b=l.forwardRef(({className:e,size:a,...t},o)=>r.jsx("th",{ref:o,className:s.cn(T({size:a,className:e})),...t}));b.displayName="TableHead";const y=c.cva("align-middle",{variants:{size:{sm:"p-1",default:"p-2",lg:"p-4"}},defaultVariants:{size:"default"}}),h=l.forwardRef(({className:e,size:a,...t},o)=>r.jsx("td",{ref:o,className:s.cn(y({size:a,className:e})),...t}));h.displayName="TableCell";const v=l.forwardRef(({className:e,...a},t)=>r.jsx("caption",{ref:t,className:s.cn("mt-4 text-sm text-muted-foreground",e),...a}));v.displayName="TableCaption";const j=l.forwardRef(({title:e,isSorted:a,direction:t,setSort:o,placement:i="right",children:N,className:w,..._},R)=>r.jsx(b,{ref:R,className:w,..._,children:r.jsx(n.TooltipProvider,{children:r.jsxs(n.Tooltip,{delayDuration:200,children:[r.jsx(n.TooltipTrigger,{asChild:!0,children:r.jsxs("div",{className:s.cn("group flex items-center gap-1 w-fit cursor-pointer hover:text-foreground",i==="left"?"flex-row-reverse":"flex-row"),onClick:()=>o(t==="asc"?"desc":"asc"),children:[N,r.jsx(q.Button,{variant:"text",size:"auto",className:a?void 0:"opacity-0 group-hover:opacity-100",children:r.jsx(H.FaIcon,{icon:a&&t==="asc"?d.faCaretUp:d.faCaretDown,className:"size-3 text-muted-foreground transition-opacity duration-200"})})]})}),r.jsxs(n.TooltipContent,{side:"top",children:["Sort by ",e]})]})})}));j.displayName="SortingTableHead";exports.SortingTableHead=j;exports.Table=u;exports.TableBody=m;exports.TableCaption=v;exports.TableCell=h;exports.TableFooter=x;exports.TableHead=b;exports.TableHeader=p;exports.TableRow=g;exports.tableCellVariants=y;exports.tableHeadVariants=T;exports.tableVariants=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("class-variance-authority"),S=require("react"),u=require("@fortawesome/free-solid-svg-icons"),V=require("../icons/fa-icon.cjs");require("../tooltip/simple-tooltip.cjs");const l=require("../tooltip/tooltip.cjs");require("@gearbox-protocol/sdk");const s=require("../../utils/cn.cjs");require("sonner");require("luxon");require("../../utils/z-index.cjs");function z(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(a,e,o.get?o:{enumerable:!0,get:()=>t[e]})}}return a.default=t,Object.freeze(a)}const n=z(S),p=c.cva("w-full caption-bottom",{variants:{size:{sm:"text-xs",default:"text-sm",lg:"text-base"}},defaultVariants:{size:"default"}}),m=n.forwardRef(({className:t,size:a,wrapperClassName:e,...o},i)=>r.jsx("div",{className:s.cn("relative w-full overflow-auto rounded-lg border border-input bg-card",e),children:r.jsx("table",{ref:i,className:s.cn(p({size:a,className:t})),...o})}));m.displayName="Table";const x=n.forwardRef(({className:t,...a},e)=>r.jsx("thead",{ref:e,className:s.cn("[&_tr]:after:inset-x-0 [&_tr]:after:bg-input [&_tr]:hover:bg-transparent [&_tr]:hover:before:opacity-0",t),...a}));x.displayName="TableHeader";const g=n.forwardRef(({className:t,...a},e)=>r.jsx("tbody",{ref:e,className:s.cn("[&_tr:last-child]:after:hidden",t),...a}));g.displayName="TableBody";const T=n.forwardRef(({className:t,...a},e)=>r.jsx("tfoot",{ref:e,className:s.cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...a}));T.displayName="TableFooter";const y=n.forwardRef(({className:t,...a},e)=>r.jsx("tr",{ref:e,className:s.cn("relative isolate transition-colors data-[state=selected]:bg-muted","before:absolute before:inset-0 before:-z-10 before:bg-muted/50 before:opacity-0 before:transition-opacity before:pointer-events-none","hover:before:opacity-100","after:absolute after:bottom-0 after:inset-x-3 after:h-px after:bg-border",t),...a}));y.displayName="TableRow";const h=c.cva("border-b bg-muted/50 text-left align-middle font-medium text-muted-foreground border-input",{variants:{size:{sm:"h-8 px-1 text-xs",default:"h-10 px-2",lg:"h-12 px-4"}},defaultVariants:{size:"default"}}),d=n.forwardRef(({className:t,size:a,...e},o)=>r.jsx("th",{ref:o,className:s.cn(h({size:a,className:t})),...e}));d.displayName="TableHead";const j=c.cva("align-middle",{variants:{size:{sm:"p-1",default:"p-2",lg:"p-4"}},defaultVariants:{size:"default"}}),N=n.forwardRef(({className:t,size:a,...e},o)=>r.jsx("td",{ref:o,className:s.cn(j({size:a,className:t})),...e}));N.displayName="TableCell";const v=n.forwardRef(({className:t,...a},e)=>r.jsx("caption",{ref:e,className:s.cn("mt-4 text-sm text-muted-foreground",t),...a}));v.displayName="TableCaption";const w=n.forwardRef(function({title:a,isSorted:e,direction:o,setSort:i,placement:b="right",children:R,className:C,..._},q){const H=e&&o==="asc"?u.faCaretUp:u.faCaretDown,f=r.jsx("span",{className:s.cn("inline-flex items-center transition-opacity",e?"opacity-100":"opacity-0 group-hover:opacity-100"),children:r.jsx(V.FaIcon,{icon:H,className:"size-3 text-muted-foreground"})});return r.jsx(d,{ref:q,className:C,..._,children:r.jsx(l.TooltipProvider,{children:r.jsxs(l.Tooltip,{delayDuration:200,children:[r.jsx(l.TooltipTrigger,{asChild:!0,children:r.jsxs("button",{type:"button",onClick:()=>i(o==="asc"?"desc":"asc"),className:s.cn("group inline-flex items-center gap-1 text-sm font-medium text-muted-foreground","cursor-pointer hover:text-foreground transition-colors"),children:[b==="left"&&f,R,b==="right"&&f]})}),r.jsxs(l.TooltipContent,{side:"top",children:["Sort by ",a]})]})})})});w.displayName="SortingTableHead";exports.SortingTableHead=w;exports.Table=m;exports.TableBody=g;exports.TableCaption=v;exports.TableCell=N;exports.TableFooter=T;exports.TableHead=d;exports.TableHeader=x;exports.TableRow=y;exports.tableCellVariants=j;exports.tableHeadVariants=h;exports.tableVariants=p;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@gearbox-protocol/sdk"),i=require("react");function y({assets:t,quotas:c,prices:u,liquidationThresholds:n,underlyingToken:o,debt:e,quotasInfo:a,allowZeroDebt:f=!1,tokensList:l}){return{hf:i.useMemo(()=>{try{return e===0n&&!f?0:s.CreditAccountData_Legacy.calcHealthFactor({assets:t,quotas:c,prices:u,liquidationThresholds:n,underlyingToken:o,debt:e,quotasInfo:a,tokensList:l})}catch(r){return typeof r=="object"&&r!==null&&"reason"in r&&r.reason==="overflow"?Number.MAX_SAFE_INTEGER:0}},[t,c,u,n,o,e,a,f,l])}}exports.useHF=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@gearbox-protocol/sdk"),i=require("react");function F({assets:t,quotas:c,prices:u,liquidationThresholds:n,underlyingToken:o,debt:e,quotasInfo:a,allowZeroDebt:f=!1,tokensList:l}){return{hf:i.useMemo(()=>{try{return e===0n&&!f?0:s.CreditAccountDataUtils.calcHealthFactor({assets:t,quotas:c,prices:u,liquidationThresholds:n,underlyingToken:o,debt:e,quotasInfo:a,tokensList:l})}catch(r){return typeof r=="object"&&r!==null&&"reason"in r&&r.reason==="overflow"?Number.MAX_SAFE_INTEGER:0}},[t,c,u,n,o,e,a,f,l])}}exports.useHF=F;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("@gearbox-protocol/sdk"),C=require("react"),e=require("./utils.cjs"),d=35;function R({xMin:t,xMax:i,yMin:s,yMax:u,xLabel:r,yLabel:n,assets:a,quotas:c,prices:L,liquidationThresholds:o,quotasInfo:E,underlyingTokenAddress:_,debt:l,tokensList:P}){return C.useMemo(()=>{const x=i-t,N=u-s,p=x/d,m=N/d,D=Array.from(Array(d)),I={...L};return D.flatMap((G,O)=>{const T=t+O*p,f=t+(O+1)*p;return r&&(I[r.address]=A.toBN(String((T+f)/2),A.PRICE_DECIMALS_POW)),D.map((F,S)=>{const X=s+S*m,h=s+(S+1)*m;return n&&(I[n.address]=A.toBN(String((X+h)/2),A.PRICE_DECIMALS_POW)),{x:T,xEnd:f,y:X,yEnd:h,value:A.CreditAccountData_Legacy.calcHealthFactor({assets:a,quotas:c,prices:I,liquidationThresholds:o,underlyingToken:_,debt:l,quotasInfo:E,tokensList:P})}})})},[t,i,s,u,r,n,a,c,L,o,_,l,E,P])}function U({prices:t}){const[i,s]=C.useState({}),u=C.useMemo(()=>({...t,...i}),[t,i]),r=C.useCallback((n,a)=>{s({...i,[a]:n})},[i]);return[u,r]}function v({assets:t,liquidationThresholds:i,quotas:s,quotasInfo:u,tokensList:r,prices:n}){const[a]=e.useFixedAssets({assets:t,liquidationThresholds:i,quotas:s,quotasInfo:u}),[c,L]=e.usePriceInNumber({asset:a[0],tokensList:r,prices:n}),[o,E]=e.usePriceInNumber({asset:a[1],tokensList:r,prices:n}),_=e.useAxis({currentPrice:c,token:L}),l=e.useAxis({currentPrice:o,token:E});return{xAxis:_,yAxis:l,currentPoint:[c||e.DEFAULT_AXIS_MAX/2,o||e.DEFAULT_AXIS_MAX/2],fixedBalances:a}}exports.CELL_BAD=e.CELL_BAD;exports.CELL_CURRENT=e.CELL_CURRENT;exports.CELL_GOOD=e.CELL_GOOD;exports.CELL_HOVERED=e.CELL_HOVERED;exports.CELL_LIQUIDATION=e.CELL_LIQUIDATION;exports.CELL_OK=e.CELL_OK;exports.DEFAULT_AXIS_MAX=e.DEFAULT_AXIS_MAX;exports.DEFAULT_AXIS_MIN=e.DEFAULT_AXIS_MIN;exports.formatAxisLabel=e.formatAxisLabel;exports.formatAxisTipLabel=e.formatAxisTipLabel;exports.formatAxisTipPrice=e.formatAxisTipPrice;exports.getCellClass=e.getCellClass;exports.isPointInCell=e.isPointInCell;exports.useAxis=e.useAxis;exports.useFixedAssets=e.useFixedAssets;exports.useIsAxisInRelativeUnits=e.useIsAxisInRelativeUnits;exports.useLiquidationGraphActivePrice=e.useLiquidationGraphActivePrice;exports.useLiquidationGraphCurrentActiveValue=e.useLiquidationGraphCurrentActiveValue;exports.usePriceInNumber=e.usePriceInNumber;exports.useWithLiquidationGraphActivePrices=e.useWithLiquidationGraphActivePrices;exports.useEditPriceManually=U;exports.useLiquidationGraphParams=v;exports.useLiquidationHeatmap=R;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("@gearbox-protocol/sdk"),C=require("react"),e=require("./utils.cjs"),d=35;function N({xMin:t,xMax:i,yMin:s,yMax:a,xLabel:r,yLabel:n,assets:u,quotas:c,prices:L,liquidationThresholds:o,quotasInfo:E,underlyingTokenAddress:l,debt:_,tokensList:P}){return C.useMemo(()=>{const h=i-t,x=a-s,p=h/d,m=x/d,D=Array.from(Array(d)),I={...L};return D.flatMap((G,O)=>{const T=t+O*p,f=t+(O+1)*p;return r&&(I[r.address]=A.toBN(String((T+f)/2),A.PRICE_DECIMALS_POW)),D.map((F,S)=>{const U=s+S*m,X=s+(S+1)*m;return n&&(I[n.address]=A.toBN(String((U+X)/2),A.PRICE_DECIMALS_POW)),{x:T,xEnd:f,y:U,yEnd:X,value:A.CreditAccountDataUtils.calcHealthFactor({assets:u,quotas:c,prices:I,liquidationThresholds:o,underlyingToken:l,debt:_,quotasInfo:E,tokensList:P})}})})},[t,i,s,a,r,n,u,c,L,o,l,_,E,P])}function R({prices:t}){const[i,s]=C.useState({}),a=C.useMemo(()=>({...t,...i}),[t,i]),r=C.useCallback((n,u)=>{s({...i,[u]:n})},[i]);return[a,r]}function v({assets:t,liquidationThresholds:i,quotas:s,quotasInfo:a,tokensList:r,prices:n}){const[u]=e.useFixedAssets({assets:t,liquidationThresholds:i,quotas:s,quotasInfo:a}),[c,L]=e.usePriceInNumber({asset:u[0],tokensList:r,prices:n}),[o,E]=e.usePriceInNumber({asset:u[1],tokensList:r,prices:n}),l=e.useAxis({currentPrice:c,token:L}),_=e.useAxis({currentPrice:o,token:E});return{xAxis:l,yAxis:_,currentPoint:[c||e.DEFAULT_AXIS_MAX/2,o||e.DEFAULT_AXIS_MAX/2],fixedBalances:u}}exports.CELL_BAD=e.CELL_BAD;exports.CELL_CURRENT=e.CELL_CURRENT;exports.CELL_GOOD=e.CELL_GOOD;exports.CELL_HOVERED=e.CELL_HOVERED;exports.CELL_LIQUIDATION=e.CELL_LIQUIDATION;exports.CELL_OK=e.CELL_OK;exports.DEFAULT_AXIS_MAX=e.DEFAULT_AXIS_MAX;exports.DEFAULT_AXIS_MIN=e.DEFAULT_AXIS_MIN;exports.formatAxisLabel=e.formatAxisLabel;exports.formatAxisTipLabel=e.formatAxisTipLabel;exports.formatAxisTipPrice=e.formatAxisTipPrice;exports.getCellClass=e.getCellClass;exports.isPointInCell=e.isPointInCell;exports.useAxis=e.useAxis;exports.useFixedAssets=e.useFixedAssets;exports.useIsAxisInRelativeUnits=e.useIsAxisInRelativeUnits;exports.useLiquidationGraphActivePrice=e.useLiquidationGraphActivePrice;exports.useLiquidationGraphCurrentActiveValue=e.useLiquidationGraphCurrentActiveValue;exports.usePriceInNumber=e.usePriceInNumber;exports.useWithLiquidationGraphActivePrices=e.useWithLiquidationGraphActivePrices;exports.useEditPriceManually=R;exports.useLiquidationGraphParams=v;exports.useLiquidationHeatmap=N;
@@ -0,0 +1 @@
1
+ "use strict";
@@ -1,17 +1,16 @@
1
- import { jsx as r, jsxs as d } from "react/jsx-runtime";
2
- import { cva as n } from "class-variance-authority";
3
- import * as l from "react";
4
- import { Button as g } from "../buttons/button/button.js";
5
- import { faCaretUp as x, faCaretDown as f } from "@fortawesome/free-solid-svg-icons";
6
- import { FaIcon as h } from "../icons/fa-icon.js";
1
+ import { jsx as r, jsxs as n } from "react/jsx-runtime";
2
+ import { cva as d } from "class-variance-authority";
3
+ import * as i from "react";
4
+ import { faCaretUp as h, faCaretDown as T } from "@fortawesome/free-solid-svg-icons";
5
+ import { FaIcon as y } from "../icons/fa-icon.js";
7
6
  import "../tooltip/simple-tooltip.js";
8
- import { TooltipProvider as T, Tooltip as y, TooltipTrigger as N, TooltipContent as v } from "../tooltip/tooltip.js";
7
+ import { TooltipProvider as N, Tooltip as v, TooltipTrigger as w, TooltipContent as R } from "../tooltip/tooltip.js";
9
8
  import "@gearbox-protocol/sdk";
10
9
  import { cn as o } from "../../utils/cn.js";
11
10
  import "sonner";
12
11
  import "luxon";
13
12
  import "../../utils/z-index.js";
14
- const w = n("w-full caption-bottom", {
13
+ const C = d("w-full caption-bottom", {
15
14
  variants: {
16
15
  size: {
17
16
  sm: "text-xs",
@@ -22,77 +21,77 @@ const w = n("w-full caption-bottom", {
22
21
  defaultVariants: {
23
22
  size: "default"
24
23
  }
25
- }), R = l.forwardRef(
26
- ({ className: a, size: e, wrapperClassName: t, ...i }, s) => /* @__PURE__ */ r(
24
+ }), z = i.forwardRef(
25
+ ({ className: a, size: t, wrapperClassName: e, ...l }, s) => /* @__PURE__ */ r(
27
26
  "div",
28
27
  {
29
28
  className: o(
30
29
  "relative w-full overflow-auto rounded-lg border border-input bg-card",
31
- t
30
+ e
32
31
  ),
33
32
  children: /* @__PURE__ */ r(
34
33
  "table",
35
34
  {
36
35
  ref: s,
37
- className: o(w({ size: e, className: a })),
38
- ...i
36
+ className: o(C({ size: t, className: a })),
37
+ ...l
39
38
  }
40
39
  )
41
40
  }
42
41
  )
43
42
  );
44
- R.displayName = "Table";
45
- const C = l.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ r(
43
+ z.displayName = "Table";
44
+ const H = i.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ r(
46
45
  "thead",
47
46
  {
48
- ref: t,
47
+ ref: e,
49
48
  className: o(
50
49
  "[&_tr]:after:inset-x-0 [&_tr]:after:bg-input [&_tr]:hover:bg-transparent [&_tr]:hover:before:opacity-0",
51
50
  a
52
51
  ),
53
- ...e
52
+ ...t
54
53
  }
55
54
  ));
56
- C.displayName = "TableHeader";
57
- const z = l.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ r(
55
+ H.displayName = "TableHeader";
56
+ const V = i.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ r(
58
57
  "tbody",
59
58
  {
60
- ref: t,
59
+ ref: e,
61
60
  className: o("[&_tr:last-child]:after:hidden", a),
62
- ...e
61
+ ...t
63
62
  }
64
63
  ));
65
- z.displayName = "TableBody";
66
- const H = l.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ r(
64
+ V.displayName = "TableBody";
65
+ const _ = i.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ r(
67
66
  "tfoot",
68
67
  {
69
- ref: t,
68
+ ref: e,
70
69
  className: o(
71
70
  "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
72
71
  a
73
72
  ),
74
- ...e
73
+ ...t
75
74
  }
76
75
  ));
77
- H.displayName = "TableFooter";
78
- const V = l.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ r(
76
+ _.displayName = "TableFooter";
77
+ const F = i.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ r(
79
78
  "tr",
80
79
  {
81
- ref: t,
80
+ ref: e,
82
81
  className: o(
83
82
  "relative isolate transition-colors data-[state=selected]:bg-muted",
84
83
  // Hover background with rounded corners
85
- "before:absolute before:inset-0 before:-z-10 before:rounded-lg before:bg-muted/50 before:opacity-0 before:transition-opacity before:pointer-events-none",
84
+ "before:absolute before:inset-0 before:-z-10 before:bg-muted/50 before:opacity-0 before:transition-opacity before:pointer-events-none",
86
85
  "hover:before:opacity-100",
87
86
  // Border line that doesn't extend to rounded corners
88
87
  "after:absolute after:bottom-0 after:inset-x-3 after:h-px after:bg-border",
89
88
  a
90
89
  ),
91
- ...e
90
+ ...t
92
91
  }
93
92
  ));
94
- V.displayName = "TableRow";
95
- const _ = n(
93
+ F.displayName = "TableRow";
94
+ const S = d(
96
95
  "border-b bg-muted/50 text-left align-middle font-medium text-muted-foreground border-input",
97
96
  {
98
97
  variants: {
@@ -106,18 +105,18 @@ const _ = n(
106
105
  size: "default"
107
106
  }
108
107
  }
109
- ), m = l.forwardRef(
110
- ({ className: a, size: e, ...t }, i) => /* @__PURE__ */ r(
108
+ ), c = i.forwardRef(
109
+ ({ className: a, size: t, ...e }, l) => /* @__PURE__ */ r(
111
110
  "th",
112
111
  {
113
- ref: i,
114
- className: o(_({ size: e, className: a })),
115
- ...t
112
+ ref: l,
113
+ className: o(S({ size: t, className: a })),
114
+ ...e
116
115
  }
117
116
  )
118
117
  );
119
- m.displayName = "TableHead";
120
- const B = n("align-middle", {
118
+ c.displayName = "TableHead";
119
+ const j = d("align-middle", {
121
120
  variants: {
122
121
  size: {
123
122
  sm: "p-1",
@@ -128,83 +127,81 @@ const B = n("align-middle", {
128
127
  defaultVariants: {
129
128
  size: "default"
130
129
  }
131
- }), F = l.forwardRef(
132
- ({ className: a, size: e, ...t }, i) => /* @__PURE__ */ r(
130
+ }), B = i.forwardRef(
131
+ ({ className: a, size: t, ...e }, l) => /* @__PURE__ */ r(
133
132
  "td",
134
133
  {
135
- ref: i,
136
- className: o(B({ size: e, className: a })),
137
- ...t
134
+ ref: l,
135
+ className: o(j({ size: t, className: a })),
136
+ ...e
138
137
  }
139
138
  )
140
139
  );
141
- F.displayName = "TableCell";
142
- const j = l.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ r(
140
+ B.displayName = "TableCell";
141
+ const D = i.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ r(
143
142
  "caption",
144
143
  {
145
- ref: t,
144
+ ref: e,
146
145
  className: o("mt-4 text-sm text-muted-foreground", a),
147
- ...e
146
+ ...t
148
147
  }
149
148
  ));
150
- j.displayName = "TableCaption";
151
- const D = l.forwardRef(
152
- ({
153
- title: a,
154
- isSorted: e,
155
- direction: t,
156
- setSort: i,
157
- placement: s = "right",
158
- children: b,
159
- className: c,
160
- ...p
161
- }, u) => /* @__PURE__ */ r(m, { ref: u, className: c, ...p, children: /* @__PURE__ */ r(T, { children: /* @__PURE__ */ d(y, { delayDuration: 200, children: [
162
- /* @__PURE__ */ r(N, { asChild: !0, children: /* @__PURE__ */ d(
163
- "div",
149
+ D.displayName = "TableCaption";
150
+ const I = i.forwardRef(function({
151
+ title: t,
152
+ isSorted: e,
153
+ direction: l,
154
+ setSort: s,
155
+ placement: f = "right",
156
+ children: b,
157
+ className: p,
158
+ ...u
159
+ }, g) {
160
+ const x = e && l === "asc" ? h : T, m = /* @__PURE__ */ r(
161
+ "span",
162
+ {
163
+ className: o(
164
+ "inline-flex items-center transition-opacity",
165
+ e ? "opacity-100" : "opacity-0 group-hover:opacity-100"
166
+ ),
167
+ children: /* @__PURE__ */ r(y, { icon: x, className: "size-3 text-muted-foreground" })
168
+ }
169
+ );
170
+ return /* @__PURE__ */ r(c, { ref: g, className: p, ...u, children: /* @__PURE__ */ r(N, { children: /* @__PURE__ */ n(v, { delayDuration: 200, children: [
171
+ /* @__PURE__ */ r(w, { asChild: !0, children: /* @__PURE__ */ n(
172
+ "button",
164
173
  {
174
+ type: "button",
175
+ onClick: () => s(l === "asc" ? "desc" : "asc"),
165
176
  className: o(
166
- "group flex items-center gap-1 w-fit cursor-pointer hover:text-foreground",
167
- s === "left" ? "flex-row-reverse" : "flex-row"
177
+ "group inline-flex items-center gap-1 text-sm font-medium text-muted-foreground",
178
+ "cursor-pointer hover:text-foreground transition-colors"
168
179
  ),
169
- onClick: () => i(t === "asc" ? "desc" : "asc"),
170
180
  children: [
181
+ f === "left" && m,
171
182
  b,
172
- /* @__PURE__ */ r(
173
- g,
174
- {
175
- variant: "text",
176
- size: "auto",
177
- className: e ? void 0 : "opacity-0 group-hover:opacity-100",
178
- children: /* @__PURE__ */ r(
179
- h,
180
- {
181
- icon: e ? t === "asc" ? x : f : f,
182
- className: "size-3 text-muted-foreground transition-opacity duration-200"
183
- }
184
- )
185
- }
186
- )
183
+ f === "right" && m
187
184
  ]
188
185
  }
189
186
  ) }),
190
- /* @__PURE__ */ d(v, { side: "top", children: [
187
+ /* @__PURE__ */ n(R, { side: "top", children: [
191
188
  "Sort by ",
192
- a
189
+ t
193
190
  ] })
194
- ] }) }) })
195
- );
196
- D.displayName = "SortingTableHead";
191
+ ] }) }) });
192
+ });
193
+ I.displayName = "SortingTableHead";
197
194
  export {
198
- D as SortingTableHead,
199
- R as Table,
200
- z as TableBody,
201
- j as TableCaption,
202
- F as TableCell,
203
- H as TableFooter,
204
- m as TableHead,
205
- C as TableHeader,
206
- V as TableRow,
207
- B as tableCellVariants,
208
- _ as tableHeadVariants,
209
- w as tableVariants
195
+ I as SortingTableHead,
196
+ z as Table,
197
+ V as TableBody,
198
+ D as TableCaption,
199
+ B as TableCell,
200
+ _ as TableFooter,
201
+ c as TableHead,
202
+ H as TableHeader,
203
+ F as TableRow,
204
+ j as tableCellVariants,
205
+ S as tableHeadVariants,
206
+ C as tableVariants
210
207
  };
@@ -1,6 +1,6 @@
1
- import { CreditAccountData_Legacy as l } from "@gearbox-protocol/sdk";
1
+ import { CreditAccountDataUtils as l } from "@gearbox-protocol/sdk";
2
2
  import { useMemo as p } from "react";
3
- function _({
3
+ function i({
4
4
  assets: e,
5
5
  quotas: c,
6
6
  prices: n,
@@ -39,5 +39,5 @@ function _({
39
39
  ]) };
40
40
  }
41
41
  export {
42
- _ as useHF
42
+ i as useHF
43
43
  };
@@ -1,34 +1,34 @@
1
- import { toBN as v, PRICE_DECIMALS_POW as R, CreditAccountData_Legacy as U } from "@gearbox-protocol/sdk";
2
- import { useMemo as G, useState as g, useCallback as F } from "react";
3
- import { useFixedAssets as Y, usePriceInNumber as S, useAxis as X, DEFAULT_AXIS_MAX as x } from "./utils.js";
4
- import { CELL_BAD as J, CELL_CURRENT as Z, CELL_GOOD as $, CELL_HOVERED as b, CELL_LIQUIDATION as j, CELL_OK as M, DEFAULT_AXIS_MIN as tt, formatAxisLabel as et, formatAxisTipLabel as rt, formatAxisTipPrice as it, getCellClass as nt, isPointInCell as st, useIsAxisInRelativeUnits as ct, useLiquidationGraphActivePrice as ot, useLiquidationGraphCurrentActiveValue as at, useWithLiquidationGraphActivePrices as ut } from "./utils.js";
1
+ import { toBN as v, PRICE_DECIMALS_POW as R, CreditAccountDataUtils as T } from "@gearbox-protocol/sdk";
2
+ import { useMemo as x, useState as F, useCallback as Y } from "react";
3
+ import { useFixedAssets as g, usePriceInNumber as S, useAxis as U, DEFAULT_AXIS_MAX as X } from "./utils.js";
4
+ import { CELL_BAD as J, CELL_CURRENT as Z, CELL_GOOD as $, CELL_HOVERED as b, CELL_LIQUIDATION as j, CELL_OK as M, DEFAULT_AXIS_MIN as tt, formatAxisLabel as et, formatAxisTipLabel as rt, formatAxisTipPrice as it, getCellClass as st, isPointInCell as nt, useIsAxisInRelativeUnits as ct, useLiquidationGraphActivePrice as ot, useLiquidationGraphCurrentActiveValue as at, useWithLiquidationGraphActivePrices as ut } from "./utils.js";
5
5
  const m = 35;
6
- function W({
6
+ function y({
7
7
  xMin: t,
8
8
  xMax: e,
9
9
  yMin: r,
10
10
  yMax: c,
11
11
  xLabel: i,
12
- yLabel: n,
13
- assets: s,
12
+ yLabel: s,
13
+ assets: n,
14
14
  quotas: o,
15
15
  prices: u,
16
16
  liquidationThresholds: a,
17
17
  quotasInfo: A,
18
18
  underlyingTokenAddress: p,
19
19
  debt: E,
20
- tokensList: l
20
+ tokensList: L
21
21
  }) {
22
- return G(() => {
23
- const N = e - t, T = c - r, d = N / m, C = T / m, P = Array.from(Array(m)), L = { ...u };
22
+ return x(() => {
23
+ const G = e - t, N = c - r, d = G / m, C = N / m, P = Array.from(Array(m)), l = { ...u };
24
24
  return P.flatMap((B, _) => {
25
25
  const f = t + _ * d, I = t + (_ + 1) * d;
26
- return i && (L[i.address] = v(
26
+ return i && (l[i.address] = v(
27
27
  String((f + I) / 2),
28
28
  R
29
29
  )), P.map((H, D) => {
30
30
  const O = r + D * C, h = r + (D + 1) * C;
31
- return n && (L[n.address] = v(
31
+ return s && (l[s.address] = v(
32
32
  String((O + h) / 2),
33
33
  R
34
34
  )), {
@@ -36,15 +36,15 @@ function W({
36
36
  xEnd: I,
37
37
  y: O,
38
38
  yEnd: h,
39
- value: U.calcHealthFactor({
40
- assets: s,
39
+ value: T.calcHealthFactor({
40
+ assets: n,
41
41
  quotas: o,
42
- prices: L,
42
+ prices: l,
43
43
  liquidationThresholds: a,
44
44
  underlyingToken: p,
45
45
  debt: E,
46
46
  quotasInfo: A,
47
- tokensList: l
47
+ tokensList: L
48
48
  })
49
49
  };
50
50
  });
@@ -55,24 +55,24 @@ function W({
55
55
  r,
56
56
  c,
57
57
  i,
58
- n,
59
58
  s,
59
+ n,
60
60
  o,
61
61
  u,
62
62
  a,
63
63
  p,
64
64
  E,
65
65
  A,
66
- l
66
+ L
67
67
  ]);
68
68
  }
69
69
  function K({ prices: t }) {
70
- const [e, r] = g({}), c = G(
70
+ const [e, r] = F({}), c = x(
71
71
  () => ({ ...t, ...e }),
72
72
  [t, e]
73
- ), i = F(
74
- (n, s) => {
75
- r({ ...e, [s]: n });
73
+ ), i = Y(
74
+ (s, n) => {
75
+ r({ ...e, [n]: s });
76
76
  },
77
77
  [e]
78
78
  );
@@ -84,30 +84,30 @@ function Q({
84
84
  quotas: r,
85
85
  quotasInfo: c,
86
86
  tokensList: i,
87
- prices: n
87
+ prices: s
88
88
  }) {
89
- const [s] = Y({
89
+ const [n] = g({
90
90
  assets: t,
91
91
  liquidationThresholds: e,
92
92
  quotas: r,
93
93
  quotasInfo: c
94
94
  }), [o, u] = S({
95
- asset: s[0],
95
+ asset: n[0],
96
96
  tokensList: i,
97
- prices: n
97
+ prices: s
98
98
  }), [a, A] = S({
99
- asset: s[1],
99
+ asset: n[1],
100
100
  tokensList: i,
101
- prices: n
102
- }), p = X({ currentPrice: o, token: u }), E = X({ currentPrice: a, token: A });
101
+ prices: s
102
+ }), p = U({ currentPrice: o, token: u }), E = U({ currentPrice: a, token: A });
103
103
  return {
104
104
  xAxis: p,
105
105
  yAxis: E,
106
106
  currentPoint: [
107
- o || x / 2,
108
- a || x / 2
107
+ o || X / 2,
108
+ a || X / 2
109
109
  ],
110
- fixedBalances: s
110
+ fixedBalances: n
111
111
  };
112
112
  }
113
113
  export {
@@ -117,21 +117,21 @@ export {
117
117
  b as CELL_HOVERED,
118
118
  j as CELL_LIQUIDATION,
119
119
  M as CELL_OK,
120
- x as DEFAULT_AXIS_MAX,
120
+ X as DEFAULT_AXIS_MAX,
121
121
  tt as DEFAULT_AXIS_MIN,
122
122
  et as formatAxisLabel,
123
123
  rt as formatAxisTipLabel,
124
124
  it as formatAxisTipPrice,
125
- nt as getCellClass,
126
- st as isPointInCell,
127
- X as useAxis,
125
+ st as getCellClass,
126
+ nt as isPointInCell,
127
+ U as useAxis,
128
128
  K as useEditPriceManually,
129
- Y as useFixedAssets,
129
+ g as useFixedAssets,
130
130
  ct as useIsAxisInRelativeUnits,
131
131
  ot as useLiquidationGraphActivePrice,
132
132
  at as useLiquidationGraphCurrentActiveValue,
133
133
  Q as useLiquidationGraphParams,
134
- W as useLiquidationHeatmap,
134
+ y as useLiquidationHeatmap,
135
135
  S as usePriceInNumber,
136
136
  ut as useWithLiquidationGraphActivePrices
137
137
  };
@@ -0,0 +1 @@
1
+