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