umwd-components 0.1.583 → 0.1.584
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.
- package/dist/src/components/auth/AuthWidget.js +1 -1
- package/dist/src/components/e-commerce/cart/CartWidget.js +1 -1
- package/dist/src/components/layout/NavbarV2.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/auth/AuthWidget.tsx +9 -5
- package/src/components/e-commerce/cart/CartWidget.tsx +108 -71
- package/src/components/layout/NavbarV2.tsx +26 -4
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import e from"react";import t from"@mui/material/SpeedDial";import o from"@mui/material/SpeedDialAction";import
|
|
7
|
+
import e from"react";import t from"@mui/material/SpeedDial";import o from"@mui/material/SpeedDialAction";import i from"@mui/material/Box";import r from"@mui/material/Stack";import n from"@mui/material/CircularProgress";import m from"@mui/icons-material/AccountCircle";import a from"@mui/icons-material/Person";import l from"@mui/icons-material/Folder";import u from"@mui/icons-material/ListAlt";import c from"@mui/icons-material/Login";import s from"@mui/icons-material/Logout";import p from"@mui/icons-material/HowToReg";import{useRouter as g}from"next/navigation";import{useSession as d}from"../../context/auth/SessionContext.js";import f from"@mui/material/Button";var E={loggedIn:[{icon:e.createElement(a,null),name:"Profile",route:"/user/profile"},{icon:e.createElement(u,null),name:"Orders",route:"/user/orders"},{icon:e.createElement(l,null),name:"Documents",route:"/user/documents"}],loggedOut:[{icon:e.createElement(c,null),name:"Sign-In",route:"/auth/signin"},{icon:e.createElement(p,null),name:"Register",route:"/auth/register"}]};function x(a){var l=a.actions,u=void 0===l?E:l,c=g(),p=d(),x=p.user,h=p.loading,v=p.error,k=p.logout;return h?e.createElement(i,{sx:{position:"relative",width:"40px",height:"40px"}},e.createElement(n,null)):v?e.createElement("p",null,"Error: ",v):e.createElement(e.Fragment,null,e.createElement(r,{spacing:1,direction:"column",sx:{display:{xs:"flex",md:"none"}}},(x?u.loggedIn:u.loggedOut).map((function(t){return e.createElement(f,{variant:"contained",startIcon:t.icon,onClick:function(){return c.push(t.route)}},t.name)}))),e.createElement(i,{sx:{display:{xs:"none",md:"block"},position:"relative",width:"40px",height:"40px"}},e.createElement(t,{ariaLabel:"SpeedDial basic example",icon:e.createElement(m,null),direction:"down",sx:{position:"absolute",top:0,right:0,width:40,"& .MuiFab-root":{width:40,height:40}}},(x?u.loggedIn:u.loggedOut).map((function(t){return e.createElement(o,{key:t.name,icon:t.icon,tooltipTitle:t.name,onClick:function(){return c.push(t.route)}})})),x&&e.createElement(o,{icon:e.createElement(s,null),tooltipTitle:"Log-Out",onClick:function(){return k()}}))))}export{x as default};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{extends as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{__read as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useState as
|
|
7
|
+
import{extends as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{__read as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useState as a}from"react";import o from"@mui/material/Box";import i from"@mui/material/Stack";import n from"@mui/material/Button";import l from"@mui/material/Badge";import m from"@mui/material/IconButton";import c from"@mui/material/CircularProgress";import s from"@mui/material/useMediaQuery";import{useTheme as p}from"@mui/material/styles";import u from"next/link";import x from"@mui/icons-material/ShoppingCart";import d from"./CartSummary.js";import{useClientSideCart as f}from"./hooks.js";import{Grow as g}from"@mui/material";function h(h){var E=h.data,k=E.cartUrl,v=void 0===k?"/shop/cart":k,b=E.checkoutUrl,y=void 0===b?"/shop/check-out":b,C=f(),B=C.state,w=C.isClient,S=t(a(null),2),j=S[0],z=S[1],M=function(e){z(e.currentTarget)},T=function(){z(null)},_=Boolean(j),O=_?"cart-widget-popover":void 0,P=p(),U=s(P.breakpoints.down("sm"));return w?r.createElement(r.Fragment,null,r.createElement(i,{sx:{display:{xs:"flex",sm:"none"}}},r.createElement(d,null),r.createElement(i,{spacing:{xs:1,sm:2},sx:{p:{xs:1,sm:2}}},r.createElement(u,{href:v,legacyBehavior:!0},r.createElement(n,{size:U?"small":"large",variant:"outlined",onClick:function(){T()}},r.createElement(x,null))),r.createElement(u,{href:y,legacyBehavior:!0},r.createElement(n,{size:U?"small":"large",variant:"contained",onClick:function(){T()}},"Check Out")))),r.createElement(o,{component:"div",sx:{display:{xs:"none",sm:"block"},position:"relative",width:"40px",height:"40px",mr:"10px"},onMouseEnter:M,onMouseLeave:T},r.createElement(l,{badgeContent:B.totalAmount,color:"primary"},r.createElement(m,{"aria-describedby":O,onClick:function(e){j?T():M(e)},sx:{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)","&:hover":{backgroundColor:"primary.dark"}}},r.createElement(x,{sx:{color:"primary.contrastText"}}))),r.createElement(g,e({in:_},_?{}:{timeout:1e3}),r.createElement(o,{id:O,sx:[{position:"absolute",top:"65px",right:0,backgroundColor:"background.paper",boxShadow:2,width:"max-content"}]},r.createElement(d,null),r.createElement(i,{spacing:{xs:1,sm:2},sx:{p:{xs:1,sm:2}}},r.createElement(u,{href:v,legacyBehavior:!0},r.createElement(n,{size:U?"small":"large",variant:"outlined",onClick:function(){T()}},r.createElement(x,null))),r.createElement(u,{href:y,legacyBehavior:!0},r.createElement(n,{size:U?"small":"large",variant:"contained",onClick:function(){T()}},"Check Out"))))))):r.createElement(c,null)}export{h as default};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__assign as t}from"../../../node_modules/tslib/tslib.es6.js";import r,{useState as l,useEffect as a,Fragment as n}from"react";import i from"next/image";import o from"@mui/material/Dialog";import m from"@mui/material/AppBar";import s from"@mui/material/Box";import
|
|
7
|
+
import{__read as e,__assign as t}from"../../../node_modules/tslib/tslib.es6.js";import r,{useState as l,useEffect as a,Fragment as n}from"react";import i from"next/image";import o from"@mui/material/Dialog";import m from"@mui/material/AppBar";import s from"@mui/material/Box";import c from"@mui/material/Toolbar";import x from"@mui/material/Typography";import p from"@mui/material/Container";import u from"@mui/material/Button";import d from"@mui/material/List";import f from"@mui/material/ListItem";import h from"@mui/material/Divider";import g from"@mui/material/ListItemText";import E from"@mui/material/Tabs";import y from"@mui/material/Tab";import b from"@mui/icons-material/Close";import v from"@mui/icons-material/MoreVert";import{useTheme as w}from"@mui/material/styles";import{StyledLink as T}from"../StyledLink.js";function I(I){var k=I.data,D=k.site_title,F=k.logo,_=k.navigation,C=k.maxWidth,W=void 0===C?"lg":C,G=k.minHeight,H=k.sx,L=void 0===H?{}:H,S=k.home_url,B=void 0===S?"/#home":S,j=k.slot1,A=void 0===j?null:j,R=k.slot2,q=void 0===R?null:R,M=e(l(!1),2),N=M[0],V=M[1],X=e(l(0),2),Y=X[0],z=X[1],J=function(){V(!1)},K=w();return a((function(){var e=function(){var e=document.querySelectorAll("section"),t=window.scrollY+1;e.forEach((function(e,r){t>=e.offsetTop&&t<e.offsetTop+e.offsetHeight&&z(r)}))};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}}),[]),r.createElement(m,{position:"sticky",sx:t({backgroundColor:K.palette.primary.main},L)},r.createElement(p,{maxWidth:W},r.createElement(c,{disableGutters:!0,sx:{py:1,"@media all":{minHeight:G}}},r.createElement(T,{href:B,sx:{color:K.palette.primary.contrastText,textDecoration:"none",lineHeight:.51},target:"_self"},r.createElement(s,{sx:{display:{xs:"none",md:"flex"},alignItems:"center"}},void 0!==(null==F?void 0:F.url)&&r.createElement(i,{src:F.url,width:F.width||32,height:F.height||32,alt:F.alternativeText||"site logo",style:t({maxHeight:"55px",marginRight:"20px",width:"auto",height:"auto"},F.style)}),null!=D&&r.createElement(r.Fragment,null,"string"==typeof D?r.createElement(x,{variant:"h6",noWrap:!0,component:"h1",sx:{display:"flex",textDecoration:"none",p:0}},D):r.createElement(r.Fragment,null,D)))),r.createElement(s,{sx:{display:{xs:"none",md:"flex"},width:{xs:"0px",md:"30px"}}}),r.createElement(s,{sx:{flexGrow:1,display:{xs:"none",md:"flex",alignItems:"center"}}},r.createElement(E,{value:Y,"aria-label":"main website navigation",indicatorColor:"secondary",role:"navigation"},_.length>0&&_.map((function(e){return r.createElement(y,{key:e.id,value:e.tab,label:r.createElement(r.Fragment,null,r.createElement(T,{href:e.path,sx:{color:K.palette.primary.contrastText},target:"_self"},e.title),e.subItems&&e.subItems.length>0&&e.subItems.map((function(e,t){var l=50+50*t;return r.createElement(s,{key:e.id,sx:{position:"fixed"}},r.createElement(s,{sx:{position:"absolute",top:l}},r.createElement(T,{href:e.path,target:"_self"},r.createElement(x,{className:"nested",variant:"button",textAlign:"center",sx:{display:"block",position:"absolute",top:"-1000px",transform:"translateX(-50%)",color:K.palette.primary.contrastText,transitionDuration:"0.5s",transitionDelay:"0.5s",width:"max-content","&:hover":{borderBottom:"1px solid red"}}},e.title))))}))),sx:{color:K.palette.primary.contrastText,opacity:.9,position:"relative",overflow:"visible",display:"flex",flexDirection:"column","& .nested":{p:0},"&:hover":{".nested":{top:"0px"}}}})})))),r.createElement(T,{href:"/",sx:{color:K.palette.primary.contrastText,textDecoration:"none"},target:"_self"},r.createElement(s,{sx:{display:{xs:"flex",md:"none"},alignItems:"center"}},void 0!==(null==F?void 0:F.url)&&r.createElement(s,{sx:{display:"flex",mr:1}},r.createElement("img",{src:F.url,width:F.width||32,height:F.height||32,alt:F.alternativeText||"site logo",style:t({maxHeight:"55px",width:"auto",height:"auto"},F.style)})),null!=D&&r.createElement(r.Fragment,null,"string"==typeof D?r.createElement(x,{variant:"h5",noWrap:!0,component:"h1",sx:{display:"flex",flexGrow:1,textDecoration:"none"}},D):r.createElement(r.Fragment,null,D)))),r.createElement(s,{sx:{display:{xs:"flex"},flexGrow:1}}),A&&r.createElement(s,{sx:{display:{xs:"flex",md:"none"},mr:2}},A),q&&r.createElement(s,{sx:{display:{xs:"flex",md:"none"},mr:2}},q),r.createElement(s,{sx:{flexGrow:0,display:{xs:"flex",md:"none"}}},r.createElement(u,{onClick:function(){V(!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)"}},r.createElement(v,{sx:{color:"primary.contrastText"}})),r.createElement(o,{fullScreen:!0,open:N,onClose:J},r.createElement(m,{position:"sticky"},r.createElement(p,{maxWidth:"xl"},r.createElement(c,{disableGutters:!0,sx:{py:1,justifyContent:"space-between"}},r.createElement(T,{href:"/",sx:{color:K.palette.primary.contrastText},target:"_self"},r.createElement(s,{sx:{display:"flex",flexDirection:"row",alignItems:"center"}},(null==F?void 0:F.url)&&r.createElement(s,{sx:{display:"flex",mr:1}},r.createElement("img",{src:F.url,alt:F.alternativeText||"logo",width:F.width||32,height:F.height||32,style:{maxHeight:"55px",width:"auto",height:"auto"}})),null!=D&&r.createElement(r.Fragment,null,"string"==typeof D?r.createElement(x,{variant:"h5",noWrap:!0,component:"h1",sx:{display:"flex",flexGrow:1,textDecoration:"none"}},D):r.createElement(r.Fragment,null,D)))),r.createElement(u,{onClick:J,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"},r.createElement(b,{sx:{color:"primary.contrastText"}}))))),r.createElement(d,null,_.length>0&&r.createElement(r.Fragment,null,_.map((function(e){return r.createElement(n,{key:e.id},r.createElement(T,{href:e.path,target:"_self"},r.createElement(f,null,r.createElement(g,{primary:e.title}))),r.createElement(h,null),e.subItems&&e.subItems.length>0&&r.createElement(d,null,e.subItems.map((function(e){return r.createElement(n,{key:e.id},r.createElement(T,{href:e.path,target:"_self"},r.createElement(f,null,r.createElement(g,{primary:e.title}))),r.createElement(h,null))}))))}))),A&&r.createElement(r.Fragment,null,r.createElement(f,{sx:{display:{sx:"flex",md:"none"}}},A),r.createElement(h,null)),q&&r.createElement(r.Fragment,null,r.createElement(f,{sx:{display:{sx:"flex",md:"none"}}},q),r.createElement(h,null))))))))}export{I as default};
|