@gearbox-protocol/ui-kit 3.14.0-next.1 → 3.14.0-next.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/buttons/button/button.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-button/styled-button.cjs +1 -1
- package/dist/cjs/components/graph/formatters.cjs +1 -1
- package/dist/cjs/components/layout/main-aside-layout/main-aside-layout.cjs +1 -1
- package/dist/cjs/components/smart-number-input/smart-number-input.cjs +1 -1
- package/dist/cjs/components/trading-view/trading-view.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/esm/components/buttons/button/button.js +1 -0
- package/dist/esm/components/client-adapters/styled-button/styled-button.js +11 -11
- package/dist/esm/components/graph/formatters.js +127 -132
- package/dist/esm/components/health-factor/health-factor.js +3 -3
- package/dist/esm/components/layout/main-aside-layout/main-aside-layout.js +78 -55
- package/dist/esm/components/smart-number-input/smart-number-input.js +253 -104
- package/dist/esm/components/trading-view/trading-view.js +58 -58
- package/dist/esm/locale/en.json.js +2 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/buttons/button/button.d.ts +4 -3
- package/dist/types/components/help-tip/help-tip.d.ts +2 -2
- package/dist/types/components/layout/main-aside-layout/main-aside-layout.d.ts +34 -0
- package/dist/types/components/smart-number-input/smart-number-input.d.ts +52 -0
- package/dist/types/components/tip-card/tip-card.d.ts +1 -1
- package/dist/types/locale/en.json.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react/jsx-runtime"),y=require("@radix-ui/react-slot"),f=require("class-variance-authority"),h=require("react");require("@gearbox-protocol/sdk");const t=require("../../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../../utils/z-index.cjs");function v(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const d=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,d.get?d:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const m=v(h),i=f.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors cursor-pointer disabled:!cursor-not-allowed [&_svg]:pointer-events-none [&_svg:not([style*='width']):not([style*='height'])]:size-4 [&_svg]:shrink-0 border border-transparent outline-none focus-visible:outline-none",{variants:{variant:{default:t.cn("text-primary-foreground bg-primary border border-primary","hover:bg-accent hover:border-accent","disabled:text-secondary-foreground disabled:bg-gray-20 disabled:border-gray-20"),destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 disabled:opacity-50",outline:t.cn("text-primary-foreground bg-transparent border border-gray-40","hover:bg-gray-60 hover:border-gray-60","disabled:text-secondary-foreground disabled:bg-gray-20 disabled:border-gray-20"),secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80 disabled:opacity-50",ghost:"hover:bg-secondary hover:text-accent-foreground disabled:opacity-50",white:t.cn("font-medium text-white-foreground bg-white border border-white","shadow-[0_1px_1px_0_rgba(0,0,0,0.15)]","hover:shadow-[0_3px_3px_0_rgba(0,0,0,0.25)]","disabled:text-gray-80 disabled:bg-gray-110 disabled:border-gray-110","disabled:shadow-[0_1px_1px_0_rgba(0,0,0,0.15)]"),neutral:t.cn("text-primary-foreground bg-gray-60 border border-gray-60","hover:bg-gray-90 hover:border-gray-90","disabled:text-secondary-foreground disabled:bg-gray-20 disabled:border-gray-20"),success:t.cn("font-medium text-success-foreground bg-success border border-success","hover:bg-success-hover hover:border-success-hover","disabled:text-secondary-foreground disabled:bg-gray-20 disabled:border-gray-20"),link:"text-primary underline-offset-4 hover:underline disabled:opacity-50",text:"text-muted-foreground hover:text-foreground hover:bg-transparent disabled:opacity-50",pink:"bg-pink-700 hover:bg-pink-600 disabled:bg-pink-700 text-primary-foreground disabled:opacity-50","pink-outline":"border-pink-700 hover:border-pink-600 disabled:border-pink-700 text-foreground disabled:opacity-50",blue:"bg-blue-800 hover:bg-blue-700 disabled:bg-blue-700 text-primary-foreground disabled:opacity-50","blue-outline":"border-blue-800 hover:border-blue-700 disabled:border-blue-800 text-foreground disabled:opacity-50"},size:{auto:"h-auto p-1.5",xs:"px-3 py-0.5 text-xs rounded-full",sm:"h-7 px-3 !text-xs !leading-[14px] rounded-[6px]",md:"h-8 px-3.5 !text-sm !leading-4 rounded-[8px]",default:"px-4 h-[40px] !text-[15px] !leading-[18px] rounded-[12px]",lg:"px-4 h-[44px] !text-[16px] !leading-[19px] rounded-[22px]",icon:"h-9 w-9 p-2"},width:{compact:"w-auto",wide:"w-full"}},defaultVariants:{variant:"default",size:"default",width:"compact"}}),s=m.forwardRef(({className:e,variant:o,size:r,width:d,asChild:b=!1,disabled:n,onClick:u,...c},l)=>{const g=b?y.Slot:"button",p=a=>{if(n){a.preventDefault(),a.stopPropagation();return}u?.(a)};return x.jsx(g,{className:t.cn(i({variant:o,size:r,className:e,width:d})),ref:l,disabled:n,onClick:p,...c})});s.displayName="Button";exports.Button=s;exports.buttonVariants=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),s=require("react"),a=require("../../buttons/button/button.cjs");require("@gearbox-protocol/sdk");const l=require("../../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../../utils/z-index.cjs");function d(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const f=d(s),m={primary:"default",outlined:"outline",neutral:"neutral",white:"white",success:"success"},u=f.forwardRef(({$size:e="lg",$width:r="compact",$color:t="primary",className:n,...o},c)=>i.jsx(a.Button,{ref:c,size:e,width:r,variant:m[t],className:l.cn("inline-block whitespace-normal",n),...o}));u.displayName="StyledButton";exports.StyledButton=u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("lightweight-charts"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("lightweight-charts"),S=require("luxon"),h=require("../../utils/format-number.cjs"),{MIN_DISPLAY_THRESHOLD:M,MAX_EXPONENTIAL_THRESHOLD:_}=h.FORMAT_CONSTANTS,O=(t,e,a="full")=>{if(h.isBelowDisplayThreshold(t))return e?`<${M}${e}`:`<${M}`;if(t===0)return e?`0${e}`:"0";const r=h.formatNumberWithSuffix(t,{maxExponentialThreshold:_,minimumFractionDigits:0,maximumFractionDigits:a==="short"?1:0,format:a,adaptiveDecimals:a==="short"});return e?`${r}${e}`:r},X=2,p=(t,e)=>{if(h.isBelowDisplayThreshold(t))return e?`<${M}${e}`:`<${M}`;if(t===0)return e?`0${e}`:"0";const a=h.toSignificantDigits(t,X);return e?`${a}${e}`:a},w=4,y=t=>{if(h.isBelowDisplayThreshold(t))return`<${M}`;if(t===0)return"0";const e=Math.round(t),a=Math.abs(t-e);return a>0&&a<.01?t.toFixed(12).replace(/0+$/,"").replace(/\.$/,""):h.toSignificantDigits(t,w)},P=(t,e)=>{if(h.isBelowDisplayThreshold(t))return e?`<${M} ${e}`:`<${M}`;if(t===0)return e?`0 ${e}`:"0";const a=Number.isInteger(t),r=Math.abs(t),s=a&&r>=1e3,i=Math.round(t),o=Math.abs(t-i);if(o>0&&o<.01&&!s){const D=t.toFixed(12).replace(/0+$/,"").replace(/\.$/,"");return e?`${D} ${e}`:D}const F=h.formatNumberWithSuffix(t,{maxExponentialThreshold:_,minimumFractionDigits:a?0:2,maximumFractionDigits:s?1:a?0:2,format:s?"short":"full",adaptiveDecimals:s});return e?`${F} ${e}`:F},E={"%":p,$:O,token:P,none:y},b=t=>E[t]||E.token;function C(t,e,a=4){if(t===0)return e?`0 ${e}`:"0";const r=e&&Math.abs(t)>=1e3?0:a,s=t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:r});return e?`${s} ${e}`:s}function U(t,e,a){const r=a?.yScaleMin;let s=t.length>0?Math.min(...t):0,i=t.length>0?Math.max(...t):0,o=[];const u=()=>{const n=(s+i)/2;let c=1,m="";return n>=1e9?(c=1e9,m="B"):n>=1e6?(c=1e6,m="M"):n>=1e3&&(c=1e3,m="K"),{scale:c,suffix:m}},F=8,D=.02;let x=0;const A=(n,c,m,d)=>{const l=(c>1?n/c:n).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:d,useGrouping:!1});return c>1?`${l}${m}`:l},H=(n,c,m)=>{for(let d=0;d<=F;d++){const g=new Set;let l=!0;for(const $ of n){const f=A($,c,m,d);if(g.has(f)){l=!1;break}g.add(f)}if(l)return d}return F},R=n=>{if(r!==void 0&&n<r)return"";if(n===0)return"0";const{scale:c,suffix:m}=u();return A(n,c,m,x)};return{formatter:n=>R(n),tickmarksFormatter:n=>{const{scale:c,suffix:m}=u(),d=i-s,g=d>0?o.filter(f=>Math.abs(f)>=d*D):o,l=n.filter(f=>f!==0&&!(r!==void 0&&f<r));x=H([...l,...g],c,m);const $=new Set;return n.map(f=>{if(r!==void 0&&f<r)return"";const k=f===0?"0":A(f,c,m,x);return!k||$.has(k)?"":($.add(k),k)})},updateVisibleRange:n=>{n.length>0&&(s=Math.min(...n),i=Math.max(...n))},updateLastValues:n=>{o=[...n]}}}const L=t=>S.DateTime.fromSeconds(Number(t)).toFormat("dd/LL/yyyy HH:mm"),Y=t=>S.DateTime.fromSeconds(Number(t)).toFormat("HH:mm"),q=(t,e)=>p(Number(t),e),N={time:L,"%":q};function B(t){const e=new Map;return(a,r,s)=>{const i=S.DateTime.fromSeconds(Number(a));let o;if(t===0)o=i.toFormat("HH:mm");else switch(r){case T.TickMarkType.Year:o=i.toFormat("yyyy");break;case T.TickMarkType.Month:o=i.toFormat("MMM yy");break;case T.TickMarkType.DayOfMonth:o=t>365?i.toFormat("dd MMM yy"):i.toFormat("dd MMM");break;case T.TickMarkType.Time:case T.TickMarkType.TimeWithSeconds:o=i.toFormat("HH:mm");break;default:o=i.toFormat("dd MMM")}let u=e.get(r);return u||(u=new Set,e.set(r,u)),u.has(o)?" ":(u.add(o),o)}}const I=(t,e)=>{if(t==="time"&&e&&e.length>0){const r=S.DateTime.fromSeconds(Number(e[0].time)),s=S.DateTime.fromSeconds(Number(e[e.length-1].time)),i=r.hasSame(s,"day"),o=i?0:Math.ceil(s.diff(r,"days").days);return{timeFormatter:i?Y:L,tickMarkFormatter:B(o)}}const a=N[t]||N.time;return{timeFormatter:a,tickMarkFormatter:r=>a(r,void 0)}},G=(t,e)=>I(t,e).timeFormatter;exports.createAdaptiveYAxisFormatter=U;exports.formatExactValue=C;exports.getXFormatter=G;exports.getXFormatters=I;exports.getYFormatter=b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("react"),r=require("../../../utils/cn.cjs");function b(l){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const x in l)if(x!=="default"){const t=Object.getOwnPropertyDescriptor(l,x);Object.defineProperty(n,x,t.get?t:{enumerable:!0,get:()=>l[x]})}}return n.default=l,Object.freeze(n)}const N=b(j),o=N.forwardRef(({children:l,aside:n,asidePosition:x="right",asideClassName:t,mainClassName:f,mainRef:c,variant:u="default",centeredMain:w=!1,className:g,...d},v)=>{const a=u==="detail",s=x==="left",m=a&&w,i=n==null?null:e.jsx("aside",{className:r.cn("min-w-0 shrink-0",a&&!m&&["w-full","z-30 lg:w-[420px] lg:min-w-[420px] lg:max-w-[420px]","xl:w-[460px] xl:min-w-[460px] xl:max-w-[460px]","max-h-full lg:max-h-[100vh] overflow-y-visible lg:overflow-y-auto","lg:max-[2449px]:sticky lg:max-[2449px]:top-4","min-[2450px]:fixed min-[2450px]:top-28",s?"min-[2450px]:left-32":"min-[2450px]:right-32"],m&&["w-full","z-30 lg:w-[420px] lg:min-w-[420px] lg:max-w-[420px]","xl:w-[460px] xl:min-w-[460px] xl:max-w-[460px]","overflow-y-visible lg:max-h-[100vh] lg:overflow-y-auto","lg:max-[1799px]:sticky lg:max-[1799px]:top-4","min-[1800px]:absolute min-[1800px]:top-0",s?"min-[1800px]:right-full min-[1800px]:mr-6":"min-[1800px]:left-full min-[1800px]:ml-6"],t),children:n}),y=r.cn("lg:contents","min-[1800px]:block min-[1800px]:relative min-[1800px]:mx-auto min-[1800px]:w-full","min-[1800px]:max-w-[min(80rem,calc(100vw-460px-1.5rem-4rem))]"),p=r.cn("relative z-0 min-w-0 w-full",!m&&"flex-1",a&&!m&&["relative z-0 w-full","min-[2450px]:mx-auto min-[2450px]:flex-none","min-[2450px]:max-w-[min(80rem,calc(100vw-460px-8rem))]",s&&"min-[2450px]:ml-[calc(460px+8rem)]"],m&&"flex-1 lg:max-w-none",f),h=x==="left"?e.jsxs(e.Fragment,{children:[i,e.jsx("div",{ref:c,className:p,children:l})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:c,className:p,children:l}),i]});return e.jsx("div",{ref:v,className:r.cn("flex w-full flex-col-reverse gap-6 lg:items-start",!m&&"lg:flex-row",a&&!m&&["relative mx-auto min-w-0","max-w-[calc(80rem+420px+1.5rem)]","xl:max-w-[calc(80rem+460px+1.5rem)]","min-[2450px]:block min-[2450px]:max-w-none min-[2450px]:gap-0"],m&&["relative mx-auto min-w-0 lg:flex-row","max-w-[calc(80rem+420px+1.5rem)] xl:max-w-[calc(80rem+460px+1.5rem)]","min-[1800px]:block min-[1800px]:max-w-none"],g),...d,children:m?e.jsx("div",{className:y,children:h}):e.jsxs(e.Fragment,{children:[x==="left"&&i,e.jsx("div",{ref:c,className:p,children:l}),x==="right"&&i]})})});o.displayName="MainAsideLayout";exports.MainAsideLayout=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),q=require("class-variance-authority"),de=require("react"),me=require("react-dom"),pe=require("../checkbox/checkbox.cjs");require("../checkbox/checkbox-labeled.cjs");const fe=require("../currency-button/currency-button.cjs"),he=require("../health-factor/health-factor.cjs"),xe=require("@fortawesome/free-solid-svg-icons"),ge=require("../icons/fa-icon.cjs"),be=require("../slider/slider.cjs");require("../slider/slider-context.cjs");const I=require("../typed-intl/index.cjs"),j=require("../../hooks/use-media-query.cjs"),v=require("../../test-ids/smart-number-input.cjs"),ve=require("../../utils/bn-to-input-view.cjs");require("@gearbox-protocol/sdk");const ye=require("../../utils/parse-input-to-bn.cjs"),y=require("../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../utils/z-index.cjs");const we=require("./balance-indicator.cjs");function Ne(n){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const o in n)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(r,o,a.get?a:{enumerable:!0,get:()=>n[o]})}}return r.default=n,Object.freeze(r)}const c=Ne(de),Ie=q.cva("relative w-full text-foreground bg-gray-20 border border-gray-30 transition-[background-color] duration-100 ease-linear [&:hover]:bg-gray-30 [&:hover]:border-gray-40 data-[active=true]:bg-gray-30 data-[active=true]:outline data-[active=true]:outline-2 data-[active=true]:outline-primary data-[active=true]:outline-offset-[-2px] data-[disabled=true]:cursor-not-allowed",{variants:{size:{sm:"px-3 py-[7px] min-h-[60px] rounded-[8px]",md:"pl-4 pr-3 py-[10px] min-h-[82px] rounded-lg"}},defaultVariants:{size:"md"}}),je=q.cva("font-medium text-foreground",{variants:{size:{sm:"text-xs",md:"text-sm"}},defaultVariants:{size:"md"}}),ke=q.cva("w-full p-0 bg-transparent border-none outline-none text-foreground placeholder:text-secondary-foreground focus:outline-none",{variants:{size:{sm:"text-[18px]! leading-[21px]!",md:"text-[28px]! leading-[33px]!"}},defaultVariants:{size:"md"}});function k(n){return Math.round(n*100)}function qe(n){return n/100}function Me(n,r){if(!r)return null;const o=parseFloat(n.replace(",",".")||"0");if(!Number.isFinite(o)||o===0)return null;const a=o*r,x=Math.abs(a)<100;try{return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:x?2:0,maximumFractionDigits:x?2:0}).format(a)}catch{return"$0"}}const S=c.forwardRef(({amount:n,token:r,label:o,maxAmount:a,maxAmountLimit:h,maxButtonLabel:x,chainId:L,network:B,maxButton:V=!0,disabled:d=!1,active:D=!1,size:R="md",symbolMaxLength:E,tokenOptions:w,multiSelectMode:O=!1,onSetAmount:p,onShowSelectDialog:M,onRemove:_,onFocus:P,onBlur:$,usdPrice:C,hfSlider:l},H)=>{const{formatMessage:U}=I.useIntlTyped(),W=c.useId(),T=r?.decimals??18,Q=e=>{const s=e.target.value,[i,u]=ye.parseInputToBN(s,T);i===null||u===null||p&&p(i,u)},X=()=>{if(p){const e=a&&h&&a>h?h:a||0n,s=ve.bnToInputView(e,T);p(e,s)}},[G,z]=c.useState(!1),J=()=>{z(!0),P?.()},K=()=>{z(!1),$?.()},Y=j.useIsMobile(),Z=l?.min??1,A=l?.max??3,ee=l?.step??.01,te=Math.max(1,Math.round(1/ee)),f=R??"md",ne=Y,se=j.useIsTablet(),re=j.useIsDesktop(),ae=E??(ne?20:se?30:re?22:30),[m,N]=c.useState(!1),g=c.useRef(null),F=c.useRef(null),[oe,ce]=c.useState({});c.useLayoutEffect(()=>{if(!m||!g.current)return;const e=()=>{const s=g.current?.getBoundingClientRect();s&&ce({position:"fixed",top:s.bottom+4,right:window.innerWidth-s.right,minWidth:s.width,zIndex:9999})};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[m]),c.useEffect(()=>{if(!m)return;const e=s=>{const i=s.target,u=g.current?.contains(i),ue=F.current?.contains(i);!u&&!ue&&N(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[m]);const b=!!(w&&w.length>0),ie=!d&&b?()=>N(e=>!e):M,le=!!(r||M||b);return t.jsxs("div",{ref:H,className:Ie({size:f}),"data-testid":v.smartNumberInputTestIds.root,"data-active":G,"data-disabled":d,children:[_&&t.jsx("div",{className:"absolute top-0 right-0 flex h-5 w-5 translate-x-1/2 -translate-y-1/2 items-center justify-center","data-testid":v.smartNumberInputTestIds.close,children:t.jsx("button",{type:"button",onClick:_,className:"flex h-5 w-5 items-center justify-center rounded-full bg-muted hover:bg-muted/80 text-muted-foreground",children:t.jsx(ge.FaIcon,{icon:xe.faXmark,className:"size-3"})})}),t.jsxs("div",{className:"mb-2 flex justify-between text-sm leading-[120%]",children:[t.jsx("span",{className:y.cn(je({size:f}),"grow shrink-0 basis-0"),"data-testid":v.smartNumberInputTestIds.label,children:o??t.jsx(I.FormattedMessageTyped,{messageId:"components.smartNumberInput.amountLabel"})}),l!==void 0?t.jsxs("div",{className:"ml-auto flex w-1/2 min-w-0 items-center gap-1",children:[t.jsx("span",{className:"shrink-0 text-xs text-secondary-foreground",children:"HF"}),t.jsx("div",{className:"min-w-0 flex-1 [&>div]:px-0 [&>div]:pb-0",children:t.jsx(be.Slider,{from:k(Z),to:k(A),value:k(l.value),precision:te,markerStep:0,epsilon:0,onChangeValue:e=>l.onChange(qe(e))})}),t.jsx(he.HealthFactor,{value:Math.round(l.value*1e4),debt:1n,decimals:2,className:"shrink-0 text-xs tabular-nums"})]}):a!==void 0&&r&&t.jsx(we.BalanceIndicator,{title:x,token:r,maxAmount:a,size:f,disabled:d,maxButton:V,onMaxButtonClick:X})]}),t.jsxs("div",{className:y.cn("flex w-full max-w-full shrink-0 basis-full items-center"),children:[t.jsx("div",{className:"mr-3 grow shrink-0 basis-0",children:t.jsx("input",{type:"text",inputMode:"decimal",autoComplete:"off",autoCorrect:"off",spellCheck:"false",pattern:"^[0-9]*[.,]?[0-9]*$",placeholder:"0",value:n,onChange:Q,onFocus:J,onBlur:K,disabled:d||!p,className:y.cn(ke({size:f}),d&&"cursor-not-allowed"),"data-testid":v.smartNumberInputTestIds.input,minLength:1,maxLength:79,title:U({messageId:"components.smartNumberInput.inputTitle"})})}),le?t.jsxs("div",{ref:g,className:"shrink-0",children:[t.jsx(fe.CurrencyButton,{active:b?m:D,size:f,disabled:d,token:r,showSelectDialog:ie,chainId:L,network:B,maxLength:ae,children:r?.symbol??t.jsx(I.FormattedMessageTyped,{messageId:"components.smartNumberInput.selectToken"})}),b&&m&&me.createPortal(t.jsx("div",{ref:F,style:oe,className:"overflow-hidden rounded-lg border border-gray-30 bg-gray-20 shadow-lg",children:w?.map((e,s)=>{const i=`${W}-${s}`,u="flex w-full min-w-0 items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-gray-30";return O?t.jsxs("div",{className:u,children:[t.jsx(pe.Checkbox,{id:i,checked:!!e.checked,color:"secondary",size:"md",className:"shrink-0",onCheckedChange:()=>e.onSelect()}),t.jsxs("label",{htmlFor:i,className:"flex min-w-0 flex-1 cursor-pointer items-center gap-2 text-left",children:[e.icon?t.jsx("span",{className:"inline-flex shrink-0 items-center",children:e.icon}):null,t.jsx("span",{className:"truncate",children:e.label})]})]},s):t.jsxs("button",{type:"button",onClick:()=>{e.onSelect(),N(!1)},className:y.cn(u,"text-left"),children:[e.icon?t.jsx("span",{className:"inline-flex shrink-0 items-center",children:e.icon}):null,t.jsx("span",{className:"truncate",children:e.label})]},s)})}),document.body)]}):null]}),C!==void 0&&(()=>{const e=Me(n,C);return e?t.jsx("div",{className:"mt-1 text-xs leading-[130%] text-secondary-foreground",children:e}):null})()]})});S.displayName="SmartNumberInput";exports.SmartNumberInput=S;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),x=require("react"),re=require("sonner"),ne=require("../../hooks/use-media-query.cjs");require("@gearbox-protocol/sdk");const oe=require("../../utils/cn.cjs");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../utils/z-index.cjs");const ie=require("../buttons/range-buttons/range-buttons.cjs"),j=require("../graph/graph.cjs"),se=require("../graph/graph-view.cjs"),le=require("./graph-dropdown.cjs"),ce=({size:e=16})=>o.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Expand fullscreen",children:[o.jsx("title",{children:"Expand fullscreen"}),o.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})]}),ue=({size:e=16})=>o.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Exit fullscreen",children:[o.jsx("title",{children:"Exit fullscreen"}),o.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})]}),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),x=require("react"),re=require("sonner"),ne=require("../../hooks/use-media-query.cjs");require("@gearbox-protocol/sdk");const oe=require("../../utils/cn.cjs");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../utils/z-index.cjs");const ie=require("../buttons/range-buttons/range-buttons.cjs"),j=require("../graph/graph.cjs"),se=require("../graph/graph-view.cjs"),le=require("./graph-dropdown.cjs"),ce=({size:e=16})=>o.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Expand fullscreen",children:[o.jsx("title",{children:"Expand fullscreen"}),o.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})]}),ue=({size:e=16})=>o.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Exit fullscreen",children:[o.jsx("title",{children:"Exit fullscreen"}),o.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})]}),N="ui-kit:tradingview-series-colors:";function M(e){if(typeof window>"u"||!window.localStorage)return new Map;try{const t=window.localStorage.getItem(N+e);if(!t)return new Map;const c=JSON.parse(t);return c==null||typeof c!="object"?new Map:new Map(Object.entries(c).filter(([,r])=>typeof r=="number"&&r>=0&&r<j.DEFAULT_SERIES_COLORS.length))}catch{return new Map}}function ae(e,t){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(N+e,JSON.stringify(Object.fromEntries(t)))}catch{}}function q(e,t){if(t.size===0)return;const c=M(e);for(const[r,b]of t)c.set(r,b);ae(e,c)}function de({data:e,yMeasureUnit:t,height:c=306,defaultGraph:r,onGraphSelected:b,graphs:m,isMultipleSelect:T,range:V,rangeList:I,setRange:F,onGraphExpanded:y,isGraphExpanded:z,onUnselectSeries:B,graphsWithNoData:D,loadingGraphs:A,noDataMessage:R="No data available for this graph",currentValueDecimals:W,containerClassName:H,useSharedPriceScale:J,showCurrentValue:$,yScaleMin:Q,yScaleMinMultiple:X,seriesColorPersistenceKey:u,...Y}){const v=x.useMemo(()=>Array.isArray(e)?e:e?[e]:[],[e]),C=x.useMemo(()=>Array.isArray(e)&&e.length>1,[e]),k=ne.useIsMobile(),Z=x.useCallback((w,S)=>{re.toast.error(R)},[R]),U=x.useMemo(()=>{if(t)return Array.isArray(t)?t[0]:t},[t]),P=(!k&&y||I.length>0||b&&m&&r)&&o.jsxs("div",{className:"z-10 w-full flex flex-row flex-wrap sm:flex-nowrap items-center gap-2",children:[o.jsx("div",{children:b&&m&&r&&o.jsx(le.GraphDropdown,{onSelected:b,items:m,defaultItem:r,multiple:T,graphsWithNoData:D,loadingGraphs:A,onNoDataSelected:Z})}),o.jsxs("div",{className:"flex flex-row flex-nowrap justify-start sm:justify-end items-center flex-1",children:[o.jsx(ie.RangeButtons,{range:V,rangeList:I,setRange:F}),!k&&y&&o.jsx("button",{type:"button",className:"px-2.5 py-1.5 flex min-w-[44px] min-h-[26px] justify-center items-center text-xs leading-[14px] font-medium text-center rounded-md border cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring bg-muted border-muted text-muted-foreground hover:border-secondary ml-1.5",onClick:y,children:z?o.jsx(ue,{size:16}):o.jsx(ce,{size:16})})]})]}),s=x.useRef(new Map),f=x.useRef(0),L=x.useRef(!1);if(m&&m.length>0&&!L.current){L.current=!0;const w=u?M(u):new Map,S=String(m[0].value);s.current.set(S,0),f.current=1;for(let n=1;n<m.length;n++){const a=String(m[n].value);if(s.current.has(a))continue;const h=w.get(a)??n;s.current.set(a,h),f.current=Math.max(f.current,h+1)}u&&q(u,s.current)}const K=x.useMemo(()=>{const w=Array.isArray(t)?t:void 0;if(u){const n=M(u);for(const[a,g]of n)s.current.has(a)||(s.current.set(a,g),f.current=Math.max(f.current,g+1))}const S=v.map((n,a)=>{const g=n?.title||`Series ${a+1}`,h=r!=null?Array.isArray(r)?r[0]?.value??r[0]:typeof r=="object"&&"value"in r?r.value:r:null,_=v.length===1?h!=null?String(h):"single":n?.id||g;if(!s.current.has(_)){const i=new Set(Array.from(s.current.values()));let l=f.current;for(let d=0;d<j.DEFAULT_SERIES_COLORS.length;d++){const p=(f.current+d)%j.DEFAULT_SERIES_COLORS.length;if(!i.has(p)){l=p;break}}s.current.set(_,l),f.current=l+1}const ee=s.current.get(_)??0,E=j.getSeriesColorPalette(ee),te=[...n?.data||[]].sort((i,l)=>{const d=typeof i.time=="number"?i.time:Number(i.time),p=typeof l.time=="number"?l.time:Number(l.time);return d-p}).reduce((i,l)=>{const d=l.time;return i.length===0||i[i.length-1].time!==d?i.push({time:d,value:l.value}):i[i.length-1]={time:d,value:l.value},i},[]),O=n?.lineColor??n?.color??void 0;return{data:te,label:g,yMeasureUnit:w?.[a]??(Array.isArray(t)?void 0:t),...O!=null?{lineColor:O,...n?.topColor!=null&&{topColor:n.topColor},...n?.bottomColor!=null&&{bottomColor:n.bottomColor}}:{color:E.line,topColor:E.top,bottomColor:E.bottom}}});return u&&s.current.size>0&&q(u,s.current),S},[v,r,t,u]),G=A!==void 0?A.size>0:C&&v.length>0?v.some(w=>!w):!e;return o.jsx("div",{style:{width:"100%",height:c?`${c}px`:void 0},className:"w-full",children:o.jsx(se.GraphViewWithData,{series:K,loading:G,toolbar:P,size:c?"full":"default",containerClassName:oe.cn("h-full",H),showLegend:C,onUnselectSeries:B,yMeasureUnit:U,currentValueDecimals:W,useSharedPriceScale:J,showCurrentValue:$,yScaleMin:Q,yScaleMinMultiple:X,...Y})})}exports.TradingView=de;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e={"errors.networkError":"Network error. Can't fetch data","errors.incorrectAddressError":"Incorrect address. Please, check url","errors.noOpenedAccountsError":"You have no opened Credit Accounts. Perhaps, you have recently been liquidated? Check notification centre to see more.","errors.notFound":"Not found","errors.tooManyRequests":"Too many requests","errors.incorrectAddress":"Incorrect address","components.errorMessage.oops":"Oops...","components.alertModal.ok":"Ok","components.footer.privacy":"Privacy Notice","components.footer.terms":"Terms of Service","components.footer.disclosure":"Risk Disclosure Statement","components.footer.legalNotice":"Legal Notice","components.footer.legal":"Legal Info","components.footer.gearbox":"Copyright © Gearbox Foundation 2023-2026.","components.footer.built":"Built at ETHGlobal MarketMake hackathon.","components.footer.version":"Version {value}","components.liquidationPrice.check":"Check Area","components.loading.loading":"Loading","components.loading.loadingPercent":"Loading {percent}%","components.loading.wait":"Please wait...","components.smartNumberInput.balance":"Balance","components.smartNumberInput.inputTitle":"Token Amount","components.smartNumberInput.confirm.input":"Input","components.tipWindow.title":"Tip","components.healthFactor.low":"Extremely low! This HF may not cover possible oracle deviations.","components.headCell":"Sort by {value}","components.graphView.noData":"Can't get data for this graph","components.filterBlock.reset":"Reset All","components.filterModal.searchPlaceholder":"Search options...","components.filterModal.noOptionsAvailable":"No options available","components.filterModal.noOptionsMatchSearch":"No options match your search","components.filterModal.reset":"Reset","components.filterModal.apply":"Apply","components.APY.tip":"These APYs are derived from the underlying protocols’ APIs and may differ in reality. Check respective protocols for their methodology.","components.creditSessionDetailedLiquidation.graph.noData":"No data","components.creditSessionDetailedLiquidation.graph.legend.point":"Current price","components.creditSessionDetailedLiquidation.graph.legend.area":"Liquidation Area","components.creditSessionDetailedLiquidation.graph.tip.hf":"Health Factor","components.creditSessionDetailedLiquidation.graph.tip.price":"Price","components.creditSessionDetailedLiquidation.table.noData":"No data","components.creditSessionDetailedLiquidation.table.seeGraph":"See graph","components.creditSessionDetailedLiquidation.table.asset":"Asset","components.creditSessionDetailedLiquidation.table.currentPrice":"Current price","components.creditSessionDetailedLiquidation.table.modelPrice":"Model price","components.apyParts.features.points":"Points","components.apyParts.features.incent":"Incent.","components.apyParts.supplyAPY":"Organic APY","components.apyParts.title":"APY type","components.apyParts.supplyAPY.tip":"Yield from lending funds","components.apyParts.tokenYield":"Intrinsic APY","components.apyParts.tokenYield.tip":"Yield from holding wstETH","components.apyParts.extraAPY":"{symbol} Incentive","components.apyParts.extraAPY.tip":"Calculated at the current rate","components.apyParts.totalAPY":"Overall APY","components.apyParts.points":"{symbol} Incentive","components.apyParts.points.condition.crossDeposit":"For cross-chain deposits made via Omni","components.openCopyButtons.copy":"Copy to clipboard","components.poolAssetsTable.asset":"Asset","components.poolAssetsTable.rate":"Effective rate","components.poolAssetsTable.limits":"Limits Usage","components.poolAssetsTable.usage":"{amount} of {total}","components.poolAssetsTable.head.name":"Credit Manager","components.poolAssetsTable.head.currentDebt":"Current Debt","components.poolAssetsTable.head.assets":"Asset LT","components.poolCreditManagersTable.assets":"{amount} assets","components.creditManagerInfo.title":"Assets and LT’s","components.creditManagerInfo.info.title":"Credit Managers","components.creditManagerInfo.info.copy.tip":"Copy Credit Manager address","components.creditManagerInfo.info.minDebt":"Min debt","components.creditManagerInfo.info.maxDebt":"Max debt","components.creditManagerInfo.info.liquidationFee":"Liquid. fee","components.creditManagerInfo.info.liquidationPremium":"Liquid. premium","components.creditManagerInfo.info.interestFee":"Interest fee","components.creditManagerInfo.info.debtLimit":"Debt limit","components.creditManagerInfo.info.maxEnabledTokens":"Max tokens","dialogs.oraclesAndLTInfo.filter.hide0Quota":"Hide 0-Quota","components.oraclesAndLTInfo.title":"Oracles and LTs","components.oraclesAndLTTable.head.token":"Token","components.oraclesAndLTTable.head.oracles":"Oracles","components.oraclesAndLTTable.head.lt":"LT","components.poolTable.pool":"Market","components.poolTable.market":"Market","components.poolTable.description.universal":"Universal","components.poolTable.supply":"Supply","components.poolTable.borrowed":"Borrowed","components.poolTable.supplyApy":"Supply APY","components.poolTable.supplyApy.tip":"Annual percentage yield that you earn for supplying capital. This number constantly changes as the utilization of the Markets goes up and down","components.poolTable.depositApy":"Deposit APY","components.poolTable.depositApy.tip":"Deposit APY breakdown: base rate, extra rewards, and points","components.poolTable.borrowApy":"Borrow APY","components.poolTable.utilizationApy":"Utilization APY","components.poolTable.borrowApy.tip":"On top of the utilization borrow APY, there is a borrow quota APY for different assets","components.poolTable.utilization":"Utilization","components.poolTable.collateral":"Collateral","components.poolTable.collateral.showAll":"Show All","components.poolTable.balance":"Your Balance","components.poolTable.balance.tip":`You don't earn token rewards, only organic yield. Please migrate liquidity by using "Migrate" flow above.`,"components.poolTable.emptyList":"No Pools found","components.poolTable.notFound.dashboard":"You currently have no open Market positions.","components.poolTable.notFound.list":"No Markets found","components.poolTable.notFound.description.dashboard":"Choose earn above.","components.poolTable.notFound.description.list":"Choose another chain or toggle Show All Markets","components.poolTable.externalApy.tooltipShort":"{value} APY boost when depositing via {name}","components.poolTable.line.rwa.tip":"This is RWA market.","components.rewardsTooltip.without.title":"Without Leverage","components.rewardsTooltip.without.extra":"Extra APY","components.rewardsTooltip.without.extra.tip":"Any deposit through Gearbox","components.rewardsTooltip.with.title":"With {leverage} Leverage","components.rewardsTooltip.with.borrowRate":"{symbol} borrow rate","components.rewardsTooltip.with.quotaRate":"Quota rate","components.rewardsTooltip.with.bonusAPY.title":"Target Bonuses Yield","components.rewardsTooltip.with.bonusAPY.tip":"Expected Bonuses APY is calculated by the Asset Issuer and represents the expected value to be paid out in points.","components.rewardsTooltip.with.extra":"+ Extra APR","components.rewardsTooltip.button":"Click to show rewards details","components.strategiesTable.head.name":"Strategy","components.strategiesTable.head.rewards":"Rewards","components.strategiesTable.head.leverage":"Max Leverage","components.strategiesTable.head.earn":"You Can Earn","components.strategiesTable.body.notFound":"No strategy found","components.strategiesTable.line.disabled":"This strategy is currently not available, cause of lack or quota or liquidity. Please contact us on Discord, and we’ll assist you.","components.strategiesTable.line.name.disabled":"This strategy is currently not available","components.strategiesTable.line.points.tip":"For debt nominated in {symbol}","components.strategiesTable.line.points.tipAny":"For debt","components.strategiesTable.line.0slippage":"0-slippage","components.strategiesTable.line.0slippage.tip":"Wrapping/unwrapping happens directly through smart-contracts, so {symbol} deposits and withdrawals don't incur slippage.","components.strategiesTable.line.rwa":"RWA","components.strategiesTable.line.rwa.tip":"This strategy is available on RWA market."};module.exports=e;
|
|
1
|
+
"use strict";const e={"errors.networkError":"Network error. Can't fetch data","errors.incorrectAddressError":"Incorrect address. Please, check url","errors.noOpenedAccountsError":"You have no opened Credit Accounts. Perhaps, you have recently been liquidated? Check notification centre to see more.","errors.notFound":"Not found","errors.tooManyRequests":"Too many requests","errors.incorrectAddress":"Incorrect address","components.errorMessage.oops":"Oops...","components.alertModal.ok":"Ok","components.footer.privacy":"Privacy Notice","components.footer.terms":"Terms of Service","components.footer.disclosure":"Risk Disclosure Statement","components.footer.legalNotice":"Legal Notice","components.footer.legal":"Legal Info","components.footer.gearbox":"Copyright © Gearbox Foundation 2023-2026.","components.footer.built":"Built at ETHGlobal MarketMake hackathon.","components.footer.version":"Version {value}","components.liquidationPrice.check":"Check Area","components.loading.loading":"Loading","components.loading.loadingPercent":"Loading {percent}%","components.loading.wait":"Please wait...","components.smartNumberInput.balance":"Balance","components.smartNumberInput.amountLabel":"Amount","components.smartNumberInput.inputTitle":"Token Amount","components.smartNumberInput.confirm.input":"Input","components.smartNumberInput.selectToken":"Select token","components.tipWindow.title":"Tip","components.healthFactor.low":"Extremely low! This HF may not cover possible oracle deviations.","components.headCell":"Sort by {value}","components.graphView.noData":"Can't get data for this graph","components.filterBlock.reset":"Reset All","components.filterModal.searchPlaceholder":"Search options...","components.filterModal.noOptionsAvailable":"No options available","components.filterModal.noOptionsMatchSearch":"No options match your search","components.filterModal.reset":"Reset","components.filterModal.apply":"Apply","components.APY.tip":"These APYs are derived from the underlying protocols’ APIs and may differ in reality. Check respective protocols for their methodology.","components.creditSessionDetailedLiquidation.graph.noData":"No data","components.creditSessionDetailedLiquidation.graph.legend.point":"Current price","components.creditSessionDetailedLiquidation.graph.legend.area":"Liquidation Area","components.creditSessionDetailedLiquidation.graph.tip.hf":"Health Factor","components.creditSessionDetailedLiquidation.graph.tip.price":"Price","components.creditSessionDetailedLiquidation.table.noData":"No data","components.creditSessionDetailedLiquidation.table.seeGraph":"See graph","components.creditSessionDetailedLiquidation.table.asset":"Asset","components.creditSessionDetailedLiquidation.table.currentPrice":"Current price","components.creditSessionDetailedLiquidation.table.modelPrice":"Model price","components.apyParts.features.points":"Points","components.apyParts.features.incent":"Incent.","components.apyParts.supplyAPY":"Organic APY","components.apyParts.title":"APY type","components.apyParts.supplyAPY.tip":"Yield from lending funds","components.apyParts.tokenYield":"Intrinsic APY","components.apyParts.tokenYield.tip":"Yield from holding wstETH","components.apyParts.extraAPY":"{symbol} Incentive","components.apyParts.extraAPY.tip":"Calculated at the current rate","components.apyParts.totalAPY":"Overall APY","components.apyParts.points":"{symbol} Incentive","components.apyParts.points.condition.crossDeposit":"For cross-chain deposits made via Omni","components.openCopyButtons.copy":"Copy to clipboard","components.poolAssetsTable.asset":"Asset","components.poolAssetsTable.rate":"Effective rate","components.poolAssetsTable.limits":"Limits Usage","components.poolAssetsTable.usage":"{amount} of {total}","components.poolAssetsTable.head.name":"Credit Manager","components.poolAssetsTable.head.currentDebt":"Current Debt","components.poolAssetsTable.head.assets":"Asset LT","components.poolCreditManagersTable.assets":"{amount} assets","components.creditManagerInfo.title":"Assets and LT’s","components.creditManagerInfo.info.title":"Credit Managers","components.creditManagerInfo.info.copy.tip":"Copy Credit Manager address","components.creditManagerInfo.info.minDebt":"Min debt","components.creditManagerInfo.info.maxDebt":"Max debt","components.creditManagerInfo.info.liquidationFee":"Liquid. fee","components.creditManagerInfo.info.liquidationPremium":"Liquid. premium","components.creditManagerInfo.info.interestFee":"Interest fee","components.creditManagerInfo.info.debtLimit":"Debt limit","components.creditManagerInfo.info.maxEnabledTokens":"Max tokens","dialogs.oraclesAndLTInfo.filter.hide0Quota":"Hide 0-Quota","components.oraclesAndLTInfo.title":"Oracles and LTs","components.oraclesAndLTTable.head.token":"Token","components.oraclesAndLTTable.head.oracles":"Oracles","components.oraclesAndLTTable.head.lt":"LT","components.poolTable.pool":"Market","components.poolTable.market":"Market","components.poolTable.description.universal":"Universal","components.poolTable.supply":"Supply","components.poolTable.borrowed":"Borrowed","components.poolTable.supplyApy":"Supply APY","components.poolTable.supplyApy.tip":"Annual percentage yield that you earn for supplying capital. This number constantly changes as the utilization of the Markets goes up and down","components.poolTable.depositApy":"Deposit APY","components.poolTable.depositApy.tip":"Deposit APY breakdown: base rate, extra rewards, and points","components.poolTable.borrowApy":"Borrow APY","components.poolTable.utilizationApy":"Utilization APY","components.poolTable.borrowApy.tip":"On top of the utilization borrow APY, there is a borrow quota APY for different assets","components.poolTable.utilization":"Utilization","components.poolTable.collateral":"Collateral","components.poolTable.collateral.showAll":"Show All","components.poolTable.balance":"Your Balance","components.poolTable.balance.tip":`You don't earn token rewards, only organic yield. Please migrate liquidity by using "Migrate" flow above.`,"components.poolTable.emptyList":"No Pools found","components.poolTable.notFound.dashboard":"You currently have no open Market positions.","components.poolTable.notFound.list":"No Markets found","components.poolTable.notFound.description.dashboard":"Choose earn above.","components.poolTable.notFound.description.list":"Choose another chain or toggle Show All Markets","components.poolTable.externalApy.tooltipShort":"{value} APY boost when depositing via {name}","components.poolTable.line.rwa.tip":"This is RWA market.","components.rewardsTooltip.without.title":"Without Leverage","components.rewardsTooltip.without.extra":"Extra APY","components.rewardsTooltip.without.extra.tip":"Any deposit through Gearbox","components.rewardsTooltip.with.title":"With {leverage} Leverage","components.rewardsTooltip.with.borrowRate":"{symbol} borrow rate","components.rewardsTooltip.with.quotaRate":"Quota rate","components.rewardsTooltip.with.bonusAPY.title":"Target Bonuses Yield","components.rewardsTooltip.with.bonusAPY.tip":"Expected Bonuses APY is calculated by the Asset Issuer and represents the expected value to be paid out in points.","components.rewardsTooltip.with.extra":"+ Extra APR","components.rewardsTooltip.button":"Click to show rewards details","components.strategiesTable.head.name":"Strategy","components.strategiesTable.head.rewards":"Rewards","components.strategiesTable.head.leverage":"Max Leverage","components.strategiesTable.head.earn":"You Can Earn","components.strategiesTable.body.notFound":"No strategy found","components.strategiesTable.line.disabled":"This strategy is currently not available, cause of lack or quota or liquidity. Please contact us on Discord, and we’ll assist you.","components.strategiesTable.line.name.disabled":"This strategy is currently not available","components.strategiesTable.line.points.tip":"For debt nominated in {symbol}","components.strategiesTable.line.points.tipAny":"For debt","components.strategiesTable.line.0slippage":"0-slippage","components.strategiesTable.line.0slippage.tip":"Wrapping/unwrapping happens directly through smart-contracts, so {symbol} deposits and withdrawals don't incur slippage.","components.strategiesTable.line.rwa":"RWA","components.strategiesTable.line.rwa.tip":"This strategy is available on RWA market."};module.exports=e;
|
|
@@ -56,6 +56,7 @@ const h = x(
|
|
|
56
56
|
auto: "h-auto p-1.5",
|
|
57
57
|
xs: "px-3 py-0.5 text-xs rounded-full",
|
|
58
58
|
sm: "h-7 px-3 !text-xs !leading-[14px] rounded-[6px]",
|
|
59
|
+
md: "h-8 px-3.5 !text-sm !leading-4 rounded-[8px]",
|
|
59
60
|
default: "px-4 h-[40px] !text-[15px] !leading-[18px] rounded-[12px]",
|
|
60
61
|
lg: "px-4 h-[44px] !text-[16px] !leading-[19px] rounded-[22px]",
|
|
61
62
|
icon: "h-9 w-9 p-2"
|
|
@@ -2,37 +2,37 @@ import { jsx as a } from "react/jsx-runtime";
|
|
|
2
2
|
import * as n from "react";
|
|
3
3
|
import { Button as p } from "../../buttons/button/button.js";
|
|
4
4
|
import "@gearbox-protocol/sdk";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as s } from "../../../utils/cn.js";
|
|
6
6
|
import "sonner";
|
|
7
7
|
import "@gearbox-protocol/sdk/common-utils";
|
|
8
8
|
import "luxon";
|
|
9
9
|
import "../../../utils/z-index.js";
|
|
10
|
-
const
|
|
10
|
+
const c = {
|
|
11
11
|
primary: "default",
|
|
12
12
|
outlined: "outline",
|
|
13
13
|
neutral: "neutral",
|
|
14
14
|
white: "white",
|
|
15
15
|
success: "success"
|
|
16
|
-
},
|
|
16
|
+
}, l = n.forwardRef(
|
|
17
17
|
({
|
|
18
18
|
$size: t = "lg",
|
|
19
19
|
$width: r = "compact",
|
|
20
20
|
$color: o = "primary",
|
|
21
|
-
className:
|
|
22
|
-
...
|
|
21
|
+
className: i,
|
|
22
|
+
...e
|
|
23
23
|
}, m) => /* @__PURE__ */ a(
|
|
24
24
|
p,
|
|
25
25
|
{
|
|
26
26
|
ref: m,
|
|
27
|
-
size: t
|
|
27
|
+
size: t,
|
|
28
28
|
width: r,
|
|
29
|
-
variant:
|
|
30
|
-
className:
|
|
31
|
-
...
|
|
29
|
+
variant: c[o],
|
|
30
|
+
className: s("inline-block whitespace-normal", i),
|
|
31
|
+
...e
|
|
32
32
|
}
|
|
33
33
|
)
|
|
34
34
|
);
|
|
35
|
-
|
|
35
|
+
l.displayName = "StyledButton";
|
|
36
36
|
export {
|
|
37
|
-
|
|
37
|
+
l as StyledButton
|
|
38
38
|
};
|
|
@@ -1,189 +1,184 @@
|
|
|
1
|
-
import { TickMarkType as
|
|
2
|
-
import { DateTime as
|
|
3
|
-
import { isBelowDisplayThreshold as x, FORMAT_CONSTANTS as
|
|
4
|
-
const { MIN_DISPLAY_THRESHOLD:
|
|
1
|
+
import { TickMarkType as g } from "lightweight-charts";
|
|
2
|
+
import { DateTime as S } from "luxon";
|
|
3
|
+
import { isBelowDisplayThreshold as x, FORMAT_CONSTANTS as X, toSignificantDigits as k, formatNumberWithSuffix as L } from "../../utils/format-number.js";
|
|
4
|
+
const { MIN_DISPLAY_THRESHOLD: h, MAX_EXPONENTIAL_THRESHOLD: I } = X, P = (t, e, o = "full") => {
|
|
5
5
|
if (x(t))
|
|
6
|
-
return e ? `<${
|
|
6
|
+
return e ? `<${h}${e}` : `<${h}`;
|
|
7
7
|
if (t === 0)
|
|
8
8
|
return e ? `0${e}` : "0";
|
|
9
|
-
const
|
|
10
|
-
maxExponentialThreshold:
|
|
9
|
+
const r = L(t, {
|
|
10
|
+
maxExponentialThreshold: I,
|
|
11
11
|
minimumFractionDigits: 0,
|
|
12
|
-
maximumFractionDigits:
|
|
13
|
-
format:
|
|
14
|
-
adaptiveDecimals:
|
|
12
|
+
maximumFractionDigits: o === "short" ? 1 : 0,
|
|
13
|
+
format: o,
|
|
14
|
+
adaptiveDecimals: o === "short"
|
|
15
15
|
});
|
|
16
|
-
return e ? `${
|
|
17
|
-
},
|
|
16
|
+
return e ? `${r}${e}` : r;
|
|
17
|
+
}, U = 2, p = (t, e) => {
|
|
18
18
|
if (x(t))
|
|
19
|
-
return e ? `<${
|
|
19
|
+
return e ? `<${h}${e}` : `<${h}`;
|
|
20
20
|
if (t === 0)
|
|
21
21
|
return e ? `0${e}` : "0";
|
|
22
|
-
const
|
|
23
|
-
return e ? `${
|
|
24
|
-
},
|
|
22
|
+
const o = k(t, U);
|
|
23
|
+
return e ? `${o}${e}` : o;
|
|
24
|
+
}, C = 4, w = (t) => {
|
|
25
25
|
if (x(t))
|
|
26
|
-
return `<${
|
|
26
|
+
return `<${h}`;
|
|
27
27
|
if (t === 0)
|
|
28
28
|
return "0";
|
|
29
|
-
const e = Math.round(t),
|
|
30
|
-
return
|
|
31
|
-
},
|
|
29
|
+
const e = Math.round(t), o = Math.abs(t - e);
|
|
30
|
+
return o > 0 && o < 0.01 ? t.toFixed(12).replace(/0+$/, "").replace(/\.$/, "") : k(t, C);
|
|
31
|
+
}, G = (t, e) => {
|
|
32
32
|
if (x(t))
|
|
33
|
-
return e ? `<${
|
|
33
|
+
return e ? `<${h} ${e}` : `<${h}`;
|
|
34
34
|
if (t === 0)
|
|
35
35
|
return e ? `0 ${e}` : "0";
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
const
|
|
39
|
-
return e ? `${
|
|
36
|
+
const o = Number.isInteger(t), r = Math.abs(t), s = o && r >= 1e3, i = Math.round(t), a = Math.abs(t - i);
|
|
37
|
+
if (a > 0 && a < 0.01 && !s) {
|
|
38
|
+
const $ = t.toFixed(12).replace(/0+$/, "").replace(/\.$/, "");
|
|
39
|
+
return e ? `${$} ${e}` : $;
|
|
40
40
|
}
|
|
41
|
-
const
|
|
42
|
-
maxExponentialThreshold:
|
|
43
|
-
minimumFractionDigits:
|
|
44
|
-
maximumFractionDigits:
|
|
45
|
-
format:
|
|
46
|
-
adaptiveDecimals:
|
|
41
|
+
const F = L(t, {
|
|
42
|
+
maxExponentialThreshold: I,
|
|
43
|
+
minimumFractionDigits: o ? 0 : 2,
|
|
44
|
+
maximumFractionDigits: s ? 1 : o ? 0 : 2,
|
|
45
|
+
format: s ? "short" : "full",
|
|
46
|
+
adaptiveDecimals: s
|
|
47
47
|
});
|
|
48
|
-
return e ? `${
|
|
48
|
+
return e ? `${F} ${e}` : F;
|
|
49
49
|
}, N = {
|
|
50
|
-
"%":
|
|
51
|
-
$:
|
|
52
|
-
token:
|
|
53
|
-
none:
|
|
54
|
-
},
|
|
55
|
-
function
|
|
50
|
+
"%": p,
|
|
51
|
+
$: P,
|
|
52
|
+
token: G,
|
|
53
|
+
none: w
|
|
54
|
+
}, J = (t) => N[t] || N.token;
|
|
55
|
+
function Z(t, e, o = 4) {
|
|
56
56
|
if (t === 0)
|
|
57
57
|
return e ? `0 ${e}` : "0";
|
|
58
|
-
const
|
|
58
|
+
const r = e && Math.abs(t) >= 1e3 ? 0 : o, s = t.toLocaleString("en-US", {
|
|
59
59
|
minimumFractionDigits: 0,
|
|
60
|
-
maximumFractionDigits:
|
|
60
|
+
maximumFractionDigits: r
|
|
61
61
|
});
|
|
62
|
-
return e ? `${
|
|
62
|
+
return e ? `${s} ${e}` : s;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
const
|
|
66
|
-
let
|
|
64
|
+
function v(t, e, o) {
|
|
65
|
+
const r = o?.yScaleMin;
|
|
66
|
+
let s = t.length > 0 ? Math.min(...t) : 0, i = t.length > 0 ? Math.max(...t) : 0, a = [];
|
|
67
67
|
const u = () => {
|
|
68
|
-
const
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
M = Math.max(1, -L), M = Math.min(M, 4);
|
|
76
|
-
}
|
|
77
|
-
return { scale: f, suffix: m, decimals: M };
|
|
78
|
-
}, l = (r, i, f) => {
|
|
79
|
-
const m = i > 1 ? r / i : r, d = Math.abs(m) >= 1 ? 1 : 4;
|
|
80
|
-
return i > 1 ? `${(r / i).toLocaleString("en-US", {
|
|
81
|
-
minimumFractionDigits: 0,
|
|
82
|
-
maximumFractionDigits: d,
|
|
83
|
-
useGrouping: !1
|
|
84
|
-
})}${f}` : r.toLocaleString("en-US", {
|
|
68
|
+
const n = (s + i) / 2;
|
|
69
|
+
let c = 1, m = "";
|
|
70
|
+
return n >= 1e9 ? (c = 1e9, m = "B") : n >= 1e6 ? (c = 1e6, m = "M") : n >= 1e3 && (c = 1e3, m = "K"), { scale: c, suffix: m };
|
|
71
|
+
}, F = 8, $ = 0.02;
|
|
72
|
+
let A = 0;
|
|
73
|
+
const E = (n, c, m, d) => {
|
|
74
|
+
const M = (c > 1 ? n / c : n).toLocaleString("en-US", {
|
|
85
75
|
minimumFractionDigits: 0,
|
|
86
76
|
maximumFractionDigits: d,
|
|
87
77
|
useGrouping: !1
|
|
88
78
|
});
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
);
|
|
103
|
-
if (Math.abs(r - h) < M)
|
|
104
|
-
return l(h, i, f);
|
|
79
|
+
return c > 1 ? `${M}${m}` : M;
|
|
80
|
+
}, R = (n, c, m) => {
|
|
81
|
+
for (let d = 0; d <= F; d++) {
|
|
82
|
+
const l = /* @__PURE__ */ new Set();
|
|
83
|
+
let M = !0;
|
|
84
|
+
for (const D of n) {
|
|
85
|
+
const f = E(D, c, m, d);
|
|
86
|
+
if (l.has(f)) {
|
|
87
|
+
M = !1;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
l.add(f);
|
|
91
|
+
}
|
|
92
|
+
if (M) return d;
|
|
105
93
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
minimumFractionDigits: 0,
|
|
113
|
-
maximumFractionDigits: E,
|
|
114
|
-
useGrouping: !1
|
|
115
|
-
});
|
|
94
|
+
return F;
|
|
95
|
+
}, O = (n) => {
|
|
96
|
+
if (r !== void 0 && n < r) return "";
|
|
97
|
+
if (n === 0) return "0";
|
|
98
|
+
const { scale: c, suffix: m } = u();
|
|
99
|
+
return E(n, c, m, A);
|
|
116
100
|
};
|
|
117
101
|
return {
|
|
118
|
-
formatter: (
|
|
119
|
-
tickmarksFormatter: (
|
|
120
|
-
const i =
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
102
|
+
formatter: (n) => O(n),
|
|
103
|
+
tickmarksFormatter: (n) => {
|
|
104
|
+
const { scale: c, suffix: m } = u(), d = i - s, l = d > 0 ? a.filter(
|
|
105
|
+
(f) => Math.abs(f) >= d * $
|
|
106
|
+
) : a, M = n.filter(
|
|
107
|
+
(f) => f !== 0 && !(r !== void 0 && f < r)
|
|
108
|
+
);
|
|
109
|
+
A = R(
|
|
110
|
+
[...M, ...l],
|
|
111
|
+
c,
|
|
112
|
+
m
|
|
113
|
+
);
|
|
114
|
+
const D = /* @__PURE__ */ new Set();
|
|
115
|
+
return n.map((f) => {
|
|
116
|
+
if (r !== void 0 && f < r) return "";
|
|
117
|
+
const T = f === 0 ? "0" : E(f, c, m, A);
|
|
118
|
+
return !T || D.has(T) ? "" : (D.add(T), T);
|
|
124
119
|
});
|
|
125
120
|
},
|
|
126
|
-
updateVisibleRange: (
|
|
127
|
-
|
|
121
|
+
updateVisibleRange: (n) => {
|
|
122
|
+
n.length > 0 && (s = Math.min(...n), i = Math.max(...n));
|
|
128
123
|
},
|
|
129
|
-
updateLastValues: (
|
|
130
|
-
|
|
124
|
+
updateLastValues: (n) => {
|
|
125
|
+
a = [...n];
|
|
131
126
|
}
|
|
132
127
|
};
|
|
133
128
|
}
|
|
134
|
-
const
|
|
135
|
-
time:
|
|
136
|
-
"%":
|
|
129
|
+
const H = (t) => S.fromSeconds(Number(t)).toFormat("dd/LL/yyyy HH:mm"), Y = (t) => S.fromSeconds(Number(t)).toFormat("HH:mm"), b = (t, e) => p(Number(t), e), _ = {
|
|
130
|
+
time: H,
|
|
131
|
+
"%": b
|
|
137
132
|
};
|
|
138
|
-
function
|
|
133
|
+
function V(t) {
|
|
139
134
|
const e = /* @__PURE__ */ new Map();
|
|
140
|
-
return (
|
|
141
|
-
const
|
|
142
|
-
let
|
|
135
|
+
return (o, r, s) => {
|
|
136
|
+
const i = S.fromSeconds(Number(o));
|
|
137
|
+
let a;
|
|
143
138
|
if (t === 0)
|
|
144
|
-
|
|
139
|
+
a = i.toFormat("HH:mm");
|
|
145
140
|
else
|
|
146
|
-
switch (
|
|
147
|
-
case
|
|
148
|
-
|
|
141
|
+
switch (r) {
|
|
142
|
+
case g.Year:
|
|
143
|
+
a = i.toFormat("yyyy");
|
|
149
144
|
break;
|
|
150
|
-
case
|
|
151
|
-
|
|
145
|
+
case g.Month:
|
|
146
|
+
a = i.toFormat("MMM yy");
|
|
152
147
|
break;
|
|
153
|
-
case
|
|
154
|
-
|
|
148
|
+
case g.DayOfMonth:
|
|
149
|
+
a = t > 365 ? i.toFormat("dd MMM yy") : i.toFormat("dd MMM");
|
|
155
150
|
break;
|
|
156
|
-
case
|
|
157
|
-
case
|
|
158
|
-
|
|
151
|
+
case g.Time:
|
|
152
|
+
case g.TimeWithSeconds:
|
|
153
|
+
a = i.toFormat("HH:mm");
|
|
159
154
|
break;
|
|
160
155
|
default:
|
|
161
|
-
|
|
156
|
+
a = i.toFormat("dd MMM");
|
|
162
157
|
}
|
|
163
|
-
let u = e.get(
|
|
164
|
-
return u || (u = /* @__PURE__ */ new Set(), e.set(
|
|
158
|
+
let u = e.get(r);
|
|
159
|
+
return u || (u = /* @__PURE__ */ new Set(), e.set(r, u)), u.has(a) ? " " : (u.add(a), a);
|
|
165
160
|
};
|
|
166
161
|
}
|
|
167
|
-
const
|
|
162
|
+
const W = (t, e) => {
|
|
168
163
|
if (t === "time" && e && e.length > 0) {
|
|
169
|
-
const
|
|
164
|
+
const r = S.fromSeconds(Number(e[0].time)), s = S.fromSeconds(
|
|
170
165
|
Number(e[e.length - 1].time)
|
|
171
|
-
),
|
|
166
|
+
), i = r.hasSame(s, "day"), a = i ? 0 : Math.ceil(s.diff(r, "days").days);
|
|
172
167
|
return {
|
|
173
|
-
timeFormatter:
|
|
174
|
-
tickMarkFormatter:
|
|
168
|
+
timeFormatter: i ? Y : H,
|
|
169
|
+
tickMarkFormatter: V(a)
|
|
175
170
|
};
|
|
176
171
|
}
|
|
177
|
-
const
|
|
172
|
+
const o = _[t] || _.time;
|
|
178
173
|
return {
|
|
179
|
-
timeFormatter:
|
|
180
|
-
tickMarkFormatter: (
|
|
174
|
+
timeFormatter: o,
|
|
175
|
+
tickMarkFormatter: (r) => o(r, void 0)
|
|
181
176
|
};
|
|
182
|
-
},
|
|
177
|
+
}, tt = (t, e) => W(t, e).timeFormatter;
|
|
183
178
|
export {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
179
|
+
v as createAdaptiveYAxisFormatter,
|
|
180
|
+
Z as formatExactValue,
|
|
181
|
+
tt as getXFormatter,
|
|
182
|
+
W as getXFormatters,
|
|
183
|
+
J as getYFormatter
|
|
189
184
|
};
|