@rws-aoa/react-library 3.6.6 → 5.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.
Files changed (71) hide show
  1. package/dist/chunks/FieldError.DAUtZvvC.js +143 -0
  2. package/dist/chunks/FieldError.DAUtZvvC.js.map +1 -0
  3. package/dist/chunks/lodash.DOeeRDpT.js +3678 -0
  4. package/dist/chunks/lodash.DOeeRDpT.js.map +1 -0
  5. package/dist/components/atoms/_menu/menu-item/MenuItem.d.ts.map +1 -1
  6. package/dist/components/atoms/_menu/menu-item/MenuItem.js +39 -39
  7. package/dist/components/atoms/_menu/menu-item/MenuItem.js.map +1 -1
  8. package/dist/components/atoms/_menu/user-menu/UserMenu.js +20 -20
  9. package/dist/components/atoms/_menu/user-menu/UserMenu.js.map +1 -1
  10. package/dist/components/atoms/button/Button.d.ts.map +1 -1
  11. package/dist/components/atoms/button/Button.js +33 -33
  12. package/dist/components/atoms/button/Button.js.map +1 -1
  13. package/dist/components/atoms/icon-button/IconButton.js +4 -4
  14. package/dist/components/atoms/icon-button/IconButton.js.map +1 -1
  15. package/dist/components/atoms/input/Input.d.ts.map +1 -1
  16. package/dist/components/atoms/input/Input.js +61 -55
  17. package/dist/components/atoms/input/Input.js.map +1 -1
  18. package/dist/components/atoms/no-permission/NoPermission.d.ts.map +1 -1
  19. package/dist/components/atoms/no-permission/NoPermission.js +10 -10
  20. package/dist/components/atoms/no-permission/NoPermission.js.map +1 -1
  21. package/dist/components/atoms/notification/Notification.d.ts.map +1 -1
  22. package/dist/components/atoms/notification/Notification.js +22 -22
  23. package/dist/components/atoms/notification/Notification.js.map +1 -1
  24. package/dist/components/atoms/section-header/SectionHeader.d.ts.map +1 -1
  25. package/dist/components/atoms/section-header/SectionHeader.js +15 -15
  26. package/dist/components/atoms/section-header/SectionHeader.js.map +1 -1
  27. package/dist/components/atoms/selection-buttons/checkbox/Checkbox.d.ts.map +1 -1
  28. package/dist/components/atoms/selection-buttons/checkbox/Checkbox.js +11 -11
  29. package/dist/components/atoms/selection-buttons/checkbox/Checkbox.js.map +1 -1
  30. package/dist/components/atoms/selection-buttons/radio-button/RadioButton.d.ts.map +1 -1
  31. package/dist/components/atoms/selection-buttons/radio-button/RadioButton.js +10 -10
  32. package/dist/components/atoms/selection-buttons/radio-button/RadioButton.js.map +1 -1
  33. package/dist/components/atoms/selection-buttons/switch-button/SwitchButton.d.ts.map +1 -1
  34. package/dist/components/atoms/selection-buttons/switch-button/SwitchButton.js +10 -10
  35. package/dist/components/atoms/selection-buttons/switch-button/SwitchButton.js.map +1 -1
  36. package/dist/components/atoms/table/Table.d.ts.map +1 -1
  37. package/dist/components/atoms/table/Table.js +60 -62
  38. package/dist/components/atoms/table/Table.js.map +1 -1
  39. package/dist/components/atoms/table/_QuickSearchToolbar.d.ts.map +1 -1
  40. package/dist/components/atoms/table/_QuickSearchToolbar.js +25 -24
  41. package/dist/components/atoms/table/_QuickSearchToolbar.js.map +1 -1
  42. package/dist/components/molecules/field-error/FieldError.d.ts +22 -0
  43. package/dist/components/molecules/field-error/FieldError.d.ts.map +1 -0
  44. package/dist/components/molecules/field-error/FieldError.js +7 -0
  45. package/dist/components/molecules/field-error/FieldError.js.map +1 -0
  46. package/dist/components/molecules/form-error/FormError.d.ts +17 -4
  47. package/dist/components/molecules/form-error/FormError.d.ts.map +1 -1
  48. package/dist/components/molecules/form-error/FormError.js +4 -10
  49. package/dist/components/molecules/form-error/FormError.js.map +1 -1
  50. package/dist/components/molecules/form-modal/FormModal.d.ts +31 -34
  51. package/dist/components/molecules/form-modal/FormModal.d.ts.map +1 -1
  52. package/dist/components/molecules/form-modal/FormModal.js +7 -75
  53. package/dist/components/molecules/form-modal/FormModal.js.map +1 -1
  54. package/dist/components/molecules/modal/Modal.js +12 -12
  55. package/dist/components/molecules/modal/Modal.js.map +1 -1
  56. package/dist/components/molecules/navigation-bar/NavigationBar.js +21 -21
  57. package/dist/components/molecules/navigation-bar/NavigationBar.js.map +1 -1
  58. package/dist/components/molecules/upload-button/UploadButton.d.ts.map +1 -1
  59. package/dist/components/molecules/upload-button/UploadButton.js +26 -24
  60. package/dist/components/molecules/upload-button/UploadButton.js.map +1 -1
  61. package/dist/contexts/TanstackFormContext.d.ts +29 -0
  62. package/dist/contexts/TanstackFormContext.d.ts.map +1 -0
  63. package/dist/contexts/TanstackFormContext.js +11 -0
  64. package/dist/contexts/TanstackFormContext.js.map +1 -0
  65. package/dist/index.d.ts +2 -0
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +40 -34
  68. package/dist/index.js.map +1 -1
  69. package/package.json +48 -39
  70. package/dist/chunks/index.DJYQ_-zP.js +0 -489
  71. package/dist/chunks/index.DJYQ_-zP.js.map +0 -1
@@ -1,4 +1,3 @@
1
- import { FormApi, Validator } from '@tanstack/react-form';
2
1
  import { AoaButtonProps } from '../../atoms/button/Button';
3
2
  import { AoaModalProps } from '../modal/Modal';
4
3
  import { AoaModalCloseButtonProps } from '../modal-close-button/ModalCloseButton';
@@ -28,15 +27,9 @@ export interface AoaFormModalProps extends Omit<AoaModalProps, 'dialogActions'>,
28
27
  /**
29
28
  * Additional properties to provide to the {@link AoaButton | submit button}
30
29
  */
31
- AoaSubmitButtonProps?: Omit<AoaButtonProps, 'buttonType' | 'data-qa' | 'onClick' | 'type'>;
32
- /**
33
- * The tanstack form instance
34
- *
35
- * @remarks
36
- * - The `any`'s here are intentional, otherwise type instantiation can become excessively deep and possibly infinite,
37
- * exact types are also not necessary here
38
- */
39
- form: FormApi<any, Validator<any>>;
30
+ AoaSubmitButtonProps?: Omit<AoaButtonProps, 'buttonType' | 'data-qa' | 'disabled' | 'onClick' | 'type'> & {
31
+ disableWithFormState?: boolean;
32
+ };
40
33
  /**
41
34
  * Labels for the buttons in {@link DialogActions}
42
35
  */
@@ -55,33 +48,37 @@ export interface AoaFormModalProps extends Omit<AoaModalProps, 'dialogActions'>,
55
48
  *
56
49
  * For a modal without a form see `AoaModal`
57
50
  *
51
+ * This component is intended for internal use only and should always be used through `<form.AoaFormModal />`
52
+ *
53
+ * @internal
58
54
  * @param props - Props to pass to the modal - {@link ModalProps}
59
55
  * @example
60
56
  * ```jsx
61
- * <AoaFormModal
62
- * open={true}
63
- * form={form}
64
- * formLabels={{
65
- * submit: 'submit',
66
- * cancel: 'cancel'
67
- * }}
68
- * formModalQas={{
69
- * cancelButton: 'cancel-button',
70
- * dialogActions: 'dialog-actions,
71
- * form: 'form',
72
- * submitButton: 'confirm-button'
73
- * }}
74
- * closeAction={handleClose}
75
- * topic='topic'
76
- * modalQas={{
77
- * modal: 'modal',
78
- * content: 'modal-content',
79
- * title: 'modal-title'
80
- * }}
81
- * formName='form'
82
- * dialogContent={content}
83
- * />
57
+ * <form.AppForm>
58
+ * <form.AoaFormModal
59
+ * open={true}
60
+ * formLabels={{
61
+ * submit: 'submit',
62
+ * cancel: 'cancel'
63
+ * }}
64
+ * formModalQas={{
65
+ * cancelButton: 'cancel-button',
66
+ * dialogActions: 'dialog-actions,
67
+ * form: 'form',
68
+ * submitButton: 'confirm-button'
69
+ * }}
70
+ * closeAction={handleClose}
71
+ * topic='topic'
72
+ * modalQas={{
73
+ * modal: 'modal',
74
+ * content: 'modal-content',
75
+ * title: 'modal-title'
76
+ * }}
77
+ * formName='form'
78
+ * dialogContent={content}
79
+ * />
80
+ * </form.AppForm>
84
81
  * ```
85
82
  */
86
- export declare function AoaFormModal({ form, formModalQas, formLabels, formName, DialogProps, DialogTitleProps, DialogContentProps, AoaSubmitButtonProps, modalQas, open, topic, dialogContent, closeAction }: Readonly<AoaFormModalProps>): import("react/jsx-runtime").JSX.Element;
83
+ export declare function AoaFormModal({ formModalQas, formLabels, formName, DialogProps, DialogTitleProps, DialogContentProps, AoaSubmitButtonProps: { disableWithFormState, ...AoaSubmitButtonProps }, modalQas, open, topic, dialogContent, closeAction }: Readonly<AoaFormModalProps>): import("react/jsx-runtime").JSX.Element;
87
84
  //# sourceMappingURL=FormModal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormModal.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/form-modal/FormModal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAuB,KAAK,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAE5G,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,aAAa,EAAE,eAAe,CAAC,EAAE,wBAAwB;IACvG;;OAEG;IACH,oBAAoB,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC,CAAC;IAC3F;;;;;;OAMG;IACH,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC;;OAEG;IACH,UAAU,EAAE,kBAAkB,CAAC;IAC/B;;OAEG;IACH,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,aAAa,EACb,WAAW,EACZ,EAAE,QAAQ,CAAC,iBAAiB,CAAC,2CAmD7B"}
1
+ {"version":3,"file":"FormModal.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/form-modal/FormModal.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAuB,KAAK,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAE5G,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,aAAa,EAAE,eAAe,CAAC,EAAE,wBAAwB;IACvG;;OAEG;IACH,oBAAoB,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC,GAAG;QACxG,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAChC,CAAC;IACF;;OAEG;IACH,UAAU,EAAE,kBAAkB,CAAC;IAC/B;;OAEG;IACH,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,YAAY,CAAC,EAC3B,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EAAE,EAAE,oBAAoB,EAAE,GAAG,oBAAoB,EAAO,EAC5E,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,aAAa,EACb,WAAW,EACZ,EAAE,QAAQ,CAAC,iBAAiB,CAAC,2CAwE7B"}
@@ -1,78 +1,10 @@
1
- import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
- import { Dialog as S, DialogTitle as T, DialogContent as k, DialogActions as w } from "@mui/material";
3
- import { m as F } from "../../../chunks/index.DJYQ_-zP.js";
4
- import { AoaButton as q } from "../../atoms/button/Button.js";
5
- import { AoaModalCloseButton as W } from "../modal-close-button/ModalCloseButton.js";
6
- function G({
7
- form: u,
8
- formModalQas: t,
9
- formLabels: p,
10
- formName: x,
11
- DialogProps: b,
12
- DialogTitleProps: y,
13
- DialogContentProps: n,
14
- AoaSubmitButtonProps: B,
15
- modalQas: i,
16
- open: g,
17
- topic: A,
18
- dialogContent: j,
19
- closeAction: h
20
- }) {
21
- return /* @__PURE__ */ c(S, { ...b, "data-qa": (i == null ? void 0 : i.modal) ?? "modal", open: !!g, children: [
22
- /* @__PURE__ */ e(T, { ...y, "data-qa": (i == null ? void 0 : i.title) ?? "modal-title", maxWidth: "sm", sx: { m: 0, p: 2 }, children: A }),
23
- /* @__PURE__ */ e(W, { closeAction: h }),
24
- /* @__PURE__ */ c(
25
- "form",
26
- {
27
- "data-qa": (t == null ? void 0 : t.form) ?? "form",
28
- name: x,
29
- onSubmit: async (r) => {
30
- r.preventDefault(), r.stopPropagation(), await u.handleSubmit();
31
- },
32
- children: [
33
- /* @__PURE__ */ e(
34
- k,
35
- {
36
- ...n,
37
- "data-qa": (i == null ? void 0 : i.content) ?? "modal-content",
38
- sx: F(
39
- {
40
- padding: "0 3rem 2rem"
41
- },
42
- n == null ? void 0 : n.sx
43
- ),
44
- children: j
45
- }
46
- ),
47
- /* @__PURE__ */ c(w, { "data-qa": (t == null ? void 0 : t.dialogActions) ?? "dialog-actions", children: [
48
- /* @__PURE__ */ e(
49
- q,
50
- {
51
- "data-qa": (t == null ? void 0 : t.cancelButton) ?? "cancel-form",
52
- onClick: () => {
53
- u.reset(), h();
54
- },
55
- type: "secondary",
56
- children: p.cancel
57
- }
58
- ),
59
- /* @__PURE__ */ e(
60
- q,
61
- {
62
- ...B,
63
- buttonType: "submit",
64
- "data-qa": (t == null ? void 0 : t.submitButton) ?? "submit-form",
65
- type: "primary",
66
- children: p.submit
67
- }
68
- )
69
- ] })
70
- ]
71
- }
72
- )
73
- ] });
74
- }
1
+ import "react/jsx-runtime";
2
+ import "@mui/material";
3
+ import "../../../chunks/lodash.DOeeRDpT.js";
4
+ import { b } from "../../../chunks/FieldError.DAUtZvvC.js";
5
+ import "../../atoms/button/Button.js";
6
+ import "../modal-close-button/ModalCloseButton.js";
75
7
  export {
76
- G as AoaFormModal
8
+ b as AoaFormModal
77
9
  };
78
10
  //# sourceMappingURL=FormModal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormModal.js","sources":["../../../../src/components/molecules/form-modal/FormModal.tsx"],"sourcesContent":["import { Dialog, DialogActions, DialogContent, DialogTitle } from '@mui/material';\nimport type { FormApi, Validator } from '@tanstack/react-form';\nimport merge from 'lodash.merge';\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' | 'onClick' | 'type'>;\n /**\n * The tanstack form instance\n *\n * @remarks\n * - The `any`'s here are intentional, otherwise type instantiation can become excessively deep and possibly infinite,\n * exact types are also not necessary here\n */\n form: FormApi<any, Validator<any>>;\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 * @param props - Props to pass to the modal - {@link ModalProps}\n * @example\n * ```jsx\n * <AoaFormModal\n * open={true}\n * form={form}\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 * ```\n */\nexport function AoaFormModal({\n form,\n formModalQas,\n formLabels,\n formName,\n DialogProps,\n DialogTitleProps,\n DialogContentProps,\n AoaSubmitButtonProps,\n modalQas,\n open,\n topic,\n dialogContent,\n closeAction\n}: Readonly<AoaFormModalProps>) {\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 <AoaButton\n {...AoaSubmitButtonProps}\n buttonType='submit'\n data-qa={formModalQas?.submitButton ?? 'submit-form'}\n type='primary'\n >\n {formLabels.submit}\n </AoaButton>\n </DialogActions>\n </form>\n </Dialog>\n );\n}\n"],"names":["AoaFormModal","form","formModalQas","formLabels","formName","DialogProps","DialogTitleProps","DialogContentProps","AoaSubmitButtonProps","modalQas","open","topic","dialogContent","closeAction","jsxs","Dialog","jsx","DialogTitle","AoaModalCloseButton","event","DialogContent","merge","DialogActions","AoaButton"],"mappings":";;;;;AA2FO,SAASA,EAAa;AAAA,EAC3B,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC;AAAA,EACA,aAAAC;AACF,GAAgC;AAE5B,SAAA,gBAAAC,EAACC,GAAQ,EAAA,GAAGV,GAAa,YAASI,KAAA,gBAAAA,EAAU,UAAS,SAAS,MAAM,EAAQC,GAC1E,UAAA;AAAA,IAAA,gBAAAM,EAACC,KAAa,GAAGX,GAAkB,YAASG,KAAA,gBAAAA,EAAU,UAAS,eAAe,UAAS,MAAK,IAAI,EAAE,GAAG,GAAG,GAAG,KACxG,UACHE,GAAA;A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6 +1,6 @@
1
- import { jsxs as u, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as u, jsx as x } from "react/jsx-runtime";
2
2
  import { Dialog as v, DialogTitle as b, DialogContent as j } from "@mui/material";
3
- import { m as x } from "../../../chunks/index.DJYQ_-zP.js";
3
+ import { l as d } from "../../../chunks/lodash.DOeeRDpT.js";
4
4
  import { memo as q } from "react";
5
5
  import { AoaModalCloseButton as A } from "../modal-close-button/ModalCloseButton.js";
6
6
  const z = q(
@@ -9,8 +9,8 @@ const z = q(
9
9
  DialogTitleProps: t,
10
10
  DialogContentProps: m,
11
11
  modalQas: e,
12
- open: c,
13
- topic: d,
12
+ open: n,
13
+ topic: c,
14
14
  dialogContent: f,
15
15
  dialogActions: h,
16
16
  closeAction: i
@@ -19,8 +19,8 @@ const z = q(
19
19
  {
20
20
  ...r,
21
21
  "data-qa": (e == null ? void 0 : e.modal) ?? "modal",
22
- open: !!c,
23
- sx: x(
22
+ open: !!n,
23
+ sx: d.merge(
24
24
  {
25
25
  "> div > div": {
26
26
  borderRadius: 0,
@@ -30,12 +30,12 @@ const z = q(
30
30
  r == null ? void 0 : r.sx
31
31
  ),
32
32
  children: [
33
- /* @__PURE__ */ n(
33
+ /* @__PURE__ */ x(
34
34
  b,
35
35
  {
36
36
  ...t,
37
37
  "data-qa": (e == null ? void 0 : e.title) ?? "modal-title",
38
- sx: x(
38
+ sx: d.merge(
39
39
  {
40
40
  padding: "3rem 3rem 1rem",
41
41
  color: "var(--color-rijks-logoblue)",
@@ -44,16 +44,16 @@ const z = q(
44
44
  },
45
45
  t == null ? void 0 : t.sx
46
46
  ),
47
- children: d
47
+ children: c
48
48
  }
49
49
  ),
50
- /* @__PURE__ */ n(A, { closeAction: i }),
51
- /* @__PURE__ */ n(
50
+ /* @__PURE__ */ x(A, { closeAction: i }),
51
+ /* @__PURE__ */ x(
52
52
  j,
53
53
  {
54
54
  ...m,
55
55
  "data-qa": (e == null ? void 0 : e.content) ?? "modal-content",
56
- sx: x(
56
+ sx: d.merge(
57
57
  {
58
58
  padding: "0 3rem 2rem"
59
59
  },
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sources":["../../../../src/components/molecules/modal/Modal.tsx"],"sourcesContent":["import {\n Dialog,\n DialogContent,\n DialogTitle,\n type DialogContentProps,\n type DialogProps,\n type DialogTitleProps\n} from '@mui/material';\nimport merge from 'lodash.merge';\nimport { memo, type ReactNode } from 'react';\nimport { AoaModalCloseButton, type AoaModalCloseButtonProps } from '../modal-close-button/ModalCloseButton';\n\nexport interface AoaModalQAs {\n /**\n * Data-qa tag applied to the content\n */\n content?: string;\n /**\n * Data-qa tag applied to the main modal\n */\n modal?: string;\n /**\n * Data-qa tag applied to the title\n */\n title?: string;\n}\n\nexport interface AoaModalProps {\n /**\n * Any other props passed to the {@link DialogContent}\n */\n readonly DialogContentProps?: DialogContentProps;\n /**\n * Any other props passed to the {@link Dialog}\n */\n readonly DialogProps?: Omit<DialogProps, 'open'>;\n /**\n * Any other props passed to the {@link DialogTitle}\n */\n readonly DialogTitleProps?: DialogTitleProps;\n /**\n * Optional for adding dialog actions below the content\n */\n readonly dialogActions?: ReactNode;\n /**\n * The content to show in the modal\n */\n readonly dialogContent: ReactNode;\n /**\n * Object of data-qa tags to pass to the modal\n */\n readonly modalQas?: AoaModalQAs;\n /**\n * Whether the modal should be opened or not\n */\n readonly open: boolean;\n /**\n * Title for the modal\n */\n readonly topic: string;\n}\n\n/**\n * Constructs a modal using pre-defined Rijkswaterstaat styling\n *\n * @param props - Props to pass to the modal - {@link ModalProps}\n * @example\n * ```jsx\n * <AoaModal\n * topic='topic'\n * modalQas={{\n * modal: 'modal',\n * content: 'content',\n * title: 'title',\n * }}\n * dialogContent={<div>SAMPLE</div>}\n * open={true}\n * />\n * ```\n */\nexport const AoaModal = memo(\n ({\n DialogProps,\n DialogTitleProps,\n DialogContentProps,\n modalQas,\n open,\n topic,\n dialogContent,\n dialogActions,\n closeAction\n }: AoaModalCloseButtonProps & AoaModalProps) => {\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 minWidth: '45vw'\n }\n },\n DialogProps?.sx\n )}\n >\n <DialogTitle\n {...DialogTitleProps}\n data-qa={modalQas?.title ?? 'modal-title'}\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 <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}\n </Dialog>\n );\n }\n);\n"],"names":["AoaModal","memo","DialogProps","DialogTitleProps","DialogContentProps","modalQas","open","topic","dialogContent","dialogActions","closeAction","jsxs","Dialog","merge","jsx","DialogTitle","AoaModalCloseButton","DialogContent"],"mappings":";;;;;AAgFO,MAAMA,IAAWC;AAAA,EACtB,CAAC;AAAA,IACC,aAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,aAAAC;AAAA,EAAA,MAGE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACE,GAAGV;AAAA,MACJ,YAASG,KAAA,gBAAAA,EAAU,UAAS;AAAA,MAC5B,MAAM,EAAQC;AAAA,MACd,IAAIO;AAAA,QACF;AAAA,UACE,eAAe;AAAA,YACb,cAAc;AAAA,YACd,UAAU;AAAA,UAAA;AAAA,QAEd;AAAA,QACAX,KAAA,gBAAAA,EAAa;AAAA,MACf;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAY;AAAA,UAACC;AAAA,UAAA;AAAA,YACE,GAAGZ;AAAA,YACJ,YAASE,KAAA,gBAAAA,EAAU,UAAS;AAAA,YAC5B,IAAIQ;AAAA,cACF;AAAA,gBACE,SAAS;AAAA,gBACT,OAAO;AAAA,gBACP,UAAU;AAAA,gBACV,YAAY;AAAA,cACd;AAAA,cACAV,KAAA,gBAAAA,EAAkB;AAAA,YACpB;AAAA,YAEC,UAAAI;AAAA,UAAA;AAAA,QACH;AAAA,QACA,gBAAAO,EAACE,KAAoB,aAAAN,GAA0B;AAAA,QAC/C,gBAAAI;AAAA,UAACG;AAAA,UAAA;AAAA,YACE,GAAGb;AAAA,YACJ,YAASC,KAAA,gBAAAA,EAAU,YAAW;AAAA,YAC9B,IAAIQ;AAAA,cACF;AAAA,gBACE,SAAS;AAAA,cACX;AAAA,cACAT,KAAA,gBAAAA,EAAoB;AAAA,YACtB;AAAA,YAEC,UAAAI;AAAA,UAAA;AAAA,QACH;AAAA,QACCC;AAAA,MAAA;AAAA,IAAA;AAAA,EACH;AAGN;"}
1
+ {"version":3,"file":"Modal.js","sources":["../../../../src/components/molecules/modal/Modal.tsx"],"sourcesContent":["import {\n Dialog,\n DialogContent,\n DialogTitle,\n type DialogContentProps,\n type DialogProps,\n type DialogTitleProps\n} from '@mui/material';\nimport { merge } from 'lodash';\nimport { memo, type ReactNode } from 'react';\nimport { AoaModalCloseButton, type AoaModalCloseButtonProps } from '../modal-close-button/ModalCloseButton';\n\nexport interface AoaModalQAs {\n /**\n * Data-qa tag applied to the content\n */\n content?: string;\n /**\n * Data-qa tag applied to the main modal\n */\n modal?: string;\n /**\n * Data-qa tag applied to the title\n */\n title?: string;\n}\n\nexport interface AoaModalProps {\n /**\n * Any other props passed to the {@link DialogContent}\n */\n readonly DialogContentProps?: DialogContentProps;\n /**\n * Any other props passed to the {@link Dialog}\n */\n readonly DialogProps?: Omit<DialogProps, 'open'>;\n /**\n * Any other props passed to the {@link DialogTitle}\n */\n readonly DialogTitleProps?: DialogTitleProps;\n /**\n * Optional for adding dialog actions below the content\n */\n readonly dialogActions?: ReactNode;\n /**\n * The content to show in the modal\n */\n readonly dialogContent: ReactNode;\n /**\n * Object of data-qa tags to pass to the modal\n */\n readonly modalQas?: AoaModalQAs;\n /**\n * Whether the modal should be opened or not\n */\n readonly open: boolean;\n /**\n * Title for the modal\n */\n readonly topic: string;\n}\n\n/**\n * Constructs a modal using pre-defined Rijkswaterstaat styling\n *\n * @param props - Props to pass to the modal - {@link ModalProps}\n * @example\n * ```jsx\n * <AoaModal\n * topic='topic'\n * modalQas={{\n * modal: 'modal',\n * content: 'content',\n * title: 'title',\n * }}\n * dialogContent={<div>SAMPLE</div>}\n * open={true}\n * />\n * ```\n */\nexport const AoaModal = memo(\n ({\n DialogProps,\n DialogTitleProps,\n DialogContentProps,\n modalQas,\n open,\n topic,\n dialogContent,\n dialogActions,\n closeAction\n }: AoaModalCloseButtonProps & AoaModalProps) => {\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 minWidth: '45vw'\n }\n },\n DialogProps?.sx\n )}\n >\n <DialogTitle\n {...DialogTitleProps}\n data-qa={modalQas?.title ?? 'modal-title'}\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 <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}\n </Dialog>\n );\n }\n);\n"],"names":["AoaModal","memo","DialogProps","DialogTitleProps","DialogContentProps","modalQas","open","topic","dialogContent","dialogActions","closeAction","jsxs","Dialog","merge","jsx","DialogTitle","AoaModal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1,22 +1,22 @@
1
- import { jsx as e, jsxs as b } from "react/jsx-runtime";
2
- import { AppBar as c, Toolbar as n, Box as d } from "@mui/material";
3
- import { m } from "../../../chunks/index.DJYQ_-zP.js";
1
+ import { jsx as o, jsxs as c } from "react/jsx-runtime";
2
+ import { AppBar as b, Toolbar as n, Box as d } from "@mui/material";
3
+ import { l as m } from "../../../chunks/lodash.DOeeRDpT.js";
4
4
  import { memo as g, useState as u, useEffect as s } from "react";
5
5
  import { FontNormalSxProps as x } from "../../../_constants.js";
6
6
  import { AoaMenuItem as l } from "../../atoms/_menu/menu-item/MenuItem.js";
7
- import { AoaUserMenu as w } from "../../atoms/_menu/user-menu/UserMenu.js";
8
- const I = g((r) => {
9
- const [o, a] = u(0);
7
+ import { AoaUserMenu as h } from "../../atoms/_menu/user-menu/UserMenu.js";
8
+ const R = g((r) => {
9
+ const [e, a] = u(0);
10
10
  return s(() => {
11
11
  const t = window.sessionStorage.getItem("activeMenuTab");
12
12
  t && a(JSON.parse(t));
13
13
  }, []), s(() => {
14
- window.sessionStorage.setItem("activeMenuTab", o.toString());
15
- }, [o]), /* @__PURE__ */ e(
16
- c,
14
+ window.sessionStorage.setItem("activeMenuTab", e.toString());
15
+ }, [e]), /* @__PURE__ */ o(
16
+ b,
17
17
  {
18
18
  position: "static",
19
- sx: m(
19
+ sx: m.merge(
20
20
  {
21
21
  color: "var(--color-text)",
22
22
  backgroundColor: "var(--color-rijks-yellow)",
@@ -25,7 +25,7 @@ const I = g((r) => {
25
25
  },
26
26
  x
27
27
  ),
28
- children: /* @__PURE__ */ b(
28
+ children: /* @__PURE__ */ c(
29
29
  n,
30
30
  {
31
31
  role: "menu",
@@ -39,7 +39,7 @@ const I = g((r) => {
39
39
  borderRadius: "4px",
40
40
  width: "6px",
41
41
  height: "6px",
42
- "-webkit-border-radius": "4px"
42
+ WebkitBorderRadius: "4px"
43
43
  },
44
44
  "::-webkit-scrollbar:hover": {
45
45
  background: "#c5c5c5;"
@@ -50,7 +50,7 @@ const I = g((r) => {
50
50
  "::-webkit-scrollbar-track": {
51
51
  opacity: 0,
52
52
  transition: "all 0.5s",
53
- "-webkit-transition": "all .5s"
53
+ WebkitTransition: "all .5s"
54
54
  },
55
55
  "::-webkit-scrollbar-thumb": {
56
56
  overflow: "visible",
@@ -60,35 +60,35 @@ const I = g((r) => {
60
60
  },
61
61
  "::-webkit-scrollbar-thumb:vertical": {
62
62
  background: "rgba(100, 100, 100, .5)",
63
- "-webkit-border-radius": "100px"
63
+ WebkitBorderRadius: "100px"
64
64
  },
65
65
  "::-webkit-scrollbar-thumb:vertical:active": {
66
66
  background: "rgba(100, 100, 100, .61)",
67
- "-webkit-border-radius": "100px"
67
+ WebkitBorderRadius: "100px"
68
68
  }
69
69
  },
70
70
  tabIndex: 0,
71
71
  children: [
72
- /* @__PURE__ */ e(
72
+ /* @__PURE__ */ o(
73
73
  l,
74
74
  {
75
75
  index: 0,
76
76
  page: { label: r.name, to: r.homePath ?? "/" },
77
- selectedPage: o,
77
+ selectedPage: e,
78
78
  setSelectedPage: a
79
79
  }
80
80
  ),
81
- /* @__PURE__ */ e(d, { sx: { flexGrow: 1, display: "flex", height: "100%" }, children: r.pages.map((t, i) => /* @__PURE__ */ e(
81
+ /* @__PURE__ */ o(d, { sx: { flexGrow: 1, display: "flex", height: "100%" }, children: r.pages.map((t, i) => /* @__PURE__ */ o(
82
82
  l,
83
83
  {
84
84
  index: i + 1,
85
85
  page: t,
86
- selectedPage: o,
86
+ selectedPage: e,
87
87
  setSelectedPage: a
88
88
  },
89
89
  i
90
90
  )) }),
91
- /* @__PURE__ */ e(w, { settings: r.settings, username: r.username })
91
+ /* @__PURE__ */ o(h, { settings: r.settings, username: r.username })
92
92
  ]
93
93
  }
94
94
  )
@@ -96,6 +96,6 @@ const I = g((r) => {
96
96
  );
97
97
  });
98
98
  export {
99
- I as AoaNavigationBar
99
+ R as AoaNavigationBar
100
100
  };
101
101
  //# sourceMappingURL=NavigationBar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationBar.js","sources":["../../../../src/components/molecules/navigation-bar/NavigationBar.tsx"],"sourcesContent":["import { AppBar, Box, Toolbar } from '@mui/material';\nimport merge from 'lodash.merge';\nimport { memo, useEffect, useState, type ReactNode } from 'react';\nimport { FontNormalSxProps } from '../../../_constants';\nimport { AoaMenuItem, type AoaPage } from '../../atoms/_menu/menu-item/MenuItem';\nimport { AoaUserMenu, type AoaSetting } from '../../atoms/_menu/user-menu/UserMenu';\n\nexport interface AoaNavigationBarProps {\n /**\n * If your home page is not on the root url, use this prop to set the home path\n */\n readonly homePath?: string;\n /**\n * The name of the application that will be used for the Home tab\n */\n readonly name: string;\n /**\n * A list of all the pages and optional subpages to be shown in the menu\n */\n readonly pages: AoaPage[];\n /**\n * A list of all the settings to be shown in the menu\n */\n readonly settings: AoaSetting[];\n /**\n * Optional username to be displayed next to the settings menu\n */\n readonly username?: string;\n}\n\n/**\n * Constructs a navigation bar using pre-defined Rijks styling\n *\n * @param props - Props to pass to the navigation bar\n * @example\n * ```jsx\n * <AoaNavigationBar\n * name=\"Demo App\"\n * pages={\n * [\n * {\n * label: \"Products\",\n * to: \"/products\",\n * subItems: [\n * {\n * label: \"Books\",\n * to: \"/books\",\n * icon: <BookIcon />\n * }\n * ]\n * }\n * ]\n * }\n * settings={[{ label: \"Logout\", onClick: () => console.log(\"Logout\") }]}\n * />\n * ```\n */\n\nexport const AoaNavigationBar = memo((props: AoaNavigationBarProps): ReactNode => {\n const [selectedPage, setSelectedPage] = useState<number>(0);\n\n useEffect(() => {\n const sessionStorage = window.sessionStorage.getItem('activeMenuTab');\n if (sessionStorage) {\n setSelectedPage(JSON.parse(sessionStorage));\n }\n }, []);\n\n useEffect(() => {\n window.sessionStorage.setItem('activeMenuTab', selectedPage.toString());\n }, [selectedPage]);\n\n return (\n <AppBar\n position='static'\n sx={merge(\n {\n color: 'var(--color-text)',\n backgroundColor: 'var(--color-rijks-yellow)',\n height: '70px',\n boxShadow: 'none'\n },\n FontNormalSxProps\n )}\n >\n <Toolbar\n role='menu'\n sx={{\n height: '100%',\n overflowX: 'scroll',\n scrollbarWidth: 'thin',\n scrollbarColor: '#c5c5c5 #f6f6f6',\n\n '::-webkit-scrollbar': {\n overflow: 'visible',\n borderRadius: '4px',\n width: '6px',\n height: '6px',\n '-webkit-border-radius': '4px'\n },\n\n '::-webkit-scrollbar:hover': {\n background: '#c5c5c5;'\n },\n\n '::-webkit-scrollbar-corner': {\n background: 'rgba(0,0,0,0.5)'\n },\n\n '::-webkit-scrollbar-track': {\n opacity: 0,\n transition: 'all 0.5s',\n '-webkit-transition': 'all .5s'\n },\n\n '::-webkit-scrollbar-thumb': {\n overflow: 'visible',\n backgroundColor: '#c5c5c5;',\n borderRadius: '4px',\n border: '3px solid #f6f6f6'\n },\n\n '::-webkit-scrollbar-thumb:vertical': {\n background: 'rgba(100, 100, 100, .5)',\n '-webkit-border-radius': '100px'\n },\n\n '::-webkit-scrollbar-thumb:vertical:active': {\n background: 'rgba(100, 100, 100, .61)',\n '-webkit-border-radius': '100px'\n }\n }}\n tabIndex={0}\n >\n <AoaMenuItem\n index={0}\n page={{ label: props.name, to: props.homePath ?? '/' }}\n selectedPage={selectedPage}\n setSelectedPage={setSelectedPage}\n />\n <Box sx={{ flexGrow: 1, display: 'flex', height: '100%' }}>\n {props.pages.map((page, index) => (\n <AoaMenuItem\n index={index + 1}\n key={index}\n page={page}\n selectedPage={selectedPage}\n setSelectedPage={setSelectedPage}\n />\n ))}\n </Box>\n <AoaUserMenu settings={props.settings} username={props.username} />\n </Toolbar>\n </AppBar>\n );\n});\n"],"names":["AoaNavigationBar","memo","props","selectedPage","setSelectedPage","useState","useEffect","sessionStorage","jsx","AppBar","merge","FontNormalSxProps","jsxs","Toolbar","AoaMenuItem","Box","page","index","AoaUserMenu"],"mappings":";;;;;;;AA0Da,MAAAA,IAAmBC,EAAK,CAACC,MAA4C;AAChF,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAiB,CAAC;AA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cAACM;AAAA,cAAA;AAAA,gBACC,OAAO;AAAA,gBACP,MAAM,EAAE,OAAOZ,EAAM,MAAM,IAAIA,EAAM,YAAY,IAAI;AAAA,gBACrD,cAAAC;AAAA,gBACA,iBAAAC;AAAA,cAAA;AAAA,YACF;AAAA,8BACCW,GAAI,EAAA,IAAI,EAAE,UAAU,GAAG,SAAS,QAAQ,QAAQ,UAC9C,UAAMb,EAAA,MAAM,IAAI,CAACc,GAAMC,MACtB,gBAAAT;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,OAAOG,IAAQ;AAAA,gBAEf,MAAAD;AAAA,gBACA,cAAAb;AAAA,gBACA,iBAAAC;AAAA,cAAA;AAAA,cAHKa;AAAA,YAKR,CAAA,GACH;AAAA,8BACCC,GAAY,EAAA,UAAUhB,EAAM,UAAU,UAAUA,EAAM,SAAU,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACnE;AAAA,EACF;AAEJ,CAAC;"}
1
+ {"version":3,"file":"NavigationBar.js","sources":["../../../../src/components/molecules/navigation-bar/NavigationBar.tsx"],"sourcesContent":["import { AppBar, Box, Toolbar } from '@mui/material';\nimport { merge } from 'lodash';\nimport { memo, useEffect, useState, type ReactNode } from 'react';\nimport { FontNormalSxProps } from '../../../_constants';\nimport { AoaMenuItem, type AoaPage } from '../../atoms/_menu/menu-item/MenuItem';\nimport { AoaUserMenu, type AoaSetting } from '../../atoms/_menu/user-menu/UserMenu';\n\nexport interface AoaNavigationBarProps {\n /**\n * If your home page is not on the root url, use this prop to set the home path\n */\n readonly homePath?: string;\n /**\n * The name of the application that will be used for the Home tab\n */\n readonly name: string;\n /**\n * A list of all the pages and optional subpages to be shown in the menu\n */\n readonly pages: AoaPage[];\n /**\n * A list of all the settings to be shown in the menu\n */\n readonly settings: AoaSetting[];\n /**\n * Optional username to be displayed next to the settings menu\n */\n readonly username?: string;\n}\n\n/**\n * Constructs a navigation bar using pre-defined Rijks styling\n *\n * @param props - Props to pass to the navigation bar\n * @example\n * ```jsx\n * <AoaNavigationBar\n * name=\"Demo App\"\n * pages={\n * [\n * {\n * label: \"Products\",\n * to: \"/products\",\n * subItems: [\n * {\n * label: \"Books\",\n * to: \"/books\",\n * icon: <BookIcon />\n * }\n * ]\n * }\n * ]\n * }\n * settings={[{ label: \"Logout\", onClick: () => console.log(\"Logout\") }]}\n * />\n * ```\n */\n\nexport const AoaNavigationBar = memo((props: AoaNavigationBarProps): ReactNode => {\n const [selectedPage, setSelectedPage] = useState<number>(0);\n\n useEffect(() => {\n const sessionStorage = window.sessionStorage.getItem('activeMenuTab');\n if (sessionStorage) {\n setSelectedPage(JSON.parse(sessionStorage));\n }\n }, []);\n\n useEffect(() => {\n window.sessionStorage.setItem('activeMenuTab', selectedPage.toString());\n }, [selectedPage]);\n\n return (\n <AppBar\n position='static'\n sx={merge(\n {\n color: 'var(--color-text)',\n backgroundColor: 'var(--color-rijks-yellow)',\n height: '70px',\n boxShadow: 'none'\n },\n FontNormalSxProps\n )}\n >\n <Toolbar\n role='menu'\n sx={{\n height: '100%',\n overflowX: 'scroll',\n scrollbarWidth: 'thin',\n scrollbarColor: '#c5c5c5 #f6f6f6',\n\n '::-webkit-scrollbar': {\n overflow: 'visible',\n borderRadius: '4px',\n width: '6px',\n height: '6px',\n WebkitBorderRadius: '4px'\n },\n\n '::-webkit-scrollbar:hover': {\n background: '#c5c5c5;'\n },\n\n '::-webkit-scrollbar-corner': {\n background: 'rgba(0,0,0,0.5)'\n },\n\n '::-webkit-scrollbar-track': {\n opacity: 0,\n transition: 'all 0.5s',\n WebkitTransition: 'all .5s'\n },\n\n '::-webkit-scrollbar-thumb': {\n overflow: 'visible',\n backgroundColor: '#c5c5c5;',\n borderRadius: '4px',\n border: '3px solid #f6f6f6'\n },\n\n '::-webkit-scrollbar-thumb:vertical': {\n background: 'rgba(100, 100, 100, .5)',\n WebkitBorderRadius: '100px'\n },\n\n '::-webkit-scrollbar-thumb:vertical:active': {\n background: 'rgba(100, 100, 100, .61)',\n WebkitBorderRadius: '100px'\n }\n }}\n tabIndex={0}\n >\n <AoaMenuItem\n index={0}\n page={{ label: props.name, to: props.homePath ?? '/' }}\n selectedPage={selectedPage}\n setSelectedPage={setSelectedPage}\n />\n <Box sx={{ flexGrow: 1, display: 'flex', height: '100%' }}>\n {props.pages.map((page, index) => (\n <AoaMenuItem\n index={index + 1}\n key={index}\n page={page}\n selectedPage={selectedPage}\n setSelectedPage={setSelectedPage}\n />\n ))}\n </Box>\n <AoaUserMenu settings={props.settings} username={props.username} />\n </Toolbar>\n </AppBar>\n );\n});\n"],"names":["AoaNavigationBar","memo","props","selectedPage","setSelectedPage","useState","useEffect","sessionStorage","jsx","AppBar","merge","FontNormalSxProps","jsxs","Toolbar","AoaMenuItem","Box","page","index","AoaUserMenu"],"mappings":";;;;;;;AA0Da,MAAAA,IAAmBC,EAAK,CAACC,MAA4C;AAChF,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAiB,CAAC;AAE1D,SAAAC,EAAU,MAAM;AACd,UAAMC,IAAiB,OAAO,eAAe,QAAQ,eAAe;AACpE,IAAIA,KACcH,EAAA,KAAK,MAAMG,CAAc,CAAC;AAAA,EAE9C,GAAG,EAAE,GAELD,EAAU,MAAM;AACd,WAAO,eAAe,QAAQ,iBAAiBH,EAAa,UAAU;AAAA,EAAA,GACrE,CAACA,CAAY,CAAC,GAGf,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,UAAS;AAAA,MACT,IAAIC,EAAA;AAAA,QACF;AAAA,UACE,OAAO;AAAA,UACP,iBAAiB;AAAA,UACjB,QAAQ;AAAA,UACR,WAAW;AAAA,QACb;AAAA,QACAC;AAAA,MACF;AAAA,MAEA,UAAA,gBAAAC;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,IAAI;AAAA,YACF,QAAQ;AAAA,YACR,WAAW;AAAA,YACX,gBAAgB;AAAA,YAChB,gBAAgB;AAAA,YAEhB,uBAAuB;AAAA,cACr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3,"file":"UploadButton.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/upload-button/UploadButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3E,MAAM,WAAW,oBAAoB,CAAC,KAAK,CAAE,SAAQ,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,WAAW,GAAG,MAAM,CAAC;IAC1G;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IAEnC;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAEpD;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;CACzC;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,EACrC,WAAW,EACX,UAAU,EACV,QAAQ,EACR,EAAE,EACF,eAAe,EACf,IAAI,EACJ,KAAK,EACL,cAAc,EACd,OAAO,EACP,GAAG,KAAK,EACT,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,2CAgBhD"}
1
+ {"version":3,"file":"UploadButton.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/upload-button/UploadButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3E,MAAM,WAAW,oBAAoB,CAAC,KAAK,CAAE,SAAQ,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,WAAW,GAAG,MAAM,CAAC;IAC1G;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IAEnC;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAEpD;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;CACzC;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,EACrC,WAAW,EACX,UAAU,EACV,QAAQ,EACR,EAAE,EACF,eAAe,EACf,IAAI,EACJ,KAAK,EACL,cAAc,EACd,OAAO,EACP,GAAG,KAAK,EACT,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,2CAkBhD"}
@@ -1,35 +1,37 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { CircularProgress as f } from "@mui/material";
3
- import { m as g } from "../../../chunks/index.DJYQ_-zP.js";
4
- import { AoaButton as b } from "../../atoms/button/Button.js";
5
- function h({
6
- isUploading: t,
7
- isDisabled: e,
8
- children: a,
9
- sx: m,
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { CircularProgress as g } from "@mui/material";
3
+ import { l as f } from "../../../chunks/lodash.DOeeRDpT.js";
4
+ import { AoaButton as u } from "../../atoms/button/Button.js";
5
+ function B({
6
+ isUploading: o,
7
+ isDisabled: a,
8
+ children: e,
9
+ sx: i,
10
10
  isNeverDisabled: s,
11
- type: i,
12
- files: p,
13
- setIsUploading: l,
11
+ type: m,
12
+ files: l,
13
+ setIsUploading: n,
14
14
  onClick: r,
15
- ...n
15
+ ...p
16
16
  }) {
17
- return /* @__PURE__ */ o(
18
- b,
17
+ return /* @__PURE__ */ t(
18
+ u,
19
19
  {
20
- ...n,
21
- disabled: s ? !1 : !!e || t || Object.keys(p ?? []).length < 1,
22
- onClick: (u) => {
23
- l(!0), r == null || r(u);
20
+ ...p,
21
+ disabled: s ? !1 : !!a || o || Object.keys(l ?? []).length < 1,
22
+ loading: o,
23
+ loadingIndicator: /* @__PURE__ */ t(g, { "aria-label": "Uploading...", size: 20 }),
24
+ loadingPosition: "start",
25
+ onClick: (d) => {
26
+ n(!0), r == null || r(d);
24
27
  },
25
- startIcon: t ? /* @__PURE__ */ o(f, { "aria-label": "Uploading...", size: 20 }) : null,
26
- sx: g({ marginRight: 0 }, m),
27
- type: i ?? "primary",
28
- children: a
28
+ sx: f.merge({ marginRight: 0 }, i),
29
+ type: m ?? "primary",
30
+ children: e
29
31
  }
30
32
  );
31
33
  }
32
34
  export {
33
- h as AoaUploadButton
35
+ B as AoaUploadButton
34
36
  };
35
37
  //# sourceMappingURL=UploadButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UploadButton.js","sources":["../../../../src/components/molecules/upload-button/UploadButton.tsx"],"sourcesContent":["import { CircularProgress } from '@mui/material';\nimport merge from 'lodash.merge';\nimport type { PropsWithChildren } from 'react';\nimport { AoaButton, type AoaButtonProps } from '../../atoms/button/Button';\n\nexport interface AoaUploadButtonProps<TData> extends Omit<AoaButtonProps, 'disabled' | 'startIcon' | 'type'> {\n /**\n * The files that should be checked, required if {@link AoaUploadButtonProps.noFilesAllowed} is `false`\n */\n readonly files?: TData[];\n /**\n * Whether the button should be disabled\n */\n readonly isDisabled?: boolean;\n /**\n * Whether the button should never be disabled.\n * - If `true` the button never goes into a `disabled` state, regardless of other conditions\n * - If `false` the button will be disabled if there are no files provided\n * (through {@link AoaUploadButtonProps.files | `files`}), or the upload progress is running\n */\n readonly isNeverDisabled?: boolean;\n\n /**\n * Whether the upload process is running. This controls whether a spinner is shown and the button is disabled\n */\n readonly isUploading: boolean;\n /**\n * The action to change {@link AoaUploadButtonProps.isUploading | `isUploading`} to `true`\n *\n * @param newState - The new state of the `isUploading` flag\n */\n setIsUploading(this: void, newState: boolean): void;\n\n /**\n * The type of the button. This _cannot_ be a `text` style button like the base {@link AoaButton}\n */\n readonly type?: 'primary' | 'secondary';\n}\n\nexport function AoaUploadButton<TData>({\n isUploading,\n isDisabled,\n children,\n sx,\n isNeverDisabled,\n type,\n files,\n setIsUploading,\n onClick,\n ...props\n}: PropsWithChildren<AoaUploadButtonProps<TData>>) {\n return (\n <AoaButton\n {...props}\n disabled={isNeverDisabled ? false : Boolean(isDisabled) || isUploading || Object.keys(files ?? []).length < 1}\n onClick={(event) => {\n setIsUploading(true);\n onClick?.(event);\n }}\n startIcon={isUploading ? <CircularProgress aria-label='Uploading...' size={20} /> : null}\n sx={merge({ marginRight: 0 }, sx)}\n type={type ?? 'primary'}\n >\n {children}\n </AoaButton>\n );\n}\n"],"names":["AoaUploadButton","isUploading","isDisabled","children","sx","isNeverDisabled","type","files","setIsUploading","onClick","props","jsx","AoaButton","event","CircularProgress","merge"],"mappings":";;;;AAuCO,SAASA,EAAuB;AAAA,EACrC,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,IAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGC;AACL,GAAmD;AAE/C,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACE,GAAGF;AAAA,MACJ,UAAUL,IAAkB,KAAQ,EAAQH,KAAeD,KAAe,OAAO,KAAKM,KAAS,EAAE,EAAE,SAAS;AAAA,MAC5G,SAAS,CAACM,MAAU;AAClB,QAAAL,EAAe,EAAI,GACnBC,KAAA,QAAAA,EAAUI;AAAA,MACZ;AAAA,MACA,WAAWZ,IAAe,gBAAAU,EAAAG,GAAA,EAAiB,cAAW,gBAAe,MAAM,GAAI,CAAA,IAAK;AAAA,MACpF,IAAIC,EAAM,EAAE,aAAa,EAAA,GAAKX,CAAE;AAAA,MAChC,MAAME,KAAQ;AAAA,MAEb,UAAAH;AAAA,IAAA;AAAA,EACH;AAEJ;"}
1
+ {"version":3,"file":"UploadButton.js","sources":["../../../../src/components/molecules/upload-button/UploadButton.tsx"],"sourcesContent":["import { CircularProgress } from '@mui/material';\nimport { merge } from 'lodash';\nimport type { PropsWithChildren } from 'react';\nimport { AoaButton, type AoaButtonProps } from '../../atoms/button/Button';\n\nexport interface AoaUploadButtonProps<TData> extends Omit<AoaButtonProps, 'disabled' | 'startIcon' | 'type'> {\n /**\n * The files that should be checked, required if {@link AoaUploadButtonProps.noFilesAllowed} is `false`\n */\n readonly files?: TData[];\n /**\n * Whether the button should be disabled\n */\n readonly isDisabled?: boolean;\n /**\n * Whether the button should never be disabled.\n * - If `true` the button never goes into a `disabled` state, regardless of other conditions\n * - If `false` the button will be disabled if there are no files provided\n * (through {@link AoaUploadButtonProps.files | `files`}), or the upload progress is running\n */\n readonly isNeverDisabled?: boolean;\n\n /**\n * Whether the upload process is running. This controls whether a spinner is shown and the button is disabled\n */\n readonly isUploading: boolean;\n /**\n * The action to change {@link AoaUploadButtonProps.isUploading | `isUploading`} to `true`\n *\n * @param newState - The new state of the `isUploading` flag\n */\n setIsUploading(this: void, newState: boolean): void;\n\n /**\n * The type of the button. This _cannot_ be a `text` style button like the base {@link AoaButton}\n */\n readonly type?: 'primary' | 'secondary';\n}\n\nexport function AoaUploadButton<TData>({\n isUploading,\n isDisabled,\n children,\n sx,\n isNeverDisabled,\n type,\n files,\n setIsUploading,\n onClick,\n ...props\n}: PropsWithChildren<AoaUploadButtonProps<TData>>) {\n return (\n <AoaButton\n {...props}\n disabled={isNeverDisabled ? false : Boolean(isDisabled) || isUploading || Object.keys(files ?? []).length < 1}\n loading={isUploading}\n loadingIndicator={<CircularProgress aria-label='Uploading...' size={20} />}\n loadingPosition='start'\n onClick={(event) => {\n setIsUploading(true);\n onClick?.(event);\n }}\n sx={merge({ marginRight: 0 }, sx)}\n type={type ?? 'primary'}\n >\n {children}\n </AoaButton>\n );\n}\n"],"names":["AoaUploadButton","isUploading","isDisabled","children","sx","isNeverDisabled","type","files","setIsUploading","onClick","props","jsx","AoaButton","CircularProgress","event","merge"],"mappings":";;;;AAuCO,SAASA,EAAuB;AAAA,EACrC,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,IAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGC;AACL,GAAmD;AAE/C,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACE,GAAGF;AAAA,MACJ,UAAUL,IAAkB,KAAQ,EAAQH,KAAeD,KAAe,OAAO,KAAKM,KAAS,EAAE,EAAE,SAAS;AAAA,MAC5G,SAASN;AAAA,MACT,kBAAmB,gBAAAU,EAAAE,GAAA,EAAiB,cAAW,gBAAe,MAAM,IAAI;AAAA,MACxE,iBAAgB;AAAA,MAChB,SAAS,CAACC,MAAU;AAClB,QAAAN,EAAe,EAAI,GACnBC,KAAA,QAAAA,EAAUK;AAAA,MACZ;AAAA,MACA,IAAIC,EAAAA,MAAM,EAAE,aAAa,EAAA,GAAKX,CAAE;AAAA,MAChC,MAAME,KAAQ;AAAA,MAEb,UAAAH;AAAA,IAAA;AAAA,EACH;AAEJ;"}
@@ -0,0 +1,29 @@
1
+ import { AoaFieldError } from '../components/molecules/field-error/FieldError';
2
+ import { AoaFormError } from '../components/molecules/form-error/FormError';
3
+ import { AoaFormModal } from '../components/molecules/form-modal/FormModal';
4
+ export declare const aoaFieldContext: import('react').Context<import('@tanstack/form-core').AnyFieldApi>, aoaFormContext: import('react').Context<import('@tanstack/form-core').AnyFormApi>, useAoaFieldContext: <TData>() => import('@tanstack/form-core').FieldApi<any, string, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>, useAoaFormContext: () => import('@tanstack/react-form').ReactFormExtendedApi<Record<string, never>, any, any, any, any, any, any, any, any, any>;
5
+ export declare const useAoaAppForm: <TFormData, TOnMount extends import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined, TOnChange extends import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends import('@tanstack/form-core').FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends import('@tanstack/form-core').FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends import('@tanstack/form-core').FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends import('@tanstack/form-core').FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta>(props: import('@tanstack/form-core').FormOptions<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta>) => import('@tanstack/form-core').FormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta> & import('@tanstack/react-form').ReactFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta> & NoInfer<{
6
+ readonly AoaFormModal: typeof AoaFormModal;
7
+ readonly AoaFormError: typeof AoaFormError;
8
+ }> & {
9
+ AppField: import('@tanstack/react-form').FieldComponent<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta, NoInfer<{
10
+ readonly AoaFieldError: typeof AoaFieldError;
11
+ }>>;
12
+ AppForm: import('react').ComponentType<import('react').PropsWithChildren>;
13
+ }, withAoaForm: <TFormData, TOnMount extends import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined, TOnChange extends import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends import('@tanstack/form-core').FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends import('@tanstack/form-core').FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends import('@tanstack/form-core').FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends import('@tanstack/form-core').FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta, TRenderProps extends Record<string, unknown> = {}>({ render, props, }: import('@tanstack/react-form').WithFormProps<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta, {
14
+ readonly AoaFieldError: typeof AoaFieldError;
15
+ }, {
16
+ readonly AoaFormModal: typeof AoaFormModal;
17
+ readonly AoaFormError: typeof AoaFormError;
18
+ }, TRenderProps>) => (props: import('react').PropsWithChildren<NoInfer<[unknown] extends [TRenderProps] ? any : TRenderProps> & {
19
+ form: import('@tanstack/form-core').FormApi<[unknown] extends [TFormData] ? any : TFormData, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnMount] ? [TOnMount] extends [TOnMount & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnMount : TOnMount, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnChange] ? [TOnChange] extends [TOnChange & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnChange : TOnChange, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnChangeAsync] ? [TOnChangeAsync] extends [TOnChangeAsync & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnChangeAsync : TOnChangeAsync, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnBlur] ? [TOnBlur] extends [TOnBlur & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlur : TOnBlur, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnBlurAsync] ? [TOnBlurAsync] extends [TOnBlurAsync & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlurAsync : TOnBlurAsync, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnSubmit] ? [TOnSubmit] extends [TOnSubmit & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmit : TOnSubmit, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnSubmitAsync] ? [TOnSubmitAsync] extends [TOnSubmitAsync & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmitAsync : TOnSubmitAsync, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnServer] ? [TOnServer] extends [TOnServer & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnServer : TOnServer, [unknown] extends [TSubmitMeta] ? any : TSubmitMeta> & import('@tanstack/react-form').ReactFormApi<[unknown] extends [TFormData] ? any : TFormData, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnMount] ? [TOnMount] extends [TOnMount & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnMount : TOnMount, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnChange] ? [TOnChange] extends [TOnChange & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnChange : TOnChange, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnChangeAsync] ? [TOnChangeAsync] extends [TOnChangeAsync & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnChangeAsync : TOnChangeAsync, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnBlur] ? [TOnBlur] extends [TOnBlur & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlur : TOnBlur, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnBlurAsync] ? [TOnBlurAsync] extends [TOnBlurAsync & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlurAsync : TOnBlurAsync, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnSubmit] ? [TOnSubmit] extends [TOnSubmit & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmit : TOnSubmit, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnSubmitAsync] ? [TOnSubmitAsync] extends [TOnSubmitAsync & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmitAsync : TOnSubmitAsync, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnServer] ? [TOnServer] extends [TOnServer & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnServer : TOnServer, [unknown] extends [TSubmitMeta] ? any : TSubmitMeta> & NoInfer<{
20
+ readonly AoaFormModal: typeof AoaFormModal;
21
+ readonly AoaFormError: typeof AoaFormError;
22
+ }> & {
23
+ AppField: import('@tanstack/react-form').FieldComponent<[unknown] extends [TFormData] ? any : TFormData, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnMount] ? [TOnMount] extends [TOnMount & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnMount : TOnMount, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnChange] ? [TOnChange] extends [TOnChange & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnChange : TOnChange, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnChangeAsync] ? [TOnChangeAsync] extends [TOnChangeAsync & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnChangeAsync : TOnChangeAsync, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnBlur] ? [TOnBlur] extends [TOnBlur & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlur : TOnBlur, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnBlurAsync] ? [TOnBlurAsync] extends [TOnBlurAsync & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlurAsync : TOnBlurAsync, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnSubmit] ? [TOnSubmit] extends [TOnSubmit & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmit : TOnSubmit, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnSubmitAsync] ? [TOnSubmitAsync] extends [TOnSubmitAsync & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmitAsync : TOnSubmitAsync, [import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined] extends [TOnServer] ? [TOnServer] extends [TOnServer & (import('@tanstack/form-core').FormValidateOrFn<TFormData> | undefined)] ? any : TOnServer : TOnServer, [unknown] extends [TSubmitMeta] ? any : TSubmitMeta, NoInfer<{
24
+ readonly AoaFieldError: typeof AoaFieldError;
25
+ }>>;
26
+ AppForm: import('react').ComponentType<import('react').PropsWithChildren>;
27
+ };
28
+ }>) => import("react").JSX.Element;
29
+ //# sourceMappingURL=TanstackFormContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TanstackFormContext.d.ts","sourceRoot":"","sources":["../../src/contexts/TanstackFormContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAE5E,eAAO,MACS,eAAe,sEAChB,cAAc,qEACV,kBAAkB,2JACnB,iBAAiB,+HACP,CAAC;AAE7B,eAAO,MAAoB,aAAa;;;;;;;;GAAY,WAAW;;;;;;;;;;;;;;;kCAU7D,CAAC"}
@@ -0,0 +1,11 @@
1
+ import "@tanstack/react-form";
2
+ import { c as t, d as s, u as r, e as m, f as F, w as x } from "../chunks/FieldError.DAUtZvvC.js";
3
+ export {
4
+ t as aoaFieldContext,
5
+ s as aoaFormContext,
6
+ r as useAoaAppForm,
7
+ m as useAoaFieldContext,
8
+ F as useAoaFormContext,
9
+ x as withAoaForm
10
+ };
11
+ //# sourceMappingURL=TanstackFormContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TanstackFormContext.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export { AoaRadioButton, type AoaRadioButtonProps } from './components/atoms/sel
12
12
  export { AoaSwitchButton, type AoaSwitchButtonProps } from './components/atoms/selection-buttons/switch-button/SwitchButton';
13
13
  export { AoaTable, type AoaTableColumns, type AoaTableData, type AoaTableProps, type AoaTableQueryOptions } from './components/atoms/table/Table';
14
14
  export { AoaZeroWidthSpace } from './components/atoms/zero-width-space/ZeroWidthSpace';
15
+ export { AoaFieldError, type AoaFieldErrorProps } from './components/molecules/field-error/FieldError';
15
16
  export { AoaFileDropzone, type AoaDropableFile, type AoaFileDropzoneDataQas, type AoaFileDropzoneProps } from './components/molecules/file-dropzone/FileDropzone';
16
17
  export { AoaFileTable, type AoaFileTableProps } from './components/molecules/file-table/FileTable';
17
18
  export { AoaFormError, type AoaFormErrorProps } from './components/molecules/form-error/FormError';
@@ -21,4 +22,5 @@ export { AoaModal, type AoaModalProps, type AoaModalQAs } from './components/mol
21
22
  export { AoaNavigationBar, type AoaNavigationBarProps } from './components/molecules/navigation-bar/NavigationBar';
22
23
  export { AoaUploadButton, type AoaUploadButtonProps } from './components/molecules/upload-button/UploadButton';
23
24
  export { AoaContentPage as AoaContentTemplate, type AoaContentPageProps as AoaContentTemplateProps } from './components/organisms/content-page/ContentPage';
25
+ export { aoaFieldContext, aoaFormContext, useAoaAppForm, useAoaFieldContext, useAoaFormContext, withAoaForm } from './contexts/TanstackFormContext';
24
26
  //# sourceMappingURL=index.d.ts.map