@australiangreens/ag-internal-components 0.0.45 → 0.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -38,7 +38,7 @@ var K = (e, t, n) => new Promise((r, a) => {
38
38
  });
39
39
  import { jsxs as c, Fragment as M, jsx as o } from "react/jsx-runtime";
40
40
  import { useState as D, createContext as He, useCallback as ne, useContext as Re, useEffect as oe, useRef as ce } from "react";
41
- import { Typography as $, Button as bt, Paper as We, styled as X, Box as T, IconButton as V, Drawer as At, Container as ze, Avatar as Ie, Skeleton as Te, Divider as Oe, CssBaseline as St, Snackbar as It, Alert as Tt, CircularProgress as Ge, LinearProgress as Ot, Autocomplete as Dt, TextField as $t, FormHelperText as kt } from "@mui/material";
41
+ import { Typography as k, Button as bt, Paper as We, styled as X, Box as T, IconButton as V, Drawer as At, Container as ze, Snackbar as St, Alert as It, CircularProgress as Ge, LinearProgress as Tt, Avatar as Ie, Skeleton as Te, Divider as Oe, CssBaseline as Ot, Autocomplete as Dt, TextField as kt, FormHelperText as $t } from "@mui/material";
42
42
  import Bt from "@mui/material/CssBaseline";
43
43
  import { styled as _, createTheme as Ue, alpha as pe } from "@mui/material/styles";
44
44
  import Ve from "@mui/material/Drawer";
@@ -51,14 +51,13 @@ import Ft from "@mui/material/DialogActions";
51
51
  import Lt from "@mui/material/DialogContent";
52
52
  import yt from "@mui/material/DialogTitle";
53
53
  import { ArrowForward as qe, ArrowBack as je, ViewHeadline as Pt } from "@mui/icons-material";
54
- import { useSetLibraryAtom as Mt, useLibraryAtom as y } from "src/providers";
55
- import { atom as k, getDefaultStore as _t, Provider as Ye, useAtom as Ht, useSetAtom as Rt } from "jotai";
56
- import { useHydrateAtoms as Wt } from "jotai/utils";
57
- function no({ text: e }) {
54
+ import { getDefaultStore as Mt, Provider as Ye, useAtom as _t, useSetAtom as Ht, atom as $ } from "jotai";
55
+ import { useHydrateAtoms as Rt } from "jotai/utils";
56
+ function eo({ text: e }) {
58
57
  const [t, n] = D(0);
59
58
  return /* @__PURE__ */ c(M, { children: [
60
- /* @__PURE__ */ o($, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
61
- /* @__PURE__ */ o($, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
59
+ /* @__PURE__ */ o(k, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
60
+ /* @__PURE__ */ o(k, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
62
61
  /* @__PURE__ */ o(
63
62
  bt,
64
63
  {
@@ -86,7 +85,7 @@ const Qe = 330, Je = 73, E = "Navbar", P = {
86
85
  userInfoHolder: `${E}-userInfoHolder`,
87
86
  settings: `${E}-settings`,
88
87
  pieChartIcon: `${E}-pieChartIcon`
89
- }, zt = _("div", { name: "NavBar" })(({ theme: e }) => ({
88
+ }, Wt = _("div", { name: "NavBar" })(({ theme: e }) => ({
90
89
  [`&.${P.root}`]: {
91
90
  display: "flex"
92
91
  },
@@ -113,11 +112,11 @@ const Qe = 330, Je = 73, E = "Navbar", P = {
113
112
  color: "white",
114
113
  backgroundColor: "black"
115
114
  // backgroundColor: '#e8e8e8',
116
- }), Gt = () => i({
115
+ }), zt = () => i({
117
116
  width: Qe
118
- }, Ke()), Ut = () => i({
117
+ }, Ke()), Gt = () => i({
119
118
  width: Je
120
- }, Ke()), Vt = _(Ve, {
119
+ }, Ke()), Ut = _(Ve, {
121
120
  shouldForwardProp: (e) => e !== "open"
122
121
  })(({ theme: e, open: t }) => i(i({
123
122
  width: t ? Qe : Je,
@@ -126,16 +125,16 @@ const Qe = 330, Je = 73, E = "Navbar", P = {
126
125
  boxSizing: "border-box",
127
126
  zIndex: e.zIndex.drawer + 100
128
127
  }, t && {
129
- "& .MuiDrawer-paper": Gt()
128
+ "& .MuiDrawer-paper": zt()
130
129
  }), !t && {
131
- "& .MuiDrawer-paper": Ut()
130
+ "& .MuiDrawer-paper": Gt()
132
131
  }));
133
132
  class he extends Nt {
134
133
  }
135
134
  Se(he, "errorName", "ContextError");
136
- const Ze = He(null), Xt = {}, qt = {}, jt = ({
137
- overrideState: e = Xt,
138
- overrideActions: t = qt,
135
+ const Ze = He(null), Vt = {}, Xt = {}, qt = ({
136
+ overrideState: e = Vt,
137
+ overrideActions: t = Xt,
139
138
  children: n
140
139
  }) => {
141
140
  const [{ open: r }, a] = D({ open: !0 }), l = ne((s) => {
@@ -148,16 +147,16 @@ const Ze = He(null), Xt = {}, qt = {}, jt = ({
148
147
  toggleOpen: p
149
148
  }, e), t);
150
149
  return /* @__PURE__ */ o(Ze.Provider, { value: u, children: n });
151
- }, Yt = () => {
150
+ }, jt = () => {
152
151
  const e = Re(Ze);
153
152
  if (e === null)
154
153
  throw new he("Error: Tried to useNavBar outside of a <NavBarProvider>");
155
154
  return e;
156
- }, Qt = (e = {}) => i({
155
+ }, Yt = (e = {}) => i({
157
156
  open: !0
158
- }, e), oo = re(
159
- (e = Qt(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(jt, { overrideState: e, overrideActions: t, children: n })
160
- ), $e = 7, ro = _(Xe)(({ theme: e }) => ({
157
+ }, e), to = re(
158
+ (e = Yt(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(qt, { overrideState: e, overrideActions: t, children: n })
159
+ ), ke = 7, no = _(Xe)(({ theme: e }) => ({
161
160
  backgroundColor: "black",
162
161
  color: "white",
163
162
  "& .MuiListItem-root": {
@@ -166,7 +165,7 @@ const Ze = He(null), Xt = {}, qt = {}, jt = ({
166
165
  "& .MuiListItemButton-root": {
167
166
  " .MuiListItemIcon-root": {
168
167
  color: "white",
169
- padding: `${$e}px`
168
+ padding: `${ke}px`
170
169
  },
171
170
  // Focus state
172
171
  "&.Mui-focusVisible": {
@@ -177,7 +176,7 @@ const Ze = He(null), Xt = {}, qt = {}, jt = ({
177
176
  borderLeftStyle: "solid",
178
177
  borderLeftWidth: "7px",
179
178
  borderLeftColor: e.palette.primary.main,
180
- paddingLeft: `calc(${e.spacing(2)} - ${$e}px)`
179
+ paddingLeft: `calc(${e.spacing(2)} - ${ke}px)`
181
180
  },
182
181
  // Hover state
183
182
  "&:hover": {
@@ -195,7 +194,7 @@ const Ze = He(null), Xt = {}, qt = {}, jt = ({
195
194
  // '&.Mui-selected.Mui-focusVisible:hover': {
196
195
  // },
197
196
  }
198
- })), ke = 7, io = _(Xe)(({ theme: e }) => ({
197
+ })), $e = 7, oo = _(Xe)(({ theme: e }) => ({
199
198
  backgroundColor: "#e8e8e8",
200
199
  color: "inherit",
201
200
  "& .MuiListItem-root": {
@@ -204,7 +203,7 @@ const Ze = He(null), Xt = {}, qt = {}, jt = ({
204
203
  "& .MuiListItemButton-root": {
205
204
  " .MuiListItemIcon-root": {
206
205
  color: "inherit",
207
- padding: `${ke}px`
206
+ padding: `${$e}px`
208
207
  },
209
208
  // Focus state
210
209
  "&.Mui-focusVisible": {
@@ -215,7 +214,7 @@ const Ze = He(null), Xt = {}, qt = {}, jt = ({
215
214
  borderLeftStyle: "solid",
216
215
  borderLeftWidth: "7px",
217
216
  borderLeftColor: e.palette.primary.main,
218
- paddingLeft: `calc(${e.spacing(2)} - ${ke}px)`
217
+ paddingLeft: `calc(${e.spacing(2)} - ${$e}px)`
219
218
  },
220
219
  // Hover state
221
220
  "&:hover": {
@@ -234,15 +233,15 @@ const Ze = He(null), Xt = {}, qt = {}, jt = ({
234
233
  // },
235
234
  }
236
235
  }));
237
- function ao({
236
+ function ro({
238
237
  "data-testid": e,
239
238
  children: t
240
239
  }) {
241
- const { open: n } = Yt();
242
- return /* @__PURE__ */ c(zt, { className: P.root, "data-testid": e, children: [
240
+ const { open: n } = jt();
241
+ return /* @__PURE__ */ c(Wt, { className: P.root, "data-testid": e, children: [
243
242
  /* @__PURE__ */ o(Bt, {}),
244
243
  /* @__PURE__ */ o(
245
- Vt,
244
+ Ut,
246
245
  {
247
246
  variant: "permanent",
248
247
  anchor: "left",
@@ -253,7 +252,7 @@ function ao({
253
252
  )
254
253
  ] });
255
254
  }
256
- const Jt = ({
255
+ const Qt = ({
257
256
  isOpen: e,
258
257
  dialogTitle: t,
259
258
  children: n,
@@ -304,14 +303,14 @@ const Jt = ({
304
303
  ]
305
304
  }
306
305
  );
307
- }, Kt = 24, Zt = 64, F = "TopBar", b = {
306
+ }, Jt = 24, Kt = 64, F = "TopBar", b = {
308
307
  topStripe: `${F}-topStripe`,
309
308
  titleBar: `${F}-titleBar`,
310
309
  titleSlider: `${F}-titleSlider`,
311
310
  titleText: `${F}-titleText`,
312
311
  leftPanelButton: `${F}-leftPanelButton`,
313
312
  rightPanelButton: `${F}-leftPanelButton`
314
- }, en = X("div", {
313
+ }, Zt = X("div", {
315
314
  shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
316
315
  name: F
317
316
  })(({ theme: e, leftPanel: t, rightPanel: n }) => {
@@ -320,12 +319,12 @@ const Jt = ({
320
319
  width: "100%",
321
320
  [`& .${b.topStripe}`]: {
322
321
  width: "100%",
323
- height: `${Kt}px`,
322
+ height: `${Jt}px`,
324
323
  backgroundColor: e.palette.primary.main
325
324
  },
326
325
  [`& .${b.titleBar}`]: {
327
326
  backgroundColor: e.palette.primary.light,
328
- height: `${Zt}px`,
327
+ height: `${Kt}px`,
329
328
  padding: e.spacing(0, 3),
330
329
  width: "100%"
331
330
  },
@@ -363,13 +362,13 @@ const Jt = ({
363
362
  })
364
363
  };
365
364
  });
366
- function tn({
365
+ function en({
367
366
  titleText: e = "",
368
367
  leftPanel: t,
369
368
  rightPanel: n,
370
369
  "data-testid": r
371
370
  }) {
372
- return /* @__PURE__ */ c(en, { leftPanel: t, rightPanel: n, "data-testid": r, children: [
371
+ return /* @__PURE__ */ c(Zt, { leftPanel: t, rightPanel: n, "data-testid": r, children: [
373
372
  /* @__PURE__ */ o("div", { className: b.topStripe }),
374
373
  /* @__PURE__ */ o("div", { className: b.titleBar, children: /* @__PURE__ */ c(T, { className: b.titleSlider, children: [
375
374
  t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ c(
@@ -387,7 +386,7 @@ function tn({
387
386
  ]
388
387
  }
389
388
  ),
390
- /* @__PURE__ */ o($, { className: b.titleText, variant: "h6", noWrap: !0, children: e }),
389
+ /* @__PURE__ */ o(k, { className: b.titleText, variant: "h6", noWrap: !0, children: e }),
391
390
  n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ c(
392
391
  V,
393
392
  {
@@ -406,7 +405,7 @@ function tn({
406
405
  ] }) })
407
406
  ] });
408
407
  }
409
- const et = 400, nn = X(At, {
408
+ const et = 400, tn = X(At, {
410
409
  shouldForwardProp: (e) => (
411
410
  // Note we do want anchor to be forwarded to the Drawer component
412
411
  ![
@@ -436,7 +435,7 @@ const et = 400, nn = X(At, {
436
435
  marginLeft: `${a}px`
437
436
  }))
438
437
  })
439
- ), on = X(T, {
438
+ ), nn = X(T, {
440
439
  shouldForwardProp: (e) => !["anchor"].includes(e)
441
440
  })(({ theme: e, anchor: t }) => x(i({
442
441
  display: "flex",
@@ -475,7 +474,7 @@ function Be({
475
474
  navBarWidthClosed: I = 0
476
475
  }) {
477
476
  return /* @__PURE__ */ c(
478
- nn,
477
+ tn,
479
478
  {
480
479
  SlideProps: {
481
480
  onEntered: () => d == null ? void 0 : d(),
@@ -491,8 +490,8 @@ function Be({
491
490
  navBarWidthOpen: m,
492
491
  navBarWidthClosed: I,
493
492
  children: [
494
- /* @__PURE__ */ o(on, x(i({ anchor: t }, s), { children: t === "left" ? /* @__PURE__ */ c(M, { children: [
495
- /* @__PURE__ */ o($, { variant: "h6", color: "inherit", component: "div", children: a }),
493
+ /* @__PURE__ */ o(nn, x(i({ anchor: t }, s), { children: t === "left" ? /* @__PURE__ */ c(M, { children: [
494
+ /* @__PURE__ */ o(k, { variant: "h6", color: "inherit", component: "div", children: a }),
496
495
  p && /* @__PURE__ */ c(V, { onClick: r, size: "large", "aria-label": "Close left side panel", children: [
497
496
  /* @__PURE__ */ o(je, { "data-testid": "arrowbackicon" }),
498
497
  " "
@@ -502,14 +501,14 @@ function Be({
502
501
  /* @__PURE__ */ o(qe, {}),
503
502
  " "
504
503
  ] }),
505
- /* @__PURE__ */ o($, { variant: "h6", color: "inherit", component: "div", children: a })
504
+ /* @__PURE__ */ o(k, { variant: "h6", color: "inherit", component: "div", children: a })
506
505
  ] }) })),
507
506
  e
508
507
  ]
509
508
  }
510
509
  );
511
510
  }
512
- const rn = X("div", {
511
+ const on = X("div", {
513
512
  shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
514
513
  name: "PanelAwareMargins"
515
514
  })(({ theme: e, leftPanel: t, rightPanel: n }) => {
@@ -532,7 +531,7 @@ const rn = X("div", {
532
531
  }),
533
532
  marginRight: `${(a = n == null ? void 0 : n.width) != null ? a : 0}px`
534
533
  });
535
- }), an = X(ze, {
534
+ }), rn = X(ze, {
536
535
  name: "PageContainer"
537
536
  })(({ theme: e }) => ({
538
537
  // Horizontal padding comes from the Container's gutter
@@ -551,7 +550,7 @@ const rn = X("div", {
551
550
  onClosed: void 0,
552
551
  dataTestId: void 0
553
552
  };
554
- function so({
553
+ function io({
555
554
  children: e,
556
555
  titleText: t = "",
557
556
  leftPanel: n,
@@ -573,7 +572,7 @@ function so({
573
572
  onChangeOpen: G,
574
573
  width: g,
575
574
  arrowButtons: h,
576
- startOpen: L,
575
+ startOpen: y,
577
576
  onOpened: ct,
578
577
  onClosed: pt,
579
578
  dataTestId: ut
@@ -591,8 +590,8 @@ function so({
591
590
  dataTestId: vt
592
591
  } = r ? i(i({}, Z), r) : i({}, Z);
593
592
  oe(() => {
594
- L !== ue && (m(L), S(L));
595
- }, [L]), oe(() => {
593
+ y !== ue && (m(y), S(y));
594
+ }, [y]), oe(() => {
596
595
  Q !== ge && (A(Q), H(Q));
597
596
  }, [Q]);
598
597
  const se = z === void 0 ? C : z, le = ie === void 0 ? I : ie, xe = (N) => {
@@ -640,7 +639,7 @@ function so({
640
639
  }
641
640
  ),
642
641
  /* @__PURE__ */ o(
643
- tn,
642
+ en,
644
643
  i(i({
645
644
  titleText: t,
646
645
  "data-testid": s
@@ -661,7 +660,7 @@ function so({
661
660
  } : {})
662
661
  ),
663
662
  /* @__PURE__ */ o(
664
- rn,
663
+ on,
665
664
  x(i(i({}, j === "push" ? {
666
665
  leftPanel: {
667
666
  open: se,
@@ -673,12 +672,118 @@ function so({
673
672
  width: ae
674
673
  }
675
674
  } : {}), {
676
- children: /* @__PURE__ */ o(an, x(i({ "data-testid": u }, p), { children: e }))
675
+ children: /* @__PURE__ */ o(rn, x(i({ "data-testid": u }, p), { children: e }))
676
+ })
677
+ )
678
+ ] });
679
+ }
680
+ const an = {
681
+ autoHideDuration: 6e3,
682
+ anchorOrigin: { vertical: "top", horizontal: "center" },
683
+ // The default is false. If we prefer timer to continue when window loses
684
+ // focus, change to true
685
+ disableWindowBlurListener: !1
686
+ }, sn = {
687
+ shouldClose: (e, t) => t !== "clickaway"
688
+ }, Ne = {
689
+ message: "",
690
+ severity: "info",
691
+ variant: "standard",
692
+ progressIndicator: void 0
693
+ // Can use 'circular' or 'linear'
694
+ }, Ee = 100, Fe = 2e3, ln = 2e3, dn = (() => {
695
+ let e = 0;
696
+ return () => (e += 1, e);
697
+ })(), cn = {
698
+ borderBottomLeftRadius: "0px",
699
+ borderBottomRightRadius: "0px"
700
+ }, pn = {}, un = {}, tt = He(null);
701
+ function gn(l) {
702
+ var p = l, {
703
+ overrideState: e = pn,
704
+ overrideActions: t = un,
705
+ shouldClose: n = sn.shouldClose,
706
+ children: r
707
+ } = p, a = Ae(p, [
708
+ "overrideState",
709
+ "overrideActions",
710
+ "shouldClose",
711
+ "children"
712
+ ]);
713
+ var G;
714
+ const [{ open: u }, s] = D({ open: !1 }), d = ce([]), v = ce(Date.now()), f = ce(0), C = ne((g) => {
715
+ s({ open: g });
716
+ }, []), m = ne((g = {}) => {
717
+ f.current += 1, d.current.length >= Ee && Date.now() - v.current >= Fe && (v.current = Date.now(), console.error(
718
+ `SaladBarProvider: MAX_QUEUE_LENGTH (${Ee}) hit ${f.current} times in last ${Fe}ms)`
719
+ ), f.current = 0);
720
+ const h = i(x(i({}, Ne), {
721
+ key: dn()
722
+ }), g);
723
+ return d.current.push(h), d.current.length === 1 && s({ open: !0 }), h.key;
724
+ }, []), I = (g = "", h = {}) => m(i({ message: g, severity: "success" }, h)), A = (g = "", h = {}) => m(i({ message: g, severity: "info" }, h)), w = (g = "", h = {}) => m(i({ message: g, severity: "warning" }, h)), S = (g = "", h = {}) => m(i({ message: g, severity: "error" }, h)), B = (g) => {
725
+ const h = d.current.findIndex((y) => y.key === g);
726
+ if (h !== -1)
727
+ return h === 0 ? (s({ open: !1 }), d.current[0]) : d.current.splice(h, 1);
728
+ }, H = (g, h) => {
729
+ n(g, h) && s({ open: !1 });
730
+ }, R = () => {
731
+ }, W = () => {
732
+ d.current.shift(), d.current.length > 0 && s({ open: !0 });
733
+ }, O = (G = d.current[0]) != null ? G : i({}, Ne), q = {};
734
+ "autoHideDuration" in O && (q.autoHideDuration = O.autoHideDuration);
735
+ const j = i(i({}, an), a), z = i(i({
736
+ open: u,
737
+ setOpen: C,
738
+ enqueueNotification: m,
739
+ enqueueSuccessNotification: I,
740
+ enqueueInfoNotification: A,
741
+ enqueueWarningNotification: w,
742
+ enqueueErrorNotification: S,
743
+ removeNotification: B
744
+ }, e), t);
745
+ return /* @__PURE__ */ c(tt.Provider, { value: z, children: [
746
+ r,
747
+ /* @__PURE__ */ o(
748
+ St,
749
+ x(i(i({}, j), q), {
750
+ open: u,
751
+ onClose: H,
752
+ TransitionProps: {
753
+ onExited: W,
754
+ onExit: R
755
+ },
756
+ sx: { zIndex: ln },
757
+ children: /* @__PURE__ */ c("div", { children: [
758
+ /* @__PURE__ */ o(
759
+ It,
760
+ {
761
+ onClose: (g) => H(g, "closeAlert"),
762
+ severity: O.severity,
763
+ variant: "filled",
764
+ icon: O.progressIndicator === "circular" ? /* @__PURE__ */ o(Ge, { size: "1em" }) : void 0,
765
+ style: O.progressIndicator === "linear" ? cn : void 0,
766
+ children: O.message
767
+ }
768
+ ),
769
+ O.progressIndicator === "linear" && /* @__PURE__ */ o(Tt, { color: "primary" })
770
+ ] })
677
771
  })
678
772
  )
679
773
  ] });
680
774
  }
681
- const ee = "Navbar", U = {
775
+ function hn() {
776
+ const e = Re(tt);
777
+ if (e === null)
778
+ throw new he("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
779
+ return e;
780
+ }
781
+ const ao = re(
782
+ (e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: r }) => /* @__PURE__ */ o(gn, x(i({}, e), { overrideState: t, overrideActions: n, children: r }))
783
+ ), fn = Mt(), so = ({
784
+ children: e,
785
+ store: t
786
+ }) => /* @__PURE__ */ o(Ye, { store: t != null ? t : fn, children: e }), L = (...e) => _t(...e), mn = (...e) => Ht(...e), vn = (...e) => vn(...e), ee = "Navbar", U = {
682
787
  root: `${ee}-root`,
683
788
  menuButton: `${ee}-menuButton`,
684
789
  hide: `${ee}-hide`,
@@ -686,7 +791,7 @@ const ee = "Navbar", U = {
686
791
  // userInfoHolder: `${PREFIX}-userInfoHolder`,
687
792
  // settings: `${PREFIX}-settings`,
688
793
  // pieChartIcon: `${PREFIX}-pieChartIcon`,
689
- }, sn = _("div", { name: "NavBar" })(({ theme: e }) => ({
794
+ }, xn = _("div", { name: "NavBar" })(({ theme: e }) => ({
690
795
  [`&.${U.root}`]: {
691
796
  display: "flex"
692
797
  },
@@ -705,7 +810,7 @@ const ee = "Navbar", U = {
705
810
  // marginTop: '64px',
706
811
  // marginBottom: '16px',
707
812
  // },
708
- })), tt = (e, t) => {
813
+ })), nt = (e, t) => {
709
814
  var n, r;
710
815
  return {
711
816
  height: `calc(100vh - ${t})`,
@@ -716,34 +821,34 @@ const ee = "Navbar", U = {
716
821
  backgroundColor: (r = (n = e == null ? void 0 : e.navBar) == null ? void 0 : n.backgroundColor) != null ? r : "white"
717
822
  // Provide default so tests don't need to wrap theme provider
718
823
  };
719
- }, Ne = (e, t, n) => i({
824
+ }, Le = (e, t, n) => i({
720
825
  width: t,
721
826
  transition: e.transitions.create("width", {
722
827
  easing: e.transitions.easing.sharp,
723
828
  duration: e.transitions.duration.enteringScreen
724
829
  })
725
- }, tt(e, n)), Ee = (e, t, n) => i({
830
+ }, nt(e, n)), ye = (e, t, n) => i({
726
831
  width: t,
727
832
  transition: e.transitions.create("width", {
728
833
  easing: e.transitions.easing.sharp,
729
834
  duration: e.transitions.duration.leavingScreen
730
835
  }),
731
836
  overflowX: "hidden"
732
- }, tt(e, n)), ln = _(Ve, {
837
+ }, nt(e, n)), Cn = _(Ve, {
733
838
  shouldForwardProp: (e) => !["open", "widthOpen", "widthClosed", "offsetTop"].includes(e)
734
839
  })(({ theme: e, open: t, widthOpen: n, widthClosed: r, offsetTop: a }) => i(i({
735
840
  flexShrink: 0,
736
841
  whiteSpace: "nowrap",
737
842
  boxSizing: "border-box"
738
- }, t && x(i({}, Ne(e, n, a)), {
739
- "& .MuiDrawer-paper": Ne(e, n, a)
740
- })), !t && x(i({}, Ee(e, r, a)), {
741
- "& .MuiDrawer-paper": Ee(e, r, a)
843
+ }, t && x(i({}, Le(e, n, a)), {
844
+ "& .MuiDrawer-paper": Le(e, n, a)
845
+ })), !t && x(i({}, ye(e, r, a)), {
846
+ "& .MuiDrawer-paper": ye(e, r, a)
742
847
  })));
743
- function dn({ links: e }) {
848
+ function wn({ links: e }) {
744
849
  return /* @__PURE__ */ o("div", { children: "LinksMenu not implemented yet" });
745
850
  }
746
- function cn(e) {
851
+ function bn(e) {
747
852
  let t = 0;
748
853
  for (let n = 0, r = e.length; n < r; n++) {
749
854
  const a = e.charCodeAt(n);
@@ -754,26 +859,26 @@ function cn(e) {
754
859
  const te = {
755
860
  width: "5rem",
756
861
  height: "5rem"
757
- }, Fe = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], pn = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
758
- function un({ user: e, domainCode: t }) {
862
+ }, Pe = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], An = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
863
+ function Sn({ user: e, domainCode: t }) {
759
864
  return /* @__PURE__ */ c(T, { marginY: "2rem", display: "flex", flexDirection: "column", alignItems: "center", gap: "1rem", children: [
760
865
  e != null && e.name ? /* @__PURE__ */ o(
761
866
  Ie,
762
867
  {
763
868
  src: e == null ? void 0 : e.picture,
764
869
  sx: x(i({}, te), {
765
- bgcolor: Fe[Math.abs(cn(e.name)) % Fe.length]
870
+ bgcolor: Pe[Math.abs(bn(e.name)) % Pe.length]
766
871
  }),
767
- children: pn(e.name)
872
+ children: An(e.name)
768
873
  }
769
874
  ) : /* @__PURE__ */ o(Ie, { sx: te }),
770
875
  /* @__PURE__ */ c(T, { alignItems: "center", display: "flex", flexDirection: "column", children: [
771
- e != null && e.name ? /* @__PURE__ */ o($, { children: e.name }) : /* @__PURE__ */ o(Te, { animation: !1, width: te.width }),
772
- t ? /* @__PURE__ */ o($, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Te, { animation: !1, width: te.width })
876
+ e != null && e.name ? /* @__PURE__ */ o(k, { children: e.name }) : /* @__PURE__ */ o(Te, { animation: !1, width: te.width }),
877
+ t ? /* @__PURE__ */ o(k, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Te, { animation: !1, width: te.width })
773
878
  ] })
774
879
  ] });
775
880
  }
776
- function gn({
881
+ function In({
777
882
  open: e,
778
883
  offsetTop: t = 0,
779
884
  widthOpen: n,
@@ -784,8 +889,8 @@ function gn({
784
889
  user: u,
785
890
  domainCode: s
786
891
  }) {
787
- return /* @__PURE__ */ o(sn, { className: U.root, "data-testid": a, children: /* @__PURE__ */ o(
788
- ln,
892
+ return /* @__PURE__ */ o(xn, { className: U.root, "data-testid": a, children: /* @__PURE__ */ o(
893
+ Cn,
789
894
  {
790
895
  variant: "permanent",
791
896
  anchor: "left",
@@ -798,14 +903,14 @@ function gn({
798
903
  l,
799
904
  /* @__PURE__ */ o(Oe, { variant: "middle" })
800
905
  ] }),
801
- Array.isArray(p) ? /* @__PURE__ */ o(dn, { links: p }) : p,
906
+ Array.isArray(p) ? /* @__PURE__ */ o(wn, { links: p }) : p,
802
907
  /* @__PURE__ */ o(Oe, { variant: "middle" }),
803
- /* @__PURE__ */ o(un, { user: u, domainCode: s })
908
+ /* @__PURE__ */ o(Sn, { user: u, domainCode: s })
804
909
  ] })
805
910
  }
806
911
  ) });
807
912
  }
808
- function hn({ children: e, topBarHeight: t }) {
913
+ function Tn({ children: e, topBarHeight: t }) {
809
914
  return /* @__PURE__ */ o(
810
915
  T,
811
916
  {
@@ -828,11 +933,11 @@ function hn({ children: e, topBarHeight: t }) {
828
933
  }
829
934
  );
830
935
  }
831
- const fn = 64, mn = 64, vn = 256, fe = k(!0), nt = k(vn), ot = k(mn), rt = k(""), it = k(fn), at = k(void 0), xn = "TopBar", Cn = {
832
- titleText: `${xn}-titleText`
936
+ const On = 64, Dn = 64, kn = 256, fe = $(!0), ot = $(kn), rt = $(Dn), it = $(""), at = $(On), st = $(void 0), $n = "TopBar", Bn = {
937
+ titleText: `${$n}-titleText`
833
938
  };
834
- function wn({ titleText: e = "", height: t, "data-testid": n }) {
835
- const r = Mt(fe);
939
+ function Nn({ titleText: e = "", height: t, "data-testid": n }) {
940
+ const r = mn(fe);
836
941
  return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ c(
837
942
  We,
838
943
  {
@@ -851,7 +956,7 @@ function wn({ titleText: e = "", height: t, "data-testid": n }) {
851
956
  },
852
957
  children: [
853
958
  /* @__PURE__ */ o(V, { size: "medium", color: "inherit", sx: { padding: 1.5 }, onClick: () => r((l) => !l), children: /* @__PURE__ */ o(Pt, { fontSize: "medium" }) }),
854
- /* @__PURE__ */ o($, { className: Cn.titleText, variant: "h6", children: e })
959
+ /* @__PURE__ */ o(k, { className: Bn.titleText, variant: "h6", children: e })
855
960
  ]
856
961
  }
857
962
  ) });
@@ -868,17 +973,17 @@ function lo({
868
973
  user: s,
869
974
  domainCode: d
870
975
  }) {
871
- const [v, f] = y(fe), [C] = y(nt), [m] = y(ot), [I, A] = y(rt), [w] = y(it), [S] = y(at);
976
+ const [v, f] = L(fe), [C] = L(ot), [m] = L(rt), [I, A] = L(it), [w] = L(at), [S] = L(st);
872
977
  return oe(() => {
873
978
  t !== void 0 && A(t);
874
979
  }, [t, A]), oe(() => {
875
980
  n !== void 0 && f(n);
876
981
  }, [n, f]), /* @__PURE__ */ c(T, { children: [
877
- /* @__PURE__ */ o(St, {}),
878
- /* @__PURE__ */ o(wn, { titleText: I, "data-testid": l, height: w }),
982
+ /* @__PURE__ */ o(Ot, {}),
983
+ /* @__PURE__ */ o(Nn, { titleText: I, "data-testid": l, height: w }),
879
984
  /* @__PURE__ */ c(T, { sx: { display: "flex" }, children: [
880
985
  /* @__PURE__ */ o(
881
- gn,
986
+ In,
882
987
  {
883
988
  open: v,
884
989
  top: S,
@@ -892,7 +997,7 @@ function lo({
892
997
  }
893
998
  ),
894
999
  /* @__PURE__ */ o(
895
- hn,
1000
+ Tn,
896
1001
  x(i({
897
1002
  "data-testid": a,
898
1003
  topBarHeight: w
@@ -903,122 +1008,16 @@ function lo({
903
1008
  ] })
904
1009
  ] });
905
1010
  }
906
- const bn = {
907
- autoHideDuration: 6e3,
908
- anchorOrigin: { vertical: "top", horizontal: "center" },
909
- // The default is false. If we prefer timer to continue when window loses
910
- // focus, change to true
911
- disableWindowBlurListener: !1
912
- }, An = {
913
- shouldClose: (e, t) => t !== "clickaway"
914
- }, Le = {
915
- message: "",
916
- severity: "info",
917
- variant: "standard",
918
- progressIndicator: void 0
919
- // Can use 'circular' or 'linear'
920
- }, ye = 100, Pe = 2e3, Sn = 2e3, In = (() => {
921
- let e = 0;
922
- return () => (e += 1, e);
923
- })(), Tn = {
924
- borderBottomLeftRadius: "0px",
925
- borderBottomRightRadius: "0px"
926
- }, On = {}, Dn = {}, st = He(null);
927
- function $n(l) {
928
- var p = l, {
929
- overrideState: e = On,
930
- overrideActions: t = Dn,
931
- shouldClose: n = An.shouldClose,
932
- children: r
933
- } = p, a = Ae(p, [
934
- "overrideState",
935
- "overrideActions",
936
- "shouldClose",
937
- "children"
938
- ]);
939
- var G;
940
- const [{ open: u }, s] = D({ open: !1 }), d = ce([]), v = ce(Date.now()), f = ce(0), C = ne((g) => {
941
- s({ open: g });
942
- }, []), m = ne((g = {}) => {
943
- f.current += 1, d.current.length >= ye && Date.now() - v.current >= Pe && (v.current = Date.now(), console.error(
944
- `SaladBarProvider: MAX_QUEUE_LENGTH (${ye}) hit ${f.current} times in last ${Pe}ms)`
945
- ), f.current = 0);
946
- const h = i(x(i({}, Le), {
947
- key: In()
948
- }), g);
949
- return d.current.push(h), d.current.length === 1 && s({ open: !0 }), h.key;
950
- }, []), I = (g = "", h = {}) => m(i({ message: g, severity: "success" }, h)), A = (g = "", h = {}) => m(i({ message: g, severity: "info" }, h)), w = (g = "", h = {}) => m(i({ message: g, severity: "warning" }, h)), S = (g = "", h = {}) => m(i({ message: g, severity: "error" }, h)), B = (g) => {
951
- const h = d.current.findIndex((L) => L.key === g);
952
- if (h !== -1)
953
- return h === 0 ? (s({ open: !1 }), d.current[0]) : d.current.splice(h, 1);
954
- }, H = (g, h) => {
955
- n(g, h) && s({ open: !1 });
956
- }, R = () => {
957
- }, W = () => {
958
- d.current.shift(), d.current.length > 0 && s({ open: !0 });
959
- }, O = (G = d.current[0]) != null ? G : i({}, Le), q = {};
960
- "autoHideDuration" in O && (q.autoHideDuration = O.autoHideDuration);
961
- const j = i(i({}, bn), a), z = i(i({
962
- open: u,
963
- setOpen: C,
964
- enqueueNotification: m,
965
- enqueueSuccessNotification: I,
966
- enqueueInfoNotification: A,
967
- enqueueWarningNotification: w,
968
- enqueueErrorNotification: S,
969
- removeNotification: B
970
- }, e), t);
971
- return /* @__PURE__ */ c(st.Provider, { value: z, children: [
972
- r,
973
- /* @__PURE__ */ o(
974
- It,
975
- x(i(i({}, j), q), {
976
- open: u,
977
- onClose: H,
978
- TransitionProps: {
979
- onExited: W,
980
- onExit: R
981
- },
982
- sx: { zIndex: Sn },
983
- children: /* @__PURE__ */ c("div", { children: [
984
- /* @__PURE__ */ o(
985
- Tt,
986
- {
987
- onClose: (g) => H(g, "closeAlert"),
988
- severity: O.severity,
989
- variant: "filled",
990
- icon: O.progressIndicator === "circular" ? /* @__PURE__ */ o(Ge, { size: "1em" }) : void 0,
991
- style: O.progressIndicator === "linear" ? Tn : void 0,
992
- children: O.message
993
- }
994
- ),
995
- O.progressIndicator === "linear" && /* @__PURE__ */ o(Ot, { color: "primary" })
996
- ] })
997
- })
998
- )
999
- ] });
1000
- }
1001
- function kn() {
1002
- const e = Re(st);
1003
- if (e === null)
1004
- throw new he("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
1005
- return e;
1006
- }
1007
- const co = re(
1008
- (e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: r }) => /* @__PURE__ */ o($n, x(i({}, e), { overrideState: t, overrideActions: n, children: r }))
1009
- ), Bn = _t(), po = ({
1010
- children: e,
1011
- store: t
1012
- }) => /* @__PURE__ */ o(Ye, { store: t != null ? t : Bn, children: e }), Nn = (...e) => Ht(...e), uo = (...e) => Rt(...e), En = (...e) => En(...e), lt = "domainCode";
1011
+ const lt = "domainCode";
1013
1012
  var _e;
1014
- const Me = k(
1013
+ const Me = $(
1015
1014
  JSON.parse((_e = localStorage.getItem(lt)) != null ? _e : '{"domainCode": ""}').domainCode
1016
- ), dt = k(
1015
+ ), dt = $(
1017
1016
  (e) => e(Me),
1018
1017
  (e, t, n) => {
1019
1018
  t(Me, n), localStorage.setItem(lt, JSON.stringify({ domainCode: n }));
1020
1019
  }
1021
- ), Fn = {
1020
+ ), En = {
1022
1021
  act: "ACT",
1023
1022
  nsw: "NSW",
1024
1023
  nt: "NT",
@@ -1030,10 +1029,10 @@ const Me = k(
1030
1029
  ag: "AG",
1031
1030
  fedmps: "Fedmps",
1032
1031
  "": ""
1033
- }, Ln = (e) => {
1032
+ }, Fn = (e) => {
1034
1033
  var t;
1035
- return e === null ? "N/A" : (t = Fn[e]) != null ? t : "";
1036
- }, go = ({
1034
+ return e === null ? "N/A" : (t = En[e]) != null ? t : "";
1035
+ }, co = ({
1037
1036
  isLoading: e,
1038
1037
  isOpen: t,
1039
1038
  onClose: n,
@@ -1041,14 +1040,14 @@ const Me = k(
1041
1040
  applicationName: a,
1042
1041
  handleLogout: l
1043
1042
  }) => {
1044
- const [p, u] = Nn(dt), [s, d] = D(p), { enqueueSuccessNotification: v } = kn(), f = r.length === 0, C = !!p && !r.includes(p) && !r.includes(s), m = !p || f || C, I = () => K(void 0, null, function* () {
1043
+ const [p, u] = L(dt), [s, d] = D(p), { enqueueSuccessNotification: v } = hn(), f = r.length === 0, C = !!p && !r.includes(p) && !r.includes(s), m = !p || f || C, I = () => K(void 0, null, function* () {
1045
1044
  s ? (u(s), v(`Set domain to ${s}`), n()) : u("");
1046
1045
  }), A = () => K(void 0, null, function* () {
1047
1046
  p && !f && !C ? (d(p), n()) : m && l();
1048
1047
  });
1049
1048
  let w;
1050
1049
  return f ? w = "Unable to retrieve your active organisations. Try logging in again." : C && (w = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ c(
1051
- Jt,
1050
+ Qt,
1052
1051
  {
1053
1052
  isOpen: t,
1054
1053
  dialogTitle: "Select an organisation",
@@ -1065,7 +1064,7 @@ const Me = k(
1065
1064
  onClose: m ? () => {
1066
1065
  } : n,
1067
1066
  children: [
1068
- /* @__PURE__ */ c($, { marginBottom: 2, children: [
1067
+ /* @__PURE__ */ c(k, { marginBottom: 2, children: [
1069
1068
  "Select the default organisation that you want to use with the ",
1070
1069
  a,
1071
1070
  "."
@@ -1078,10 +1077,10 @@ const Me = k(
1078
1077
  disableClearable: !1,
1079
1078
  value: s !== "" ? s : null,
1080
1079
  onChange: (S, B) => d(B != null ? B : ""),
1081
- getOptionLabel: Ln,
1080
+ getOptionLabel: Fn,
1082
1081
  options: [...r],
1083
1082
  renderInput: (S) => /* @__PURE__ */ o(
1084
- $t,
1083
+ kt,
1085
1084
  x(i({}, S), {
1086
1085
  variant: "filled",
1087
1086
  label: "Select organisation",
@@ -1095,11 +1094,11 @@ const Me = k(
1095
1094
  )
1096
1095
  }
1097
1096
  ),
1098
- w && /* @__PURE__ */ o(kt, { error: !0, children: w })
1097
+ w && /* @__PURE__ */ o($t, { error: !0, children: w })
1099
1098
  ]
1100
1099
  }
1101
1100
  );
1102
- }, ho = Ue({
1101
+ }, po = Ue({
1103
1102
  palette: {
1104
1103
  primary: {
1105
1104
  dark: "#00A651",
@@ -1150,7 +1149,7 @@ const Me = k(
1150
1149
  navBar: {
1151
1150
  backgroundColor: "#E8E8E8"
1152
1151
  }
1153
- }), fo = Ue({
1152
+ }), uo = Ue({
1154
1153
  palette: {
1155
1154
  primary: {
1156
1155
  main: "#007236",
@@ -1241,24 +1240,24 @@ const Me = k(
1241
1240
  navBar: {
1242
1241
  backgroundColor: "#E8E8E8"
1243
1242
  }
1244
- }), yn = {
1243
+ }), Ln = {
1245
1244
  domainCode: dt,
1246
1245
  navBarOpen: fe,
1247
- navBarWidthOpen: nt,
1248
- navBarWidthClosed: ot,
1249
- titleText: rt,
1250
- topBarHeight: it,
1251
- navBarTop: at
1252
- }, mo = re(() => ({ children: e }) => /* @__PURE__ */ o(Ye, { children: e })), Pn = ({
1246
+ navBarWidthOpen: ot,
1247
+ navBarWidthClosed: rt,
1248
+ titleText: it,
1249
+ topBarHeight: at,
1250
+ navBarTop: st
1251
+ }, go = re(() => ({ children: e }) => /* @__PURE__ */ o(Ye, { children: e })), yn = ({
1253
1252
  initialValues: e,
1254
1253
  children: t
1255
- }) => (Wt(e), /* @__PURE__ */ o(M, { children: t })), vo = re(
1254
+ }) => (Rt(e), /* @__PURE__ */ o(M, { children: t })), ho = re(
1256
1255
  (e) => ({ children: t }) => /* @__PURE__ */ o(
1257
- Pn,
1256
+ yn,
1258
1257
  {
1259
1258
  initialValues: Object.entries(e).map(
1260
1259
  ([n, r]) => [
1261
- yn[n],
1260
+ Ln[n],
1262
1261
  r
1263
1262
  ]
1264
1263
  ),
@@ -1267,42 +1266,42 @@ const Me = k(
1267
1266
  )
1268
1267
  );
1269
1268
  export {
1270
- Jt as AgDialog,
1269
+ Qt as AgDialog,
1271
1270
  lo as AppLayout,
1272
- po as AtomProvider,
1273
- st as Context,
1271
+ so as AtomProvider,
1272
+ tt as Context,
1274
1273
  he as ContextError,
1275
- go as DomainCodeDialog,
1276
- no as ExampleComponent,
1277
- Pn as HydrateAtoms,
1274
+ co as DomainCodeDialog,
1275
+ eo as ExampleComponent,
1276
+ yn as HydrateAtoms,
1278
1277
  Je as NAVBAR_WIDTH_CLOSED,
1279
1278
  Qe as NAVBAR_WIDTH_OPENED,
1280
- ao as NavBar,
1281
- ro as NavBarDarkStyledList,
1282
- io as NavBarLightStyledList,
1283
- jt as NavBarProvider,
1284
- so as PageLayout,
1285
- $n as SaladBarProvider,
1286
- Bn as atomStore,
1287
- Qt as buildNavBarState,
1279
+ ro as NavBar,
1280
+ no as NavBarDarkStyledList,
1281
+ oo as NavBarLightStyledList,
1282
+ qt as NavBarProvider,
1283
+ io as PageLayout,
1284
+ gn as SaladBarProvider,
1285
+ fn as atomStore,
1286
+ Yt as buildNavBarState,
1288
1287
  dt as domainCodeAtom,
1289
- ho as fed21Theme,
1290
- fo as internalAgSystemsTheme,
1288
+ po as fed21Theme,
1289
+ uo as internalAgSystemsTheme,
1291
1290
  P as navBarClasses,
1292
1291
  fe as navBarOpenAtom,
1293
- at as navBarTopAtom,
1294
- ot as navBarWidthClosedAtom,
1295
- nt as navBarWidthOpenAtom,
1296
- rt as titleTextAtom,
1297
- it as topBarHeightAtom,
1298
- Nn as useLibraryAtom,
1299
- En as useLibraryAtomValue,
1300
- Yt as useNavBar,
1301
- kn as useSaladBar,
1302
- uo as useSetLibraryAtom,
1303
- mo as withAtomProvider,
1304
- oo as withNavBarProvider,
1305
- vo as withOverrideDefaults,
1306
- co as withSaladBarProvider
1292
+ st as navBarTopAtom,
1293
+ rt as navBarWidthClosedAtom,
1294
+ ot as navBarWidthOpenAtom,
1295
+ it as titleTextAtom,
1296
+ at as topBarHeightAtom,
1297
+ L as useLibraryAtom,
1298
+ vn as useLibraryAtomValue,
1299
+ jt as useNavBar,
1300
+ hn as useSaladBar,
1301
+ mn as useSetLibraryAtom,
1302
+ go as withAtomProvider,
1303
+ to as withNavBarProvider,
1304
+ ho as withOverrideDefaults,
1305
+ ao as withSaladBarProvider
1307
1306
  };
1308
1307
  //# sourceMappingURL=index.js.map