sage-nexus-ui 1.13.8 → 1.13.9
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
|
-
import{jsxs as e,Fragment as n,jsx as t}from"react/jsx-runtime";import{useTheme as i,useMediaQuery as r,AppBar as l,Toolbar as o,Box as s}from"@mui/material";import{NexusHome as d}from"./NexusHome.mjs";import{ThemeToggle as c}from"./ThemeToggle.mjs";import x from"./NexusLogo.mjs";import{ActionBarTitle as a}from"./Typography.mjs";import{useState as m,useRef as u,useEffect as
|
|
1
|
+
import{jsxs as e,Fragment as n,jsx as t}from"react/jsx-runtime";import{useTheme as i,useMediaQuery as r,AppBar as l,Toolbar as o,Box as s}from"@mui/material";import{NexusHome as d}from"./NexusHome.mjs";import{ThemeToggle as c}from"./ThemeToggle.mjs";import x from"./NexusLogo.mjs";import{ActionBarTitle as a}from"./Typography.mjs";import{useState as m,useRef as u,useEffect as f}from"react";const h=({title:h,extraLeft:p,extraRight:g,homeHref:w,showHome:v=!0})=>{const[y,b]=m(!0),C=u(0),j=i(),k=r(j.breakpoints.up("md")),R=u(null),[I,E]=m(49),B=u(null),z=u(null),L=u(null),A=u(null),H=u(null),M=u(null),[T,$]=m(null),[D,N]=m(null);return f(()=>{const e=R.current;if(!e)return;const n=()=>E(e.getBoundingClientRect().height);n();const t=window.ResizeObserver;if(!t)return;const i=new t(n);return i.observe(e),()=>i.disconnect()},[]),f(()=>{const e=()=>{const e=window.scrollY;e>C.current?b(!1):b(!0),C.current=e};return window.addEventListener("scroll",e,{passive:!0}),()=>window.removeEventListener("scroll",e)},[]),f(()=>{if(!k)return $(null),void N(null);function e(){const e=z.current,n=L.current,t=B.current,i=A.current,r=H.current,l=M.current;if(!e||!n||!t)return;const o=e.getBoundingClientRect(),s=n.getBoundingClientRect(),d=t.getBoundingClientRect();if(i){const e=i.getBoundingClientRect().width||0,n=(o.right+s.left)/2,t=o.right+e/2+8,r=s.left-e/2-8,l=Math.min(Math.max(n,t),r);$(l-d.left)}else $(null);if(r&&l){const e=r.getBoundingClientRect().width||0,n=l.getBoundingClientRect(),t=(s.right+n.left)/2,i=s.right+e/2+8,o=n.left-e/2-8,c=Math.min(Math.max(t,i),o);N(c-d.left)}else N(null)}e(),window.addEventListener("resize",e);let n=null;const t=window.ResizeObserver;return t&&(n=new t(e),B.current&&n.observe(B.current)),()=>{window.removeEventListener("resize",e),n&&n.disconnect()}},[k,p,g]),e(n,{children:[t(l,{position:"sticky",component:"header",color:"inherit",elevation:0,ref:R,sx:{zIndex:j.zIndex.drawer+1,[j.breakpoints.up("md")]:{position:"fixed"}},children:e(o,{variant:"dense",sx:{display:"flex",flexDirection:{xs:"column",md:"row"},flexWrap:"wrap",alignItems:"center",justifyContent:{xs:"center",md:"space-between"},py:{xs:1,md:0}},children:[t(s,{sx:{width:{xs:"100%",md:"auto"},textAlign:"center",display:{xs:"block",md:"none"}},children:t(a,{children:h})}),(p||g)&&e(s,{sx:{display:{xs:"flex",md:"none"},justifyContent:"center",alignItems:"center",gap:1,width:"100%"},children:[p&&t(s,{children:p}),g&&t(s,{children:g})]}),t(s,{sx:{display:"block",width:"100%",maxHeight:{xs:k||y?"300px":"0px",md:"none"},overflow:{xs:"hidden",md:"visible"},transition:{xs:"max-height 0.2s ease-in-out",md:"none"}},children:e(s,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:"center",width:"100%",gap:{xs:1,md:0},position:"relative"},ref:B,children:[t(s,{sx:{display:"flex",alignItems:"center",width:{xs:"100%",md:"auto"},flex:{xs:"none",md:1},justifyContent:{xs:"center",md:"flex-start"}},children:t(s,{sx:{height:"38px",pt:.5,display:{xs:"none",md:"block"}},ref:z,children:t(x,{})})}),t(s,{sx:{display:{xs:"none",md:"flex"},justifyContent:"center",alignItems:"center",position:"absolute",left:0,right:0,pointerEvents:"none"},children:t(s,{sx:{pointerEvents:"auto",textAlign:"center"},children:t(s,{ref:L,children:t(a,{children:h})})})}),t(s,{sx:{display:{xs:"none",md:p?"block":"none"},position:"absolute",left:null!=T?`${T}px`:void 0,transform:"translateX(-50%)",pointerEvents:"auto",textAlign:"center"},children:t(s,{ref:A,children:p})}),t(s,{sx:{display:{xs:"none",md:g?"block":"none"},position:"absolute",left:null!=D?`${D}px`:void 0,transform:"translateX(-50%)",pointerEvents:"auto",textAlign:"center"},children:t(s,{ref:H,children:g})}),t(s,{sx:{display:"flex",alignItems:"center",gap:1,width:{xs:"100%",md:"auto"},flex:{xs:"none",md:1},justifyContent:{xs:"center",md:"flex-end"}},children:e(s,{sx:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:1},ref:M,children:[v&&t(d,{href:w}),t(c,{})]})})]})})]})}),t(s,{sx:{display:{xs:"none",md:"block"},height:`${I}px`,flexShrink:0}})]})};export{h as ActionBar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="1.13.
|
|
1
|
+
const o="1.13.9";export{o as SAGE_NEXUS_UI_VERSION};
|