@rws-aoa/react-library 6.0.1 → 7.0.0
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/_constants.js.map +1 -1
- package/dist/chunks/FieldError.CCQnjdMd.js +161 -0
- package/dist/chunks/{FieldError.B8t3zEhf.js.map → FieldError.CCQnjdMd.js.map} +1 -1
- package/dist/chunks/compiler-runtime.hDcrsMwn.js +55 -0
- package/dist/chunks/compiler-runtime.hDcrsMwn.js.map +1 -0
- package/dist/components/atoms/_menu/menu-item/MenuItem.d.ts +2 -2
- package/dist/components/atoms/_menu/menu-item/MenuItem.d.ts.map +1 -1
- package/dist/components/atoms/_menu/menu-item/MenuItem.js +73 -128
- package/dist/components/atoms/_menu/menu-item/MenuItem.js.map +1 -1
- package/dist/components/atoms/_menu/user-menu/UserMenu.d.ts +1 -2
- package/dist/components/atoms/_menu/user-menu/UserMenu.d.ts.map +1 -1
- package/dist/components/atoms/_menu/user-menu/UserMenu.js +72 -72
- package/dist/components/atoms/_menu/user-menu/UserMenu.js.map +1 -1
- package/dist/components/atoms/button/Button.d.ts +2 -2
- package/dist/components/atoms/button/Button.d.ts.map +1 -1
- package/dist/components/atoms/button/Button.js +120 -133
- package/dist/components/atoms/button/Button.js.map +1 -1
- package/dist/components/atoms/icon-button/IconButton.d.ts +6 -1
- package/dist/components/atoms/icon-button/IconButton.d.ts.map +1 -1
- package/dist/components/atoms/icon-button/IconButton.js +50 -50
- package/dist/components/atoms/icon-button/IconButton.js.map +1 -1
- package/dist/components/atoms/input/Input.d.ts +1 -2
- package/dist/components/atoms/input/Input.d.ts.map +1 -1
- package/dist/components/atoms/input/Input.js +51 -56
- package/dist/components/atoms/input/Input.js.map +1 -1
- package/dist/components/atoms/logo/Logo.d.ts +2 -2
- package/dist/components/atoms/logo/Logo.d.ts.map +1 -1
- package/dist/components/atoms/logo/Logo.js +298 -457
- package/dist/components/atoms/logo/Logo.js.map +1 -1
- package/dist/components/atoms/no-permission/NoPermission.d.ts +1 -1
- package/dist/components/atoms/no-permission/NoPermission.d.ts.map +1 -1
- package/dist/components/atoms/no-permission/NoPermission.js +20 -23
- package/dist/components/atoms/no-permission/NoPermission.js.map +1 -1
- package/dist/components/atoms/notification/Notification.d.ts +1 -2
- package/dist/components/atoms/notification/Notification.d.ts.map +1 -1
- package/dist/components/atoms/notification/Notification.js +29 -41
- package/dist/components/atoms/notification/Notification.js.map +1 -1
- package/dist/components/atoms/notification/_icons/Error.d.ts +1 -1
- package/dist/components/atoms/notification/_icons/Error.d.ts.map +1 -1
- package/dist/components/atoms/notification/_icons/Error.js +25 -32
- package/dist/components/atoms/notification/_icons/Error.js.map +1 -1
- package/dist/components/atoms/notification/_icons/Info.d.ts +1 -1
- package/dist/components/atoms/notification/_icons/Info.d.ts.map +1 -1
- package/dist/components/atoms/notification/_icons/Info.js +26 -39
- package/dist/components/atoms/notification/_icons/Info.js.map +1 -1
- package/dist/components/atoms/notification/_icons/Success.d.ts +1 -1
- package/dist/components/atoms/notification/_icons/Success.d.ts.map +1 -1
- package/dist/components/atoms/notification/_icons/Success.js +26 -39
- package/dist/components/atoms/notification/_icons/Success.js.map +1 -1
- package/dist/components/atoms/notification/_icons/Warning.js +23 -38
- package/dist/components/atoms/notification/_icons/Warning.js.map +1 -1
- package/dist/components/atoms/section-header/SectionHeader.d.ts +1 -1
- package/dist/components/atoms/section-header/SectionHeader.d.ts.map +1 -1
- package/dist/components/atoms/section-header/SectionHeader.js +37 -64
- package/dist/components/atoms/section-header/SectionHeader.js.map +1 -1
- package/dist/components/atoms/selection-buttons/checkbox/Checkbox.d.ts +1 -2
- package/dist/components/atoms/selection-buttons/checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/atoms/selection-buttons/checkbox/Checkbox.js +23 -35
- package/dist/components/atoms/selection-buttons/checkbox/Checkbox.js.map +1 -1
- package/dist/components/atoms/selection-buttons/radio-button/RadioButton.d.ts +1 -2
- package/dist/components/atoms/selection-buttons/radio-button/RadioButton.d.ts.map +1 -1
- package/dist/components/atoms/selection-buttons/radio-button/RadioButton.js +19 -29
- package/dist/components/atoms/selection-buttons/radio-button/RadioButton.js.map +1 -1
- package/dist/components/atoms/selection-buttons/switch-button/SwitchButton.d.ts +1 -2
- package/dist/components/atoms/selection-buttons/switch-button/SwitchButton.d.ts.map +1 -1
- package/dist/components/atoms/selection-buttons/switch-button/SwitchButton.js +26 -29
- package/dist/components/atoms/selection-buttons/switch-button/SwitchButton.js.map +1 -1
- package/dist/components/atoms/table/Table.d.ts +1 -0
- package/dist/components/atoms/table/Table.d.ts.map +1 -1
- package/dist/components/atoms/table/Table.js +173 -202
- package/dist/components/atoms/table/Table.js.map +1 -1
- package/dist/components/atoms/table/_QuickSearchToolbar.d.ts +1 -1
- package/dist/components/atoms/table/_QuickSearchToolbar.d.ts.map +1 -1
- package/dist/components/atoms/table/_QuickSearchToolbar.js +1434 -1523
- package/dist/components/atoms/table/_QuickSearchToolbar.js.map +1 -1
- package/dist/components/atoms/tooltip/Tooltip.js +16 -27
- package/dist/components/atoms/tooltip/Tooltip.js.map +1 -1
- package/dist/components/atoms/zero-width-space/ZeroWidthSpace.d.ts +1 -2
- package/dist/components/atoms/zero-width-space/ZeroWidthSpace.d.ts.map +1 -1
- package/dist/components/atoms/zero-width-space/ZeroWidthSpace.js +16 -7
- package/dist/components/atoms/zero-width-space/ZeroWidthSpace.js.map +1 -1
- package/dist/components/molecules/field-error/FieldError.js +3 -2
- package/dist/components/molecules/field-error/FieldError.js.map +1 -1
- package/dist/components/molecules/file-dropzone/FileDropzone.d.ts.map +1 -1
- package/dist/components/molecules/file-dropzone/FileDropzone.js +90 -79
- package/dist/components/molecules/file-dropzone/FileDropzone.js.map +1 -1
- package/dist/components/molecules/file-table/FileTable.js +4 -14
- package/dist/components/molecules/file-table/FileTable.js.map +1 -1
- package/dist/components/molecules/form-error/FormError.js +3 -2
- package/dist/components/molecules/form-error/FormError.js.map +1 -1
- package/dist/components/molecules/form-modal/FormModal.js +3 -2
- package/dist/components/molecules/form-modal/FormModal.js.map +1 -1
- package/dist/components/molecules/modal/Modal.d.ts +1 -1
- package/dist/components/molecules/modal/Modal.d.ts.map +1 -1
- package/dist/components/molecules/modal/Modal.js +50 -68
- package/dist/components/molecules/modal/Modal.js.map +1 -1
- package/dist/components/molecules/modal-close-button/ModalCloseButton.d.ts +1 -1
- package/dist/components/molecules/modal-close-button/ModalCloseButton.d.ts.map +1 -1
- package/dist/components/molecules/modal-close-button/ModalCloseButton.js +20 -19
- package/dist/components/molecules/modal-close-button/ModalCloseButton.js.map +1 -1
- package/dist/components/molecules/navigation-bar/NavigationBar.d.ts +1 -2
- package/dist/components/molecules/navigation-bar/NavigationBar.d.ts.map +1 -1
- package/dist/components/molecules/navigation-bar/NavigationBar.js +96 -97
- package/dist/components/molecules/navigation-bar/NavigationBar.js.map +1 -1
- package/dist/components/molecules/upload-button/UploadButton.js +36 -33
- package/dist/components/molecules/upload-button/UploadButton.js.map +1 -1
- package/dist/components/organisms/content-page/ContentPage.d.ts +1 -1
- package/dist/components/organisms/content-page/ContentPage.d.ts.map +1 -1
- package/dist/components/organisms/content-page/ContentPage.js +22 -11
- package/dist/components/organisms/content-page/ContentPage.js.map +1 -1
- package/dist/contexts/TanstackFormContext.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +14 -14
- package/dist/chunks/FieldError.B8t3zEhf.js +0 -143
package/dist/_constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_constants.js","sources":["../src/_constants.ts"],"sourcesContent":["import type { SxProps } from '@mui/material';\n\nexport const FontNormalSxProps = {\n fontFamily: 'var(--font-text)',\n fontSize: 'var(--font-size-text)',\n lineHeight: 'var(--font-lineheight-text)',\n fontStyle: 'normal',\n fontWeight: 'normal'\n} satisfies SxProps;\n\nexport function isExtensionAllowed(regExp: RegExp, fileName: string) {\n return regExp.test(fileName);\n}\n"],"names":["FontNormalSxProps","isExtensionAllowed","regExp","fileName"],"mappings":"AAEO,MAAMA,IAAoB;AAAA,EAC/
|
|
1
|
+
{"version":3,"file":"_constants.js","sources":["../src/_constants.ts"],"sourcesContent":["import type { SxProps } from '@mui/material';\n\nexport const FontNormalSxProps = {\n fontFamily: 'var(--font-text)',\n fontSize: 'var(--font-size-text)',\n lineHeight: 'var(--font-lineheight-text)',\n fontStyle: 'normal',\n fontWeight: 'normal'\n} satisfies SxProps;\n\nexport function isExtensionAllowed(regExp: RegExp, fileName: string) {\n return regExp.test(fileName);\n}\n"],"names":["FontNormalSxProps","fontFamily","fontSize","lineHeight","fontStyle","fontWeight","isExtensionAllowed","regExp","fileName","test"],"mappings":"AAEO,MAAMA,IAAoB;AAAA,EAC/BC,YAAY;AAAA,EACZC,UAAU;AAAA,EACVC,YAAY;AAAA,EACZC,WAAW;AAAA,EACXC,YAAY;AACd;AAEO,SAASC,EAAmBC,GAAgBC,GAAkB;AACnE,SAAOD,EAAOE,KAAKD,CAAQ;AAC7B;"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { jsx as n, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import { c as R } from "./compiler-runtime.hDcrsMwn.js";
|
|
3
|
+
import { createFormHookContexts as K, createFormHook as O } from "@tanstack/react-form";
|
|
4
|
+
import { AoaNotification as P } from "../components/atoms/notification/Notification.js";
|
|
5
|
+
import { DialogTitle as U, DialogContent as V, Dialog as X, DialogActions as Y } from "@mui/material";
|
|
6
|
+
import { l as Z } from "./lodash.CA_K01A9.js";
|
|
7
|
+
import { AoaButton as W } from "../components/atoms/button/Button.js";
|
|
8
|
+
import { AoaModalCloseButton as tt } from "../components/molecules/modal-close-button/ModalCloseButton.js";
|
|
9
|
+
function et(l) {
|
|
10
|
+
const t = R.c(5), {
|
|
11
|
+
"data-qa": s
|
|
12
|
+
} = l, r = I();
|
|
13
|
+
let a;
|
|
14
|
+
t[0] !== s ? (a = (i) => {
|
|
15
|
+
if (i.length) {
|
|
16
|
+
const e = i.at(0);
|
|
17
|
+
if (typeof e == "string")
|
|
18
|
+
return /* @__PURE__ */ n(P, { "data-qa": s ?? "form-error", message: e, severity: "error" });
|
|
19
|
+
if (e && typeof e == "object") {
|
|
20
|
+
const m = ["error", "info", "success", "warning"].includes(e.level) ? e.level : "error";
|
|
21
|
+
return /* @__PURE__ */ n(P, { "data-qa": s ?? "form-error", message: e.message, severity: m });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}, t[0] = s, t[1] = a) : a = t[1];
|
|
26
|
+
let o;
|
|
27
|
+
return t[2] !== r.Subscribe || t[3] !== a ? (o = /* @__PURE__ */ n(r.Subscribe, { selector: ot, children: a }), t[2] = r.Subscribe, t[3] = a, t[4] = o) : o = t[4], o;
|
|
28
|
+
}
|
|
29
|
+
function ot(l) {
|
|
30
|
+
return l.errors;
|
|
31
|
+
}
|
|
32
|
+
function rt(l) {
|
|
33
|
+
const t = R.c(51), {
|
|
34
|
+
formModalQas: s,
|
|
35
|
+
formLabels: r,
|
|
36
|
+
formName: a,
|
|
37
|
+
DialogProps: o,
|
|
38
|
+
DialogTitleProps: i,
|
|
39
|
+
DialogContentProps: e,
|
|
40
|
+
AoaSubmitButtonProps: m,
|
|
41
|
+
modalQas: f,
|
|
42
|
+
open: J,
|
|
43
|
+
topic: T,
|
|
44
|
+
dialogContent: j,
|
|
45
|
+
closeAction: d
|
|
46
|
+
} = l;
|
|
47
|
+
let p;
|
|
48
|
+
t[0] !== m ? (p = m === void 0 ? {} : m, t[0] = m, t[1] = p) : p = t[1];
|
|
49
|
+
let u, b;
|
|
50
|
+
t[2] !== p ? ({
|
|
51
|
+
disableWithFormState: b,
|
|
52
|
+
...u
|
|
53
|
+
} = p, t[2] = p, t[3] = u, t[4] = b) : (u = t[3], b = t[4]);
|
|
54
|
+
const c = I();
|
|
55
|
+
let v;
|
|
56
|
+
t[5] !== u || t[6] !== b || t[7] !== c.Subscribe || t[8] !== r.submit || t[9] !== s?.submitButton ? (v = b ? /* @__PURE__ */ n(c.Subscribe, { selector: st, children: (w) => {
|
|
57
|
+
const [z, G] = w;
|
|
58
|
+
return /* @__PURE__ */ n(W, { ...u, "aria-disabled": z || !G, buttonType: "submit", "data-qa": s?.submitButton ?? "submit-form", disabled: z || !G, type: "primary", children: r.submit });
|
|
59
|
+
} }) : /* @__PURE__ */ n(W, { ...u, buttonType: "submit", "data-qa": s?.submitButton ?? "submit-form", type: "primary", children: r.submit }), t[5] = u, t[6] = b, t[7] = c.Subscribe, t[8] = r.submit, t[9] = s?.submitButton, t[10] = v) : v = t[10];
|
|
60
|
+
const E = v, Q = f?.modal ?? "modal", _ = !!J, $ = f?.title ?? "modal-title";
|
|
61
|
+
let B;
|
|
62
|
+
t[11] === Symbol.for("react.memo_cache_sentinel") ? (B = {
|
|
63
|
+
m: 0,
|
|
64
|
+
p: 2
|
|
65
|
+
}, t[11] = B) : B = t[11];
|
|
66
|
+
let g;
|
|
67
|
+
t[12] !== i || t[13] !== $ || t[14] !== T ? (g = /* @__PURE__ */ n(U, { ...i, "data-qa": $, maxWidth: "sm", sx: B, children: T }), t[12] = i, t[13] = $, t[14] = T, t[15] = g) : g = t[15];
|
|
68
|
+
let x;
|
|
69
|
+
t[16] !== d ? (x = /* @__PURE__ */ n(tt, { closeAction: d }), t[16] = d, t[17] = x) : x = t[17];
|
|
70
|
+
const k = s?.form ?? "form";
|
|
71
|
+
let h;
|
|
72
|
+
t[18] !== c ? (h = async (w) => {
|
|
73
|
+
w.preventDefault(), w.stopPropagation(), await c.handleSubmit();
|
|
74
|
+
}, t[18] = c, t[19] = h) : h = t[19];
|
|
75
|
+
const L = f?.content ?? "modal-content";
|
|
76
|
+
let y;
|
|
77
|
+
t[20] !== e?.sx ? (y = Z.merge({
|
|
78
|
+
padding: "0 3rem 2rem"
|
|
79
|
+
}, e?.sx), t[20] = e?.sx, t[21] = y) : y = t[21];
|
|
80
|
+
let A;
|
|
81
|
+
t[22] !== e || t[23] !== j || t[24] !== L || t[25] !== y ? (A = /* @__PURE__ */ n(V, { ...e, "data-qa": L, sx: y, children: j }), t[22] = e, t[23] = j, t[24] = L, t[25] = y, t[26] = A) : A = t[26];
|
|
82
|
+
const M = s?.dialogActions ?? "dialog-actions", H = s?.cancelButton ?? "cancel-form";
|
|
83
|
+
let C;
|
|
84
|
+
t[27] !== d || t[28] !== c ? (C = () => {
|
|
85
|
+
c.reset(), d();
|
|
86
|
+
}, t[27] = d, t[28] = c, t[29] = C) : C = t[29];
|
|
87
|
+
let S;
|
|
88
|
+
t[30] !== r.cancel || t[31] !== H || t[32] !== C ? (S = /* @__PURE__ */ n(W, { "data-qa": H, onClick: C, type: "secondary", children: r.cancel }), t[30] = r.cancel, t[31] = H, t[32] = C, t[33] = S) : S = t[33];
|
|
89
|
+
let F;
|
|
90
|
+
t[34] !== E || t[35] !== M || t[36] !== S ? (F = /* @__PURE__ */ N(Y, { "data-qa": M, children: [
|
|
91
|
+
S,
|
|
92
|
+
E
|
|
93
|
+
] }), t[34] = E, t[35] = M, t[36] = S, t[37] = F) : F = t[37];
|
|
94
|
+
let q;
|
|
95
|
+
t[38] !== a || t[39] !== k || t[40] !== h || t[41] !== A || t[42] !== F ? (q = /* @__PURE__ */ N("form", { "data-qa": k, name: a, onSubmit: h, children: [
|
|
96
|
+
A,
|
|
97
|
+
F
|
|
98
|
+
] }), t[38] = a, t[39] = k, t[40] = h, t[41] = A, t[42] = F, t[43] = q) : q = t[43];
|
|
99
|
+
let D;
|
|
100
|
+
return t[44] !== o || t[45] !== q || t[46] !== Q || t[47] !== _ || t[48] !== g || t[49] !== x ? (D = /* @__PURE__ */ N(X, { ...o, "data-qa": Q, open: _, children: [
|
|
101
|
+
g,
|
|
102
|
+
x,
|
|
103
|
+
q
|
|
104
|
+
] }), t[44] = o, t[45] = q, t[46] = Q, t[47] = _, t[48] = g, t[49] = x, t[50] = D) : D = t[50], D;
|
|
105
|
+
}
|
|
106
|
+
function st(l) {
|
|
107
|
+
return [l.isSubmitting, l.canSubmit];
|
|
108
|
+
}
|
|
109
|
+
const {
|
|
110
|
+
fieldContext: at,
|
|
111
|
+
formContext: it,
|
|
112
|
+
useFieldContext: nt,
|
|
113
|
+
useFormContext: I
|
|
114
|
+
} = K(), {
|
|
115
|
+
useAppForm: xt,
|
|
116
|
+
withForm: ht
|
|
117
|
+
} = O({
|
|
118
|
+
fieldContext: at,
|
|
119
|
+
formContext: it,
|
|
120
|
+
fieldComponents: {
|
|
121
|
+
AoaFieldError: lt
|
|
122
|
+
},
|
|
123
|
+
formComponents: {
|
|
124
|
+
AoaFormModal: rt,
|
|
125
|
+
AoaFormError: et
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
function lt(l) {
|
|
129
|
+
const t = R.c(11), {
|
|
130
|
+
"data-qa": s
|
|
131
|
+
} = l, r = nt();
|
|
132
|
+
if (r.state.meta.isTouched && r.state.meta.errors.length) {
|
|
133
|
+
let a;
|
|
134
|
+
t[0] !== r.state.meta.errors ? (a = r.state.meta.errors.at(0), t[0] = r.state.meta.errors, t[1] = a) : a = t[1];
|
|
135
|
+
const o = a;
|
|
136
|
+
if (typeof o == "string") {
|
|
137
|
+
const i = s ?? "field-error";
|
|
138
|
+
let e;
|
|
139
|
+
return t[2] !== o || t[3] !== i ? (e = /* @__PURE__ */ n(P, { "data-qa": i, message: o, severity: "error" }), t[2] = o, t[3] = i, t[4] = e) : e = t[4], e;
|
|
140
|
+
} else if (o && typeof o == "object") {
|
|
141
|
+
let i;
|
|
142
|
+
t[5] !== o.level ? (i = ["error", "info", "success", "warning"].includes(o.level) ? o.level : "error", t[5] = o.level, t[6] = i) : i = t[6];
|
|
143
|
+
const e = i, m = s ?? "field-error";
|
|
144
|
+
let f;
|
|
145
|
+
return t[7] !== o.message || t[8] !== e || t[9] !== m ? (f = /* @__PURE__ */ n(P, { "data-qa": m, message: o.message, severity: e }), t[7] = o.message, t[8] = e, t[9] = m, t[10] = f) : f = t[10], f;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
export {
|
|
151
|
+
lt as A,
|
|
152
|
+
et as a,
|
|
153
|
+
rt as b,
|
|
154
|
+
at as c,
|
|
155
|
+
it as d,
|
|
156
|
+
nt as e,
|
|
157
|
+
I as f,
|
|
158
|
+
xt as u,
|
|
159
|
+
ht as w
|
|
160
|
+
};
|
|
161
|
+
//# sourceMappingURL=FieldError.CCQnjdMd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldError.B8t3zEhf.js","sources":["../../src/components/molecules/form-error/FormError.tsx","../../src/components/molecules/form-modal/FormModal.tsx","../../src/contexts/TanstackFormContext.ts","../../src/components/molecules/field-error/FieldError.tsx"],"sourcesContent":["import { useAoaFormContext } from '../../../contexts/TanstackFormContext';\nimport { AoaNotification, type Severity } from '../../atoms/notification/Notification';\n\nexport interface AoaFormErrorProps {\n readonly 'data-qa'?: string;\n}\n\n/**\n * Constructs a custom error message for a form **using pre-defined Rijks styling**\n *\n * This component is intended for internal use only and should always be used through `<form.AoaFormError />`\n *\n * @internal\n * @param param0 - Props to pass to the form error\n * @returns A custom error message for a form\n * @example\n * ```jsx\n * <form.AppForm>\n * <form.AoaFormError />\n * </form.AppForm>\n * ```\n */\nexport function AoaFormError({ 'data-qa': dataQa }: AoaFormErrorProps) {\n const form = useAoaFormContext();\n\n return (\n <form.Subscribe selector={(state) => state.errors}>\n {(errors) => {\n if (errors.length) {\n const error = errors.at(0);\n\n if (typeof error === 'string') {\n return <AoaNotification data-qa={dataQa ?? 'form-error'} message={error} severity='error' />;\n } else if (error && typeof error === 'object') {\n const parsedLevel = ['error', 'info', 'success', 'warning'].includes(error.level)\n ? (error.level as Severity)\n : 'error';\n return <AoaNotification data-qa={dataQa ?? 'form-error'} message={error.message} severity={parsedLevel} />;\n }\n }\n\n return null;\n }}\n </form.Subscribe>\n );\n}\n","import { Dialog, DialogActions, DialogContent, DialogTitle } from '@mui/material';\nimport { merge } from 'lodash';\nimport { useAoaFormContext } from '../../../contexts/TanstackFormContext';\nimport { AoaButton, type AoaButtonProps } from '../../atoms/button/Button';\nimport type { AoaModalProps } from '../modal/Modal';\nimport { AoaModalCloseButton, type AoaModalCloseButtonProps } from '../modal-close-button/ModalCloseButton';\n\nexport interface AoaFormModalQAs {\n /**\n * Data-qa tag applied to the \"cancel\" button\n */\n cancelButton?: string;\n /**\n * Data-qa tag applied to the `DialogActions` component\n */\n dialogActions?: string;\n /**\n * Data-qa tag applied to the HTML `form` element\n */\n form?: string;\n /**\n * Data-qa tag applied to the \"submit\" button\n */\n submitButton?: string;\n}\n\nexport interface AoaFormModalLabels {\n cancel: string;\n submit: string;\n}\n\nexport interface AoaFormModalProps extends Omit<AoaModalProps, 'dialogActions'>, AoaModalCloseButtonProps {\n /**\n * Additional properties to provide to the {@link AoaButton | submit button}\n */\n AoaSubmitButtonProps?: Omit<AoaButtonProps, 'buttonType' | 'data-qa' | 'disabled' | 'onClick' | 'type'> & {\n disableWithFormState?: boolean;\n };\n /**\n * Labels for the buttons in {@link DialogActions}\n */\n formLabels: AoaFormModalLabels;\n /**\n * data-qa tags for the components in the form section of the modal\n */\n formModalQas?: AoaFormModalQAs;\n /**\n * Optionally the `name` property for the HTML form element\n */\n formName?: string;\n}\n\n/**\n * Constructs a modal **for holding a Form** using pre-defined Rijks styling\n *\n * For a modal without a form see `AoaModal`\n *\n * This component is intended for internal use only and should always be used through `<form.AoaFormModal />`\n *\n * @internal\n * @param props - Props to pass to the modal - {@link ModalProps}\n * @example\n * ```jsx\n * <form.AppForm>\n * <form.AoaFormModal\n * open={true}\n * formLabels={{\n * submit: 'submit',\n * cancel: 'cancel'\n * }}\n * formModalQas={{\n * cancelButton: 'cancel-button',\n * dialogActions: 'dialog-actions,\n * form: 'form',\n * submitButton: 'confirm-button'\n * }}\n * closeAction={handleClose}\n * topic='topic'\n * modalQas={{\n * modal: 'modal',\n * content: 'modal-content',\n * title: 'modal-title'\n * }}\n * formName='form'\n * dialogContent={content}\n * />\n * </form.AppForm>\n * ```\n */\nexport function AoaFormModal({\n formModalQas,\n formLabels,\n formName,\n DialogProps,\n DialogTitleProps,\n DialogContentProps,\n AoaSubmitButtonProps: { disableWithFormState, ...AoaSubmitButtonProps } = {},\n modalQas,\n open,\n topic,\n dialogContent,\n closeAction\n}: Readonly<AoaFormModalProps>) {\n const form = useAoaFormContext();\n\n const SubmitButton = disableWithFormState ? (\n <form.Subscribe selector={(state) => [state.isSubmitting, state.canSubmit] as const}>\n {([isSubmitting, canSubmit]) => (\n <AoaButton\n {...AoaSubmitButtonProps}\n aria-disabled={isSubmitting || !canSubmit}\n buttonType='submit'\n data-qa={formModalQas?.submitButton ?? 'submit-form'}\n disabled={isSubmitting || !canSubmit}\n type='primary'\n >\n {formLabels.submit}\n </AoaButton>\n )}\n </form.Subscribe>\n ) : (\n <AoaButton\n {...AoaSubmitButtonProps}\n buttonType='submit'\n data-qa={formModalQas?.submitButton ?? 'submit-form'}\n type='primary'\n >\n {formLabels.submit}\n </AoaButton>\n );\n\n return (\n <Dialog {...DialogProps} data-qa={modalQas?.modal ?? 'modal'} open={Boolean(open)}>\n <DialogTitle {...DialogTitleProps} data-qa={modalQas?.title ?? 'modal-title'} maxWidth='sm' sx={{ m: 0, p: 2 }}>\n {topic}\n </DialogTitle>\n <AoaModalCloseButton closeAction={closeAction} />\n <form\n data-qa={formModalQas?.form ?? 'form'}\n name={formName}\n onSubmit={async (event) => {\n event.preventDefault();\n event.stopPropagation();\n await form.handleSubmit();\n }}\n >\n <DialogContent\n {...DialogContentProps}\n data-qa={modalQas?.content ?? 'modal-content'}\n sx={merge(\n {\n padding: '0 3rem 2rem'\n },\n DialogContentProps?.sx\n )}\n >\n {dialogContent}\n </DialogContent>\n <DialogActions data-qa={formModalQas?.dialogActions ?? 'dialog-actions'}>\n <AoaButton\n data-qa={formModalQas?.cancelButton ?? 'cancel-form'}\n onClick={() => {\n form.reset();\n closeAction();\n }}\n type='secondary'\n >\n {formLabels.cancel}\n </AoaButton>\n {SubmitButton}\n </DialogActions>\n </form>\n </Dialog>\n );\n}\n","import { createFormHook, createFormHookContexts } from '@tanstack/react-form';\nimport { AoaFieldError } from '../components/molecules/field-error/FieldError';\nimport { AoaFormError } from '../components/molecules/form-error/FormError';\nimport { AoaFormModal } from '../components/molecules/form-modal/FormModal';\n\nexport const {\n fieldContext: aoaFieldContext,\n formContext: aoaFormContext,\n useFieldContext: useAoaFieldContext,\n useFormContext: useAoaFormContext\n} = createFormHookContexts();\n\nexport const { useAppForm: useAoaAppForm, withForm: withAoaForm } = createFormHook({\n fieldContext: aoaFieldContext,\n formContext: aoaFormContext,\n fieldComponents: {\n AoaFieldError\n },\n formComponents: {\n AoaFormModal,\n AoaFormError\n }\n});\n","import { useAoaFieldContext } from '../../../contexts/TanstackFormContext';\nimport { AoaNotification, type Severity } from '../../atoms/notification/Notification';\n\nexport interface AoaFieldErrorProps {\n readonly 'data-qa'?: string;\n}\n\n/**\n * Constructs a custom error message for a field **using pre-defined Rijks styling**\n *\n * This component is intended for internal use only and should always be used through `<field.AoaFieldError />`\n *\n * @internal\n * @param param0 - Props to pass to the field error\n * @returns A custom error message for a field\n * @example\n * ```jsx\n * <form.AppField name='name'>\n * {(field) => {\n * return <field.AoaFieldError />;\n * }}\n * </form.AppField>\n * ```\n */\nexport function AoaFieldError<TData>({ 'data-qa': dataQa }: AoaFieldErrorProps) {\n const field = useAoaFieldContext<TData>();\n\n if (field.state.meta.isTouched && field.state.meta.errors.length) {\n const error = field.state.meta.errors.at(0);\n\n if (typeof error === 'string') {\n return <AoaNotification data-qa={dataQa ?? 'field-error'} message={error} severity='error' />;\n } else if (error && typeof error === 'object') {\n const parsedLevel = ['error', 'info', 'success', 'warning'].includes(error.level)\n ? (error.level as Severity)\n : 'error';\n return <AoaNotification data-qa={dataQa ?? 'field-error'} message={error.message} severity={parsedLevel} />;\n }\n }\n\n return null;\n}\n"],"names":["AoaFormError","dataQa","form","useAoaFormContext","jsx","state","errors","error","AoaNotification","parsedLevel","AoaFormModal","formModalQas","formLabels","formName","DialogProps","DialogTitleProps","DialogContentProps","disableWithFormState","AoaSubmitButtonProps","modalQas","open","topic","dialogContent","closeAction","SubmitButton","isSubmitting","canSubmit","AoaButton","jsxs","Dialog","DialogTitle","AoaModalCloseButton","event","DialogContent","merge","DialogActions","aoaFieldContext","aoaFormContext","useAoaFieldContext","createFormHookContexts","useAoaAppForm","withAoaForm","createFormHook","AoaFieldError","field"],"mappings":";;;;;;;AAsBO,SAASA,EAAa,EAAE,WAAWC,KAA6B;AACrE,QAAMC,IAAOC,EAAA;AAEb,SACE,gBAAAC,EAACF,EAAK,WAAL,EAAe,UAAU,CAACG,MAAUA,EAAM,QACxC,UAAA,CAACC,MAAW;AACX,QAAIA,EAAO,QAAQ;AACjB,YAAMC,IAAQD,EAAO,GAAG,CAAC;AAEzB,UAAI,OAAOC,KAAU;AACnB,eAAO,gBAAAH,EAACI,KAAgB,WAASP,KAAU,cAAc,SAASM,GAAO,UAAS,SAAQ;AAC5F,UAAWA,KAAS,OAAOA,KAAU,UAAU;AAC7C,cAAME,IAAc,CAAC,SAAS,QAAQ,WAAW,SAAS,EAAE,SAASF,EAAM,KAAK,IAC3EA,EAAM,QACP;AACJ,eAAO,gBAAAH,EAACI,KAAgB,WAASP,KAAU,cAAc,SAASM,EAAM,SAAS,UAAUE,EAAA,CAAa;AAAA,MAAA;AAAA,IAC1G;AAGF,WAAO;AAAA,EAAA,GAEX;AAEJ;AC4CO,SAASC,EAAa;AAAA,EAC3B,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,sBAAsB,EAAE,sBAAAC,GAAsB,GAAGC,EAAA,IAAyB,CAAA;AAAA,EAC1E,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC;AAAA,EACA,aAAAC;AACF,GAAgC;AAC9B,QAAMrB,IAAOC,E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E,SAASF,EAAM,KAAK,IAC3EA,EAAM,QACP;AACJ,aAAO,gBAAAH,EAACI,KAAgB,WAASP,KAAU,eAAe,SAASM,EAAM,SAAS,UAAUE,EAAA,CAAa;AAAA,IAAA;AAAA,EAC3G;AAGF,SAAO;AACT;"}
|
|
1
|
+
{"version":3,"file":"FieldError.CCQnjdMd.js","sources":["../../src/components/molecules/form-error/FormError.tsx","../../src/components/molecules/form-modal/FormModal.tsx","../../src/contexts/TanstackFormContext.ts","../../src/components/molecules/field-error/FieldError.tsx"],"sourcesContent":["import { useAoaFormContext } from '../../../contexts/TanstackFormContext';\nimport { AoaNotification, type Severity } from '../../atoms/notification/Notification';\n\nexport interface AoaFormErrorProps {\n readonly 'data-qa'?: string;\n}\n\n/**\n * Constructs a custom error message for a form **using pre-defined Rijks styling**\n *\n * This component is intended for internal use only and should always be used through `<form.AoaFormError />`\n *\n * @internal\n * @param param0 - Props to pass to the form error\n * @returns A custom error message for a form\n * @example\n * ```jsx\n * <form.AppForm>\n * <form.AoaFormError />\n * </form.AppForm>\n * ```\n */\nexport function AoaFormError({ 'data-qa': dataQa }: AoaFormErrorProps) {\n const form = useAoaFormContext();\n\n return (\n <form.Subscribe selector={(state) => state.errors}>\n {(errors) => {\n if (errors.length) {\n const error = errors.at(0);\n\n if (typeof error === 'string') {\n return <AoaNotification data-qa={dataQa ?? 'form-error'} message={error} severity='error' />;\n } else if (error && typeof error === 'object') {\n const parsedLevel = ['error', 'info', 'success', 'warning'].includes(error.level)\n ? (error.level as Severity)\n : 'error';\n return <AoaNotification data-qa={dataQa ?? 'form-error'} message={error.message} severity={parsedLevel} />;\n }\n }\n\n return null;\n }}\n </form.Subscribe>\n );\n}\n","import { Dialog, DialogActions, DialogContent, DialogTitle } from '@mui/material';\nimport { merge } from 'lodash';\nimport { useAoaFormContext } from '../../../contexts/TanstackFormContext';\nimport { AoaButton, type AoaButtonProps } from '../../atoms/button/Button';\nimport type { AoaModalProps } from '../modal/Modal';\nimport { AoaModalCloseButton, type AoaModalCloseButtonProps } from '../modal-close-button/ModalCloseButton';\n\nexport interface AoaFormModalQAs {\n /**\n * Data-qa tag applied to the \"cancel\" button\n */\n cancelButton?: string;\n /**\n * Data-qa tag applied to the `DialogActions` component\n */\n dialogActions?: string;\n /**\n * Data-qa tag applied to the HTML `form` element\n */\n form?: string;\n /**\n * Data-qa tag applied to the \"submit\" button\n */\n submitButton?: string;\n}\n\nexport interface AoaFormModalLabels {\n cancel: string;\n submit: string;\n}\n\nexport interface AoaFormModalProps extends Omit<AoaModalProps, 'dialogActions'>, AoaModalCloseButtonProps {\n /**\n * Additional properties to provide to the {@link AoaButton | submit button}\n */\n AoaSubmitButtonProps?: Omit<AoaButtonProps, 'buttonType' | 'data-qa' | 'disabled' | 'onClick' | 'type'> & {\n disableWithFormState?: boolean;\n };\n /**\n * Labels for the buttons in {@link DialogActions}\n */\n formLabels: AoaFormModalLabels;\n /**\n * data-qa tags for the components in the form section of the modal\n */\n formModalQas?: AoaFormModalQAs;\n /**\n * Optionally the `name` property for the HTML form element\n */\n formName?: string;\n}\n\n/**\n * Constructs a modal **for holding a Form** using pre-defined Rijks styling\n *\n * For a modal without a form see `AoaModal`\n *\n * This component is intended for internal use only and should always be used through `<form.AoaFormModal />`\n *\n * @internal\n * @param props - Props to pass to the modal - {@link ModalProps}\n * @example\n * ```jsx\n * <form.AppForm>\n * <form.AoaFormModal\n * open={true}\n * formLabels={{\n * submit: 'submit',\n * cancel: 'cancel'\n * }}\n * formModalQas={{\n * cancelButton: 'cancel-button',\n * dialogActions: 'dialog-actions,\n * form: 'form',\n * submitButton: 'confirm-button'\n * }}\n * closeAction={handleClose}\n * topic='topic'\n * modalQas={{\n * modal: 'modal',\n * content: 'modal-content',\n * title: 'modal-title'\n * }}\n * formName='form'\n * dialogContent={content}\n * />\n * </form.AppForm>\n * ```\n */\nexport function AoaFormModal({\n formModalQas,\n formLabels,\n formName,\n DialogProps,\n DialogTitleProps,\n DialogContentProps,\n AoaSubmitButtonProps: { disableWithFormState, ...AoaSubmitButtonProps } = {},\n modalQas,\n open,\n topic,\n dialogContent,\n closeAction\n}: Readonly<AoaFormModalProps>) {\n const form = useAoaFormContext();\n\n const SubmitButton = disableWithFormState ? (\n <form.Subscribe selector={(state) => [state.isSubmitting, state.canSubmit] as const}>\n {([isSubmitting, canSubmit]) => (\n <AoaButton\n {...AoaSubmitButtonProps}\n aria-disabled={isSubmitting || !canSubmit}\n buttonType='submit'\n data-qa={formModalQas?.submitButton ?? 'submit-form'}\n disabled={isSubmitting || !canSubmit}\n type='primary'\n >\n {formLabels.submit}\n </AoaButton>\n )}\n </form.Subscribe>\n ) : (\n <AoaButton\n {...AoaSubmitButtonProps}\n buttonType='submit'\n data-qa={formModalQas?.submitButton ?? 'submit-form'}\n type='primary'\n >\n {formLabels.submit}\n </AoaButton>\n );\n\n return (\n <Dialog {...DialogProps} data-qa={modalQas?.modal ?? 'modal'} open={Boolean(open)}>\n <DialogTitle {...DialogTitleProps} data-qa={modalQas?.title ?? 'modal-title'} maxWidth='sm' sx={{ m: 0, p: 2 }}>\n {topic}\n </DialogTitle>\n <AoaModalCloseButton closeAction={closeAction} />\n <form\n data-qa={formModalQas?.form ?? 'form'}\n name={formName}\n onSubmit={async (event) => {\n event.preventDefault();\n event.stopPropagation();\n await form.handleSubmit();\n }}\n >\n <DialogContent\n {...DialogContentProps}\n data-qa={modalQas?.content ?? 'modal-content'}\n sx={merge(\n {\n padding: '0 3rem 2rem'\n },\n DialogContentProps?.sx\n )}\n >\n {dialogContent}\n </DialogContent>\n <DialogActions data-qa={formModalQas?.dialogActions ?? 'dialog-actions'}>\n <AoaButton\n data-qa={formModalQas?.cancelButton ?? 'cancel-form'}\n onClick={() => {\n form.reset();\n closeAction();\n }}\n type='secondary'\n >\n {formLabels.cancel}\n </AoaButton>\n {SubmitButton}\n </DialogActions>\n </form>\n </Dialog>\n );\n}\n","import { createFormHook, createFormHookContexts } from '@tanstack/react-form';\nimport { AoaFieldError } from '../components/molecules/field-error/FieldError';\nimport { AoaFormError } from '../components/molecules/form-error/FormError';\nimport { AoaFormModal } from '../components/molecules/form-modal/FormModal';\n\nexport const {\n fieldContext: aoaFieldContext,\n formContext: aoaFormContext,\n useFieldContext: useAoaFieldContext,\n useFormContext: useAoaFormContext\n} = createFormHookContexts();\n\nexport const { useAppForm: useAoaAppForm, withForm: withAoaForm } = createFormHook({\n fieldContext: aoaFieldContext,\n formContext: aoaFormContext,\n fieldComponents: {\n AoaFieldError\n },\n formComponents: {\n AoaFormModal,\n AoaFormError\n }\n});\n","import { useAoaFieldContext } from '../../../contexts/TanstackFormContext';\nimport { AoaNotification, type Severity } from '../../atoms/notification/Notification';\n\nexport interface AoaFieldErrorProps {\n readonly 'data-qa'?: string;\n}\n\n/**\n * Constructs a custom error message for a field **using pre-defined Rijks styling**\n *\n * This component is intended for internal use only and should always be used through `<field.AoaFieldError />`\n *\n * @internal\n * @param param0 - Props to pass to the field error\n * @returns A custom error message for a field\n * @example\n * ```jsx\n * <form.AppField name='name'>\n * {(field) => {\n * return <field.AoaFieldError />;\n * }}\n * </form.AppField>\n * ```\n */\nexport function AoaFieldError<TData>({ 'data-qa': dataQa }: AoaFieldErrorProps) {\n const field = useAoaFieldContext<TData>();\n\n if (field.state.meta.isTouched && field.state.meta.errors.length) {\n const error = field.state.meta.errors.at(0);\n\n if (typeof error === 'string') {\n return <AoaNotification data-qa={dataQa ?? 'field-error'} message={error} severity='error' />;\n } else if (error && typeof error === 'object') {\n const parsedLevel = ['error', 'info', 'success', 'warning'].includes(error.level)\n ? (error.level as Severity)\n : 'error';\n return <AoaNotification data-qa={dataQa ?? 'field-error'} message={error.message} severity={parsedLevel} />;\n }\n }\n\n return null;\n}\n"],"names":["AoaFormError","t0","$","_c","dataQa","form","useAoaFormContext","t1","errors","length","error","at","jsx","AoaNotification","parsedLevel","includes","level","message","t2","Subscribe","_temp","state","AoaFormModal","formModalQas","formLabels","formName","DialogProps","DialogTitleProps","DialogContentProps","AoaSubmitButtonProps","modalQas","open","topic","dialogContent","closeAction","undefined","disableWithFormState","t3","submit","submitButton","t4","isSubmitting","canSubmit","AoaButton","SubmitButton","modal","t5","Boolean","t6","title","t7","Symbol","for","m","p","t8","DialogTitle","t9","AoaModalCloseButton","t10","t11","event","preventDefault","stopPropagation","handleSubmit","t12","content","t13","sx","merge","padding","t14","DialogContent","t15","dialogActions","t16","cancelButton","t17","reset","t18","cancel","t19","DialogActions","t20","t21","Dialog","fieldContext","aoaFieldContext","formContext","aoaFormContext","useFieldContext","useAoaFieldContext","useFormContext","createFormHookContexts","useAppForm","useAoaAppForm","withForm","withAoaForm","createFormHook","fieldComponents","AoaFieldError","formComponents","field","meta","isTouched"],"mappings":";;;;;;;;AAsBO,SAAAA,GAAAC,GAAA;AAAA,QAAAC,IAAAC,EAAAA,EAAA,CAAA,GAAsB;AAAA,IAAA,WAAAC;AAAAA,EAAAA,IAAAH,GAC3BI,IAAaC,EAAAA;AAAoB,MAAAC;AAAA,EAAAL,SAAAE,KAI5BG,IAAAC,CAAAA,MAAA;AAAA,QACKA,EAAMC,QAAA;AACR,YAAAC,IAAcF,EAAMG,IAAK;AAAE,UAEvB,OAAOD,KAAU;AAAQ,eACpB,gBAAAE,EAACC,KAAyB,WAAAT,KAAU,cAAuBM,SAAAA,GAAgB,UAAA,SAAO;AAAG,UACnFA,KAAS,OAAOA,KAAU,UAAQ;AAC3C,cAAAI,IAAoB,CAAC,SAAS,QAAQ,WAAW,SAAS,EAAAC,SAAWL,EAAKM,KAAM,IAC3EN,EAAKM,QACN;AAAQ,eACL,gBAAAJ,EAACC,KAAyB,WAAAT,KAAU,cAAuB,SAAAM,EAAKO,SAAoBH,UAAAA,EAAAA,CAAW;AAAA,MAAA;AAAA,IAAI;AAAA,WAAA;AAAA,EAAA,GAK/GZ,OAAAE,GAAAF,OAAAK,KAAAA,IAAAL,EAAA,CAAA;AAAA,MAAAgB;AAAA,SAAAhB,SAAAG,EAAAc,aAAAjB,SAAAK,KAhBHW,sBA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AAAQ,KAAAR,SAAAgB,KAAjDmB,sBAACxB,GAAA,EAAyB,WAAAK,GAAkCR,SAAAA,GAAgB,UAAA,SAAO,GAAGR,OAAAQ,GAAAR,OAAAgB,GAAAhB,OAAAmC,KAAAA,IAAAnC,EAAA,CAAA,GAAtFmC;AAAAA,IAAAA,WACE3B,KAAS,OAAOA,KAAU,UAAQ;AAAA,UAAAQ;AAAA,MAAAhB,EAAA,CAAA,MAAAQ,EAAAM,SACvBE,IAAA,CAAC,SAAS,QAAQ,WAAW,SAAS,EAAAH,SAAWL,EAAKM,KAAM,IAC3EN,EAAKM,QACN,SAAOd,EAAA,CAAA,IAAAQ,EAAAM,OAAAd,OAAAgB,KAAAA,IAAAhB,EAAA,CAAA;AAFX,YAAAY,IAAoBI,GAGamB,IAAAjC,KAAU;AAAa,UAAAoC;AAAA,aAAAtC,EAAA,CAAA,MAAAQ,EAAAO,WAAAf,EAAA,CAAA,MAAAY,KAAAZ,EAAA,CAAA,MAAAmC,KAAjDG,IAAA,gBAAA5B,EAACC,KAAyB,WAAAwB,GAAkC,SAAA3B,EAAKO,SAAoBH,UAAAA,EAAAA,CAAW,GAAIZ,EAAA,CAAA,IAAAQ,EAAAO,SAAAf,OAAAY,GAAAZ,OAAAmC,GAAAnC,QAAAsC,KAAAA,IAAAtC,EAAA,EAAA,GAApGsC;AAAAA,IAAAA;AAAAA,EAAoG;AAAA,SAAA;AAAA;"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import p from "react";
|
|
2
|
+
var e = { exports: {} }, t = {};
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react-compiler-runtime.production.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var a;
|
|
13
|
+
function s() {
|
|
14
|
+
if (a) return t;
|
|
15
|
+
a = 1;
|
|
16
|
+
var o = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
17
|
+
return t.c = function(r) {
|
|
18
|
+
return o.H.useMemoCache(r);
|
|
19
|
+
}, t;
|
|
20
|
+
}
|
|
21
|
+
var n = {};
|
|
22
|
+
/**
|
|
23
|
+
* @license React
|
|
24
|
+
* react-compiler-runtime.development.js
|
|
25
|
+
*
|
|
26
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
27
|
+
*
|
|
28
|
+
* This source code is licensed under the MIT license found in the
|
|
29
|
+
* LICENSE file in the root directory of this source tree.
|
|
30
|
+
*/
|
|
31
|
+
var u;
|
|
32
|
+
function m() {
|
|
33
|
+
return u || (u = 1, process.env.NODE_ENV !== "production" && function() {
|
|
34
|
+
var o = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
35
|
+
n.c = function(r) {
|
|
36
|
+
var i = o.H;
|
|
37
|
+
return i === null && console.error(
|
|
38
|
+
`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
39
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
40
|
+
2. You might be breaking the Rules of Hooks
|
|
41
|
+
3. You might have more than one copy of React in the same app
|
|
42
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
|
|
43
|
+
), i.useMemoCache(r);
|
|
44
|
+
};
|
|
45
|
+
}()), n;
|
|
46
|
+
}
|
|
47
|
+
var c;
|
|
48
|
+
function l() {
|
|
49
|
+
return c || (c = 1, process.env.NODE_ENV === "production" ? e.exports = s() : e.exports = m()), e.exports;
|
|
50
|
+
}
|
|
51
|
+
var _ = l();
|
|
52
|
+
export {
|
|
53
|
+
_ as c
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=compiler-runtime.hDcrsMwn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiler-runtime.hDcrsMwn.js","sources":["../../../../node_modules/react/cjs/react-compiler-runtime.production.js","../../../../node_modules/react/cjs/react-compiler-runtime.development.js","../../../../node_modules/react/compiler-runtime.js"],"sourcesContent":["/**\n * @license React\n * react-compiler-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar ReactSharedInternals =\n require(\"react\").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\nexports.c = function (size) {\n return ReactSharedInternals.H.useMemoCache(size);\n};\n","/**\n * @license React\n * react-compiler-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n var ReactSharedInternals =\n require(\"react\").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\n exports.c = function (size) {\n var dispatcher = ReactSharedInternals.H;\n null === dispatcher &&\n console.error(\n \"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\\n1. You might have mismatching versions of React and the renderer (such as React DOM)\\n2. You might be breaking the Rules of Hooks\\n3. You might have more than one copy of React in the same app\\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.\"\n );\n return dispatcher.useMemoCache(size);\n };\n })();\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-compiler-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-compiler-runtime.development.js');\n}\n"],"names":["ReactSharedInternals","require$$0","reactCompilerRuntime_production","size","reactCompilerRuntime_development","dispatcher","compilerRuntimeModule","require$$1"],"mappings":";;;;;;;;;;;;;;;AAWA,MAAIA,IACFC,EAAiB;AACnB,SAAAC,EAAA,IAAY,SAAUC,GAAM;AAC1B,WAAOH,EAAqB,EAAE,aAAaG,CAAI;AAAA;;;;;;;;;;;;;;sBCHhC,QAAQ,IAAI,aAA7B,gBACG,WAAY;AACX,QAAIH,IACFC,EAAiB;AACnB,IAAAG,EAAA,IAAY,SAAUD,GAAM;AAC1B,UAAIE,IAAaL,EAAqB;AACtC,aAASK,MAAT,QACE,QAAQ;AAAA,QACN;AAAA;AAAA;AAAA;AAAA;AAAA,SAEGA,EAAW,aAAaF,CAAI;AAAA;EAEzC,EAAG;;;;sBCdC,QAAQ,IAAI,aAAa,eAC3BG,EAAA,UAAiBL,EAAA,IAEjBK,EAAA,UAAiBC,EAAA;;;","x_google_ignoreList":[0,1,2]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dispatch,
|
|
1
|
+
import { Dispatch, JSX, SetStateAction } from 'react';
|
|
2
2
|
interface SubMenu {
|
|
3
3
|
/**
|
|
4
4
|
* Optional divider to be shown below menu item
|
|
@@ -91,6 +91,6 @@ interface MenuItemProps {
|
|
|
91
91
|
* />
|
|
92
92
|
* ```
|
|
93
93
|
*/
|
|
94
|
-
export declare
|
|
94
|
+
export declare function AoaMenuItem(props: MenuItemProps): import("react/jsx-runtime").JSX.Element;
|
|
95
95
|
export {};
|
|
96
96
|
//# sourceMappingURL=MenuItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/_menu/menu-item/MenuItem.tsx"],"names":[],"mappings":"AAWA,OAAO,
|
|
1
|
+
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/_menu/menu-item/MenuItem.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAY,KAAK,QAAQ,EAAE,KAAK,GAAG,EA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{ useState as d, createElement as k } from "react";
|
|
3
|
+
import { Home as y, KeyboardArrowDown as C } from "@mui/icons-material";
|
|
4
|
+
import { MenuItem as g, Link as P, menuItemClasses as s, Typography as j, svgIconClasses as m, Popper as w } from "@mui/material";
|
|
5
5
|
import { Link as c } from "@tanstack/react-router";
|
|
6
|
-
import { l as
|
|
7
|
-
import { FontNormalSxProps as
|
|
8
|
-
|
|
6
|
+
import { l as u } from "../../../../chunks/lodash.CA_K01A9.js";
|
|
7
|
+
import { FontNormalSxProps as x } from "../../../../_constants.js";
|
|
8
|
+
function R(e) {
|
|
9
9
|
const [b, a] = d(null), [t, n] = d(!1);
|
|
10
10
|
function h(o) {
|
|
11
11
|
n(!0), a(o.currentTarget);
|
|
@@ -14,137 +14,82 @@ const A = k((e) => {
|
|
|
14
14
|
n(!1), a(null);
|
|
15
15
|
}
|
|
16
16
|
function p() {
|
|
17
|
-
return e.page.externalPath ? {
|
|
17
|
+
return e.page.externalPath ? {
|
|
18
|
+
href: e.page.to
|
|
19
|
+
} : {
|
|
20
|
+
to: e.page.to
|
|
21
|
+
};
|
|
18
22
|
}
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
key: e.index,
|
|
29
|
-
onClick: () => e.setSelectedPage(e.index),
|
|
30
|
-
onMouseEnter: (o) => h(o),
|
|
31
|
-
onMouseLeave: () => l(),
|
|
32
|
-
role: "menuitem",
|
|
33
|
-
selected: e.selectedPage === e.index,
|
|
34
|
-
sx: {
|
|
35
|
-
height: "100%",
|
|
36
|
-
borderBottom: "3px solid transparent",
|
|
37
|
-
padding: "6px 20px 3px",
|
|
38
|
-
":hover": {
|
|
39
|
-
backgroundColor: "var(--color-rijks-yellow-hover)",
|
|
40
|
-
...e.page.to && {
|
|
41
|
-
textDecoration: "underline"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
[`&.${m.selected}`]: {
|
|
45
|
-
backgroundColor: "var(--color-rijks-yellow-light)",
|
|
46
|
-
borderBottomColor: "var(--color-rijks-skyblue)",
|
|
47
|
-
":hover": {
|
|
48
|
-
backgroundColor: "var(--color-rijks-yellow-hover)"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
title: e.page.label
|
|
23
|
+
return /* @__PURE__ */ k(g, { ...p(), "aria-controls": e.page.subItems?.length && t ? "submenu" : void 0, "aria-expanded": e.page.subItems?.length && t ? "true" : void 0, "aria-haspopup": e.page.subItems?.length ? "true" : "false", "aria-label": e.page.label, component: e.page.to && !e.page.externalPath ? c : P, key: e.index, onClick: () => e.setSelectedPage(e.index), onMouseEnter: (o) => h(o), onMouseLeave: () => l(), role: "menuitem", selected: e.selectedPage === e.index, sx: {
|
|
24
|
+
height: "100%",
|
|
25
|
+
borderBottom: "3px solid transparent",
|
|
26
|
+
padding: "6px 20px 3px",
|
|
27
|
+
":hover": {
|
|
28
|
+
backgroundColor: "var(--color-rijks-yellow-hover)",
|
|
29
|
+
...e.page.to && {
|
|
30
|
+
textDecoration: "underline"
|
|
31
|
+
}
|
|
53
32
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
sx: x.merge(
|
|
60
|
-
{
|
|
61
|
-
display: "flex",
|
|
62
|
-
alignItems: "center",
|
|
63
|
-
[`&.${s.root}`]: {
|
|
64
|
-
marginRight: "5px"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
u
|
|
68
|
-
),
|
|
69
|
-
variant: "body1",
|
|
70
|
-
children: [
|
|
71
|
-
e.index === 0 && /* @__PURE__ */ r(C, {}),
|
|
72
|
-
e.page.label,
|
|
73
|
-
e.page.subItems?.length ? /* @__PURE__ */ r(P, {}) : null
|
|
74
|
-
]
|
|
33
|
+
[`&.${s.selected}`]: {
|
|
34
|
+
backgroundColor: "var(--color-rijks-yellow-light)",
|
|
35
|
+
borderBottomColor: "var(--color-rijks-skyblue)",
|
|
36
|
+
":hover": {
|
|
37
|
+
backgroundColor: "var(--color-rijks-yellow-hover)"
|
|
75
38
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
39
|
+
}
|
|
40
|
+
}, title: e.page.label }, /* @__PURE__ */ i(j, { "aria-hidden": !0, component: "span", sx: u.merge({
|
|
41
|
+
display: "flex",
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
[`&.${m.root}`]: {
|
|
44
|
+
marginRight: "5px"
|
|
45
|
+
}
|
|
46
|
+
}, x), variant: "body1", children: [
|
|
47
|
+
e.index === 0 && /* @__PURE__ */ r(y, {}),
|
|
48
|
+
e.page.label,
|
|
49
|
+
e.page.subItems?.length ? /* @__PURE__ */ r(C, {}) : null
|
|
50
|
+
] }), e.page.subItems && /* @__PURE__ */ r(w, { anchorEl: b, id: "submenu", open: t, placement: "bottom-start", role: "menu", sx: {
|
|
51
|
+
backgroundColor: "var(--color-bg-light)",
|
|
52
|
+
padding: "4px 0",
|
|
53
|
+
borderRadius: "6px",
|
|
54
|
+
marginTop: "8px",
|
|
55
|
+
minWidth: "180px",
|
|
56
|
+
color: "var(--color-text)",
|
|
57
|
+
boxShadow: `
|
|
93
58
|
rgb(255 255 255) 0 0 0 0,
|
|
94
59
|
rgb(0 0 0 / 5%) 0 0 0 1px,
|
|
95
60
|
rgb(0 0 0 / 10%) 0 10px 15px -3px,
|
|
96
61
|
rgb(0 0 0 / 5%) 0 4px 6px -2px
|
|
97
62
|
`
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
borderBottom: "transparent",
|
|
116
|
-
position: "relative",
|
|
117
|
-
marginBottom: "16px",
|
|
118
|
-
"::after": {
|
|
119
|
-
content: '""',
|
|
120
|
-
position: "absolute",
|
|
121
|
-
bottom: "-8px",
|
|
122
|
-
left: "0",
|
|
123
|
-
width: "100%",
|
|
124
|
-
borderBottom: "1px solid rgba(0, 0, 0, 0.12)"
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
[`&.${s.root}`]: {
|
|
128
|
-
fontSize: "var(--font-size-text)",
|
|
129
|
-
color: "var(--color-rijks-grey-7)",
|
|
130
|
-
marginRight: "12px"
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
u
|
|
134
|
-
),
|
|
135
|
-
to: o.to,
|
|
136
|
-
children: [
|
|
137
|
-
o.icon,
|
|
138
|
-
o.label
|
|
139
|
-
]
|
|
140
|
-
},
|
|
141
|
-
v
|
|
142
|
-
))
|
|
63
|
+
}, children: e.page.subItems?.map((o, v) => /* @__PURE__ */ i(g, { "aria-label": o.label, component: c, disableRipple: !0, divider: o.divider ?? !1, onClick: (f) => {
|
|
64
|
+
f.stopPropagation(), e.setSelectedPage(e.index), l();
|
|
65
|
+
}, sx: u.merge({
|
|
66
|
+
":active": {
|
|
67
|
+
backgroundColor: "var(--color-bg-light)"
|
|
68
|
+
},
|
|
69
|
+
[`&.${s.divider}`]: {
|
|
70
|
+
borderBottom: "transparent",
|
|
71
|
+
position: "relative",
|
|
72
|
+
marginBottom: "16px",
|
|
73
|
+
"::after": {
|
|
74
|
+
content: '""',
|
|
75
|
+
position: "absolute",
|
|
76
|
+
bottom: "-8px",
|
|
77
|
+
left: "0",
|
|
78
|
+
width: "100%",
|
|
79
|
+
borderBottom: "1px solid rgba(0, 0, 0, 0.12)"
|
|
143
80
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
81
|
+
},
|
|
82
|
+
[`&.${m.root}`]: {
|
|
83
|
+
fontSize: "var(--font-size-text)",
|
|
84
|
+
color: "var(--color-rijks-grey-7)",
|
|
85
|
+
marginRight: "12px"
|
|
86
|
+
}
|
|
87
|
+
}, x), to: o.to, children: [
|
|
88
|
+
o.icon,
|
|
89
|
+
o.label
|
|
90
|
+
] }, v)) }));
|
|
91
|
+
}
|
|
147
92
|
export {
|
|
148
|
-
|
|
93
|
+
R as AoaMenuItem
|
|
149
94
|
};
|
|
150
95
|
//# sourceMappingURL=MenuItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.js","sources":["../../../../../src/components/atoms/_menu/menu-item/MenuItem.tsx"],"sourcesContent":["import { Home as HomeIcon, KeyboardArrowDown as KeyboardArrowDownIcon } from '@mui/icons-material';\nimport {\n Link as MUILink,\n MenuItem as MUIMenuItem,\n menuItemClasses,\n svgIconClasses,\n Popper,\n Typography\n} from '@mui/material';\nimport { Link } from '@tanstack/react-router';\nimport { merge } from 'lodash';\nimport { memo, useState, type Dispatch, type MouseEvent, type ReactNode, type SetStateAction } from 'react';\nimport { FontNormalSxProps } from '../../../../_constants';\n\ninterface SubMenu {\n /**\n * Optional divider to be shown below menu item\n */\n divider?: boolean;\n /**\n * Optional icon to be displayed in front of the label\n */\n icon?: JSX.Element;\n /**\n * The label of the menu item\n */\n label: string;\n /**\n * The path that the menu item links to on click\n */\n to: string;\n}\n\ntype Menu =\n /**\n * The path that the menu item links to on click and the subitems shown on hover\n */\n | { subItems: SubMenu[]; to: string }\n /**\n * Subitems are required when there is no path that the menu item links to on click\n */\n | { subItems: SubMenu[]; to?: never }\n /**\n * The path that the menu item links to on click is required when there are no subitems on hover\n */\n | { subItems?: never; to: string };\n\nexport type AoaPage = Menu & {\n /**\n * Optional boolean to indicate if it's an external \"to\" path\n */\n externalPath?: boolean;\n /**\n * The label of the menu item\n */\n label: string;\n};\n\ninterface MenuItemProps {\n /**\n * Index of the current menu item. Home === 0\n */\n readonly index: number;\n /**\n * The Page object for this menu item\n */\n readonly page: AoaPage;\n /**\n * The currently active menu item\n */\n readonly selectedPage: number;\n /**\n * The function to update the active menu item\n */\n readonly setSelectedPage: Dispatch<SetStateAction<number>>;\n}\n\n/**\n * Constructs a menu item using pre-defined Rijks styling\n *\n * @param props - Props to pass to the menu item\n * @example\n * ```jsx\n * <AoaMenuItem\n * index={index}\n * page={{\n * label: \"Products\",\n * to: \"/products\",\n * subItems: [\n * {\n * label: \"Books\",\n * to: \"/books\",\n * icon: <BookIcon />,\n * }\n * ]\n * }}\n * selectedPage={selectedPage}\n * setSelectedPage={setSelectedPage}\n * />\n * ```\n */\nexport const AoaMenuItem = memo((props: MenuItemProps): ReactNode => {\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);\n const [open, setOpen] = useState(false);\n\n function handleMenuOpen(event: MouseEvent<HTMLAnchorElement, globalThis.MouseEvent>) {\n setOpen(true);\n setAnchorEl(event.currentTarget);\n }\n\n function handleMenuClose() {\n setOpen(false);\n setAnchorEl(null);\n }\n\n function linkProps() {\n if (props.page.externalPath) {\n return { href: props.page.to };\n } else {\n return { to: props.page.to };\n }\n }\n\n return (\n <MUIMenuItem\n {...linkProps()}\n aria-controls={props.page.subItems?.length && open ? 'submenu' : undefined}\n aria-expanded={props.page.subItems?.length && open ? 'true' : undefined}\n aria-haspopup={props.page.subItems?.length ? 'true' : 'false'}\n aria-label={props.page.label}\n component={props.page.to && !props.page.externalPath ? Link : MUILink}\n key={props.index}\n onClick={() => props.setSelectedPage(props.index)}\n onMouseEnter={(event: MouseEvent<HTMLAnchorElement, globalThis.MouseEvent>) => handleMenuOpen(event)}\n onMouseLeave={() => handleMenuClose()}\n role='menuitem'\n selected={props.selectedPage === props.index}\n sx={{\n height: '100%',\n borderBottom: '3px solid transparent',\n padding: '6px 20px 3px',\n\n ':hover': {\n backgroundColor: 'var(--color-rijks-yellow-hover)',\n ...(props.page.to && {\n textDecoration: 'underline'\n })\n },\n\n [`&.${menuItemClasses.selected}`]: {\n backgroundColor: 'var(--color-rijks-yellow-light)',\n borderBottomColor: 'var(--color-rijks-skyblue)',\n ':hover': {\n backgroundColor: 'var(--color-rijks-yellow-hover)'\n }\n }\n }}\n title={props.page.label}\n >\n <Typography\n aria-hidden\n component='span'\n sx={merge(\n {\n display: 'flex',\n alignItems: 'center',\n\n [`&.${svgIconClasses.root}`]: {\n marginRight: '5px'\n }\n },\n FontNormalSxProps\n )}\n variant='body1'\n >\n {props.index === 0 && <HomeIcon />}\n {props.page.label}\n {props.page.subItems?.length ? <KeyboardArrowDownIcon /> : null}\n </Typography>\n {props.page.subItems && (\n <Popper\n anchorEl={anchorEl}\n id='submenu'\n open={open}\n placement='bottom-start'\n role='menu'\n sx={{\n backgroundColor: 'var(--color-bg-light)',\n padding: '4px 0',\n borderRadius: '6px',\n marginTop: '8px',\n minWidth: '180px',\n color: 'var(--color-text)',\n boxShadow: `\n rgb(255 255 255) 0 0 0 0,\n rgb(0 0 0 / 5%) 0 0 0 1px,\n rgb(0 0 0 / 10%) 0 10px 15px -3px,\n rgb(0 0 0 / 5%) 0 4px 6px -2px\n `\n }}\n >\n {props.page.subItems?.map((subItem, index) => (\n <MUIMenuItem\n aria-label={subItem.label}\n component={Link}\n disableRipple\n divider={subItem.divider ?? false}\n key={index}\n onClick={(event) => {\n event.stopPropagation();\n props.setSelectedPage(props.index);\n handleMenuClose();\n }}\n sx={merge(\n {\n ':active': {\n backgroundColor: 'var(--color-bg-light)'\n },\n\n [`&.${menuItemClasses.divider}`]: {\n borderBottom: 'transparent',\n position: 'relative',\n marginBottom: '16px',\n\n '::after': {\n content: '\"\"',\n position: 'absolute',\n bottom: '-8px',\n left: '0',\n width: '100%',\n borderBottom: '1px solid rgba(0, 0, 0, 0.12)'\n }\n },\n\n [`&.${svgIconClasses.root}`]: {\n fontSize: 'var(--font-size-text)',\n color: 'var(--color-rijks-grey-7)',\n marginRight: '12px'\n }\n },\n FontNormalSxProps\n )}\n to={subItem.to}\n >\n {subItem.icon}\n {subItem.label}\n </MUIMenuItem>\n ))}\n </Popper>\n )}\n </MUIMenuItem>\n );\n});\n"],"names":["AoaMenuItem","memo","props","anchorEl","setAnchorEl","useState","open","setOpen","handleMenuOpen","event","handleMenuClose","linkProps","createElement","MUIMenuItem","Link","MUILink","menuItemClasses","jsxs","Typography","merge","svgIconClasses","FontNormalSxProps","jsx","HomeIcon","KeyboardArrowDownIcon","Popper","subItem","index"],"mappings":";;;;;;;AAqGO,MAAMA,IAAcC,EAAK,CAACC,MAAoC;AACnE,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAA6B,IAAI,GAC3D,CAACC,GAAMC,CAAO,IAAIF,EAAS,EAAK;AAEtC,WAASG,EAAeC,GAA6D;AACnF,IAAAF,EAAQ,EAAI,GACZH,EAAYK,EAAM,aAAa;AAAA,EAAA;AAGjC,WAASC,IAAkB;AACzB,IAAAH,EAAQ,EAAK,GACbH,EAAY,IAAI;AAAA,EAAA;AAGlB,WAASO,IAAY;AACnB,WAAIT,EAAM,KAAK,eACN,EAAE,MAAMA,EAAM,KAAK,GAAA,IAEnB,EAAE,IAAIA,EAAM,KAAK,GAAA;AAAA,EAC1B;AAGF,SACE,gBAAAU;AAAA,IAACC;AAAAA,IAAA;AAAA,MACE,GAAGF,EAAA;AAAA,MACJ,iBAAeT,EAAM,KAAK,UAAU,UAAUI,IAAO,YAAY;AAAA,MACjE,iBAAeJ,EAAM,KAAK,UAAU,UAAUI,IAAO,SAAS;AAAA,MAC9D,iBAAeJ,EAAM,KAAK,UAAU,SAAS,SAAS;AAAA,MACtD,cAAYA,EAAM,KAAK;AAAA,MACvB,WAAWA,EAAM,KAAK,MAAM,CAACA,EAAM,KAAK,eAAeY,IAAOC;AAAAA,MAC9D,KAAKb,EAAM;AAAA,MACX,SAAS,MAAMA,EAAM,gBAAgBA,EAAM,KAAK;AAAA,MAChD,cAAc,CAACO,MAAgED,E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WAAW;AAAA,UACX,UAAU;AAAA,UACV,OAAO;AAAA,UACP,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAAA;AAAA,QAQZ,YAAM,KAAK,UAAU,IAAI,CAACoB,GAASC,MAClC,gBAAAV;AAAA,UAACJ;AAAAA,UAAA;AAAA,YACC,cAAYa,EAAQ;AAAA,YACpB,WAAWZ;AAAA,YACX,eAAa;AAAA,YACb,SAASY,EAAQ,WAAW;AAAA,YAE5B,SAAS,CAACjB,MAAU;AAClB,cAAAA,EAAM,gBAAA,GACNP,EAAM,gBAAgBA,EAAM,KAAK,GACjCQ,EAAA;AAAA,YAAgB;AAAA,YAElB,IAAIS,EAAAA;AAAAA,cACF;AAAA,gBACE,WAAW;AAAA,kBACT,iBAAiB;AAAA,gBAAA;AAAA,gBAGnB,CAAC,KAAKH,EAAgB,OAAO,EAAE,GAAG;AAAA,kBAChC,cAAc;AAAA,kBACd,UAAU;AAAA,kBACV,cAAc;AAAA,kBAEd,WAAW;AAAA,oBACT,SAAS;AAAA,oBACT,UAAU;AAAA,oBACV,QAAQ;AAAA,oBACR,MAAM;AAAA,oBACN,OAAO;AAAA,oBACP,cAAc;AAAA,kBAAA;AAAA,gBAChB;AAAA,gBAGF,CAAC,KAAKI,EAAe,IAAI,EAAE,GAAG;AAAA,kBAC5B,UAAU;AAAA,kBACV,OAAO;AAAA,kBACP,aAAa;AAAA,gBAAA;AAAA,cACf;AAAA,cAEFC;AAAA,YAAA;AAAA,YAEF,IAAIK,EAAQ;AAAA,YAEX,UAAA;AAAA,cAAAA,EAAQ;AAAA,cACRA,EAAQ;AAAA,YAAA;AAAA,UAAA;AAAA,UAtCJC;AAAA,QAAA,CAwCR;AAAA,MAAA;AAAA,IAAA;AAAA,EACH;AAIR,CAAC;"}
|
|
1
|
+
{"version":3,"file":"MenuItem.js","sources":["../../../../../src/components/atoms/_menu/menu-item/MenuItem.tsx"],"sourcesContent":["import { Home as HomeIcon, KeyboardArrowDown as KeyboardArrowDownIcon } from '@mui/icons-material';\nimport {\n Link as MUILink,\n MenuItem as MUIMenuItem,\n menuItemClasses,\n svgIconClasses,\n Popper,\n Typography\n} from '@mui/material';\nimport { Link } from '@tanstack/react-router';\nimport { merge } from 'lodash';\nimport { useState, type Dispatch, type JSX, type MouseEvent, type SetStateAction } from 'react';\nimport { FontNormalSxProps } from '../../../../_constants';\n\ninterface SubMenu {\n /**\n * Optional divider to be shown below menu item\n */\n divider?: boolean;\n /**\n * Optional icon to be displayed in front of the label\n */\n icon?: JSX.Element;\n /**\n * The label of the menu item\n */\n label: string;\n /**\n * The path that the menu item links to on click\n */\n to: string;\n}\n\ntype Menu =\n /**\n * The path that the menu item links to on click and the subitems shown on hover\n */\n | { subItems: SubMenu[]; to: string }\n /**\n * Subitems are required when there is no path that the menu item links to on click\n */\n | { subItems: SubMenu[]; to?: never }\n /**\n * The path that the menu item links to on click is required when there are no subitems on hover\n */\n | { subItems?: never; to: string };\n\nexport type AoaPage = Menu & {\n /**\n * Optional boolean to indicate if it's an external \"to\" path\n */\n externalPath?: boolean;\n /**\n * The label of the menu item\n */\n label: string;\n};\n\ninterface MenuItemProps {\n /**\n * Index of the current menu item. Home === 0\n */\n readonly index: number;\n /**\n * The Page object for this menu item\n */\n readonly page: AoaPage;\n /**\n * The currently active menu item\n */\n readonly selectedPage: number;\n /**\n * The function to update the active menu item\n */\n readonly setSelectedPage: Dispatch<SetStateAction<number>>;\n}\n\n/**\n * Constructs a menu item using pre-defined Rijks styling\n *\n * @param props - Props to pass to the menu item\n * @example\n * ```jsx\n * <AoaMenuItem\n * index={index}\n * page={{\n * label: \"Products\",\n * to: \"/products\",\n * subItems: [\n * {\n * label: \"Books\",\n * to: \"/books\",\n * icon: <BookIcon />,\n * }\n * ]\n * }}\n * selectedPage={selectedPage}\n * setSelectedPage={setSelectedPage}\n * />\n * ```\n */\nexport function AoaMenuItem(props: MenuItemProps) {\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);\n const [open, setOpen] = useState(false);\n\n function handleMenuOpen(event: MouseEvent<HTMLAnchorElement, globalThis.MouseEvent>) {\n setOpen(true);\n setAnchorEl(event.currentTarget);\n }\n\n function handleMenuClose() {\n setOpen(false);\n setAnchorEl(null);\n }\n\n function linkProps() {\n if (props.page.externalPath) {\n return { href: props.page.to };\n } else {\n return { to: props.page.to };\n }\n }\n\n return (\n <MUIMenuItem\n {...linkProps()}\n aria-controls={props.page.subItems?.length && open ? 'submenu' : undefined}\n aria-expanded={props.page.subItems?.length && open ? 'true' : undefined}\n aria-haspopup={props.page.subItems?.length ? 'true' : 'false'}\n aria-label={props.page.label}\n component={props.page.to && !props.page.externalPath ? Link : MUILink}\n key={props.index}\n onClick={() => props.setSelectedPage(props.index)}\n onMouseEnter={(event: MouseEvent<HTMLAnchorElement, globalThis.MouseEvent>) => handleMenuOpen(event)}\n onMouseLeave={() => handleMenuClose()}\n role='menuitem'\n selected={props.selectedPage === props.index}\n sx={{\n height: '100%',\n borderBottom: '3px solid transparent',\n padding: '6px 20px 3px',\n\n ':hover': {\n backgroundColor: 'var(--color-rijks-yellow-hover)',\n ...(props.page.to && {\n textDecoration: 'underline'\n })\n },\n\n [`&.${menuItemClasses.selected}`]: {\n backgroundColor: 'var(--color-rijks-yellow-light)',\n borderBottomColor: 'var(--color-rijks-skyblue)',\n ':hover': {\n backgroundColor: 'var(--color-rijks-yellow-hover)'\n }\n }\n }}\n title={props.page.label}\n >\n <Typography\n aria-hidden\n component='span'\n sx={merge(\n {\n display: 'flex',\n alignItems: 'center',\n\n [`&.${svgIconClasses.root}`]: {\n marginRight: '5px'\n }\n },\n FontNormalSxProps\n )}\n variant='body1'\n >\n {props.index === 0 && <HomeIcon />}\n {props.page.label}\n {props.page.subItems?.length ? <KeyboardArrowDownIcon /> : null}\n </Typography>\n {props.page.subItems && (\n <Popper\n anchorEl={anchorEl}\n id='submenu'\n open={open}\n placement='bottom-start'\n role='menu'\n sx={{\n backgroundColor: 'var(--color-bg-light)',\n padding: '4px 0',\n borderRadius: '6px',\n marginTop: '8px',\n minWidth: '180px',\n color: 'var(--color-text)',\n boxShadow: `\n rgb(255 255 255) 0 0 0 0,\n rgb(0 0 0 / 5%) 0 0 0 1px,\n rgb(0 0 0 / 10%) 0 10px 15px -3px,\n rgb(0 0 0 / 5%) 0 4px 6px -2px\n `\n }}\n >\n {props.page.subItems?.map((subItem, index) => (\n <MUIMenuItem\n aria-label={subItem.label}\n component={Link}\n disableRipple\n divider={subItem.divider ?? false}\n key={index}\n onClick={(event) => {\n event.stopPropagation();\n props.setSelectedPage(props.index);\n handleMenuClose();\n }}\n sx={merge(\n {\n ':active': {\n backgroundColor: 'var(--color-bg-light)'\n },\n\n [`&.${menuItemClasses.divider}`]: {\n borderBottom: 'transparent',\n position: 'relative',\n marginBottom: '16px',\n\n '::after': {\n content: '\"\"',\n position: 'absolute',\n bottom: '-8px',\n left: '0',\n width: '100%',\n borderBottom: '1px solid rgba(0, 0, 0, 0.12)'\n }\n },\n\n [`&.${svgIconClasses.root}`]: {\n fontSize: 'var(--font-size-text)',\n color: 'var(--color-rijks-grey-7)',\n marginRight: '12px'\n }\n },\n FontNormalSxProps\n )}\n to={subItem.to}\n >\n {subItem.icon}\n {subItem.label}\n </MUIMenuItem>\n ))}\n </Popper>\n )}\n </MUIMenuItem>\n );\n}\n"],"names":["AoaMenuItem","props","anchorEl","setAnchorEl","useState","open","setOpen","handleMenuOpen","event","currentTarget","handleMenuClose","linkProps","page","externalPath","href","to","createElement","MUIMenuItem","subItems","length","undefined","label","Link","MUILink","index","setSelectedPage","selectedPage","height","borderBottom","padding","backgroundColor","textDecoration","menuItemClasses","selected","borderBottomColor","jsxs","Typography","merge","display","alignItems","svgIconClasses","root","marginRight","FontNormalSxProps","jsx","HomeIcon","KeyboardArrowDownIcon","Popper","borderRadius","marginTop","minWidth","color","boxShadow","map","subItem","divider","stopPropagation","position","marginBottom","content","bottom","left","width","fontSize","icon"],"mappings":";;;;;;;AAqGO,SAASA,EAAYC,GAAs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O,EAAE,GAAG;AAAA,MAChC3B,cAAc;AAAA,MACd6B,UAAU;AAAA,MACVC,cAAc;AAAA,MAEd,WAAW;AAAA,QACTC,SAAS;AAAA,QACTF,UAAU;AAAA,QACVG,QAAQ;AAAA,QACRC,MAAM;AAAA,QACNC,OAAO;AAAA,QACPlC,cAAc;AAAA,MAAA;AAAA,IAChB;AAAA,IAGF,CAAC,KAAKY,EAAeC,IAAI,EAAE,GAAG;AAAA,MAC5BsB,UAAU;AAAA,MACVZ,OAAO;AAAA,MACPT,aAAa;AAAA,IAAA;AAAA,EACf,GAEFC,CACF,GACA,IAAIW,EAAQvC,IAEXuC,UAAAA;AAAAA,IAAAA,EAAQU;AAAAA,IACRV,EAAQjC;AAAAA,EAAAA,KAtCJG,CAuCP,CACD,EAAA,CACH,CAEJ;AAEJ;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
1
|
type Action =
|
|
3
2
|
/**
|
|
4
3
|
* The path that the menu item links to on click
|
|
@@ -47,6 +46,6 @@ interface UserMenuProps {
|
|
|
47
46
|
* />
|
|
48
47
|
* ```
|
|
49
48
|
*/
|
|
50
|
-
export declare
|
|
49
|
+
export declare function AoaUserMenu(props: UserMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
51
50
|
export {};
|
|
52
51
|
//# sourceMappingURL=UserMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/_menu/user-menu/UserMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UserMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/_menu/user-menu/UserMenu.tsx"],"names":[],"mappings":"AAMA,KAAK,MAAM;AACT;;GAEG;AACD;IAAE,OAAO,CAAC,EAAE,KAAK,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE;AACjC;;GAEG;GACD;IAAE,OAAO,IAAI,IAAI,CAAC;IAAC,EAAE,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAEpC,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IAChC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,UAAU,aAAa;IACrB;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,UAAU,EAAE,CAAC;IAChC;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;GAYG;AAEH,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,2CAiF/C"}
|