umwd-components 0.1.746 → 0.1.747
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.
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("next/image"),i=require("@mui/material/Dialog"),s=require("@mui/material/AppBar"),l=require("@mui/material/Box"),n=require("@mui/material/Toolbar"),a=require("@mui/material/Typography"),x=require("@mui/material/Container"),o=require("@mui/material/Button"),d=require("@mui/material/List"),h=require("@mui/material/ListItem"),c=require("@mui/material/Divider"),m=require("@mui/material/ListItemText"),p=require("@mui/material/Tabs"),u=require("@mui/material/Tab"),g=require("@mui/icons-material/Close"),j=require("@mui/icons-material/MoreVert"),y=require("@mui/material/styles"),f=require("../StyledLink.js");exports.default=function({data:b}){const{site_title:w,logo:v,navigation:q,maxWidth:T="lg",minHeight:I,sx:k={},home_url:S="/#home",slot1:L=null,slot2:F=null}=b,[D,_]=t.useState(!1),[C,W]=t.useState(0),G=()=>{_(!1)},H=y.useTheme();return t.useEffect(()=>{const e=()=>{const e=document.querySelectorAll("section"),t=window.scrollY+1;e.forEach((e,r)=>{t>=e.offsetTop&&t<e.offsetTop+e.offsetHeight&&W(r)})};return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[]),e.jsx(s,{position:"sticky",sx:{backgroundColor:H.palette.primary.main,...k},children:e.jsx(x,{maxWidth:T,children:e.jsxs(n,{disableGutters:!0,sx:{py:1,"@media all":{minHeight:I}},children:[e.jsx(f.StyledLink,{href:S,sx:{color:H.palette.primary.contrastText,textDecoration:"none",lineHeight:.51},target:"_self",children:e.jsxs(l,{sx:{display:{xs:"none",md:"flex"},alignItems:"center"},children:[void 0!==v?.url&&e.jsx(r,{src:v.url,width:v.width||32,height:v.height||32,alt:v.alternativeText||"site logo",style:{maxHeight:"55px",marginRight:"20px",width:"auto",height:"auto",...v.style}}),null!=w&&e.jsx(e.Fragment,{children:"string"==typeof w?e.jsx(a,{variant:"h6",noWrap:!0,component:"h1",sx:{display:"flex",textDecoration:"none",p:0},children:w}):e.jsx(e.Fragment,{children:w})})]})}),e.jsx(l,{sx:{display:{xs:"none",md:"flex"},width:{xs:"0px",md:"30px"}}}),e.jsx(l,{sx:{flexGrow:1,display:{xs:"none",md:"flex",alignItems:"center"}},children:e.jsx(p,{value:C,"aria-label":"main website navigation",indicatorColor:"secondary",role:"navigation",children:q.length>0&&q.map((t,r)=>e.jsx(u,{value:t.tab,label:e.jsxs(e.Fragment,{children:[e.jsx(f.StyledLink,{href:t.path,sx:{color:H.palette.primary.contrastText},target:"_self",children:t.title}),t.subItems&&t.subItems.length>0&&t.subItems.map((t,r)=>{const i=50+50*r;return e.jsx(l,{sx:{position:"fixed"},children:e.jsx(l,{sx:{position:"absolute",top:i},children:e.jsx(f.StyledLink,{href:t.path,target:"_self",children:e.jsx(a,{className:"nested",variant:"button",textAlign:"center",sx:{display:"block",position:"absolute",top:"-1000px",transform:"translateX(-50%)",color:H.palette.primary.contrastText,transitionDuration:"0.5s",transitionDelay:"0.5s",width:"max-content","&:hover":{borderBottom:"1px solid red"}},children:t.title})})},`${t.documentId}-inner`)},t.documentId)})]}),sx:{color:H.palette.primary.contrastText,opacity:.9,position:"relative",overflow:"visible",display:"flex",flexDirection:"column","& .nested":{p:0},"&:hover":{".nested":{top:"0px"}}}},t.documentId))})}),e.jsx(f.StyledLink,{href:"/",sx:{color:H.palette.primary.contrastText,textDecoration:"none"},target:"_self",children:e.jsxs(l,{sx:{display:{xs:"flex",md:"none"},alignItems:"center"},children:[void 0!==v?.url&&e.jsx(l,{sx:{display:"flex",mr:1},children:e.jsx("img",{src:v.url,width:v.width||32,height:v.height||32,alt:v.alternativeText||"site logo",style:{maxHeight:"55px",width:"auto",height:"auto",...v.style}})}),null!=w&&e.jsx(e.Fragment,{children:"string"==typeof w?e.jsx(a,{variant:"h5",noWrap:!0,component:"h1",sx:{display:"flex",flexGrow:1,textDecoration:"none"},children:w}):e.jsx(e.Fragment,{children:w})})]})}),e.jsx(l,{sx:{display:{xs:"flex"},flexGrow:1}}),L&&e.jsx(l,{sx:{display:{xs:"none",md:"flex"},mr:2},children:L}),F&&e.jsx(l,{sx:{display:{xs:"none",md:"flex"},mr:2},children:F}),e.jsxs(l,{sx:{flexGrow:0,display:{xs:"flex",md:"none"}},children:[e.jsx(o,{onClick:()=>{_(!0)},sx:{width:"40px",height:"40px",borderRadius:"50%",p:0,minWidth:"unset",color:"primary.contrastText",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},children:e.jsx(j,{sx:{color:"primary.contrastText"}})}),e.jsxs(i,{fullScreen:!0,open:D,onClose:G,children:[e.jsx(s,{position:"sticky",children:e.jsx(x,{maxWidth:"xl",children:e.jsxs(n,{disableGutters:!0,sx:{py:1,justifyContent:"space-between"},children:[e.jsx(f.StyledLink,{href:"/",sx:{color:H.palette.primary.contrastText},target:"_self",children:e.jsxs(l,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[v?.url&&e.jsx(l,{sx:{display:"flex",mr:1},children:e.jsx("img",{src:v.url,alt:v.alternativeText||"logo",width:v.width||32,height:v.height||32,style:{maxHeight:"55px",width:"auto",height:"auto"}})}),null!=w&&e.jsx(e.Fragment,{children:"string"==typeof w?e.jsx(a,{variant:"h5",noWrap:!0,component:"h1",sx:{display:"flex",flexGrow:1,textDecoration:"none"},children:w}):e.jsx(e.Fragment,{children:w})})]})}),e.jsx(o,{onClick:G,sx:{width:"40px",height:"40px",borderRadius:"50%",p:0,minWidth:"unset",color:"primary.contrastText",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},"aria-label":"close",children:e.jsx(g,{sx:{color:"primary.contrastText"}})})]})})}),e.jsxs(d,{children:[q.length>0&&e.jsx(e.Fragment,{children:q.map(r=>e.jsxs(t.Fragment,{children:[e.jsx(f.StyledLink,{href:r.path,target:"_self",children:e.jsx(h,{children:e.jsx(m,{primary:r.title})})}),e.jsx(c,{}),r.subItems&&r.subItems.length>0&&e.jsx(d,{children:r.subItems.map(r=>e.jsxs(t.Fragment,{children:[e.jsx(f.StyledLink,{href:r.path,target:"_self",children:e.jsx(h,{children:e.jsx(m,{primary:r.title})})}),e.jsx(c,{})]},r.documentId))})]},r.documentId))}),L&&e.jsxs(e.Fragment,{children:[e.jsx(h,{children:L}),e.jsx(c,{})]}),F&&e.jsxs(e.Fragment,{children:[e.jsx(h,{children:F}),e.jsx(c,{})]})]})]})]})]})})})};
|
|
7
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("next/image"),i=require("@mui/material/Dialog"),s=require("@mui/material/AppBar"),l=require("@mui/material/Box"),n=require("@mui/material/Toolbar"),a=require("@mui/material/Typography"),x=require("@mui/material/Container"),o=require("@mui/material/Button"),d=require("@mui/material/List"),h=require("@mui/material/ListItem"),c=require("@mui/material/Divider"),m=require("@mui/material/ListItemText"),p=require("@mui/material/Tabs"),u=require("@mui/material/Tab"),g=require("@mui/icons-material/Close"),j=require("@mui/icons-material/MoreVert"),y=require("@mui/material/styles"),f=require("../StyledLink.js");exports.default=function({data:b}){const{site_title:w,logo:v,navigation:q,maxWidth:T="lg",minHeight:I,sx:k={},home_url:S="/#home",slot1:L=null,slot2:F=null}=b,[D,_]=t.useState(!1),[C,W]=t.useState(0),G=()=>{_(!1)},H=y.useTheme();return t.useEffect(()=>{const e=()=>{const e=document.querySelectorAll("section"),t=window.scrollY+1;e.forEach((e,r)=>{t>=e.offsetTop&&t<e.offsetTop+e.offsetHeight&&r<q.length&&W(r)})};return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[]),e.jsx(s,{position:"sticky",sx:{backgroundColor:H.palette.primary.main,...k},children:e.jsx(x,{maxWidth:T,children:e.jsxs(n,{disableGutters:!0,sx:{py:1,"@media all":{minHeight:I}},children:[e.jsx(f.StyledLink,{href:S,sx:{color:H.palette.primary.contrastText,textDecoration:"none",lineHeight:.51},target:"_self",children:e.jsxs(l,{sx:{display:{xs:"none",md:"flex"},alignItems:"center"},children:[void 0!==v?.url&&e.jsx(r,{src:v.url,width:v.width||32,height:v.height||32,alt:v.alternativeText||"site logo",style:{maxHeight:"55px",marginRight:"20px",width:"auto",height:"auto",...v.style}}),null!=w&&e.jsx(e.Fragment,{children:"string"==typeof w?e.jsx(a,{variant:"h6",noWrap:!0,component:"h1",sx:{display:"flex",textDecoration:"none",p:0},children:w}):e.jsx(e.Fragment,{children:w})})]})}),e.jsx(l,{sx:{display:{xs:"none",md:"flex"},width:{xs:"0px",md:"30px"}}}),e.jsx(l,{sx:{flexGrow:1,display:{xs:"none",md:"flex",alignItems:"center"}},children:e.jsx(p,{value:C,"aria-label":"main website navigation",indicatorColor:"secondary",role:"navigation",children:q.length>0&&q.map((t,r)=>e.jsx(u,{value:t.tab,label:e.jsxs(e.Fragment,{children:[e.jsx(f.StyledLink,{href:t.path,sx:{color:H.palette.primary.contrastText},target:"_self",children:t.title}),t.subItems&&t.subItems.length>0&&t.subItems.map((t,r)=>{const i=50+50*r;return e.jsx(l,{sx:{position:"fixed"},children:e.jsx(l,{sx:{position:"absolute",top:i},children:e.jsx(f.StyledLink,{href:t.path,target:"_self",children:e.jsx(a,{className:"nested",variant:"button",textAlign:"center",sx:{display:"block",position:"absolute",top:"-1000px",transform:"translateX(-50%)",color:H.palette.primary.contrastText,transitionDuration:"0.5s",transitionDelay:"0.5s",width:"max-content","&:hover":{borderBottom:"1px solid red"}},children:t.title})})},`${t.documentId}-inner`)},t.documentId)})]}),sx:{color:H.palette.primary.contrastText,opacity:.9,position:"relative",overflow:"visible",display:"flex",flexDirection:"column","& .nested":{p:0},"&:hover":{".nested":{top:"0px"}}}},t.documentId))})}),e.jsx(f.StyledLink,{href:"/",sx:{color:H.palette.primary.contrastText,textDecoration:"none"},target:"_self",children:e.jsxs(l,{sx:{display:{xs:"flex",md:"none"},alignItems:"center"},children:[void 0!==v?.url&&e.jsx(l,{sx:{display:"flex",mr:1},children:e.jsx("img",{src:v.url,width:v.width||32,height:v.height||32,alt:v.alternativeText||"site logo",style:{maxHeight:"55px",width:"auto",height:"auto",...v.style}})}),null!=w&&e.jsx(e.Fragment,{children:"string"==typeof w?e.jsx(a,{variant:"h5",noWrap:!0,component:"h1",sx:{display:"flex",flexGrow:1,textDecoration:"none"},children:w}):e.jsx(e.Fragment,{children:w})})]})}),e.jsx(l,{sx:{display:{xs:"flex"},flexGrow:1}}),L&&e.jsx(l,{sx:{display:{xs:"none",md:"flex"},mr:2},children:L}),F&&e.jsx(l,{sx:{display:{xs:"none",md:"flex"},mr:2},children:F}),e.jsxs(l,{sx:{flexGrow:0,display:{xs:"flex",md:"none"}},children:[e.jsx(o,{onClick:()=>{_(!0)},sx:{width:"40px",height:"40px",borderRadius:"50%",p:0,minWidth:"unset",color:"primary.contrastText",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},children:e.jsx(j,{sx:{color:"primary.contrastText"}})}),e.jsxs(i,{fullScreen:!0,open:D,onClose:G,children:[e.jsx(s,{position:"sticky",children:e.jsx(x,{maxWidth:"xl",children:e.jsxs(n,{disableGutters:!0,sx:{py:1,justifyContent:"space-between"},children:[e.jsx(f.StyledLink,{href:"/",sx:{color:H.palette.primary.contrastText},target:"_self",children:e.jsxs(l,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[v?.url&&e.jsx(l,{sx:{display:"flex",mr:1},children:e.jsx("img",{src:v.url,alt:v.alternativeText||"logo",width:v.width||32,height:v.height||32,style:{maxHeight:"55px",width:"auto",height:"auto"}})}),null!=w&&e.jsx(e.Fragment,{children:"string"==typeof w?e.jsx(a,{variant:"h5",noWrap:!0,component:"h1",sx:{display:"flex",flexGrow:1,textDecoration:"none"},children:w}):e.jsx(e.Fragment,{children:w})})]})}),e.jsx(o,{onClick:G,sx:{width:"40px",height:"40px",borderRadius:"50%",p:0,minWidth:"unset",color:"primary.contrastText",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},"aria-label":"close",children:e.jsx(g,{sx:{color:"primary.contrastText"}})})]})})}),e.jsxs(d,{children:[q.length>0&&e.jsx(e.Fragment,{children:q.map(r=>e.jsxs(t.Fragment,{children:[e.jsx(f.StyledLink,{href:r.path,target:"_self",children:e.jsx(h,{children:e.jsx(m,{primary:r.title})})}),e.jsx(c,{}),r.subItems&&r.subItems.length>0&&e.jsx(d,{children:r.subItems.map(r=>e.jsxs(t.Fragment,{children:[e.jsx(f.StyledLink,{href:r.path,target:"_self",children:e.jsx(h,{children:e.jsx(m,{primary:r.title})})}),e.jsx(c,{})]},r.documentId))})]},r.documentId))}),L&&e.jsxs(e.Fragment,{children:[e.jsx(h,{children:L}),e.jsx(c,{})]}),F&&e.jsxs(e.Fragment,{children:[e.jsx(h,{children:F}),e.jsx(c,{})]})]})]})]})]})})})};
|