@australiangreens/ag-internal-components 0.0.25 → 0.0.27

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 (51) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/components/ExampleComponent/index.d.ts +1 -0
  4. package/dist/components/ExampleComponent/index.d.ts.map +1 -1
  5. package/dist/components/NavBar/NavBarContext.d.ts +16 -0
  6. package/dist/components/NavBar/NavBarContext.d.ts.map +1 -0
  7. package/dist/components/NavBar/NavBarDarkStyledList.d.ts +2 -0
  8. package/dist/components/NavBar/NavBarDarkStyledList.d.ts.map +1 -0
  9. package/dist/components/NavBar/Styling.d.ts +15 -0
  10. package/dist/components/NavBar/Styling.d.ts.map +1 -0
  11. package/dist/components/NavBar/index.d.ts +21 -0
  12. package/dist/components/NavBar/index.d.ts.map +1 -0
  13. package/dist/components/NavBar/testWrappers.d.ts +5 -0
  14. package/dist/components/NavBar/testWrappers.d.ts.map +1 -0
  15. package/dist/components/index.d.ts +2 -2
  16. package/dist/components/index.d.ts.map +1 -1
  17. package/dist/esm/index.js +442 -308
  18. package/dist/esm/index.js.map +1 -1
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/layouts/PageLayout/PageContainer.d.ts +14 -0
  22. package/dist/layouts/PageLayout/PageContainer.d.ts.map +1 -0
  23. package/dist/layouts/PageLayout/PanelAwareMargins.d.ts.map +1 -0
  24. package/dist/layouts/PageLayout/SidePanel.d.ts.map +1 -0
  25. package/dist/layouts/PageLayout/TopBar.d.ts.map +1 -0
  26. package/dist/layouts/PageLayout/index.d.ts.map +1 -0
  27. package/dist/layouts/index.d.ts +3 -0
  28. package/dist/layouts/index.d.ts.map +1 -0
  29. package/dist/providers/SaladBar/SaladBarContext.d.ts +15 -25
  30. package/dist/providers/SaladBar/SaladBarContext.d.ts.map +1 -1
  31. package/dist/providers/SaladBar/index.d.ts +4 -2
  32. package/dist/providers/SaladBar/index.d.ts.map +1 -1
  33. package/dist/providers/SaladBar/testWrappers.d.ts +2 -0
  34. package/dist/providers/SaladBar/testWrappers.d.ts.map +1 -0
  35. package/dist/providers/SaladBar/types.d.ts +44 -0
  36. package/dist/providers/SaladBar/types.d.ts.map +1 -0
  37. package/dist/providers/SaladBar/useSaladBar.d.ts +3 -8
  38. package/dist/providers/SaladBar/useSaladBar.d.ts.map +1 -1
  39. package/package.json +18 -4
  40. package/dist/components/PageLayout/PageContainer.d.ts +0 -14
  41. package/dist/components/PageLayout/PageContainer.d.ts.map +0 -1
  42. package/dist/components/PageLayout/PanelAwareMargins.d.ts.map +0 -1
  43. package/dist/components/PageLayout/SidePanel.d.ts.map +0 -1
  44. package/dist/components/PageLayout/TopBar.d.ts.map +0 -1
  45. package/dist/components/PageLayout/index.d.ts.map +0 -1
  46. package/dist/providers/SaladBar/SaladBarProvider.d.ts +0 -11
  47. package/dist/providers/SaladBar/SaladBarProvider.d.ts.map +0 -1
  48. /package/dist/{components → layouts}/PageLayout/PanelAwareMargins.d.ts +0 -0
  49. /package/dist/{components → layouts}/PageLayout/SidePanel.d.ts +0 -0
  50. /package/dist/{components → layouts}/PageLayout/TopBar.d.ts +0 -0
  51. /package/dist/{components → layouts}/PageLayout/index.d.ts +0 -0
package/dist/esm/index.js CHANGED
@@ -1,50 +1,53 @@
1
- var Et = Object.defineProperty, kt = Object.defineProperties;
2
- var Nt = Object.getOwnPropertyDescriptors;
3
- var M = Object.getOwnPropertySymbols;
4
- var at = Object.prototype.hasOwnProperty, st = Object.prototype.propertyIsEnumerable;
5
- var V = (t, e, n) => e in t ? Et(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, r = (t, e) => {
1
+ var Gt = Object.defineProperty, Ut = Object.defineProperties;
2
+ var qt = Object.getOwnPropertyDescriptors;
3
+ var W = Object.getOwnPropertySymbols;
4
+ var ct = Object.prototype.hasOwnProperty, dt = 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
6
  for (var n in e || (e = {}))
7
- at.call(e, n) && V(t, n, e[n]);
8
- if (M)
9
- for (var n of M(e))
10
- st.call(e, n) && V(t, n, e[n]);
7
+ ct.call(e, n) && J(t, n, e[n]);
8
+ if (W)
9
+ for (var n of W(e))
10
+ dt.call(e, n) && J(t, n, e[n]);
11
11
  return t;
12
- }, v = (t, e) => kt(t, Nt(e));
13
- var ct = (t, e) => {
12
+ }, B = (t, e) => Ut(t, qt(e));
13
+ var pt = (t, e) => {
14
14
  var n = {};
15
15
  for (var o in t)
16
- at.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
17
- if (t != null && M)
18
- for (var o of M(t))
19
- e.indexOf(o) < 0 && st.call(t, o) && (n[o] = t[o]);
16
+ ct.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 && dt.call(t, o) && (n[o] = t[o]);
20
20
  return n;
21
21
  };
22
- var lt = (t, e, n) => (V(t, typeof e != "symbol" ? e + "" : e, n), n);
23
- import { jsxs as l, Fragment as q, jsx as i } from "react/jsx-runtime";
24
- import { useState as b, useEffect as dt, createContext as Dt, useRef as K, useContext as Lt } from "react";
25
- import $t from "@mui/material/Button";
26
- import Rt from "@mui/material/Paper";
27
- import E from "@mui/material/Typography";
28
- import { styled as k, Box as xt, IconButton as pt } from "@mui/material";
29
- import wt from "@mui/icons-material/ArrowForward";
30
- import vt from "@mui/icons-material/ArrowBack";
31
- import _t from "@mui/material/Drawer";
32
- import Ht from "@mui/material/Box";
33
- import ut from "@mui/material/IconButton";
34
- import Mt from "@mui/material/Container";
35
- import { createTheme as Ct, alpha as J, ThemeProvider as zt } from "@mui/material/styles";
36
- import qt from "@mui/material/Snackbar";
37
- import Gt from "@mui/material/Alert";
38
- import Ut from "@mui/material/LinearProgress";
39
- import Wt from "@mui/material/CircularProgress";
40
- import { AgError as Xt } from "@australiangreens/ag-error";
41
- function Pe({ text: t }) {
22
+ var ut = (t, e, n) => (J(t, typeof e != "symbol" ? e + "" : e, n), n);
23
+ import { jsxs as d, Fragment as U, jsx as i } from "react/jsx-runtime";
24
+ import { useState as b, 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 bt from "@mui/material/Drawer";
31
+ import { AgError as Kt } from "@australiangreens/ag-error";
32
+ import { createHelper as yt } from "souvlaki";
33
+ import Jt from "@mui/material/List";
34
+ import { styled as L, Box as It, IconButton as ft } from "@mui/material";
35
+ import St 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 }) {
42
45
  const [e, n] = b(0);
43
- return /* @__PURE__ */ l(q, { children: [
44
- /* @__PURE__ */ i(E, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
45
- /* @__PURE__ */ i(E, { variant: "caption", display: "block", children: /* @__PURE__ */ i("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
46
+ return /* @__PURE__ */ d(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" }) }),
46
49
  /* @__PURE__ */ i(
47
- $t,
50
+ Xt,
48
51
  {
49
52
  variant: "outlined",
50
53
  onClick: () => n((o) => o + 1),
@@ -52,38 +55,171 @@ function Pe({ text: t }) {
52
55
  children: "Hello I am a button"
53
56
  }
54
57
  ),
55
- /* @__PURE__ */ l("p", { children: [
58
+ /* @__PURE__ */ d("p", { children: [
56
59
  "This is some text: ",
57
60
  /* @__PURE__ */ i("span", { children: t })
58
61
  ] }),
59
- /* @__PURE__ */ l(Rt, { children: [
62
+ /* @__PURE__ */ d(Vt, { children: [
60
63
  "This number will incremember when button pressed: ",
61
64
  e
62
65
  ] })
63
66
  ] });
64
67
  }
65
- const jt = 24, Qt = 64, C = "TopBar", u = {
66
- topStripe: `${C}-topStripe`,
67
- titleBar: `${C}-titleBar`,
68
- titleSlider: `${C}-titleSlider`,
69
- titleText: `${C}-titleText`,
70
- leftPanelButton: `${C}-leftPanelButton`,
71
- rightPanelButton: `${C}-leftPanelButton`
72
- }, Vt = k("div", {
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}`]: {
78
+ display: "flex"
79
+ },
80
+ [`& .${A.menuButton}`]: {
81
+ marginRight: 36
82
+ },
83
+ [`& .${A.hide}`]: {
84
+ display: "none"
85
+ },
86
+ [`& .${A.content}`]: {
87
+ flexGrow: 1,
88
+ padding: t.spacing(3)
89
+ },
90
+ [`& .${A.userInfoHolder}`]: {
91
+ height: "148px",
92
+ marginTop: "64px",
93
+ marginBottom: "16px"
94
+ }
95
+ })), kt = () => ({
96
+ position: "absolute",
97
+ height: "100%",
98
+ overflowX: "hidden",
99
+ overflowY: "hidden",
100
+ color: "white",
101
+ backgroundColor: "black"
102
+ }), ie = () => r({
103
+ width: At
104
+ }, kt()), ae = () => r({
105
+ width: Pt
106
+ }, kt()), se = rt(bt, {
107
+ shouldForwardProp: (t) => t !== "open"
108
+ })(({ theme: t, open: e }) => r(r({
109
+ width: e ? At : Pt,
110
+ flexShrink: 0,
111
+ whiteSpace: "nowrap",
112
+ boxSizing: "border-box",
113
+ zIndex: t.zIndex.drawer + 100
114
+ }, e && {
115
+ "& .MuiDrawer-paper": ie()
116
+ }), !e && {
117
+ "& .MuiDrawer-paper": ae()
118
+ }));
119
+ class ot extends Kt {
120
+ }
121
+ ut(ot, "errorName", "ContextError");
122
+ const Et = Bt(null), le = {}, ce = {}, de = ({
123
+ overrideState: t = le,
124
+ overrideActions: e = ce,
125
+ children: n
126
+ }) => {
127
+ const [{ open: o }, l] = b({ open: !0 }), g = nt((x) => {
128
+ l({ open: x });
129
+ }, []), 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({
140
+ open: !0
141
+ }, t), tn = yt(
142
+ (t = ue(), e = {}) => ({ children: n }) => /* @__PURE__ */ i(de, { overrideState: t, overrideActions: e, children: n })
143
+ ), mt = 7, en = rt(Jt)(({ theme: t }) => ({
144
+ backgroundColor: "black",
145
+ color: "white",
146
+ "& .MuiListItem-root": {
147
+ padding: "unset"
148
+ },
149
+ "& .MuiListItemButton-root": {
150
+ " .MuiListItemIcon-root": {
151
+ color: "white",
152
+ padding: `${mt}px`
153
+ },
154
+ // Focus state
155
+ "&.Mui-focusVisible": {
156
+ backgroundColor: t.palette.grey[700]
157
+ },
158
+ // Selected state
159
+ "&.Mui-selected": {
160
+ borderLeftStyle: "solid",
161
+ borderLeftWidth: "7px",
162
+ borderLeftColor: t.palette.primary.main,
163
+ paddingLeft: `calc(${t.spacing(2)} - ${mt}px)`
164
+ },
165
+ // Hover state
166
+ "&:hover": {
167
+ backgroundColor: t.palette.primary.dark
168
+ },
169
+ // Focus+Selected state
170
+ "&.Mui-selected.Mui-focusVisible": {
171
+ backgroundColor: t.palette.grey[700]
172
+ },
173
+ // Hover+Selected state
174
+ "&.Mui-selected:hover": {
175
+ backgroundColor: t.palette.primary.dark
176
+ }
177
+ // Focus+Hover+Selected state doesn't need to be specified
178
+ // '&.Mui-selected.Mui-focusVisible:hover': {
179
+ // },
180
+ }
181
+ }));
182
+ function nn({
183
+ "data-testid": t,
184
+ children: e
185
+ }) {
186
+ const { open: n } = pe();
187
+ return /* @__PURE__ */ d(oe, { className: A.root, "data-testid": t, children: [
188
+ /* @__PURE__ */ i(jt, {}),
189
+ /* @__PURE__ */ i(
190
+ se,
191
+ {
192
+ variant: "permanent",
193
+ anchor: "left",
194
+ transitionDuration: null,
195
+ open: n,
196
+ children: e
197
+ }
198
+ )
199
+ ] });
200
+ }
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", {
73
209
  shouldForwardProp: (t) => !["leftPanel", "rightPanel"].includes(t),
74
- name: C
210
+ name: T
75
211
  })(({ theme: t, leftPanel: e, rightPanel: n }) => {
76
- var o, c;
212
+ var o, l;
77
213
  return {
78
214
  width: "100%",
79
215
  [`& .${u.topStripe}`]: {
80
216
  width: "100%",
81
- height: `${jt}px`,
217
+ height: `${ge}px`,
82
218
  backgroundColor: t.palette.primary.main
83
219
  },
84
220
  [`& .${u.titleBar}`]: {
85
221
  backgroundColor: t.palette.primary.light,
86
- height: `${Qt}px`,
222
+ height: `${fe}px`,
87
223
  padding: t.spacing(0, 3),
88
224
  width: "100%"
89
225
  },
@@ -117,21 +253,21 @@ const jt = 24, Qt = 64, C = "TopBar", u = {
117
253
  easing: t.transitions.easing.easeOut,
118
254
  duration: t.transitions.duration.enteringScreen
119
255
  }),
120
- marginRight: `${(c = n == null ? void 0 : n.width) != null ? c : 0}px`
256
+ marginRight: `${(l = n == null ? void 0 : n.width) != null ? l : 0}px`
121
257
  })
122
258
  };
123
259
  });
124
- function Kt({
260
+ function me({
125
261
  titleText: t = "",
126
262
  leftPanel: e,
127
263
  rightPanel: n,
128
264
  "data-testid": o
129
265
  }) {
130
- return /* @__PURE__ */ l(Vt, { leftPanel: e, rightPanel: n, "data-testid": o, children: [
266
+ return /* @__PURE__ */ d(he, { leftPanel: e, rightPanel: n, "data-testid": o, children: [
131
267
  /* @__PURE__ */ i("div", { className: u.topStripe }),
132
- /* @__PURE__ */ i("div", { className: u.titleBar, children: /* @__PURE__ */ l(xt, { className: u.titleSlider, children: [
133
- e !== void 0 && !e.open && e.showOpenArrow && /* @__PURE__ */ l(
134
- pt,
268
+ /* @__PURE__ */ i("div", { className: u.titleBar, children: /* @__PURE__ */ d(It, { className: u.titleSlider, children: [
269
+ e !== void 0 && !e.open && e.showOpenArrow && /* @__PURE__ */ d(
270
+ ft,
135
271
  {
136
272
  className: u.leftPanelButton,
137
273
  color: "inherit",
@@ -141,13 +277,13 @@ function Kt({
141
277
  size: "large",
142
278
  children: [
143
279
  " ",
144
- /* @__PURE__ */ i(wt, {})
280
+ /* @__PURE__ */ i(St, {})
145
281
  ]
146
282
  }
147
283
  ),
148
- /* @__PURE__ */ i(E, { className: u.titleText, variant: "h6", noWrap: !0, children: t }),
149
- n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ l(
150
- pt,
284
+ /* @__PURE__ */ i(D, { className: u.titleText, variant: "h6", noWrap: !0, children: t }),
285
+ n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ d(
286
+ ft,
151
287
  {
152
288
  className: u.rightPanelButton,
153
289
  color: "inherit",
@@ -157,14 +293,14 @@ function Kt({
157
293
  size: "large",
158
294
  children: [
159
295
  " ",
160
- /* @__PURE__ */ i(vt, {})
296
+ /* @__PURE__ */ i(Ft, {})
161
297
  ]
162
298
  }
163
299
  )
164
300
  ] }) })
165
301
  ] });
166
302
  }
167
- const Ft = 400, Jt = k(_t, {
303
+ const Nt = 400, ve = L(bt, {
168
304
  shouldForwardProp: (t) => (
169
305
  // Note we do want anchor to be forwarded to the Drawer component
170
306
  ![
@@ -178,7 +314,7 @@ const Ft = 400, Jt = k(_t, {
178
314
  ),
179
315
  name: "SidePanelDrawer"
180
316
  })(
181
- ({ width: t, debugOpacity: e = !1, anchor: n, navBarOpen: o, navBarWidthOpen: c, navBarWidthClosed: m }) => ({
317
+ ({ width: t, debugOpacity: e = !1, anchor: n, navBarOpen: o, navBarWidthOpen: l, navBarWidthClosed: g }) => ({
182
318
  width: t,
183
319
  "& .MuiDrawer-paper": r(r({
184
320
  position: "absolute",
@@ -189,14 +325,14 @@ const Ft = 400, Jt = k(_t, {
189
325
  }, e && {
190
326
  opacity: "50%"
191
327
  }), n === "left" && r({
192
- marginLeft: `${m}px`
328
+ marginLeft: `${g}px`
193
329
  }, o && {
194
- marginLeft: `${c}px`
330
+ marginLeft: `${l}px`
195
331
  }))
196
332
  })
197
- ), Yt = k(Ht, {
333
+ ), xe = L(Yt, {
198
334
  shouldForwardProp: (t) => !["anchor"].includes(t)
199
- })(({ theme: t, anchor: e }) => v(r({
335
+ })(({ theme: t, anchor: e }) => B(r({
200
336
  display: "flex",
201
337
  alignItems: "center",
202
338
  padding: t.spacing(2)
@@ -214,64 +350,64 @@ const Ft = 400, Jt = k(_t, {
214
350
  marginRight: e === "right" ? t.spacing(2) : 0
215
351
  }
216
352
  }));
217
- function ft({
353
+ function vt({
218
354
  children: t,
219
355
  anchor: e = "left",
220
356
  open: n,
221
357
  onClose: o = () => {
222
358
  },
223
- titleText: c = "",
224
- width: m = Ft,
225
- showCloseArrow: h = !0,
226
- debugOpacity: d = !1,
227
- headerBoxProps: F = {},
228
- onOpened: f,
229
- onClosed: p,
230
- "data-testid": O,
231
- navBarOpen: T = !1,
232
- navBarWidthOpen: x = 0,
233
- navBarWidthClosed: y = 0
359
+ titleText: l = "",
360
+ width: g = Nt,
361
+ showCloseArrow: f = !0,
362
+ debugOpacity: x = !1,
363
+ headerBoxProps: h = {},
364
+ onOpened: c,
365
+ onClosed: m,
366
+ "data-testid": w,
367
+ navBarOpen: y = !1,
368
+ navBarWidthOpen: p = 0,
369
+ navBarWidthClosed: I = 0
234
370
  }) {
235
- return /* @__PURE__ */ l(
236
- Jt,
371
+ return /* @__PURE__ */ d(
372
+ ve,
237
373
  {
238
374
  SlideProps: {
239
- onEntered: () => f == null ? void 0 : f(),
240
- onExited: () => p == null ? void 0 : p()
375
+ onEntered: () => c == null ? void 0 : c(),
376
+ onExited: () => m == null ? void 0 : m()
241
377
  },
242
378
  variant: "persistent",
243
379
  anchor: e,
244
380
  open: n,
245
- width: m,
246
- debugOpacity: d,
247
- "data-testid": O,
248
- navBarOpen: T,
249
- navBarWidthOpen: x,
250
- navBarWidthClosed: y,
381
+ width: g,
382
+ debugOpacity: x,
383
+ "data-testid": w,
384
+ navBarOpen: y,
385
+ navBarWidthOpen: p,
386
+ navBarWidthClosed: I,
251
387
  children: [
252
- /* @__PURE__ */ i(Yt, v(r({ anchor: e }, F), { children: e === "left" ? /* @__PURE__ */ l(q, { children: [
253
- /* @__PURE__ */ i(E, { variant: "h6", color: "inherit", component: "div", children: c }),
254
- h && /* @__PURE__ */ l(ut, { onClick: o, size: "large", "aria-label": "Close left side panel", children: [
255
- /* @__PURE__ */ i(vt, { "data-testid": "arrowbackicon" }),
388
+ /* @__PURE__ */ i(xe, B(r({ anchor: e }, h), { children: e === "left" ? /* @__PURE__ */ d(U, { children: [
389
+ /* @__PURE__ */ i(D, { variant: "h6", color: "inherit", component: "div", children: l }),
390
+ f && /* @__PURE__ */ d(ht, { onClick: o, size: "large", "aria-label": "Close left side panel", children: [
391
+ /* @__PURE__ */ i(Ft, { "data-testid": "arrowbackicon" }),
256
392
  " "
257
393
  ] })
258
- ] }) : /* @__PURE__ */ l(q, { children: [
259
- h && /* @__PURE__ */ l(ut, { onClick: o, size: "large", "aria-label": "Close right side panel", children: [
260
- /* @__PURE__ */ i(wt, {}),
394
+ ] }) : /* @__PURE__ */ d(U, { children: [
395
+ f && /* @__PURE__ */ d(ht, { onClick: o, size: "large", "aria-label": "Close right side panel", children: [
396
+ /* @__PURE__ */ i(St, {}),
261
397
  " "
262
398
  ] }),
263
- /* @__PURE__ */ i(E, { variant: "h6", color: "inherit", component: "div", children: c })
399
+ /* @__PURE__ */ i(D, { variant: "h6", color: "inherit", component: "div", children: l })
264
400
  ] }) })),
265
401
  t
266
402
  ]
267
403
  }
268
404
  );
269
405
  }
270
- const Zt = k("div", {
406
+ const we = L("div", {
271
407
  shouldForwardProp: (t) => !["leftPanel", "rightPanel"].includes(t),
272
408
  name: "PanelAwareMargins"
273
409
  })(({ theme: t, leftPanel: e, rightPanel: n }) => {
274
- var o, c;
410
+ var o, l;
275
411
  return r(r({
276
412
  transition: t.transitions.create("margin", {
277
413
  easing: t.transitions.easing.sharp,
@@ -288,155 +424,155 @@ const Zt = k("div", {
288
424
  easing: t.transitions.easing.easeOut,
289
425
  duration: t.transitions.duration.enteringScreen
290
426
  }),
291
- marginRight: `${(c = n == null ? void 0 : n.width) != null ? c : 0}px`
427
+ marginRight: `${(l = n == null ? void 0 : n.width) != null ? l : 0}px`
292
428
  });
293
- }), te = k(Mt, {
429
+ }), Ce = L(Zt, {
294
430
  name: "PageContainer"
295
431
  })(({ theme: t }) => ({
296
432
  // Horizontal padding comes from the Container's gutter
297
433
  paddingTop: t.spacing(3),
298
434
  paddingBottom: t.spacing(3)
299
- })), Y = !1, Z = !1, z = {
435
+ })), tt = !1, et = !1, G = {
300
436
  titleText: "",
301
437
  flavour: "push",
302
- width: Ft,
438
+ width: Nt,
303
439
  arrowButtons: "both",
304
440
  startOpen: !1,
305
441
  open: void 0,
306
442
  onChangeOpen: void 0,
307
- content: /* @__PURE__ */ i(q, {}),
443
+ content: /* @__PURE__ */ i(U, {}),
308
444
  onOpened: void 0,
309
445
  onClosed: void 0,
310
446
  dataTestId: void 0
311
447
  };
312
- function Ae({
448
+ function rn({
313
449
  children: t,
314
450
  titleText: e = "",
315
451
  leftPanel: n,
316
452
  rightPanel: o,
317
- sidePanelsAreMutuallyExclusive: c = !0,
318
- debugOpacity: m = !1,
319
- pageContainerProps: h,
320
- pageContentDataTestId: d,
321
- topBarDataTestId: F,
322
- navBarOpen: f,
323
- navBarWidthOpen: p,
324
- navBarWidthClosed: O
453
+ sidePanelsAreMutuallyExclusive: l = !0,
454
+ debugOpacity: g = !1,
455
+ pageContainerProps: f,
456
+ pageContentDataTestId: x,
457
+ topBarDataTestId: h,
458
+ navBarOpen: c,
459
+ navBarWidthOpen: m,
460
+ navBarWidthClosed: w
325
461
  }) {
326
- const [T, x] = b(Y), [y, S] = b(Z), [N, D] = b(Y), [G, g] = b(Z), B = n !== void 0, I = o !== void 0, {
327
- titleText: L,
328
- content: s,
329
- flavour: a,
330
- open: P,
331
- onChangeOpen: et,
332
- width: U,
333
- arrowButtons: $,
334
- startOpen: R,
335
- onOpened: Tt,
336
- onClosed: yt,
337
- dataTestId: St
338
- } = n ? r(r({}, z), n) : r({}, z), {
339
- titleText: Bt,
340
- content: bt,
341
- flavour: nt,
342
- open: W,
343
- onChangeOpen: rt,
344
- width: X,
345
- arrowButtons: _,
346
- startOpen: H,
347
- onOpened: It,
348
- onClosed: Pt,
349
- dataTestId: At
350
- } = o ? r(r({}, z), o) : r({}, z);
351
- dt(() => {
352
- R !== Y && (x(R), D(R));
353
- }, [R]), dt(() => {
354
- H !== Z && (S(H), g(H));
355
- }, [H]);
356
- const j = P === void 0 ? T : P, Q = W === void 0 ? y : W, ot = (w) => {
357
- P === void 0 && (x(w), c && I && (w ? (S(!1), g(y)) : S(G))), et && et(w);
358
- }, it = (w) => {
359
- W === void 0 && (S(w), c && B && (w ? (x(!1), D(T)) : x(N))), rt && rt(w);
462
+ const [y, p] = b(tt), [I, S] = b(et), [q, M] = b(tt), [X, P] = b(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 && (S(z), P(z));
491
+ }, [z]);
492
+ const Q = N === void 0 ? y : N, K = V === void 0 ? I : V, st = (C) => {
493
+ N === void 0 && (p(C), l && E && (C ? (S(!1), P(I)) : S(X))), $ && $(C);
494
+ }, lt = (C) => {
495
+ V === void 0 && (S(C), l && k && (C ? (p(!1), M(y)) : p(q))), at && at(C);
360
496
  };
361
- return /* @__PURE__ */ l(xt, { children: [
362
- B && /* @__PURE__ */ i(
363
- ft,
497
+ return /* @__PURE__ */ d(It, { children: [
498
+ k && /* @__PURE__ */ i(
499
+ vt,
364
500
  {
365
- "data-testid": St,
501
+ "data-testid": Mt,
366
502
  anchor: "left",
367
- open: j,
368
- onClose: () => ot(!1),
369
- width: U,
370
- titleText: L,
371
- debugOpacity: m,
372
- showCloseArrow: $ === "both" || $ === "close",
373
- onOpened: Tt,
374
- onClosed: yt,
375
- navBarOpen: f,
376
- navBarWidthOpen: p,
377
- navBarWidthClosed: O,
378
- children: s
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: c,
512
+ navBarWidthOpen: m,
513
+ navBarWidthClosed: w,
514
+ children: R
379
515
  }
380
516
  ),
381
- I && /* @__PURE__ */ i(
382
- ft,
517
+ E && /* @__PURE__ */ i(
518
+ vt,
383
519
  {
384
- "data-testid": At,
520
+ "data-testid": Wt,
385
521
  anchor: "right",
386
- open: Q,
387
- onClose: () => it(!1),
388
- width: X,
389
- titleText: Bt,
390
- debugOpacity: m,
391
- showCloseArrow: _ === "both" || _ === "close",
392
- onOpened: It,
393
- onClosed: Pt,
394
- navBarOpen: f,
395
- navBarWidthOpen: p,
396
- navBarWidthClosed: O,
397
- children: bt
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: c,
531
+ navBarWidthOpen: m,
532
+ navBarWidthClosed: w,
533
+ children: _t
398
534
  }
399
535
  ),
400
536
  /* @__PURE__ */ i(
401
- Kt,
537
+ me,
402
538
  r(r({
403
539
  titleText: e,
404
- "data-testid": F
405
- }, B && a === "push" ? {
540
+ "data-testid": h
541
+ }, k && _ === "push" ? {
406
542
  leftPanel: {
407
- open: j,
408
- width: U,
409
- onOpen: () => ot(!0),
410
- showOpenArrow: $ === "both" || $ === "open"
543
+ open: Q,
544
+ width: a,
545
+ onOpen: () => st(!0),
546
+ showOpenArrow: s === "both" || s === "open"
411
547
  }
412
- } : {}), I && nt === "push" ? {
548
+ } : {}), E && it === "push" ? {
413
549
  rightPanel: {
414
- open: Q,
415
- width: X,
416
- onOpen: () => it(!0),
417
- showOpenArrow: _ === "both" || _ === "open"
550
+ open: K,
551
+ width: j,
552
+ onOpen: () => lt(!0),
553
+ showOpenArrow: H === "both" || H === "open"
418
554
  }
419
555
  } : {})
420
556
  ),
421
557
  /* @__PURE__ */ i(
422
- Zt,
423
- v(r(r({}, a === "push" ? {
558
+ we,
559
+ B(r(r({}, _ === "push" ? {
424
560
  leftPanel: {
425
- open: j,
426
- width: U
561
+ open: Q,
562
+ width: a
427
563
  }
428
- } : {}), nt === "push" ? {
564
+ } : {}), it === "push" ? {
429
565
  rightPanel: {
430
- open: Q,
431
- width: X
566
+ open: K,
567
+ width: j
432
568
  }
433
569
  } : {}), {
434
- children: /* @__PURE__ */ i(te, v(r({ "data-testid": d }, h), { children: t }))
570
+ children: /* @__PURE__ */ i(Ce, B(r({ "data-testid": x }, f), { children: t }))
435
571
  })
436
572
  )
437
573
  ] });
438
574
  }
439
- const ee = Ct({
575
+ const Be = Tt({
440
576
  palette: {
441
577
  primary: {
442
578
  main: "#007236",
@@ -490,18 +626,18 @@ const ee = Ct({
490
626
  styleOverrides: {
491
627
  root: ({ theme: t }) => ({
492
628
  "&.Mui-selected": {
493
- backgroundColor: J(
629
+ backgroundColor: Z(
494
630
  t.palette.secondary.main,
495
631
  t.palette.action.selectedOpacity
496
632
  ),
497
633
  "&:hover": {
498
- backgroundColor: J(
634
+ backgroundColor: Z(
499
635
  t.palette.secondary.main,
500
636
  t.palette.action.selectedOpacity
501
637
  )
502
638
  },
503
639
  "&.Mui-focusVisible": {
504
- backgroundColor: J(
640
+ backgroundColor: Z(
505
641
  t.palette.secondary.main,
506
642
  t.palette.action.focusOpacity
507
643
  )
@@ -524,7 +660,7 @@ const ee = Ct({
524
660
  fontWeight: 700
525
661
  }
526
662
  }
527
- }), ne = Ct({
663
+ }), Oe = Tt({
528
664
  palette: {
529
665
  primary: {
530
666
  dark: "#00A651",
@@ -573,133 +709,131 @@ const ee = Ct({
573
709
  }
574
710
  }
575
711
  });
576
- function Ee({
712
+ function on({
577
713
  name: t = "internal",
578
714
  children: e
579
715
  }) {
580
- return /* @__PURE__ */ i(zt, { theme: t === "internal" ? ee : t === "fed21" ? ne : void 0, children: e });
716
+ return /* @__PURE__ */ i(Qt, { theme: t === "internal" ? Be : t === "fed21" ? Oe : void 0, children: e });
581
717
  }
582
- class tt extends Xt {
583
- }
584
- lt(tt, "errorName", "ContextError");
585
- const A = () => {
586
- throw new tt("SaladBarContext can only be used in a child of a <SaladBarProvider>");
587
- }, re = (t) => {
588
- throw new tt("SaladBarContext can only be used in a child of a <SaladBarProvider>");
589
- }, oe = {
590
- enqueueNotification: A,
591
- enqueueSuccessNotification: A,
592
- enqueueInfoNotification: A,
593
- enqueueWarningNotification: A,
594
- enqueueErrorNotification: A,
595
- removeNotification: re
596
- }, Ot = Dt(oe), ie = {
718
+ const Te = {
597
719
  autoHideDuration: 6e3,
598
720
  anchorOrigin: { vertical: "top", horizontal: "center" },
599
721
  // The default is false. If we prefer timer to continue when window loses
600
722
  // focus, change to true
601
723
  disableWindowBlurListener: !1
602
- }, ae = {
724
+ }, be = {
603
725
  shouldClose: (t, e) => e !== "clickaway"
604
- }, gt = {
726
+ }, xt = {
605
727
  message: "",
606
728
  severity: "info",
607
729
  variant: "standard",
608
730
  progressIndicator: void 0
609
731
  // Can use 'circular' or 'linear'
610
- }, ht = 100, mt = 2e3, se = 2e3, ce = (() => {
732
+ }, wt = 100, Ct = 2e3, ye = 2e3, Ie = (() => {
611
733
  let t = 0;
612
734
  return () => (t += 1, t);
613
- })(), le = {
735
+ })(), Se = {
614
736
  borderBottomLeftRadius: "0px",
615
737
  borderBottomRightRadius: "0px"
616
- };
617
- function ke(o) {
618
- var c = o, {
619
- children: t,
620
- shouldClose: e = ae.shouldClose
621
- } = c, n = ct(c, [
622
- "children",
623
- "shouldClose"
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 = be.shouldClose,
744
+ children: o
745
+ } = f, l = pt(f, [
746
+ "overrideState",
747
+ "overrideActions",
748
+ "shouldClose",
749
+ "children"
624
750
  ]);
625
- var L;
626
- const [m, h] = b(!1), d = K([]), F = K(Date.now()), f = K(0), p = (s = {}) => {
627
- f.current += 1, d.current.length >= ht && Date.now() - F.current >= mt && (F.current = Date.now(), console.error(
628
- `SaladBarProvider: MAX_QUEUE_LENGTH (${ht}) hit ${f.current} times in last ${mt}ms)`
629
- ), f.current = 0);
630
- const a = r(v(r({}, gt), {
631
- key: ce()
632
- }), s);
633
- return d.current.push(a), d.current.length === 1 && h(!0), a.key;
634
- }, 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) => {
635
- const a = d.current.findIndex((P) => P.key === s);
636
- if (a !== -1)
637
- return a === 0 ? (h(!1), d.current[0]) : d.current.splice(a, 1);
638
- }, N = (s, a) => {
639
- e(s, a) && h(!1);
640
- }, D = () => {
641
- }, G = () => {
642
- d.current.shift(), d.current.length > 0 && h(!0);
643
- }, g = (L = d.current[0]) != null ? L : r({}, gt), B = {};
644
- "autoHideDuration" in g && (B.autoHideDuration = g.autoHideDuration);
645
- const I = r(r({}, ie), n);
646
- return (
647
- // Should be resolved when we move to React >= 18
648
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
649
- // @ts-ignore
650
- /* @__PURE__ */ l(
651
- Ot.Provider,
652
- {
653
- value: {
654
- enqueueNotification: p,
655
- enqueueSuccessNotification: O,
656
- enqueueInfoNotification: T,
657
- enqueueWarningNotification: x,
658
- enqueueErrorNotification: y,
659
- removeNotification: S
751
+ var $;
752
+ const [{ open: x }, h] = b({ open: !1 }), c = Y([]), m = Y(Date.now()), w = Y(0), y = nt((a) => {
753
+ h({ open: a });
754
+ }, []), p = nt((a = {}) => {
755
+ w.current += 1, c.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)`
757
+ ), w.current = 0);
758
+ const s = r(B(r({}, xt), {
759
+ key: Ie()
760
+ }), a);
761
+ return c.current.push(s), c.current.length === 1 && h({ open: !0 }), s.key;
762
+ }, []), I = (a = "", s = {}) => p(r({ message: a, severity: "success" }, s)), S = (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 = c.current.findIndex((F) => F.key === a);
764
+ if (s !== -1)
765
+ return s === 0 ? (h({ open: !1 }), c.current[0]) : c.current.splice(s, 1);
766
+ }, P = (a, s) => {
767
+ n(a, s) && h({ open: !1 });
768
+ }, k = () => {
769
+ }, E = () => {
770
+ c.current.shift(), c.current.length > 0 && h({ open: !0 });
771
+ }, v = ($ = c.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: y,
776
+ enqueueNotification: p,
777
+ enqueueSuccessNotification: I,
778
+ enqueueInfoNotification: S,
779
+ enqueueWarningNotification: q,
780
+ enqueueErrorNotification: M,
781
+ removeNotification: X
782
+ }, t), e);
783
+ return /* @__PURE__ */ d($t.Provider, { value: N, children: [
784
+ o,
785
+ /* @__PURE__ */ i(
786
+ te,
787
+ B(r(r({}, _), R), {
788
+ open: x,
789
+ onClose: P,
790
+ TransitionProps: {
791
+ onExited: E,
792
+ onExit: k
660
793
  },
661
- children: [
662
- t,
794
+ sx: { zIndex: ye },
795
+ children: /* @__PURE__ */ d("div", { children: [
663
796
  /* @__PURE__ */ i(
664
- qt,
665
- v(r(r({}, I), B), {
666
- open: m,
667
- onClose: N,
668
- TransitionProps: {
669
- onExited: G,
670
- onExit: D
671
- },
672
- sx: { zIndex: se },
673
- children: /* @__PURE__ */ l("div", { children: [
674
- /* @__PURE__ */ i(
675
- Gt,
676
- {
677
- onClose: (s) => N(s, "closeAlert"),
678
- severity: g.severity,
679
- variant: "filled",
680
- icon: g.progressIndicator === "circular" ? /* @__PURE__ */ i(Wt, { size: "1em" }) : void 0,
681
- style: g.progressIndicator === "linear" ? le : void 0,
682
- children: g.message
683
- }
684
- ),
685
- g.progressIndicator === "linear" && /* @__PURE__ */ i(Ut, { color: "primary" })
686
- ] })
687
- })
688
- )
689
- ]
690
- }
797
+ ee,
798
+ {
799
+ onClose: (a) => P(a, "closeAlert"),
800
+ severity: v.severity,
801
+ variant: "filled",
802
+ icon: v.progressIndicator === "circular" ? /* @__PURE__ */ i(re, { size: "1em" }) : void 0,
803
+ style: v.progressIndicator === "linear" ? Se : void 0,
804
+ children: v.message
805
+ }
806
+ ),
807
+ v.progressIndicator === "linear" && /* @__PURE__ */ i(ne, { color: "primary" })
808
+ ] })
809
+ })
691
810
  )
692
- );
811
+ ] });
693
812
  }
694
- function Ne() {
695
- return Lt(Ot);
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;
696
818
  }
819
+ const sn = yt(() => ({ children: t }) => /* @__PURE__ */ i(Pe, { children: t }));
697
820
  export {
698
- Ee as AgThemeProvider,
699
- tt as ContextError,
700
- Pe as ExampleComponent,
701
- Ae as PageLayout,
702
- ke as SaladBarProvider,
703
- Ne as useSaladBar
821
+ on as AgThemeProvider,
822
+ $t as Context,
823
+ ot as ContextError,
824
+ Ze as ExampleComponent,
825
+ Pt as NAVBAR_WIDTH_CLOSED,
826
+ At as NAVBAR_WIDTH_OPENED,
827
+ nn as NavBar,
828
+ en as NavBarDarkStyledList,
829
+ de as NavBarProvider,
830
+ rn as PageLayout,
831
+ Pe as SaladBarProvider,
832
+ ue as buildNavBarState,
833
+ A as navBarClasses,
834
+ pe as useNavBar,
835
+ an as useSaladBar,
836
+ tn as withNavBarProvider,
837
+ sn as withSaladBarProvider
704
838
  };
705
839
  //# sourceMappingURL=index.js.map