sage-nexus-ui 1.13.6 → 1.13.8
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
|
|
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 h}from"react";const f=({title:f,extraLeft:p,extraRight:g,homeHref:w,showHome:y=!0})=>{const[v,b]=m(!0),C=u(0),j=i(),k=r(j.breakpoints.up("md")),E=u(null),R=u(null),I=u(null),B=u(null),L=u(null),A=u(null),[H,M]=m(null),[z,T]=m(null);return h(()=>{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)},[]),h(()=>{if(!k)return M(null),void T(null);function e(){const e=R.current,n=I.current,t=E.current,i=B.current,r=L.current,l=A.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);M(l-d.left)}else M(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);T(c-d.left)}else T(null)}e(),window.addEventListener("resize",e);let n=null;const t=window.ResizeObserver;return t&&(n=new t(e),E.current&&n.observe(E.current)),()=>{window.removeEventListener("resize",e),n&&n.disconnect()}},[k,p,g]),e(n,{children:[t(l,{position:"sticky",component:"header",color:"inherit",sx:{[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:f})}),(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||v?"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:E,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:R,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:I,children:t(a,{children:f})})})}),t(s,{sx:{display:{xs:"none",md:p?"block":"none"},position:"absolute",left:null!=H?`${H}px`:void 0,transform:"translateX(-50%)",pointerEvents:"auto",textAlign:"center"},children:t(s,{ref:B,children:p})}),t(s,{sx:{display:{xs:"none",md:g?"block":"none"},position:"absolute",left:null!=z?`${z}px`:void 0,transform:"translateX(-50%)",pointerEvents:"auto",textAlign:"center"},children:t(s,{ref:L,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:A,children:[y&&t(d,{href:w}),t(c,{})]})})]})})]})}),t(s,{sx:{display:{xs:"none",md:"block"},height:"48px",flexShrink:0}})]})};export{f as ActionBar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{useThemeMode as t}from"../theme/ThemeContext.mjs";import{Tooltip as r,IconButton as e}from"@mui/material";import i from"@mui/icons-material/LightMode";import m from"@mui/icons-material/DarkMode";const a=()=>{const{mode:a,toggleMode:l}=t();return o(r,{title:`Switch to ${"dark"===a?"light":"dark"} mode`,placement:"bottom",children:o(e,{onClick:l,size:"small",color:"warning","aria-label":`Switch to ${"dark"===a?"light":"dark"} mode`,children:o("dark"===a?i:m,{fontSize:"small"})})})};export{a as ThemeToggle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="1.13.
|
|
1
|
+
const o="1.13.8";export{o as SAGE_NEXUS_UI_VERSION};
|
package/dist/index.d.ts
CHANGED
|
@@ -447,8 +447,9 @@ interface ActionBarProps {
|
|
|
447
447
|
extraLeft?: ReactNode;
|
|
448
448
|
extraRight?: ReactNode;
|
|
449
449
|
homeHref?: string;
|
|
450
|
+
showHome?: boolean;
|
|
450
451
|
}
|
|
451
|
-
declare const ActionBar: ({ title, extraLeft, extraRight, homeHref, }: ActionBarProps) => ReactElement;
|
|
452
|
+
declare const ActionBar: ({ title, extraLeft, extraRight, homeHref, showHome, }: ActionBarProps) => ReactElement;
|
|
452
453
|
|
|
453
454
|
interface AccordionGroupProps {
|
|
454
455
|
children: ReactNode;
|