@rws-aoa/react-library 8.1.0 → 8.2.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/chunks/FieldError.Bo2QpEMu.js +230 -0
- package/dist/chunks/FieldError.Bo2QpEMu.js.map +1 -0
- package/dist/components/atoms/_menu/user-menu/UserMenu.js.map +1 -1
- package/dist/components/atoms/icon-button/IconButton.js.map +1 -1
- package/dist/components/atoms/logo/Logo.js.map +1 -1
- package/dist/components/atoms/notification/_icons/Error.js.map +1 -1
- package/dist/components/atoms/notification/_icons/Success.js.map +1 -1
- package/dist/components/atoms/notification/_icons/Warning.js.map +1 -1
- package/dist/components/atoms/table/Table.d.ts.map +1 -1
- package/dist/components/atoms/table/Table.js +2 -2
- package/dist/components/atoms/table/Table.js.map +1 -1
- package/dist/components/atoms/table/_QuickSearchToolbar.d.ts.map +1 -1
- package/dist/components/atoms/table/_QuickSearchToolbar.js +34 -44
- package/dist/components/atoms/table/_QuickSearchToolbar.js.map +1 -1
- package/dist/components/atoms/zero-width-space/ZeroWidthSpace.js.map +1 -1
- package/dist/components/molecules/field-error/FieldError.js +1 -1
- package/dist/components/molecules/file-dropzone/FileDropzone.js.map +1 -1
- package/dist/components/molecules/form-error/FormError.js +1 -1
- package/dist/components/molecules/form-modal/FormModal.js +1 -1
- package/dist/components/molecules/modal/Modal.js.map +1 -1
- package/dist/components/molecules/modal-close-button/ModalCloseButton.js.map +1 -1
- package/dist/components/molecules/navigation-bar/NavigationBar.js.map +1 -1
- package/dist/components/molecules/no-label-number-field/NoLabelNumberField.d.ts +120 -0
- package/dist/components/molecules/no-label-number-field/NoLabelNumberField.d.ts.map +1 -0
- package/dist/components/molecules/no-label-number-field/NoLabelNumberField.js +9 -0
- package/dist/components/molecules/no-label-number-field/NoLabelNumberField.js.map +1 -0
- package/dist/components/molecules/upload-button/UploadButton.js.map +1 -1
- package/dist/contexts/TanstackFormContext.d.ts +4 -0
- package/dist/contexts/TanstackFormContext.d.ts.map +1 -1
- package/dist/contexts/TanstackFormContext.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -32
- package/package.json +23 -19
- package/dist/chunks/FieldError.5EPMwcGp.js +0 -170
- package/dist/chunks/FieldError.5EPMwcGp.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rws-aoa/react-library",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.0",
|
|
4
4
|
"description": "RWS AOA Design System",
|
|
5
5
|
"author": "@rws-aoa",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,49 +28,49 @@
|
|
|
28
28
|
"@emotion/styled": "^11.14.1",
|
|
29
29
|
"@mui/icons-material": "^7.3.5",
|
|
30
30
|
"@mui/material": "^7.3.5",
|
|
31
|
-
"@
|
|
31
|
+
"@sapphire/utilities": "^3.18.2",
|
|
32
|
+
"@tanstack/react-router": "^1.139.7",
|
|
32
33
|
"clsx": "^2.1.1",
|
|
33
34
|
"lodash": "^4.17.21",
|
|
34
35
|
"react": "^19.2.0",
|
|
35
36
|
"react-dom": "^19.2.0"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
|
-
"@chromatic-com/storybook": "^4.1.
|
|
39
|
+
"@chromatic-com/storybook": "^4.1.3",
|
|
39
40
|
"@favware/cliff-jumper": "^6.0.0",
|
|
40
41
|
"@fontsource/material-icons": "^5.2.7",
|
|
41
|
-
"@fontsource/roboto": "^5.2.
|
|
42
|
+
"@fontsource/roboto": "^5.2.9",
|
|
42
43
|
"@mui/system": "^7.3.5",
|
|
43
|
-
"@mui/x-data-grid": "^8.
|
|
44
|
-
"@mui/x-data-grid-generator": "^8.
|
|
44
|
+
"@mui/x-data-grid": "^8.20.0",
|
|
45
|
+
"@mui/x-data-grid-generator": "^8.20.0",
|
|
45
46
|
"@storybook/addon-a11y": "^9.1.16",
|
|
46
|
-
"@storybook/addon-console": "^3.0.0",
|
|
47
47
|
"@storybook/addon-docs": "^9.1.16",
|
|
48
48
|
"@storybook/addon-onboarding": "^9.1.16",
|
|
49
49
|
"@storybook/addon-themes": "^9.1.16",
|
|
50
|
-
"@storybook/addon-vitest": "9.1.16",
|
|
50
|
+
"@storybook/addon-vitest": "^9.1.16",
|
|
51
51
|
"@storybook/react-vite": "^9.1.16",
|
|
52
|
-
"@tanstack/react-form": "1.
|
|
53
|
-
"@types/lodash": "^4.17.
|
|
52
|
+
"@tanstack/react-form": "1.26.0",
|
|
53
|
+
"@types/lodash": "^4.17.21",
|
|
54
54
|
"@types/lodash.merge": "^4.6.9",
|
|
55
|
-
"@types/react": "^19.2.
|
|
56
|
-
"@types/react-dom": "^19.2.
|
|
57
|
-
"@vitejs/plugin-react": "^5.1.
|
|
55
|
+
"@types/react": "^19.2.7",
|
|
56
|
+
"@types/react-dom": "^19.2.3",
|
|
57
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
58
58
|
"@vitest/browser": "^3.2.4",
|
|
59
59
|
"@vitest/coverage-v8": "^3.2.4",
|
|
60
|
-
"babel-plugin-react-compiler": "^
|
|
60
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
61
61
|
"eslint": "^9.39.1",
|
|
62
|
-
"glob": "^
|
|
62
|
+
"glob": "^13.0.0",
|
|
63
63
|
"npm-run-all2": "^8.0.4",
|
|
64
|
-
"playwright": "^1.
|
|
65
|
-
"prettier": "^3.
|
|
64
|
+
"playwright": "^1.57.0",
|
|
65
|
+
"prettier": "^3.7.0",
|
|
66
66
|
"react-dropzone": "^14.3.8",
|
|
67
67
|
"react-toastify": "^11.0.5",
|
|
68
68
|
"remark-gfm": "^4.0.1",
|
|
69
69
|
"storybook": "^9.1.16",
|
|
70
|
-
"stylelint": "^16.
|
|
70
|
+
"stylelint": "^16.26.0",
|
|
71
71
|
"tslib": "^2.8.1",
|
|
72
72
|
"typescript": "^5.9.3",
|
|
73
|
-
"vite": "^7.2.
|
|
73
|
+
"vite": "^7.2.4",
|
|
74
74
|
"vite-plugin-checker": "^0.11.0",
|
|
75
75
|
"vite-plugin-dts": "^4.5.4",
|
|
76
76
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
@@ -174,6 +174,10 @@
|
|
|
174
174
|
"types": "./dist/components/molecules/navigation-bar/NavigationBar.d.ts",
|
|
175
175
|
"default": "./dist/components/molecules/navigation-bar/NavigationBar.js"
|
|
176
176
|
},
|
|
177
|
+
"./nolabelnumberfield": {
|
|
178
|
+
"types": "./dist/components/molecules/no-label-number-field/NoLabelNumberField.d.ts",
|
|
179
|
+
"default": "./dist/components/molecules/no-label-number-field/NoLabelNumberField.js"
|
|
180
|
+
},
|
|
177
181
|
"./nopermission": {
|
|
178
182
|
"types": "./dist/components/atoms/no-permission/NoPermission.d.ts",
|
|
179
183
|
"default": "./dist/components/atoms/no-permission/NoPermission.js"
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { jsx as n, jsxs as R } from "react/jsx-runtime";
|
|
2
|
-
import { c as G } from "./compiler-runtime.CrLvXwKf.js";
|
|
3
|
-
import { createFormHookContexts as U, createFormHook as V } from "@tanstack/react-form";
|
|
4
|
-
import { AoaNotification as j } from "../components/atoms/notification/Notification.js";
|
|
5
|
-
import { DialogTitle as X, DialogContent as Y, Dialog as Z, DialogActions as ee } from "@mui/material";
|
|
6
|
-
import { l as _ } from "./lodash.DPVO3Hgf.js";
|
|
7
|
-
import { AoaButton as z } from "../components/atoms/button/Button.js";
|
|
8
|
-
import { AoaModalCloseButton as te } from "../components/molecules/modal-close-button/ModalCloseButton.js";
|
|
9
|
-
function oe(l) {
|
|
10
|
-
const e = G.c(5), {
|
|
11
|
-
"data-qa": a
|
|
12
|
-
} = l, s = K();
|
|
13
|
-
let i;
|
|
14
|
-
e[0] !== a ? (i = (r) => {
|
|
15
|
-
if (r.length) {
|
|
16
|
-
const o = r.at(0);
|
|
17
|
-
if (typeof o == "string")
|
|
18
|
-
return /* @__PURE__ */ n(j, { "data-qa": a ?? "form-error", message: o, severity: "error" });
|
|
19
|
-
if (o && typeof o == "object") {
|
|
20
|
-
const m = ["error", "info", "success", "warning"].includes(o.level) ? o.level : "error";
|
|
21
|
-
return /* @__PURE__ */ n(j, { "data-qa": a ?? "form-error", message: o.message, severity: m });
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return null;
|
|
25
|
-
}, e[0] = a, e[1] = i) : i = e[1];
|
|
26
|
-
let t;
|
|
27
|
-
return e[2] !== s.Subscribe || e[3] !== i ? (t = /* @__PURE__ */ n(s.Subscribe, { selector: re, children: i }), e[2] = s.Subscribe, e[3] = i, e[4] = t) : t = e[4], t;
|
|
28
|
-
}
|
|
29
|
-
function re(l) {
|
|
30
|
-
return l.errors;
|
|
31
|
-
}
|
|
32
|
-
function se(l) {
|
|
33
|
-
const e = G.c(56), {
|
|
34
|
-
formModalQas: a,
|
|
35
|
-
formLabels: s,
|
|
36
|
-
formName: i,
|
|
37
|
-
DialogProps: t,
|
|
38
|
-
DialogTitleProps: r,
|
|
39
|
-
DialogContentProps: o,
|
|
40
|
-
AoaSubmitButtonProps: m,
|
|
41
|
-
modalQas: f,
|
|
42
|
-
open: O,
|
|
43
|
-
topic: T,
|
|
44
|
-
dialogContent: k,
|
|
45
|
-
closeAction: d
|
|
46
|
-
} = l;
|
|
47
|
-
let p;
|
|
48
|
-
e[0] !== m ? (p = m === void 0 ? {} : m, e[0] = m, e[1] = p) : p = e[1];
|
|
49
|
-
let u, b;
|
|
50
|
-
e[2] !== p ? ({
|
|
51
|
-
disableWithFormState: b,
|
|
52
|
-
...u
|
|
53
|
-
} = p, e[2] = p, e[3] = u, e[4] = b) : (u = e[3], b = e[4]);
|
|
54
|
-
const c = K();
|
|
55
|
-
let D;
|
|
56
|
-
e[5] !== u || e[6] !== b || e[7] !== c.Subscribe || e[8] !== s.submit || e[9] !== a?.submitButton ? (D = b ? /* @__PURE__ */ n(c.Subscribe, { selector: ae, children: (P) => {
|
|
57
|
-
const [I, J] = P;
|
|
58
|
-
return /* @__PURE__ */ n(z, { ...u, "aria-disabled": I || !J, buttonType: "submit", "data-qa": a?.submitButton ?? "submit-form", disabled: I || !J, type: "primary", children: s.submit });
|
|
59
|
-
} }) : /* @__PURE__ */ n(z, { ...u, buttonType: "submit", "data-qa": a?.submitButton ?? "submit-form", type: "primary", children: s.submit }), e[5] = u, e[6] = b, e[7] = c.Subscribe, e[8] = s.submit, e[9] = a?.submitButton, e[10] = D) : D = e[10];
|
|
60
|
-
const E = D, Q = f?.modal ?? "modal", $ = !!O;
|
|
61
|
-
let g;
|
|
62
|
-
e[11] !== t?.sx ? (g = _.merge({
|
|
63
|
-
"> div > div": {
|
|
64
|
-
borderRadius: 0
|
|
65
|
-
}
|
|
66
|
-
}, t?.sx), e[11] = t?.sx, e[12] = g) : g = e[12];
|
|
67
|
-
const L = f?.title ?? "modal-title";
|
|
68
|
-
let x;
|
|
69
|
-
e[13] !== r?.sx ? (x = _.merge({
|
|
70
|
-
padding: "3rem 3rem 1rem",
|
|
71
|
-
color: "var(--color-rijks-logoblue)",
|
|
72
|
-
fontSize: "1.1rem",
|
|
73
|
-
fontWeight: "bolder"
|
|
74
|
-
}, r?.sx), e[13] = r?.sx, e[14] = x) : x = e[14];
|
|
75
|
-
let h;
|
|
76
|
-
e[15] !== r || e[16] !== L || e[17] !== x || e[18] !== T ? (h = /* @__PURE__ */ n(X, { ...r, "data-qa": L, maxWidth: "sm", sx: x, children: T }), e[15] = r, e[16] = L, e[17] = x, e[18] = T, e[19] = h) : h = e[19];
|
|
77
|
-
let A;
|
|
78
|
-
e[20] !== d ? (A = /* @__PURE__ */ n(te, { closeAction: d }), e[20] = d, e[21] = A) : A = e[21];
|
|
79
|
-
const M = a?.form ?? "form";
|
|
80
|
-
let C;
|
|
81
|
-
e[22] !== c ? (C = async (P) => {
|
|
82
|
-
P.preventDefault(), P.stopPropagation(), await c.handleSubmit();
|
|
83
|
-
}, e[22] = c, e[23] = C) : C = e[23];
|
|
84
|
-
const W = f?.content ?? "modal-content";
|
|
85
|
-
let y;
|
|
86
|
-
e[24] !== o?.sx ? (y = _.merge({
|
|
87
|
-
padding: "0 3rem 2rem"
|
|
88
|
-
}, o?.sx), e[24] = o?.sx, e[25] = y) : y = e[25];
|
|
89
|
-
let S;
|
|
90
|
-
e[26] !== o || e[27] !== k || e[28] !== W || e[29] !== y ? (S = /* @__PURE__ */ n(Y, { ...o, "data-qa": W, sx: y, children: k }), e[26] = o, e[27] = k, e[28] = W, e[29] = y, e[30] = S) : S = e[30];
|
|
91
|
-
const H = a?.dialogActions ?? "dialog-actions", N = a?.cancelButton ?? "cancel-form";
|
|
92
|
-
let v;
|
|
93
|
-
e[31] !== d || e[32] !== c ? (v = () => {
|
|
94
|
-
c.reset(), d();
|
|
95
|
-
}, e[31] = d, e[32] = c, e[33] = v) : v = e[33];
|
|
96
|
-
let F;
|
|
97
|
-
e[34] !== s.cancel || e[35] !== N || e[36] !== v ? (F = /* @__PURE__ */ n(z, { "data-qa": N, onClick: v, type: "secondary", children: s.cancel }), e[34] = s.cancel, e[35] = N, e[36] = v, e[37] = F) : F = e[37];
|
|
98
|
-
let q;
|
|
99
|
-
e[38] !== E || e[39] !== H || e[40] !== F ? (q = /* @__PURE__ */ R(ee, { "data-qa": H, children: [
|
|
100
|
-
F,
|
|
101
|
-
E
|
|
102
|
-
] }), e[38] = E, e[39] = H, e[40] = F, e[41] = q) : q = e[41];
|
|
103
|
-
let B;
|
|
104
|
-
e[42] !== i || e[43] !== M || e[44] !== C || e[45] !== S || e[46] !== q ? (B = /* @__PURE__ */ R("form", { "data-qa": M, name: i, onSubmit: C, children: [
|
|
105
|
-
S,
|
|
106
|
-
q
|
|
107
|
-
] }), e[42] = i, e[43] = M, e[44] = C, e[45] = S, e[46] = q, e[47] = B) : B = e[47];
|
|
108
|
-
let w;
|
|
109
|
-
return e[48] !== t || e[49] !== A || e[50] !== B || e[51] !== Q || e[52] !== $ || e[53] !== g || e[54] !== h ? (w = /* @__PURE__ */ R(Z, { ...t, "data-qa": Q, open: $, sx: g, children: [
|
|
110
|
-
h,
|
|
111
|
-
A,
|
|
112
|
-
B
|
|
113
|
-
] }), e[48] = t, e[49] = A, e[50] = B, e[51] = Q, e[52] = $, e[53] = g, e[54] = h, e[55] = w) : w = e[55], w;
|
|
114
|
-
}
|
|
115
|
-
function ae(l) {
|
|
116
|
-
return [l.isSubmitting, l.canSubmit];
|
|
117
|
-
}
|
|
118
|
-
const {
|
|
119
|
-
fieldContext: ie,
|
|
120
|
-
formContext: ne,
|
|
121
|
-
useFieldContext: le,
|
|
122
|
-
useFormContext: K
|
|
123
|
-
} = U(), {
|
|
124
|
-
useAppForm: he,
|
|
125
|
-
withForm: Ae
|
|
126
|
-
} = V({
|
|
127
|
-
fieldContext: ie,
|
|
128
|
-
formContext: ne,
|
|
129
|
-
fieldComponents: {
|
|
130
|
-
AoaFieldError: me
|
|
131
|
-
},
|
|
132
|
-
formComponents: {
|
|
133
|
-
AoaFormModal: se,
|
|
134
|
-
AoaFormError: oe
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
function me(l) {
|
|
138
|
-
const e = G.c(11), {
|
|
139
|
-
"data-qa": a
|
|
140
|
-
} = l, s = le();
|
|
141
|
-
if (s.state.meta.isTouched && s.state.meta.errors.length) {
|
|
142
|
-
let i;
|
|
143
|
-
e[0] !== s.state.meta.errors ? (i = s.state.meta.errors.at(0), e[0] = s.state.meta.errors, e[1] = i) : i = e[1];
|
|
144
|
-
const t = i;
|
|
145
|
-
if (typeof t == "string") {
|
|
146
|
-
const r = a ?? "field-error";
|
|
147
|
-
let o;
|
|
148
|
-
return e[2] !== t || e[3] !== r ? (o = /* @__PURE__ */ n(j, { "data-qa": r, message: t, severity: "error" }), e[2] = t, e[3] = r, e[4] = o) : o = e[4], o;
|
|
149
|
-
} else if (t && typeof t == "object") {
|
|
150
|
-
let r;
|
|
151
|
-
e[5] !== t.level ? (r = ["error", "info", "success", "warning"].includes(t.level) ? t.level : "error", e[5] = t.level, e[6] = r) : r = e[6];
|
|
152
|
-
const o = r, m = a ?? "field-error";
|
|
153
|
-
let f;
|
|
154
|
-
return e[7] !== t.message || e[8] !== o || e[9] !== m ? (f = /* @__PURE__ */ n(j, { "data-qa": m, message: t.message, severity: o }), e[7] = t.message, e[8] = o, e[9] = m, e[10] = f) : f = e[10], f;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
return null;
|
|
158
|
-
}
|
|
159
|
-
export {
|
|
160
|
-
me as A,
|
|
161
|
-
oe as a,
|
|
162
|
-
se as b,
|
|
163
|
-
ie as c,
|
|
164
|
-
ne as d,
|
|
165
|
-
le as e,
|
|
166
|
-
K as f,
|
|
167
|
-
he as u,
|
|
168
|
-
Ae as w
|
|
169
|
-
};
|
|
170
|
-
//# sourceMappingURL=FieldError.5EPMwcGp.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FieldError.5EPMwcGp.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) ? (error.level as Severity) : '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 {...AoaSubmitButtonProps} buttonType='submit' data-qa={formModalQas?.submitButton ?? 'submit-form'} type='primary'>\n {formLabels.submit}\n </AoaButton>\n );\n\n return (\n <Dialog\n {...DialogProps}\n data-qa={modalQas?.modal ?? 'modal'}\n open={Boolean(open)}\n sx={merge(\n {\n '> div > div': {\n borderRadius: 0\n }\n },\n DialogProps?.sx\n )}\n >\n <DialogTitle\n {...DialogTitleProps}\n data-qa={modalQas?.title ?? 'modal-title'}\n maxWidth='sm'\n sx={merge(\n {\n padding: '3rem 3rem 1rem',\n color: 'var(--color-rijks-logoblue)',\n fontSize: '1.1rem',\n fontWeight: 'bolder'\n },\n DialogTitleProps?.sx\n )}\n >\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) ? (error.level as Severity) : '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","sx","merge","borderRadius","t7","title","t8","padding","color","fontSize","fontWeight","t9","DialogTitle","t10","AoaModalCloseButton","t11","t12","event","preventDefault","stopPropagation","handleSubmit","t13","content","t14","t15","DialogContent","t16","dialogActions","t17","cancelButton","t18","reset","t19","cancel","t20","DialogActions","t21","t22","jsxs","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,Q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