@australiangreens/ag-internal-components 0.0.24 → 0.0.26
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/PageLayout/PageContainer.d.ts +14 -0
- package/dist/components/PageLayout/PageContainer.d.ts.map +1 -0
- package/dist/components/PageLayout/PanelAwareMargins.d.ts +19 -0
- package/dist/components/PageLayout/PanelAwareMargins.d.ts.map +1 -0
- package/dist/components/PageLayout/SidePanel.d.ts +26 -0
- package/dist/components/PageLayout/SidePanel.d.ts.map +1 -0
- package/dist/components/PageLayout/TopBar.d.ts +32 -0
- package/dist/components/PageLayout/TopBar.d.ts.map +1 -0
- package/dist/components/PageLayout/index.d.ts +46 -0
- package/dist/components/PageLayout/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/esm/index.js +523 -138
- package/dist/esm/index.js.map +1 -1
- package/dist/providers/SaladBar/index.d.ts +1 -0
- package/dist/providers/SaladBar/index.d.ts.map +1 -1
- package/dist/providers/SaladBar/testWrappers.d.ts +2 -0
- package/dist/providers/SaladBar/testWrappers.d.ts.map +1 -0
- package/package.json +4 -3
package/dist/esm/index.js
CHANGED
|
@@ -1,61 +1,443 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
for (var
|
|
16
|
-
|
|
17
|
-
if (
|
|
18
|
-
for (var
|
|
19
|
-
|
|
20
|
-
return
|
|
1
|
+
var Et = Object.defineProperty, kt = Object.defineProperties;
|
|
2
|
+
var Nt = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var M = Object.getOwnPropertySymbols;
|
|
4
|
+
var at = Object.prototype.hasOwnProperty, st = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var V = (t, e, n) => e in t ? Et(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, r = (t, e) => {
|
|
6
|
+
for (var n in e || (e = {}))
|
|
7
|
+
at.call(e, n) && V(t, n, e[n]);
|
|
8
|
+
if (M)
|
|
9
|
+
for (var n of M(e))
|
|
10
|
+
st.call(e, n) && V(t, n, e[n]);
|
|
11
|
+
return t;
|
|
12
|
+
}, v = (t, e) => kt(t, Nt(e));
|
|
13
|
+
var ct = (t, e) => {
|
|
14
|
+
var n = {};
|
|
15
|
+
for (var o in t)
|
|
16
|
+
at.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
|
|
17
|
+
if (t != null && M)
|
|
18
|
+
for (var o of M(t))
|
|
19
|
+
e.indexOf(o) < 0 && st.call(t, o) && (n[o] = t[o]);
|
|
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
|
-
import
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
22
|
+
var lt = (t, e, n) => (V(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
23
|
+
import { jsxs as l, Fragment as q, jsx as i } from "react/jsx-runtime";
|
|
24
|
+
import { useState as b, useEffect as dt, createContext as Dt, useRef as K, useContext as Lt } from "react";
|
|
25
|
+
import $t from "@mui/material/Button";
|
|
26
|
+
import Rt from "@mui/material/Paper";
|
|
27
|
+
import E from "@mui/material/Typography";
|
|
28
|
+
import { styled as k, Box as xt, IconButton as pt } from "@mui/material";
|
|
29
|
+
import wt from "@mui/icons-material/ArrowForward";
|
|
30
|
+
import vt from "@mui/icons-material/ArrowBack";
|
|
31
|
+
import _t from "@mui/material/Drawer";
|
|
32
|
+
import Ht from "@mui/material/Box";
|
|
33
|
+
import ut from "@mui/material/IconButton";
|
|
34
|
+
import Mt from "@mui/material/Container";
|
|
35
|
+
import { createTheme as Ct, alpha as J, ThemeProvider as zt } from "@mui/material/styles";
|
|
36
|
+
import qt from "@mui/material/Snackbar";
|
|
37
|
+
import Gt from "@mui/material/Alert";
|
|
38
|
+
import Ut from "@mui/material/LinearProgress";
|
|
39
|
+
import Wt from "@mui/material/CircularProgress";
|
|
40
|
+
import { AgError as Xt } from "@australiangreens/ag-error";
|
|
41
|
+
import { createHelper as jt } from "souvlaki";
|
|
42
|
+
function ke({ text: t }) {
|
|
43
|
+
const [e, n] = b(0);
|
|
44
|
+
return /* @__PURE__ */ l(q, { children: [
|
|
45
|
+
/* @__PURE__ */ i(E, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
|
|
46
|
+
/* @__PURE__ */ i(E, { variant: "caption", display: "block", children: /* @__PURE__ */ i("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
|
|
47
|
+
/* @__PURE__ */ i(
|
|
48
|
+
$t,
|
|
41
49
|
{
|
|
42
50
|
variant: "outlined",
|
|
43
|
-
onClick: () =>
|
|
51
|
+
onClick: () => n((o) => o + 1),
|
|
44
52
|
"aria-label": "Increment",
|
|
45
53
|
children: "Hello I am a button"
|
|
46
54
|
}
|
|
47
55
|
),
|
|
48
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ l("p", { children: [
|
|
49
57
|
"This is some text: ",
|
|
50
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ i("span", { children: t })
|
|
51
59
|
] }),
|
|
52
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ l(Rt, { children: [
|
|
53
61
|
"This number will incremember when button pressed: ",
|
|
54
|
-
|
|
62
|
+
e
|
|
55
63
|
] })
|
|
56
64
|
] });
|
|
57
65
|
}
|
|
58
|
-
const
|
|
66
|
+
const Qt = 24, Vt = 64, C = "TopBar", u = {
|
|
67
|
+
topStripe: `${C}-topStripe`,
|
|
68
|
+
titleBar: `${C}-titleBar`,
|
|
69
|
+
titleSlider: `${C}-titleSlider`,
|
|
70
|
+
titleText: `${C}-titleText`,
|
|
71
|
+
leftPanelButton: `${C}-leftPanelButton`,
|
|
72
|
+
rightPanelButton: `${C}-leftPanelButton`
|
|
73
|
+
}, Kt = k("div", {
|
|
74
|
+
shouldForwardProp: (t) => !["leftPanel", "rightPanel"].includes(t),
|
|
75
|
+
name: C
|
|
76
|
+
})(({ theme: t, leftPanel: e, rightPanel: n }) => {
|
|
77
|
+
var o, c;
|
|
78
|
+
return {
|
|
79
|
+
width: "100%",
|
|
80
|
+
[`& .${u.topStripe}`]: {
|
|
81
|
+
width: "100%",
|
|
82
|
+
height: `${Qt}px`,
|
|
83
|
+
backgroundColor: t.palette.primary.main
|
|
84
|
+
},
|
|
85
|
+
[`& .${u.titleBar}`]: {
|
|
86
|
+
backgroundColor: t.palette.primary.light,
|
|
87
|
+
height: `${Vt}px`,
|
|
88
|
+
padding: t.spacing(0, 3),
|
|
89
|
+
width: "100%"
|
|
90
|
+
},
|
|
91
|
+
[`& .${u.titleSlider}`]: r(r({
|
|
92
|
+
height: "100%",
|
|
93
|
+
display: "flex",
|
|
94
|
+
alignItems: "center",
|
|
95
|
+
color: "white",
|
|
96
|
+
transition: t.transitions.create("margin", {
|
|
97
|
+
easing: t.transitions.easing.sharp,
|
|
98
|
+
duration: t.transitions.duration.leavingScreen
|
|
99
|
+
}),
|
|
100
|
+
[`& .${u.leftPanelButton}`]: {
|
|
101
|
+
marginRight: t.spacing(2),
|
|
102
|
+
flexGrow: 0
|
|
103
|
+
},
|
|
104
|
+
[`& .${u.titleText}`]: {
|
|
105
|
+
flexGrow: 1
|
|
106
|
+
},
|
|
107
|
+
[`& .${u.rightPanelButton}`]: {
|
|
108
|
+
flexGrow: 0
|
|
109
|
+
}
|
|
110
|
+
}, (e == null ? void 0 : e.open) && {
|
|
111
|
+
transition: t.transitions.create("margin", {
|
|
112
|
+
easing: t.transitions.easing.easeOut,
|
|
113
|
+
duration: t.transitions.duration.enteringScreen
|
|
114
|
+
}),
|
|
115
|
+
marginLeft: `${(o = e == null ? void 0 : e.width) != null ? o : 0}px`
|
|
116
|
+
}), (n == null ? void 0 : n.open) && {
|
|
117
|
+
transition: t.transitions.create("margin", {
|
|
118
|
+
easing: t.transitions.easing.easeOut,
|
|
119
|
+
duration: t.transitions.duration.enteringScreen
|
|
120
|
+
}),
|
|
121
|
+
marginRight: `${(c = n == null ? void 0 : n.width) != null ? c : 0}px`
|
|
122
|
+
})
|
|
123
|
+
};
|
|
124
|
+
});
|
|
125
|
+
function Jt({
|
|
126
|
+
titleText: t = "",
|
|
127
|
+
leftPanel: e,
|
|
128
|
+
rightPanel: n,
|
|
129
|
+
"data-testid": o
|
|
130
|
+
}) {
|
|
131
|
+
return /* @__PURE__ */ l(Kt, { leftPanel: e, rightPanel: n, "data-testid": o, children: [
|
|
132
|
+
/* @__PURE__ */ i("div", { className: u.topStripe }),
|
|
133
|
+
/* @__PURE__ */ i("div", { className: u.titleBar, children: /* @__PURE__ */ l(xt, { className: u.titleSlider, children: [
|
|
134
|
+
e !== void 0 && !e.open && e.showOpenArrow && /* @__PURE__ */ l(
|
|
135
|
+
pt,
|
|
136
|
+
{
|
|
137
|
+
className: u.leftPanelButton,
|
|
138
|
+
color: "inherit",
|
|
139
|
+
"aria-label": "Open left side panel",
|
|
140
|
+
onClick: e == null ? void 0 : e.onOpen,
|
|
141
|
+
edge: "start",
|
|
142
|
+
size: "large",
|
|
143
|
+
children: [
|
|
144
|
+
" ",
|
|
145
|
+
/* @__PURE__ */ i(wt, {})
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
),
|
|
149
|
+
/* @__PURE__ */ i(E, { className: u.titleText, variant: "h6", noWrap: !0, children: t }),
|
|
150
|
+
n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ l(
|
|
151
|
+
pt,
|
|
152
|
+
{
|
|
153
|
+
className: u.rightPanelButton,
|
|
154
|
+
color: "inherit",
|
|
155
|
+
"aria-label": "Open right side panel",
|
|
156
|
+
onClick: n == null ? void 0 : n.onOpen,
|
|
157
|
+
edge: "end",
|
|
158
|
+
size: "large",
|
|
159
|
+
children: [
|
|
160
|
+
" ",
|
|
161
|
+
/* @__PURE__ */ i(vt, {})
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
] }) })
|
|
166
|
+
] });
|
|
167
|
+
}
|
|
168
|
+
const Ft = 400, Yt = k(_t, {
|
|
169
|
+
shouldForwardProp: (t) => (
|
|
170
|
+
// Note we do want anchor to be forwarded to the Drawer component
|
|
171
|
+
![
|
|
172
|
+
"width",
|
|
173
|
+
"debug",
|
|
174
|
+
"debugOpacity",
|
|
175
|
+
"navBarOpen",
|
|
176
|
+
"navBarWidthOpen",
|
|
177
|
+
"navBarWidthClosed"
|
|
178
|
+
].includes(t)
|
|
179
|
+
),
|
|
180
|
+
name: "SidePanelDrawer"
|
|
181
|
+
})(
|
|
182
|
+
({ width: t, debugOpacity: e = !1, anchor: n, navBarOpen: o, navBarWidthOpen: c, navBarWidthClosed: m }) => ({
|
|
183
|
+
width: t,
|
|
184
|
+
"& .MuiDrawer-paper": r(r({
|
|
185
|
+
position: "absolute",
|
|
186
|
+
width: t,
|
|
187
|
+
boxSizing: "border-box",
|
|
188
|
+
border: "unset",
|
|
189
|
+
boxShadow: "0px 4px 5px rgba(0, 0, 0, 0.14), 0px 1px 10px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.2)"
|
|
190
|
+
}, e && {
|
|
191
|
+
opacity: "50%"
|
|
192
|
+
}), n === "left" && r({
|
|
193
|
+
marginLeft: `${m}px`
|
|
194
|
+
}, o && {
|
|
195
|
+
marginLeft: `${c}px`
|
|
196
|
+
}))
|
|
197
|
+
})
|
|
198
|
+
), Zt = k(Ht, {
|
|
199
|
+
shouldForwardProp: (t) => !["anchor"].includes(t)
|
|
200
|
+
})(({ theme: t, anchor: e }) => v(r({
|
|
201
|
+
display: "flex",
|
|
202
|
+
alignItems: "center",
|
|
203
|
+
padding: t.spacing(2)
|
|
204
|
+
}, t.mixins.toolbar), {
|
|
205
|
+
justifyContent: e === "left" ? "space-between" : "flex-start",
|
|
206
|
+
backgroundColor: t.palette.primary.light,
|
|
207
|
+
height: "88px",
|
|
208
|
+
"&,*": {
|
|
209
|
+
color: "white"
|
|
210
|
+
},
|
|
211
|
+
" .MuiTypography-root": {
|
|
212
|
+
fontSize: "22px"
|
|
213
|
+
},
|
|
214
|
+
" .MuiButtonBase-root": {
|
|
215
|
+
marginRight: e === "right" ? t.spacing(2) : 0
|
|
216
|
+
}
|
|
217
|
+
}));
|
|
218
|
+
function ft({
|
|
219
|
+
children: t,
|
|
220
|
+
anchor: e = "left",
|
|
221
|
+
open: n,
|
|
222
|
+
onClose: o = () => {
|
|
223
|
+
},
|
|
224
|
+
titleText: c = "",
|
|
225
|
+
width: m = Ft,
|
|
226
|
+
showCloseArrow: h = !0,
|
|
227
|
+
debugOpacity: d = !1,
|
|
228
|
+
headerBoxProps: F = {},
|
|
229
|
+
onOpened: f,
|
|
230
|
+
onClosed: p,
|
|
231
|
+
"data-testid": O,
|
|
232
|
+
navBarOpen: T = !1,
|
|
233
|
+
navBarWidthOpen: x = 0,
|
|
234
|
+
navBarWidthClosed: y = 0
|
|
235
|
+
}) {
|
|
236
|
+
return /* @__PURE__ */ l(
|
|
237
|
+
Yt,
|
|
238
|
+
{
|
|
239
|
+
SlideProps: {
|
|
240
|
+
onEntered: () => f == null ? void 0 : f(),
|
|
241
|
+
onExited: () => p == null ? void 0 : p()
|
|
242
|
+
},
|
|
243
|
+
variant: "persistent",
|
|
244
|
+
anchor: e,
|
|
245
|
+
open: n,
|
|
246
|
+
width: m,
|
|
247
|
+
debugOpacity: d,
|
|
248
|
+
"data-testid": O,
|
|
249
|
+
navBarOpen: T,
|
|
250
|
+
navBarWidthOpen: x,
|
|
251
|
+
navBarWidthClosed: y,
|
|
252
|
+
children: [
|
|
253
|
+
/* @__PURE__ */ i(Zt, v(r({ anchor: e }, F), { children: e === "left" ? /* @__PURE__ */ l(q, { children: [
|
|
254
|
+
/* @__PURE__ */ i(E, { variant: "h6", color: "inherit", component: "div", children: c }),
|
|
255
|
+
h && /* @__PURE__ */ l(ut, { onClick: o, size: "large", "aria-label": "Close left side panel", children: [
|
|
256
|
+
/* @__PURE__ */ i(vt, { "data-testid": "arrowbackicon" }),
|
|
257
|
+
" "
|
|
258
|
+
] })
|
|
259
|
+
] }) : /* @__PURE__ */ l(q, { children: [
|
|
260
|
+
h && /* @__PURE__ */ l(ut, { onClick: o, size: "large", "aria-label": "Close right side panel", children: [
|
|
261
|
+
/* @__PURE__ */ i(wt, {}),
|
|
262
|
+
" "
|
|
263
|
+
] }),
|
|
264
|
+
/* @__PURE__ */ i(E, { variant: "h6", color: "inherit", component: "div", children: c })
|
|
265
|
+
] }) })),
|
|
266
|
+
t
|
|
267
|
+
]
|
|
268
|
+
}
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
const te = k("div", {
|
|
272
|
+
shouldForwardProp: (t) => !["leftPanel", "rightPanel"].includes(t),
|
|
273
|
+
name: "PanelAwareMargins"
|
|
274
|
+
})(({ theme: t, leftPanel: e, rightPanel: n }) => {
|
|
275
|
+
var o, c;
|
|
276
|
+
return r(r({
|
|
277
|
+
transition: t.transitions.create("margin", {
|
|
278
|
+
easing: t.transitions.easing.sharp,
|
|
279
|
+
duration: t.transitions.duration.leavingScreen
|
|
280
|
+
})
|
|
281
|
+
}, (e == null ? void 0 : e.open) && {
|
|
282
|
+
transition: t.transitions.create("margin", {
|
|
283
|
+
easing: t.transitions.easing.easeOut,
|
|
284
|
+
duration: t.transitions.duration.enteringScreen
|
|
285
|
+
}),
|
|
286
|
+
marginLeft: `${(o = e == null ? void 0 : e.width) != null ? o : 0}px`
|
|
287
|
+
}), (n == null ? void 0 : n.open) && {
|
|
288
|
+
transition: t.transitions.create("margin", {
|
|
289
|
+
easing: t.transitions.easing.easeOut,
|
|
290
|
+
duration: t.transitions.duration.enteringScreen
|
|
291
|
+
}),
|
|
292
|
+
marginRight: `${(c = n == null ? void 0 : n.width) != null ? c : 0}px`
|
|
293
|
+
});
|
|
294
|
+
}), ee = k(Mt, {
|
|
295
|
+
name: "PageContainer"
|
|
296
|
+
})(({ theme: t }) => ({
|
|
297
|
+
// Horizontal padding comes from the Container's gutter
|
|
298
|
+
paddingTop: t.spacing(3),
|
|
299
|
+
paddingBottom: t.spacing(3)
|
|
300
|
+
})), Y = !1, Z = !1, z = {
|
|
301
|
+
titleText: "",
|
|
302
|
+
flavour: "push",
|
|
303
|
+
width: Ft,
|
|
304
|
+
arrowButtons: "both",
|
|
305
|
+
startOpen: !1,
|
|
306
|
+
open: void 0,
|
|
307
|
+
onChangeOpen: void 0,
|
|
308
|
+
content: /* @__PURE__ */ i(q, {}),
|
|
309
|
+
onOpened: void 0,
|
|
310
|
+
onClosed: void 0,
|
|
311
|
+
dataTestId: void 0
|
|
312
|
+
};
|
|
313
|
+
function Ne({
|
|
314
|
+
children: t,
|
|
315
|
+
titleText: e = "",
|
|
316
|
+
leftPanel: n,
|
|
317
|
+
rightPanel: o,
|
|
318
|
+
sidePanelsAreMutuallyExclusive: c = !0,
|
|
319
|
+
debugOpacity: m = !1,
|
|
320
|
+
pageContainerProps: h,
|
|
321
|
+
pageContentDataTestId: d,
|
|
322
|
+
topBarDataTestId: F,
|
|
323
|
+
navBarOpen: f,
|
|
324
|
+
navBarWidthOpen: p,
|
|
325
|
+
navBarWidthClosed: O
|
|
326
|
+
}) {
|
|
327
|
+
const [T, x] = b(Y), [y, S] = b(Z), [N, D] = b(Y), [G, g] = b(Z), B = n !== void 0, I = o !== void 0, {
|
|
328
|
+
titleText: L,
|
|
329
|
+
content: s,
|
|
330
|
+
flavour: a,
|
|
331
|
+
open: P,
|
|
332
|
+
onChangeOpen: et,
|
|
333
|
+
width: U,
|
|
334
|
+
arrowButtons: $,
|
|
335
|
+
startOpen: R,
|
|
336
|
+
onOpened: Tt,
|
|
337
|
+
onClosed: yt,
|
|
338
|
+
dataTestId: St
|
|
339
|
+
} = n ? r(r({}, z), n) : r({}, z), {
|
|
340
|
+
titleText: Bt,
|
|
341
|
+
content: bt,
|
|
342
|
+
flavour: nt,
|
|
343
|
+
open: W,
|
|
344
|
+
onChangeOpen: rt,
|
|
345
|
+
width: X,
|
|
346
|
+
arrowButtons: _,
|
|
347
|
+
startOpen: H,
|
|
348
|
+
onOpened: It,
|
|
349
|
+
onClosed: Pt,
|
|
350
|
+
dataTestId: At
|
|
351
|
+
} = o ? r(r({}, z), o) : r({}, z);
|
|
352
|
+
dt(() => {
|
|
353
|
+
R !== Y && (x(R), D(R));
|
|
354
|
+
}, [R]), dt(() => {
|
|
355
|
+
H !== Z && (S(H), g(H));
|
|
356
|
+
}, [H]);
|
|
357
|
+
const j = P === void 0 ? T : P, Q = W === void 0 ? y : W, ot = (w) => {
|
|
358
|
+
P === void 0 && (x(w), c && I && (w ? (S(!1), g(y)) : S(G))), et && et(w);
|
|
359
|
+
}, it = (w) => {
|
|
360
|
+
W === void 0 && (S(w), c && B && (w ? (x(!1), D(T)) : x(N))), rt && rt(w);
|
|
361
|
+
};
|
|
362
|
+
return /* @__PURE__ */ l(xt, { children: [
|
|
363
|
+
B && /* @__PURE__ */ i(
|
|
364
|
+
ft,
|
|
365
|
+
{
|
|
366
|
+
"data-testid": St,
|
|
367
|
+
anchor: "left",
|
|
368
|
+
open: j,
|
|
369
|
+
onClose: () => ot(!1),
|
|
370
|
+
width: U,
|
|
371
|
+
titleText: L,
|
|
372
|
+
debugOpacity: m,
|
|
373
|
+
showCloseArrow: $ === "both" || $ === "close",
|
|
374
|
+
onOpened: Tt,
|
|
375
|
+
onClosed: yt,
|
|
376
|
+
navBarOpen: f,
|
|
377
|
+
navBarWidthOpen: p,
|
|
378
|
+
navBarWidthClosed: O,
|
|
379
|
+
children: s
|
|
380
|
+
}
|
|
381
|
+
),
|
|
382
|
+
I && /* @__PURE__ */ i(
|
|
383
|
+
ft,
|
|
384
|
+
{
|
|
385
|
+
"data-testid": At,
|
|
386
|
+
anchor: "right",
|
|
387
|
+
open: Q,
|
|
388
|
+
onClose: () => it(!1),
|
|
389
|
+
width: X,
|
|
390
|
+
titleText: Bt,
|
|
391
|
+
debugOpacity: m,
|
|
392
|
+
showCloseArrow: _ === "both" || _ === "close",
|
|
393
|
+
onOpened: It,
|
|
394
|
+
onClosed: Pt,
|
|
395
|
+
navBarOpen: f,
|
|
396
|
+
navBarWidthOpen: p,
|
|
397
|
+
navBarWidthClosed: O,
|
|
398
|
+
children: bt
|
|
399
|
+
}
|
|
400
|
+
),
|
|
401
|
+
/* @__PURE__ */ i(
|
|
402
|
+
Jt,
|
|
403
|
+
r(r({
|
|
404
|
+
titleText: e,
|
|
405
|
+
"data-testid": F
|
|
406
|
+
}, B && a === "push" ? {
|
|
407
|
+
leftPanel: {
|
|
408
|
+
open: j,
|
|
409
|
+
width: U,
|
|
410
|
+
onOpen: () => ot(!0),
|
|
411
|
+
showOpenArrow: $ === "both" || $ === "open"
|
|
412
|
+
}
|
|
413
|
+
} : {}), I && nt === "push" ? {
|
|
414
|
+
rightPanel: {
|
|
415
|
+
open: Q,
|
|
416
|
+
width: X,
|
|
417
|
+
onOpen: () => it(!0),
|
|
418
|
+
showOpenArrow: _ === "both" || _ === "open"
|
|
419
|
+
}
|
|
420
|
+
} : {})
|
|
421
|
+
),
|
|
422
|
+
/* @__PURE__ */ i(
|
|
423
|
+
te,
|
|
424
|
+
v(r(r({}, a === "push" ? {
|
|
425
|
+
leftPanel: {
|
|
426
|
+
open: j,
|
|
427
|
+
width: U
|
|
428
|
+
}
|
|
429
|
+
} : {}), nt === "push" ? {
|
|
430
|
+
rightPanel: {
|
|
431
|
+
open: Q,
|
|
432
|
+
width: X
|
|
433
|
+
}
|
|
434
|
+
} : {}), {
|
|
435
|
+
children: /* @__PURE__ */ i(ee, v(r({ "data-testid": d }, h), { children: t }))
|
|
436
|
+
})
|
|
437
|
+
)
|
|
438
|
+
] });
|
|
439
|
+
}
|
|
440
|
+
const ne = Ct({
|
|
59
441
|
palette: {
|
|
60
442
|
primary: {
|
|
61
443
|
main: "#007236",
|
|
@@ -107,22 +489,22 @@ const se = q({
|
|
|
107
489
|
MuiMenuItem: {
|
|
108
490
|
// Setting defaultProps for color on MenuItem does not work, so update manually
|
|
109
491
|
styleOverrides: {
|
|
110
|
-
root: ({ theme:
|
|
492
|
+
root: ({ theme: t }) => ({
|
|
111
493
|
"&.Mui-selected": {
|
|
112
|
-
backgroundColor:
|
|
113
|
-
|
|
114
|
-
|
|
494
|
+
backgroundColor: J(
|
|
495
|
+
t.palette.secondary.main,
|
|
496
|
+
t.palette.action.selectedOpacity
|
|
115
497
|
),
|
|
116
498
|
"&:hover": {
|
|
117
|
-
backgroundColor:
|
|
118
|
-
|
|
119
|
-
|
|
499
|
+
backgroundColor: J(
|
|
500
|
+
t.palette.secondary.main,
|
|
501
|
+
t.palette.action.selectedOpacity
|
|
120
502
|
)
|
|
121
503
|
},
|
|
122
504
|
"&.Mui-focusVisible": {
|
|
123
|
-
backgroundColor:
|
|
124
|
-
|
|
125
|
-
|
|
505
|
+
backgroundColor: J(
|
|
506
|
+
t.palette.secondary.main,
|
|
507
|
+
t.palette.action.focusOpacity
|
|
126
508
|
)
|
|
127
509
|
}
|
|
128
510
|
}
|
|
@@ -143,7 +525,7 @@ const se = q({
|
|
|
143
525
|
fontWeight: 700
|
|
144
526
|
}
|
|
145
527
|
}
|
|
146
|
-
}),
|
|
528
|
+
}), re = Ct({
|
|
147
529
|
palette: {
|
|
148
530
|
primary: {
|
|
149
531
|
dark: "#00A651",
|
|
@@ -192,116 +574,116 @@ const se = q({
|
|
|
192
574
|
}
|
|
193
575
|
}
|
|
194
576
|
});
|
|
195
|
-
function
|
|
196
|
-
name:
|
|
197
|
-
children:
|
|
577
|
+
function De({
|
|
578
|
+
name: t = "internal",
|
|
579
|
+
children: e
|
|
198
580
|
}) {
|
|
199
|
-
return /* @__PURE__ */
|
|
581
|
+
return /* @__PURE__ */ i(zt, { theme: t === "internal" ? ne : t === "fed21" ? re : void 0, children: e });
|
|
200
582
|
}
|
|
201
|
-
class
|
|
583
|
+
class tt extends Xt {
|
|
202
584
|
}
|
|
203
|
-
|
|
204
|
-
const
|
|
205
|
-
throw new
|
|
206
|
-
},
|
|
207
|
-
throw new
|
|
208
|
-
},
|
|
209
|
-
enqueueNotification:
|
|
210
|
-
enqueueSuccessNotification:
|
|
211
|
-
enqueueInfoNotification:
|
|
212
|
-
enqueueWarningNotification:
|
|
213
|
-
enqueueErrorNotification:
|
|
214
|
-
removeNotification:
|
|
215
|
-
},
|
|
585
|
+
lt(tt, "errorName", "ContextError");
|
|
586
|
+
const A = () => {
|
|
587
|
+
throw new tt("SaladBarContext can only be used in a child of a <SaladBarProvider>");
|
|
588
|
+
}, oe = (t) => {
|
|
589
|
+
throw new tt("SaladBarContext can only be used in a child of a <SaladBarProvider>");
|
|
590
|
+
}, ie = {
|
|
591
|
+
enqueueNotification: A,
|
|
592
|
+
enqueueSuccessNotification: A,
|
|
593
|
+
enqueueInfoNotification: A,
|
|
594
|
+
enqueueWarningNotification: A,
|
|
595
|
+
enqueueErrorNotification: A,
|
|
596
|
+
removeNotification: oe
|
|
597
|
+
}, Ot = Dt(ie), ae = {
|
|
216
598
|
autoHideDuration: 6e3,
|
|
217
599
|
anchorOrigin: { vertical: "top", horizontal: "center" },
|
|
218
600
|
// The default is false. If we prefer timer to continue when window loses
|
|
219
601
|
// focus, change to true
|
|
220
602
|
disableWindowBlurListener: !1
|
|
221
|
-
},
|
|
222
|
-
shouldClose: (
|
|
223
|
-
},
|
|
603
|
+
}, se = {
|
|
604
|
+
shouldClose: (t, e) => e !== "clickaway"
|
|
605
|
+
}, gt = {
|
|
224
606
|
message: "",
|
|
225
607
|
severity: "info",
|
|
226
608
|
variant: "standard",
|
|
227
609
|
progressIndicator: void 0
|
|
228
610
|
// Can use 'circular' or 'linear'
|
|
229
|
-
},
|
|
230
|
-
let
|
|
231
|
-
return () => (
|
|
232
|
-
})(),
|
|
611
|
+
}, ht = 100, mt = 2e3, ce = 2e3, le = (() => {
|
|
612
|
+
let t = 0;
|
|
613
|
+
return () => (t += 1, t);
|
|
614
|
+
})(), de = {
|
|
233
615
|
borderBottomLeftRadius: "0px",
|
|
234
616
|
borderBottomRightRadius: "0px"
|
|
235
617
|
};
|
|
236
|
-
function
|
|
237
|
-
var
|
|
238
|
-
children:
|
|
239
|
-
shouldClose:
|
|
240
|
-
} =
|
|
618
|
+
function pe(o) {
|
|
619
|
+
var c = o, {
|
|
620
|
+
children: t,
|
|
621
|
+
shouldClose: e = se.shouldClose
|
|
622
|
+
} = c, n = ct(c, [
|
|
241
623
|
"children",
|
|
242
624
|
"shouldClose"
|
|
243
625
|
]);
|
|
244
|
-
var
|
|
245
|
-
const [
|
|
246
|
-
|
|
247
|
-
`SaladBarProvider: MAX_QUEUE_LENGTH (${
|
|
248
|
-
),
|
|
249
|
-
const
|
|
250
|
-
key:
|
|
251
|
-
}),
|
|
252
|
-
return
|
|
253
|
-
},
|
|
254
|
-
const
|
|
255
|
-
if (
|
|
256
|
-
return
|
|
257
|
-
},
|
|
258
|
-
|
|
259
|
-
},
|
|
626
|
+
var L;
|
|
627
|
+
const [m, h] = b(!1), d = K([]), F = K(Date.now()), f = K(0), p = (s = {}) => {
|
|
628
|
+
f.current += 1, d.current.length >= ht && Date.now() - F.current >= mt && (F.current = Date.now(), console.error(
|
|
629
|
+
`SaladBarProvider: MAX_QUEUE_LENGTH (${ht}) hit ${f.current} times in last ${mt}ms)`
|
|
630
|
+
), f.current = 0);
|
|
631
|
+
const a = r(v(r({}, gt), {
|
|
632
|
+
key: le()
|
|
633
|
+
}), s);
|
|
634
|
+
return d.current.push(a), d.current.length === 1 && h(!0), a.key;
|
|
635
|
+
}, O = (s = "", a = {}) => p(r({ message: s, severity: "success" }, a)), T = (s = "", a = {}) => p(r({ message: s, severity: "info" }, a)), x = (s = "", a = {}) => p(r({ message: s, severity: "warning" }, a)), y = (s = "", a = {}) => p(r({ message: s, severity: "error" }, a)), S = (s) => {
|
|
636
|
+
const a = d.current.findIndex((P) => P.key === s);
|
|
637
|
+
if (a !== -1)
|
|
638
|
+
return a === 0 ? (h(!1), d.current[0]) : d.current.splice(a, 1);
|
|
639
|
+
}, N = (s, a) => {
|
|
640
|
+
e(s, a) && h(!1);
|
|
641
|
+
}, D = () => {
|
|
260
642
|
}, G = () => {
|
|
261
|
-
|
|
262
|
-
},
|
|
263
|
-
"autoHideDuration" in
|
|
264
|
-
const
|
|
643
|
+
d.current.shift(), d.current.length > 0 && h(!0);
|
|
644
|
+
}, g = (L = d.current[0]) != null ? L : r({}, gt), B = {};
|
|
645
|
+
"autoHideDuration" in g && (B.autoHideDuration = g.autoHideDuration);
|
|
646
|
+
const I = r(r({}, ae), n);
|
|
265
647
|
return (
|
|
266
648
|
// Should be resolved when we move to React >= 18
|
|
267
649
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
268
650
|
// @ts-ignore
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
-
|
|
651
|
+
/* @__PURE__ */ l(
|
|
652
|
+
Ot.Provider,
|
|
271
653
|
{
|
|
272
654
|
value: {
|
|
273
|
-
enqueueNotification:
|
|
274
|
-
enqueueSuccessNotification:
|
|
275
|
-
enqueueInfoNotification:
|
|
276
|
-
enqueueWarningNotification:
|
|
277
|
-
enqueueErrorNotification:
|
|
278
|
-
removeNotification:
|
|
655
|
+
enqueueNotification: p,
|
|
656
|
+
enqueueSuccessNotification: O,
|
|
657
|
+
enqueueInfoNotification: T,
|
|
658
|
+
enqueueWarningNotification: x,
|
|
659
|
+
enqueueErrorNotification: y,
|
|
660
|
+
removeNotification: S
|
|
279
661
|
},
|
|
280
662
|
children: [
|
|
281
|
-
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
open:
|
|
286
|
-
onClose:
|
|
663
|
+
t,
|
|
664
|
+
/* @__PURE__ */ i(
|
|
665
|
+
qt,
|
|
666
|
+
v(r(r({}, I), B), {
|
|
667
|
+
open: m,
|
|
668
|
+
onClose: N,
|
|
287
669
|
TransitionProps: {
|
|
288
670
|
onExited: G,
|
|
289
|
-
onExit:
|
|
671
|
+
onExit: D
|
|
290
672
|
},
|
|
291
|
-
sx: { zIndex:
|
|
292
|
-
children: /* @__PURE__ */
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
-
|
|
673
|
+
sx: { zIndex: ce },
|
|
674
|
+
children: /* @__PURE__ */ l("div", { children: [
|
|
675
|
+
/* @__PURE__ */ i(
|
|
676
|
+
Gt,
|
|
295
677
|
{
|
|
296
|
-
onClose: (
|
|
297
|
-
severity:
|
|
678
|
+
onClose: (s) => N(s, "closeAlert"),
|
|
679
|
+
severity: g.severity,
|
|
298
680
|
variant: "filled",
|
|
299
|
-
icon:
|
|
300
|
-
style:
|
|
301
|
-
children:
|
|
681
|
+
icon: g.progressIndicator === "circular" ? /* @__PURE__ */ i(Wt, { size: "1em" }) : void 0,
|
|
682
|
+
style: g.progressIndicator === "linear" ? de : void 0,
|
|
683
|
+
children: g.message
|
|
302
684
|
}
|
|
303
685
|
),
|
|
304
|
-
|
|
686
|
+
g.progressIndicator === "linear" && /* @__PURE__ */ i(Ut, { color: "primary" })
|
|
305
687
|
] })
|
|
306
688
|
})
|
|
307
689
|
)
|
|
@@ -310,14 +692,17 @@ function De(i) {
|
|
|
310
692
|
)
|
|
311
693
|
);
|
|
312
694
|
}
|
|
313
|
-
function
|
|
314
|
-
return
|
|
695
|
+
function Le() {
|
|
696
|
+
return Lt(Ot);
|
|
315
697
|
}
|
|
698
|
+
const $e = jt(() => ({ children: t }) => /* @__PURE__ */ i(pe, { children: t }));
|
|
316
699
|
export {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
700
|
+
De as AgThemeProvider,
|
|
701
|
+
tt as ContextError,
|
|
702
|
+
ke as ExampleComponent,
|
|
703
|
+
Ne as PageLayout,
|
|
704
|
+
pe as SaladBarProvider,
|
|
705
|
+
Le as useSaladBar,
|
|
706
|
+
$e as withSaladBarProvider
|
|
322
707
|
};
|
|
323
708
|
//# sourceMappingURL=index.js.map
|