@australiangreens/ag-internal-components 0.0.27 → 0.0.29
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/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/components/ExampleComponent/index.d.ts.map +1 -1
- package/dist/components/NavBar/NavBarContext.d.ts +1 -0
- package/dist/components/NavBar/NavBarContext.d.ts.map +1 -1
- package/dist/components/NavBar/NavBarLightStyledList.d.ts +2 -0
- package/dist/components/NavBar/NavBarLightStyledList.d.ts.map +1 -0
- package/dist/components/NavBar/Styling.d.ts.map +1 -1
- package/dist/components/NavBar/index.d.ts +1 -0
- package/dist/components/NavBar/index.d.ts.map +1 -1
- package/dist/esm/index.js +626 -354
- package/dist/esm/index.js.map +1 -1
- package/dist/layouts/AppLayout/AppLayoutContext.d.ts +32 -0
- package/dist/layouts/AppLayout/AppLayoutContext.d.ts.map +1 -0
- package/dist/layouts/AppLayout/NavBar/NavBarDarkStyledList.d.ts +2 -0
- package/dist/layouts/AppLayout/NavBar/NavBarDarkStyledList.d.ts.map +1 -0
- package/dist/layouts/AppLayout/NavBar/Styling.d.ts +19 -0
- package/dist/layouts/AppLayout/NavBar/Styling.d.ts.map +1 -0
- package/dist/layouts/AppLayout/NavBar/index.d.ts +20 -0
- package/dist/layouts/AppLayout/NavBar/index.d.ts.map +1 -0
- package/dist/layouts/AppLayout/PageContainer.d.ts +14 -0
- package/dist/layouts/AppLayout/PageContainer.d.ts.map +1 -0
- package/dist/layouts/AppLayout/TopBar.d.ts +19 -0
- package/dist/layouts/AppLayout/TopBar.d.ts.map +1 -0
- package/dist/layouts/AppLayout/appLayoutContextStateReducer.d.ts +14 -0
- package/dist/layouts/AppLayout/appLayoutContextStateReducer.d.ts.map +1 -0
- package/dist/layouts/AppLayout/defaults.d.ts +21 -0
- package/dist/layouts/AppLayout/defaults.d.ts.map +1 -0
- package/dist/layouts/AppLayout/index.d.ts +4 -0
- package/dist/layouts/AppLayout/index.d.ts.map +1 -0
- package/dist/layouts/AppLayout/types.d.ts +23 -0
- package/dist/layouts/AppLayout/types.d.ts.map +1 -0
- package/dist/layouts/PageLayout/PageContainer.d.ts.map +1 -1
- package/dist/layouts/PageLayout/SidePanel.d.ts +1 -1
- package/dist/layouts/PageLayout/SidePanel.d.ts.map +1 -1
- package/dist/layouts/PageLayout/TopBar.d.ts.map +1 -1
- package/dist/layouts/PageLayout/index.d.ts +15 -1
- package/dist/layouts/PageLayout/index.d.ts.map +1 -1
- package/dist/layouts/index.d.ts +2 -0
- package/dist/layouts/index.d.ts.map +1 -1
- package/dist/providers/AgTheme/index.d.ts.map +1 -1
- package/dist/providers/SaladBar/SaladBarContext.d.ts +1 -1
- package/dist/providers/SaladBar/SaladBarContext.d.ts.map +1 -1
- package/dist/providers/SaladBar/testWrappers.d.ts +2 -1
- package/dist/providers/SaladBar/testWrappers.d.ts.map +1 -1
- package/dist/providers/SaladBar/types.d.ts +1 -1
- package/dist/providers/SaladBar/types.d.ts.map +1 -1
- package/package.json +3 -2
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var Le=Object.defineProperty,$e=Object.defineProperties;var Re=Object.getOwnPropertyDescriptors;var z=Object.getOwnPropertySymbols;var le=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable;var Y=(e,t,n)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,o=(e,t)=>{for(var n in t||(t={}))le.call(t,n)&&Y(e,n,t[n]);if(z)for(var n of z(t))de.call(t,n)&&Y(e,n,t[n]);return e},T=(e,t)=>$e(e,Re(t));var ce=(e,t)=>{var n={};for(var a in e)le.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&z)for(var a of z(e))t.indexOf(a)<0&&de.call(e,a)&&(n[a]=e[a]);return n};var ue=(e,t,n)=>(Y(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("react"),Me=require("@mui/material/Button"),qe=require("@mui/material/Paper"),He=require("@mui/material/Typography"),ze=require("@mui/material/CssBaseline"),B=require("@mui/material/styles"),We=require("@mui/material/Drawer"),Ge=require("@australiangreens/ag-error"),we=require("souvlaki"),Ue=require("@mui/material/List"),C=require("@mui/material"),Ve=require("@mui/icons-material/ArrowForward"),Xe=require("@mui/icons-material/ArrowBack"),Qe=require("@mui/material/Box"),Ke=require("@mui/material/IconButton"),Je=require("@mui/material/Container"),Ye=require("@mui/material/Snackbar"),Ze=require("@mui/material/Alert"),et=require("@mui/material/LinearProgress"),tt=require("@mui/material/CircularProgress"),u=e=>e&&e.__esModule?e:{default:e},nt=u(Me),rt=u(qe),L=u(He),ot=u(ze),Be=u(We),at=u(Ue),Ce=u(Ve),me=u(Xe),it=u(Qe),pe=u(Ke),st=u(Je),lt=u(Ye),dt=u(Ze),ct=u(et),ut=u(tt);function pt({text:e}){const[t,n]=l.useState(0);return r.jsxs(r.Fragment,{children:[r.jsx(L.default,{variant:"h6",color:"inherit",component:"div",sx:{fontSize:"22px"},children:"Hello world"}),r.jsx(L.default,{variant:"caption",display:"block",children:r.jsx("span",{children:"Just ensuring MUI is working as planned as a peer dependency. v0.0.11"})}),r.jsx(nt.default,{variant:"outlined",onClick:()=>n(a=>a+1),"aria-label":"Increment",children:"Hello I am a button"}),r.jsxs("p",{children:["This is some text: ",r.jsx("span",{children:e})]}),r.jsxs(rt.default,{children:["This number will incremember when button pressed: ",t]})]})}const te=330,ne=73,O="Navbar",I={root:`${O}-root`,menuButton:`${O}-menuButton`,hide:`${O}-hide`,content:`${O}-content`,userInfoHolder:`${O}-userInfoHolder`,settings:`${O}-settings`,pieChartIcon:`${O}-pieChartIcon`},ft=B.styled("div",{name:"NavBar"})(({theme:e})=>({[`&.${I.root}`]:{display:"flex"},[`& .${I.menuButton}`]:{marginRight:36},[`& .${I.hide}`]:{display:"none"},[`& .${I.content}`]:{flexGrow:1,padding:e.spacing(3)},[`& .${I.userInfoHolder}`]:{height:"148px",marginTop:"64px",marginBottom:"16px"}})),Se=()=>({position:"absolute",height:"100%",overflowX:"hidden",overflowY:"hidden",color:"white",backgroundColor:"black"}),gt=()=>o({width:te},Se()),ht=()=>o({width:ne},Se()),xt=B.styled(Be.default,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:t})=>o(o({width:t?te:ne,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",zIndex:e.zIndex.drawer+100},t&&{"& .MuiDrawer-paper":gt()}),!t&&{"& .MuiDrawer-paper":ht()}));class G extends Ge.AgError{}ue(G,"errorName","ContextError");const ye=l.createContext(null),vt={},wt={},Te=({overrideState:e=vt,overrideActions:t=wt,children:n})=>{const[{open:a},d]=l.useState({open:!0}),g=l.useCallback(m=>{d({open:m})},[]),h=o(o({open:a,setOpen:g},e),t);return r.jsx(ye.Provider,{value:h,children:n})},Oe=()=>{const e=l.useContext(ye);if(e===null)throw new G("Error: Tried to useNavBar outside of a <NavBarProvider>");return e},be=(e={})=>o({open:!0},e),Bt=we.createHelper((e=be(),t={})=>({children:n})=>r.jsx(Te,{overrideState:e,overrideActions:t,children:n})),fe=7,Ct=B.styled(at.default)(({theme:e})=>({backgroundColor:"black",color:"white","& .MuiListItem-root":{padding:"unset"},"& .MuiListItemButton-root":{" .MuiListItemIcon-root":{color:"white",padding:`${fe}px`},"&.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected":{borderLeftStyle:"solid",borderLeftWidth:"7px",borderLeftColor:e.palette.primary.main,paddingLeft:`calc(${e.spacing(2)} - ${fe}px)`},"&:hover":{backgroundColor:e.palette.primary.dark},"&.Mui-selected.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected:hover":{backgroundColor:e.palette.primary.dark}}}));function mt({"data-testid":e,children:t}){const{open:n}=Oe();return r.jsxs(ft,{className:I.root,"data-testid":e,children:[r.jsx(ot.default,{}),r.jsx(xt,{variant:"permanent",anchor:"left",transitionDuration:null,open:n,children:t})]})}const St=24,yt=64,b="TopBar",f={topStripe:`${b}-topStripe`,titleBar:`${b}-titleBar`,titleSlider:`${b}-titleSlider`,titleText:`${b}-titleText`,leftPanelButton:`${b}-leftPanelButton`,rightPanelButton:`${b}-leftPanelButton`},Tt=C.styled("div",{shouldForwardProp:e=>!["leftPanel","rightPanel"].includes(e),name:b})(({theme:e,leftPanel:t,rightPanel:n})=>{var a,d;return{width:"100%",[`& .${f.topStripe}`]:{width:"100%",height:`${St}px`,backgroundColor:e.palette.primary.main},[`& .${f.titleBar}`]:{backgroundColor:e.palette.primary.light,height:`${yt}px`,padding:e.spacing(0,3),width:"100%"},[`& .${f.titleSlider}`]:o(o({height:"100%",display:"flex",alignItems:"center",color:"white",transition:e.transitions.create("margin",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),[`& .${f.leftPanelButton}`]:{marginRight:e.spacing(2),flexGrow:0},[`& .${f.titleText}`]:{flexGrow:1},[`& .${f.rightPanelButton}`]:{flexGrow:0}},(t==null?void 0:t.open)&&{transition:e.transitions.create("margin",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.enteringScreen}),marginLeft:`${(a=t==null?void 0:t.width)!=null?a:0}px`}),(n==null?void 0:n.open)&&{transition:e.transitions.create("margin",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.enteringScreen}),marginRight:`${(d=n==null?void 0:n.width)!=null?d:0}px`})}});function Ot({titleText:e="",leftPanel:t,rightPanel:n,"data-testid":a}){return r.jsxs(Tt,{leftPanel:t,rightPanel:n,"data-testid":a,children:[r.jsx("div",{className:f.topStripe}),r.jsx("div",{className:f.titleBar,children:r.jsxs(C.Box,{className:f.titleSlider,children:[t!==void 0&&!t.open&&t.showOpenArrow&&r.jsxs(C.IconButton,{className:f.leftPanelButton,color:"inherit","aria-label":"Open left side panel",onClick:t==null?void 0:t.onOpen,edge:"start",size:"large",children:[" ",r.jsx(Ce.default,{})]}),r.jsx(L.default,{className:f.titleText,variant:"h6",noWrap:!0,children:e}),n!==void 0&&!n.open&&n.showOpenArrow&&r.jsxs(C.IconButton,{className:f.rightPanelButton,color:"inherit","aria-label":"Open right side panel",onClick:n==null?void 0:n.onOpen,edge:"end",size:"large",children:[" ",r.jsx(me.default,{})]})]})})]})}const Ie=400,bt=C.styled(Be.default,{shouldForwardProp:e=>!["width","debug","debugOpacity","navBarOpen","navBarWidthOpen","navBarWidthClosed"].includes(e),name:"SidePanelDrawer"})(({width:e,debugOpacity:t=!1,anchor:n,navBarOpen:a,navBarWidthOpen:d,navBarWidthClosed:g})=>({width:e,"& .MuiDrawer-paper":o(o({position:"absolute",width:e,boxSizing:"border-box",border:"unset",boxShadow:"0px 4px 5px rgba(0, 0, 0, 0.14), 0px 1px 10px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.2)"},t&&{opacity:"50%"}),n==="left"&&o({marginLeft:`${g}px`},a&&{marginLeft:`${d}px`}))})),It=C.styled(it.default,{shouldForwardProp:e=>!["anchor"].includes(e)})(({theme:e,anchor:t})=>T(o({display:"flex",alignItems:"center",padding:e.spacing(2)},e.mixins.toolbar),{justifyContent:t==="left"?"space-between":"flex-start",backgroundColor:e.palette.primary.light,height:"88px","&,*":{color:"white"}," .MuiTypography-root":{fontSize:"22px"}," .MuiButtonBase-root":{marginRight:t==="right"?e.spacing(2):0}}));function ge({children:e,anchor:t="left",open:n,onClose:a=()=>{},titleText:d="",width:g=Ie,showCloseArrow:h=!0,debugOpacity:m=!1,headerBoxProps:x={},onOpened:c,onClosed:v,"data-testid":S,navBarOpen:_=!1,navBarWidthOpen:p=0,navBarWidthClosed:F=0}){return r.jsxs(bt,{SlideProps:{onEntered:()=>c==null?void 0:c(),onExited:()=>v==null?void 0:v()},variant:"persistent",anchor:t,open:n,width:g,debugOpacity:m,"data-testid":S,navBarOpen:_,navBarWidthOpen:p,navBarWidthClosed:F,children:[r.jsx(It,T(o({anchor:t},x),{children:t==="left"?r.jsxs(r.Fragment,{children:[r.jsx(L.default,{variant:"h6",color:"inherit",component:"div",children:d}),h&&r.jsxs(pe.default,{onClick:a,size:"large","aria-label":"Close left side panel",children:[r.jsx(me.default,{"data-testid":"arrowbackicon"})," "]})]}):r.jsxs(r.Fragment,{children:[h&&r.jsxs(pe.default,{onClick:a,size:"large","aria-label":"Close right side panel",children:[r.jsx(Ce.default,{})," "]}),r.jsx(L.default,{variant:"h6",color:"inherit",component:"div",children:d})]})})),e]})}const _t=C.styled("div",{shouldForwardProp:e=>!["leftPanel","rightPanel"].includes(e),name:"PanelAwareMargins"})(({theme:e,leftPanel:t,rightPanel:n})=>{var a,d;return o(o({transition:e.transitions.create("margin",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen})},(t==null?void 0:t.open)&&{transition:e.transitions.create("margin",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.enteringScreen}),marginLeft:`${(a=t==null?void 0:t.width)!=null?a:0}px`}),(n==null?void 0:n.open)&&{transition:e.transitions.create("margin",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.enteringScreen}),marginRight:`${(d=n==null?void 0:n.width)!=null?d:0}px`})}),Ft=C.styled(st.default,{name:"PageContainer"})(({theme:e})=>({paddingTop:e.spacing(3),paddingBottom:e.spacing(3)})),Z=!1,ee=!1,W={titleText:"",flavour:"push",width:Ie,arrowButtons:"both",startOpen:!1,open:void 0,onChangeOpen:void 0,content:r.jsx(r.Fragment,{}),onOpened:void 0,onClosed:void 0,dataTestId:void 0};function Pt({children:e,titleText:t="",leftPanel:n,rightPanel:a,sidePanelsAreMutuallyExclusive:d=!0,debugOpacity:g=!1,pageContainerProps:h,pageContentDataTestId:m,topBarDataTestId:x,navBarOpen:c,navBarWidthOpen:v,navBarWidthClosed:S}){const[_,p]=l.useState(Z),[F,P]=l.useState(ee),[U,$]=l.useState(Z),[V,E]=l.useState(ee),N=n!==void 0,k=a!==void 0,{titleText:w,content:R,flavour:M,open:D,onChangeOpen:j,width:i,arrowButtons:s,startOpen:A,onOpened:Fe,onClosed:Pe,dataTestId:Ae}=n?o(o({},W),n):o({},W),{titleText:Ee,content:Ne,flavour:oe,open:X,onChangeOpen:ae,width:Q,arrowButtons:q,startOpen:H,onOpened:ke,onClosed:De,dataTestId:je}=a?o(o({},W),a):o({},W);l.useEffect(()=>{A!==Z&&(p(A),$(A))},[A]),l.useEffect(()=>{H!==ee&&(P(H),E(H))},[H]);const K=D===void 0?_:D,J=X===void 0?F:X,ie=y=>{D===void 0&&(p(y),d&&k&&(y?(P(!1),E(F)):P(V))),j&&j(y)},se=y=>{X===void 0&&(P(y),d&&N&&(y?(p(!1),$(_)):p(U))),ae&&ae(y)};return r.jsxs(C.Box,{children:[N&&r.jsx(ge,{"data-testid":Ae,anchor:"left",open:K,onClose:()=>ie(!1),width:i,titleText:w,debugOpacity:g,showCloseArrow:s==="both"||s==="close",onOpened:Fe,onClosed:Pe,navBarOpen:c,navBarWidthOpen:v,navBarWidthClosed:S,children:R}),k&&r.jsx(ge,{"data-testid":je,anchor:"right",open:J,onClose:()=>se(!1),width:Q,titleText:Ee,debugOpacity:g,showCloseArrow:q==="both"||q==="close",onOpened:ke,onClosed:De,navBarOpen:c,navBarWidthOpen:v,navBarWidthClosed:S,children:Ne}),r.jsx(Ot,o(o({titleText:t,"data-testid":x},N&&M==="push"?{leftPanel:{open:K,width:i,onOpen:()=>ie(!0),showOpenArrow:s==="both"||s==="open"}}:{}),k&&oe==="push"?{rightPanel:{open:J,width:Q,onOpen:()=>se(!0),showOpenArrow:q==="both"||q==="open"}}:{})),r.jsx(_t,T(o(o({},M==="push"?{leftPanel:{open:K,width:i}}:{}),oe==="push"?{rightPanel:{open:J,width:Q}}:{}),{children:r.jsx(Ft,T(o({"data-testid":m},h),{children:e}))}))]})}const At=B.createTheme({palette:{primary:{main:"#007236",dark:"#005221",light:"#00A04E",contrastText:"#FFFFFF"},secondary:{main:"#662D91",dark:"#440E62",light:"#93268F",contrastText:"#FFFFFF"},error:{main:"#D32F2F",dark:"#C62828",light:"#EF5350"},info:{main:"#0288D1",dark:"#01579B",light:"#03A9F4"},success:{main:"#0288D1",dark:"#01579B",light:"#03A9F4"}},components:{MuiTextField:{defaultProps:{color:"secondary"}},MuiToggleButtonGroup:{defaultProps:{color:"secondary"}},MuiCheckbox:{defaultProps:{color:"secondary"}},MuiSelect:{defaultProps:{color:"secondary"}},MuiSwitch:{defaultProps:{color:"secondary"}},MuiFormControl:{defaultProps:{color:"secondary"}},MuiMenuItem:{styleOverrides:{root:({theme:e})=>({"&.Mui-selected":{backgroundColor:B.alpha(e.palette.secondary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:B.alpha(e.palette.secondary.main,e.palette.action.selectedOpacity)},"&.Mui-focusVisible":{backgroundColor:B.alpha(e.palette.secondary.main,e.palette.action.focusOpacity)}}})}}},typography:{explainer:{fontSize:"14px",marginBlockStart:"1em"},h3:{fontSize:"1rem",fontWeight:700}}}),Et=B.createTheme({palette:{primary:{dark:"#00A651",light:"#A3D39C",main:"#007236",contrastText:"#FFF"},warning:{main:"#F5871F",light:"#FCC589",dark:"#A2590A",contrastText:"#FFF"},secondary:{main:"#662D91",light:"#BD8CBF",dark:"#440E62",contrastText:"#FFF"},error:{main:"#D43C95",light:"#8F2064",dark:"#F9CDE0",contrastText:"#FFF"},info:{main:"#00A88D",light:"#ADDCCF",dark:"#005243",contrastText:"#FFF"},success:{main:"#00A651",light:"#A3D39C",dark:"#007236",contrastText:"#FFF"}},typography:{explainer:{fontSize:"14px",marginBlockStart:"1em"}}});function Nt({name:e="internal",children:t}){const n=e==="internal"?At:e==="fed21"?Et:void 0;return r.jsx(B.ThemeProvider,{theme:n,children:t})}const kt={autoHideDuration:6e3,anchorOrigin:{vertical:"top",horizontal:"center"},disableWindowBlurListener:!1},Dt={shouldClose:(e,t)=>t!=="clickaway"},he={message:"",severity:"info",variant:"standard",progressIndicator:void 0},xe=100,ve=2e3,jt=2e3,Lt=(()=>{let e=0;return()=>(e+=1,e)})(),$t={borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"},Rt={},Mt={},re=l.createContext(null);function _e(g){var h=g,{overrideState:e=Rt,overrideActions:t=Mt,shouldClose:n=Dt.shouldClose,children:a}=h,d=ce(h,["overrideState","overrideActions","shouldClose","children"]);var j;const[{open:m},x]=l.useState({open:!1}),c=l.useRef([]),v=l.useRef(Date.now()),S=l.useRef(0),_=l.useCallback(i=>{x({open:i})},[]),p=l.useCallback((i={})=>{S.current+=1,c.current.length>=xe&&Date.now()-v.current>=ve&&(v.current=Date.now(),console.error(`SaladBarProvider: MAX_QUEUE_LENGTH (${xe}) hit ${S.current} times in last ${ve}ms)`),S.current=0);const s=o(T(o({},he),{key:Lt()}),i);return c.current.push(s),c.current.length===1&&x({open:!0}),s.key},[]),F=(i="",s={})=>p(o({message:i,severity:"success"},s)),P=(i="",s={})=>p(o({message:i,severity:"info"},s)),U=(i="",s={})=>p(o({message:i,severity:"warning"},s)),$=(i="",s={})=>p(o({message:i,severity:"error"},s)),V=i=>{const s=c.current.findIndex(A=>A.key===i);if(s!==-1)return s===0?(x({open:!1}),c.current[0]):c.current.splice(s,1)},E=(i,s)=>{n(i,s)&&x({open:!1})},N=()=>{},k=()=>{c.current.shift(),c.current.length>0&&x({open:!0})},w=(j=c.current[0])!=null?j:o({},he),R={};"autoHideDuration"in w&&(R.autoHideDuration=w.autoHideDuration);const M=o(o({},kt),d),D=o(o({open:m,setOpen:_,enqueueNotification:p,enqueueSuccessNotification:F,enqueueInfoNotification:P,enqueueWarningNotification:U,enqueueErrorNotification:$,removeNotification:V},e),t);return r.jsxs(re.Provider,{value:D,children:[a,r.jsx(lt.default,T(o(o({},M),R),{open:m,onClose:E,TransitionProps:{onExited:k,onExit:N},sx:{zIndex:jt},children:r.jsxs("div",{children:[r.jsx(dt.default,{onClose:i=>E(i,"closeAlert"),severity:w.severity,variant:"filled",icon:w.progressIndicator==="circular"?r.jsx(ut.default,{size:"1em"}):void 0,style:w.progressIndicator==="linear"?$t:void 0,children:w.message}),w.progressIndicator==="linear"&&r.jsx(ct.default,{color:"primary"})]})}))]})}function qt(){const e=l.useContext(re);if(e===null)throw new G("Error: Tried to useSaladBar outside of a <SaladBarProvider>");return e}const Ht=we.createHelper(()=>({children:e})=>r.jsx(_e,{children:e}));exports.AgThemeProvider=Nt;exports.Context=re;exports.ContextError=G;exports.ExampleComponent=pt;exports.NAVBAR_WIDTH_CLOSED=ne;exports.NAVBAR_WIDTH_OPENED=te;exports.NavBar=mt;exports.NavBarDarkStyledList=Ct;exports.NavBarProvider=Te;exports.PageLayout=Pt;exports.SaladBarProvider=_e;exports.buildNavBarState=be;exports.navBarClasses=I;exports.useNavBar=Oe;exports.useSaladBar=qt;exports.withNavBarProvider=Bt;exports.withSaladBarProvider=Ht;
|
|
1
|
+
"use strict";var Ue=Object.defineProperty,Xe=Object.defineProperties;var Qe=Object.getOwnPropertyDescriptors;var U=Object.getOwnPropertySymbols;var he=Object.prototype.hasOwnProperty,xe=Object.prototype.propertyIsEnumerable;var ne=(e,t,r)=>t in e?Ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,o=(e,t)=>{for(var r in t||(t={}))he.call(t,r)&&ne(e,r,t[r]);if(U)for(var r of U(t))xe.call(t,r)&&ne(e,r,t[r]);return e},v=(e,t)=>Xe(e,Qe(t));var fe=(e,t)=>{var r={};for(var a in e)he.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&U)for(var a of U(e))t.indexOf(a)<0&&xe.call(e,a)&&(r[a]=e[a]);return r};var ve=(e,t,r)=>(ne(e,typeof t!="symbol"?t+"":t,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),l=require("react"),i=require("@mui/material"),Ye=require("@mui/material/CssBaseline"),w=require("@mui/material/styles"),Ke=require("@mui/material/Drawer"),Je=require("@australiangreens/ag-error"),Se=require("souvlaki"),Ze=require("@mui/material/List"),Q=require("@mui/icons-material"),ae=e=>e&&e.__esModule?e:{default:e},Ie=ae(Ye),Oe=ae(Ke),ie=ae(Ze);function et({text:e}){const[t,r]=l.useState(0);return n.jsxs(n.Fragment,{children:[n.jsx(i.Typography,{variant:"h6",color:"inherit",component:"div",sx:{fontSize:"22px"},children:"Hello world"}),n.jsx(i.Typography,{variant:"caption",display:"block",children:n.jsx("span",{children:"Just ensuring MUI is working as planned as a peer dependency. v0.0.11"})}),n.jsx(i.Button,{variant:"outlined",onClick:()=>r(a=>a+1),"aria-label":"Increment",children:"Hello I am a button"}),n.jsxs("p",{children:["This is some text: ",n.jsx("span",{children:e})]}),n.jsxs(i.Paper,{children:["This number will incremember when button pressed: ",t]})]})}const se=330,le=73,S="Navbar",$={root:`${S}-root`,menuButton:`${S}-menuButton`,hide:`${S}-hide`,content:`${S}-content`,userInfoHolder:`${S}-userInfoHolder`,settings:`${S}-settings`,pieChartIcon:`${S}-pieChartIcon`},tt=w.styled("div",{name:"NavBar"})(({theme:e})=>({[`&.${$.root}`]:{display:"flex"},[`& .${$.menuButton}`]:{marginRight:36},[`& .${$.hide}`]:{display:"none"},[`& .${$.content}`]:{flexGrow:1,padding:e.spacing(3)},[`& .${$.userInfoHolder}`]:{height:"148px",marginTop:"64px",marginBottom:"16px"}})),$e=()=>({position:"absolute",height:"100%",overflowX:"hidden",overflowY:"hidden",color:"white",backgroundColor:"black"}),nt=()=>o({width:se},$e()),rt=()=>o({width:le},$e()),ot=w.styled(Oe.default,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:t})=>o(o({width:t?se:le,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",zIndex:e.zIndex.drawer+100},t&&{"& .MuiDrawer-paper":nt()}),!t&&{"& .MuiDrawer-paper":rt()}));class H extends Je.AgError{}ve(H,"errorName","ContextError");const Le=l.createContext(null),at={},it={},Ae=({overrideState:e=at,overrideActions:t=it,children:r})=>{const[{open:a},s]=l.useState({open:!0}),h=l.useCallback(p=>{s({open:p})},[]),x=l.useCallback(()=>{s(p=>v(o({},p),{open:!p.open}))},[]),g=o(o({open:a,setOpen:h,toggleOpen:x},e),t);return n.jsx(Le.Provider,{value:g,children:r})},Ne=()=>{const e=l.useContext(Le);if(e===null)throw new H("Error: Tried to useNavBar outside of a <NavBarProvider>");return e},ke=(e={})=>o({open:!0},e),st=Se.createHelper((e=ke(),t={})=>({children:r})=>n.jsx(Ae,{overrideState:e,overrideActions:t,children:r})),we=7,lt=w.styled(ie.default)(({theme:e})=>({backgroundColor:"black",color:"white","& .MuiListItem-root":{padding:"unset"},"& .MuiListItemButton-root":{" .MuiListItemIcon-root":{color:"white",padding:`${we}px`},"&.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected":{borderLeftStyle:"solid",borderLeftWidth:"7px",borderLeftColor:e.palette.primary.main,paddingLeft:`calc(${e.spacing(2)} - ${we}px)`},"&:hover":{backgroundColor:e.palette.primary.dark},"&.Mui-selected.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected:hover":{backgroundColor:e.palette.primary.dark}}})),ye=7,dt=w.styled(ie.default)(({theme:e})=>({backgroundColor:"#e8e8e8",color:"inherit","& .MuiListItem-root":{padding:"unset"},"& .MuiListItemButton-root":{" .MuiListItemIcon-root":{color:"inherit",padding:`${ye}px`},"&.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected":{borderLeftStyle:"solid",borderLeftWidth:"7px",borderLeftColor:e.palette.primary.main,paddingLeft:`calc(${e.spacing(2)} - ${ye}px)`},"&:hover":{backgroundColor:e.palette.primary.dark},"&.Mui-selected.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected:hover":{backgroundColor:e.palette.primary.dark}}}));function ct({"data-testid":e,children:t}){const{open:r}=Ne();return n.jsxs(tt,{className:$.root,"data-testid":e,children:[n.jsx(Ie.default,{}),n.jsx(ot,{variant:"permanent",anchor:"left",transitionDuration:null,open:r,children:t})]})}const ut=24,pt=64,O="TopBar",B={topStripe:`${O}-topStripe`,titleBar:`${O}-titleBar`,titleSlider:`${O}-titleSlider`,titleText:`${O}-titleText`,leftPanelButton:`${O}-leftPanelButton`,rightPanelButton:`${O}-leftPanelButton`},gt=i.styled("div",{shouldForwardProp:e=>!["leftPanel","rightPanel"].includes(e),name:O})(({theme:e,leftPanel:t,rightPanel:r})=>{var a,s;return{width:"100%",[`& .${B.topStripe}`]:{width:"100%",height:`${ut}px`,backgroundColor:e.palette.primary.main},[`& .${B.titleBar}`]:{backgroundColor:e.palette.primary.light,height:`${pt}px`,padding:e.spacing(0,3),width:"100%"},[`& .${B.titleSlider}`]:o(o({height:"100%",display:"flex",alignItems:"center",color:"white",transition:e.transitions.create("margin",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),[`& .${B.leftPanelButton}`]:{marginRight:e.spacing(2),flexGrow:0},[`& .${B.titleText}`]:{flexGrow:1},[`& .${B.rightPanelButton}`]:{flexGrow:0}},(t==null?void 0:t.open)&&{transition:e.transitions.create("margin",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.enteringScreen}),marginLeft:`${(a=t==null?void 0:t.width)!=null?a:0}px`}),(r==null?void 0:r.open)&&{transition:e.transitions.create("margin",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.enteringScreen}),marginRight:`${(s=r==null?void 0:r.width)!=null?s:0}px`})}});function ht({titleText:e="",leftPanel:t,rightPanel:r,"data-testid":a}){return n.jsxs(gt,{leftPanel:t,rightPanel:r,"data-testid":a,children:[n.jsx("div",{className:B.topStripe}),n.jsx("div",{className:B.titleBar,children:n.jsxs(i.Box,{className:B.titleSlider,children:[t!==void 0&&!t.open&&t.showOpenArrow&&n.jsxs(i.IconButton,{className:B.leftPanelButton,color:"inherit","aria-label":"Open left side panel",onClick:t==null?void 0:t.onOpen,edge:"start",size:"large",children:[" ",n.jsx(Q.ArrowForward,{})]}),n.jsx(i.Typography,{className:B.titleText,variant:"h6",noWrap:!0,children:e}),r!==void 0&&!r.open&&r.showOpenArrow&&n.jsxs(i.IconButton,{className:B.rightPanelButton,color:"inherit","aria-label":"Open right side panel",onClick:r==null?void 0:r.onOpen,edge:"end",size:"large",children:[" ",n.jsx(Q.ArrowBack,{})]})]})})]})}const Ee=400,xt=i.styled(i.Drawer,{shouldForwardProp:e=>!["width","debug","debugOpacity","navBarOpen","navBarWidthOpen","navBarWidthClosed"].includes(e),name:"SidePanelDrawer"})(({width:e,debugOpacity:t=!1,anchor:r,navBarOpen:a,navBarWidthOpen:s,navBarWidthClosed:h})=>({width:e,"& .MuiDrawer-paper":o(o({position:"absolute",width:e,boxSizing:"border-box",border:"unset",boxShadow:"0px 4px 5px rgba(0, 0, 0, 0.14), 0px 1px 10px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.2)"},t&&{opacity:"50%"}),r==="left"&&o({marginLeft:`${h}px`},a&&{marginLeft:`${s}px`}))})),ft=i.styled(i.Box,{shouldForwardProp:e=>!["anchor"].includes(e)})(({theme:e,anchor:t})=>v(o({display:"flex",alignItems:"center",padding:e.spacing(2)},e.mixins.toolbar),{justifyContent:t==="left"?"space-between":"flex-start",backgroundColor:e.palette.primary.light,height:"88px","&,*":{color:"white"}," .MuiTypography-root":{fontSize:"22px"}," .MuiButtonBase-root":{marginRight:t==="right"?e.spacing(2):0}}));function Be({children:e,anchor:t="left",open:r,onClose:a=()=>{},titleText:s="",width:h=Ee,showCloseArrow:x=!0,debugOpacity:g=!1,headerBoxProps:p={},onOpened:u,onClosed:f,"data-testid":T,navBarOpen:L=!1,navBarWidthOpen:y=0,navBarWidthClosed:A=0}){return n.jsxs(xt,{SlideProps:{onEntered:()=>u==null?void 0:u(),onExited:()=>f==null?void 0:f()},variant:"persistent",anchor:t,open:r,width:h,debugOpacity:g,"data-testid":T,navBarOpen:L,navBarWidthOpen:y,navBarWidthClosed:A,children:[n.jsx(ft,v(o({anchor:t},p),{children:t==="left"?n.jsxs(n.Fragment,{children:[n.jsx(i.Typography,{variant:"h6",color:"inherit",component:"div",children:s}),x&&n.jsxs(i.IconButton,{onClick:a,size:"large","aria-label":"Close left side panel",children:[n.jsx(Q.ArrowBack,{"data-testid":"arrowbackicon"})," "]})]}):n.jsxs(n.Fragment,{children:[x&&n.jsxs(i.IconButton,{onClick:a,size:"large","aria-label":"Close right side panel",children:[n.jsx(Q.ArrowForward,{})," "]}),n.jsx(i.Typography,{variant:"h6",color:"inherit",component:"div",children:s})]})})),e]})}const vt=i.styled("div",{shouldForwardProp:e=>!["leftPanel","rightPanel"].includes(e),name:"PanelAwareMargins"})(({theme:e,leftPanel:t,rightPanel:r})=>{var a,s;return o(o({transition:e.transitions.create("margin",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen})},(t==null?void 0:t.open)&&{transition:e.transitions.create("margin",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.enteringScreen}),marginLeft:`${(a=t==null?void 0:t.width)!=null?a:0}px`}),(r==null?void 0:r.open)&&{transition:e.transitions.create("margin",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.enteringScreen}),marginRight:`${(s=r==null?void 0:r.width)!=null?s:0}px`})}),wt=i.styled(i.Container,{name:"PageContainer"})(({theme:e})=>({paddingTop:e.spacing(3),paddingBottom:e.spacing(3)})),re=!1,oe=!1,X={titleText:"",flavour:"push",width:Ee,arrowButtons:"both",startOpen:!1,open:void 0,onChangeOpen:void 0,content:n.jsx(n.Fragment,{}),onOpened:void 0,onClosed:void 0,dataTestId:void 0};function yt({children:e,titleText:t="",leftPanel:r,rightPanel:a,sidePanelsAreMutuallyExclusive:s=!0,debugOpacity:h=!1,pageContainerProps:x,pageContentDataTestId:g,topBarDataTestId:p,navBarOpen:u,navBarWidthOpen:f,navBarWidthClosed:T}){const[L,y]=l.useState(re),[A,N]=l.useState(oe),[Y,W]=l.useState(re),[K,P]=l.useState(oe),F=r!==void 0,j=a!==void 0,{titleText:C,content:z,flavour:G,open:D,onChangeOpen:_,width:d,arrowButtons:c,startOpen:k,onOpened:Me,onClosed:Re,dataTestId:He}=r?o(o({},X),r):o({},X),{titleText:We,content:ze,flavour:ce,open:J,onChangeOpen:ue,width:Z,arrowButtons:q,startOpen:V,onOpened:Ge,onClosed:qe,dataTestId:Ve}=a?o(o({},X),a):o({},X);l.useEffect(()=>{k!==re&&(y(k),W(k))},[k]),l.useEffect(()=>{V!==oe&&(N(V),P(V))},[V]);const ee=D===void 0?L:D,te=J===void 0?A:J,pe=b=>{D===void 0&&(y(b),s&&j&&(b?(N(!1),P(A)):N(K))),_&&_(b)},ge=b=>{J===void 0&&(N(b),s&&F&&(b?(y(!1),W(L)):y(Y))),ue&&ue(b)};return n.jsxs(i.Box,{children:[F&&n.jsx(Be,{"data-testid":He,anchor:"left",open:ee,onClose:()=>pe(!1),width:d,titleText:C,debugOpacity:h,showCloseArrow:c==="both"||c==="close",onOpened:Me,onClosed:Re,navBarOpen:u,navBarWidthOpen:f,navBarWidthClosed:T,children:z}),j&&n.jsx(Be,{"data-testid":Ve,anchor:"right",open:te,onClose:()=>ge(!1),width:Z,titleText:We,debugOpacity:h,showCloseArrow:q==="both"||q==="close",onOpened:Ge,onClosed:qe,navBarOpen:u,navBarWidthOpen:f,navBarWidthClosed:T,children:ze}),n.jsx(ht,o(o({titleText:t,"data-testid":p},F&&G==="push"?{leftPanel:{open:ee,width:d,onOpen:()=>pe(!0),showOpenArrow:c==="both"||c==="open"}}:{}),j&&ce==="push"?{rightPanel:{open:te,width:Z,onOpen:()=>ge(!0),showOpenArrow:q==="both"||q==="open"}}:{})),n.jsx(vt,v(o(o({},G==="push"?{leftPanel:{open:ee,width:d}}:{}),ce==="push"?{rightPanel:{open:te,width:Z}}:{}),{children:n.jsx(wt,v(o({"data-testid":g},x),{children:e}))}))]})}const R={content:n.jsx(n.Fragment,{}),widthOpen:330,widthClosed:73},Bt=24,Ct=64,M="TopBar",m={topStripe:`${M}-topStripe`,titleBar:`${M}-titleBar`,titleSlider:`${M}-titleSlider`,titleText:`${M}-titleText`},Tt=i.styled("div",{shouldForwardProp:e=>!["leftPanel","rightPanel"].includes(e),name:M})(({theme:e})=>({width:"100%",[`& .${m.topStripe}`]:{width:"100%",height:`${Bt}px`,backgroundColor:e.palette.primary.main},[`& .${m.titleBar}`]:{backgroundColor:e.palette.primary.light,height:`${Ct}px`,padding:e.spacing(0,3),width:"100%"},[`& .${m.titleSlider}`]:{height:"100%",display:"flex",alignItems:"center",color:"white",transition:e.transitions.create("margin",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),[`& .${m.titleText}`]:{flexGrow:1}}}));function mt({titleText:e="","data-testid":t}){return n.jsxs(Tt,{"data-testid":t,children:[n.jsx("div",{className:m.topStripe}),n.jsx("div",{className:m.titleBar,children:n.jsx(i.Box,{className:m.titleSlider,children:n.jsx(i.Typography,{className:m.titleText,variant:"h6",noWrap:!0,children:e})})})]})}const bt=i.styled(i.Container,{name:"PageContainer"})(({theme:e})=>({paddingTop:e.spacing(3),paddingBottom:e.spacing(3)})),St={navBarOpen:!0,titleText:"",navBarWidthOpen:R.widthOpen,navBarWidthClosed:R.widthClosed};function It(e,t){switch(t.type){case"toggleNavBarOpen":return v(o({},e),{navBarOpen:!e.navBarOpen});case"setNavBarOpen":return v(o({},e),{navBarOpen:t.payload});case"setTitleText":return v(o({},e),{titleText:t.payload});default:throw new Error("Invalid action.type")}}const Pe=l.createContext(null),Ot={},$t={},Fe=({overrideState:e=Ot,overrideActions:t=$t,children:r})=>{const[{titleText:a,navBarOpen:s,navBarWidthOpen:h,navBarWidthClosed:x},g]=l.useReducer(It,St),p=l.useMemo(()=>({toggleNavBarOpen:()=>g({type:"toggleNavBarOpen"}),setNavBarOpen:f=>g({type:"setNavBarOpen",payload:f}),setTitleText:f=>g({type:"setTitleText",payload:f})}),[]),u=o(o(o({navBarOpen:s,titleText:a,navBarWidthOpen:h,navBarWidthClosed:x},p),e),t);return n.jsx(Pe.Provider,{value:u,children:r})},je=()=>{const e=l.useContext(Pe);if(e===null)throw new H("Error: Tried to call useAppLayout() outside of a <AppLayoutProvider>");return e},I="Navbar",E={root:`${I}-root`,menuButton:`${I}-menuButton`,hide:`${I}-hide`,content:`${I}-content`,userInfoHolder:`${I}-userInfoHolder`,settings:`${I}-settings`,pieChartIcon:`${I}-pieChartIcon`},Lt=w.styled("div",{name:"NavBar"})(({theme:e})=>({[`&.${E.root}`]:{display:"flex"},[`& .${E.menuButton}`]:{marginRight:36},[`& .${E.hide}`]:{display:"none"},[`& .${E.content}`]:{flexGrow:1,padding:e.spacing(3)},[`& .${E.userInfoHolder}`]:{height:"148px",marginTop:"64px",marginBottom:"16px"}})),De=()=>({position:"absolute",height:"100%",overflowX:"hidden",overflowY:"hidden",color:"white",backgroundColor:"black"}),At=e=>o({width:e},De()),Nt=e=>o({width:e},De()),kt=w.styled(Oe.default,{shouldForwardProp:e=>!["open","widthOpen","widthClosed"].includes(e)})(({theme:e,open:t,widthOpen:r,widthClosed:a})=>o(o({width:t?r:a,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",zIndex:e.zIndex.drawer+100},t&&{"& .MuiDrawer-paper":At(r)}),!t&&{"& .MuiDrawer-paper":Nt(a)})),Ce=7;w.styled(ie.default)(({theme:e})=>({backgroundColor:"black",color:"white","& .MuiListItem-root":{padding:"unset"},"& .MuiListItemButton-root":{" .MuiListItemIcon-root":{color:"white",padding:`${Ce}px`},"&.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected":{borderLeftStyle:"solid",borderLeftWidth:"7px",borderLeftColor:e.palette.primary.main,paddingLeft:`calc(${e.spacing(2)} - ${Ce}px)`},"&:hover":{backgroundColor:e.palette.primary.dark},"&.Mui-selected.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected:hover":{backgroundColor:e.palette.primary.dark}}}));function Et({open:e,widthOpen:t,widthClosed:r,"data-testid":a,children:s}){return n.jsxs(Lt,{className:E.root,"data-testid":a,children:[n.jsx(Ie.default,{}),n.jsx(kt,{variant:"permanent",anchor:"left",transitionDuration:null,open:e,widthOpen:t,widthClosed:r,children:s})]})}function Pt({children:e,navBar:t=R,pageContainerProps:r,pageContentDataTestId:a,topBarDataTestId:s}){const{navBarOpen:h,titleText:x}=je(),{content:g,widthOpen:p,widthClosed:u}=t?o(o({},R),t):o({},R);return n.jsx(i.Box,{display:"flex",flexDirection:"column",height:"100vh",children:n.jsxs(i.Box,{display:"flex",position:"relative",flexGrow:1,overflow:"hidden",children:[n.jsx(Et,{open:h,widthOpen:p,widthClosed:u,children:g}),n.jsx(i.Box,{component:"main",id:"main-content",flexGrow:1,overflow:"auto",tabIndex:-1,children:n.jsxs(i.Box,{children:[n.jsx(mt,{titleText:x,"data-testid":s}),n.jsx(bt,v(o({"data-testid":a},r),{children:e}))]})})]})})}function Ft(e){return n.jsx(Fe,{children:n.jsx(Pt,o({},e))})}const jt=w.createTheme({palette:{primary:{main:"#007236",dark:"#005221",light:"#00A04E",contrastText:"#FFFFFF"},secondary:{main:"#662D91",dark:"#440E62",light:"#93268F",contrastText:"#FFFFFF"},error:{main:"#D32F2F",dark:"#C62828",light:"#EF5350"},info:{main:"#0288D1",dark:"#01579B",light:"#03A9F4"},success:{main:"#0288D1",dark:"#01579B",light:"#03A9F4"}},components:{MuiTextField:{defaultProps:{color:"secondary"}},MuiToggleButtonGroup:{defaultProps:{color:"secondary"}},MuiCheckbox:{defaultProps:{color:"secondary"}},MuiSelect:{defaultProps:{color:"secondary"}},MuiSwitch:{defaultProps:{color:"secondary"}},MuiFormControl:{defaultProps:{color:"secondary"}},MuiMenuItem:{styleOverrides:{root:({theme:e})=>({"&.Mui-selected":{backgroundColor:w.alpha(e.palette.secondary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:w.alpha(e.palette.secondary.main,e.palette.action.selectedOpacity)},"&.Mui-focusVisible":{backgroundColor:w.alpha(e.palette.secondary.main,e.palette.action.focusOpacity)}}})}}},typography:{explainer:{fontSize:"14px",marginBlockStart:"1em"},h3:{fontSize:"1rem",fontWeight:700}}}),Dt=w.createTheme({palette:{primary:{dark:"#00A651",light:"#A3D39C",main:"#007236",contrastText:"#FFF"},warning:{main:"#F5871F",light:"#FCC589",dark:"#A2590A",contrastText:"#FFF"},secondary:{main:"#662D91",light:"#BD8CBF",dark:"#440E62",contrastText:"#FFF"},error:{main:"#D43C95",light:"#8F2064",dark:"#F9CDE0",contrastText:"#FFF"},info:{main:"#00A88D",light:"#ADDCCF",dark:"#005243",contrastText:"#FFF"},success:{main:"#00A651",light:"#A3D39C",dark:"#007236",contrastText:"#FFF"}},typography:{explainer:{fontSize:"14px",marginBlockStart:"1em"}}});function _t({name:e="internal",children:t}){const r=e==="internal"?jt:e==="fed21"?Dt:void 0;return n.jsx(w.ThemeProvider,{theme:r,children:t})}const Mt={autoHideDuration:6e3,anchorOrigin:{vertical:"top",horizontal:"center"},disableWindowBlurListener:!1},Rt={shouldClose:(e,t)=>t!=="clickaway"},Te={message:"",severity:"info",variant:"standard",progressIndicator:void 0},me=100,be=2e3,Ht=2e3,Wt=(()=>{let e=0;return()=>(e+=1,e)})(),zt={borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"},Gt={},qt={},de=l.createContext(null);function _e(h){var x=h,{overrideState:e=Gt,overrideActions:t=qt,shouldClose:r=Rt.shouldClose,children:a}=x,s=fe(x,["overrideState","overrideActions","shouldClose","children"]);var _;const[{open:g},p]=l.useState({open:!1}),u=l.useRef([]),f=l.useRef(Date.now()),T=l.useRef(0),L=l.useCallback(d=>{p({open:d})},[]),y=l.useCallback((d={})=>{T.current+=1,u.current.length>=me&&Date.now()-f.current>=be&&(f.current=Date.now(),console.error(`SaladBarProvider: MAX_QUEUE_LENGTH (${me}) hit ${T.current} times in last ${be}ms)`),T.current=0);const c=o(v(o({},Te),{key:Wt()}),d);return u.current.push(c),u.current.length===1&&p({open:!0}),c.key},[]),A=(d="",c={})=>y(o({message:d,severity:"success"},c)),N=(d="",c={})=>y(o({message:d,severity:"info"},c)),Y=(d="",c={})=>y(o({message:d,severity:"warning"},c)),W=(d="",c={})=>y(o({message:d,severity:"error"},c)),K=d=>{const c=u.current.findIndex(k=>k.key===d);if(c!==-1)return c===0?(p({open:!1}),u.current[0]):u.current.splice(c,1)},P=(d,c)=>{r(d,c)&&p({open:!1})},F=()=>{},j=()=>{u.current.shift(),u.current.length>0&&p({open:!0})},C=(_=u.current[0])!=null?_:o({},Te),z={};"autoHideDuration"in C&&(z.autoHideDuration=C.autoHideDuration);const G=o(o({},Mt),s),D=o(o({open:g,setOpen:L,enqueueNotification:y,enqueueSuccessNotification:A,enqueueInfoNotification:N,enqueueWarningNotification:Y,enqueueErrorNotification:W,removeNotification:K},e),t);return n.jsxs(de.Provider,{value:D,children:[a,n.jsx(i.Snackbar,v(o(o({},G),z),{open:g,onClose:P,TransitionProps:{onExited:j,onExit:F},sx:{zIndex:Ht},children:n.jsxs("div",{children:[n.jsx(i.Alert,{onClose:d=>P(d,"closeAlert"),severity:C.severity,variant:"filled",icon:C.progressIndicator==="circular"?n.jsx(i.CircularProgress,{size:"1em"}):void 0,style:C.progressIndicator==="linear"?zt:void 0,children:C.message}),C.progressIndicator==="linear"&&n.jsx(i.LinearProgress,{color:"primary"})]})}))]})}function Vt(){const e=l.useContext(de);if(e===null)throw new H("Error: Tried to useSaladBar outside of a <SaladBarProvider>");return e}const Ut=Se.createHelper((e={autoHideDuration:1},t={},r={})=>({children:a})=>n.jsx(_e,v(o({},e),{overrideState:t,overrideActions:r,children:a})));exports.AgThemeProvider=_t;exports.AppLayout=Ft;exports.AppLayoutProvider=Fe;exports.Context=de;exports.ContextError=H;exports.ExampleComponent=et;exports.NAVBAR_WIDTH_CLOSED=le;exports.NAVBAR_WIDTH_OPENED=se;exports.NavBar=ct;exports.NavBarDarkStyledList=lt;exports.NavBarLightStyledList=dt;exports.NavBarProvider=Ae;exports.PageLayout=yt;exports.SaladBarProvider=_e;exports.buildNavBarState=ke;exports.navBarClasses=$;exports.useAppLayout=je;exports.useNavBar=Ne;exports.useSaladBar=Vt;exports.withNavBarProvider=st;exports.withSaladBarProvider=Ut;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/components/ExampleComponent/index.tsx","../../src/components/NavBar/Styling.tsx","../../src/errors/ContextError.ts","../../src/components/NavBar/NavBarContext.tsx","../../src/components/NavBar/testWrappers.tsx","../../src/components/NavBar/NavBarDarkStyledList.tsx","../../src/components/NavBar/index.tsx","../../src/layouts/PageLayout/TopBar.tsx","../../src/layouts/PageLayout/SidePanel.tsx","../../src/layouts/PageLayout/PanelAwareMargins.tsx","../../src/layouts/PageLayout/PageContainer.tsx","../../src/layouts/PageLayout/index.tsx","../../src/providers/AgTheme/themes.ts","../../src/providers/AgTheme/index.tsx","../../src/providers/SaladBar/defaults.ts","../../src/providers/SaladBar/SaladBarContext.tsx","../../src/providers/SaladBar/useSaladBar.ts","../../src/providers/SaladBar/testWrappers.tsx"],"sourcesContent":["import { useState } from 'react';\nimport Button from '@mui/material/Button';\nimport Paper from '@mui/material/Paper';\nimport Typography from '@mui/material/Typography';\n\nexport interface ExampleComponentProps {\n /** Test */\n text: string;\n}\n\nexport default function ExampleComponent({ text }: ExampleComponentProps) {\n const [num, setNum] = useState(0);\n\n return (\n <>\n <Typography variant=\"h6\" color=\"inherit\" component=\"div\" sx={{ fontSize: '22px' }}>\n Hello world\n </Typography>\n\n <Typography variant=\"caption\" display=\"block\">\n <span>Just ensuring MUI is working as planned as a peer dependency. v0.0.11</span>\n </Typography>\n <Button\n variant=\"outlined\"\n onClick={() => setNum((oldNum) => oldNum + 1)}\n aria-label=\"Increment\"\n >\n Hello I am a button\n </Button>\n <p>\n This is some text: <span>{text}</span>\n </p>\n <Paper>This number will incremember when button pressed: {num}</Paper>\n </>\n );\n}\n","import { styled, CSSObject } from '@mui/material/styles';\nimport Drawer from '@mui/material/Drawer';\n\nexport const NAVBAR_WIDTH_OPENED = 330;\nexport const NAVBAR_WIDTH_CLOSED = 73;\n\nconst PREFIX = 'Navbar';\n\nexport const classes = {\n root: `${PREFIX}-root`,\n menuButton: `${PREFIX}-menuButton`,\n hide: `${PREFIX}-hide`,\n content: `${PREFIX}-content`,\n userInfoHolder: `${PREFIX}-userInfoHolder`,\n settings: `${PREFIX}-settings`,\n pieChartIcon: `${PREFIX}-pieChartIcon`,\n};\n\nexport const Root = styled('div', { name: 'NavBar' })(({ theme }) => ({\n [`&.${classes.root}`]: {\n display: 'flex',\n },\n\n [`& .${classes.menuButton}`]: {\n marginRight: 36,\n },\n\n [`& .${classes.hide}`]: {\n display: 'none',\n },\n\n [`& .${classes.content}`]: {\n flexGrow: 1,\n padding: theme.spacing(3),\n },\n\n [`& .${classes.userInfoHolder}`]: {\n height: '148px',\n marginTop: '64px',\n marginBottom: '16px',\n },\n}));\n\n// The starting point for this was the \"Mini variant drawer\" of\n// https://mui.com/components/drawers/#main-content\n\nconst sharedOverrides = (): CSSObject => ({\n position: 'absolute',\n height: '100%',\n overflowX: 'hidden',\n overflowY: 'hidden',\n color: 'white',\n backgroundColor: 'black',\n});\n\nconst openedMixin = (): CSSObject => ({\n width: NAVBAR_WIDTH_OPENED,\n ...sharedOverrides(),\n});\n\nconst closedMixin = (): CSSObject => ({\n width: NAVBAR_WIDTH_CLOSED,\n ...sharedOverrides(),\n});\n\nexport const NavDrawer = styled(Drawer, {\n shouldForwardProp: (prop) => prop !== 'open',\n})(({ theme, open }) => ({\n width: open ? NAVBAR_WIDTH_OPENED : NAVBAR_WIDTH_CLOSED,\n flexShrink: 0,\n whiteSpace: 'nowrap',\n boxSizing: 'border-box',\n zIndex: theme.zIndex.drawer + 100,\n\n ...(open && {\n '& .MuiDrawer-paper': openedMixin(),\n }),\n ...(!open && {\n '& .MuiDrawer-paper': closedMixin(),\n }),\n}));\n","import { AgError } from '@australiangreens/ag-error';\n\n// Superclass for errors involving React context.\nexport class ContextError extends AgError {\n static errorName = 'ContextError';\n}\n","import { createContext, useContext, PropsWithChildren, useState, useCallback } from 'react';\nimport { ContextError } from '../../errors/ContextError';\n\nexport type NavBarState = {\n open: boolean;\n};\n\nexport type NavBarActions = {\n setOpen: (newVal: boolean) => void;\n};\n\ntype NavBarContext = NavBarState & NavBarActions;\n\nconst Context = createContext<NavBarContext | null>(null);\n\ntype NavBarProviderProps = {\n overrideState?: Partial<NavBarState>;\n overrideActions?: Partial<NavBarActions>;\n};\n\n// Note: Must be at at this scope, otherwise useEffect will loop infinitely\nconst defaultOverrideState = {};\nconst defaultOverrideActions = {};\n\nexport const NavBarProvider = ({\n overrideState = defaultOverrideState,\n overrideActions = defaultOverrideActions,\n children,\n}: PropsWithChildren<NavBarProviderProps>) => {\n const [{ open }, setNavBarState] = useState<NavBarState>({ open: true });\n\n const setOpen = useCallback((newVal: boolean) => {\n setNavBarState({ open: newVal });\n }, []);\n\n const value: NavBarContext = {\n open,\n setOpen,\n ...overrideState,\n ...overrideActions,\n };\n\n return <Context.Provider value={value}>{children}</Context.Provider>;\n};\n\nexport const useNavBar = () => {\n const context = useContext(Context);\n\n if (context === null) {\n throw new ContextError('Error: Tried to useNavBar outside of a <NavBarProvider>');\n }\n\n return context;\n};\n","/* eslint-disable react/prop-types */\n/* eslint-disable react/display-name */\nimport { createHelper } from 'souvlaki';\n\nimport { NavBarProvider, NavBarActions, NavBarState } from './NavBarContext';\n\nexport type Builder<T> = (overrides?: Partial<T>) => T;\n\nexport const buildNavBarState: Builder<NavBarState> = (overrides = {}) => ({\n open: true,\n ...overrides,\n});\n\nexport const withNavBarProvider = createHelper(\n (state: Partial<NavBarState> = buildNavBarState(), actions: Partial<NavBarActions> = {}) =>\n ({ children }) => {\n return (\n <NavBarProvider overrideState={state} overrideActions={actions}>\n {children}\n </NavBarProvider>\n );\n }\n);\n","import { styled } from '@mui/material/styles';\nimport List, { ListProps } from '@mui/material/List';\n\nconst SELECTED_INDICATOR_WIDTH = 7;\n\nexport const NavBarDarkStyledList = styled(List)<ListProps>(({ theme }) => ({\n backgroundColor: 'black',\n color: 'white',\n\n '& .MuiListItem-root': {\n padding: 'unset',\n },\n\n '& .MuiListItemButton-root': {\n ' .MuiListItemIcon-root': {\n color: 'white',\n padding: `${SELECTED_INDICATOR_WIDTH}px`,\n },\n\n // Focus state\n '&.Mui-focusVisible': {\n backgroundColor: theme.palette.grey[700],\n },\n\n // Selected state\n '&.Mui-selected': {\n borderLeftStyle: 'solid',\n borderLeftWidth: '7px',\n borderLeftColor: theme.palette.primary.main,\n paddingLeft: `calc(${theme.spacing(2)} - ${SELECTED_INDICATOR_WIDTH}px)`,\n },\n\n // Hover state\n '&:hover': {\n backgroundColor: theme.palette.primary.dark,\n },\n\n // Focus+Selected state\n '&.Mui-selected.Mui-focusVisible': {\n backgroundColor: theme.palette.grey[700],\n },\n\n // Hover+Selected state\n '&.Mui-selected:hover': {\n backgroundColor: theme.palette.primary.dark,\n },\n\n // Focus+Hover+Selected state doesn't need to be specified\n // '&.Mui-selected.Mui-focusVisible:hover': {\n // },\n },\n})) as typeof List;\n","import { PropsWithChildren } from 'react';\nimport CssBaseline from '@mui/material/CssBaseline';\n\nimport { classes, Root, NavDrawer } from './Styling';\nimport { useNavBar } from './NavBarContext';\n\nexport { NAVBAR_WIDTH_OPENED, NAVBAR_WIDTH_CLOSED } from './Styling';\n\nexport type NavbarProps = {\n /** Set the datatest-id on the root element for using reactdom's getByTestId()\n * function */\n 'data-testid'?: string;\n};\n\n// TODO: Add in more common elements (or make another component) for user/organisations/logout etc?\n// TODO: Should there be two sets of 'children', one for the list and one for dialogs etc?\n\n/**\n * A (currently uncontrolled) styled navigation bar wth a context provider to\n * retrieve its current open/closed state. At this point in time its pretty\n * unopinionated, it just renders whatever children it is given. THe\n * NavBarDarkStyledList component can be used for consistent styling against the\n * background. We'll be changing the way we use NavBars soon anyway, so not much\n * point solidying the patterns yet.\n */\nexport default function NavBar({\n 'data-testid': dataTestId,\n children,\n}: PropsWithChildren<NavbarProps>) {\n const { open } = useNavBar();\n\n return (\n <Root className={classes.root} data-testid={dataTestId}>\n <CssBaseline />\n <NavDrawer\n variant=\"permanent\"\n anchor=\"left\"\n // We aren't using transitions, and {0} will still create an unwanted timeout\n transitionDuration={null as unknown as number}\n open={open}\n >\n {children}\n </NavDrawer>\n </Root>\n );\n}\n\nexport * from './NavBarContext';\nexport * from './testWrappers';\n\nexport * from './NavBarDarkStyledList';\n\n// TODO: This is a temporary fix, library clients shouldn't need this\nexport { classes as navBarClasses } from './Styling';\n","import { Box, IconButton, styled } from '@mui/material';\nimport Typography from '@mui/material/Typography';\nimport ArrowForwardIcon from '@mui/icons-material/ArrowForward';\nimport ArrowBackIcon from '@mui/icons-material/ArrowBack';\n\nconst TOP_STRIPE_HEIGHT = 24;\nconst TITLE_BAR_HEIGHT = 64;\n\nconst PREFIX = 'TopBar';\n\ninterface PanelProps {\n open: boolean;\n width: number;\n showOpenArrow: boolean;\n\n /** Called when the arrow button is pressed (if showOpenButton is true) */\n onOpen?: () => void;\n\n showOpenButton?: boolean;\n}\n\nexport interface TopBarProps {\n titleText?: string;\n leftPanel?: PanelProps;\n rightPanel?: PanelProps;\n 'data-testid'?: string;\n}\n\nexport const classes = {\n topStripe: `${PREFIX}-topStripe`,\n titleBar: `${PREFIX}-titleBar`,\n titleSlider: `${PREFIX}-titleSlider`,\n\n titleText: `${PREFIX}-titleText`,\n leftPanelButton: `${PREFIX}-leftPanelButton`,\n rightPanelButton: `${PREFIX}-leftPanelButton`,\n};\n\ninterface RootProps {\n leftPanel?: PanelProps;\n rightPanel?: PanelProps;\n}\n\nconst Root = styled('div', {\n shouldForwardProp: (prop) => !(['leftPanel', 'rightPanel'] as Array<PropertyKey>).includes(prop),\n name: PREFIX,\n})<RootProps>(({ theme, leftPanel, rightPanel }) => ({\n width: '100%',\n\n [`& .${classes.topStripe}`]: {\n width: '100%',\n height: `${TOP_STRIPE_HEIGHT}px`,\n backgroundColor: theme.palette.primary.main,\n },\n\n [`& .${classes.titleBar}`]: {\n backgroundColor: theme.palette.primary.light,\n height: `${TITLE_BAR_HEIGHT}px`,\n padding: theme.spacing(0, 3),\n width: '100%',\n },\n\n [`& .${classes.titleSlider}`]: {\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n color: 'white',\n\n transition: theme.transitions.create('margin', {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.leavingScreen,\n }),\n\n [`& .${classes.leftPanelButton}`]: {\n marginRight: theme.spacing(2),\n flexGrow: 0,\n },\n\n [`& .${classes.titleText}`]: {\n flexGrow: 1,\n },\n\n [`& .${classes.rightPanelButton}`]: {\n flexGrow: 0,\n },\n\n ...(leftPanel?.open && {\n transition: theme.transitions.create('margin', {\n easing: theme.transitions.easing.easeOut,\n duration: theme.transitions.duration.enteringScreen,\n }),\n marginLeft: `${leftPanel?.width ?? 0}px`,\n }),\n\n ...(rightPanel?.open && {\n transition: theme.transitions.create('margin', {\n easing: theme.transitions.easing.easeOut,\n duration: theme.transitions.duration.enteringScreen,\n }),\n marginRight: `${rightPanel?.width ?? 0}px`,\n }),\n },\n}));\n\n/**\n * Goes at the top of every page. Wasn't feeling creative in naming it.\n *\n * This differs from the typical appbar with a toolbar used in most MUI apps in\n * that it has to interact with a sliding side panel that is not the main\n * navbar.\n */\nexport default function TopBar({\n titleText = '',\n leftPanel,\n rightPanel,\n 'data-testid': dataTestId,\n}: TopBarProps) {\n return (\n <Root leftPanel={leftPanel} rightPanel={rightPanel} data-testid={dataTestId}>\n <div className={classes.topStripe} />\n <div className={classes.titleBar}>\n <Box className={classes.titleSlider}>\n {leftPanel !== undefined && !leftPanel.open && leftPanel.showOpenArrow && (\n <IconButton\n className={classes.leftPanelButton}\n color=\"inherit\"\n aria-label=\"Open left side panel\"\n onClick={leftPanel?.onOpen}\n edge=\"start\"\n size=\"large\"\n >\n {' '}\n <ArrowForwardIcon />\n </IconButton>\n )}\n\n <Typography className={classes.titleText} variant=\"h6\" noWrap>\n {titleText}\n </Typography>\n\n {rightPanel !== undefined && !rightPanel.open && rightPanel.showOpenArrow && (\n <IconButton\n className={classes.rightPanelButton}\n color=\"inherit\"\n aria-label=\"Open right side panel\"\n onClick={rightPanel?.onOpen}\n edge=\"end\"\n size=\"large\"\n >\n {' '}\n <ArrowBackIcon />\n </IconButton>\n )}\n </Box>\n </div>\n </Root>\n );\n}\n","import { PropsWithChildren } from 'react';\nimport ArrowBackIcon from '@mui/icons-material/ArrowBack';\nimport ArrowForwardIcon from '@mui/icons-material/ArrowForward';\nimport Drawer, { DrawerProps } from '@mui/material/Drawer';\nimport Box, { BoxProps } from '@mui/material/Box';\nimport Typography from '@mui/material/Typography';\nimport IconButton from '@mui/material/IconButton';\nimport { styled } from '@mui/material';\n\nexport const DEFAULT_PANEL_WIDTH = 400;\n\ninterface SidePanelDrawerProps extends DrawerProps {\n anchor: 'left' | 'right';\n width?: number;\n debugOpacity?: boolean;\n navBarOpen: boolean;\n navBarWidthOpen: number;\n navBarWidthClosed: number;\n}\n\nconst SidePanelDrawer = styled(Drawer, {\n shouldForwardProp: (prop) =>\n // Note we do want anchor to be forwarded to the Drawer component\n !(\n [\n 'width',\n 'debug',\n 'debugOpacity',\n 'navBarOpen',\n 'navBarWidthOpen',\n 'navBarWidthClosed',\n ] as Array<PropertyKey>\n ).includes(prop),\n name: 'SidePanelDrawer',\n})<SidePanelDrawerProps>(\n ({ width, debugOpacity = false, anchor, navBarOpen, navBarWidthOpen, navBarWidthClosed }) => ({\n width,\n\n '& .MuiDrawer-paper': {\n position: 'absolute',\n width,\n boxSizing: 'border-box',\n border: 'unset',\n boxShadow:\n '0px 4px 5px rgba(0, 0, 0, 0.14), 0px 1px 10px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.2)',\n\n ...(debugOpacity && {\n opacity: '50%',\n }),\n\n ...(anchor === 'left' && {\n marginLeft: `${navBarWidthClosed}px`,\n ...(navBarOpen && {\n marginLeft: `${navBarWidthOpen}px`,\n }),\n }),\n },\n })\n);\n\ninterface DrawerHeaderBoxProps {\n anchor: 'left' | 'right';\n}\n\nconst DrawerHeaderBox = styled(Box, {\n shouldForwardProp: (prop) => !(['anchor'] as Array<PropertyKey>).includes(prop),\n})<DrawerHeaderBoxProps>(({ theme, anchor }) => ({\n display: 'flex',\n alignItems: 'center',\n padding: theme.spacing(2),\n ...theme.mixins.toolbar,\n justifyContent: anchor === 'left' ? 'space-between' : 'flex-start',\n backgroundColor: theme.palette.primary.light,\n height: '88px',\n\n '&,*': {\n color: 'white',\n },\n\n ' .MuiTypography-root': {\n fontSize: '22px',\n },\n\n ' .MuiButtonBase-root': {\n marginRight: anchor === 'right' ? theme.spacing(2) : 0,\n },\n}));\n\ntype SidePanelProps = PropsWithChildren<{\n open: boolean;\n anchor?: 'left' | 'right';\n onClose?: React.MouseEventHandler<HTMLElement>;\n titleText?: string;\n width?: number;\n showCloseArrow?: boolean;\n debugOpacity?: boolean;\n headerBoxProps?: BoxProps;\n onOpened?: () => void;\n onClosed?: () => void;\n 'data-testid'?: string;\n navBarOpen?: boolean;\n navBarWidthOpen?: number;\n navBarWidthClosed?: number;\n}>;\n\n/**\n * The SidePanel is designed to be used along with the TopBar component for a\n * consistent look and feel.\n */\nexport default function SidePanel({\n children,\n anchor = 'left',\n open,\n onClose = () => {},\n titleText = '',\n width = DEFAULT_PANEL_WIDTH,\n showCloseArrow = true,\n debugOpacity = false,\n headerBoxProps = {},\n onOpened,\n onClosed,\n 'data-testid': dataTestId,\n navBarOpen = false,\n navBarWidthOpen = 0,\n navBarWidthClosed = 0,\n}: SidePanelProps) {\n return (\n <SidePanelDrawer\n SlideProps={{\n onEntered: () => onOpened?.(),\n onExited: () => onClosed?.(),\n }}\n variant=\"persistent\"\n anchor={anchor}\n open={open}\n width={width}\n debugOpacity={debugOpacity}\n data-testid={dataTestId}\n navBarOpen={navBarOpen}\n navBarWidthOpen={navBarWidthOpen}\n navBarWidthClosed={navBarWidthClosed}\n >\n <DrawerHeaderBox anchor={anchor} {...headerBoxProps}>\n {/* Might be a cleaner way to do this, but it does the job */}\n {anchor === 'left' ? (\n <>\n <Typography variant=\"h6\" color=\"inherit\" component=\"div\">\n {titleText}\n </Typography>\n\n {showCloseArrow && (\n <IconButton onClick={onClose} size=\"large\" aria-label=\"Close left side panel\">\n <ArrowBackIcon data-testid=\"arrowbackicon\" />{' '}\n </IconButton>\n )}\n </>\n ) : (\n <>\n {showCloseArrow && (\n <IconButton onClick={onClose} size=\"large\" aria-label=\"Close right side panel\">\n <ArrowForwardIcon />{' '}\n </IconButton>\n )}\n\n <Typography variant=\"h6\" color=\"inherit\" component=\"div\">\n {titleText}\n </Typography>\n </>\n )}\n </DrawerHeaderBox>\n {children}\n </SidePanelDrawer>\n );\n}\n","import { styled } from '@mui/material';\n\ninterface PanelProps {\n width: number;\n open: boolean;\n}\n\ninterface PanelAwareMarginsProps {\n /** If the leftPanel prop is omitted but a left panel is still in use on the\n * page, it will slide over the top instead of the default pushing */\n leftPanel?: PanelProps;\n\n /** If the rightPanel prop is omitted but a right panel is still in use on the\n * page, it will slide over the top instead of the default pushing */\n rightPanel?: PanelProps;\n}\n\n/** With the optional leftPanel and rightPanel props providing state and width,\n * the children of of the PanelAwareMargins will looks like they is pushed aside\n * by the panels by transitioning the margins. */\nconst PanelAwareMargins = styled('div', {\n shouldForwardProp: (prop) => !(['leftPanel', 'rightPanel'] as Array<PropertyKey>).includes(prop),\n name: 'PanelAwareMargins',\n})<PanelAwareMarginsProps>(({ theme, leftPanel, rightPanel }) => ({\n transition: theme.transitions.create('margin', {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.leavingScreen,\n }),\n\n ...(leftPanel?.open && {\n transition: theme.transitions.create('margin', {\n easing: theme.transitions.easing.easeOut,\n duration: theme.transitions.duration.enteringScreen,\n }),\n marginLeft: `${leftPanel?.width ?? 0}px`,\n }),\n ...(rightPanel?.open && {\n transition: theme.transitions.create('margin', {\n easing: theme.transitions.easing.easeOut,\n duration: theme.transitions.duration.enteringScreen,\n }),\n marginRight: `${rightPanel?.width ?? 0}px`,\n }),\n}));\n\nexport default PanelAwareMargins;\n","import { styled } from '@mui/material';\nimport Container from '@mui/material/Container';\n\n/** Just a simple styled container applying our spacings*/\nconst PageContainer = styled(Container, {\n name: 'PageContainer',\n})(({ theme }) => ({\n // Horizontal padding comes from the Container's gutter\n paddingTop: theme.spacing(3),\n paddingBottom: theme.spacing(3),\n}));\n\nexport default PageContainer;\n","import { ComponentProps, PropsWithChildren, ReactNode, useEffect, useState } from 'react';\nimport { Box } from '@mui/material';\n\nimport TopBar from './TopBar';\nimport SidePanel, { DEFAULT_PANEL_WIDTH } from './SidePanel';\nimport PanelAwareMargins from './PanelAwareMargins';\nimport PageContainer from './PageContainer';\n\nconst INITIAL_LEFT_PANEL_OPEN = false;\nconst INITIAL_RIGHT_PANEL_OPEN = false;\n\nconst PANEL_DEFAULTS = {\n titleText: '',\n flavour: 'push',\n width: DEFAULT_PANEL_WIDTH,\n arrowButtons: 'both',\n startOpen: false,\n open: undefined,\n onChangeOpen: undefined,\n content: <></>,\n onOpened: undefined,\n onClosed: undefined,\n dataTestId: undefined,\n};\n\ninterface SidePanelProps {\n titleText?: string;\n content?: ReactNode;\n flavour?: 'push' | 'overlay';\n arrowButtons?: 'open' | 'close' | 'both' | 'none';\n width?: number;\n startOpen?: boolean;\n\n /** Use this and onChangeOpen if you want to use component as a controlled component */\n open?: boolean;\n onChangeOpen?: (open: boolean) => void;\n\n /** Called when the sliding transition to open has finished */\n onOpened?: () => void;\n\n /** Called when the sliding transition to open has finished */\n onClosed?: () => void;\n\n dataTestId?: string;\n}\n\ninterface BasePageLayoutProps {\n titleText?: string;\n\n leftPanel?: SidePanelProps;\n rightPanel?: SidePanelProps;\n\n /** This will only have an effect for panels whose state is not controlled by\n * parent */\n sidePanelsAreMutuallyExclusive?: boolean;\n\n /** Temporary, get rid of later */\n debugOpacity?: boolean;\n\n /** Props applied to the PageContainer component, which is a styled MUI Container */\n pageContainerProps?: ComponentProps<typeof PageContainer>;\n\n topBarDataTestId?: string;\n pageContentDataTestId?: string;\n}\n\ninterface PageLayoutWithNavBarProps extends BasePageLayoutProps {\n navBarOpen: boolean;\n navBarWidthOpen: number;\n navBarWidthClosed: number;\n}\n\ninterface PagelayoutWithoutNavBarProps extends BasePageLayoutProps {\n navBarOpen?: never;\n navBarWidthOpen?: never;\n navBarWidthClosed?: never;\n}\n\nexport type PageLayoutProps = PropsWithChildren<\n PageLayoutWithNavBarProps | PagelayoutWithoutNavBarProps\n>;\n\nexport default function PageLayout({\n children,\n titleText = '',\n leftPanel,\n rightPanel,\n sidePanelsAreMutuallyExclusive = true,\n debugOpacity = false,\n pageContainerProps,\n pageContentDataTestId,\n topBarDataTestId,\n navBarOpen,\n navBarWidthOpen,\n navBarWidthClosed,\n}: PageLayoutProps) {\n const [leftPanelOpenInternal, setLeftPanelOpenInternal] = useState(INITIAL_LEFT_PANEL_OPEN);\n const [rightPanelOpenInternal, setRightPanelOpenInternal] = useState(INITIAL_RIGHT_PANEL_OPEN);\n const [leftPanelOpenInternalPrevious, setLeftPanelOpenInternalPrevious] =\n useState(INITIAL_LEFT_PANEL_OPEN);\n const [rightPanelOpenInternalPrevious, setRightPanelOpenInternalPrevious] =\n useState(INITIAL_RIGHT_PANEL_OPEN);\n\n const includeLeftPanel = leftPanel !== undefined;\n const includeRightPanel = rightPanel !== undefined;\n\n const {\n titleText: leftPanelTitleText,\n content: leftPanelContent,\n flavour: leftPanelFlavour,\n open: leftPanelOpen,\n onChangeOpen: leftPanelOnChangeOpen,\n width: leftPanelWidth,\n arrowButtons: leftPanelArrowButtons,\n startOpen: leftPanelStartOpen,\n onOpened: leftPanelOnOpened,\n onClosed: leftPanelOnClosed,\n dataTestId: leftPanelDataTestId,\n } = leftPanel ? { ...PANEL_DEFAULTS, ...leftPanel } : { ...PANEL_DEFAULTS };\n\n const {\n titleText: rightPanelTitleText,\n content: rightPanelContent,\n flavour: rightPanelFlavour,\n open: rightPanelOpen,\n onChangeOpen: rightPanelOnChangeOpen,\n width: rightPanelWidth,\n arrowButtons: rightPanelArrowButtons,\n startOpen: rightPanelStartOpen,\n onOpened: rightPanelOnOpened,\n onClosed: rightPanelOnClosed,\n dataTestId: rightPanelDataTestId,\n } = rightPanel ? { ...PANEL_DEFAULTS, ...rightPanel } : { ...PANEL_DEFAULTS };\n\n useEffect(() => {\n if (leftPanelStartOpen !== INITIAL_LEFT_PANEL_OPEN) {\n setLeftPanelOpenInternal(leftPanelStartOpen);\n setLeftPanelOpenInternalPrevious(leftPanelStartOpen);\n }\n }, [leftPanelStartOpen]);\n\n useEffect(() => {\n if (rightPanelStartOpen !== INITIAL_RIGHT_PANEL_OPEN) {\n setRightPanelOpenInternal(rightPanelStartOpen);\n setRightPanelOpenInternalPrevious(rightPanelStartOpen);\n }\n }, [rightPanelStartOpen]);\n\n const leftPanelOpenCurrent = leftPanelOpen === undefined ? leftPanelOpenInternal : leftPanelOpen;\n\n const rightPanelOpenCurrent =\n rightPanelOpen === undefined ? rightPanelOpenInternal : rightPanelOpen;\n\n const handleLeftPanelChangeOpen = (open: boolean) => {\n if (leftPanelOpen === undefined) {\n // If not in controlled mode, update the internal state\n setLeftPanelOpenInternal(open);\n\n if (sidePanelsAreMutuallyExclusive && includeRightPanel) {\n if (open) {\n setRightPanelOpenInternal(false);\n setRightPanelOpenInternalPrevious(rightPanelOpenInternal);\n } else {\n setRightPanelOpenInternal(rightPanelOpenInternalPrevious);\n }\n }\n }\n // Likewise, if callback provided, call it\n if (leftPanelOnChangeOpen) leftPanelOnChangeOpen(open);\n };\n\n const handleRightPanelChangeOpen = (open: boolean) => {\n if (rightPanelOpen === undefined) {\n setRightPanelOpenInternal(open);\n if (sidePanelsAreMutuallyExclusive && includeLeftPanel) {\n if (open) {\n setLeftPanelOpenInternal(false);\n setLeftPanelOpenInternalPrevious(leftPanelOpenInternal);\n } else {\n setLeftPanelOpenInternal(leftPanelOpenInternalPrevious);\n }\n }\n }\n if (rightPanelOnChangeOpen) rightPanelOnChangeOpen(open);\n };\n\n return (\n <Box>\n {includeLeftPanel && (\n <SidePanel\n data-testid={leftPanelDataTestId}\n anchor=\"left\"\n open={leftPanelOpenCurrent}\n onClose={() => handleLeftPanelChangeOpen(false)}\n width={leftPanelWidth}\n titleText={leftPanelTitleText}\n debugOpacity={debugOpacity}\n showCloseArrow={leftPanelArrowButtons === 'both' || leftPanelArrowButtons === 'close'}\n onOpened={leftPanelOnOpened}\n onClosed={leftPanelOnClosed}\n navBarOpen={navBarOpen}\n navBarWidthOpen={navBarWidthOpen}\n navBarWidthClosed={navBarWidthClosed}\n >\n {leftPanelContent}\n </SidePanel>\n )}\n\n {includeRightPanel && (\n <SidePanel\n data-testid={rightPanelDataTestId}\n anchor=\"right\"\n open={rightPanelOpenCurrent}\n onClose={() => handleRightPanelChangeOpen(false)}\n width={rightPanelWidth}\n titleText={rightPanelTitleText}\n debugOpacity={debugOpacity}\n showCloseArrow={rightPanelArrowButtons === 'both' || rightPanelArrowButtons === 'close'}\n onOpened={rightPanelOnOpened}\n onClosed={rightPanelOnClosed}\n navBarOpen={navBarOpen}\n navBarWidthOpen={navBarWidthOpen}\n navBarWidthClosed={navBarWidthClosed}\n >\n {rightPanelContent}\n </SidePanel>\n )}\n\n <TopBar\n titleText={titleText}\n data-testid={topBarDataTestId}\n {...(includeLeftPanel && leftPanelFlavour === 'push'\n ? {\n leftPanel: {\n open: leftPanelOpenCurrent,\n width: leftPanelWidth,\n onOpen: () => handleLeftPanelChangeOpen(true),\n showOpenArrow: leftPanelArrowButtons === 'both' || leftPanelArrowButtons === 'open',\n },\n }\n : {})}\n {...(includeRightPanel && rightPanelFlavour === 'push'\n ? {\n rightPanel: {\n open: rightPanelOpenCurrent,\n width: rightPanelWidth,\n onOpen: () => handleRightPanelChangeOpen(true),\n showOpenArrow:\n rightPanelArrowButtons === 'both' || rightPanelArrowButtons === 'open',\n },\n }\n : {})}\n />\n\n <PanelAwareMargins\n {...(leftPanelFlavour === 'push'\n ? {\n leftPanel: {\n open: leftPanelOpenCurrent,\n width: leftPanelWidth,\n },\n }\n : {})}\n {...(rightPanelFlavour === 'push'\n ? {\n rightPanel: {\n open: rightPanelOpenCurrent,\n width: rightPanelWidth,\n },\n }\n : {})}\n >\n <PageContainer data-testid={pageContentDataTestId} {...pageContainerProps}>\n {children}\n </PageContainer>\n </PanelAwareMargins>\n </Box>\n );\n}\n","import { alpha, createTheme } from '@mui/material/styles';\n\nexport const internalAGSystemsTheme = createTheme({\n palette: {\n primary: {\n main: '#007236',\n dark: '#005221',\n light: '#00A04E',\n contrastText: '#FFFFFF',\n },\n secondary: {\n main: '#662D91',\n dark: '#440E62',\n light: '#93268F',\n contrastText: '#FFFFFF',\n },\n error: {\n main: '#D32F2F',\n dark: '#C62828',\n light: '#EF5350',\n },\n info: {\n main: '#0288D1',\n dark: '#01579B',\n light: '#03A9F4',\n },\n success: {\n main: '#0288D1',\n dark: '#01579B',\n light: '#03A9F4',\n },\n },\n components: {\n MuiTextField: {\n defaultProps: { color: 'secondary' },\n },\n MuiToggleButtonGroup: {\n defaultProps: { color: 'secondary' },\n },\n MuiCheckbox: {\n defaultProps: { color: 'secondary' },\n },\n MuiSelect: {\n defaultProps: { color: 'secondary' },\n },\n MuiSwitch: {\n defaultProps: { color: 'secondary' },\n },\n MuiFormControl: {\n defaultProps: { color: 'secondary' },\n },\n MuiMenuItem: {\n // Setting defaultProps for color on MenuItem does not work, so update manually\n styleOverrides: {\n root: ({ theme }) => ({\n '&.Mui-selected': {\n backgroundColor: alpha(\n theme.palette.secondary.main,\n theme.palette.action.selectedOpacity\n ),\n '&:hover': {\n backgroundColor: alpha(\n theme.palette.secondary.main,\n theme.palette.action.selectedOpacity\n ),\n },\n '&.Mui-focusVisible': {\n backgroundColor: alpha(\n theme.palette.secondary.main,\n theme.palette.action.focusOpacity\n ),\n },\n },\n }),\n },\n },\n },\n typography: {\n // I couldn't think of what to call this. It is an attempt to match\n // https://www.figma.com/file/atonRPl2YD9A1NCntbDtKR/List-Filter-and-Product-Concept?node-id=1187%3A43730\n // but not sure if line height should be changed\n explainer: {\n fontSize: '14px',\n marginBlockStart: '1em',\n },\n h3: {\n fontSize: '1rem',\n fontWeight: 700,\n },\n },\n});\n\nexport const fed21Theme = createTheme({\n palette: {\n primary: {\n dark: '#00A651',\n light: '#A3D39C',\n main: '#007236',\n contrastText: '#FFF',\n },\n warning: {\n main: '#F5871F',\n light: '#FCC589',\n dark: '#A2590A',\n contrastText: '#FFF',\n },\n secondary: {\n main: '#662D91',\n light: '#BD8CBF',\n dark: '#440E62',\n contrastText: '#FFF',\n },\n error: {\n main: '#D43C95',\n light: '#8F2064',\n dark: '#F9CDE0',\n contrastText: '#FFF',\n },\n info: {\n main: '#00A88D',\n light: '#ADDCCF',\n dark: '#005243',\n contrastText: '#FFF',\n },\n success: {\n main: '#00A651',\n light: '#A3D39C',\n dark: '#007236',\n contrastText: '#FFF',\n },\n },\n typography: {\n // I couldn't think of what to call this. It is an attempt to match\n // https://www.figma.com/file/atonRPl2YD9A1NCntbDtKR/List-Filter-and-Product-Concept?node-id=1187%3A43730\n // but not sure if line height should be changed\n explainer: {\n fontSize: '14px',\n marginBlockStart: '1em',\n },\n },\n});\n","import { PropsWithChildren } from 'react';\nimport { ThemeProvider } from '@mui/material/styles';\n\nimport { internalAGSystemsTheme, fed21Theme } from './themes';\n\nexport type AgThemeName = 'internal' | 'fed21';\n\nexport interface AgThemeProviderProps {\n name?: AgThemeName;\n}\n\nexport default function AgThemeProvider({\n name = 'internal',\n children,\n}: PropsWithChildren<AgThemeProviderProps>) {\n const theme =\n name === 'internal' ? internalAGSystemsTheme : name === 'fed21' ? fed21Theme : undefined;\n\n // Should be resolved when we move to React >= 18\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return <ThemeProvider theme={theme}>{children}</ThemeProvider>;\n}\n","// The default props passed to the underlying Snackbar component\nimport { SnackbarOrigin } from '@mui/material/Snackbar';\n\nexport const defaultSnackbarProps = {\n autoHideDuration: 6000,\n anchorOrigin: { vertical: 'top', horizontal: 'center' } as SnackbarOrigin,\n\n // The default is false. If we prefer timer to continue when window loses\n // focus, change to true\n disableWindowBlurListener: false,\n};\n\nexport const defaultSaladBarProps = {\n shouldClose: (_event: Event | React.SyntheticEvent<Element, Event>, reason: string) => {\n return reason !== 'clickaway';\n },\n};\n\nexport const defaultEnqueueNotificationOptions = {\n message: '',\n severity: 'info',\n variant: 'standard',\n progressIndicator: undefined, // Can use 'circular' or 'linear'\n};\n","import React, { useRef, useState, createContext, useCallback } from 'react';\nimport Snackbar, { SnackbarProps } from '@mui/material/Snackbar';\nimport Alert from '@mui/material/Alert';\nimport LinearProgress from '@mui/material/LinearProgress';\nimport CircularProgress from '@mui/material/CircularProgress';\n\nimport {\n Notification,\n SaladBarCloseReason,\n SaladBarState,\n SaladBarActions,\n SaladBarContext,\n} from './types';\nimport {\n defaultSaladBarProps,\n defaultSnackbarProps,\n defaultEnqueueNotificationOptions,\n} from './defaults';\n\nconst MAX_QUEUE_LENGTH = 100;\nconst MAX_QUEUE_HIT_REPORT_INTERVAL = 2000;\nconst SALADBAR_INDEX = 2000;\n\n// No need to use uuids, just use an incremented value\nconst generateNotificationKey = (() => {\n let previousKey = 0;\n return () => {\n previousKey += 1;\n return previousKey;\n };\n})();\n\nconst alertWithLinearProgressStyle = {\n borderBottomLeftRadius: '0px',\n borderBottomRightRadius: '0px',\n};\n\n// Note: Must be at at this scope, otherwise useEffect will loop infinitely\nconst defaultOverrideState = {};\nconst defaultOverrideActions = {};\n\nexport const Context = createContext<SaladBarContext | null>(null);\n\nexport interface SaladBarProviderProps extends SnackbarProps {\n /** Allow overriding the state of the SaladBar (for tests etc)*/\n overrideState?: Partial<SaladBarState>;\n\n /** Allow overriding the actions of the SaladBar (for tests etc)*/\n overrideActions?: Partial<SaladBarActions>;\n\n /** Called when an event triggers closing of currently displayed snackbar.\n * Default implementation returns false if reason is 'clickaway', otherwise\n * true.*/\n shouldClose?: (\n event: Event | React.SyntheticEvent<Element, Event>,\n reason: SaladBarCloseReason\n ) => boolean;\n}\n\nexport default function SaladBarProvider({\n overrideState = defaultOverrideState,\n overrideActions = defaultOverrideActions,\n shouldClose = defaultSaladBarProps.shouldClose,\n children,\n ...snackbarProps\n}: SaladBarProviderProps) {\n const [{ open }, setSaladBarState] = useState({ open: false });\n\n // We use a ref instead of a state to store the actual data, because we want\n // queue to be persistent across the whole lifetime of component. I considered\n // using yocto-queue because it would be O(1) instead of O(n), but its not\n // designed to access the head without removing it and its not going to make\n // much difference anyway.\n const queueRef = useRef<Notification[]>([]);\n\n const limitLastHitAt = useRef(Date.now());\n const limitHitCountSinceLastReport = useRef(0);\n\n const setOpen = useCallback((newVal: boolean) => {\n setSaladBarState({ open: newVal });\n }, []);\n\n const enqueueNotification = useCallback((notification: Notification = {}) => {\n limitHitCountSinceLastReport.current += 1;\n if (queueRef.current.length >= MAX_QUEUE_LENGTH) {\n // If the queue length is hit, probably stuck in some sort of loop, so\n // don't want to spam logs instantly so space it out\n if (Date.now() - limitLastHitAt.current >= MAX_QUEUE_HIT_REPORT_INTERVAL) {\n limitLastHitAt.current = Date.now();\n console.error(\n `SaladBarProvider: MAX_QUEUE_LENGTH (${MAX_QUEUE_LENGTH}) hit ${limitHitCountSinceLastReport.current} times in last ${MAX_QUEUE_HIT_REPORT_INTERVAL}ms)`\n );\n limitHitCountSinceLastReport.current = 0;\n }\n }\n\n const newNotification = {\n ...defaultEnqueueNotificationOptions,\n key: generateNotificationKey(), // Can be overridden.\n ...notification, // This could result in collisons, but unlikely.\n };\n\n // Add to the end of queue\n queueRef.current.push(newNotification as Notification);\n\n // If the queue was previously empty, then open the snackbar. We don't do it\n // whenever enqueueNotification is called since it will mess up transitions\n if (queueRef.current.length === 1) setSaladBarState({ open: true });\n\n return newNotification.key;\n }, []);\n\n const enqueueSuccessNotification = (message = '', options = {}) =>\n enqueueNotification({ message, severity: 'success', ...options });\n\n const enqueueInfoNotification = (message = '', options = {}) =>\n enqueueNotification({ message, severity: 'info', ...options });\n\n const enqueueWarningNotification = (message = '', options = {}) =>\n enqueueNotification({ message, severity: 'warning', ...options });\n\n const enqueueErrorNotification = (message = '', options = {}) =>\n enqueueNotification({ message, severity: 'error', ...options });\n\n /**\n * Remove the notification with specified key from the queue. If the key is\n * not found, immediately returns null.\n *\n * @param key - The key as returned from enqueue...() function.\n *\n * @returns The removed notification\n */\n const removeNotification = (key: Notification['key']) => {\n const index = queueRef.current.findIndex((x) => x.key === key);\n if (index === -1) return;\n\n if (index === 0) {\n // If its at the front of the queue, it is either currently being\n // displayed or in process of being closed. Either way, we can just set\n // open to false\n setSaladBarState({ open: false });\n return queueRef.current[0];\n }\n // Otherwise we just remove it from the queue, it won't need to transition\n return queueRef.current.splice(index, 1);\n };\n\n const handleClose = (\n event: Event | React.SyntheticEvent<Element, Event>,\n reason: SaladBarCloseReason\n ) => {\n if (shouldClose(event, reason)) setSaladBarState({ open: false });\n };\n\n // Callback fired before the transition is exiting.\n const handleExit = () => {};\n\n // Callback fired when the transition has exited.\n const handleExited = () => {\n // Remove head of queue\n queueRef.current.shift();\n\n // If there is still something on the queue, then re-open\n if (queueRef.current.length > 0) setSaladBarState({ open: true });\n };\n\n // The notification to display is the one at head of queue\n const currentNotification = queueRef.current[0] ?? {\n ...defaultEnqueueNotificationOptions,\n };\n\n // Can also override certain props on a notification level\n const currentNotificationSnackbarProps: { autoHideDuration?: number } = {};\n // Probably a better way of doing this\n if ('autoHideDuration' in currentNotification) {\n currentNotificationSnackbarProps.autoHideDuration = currentNotification.autoHideDuration;\n }\n\n // Note the order of props in Snackbar, we don't allow overriding open and\n // onClose directly.\n const snackbarFinalProps = {\n ...defaultSnackbarProps,\n ...snackbarProps,\n };\n\n const value: SaladBarContext = {\n open,\n setOpen,\n enqueueNotification,\n enqueueSuccessNotification,\n enqueueInfoNotification,\n enqueueWarningNotification,\n enqueueErrorNotification,\n removeNotification,\n ...overrideState,\n ...overrideActions,\n };\n\n return (\n <Context.Provider value={value}>\n {children}\n <Snackbar\n {...snackbarFinalProps}\n {...currentNotificationSnackbarProps}\n open={open}\n onClose={handleClose}\n TransitionProps={{\n onExited: handleExited,\n onExit: handleExit,\n }}\n sx={{ zIndex: SALADBAR_INDEX }}\n >\n <div>\n <Alert\n onClose={(event) => handleClose(event, 'closeAlert')}\n severity={currentNotification.severity}\n variant={'filled'}\n icon={\n currentNotification.progressIndicator === 'circular' ? (\n <CircularProgress size=\"1em\" />\n ) : undefined\n }\n style={\n currentNotification.progressIndicator === 'linear'\n ? alertWithLinearProgressStyle\n : undefined\n }\n >\n {currentNotification.message}\n </Alert>\n {currentNotification.progressIndicator === 'linear' && <LinearProgress color=\"primary\" />}\n </div>\n </Snackbar>\n </Context.Provider>\n );\n}\n","import { useContext } from 'react';\n\nimport { Context } from './SaladBarContext';\nimport { ContextError } from '../../errors/ContextError';\n\n/**\n * Use the `useSaladBar` hook in components to access the enqueueNotification()\n * method to add a snackbar message to queue.\n *\n * Must be used inside a <SaladBarProvider>\n *\n * Example:\n *\n * ```js\n * const {\n * enqueueNotification,\n * enqueueSuccessNotification,\n * enqueueInfoNotification,\n * enqueueWarningNotification,\n * enqueueErrorNotification,\n * } = useSaladBar();\n * ...\n * enqueueNotification({message: 'hello', severity: 'info'});\n * // or\n * enqueueInfoNotification('hello');\n * ```\n */\nexport function useSaladBar() {\n const context = useContext(Context);\n\n if (context === null) {\n throw new ContextError('Error: Tried to useSaladBar outside of a <SaladBarProvider>');\n }\n\n return context;\n}\n","/* eslint-disable react/prop-types */\n/* eslint-disable react/display-name */\nimport { createHelper } from 'souvlaki';\n\nimport SaladBarProvider from './SaladBarContext';\n\nexport const withSaladBarProvider = createHelper(() => ({ children }) => (\n <SaladBarProvider>{children}</SaladBarProvider>\n));\n"],"names":["ExampleComponent","text","num","setNum","useState","jsxs","Fragment","jsx","Typography","Button","oldNum","Paper","NAVBAR_WIDTH_OPENED","NAVBAR_WIDTH_CLOSED","PREFIX","classes","Root","styled","theme","sharedOverrides","openedMixin","__spreadValues","closedMixin","NavDrawer","Drawer","prop","open","ContextError","AgError","__publicField","Context","createContext","defaultOverrideState","defaultOverrideActions","NavBarProvider","overrideState","overrideActions","children","setNavBarState","setOpen","useCallback","newVal","value","useNavBar","context","useContext","buildNavBarState","overrides","withNavBarProvider","createHelper","state","actions","SELECTED_INDICATOR_WIDTH","NavBarDarkStyledList","List","NavBar","dataTestId","CssBaseline","TOP_STRIPE_HEIGHT","TITLE_BAR_HEIGHT","leftPanel","rightPanel","_a","_b","TopBar","titleText","Box","IconButton","ArrowForwardIcon","ArrowBackIcon","DEFAULT_PANEL_WIDTH","SidePanelDrawer","width","debugOpacity","anchor","navBarOpen","navBarWidthOpen","navBarWidthClosed","DrawerHeaderBox","__spreadProps","SidePanel","onClose","showCloseArrow","headerBoxProps","onOpened","onClosed","PanelAwareMargins","PageContainer","Container","INITIAL_LEFT_PANEL_OPEN","INITIAL_RIGHT_PANEL_OPEN","PANEL_DEFAULTS","PageLayout","sidePanelsAreMutuallyExclusive","pageContainerProps","pageContentDataTestId","topBarDataTestId","leftPanelOpenInternal","setLeftPanelOpenInternal","rightPanelOpenInternal","setRightPanelOpenInternal","leftPanelOpenInternalPrevious","setLeftPanelOpenInternalPrevious","rightPanelOpenInternalPrevious","setRightPanelOpenInternalPrevious","includeLeftPanel","includeRightPanel","leftPanelTitleText","leftPanelContent","leftPanelFlavour","leftPanelOpen","leftPanelOnChangeOpen","leftPanelWidth","leftPanelArrowButtons","leftPanelStartOpen","leftPanelOnOpened","leftPanelOnClosed","leftPanelDataTestId","rightPanelTitleText","rightPanelContent","rightPanelFlavour","rightPanelOpen","rightPanelOnChangeOpen","rightPanelWidth","rightPanelArrowButtons","rightPanelStartOpen","rightPanelOnOpened","rightPanelOnClosed","rightPanelDataTestId","useEffect","leftPanelOpenCurrent","rightPanelOpenCurrent","handleLeftPanelChangeOpen","handleRightPanelChangeOpen","internalAGSystemsTheme","createTheme","alpha","fed21Theme","AgThemeProvider","name","ThemeProvider","defaultSnackbarProps","defaultSaladBarProps","_event","reason","defaultEnqueueNotificationOptions","MAX_QUEUE_LENGTH","MAX_QUEUE_HIT_REPORT_INTERVAL","SALADBAR_INDEX","generateNotificationKey","previousKey","alertWithLinearProgressStyle","SaladBarProvider","shouldClose","snackbarProps","__objRest","setSaladBarState","queueRef","useRef","limitLastHitAt","limitHitCountSinceLastReport","enqueueNotification","notification","newNotification","enqueueSuccessNotification","message","options","enqueueInfoNotification","enqueueWarningNotification","enqueueErrorNotification","removeNotification","key","index","x","handleClose","event","handleExit","handleExited","currentNotification","currentNotificationSnackbarProps","snackbarFinalProps","Snackbar","Alert","CircularProgress","LinearProgress","useSaladBar","withSaladBarProvider"],"mappings":"8nDAUwB,SAAAA,GAAiB,CAAE,KAAAC,GAA+B,CACxE,KAAM,CAACC,EAAKC,CAAM,EAAIC,WAAS,CAAC,EAEhC,OAEIC,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAAC,EAAA,IAACC,EAAW,QAAA,CAAA,QAAQ,KAAK,MAAM,UAAU,UAAU,MAAM,GAAI,CAAE,SAAU,MAAO,EAAG,SAEnF,cAAA,EAEAD,EAAAA,IAACC,EAAAA,SAAW,QAAQ,UAAU,QAAQ,QACpC,SAAAD,EAAAA,IAAC,OAAK,CAAA,SAAA,uEAAA,CAAqE,CAC7E,CAAA,EACAA,EAAA,IAACE,GAAA,QAAA,CACC,QAAQ,WACR,QAAS,IAAMN,EAAQO,GAAWA,EAAS,CAAC,EAC5C,aAAW,YACZ,SAAA,qBAAA,CAED,SACC,IAAE,CAAA,SAAA,CAAA,sBACkBH,EAAAA,IAAC,QAAM,SAAKN,CAAA,CAAA,CAAA,EACjC,SACCU,GAAAA,QAAM,CAAA,SAAA,CAAA,qDAAmDT,CAAA,EAAI,CAChE,CAAA,CAAA,CAEJ,CChCO,MAAMU,GAAsB,IACtBC,GAAsB,GAE7BC,EAAS,SAEFC,EAAU,CACrB,KAAM,GAAGD,SACT,WAAY,GAAGA,eACf,KAAM,GAAGA,SACT,QAAS,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BC,EAAiC,iBAAmBD,EAAoB,kBAK1E,MAAME,EAAqB/J,IAAA,GACtBwH,IACAa,GAGChH,EAAyBrB,IAAA,CAC7B,KAAAK,EACA,QAAAa,EACA,oBAAA0H,EACA,2BAAAG,EACA,wBAAAG,EACA,2BAAAC,EACA,yBAAAC,EACA,mBAAAC,GACGvI,GACAC,GAGL,OACG/B,EAAA,KAAAyB,GAAQ,SAAR,CAAiB,MAAAY,EACf,SAAA,CAAAL,EACD9B,EAAA,IAAC8K,GAAA,QAAAtG,EAAA1D,IAAA,GACK+J,GACAD,GAFL,CAGC,KAAAzJ,EACA,QAASoJ,EACT,gBAAiB,CACf,SAAUG,EACV,OAAQD,CACV,EACA,GAAI,CAAE,OAAQ5B,EAAe,EAE7B,gBAAC,MACC,CAAA,SAAA,CAAA7I,EAAA,IAAC+K,GAAA,QAAA,CACC,QAAUP,GAAUD,EAAYC,EAAO,YAAY,EACnD,SAAUG,EAAoB,SAC9B,QAAS,SACT,KACEA,EAAoB,oBAAsB,iBACvCK,WAAiB,CAAA,KAAK,MAAM,EAC3B,OAEN,MACEL,EAAoB,oBAAsB,SACtC3B,GACA,OAGL,SAAoB2B,EAAA,OAAA,CACvB,EACCA,EAAoB,oBAAsB,UAAa3K,EAAAA,IAAAiL,GAAAA,QAAA,CAAe,MAAM,UAAU,CAAA,EACzF,CAAA,EACF,CACF,CAAA,CAAA,CAEJ,CChNO,SAASC,IAAc,CACtB,MAAA7I,EAAUC,aAAWf,EAAO,EAElC,GAAIc,IAAY,KACR,MAAA,IAAIjB,EAAa,6DAA6D,EAG/E,OAAAiB,CACT,CC7Ba,MAAA8I,GAAuBzI,GAAAA,aAAa,IAAM,CAAC,CAAE,SAAAZ,CACxD,IAAA9B,MAACiJ,GAAkB,CAAA,SAAAnH,EAAS,CAC7B"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/components/ExampleComponent/index.tsx","../../src/components/NavBar/Styling.tsx","../../src/errors/ContextError.ts","../../src/components/NavBar/NavBarContext.tsx","../../src/components/NavBar/testWrappers.tsx","../../src/components/NavBar/NavBarDarkStyledList.tsx","../../src/components/NavBar/NavBarLightStyledList.tsx","../../src/components/NavBar/index.tsx","../../src/layouts/PageLayout/TopBar.tsx","../../src/layouts/PageLayout/SidePanel.tsx","../../src/layouts/PageLayout/PanelAwareMargins.tsx","../../src/layouts/PageLayout/PageContainer.tsx","../../src/layouts/PageLayout/index.tsx","../../src/layouts/AppLayout/defaults.tsx","../../src/layouts/AppLayout/TopBar.tsx","../../src/layouts/AppLayout/PageContainer.tsx","../../src/layouts/AppLayout/appLayoutContextStateReducer.ts","../../src/layouts/AppLayout/AppLayoutContext.tsx","../../src/layouts/AppLayout/NavBar/Styling.tsx","../../src/layouts/AppLayout/NavBar/NavBarDarkStyledList.tsx","../../src/layouts/AppLayout/NavBar/index.tsx","../../src/layouts/AppLayout/index.tsx","../../src/providers/AgTheme/themes.ts","../../src/providers/AgTheme/index.tsx","../../src/providers/SaladBar/defaults.ts","../../src/providers/SaladBar/SaladBarContext.tsx","../../src/providers/SaladBar/useSaladBar.ts","../../src/providers/SaladBar/testWrappers.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Button, Paper, Typography } from '@mui/material';\n\nexport interface ExampleComponentProps {\n /** Test */\n text: string;\n}\n\nexport default function ExampleComponent({ text }: ExampleComponentProps) {\n const [num, setNum] = useState(0);\n\n return (\n <>\n <Typography variant=\"h6\" color=\"inherit\" component=\"div\" sx={{ fontSize: '22px' }}>\n Hello world\n </Typography>\n\n <Typography variant=\"caption\" display=\"block\">\n <span>Just ensuring MUI is working as planned as a peer dependency. v0.0.11</span>\n </Typography>\n <Button\n variant=\"outlined\"\n onClick={() => setNum((oldNum) => oldNum + 1)}\n aria-label=\"Increment\"\n >\n Hello I am a button\n </Button>\n <p>\n This is some text: <span>{text}</span>\n </p>\n <Paper>This number will incremember when button pressed: {num}</Paper>\n </>\n );\n}\n","import { styled, CSSObject } from '@mui/material/styles';\nimport Drawer from '@mui/material/Drawer';\n\nexport const NAVBAR_WIDTH_OPENED = 330;\nexport const NAVBAR_WIDTH_CLOSED = 73;\n\nconst PREFIX = 'Navbar';\n\nexport const classes = {\n root: `${PREFIX}-root`,\n menuButton: `${PREFIX}-menuButton`,\n hide: `${PREFIX}-hide`,\n content: `${PREFIX}-content`,\n userInfoHolder: `${PREFIX}-userInfoHolder`,\n settings: `${PREFIX}-settings`,\n pieChartIcon: `${PREFIX}-pieChartIcon`,\n};\n\nexport const Root = styled('div', { name: 'NavBar' })(({ theme }) => ({\n [`&.${classes.root}`]: {\n display: 'flex',\n },\n\n [`& .${classes.menuButton}`]: {\n marginRight: 36,\n },\n\n [`& .${classes.hide}`]: {\n display: 'none',\n },\n\n [`& .${classes.content}`]: {\n flexGrow: 1,\n padding: theme.spacing(3),\n },\n\n [`& .${classes.userInfoHolder}`]: {\n height: '148px',\n marginTop: '64px',\n marginBottom: '16px',\n },\n}));\n\n// The starting point for this was the \"Mini variant drawer\" of\n// https://mui.com/components/drawers/#main-content\n\nconst sharedOverrides = (): CSSObject => ({\n position: 'absolute',\n height: '100%',\n overflowX: 'hidden',\n overflowY: 'hidden',\n color: 'white',\n backgroundColor: 'black',\n // backgroundColor: '#e8e8e8',\n});\n\nconst openedMixin = (): CSSObject => ({\n width: NAVBAR_WIDTH_OPENED,\n ...sharedOverrides(),\n});\n\nconst closedMixin = (): CSSObject => ({\n width: NAVBAR_WIDTH_CLOSED,\n ...sharedOverrides(),\n});\n\nexport const NavDrawer = styled(Drawer, {\n shouldForwardProp: (prop) => prop !== 'open',\n})(({ theme, open }) => ({\n width: open ? NAVBAR_WIDTH_OPENED : NAVBAR_WIDTH_CLOSED,\n flexShrink: 0,\n whiteSpace: 'nowrap',\n boxSizing: 'border-box',\n zIndex: theme.zIndex.drawer + 100,\n\n ...(open && {\n '& .MuiDrawer-paper': openedMixin(),\n }),\n ...(!open && {\n '& .MuiDrawer-paper': closedMixin(),\n }),\n}));\n","import { AgError } from '@australiangreens/ag-error';\n\n// Superclass for errors involving React context.\nexport class ContextError extends AgError {\n static errorName = 'ContextError';\n}\n","import { createContext, useContext, PropsWithChildren, useState, useCallback } from 'react';\nimport { ContextError } from '../../errors/ContextError';\n\nexport type NavBarState = {\n open: boolean;\n};\n\nexport type NavBarActions = {\n setOpen: (newVal: boolean) => void;\n toggleOpen: () => void;\n};\n\ntype NavBarContext = NavBarState & NavBarActions;\n\nconst Context = createContext<NavBarContext | null>(null);\n\ntype NavBarProviderProps = {\n overrideState?: Partial<NavBarState>;\n overrideActions?: Partial<NavBarActions>;\n};\n\n// Note: Must be at at this scope, otherwise useEffect will loop infinitely\nconst defaultOverrideState = {};\nconst defaultOverrideActions = {};\n\nexport const NavBarProvider = ({\n overrideState = defaultOverrideState,\n overrideActions = defaultOverrideActions,\n children,\n}: PropsWithChildren<NavBarProviderProps>) => {\n const [{ open }, setNavBarState] = useState<NavBarState>({ open: true });\n\n const setOpen = useCallback((newVal: boolean) => {\n setNavBarState({ open: newVal });\n }, []);\n\n const toggleOpen = useCallback(() => {\n setNavBarState((prevState) => ({ ...prevState, open: !prevState.open }));\n }, []);\n\n const value: NavBarContext = {\n open,\n setOpen,\n toggleOpen,\n ...overrideState,\n ...overrideActions,\n };\n\n return <Context.Provider value={value}>{children}</Context.Provider>;\n};\n\nexport const useNavBar = () => {\n const context = useContext(Context);\n\n if (context === null) {\n throw new ContextError('Error: Tried to useNavBar outside of a <NavBarProvider>');\n }\n\n return context;\n};\n","/* eslint-disable react/prop-types */\n/* eslint-disable react/display-name */\nimport { createHelper } from 'souvlaki';\n\nimport { NavBarProvider, NavBarActions, NavBarState } from './NavBarContext';\n\nexport type Builder<T> = (overrides?: Partial<T>) => T;\n\nexport const buildNavBarState: Builder<NavBarState> = (overrides = {}) => ({\n open: true,\n ...overrides,\n});\n\nexport const withNavBarProvider = createHelper(\n (state: Partial<NavBarState> = buildNavBarState(), actions: Partial<NavBarActions> = {}) =>\n ({ children }) => {\n return (\n <NavBarProvider overrideState={state} overrideActions={actions}>\n {children}\n </NavBarProvider>\n );\n }\n);\n","import { styled } from '@mui/material/styles';\nimport List, { ListProps } from '@mui/material/List';\n\nconst SELECTED_INDICATOR_WIDTH = 7;\n\nexport const NavBarDarkStyledList = styled(List)<ListProps>(({ theme }) => ({\n backgroundColor: 'black',\n color: 'white',\n\n '& .MuiListItem-root': {\n padding: 'unset',\n },\n\n '& .MuiListItemButton-root': {\n ' .MuiListItemIcon-root': {\n color: 'white',\n padding: `${SELECTED_INDICATOR_WIDTH}px`,\n },\n\n // Focus state\n '&.Mui-focusVisible': {\n backgroundColor: theme.palette.grey[700],\n },\n\n // Selected state\n '&.Mui-selected': {\n borderLeftStyle: 'solid',\n borderLeftWidth: '7px',\n borderLeftColor: theme.palette.primary.main,\n paddingLeft: `calc(${theme.spacing(2)} - ${SELECTED_INDICATOR_WIDTH}px)`,\n },\n\n // Hover state\n '&:hover': {\n backgroundColor: theme.palette.primary.dark,\n },\n\n // Focus+Selected state\n '&.Mui-selected.Mui-focusVisible': {\n backgroundColor: theme.palette.grey[700],\n },\n\n // Hover+Selected state\n '&.Mui-selected:hover': {\n backgroundColor: theme.palette.primary.dark,\n },\n\n // Focus+Hover+Selected state doesn't need to be specified\n // '&.Mui-selected.Mui-focusVisible:hover': {\n // },\n },\n})) as typeof List;\n","import { styled } from '@mui/material/styles';\nimport List, { ListProps } from '@mui/material/List';\n\nconst SELECTED_INDICATOR_WIDTH = 7;\n\nexport const NavBarLightStyledList = styled(List)<ListProps>(({ theme }) => ({\n backgroundColor: '#e8e8e8',\n color: 'inherit',\n\n '& .MuiListItem-root': {\n padding: 'unset',\n },\n\n '& .MuiListItemButton-root': {\n ' .MuiListItemIcon-root': {\n color: 'inherit',\n padding: `${SELECTED_INDICATOR_WIDTH}px`,\n },\n\n // Focus state\n '&.Mui-focusVisible': {\n backgroundColor: theme.palette.grey[700],\n },\n\n // Selected state\n '&.Mui-selected': {\n borderLeftStyle: 'solid',\n borderLeftWidth: '7px',\n borderLeftColor: theme.palette.primary.main,\n paddingLeft: `calc(${theme.spacing(2)} - ${SELECTED_INDICATOR_WIDTH}px)`,\n },\n\n // Hover state\n '&:hover': {\n backgroundColor: theme.palette.primary.dark,\n },\n\n // Focus+Selected state\n '&.Mui-selected.Mui-focusVisible': {\n backgroundColor: theme.palette.grey[700],\n },\n\n // Hover+Selected state\n '&.Mui-selected:hover': {\n backgroundColor: theme.palette.primary.dark,\n },\n\n // Focus+Hover+Selected state doesn't need to be specified\n // '&.Mui-selected.Mui-focusVisible:hover': {\n // },\n },\n})) as typeof List;\n","import { PropsWithChildren } from 'react';\nimport CssBaseline from '@mui/material/CssBaseline';\n\nimport { classes, Root, NavDrawer } from './Styling';\nimport { useNavBar } from './NavBarContext';\n\nexport { NAVBAR_WIDTH_OPENED, NAVBAR_WIDTH_CLOSED } from './Styling';\n\nexport type NavbarProps = {\n /** Set the datatest-id on the root element for using reactdom's getByTestId()\n * function */\n 'data-testid'?: string;\n};\n\n// TODO: Add in more common elements (or make another component) for user/organisations/logout etc?\n// TODO: Should there be two sets of 'children', one for the list and one for dialogs etc?\n\n// TODO: Rather than exporting the min and max widths, would it make more sense\n// TODO: to just share them via the context provider?\n\n/**\n * A (currently uncontrolled) styled navigation bar wth a context provider to\n * retrieve its current open/closed state. At this point in time its pretty\n * unopinionated, it just renders whatever children it is given. THe\n * NavBarDarkStyledList component can be used for consistent styling against the\n * background. We'll be changing the way we use NavBars soon anyway, so not much\n * point solidying the patterns yet.\n */\nexport default function NavBar({\n 'data-testid': dataTestId,\n children,\n}: PropsWithChildren<NavbarProps>) {\n const { open } = useNavBar();\n\n return (\n <Root className={classes.root} data-testid={dataTestId}>\n <CssBaseline />\n <NavDrawer\n variant=\"permanent\"\n anchor=\"left\"\n // We aren't using transitions, and {0} will still create an unwanted timeout\n transitionDuration={null as unknown as number}\n open={open}\n >\n {children}\n </NavDrawer>\n </Root>\n );\n}\n\nexport * from './NavBarContext';\nexport * from './testWrappers';\n\nexport * from './NavBarDarkStyledList';\nexport * from './NavBarLightStyledList';\n\n// TODO: This is a temporary fix, library clients shouldn't need this\nexport { classes as navBarClasses } from './Styling';\n","import { Box, IconButton, styled, Typography } from '@mui/material';\nimport { ArrowForward as ForwardIcon, ArrowBack as BackIcon } from '@mui/icons-material';\n\nconst TOP_STRIPE_HEIGHT = 24;\nconst TITLE_BAR_HEIGHT = 64;\n\nconst PREFIX = 'TopBar';\n\ninterface PanelProps {\n open: boolean;\n width: number;\n showOpenArrow: boolean;\n\n /** Called when the arrow button is pressed (if showOpenButton is true) */\n onOpen?: () => void;\n\n showOpenButton?: boolean;\n}\n\nexport interface TopBarProps {\n titleText?: string;\n leftPanel?: PanelProps;\n rightPanel?: PanelProps;\n 'data-testid'?: string;\n}\n\nexport const classes = {\n topStripe: `${PREFIX}-topStripe`,\n titleBar: `${PREFIX}-titleBar`,\n titleSlider: `${PREFIX}-titleSlider`,\n\n titleText: `${PREFIX}-titleText`,\n leftPanelButton: `${PREFIX}-leftPanelButton`,\n rightPanelButton: `${PREFIX}-leftPanelButton`,\n};\n\ninterface RootProps {\n leftPanel?: PanelProps;\n rightPanel?: PanelProps;\n}\n\nconst Root = styled('div', {\n shouldForwardProp: (prop) => !(['leftPanel', 'rightPanel'] as Array<PropertyKey>).includes(prop),\n name: PREFIX,\n})<RootProps>(({ theme, leftPanel, rightPanel }) => ({\n width: '100%',\n\n [`& .${classes.topStripe}`]: {\n width: '100%',\n height: `${TOP_STRIPE_HEIGHT}px`,\n backgroundColor: theme.palette.primary.main,\n },\n\n [`& .${classes.titleBar}`]: {\n backgroundColor: theme.palette.primary.light,\n height: `${TITLE_BAR_HEIGHT}px`,\n padding: theme.spacing(0, 3),\n width: '100%',\n },\n\n [`& .${classes.titleSlider}`]: {\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n color: 'white',\n\n transition: theme.transitions.create('margin', {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.leavingScreen,\n }),\n\n [`& .${classes.leftPanelButton}`]: {\n marginRight: theme.spacing(2),\n flexGrow: 0,\n },\n\n [`& .${classes.titleText}`]: {\n flexGrow: 1,\n },\n\n [`& .${classes.rightPanelButton}`]: {\n flexGrow: 0,\n },\n\n ...(leftPanel?.open && {\n transition: theme.transitions.create('margin', {\n easing: theme.transitions.easing.easeOut,\n duration: theme.transitions.duration.enteringScreen,\n }),\n marginLeft: `${leftPanel?.width ?? 0}px`,\n }),\n\n ...(rightPanel?.open && {\n transition: theme.transitions.create('margin', {\n easing: theme.transitions.easing.easeOut,\n duration: theme.transitions.duration.enteringScreen,\n }),\n marginRight: `${rightPanel?.width ?? 0}px`,\n }),\n },\n}));\n\n/**\n * Goes at the top of every page. Wasn't feeling creative in naming it.\n *\n * This differs from the typical appbar with a toolbar used in most MUI apps in\n * that it has to interact with a sliding side panel that is not the main\n * navbar.\n */\nexport default function TopBar({\n titleText = '',\n leftPanel,\n rightPanel,\n 'data-testid': dataTestId,\n}: TopBarProps) {\n return (\n <Root leftPanel={leftPanel} rightPanel={rightPanel} data-testid={dataTestId}>\n <div className={classes.topStripe} />\n <div className={classes.titleBar}>\n <Box className={classes.titleSlider}>\n {leftPanel !== undefined && !leftPanel.open && leftPanel.showOpenArrow && (\n <IconButton\n className={classes.leftPanelButton}\n color=\"inherit\"\n aria-label=\"Open left side panel\"\n onClick={leftPanel?.onOpen}\n edge=\"start\"\n size=\"large\"\n >\n {' '}\n <ForwardIcon />\n </IconButton>\n )}\n\n <Typography className={classes.titleText} variant=\"h6\" noWrap>\n {titleText}\n </Typography>\n\n {rightPanel !== undefined && !rightPanel.open && rightPanel.showOpenArrow && (\n <IconButton\n className={classes.rightPanelButton}\n color=\"inherit\"\n aria-label=\"Open right side panel\"\n onClick={rightPanel?.onOpen}\n edge=\"end\"\n size=\"large\"\n >\n {' '}\n <BackIcon />\n </IconButton>\n )}\n </Box>\n </div>\n </Root>\n );\n}\n","import { PropsWithChildren } from 'react';\nimport {Box, BoxProps, Typography, styled, Drawer, DrawerProps, IconButton} from '@mui/material';\nimport {ArrowBack as BackIcon, ArrowForward as ForwardIcon} from '@mui/icons-material';\n\nexport const DEFAULT_PANEL_WIDTH = 400;\n\ninterface SidePanelDrawerProps extends DrawerProps {\n anchor: 'left' | 'right';\n width?: number;\n debugOpacity?: boolean;\n navBarOpen: boolean;\n navBarWidthOpen: number;\n navBarWidthClosed: number;\n}\n\nconst SidePanelDrawer = styled(Drawer, {\n shouldForwardProp: (prop) =>\n // Note we do want anchor to be forwarded to the Drawer component\n !(\n [\n 'width',\n 'debug',\n 'debugOpacity',\n 'navBarOpen',\n 'navBarWidthOpen',\n 'navBarWidthClosed',\n ] as Array<PropertyKey>\n ).includes(prop),\n name: 'SidePanelDrawer',\n})<SidePanelDrawerProps>(\n ({ width, debugOpacity = false, anchor, navBarOpen, navBarWidthOpen, navBarWidthClosed }) => ({\n width,\n\n '& .MuiDrawer-paper': {\n position: 'absolute',\n width,\n boxSizing: 'border-box',\n border: 'unset',\n boxShadow:\n '0px 4px 5px rgba(0, 0, 0, 0.14), 0px 1px 10px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.2)',\n\n ...(debugOpacity && {\n opacity: '50%',\n }),\n\n ...(anchor === 'left' && {\n marginLeft: `${navBarWidthClosed}px`,\n ...(navBarOpen && {\n marginLeft: `${navBarWidthOpen}px`,\n }),\n }),\n },\n })\n);\n\ninterface DrawerHeaderBoxProps {\n anchor: 'left' | 'right';\n}\n\nconst DrawerHeaderBox = styled(Box, {\n shouldForwardProp: (prop) => !(['anchor'] as Array<PropertyKey>).includes(prop),\n})<DrawerHeaderBoxProps>(({ theme, anchor }) => ({\n display: 'flex',\n alignItems: 'center',\n padding: theme.spacing(2),\n ...theme.mixins.toolbar,\n justifyContent: anchor === 'left' ? 'space-between' : 'flex-start',\n backgroundColor: theme.palette.primary.light,\n height: '88px',\n\n '&,*': {\n color: 'white',\n },\n\n ' .MuiTypography-root': {\n fontSize: '22px',\n },\n\n ' .MuiButtonBase-root': {\n marginRight: anchor === 'right' ? theme.spacing(2) : 0,\n },\n}));\n\ntype SidePanelProps = PropsWithChildren<{\n open: boolean;\n anchor?: 'left' | 'right';\n onClose?: React.MouseEventHandler<HTMLElement>;\n titleText?: string;\n width?: number;\n showCloseArrow?: boolean;\n debugOpacity?: boolean;\n headerBoxProps?: BoxProps;\n onOpened?: () => void;\n onClosed?: () => void;\n 'data-testid'?: string;\n navBarOpen?: boolean;\n navBarWidthOpen?: number;\n navBarWidthClosed?: number;\n}>;\n\n/**\n * The SidePanel is designed to be used along with the TopBar component for a\n * consistent look and feel.\n */\nexport default function SidePanel({\n children,\n anchor = 'left',\n open,\n onClose = () => {},\n titleText = '',\n width = DEFAULT_PANEL_WIDTH,\n showCloseArrow = true,\n debugOpacity = false,\n headerBoxProps = {},\n onOpened,\n onClosed,\n 'data-testid': dataTestId,\n navBarOpen = false,\n navBarWidthOpen = 0,\n navBarWidthClosed = 0,\n}: SidePanelProps) {\n return (\n <SidePanelDrawer\n SlideProps={{\n onEntered: () => onOpened?.(),\n onExited: () => onClosed?.(),\n }}\n variant=\"persistent\"\n anchor={anchor}\n open={open}\n width={width}\n debugOpacity={debugOpacity}\n data-testid={dataTestId}\n navBarOpen={navBarOpen}\n navBarWidthOpen={navBarWidthOpen}\n navBarWidthClosed={navBarWidthClosed}\n >\n <DrawerHeaderBox anchor={anchor} {...headerBoxProps}>\n {/* Might be a cleaner way to do this, but it does the job */}\n {anchor === 'left' ? (\n <>\n <Typography variant=\"h6\" color=\"inherit\" component=\"div\">\n {titleText}\n </Typography>\n\n {showCloseArrow && (\n <IconButton onClick={onClose} size=\"large\" aria-label=\"Close left side panel\">\n <BackIcon data-testid=\"arrowbackicon\" />{' '}\n </IconButton>\n )}\n </>\n ) : (\n <>\n {showCloseArrow && (\n <IconButton onClick={onClose} size=\"large\" aria-label=\"Close right side panel\">\n <ForwardIcon />{' '}\n </IconButton>\n )}\n\n <Typography variant=\"h6\" color=\"inherit\" component=\"div\">\n {titleText}\n </Typography>\n </>\n )}\n </DrawerHeaderBox>\n {children}\n </SidePanelDrawer>\n );\n}\n","import { styled } from '@mui/material';\n\ninterface PanelProps {\n width: number;\n open: boolean;\n}\n\ninterface PanelAwareMarginsProps {\n /** If the leftPanel prop is omitted but a left panel is still in use on the\n * page, it will slide over the top instead of the default pushing */\n leftPanel?: PanelProps;\n\n /** If the rightPanel prop is omitted but a right panel is still in use on the\n * page, it will slide over the top instead of the default pushing */\n rightPanel?: PanelProps;\n}\n\n/** With the optional leftPanel and rightPanel props providing state and width,\n * the children of of the PanelAwareMargins will looks like they is pushed aside\n * by the panels by transitioning the margins. */\nconst PanelAwareMargins = styled('div', {\n shouldForwardProp: (prop) => !(['leftPanel', 'rightPanel'] as Array<PropertyKey>).includes(prop),\n name: 'PanelAwareMargins',\n})<PanelAwareMarginsProps>(({ theme, leftPanel, rightPanel }) => ({\n transition: theme.transitions.create('margin', {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.leavingScreen,\n }),\n\n ...(leftPanel?.open && {\n transition: theme.transitions.create('margin', {\n easing: theme.transitions.easing.easeOut,\n duration: theme.transitions.duration.enteringScreen,\n }),\n marginLeft: `${leftPanel?.width ?? 0}px`,\n }),\n ...(rightPanel?.open && {\n transition: theme.transitions.create('margin', {\n easing: theme.transitions.easing.easeOut,\n duration: theme.transitions.duration.enteringScreen,\n }),\n marginRight: `${rightPanel?.width ?? 0}px`,\n }),\n}));\n\nexport default PanelAwareMargins;\n","import { styled, Container } from '@mui/material';\n\n/** Just a simple styled container applying our spacings*/\nconst PageContainer = styled(Container, {\n name: 'PageContainer',\n})(({ theme }) => ({\n // Horizontal padding comes from the Container's gutter\n paddingTop: theme.spacing(3),\n paddingBottom: theme.spacing(3),\n}));\n\nexport default PageContainer;\n","import { ComponentProps, PropsWithChildren, ReactNode, useEffect, useState } from 'react';\nimport { Box } from '@mui/material';\n\nimport TopBar from './TopBar';\nimport SidePanel, { DEFAULT_PANEL_WIDTH } from './SidePanel';\nimport PanelAwareMargins from './PanelAwareMargins';\nimport PageContainer from './PageContainer';\n\nconst INITIAL_LEFT_PANEL_OPEN = false;\nconst INITIAL_RIGHT_PANEL_OPEN = false;\n\nconst PANEL_DEFAULTS = {\n titleText: '',\n flavour: 'push',\n width: DEFAULT_PANEL_WIDTH,\n arrowButtons: 'both',\n startOpen: false,\n open: undefined,\n onChangeOpen: undefined,\n content: <></>,\n onOpened: undefined,\n onClosed: undefined,\n dataTestId: undefined,\n};\n\nexport interface SidePanelProps {\n titleText?: string;\n content?: ReactNode;\n flavour?: 'push' | 'overlay';\n arrowButtons?: 'open' | 'close' | 'both' | 'none';\n width?: number;\n startOpen?: boolean;\n\n /** Use this and onChangeOpen if you want to use component as a controlled component */\n open?: boolean;\n onChangeOpen?: (open: boolean) => void;\n\n /** Called when the sliding transition to open has finished */\n onOpened?: () => void;\n\n /** Called when the sliding transition to open has finished */\n onClosed?: () => void;\n\n dataTestId?: string;\n}\n\ninterface BasePageLayoutProps {\n titleText?: string;\n\n leftPanel?: SidePanelProps;\n rightPanel?: SidePanelProps;\n\n /** This will only have an effect for panels whose state is not controlled by\n * parent */\n sidePanelsAreMutuallyExclusive?: boolean;\n\n /** Temporary, get rid of later */\n debugOpacity?: boolean;\n\n /** Props applied to the PageContainer component, which is a styled MUI Container */\n pageContainerProps?: ComponentProps<typeof PageContainer>;\n\n topBarDataTestId?: string;\n pageContentDataTestId?: string;\n}\n\ninterface PageLayoutWithNavBarProps extends BasePageLayoutProps {\n /** Only used by side panels for alignment purposes */\n navBarOpen: boolean;\n /** Only used by side panels for alignment purposes */\n navBarWidthOpen: number;\n /** Only used by side panels for alignment purposes */\n navBarWidthClosed: number;\n}\n\ninterface PagelayoutWithoutNavBarProps extends BasePageLayoutProps {\n navBarOpen?: never;\n navBarWidthOpen?: never;\n navBarWidthClosed?: never;\n}\n\nexport type PageLayoutProps = PropsWithChildren<\n PageLayoutWithNavBarProps | PagelayoutWithoutNavBarProps\n>;\n\n/**\n * To be used by all Page components in our apps to use a standard Top Bar, Left\n * Panel, Right Panel and Page Contents within the contents for a uniform look.\n *\n * At present it is somewhat crudely adapted from the code used in the\n * ListManager app. It _assumes_ NavBar component on the left.\n *\n * It is in the process of being tidied up, and as such is very much in flux.\n * The end goal is to unify the left most NavBar component with the PageLayout,\n * but this has to be done incrementally.\n */\nexport default function PageLayout({\n children,\n titleText = '',\n leftPanel,\n rightPanel,\n sidePanelsAreMutuallyExclusive = true,\n debugOpacity = false,\n pageContainerProps,\n pageContentDataTestId,\n topBarDataTestId,\n navBarOpen,\n navBarWidthOpen,\n navBarWidthClosed,\n}: PageLayoutProps) {\n const [leftPanelOpenInternal, setLeftPanelOpenInternal] = useState(INITIAL_LEFT_PANEL_OPEN);\n const [rightPanelOpenInternal, setRightPanelOpenInternal] = useState(INITIAL_RIGHT_PANEL_OPEN);\n const [leftPanelOpenInternalPrevious, setLeftPanelOpenInternalPrevious] =\n useState(INITIAL_LEFT_PANEL_OPEN);\n const [rightPanelOpenInternalPrevious, setRightPanelOpenInternalPrevious] =\n useState(INITIAL_RIGHT_PANEL_OPEN);\n\n const includeLeftPanel = leftPanel !== undefined;\n const includeRightPanel = rightPanel !== undefined;\n\n const {\n titleText: leftPanelTitleText,\n content: leftPanelContent,\n flavour: leftPanelFlavour,\n open: leftPanelOpen,\n onChangeOpen: leftPanelOnChangeOpen,\n width: leftPanelWidth,\n arrowButtons: leftPanelArrowButtons,\n startOpen: leftPanelStartOpen,\n onOpened: leftPanelOnOpened,\n onClosed: leftPanelOnClosed,\n dataTestId: leftPanelDataTestId,\n } = leftPanel ? { ...PANEL_DEFAULTS, ...leftPanel } : { ...PANEL_DEFAULTS };\n\n const {\n titleText: rightPanelTitleText,\n content: rightPanelContent,\n flavour: rightPanelFlavour,\n open: rightPanelOpen,\n onChangeOpen: rightPanelOnChangeOpen,\n width: rightPanelWidth,\n arrowButtons: rightPanelArrowButtons,\n startOpen: rightPanelStartOpen,\n onOpened: rightPanelOnOpened,\n onClosed: rightPanelOnClosed,\n dataTestId: rightPanelDataTestId,\n } = rightPanel ? { ...PANEL_DEFAULTS, ...rightPanel } : { ...PANEL_DEFAULTS };\n\n useEffect(() => {\n if (leftPanelStartOpen !== INITIAL_LEFT_PANEL_OPEN) {\n setLeftPanelOpenInternal(leftPanelStartOpen);\n setLeftPanelOpenInternalPrevious(leftPanelStartOpen);\n }\n }, [leftPanelStartOpen]);\n\n useEffect(() => {\n if (rightPanelStartOpen !== INITIAL_RIGHT_PANEL_OPEN) {\n setRightPanelOpenInternal(rightPanelStartOpen);\n setRightPanelOpenInternalPrevious(rightPanelStartOpen);\n }\n }, [rightPanelStartOpen]);\n\n const leftPanelOpenCurrent = leftPanelOpen === undefined ? leftPanelOpenInternal : leftPanelOpen;\n\n const rightPanelOpenCurrent =\n rightPanelOpen === undefined ? rightPanelOpenInternal : rightPanelOpen;\n\n const handleLeftPanelChangeOpen = (open: boolean) => {\n if (leftPanelOpen === undefined) {\n // If not in controlled mode, update the internal state\n setLeftPanelOpenInternal(open);\n\n if (sidePanelsAreMutuallyExclusive && includeRightPanel) {\n if (open) {\n setRightPanelOpenInternal(false);\n setRightPanelOpenInternalPrevious(rightPanelOpenInternal);\n } else {\n setRightPanelOpenInternal(rightPanelOpenInternalPrevious);\n }\n }\n }\n // Likewise, if callback provided, call it\n if (leftPanelOnChangeOpen) leftPanelOnChangeOpen(open);\n };\n\n const handleRightPanelChangeOpen = (open: boolean) => {\n if (rightPanelOpen === undefined) {\n setRightPanelOpenInternal(open);\n if (sidePanelsAreMutuallyExclusive && includeLeftPanel) {\n if (open) {\n setLeftPanelOpenInternal(false);\n setLeftPanelOpenInternalPrevious(leftPanelOpenInternal);\n } else {\n setLeftPanelOpenInternal(leftPanelOpenInternalPrevious);\n }\n }\n }\n if (rightPanelOnChangeOpen) rightPanelOnChangeOpen(open);\n };\n\n return (\n <Box>\n {includeLeftPanel && (\n <SidePanel\n data-testid={leftPanelDataTestId}\n anchor=\"left\"\n open={leftPanelOpenCurrent}\n onClose={() => handleLeftPanelChangeOpen(false)}\n width={leftPanelWidth}\n titleText={leftPanelTitleText}\n debugOpacity={debugOpacity}\n showCloseArrow={leftPanelArrowButtons === 'both' || leftPanelArrowButtons === 'close'}\n onOpened={leftPanelOnOpened}\n onClosed={leftPanelOnClosed}\n navBarOpen={navBarOpen}\n navBarWidthOpen={navBarWidthOpen}\n navBarWidthClosed={navBarWidthClosed}\n >\n {leftPanelContent}\n </SidePanel>\n )}\n\n {includeRightPanel && (\n <SidePanel\n data-testid={rightPanelDataTestId}\n anchor=\"right\"\n open={rightPanelOpenCurrent}\n onClose={() => handleRightPanelChangeOpen(false)}\n width={rightPanelWidth}\n titleText={rightPanelTitleText}\n debugOpacity={debugOpacity}\n showCloseArrow={rightPanelArrowButtons === 'both' || rightPanelArrowButtons === 'close'}\n onOpened={rightPanelOnOpened}\n onClosed={rightPanelOnClosed}\n navBarOpen={navBarOpen}\n navBarWidthOpen={navBarWidthOpen}\n navBarWidthClosed={navBarWidthClosed}\n >\n {rightPanelContent}\n </SidePanel>\n )}\n\n <TopBar\n titleText={titleText}\n data-testid={topBarDataTestId}\n {...(includeLeftPanel && leftPanelFlavour === 'push'\n ? {\n leftPanel: {\n open: leftPanelOpenCurrent,\n width: leftPanelWidth,\n onOpen: () => handleLeftPanelChangeOpen(true),\n showOpenArrow: leftPanelArrowButtons === 'both' || leftPanelArrowButtons === 'open',\n },\n }\n : {})}\n {...(includeRightPanel && rightPanelFlavour === 'push'\n ? {\n rightPanel: {\n open: rightPanelOpenCurrent,\n width: rightPanelWidth,\n onOpen: () => handleRightPanelChangeOpen(true),\n showOpenArrow:\n rightPanelArrowButtons === 'both' || rightPanelArrowButtons === 'open',\n },\n }\n : {})}\n />\n\n <PanelAwareMargins\n {...(leftPanelFlavour === 'push'\n ? {\n leftPanel: {\n open: leftPanelOpenCurrent,\n width: leftPanelWidth,\n },\n }\n : {})}\n {...(rightPanelFlavour === 'push'\n ? {\n rightPanel: {\n open: rightPanelOpenCurrent,\n width: rightPanelWidth,\n },\n }\n : {})}\n >\n <PageContainer data-testid={pageContentDataTestId} {...pageContainerProps}>\n {children}\n </PageContainer>\n </PanelAwareMargins>\n </Box>\n );\n}\n","export const SIDE_PANEL_DEFAULTS = {\n titleText: '',\n flavour: 'push',\n width: 400,\n arrowButtons: 'both',\n startOpen: false,\n open: undefined,\n onChangeOpen: undefined,\n content: <></>,\n onOpened: undefined,\n onClosed: undefined,\n dataTestId: undefined,\n};\n\nexport const INITIAL_LEFT_PANEL_OPEN = false;\nexport const INITIAL_RIGHT_PANEL_OPEN = false;\n\nexport const NAVBAR_DEFAULTS = {\n content: <></>,\n widthOpen: 330,\n widthClosed: 73,\n};\n","import { Box, styled, Typography } from '@mui/material';\n\nconst TOP_STRIPE_HEIGHT = 24;\nconst TITLE_BAR_HEIGHT = 64;\n\nconst PREFIX = 'TopBar';\n\nexport interface TopBarProps {\n titleText?: string;\n 'data-testid'?: string;\n}\n\nexport const classes = {\n topStripe: `${PREFIX}-topStripe`,\n titleBar: `${PREFIX}-titleBar`,\n titleSlider: `${PREFIX}-titleSlider`,\n\n titleText: `${PREFIX}-titleText`,\n};\n\ninterface RootProps {}\n\nconst Root = styled('div', {\n shouldForwardProp: (prop) => !(['leftPanel', 'rightPanel'] as Array<PropertyKey>).includes(prop),\n name: PREFIX,\n})<RootProps>(({ theme }) => ({\n width: '100%',\n\n [`& .${classes.topStripe}`]: {\n width: '100%',\n height: `${TOP_STRIPE_HEIGHT}px`,\n backgroundColor: theme.palette.primary.main,\n },\n\n [`& .${classes.titleBar}`]: {\n backgroundColor: theme.palette.primary.light,\n height: `${TITLE_BAR_HEIGHT}px`,\n padding: theme.spacing(0, 3),\n width: '100%',\n },\n\n [`& .${classes.titleSlider}`]: {\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n color: 'white',\n\n transition: theme.transitions.create('margin', {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.leavingScreen,\n }),\n\n [`& .${classes.titleText}`]: {\n flexGrow: 1,\n },\n },\n}));\n\n/**\n * Goes at the top of every page. Wasn't feeling creative in naming it.\n *\n * This differs from the more complex TopBar used in the PageLayout component\n * that it has to interact with a sliding side panel that is not the main\n * navbar.\n */\nexport default function TopBar({ titleText = '', 'data-testid': dataTestId }: TopBarProps) {\n return (\n <Root data-testid={dataTestId}>\n <div className={classes.topStripe} />\n <div className={classes.titleBar}>\n <Box className={classes.titleSlider}>\n <Typography className={classes.titleText} variant=\"h6\" noWrap>\n {titleText}\n </Typography>\n </Box>\n </div>\n </Root>\n );\n}\n","import { styled, Container } from '@mui/material';\n\n/** Just a simple styled container applying our spacings*/\nconst PageContainer = styled(Container, {\n name: 'PageContainer',\n})(({ theme }) => ({\n // Horizontal padding comes from the Container's gutter\n paddingTop: theme.spacing(3),\n paddingBottom: theme.spacing(3),\n}));\n\nexport default PageContainer;\n","import { AppLayoutContextState } from './AppLayoutContext';\nimport { NAVBAR_DEFAULTS } from './defaults';\n\ntype Action =\n | { type: 'toggleNavBarOpen' }\n | { type: 'setNavBarOpen'; payload: AppLayoutContextState['navBarOpen'] }\n | { type: 'setTitleText'; payload: AppLayoutContextState['titleText'] };\n\nexport const INITIAL_PAGE_LAYOUT_CONTEXT_STATE: AppLayoutContextState = {\n navBarOpen: true,\n titleText: '',\n navBarWidthOpen: NAVBAR_DEFAULTS.widthOpen,\n navBarWidthClosed: NAVBAR_DEFAULTS.widthClosed,\n};\n\nexport function appLayoutContextStateReducer(\n state: AppLayoutContextState,\n action: Action\n): AppLayoutContextState {\n switch (action.type) {\n case 'toggleNavBarOpen':\n return {\n ...state,\n navBarOpen: !state.navBarOpen,\n };\n\n case 'setNavBarOpen':\n return {\n ...state,\n navBarOpen: action.payload,\n };\n\n case 'setTitleText':\n return {\n ...state,\n titleText: action.payload,\n };\n\n default:\n throw new Error(`Invalid action.type`);\n }\n}\n","import { createContext, useContext, PropsWithChildren, useMemo, useReducer } from 'react';\nimport { ContextError } from '../../errors/ContextError';\nimport {\n INITIAL_PAGE_LAYOUT_CONTEXT_STATE,\n appLayoutContextStateReducer,\n} from './appLayoutContextStateReducer';\n\nexport interface AppLayoutContextState {\n navBarOpen: boolean;\n titleText: string;\n navBarWidthOpen: number;\n navBarWidthClosed: number;\n}\n\nexport interface AppLayoutContextActions {\n toggleNavBarOpen: () => void;\n setNavBarOpen: (newVal: boolean) => void;\n setTitleText: (newVal: string) => void;\n}\n\nexport type AppLayoutContext = AppLayoutContextState & AppLayoutContextActions;\n\ninterface BasePageProviderProps {\n overrideState?: Partial<AppLayoutContextState>;\n overrideActions?: Partial<AppLayoutContextActions>;\n}\n\nexport type PageProviderProps = PropsWithChildren<BasePageProviderProps>;\n\nconst Context = createContext<AppLayoutContext | null>(null);\n\n// Note: Must be at at this scope, otherwise useEffect will loop infinitely\nconst defaultOverrideState = {};\nconst defaultOverrideContextActions = {};\n\n/**\n * Provider of AppLayoutContext, which includes state such as navBarOpen and\n * titleText, along with actions such as setNavBarOpen() and toggleNavBarOpen().\n *\n * These functions provided by the hook are wrappers on the underlying reducer.\n *\n * The overrideState and overrideActions props are designed to be used in tests\n * with the Souvlaki library, for components that rely on being in the context\n * of a AppLayoutProvider, without the need to render the navbar etc.\n */\nexport const AppLayoutProvider = ({\n overrideState = defaultOverrideState,\n overrideActions = defaultOverrideContextActions,\n children,\n}: PageProviderProps) => {\n // Under the hood we use a reducer to manage our state\n const [{ titleText, navBarOpen, navBarWidthOpen, navBarWidthClosed }, appLayoutContextDispatch] =\n useReducer(appLayoutContextStateReducer, INITIAL_PAGE_LAYOUT_CONTEXT_STATE);\n\n const appLayoutContextDispatchWrappers = useMemo(\n () => ({\n toggleNavBarOpen: () => appLayoutContextDispatch({ type: 'toggleNavBarOpen' }),\n\n setNavBarOpen: (newValue: boolean) =>\n appLayoutContextDispatch({ type: 'setNavBarOpen', payload: newValue }),\n\n setTitleText: (newValue: string) =>\n appLayoutContextDispatch({ type: 'setTitleText', payload: newValue }),\n }),\n []\n );\n\n const value: AppLayoutContext = {\n navBarOpen,\n titleText,\n navBarWidthOpen,\n navBarWidthClosed,\n ...appLayoutContextDispatchWrappers,\n ...overrideState,\n ...overrideActions,\n };\n\n return <Context.Provider value={value}>{children}</Context.Provider>;\n};\n\nexport const useAppLayout = () => {\n const context = useContext(Context);\n\n if (context === null) {\n throw new ContextError('Error: Tried to call useAppLayout() outside of a <AppLayoutProvider>');\n }\n\n return context;\n};\n","import { styled, CSSObject } from '@mui/material/styles';\nimport Drawer from '@mui/material/Drawer';\n\nconst PREFIX = 'Navbar';\n\nexport const classes = {\n root: `${PREFIX}-root`,\n menuButton: `${PREFIX}-menuButton`,\n hide: `${PREFIX}-hide`,\n content: `${PREFIX}-content`,\n userInfoHolder: `${PREFIX}-userInfoHolder`,\n settings: `${PREFIX}-settings`,\n pieChartIcon: `${PREFIX}-pieChartIcon`,\n};\n\nexport const Root = styled('div', { name: 'NavBar' })(({ theme }) => ({\n [`&.${classes.root}`]: {\n display: 'flex',\n },\n\n [`& .${classes.menuButton}`]: {\n marginRight: 36,\n },\n\n [`& .${classes.hide}`]: {\n display: 'none',\n },\n\n [`& .${classes.content}`]: {\n flexGrow: 1,\n padding: theme.spacing(3),\n },\n\n [`& .${classes.userInfoHolder}`]: {\n height: '148px',\n marginTop: '64px',\n marginBottom: '16px',\n },\n}));\n\n// The starting point for this was the \"Mini variant drawer\" of\n// https://mui.com/components/drawers/#main-content\n\nconst sharedOverrides = (): CSSObject => ({\n position: 'absolute',\n height: '100%',\n overflowX: 'hidden',\n overflowY: 'hidden',\n color: 'white',\n backgroundColor: 'black',\n});\n\nconst openedMixin = (width: number): CSSObject => ({\n width,\n ...sharedOverrides(),\n});\n\nconst closedMixin = (width: number): CSSObject => ({\n width,\n ...sharedOverrides(),\n});\n\ninterface NavDrawerProps {\n open: boolean;\n widthOpen: number;\n widthClosed: number;\n}\n\nexport const NavDrawer = styled(Drawer, {\n shouldForwardProp: (prop) => !['open', 'widthOpen', 'widthClosed'].includes(prop as string),\n})<NavDrawerProps>(({ theme, open, widthOpen, widthClosed }) => ({\n width: open ? widthOpen : widthClosed,\n flexShrink: 0,\n whiteSpace: 'nowrap',\n boxSizing: 'border-box',\n zIndex: theme.zIndex.drawer + 100,\n\n ...(open && {\n '& .MuiDrawer-paper': openedMixin(widthOpen),\n }),\n ...(!open && {\n '& .MuiDrawer-paper': closedMixin(widthClosed),\n }),\n}));\n","import { styled } from '@mui/material/styles';\nimport List, { ListProps } from '@mui/material/List';\n\nconst SELECTED_INDICATOR_WIDTH = 7;\n\nexport const NavBarDarkStyledList = styled(List)<ListProps>(({ theme }) => ({\n backgroundColor: 'black',\n color: 'white',\n\n '& .MuiListItem-root': {\n padding: 'unset',\n },\n\n '& .MuiListItemButton-root': {\n ' .MuiListItemIcon-root': {\n color: 'white',\n padding: `${SELECTED_INDICATOR_WIDTH}px`,\n },\n\n // Focus state\n '&.Mui-focusVisible': {\n backgroundColor: theme.palette.grey[700],\n },\n\n // Selected state\n '&.Mui-selected': {\n borderLeftStyle: 'solid',\n borderLeftWidth: '7px',\n borderLeftColor: theme.palette.primary.main,\n paddingLeft: `calc(${theme.spacing(2)} - ${SELECTED_INDICATOR_WIDTH}px)`,\n },\n\n // Hover state\n '&:hover': {\n backgroundColor: theme.palette.primary.dark,\n },\n\n // Focus+Selected state\n '&.Mui-selected.Mui-focusVisible': {\n backgroundColor: theme.palette.grey[700],\n },\n\n // Hover+Selected state\n '&.Mui-selected:hover': {\n backgroundColor: theme.palette.primary.dark,\n },\n\n // Focus+Hover+Selected state doesn't need to be specified\n // '&.Mui-selected.Mui-focusVisible:hover': {\n // },\n },\n})) as typeof List;\n","import { PropsWithChildren } from 'react';\nimport CssBaseline from '@mui/material/CssBaseline';\n\nimport { classes, Root, NavDrawer } from './Styling';\n\nexport type NavbarProps = {\n open: boolean;\n widthOpen: number;\n widthClosed: number;\n\n /** Set the datatest-id on the root element for using reactdom's getByTestId()\n * function */\n 'data-testid'?: string;\n};\n\n// TODO: Add in more common elements (or make another component) for user/organisations/logout etc?\n// TODO: Should there be two sets of 'children', one for the list and one for dialogs etc?\n\n/**\n * A styled navigation bar. At this point in time its pretty unopinionated, it\n * just renders whatever children it is given. The NavBarDarkStyledList\n * component can be used for consistent styling against the background. We'll be\n * changing the way we use NavBars soon anyway, so not much point solidying the\n * patterns yet.\n */\nexport default function NavBar({\n open,\n widthOpen,\n widthClosed,\n 'data-testid': dataTestId,\n children,\n}: PropsWithChildren<NavbarProps>) {\n return (\n <Root className={classes.root} data-testid={dataTestId}>\n <CssBaseline />\n <NavDrawer\n variant=\"permanent\"\n anchor=\"left\"\n // We aren't using transitions, and {0} will still create an unwanted timeout\n transitionDuration={null as unknown as number}\n open={open}\n widthOpen={widthOpen}\n widthClosed={widthClosed}\n >\n {children}\n </NavDrawer>\n </Root>\n );\n}\n\nexport * from './NavBarDarkStyledList';\n\n// TODO: This is a temporary fix, library clients shouldn't need this\nexport { classes as navBarClasses } from './Styling';\n","import { Box } from '@mui/material';\n\nimport { AppLayoutProps } from './types';\nimport { NAVBAR_DEFAULTS } from './defaults';\nimport TopBar from './TopBar';\nimport PageContainer from './PageContainer';\nimport { AppLayoutProvider, useAppLayout } from './AppLayoutContext';\nimport NavBar from './NavBar';\n\nfunction AppLayout({\n children,\n navBar = NAVBAR_DEFAULTS,\n pageContainerProps,\n pageContentDataTestId,\n topBarDataTestId,\n}: AppLayoutProps) {\n // TODO: Would it be cleaner to have the NavBar have its own provider, so there is a separate useAppLayout() and useNavBar()?\n const { navBarOpen, titleText } = useAppLayout();\n\n const {\n content: navBarContent,\n widthOpen: navBarWidthOpen,\n widthClosed: navBarWidthClosed,\n } = navBar ? { ...NAVBAR_DEFAULTS, ...navBar } : { ...NAVBAR_DEFAULTS };\n\n return (\n <Box display=\"flex\" flexDirection=\"column\" height=\"100vh\">\n <Box display=\"flex\" position=\"relative\" flexGrow={1} overflow=\"hidden\">\n <NavBar open={navBarOpen} widthOpen={navBarWidthOpen} widthClosed={navBarWidthClosed}>\n {navBarContent}\n </NavBar>\n <Box component=\"main\" id=\"main-content\" flexGrow={1} overflow=\"auto\" tabIndex={-1}>\n <Box>\n <TopBar titleText={titleText} data-testid={topBarDataTestId} />\n\n <PageContainer data-testid={pageContentDataTestId} {...pageContainerProps}>\n {children}\n </PageContainer>\n </Box>\n </Box>\n </Box>\n </Box>\n );\n}\n\nexport default function AppLayoutWithProvider(props: AppLayoutProps) {\n return (\n <AppLayoutProvider>\n <AppLayout {...props} />\n </AppLayoutProvider>\n );\n}\n\nexport * from './AppLayoutContext';\n","import { alpha, createTheme } from '@mui/material/styles';\n\nexport const internalAGSystemsTheme = createTheme({\n palette: {\n primary: {\n main: '#007236',\n dark: '#005221',\n light: '#00A04E',\n contrastText: '#FFFFFF',\n },\n secondary: {\n main: '#662D91',\n dark: '#440E62',\n light: '#93268F',\n contrastText: '#FFFFFF',\n },\n error: {\n main: '#D32F2F',\n dark: '#C62828',\n light: '#EF5350',\n },\n info: {\n main: '#0288D1',\n dark: '#01579B',\n light: '#03A9F4',\n },\n success: {\n main: '#0288D1',\n dark: '#01579B',\n light: '#03A9F4',\n },\n },\n components: {\n MuiTextField: {\n defaultProps: { color: 'secondary' },\n },\n MuiToggleButtonGroup: {\n defaultProps: { color: 'secondary' },\n },\n MuiCheckbox: {\n defaultProps: { color: 'secondary' },\n },\n MuiSelect: {\n defaultProps: { color: 'secondary' },\n },\n MuiSwitch: {\n defaultProps: { color: 'secondary' },\n },\n MuiFormControl: {\n defaultProps: { color: 'secondary' },\n },\n MuiMenuItem: {\n // Setting defaultProps for color on MenuItem does not work, so update manually\n styleOverrides: {\n root: ({ theme }) => ({\n '&.Mui-selected': {\n backgroundColor: alpha(\n theme.palette.secondary.main,\n theme.palette.action.selectedOpacity\n ),\n '&:hover': {\n backgroundColor: alpha(\n theme.palette.secondary.main,\n theme.palette.action.selectedOpacity\n ),\n },\n '&.Mui-focusVisible': {\n backgroundColor: alpha(\n theme.palette.secondary.main,\n theme.palette.action.focusOpacity\n ),\n },\n },\n }),\n },\n },\n },\n typography: {\n // I couldn't think of what to call this. It is an attempt to match\n // https://www.figma.com/file/atonRPl2YD9A1NCntbDtKR/List-Filter-and-Product-Concept?node-id=1187%3A43730\n // but not sure if line height should be changed\n explainer: {\n fontSize: '14px',\n marginBlockStart: '1em',\n },\n h3: {\n fontSize: '1rem',\n fontWeight: 700,\n },\n },\n});\n\nexport const fed21Theme = createTheme({\n palette: {\n primary: {\n dark: '#00A651',\n light: '#A3D39C',\n main: '#007236',\n contrastText: '#FFF',\n },\n warning: {\n main: '#F5871F',\n light: '#FCC589',\n dark: '#A2590A',\n contrastText: '#FFF',\n },\n secondary: {\n main: '#662D91',\n light: '#BD8CBF',\n dark: '#440E62',\n contrastText: '#FFF',\n },\n error: {\n main: '#D43C95',\n light: '#8F2064',\n dark: '#F9CDE0',\n contrastText: '#FFF',\n },\n info: {\n main: '#00A88D',\n light: '#ADDCCF',\n dark: '#005243',\n contrastText: '#FFF',\n },\n success: {\n main: '#00A651',\n light: '#A3D39C',\n dark: '#007236',\n contrastText: '#FFF',\n },\n },\n typography: {\n // I couldn't think of what to call this. It is an attempt to match\n // https://www.figma.com/file/atonRPl2YD9A1NCntbDtKR/List-Filter-and-Product-Concept?node-id=1187%3A43730\n // but not sure if line height should be changed\n explainer: {\n fontSize: '14px',\n marginBlockStart: '1em',\n },\n },\n});\n","import { PropsWithChildren } from 'react';\nimport { ThemeProvider } from '@mui/material/styles';\n\nimport { internalAGSystemsTheme, fed21Theme } from './themes';\n\nexport type AgThemeName = 'internal' | 'fed21';\n\nexport interface AgThemeProviderProps {\n name?: AgThemeName;\n}\n\n// TODO: Any advantage having this as a component rather than just a normal theme that can be added to a themeprovider? Might make documentation simpler.\nexport default function AgThemeProvider({\n name = 'internal',\n children,\n}: PropsWithChildren<AgThemeProviderProps>) {\n const theme =\n name === 'internal' ? internalAGSystemsTheme : name === 'fed21' ? fed21Theme : undefined;\n\n // Should be resolved when we move to React >= 18\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return <ThemeProvider theme={theme}>{children}</ThemeProvider>;\n}\n","// The default props passed to the underlying Snackbar component\nimport { SnackbarOrigin } from '@mui/material/Snackbar';\n\nexport const defaultSnackbarProps = {\n autoHideDuration: 6000,\n anchorOrigin: { vertical: 'top', horizontal: 'center' } as SnackbarOrigin,\n\n // The default is false. If we prefer timer to continue when window loses\n // focus, change to true\n disableWindowBlurListener: false,\n};\n\nexport const defaultSaladBarProps = {\n shouldClose: (_event: Event | React.SyntheticEvent<Element, Event>, reason: string) => {\n return reason !== 'clickaway';\n },\n};\n\nexport const defaultEnqueueNotificationOptions = {\n message: '',\n severity: 'info',\n variant: 'standard',\n progressIndicator: undefined, // Can use 'circular' or 'linear'\n};\n","import React, { useRef, useState, createContext, useCallback } from 'react';\nimport { Alert, LinearProgress, CircularProgress, Snackbar, SnackbarProps } from '@mui/material';\n\nimport {\n Notification,\n SaladBarCloseReason,\n SaladBarState,\n SaladBarActions,\n SaladBarContext,\n} from './types';\nimport {\n defaultSaladBarProps,\n defaultSnackbarProps,\n defaultEnqueueNotificationOptions,\n} from './defaults';\n\nconst MAX_QUEUE_LENGTH = 100;\nconst MAX_QUEUE_HIT_REPORT_INTERVAL = 2000;\nconst SALADBAR_INDEX = 2000;\n\n// No need to use uuids, just use an incremented value\nconst generateNotificationKey = (() => {\n let previousKey = 0;\n return () => {\n previousKey += 1;\n return previousKey;\n };\n})();\n\nconst alertWithLinearProgressStyle = {\n borderBottomLeftRadius: '0px',\n borderBottomRightRadius: '0px',\n};\n\n// Note: Must be at at this scope, otherwise useEffect will loop infinitely\nconst defaultOverrideState = {};\nconst defaultOverrideActions = {};\n\nexport const Context = createContext<SaladBarContext | null>(null);\n\nexport interface SaladBarProviderProps extends SnackbarProps {\n /** Allow overriding the state of the SaladBar (for tests etc)*/\n overrideState?: Partial<SaladBarState>;\n\n /** Allow overriding the actions of the SaladBar (for tests etc)*/\n overrideActions?: Partial<SaladBarActions>;\n\n /** Called when an event triggers closing of currently displayed snackbar.\n * Default implementation returns false if reason is 'clickaway', otherwise\n * true.*/\n shouldClose?: (\n event: Event | React.SyntheticEvent<Element, Event>,\n reason: SaladBarCloseReason\n ) => boolean;\n}\n\nexport default function SaladBarProvider({\n overrideState = defaultOverrideState,\n overrideActions = defaultOverrideActions,\n shouldClose = defaultSaladBarProps.shouldClose,\n children,\n ...snackbarProps\n}: SaladBarProviderProps) {\n const [{ open }, setSaladBarState] = useState({ open: false });\n\n // We use a ref instead of a state to store the actual data, because we want\n // queue to be persistent across the whole lifetime of component. I considered\n // using yocto-queue because it would be O(1) instead of O(n), but its not\n // designed to access the head without removing it and its not going to make\n // much difference anyway.\n const queueRef = useRef<Notification[]>([]);\n\n const limitLastHitAt = useRef(Date.now());\n const limitHitCountSinceLastReport = useRef(0);\n\n const setOpen = useCallback((newVal: boolean) => {\n setSaladBarState({ open: newVal });\n }, []);\n\n const enqueueNotification = useCallback((notification: Notification = {}) => {\n limitHitCountSinceLastReport.current += 1;\n if (queueRef.current.length >= MAX_QUEUE_LENGTH) {\n // If the queue length is hit, probably stuck in some sort of loop, so\n // don't want to spam logs instantly so space it out\n if (Date.now() - limitLastHitAt.current >= MAX_QUEUE_HIT_REPORT_INTERVAL) {\n limitLastHitAt.current = Date.now();\n console.error(\n `SaladBarProvider: MAX_QUEUE_LENGTH (${MAX_QUEUE_LENGTH}) hit ${limitHitCountSinceLastReport.current} times in last ${MAX_QUEUE_HIT_REPORT_INTERVAL}ms)`\n );\n limitHitCountSinceLastReport.current = 0;\n }\n }\n\n const newNotification = {\n ...defaultEnqueueNotificationOptions,\n key: generateNotificationKey(), // Can be overridden.\n ...notification, // This could result in collisons, but unlikely.\n };\n\n // Add to the end of queue\n queueRef.current.push(newNotification as Notification);\n\n // If the queue was previously empty, then open the snackbar. We don't do it\n // whenever enqueueNotification is called since it will mess up transitions\n if (queueRef.current.length === 1) setSaladBarState({ open: true });\n\n return newNotification.key;\n }, []);\n\n const enqueueSuccessNotification = (message = '', options = {}) =>\n enqueueNotification({ message, severity: 'success', ...options });\n\n const enqueueInfoNotification = (message = '', options = {}) =>\n enqueueNotification({ message, severity: 'info', ...options });\n\n const enqueueWarningNotification = (message = '', options = {}) =>\n enqueueNotification({ message, severity: 'warning', ...options });\n\n const enqueueErrorNotification = (message = '', options = {}) =>\n enqueueNotification({ message, severity: 'error', ...options });\n\n /**\n * Remove the notification with specified key from the queue. If the key is\n * not found, immediately returns null.\n *\n * @param key - The key as returned from enqueue...() function.\n *\n * @returns The removed notification\n */\n const removeNotification = (key: Notification['key']) => {\n const index = queueRef.current.findIndex((x) => x.key === key);\n if (index === -1) return;\n\n if (index === 0) {\n // If its at the front of the queue, it is either currently being\n // displayed or in process of being closed. Either way, we can just set\n // open to false\n setSaladBarState({ open: false });\n return queueRef.current[0];\n }\n // Otherwise we just remove it from the queue, it won't need to transition\n return queueRef.current.splice(index, 1);\n };\n\n const handleClose = (\n event: Event | React.SyntheticEvent<Element, Event>,\n reason: SaladBarCloseReason\n ) => {\n if (shouldClose(event, reason)) setSaladBarState({ open: false });\n };\n\n // Callback fired before the transition is exiting.\n const handleExit = () => {};\n\n // Callback fired when the transition has exited.\n const handleExited = () => {\n // Remove head of queue\n queueRef.current.shift();\n\n // If there is still something on the queue, then re-open\n if (queueRef.current.length > 0) setSaladBarState({ open: true });\n };\n\n // The notification to display is the one at head of queue\n const currentNotification = queueRef.current[0] ?? {\n ...defaultEnqueueNotificationOptions,\n };\n\n // Can also override certain props on a notification level\n const currentNotificationSnackbarProps: { autoHideDuration?: number } = {};\n // Probably a better way of doing this\n if ('autoHideDuration' in currentNotification) {\n currentNotificationSnackbarProps.autoHideDuration = currentNotification.autoHideDuration;\n }\n\n // Note the order of props in Snackbar, we don't allow overriding open and\n // onClose directly.\n const snackbarFinalProps = {\n ...defaultSnackbarProps,\n ...snackbarProps,\n };\n\n const value: SaladBarContext = {\n open,\n setOpen,\n enqueueNotification,\n enqueueSuccessNotification,\n enqueueInfoNotification,\n enqueueWarningNotification,\n enqueueErrorNotification,\n removeNotification,\n ...overrideState,\n ...overrideActions,\n };\n\n return (\n <Context.Provider value={value}>\n {children}\n <Snackbar\n {...snackbarFinalProps}\n {...currentNotificationSnackbarProps}\n open={open}\n onClose={handleClose}\n TransitionProps={{\n onExited: handleExited,\n onExit: handleExit,\n }}\n sx={{ zIndex: SALADBAR_INDEX }}\n >\n <div>\n <Alert\n onClose={(event) => handleClose(event, 'closeAlert')}\n severity={currentNotification.severity}\n variant={'filled'}\n icon={\n currentNotification.progressIndicator === 'circular' ? (\n <CircularProgress size=\"1em\" />\n ) : undefined\n }\n style={\n currentNotification.progressIndicator === 'linear'\n ? alertWithLinearProgressStyle\n : undefined\n }\n >\n {currentNotification.message}\n </Alert>\n {currentNotification.progressIndicator === 'linear' && <LinearProgress color=\"primary\" />}\n </div>\n </Snackbar>\n </Context.Provider>\n );\n}\n","import { useContext } from 'react';\n\nimport { Context } from './SaladBarContext';\nimport { ContextError } from '../../errors/ContextError';\n\n/**\n * Use the `useSaladBar` hook in components to access the enqueueNotification()\n * method to add a snackbar message to queue.\n *\n * Must be used inside a <SaladBarProvider>\n *\n * Example:\n *\n * ```js\n * const {\n * enqueueNotification,\n * enqueueSuccessNotification,\n * enqueueInfoNotification,\n * enqueueWarningNotification,\n * enqueueErrorNotification,\n * } = useSaladBar();\n * ...\n * enqueueNotification({message: 'hello', severity: 'info'});\n * // or\n * enqueueInfoNotification('hello');\n * ```\n */\nexport function useSaladBar() {\n const context = useContext(Context);\n\n if (context === null) {\n throw new ContextError('Error: Tried to useSaladBar outside of a <SaladBarProvider>');\n }\n\n return context;\n}\n","/* eslint-disable react/prop-types */\n/* eslint-disable react/display-name */\nimport { createHelper } from 'souvlaki';\n\nimport SaladBarProvider, { SaladBarProviderProps } from './SaladBarContext';\n\nexport const withSaladBarProvider = createHelper(\n (\n props: SaladBarProviderProps = { autoHideDuration: 1 },\n state: Partial<unknown> = {},\n actions: Partial<unknown> = {}\n ) =>\n ({ children }) => {\n return (\n <SaladBarProvider {...props} overrideState={state} overrideActions={actions}>\n {children}\n </SaladBarProvider>\n );\n }\n);\n"],"names":["ExampleComponent","text","num","setNum","useState","jsxs","Fragment","jsx","Typography","Button","oldNum","Paper","NAVBAR_WIDTH_OPENED","NAVBAR_WIDTH_CLOSED","PREFIX","classes","Root","styled","theme","sharedOverrides","openedMixin","__spreadValues","closedMixin","NavDrawer","Drawer","prop","open","ContextError","AgError","__publicField","Context","createContext","defaultOverrideState","defaultOverrideActions","NavBarProvider","overrideState","overrideActions","children","setNavBarState","setOpen","useCallback","newVal","toggleOpen","prevState","__spreadProps","value","useNavBar","context","useContext","buildNavBarState","overrides","withNavBarProvider","createHelper","state","actions","SELECTED_INDICATOR_WIDTH","NavBarDarkStyledList","List","NavBarLightStyledList","NavBar","dataTestId","CssBaseline","TOP_STRIPE_HEIGHT","TITLE_BAR_HEIGHT","leftPanel","rightPanel","_a","_b","TopBar","titleText","Box","IconButton","ForwardIcon","BackIcon","DEFAULT_PANEL_WIDTH","SidePanelDrawer","width","debugOpacity","anchor","navBarOpen","navBarWidthOpen","navBarWidthClosed","DrawerHeaderBox","SidePanel","onClose","showCloseArrow","headerBoxProps","onOpened","onClosed","PanelAwareMargins","PageContainer","Container","INITIAL_LEFT_PANEL_OPEN","INITIAL_RIGHT_PANEL_OPEN","PANEL_DEFAULTS","PageLayout","sidePanelsAreMutuallyExclusive","pageContainerProps","pageContentDataTestId","topBarDataTestId","leftPanelOpenInternal","setLeftPanelOpenInternal","rightPanelOpenInternal","setRightPanelOpenInternal","leftPanelOpenInternalPrevious","setLeftPanelOpenInternalPrevious","rightPanelOpenInternalPrevious","setRightPanelOpenInternalPrevious","includeLeftPanel","includeRightPanel","leftPanelTitleText","leftPanelContent","leftPanelFlavour","leftPanelOpen","leftPanelOnChangeOpen","leftPanelWidth","leftPanelArrowButtons","leftPanelStartOpen","leftPanelOnOpened","leftPanelOnClosed","leftPanelDataTestId","rightPanelTitleText","rightPanelContent","rightPanelFlavour","rightPanelOpen","rightPanelOnChangeOpen","rightPanelWidth","rightPanelArrowButtons","rightPanelStartOpen","rightPanelOnOpened","rightPanelOnClosed","rightPanelDataTestId","useEffect","leftPanelOpenCurrent","rightPanelOpenCurrent","handleLeftPanelChangeOpen","handleRightPanelChangeOpen","NAVBAR_DEFAULTS","INITIAL_PAGE_LAYOUT_CONTEXT_STATE","appLayoutContextStateReducer","action","defaultOverrideContextActions","AppLayoutProvider","appLayoutContextDispatch","useReducer","appLayoutContextDispatchWrappers","useMemo","newValue","useAppLayout","widthOpen","widthClosed","AppLayout","navBar","navBarContent","AppLayoutWithProvider","props","internalAGSystemsTheme","createTheme","alpha","fed21Theme","AgThemeProvider","name","ThemeProvider","defaultSnackbarProps","defaultSaladBarProps","_event","reason","defaultEnqueueNotificationOptions","MAX_QUEUE_LENGTH","MAX_QUEUE_HIT_REPORT_INTERVAL","SALADBAR_INDEX","generateNotificationKey","previousKey","alertWithLinearProgressStyle","SaladBarProvider","shouldClose","snackbarProps","__objRest","setSaladBarState","queueRef","useRef","limitLastHitAt","limitHitCountSinceLastReport","enqueueNotification","notification","newNotification","enqueueSuccessNotification","message","options","enqueueInfoNotification","enqueueWarningNotification","enqueueErrorNotification","removeNotification","key","index","x","handleClose","event","handleExit","handleExited","currentNotification","currentNotificationSnackbarProps","snackbarFinalProps","Snackbar","Alert","CircularProgress","LinearProgress","useSaladBar","withSaladBarProvider"],"mappings":"ymCAQwB,SAAAA,GAAiB,CAAE,KAAAC,GAA+B,CACxE,KAAM,CAACC,EAAKC,CAAM,EAAIC,WAAS,CAAC,EAEhC,OAEIC,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAAC,EAAA,IAACC,EAAW,WAAA,CAAA,QAAQ,KAAK,MAAM,UAAU,UAAU,MAAM,GAAI,CAAE,SAAU,MAAO,EAAG,SAEnF,cAAA,EAEAD,EAAAA,IAACC,EAAAA,YAAW,QAAQ,UAAU,QAAQ,QACpC,SAAAD,EAAAA,IAAC,OAAK,CAAA,SAAA,uEAAA,CAAqE,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6DAA6D,EAG/E,OAAAoB,CACT,CC7BO,MAAMiK,GAAuB5J,GAAA,aAClC,CACIuG,EAA+B,CAAE,iBAAkB,GACnDtG,EAA0B,CAAC,EAC3BC,EAA4B,CAAA,IAE9B,CAAC,CAAE,SAAAjB,KAEC9B,MAACuK,UAAqBnB,IAAO,cAAetG,EAAO,gBAAiBC,EACjE,SAAAjB,CACH,EAAA,CAGR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ExampleComponent/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ExampleComponent/index.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,qBAAqB;IACpC,WAAW;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,IAAI,EAAE,EAAE,qBAAqB,eAyBvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavBarContext.d.ts","sourceRoot":"","sources":["../../../../src/components/NavBar/NavBarContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,iBAAiB,EAAyB,MAAM,OAAO,CAAC;AAG5F,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"NavBarContext.d.ts","sourceRoot":"","sources":["../../../../src/components/NavBar/NavBarContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,iBAAiB,EAAyB,MAAM,OAAO,CAAC;AAG5F,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,KAAK,aAAa,GAAG,WAAW,GAAG,aAAa,CAAC;AAIjD,KAAK,mBAAmB,GAAG;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACrC,eAAe,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;CAC1C,CAAC;AAMF,eAAO,MAAM,cAAc,kDAIxB,kBAAkB,mBAAmB,CAAC,gBAoBxC,CAAC;AAEF,eAAO,MAAM,SAAS,qBAQrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavBarLightStyledList.d.ts","sourceRoot":"","sources":["../../../../src/components/NavBar/NavBarLightStyledList.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,qBAAqB,6FA8ChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styling.d.ts","sourceRoot":"","sources":["../../../../src/components/NavBar/Styling.tsx"],"names":[],"mappings":";AAGA,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAItC,eAAO,MAAM,OAAO;;;;;;;;CAQnB,CAAC;AAEF,eAAO,MAAM,IAAI,wVAuBd,CAAC;
|
|
1
|
+
{"version":3,"file":"Styling.d.ts","sourceRoot":"","sources":["../../../../src/components/NavBar/Styling.tsx"],"names":[],"mappings":";AAGA,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAItC,eAAO,MAAM,OAAO;;;;;;;;CAQnB,CAAC;AAEF,eAAO,MAAM,IAAI,wVAuBd,CAAC;AAyBJ,eAAO,MAAM,SAAS,kLAenB,CAAC"}
|
|
@@ -17,5 +17,6 @@ export default function NavBar({ 'data-testid': dataTestId, children, }: PropsWi
|
|
|
17
17
|
export * from './NavBarContext';
|
|
18
18
|
export * from './testWrappers';
|
|
19
19
|
export * from './NavBarDarkStyledList';
|
|
20
|
+
export * from './NavBarLightStyledList';
|
|
20
21
|
export { classes as navBarClasses } from './Styling';
|
|
21
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/NavBar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAM1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAErE,MAAM,MAAM,WAAW,GAAG;IACxB;kBACc;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/NavBar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAM1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAErE,MAAM,MAAM,WAAW,GAAG;IACxB;kBACc;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAQF;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,aAAa,EAAE,UAAU,EACzB,QAAQ,GACT,EAAE,iBAAiB,CAAC,WAAW,CAAC,eAiBhC;AAED,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAE/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AAGxC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,WAAW,CAAC"}
|