@australiangreens/ag-internal-components 0.0.25 → 0.0.26

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 CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var Oe=Object.defineProperty,Be=Object.defineProperties;var _e=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,ae=Object.prototype.propertyIsEnumerable;var K=(e,t,n)=>t in e?Oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,o=(e,t)=>{for(var n in t||(t={}))oe.call(t,n)&&K(e,n,t[n]);if(M)for(var n of M(t))ae.call(t,n)&&K(e,n,t[n]);return e},C=(e,t)=>Be(e,_e(t));var ie=(e,t)=>{var n={};for(var a in e)oe.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&M)for(var a of M(e))t.indexOf(a)<0&&ae.call(e,a)&&(n[a]=e[a]);return n};var se=(e,t,n)=>(K(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),d=require("react"),Ie=require("@mui/material/Button"),Pe=require("@mui/material/Paper"),be=require("@mui/material/Typography"),w=require("@mui/material"),Ae=require("@mui/icons-material/ArrowForward"),Ee=require("@mui/icons-material/ArrowBack"),je=require("@mui/material/Drawer"),ke=require("@mui/material/Box"),Ne=require("@mui/material/IconButton"),De=require("@mui/material/Container"),P=require("@mui/material/styles"),Le=require("@mui/material/Snackbar"),qe=require("@mui/material/Alert"),Re=require("@mui/material/LinearProgress"),$e=require("@mui/material/CircularProgress"),Me=require("@australiangreens/ag-error"),u=e=>e&&e.__esModule?e:{default:e},He=u(Ie),ze=u(Pe),j=u(be),fe=u(Ae),ge=u(Ee),Ge=u(je),Ue=u(ke),le=u(Ne),We=u(De),Xe=u(Le),Qe=u(qe),Ve=u(Re),Ke=u($e);function Je({text:e}){const[t,n]=d.useState(0);return r.jsxs(r.Fragment,{children:[r.jsx(j.default,{variant:"h6",color:"inherit",component:"div",sx:{fontSize:"22px"},children:"Hello world"}),r.jsx(j.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(He.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(ze.default,{children:["This number will incremember when button pressed: ",t]})]})}const Ye=24,Ze=64,F="TopBar",f={topStripe:`${F}-topStripe`,titleBar:`${F}-titleBar`,titleSlider:`${F}-titleSlider`,titleText:`${F}-titleText`,leftPanelButton:`${F}-leftPanelButton`,rightPanelButton:`${F}-leftPanelButton`},et=w.styled("div",{shouldForwardProp:e=>!["leftPanel","rightPanel"].includes(e),name:F})(({theme:e,leftPanel:t,rightPanel:n})=>{var a,l;return{width:"100%",[`& .${f.topStripe}`]:{width:"100%",height:`${Ye}px`,backgroundColor:e.palette.primary.main},[`& .${f.titleBar}`]:{backgroundColor:e.palette.primary.light,height:`${Ze}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:`${(l=n==null?void 0:n.width)!=null?l:0}px`})}});function tt({titleText:e="",leftPanel:t,rightPanel:n,"data-testid":a}){return r.jsxs(et,{leftPanel:t,rightPanel:n,"data-testid":a,children:[r.jsx("div",{className:f.topStripe}),r.jsx("div",{className:f.titleBar,children:r.jsxs(w.Box,{className:f.titleSlider,children:[t!==void 0&&!t.open&&t.showOpenArrow&&r.jsxs(w.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(fe.default,{})]}),r.jsx(j.default,{className:f.titleText,variant:"h6",noWrap:!0,children:e}),n!==void 0&&!n.open&&n.showOpenArrow&&r.jsxs(w.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(ge.default,{})]})]})})]})}const he=400,nt=w.styled(Ge.default,{shouldForwardProp:e=>!["width","debug","debugOpacity","navBarOpen","navBarWidthOpen","navBarWidthClosed"].includes(e),name:"SidePanelDrawer"})(({width:e,debugOpacity:t=!1,anchor:n,navBarOpen:a,navBarWidthOpen:l,navBarWidthClosed:m})=>({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:`${m}px`},a&&{marginLeft:`${l}px`}))})),rt=w.styled(Ue.default,{shouldForwardProp:e=>!["anchor"].includes(e)})(({theme:e,anchor:t})=>C(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 ce({children:e,anchor:t="left",open:n,onClose:a=()=>{},titleText:l="",width:m=he,showCloseArrow:x=!0,debugOpacity:c=!1,headerBoxProps:S={},onOpened:g,onClosed:p,"data-testid":T,navBarOpen:O=!1,navBarWidthOpen:v=0,navBarWidthClosed:B=0}){return r.jsxs(nt,{SlideProps:{onEntered:()=>g==null?void 0:g(),onExited:()=>p==null?void 0:p()},variant:"persistent",anchor:t,open:n,width:m,debugOpacity:c,"data-testid":T,navBarOpen:O,navBarWidthOpen:v,navBarWidthClosed:B,children:[r.jsx(rt,C(o({anchor:t},S),{children:t==="left"?r.jsxs(r.Fragment,{children:[r.jsx(j.default,{variant:"h6",color:"inherit",component:"div",children:l}),x&&r.jsxs(le.default,{onClick:a,size:"large","aria-label":"Close left side panel",children:[r.jsx(ge.default,{"data-testid":"arrowbackicon"})," "]})]}):r.jsxs(r.Fragment,{children:[x&&r.jsxs(le.default,{onClick:a,size:"large","aria-label":"Close right side panel",children:[r.jsx(fe.default,{})," "]}),r.jsx(j.default,{variant:"h6",color:"inherit",component:"div",children:l})]})})),e]})}const ot=w.styled("div",{shouldForwardProp:e=>!["leftPanel","rightPanel"].includes(e),name:"PanelAwareMargins"})(({theme:e,leftPanel:t,rightPanel:n})=>{var a,l;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:`${(l=n==null?void 0:n.width)!=null?l:0}px`})}),at=w.styled(We.default,{name:"PageContainer"})(({theme:e})=>({paddingTop:e.spacing(3),paddingBottom:e.spacing(3)})),J=!1,Y=!1,H={titleText:"",flavour:"push",width:he,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 it({children:e,titleText:t="",leftPanel:n,rightPanel:a,sidePanelsAreMutuallyExclusive:l=!0,debugOpacity:m=!1,pageContainerProps:x,pageContentDataTestId:c,topBarDataTestId:S,navBarOpen:g,navBarWidthOpen:p,navBarWidthClosed:T}){const[O,v]=d.useState(J),[B,_]=d.useState(Y),[k,N]=d.useState(J),[G,h]=d.useState(Y),I=n!==void 0,b=a!==void 0,{titleText:D,content:s,flavour:i,open:A,onChangeOpen:Z,width:U,arrowButtons:L,startOpen:q,onOpened:we,onClosed:me,dataTestId:ve}=n?o(o({},H),n):o({},H),{titleText:ye,content:Ce,flavour:ee,open:W,onChangeOpen:te,width:X,arrowButtons:R,startOpen:$,onOpened:Fe,onClosed:Se,dataTestId:Te}=a?o(o({},H),a):o({},H);d.useEffect(()=>{q!==J&&(v(q),N(q))},[q]),d.useEffect(()=>{$!==Y&&(_($),h($))},[$]);const Q=A===void 0?O:A,V=W===void 0?B:W,ne=y=>{A===void 0&&(v(y),l&&b&&(y?(_(!1),h(B)):_(G))),Z&&Z(y)},re=y=>{W===void 0&&(_(y),l&&I&&(y?(v(!1),N(O)):v(k))),te&&te(y)};return r.jsxs(w.Box,{children:[I&&r.jsx(ce,{"data-testid":ve,anchor:"left",open:Q,onClose:()=>ne(!1),width:U,titleText:D,debugOpacity:m,showCloseArrow:L==="both"||L==="close",onOpened:we,onClosed:me,navBarOpen:g,navBarWidthOpen:p,navBarWidthClosed:T,children:s}),b&&r.jsx(ce,{"data-testid":Te,anchor:"right",open:V,onClose:()=>re(!1),width:X,titleText:ye,debugOpacity:m,showCloseArrow:R==="both"||R==="close",onOpened:Fe,onClosed:Se,navBarOpen:g,navBarWidthOpen:p,navBarWidthClosed:T,children:Ce}),r.jsx(tt,o(o({titleText:t,"data-testid":S},I&&i==="push"?{leftPanel:{open:Q,width:U,onOpen:()=>ne(!0),showOpenArrow:L==="both"||L==="open"}}:{}),b&&ee==="push"?{rightPanel:{open:V,width:X,onOpen:()=>re(!0),showOpenArrow:R==="both"||R==="open"}}:{})),r.jsx(ot,C(o(o({},i==="push"?{leftPanel:{open:Q,width:U}}:{}),ee==="push"?{rightPanel:{open:V,width:X}}:{}),{children:r.jsx(at,C(o({"data-testid":c},x),{children:e}))}))]})}const st=P.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:P.alpha(e.palette.secondary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:P.alpha(e.palette.secondary.main,e.palette.action.selectedOpacity)},"&.Mui-focusVisible":{backgroundColor:P.alpha(e.palette.secondary.main,e.palette.action.focusOpacity)}}})}}},typography:{explainer:{fontSize:"14px",marginBlockStart:"1em"},h3:{fontSize:"1rem",fontWeight:700}}}),lt=P.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 ct({name:e="internal",children:t}){const n=e==="internal"?st:e==="fed21"?lt:void 0;return r.jsx(P.ThemeProvider,{theme:n,children:t})}class z extends Me.AgError{}se(z,"errorName","ContextError");const E=()=>{throw new z("SaladBarContext can only be used in a child of a <SaladBarProvider>")},dt=e=>{throw new z("SaladBarContext can only be used in a child of a <SaladBarProvider>")},ut={enqueueNotification:E,enqueueSuccessNotification:E,enqueueInfoNotification:E,enqueueWarningNotification:E,enqueueErrorNotification:E,removeNotification:dt},xe=d.createContext(ut),pt={autoHideDuration:6e3,anchorOrigin:{vertical:"top",horizontal:"center"},disableWindowBlurListener:!1},ft={shouldClose:(e,t)=>t!=="clickaway"},de={message:"",severity:"info",variant:"standard",progressIndicator:void 0},ue=100,pe=2e3,gt=2e3,ht=(()=>{let e=0;return()=>(e+=1,e)})(),xt={borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"};function wt(a){var l=a,{children:e,shouldClose:t=ft.shouldClose}=l,n=ie(l,["children","shouldClose"]);var D;const[m,x]=d.useState(!1),c=d.useRef([]),S=d.useRef(Date.now()),g=d.useRef(0),p=(s={})=>{g.current+=1,c.current.length>=ue&&Date.now()-S.current>=pe&&(S.current=Date.now(),console.error(`SaladBarProvider: MAX_QUEUE_LENGTH (${ue}) hit ${g.current} times in last ${pe}ms)`),g.current=0);const i=o(C(o({},de),{key:ht()}),s);return c.current.push(i),c.current.length===1&&x(!0),i.key},T=(s="",i={})=>p(o({message:s,severity:"success"},i)),O=(s="",i={})=>p(o({message:s,severity:"info"},i)),v=(s="",i={})=>p(o({message:s,severity:"warning"},i)),B=(s="",i={})=>p(o({message:s,severity:"error"},i)),_=s=>{const i=c.current.findIndex(A=>A.key===s);if(i!==-1)return i===0?(x(!1),c.current[0]):c.current.splice(i,1)},k=(s,i)=>{t(s,i)&&x(!1)},N=()=>{},G=()=>{c.current.shift(),c.current.length>0&&x(!0)},h=(D=c.current[0])!=null?D:o({},de),I={};"autoHideDuration"in h&&(I.autoHideDuration=h.autoHideDuration);const b=o(o({},pt),n);return r.jsxs(xe.Provider,{value:{enqueueNotification:p,enqueueSuccessNotification:T,enqueueInfoNotification:O,enqueueWarningNotification:v,enqueueErrorNotification:B,removeNotification:_},children:[e,r.jsx(Xe.default,C(o(o({},b),I),{open:m,onClose:k,TransitionProps:{onExited:G,onExit:N},sx:{zIndex:gt},children:r.jsxs("div",{children:[r.jsx(Qe.default,{onClose:s=>k(s,"closeAlert"),severity:h.severity,variant:"filled",icon:h.progressIndicator==="circular"?r.jsx(Ke.default,{size:"1em"}):void 0,style:h.progressIndicator==="linear"?xt:void 0,children:h.message}),h.progressIndicator==="linear"&&r.jsx(Ve.default,{color:"primary"})]})}))]})}function mt(){return d.useContext(xe)}exports.AgThemeProvider=ct;exports.ContextError=z;exports.ExampleComponent=Je;exports.PageLayout=it;exports.SaladBarProvider=wt;exports.useSaladBar=mt;
1
+ "use strict";var Oe=Object.defineProperty,Pe=Object.defineProperties;var _e=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,ae=Object.prototype.propertyIsEnumerable;var K=(e,t,n)=>t in e?Oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,o=(e,t)=>{for(var n in t||(t={}))oe.call(t,n)&&K(e,n,t[n]);if(M)for(var n of M(t))ae.call(t,n)&&K(e,n,t[n]);return e},S=(e,t)=>Pe(e,_e(t));var ie=(e,t)=>{var n={};for(var a in e)oe.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&M)for(var a of M(e))t.indexOf(a)<0&&ae.call(e,a)&&(n[a]=e[a]);return n};var se=(e,t,n)=>(K(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),d=require("react"),Ie=require("@mui/material/Button"),be=require("@mui/material/Paper"),Ae=require("@mui/material/Typography"),w=require("@mui/material"),Ee=require("@mui/icons-material/ArrowForward"),je=require("@mui/icons-material/ArrowBack"),ke=require("@mui/material/Drawer"),Ne=require("@mui/material/Box"),De=require("@mui/material/IconButton"),qe=require("@mui/material/Container"),I=require("@mui/material/styles"),Le=require("@mui/material/Snackbar"),Re=require("@mui/material/Alert"),$e=require("@mui/material/LinearProgress"),Me=require("@mui/material/CircularProgress"),He=require("@australiangreens/ag-error"),ze=require("souvlaki"),u=e=>e&&e.__esModule?e:{default:e},Ge=u(Ie),Ue=u(be),j=u(Ae),fe=u(Ee),ge=u(je),We=u(ke),Xe=u(Ne),le=u(De),Qe=u(qe),Ve=u(Le),Ke=u(Re),Je=u($e),Ye=u(Me);function Ze({text:e}){const[t,n]=d.useState(0);return r.jsxs(r.Fragment,{children:[r.jsx(j.default,{variant:"h6",color:"inherit",component:"div",sx:{fontSize:"22px"},children:"Hello world"}),r.jsx(j.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(Ge.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(Ue.default,{children:["This number will incremember when button pressed: ",t]})]})}const et=24,tt=64,C="TopBar",f={topStripe:`${C}-topStripe`,titleBar:`${C}-titleBar`,titleSlider:`${C}-titleSlider`,titleText:`${C}-titleText`,leftPanelButton:`${C}-leftPanelButton`,rightPanelButton:`${C}-leftPanelButton`},nt=w.styled("div",{shouldForwardProp:e=>!["leftPanel","rightPanel"].includes(e),name:C})(({theme:e,leftPanel:t,rightPanel:n})=>{var a,l;return{width:"100%",[`& .${f.topStripe}`]:{width:"100%",height:`${et}px`,backgroundColor:e.palette.primary.main},[`& .${f.titleBar}`]:{backgroundColor:e.palette.primary.light,height:`${tt}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:`${(l=n==null?void 0:n.width)!=null?l:0}px`})}});function rt({titleText:e="",leftPanel:t,rightPanel:n,"data-testid":a}){return r.jsxs(nt,{leftPanel:t,rightPanel:n,"data-testid":a,children:[r.jsx("div",{className:f.topStripe}),r.jsx("div",{className:f.titleBar,children:r.jsxs(w.Box,{className:f.titleSlider,children:[t!==void 0&&!t.open&&t.showOpenArrow&&r.jsxs(w.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(fe.default,{})]}),r.jsx(j.default,{className:f.titleText,variant:"h6",noWrap:!0,children:e}),n!==void 0&&!n.open&&n.showOpenArrow&&r.jsxs(w.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(ge.default,{})]})]})})]})}const he=400,ot=w.styled(We.default,{shouldForwardProp:e=>!["width","debug","debugOpacity","navBarOpen","navBarWidthOpen","navBarWidthClosed"].includes(e),name:"SidePanelDrawer"})(({width:e,debugOpacity:t=!1,anchor:n,navBarOpen:a,navBarWidthOpen:l,navBarWidthClosed:v})=>({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:`${v}px`},a&&{marginLeft:`${l}px`}))})),at=w.styled(Xe.default,{shouldForwardProp:e=>!["anchor"].includes(e)})(({theme:e,anchor:t})=>S(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 ce({children:e,anchor:t="left",open:n,onClose:a=()=>{},titleText:l="",width:v=he,showCloseArrow:x=!0,debugOpacity:c=!1,headerBoxProps:F={},onOpened:g,onClosed:p,"data-testid":T,navBarOpen:B=!1,navBarWidthOpen:m=0,navBarWidthClosed:O=0}){return r.jsxs(ot,{SlideProps:{onEntered:()=>g==null?void 0:g(),onExited:()=>p==null?void 0:p()},variant:"persistent",anchor:t,open:n,width:v,debugOpacity:c,"data-testid":T,navBarOpen:B,navBarWidthOpen:m,navBarWidthClosed:O,children:[r.jsx(at,S(o({anchor:t},F),{children:t==="left"?r.jsxs(r.Fragment,{children:[r.jsx(j.default,{variant:"h6",color:"inherit",component:"div",children:l}),x&&r.jsxs(le.default,{onClick:a,size:"large","aria-label":"Close left side panel",children:[r.jsx(ge.default,{"data-testid":"arrowbackicon"})," "]})]}):r.jsxs(r.Fragment,{children:[x&&r.jsxs(le.default,{onClick:a,size:"large","aria-label":"Close right side panel",children:[r.jsx(fe.default,{})," "]}),r.jsx(j.default,{variant:"h6",color:"inherit",component:"div",children:l})]})})),e]})}const it=w.styled("div",{shouldForwardProp:e=>!["leftPanel","rightPanel"].includes(e),name:"PanelAwareMargins"})(({theme:e,leftPanel:t,rightPanel:n})=>{var a,l;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:`${(l=n==null?void 0:n.width)!=null?l:0}px`})}),st=w.styled(Qe.default,{name:"PageContainer"})(({theme:e})=>({paddingTop:e.spacing(3),paddingBottom:e.spacing(3)})),J=!1,Y=!1,H={titleText:"",flavour:"push",width:he,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 lt({children:e,titleText:t="",leftPanel:n,rightPanel:a,sidePanelsAreMutuallyExclusive:l=!0,debugOpacity:v=!1,pageContainerProps:x,pageContentDataTestId:c,topBarDataTestId:F,navBarOpen:g,navBarWidthOpen:p,navBarWidthClosed:T}){const[B,m]=d.useState(J),[O,P]=d.useState(Y),[k,N]=d.useState(J),[G,h]=d.useState(Y),_=n!==void 0,b=a!==void 0,{titleText:D,content:s,flavour:i,open:A,onChangeOpen:Z,width:U,arrowButtons:q,startOpen:L,onOpened:ve,onClosed:me,dataTestId:ye}=n?o(o({},H),n):o({},H),{titleText:Se,content:Ce,flavour:ee,open:W,onChangeOpen:te,width:X,arrowButtons:R,startOpen:$,onOpened:Fe,onClosed:Te,dataTestId:Be}=a?o(o({},H),a):o({},H);d.useEffect(()=>{L!==J&&(m(L),N(L))},[L]),d.useEffect(()=>{$!==Y&&(P($),h($))},[$]);const Q=A===void 0?B:A,V=W===void 0?O:W,ne=y=>{A===void 0&&(m(y),l&&b&&(y?(P(!1),h(O)):P(G))),Z&&Z(y)},re=y=>{W===void 0&&(P(y),l&&_&&(y?(m(!1),N(B)):m(k))),te&&te(y)};return r.jsxs(w.Box,{children:[_&&r.jsx(ce,{"data-testid":ye,anchor:"left",open:Q,onClose:()=>ne(!1),width:U,titleText:D,debugOpacity:v,showCloseArrow:q==="both"||q==="close",onOpened:ve,onClosed:me,navBarOpen:g,navBarWidthOpen:p,navBarWidthClosed:T,children:s}),b&&r.jsx(ce,{"data-testid":Be,anchor:"right",open:V,onClose:()=>re(!1),width:X,titleText:Se,debugOpacity:v,showCloseArrow:R==="both"||R==="close",onOpened:Fe,onClosed:Te,navBarOpen:g,navBarWidthOpen:p,navBarWidthClosed:T,children:Ce}),r.jsx(rt,o(o({titleText:t,"data-testid":F},_&&i==="push"?{leftPanel:{open:Q,width:U,onOpen:()=>ne(!0),showOpenArrow:q==="both"||q==="open"}}:{}),b&&ee==="push"?{rightPanel:{open:V,width:X,onOpen:()=>re(!0),showOpenArrow:R==="both"||R==="open"}}:{})),r.jsx(it,S(o(o({},i==="push"?{leftPanel:{open:Q,width:U}}:{}),ee==="push"?{rightPanel:{open:V,width:X}}:{}),{children:r.jsx(st,S(o({"data-testid":c},x),{children:e}))}))]})}const ct=I.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:I.alpha(e.palette.secondary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:I.alpha(e.palette.secondary.main,e.palette.action.selectedOpacity)},"&.Mui-focusVisible":{backgroundColor:I.alpha(e.palette.secondary.main,e.palette.action.focusOpacity)}}})}}},typography:{explainer:{fontSize:"14px",marginBlockStart:"1em"},h3:{fontSize:"1rem",fontWeight:700}}}),dt=I.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 ut({name:e="internal",children:t}){const n=e==="internal"?ct:e==="fed21"?dt:void 0;return r.jsx(I.ThemeProvider,{theme:n,children:t})}class z extends He.AgError{}se(z,"errorName","ContextError");const E=()=>{throw new z("SaladBarContext can only be used in a child of a <SaladBarProvider>")},pt=e=>{throw new z("SaladBarContext can only be used in a child of a <SaladBarProvider>")},ft={enqueueNotification:E,enqueueSuccessNotification:E,enqueueInfoNotification:E,enqueueWarningNotification:E,enqueueErrorNotification:E,removeNotification:pt},xe=d.createContext(ft),gt={autoHideDuration:6e3,anchorOrigin:{vertical:"top",horizontal:"center"},disableWindowBlurListener:!1},ht={shouldClose:(e,t)=>t!=="clickaway"},de={message:"",severity:"info",variant:"standard",progressIndicator:void 0},ue=100,pe=2e3,xt=2e3,wt=(()=>{let e=0;return()=>(e+=1,e)})(),vt={borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"};function we(a){var l=a,{children:e,shouldClose:t=ht.shouldClose}=l,n=ie(l,["children","shouldClose"]);var D;const[v,x]=d.useState(!1),c=d.useRef([]),F=d.useRef(Date.now()),g=d.useRef(0),p=(s={})=>{g.current+=1,c.current.length>=ue&&Date.now()-F.current>=pe&&(F.current=Date.now(),console.error(`SaladBarProvider: MAX_QUEUE_LENGTH (${ue}) hit ${g.current} times in last ${pe}ms)`),g.current=0);const i=o(S(o({},de),{key:wt()}),s);return c.current.push(i),c.current.length===1&&x(!0),i.key},T=(s="",i={})=>p(o({message:s,severity:"success"},i)),B=(s="",i={})=>p(o({message:s,severity:"info"},i)),m=(s="",i={})=>p(o({message:s,severity:"warning"},i)),O=(s="",i={})=>p(o({message:s,severity:"error"},i)),P=s=>{const i=c.current.findIndex(A=>A.key===s);if(i!==-1)return i===0?(x(!1),c.current[0]):c.current.splice(i,1)},k=(s,i)=>{t(s,i)&&x(!1)},N=()=>{},G=()=>{c.current.shift(),c.current.length>0&&x(!0)},h=(D=c.current[0])!=null?D:o({},de),_={};"autoHideDuration"in h&&(_.autoHideDuration=h.autoHideDuration);const b=o(o({},gt),n);return r.jsxs(xe.Provider,{value:{enqueueNotification:p,enqueueSuccessNotification:T,enqueueInfoNotification:B,enqueueWarningNotification:m,enqueueErrorNotification:O,removeNotification:P},children:[e,r.jsx(Ve.default,S(o(o({},b),_),{open:v,onClose:k,TransitionProps:{onExited:G,onExit:N},sx:{zIndex:xt},children:r.jsxs("div",{children:[r.jsx(Ke.default,{onClose:s=>k(s,"closeAlert"),severity:h.severity,variant:"filled",icon:h.progressIndicator==="circular"?r.jsx(Ye.default,{size:"1em"}):void 0,style:h.progressIndicator==="linear"?vt:void 0,children:h.message}),h.progressIndicator==="linear"&&r.jsx(Je.default,{color:"primary"})]})}))]})}function mt(){return d.useContext(xe)}const yt=ze.createHelper(()=>({children:e})=>r.jsx(we,{children:e}));exports.AgThemeProvider=ut;exports.ContextError=z;exports.ExampleComponent=Ze;exports.PageLayout=lt;exports.SaladBarProvider=we;exports.useSaladBar=mt;exports.withSaladBarProvider=yt;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/components/ExampleComponent/index.tsx","../../src/components/PageLayout/TopBar.tsx","../../src/components/PageLayout/SidePanel.tsx","../../src/components/PageLayout/PanelAwareMargins.tsx","../../src/components/PageLayout/PageContainer.tsx","../../src/components/PageLayout/index.tsx","../../src/providers/AgTheme/themes.ts","../../src/providers/AgTheme/index.tsx","../../src/errors/ContextError.ts","../../src/providers/SaladBar/SaladBarContext.ts","../../src/providers/SaladBar/defaults.ts","../../src/providers/SaladBar/SaladBarProvider.tsx","../../src/providers/SaladBar/useSaladBar.ts"],"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 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 { 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","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 } from 'react';\n\nimport { ContextError } from '../../errors/ContextError';\n\nconst stub: () => void = () => {\n throw new ContextError('SaladBarContext can only be used in a child of a <SaladBarProvider>');\n};\n\nexport type NotificationType = {\n key: number;\n message: string;\n severity: 'success' | 'info' | 'warning' | 'error' | undefined;\n variant: 'standard' | 'outlined' | 'filled' | undefined;\n progressIndicator: string | undefined;\n autoHideDuration: number | undefined;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst notstub = (key: unknown): NotificationType | NotificationType[] | void => {\n throw new ContextError('SaladBarContext can only be used in a child of a <SaladBarProvider>');\n};\n\ntype SaladBarContextFunction = typeof stub | typeof notstub;\n\ntype SaladBarContextType = {\n enqueueNotification: SaladBarContextFunction; // Call as enqueueNotification(options)\n // where options include message and severity of 'error' ,'warning', 'info' or\n // 'success'\n enqueueSuccessNotification: SaladBarContextFunction; // Call as const key =\n // enqueueSuccessNotification(msg),\n enqueueInfoNotification: SaladBarContextFunction; // Call as const key =\n // enqueueInfoNotification(msg),\n enqueueWarningNotification: SaladBarContextFunction; // Call as const key =\n // enqueueWarningNotification(msg),\n enqueueErrorNotification: SaladBarContextFunction; // Call as const key =\n // enqueueErrorNotification(msg),\n removeNotification: SaladBarContextFunction; // Call as enqueueErrorNotification(key),\n};\n\n// The defaultValue argument is only used when a component does not have a\n// matching Provider above it in the tree. See\n// https://reactjs.org/docs/context.html#reactcreatecontext\n// Using createContext doesn't itself maintain any type of state exactly, it\n// just provides a way for children to access shared references.\nconst defaultValue = {\n enqueueNotification: stub,\n enqueueSuccessNotification: stub,\n enqueueInfoNotification: stub,\n enqueueWarningNotification: stub,\n enqueueErrorNotification: stub,\n removeNotification: notstub,\n} as SaladBarContextType;\n\n/**\n * @returns A SaladBarContext\n */\nconst SaladBarContext = createContext(defaultValue);\n\nexport default SaladBarContext;\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 } from 'react';\nimport Snackbar, { SnackbarProps, SnackbarCloseReason } from '@mui/material/Snackbar';\nimport Alert from '@mui/material/Alert';\nimport LinearProgress from '@mui/material/LinearProgress';\nimport CircularProgress from '@mui/material/CircularProgress';\n\nimport SaladBarContext, { NotificationType } from './SaladBarContext';\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\nexport type SaladBarCloseReason = SnackbarCloseReason | 'closeAlert';\n\nexport interface SaladBarProviderProps extends SnackbarProps {\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 children,\n shouldClose = defaultSaladBarProps.shouldClose,\n ...snackbarProps\n}: SaladBarProviderProps) {\n const [open, setOpen] = useState(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<NotificationType[]>([]);\n\n const limitLastHitAt = useRef(Date.now());\n const limitHitCountSinceLastReport = useRef(0);\n\n const enqueueNotification = (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 NotificationType);\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) setOpen(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: unknown) => {\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 setOpen(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)) setOpen(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) setOpen(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.\n\n const snackbarFinalProps = { ...defaultSnackbarProps, ...snackbarProps };\n\n return (\n // Should be resolved when we move to React >= 18\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n <SaladBarContext.Provider\n value={{\n enqueueNotification,\n enqueueSuccessNotification,\n enqueueInfoNotification,\n enqueueWarningNotification,\n enqueueErrorNotification,\n removeNotification,\n }}\n >\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 </SaladBarContext.Provider>\n );\n}\n","import { useContext } from 'react';\nimport SaladBarContext from './SaladBarContext';\n\n/**\n * Use the `useSaladBar` hook in components to access the enqueueNotification()\n * method to add a snackbar message to queue.\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 default function useSaladBar() {\n return useContext(SaladBarContext);\n}\n"],"names":["ExampleComponent","text","num","setNum","useState","jsxs","Fragment","jsx","Typography","Button","oldNum","Paper","TOP_STRIPE_HEIGHT","TITLE_BAR_HEIGHT","PREFIX","classes","Root","styled","prop","theme","leftPanel","rightPanel","__spreadValues","_a","_b","TopBar","titleText","dataTestId","Box","IconButton","ArrowForwardIcon","ArrowBackIcon","DEFAULT_PANEL_WIDTH","SidePanelDrawer","Drawer","width","debugOpacity","anchor","navBarOpen","navBarWidthOpen","navBarWidthClosed","DrawerHeaderBox","__spreadProps","SidePanel","children","open","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","ContextError","AgError","__publicField","stub","notstub","key","defaultValue","SaladBarContext","createContext","defaultSnackbarProps","defaultSaladBarProps","_event","reason","defaultEnqueueNotificationOptions","MAX_QUEUE_LENGTH","MAX_QUEUE_HIT_REPORT_INTERVAL","SALADBAR_INDEX","generateNotificationKey","previousKey","alertWithLinearProgressStyle","SaladBarProvider","shouldClose","snackbarProps","__objRest","setOpen","queueRef","useRef","limitLastHitAt","limitHitCountSinceLastReport","enqueueNotification","notification","newNotification","enqueueSuccessNotification","message","options","enqueueInfoNotification","enqueueWarningNotification","enqueueErrorNotification","removeNotification","index","x","handleClose","event","handleExit","handleExited","currentNotification","currentNotificationSnackbarProps","snackbarFinalProps","Snackbar","Alert","CircularProgress","LinearProgress","useSaladBar","useContext"],"mappings":"4gDASwB,SAAAA,GAAiB,CAAE,KAAAC,GAA+B,CACxE,KAAM,CAACC,EAAKC,CAAM,EAAIC,W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AA,GAC9CiG,IAICiC,EAAkE,CAAA,EAEpE,qBAAsBD,IACxBC,EAAiC,iBAAmBD,EAAoB,kBAM1E,MAAME,EAAqBnI,IAAA,GAAK6F,IAAyBa,GAEzD,OAIE3H,EAAA,KAAC4G,GAAgB,SAAhB,CACC,MAAO,CACL,oBAAAsB,EACA,2BAAAG,EACA,wBAAAG,EACA,2BAAAC,EACA,yBAAAC,EACA,mBAAAC,CACF,EAEC,SAAA,CAAApG,EACDrC,EAAA,IAACmJ,GAAA,QAAAhH,EAAApB,IAAA,GACKmI,GACAD,GAFL,CAGC,KAAA3G,EACA,QAASsG,EACT,gBAAiB,CACf,SAAUG,EACV,OAAQD,CACV,EACA,GAAI,CAAE,OAAQ3B,EAAe,EAE7B,gBAAC,MACC,CAAA,SAAA,CAAAnH,EAAA,IAACoJ,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,SACtC1B,GACA,OAGL,SAAoB0B,EAAA,OAAA,CACvB,EACCA,EAAoB,oBAAsB,UAAahJ,EAAAA,IAAAsJ,GAAAA,QAAA,CAAe,MAAM,UAAU,CAAA,EACzF,CAAA,EACF,CAAA,CAAA,CACF,CAEJ,CC3LA,SAAwBC,IAAc,CACpC,OAAOC,EAAAA,WAAW9C,EAAe,CACnC"}
1
+ {"version":3,"file":"index.js","sources":["../../src/components/ExampleComponent/index.tsx","../../src/components/PageLayout/TopBar.tsx","../../src/components/PageLayout/SidePanel.tsx","../../src/components/PageLayout/PanelAwareMargins.tsx","../../src/components/PageLayout/PageContainer.tsx","../../src/components/PageLayout/index.tsx","../../src/providers/AgTheme/themes.ts","../../src/providers/AgTheme/index.tsx","../../src/errors/ContextError.ts","../../src/providers/SaladBar/SaladBarContext.ts","../../src/providers/SaladBar/defaults.ts","../../src/providers/SaladBar/SaladBarProvider.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 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 { 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","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 } from 'react';\n\nimport { ContextError } from '../../errors/ContextError';\n\nconst stub: () => void = () => {\n throw new ContextError('SaladBarContext can only be used in a child of a <SaladBarProvider>');\n};\n\nexport type NotificationType = {\n key: number;\n message: string;\n severity: 'success' | 'info' | 'warning' | 'error' | undefined;\n variant: 'standard' | 'outlined' | 'filled' | undefined;\n progressIndicator: string | undefined;\n autoHideDuration: number | undefined;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst notstub = (key: unknown): NotificationType | NotificationType[] | void => {\n throw new ContextError('SaladBarContext can only be used in a child of a <SaladBarProvider>');\n};\n\ntype SaladBarContextFunction = typeof stub | typeof notstub;\n\ntype SaladBarContextType = {\n enqueueNotification: SaladBarContextFunction; // Call as enqueueNotification(options)\n // where options include message and severity of 'error' ,'warning', 'info' or\n // 'success'\n enqueueSuccessNotification: SaladBarContextFunction; // Call as const key =\n // enqueueSuccessNotification(msg),\n enqueueInfoNotification: SaladBarContextFunction; // Call as const key =\n // enqueueInfoNotification(msg),\n enqueueWarningNotification: SaladBarContextFunction; // Call as const key =\n // enqueueWarningNotification(msg),\n enqueueErrorNotification: SaladBarContextFunction; // Call as const key =\n // enqueueErrorNotification(msg),\n removeNotification: SaladBarContextFunction; // Call as enqueueErrorNotification(key),\n};\n\n// The defaultValue argument is only used when a component does not have a\n// matching Provider above it in the tree. See\n// https://reactjs.org/docs/context.html#reactcreatecontext\n// Using createContext doesn't itself maintain any type of state exactly, it\n// just provides a way for children to access shared references.\nconst defaultValue = {\n enqueueNotification: stub,\n enqueueSuccessNotification: stub,\n enqueueInfoNotification: stub,\n enqueueWarningNotification: stub,\n enqueueErrorNotification: stub,\n removeNotification: notstub,\n} as SaladBarContextType;\n\n/**\n * @returns A SaladBarContext\n */\nconst SaladBarContext = createContext(defaultValue);\n\nexport default SaladBarContext;\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 } from 'react';\nimport Snackbar, { SnackbarProps, SnackbarCloseReason } from '@mui/material/Snackbar';\nimport Alert from '@mui/material/Alert';\nimport LinearProgress from '@mui/material/LinearProgress';\nimport CircularProgress from '@mui/material/CircularProgress';\n\nimport SaladBarContext, { NotificationType } from './SaladBarContext';\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\nexport type SaladBarCloseReason = SnackbarCloseReason | 'closeAlert';\n\nexport interface SaladBarProviderProps extends SnackbarProps {\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 children,\n shouldClose = defaultSaladBarProps.shouldClose,\n ...snackbarProps\n}: SaladBarProviderProps) {\n const [open, setOpen] = useState(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<NotificationType[]>([]);\n\n const limitLastHitAt = useRef(Date.now());\n const limitHitCountSinceLastReport = useRef(0);\n\n const enqueueNotification = (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 NotificationType);\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) setOpen(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: unknown) => {\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 setOpen(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)) setOpen(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) setOpen(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.\n\n const snackbarFinalProps = { ...defaultSnackbarProps, ...snackbarProps };\n\n return (\n // Should be resolved when we move to React >= 18\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n <SaladBarContext.Provider\n value={{\n enqueueNotification,\n enqueueSuccessNotification,\n enqueueInfoNotification,\n enqueueWarningNotification,\n enqueueErrorNotification,\n removeNotification,\n }}\n >\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 </SaladBarContext.Provider>\n );\n}\n","import { useContext } from 'react';\nimport SaladBarContext from './SaladBarContext';\n\n/**\n * Use the `useSaladBar` hook in components to access the enqueueNotification()\n * method to add a snackbar message to queue.\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 default function useSaladBar() {\n return useContext(SaladBarContext);\n}\n","/* eslint-disable react/prop-types */\n/* eslint-disable react/display-name */\nimport { createHelper } from 'souvlaki';\n\nimport SaladBarProvider from './SaladBarProvider';\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","TOP_STRIPE_HEIGHT","TITLE_BAR_HEIGHT","PREFIX","classes","Root","styled","prop","theme","leftPanel","rightPanel","__spreadValues","_a","_b","TopBar","titleText","dataTestId","Box","IconButton","ArrowForwardIcon","ArrowBackIcon","DEFAULT_PANEL_WIDTH","SidePanelDrawer","Drawer","width","debugOpacity","anchor","navBarOpen","navBarWidthOpen","navBarWidthClosed","DrawerHeaderBox","__spreadProps","SidePanel","children","open","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","ContextError","AgError","__publicField","stub","notstub","key","defaultValue","SaladBarContext","createContext","defaultSnackbarProps","defaultSaladBarProps","_event","reason","defaultEnqueueNotificationOptions","MAX_QUEUE_LENGTH","MAX_QUEUE_HIT_REPORT_INTERVAL","SALADBAR_INDEX","generateNotificationKey","previousKey","alertWithLinearProgressStyle","SaladBarProvider","shouldClose","snackbarProps","__objRest","setOpen","queueRef","useRef","limitLastHitAt","limitHitCountSinceLastReport","enqueueNotification","notification","newNotification","enqueueSuccessNotification","message","options","enqueueInfoNotification","enqueueWarningNotification","enqueueErrorNotification","removeNotification","index","x","handleClose","event","handleExit","handleExited","currentNotification","currentNotificationSnackbarProps","snackbarFinalProps","Snackbar","Alert","CircularProgress","LinearProgress","useSaladBar","useContext","withSaladBarProvider","createHelper"],"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,EAAI,CAAA,EAIzCqB,GAAsBhI,EAAA4G,EAAS,QAAQ,CAAC,IAAlB,KAAA5G,EAAuBD,EAAA,GAC9CiG,IAICiC,EAAkE,CAAA,EAEpE,qBAAsBD,IACxBC,EAAiC,iBAAmBD,EAAoB,kBAM1E,MAAME,EAAqBnI,IAAA,GAAK6F,IAAyBa,GAEzD,OAIE3H,EAAA,KAAC4G,GAAgB,SAAhB,CACC,MAAO,CACL,oBAAAsB,EACA,2BAAAG,EACA,wBAAAG,EACA,2BAAAC,EACA,yBAAAC,EACA,mBAAAC,CACF,EAEC,SAAA,CAAApG,EACDrC,EAAA,IAACmJ,GAAA,QAAAhH,EAAApB,IAAA,GACKmI,GACAD,GAFL,CAGC,KAAA3G,EACA,QAASsG,EACT,gBAAiB,CACf,SAAUG,EACV,OAAQD,CACV,EACA,GAAI,CAAE,OAAQ3B,EAAe,EAE7B,gBAAC,MACC,CAAA,SAAA,CAAAnH,EAAA,IAACoJ,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,SACtC1B,GACA,OAGL,SAAoB0B,EAAA,OAAA,CACvB,EACCA,EAAoB,oBAAsB,UAAahJ,EAAAA,IAAAsJ,GAAAA,QAAA,CAAe,MAAM,UAAU,CAAA,EACzF,CAAA,EACF,CAAA,CAAA,CACF,CAEJ,CC3LA,SAAwBC,IAAc,CACpC,OAAOC,EAAAA,WAAW9C,EAAe,CACnC,CCnBa,MAAA+C,GAAuBC,GAAAA,aAAa,IAAM,CAAC,CAAE,SAAArH,CACxD,IAAArC,MAACuH,GAAkB,CAAA,SAAAlF,EAAS,CAC7B"}
@@ -9,6 +9,6 @@ declare const PageContainer: import("@emotion/styled").StyledComponent<Pick<{
9
9
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
10
10
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
11
11
  ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
12
- }, keyof import("@mui/material/OverridableComponent").CommonProps | "maxWidth" | "children" | "sx" | "fixed" | "disableGutters">, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "maxWidth" | "translate" | "children" | "sx" | "ref" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "fixed" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
12
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "maxWidth" | "children" | "sx" | "fixed" | "disableGutters">, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "maxWidth" | "translate" | "children" | "sx" | "ref" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "fixed" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
13
13
  export default PageContainer;
14
14
  //# sourceMappingURL=PageContainer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PageContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/PageLayout/PageContainer.tsx"],"names":[],"mappings":";AAGA,0DAA0D;AAC1D,QAAA,MAAM,aAAa;;;;;;;;;8yJAMhB,CAAC;AAEJ,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"PageContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/PageLayout/PageContainer.tsx"],"names":[],"mappings":";AAGA,0DAA0D;AAC1D,QAAA,MAAM,aAAa;;;;;;;;;y1JAMhB,CAAC;AAEJ,eAAe,aAAa,CAAC"}
package/dist/esm/index.js CHANGED
@@ -38,7 +38,8 @@ import Gt from "@mui/material/Alert";
38
38
  import Ut from "@mui/material/LinearProgress";
39
39
  import Wt from "@mui/material/CircularProgress";
40
40
  import { AgError as Xt } from "@australiangreens/ag-error";
41
- function Pe({ text: t }) {
41
+ import { createHelper as jt } from "souvlaki";
42
+ function ke({ text: t }) {
42
43
  const [e, n] = b(0);
43
44
  return /* @__PURE__ */ l(q, { children: [
44
45
  /* @__PURE__ */ i(E, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
@@ -62,14 +63,14 @@ function Pe({ text: t }) {
62
63
  ] })
63
64
  ] });
64
65
  }
65
- const jt = 24, Qt = 64, C = "TopBar", u = {
66
+ const Qt = 24, Vt = 64, C = "TopBar", u = {
66
67
  topStripe: `${C}-topStripe`,
67
68
  titleBar: `${C}-titleBar`,
68
69
  titleSlider: `${C}-titleSlider`,
69
70
  titleText: `${C}-titleText`,
70
71
  leftPanelButton: `${C}-leftPanelButton`,
71
72
  rightPanelButton: `${C}-leftPanelButton`
72
- }, Vt = k("div", {
73
+ }, Kt = k("div", {
73
74
  shouldForwardProp: (t) => !["leftPanel", "rightPanel"].includes(t),
74
75
  name: C
75
76
  })(({ theme: t, leftPanel: e, rightPanel: n }) => {
@@ -78,12 +79,12 @@ const jt = 24, Qt = 64, C = "TopBar", u = {
78
79
  width: "100%",
79
80
  [`& .${u.topStripe}`]: {
80
81
  width: "100%",
81
- height: `${jt}px`,
82
+ height: `${Qt}px`,
82
83
  backgroundColor: t.palette.primary.main
83
84
  },
84
85
  [`& .${u.titleBar}`]: {
85
86
  backgroundColor: t.palette.primary.light,
86
- height: `${Qt}px`,
87
+ height: `${Vt}px`,
87
88
  padding: t.spacing(0, 3),
88
89
  width: "100%"
89
90
  },
@@ -121,13 +122,13 @@ const jt = 24, Qt = 64, C = "TopBar", u = {
121
122
  })
122
123
  };
123
124
  });
124
- function Kt({
125
+ function Jt({
125
126
  titleText: t = "",
126
127
  leftPanel: e,
127
128
  rightPanel: n,
128
129
  "data-testid": o
129
130
  }) {
130
- return /* @__PURE__ */ l(Vt, { leftPanel: e, rightPanel: n, "data-testid": o, children: [
131
+ return /* @__PURE__ */ l(Kt, { leftPanel: e, rightPanel: n, "data-testid": o, children: [
131
132
  /* @__PURE__ */ i("div", { className: u.topStripe }),
132
133
  /* @__PURE__ */ i("div", { className: u.titleBar, children: /* @__PURE__ */ l(xt, { className: u.titleSlider, children: [
133
134
  e !== void 0 && !e.open && e.showOpenArrow && /* @__PURE__ */ l(
@@ -164,7 +165,7 @@ function Kt({
164
165
  ] }) })
165
166
  ] });
166
167
  }
167
- const Ft = 400, Jt = k(_t, {
168
+ const Ft = 400, Yt = k(_t, {
168
169
  shouldForwardProp: (t) => (
169
170
  // Note we do want anchor to be forwarded to the Drawer component
170
171
  ![
@@ -194,7 +195,7 @@ const Ft = 400, Jt = k(_t, {
194
195
  marginLeft: `${c}px`
195
196
  }))
196
197
  })
197
- ), Yt = k(Ht, {
198
+ ), Zt = k(Ht, {
198
199
  shouldForwardProp: (t) => !["anchor"].includes(t)
199
200
  })(({ theme: t, anchor: e }) => v(r({
200
201
  display: "flex",
@@ -233,7 +234,7 @@ function ft({
233
234
  navBarWidthClosed: y = 0
234
235
  }) {
235
236
  return /* @__PURE__ */ l(
236
- Jt,
237
+ Yt,
237
238
  {
238
239
  SlideProps: {
239
240
  onEntered: () => f == null ? void 0 : f(),
@@ -249,7 +250,7 @@ function ft({
249
250
  navBarWidthOpen: x,
250
251
  navBarWidthClosed: y,
251
252
  children: [
252
- /* @__PURE__ */ i(Yt, v(r({ anchor: e }, F), { children: e === "left" ? /* @__PURE__ */ l(q, { children: [
253
+ /* @__PURE__ */ i(Zt, v(r({ anchor: e }, F), { children: e === "left" ? /* @__PURE__ */ l(q, { children: [
253
254
  /* @__PURE__ */ i(E, { variant: "h6", color: "inherit", component: "div", children: c }),
254
255
  h && /* @__PURE__ */ l(ut, { onClick: o, size: "large", "aria-label": "Close left side panel", children: [
255
256
  /* @__PURE__ */ i(vt, { "data-testid": "arrowbackicon" }),
@@ -267,7 +268,7 @@ function ft({
267
268
  }
268
269
  );
269
270
  }
270
- const Zt = k("div", {
271
+ const te = k("div", {
271
272
  shouldForwardProp: (t) => !["leftPanel", "rightPanel"].includes(t),
272
273
  name: "PanelAwareMargins"
273
274
  })(({ theme: t, leftPanel: e, rightPanel: n }) => {
@@ -290,7 +291,7 @@ const Zt = k("div", {
290
291
  }),
291
292
  marginRight: `${(c = n == null ? void 0 : n.width) != null ? c : 0}px`
292
293
  });
293
- }), te = k(Mt, {
294
+ }), ee = k(Mt, {
294
295
  name: "PageContainer"
295
296
  })(({ theme: t }) => ({
296
297
  // Horizontal padding comes from the Container's gutter
@@ -309,7 +310,7 @@ const Zt = k("div", {
309
310
  onClosed: void 0,
310
311
  dataTestId: void 0
311
312
  };
312
- function Ae({
313
+ function Ne({
313
314
  children: t,
314
315
  titleText: e = "",
315
316
  leftPanel: n,
@@ -398,7 +399,7 @@ function Ae({
398
399
  }
399
400
  ),
400
401
  /* @__PURE__ */ i(
401
- Kt,
402
+ Jt,
402
403
  r(r({
403
404
  titleText: e,
404
405
  "data-testid": F
@@ -419,7 +420,7 @@ function Ae({
419
420
  } : {})
420
421
  ),
421
422
  /* @__PURE__ */ i(
422
- Zt,
423
+ te,
423
424
  v(r(r({}, a === "push" ? {
424
425
  leftPanel: {
425
426
  open: j,
@@ -431,12 +432,12 @@ function Ae({
431
432
  width: X
432
433
  }
433
434
  } : {}), {
434
- children: /* @__PURE__ */ i(te, v(r({ "data-testid": d }, h), { children: t }))
435
+ children: /* @__PURE__ */ i(ee, v(r({ "data-testid": d }, h), { children: t }))
435
436
  })
436
437
  )
437
438
  ] });
438
439
  }
439
- const ee = Ct({
440
+ const ne = Ct({
440
441
  palette: {
441
442
  primary: {
442
443
  main: "#007236",
@@ -524,7 +525,7 @@ const ee = Ct({
524
525
  fontWeight: 700
525
526
  }
526
527
  }
527
- }), ne = Ct({
528
+ }), re = Ct({
528
529
  palette: {
529
530
  primary: {
530
531
  dark: "#00A651",
@@ -573,33 +574,33 @@ const ee = Ct({
573
574
  }
574
575
  }
575
576
  });
576
- function Ee({
577
+ function De({
577
578
  name: t = "internal",
578
579
  children: e
579
580
  }) {
580
- return /* @__PURE__ */ i(zt, { theme: t === "internal" ? ee : t === "fed21" ? ne : void 0, children: e });
581
+ return /* @__PURE__ */ i(zt, { theme: t === "internal" ? ne : t === "fed21" ? re : void 0, children: e });
581
582
  }
582
583
  class tt extends Xt {
583
584
  }
584
585
  lt(tt, "errorName", "ContextError");
585
586
  const A = () => {
586
587
  throw new tt("SaladBarContext can only be used in a child of a <SaladBarProvider>");
587
- }, re = (t) => {
588
+ }, oe = (t) => {
588
589
  throw new tt("SaladBarContext can only be used in a child of a <SaladBarProvider>");
589
- }, oe = {
590
+ }, ie = {
590
591
  enqueueNotification: A,
591
592
  enqueueSuccessNotification: A,
592
593
  enqueueInfoNotification: A,
593
594
  enqueueWarningNotification: A,
594
595
  enqueueErrorNotification: A,
595
- removeNotification: re
596
- }, Ot = Dt(oe), ie = {
596
+ removeNotification: oe
597
+ }, Ot = Dt(ie), ae = {
597
598
  autoHideDuration: 6e3,
598
599
  anchorOrigin: { vertical: "top", horizontal: "center" },
599
600
  // The default is false. If we prefer timer to continue when window loses
600
601
  // focus, change to true
601
602
  disableWindowBlurListener: !1
602
- }, ae = {
603
+ }, se = {
603
604
  shouldClose: (t, e) => e !== "clickaway"
604
605
  }, gt = {
605
606
  message: "",
@@ -607,17 +608,17 @@ const A = () => {
607
608
  variant: "standard",
608
609
  progressIndicator: void 0
609
610
  // Can use 'circular' or 'linear'
610
- }, ht = 100, mt = 2e3, se = 2e3, ce = (() => {
611
+ }, ht = 100, mt = 2e3, ce = 2e3, le = (() => {
611
612
  let t = 0;
612
613
  return () => (t += 1, t);
613
- })(), le = {
614
+ })(), de = {
614
615
  borderBottomLeftRadius: "0px",
615
616
  borderBottomRightRadius: "0px"
616
617
  };
617
- function ke(o) {
618
+ function pe(o) {
618
619
  var c = o, {
619
620
  children: t,
620
- shouldClose: e = ae.shouldClose
621
+ shouldClose: e = se.shouldClose
621
622
  } = c, n = ct(c, [
622
623
  "children",
623
624
  "shouldClose"
@@ -628,7 +629,7 @@ function ke(o) {
628
629
  `SaladBarProvider: MAX_QUEUE_LENGTH (${ht}) hit ${f.current} times in last ${mt}ms)`
629
630
  ), f.current = 0);
630
631
  const a = r(v(r({}, gt), {
631
- key: ce()
632
+ key: le()
632
633
  }), s);
633
634
  return d.current.push(a), d.current.length === 1 && h(!0), a.key;
634
635
  }, O = (s = "", a = {}) => p(r({ message: s, severity: "success" }, a)), T = (s = "", a = {}) => p(r({ message: s, severity: "info" }, a)), x = (s = "", a = {}) => p(r({ message: s, severity: "warning" }, a)), y = (s = "", a = {}) => p(r({ message: s, severity: "error" }, a)), S = (s) => {
@@ -642,7 +643,7 @@ function ke(o) {
642
643
  d.current.shift(), d.current.length > 0 && h(!0);
643
644
  }, g = (L = d.current[0]) != null ? L : r({}, gt), B = {};
644
645
  "autoHideDuration" in g && (B.autoHideDuration = g.autoHideDuration);
645
- const I = r(r({}, ie), n);
646
+ const I = r(r({}, ae), n);
646
647
  return (
647
648
  // Should be resolved when we move to React >= 18
648
649
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -669,7 +670,7 @@ function ke(o) {
669
670
  onExited: G,
670
671
  onExit: D
671
672
  },
672
- sx: { zIndex: se },
673
+ sx: { zIndex: ce },
673
674
  children: /* @__PURE__ */ l("div", { children: [
674
675
  /* @__PURE__ */ i(
675
676
  Gt,
@@ -678,7 +679,7 @@ function ke(o) {
678
679
  severity: g.severity,
679
680
  variant: "filled",
680
681
  icon: g.progressIndicator === "circular" ? /* @__PURE__ */ i(Wt, { size: "1em" }) : void 0,
681
- style: g.progressIndicator === "linear" ? le : void 0,
682
+ style: g.progressIndicator === "linear" ? de : void 0,
682
683
  children: g.message
683
684
  }
684
685
  ),
@@ -691,15 +692,17 @@ function ke(o) {
691
692
  )
692
693
  );
693
694
  }
694
- function Ne() {
695
+ function Le() {
695
696
  return Lt(Ot);
696
697
  }
698
+ const $e = jt(() => ({ children: t }) => /* @__PURE__ */ i(pe, { children: t }));
697
699
  export {
698
- Ee as AgThemeProvider,
700
+ De as AgThemeProvider,
699
701
  tt as ContextError,
700
- Pe as ExampleComponent,
701
- Ae as PageLayout,
702
- ke as SaladBarProvider,
703
- Ne as useSaladBar
702
+ ke as ExampleComponent,
703
+ Ne as PageLayout,
704
+ pe as SaladBarProvider,
705
+ Le as useSaladBar,
706
+ $e as withSaladBarProvider
704
707
  };
705
708
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/components/ExampleComponent/index.tsx","../../src/components/PageLayout/TopBar.tsx","../../src/components/PageLayout/SidePanel.tsx","../../src/components/PageLayout/PanelAwareMargins.tsx","../../src/components/PageLayout/PageContainer.tsx","../../src/components/PageLayout/index.tsx","../../src/providers/AgTheme/themes.ts","../../src/providers/AgTheme/index.tsx","../../src/errors/ContextError.ts","../../src/providers/SaladBar/SaladBarContext.ts","../../src/providers/SaladBar/defaults.ts","../../src/providers/SaladBar/SaladBarProvider.tsx","../../src/providers/SaladBar/useSaladBar.ts"],"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 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 { 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","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 } from 'react';\n\nimport { ContextError } from '../../errors/ContextError';\n\nconst stub: () => void = () => {\n throw new ContextError('SaladBarContext can only be used in a child of a <SaladBarProvider>');\n};\n\nexport type NotificationType = {\n key: number;\n message: string;\n severity: 'success' | 'info' | 'warning' | 'error' | undefined;\n variant: 'standard' | 'outlined' | 'filled' | undefined;\n progressIndicator: string | undefined;\n autoHideDuration: number | undefined;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst notstub = (key: unknown): NotificationType | NotificationType[] | void => {\n throw new ContextError('SaladBarContext can only be used in a child of a <SaladBarProvider>');\n};\n\ntype SaladBarContextFunction = typeof stub | typeof notstub;\n\ntype SaladBarContextType = {\n enqueueNotification: SaladBarContextFunction; // Call as enqueueNotification(options)\n // where options include message and severity of 'error' ,'warning', 'info' or\n // 'success'\n enqueueSuccessNotification: SaladBarContextFunction; // Call as const key =\n // enqueueSuccessNotification(msg),\n enqueueInfoNotification: SaladBarContextFunction; // Call as const key =\n // enqueueInfoNotification(msg),\n enqueueWarningNotification: SaladBarContextFunction; // Call as const key =\n // enqueueWarningNotification(msg),\n enqueueErrorNotification: SaladBarContextFunction; // Call as const key =\n // enqueueErrorNotification(msg),\n removeNotification: SaladBarContextFunction; // Call as enqueueErrorNotification(key),\n};\n\n// The defaultValue argument is only used when a component does not have a\n// matching Provider above it in the tree. See\n// https://reactjs.org/docs/context.html#reactcreatecontext\n// Using createContext doesn't itself maintain any type of state exactly, it\n// just provides a way for children to access shared references.\nconst defaultValue = {\n enqueueNotification: stub,\n enqueueSuccessNotification: stub,\n enqueueInfoNotification: stub,\n enqueueWarningNotification: stub,\n enqueueErrorNotification: stub,\n removeNotification: notstub,\n} as SaladBarContextType;\n\n/**\n * @returns A SaladBarContext\n */\nconst SaladBarContext = createContext(defaultValue);\n\nexport default SaladBarContext;\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 } from 'react';\nimport Snackbar, { SnackbarProps, SnackbarCloseReason } from '@mui/material/Snackbar';\nimport Alert from '@mui/material/Alert';\nimport LinearProgress from '@mui/material/LinearProgress';\nimport CircularProgress from '@mui/material/CircularProgress';\n\nimport SaladBarContext, { NotificationType } from './SaladBarContext';\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\nexport type SaladBarCloseReason = SnackbarCloseReason | 'closeAlert';\n\nexport interface SaladBarProviderProps extends SnackbarProps {\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 children,\n shouldClose = defaultSaladBarProps.shouldClose,\n ...snackbarProps\n}: SaladBarProviderProps) {\n const [open, setOpen] = useState(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<NotificationType[]>([]);\n\n const limitLastHitAt = useRef(Date.now());\n const limitHitCountSinceLastReport = useRef(0);\n\n const enqueueNotification = (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 NotificationType);\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) setOpen(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: unknown) => {\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 setOpen(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)) setOpen(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) setOpen(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.\n\n const snackbarFinalProps = { ...defaultSnackbarProps, ...snackbarProps };\n\n return (\n // Should be resolved when we move to React >= 18\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n <SaladBarContext.Provider\n value={{\n enqueueNotification,\n enqueueSuccessNotification,\n enqueueInfoNotification,\n enqueueWarningNotification,\n enqueueErrorNotification,\n removeNotification,\n }}\n >\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 </SaladBarContext.Provider>\n );\n}\n","import { useContext } from 'react';\nimport SaladBarContext from './SaladBarContext';\n\n/**\n * Use the `useSaladBar` hook in components to access the enqueueNotification()\n * method to add a snackbar message to queue.\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 default function useSaladBar() {\n return useContext(SaladBarContext);\n}\n"],"names":["ExampleComponent","text","num","setNum","useState","jsxs","Fragment","jsx","Typography","Button","oldNum","Paper","TOP_STRIPE_HEIGHT","TITLE_BAR_HEIGHT","PREFIX","classes","Root","styled","prop","theme","leftPanel","rightPanel","__spreadValues","_a","_b","TopBar","titleText","dataTestId","Box","IconButton","ArrowForwardIcon","ArrowBackIcon","DEFAULT_PANEL_WIDTH","SidePanelDrawer","Drawer","width","debugOpacity","anchor","navBarOpen","navBarWidthOpen","navBarWidthClosed","DrawerHeaderBox","__spreadProps","SidePanel","children","open","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","ContextError","AgError","__publicField","stub","notstub","key","defaultValue","SaladBarContext","createContext","defaultSnackbarProps","defaultSaladBarProps","_event","reason","defaultEnqueueNotificationOptions","MAX_QUEUE_LENGTH","MAX_QUEUE_HIT_REPORT_INTERVAL","SALADBAR_INDEX","generateNotificationKey","previousKey","alertWithLinearProgressStyle","SaladBarProvider","shouldClose","snackbarProps","__objRest","setOpen","queueRef","useRef","limitLastHitAt","limitHitCountSinceLastReport","enqueueNotification","notification","newNotification","enqueueSuccessNotification","message","options","enqueueInfoNotification","enqueueWarningNotification","enqueueErrorNotification","removeNotification","index","x","handleClose","event","handleExit","handleExited","currentNotification","currentNotificationSnackbarProps","snackbarFinalProps","Snackbar","Alert","CircularProgress","LinearProgress","useSaladBar","useContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASwB,SAAAA,GAAiB,EAAE,MAAAC,KAA+B;AACxE,QAAM,CAACC,GAAKC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UG;AAAA,gBACV,QAAQD;AAAA,cACV;AAAA,cACA,IAAI,EAAE,QAAQ3B,GAAe;AAAA,cAE7B,4BAAC,OACC,EAAA,UAAA;AAAA,gBAAA,gBAAAnH;AAAA,kBAACoJ;AAAA,kBAAA;AAAA,oBACC,SAAS,CAACP,MAAUD,EAAYC,GAAO,YAAY;AAAA,oBACnD,UAAUG,EAAoB;AAAA,oBAC9B,SAAS;AAAA,oBACT,MACEA,EAAoB,sBAAsB,+BACvCK,IAAiB,EAAA,MAAK,OAAM,IAC3B;AAAA,oBAEN,OACEL,EAAoB,sBAAsB,WACtC1B,KACA;AAAA,oBAGL,UAAoB0B,EAAA;AAAA,kBAAA;AAAA,gBACvB;AAAA,gBACCA,EAAoB,sBAAsB,YAAa,gBAAAhJ,EAAAsJ,IAAA,EAAe,OAAM,WAAU;AAAA,cAAA,GACzF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA;AAEJ;AC3LA,SAAwBC,KAAc;AACpC,SAAOC,GAAW9C,EAAe;AACnC;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/components/ExampleComponent/index.tsx","../../src/components/PageLayout/TopBar.tsx","../../src/components/PageLayout/SidePanel.tsx","../../src/components/PageLayout/PanelAwareMargins.tsx","../../src/components/PageLayout/PageContainer.tsx","../../src/components/PageLayout/index.tsx","../../src/providers/AgTheme/themes.ts","../../src/providers/AgTheme/index.tsx","../../src/errors/ContextError.ts","../../src/providers/SaladBar/SaladBarContext.ts","../../src/providers/SaladBar/defaults.ts","../../src/providers/SaladBar/SaladBarProvider.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 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 { 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","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 } from 'react';\n\nimport { ContextError } from '../../errors/ContextError';\n\nconst stub: () => void = () => {\n throw new ContextError('SaladBarContext can only be used in a child of a <SaladBarProvider>');\n};\n\nexport type NotificationType = {\n key: number;\n message: string;\n severity: 'success' | 'info' | 'warning' | 'error' | undefined;\n variant: 'standard' | 'outlined' | 'filled' | undefined;\n progressIndicator: string | undefined;\n autoHideDuration: number | undefined;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst notstub = (key: unknown): NotificationType | NotificationType[] | void => {\n throw new ContextError('SaladBarContext can only be used in a child of a <SaladBarProvider>');\n};\n\ntype SaladBarContextFunction = typeof stub | typeof notstub;\n\ntype SaladBarContextType = {\n enqueueNotification: SaladBarContextFunction; // Call as enqueueNotification(options)\n // where options include message and severity of 'error' ,'warning', 'info' or\n // 'success'\n enqueueSuccessNotification: SaladBarContextFunction; // Call as const key =\n // enqueueSuccessNotification(msg),\n enqueueInfoNotification: SaladBarContextFunction; // Call as const key =\n // enqueueInfoNotification(msg),\n enqueueWarningNotification: SaladBarContextFunction; // Call as const key =\n // enqueueWarningNotification(msg),\n enqueueErrorNotification: SaladBarContextFunction; // Call as const key =\n // enqueueErrorNotification(msg),\n removeNotification: SaladBarContextFunction; // Call as enqueueErrorNotification(key),\n};\n\n// The defaultValue argument is only used when a component does not have a\n// matching Provider above it in the tree. See\n// https://reactjs.org/docs/context.html#reactcreatecontext\n// Using createContext doesn't itself maintain any type of state exactly, it\n// just provides a way for children to access shared references.\nconst defaultValue = {\n enqueueNotification: stub,\n enqueueSuccessNotification: stub,\n enqueueInfoNotification: stub,\n enqueueWarningNotification: stub,\n enqueueErrorNotification: stub,\n removeNotification: notstub,\n} as SaladBarContextType;\n\n/**\n * @returns A SaladBarContext\n */\nconst SaladBarContext = createContext(defaultValue);\n\nexport default SaladBarContext;\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 } from 'react';\nimport Snackbar, { SnackbarProps, SnackbarCloseReason } from '@mui/material/Snackbar';\nimport Alert from '@mui/material/Alert';\nimport LinearProgress from '@mui/material/LinearProgress';\nimport CircularProgress from '@mui/material/CircularProgress';\n\nimport SaladBarContext, { NotificationType } from './SaladBarContext';\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\nexport type SaladBarCloseReason = SnackbarCloseReason | 'closeAlert';\n\nexport interface SaladBarProviderProps extends SnackbarProps {\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 children,\n shouldClose = defaultSaladBarProps.shouldClose,\n ...snackbarProps\n}: SaladBarProviderProps) {\n const [open, setOpen] = useState(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<NotificationType[]>([]);\n\n const limitLastHitAt = useRef(Date.now());\n const limitHitCountSinceLastReport = useRef(0);\n\n const enqueueNotification = (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 NotificationType);\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) setOpen(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: unknown) => {\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 setOpen(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)) setOpen(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) setOpen(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.\n\n const snackbarFinalProps = { ...defaultSnackbarProps, ...snackbarProps };\n\n return (\n // Should be resolved when we move to React >= 18\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n <SaladBarContext.Provider\n value={{\n enqueueNotification,\n enqueueSuccessNotification,\n enqueueInfoNotification,\n enqueueWarningNotification,\n enqueueErrorNotification,\n removeNotification,\n }}\n >\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 </SaladBarContext.Provider>\n );\n}\n","import { useContext } from 'react';\nimport SaladBarContext from './SaladBarContext';\n\n/**\n * Use the `useSaladBar` hook in components to access the enqueueNotification()\n * method to add a snackbar message to queue.\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 default function useSaladBar() {\n return useContext(SaladBarContext);\n}\n","/* eslint-disable react/prop-types */\n/* eslint-disable react/display-name */\nimport { createHelper } from 'souvlaki';\n\nimport SaladBarProvider from './SaladBarProvider';\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","TOP_STRIPE_HEIGHT","TITLE_BAR_HEIGHT","PREFIX","classes","Root","styled","prop","theme","leftPanel","rightPanel","__spreadValues","_a","_b","TopBar","titleText","dataTestId","Box","IconButton","ArrowForwardIcon","ArrowBackIcon","DEFAULT_PANEL_WIDTH","SidePanelDrawer","Drawer","width","debugOpacity","anchor","navBarOpen","navBarWidthOpen","navBarWidthClosed","DrawerHeaderBox","__spreadProps","SidePanel","children","open","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","ContextError","AgError","__publicField","stub","notstub","key","defaultValue","SaladBarContext","createContext","defaultSnackbarProps","defaultSaladBarProps","_event","reason","defaultEnqueueNotificationOptions","MAX_QUEUE_LENGTH","MAX_QUEUE_HIT_REPORT_INTERVAL","SALADBAR_INDEX","generateNotificationKey","previousKey","alertWithLinearProgressStyle","SaladBarProvider","shouldClose","snackbarProps","__objRest","setOpen","queueRef","useRef","limitLastHitAt","limitHitCountSinceLastReport","enqueueNotification","notification","newNotification","enqueueSuccessNotification","message","options","enqueueInfoNotification","enqueueWarningNotification","enqueueErrorNotification","removeNotification","index","x","handleClose","event","handleExit","handleExited","currentNotification","currentNotificationSnackbarProps","snackbarFinalProps","Snackbar","Alert","CircularProgress","LinearProgress","useSaladBar","useContext","withSaladBarProvider","createHelper"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASwB,SAAAA,GAAiB,EAAE,MAAAC,KAA+B;AACxE,QAAM,CAACC,GAAKC,CAAM,IAAIC,EAAS,CAAC;AAEhC,SAEI,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAW,EAAA,SAAQ,MAAK,OAAM,WAAU,WAAU,O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J;AAAA,kBAAA;AAAA,oBACC,SAAS,CAACP,MAAUD,EAAYC,GAAO,YAAY;AAAA,oBACnD,UAAUG,EAAoB;AAAA,oBAC9B,SAAS;AAAA,oBACT,MACEA,EAAoB,sBAAsB,+BACvCK,IAAiB,EAAA,MAAK,OAAM,IAC3B;AAAA,oBAEN,OACEL,EAAoB,sBAAsB,WACtC1B,KACA;AAAA,oBAGL,UAAoB0B,EAAA;AAAA,kBAAA;AAAA,gBACvB;AAAA,gBACCA,EAAoB,sBAAsB,YAAa,gBAAAhJ,EAAAsJ,IAAA,EAAe,OAAM,WAAU;AAAA,cAAA,GACzF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA;AAEJ;AC3LA,SAAwBC,KAAc;AACpC,SAAOC,GAAW9C,EAAe;AACnC;ACnBa,MAAA+C,KAAuBC,GAAa,MAAM,CAAC,EAAE,UAAArH,EACxD,MAAA,gBAAArC,EAACuH,IAAkB,EAAA,UAAAlF,GAAS,CAC7B;"}
@@ -1,3 +1,4 @@
1
1
  export { default as default } from './SaladBarProvider';
2
2
  export { default as useSaladBar } from './useSaladBar';
3
+ export * from './testWrappers';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/providers/SaladBar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/providers/SaladBar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const withSaladBarProvider: import("souvlaki").SimpleHelper<[]>;
2
+ //# sourceMappingURL=testWrappers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testWrappers.d.ts","sourceRoot":"","sources":["../../../../src/providers/SaladBar/testWrappers.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,oBAAoB,qCAE/B,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@australiangreens/ag-internal-components",
3
3
  "private": false,
4
- "version": "0.0.25",
4
+ "version": "0.0.26",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/australiangreens/ag-internal-components#readme",
7
7
  "license": "MIT",
@@ -38,7 +38,8 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@australiangreens/ag-error": "^0.1.7",
41
- "@australiangreens/ag-error-jest": "^0.1.9"
41
+ "@australiangreens/ag-error-jest": "^0.1.9",
42
+ "souvlaki": "^0.3.0"
42
43
  },
43
44
  "peerDependencies": {
44
45
  "@emotion/react": "11.10.5",
@@ -60,7 +61,7 @@
60
61
  "@testing-library/react": "12.1.2",
61
62
  "@testing-library/user-event": "^14.4.3",
62
63
  "@types/node": "16.18.0",
63
- "@types/react": "17.0.2",
64
+ "@types/react": "18.0.26",
64
65
  "@types/react-dom": "^18.2.4",
65
66
  "@types/react-test-renderer": "^18.0.0",
66
67
  "@typescript-eslint/eslint-plugin": "^5.59.8",