@rws-aoa/react-library 3.6.0 → 3.6.1

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.
@@ -27,6 +27,11 @@ export interface AoaFileDropzoneProps<TProps extends NonNullObject, TFile extend
27
27
  extensions: Accept;
28
28
  /** The toast warning message to be shown when a file is rejection */
29
29
  extensionWarning: string;
30
+ /**
31
+ * The toast warning message to be shown when the files to be uploaded exceeds the maximum,
32
+ * required if {@link AoaFileDropzoneProps.maxUploadFiles maxUploadFiles} is specified.
33
+ */
34
+ maxUploadSizeExceededWarning?: string;
30
35
  /** The children to show inside the box where files can be dropped */
31
36
  fileDropChildren?: ReactNode;
32
37
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"FileDropzone.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/file-dropzone/FileDropzone.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAe,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAe,KAAK,MAAM,EAAsC,MAAM,gBAAgB,CAAC;AAI9F,MAAM,MAAM,eAAe,CAAC,MAAM,SAAS,aAAa,IAAI,MAAM,GAAG;IACnE,gCAAgC;IAChC,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACrC,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB,CAAC,MAAM,SAAS,aAAa,EAAE,KAAK,SAAS,eAAe,CAAC,MAAM,CAAC;IACvG,sFAAsF;IACtF,YAAY,EAAE,KAAK,EAAE,CAAC;IACtB;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IACjC,+FAA+F;IAC/F,cAAc,EAAE,MAAM,CAAC;IACvB,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,gBAAgB,EAAE,MAAM,CAAC;IACzB,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B;;;;OAIG;IACH,mBAAmB,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC;IAC1C,qGAAqG;IACrG,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,iBAAiB,CAAC,CAAC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC;IAC/C,qDAAqD;IACrD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,+BAA+B;IAC/B,OAAO,CAAC,EAAE,sBAAsB,CAAC;CAClC;AAED,wBAAgB,eAAe,CAAC,MAAM,SAAS,aAAa,EAAE,KAAK,SAAS,eAAe,CAAC,MAAM,CAAC,EACjG,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,2CA6ExE"}
1
+ {"version":3,"file":"FileDropzone.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/file-dropzone/FileDropzone.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAe,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAe,KAAK,MAAM,EAAsC,MAAM,gBAAgB,CAAC;AAI9F,MAAM,MAAM,eAAe,CAAC,MAAM,SAAS,aAAa,IAAI,MAAM,GAAG;IACnE,gCAAgC;IAChC,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACrC,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB,CAAC,MAAM,SAAS,aAAa,EAAE,KAAK,SAAS,eAAe,CAAC,MAAM,CAAC;IACvG,sFAAsF;IACtF,YAAY,EAAE,KAAK,EAAE,CAAC;IACtB;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IACjC,+FAA+F;IAC/F,cAAc,EAAE,MAAM,CAAC;IACvB,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B;;;;OAIG;IACH,mBAAmB,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC;IAC1C,qGAAqG;IACrG,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,iBAAiB,CAAC,CAAC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC;IAC/C,qDAAqD;IACrD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,+BAA+B;IAC/B,OAAO,CAAC,EAAE,sBAAsB,CAAC;CAClC;AAED,wBAAgB,eAAe,CAAC,MAAM,SAAS,aAAa,EAAE,KAAK,SAAS,eAAe,CAAC,MAAM,CAAC,EACjG,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,2CAiFxE"}
@@ -1,58 +1,58 @@
1
- import { jsxs as b, jsx as m } from "react/jsx-runtime";
2
- import { Box as s } from "@mui/material";
3
- import { useCallback as h } from "react";
4
- import { useDropzone as D } from "react-dropzone";
5
- import { toast as k } from "react-toastify";
6
- import { isExtensionAllowed as C } from "../../../_constants.js";
7
- function A(e) {
8
- var a, l;
9
- const f = h(
10
- (n, t) => {
1
+ import { jsxs as b, jsx as s } from "react/jsx-runtime";
2
+ import { Box as c } from "@mui/material";
3
+ import { useCallback as D } from "react";
4
+ import { useDropzone as U } from "react-dropzone";
5
+ import { toast as f } from "react-toastify";
6
+ import { isExtensionAllowed as k } from "../../../_constants.js";
7
+ function w(e) {
8
+ var l, o;
9
+ const x = D(
10
+ (t, a) => {
11
11
  var r, d;
12
- t.length > 0 && k(e.extensionWarning, { type: "warning" });
13
- const o = [...e.currentFiles];
14
- for (const i of n) {
15
- const c = o.findIndex((F) => F.file.name === i.name);
16
- c !== -1 ? o.splice(c, 1, {
17
- file: i,
18
- ...((r = e.perFileProperties) == null ? void 0 : r.call(e, i)) ?? {}
19
- }) : o.push({ file: i, ...((d = e.perFileProperties) == null ? void 0 : d.call(e, i)) ?? {} });
12
+ a.length > 0 && f(e.extensionWarning, { type: "warning" });
13
+ const i = [...e.currentFiles];
14
+ for (const n of t) {
15
+ const m = i.findIndex((h) => h.file.name === n.name);
16
+ m !== -1 ? i.splice(m, 1, {
17
+ file: n,
18
+ ...((r = e.perFileProperties) == null ? void 0 : r.call(e, n)) ?? {}
19
+ }) : i.push({ file: n, ...((d = e.perFileProperties) == null ? void 0 : d.call(e, n)) ?? {} });
20
20
  }
21
- e.storeFiles(o);
21
+ e.maxUploadFiles && i.length > e.maxUploadFiles && f(e.maxUploadFiles ?? `U heeft meer dan ${e.maxUploadFiles} bestand(en) geselecteerd. Dit is niet toegestaan.`, { type: "warning" }), e.storeFiles(i);
22
22
  },
23
23
  [e.extensionWarning, e.currentFiles, e.perFileProperties, e.storeFiles]
24
24
  );
25
- function u(n) {
26
- var t;
27
- return (t = e.customFileValidator) != null && t.call(e, n) ? {
25
+ function u(t) {
26
+ var a;
27
+ return (a = e.customFileValidator) != null && a.call(e, t) ? {
28
28
  code: "custom-validator",
29
29
  message: e.extensionWarning
30
- } : C(e.extensionRegex, n.name) ? null : {
30
+ } : k(e.extensionRegex, t.name) ? null : {
31
31
  code: "name-not-ok",
32
32
  message: e.extensionWarning
33
33
  };
34
34
  }
35
- const { getRootProps: x, getInputProps: g } = D({
36
- onDrop: f,
35
+ const { getRootProps: g, getInputProps: F } = U({
36
+ onDrop: x,
37
37
  disabled: e.isDisabled,
38
38
  accept: e.extensions,
39
39
  maxFiles: e.maxUploadFiles,
40
40
  validator: u
41
41
  });
42
42
  return /* @__PURE__ */ b(
43
- s,
43
+ c,
44
44
  {
45
- ...x(),
45
+ ...g(),
46
46
  sx: {
47
47
  "&:focus": {
48
48
  outline: "none"
49
49
  }
50
50
  },
51
- "data-qa": ((a = e.dataQas) == null ? void 0 : a.root) ?? "file-dropzone-root",
51
+ "data-qa": ((l = e.dataQas) == null ? void 0 : l.root) ?? "file-dropzone-root",
52
52
  children: [
53
- /* @__PURE__ */ m("input", { ...g(), "data-qa": ((l = e.dataQas) == null ? void 0 : l.input) ?? "file-drop-input" }),
54
- /* @__PURE__ */ m(
55
- s,
53
+ /* @__PURE__ */ s("input", { ...F(), "data-qa": ((o = e.dataQas) == null ? void 0 : o.input) ?? "file-drop-input" }),
54
+ /* @__PURE__ */ s(
55
+ c,
56
56
  {
57
57
  sx: {
58
58
  backgroundColor: "var(--color-rijks-grey-2)",
@@ -70,6 +70,6 @@ function A(e) {
70
70
  );
71
71
  }
72
72
  export {
73
- A as AoaFileDropzone
73
+ w as AoaFileDropzone
74
74
  };
75
75
  //# sourceMappingURL=FileDropzone.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileDropzone.js","sources":["../../../../src/components/molecules/file-dropzone/FileDropzone.tsx"],"sourcesContent":["/* eslint-disable no-unused-vars */\nimport { Box } from \"@mui/material\";\nimport type { NonNullObject } from \"@sapphire/utilities\";\nimport { useCallback, type PropsWithChildren, type ReactNode } from \"react\";\nimport { useDropzone, type Accept, type FileError, type FileRejection } from \"react-dropzone\";\nimport { toast } from \"react-toastify\";\nimport { isExtensionAllowed } from \"../../../_constants\";\n\nexport type AoaDropableFile<TProps extends NonNullObject> = TProps & {\n /** The file that was dropped */\n file: File;\n};\n\nexport interface AoaFileDropzoneDataQas {\n /** The data-qa tag for the root element */\n root: string;\n /** The data-qa tag for the input */\n input: string;\n}\n\nexport interface AoaFileDropzoneProps<TProps extends NonNullObject, TFile extends AoaDropableFile<TProps>> {\n /** The current set of files that are already dropped, coming from Redux or Zustand */\n currentFiles: TFile[];\n /**\n * The function to overwrite the files in the client store.\n * This should overwrite all files, not merge with current, which is handled in this component\n * @param files - The new set of files to be stored\n */\n storeFiles(files: TFile[]): void;\n /** The regular expression that validates if the dropped file should be accepted or rejected */\n extensionRegex: RegExp;\n /** The extension map to be passed to the dropzone component */\n extensions: Accept;\n /** The toast warning message to be shown when a file is rejection */\n extensionWarning: string;\n /** The children to show inside the box where files can be dropped */\n fileDropChildren?: ReactNode;\n /**\n * A custom function that can perform extra checks when validating files.\n * This should return `true` if the file should be rejected or `false` if it should be accepted\n * @param file - The file to be validated\n */\n customFileValidator?(file: File): boolean;\n /** A maximum count of files that should be accepted, if exceeded no save action will be performed */\n maxUploadFiles?: number;\n /** Additional properties to set for every file that is to be saved */\n perFileProperties?(acceptedFile: File): TProps;\n /** Whether the dropzone should be disabled or not */\n isDisabled?: boolean;\n /** data-qa tags for testing */\n dataQas?: AoaFileDropzoneDataQas;\n}\n\nexport function AoaFileDropzone<TProps extends NonNullObject, TFile extends AoaDropableFile<TProps>>(\n props: Readonly<PropsWithChildren<AoaFileDropzoneProps<TProps, TFile>>>\n) {\n const handleDrop = useCallback(\n (acceptedFiles: File[], fileRejections: FileRejection[]) => {\n if (fileRejections.length > 0) {\n toast(props.extensionWarning, { type: \"warning\" });\n }\n\n const filesClone = [...props.currentFiles];\n for (const acceptedFile of acceptedFiles) {\n const existingFileIndex = filesClone.findIndex((file) => file.file.name === acceptedFile.name);\n if (existingFileIndex !== -1) {\n filesClone.splice(existingFileIndex, 1, {\n file: acceptedFile,\n ...(props.perFileProperties?.(acceptedFile) ?? {})\n } as TFile & TProps);\n } else {\n filesClone.push({ file: acceptedFile, ...(props.perFileProperties?.(acceptedFile) ?? {}) } as TFile & TProps);\n }\n }\n\n props.storeFiles(filesClone);\n },\n [props.extensionWarning, props.currentFiles, props.perFileProperties, props.storeFiles]\n );\n\n function fileValidator(file: File): FileError | null {\n if (props.customFileValidator?.(file)) {\n return {\n code: \"custom-validator\",\n message: props.extensionWarning\n };\n }\n\n if (isExtensionAllowed(props.extensionRegex, file.name)) {\n return null;\n }\n\n return {\n code: \"name-not-ok\",\n message: props.extensionWarning\n };\n }\n\n const { getRootProps, getInputProps } = useDropzone({\n onDrop: handleDrop,\n disabled: props.isDisabled,\n accept: props.extensions,\n maxFiles: props.maxUploadFiles,\n validator: fileValidator\n });\n\n return (\n <Box\n {...getRootProps()}\n sx={{\n \"&:focus\": {\n outline: \"none\"\n }\n }}\n data-qa={props.dataQas?.root ?? \"file-dropzone-root\"}\n >\n <input {...getInputProps()} data-qa={props.dataQas?.input ?? \"file-drop-input\"} />\n <Box\n sx={{\n backgroundColor: \"var(--color-rijks-grey-2)\",\n borderWidth: 1,\n borderStyle: \"dashed\",\n borderColor: \"black\",\n marginBottom: 0.5,\n textAlign: \"center\"\n }}\n >\n {props.fileDropChildren}\n </Box>\n </Box>\n );\n}\n"],"names":["AoaFileDropzone","props","handleDrop","useCallback","acceptedFiles","fileRejections","toast","filesClone","acceptedFile","existingFileIndex","file","_a","_b","fileValidator","isExtensionAllowed","getRootProps","getInputProps","useDropzone","jsxs","Box","jsx"],"mappings":";;;;;;AAqDO,SAASA,EACdC,GACA;;AACA,QAAMC,IAAaC;AAAA,IACjB,CAACC,GAAuBC,MAAoC;;AACtD,MAAAA,EAAe,SAAS,KAC1BC,EAAML,EAAM,kBAAkB,EAAE,MAAM,UAAW,CAAA;AAGnD,YAAMM,IAAa,CAAC,GAAGN,EAAM,YAAY;AACzC,iBAAWO,KAAgBJ,GAAe;AAClC,cAAAK,IAAoBF,EAAW,UAAU,CAACG,MAASA,EAAK,KAAK,SAASF,EAAa,IAAI;AAC7F,QAAIC,MAAsB,KACbF,EAAA,OAAOE,GAAmB,GAAG;AAAA,UACtC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AAAA,cACF,iBAAiB;AAAA,cACjB,aAAa;AAAA,cACb,aAAa;AAAA,cACb,aAAa;AAAA,cACb,cAAc;AAAA,cACd,WAAW;AAAA,YACb;AAAA,YAEC,UAAMlB,EAAA;AAAA,UAAA;AAAA,QACT;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"FileDropzone.js","sources":["../../../../src/components/molecules/file-dropzone/FileDropzone.tsx"],"sourcesContent":["/* eslint-disable no-unused-vars */\nimport { Box } from \"@mui/material\";\nimport type { NonNullObject } from \"@sapphire/utilities\";\nimport { useCallback, type PropsWithChildren, type ReactNode } from \"react\";\nimport { useDropzone, type Accept, type FileError, type FileRejection } from \"react-dropzone\";\nimport { toast } from \"react-toastify\";\nimport { isExtensionAllowed } from \"../../../_constants\";\n\nexport type AoaDropableFile<TProps extends NonNullObject> = TProps & {\n /** The file that was dropped */\n file: File;\n};\n\nexport interface AoaFileDropzoneDataQas {\n /** The data-qa tag for the root element */\n root: string;\n /** The data-qa tag for the input */\n input: string;\n}\n\nexport interface AoaFileDropzoneProps<TProps extends NonNullObject, TFile extends AoaDropableFile<TProps>> {\n /** The current set of files that are already dropped, coming from Redux or Zustand */\n currentFiles: TFile[];\n /**\n * The function to overwrite the files in the client store.\n * This should overwrite all files, not merge with current, which is handled in this component\n * @param files - The new set of files to be stored\n */\n storeFiles(files: TFile[]): void;\n /** The regular expression that validates if the dropped file should be accepted or rejected */\n extensionRegex: RegExp;\n /** The extension map to be passed to the dropzone component */\n extensions: Accept;\n /** The toast warning message to be shown when a file is rejection */\n extensionWarning: string;\n /**\n * The toast warning message to be shown when the files to be uploaded exceeds the maximum,\n * required if {@link AoaFileDropzoneProps.maxUploadFiles maxUploadFiles} is specified.\n */\n maxUploadSizeExceededWarning?: string;\n /** The children to show inside the box where files can be dropped */\n fileDropChildren?: ReactNode;\n /**\n * A custom function that can perform extra checks when validating files.\n * This should return `true` if the file should be rejected or `false` if it should be accepted\n * @param file - The file to be validated\n */\n customFileValidator?(file: File): boolean;\n /** A maximum count of files that should be accepted, if exceeded no save action will be performed */\n maxUploadFiles?: number;\n /** Additional properties to set for every file that is to be saved */\n perFileProperties?(acceptedFile: File): TProps;\n /** Whether the dropzone should be disabled or not */\n isDisabled?: boolean;\n /** data-qa tags for testing */\n dataQas?: AoaFileDropzoneDataQas;\n}\n\nexport function AoaFileDropzone<TProps extends NonNullObject, TFile extends AoaDropableFile<TProps>>(\n props: Readonly<PropsWithChildren<AoaFileDropzoneProps<TProps, TFile>>>\n) {\n const handleDrop = useCallback(\n (acceptedFiles: File[], fileRejections: FileRejection[]) => {\n if (fileRejections.length > 0) {\n toast(props.extensionWarning, { type: \"warning\" });\n }\n\n const filesClone = [...props.currentFiles];\n for (const acceptedFile of acceptedFiles) {\n const existingFileIndex = filesClone.findIndex((file) => file.file.name === acceptedFile.name);\n if (existingFileIndex !== -1) {\n filesClone.splice(existingFileIndex, 1, {\n file: acceptedFile,\n ...(props.perFileProperties?.(acceptedFile) ?? {})\n } as TFile & TProps);\n } else {\n filesClone.push({ file: acceptedFile, ...(props.perFileProperties?.(acceptedFile) ?? {}) } as TFile & TProps);\n }\n }\n\n if (props.maxUploadFiles && filesClone.length > props.maxUploadFiles) {\n toast(props.maxUploadFiles ?? `U heeft meer dan ${props.maxUploadFiles} bestand(en) geselecteerd. Dit is niet toegestaan.`, { type: \"warning\" });\n }\n\n props.storeFiles(filesClone);\n },\n [props.extensionWarning, props.currentFiles, props.perFileProperties, props.storeFiles]\n );\n\n function fileValidator(file: File): FileError | null {\n if (props.customFileValidator?.(file)) {\n return {\n code: \"custom-validator\",\n message: props.extensionWarning\n };\n }\n\n if (isExtensionAllowed(props.extensionRegex, file.name)) {\n return null;\n }\n\n return {\n code: \"name-not-ok\",\n message: props.extensionWarning\n };\n }\n\n const { getRootProps, getInputProps } = useDropzone({\n onDrop: handleDrop,\n disabled: props.isDisabled,\n accept: props.extensions,\n maxFiles: props.maxUploadFiles,\n validator: fileValidator\n });\n\n return (\n <Box\n {...getRootProps()}\n sx={{\n \"&:focus\": {\n outline: \"none\"\n }\n }}\n data-qa={props.dataQas?.root ?? \"file-dropzone-root\"}\n >\n <input {...getInputProps()} data-qa={props.dataQas?.input ?? \"file-drop-input\"} />\n <Box\n sx={{\n backgroundColor: \"var(--color-rijks-grey-2)\",\n borderWidth: 1,\n borderStyle: \"dashed\",\n borderColor: \"black\",\n marginBottom: 0.5,\n textAlign: \"center\"\n }}\n >\n {props.fileDropChildren}\n </Box>\n </Box>\n );\n}\n"],"names":["AoaFileDropzone","props","handleDrop","useCallback","acceptedFiles","fileRejections","toast","filesClone","acceptedFile","existingFileIndex","file","_a","_b","fileValidator","isExtensionAllowed","getRootProps","getInputProps","useDropzone","jsxs","Box","jsx"],"mappings":";;;;;;AA0DO,SAASA,EACdC,GACA;;AACA,QAAMC,IAAaC;AAAA,IACjB,CAACC,GAAuBC,MAAoC;;AACtD,MAAAA,EAAe,SAAS,KAC1BC,EAAML,EAAM,kBAAkB,EAAE,MAAM,UAAW,CAAA;AAGnD,YAAMM,IAAa,CAAC,GAAGN,EAAM,YAAY;AACzC,iBAAWO,KAAgBJ,GAAe;AAClC,cAAAK,IAAoBF,EAAW,UAAU,CAACG,MAASA,EAAK,KAAK,SAASF,EAAa,IAAI;AAC7F,QAAIC,MAAsB,KACbF,EAAA,OAAOE,GAAmB,GAAG;AAAA,UACtC,MAAMD;AAAA,UACN,KAAIG,IAAAV,EAAM,sBAAN,gBAAAU,EAAA,KAAAV,GAA0BO,OAAiB,CAAC;AAAA,QAAA,CAC/B,IAERD,EAAA,KAAK,EAAE,MAAMC,GAAc,KAAII,IAAAX,EAAM,sBAAN,gBAAAW,EAAA,KAAAX,GAA0BO,OAAiB,CAAC,EAAA,CAAsB;AAAA,MAEhH;AAEA,MAAIP,EAAM,kBAAkBM,EAAW,SAASN,EAAM,kBAC9CK,EAAAL,EAAM,kBAAkB,oBAAoBA,EAAM,cAAc,sDAAsD,EAAE,MAAM,UA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 @@
1
1
  {
2
2
  "name": "@rws-aoa/react-library",
3
- "version": "3.6.0",
3
+ "version": "3.6.1",
4
4
  "description": "RWS AOA Design System",
5
5
  "author": "@rws-aoa",
6
6
  "license": "Apache-2.0",