it-data-nexus-ui-library 2.4.4 → 2.4.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
- 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}from"@mui/material";import{Box as s}from"./_Primitives/Box.mjs";import{Stack as c}from"./_Primitives/Stack.mjs";import{NexusHome as d}from"./NexusHome.mjs";import{ThemeToggle as x}from"./ThemeToggle.mjs";import f from"./NexusLogo.mjs";import{ActionBarTitle as a}from"./Typography.mjs";import{useRef as h,useState as u,useEffect as m}from"react";const p=({title:p,extraLeft:g,extraRight:w,homeHref:y,showHome:v=!0})=>{const j=i(),C=r(j.breakpoints.up("lg")),I=h(null),[b,B]=u(49),R=h(null),k=h(null),z=h(null),E=h(null),M=h(null),A=h(null),[L,S]=u(null),[H,T]=u(null);return m(()=>{const e=I.current;if(!e)return;const n=()=>B(e.getBoundingClientRect().height);n();const t=window.ResizeObserver;if(!t)return;const i=new t(n);return i.observe(e),()=>i.disconnect()},[]),m(()=>{if(!C)return S(null),void T(null);function e(){const e=k.current,n=z.current,t=R.current,i=E.current,r=M.current,l=A.current;if(!e||!n||!t)return;const o=e.getBoundingClientRect(),s=n.getBoundingClientRect(),c=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);S(l-c.left)}else S(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,d=Math.min(Math.max(t,i),o);T(d-c.left)}else T(null)}e(),window.addEventListener("resize",e);let n=null;const t=window.ResizeObserver;return t&&(n=new t(e),R.current&&n.observe(R.current)),()=>{window.removeEventListener("resize",e),n&&n.disconnect()}},[C,g,w]),e(n,{children:[t(l,{position:"sticky",component:"header",color:"inherit",elevation:0,ref:I,sx:{zIndex:{xs:j.zIndex.appBar,sm:j.zIndex.drawer+1},[j.breakpoints.up("sm")]:{position:"fixed"}},children:e(o,{variant:"dense",sx:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:{lg:"center"},py:{xs:.5,lg:0}},children:[e(c,{sx:{display:{xs:"flex",sm:"none"},width:"100%"},spacing:.25,children:[e(c,{direction:"row",sx:{justifyContent:"flex-end","& .MuiIconButton-root":{padding:"4px"},"& svg":{fontSize:"1.1rem"}},children:[v&&t(d,{href:y}),t(x,{})]}),t(a,{sx:{textAlign:"center",fontSize:"1.1rem"},children:p})]}),(g||w)&&e(c,{direction:"row",sx:{display:{xs:"flex",sm:"none"},justifyContent:"center",alignItems:"center",gap:1,width:"100%",mt:1},children:[g,w]}),e(c,{sx:{display:{xs:"none",sm:"flex",lg:"none"},width:"100%"},spacing:.5,children:[e(c,{direction:"row",sx:{alignItems:"center",width:"100%"},children:[t(s,{sx:{flex:1,display:"flex",alignItems:"center"},children:t(s,{sx:{height:"38px",pt:.5},children:t(f,{})})}),t(a,{children:p}),e(c,{direction:"row",sx:{flex:1,justifyContent:"flex-end",alignItems:"center",gap:1},children:[v&&t(d,{href:y}),t(x,{})]})]}),(g||w)&&e(c,{direction:"row",sx:{justifyContent:"center",alignItems:"center",gap:2,pb:.5},children:[g&&t(s,{children:g}),w&&t(s,{children:w})]})]}),t(s,{sx:{display:{xs:"none",lg:"block"},width:"100%"},children:e(s,{sx:{display:"flex",flexDirection:"row",alignItems:"center",width:"100%",position:"relative"},ref:R,children:[t(s,{sx:{display:"flex",alignItems:"center",flex:1,justifyContent:"flex-start"},children:t(s,{sx:{height:"38px",pt:.5},ref:k,children:t(f,{})})}),t(s,{sx:{display:"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:z,children:t(a,{children:p})})})}),t(s,{sx:{display:g?"block":"none",position:"absolute",left:null!=L?`${L}px`:void 0,transform:"translateX(-50%)",pointerEvents:"auto",textAlign:"center"},children:t(s,{ref:E,children:g})}),t(s,{sx:{display:w?"block":"none",position:"absolute",left:null!=H?`${H}px`:void 0,transform:"translateX(-50%)",pointerEvents:"auto",textAlign:"center"},children:t(s,{ref:M,children:w})}),t(s,{sx:{display:"flex",alignItems:"center",flex:1,justifyContent:"flex-end"},children:e(s,{sx:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:1},ref:A,children:[v&&t(d,{href:y}),t(x,{})]})})]})})]})}),t(s,{sx:{display:{xs:"none",sm:"block"},height:`${b}px`,flexShrink:0}})]})};export{p as ActionBar};
1
+ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import{useTheme as i,useMediaQuery as r,AppBar as l,Toolbar as o}from"@mui/material";import{Box as s}from"./_Primitives/Box.mjs";import{Stack as c}from"./_Primitives/Stack.mjs";import{NexusHome as d}from"./NexusHome.mjs";import{ThemeToggle as x}from"./ThemeToggle.mjs";import f from"./NexusLogo.mjs";import{ActionBarTitle as a}from"./Typography.mjs";import{useRef as h,useState as u,useEffect as m}from"react";const p=({title:p,extraLeft:g,extraRight:w,homeHref:y,showHome:v=!0,logo:j})=>{const C=j??e(f,{}),I=i(),b=r(I.breakpoints.up("lg")),B=h(null),[R,k]=u(49),z=h(null),E=h(null),M=h(null),A=h(null),L=h(null),S=h(null),[H,T]=u(null),[$,D]=u(null);return m(()=>{const e=B.current;if(!e)return;const n=()=>k(e.getBoundingClientRect().height);n();const t=window.ResizeObserver;if(!t)return;const i=new t(n);return i.observe(e),()=>i.disconnect()},[]),m(()=>{if(!b)return T(null),void D(null);function e(){const e=E.current,n=M.current,t=z.current,i=A.current,r=L.current,l=S.current;if(!e||!n||!t)return;const o=e.getBoundingClientRect(),s=n.getBoundingClientRect(),c=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);T(l-c.left)}else T(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,d=Math.min(Math.max(t,i),o);D(d-c.left)}else D(null)}e(),window.addEventListener("resize",e);let n=null;const t=window.ResizeObserver;return t&&(n=new t(e),z.current&&n.observe(z.current)),()=>{window.removeEventListener("resize",e),n&&n.disconnect()}},[b,g,w]),n(t,{children:[e(l,{position:"sticky",component:"header",color:"inherit",elevation:0,ref:B,sx:{zIndex:{xs:I.zIndex.appBar,sm:I.zIndex.drawer+1},[I.breakpoints.up("sm")]:{position:"fixed"}},children:n(o,{variant:"dense",sx:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:{lg:"center"},py:{xs:.5,lg:0}},children:[n(c,{sx:{display:{xs:"flex",sm:"none"},width:"100%"},spacing:.25,children:[n(c,{direction:"row",sx:{justifyContent:"flex-end","& .MuiIconButton-root":{padding:"4px"},"& svg":{fontSize:"1.1rem"}},children:[v&&e(d,{href:y}),e(x,{})]}),e(a,{sx:{textAlign:"center",fontSize:"1.1rem"},children:p})]}),(g||w)&&n(c,{direction:"row",sx:{display:{xs:"flex",sm:"none"},justifyContent:"center",alignItems:"center",gap:1,width:"100%",mt:1},children:[g,w]}),n(c,{sx:{display:{xs:"none",sm:"flex",lg:"none"},width:"100%"},spacing:.5,children:[n(c,{direction:"row",sx:{alignItems:"center",width:"100%"},children:[e(s,{sx:{flex:1,display:"flex",alignItems:"center"},children:e(s,{sx:{height:"38px",pt:.5},children:C})}),e(a,{children:p}),n(c,{direction:"row",sx:{flex:1,justifyContent:"flex-end",alignItems:"center",gap:1},children:[v&&e(d,{href:y}),e(x,{})]})]}),(g||w)&&n(c,{direction:"row",sx:{justifyContent:"center",alignItems:"center",gap:2,pb:.5},children:[g&&e(s,{children:g}),w&&e(s,{children:w})]})]}),e(s,{sx:{display:{xs:"none",lg:"block"},width:"100%"},children:n(s,{sx:{display:"flex",flexDirection:"row",alignItems:"center",width:"100%",position:"relative"},ref:z,children:[e(s,{sx:{display:"flex",alignItems:"center",flex:1,justifyContent:"flex-start"},children:e(s,{sx:{height:"38px",pt:.5},ref:E,children:C})}),e(s,{sx:{display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,right:0,pointerEvents:"none"},children:e(s,{sx:{pointerEvents:"auto",textAlign:"center"},children:e(s,{ref:M,children:e(a,{children:p})})})}),e(s,{sx:{display:g?"block":"none",position:"absolute",left:null!=H?`${H}px`:void 0,transform:"translateX(-50%)",pointerEvents:"auto",textAlign:"center"},children:e(s,{ref:A,children:g})}),e(s,{sx:{display:w?"block":"none",position:"absolute",left:null!=$?`${$}px`:void 0,transform:"translateX(-50%)",pointerEvents:"auto",textAlign:"center"},children:e(s,{ref:L,children:w})}),e(s,{sx:{display:"flex",alignItems:"center",flex:1,justifyContent:"flex-end"},children:n(s,{sx:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:1},ref:S,children:[v&&e(d,{href:y}),e(x,{})]})})]})})]})}),e(s,{sx:{display:{xs:"none",sm:"block"},height:`${R}px`,flexShrink:0}})]})};export{p as ActionBar};
@@ -1 +1 @@
1
- const o="2.4.4";export{o as SAGE_NEXUS_UI_VERSION};
1
+ const o="2.4.6";export{o as SAGE_NEXUS_UI_VERSION};
package/dist/index.d.ts CHANGED
@@ -600,8 +600,9 @@ interface ActionBarProps {
600
600
  extraRight?: ReactNode;
601
601
  homeHref?: string;
602
602
  showHome?: boolean;
603
+ logo?: ReactNode;
603
604
  }
604
- declare const ActionBar: ({ title, extraLeft, extraRight, homeHref, showHome, }: ActionBarProps) => ReactElement;
605
+ declare const ActionBar: ({ title, extraLeft, extraRight, homeHref, showHome, logo, }: ActionBarProps) => ReactElement;
605
606
 
606
607
  interface AccordionGroupProps {
607
608
  children: ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "it-data-nexus-ui-library",
3
- "version": "2.4.4",
3
+ "version": "2.4.6",
4
4
  "description": "Nexus core components",
5
5
  "license": "ISC",
6
6
  "author": "emsmart-sage",