@australiangreens/ag-internal-components 0.0.55 → 0.0.56
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
|
@@ -39,9 +39,9 @@ var J = (e, t, n) => new Promise((i, a) => {
|
|
|
39
39
|
import { jsxs as c, Fragment as y, jsx as o } from "react/jsx-runtime";
|
|
40
40
|
import { useState as k, createContext as Re, useCallback as ee, useContext as We, useEffect as te, useRef as de } from "react";
|
|
41
41
|
import { Typography as B, Button as bt, Paper as ze, Box as x, Drawer as he, styled as ge, IconButton as V, Container as Ge, useTheme as At, Avatar as Ie, Collapse as St, Skeleton as Oe, Divider as De, CssBaseline as Tt, Snackbar as It, Alert as Ot, CircularProgress as Ue, LinearProgress as Dt, Autocomplete as kt, TextField as Bt, FormHelperText as $t } from "@mui/material";
|
|
42
|
-
import
|
|
42
|
+
import Nt from "@mui/material/CssBaseline";
|
|
43
43
|
import { styled as $, createTheme as Ve, alpha as ce } from "@mui/material/styles";
|
|
44
|
-
import { AgError as
|
|
44
|
+
import { AgError as Et } from "@australiangreens/ag-error";
|
|
45
45
|
import { createHelper as oe } from "souvlaki";
|
|
46
46
|
import Xe from "@mui/material/List";
|
|
47
47
|
import ke from "@mui/material/Button";
|
|
@@ -50,7 +50,7 @@ import Pt from "@mui/material/DialogActions";
|
|
|
50
50
|
import Lt from "@mui/material/DialogContent";
|
|
51
51
|
import yt from "@mui/material/DialogTitle";
|
|
52
52
|
import { ArrowForward as qe, ArrowBack as je, ViewHeadline as Mt } from "@mui/icons-material";
|
|
53
|
-
import { atom as
|
|
53
|
+
import { atom as N, useSetAtom as _t, useAtom as P, getDefaultStore as Ht, Provider as Qe } from "jotai";
|
|
54
54
|
import { useHydrateAtoms as Rt } from "jotai/utils";
|
|
55
55
|
function Jn({ text: e }) {
|
|
56
56
|
const [t, n] = k(0);
|
|
@@ -130,7 +130,7 @@ const Ye = 330, Je = 73, F = "Navbar", _ = {
|
|
|
130
130
|
}), !t && {
|
|
131
131
|
"& .MuiDrawer-paper": Gt()
|
|
132
132
|
}));
|
|
133
|
-
class fe extends
|
|
133
|
+
class fe extends Et {
|
|
134
134
|
}
|
|
135
135
|
Te(fe, "errorName", "ContextError");
|
|
136
136
|
const Ze = Re(null), Vt = {}, Xt = {}, qt = ({
|
|
@@ -240,7 +240,7 @@ function to({
|
|
|
240
240
|
}) {
|
|
241
241
|
const { open: n } = jt();
|
|
242
242
|
return /* @__PURE__ */ c(Wt, { className: _.root, "data-testid": e, children: [
|
|
243
|
-
/* @__PURE__ */ o(
|
|
243
|
+
/* @__PURE__ */ o(Nt, {}),
|
|
244
244
|
/* @__PURE__ */ o(
|
|
245
245
|
Ut,
|
|
246
246
|
{
|
|
@@ -456,7 +456,7 @@ const et = 400, tn = ge(he, {
|
|
|
456
456
|
marginRight: t === "right" ? e.spacing(2) : 0
|
|
457
457
|
}
|
|
458
458
|
}));
|
|
459
|
-
function
|
|
459
|
+
function Ne({
|
|
460
460
|
children: e,
|
|
461
461
|
anchor: t = "left",
|
|
462
462
|
open: n,
|
|
@@ -595,14 +595,14 @@ function no({
|
|
|
595
595
|
}, [M]), te(() => {
|
|
596
596
|
Q !== ue && (I(Q), H(Q));
|
|
597
597
|
}, [Q]);
|
|
598
|
-
const ae = z === void 0 ? C : z, se = ie === void 0 ? T : ie, Ce = (
|
|
599
|
-
z === void 0 && (m(
|
|
600
|
-
}, we = (
|
|
601
|
-
ie === void 0 && (I(
|
|
598
|
+
const ae = z === void 0 ? C : z, se = ie === void 0 ? T : ie, Ce = (E) => {
|
|
599
|
+
z === void 0 && (m(E), a && W && (E ? (I(!1), H(T)) : I(O))), G && G(E);
|
|
600
|
+
}, we = (E) => {
|
|
601
|
+
ie === void 0 && (I(E), a && R && (E ? (m(!1), b(C)) : m(S))), xe && xe(E);
|
|
602
602
|
};
|
|
603
603
|
return /* @__PURE__ */ c(x, { children: [
|
|
604
604
|
R && /* @__PURE__ */ o(
|
|
605
|
-
|
|
605
|
+
Ne,
|
|
606
606
|
{
|
|
607
607
|
"data-testid": ut,
|
|
608
608
|
anchor: "left",
|
|
@@ -621,7 +621,7 @@ function no({
|
|
|
621
621
|
}
|
|
622
622
|
),
|
|
623
623
|
W && /* @__PURE__ */ o(
|
|
624
|
-
|
|
624
|
+
Ne,
|
|
625
625
|
{
|
|
626
626
|
"data-testid": vt,
|
|
627
627
|
anchor: "right",
|
|
@@ -722,7 +722,7 @@ const Z = "Navbar", U = {
|
|
|
722
722
|
backgroundColor: (i = (n = e == null ? void 0 : e.navBar) == null ? void 0 : n.backgroundColor) != null ? i : "white"
|
|
723
723
|
// Provide default so tests don't need to wrap theme provider
|
|
724
724
|
};
|
|
725
|
-
},
|
|
725
|
+
}, Ee = (e, t, n) => r({
|
|
726
726
|
width: t,
|
|
727
727
|
transition: ne(e, "width", "entering")
|
|
728
728
|
}, tt(e, n)), Fe = (e, t, n) => r({
|
|
@@ -737,8 +737,8 @@ const Z = "Navbar", U = {
|
|
|
737
737
|
boxSizing: "border-box",
|
|
738
738
|
display: "flex",
|
|
739
739
|
flexDirection: "column"
|
|
740
|
-
}, t && w(r({},
|
|
741
|
-
"& .MuiDrawer-paper":
|
|
740
|
+
}, t && w(r({}, Ee(e, n, a)), {
|
|
741
|
+
"& .MuiDrawer-paper": Ee(e, n, a)
|
|
742
742
|
})), !t && w(r({}, Fe(e, i, a)), {
|
|
743
743
|
"& .MuiDrawer-paper": Fe(e, i, a)
|
|
744
744
|
})));
|
|
@@ -761,7 +761,7 @@ function pn({ user: e, domainCode: t, open: n }) {
|
|
|
761
761
|
display: "flex",
|
|
762
762
|
alignItems: "center",
|
|
763
763
|
flexDirection: "column",
|
|
764
|
-
gap: "
|
|
764
|
+
gap: "0.5rem"
|
|
765
765
|
},
|
|
766
766
|
children: [
|
|
767
767
|
/* @__PURE__ */ o(
|
|
@@ -793,10 +793,9 @@ function pn({ user: e, domainCode: t, open: n }) {
|
|
|
793
793
|
easing: i.transitions.easing.sharp,
|
|
794
794
|
timeout: {
|
|
795
795
|
enter: i.transitions.duration.enteringScreen,
|
|
796
|
-
exit: i.transitions.duration.leavingScreen
|
|
796
|
+
exit: i.transitions.duration.leavingScreen
|
|
797
797
|
},
|
|
798
798
|
in: n,
|
|
799
|
-
unmountOnExit: !0,
|
|
800
799
|
children: /* @__PURE__ */ c(x, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
|
|
801
800
|
e != null && e.name ? /* @__PURE__ */ o(B, { children: e.name }) : /* @__PURE__ */ o(Oe, { animation: !1, width: "50%" }),
|
|
802
801
|
t ? /* @__PURE__ */ o(B, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Oe, { animation: !1, width: "25%" })
|
|
@@ -869,7 +868,7 @@ function hn({ children: e, topBarHeight: t }) {
|
|
|
869
868
|
}
|
|
870
869
|
);
|
|
871
870
|
}
|
|
872
|
-
const gn = 64, fn = 64, mn = 256, me =
|
|
871
|
+
const gn = 64, fn = 64, mn = 256, me = N(!0), nt = N(mn), ot = N(fn), it = N(""), rt = N(gn), at = N(void 0), vn = "TopBar", xn = {
|
|
873
872
|
titleText: `${vn}-titleText`
|
|
874
873
|
};
|
|
875
874
|
function Cn({ titleText: e = "", height: t, "data-testid": n }) {
|
|
@@ -1054,9 +1053,9 @@ const io = oe(
|
|
|
1054
1053
|
store: t
|
|
1055
1054
|
}) => /* @__PURE__ */ o(Qe, { store: t != null ? t : Bn, children: e }), lt = "domainCode";
|
|
1056
1055
|
var He;
|
|
1057
|
-
const _e =
|
|
1056
|
+
const _e = N(
|
|
1058
1057
|
JSON.parse((He = localStorage.getItem(lt)) != null ? He : '{"domainCode": ""}').domainCode
|
|
1059
|
-
), dt =
|
|
1058
|
+
), dt = N(
|
|
1060
1059
|
(e) => e(_e),
|
|
1061
1060
|
(e, t, n) => {
|
|
1062
1061
|
t(_e, n), localStorage.setItem(lt, JSON.stringify({ domainCode: n }));
|
|
@@ -1073,7 +1072,7 @@ const _e = E(
|
|
|
1073
1072
|
ag: "AG",
|
|
1074
1073
|
fedmps: "Fedmps",
|
|
1075
1074
|
"": ""
|
|
1076
|
-
},
|
|
1075
|
+
}, Nn = (e) => {
|
|
1077
1076
|
var t;
|
|
1078
1077
|
return e === null ? "N/A" : (t = $n[e]) != null ? t : "";
|
|
1079
1078
|
}, ao = ({
|
|
@@ -1121,7 +1120,7 @@ const _e = E(
|
|
|
1121
1120
|
disableClearable: !1,
|
|
1122
1121
|
value: s !== "" ? s : null,
|
|
1123
1122
|
onChange: (b, O) => d(O != null ? O : ""),
|
|
1124
|
-
getOptionLabel:
|
|
1123
|
+
getOptionLabel: Nn,
|
|
1125
1124
|
options: [...i],
|
|
1126
1125
|
renderInput: (b) => /* @__PURE__ */ o(
|
|
1127
1126
|
Bt,
|
|
@@ -1284,7 +1283,7 @@ const _e = E(
|
|
|
1284
1283
|
navBar: {
|
|
1285
1284
|
backgroundColor: "#E8E8E8"
|
|
1286
1285
|
}
|
|
1287
|
-
}),
|
|
1286
|
+
}), En = {
|
|
1288
1287
|
domainCode: dt,
|
|
1289
1288
|
navBarOpen: me,
|
|
1290
1289
|
navBarWidthOpen: nt,
|
|
@@ -1301,7 +1300,7 @@ const _e = E(
|
|
|
1301
1300
|
{
|
|
1302
1301
|
initialValues: Object.entries(e).map(
|
|
1303
1302
|
([n, i]) => [
|
|
1304
|
-
|
|
1303
|
+
En[n],
|
|
1305
1304
|
i
|
|
1306
1305
|
]
|
|
1307
1306
|
),
|