@australiangreens/ag-internal-components 0.0.28 → 0.0.30

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.
Files changed (59) hide show
  1. package/README.md +24 -0
  2. package/dist/cjs/index.js +1 -1
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/components/ExampleComponent/index.d.ts.map +1 -1
  5. package/dist/components/NavBar/NavBarContext.d.ts +1 -0
  6. package/dist/components/NavBar/NavBarContext.d.ts.map +1 -1
  7. package/dist/components/NavBar/NavBarLightStyledList.d.ts +2 -0
  8. package/dist/components/NavBar/NavBarLightStyledList.d.ts.map +1 -0
  9. package/dist/components/NavBar/Styling.d.ts.map +1 -1
  10. package/dist/components/NavBar/index.d.ts +1 -0
  11. package/dist/components/NavBar/index.d.ts.map +1 -1
  12. package/dist/esm/index.js +731 -563
  13. package/dist/esm/index.js.map +1 -1
  14. package/dist/index.d.ts +6 -1
  15. package/dist/layouts/AppLayout/AppLayout.d.ts +35 -0
  16. package/dist/layouts/AppLayout/AppLayout.d.ts.map +1 -0
  17. package/dist/layouts/AppLayout/AppLayoutContext.d.ts +39 -0
  18. package/dist/layouts/AppLayout/AppLayoutContext.d.ts.map +1 -0
  19. package/dist/layouts/AppLayout/NavBar/LinksMenu.d.ts +6 -0
  20. package/dist/layouts/AppLayout/NavBar/LinksMenu.d.ts.map +1 -0
  21. package/dist/layouts/AppLayout/NavBar/NavBar.d.ts +44 -0
  22. package/dist/layouts/AppLayout/NavBar/NavBar.d.ts.map +1 -0
  23. package/dist/layouts/AppLayout/NavBar/Styling.d.ts +18 -0
  24. package/dist/layouts/AppLayout/NavBar/Styling.d.ts.map +1 -0
  25. package/dist/layouts/AppLayout/NavBar/index.d.ts +4 -0
  26. package/dist/layouts/AppLayout/NavBar/index.d.ts.map +1 -0
  27. package/dist/layouts/AppLayout/NavBar/types.d.ts +7 -0
  28. package/dist/layouts/AppLayout/NavBar/types.d.ts.map +1 -0
  29. package/dist/layouts/AppLayout/PageContainer.d.ts +7 -0
  30. package/dist/layouts/AppLayout/PageContainer.d.ts.map +1 -0
  31. package/dist/layouts/AppLayout/TopBar.d.ts +15 -0
  32. package/dist/layouts/AppLayout/TopBar.d.ts.map +1 -0
  33. package/dist/layouts/AppLayout/appLayoutContextStateReducer.d.ts +26 -0
  34. package/dist/layouts/AppLayout/appLayoutContextStateReducer.d.ts.map +1 -0
  35. package/dist/layouts/AppLayout/defaults.d.ts +5 -0
  36. package/dist/layouts/AppLayout/defaults.d.ts.map +1 -0
  37. package/dist/layouts/AppLayout/index.d.ts +3 -0
  38. package/dist/layouts/AppLayout/index.d.ts.map +1 -0
  39. package/dist/layouts/PageLayout/PageContainer.d.ts.map +1 -1
  40. package/dist/layouts/PageLayout/SidePanel.d.ts +1 -1
  41. package/dist/layouts/PageLayout/SidePanel.d.ts.map +1 -1
  42. package/dist/layouts/PageLayout/TopBar.d.ts.map +1 -1
  43. package/dist/layouts/PageLayout/index.d.ts +15 -1
  44. package/dist/layouts/PageLayout/index.d.ts.map +1 -1
  45. package/dist/layouts/index.d.ts +2 -0
  46. package/dist/layouts/index.d.ts.map +1 -1
  47. package/dist/providers/SaladBar/SaladBarContext.d.ts +1 -1
  48. package/dist/providers/SaladBar/SaladBarContext.d.ts.map +1 -1
  49. package/dist/providers/SaladBar/types.d.ts +1 -1
  50. package/dist/providers/SaladBar/types.d.ts.map +1 -1
  51. package/dist/providers/index.d.ts +0 -2
  52. package/dist/providers/index.d.ts.map +1 -1
  53. package/dist/themes/types.d.ts +13 -0
  54. package/dist/themes/types.d.ts.map +1 -0
  55. package/package.json +6 -4
  56. package/dist/providers/AgTheme/index.d.ts +0 -7
  57. package/dist/providers/AgTheme/index.d.ts.map +0 -1
  58. package/dist/providers/AgTheme/themes.d.ts +0 -3
  59. package/dist/providers/AgTheme/themes.d.ts.map +0 -1
package/dist/esm/index.js CHANGED
@@ -1,146 +1,139 @@
1
- var Gt = Object.defineProperty, Ut = Object.defineProperties;
2
- var qt = Object.getOwnPropertyDescriptors;
3
- var W = Object.getOwnPropertySymbols;
4
- var dt = Object.prototype.hasOwnProperty, ct = Object.prototype.propertyIsEnumerable;
5
- var J = (t, e, n) => e in t ? Gt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, r = (t, e) => {
6
- for (var n in e || (e = {}))
7
- dt.call(e, n) && J(t, n, e[n]);
8
- if (W)
9
- for (var n of W(e))
10
- ct.call(e, n) && J(t, n, e[n]);
11
- return t;
12
- }, C = (t, e) => Ut(t, qt(e));
13
- var pt = (t, e) => {
1
+ var Je = Object.defineProperty, Ze = Object.defineProperties;
2
+ var et = Object.getOwnPropertyDescriptors;
3
+ var V = Object.getOwnPropertySymbols;
4
+ var fe = Object.prototype.hasOwnProperty, xe = Object.prototype.propertyIsEnumerable;
5
+ var ie = (e, t, n) => t in e ? Je(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, r = (e, t) => {
6
+ for (var n in t || (t = {}))
7
+ fe.call(t, n) && ie(e, n, t[n]);
8
+ if (V)
9
+ for (var n of V(t))
10
+ xe.call(t, n) && ie(e, n, t[n]);
11
+ return e;
12
+ }, h = (e, t) => Ze(e, et(t));
13
+ var Be = (e, t) => {
14
14
  var n = {};
15
- for (var o in t)
16
- dt.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
17
- if (t != null && W)
18
- for (var o of W(t))
19
- e.indexOf(o) < 0 && ct.call(t, o) && (n[o] = t[o]);
15
+ for (var i in e)
16
+ fe.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]);
17
+ if (e != null && V)
18
+ for (var i of V(e))
19
+ t.indexOf(i) < 0 && xe.call(e, i) && (n[i] = e[i]);
20
20
  return n;
21
21
  };
22
- var ut = (t, e, n) => (J(t, typeof e != "symbol" ? e + "" : e, n), n);
23
- import { jsxs as c, Fragment as U, jsx as i } from "react/jsx-runtime";
24
- import { useState as S, createContext as Bt, useCallback as nt, useContext as Ot, useEffect as gt, useRef as Y } from "react";
25
- import Xt from "@mui/material/Button";
26
- import Vt from "@mui/material/Paper";
27
- import D from "@mui/material/Typography";
28
- import jt from "@mui/material/CssBaseline";
29
- import { styled as rt, createTheme as Tt, alpha as Z, ThemeProvider as Qt } from "@mui/material/styles";
30
- import St from "@mui/material/Drawer";
31
- import { AgError as Kt } from "@australiangreens/ag-error";
32
- import { createHelper as bt } from "souvlaki";
33
- import Jt from "@mui/material/List";
34
- import { styled as L, Box as yt, IconButton as ft } from "@mui/material";
35
- import It from "@mui/icons-material/ArrowForward";
36
- import Ft from "@mui/icons-material/ArrowBack";
37
- import Yt from "@mui/material/Box";
38
- import ht from "@mui/material/IconButton";
39
- import Zt from "@mui/material/Container";
40
- import te from "@mui/material/Snackbar";
41
- import ee from "@mui/material/Alert";
42
- import ne from "@mui/material/LinearProgress";
43
- import re from "@mui/material/CircularProgress";
44
- function Ze({ text: t }) {
45
- const [e, n] = S(0);
46
- return /* @__PURE__ */ c(U, { children: [
47
- /* @__PURE__ */ i(D, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
48
- /* @__PURE__ */ i(D, { variant: "caption", display: "block", children: /* @__PURE__ */ i("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
49
- /* @__PURE__ */ i(
50
- Xt,
22
+ var we = (e, t, n) => (ie(e, typeof t != "symbol" ? t + "" : t, n), n);
23
+ import { jsxs as l, Fragment as Q, jsx as o } from "react/jsx-runtime";
24
+ import { useState as $, createContext as le, useCallback as Y, useContext as ce, useEffect as K, useReducer as tt, useMemo as nt, useRef as ae } from "react";
25
+ import { Typography as A, Button as rt, Paper as pe, styled as W, Box as O, IconButton as M, Drawer as ot, Container as Se, Divider as Te, CssBaseline as it, Snackbar as at, Alert as st, CircularProgress as dt, LinearProgress as lt } from "@mui/material";
26
+ import ct from "@mui/material/CssBaseline";
27
+ import { styled as E } from "@mui/material/styles";
28
+ import Le from "@mui/material/Drawer";
29
+ import { AgError as pt } from "@australiangreens/ag-error";
30
+ import { createHelper as Ae } from "souvlaki";
31
+ import Ee from "@mui/material/List";
32
+ import { ArrowForward as Pe, ArrowBack as ke, ViewHeadline as ut } from "@mui/icons-material";
33
+ function hn({ text: e }) {
34
+ const [t, n] = $(0);
35
+ return /* @__PURE__ */ l(Q, { children: [
36
+ /* @__PURE__ */ o(A, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
37
+ /* @__PURE__ */ o(A, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
38
+ /* @__PURE__ */ o(
39
+ rt,
51
40
  {
52
41
  variant: "outlined",
53
- onClick: () => n((o) => o + 1),
42
+ onClick: () => n((i) => i + 1),
54
43
  "aria-label": "Increment",
55
44
  children: "Hello I am a button"
56
45
  }
57
46
  ),
58
- /* @__PURE__ */ c("p", { children: [
47
+ /* @__PURE__ */ l("p", { children: [
59
48
  "This is some text: ",
60
- /* @__PURE__ */ i("span", { children: t })
49
+ /* @__PURE__ */ o("span", { children: e })
61
50
  ] }),
62
- /* @__PURE__ */ c(Vt, { children: [
51
+ /* @__PURE__ */ l(pe, { children: [
63
52
  "This number will incremember when button pressed: ",
64
- e
53
+ t
65
54
  ] })
66
55
  ] });
67
56
  }
68
- const At = 330, Pt = 73, O = "Navbar", A = {
69
- root: `${O}-root`,
70
- menuButton: `${O}-menuButton`,
71
- hide: `${O}-hide`,
72
- content: `${O}-content`,
73
- userInfoHolder: `${O}-userInfoHolder`,
74
- settings: `${O}-settings`,
75
- pieChartIcon: `${O}-pieChartIcon`
76
- }, oe = rt("div", { name: "NavBar" })(({ theme: t }) => ({
77
- [`&.${A.root}`]: {
57
+ const De = 330, _e = 73, I = "Navbar", L = {
58
+ root: `${I}-root`,
59
+ menuButton: `${I}-menuButton`,
60
+ hide: `${I}-hide`,
61
+ content: `${I}-content`,
62
+ userInfoHolder: `${I}-userInfoHolder`,
63
+ settings: `${I}-settings`,
64
+ pieChartIcon: `${I}-pieChartIcon`
65
+ }, ht = E("div", { name: "NavBar" })(({ theme: e }) => ({
66
+ [`&.${L.root}`]: {
78
67
  display: "flex"
79
68
  },
80
- [`& .${A.menuButton}`]: {
69
+ [`& .${L.menuButton}`]: {
81
70
  marginRight: 36
82
71
  },
83
- [`& .${A.hide}`]: {
72
+ [`& .${L.hide}`]: {
84
73
  display: "none"
85
74
  },
86
- [`& .${A.content}`]: {
75
+ [`& .${L.content}`]: {
87
76
  flexGrow: 1,
88
- padding: t.spacing(3)
77
+ padding: e.spacing(3)
89
78
  },
90
- [`& .${A.userInfoHolder}`]: {
79
+ [`& .${L.userInfoHolder}`]: {
91
80
  height: "148px",
92
81
  marginTop: "64px",
93
82
  marginBottom: "16px"
94
83
  }
95
- })), kt = () => ({
84
+ })), He = () => ({
96
85
  position: "absolute",
97
86
  height: "100%",
98
87
  overflowX: "hidden",
99
88
  overflowY: "hidden",
100
89
  color: "white",
101
90
  backgroundColor: "black"
102
- }), ie = () => r({
103
- width: At
104
- }, kt()), ae = () => r({
105
- width: Pt
106
- }, kt()), se = rt(St, {
107
- shouldForwardProp: (t) => t !== "open"
108
- })(({ theme: t, open: e }) => r(r({
109
- width: e ? At : Pt,
91
+ // backgroundColor: '#e8e8e8',
92
+ }), gt = () => r({
93
+ width: De
94
+ }, He()), vt = () => r({
95
+ width: _e
96
+ }, He()), ft = E(Le, {
97
+ shouldForwardProp: (e) => e !== "open"
98
+ })(({ theme: e, open: t }) => r(r({
99
+ width: t ? De : _e,
110
100
  flexShrink: 0,
111
101
  whiteSpace: "nowrap",
112
102
  boxSizing: "border-box",
113
- zIndex: t.zIndex.drawer + 100
114
- }, e && {
115
- "& .MuiDrawer-paper": ie()
116
- }), !e && {
117
- "& .MuiDrawer-paper": ae()
103
+ zIndex: e.zIndex.drawer + 100
104
+ }, t && {
105
+ "& .MuiDrawer-paper": gt()
106
+ }), !t && {
107
+ "& .MuiDrawer-paper": vt()
118
108
  }));
119
- class ot extends Kt {
109
+ class J extends pt {
120
110
  }
121
- ut(ot, "errorName", "ContextError");
122
- const Et = Bt(null), le = {}, de = {}, ce = ({
123
- overrideState: t = le,
124
- overrideActions: e = de,
111
+ we(J, "errorName", "ContextError");
112
+ const Re = le(null), xt = {}, Bt = {}, wt = ({
113
+ overrideState: e = xt,
114
+ overrideActions: t = Bt,
125
115
  children: n
126
116
  }) => {
127
- const [{ open: o }, l] = S({ open: !0 }), g = nt((x) => {
128
- l({ open: x });
117
+ const [{ open: i }, a] = $({ open: !0 }), v = Y((u) => {
118
+ a({ open: u });
119
+ }, []), g = Y(() => {
120
+ a((u) => h(r({}, u), { open: !u.open }));
129
121
  }, []), f = r(r({
130
- open: o,
131
- setOpen: g
132
- }, t), e);
133
- return /* @__PURE__ */ i(Et.Provider, { value: f, children: n });
134
- }, pe = () => {
135
- const t = Ot(Et);
136
- if (t === null)
137
- throw new ot("Error: Tried to useNavBar outside of a <NavBarProvider>");
138
- return t;
139
- }, ue = (t = {}) => r({
122
+ open: i,
123
+ setOpen: v,
124
+ toggleOpen: g
125
+ }, e), t);
126
+ return /* @__PURE__ */ o(Re.Provider, { value: f, children: n });
127
+ }, Tt = () => {
128
+ const e = ce(Re);
129
+ if (e === null)
130
+ throw new J("Error: Tried to useNavBar outside of a <NavBarProvider>");
131
+ return e;
132
+ }, Ot = (e = {}) => r({
140
133
  open: !0
141
- }, t), tn = bt(
142
- (t = ue(), e = {}) => ({ children: n }) => /* @__PURE__ */ i(ce, { overrideState: t, overrideActions: e, children: n })
143
- ), mt = 7, en = rt(Jt)(({ theme: t }) => ({
134
+ }, e), gn = Ae(
135
+ (e = Ot(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(wt, { overrideState: e, overrideActions: t, children: n })
136
+ ), Oe = 7, vn = E(Ee)(({ theme: e }) => ({
144
137
  backgroundColor: "black",
145
138
  color: "white",
146
139
  "& .MuiListItem-root": {
@@ -149,143 +142,181 @@ const Et = Bt(null), le = {}, de = {}, ce = ({
149
142
  "& .MuiListItemButton-root": {
150
143
  " .MuiListItemIcon-root": {
151
144
  color: "white",
152
- padding: `${mt}px`
145
+ padding: `${Oe}px`
153
146
  },
154
147
  // Focus state
155
148
  "&.Mui-focusVisible": {
156
- backgroundColor: t.palette.grey[700]
149
+ backgroundColor: e.palette.grey[700]
157
150
  },
158
151
  // Selected state
159
152
  "&.Mui-selected": {
160
153
  borderLeftStyle: "solid",
161
154
  borderLeftWidth: "7px",
162
- borderLeftColor: t.palette.primary.main,
163
- paddingLeft: `calc(${t.spacing(2)} - ${mt}px)`
155
+ borderLeftColor: e.palette.primary.main,
156
+ paddingLeft: `calc(${e.spacing(2)} - ${Oe}px)`
164
157
  },
165
158
  // Hover state
166
159
  "&:hover": {
167
- backgroundColor: t.palette.primary.dark
160
+ backgroundColor: e.palette.primary.dark
168
161
  },
169
162
  // Focus+Selected state
170
163
  "&.Mui-selected.Mui-focusVisible": {
171
- backgroundColor: t.palette.grey[700]
164
+ backgroundColor: e.palette.grey[700]
172
165
  },
173
166
  // Hover+Selected state
174
167
  "&.Mui-selected:hover": {
175
- backgroundColor: t.palette.primary.dark
168
+ backgroundColor: e.palette.primary.dark
169
+ }
170
+ // Focus+Hover+Selected state doesn't need to be specified
171
+ // '&.Mui-selected.Mui-focusVisible:hover': {
172
+ // },
173
+ }
174
+ })), ye = 7, fn = E(Ee)(({ theme: e }) => ({
175
+ backgroundColor: "#e8e8e8",
176
+ color: "inherit",
177
+ "& .MuiListItem-root": {
178
+ padding: "unset"
179
+ },
180
+ "& .MuiListItemButton-root": {
181
+ " .MuiListItemIcon-root": {
182
+ color: "inherit",
183
+ padding: `${ye}px`
184
+ },
185
+ // Focus state
186
+ "&.Mui-focusVisible": {
187
+ backgroundColor: e.palette.grey[700]
188
+ },
189
+ // Selected state
190
+ "&.Mui-selected": {
191
+ borderLeftStyle: "solid",
192
+ borderLeftWidth: "7px",
193
+ borderLeftColor: e.palette.primary.main,
194
+ paddingLeft: `calc(${e.spacing(2)} - ${ye}px)`
195
+ },
196
+ // Hover state
197
+ "&:hover": {
198
+ backgroundColor: e.palette.primary.dark
199
+ },
200
+ // Focus+Selected state
201
+ "&.Mui-selected.Mui-focusVisible": {
202
+ backgroundColor: e.palette.grey[700]
203
+ },
204
+ // Hover+Selected state
205
+ "&.Mui-selected:hover": {
206
+ backgroundColor: e.palette.primary.dark
176
207
  }
177
208
  // Focus+Hover+Selected state doesn't need to be specified
178
209
  // '&.Mui-selected.Mui-focusVisible:hover': {
179
210
  // },
180
211
  }
181
212
  }));
182
- function nn({
183
- "data-testid": t,
184
- children: e
213
+ function xn({
214
+ "data-testid": e,
215
+ children: t
185
216
  }) {
186
- const { open: n } = pe();
187
- return /* @__PURE__ */ c(oe, { className: A.root, "data-testid": t, children: [
188
- /* @__PURE__ */ i(jt, {}),
189
- /* @__PURE__ */ i(
190
- se,
217
+ const { open: n } = Tt();
218
+ return /* @__PURE__ */ l(ht, { className: L.root, "data-testid": e, children: [
219
+ /* @__PURE__ */ o(ct, {}),
220
+ /* @__PURE__ */ o(
221
+ ft,
191
222
  {
192
223
  variant: "permanent",
193
224
  anchor: "left",
194
225
  transitionDuration: null,
195
226
  open: n,
196
- children: e
227
+ children: t
197
228
  }
198
229
  )
199
230
  ] });
200
231
  }
201
- const ge = 24, fe = 64, T = "TopBar", u = {
202
- topStripe: `${T}-topStripe`,
203
- titleBar: `${T}-titleBar`,
204
- titleSlider: `${T}-titleSlider`,
205
- titleText: `${T}-titleText`,
206
- leftPanelButton: `${T}-leftPanelButton`,
207
- rightPanelButton: `${T}-leftPanelButton`
208
- }, he = L("div", {
209
- shouldForwardProp: (t) => !["leftPanel", "rightPanel"].includes(t),
210
- name: T
211
- })(({ theme: t, leftPanel: e, rightPanel: n }) => {
212
- var o, l;
232
+ const yt = 24, Ct = 64, N = "TopBar", T = {
233
+ topStripe: `${N}-topStripe`,
234
+ titleBar: `${N}-titleBar`,
235
+ titleSlider: `${N}-titleSlider`,
236
+ titleText: `${N}-titleText`,
237
+ leftPanelButton: `${N}-leftPanelButton`,
238
+ rightPanelButton: `${N}-leftPanelButton`
239
+ }, mt = W("div", {
240
+ shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
241
+ name: N
242
+ })(({ theme: e, leftPanel: t, rightPanel: n }) => {
243
+ var i, a;
213
244
  return {
214
245
  width: "100%",
215
- [`& .${u.topStripe}`]: {
246
+ [`& .${T.topStripe}`]: {
216
247
  width: "100%",
217
- height: `${ge}px`,
218
- backgroundColor: t.palette.primary.main
248
+ height: `${yt}px`,
249
+ backgroundColor: e.palette.primary.main
219
250
  },
220
- [`& .${u.titleBar}`]: {
221
- backgroundColor: t.palette.primary.light,
222
- height: `${fe}px`,
223
- padding: t.spacing(0, 3),
251
+ [`& .${T.titleBar}`]: {
252
+ backgroundColor: e.palette.primary.light,
253
+ height: `${Ct}px`,
254
+ padding: e.spacing(0, 3),
224
255
  width: "100%"
225
256
  },
226
- [`& .${u.titleSlider}`]: r(r({
257
+ [`& .${T.titleSlider}`]: r(r({
227
258
  height: "100%",
228
259
  display: "flex",
229
260
  alignItems: "center",
230
261
  color: "white",
231
- transition: t.transitions.create("margin", {
232
- easing: t.transitions.easing.sharp,
233
- duration: t.transitions.duration.leavingScreen
262
+ transition: e.transitions.create("margin", {
263
+ easing: e.transitions.easing.sharp,
264
+ duration: e.transitions.duration.leavingScreen
234
265
  }),
235
- [`& .${u.leftPanelButton}`]: {
236
- marginRight: t.spacing(2),
266
+ [`& .${T.leftPanelButton}`]: {
267
+ marginRight: e.spacing(2),
237
268
  flexGrow: 0
238
269
  },
239
- [`& .${u.titleText}`]: {
270
+ [`& .${T.titleText}`]: {
240
271
  flexGrow: 1
241
272
  },
242
- [`& .${u.rightPanelButton}`]: {
273
+ [`& .${T.rightPanelButton}`]: {
243
274
  flexGrow: 0
244
275
  }
245
- }, (e == null ? void 0 : e.open) && {
246
- transition: t.transitions.create("margin", {
247
- easing: t.transitions.easing.easeOut,
248
- duration: t.transitions.duration.enteringScreen
276
+ }, (t == null ? void 0 : t.open) && {
277
+ transition: e.transitions.create("margin", {
278
+ easing: e.transitions.easing.easeOut,
279
+ duration: e.transitions.duration.enteringScreen
249
280
  }),
250
- marginLeft: `${(o = e == null ? void 0 : e.width) != null ? o : 0}px`
281
+ marginLeft: `${(i = t == null ? void 0 : t.width) != null ? i : 0}px`
251
282
  }), (n == null ? void 0 : n.open) && {
252
- transition: t.transitions.create("margin", {
253
- easing: t.transitions.easing.easeOut,
254
- duration: t.transitions.duration.enteringScreen
283
+ transition: e.transitions.create("margin", {
284
+ easing: e.transitions.easing.easeOut,
285
+ duration: e.transitions.duration.enteringScreen
255
286
  }),
256
- marginRight: `${(l = n == null ? void 0 : n.width) != null ? l : 0}px`
287
+ marginRight: `${(a = n == null ? void 0 : n.width) != null ? a : 0}px`
257
288
  })
258
289
  };
259
290
  });
260
- function me({
261
- titleText: t = "",
262
- leftPanel: e,
291
+ function bt({
292
+ titleText: e = "",
293
+ leftPanel: t,
263
294
  rightPanel: n,
264
- "data-testid": o
295
+ "data-testid": i
265
296
  }) {
266
- return /* @__PURE__ */ c(he, { leftPanel: e, rightPanel: n, "data-testid": o, children: [
267
- /* @__PURE__ */ i("div", { className: u.topStripe }),
268
- /* @__PURE__ */ i("div", { className: u.titleBar, children: /* @__PURE__ */ c(yt, { className: u.titleSlider, children: [
269
- e !== void 0 && !e.open && e.showOpenArrow && /* @__PURE__ */ c(
270
- ft,
297
+ return /* @__PURE__ */ l(mt, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
298
+ /* @__PURE__ */ o("div", { className: T.topStripe }),
299
+ /* @__PURE__ */ o("div", { className: T.titleBar, children: /* @__PURE__ */ l(O, { className: T.titleSlider, children: [
300
+ t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ l(
301
+ M,
271
302
  {
272
- className: u.leftPanelButton,
303
+ className: T.leftPanelButton,
273
304
  color: "inherit",
274
305
  "aria-label": "Open left side panel",
275
- onClick: e == null ? void 0 : e.onOpen,
306
+ onClick: t == null ? void 0 : t.onOpen,
276
307
  edge: "start",
277
308
  size: "large",
278
309
  children: [
279
310
  " ",
280
- /* @__PURE__ */ i(It, {})
311
+ /* @__PURE__ */ o(Pe, {})
281
312
  ]
282
313
  }
283
314
  ),
284
- /* @__PURE__ */ i(D, { className: u.titleText, variant: "h6", noWrap: !0, children: t }),
285
- n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ c(
286
- ft,
315
+ /* @__PURE__ */ o(A, { className: T.titleText, variant: "h6", noWrap: !0, children: e }),
316
+ n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ l(
317
+ M,
287
318
  {
288
- className: u.rightPanelButton,
319
+ className: T.rightPanelButton,
289
320
  color: "inherit",
290
321
  "aria-label": "Open right side panel",
291
322
  onClick: n == null ? void 0 : n.onOpen,
@@ -293,15 +324,15 @@ function me({
293
324
  size: "large",
294
325
  children: [
295
326
  " ",
296
- /* @__PURE__ */ i(Ft, {})
327
+ /* @__PURE__ */ o(ke, {})
297
328
  ]
298
329
  }
299
330
  )
300
331
  ] }) })
301
332
  ] });
302
333
  }
303
- const Nt = 400, ve = L(St, {
304
- shouldForwardProp: (t) => (
334
+ const Me = 400, It = W(ot, {
335
+ shouldForwardProp: (e) => (
305
336
  // Note we do want anchor to be forwarded to the Drawer component
306
337
  ![
307
338
  "width",
@@ -310,35 +341,35 @@ const Nt = 400, ve = L(St, {
310
341
  "navBarOpen",
311
342
  "navBarWidthOpen",
312
343
  "navBarWidthClosed"
313
- ].includes(t)
344
+ ].includes(e)
314
345
  ),
315
346
  name: "SidePanelDrawer"
316
347
  })(
317
- ({ width: t, debugOpacity: e = !1, anchor: n, navBarOpen: o, navBarWidthOpen: l, navBarWidthClosed: g }) => ({
318
- width: t,
348
+ ({ width: e, debugOpacity: t = !1, anchor: n, navBarOpen: i, navBarWidthOpen: a, navBarWidthClosed: v }) => ({
349
+ width: e,
319
350
  "& .MuiDrawer-paper": r(r({
320
351
  position: "absolute",
321
- width: t,
352
+ width: e,
322
353
  boxSizing: "border-box",
323
354
  border: "unset",
324
355
  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)"
325
- }, e && {
356
+ }, t && {
326
357
  opacity: "50%"
327
358
  }), n === "left" && r({
328
- marginLeft: `${g}px`
329
- }, o && {
330
- marginLeft: `${l}px`
359
+ marginLeft: `${v}px`
360
+ }, i && {
361
+ marginLeft: `${a}px`
331
362
  }))
332
363
  })
333
- ), xe = L(Yt, {
334
- shouldForwardProp: (t) => !["anchor"].includes(t)
335
- })(({ theme: t, anchor: e }) => C(r({
364
+ ), Nt = W(O, {
365
+ shouldForwardProp: (e) => !["anchor"].includes(e)
366
+ })(({ theme: e, anchor: t }) => h(r({
336
367
  display: "flex",
337
368
  alignItems: "center",
338
- padding: t.spacing(2)
339
- }, t.mixins.toolbar), {
340
- justifyContent: e === "left" ? "space-between" : "flex-start",
341
- backgroundColor: t.palette.primary.light,
369
+ padding: e.spacing(2)
370
+ }, e.mixins.toolbar), {
371
+ justifyContent: t === "left" ? "space-between" : "flex-start",
372
+ backgroundColor: e.palette.primary.light,
342
373
  height: "88px",
343
374
  "&,*": {
344
375
  color: "white"
@@ -347,495 +378,632 @@ const Nt = 400, ve = L(St, {
347
378
  fontSize: "22px"
348
379
  },
349
380
  " .MuiButtonBase-root": {
350
- marginRight: e === "right" ? t.spacing(2) : 0
381
+ marginRight: t === "right" ? e.spacing(2) : 0
351
382
  }
352
383
  }));
353
- function vt({
354
- children: t,
355
- anchor: e = "left",
384
+ function Ce({
385
+ children: e,
386
+ anchor: t = "left",
356
387
  open: n,
357
- onClose: o = () => {
388
+ onClose: i = () => {
358
389
  },
359
- titleText: l = "",
360
- width: g = Nt,
361
- showCloseArrow: f = !0,
362
- debugOpacity: x = !1,
363
- headerBoxProps: h = {},
364
- onOpened: d,
365
- onClosed: m,
390
+ titleText: a = "",
391
+ width: v = Me,
392
+ showCloseArrow: g = !0,
393
+ debugOpacity: f = !1,
394
+ headerBoxProps: u = {},
395
+ onOpened: s,
396
+ onClosed: B,
366
397
  "data-testid": w,
367
- navBarOpen: b = !1,
368
- navBarWidthOpen: p = 0,
369
- navBarWidthClosed: y = 0
398
+ navBarOpen: d = !1,
399
+ navBarWidthOpen: x = 0,
400
+ navBarWidthClosed: C = 0
370
401
  }) {
371
- return /* @__PURE__ */ c(
372
- ve,
402
+ return /* @__PURE__ */ l(
403
+ It,
373
404
  {
374
405
  SlideProps: {
375
- onEntered: () => d == null ? void 0 : d(),
376
- onExited: () => m == null ? void 0 : m()
406
+ onEntered: () => s == null ? void 0 : s(),
407
+ onExited: () => B == null ? void 0 : B()
377
408
  },
378
409
  variant: "persistent",
379
- anchor: e,
410
+ anchor: t,
380
411
  open: n,
381
- width: g,
382
- debugOpacity: x,
412
+ width: v,
413
+ debugOpacity: f,
383
414
  "data-testid": w,
384
- navBarOpen: b,
385
- navBarWidthOpen: p,
386
- navBarWidthClosed: y,
415
+ navBarOpen: d,
416
+ navBarWidthOpen: x,
417
+ navBarWidthClosed: C,
387
418
  children: [
388
- /* @__PURE__ */ i(xe, C(r({ anchor: e }, h), { children: e === "left" ? /* @__PURE__ */ c(U, { children: [
389
- /* @__PURE__ */ i(D, { variant: "h6", color: "inherit", component: "div", children: l }),
390
- f && /* @__PURE__ */ c(ht, { onClick: o, size: "large", "aria-label": "Close left side panel", children: [
391
- /* @__PURE__ */ i(Ft, { "data-testid": "arrowbackicon" }),
419
+ /* @__PURE__ */ o(Nt, h(r({ anchor: t }, u), { children: t === "left" ? /* @__PURE__ */ l(Q, { children: [
420
+ /* @__PURE__ */ o(A, { variant: "h6", color: "inherit", component: "div", children: a }),
421
+ g && /* @__PURE__ */ l(M, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
422
+ /* @__PURE__ */ o(ke, { "data-testid": "arrowbackicon" }),
392
423
  " "
393
424
  ] })
394
- ] }) : /* @__PURE__ */ c(U, { children: [
395
- f && /* @__PURE__ */ c(ht, { onClick: o, size: "large", "aria-label": "Close right side panel", children: [
396
- /* @__PURE__ */ i(It, {}),
425
+ ] }) : /* @__PURE__ */ l(Q, { children: [
426
+ g && /* @__PURE__ */ l(M, { onClick: i, size: "large", "aria-label": "Close right side panel", children: [
427
+ /* @__PURE__ */ o(Pe, {}),
397
428
  " "
398
429
  ] }),
399
- /* @__PURE__ */ i(D, { variant: "h6", color: "inherit", component: "div", children: l })
430
+ /* @__PURE__ */ o(A, { variant: "h6", color: "inherit", component: "div", children: a })
400
431
  ] }) })),
401
- t
432
+ e
402
433
  ]
403
434
  }
404
435
  );
405
436
  }
406
- const we = L("div", {
407
- shouldForwardProp: (t) => !["leftPanel", "rightPanel"].includes(t),
437
+ const $t = W("div", {
438
+ shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
408
439
  name: "PanelAwareMargins"
409
- })(({ theme: t, leftPanel: e, rightPanel: n }) => {
410
- var o, l;
440
+ })(({ theme: e, leftPanel: t, rightPanel: n }) => {
441
+ var i, a;
411
442
  return r(r({
412
- transition: t.transitions.create("margin", {
413
- easing: t.transitions.easing.sharp,
414
- duration: t.transitions.duration.leavingScreen
443
+ transition: e.transitions.create("margin", {
444
+ easing: e.transitions.easing.sharp,
445
+ duration: e.transitions.duration.leavingScreen
415
446
  })
416
- }, (e == null ? void 0 : e.open) && {
417
- transition: t.transitions.create("margin", {
418
- easing: t.transitions.easing.easeOut,
419
- duration: t.transitions.duration.enteringScreen
447
+ }, (t == null ? void 0 : t.open) && {
448
+ transition: e.transitions.create("margin", {
449
+ easing: e.transitions.easing.easeOut,
450
+ duration: e.transitions.duration.enteringScreen
420
451
  }),
421
- marginLeft: `${(o = e == null ? void 0 : e.width) != null ? o : 0}px`
452
+ marginLeft: `${(i = t == null ? void 0 : t.width) != null ? i : 0}px`
422
453
  }), (n == null ? void 0 : n.open) && {
423
- transition: t.transitions.create("margin", {
424
- easing: t.transitions.easing.easeOut,
425
- duration: t.transitions.duration.enteringScreen
454
+ transition: e.transitions.create("margin", {
455
+ easing: e.transitions.easing.easeOut,
456
+ duration: e.transitions.duration.enteringScreen
426
457
  }),
427
- marginRight: `${(l = n == null ? void 0 : n.width) != null ? l : 0}px`
458
+ marginRight: `${(a = n == null ? void 0 : n.width) != null ? a : 0}px`
428
459
  });
429
- }), Ce = L(Zt, {
460
+ }), St = W(Se, {
430
461
  name: "PageContainer"
431
- })(({ theme: t }) => ({
462
+ })(({ theme: e }) => ({
432
463
  // Horizontal padding comes from the Container's gutter
433
- paddingTop: t.spacing(3),
434
- paddingBottom: t.spacing(3)
435
- })), tt = !1, et = !1, G = {
464
+ paddingTop: e.spacing(3),
465
+ paddingBottom: e.spacing(3)
466
+ })), se = !1, de = !1, q = {
436
467
  titleText: "",
437
468
  flavour: "push",
438
- width: Nt,
469
+ width: Me,
439
470
  arrowButtons: "both",
440
471
  startOpen: !1,
441
472
  open: void 0,
442
473
  onChangeOpen: void 0,
443
- content: /* @__PURE__ */ i(U, {}),
474
+ content: /* @__PURE__ */ o(Q, {}),
444
475
  onOpened: void 0,
445
476
  onClosed: void 0,
446
477
  dataTestId: void 0
447
478
  };
448
- function rn({
449
- children: t,
450
- titleText: e = "",
479
+ function Bn({
480
+ children: e,
481
+ titleText: t = "",
451
482
  leftPanel: n,
452
- rightPanel: o,
453
- sidePanelsAreMutuallyExclusive: l = !0,
454
- debugOpacity: g = !1,
455
- pageContainerProps: f,
456
- pageContentDataTestId: x,
457
- topBarDataTestId: h,
458
- navBarOpen: d,
459
- navBarWidthOpen: m,
483
+ rightPanel: i,
484
+ sidePanelsAreMutuallyExclusive: a = !0,
485
+ debugOpacity: v = !1,
486
+ pageContainerProps: g,
487
+ pageContentDataTestId: f,
488
+ topBarDataTestId: u,
489
+ navBarOpen: s,
490
+ navBarWidthOpen: B,
460
491
  navBarWidthClosed: w
461
492
  }) {
462
- const [b, p] = S(tt), [y, I] = S(et), [q, M] = S(tt), [X, P] = S(et), k = n !== void 0, E = o !== void 0, {
463
- titleText: v,
464
- content: R,
465
- flavour: _,
466
- open: N,
467
- onChangeOpen: $,
468
- width: a,
469
- arrowButtons: s,
470
- startOpen: F,
471
- onOpened: Dt,
472
- onClosed: Lt,
473
- dataTestId: Mt
474
- } = n ? r(r({}, G), n) : r({}, G), {
475
- titleText: Rt,
476
- content: _t,
477
- flavour: it,
478
- open: V,
479
- onChangeOpen: at,
480
- width: j,
481
- arrowButtons: H,
482
- startOpen: z,
483
- onOpened: Ht,
484
- onClosed: zt,
485
- dataTestId: Wt
486
- } = o ? r(r({}, G), o) : r({}, G);
487
- gt(() => {
488
- F !== tt && (p(F), M(F));
489
- }, [F]), gt(() => {
490
- z !== et && (I(z), P(z));
491
- }, [z]);
492
- const Q = N === void 0 ? b : N, K = V === void 0 ? y : V, st = (B) => {
493
- N === void 0 && (p(B), l && E && (B ? (I(!1), P(y)) : I(X))), $ && $(B);
494
- }, lt = (B) => {
495
- V === void 0 && (I(B), l && k && (B ? (p(!1), M(b)) : p(q))), at && at(B);
493
+ const [d, x] = $(se), [C, m] = $(de), [Z, F] = $(se), [ee, P] = $(de), k = n !== void 0, D = i !== void 0, {
494
+ titleText: y,
495
+ content: z,
496
+ flavour: G,
497
+ open: _,
498
+ onChangeOpen: H,
499
+ width: c,
500
+ arrowButtons: p,
501
+ startOpen: S,
502
+ onOpened: Ue,
503
+ onClosed: Xe,
504
+ dataTestId: Ve
505
+ } = n ? r(r({}, q), n) : r({}, q), {
506
+ titleText: qe,
507
+ content: je,
508
+ flavour: ue,
509
+ open: te,
510
+ onChangeOpen: he,
511
+ width: ne,
512
+ arrowButtons: U,
513
+ startOpen: X,
514
+ onOpened: Qe,
515
+ onClosed: Ye,
516
+ dataTestId: Ke
517
+ } = i ? r(r({}, q), i) : r({}, q);
518
+ K(() => {
519
+ S !== se && (x(S), F(S));
520
+ }, [S]), K(() => {
521
+ X !== de && (m(X), P(X));
522
+ }, [X]);
523
+ const re = _ === void 0 ? d : _, oe = te === void 0 ? C : te, ge = (b) => {
524
+ _ === void 0 && (x(b), a && D && (b ? (m(!1), P(C)) : m(ee))), H && H(b);
525
+ }, ve = (b) => {
526
+ te === void 0 && (m(b), a && k && (b ? (x(!1), F(d)) : x(Z))), he && he(b);
496
527
  };
497
- return /* @__PURE__ */ c(yt, { children: [
498
- k && /* @__PURE__ */ i(
499
- vt,
528
+ return /* @__PURE__ */ l(O, { children: [
529
+ k && /* @__PURE__ */ o(
530
+ Ce,
500
531
  {
501
- "data-testid": Mt,
532
+ "data-testid": Ve,
502
533
  anchor: "left",
503
- open: Q,
504
- onClose: () => st(!1),
505
- width: a,
506
- titleText: v,
507
- debugOpacity: g,
508
- showCloseArrow: s === "both" || s === "close",
509
- onOpened: Dt,
510
- onClosed: Lt,
511
- navBarOpen: d,
512
- navBarWidthOpen: m,
534
+ open: re,
535
+ onClose: () => ge(!1),
536
+ width: c,
537
+ titleText: y,
538
+ debugOpacity: v,
539
+ showCloseArrow: p === "both" || p === "close",
540
+ onOpened: Ue,
541
+ onClosed: Xe,
542
+ navBarOpen: s,
543
+ navBarWidthOpen: B,
513
544
  navBarWidthClosed: w,
514
- children: R
545
+ children: z
515
546
  }
516
547
  ),
517
- E && /* @__PURE__ */ i(
518
- vt,
548
+ D && /* @__PURE__ */ o(
549
+ Ce,
519
550
  {
520
- "data-testid": Wt,
551
+ "data-testid": Ke,
521
552
  anchor: "right",
522
- open: K,
523
- onClose: () => lt(!1),
524
- width: j,
525
- titleText: Rt,
526
- debugOpacity: g,
527
- showCloseArrow: H === "both" || H === "close",
528
- onOpened: Ht,
529
- onClosed: zt,
530
- navBarOpen: d,
531
- navBarWidthOpen: m,
553
+ open: oe,
554
+ onClose: () => ve(!1),
555
+ width: ne,
556
+ titleText: qe,
557
+ debugOpacity: v,
558
+ showCloseArrow: U === "both" || U === "close",
559
+ onOpened: Qe,
560
+ onClosed: Ye,
561
+ navBarOpen: s,
562
+ navBarWidthOpen: B,
532
563
  navBarWidthClosed: w,
533
- children: _t
564
+ children: je
534
565
  }
535
566
  ),
536
- /* @__PURE__ */ i(
537
- me,
567
+ /* @__PURE__ */ o(
568
+ bt,
538
569
  r(r({
539
- titleText: e,
540
- "data-testid": h
541
- }, k && _ === "push" ? {
570
+ titleText: t,
571
+ "data-testid": u
572
+ }, k && G === "push" ? {
542
573
  leftPanel: {
543
- open: Q,
544
- width: a,
545
- onOpen: () => st(!0),
546
- showOpenArrow: s === "both" || s === "open"
574
+ open: re,
575
+ width: c,
576
+ onOpen: () => ge(!0),
577
+ showOpenArrow: p === "both" || p === "open"
547
578
  }
548
- } : {}), E && it === "push" ? {
579
+ } : {}), D && ue === "push" ? {
549
580
  rightPanel: {
550
- open: K,
551
- width: j,
552
- onOpen: () => lt(!0),
553
- showOpenArrow: H === "both" || H === "open"
581
+ open: oe,
582
+ width: ne,
583
+ onOpen: () => ve(!0),
584
+ showOpenArrow: U === "both" || U === "open"
554
585
  }
555
586
  } : {})
556
587
  ),
557
- /* @__PURE__ */ i(
558
- we,
559
- C(r(r({}, _ === "push" ? {
588
+ /* @__PURE__ */ o(
589
+ $t,
590
+ h(r(r({}, G === "push" ? {
560
591
  leftPanel: {
561
- open: Q,
562
- width: a
592
+ open: re,
593
+ width: c
563
594
  }
564
- } : {}), it === "push" ? {
595
+ } : {}), ue === "push" ? {
565
596
  rightPanel: {
566
- open: K,
567
- width: j
597
+ open: oe,
598
+ width: ne
568
599
  }
569
600
  } : {}), {
570
- children: /* @__PURE__ */ i(Ce, C(r({ "data-testid": x }, f), { children: t }))
601
+ children: /* @__PURE__ */ o(St, h(r({ "data-testid": f }, g), { children: e }))
571
602
  })
572
603
  )
573
604
  ] });
574
605
  }
575
- const Be = Tt({
576
- palette: {
577
- primary: {
578
- main: "#007236",
579
- dark: "#005221",
580
- light: "#00A04E",
581
- contrastText: "#FFFFFF"
582
- },
583
- secondary: {
584
- main: "#662D91",
585
- dark: "#440E62",
586
- light: "#93268F",
587
- contrastText: "#FFFFFF"
588
- },
589
- error: {
590
- main: "#D32F2F",
591
- dark: "#C62828",
592
- light: "#EF5350"
593
- },
594
- info: {
595
- main: "#0288D1",
596
- dark: "#01579B",
597
- light: "#03A9F4"
598
- },
599
- success: {
600
- main: "#0288D1",
601
- dark: "#01579B",
602
- light: "#03A9F4"
606
+ const Lt = 64, At = 64, Et = 256, Pt = {
607
+ navBarOpen: !0,
608
+ titleText: "",
609
+ navBarWidthOpen: Et,
610
+ navBarWidthClosed: At,
611
+ topBarHeight: Lt,
612
+ navBarTop: void 0
613
+ };
614
+ function kt(e, t) {
615
+ switch (t.type) {
616
+ case "toggleNavBarOpen":
617
+ return h(r({}, e), {
618
+ navBarOpen: !e.navBarOpen
619
+ });
620
+ case "setNavBarOpen":
621
+ return h(r({}, e), {
622
+ navBarOpen: t.payload
623
+ });
624
+ case "setTitleText":
625
+ return h(r({}, e), {
626
+ titleText: t.payload
627
+ });
628
+ case "setNavBarWidthOpen":
629
+ return h(r({}, e), {
630
+ navBarWidthOpen: t.payload
631
+ });
632
+ case "setTopBarHeight":
633
+ return h(r({}, e), {
634
+ topBarHeight: t.payload
635
+ });
636
+ case "setNavBarTop":
637
+ return h(r({}, e), {
638
+ navBarTop: t.payload
639
+ });
640
+ default:
641
+ throw new Error("Invalid action.type");
642
+ }
643
+ }
644
+ const We = le(null), Dt = {}, _t = {}, Ht = ({
645
+ overrideState: e = Dt,
646
+ overrideActions: t = _t,
647
+ children: n
648
+ }) => {
649
+ const [
650
+ { titleText: i, topBarHeight: a, navBarOpen: v, navBarWidthOpen: g, navBarWidthClosed: f, navBarTop: u },
651
+ s
652
+ ] = tt(kt, Pt), B = nt(
653
+ () => ({
654
+ toggleNavBarOpen: () => s({ type: "toggleNavBarOpen" }),
655
+ setNavBarOpen: (d) => s({ type: "setNavBarOpen", payload: d }),
656
+ setNavBarWidthOpen: (d) => s({ type: "setNavBarWidthOpen", payload: d }),
657
+ setNavBarWidthClosed: (d) => s({ type: "setNavBarWidthClosed", payload: d }),
658
+ setTitleText: (d) => s({ type: "setTitleText", payload: d }),
659
+ setTopBarHeight: (d) => s({ type: "setTopBarHeight", payload: d }),
660
+ setNavBarTop: (d) => s({ type: "setNavBarTop", payload: d }),
661
+ clearNavBarTop: () => s({ type: "setNavBarTop", payload: void 0 })
662
+ }),
663
+ []
664
+ ), w = r(r(r({
665
+ navBarOpen: v,
666
+ navBarWidthOpen: g,
667
+ navBarWidthClosed: f,
668
+ titleText: i,
669
+ topBarHeight: a,
670
+ navBarTop: u
671
+ }, B), e), t);
672
+ return /* @__PURE__ */ o(We.Provider, { value: w, children: n });
673
+ }, Fe = () => {
674
+ const e = ce(We);
675
+ if (e === null)
676
+ throw new J("Error: Tried to call useAppLayout() outside of a <AppLayoutProvider>");
677
+ return e;
678
+ }, Rt = "TopBar", Mt = {
679
+ titleText: `${Rt}-titleText`
680
+ };
681
+ function Wt({ titleText: e = "", height: t, "data-testid": n }) {
682
+ const { toggleNavBarOpen: i } = Fe();
683
+ return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ l(
684
+ pe,
685
+ {
686
+ square: !0,
687
+ elevation: 0,
688
+ sx: {
689
+ width: "100%",
690
+ position: "sticky",
691
+ color: "primary.contrastText",
692
+ backgroundColor: "primary.main",
693
+ display: "flex",
694
+ alignItems: "center",
695
+ gap: 2,
696
+ flexShrink: 0,
697
+ height: t
698
+ },
699
+ children: [
700
+ /* @__PURE__ */ o(M, { size: "medium", color: "inherit", sx: { padding: 1.5 }, onClick: i, children: /* @__PURE__ */ o(ut, { fontSize: "medium" }) }),
701
+ /* @__PURE__ */ o(A, { className: Mt.titleText, variant: "h6", children: e })
702
+ ]
603
703
  }
704
+ ) });
705
+ }
706
+ const j = "Navbar", R = {
707
+ root: `${j}-root`,
708
+ menuButton: `${j}-menuButton`,
709
+ hide: `${j}-hide`,
710
+ content: `${j}-content`
711
+ // userInfoHolder: `${PREFIX}-userInfoHolder`,
712
+ // settings: `${PREFIX}-settings`,
713
+ // pieChartIcon: `${PREFIX}-pieChartIcon`,
714
+ }, Ft = E("div", { name: "NavBar" })(({ theme: e }) => ({
715
+ [`&.${R.root}`]: {
716
+ display: "flex"
604
717
  },
605
- components: {
606
- MuiTextField: {
607
- defaultProps: { color: "secondary" }
608
- },
609
- MuiToggleButtonGroup: {
610
- defaultProps: { color: "secondary" }
611
- },
612
- MuiCheckbox: {
613
- defaultProps: { color: "secondary" }
614
- },
615
- MuiSelect: {
616
- defaultProps: { color: "secondary" }
617
- },
618
- MuiSwitch: {
619
- defaultProps: { color: "secondary" }
620
- },
621
- MuiFormControl: {
622
- defaultProps: { color: "secondary" }
623
- },
624
- MuiMenuItem: {
625
- // Setting defaultProps for color on MenuItem does not work, so update manually
626
- styleOverrides: {
627
- root: ({ theme: t }) => ({
628
- "&.Mui-selected": {
629
- backgroundColor: Z(
630
- t.palette.secondary.main,
631
- t.palette.action.selectedOpacity
632
- ),
633
- "&:hover": {
634
- backgroundColor: Z(
635
- t.palette.secondary.main,
636
- t.palette.action.selectedOpacity
637
- )
638
- },
639
- "&.Mui-focusVisible": {
640
- backgroundColor: Z(
641
- t.palette.secondary.main,
642
- t.palette.action.focusOpacity
643
- )
644
- }
645
- }
646
- })
647
- }
648
- }
718
+ [`& .${R.menuButton}`]: {
719
+ marginRight: 36
649
720
  },
650
- typography: {
651
- // I couldn't think of what to call this. It is an attempt to match
652
- // https://www.figma.com/file/atonRPl2YD9A1NCntbDtKR/List-Filter-and-Product-Concept?node-id=1187%3A43730
653
- // but not sure if line height should be changed
654
- explainer: {
655
- fontSize: "14px",
656
- marginBlockStart: "1em"
657
- },
658
- h3: {
659
- fontSize: "1rem",
660
- fontWeight: 700
661
- }
721
+ [`& .${R.hide}`]: {
722
+ display: "none"
723
+ },
724
+ [`& .${R.content}`]: {
725
+ flexGrow: 1,
726
+ padding: e.spacing(3)
662
727
  }
663
- }), Oe = Tt({
664
- palette: {
665
- primary: {
666
- dark: "#00A651",
667
- light: "#A3D39C",
668
- main: "#007236",
669
- contrastText: "#FFF"
670
- },
671
- warning: {
672
- main: "#F5871F",
673
- light: "#FCC589",
674
- dark: "#A2590A",
675
- contrastText: "#FFF"
676
- },
677
- secondary: {
678
- main: "#662D91",
679
- light: "#BD8CBF",
680
- dark: "#440E62",
681
- contrastText: "#FFF"
682
- },
683
- error: {
684
- main: "#D43C95",
685
- light: "#8F2064",
686
- dark: "#F9CDE0",
687
- contrastText: "#FFF"
688
- },
689
- info: {
690
- main: "#00A88D",
691
- light: "#ADDCCF",
692
- dark: "#005243",
693
- contrastText: "#FFF"
694
- },
695
- success: {
696
- main: "#00A651",
697
- light: "#A3D39C",
698
- dark: "#007236",
699
- contrastText: "#FFF"
728
+ // [`& .${classes.userInfoHolder}`]: {
729
+ // height: '148px',
730
+ // marginTop: '64px',
731
+ // marginBottom: '16px',
732
+ // },
733
+ })), ze = (e, t) => {
734
+ var n, i;
735
+ return {
736
+ height: `calc(100vh - ${t})`,
737
+ top: t,
738
+ overflowX: "hidden",
739
+ overflowY: "hidden",
740
+ color: "inherit",
741
+ backgroundColor: (i = (n = e == null ? void 0 : e.navBar) == null ? void 0 : n.backgroundColor) != null ? i : "white"
742
+ // Provide default so tests don't need to wrap theme provider
743
+ };
744
+ }, me = (e, t, n) => r({
745
+ width: t,
746
+ transition: e.transitions.create("width", {
747
+ easing: e.transitions.easing.sharp,
748
+ duration: e.transitions.duration.enteringScreen
749
+ })
750
+ }, ze(e, n)), be = (e, t, n) => r({
751
+ width: t,
752
+ transition: e.transitions.create("width", {
753
+ easing: e.transitions.easing.sharp,
754
+ duration: e.transitions.duration.leavingScreen
755
+ }),
756
+ overflowX: "hidden"
757
+ }, ze(e, n)), zt = E(Le, {
758
+ shouldForwardProp: (e) => !["open", "widthOpen", "widthClosed", "offsetTop"].includes(e)
759
+ })(({ theme: e, open: t, widthOpen: n, widthClosed: i, offsetTop: a }) => r(r({
760
+ flexShrink: 0,
761
+ whiteSpace: "nowrap",
762
+ boxSizing: "border-box"
763
+ }, t && h(r({}, me(e, n, a)), {
764
+ "& .MuiDrawer-paper": me(e, n, a)
765
+ })), !t && h(r({}, be(e, i, a)), {
766
+ "& .MuiDrawer-paper": be(e, i, a)
767
+ })));
768
+ function Gt({ links: e }) {
769
+ return /* @__PURE__ */ o("div", { children: "LinksMenu not implemented yet" });
770
+ }
771
+ function Ut({
772
+ open: e,
773
+ offsetTop: t = 0,
774
+ widthOpen: n,
775
+ widthClosed: i,
776
+ "data-testid": a,
777
+ top: v,
778
+ middle: g,
779
+ bottom: f
780
+ }) {
781
+ return /* @__PURE__ */ o(Ft, { className: R.root, "data-testid": a, children: /* @__PURE__ */ o(
782
+ zt,
783
+ {
784
+ variant: "permanent",
785
+ anchor: "left",
786
+ open: e,
787
+ widthOpen: n,
788
+ widthClosed: i,
789
+ offsetTop: t,
790
+ children: /* @__PURE__ */ l(O, { component: "nav", sx: {}, children: [
791
+ v && /* @__PURE__ */ l(O, { sx: { flexGrow: 1 }, children: [
792
+ v,
793
+ /* @__PURE__ */ o(Te, { variant: "middle" })
794
+ ] }),
795
+ Array.isArray(g) ? /* @__PURE__ */ o(Gt, { links: g }) : g,
796
+ f && /* @__PURE__ */ l(O, { sx: {}, children: [
797
+ /* @__PURE__ */ o(Te, { variant: "middle" }),
798
+ f
799
+ ] })
800
+ ] })
700
801
  }
701
- },
702
- typography: {
703
- // I couldn't think of what to call this. It is an attempt to match
704
- // https://www.figma.com/file/atonRPl2YD9A1NCntbDtKR/List-Filter-and-Product-Concept?node-id=1187%3A43730
705
- // but not sure if line height should be changed
706
- explainer: {
707
- fontSize: "14px",
708
- marginBlockStart: "1em"
802
+ ) });
803
+ }
804
+ function Xt({ children: e, topBarHeight: t }) {
805
+ return /* @__PURE__ */ o(
806
+ O,
807
+ {
808
+ sx: {
809
+ overflow: "auto",
810
+ height: `calc(100vh - ${t}px)`,
811
+ scrollbarGutter: "stable",
812
+ // scrollbarGutter: 'stable both-edges',
813
+ flexGrow: 1
814
+ },
815
+ children: /* @__PURE__ */ o(
816
+ Se,
817
+ {
818
+ component: "main",
819
+ id: "main-content",
820
+ sx: { paddingTop: 3, paddingBottom: 3, flexGrow: 1 },
821
+ children: e
822
+ }
823
+ )
709
824
  }
710
- }
711
- });
712
- function on({
713
- name: t = "internal",
714
- children: e
825
+ );
826
+ }
827
+ function Vt({
828
+ children: e,
829
+ initialTitleText: t,
830
+ initialNavBarOpen: n,
831
+ pageContainerProps: i,
832
+ pageContentDataTestId: a,
833
+ topBarDataTestId: v,
834
+ navBarDataTestId: g,
835
+ navBarMiddle: f
715
836
  }) {
716
- return /* @__PURE__ */ i(Qt, { theme: t === "internal" ? Be : t === "fed21" ? Oe : void 0, children: e });
837
+ const {
838
+ navBarOpen: u,
839
+ setNavBarOpen: s,
840
+ titleText: B,
841
+ setTitleText: w,
842
+ topBarHeight: d,
843
+ navBarWidthOpen: x,
844
+ navBarWidthClosed: C,
845
+ navBarTop: m
846
+ } = Fe();
847
+ return K(() => {
848
+ t !== void 0 && w(t);
849
+ }, [t, w]), K(() => {
850
+ console.log(n), n !== void 0 && s(n);
851
+ }, [n, s]), /* @__PURE__ */ l(O, { children: [
852
+ /* @__PURE__ */ o(it, {}),
853
+ /* @__PURE__ */ o(Wt, { titleText: B, "data-testid": v, height: d }),
854
+ /* @__PURE__ */ l(O, { sx: { display: "flex" }, children: [
855
+ /* @__PURE__ */ o(
856
+ Ut,
857
+ {
858
+ open: u,
859
+ top: m,
860
+ middle: f,
861
+ bottom: /* @__PURE__ */ o(O, { sx: { padding: 2 }, children: /* @__PURE__ */ o(pe, { sx: { padding: 2, textWrap: "initial" }, variant: "outlined", children: "Placeholder for standard user settings, domain selector etc. It should be at the very bottom, but WIP" }) }),
862
+ widthOpen: x,
863
+ widthClosed: C,
864
+ offsetTop: d,
865
+ "data-testid": g
866
+ }
867
+ ),
868
+ /* @__PURE__ */ o(
869
+ Xt,
870
+ h(r({
871
+ "data-testid": a,
872
+ topBarHeight: d
873
+ }, i), {
874
+ children: e
875
+ })
876
+ )
877
+ ] })
878
+ ] });
879
+ }
880
+ function wn(e) {
881
+ return /* @__PURE__ */ o(Ht, { children: /* @__PURE__ */ o(Vt, r({}, e)) });
717
882
  }
718
- const Te = {
883
+ const qt = {
719
884
  autoHideDuration: 6e3,
720
885
  anchorOrigin: { vertical: "top", horizontal: "center" },
721
886
  // The default is false. If we prefer timer to continue when window loses
722
887
  // focus, change to true
723
888
  disableWindowBlurListener: !1
724
- }, Se = {
725
- shouldClose: (t, e) => e !== "clickaway"
726
- }, xt = {
889
+ }, jt = {
890
+ shouldClose: (e, t) => t !== "clickaway"
891
+ }, Ie = {
727
892
  message: "",
728
893
  severity: "info",
729
894
  variant: "standard",
730
895
  progressIndicator: void 0
731
896
  // Can use 'circular' or 'linear'
732
- }, wt = 100, Ct = 2e3, be = 2e3, ye = (() => {
733
- let t = 0;
734
- return () => (t += 1, t);
735
- })(), Ie = {
897
+ }, Ne = 100, $e = 2e3, Qt = 2e3, Yt = (() => {
898
+ let e = 0;
899
+ return () => (e += 1, e);
900
+ })(), Kt = {
736
901
  borderBottomLeftRadius: "0px",
737
902
  borderBottomRightRadius: "0px"
738
- }, Fe = {}, Ae = {}, $t = Bt(null);
739
- function Pe(g) {
740
- var f = g, {
741
- overrideState: t = Fe,
742
- overrideActions: e = Ae,
743
- shouldClose: n = Se.shouldClose,
744
- children: o
745
- } = f, l = pt(f, [
903
+ }, Jt = {}, Zt = {}, Ge = le(null);
904
+ function en(v) {
905
+ var g = v, {
906
+ overrideState: e = Jt,
907
+ overrideActions: t = Zt,
908
+ shouldClose: n = jt.shouldClose,
909
+ children: i
910
+ } = g, a = Be(g, [
746
911
  "overrideState",
747
912
  "overrideActions",
748
913
  "shouldClose",
749
914
  "children"
750
915
  ]);
751
- var $;
752
- const [{ open: x }, h] = S({ open: !1 }), d = Y([]), m = Y(Date.now()), w = Y(0), b = nt((a) => {
753
- h({ open: a });
754
- }, []), p = nt((a = {}) => {
755
- w.current += 1, d.current.length >= wt && Date.now() - m.current >= Ct && (m.current = Date.now(), console.error(
756
- `SaladBarProvider: MAX_QUEUE_LENGTH (${wt}) hit ${w.current} times in last ${Ct}ms)`
916
+ var H;
917
+ const [{ open: f }, u] = $({ open: !1 }), s = ae([]), B = ae(Date.now()), w = ae(0), d = Y((c) => {
918
+ u({ open: c });
919
+ }, []), x = Y((c = {}) => {
920
+ w.current += 1, s.current.length >= Ne && Date.now() - B.current >= $e && (B.current = Date.now(), console.error(
921
+ `SaladBarProvider: MAX_QUEUE_LENGTH (${Ne}) hit ${w.current} times in last ${$e}ms)`
757
922
  ), w.current = 0);
758
- const s = r(C(r({}, xt), {
759
- key: ye()
760
- }), a);
761
- return d.current.push(s), d.current.length === 1 && h({ open: !0 }), s.key;
762
- }, []), y = (a = "", s = {}) => p(r({ message: a, severity: "success" }, s)), I = (a = "", s = {}) => p(r({ message: a, severity: "info" }, s)), q = (a = "", s = {}) => p(r({ message: a, severity: "warning" }, s)), M = (a = "", s = {}) => p(r({ message: a, severity: "error" }, s)), X = (a) => {
763
- const s = d.current.findIndex((F) => F.key === a);
764
- if (s !== -1)
765
- return s === 0 ? (h({ open: !1 }), d.current[0]) : d.current.splice(s, 1);
766
- }, P = (a, s) => {
767
- n(a, s) && h({ open: !1 });
923
+ const p = r(h(r({}, Ie), {
924
+ key: Yt()
925
+ }), c);
926
+ return s.current.push(p), s.current.length === 1 && u({ open: !0 }), p.key;
927
+ }, []), C = (c = "", p = {}) => x(r({ message: c, severity: "success" }, p)), m = (c = "", p = {}) => x(r({ message: c, severity: "info" }, p)), Z = (c = "", p = {}) => x(r({ message: c, severity: "warning" }, p)), F = (c = "", p = {}) => x(r({ message: c, severity: "error" }, p)), ee = (c) => {
928
+ const p = s.current.findIndex((S) => S.key === c);
929
+ if (p !== -1)
930
+ return p === 0 ? (u({ open: !1 }), s.current[0]) : s.current.splice(p, 1);
931
+ }, P = (c, p) => {
932
+ n(c, p) && u({ open: !1 });
768
933
  }, k = () => {
769
- }, E = () => {
770
- d.current.shift(), d.current.length > 0 && h({ open: !0 });
771
- }, v = ($ = d.current[0]) != null ? $ : r({}, xt), R = {};
772
- "autoHideDuration" in v && (R.autoHideDuration = v.autoHideDuration);
773
- const _ = r(r({}, Te), l), N = r(r({
774
- open: x,
775
- setOpen: b,
776
- enqueueNotification: p,
777
- enqueueSuccessNotification: y,
778
- enqueueInfoNotification: I,
779
- enqueueWarningNotification: q,
780
- enqueueErrorNotification: M,
781
- removeNotification: X
782
- }, t), e);
783
- return /* @__PURE__ */ c($t.Provider, { value: N, children: [
784
- o,
785
- /* @__PURE__ */ i(
786
- te,
787
- C(r(r({}, _), R), {
788
- open: x,
934
+ }, D = () => {
935
+ s.current.shift(), s.current.length > 0 && u({ open: !0 });
936
+ }, y = (H = s.current[0]) != null ? H : r({}, Ie), z = {};
937
+ "autoHideDuration" in y && (z.autoHideDuration = y.autoHideDuration);
938
+ const G = r(r({}, qt), a), _ = r(r({
939
+ open: f,
940
+ setOpen: d,
941
+ enqueueNotification: x,
942
+ enqueueSuccessNotification: C,
943
+ enqueueInfoNotification: m,
944
+ enqueueWarningNotification: Z,
945
+ enqueueErrorNotification: F,
946
+ removeNotification: ee
947
+ }, e), t);
948
+ return /* @__PURE__ */ l(Ge.Provider, { value: _, children: [
949
+ i,
950
+ /* @__PURE__ */ o(
951
+ at,
952
+ h(r(r({}, G), z), {
953
+ open: f,
789
954
  onClose: P,
790
955
  TransitionProps: {
791
- onExited: E,
956
+ onExited: D,
792
957
  onExit: k
793
958
  },
794
- sx: { zIndex: be },
795
- children: /* @__PURE__ */ c("div", { children: [
796
- /* @__PURE__ */ i(
797
- ee,
959
+ sx: { zIndex: Qt },
960
+ children: /* @__PURE__ */ l("div", { children: [
961
+ /* @__PURE__ */ o(
962
+ st,
798
963
  {
799
- onClose: (a) => P(a, "closeAlert"),
800
- severity: v.severity,
964
+ onClose: (c) => P(c, "closeAlert"),
965
+ severity: y.severity,
801
966
  variant: "filled",
802
- icon: v.progressIndicator === "circular" ? /* @__PURE__ */ i(re, { size: "1em" }) : void 0,
803
- style: v.progressIndicator === "linear" ? Ie : void 0,
804
- children: v.message
967
+ icon: y.progressIndicator === "circular" ? /* @__PURE__ */ o(dt, { size: "1em" }) : void 0,
968
+ style: y.progressIndicator === "linear" ? Kt : void 0,
969
+ children: y.message
805
970
  }
806
971
  ),
807
- v.progressIndicator === "linear" && /* @__PURE__ */ i(ne, { color: "primary" })
972
+ y.progressIndicator === "linear" && /* @__PURE__ */ o(lt, { color: "primary" })
808
973
  ] })
809
974
  })
810
975
  )
811
976
  ] });
812
977
  }
813
- function an() {
814
- const t = Ot($t);
815
- if (t === null)
816
- throw new ot("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
817
- return t;
978
+ function Tn() {
979
+ const e = ce(Ge);
980
+ if (e === null)
981
+ throw new J("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
982
+ return e;
818
983
  }
819
- const sn = bt(
820
- (t = { autoHideDuration: 1 }, e = {}, n = {}) => ({ children: o }) => /* @__PURE__ */ i(Pe, C(r({}, t), { overrideState: e, overrideActions: n, children: o }))
984
+ const On = Ae(
985
+ (e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(en, h(r({}, e), { overrideState: t, overrideActions: n, children: i }))
821
986
  );
822
987
  export {
823
- on as AgThemeProvider,
824
- $t as Context,
825
- ot as ContextError,
826
- Ze as ExampleComponent,
827
- Pt as NAVBAR_WIDTH_CLOSED,
828
- At as NAVBAR_WIDTH_OPENED,
829
- nn as NavBar,
830
- en as NavBarDarkStyledList,
831
- ce as NavBarProvider,
832
- rn as PageLayout,
833
- Pe as SaladBarProvider,
834
- ue as buildNavBarState,
835
- A as navBarClasses,
836
- pe as useNavBar,
837
- an as useSaladBar,
838
- tn as withNavBarProvider,
839
- sn as withSaladBarProvider
988
+ wn as AppLayout,
989
+ Ht as AppLayoutProvider,
990
+ Ge as Context,
991
+ J as ContextError,
992
+ hn as ExampleComponent,
993
+ _e as NAVBAR_WIDTH_CLOSED,
994
+ De as NAVBAR_WIDTH_OPENED,
995
+ xn as NavBar,
996
+ vn as NavBarDarkStyledList,
997
+ fn as NavBarLightStyledList,
998
+ wt as NavBarProvider,
999
+ Bn as PageLayout,
1000
+ en as SaladBarProvider,
1001
+ Ot as buildNavBarState,
1002
+ L as navBarClasses,
1003
+ Fe as useAppLayout,
1004
+ Tt as useNavBar,
1005
+ Tn as useSaladBar,
1006
+ gn as withNavBarProvider,
1007
+ On as withSaladBarProvider
840
1008
  };
841
1009
  //# sourceMappingURL=index.js.map