@australiangreens/ag-internal-components 0.0.26 → 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 (48) 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 -311
  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.map +1 -0
  22. package/dist/layouts/PageLayout/PanelAwareMargins.d.ts.map +1 -0
  23. package/dist/layouts/PageLayout/SidePanel.d.ts.map +1 -0
  24. package/dist/layouts/PageLayout/TopBar.d.ts.map +1 -0
  25. package/dist/layouts/PageLayout/index.d.ts.map +1 -0
  26. package/dist/layouts/index.d.ts +3 -0
  27. package/dist/layouts/index.d.ts.map +1 -0
  28. package/dist/providers/SaladBar/SaladBarContext.d.ts +15 -25
  29. package/dist/providers/SaladBar/SaladBarContext.d.ts.map +1 -1
  30. package/dist/providers/SaladBar/index.d.ts +3 -2
  31. package/dist/providers/SaladBar/index.d.ts.map +1 -1
  32. package/dist/providers/SaladBar/types.d.ts +44 -0
  33. package/dist/providers/SaladBar/types.d.ts.map +1 -0
  34. package/dist/providers/SaladBar/useSaladBar.d.ts +3 -8
  35. package/dist/providers/SaladBar/useSaladBar.d.ts.map +1 -1
  36. package/package.json +15 -2
  37. package/dist/components/PageLayout/PageContainer.d.ts.map +0 -1
  38. package/dist/components/PageLayout/PanelAwareMargins.d.ts.map +0 -1
  39. package/dist/components/PageLayout/SidePanel.d.ts.map +0 -1
  40. package/dist/components/PageLayout/TopBar.d.ts.map +0 -1
  41. package/dist/components/PageLayout/index.d.ts.map +0 -1
  42. package/dist/providers/SaladBar/SaladBarProvider.d.ts +0 -11
  43. package/dist/providers/SaladBar/SaladBarProvider.d.ts.map +0 -1
  44. /package/dist/{components → layouts}/PageLayout/PageContainer.d.ts +0 -0
  45. /package/dist/{components → layouts}/PageLayout/PanelAwareMargins.d.ts +0 -0
  46. /package/dist/{components → layouts}/PageLayout/SidePanel.d.ts +0 -0
  47. /package/dist/{components → layouts}/PageLayout/TopBar.d.ts +0 -0
  48. /package/dist/{components → layouts}/PageLayout/index.d.ts +0 -0
package/dist/esm/index.js CHANGED
@@ -1,51 +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
- import { createHelper as jt } from "souvlaki";
42
- function ke({ 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 }) {
43
45
  const [e, n] = b(0);
44
- return /* @__PURE__ */ l(q, { children: [
45
- /* @__PURE__ */ i(E, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
46
- /* @__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" }) }),
47
49
  /* @__PURE__ */ i(
48
- $t,
50
+ Xt,
49
51
  {
50
52
  variant: "outlined",
51
53
  onClick: () => n((o) => o + 1),
@@ -53,38 +55,171 @@ function ke({ text: t }) {
53
55
  children: "Hello I am a button"
54
56
  }
55
57
  ),
56
- /* @__PURE__ */ l("p", { children: [
58
+ /* @__PURE__ */ d("p", { children: [
57
59
  "This is some text: ",
58
60
  /* @__PURE__ */ i("span", { children: t })
59
61
  ] }),
60
- /* @__PURE__ */ l(Rt, { children: [
62
+ /* @__PURE__ */ d(Vt, { children: [
61
63
  "This number will incremember when button pressed: ",
62
64
  e
63
65
  ] })
64
66
  ] });
65
67
  }
66
- const Qt = 24, Vt = 64, C = "TopBar", u = {
67
- topStripe: `${C}-topStripe`,
68
- titleBar: `${C}-titleBar`,
69
- titleSlider: `${C}-titleSlider`,
70
- titleText: `${C}-titleText`,
71
- leftPanelButton: `${C}-leftPanelButton`,
72
- rightPanelButton: `${C}-leftPanelButton`
73
- }, Kt = 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", {
74
209
  shouldForwardProp: (t) => !["leftPanel", "rightPanel"].includes(t),
75
- name: C
210
+ name: T
76
211
  })(({ theme: t, leftPanel: e, rightPanel: n }) => {
77
- var o, c;
212
+ var o, l;
78
213
  return {
79
214
  width: "100%",
80
215
  [`& .${u.topStripe}`]: {
81
216
  width: "100%",
82
- height: `${Qt}px`,
217
+ height: `${ge}px`,
83
218
  backgroundColor: t.palette.primary.main
84
219
  },
85
220
  [`& .${u.titleBar}`]: {
86
221
  backgroundColor: t.palette.primary.light,
87
- height: `${Vt}px`,
222
+ height: `${fe}px`,
88
223
  padding: t.spacing(0, 3),
89
224
  width: "100%"
90
225
  },
@@ -118,21 +253,21 @@ const Qt = 24, Vt = 64, C = "TopBar", u = {
118
253
  easing: t.transitions.easing.easeOut,
119
254
  duration: t.transitions.duration.enteringScreen
120
255
  }),
121
- 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`
122
257
  })
123
258
  };
124
259
  });
125
- function Jt({
260
+ function me({
126
261
  titleText: t = "",
127
262
  leftPanel: e,
128
263
  rightPanel: n,
129
264
  "data-testid": o
130
265
  }) {
131
- return /* @__PURE__ */ l(Kt, { leftPanel: e, rightPanel: n, "data-testid": o, children: [
266
+ return /* @__PURE__ */ d(he, { leftPanel: e, rightPanel: n, "data-testid": o, children: [
132
267
  /* @__PURE__ */ i("div", { className: u.topStripe }),
133
- /* @__PURE__ */ i("div", { className: u.titleBar, children: /* @__PURE__ */ l(xt, { className: u.titleSlider, children: [
134
- e !== void 0 && !e.open && e.showOpenArrow && /* @__PURE__ */ l(
135
- 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,
136
271
  {
137
272
  className: u.leftPanelButton,
138
273
  color: "inherit",
@@ -142,13 +277,13 @@ function Jt({
142
277
  size: "large",
143
278
  children: [
144
279
  " ",
145
- /* @__PURE__ */ i(wt, {})
280
+ /* @__PURE__ */ i(St, {})
146
281
  ]
147
282
  }
148
283
  ),
149
- /* @__PURE__ */ i(E, { className: u.titleText, variant: "h6", noWrap: !0, children: t }),
150
- n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ l(
151
- 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,
152
287
  {
153
288
  className: u.rightPanelButton,
154
289
  color: "inherit",
@@ -158,14 +293,14 @@ function Jt({
158
293
  size: "large",
159
294
  children: [
160
295
  " ",
161
- /* @__PURE__ */ i(vt, {})
296
+ /* @__PURE__ */ i(Ft, {})
162
297
  ]
163
298
  }
164
299
  )
165
300
  ] }) })
166
301
  ] });
167
302
  }
168
- const Ft = 400, Yt = k(_t, {
303
+ const Nt = 400, ve = L(bt, {
169
304
  shouldForwardProp: (t) => (
170
305
  // Note we do want anchor to be forwarded to the Drawer component
171
306
  ![
@@ -179,7 +314,7 @@ const Ft = 400, Yt = k(_t, {
179
314
  ),
180
315
  name: "SidePanelDrawer"
181
316
  })(
182
- ({ 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 }) => ({
183
318
  width: t,
184
319
  "& .MuiDrawer-paper": r(r({
185
320
  position: "absolute",
@@ -190,14 +325,14 @@ const Ft = 400, Yt = k(_t, {
190
325
  }, e && {
191
326
  opacity: "50%"
192
327
  }), n === "left" && r({
193
- marginLeft: `${m}px`
328
+ marginLeft: `${g}px`
194
329
  }, o && {
195
- marginLeft: `${c}px`
330
+ marginLeft: `${l}px`
196
331
  }))
197
332
  })
198
- ), Zt = k(Ht, {
333
+ ), xe = L(Yt, {
199
334
  shouldForwardProp: (t) => !["anchor"].includes(t)
200
- })(({ theme: t, anchor: e }) => v(r({
335
+ })(({ theme: t, anchor: e }) => B(r({
201
336
  display: "flex",
202
337
  alignItems: "center",
203
338
  padding: t.spacing(2)
@@ -215,64 +350,64 @@ const Ft = 400, Yt = k(_t, {
215
350
  marginRight: e === "right" ? t.spacing(2) : 0
216
351
  }
217
352
  }));
218
- function ft({
353
+ function vt({
219
354
  children: t,
220
355
  anchor: e = "left",
221
356
  open: n,
222
357
  onClose: o = () => {
223
358
  },
224
- titleText: c = "",
225
- width: m = Ft,
226
- showCloseArrow: h = !0,
227
- debugOpacity: d = !1,
228
- headerBoxProps: F = {},
229
- onOpened: f,
230
- onClosed: p,
231
- "data-testid": O,
232
- navBarOpen: T = !1,
233
- navBarWidthOpen: x = 0,
234
- 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
235
370
  }) {
236
- return /* @__PURE__ */ l(
237
- Yt,
371
+ return /* @__PURE__ */ d(
372
+ ve,
238
373
  {
239
374
  SlideProps: {
240
- onEntered: () => f == null ? void 0 : f(),
241
- onExited: () => p == null ? void 0 : p()
375
+ onEntered: () => c == null ? void 0 : c(),
376
+ onExited: () => m == null ? void 0 : m()
242
377
  },
243
378
  variant: "persistent",
244
379
  anchor: e,
245
380
  open: n,
246
- width: m,
247
- debugOpacity: d,
248
- "data-testid": O,
249
- navBarOpen: T,
250
- navBarWidthOpen: x,
251
- navBarWidthClosed: y,
381
+ width: g,
382
+ debugOpacity: x,
383
+ "data-testid": w,
384
+ navBarOpen: y,
385
+ navBarWidthOpen: p,
386
+ navBarWidthClosed: I,
252
387
  children: [
253
- /* @__PURE__ */ i(Zt, v(r({ anchor: e }, F), { children: e === "left" ? /* @__PURE__ */ l(q, { children: [
254
- /* @__PURE__ */ i(E, { variant: "h6", color: "inherit", component: "div", children: c }),
255
- h && /* @__PURE__ */ l(ut, { onClick: o, size: "large", "aria-label": "Close left side panel", children: [
256
- /* @__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" }),
257
392
  " "
258
393
  ] })
259
- ] }) : /* @__PURE__ */ l(q, { children: [
260
- h && /* @__PURE__ */ l(ut, { onClick: o, size: "large", "aria-label": "Close right side panel", children: [
261
- /* @__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, {}),
262
397
  " "
263
398
  ] }),
264
- /* @__PURE__ */ i(E, { variant: "h6", color: "inherit", component: "div", children: c })
399
+ /* @__PURE__ */ i(D, { variant: "h6", color: "inherit", component: "div", children: l })
265
400
  ] }) })),
266
401
  t
267
402
  ]
268
403
  }
269
404
  );
270
405
  }
271
- const te = k("div", {
406
+ const we = L("div", {
272
407
  shouldForwardProp: (t) => !["leftPanel", "rightPanel"].includes(t),
273
408
  name: "PanelAwareMargins"
274
409
  })(({ theme: t, leftPanel: e, rightPanel: n }) => {
275
- var o, c;
410
+ var o, l;
276
411
  return r(r({
277
412
  transition: t.transitions.create("margin", {
278
413
  easing: t.transitions.easing.sharp,
@@ -289,155 +424,155 @@ const te = k("div", {
289
424
  easing: t.transitions.easing.easeOut,
290
425
  duration: t.transitions.duration.enteringScreen
291
426
  }),
292
- 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`
293
428
  });
294
- }), ee = k(Mt, {
429
+ }), Ce = L(Zt, {
295
430
  name: "PageContainer"
296
431
  })(({ theme: t }) => ({
297
432
  // Horizontal padding comes from the Container's gutter
298
433
  paddingTop: t.spacing(3),
299
434
  paddingBottom: t.spacing(3)
300
- })), Y = !1, Z = !1, z = {
435
+ })), tt = !1, et = !1, G = {
301
436
  titleText: "",
302
437
  flavour: "push",
303
- width: Ft,
438
+ width: Nt,
304
439
  arrowButtons: "both",
305
440
  startOpen: !1,
306
441
  open: void 0,
307
442
  onChangeOpen: void 0,
308
- content: /* @__PURE__ */ i(q, {}),
443
+ content: /* @__PURE__ */ i(U, {}),
309
444
  onOpened: void 0,
310
445
  onClosed: void 0,
311
446
  dataTestId: void 0
312
447
  };
313
- function Ne({
448
+ function rn({
314
449
  children: t,
315
450
  titleText: e = "",
316
451
  leftPanel: n,
317
452
  rightPanel: o,
318
- sidePanelsAreMutuallyExclusive: c = !0,
319
- debugOpacity: m = !1,
320
- pageContainerProps: h,
321
- pageContentDataTestId: d,
322
- topBarDataTestId: F,
323
- navBarOpen: f,
324
- navBarWidthOpen: p,
325
- 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
326
461
  }) {
327
- 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, {
328
- titleText: L,
329
- content: s,
330
- flavour: a,
331
- open: P,
332
- onChangeOpen: et,
333
- width: U,
334
- arrowButtons: $,
335
- startOpen: R,
336
- onOpened: Tt,
337
- onClosed: yt,
338
- dataTestId: St
339
- } = n ? r(r({}, z), n) : r({}, z), {
340
- titleText: Bt,
341
- content: bt,
342
- flavour: nt,
343
- open: W,
344
- onChangeOpen: rt,
345
- width: X,
346
- arrowButtons: _,
347
- startOpen: H,
348
- onOpened: It,
349
- onClosed: Pt,
350
- dataTestId: At
351
- } = o ? r(r({}, z), o) : r({}, z);
352
- dt(() => {
353
- R !== Y && (x(R), D(R));
354
- }, [R]), dt(() => {
355
- H !== Z && (S(H), g(H));
356
- }, [H]);
357
- const j = P === void 0 ? T : P, Q = W === void 0 ? y : W, ot = (w) => {
358
- P === void 0 && (x(w), c && I && (w ? (S(!1), g(y)) : S(G))), et && et(w);
359
- }, it = (w) => {
360
- 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);
361
496
  };
362
- return /* @__PURE__ */ l(xt, { children: [
363
- B && /* @__PURE__ */ i(
364
- ft,
497
+ return /* @__PURE__ */ d(It, { children: [
498
+ k && /* @__PURE__ */ i(
499
+ vt,
365
500
  {
366
- "data-testid": St,
501
+ "data-testid": Mt,
367
502
  anchor: "left",
368
- open: j,
369
- onClose: () => ot(!1),
370
- width: U,
371
- titleText: L,
372
- debugOpacity: m,
373
- showCloseArrow: $ === "both" || $ === "close",
374
- onOpened: Tt,
375
- onClosed: yt,
376
- navBarOpen: f,
377
- navBarWidthOpen: p,
378
- navBarWidthClosed: O,
379
- 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
380
515
  }
381
516
  ),
382
- I && /* @__PURE__ */ i(
383
- ft,
517
+ E && /* @__PURE__ */ i(
518
+ vt,
384
519
  {
385
- "data-testid": At,
520
+ "data-testid": Wt,
386
521
  anchor: "right",
387
- open: Q,
388
- onClose: () => it(!1),
389
- width: X,
390
- titleText: Bt,
391
- debugOpacity: m,
392
- showCloseArrow: _ === "both" || _ === "close",
393
- onOpened: It,
394
- onClosed: Pt,
395
- navBarOpen: f,
396
- navBarWidthOpen: p,
397
- navBarWidthClosed: O,
398
- 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
399
534
  }
400
535
  ),
401
536
  /* @__PURE__ */ i(
402
- Jt,
537
+ me,
403
538
  r(r({
404
539
  titleText: e,
405
- "data-testid": F
406
- }, B && a === "push" ? {
540
+ "data-testid": h
541
+ }, k && _ === "push" ? {
407
542
  leftPanel: {
408
- open: j,
409
- width: U,
410
- onOpen: () => ot(!0),
411
- showOpenArrow: $ === "both" || $ === "open"
543
+ open: Q,
544
+ width: a,
545
+ onOpen: () => st(!0),
546
+ showOpenArrow: s === "both" || s === "open"
412
547
  }
413
- } : {}), I && nt === "push" ? {
548
+ } : {}), E && it === "push" ? {
414
549
  rightPanel: {
415
- open: Q,
416
- width: X,
417
- onOpen: () => it(!0),
418
- showOpenArrow: _ === "both" || _ === "open"
550
+ open: K,
551
+ width: j,
552
+ onOpen: () => lt(!0),
553
+ showOpenArrow: H === "both" || H === "open"
419
554
  }
420
555
  } : {})
421
556
  ),
422
557
  /* @__PURE__ */ i(
423
- te,
424
- v(r(r({}, a === "push" ? {
558
+ we,
559
+ B(r(r({}, _ === "push" ? {
425
560
  leftPanel: {
426
- open: j,
427
- width: U
561
+ open: Q,
562
+ width: a
428
563
  }
429
- } : {}), nt === "push" ? {
564
+ } : {}), it === "push" ? {
430
565
  rightPanel: {
431
- open: Q,
432
- width: X
566
+ open: K,
567
+ width: j
433
568
  }
434
569
  } : {}), {
435
- children: /* @__PURE__ */ i(ee, v(r({ "data-testid": d }, h), { children: t }))
570
+ children: /* @__PURE__ */ i(Ce, B(r({ "data-testid": x }, f), { children: t }))
436
571
  })
437
572
  )
438
573
  ] });
439
574
  }
440
- const ne = Ct({
575
+ const Be = Tt({
441
576
  palette: {
442
577
  primary: {
443
578
  main: "#007236",
@@ -491,18 +626,18 @@ const ne = Ct({
491
626
  styleOverrides: {
492
627
  root: ({ theme: t }) => ({
493
628
  "&.Mui-selected": {
494
- backgroundColor: J(
629
+ backgroundColor: Z(
495
630
  t.palette.secondary.main,
496
631
  t.palette.action.selectedOpacity
497
632
  ),
498
633
  "&:hover": {
499
- backgroundColor: J(
634
+ backgroundColor: Z(
500
635
  t.palette.secondary.main,
501
636
  t.palette.action.selectedOpacity
502
637
  )
503
638
  },
504
639
  "&.Mui-focusVisible": {
505
- backgroundColor: J(
640
+ backgroundColor: Z(
506
641
  t.palette.secondary.main,
507
642
  t.palette.action.focusOpacity
508
643
  )
@@ -525,7 +660,7 @@ const ne = Ct({
525
660
  fontWeight: 700
526
661
  }
527
662
  }
528
- }), re = Ct({
663
+ }), Oe = Tt({
529
664
  palette: {
530
665
  primary: {
531
666
  dark: "#00A651",
@@ -574,135 +709,131 @@ const ne = Ct({
574
709
  }
575
710
  }
576
711
  });
577
- function De({
712
+ function on({
578
713
  name: t = "internal",
579
714
  children: e
580
715
  }) {
581
- return /* @__PURE__ */ i(zt, { theme: t === "internal" ? ne : t === "fed21" ? re : void 0, children: e });
716
+ return /* @__PURE__ */ i(Qt, { theme: t === "internal" ? Be : t === "fed21" ? Oe : void 0, children: e });
582
717
  }
583
- class tt extends Xt {
584
- }
585
- lt(tt, "errorName", "ContextError");
586
- const A = () => {
587
- throw new tt("SaladBarContext can only be used in a child of a <SaladBarProvider>");
588
- }, oe = (t) => {
589
- throw new tt("SaladBarContext can only be used in a child of a <SaladBarProvider>");
590
- }, ie = {
591
- enqueueNotification: A,
592
- enqueueSuccessNotification: A,
593
- enqueueInfoNotification: A,
594
- enqueueWarningNotification: A,
595
- enqueueErrorNotification: A,
596
- removeNotification: oe
597
- }, Ot = Dt(ie), ae = {
718
+ const Te = {
598
719
  autoHideDuration: 6e3,
599
720
  anchorOrigin: { vertical: "top", horizontal: "center" },
600
721
  // The default is false. If we prefer timer to continue when window loses
601
722
  // focus, change to true
602
723
  disableWindowBlurListener: !1
603
- }, se = {
724
+ }, be = {
604
725
  shouldClose: (t, e) => e !== "clickaway"
605
- }, gt = {
726
+ }, xt = {
606
727
  message: "",
607
728
  severity: "info",
608
729
  variant: "standard",
609
730
  progressIndicator: void 0
610
731
  // Can use 'circular' or 'linear'
611
- }, ht = 100, mt = 2e3, ce = 2e3, le = (() => {
732
+ }, wt = 100, Ct = 2e3, ye = 2e3, Ie = (() => {
612
733
  let t = 0;
613
734
  return () => (t += 1, t);
614
- })(), de = {
735
+ })(), Se = {
615
736
  borderBottomLeftRadius: "0px",
616
737
  borderBottomRightRadius: "0px"
617
- };
618
- function pe(o) {
619
- var c = o, {
620
- children: t,
621
- shouldClose: e = se.shouldClose
622
- } = c, n = ct(c, [
623
- "children",
624
- "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"
625
750
  ]);
626
- var L;
627
- const [m, h] = b(!1), d = K([]), F = K(Date.now()), f = K(0), p = (s = {}) => {
628
- f.current += 1, d.current.length >= ht && Date.now() - F.current >= mt && (F.current = Date.now(), console.error(
629
- `SaladBarProvider: MAX_QUEUE_LENGTH (${ht}) hit ${f.current} times in last ${mt}ms)`
630
- ), f.current = 0);
631
- const a = r(v(r({}, gt), {
632
- key: le()
633
- }), s);
634
- return d.current.push(a), d.current.length === 1 && h(!0), a.key;
635
- }, O = (s = "", a = {}) => p(r({ message: s, severity: "success" }, a)), T = (s = "", a = {}) => p(r({ message: s, severity: "info" }, a)), x = (s = "", a = {}) => p(r({ message: s, severity: "warning" }, a)), y = (s = "", a = {}) => p(r({ message: s, severity: "error" }, a)), S = (s) => {
636
- const a = d.current.findIndex((P) => P.key === s);
637
- if (a !== -1)
638
- return a === 0 ? (h(!1), d.current[0]) : d.current.splice(a, 1);
639
- }, N = (s, a) => {
640
- e(s, a) && h(!1);
641
- }, D = () => {
642
- }, G = () => {
643
- d.current.shift(), d.current.length > 0 && h(!0);
644
- }, g = (L = d.current[0]) != null ? L : r({}, gt), B = {};
645
- "autoHideDuration" in g && (B.autoHideDuration = g.autoHideDuration);
646
- const I = r(r({}, ae), n);
647
- return (
648
- // Should be resolved when we move to React >= 18
649
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
650
- // @ts-ignore
651
- /* @__PURE__ */ l(
652
- Ot.Provider,
653
- {
654
- value: {
655
- enqueueNotification: p,
656
- enqueueSuccessNotification: O,
657
- enqueueInfoNotification: T,
658
- enqueueWarningNotification: x,
659
- enqueueErrorNotification: y,
660
- 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
661
793
  },
662
- children: [
663
- t,
794
+ sx: { zIndex: ye },
795
+ children: /* @__PURE__ */ d("div", { children: [
664
796
  /* @__PURE__ */ i(
665
- qt,
666
- v(r(r({}, I), B), {
667
- open: m,
668
- onClose: N,
669
- TransitionProps: {
670
- onExited: G,
671
- onExit: D
672
- },
673
- sx: { zIndex: ce },
674
- children: /* @__PURE__ */ l("div", { children: [
675
- /* @__PURE__ */ i(
676
- Gt,
677
- {
678
- onClose: (s) => N(s, "closeAlert"),
679
- severity: g.severity,
680
- variant: "filled",
681
- icon: g.progressIndicator === "circular" ? /* @__PURE__ */ i(Wt, { size: "1em" }) : void 0,
682
- style: g.progressIndicator === "linear" ? de : void 0,
683
- children: g.message
684
- }
685
- ),
686
- g.progressIndicator === "linear" && /* @__PURE__ */ i(Ut, { color: "primary" })
687
- ] })
688
- })
689
- )
690
- ]
691
- }
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
+ })
692
810
  )
693
- );
811
+ ] });
694
812
  }
695
- function Le() {
696
- 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;
697
818
  }
698
- const $e = jt(() => ({ children: t }) => /* @__PURE__ */ i(pe, { children: t }));
819
+ const sn = yt(() => ({ children: t }) => /* @__PURE__ */ i(Pe, { children: t }));
699
820
  export {
700
- De as AgThemeProvider,
701
- tt as ContextError,
702
- ke as ExampleComponent,
703
- Ne as PageLayout,
704
- pe as SaladBarProvider,
705
- Le as useSaladBar,
706
- $e as withSaladBarProvider
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
707
838
  };
708
839
  //# sourceMappingURL=index.js.map