@gearbox-protocol/permissionless-ui 1.22.5 → 1.22.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),k=require("@fortawesome/free-solid-svg-icons"),o=require("react"),C=require("../app-bar/app-bar.cjs"),_=require("./navbar-indicator-context.cjs"),I=require("../navitem/navitem.cjs"),D=require("../simple-dropdown/simple-dropdown.cjs");require("@gearbox-protocol/sdk");const E=require("../../utils/cn.cjs");require("sonner");require("luxon");require("../../utils/z-index.cjs");const A=require("../icons/fa-icon.cjs"),x=24;function B({visibleItems:t,overflowItems:i,showMore:h,moreOpen:a,setMoreOpen:l,moreLabel:u,measured:d}){const p=_.useNavbarIndicator();return e.jsxs("div",{ref:p?.containerRef,className:"relative flex items-center gap-10 max-xs:gap-8 h-full",style:{opacity:d?1:0},children:[t.map(r=>e.jsx(I.NavItem,{active:r.active,onClick:r.onClick,style:{cursor:"pointer"},children:r.label},r.id)),h&&e.jsx(D.SimpleDropdown,{open:a,onOpenChange:l,title:e.jsx(I.NavItem,{active:i.some(r=>r.active),badge:e.jsx(A.FaIcon,{icon:k.faChevronDown,className:"size-3 text-foreground ml-1 transition-transform duration-200",style:{transform:a?"rotate(180deg)":void 0}}),children:u}),asChild:!0,align:"end",className:"p-0 border-0 bg-transparent shadow-none",children:e.jsx(C.AppBarDropdownMenu,{children:i.map(r=>e.jsx(C.AppBarMenuItem,{onClick:r.onClick,children:r.label},r.id))})}),e.jsx("div",{ref:p?.indicatorRef,className:"absolute bottom-0 h-0.5 bg-accent transition-all duration-300 ease-out pointer-events-none",style:{left:0,width:0,opacity:0,transform:"translateX(0)"}})]})}function P({items:t,moreLabel:i="More",className:h}){const a=o.useRef(null),l=o.useRef(null),[u,d]=o.useState(t.length),[p,r]=o.useState(!1),[M,b]=o.useState(!1),f=o.useCallback(()=>{const s=a.current,c=l.current;if(!s||!c||t.length===0)return;const v=s.clientWidth;if(v<=0)return;const w=Array.from(c.children),m=w.slice(0,t.length).map(n=>n.offsetWidth),W=w[t.length]?.offsetWidth??60;if(m.every(n=>n===0))return;let j=0;for(let n=0;n<t.length;n++)j+=(n===0?0:x)+m[n];if(j<=v){d(t.length),b(!0);return}let N=0,q=0;for(let n=0;n<t.length;n++){const O=m[n],y=N+(n===0?0:x)+O;if(y+x+W>v)break;N=y,q=n+1}d(q),b(!0)},[t]);o.useEffect(()=>{f()},[f]),o.useEffect(()=>{const s=a.current;if(!s)return;const c=new ResizeObserver(f);return c.observe(s),()=>c.disconnect()},[f]);const R=t.slice(0,u),g=t.slice(u),S=g.length>0;return e.jsxs("div",{ref:a,className:E.cn("relative flex-1 min-w-0 h-full flex items-center justify-center",h),children:[e.jsxs("div",{ref:l,"aria-hidden":!0,style:{position:"absolute",visibility:"hidden",height:0,overflow:"hidden",whiteSpace:"nowrap",pointerEvents:"none"},className:"flex items-center gap-10 max-xs:gap-8",children:[t.map(s=>e.jsx("span",{className:"inline-flex items-center whitespace-nowrap text-[15px] leading-[125%]",children:s.label},s.id)),e.jsxs("span",{className:"inline-flex items-center whitespace-nowrap text-[15px] leading-[125%] gap-2",children:[i,e.jsx("span",{className:"size-3"})]})]}),e.jsx(_.NavbarIndicatorProvider,{children:e.jsx(B,{visibleItems:R,overflowItems:g,showMore:S,moreOpen:p,setMoreOpen:r,moreLabel:i,measured:M})})]})}exports.NavbarWithOverflow=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),k=require("@fortawesome/free-solid-svg-icons"),o=require("react"),C=require("../app-bar/app-bar.cjs"),_=require("./navbar-indicator-context.cjs"),I=require("../navitem/navitem.cjs"),D=require("../simple-dropdown/simple-dropdown.cjs");require("@gearbox-protocol/sdk");const E=require("../../utils/cn.cjs");require("sonner");require("luxon");require("../../utils/z-index.cjs");const A=require("../icons/fa-icon.cjs"),x=40;function B({visibleItems:t,overflowItems:i,showMore:h,moreOpen:a,setMoreOpen:l,moreLabel:u,measured:d}){const p=_.useNavbarIndicator();return e.jsxs("div",{ref:p?.containerRef,className:"relative flex items-center gap-10 max-xs:gap-8 h-full",style:{opacity:d?1:0},children:[t.map(r=>e.jsx(I.NavItem,{active:r.active,onClick:r.onClick,style:{cursor:"pointer"},children:r.label},r.id)),h&&e.jsx(D.SimpleDropdown,{open:a,onOpenChange:l,title:e.jsx(I.NavItem,{active:i.some(r=>r.active),badge:e.jsx(A.FaIcon,{icon:k.faChevronDown,className:"size-3 text-foreground ml-1 transition-transform duration-200",style:{transform:a?"rotate(180deg)":void 0}}),children:u}),asChild:!0,align:"end",className:"p-0 border-0 bg-transparent shadow-none",children:e.jsx(C.AppBarDropdownMenu,{children:i.map(r=>e.jsx(C.AppBarMenuItem,{onClick:r.onClick,children:r.label},r.id))})}),e.jsx("div",{ref:p?.indicatorRef,className:"absolute bottom-0 h-0.5 bg-accent transition-all duration-300 ease-out pointer-events-none",style:{left:0,width:0,opacity:0,transform:"translateX(0)"}})]})}function P({items:t,moreLabel:i="More",className:h}){const a=o.useRef(null),l=o.useRef(null),[u,d]=o.useState(t.length),[p,r]=o.useState(!1),[M,b]=o.useState(!1),f=o.useCallback(()=>{const s=a.current,c=l.current;if(!s||!c||t.length===0)return;const v=s.clientWidth;if(v<=0)return;const w=Array.from(c.children),m=w.slice(0,t.length).map(n=>n.offsetWidth),W=w[t.length]?.offsetWidth??60;if(m.every(n=>n===0))return;let j=0;for(let n=0;n<t.length;n++)j+=(n===0?0:x)+m[n];if(j<=v){d(t.length),b(!0);return}let N=0,q=0;for(let n=0;n<t.length;n++){const O=m[n],y=N+(n===0?0:x)+O;if(y+x+W>v)break;N=y,q=n+1}d(q),b(!0)},[t]);o.useEffect(()=>{f()},[f]),o.useEffect(()=>{const s=a.current;if(!s)return;const c=new ResizeObserver(f);return c.observe(s),()=>c.disconnect()},[f]);const R=t.slice(0,u),g=t.slice(u),S=g.length>0;return e.jsxs("div",{ref:a,className:E.cn("relative flex-1 min-w-0 h-full flex items-center justify-center",h),children:[e.jsxs("div",{ref:l,"aria-hidden":!0,style:{position:"absolute",visibility:"hidden",height:0,overflow:"hidden",whiteSpace:"nowrap",pointerEvents:"none"},className:"flex items-center gap-10 max-xs:gap-8",children:[t.map(s=>e.jsx("span",{className:"inline-flex items-center whitespace-nowrap text-[15px] leading-[125%]",children:s.label},s.id)),e.jsxs("span",{className:"inline-flex items-center whitespace-nowrap text-[15px] leading-[125%] gap-2",children:[i,e.jsx("span",{className:"size-3"})]})]}),e.jsx(_.NavbarIndicatorProvider,{children:e.jsx(B,{visibleItems:R,overflowItems:g,showMore:S,moreOpen:p,setMoreOpen:r,moreLabel:i,measured:M})})]})}exports.NavbarWithOverflow=P;
@@ -11,7 +11,7 @@ import "sonner";
11
11
  import "luxon";
12
12
  import "../../utils/z-index.js";
13
13
  import { FaIcon as V } from "../icons/fa-icon.js";
14
- const b = 24;
14
+ const b = 40;
15
15
  function _({
16
16
  visibleItems: t,
17
17
  overflowItems: a,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/permissionless-ui",
3
- "version": "1.22.5",
3
+ "version": "1.22.6",
4
4
  "description": "Internal UI components",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/index.js",