@aarhus-university/au-lib-react-components 12.4.0 → 12.4.2

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/package.json CHANGED
@@ -1,105 +1,105 @@
1
- {
2
- "sideEffects": true,
3
- "name": "@aarhus-university/au-lib-react-components",
4
- "version": "12.4.0",
5
- "description": "Library for shared React components for various applications on au.dk",
6
- "scripts": {
7
- "test": "jest",
8
- "build": "jest && webpack --config ./webpack.config.js",
9
- "storybook": "storybook dev -p 6006 -h 127.0.0.1",
10
- "build-storybook": "storybook build",
11
- "chromatic": "npx chromatic --project-token=0be71d94786b",
12
- "build-js": "./esbuild.mjs"
13
- },
14
- "repository": {
15
- "type": "git",
16
- "url": "https://gitlab.au.dk/au-web-og-digital/au-lib-react-components"
17
- },
18
- "author": {
19
- "name": "Thomas Riis Hansen",
20
- "email": "trh@au.dk"
21
- },
22
- "devDependencies": {
23
- "@babel/core": "^7.22.5",
24
- "@babel/plugin-proposal-class-properties": "^7.18.6",
25
- "@babel/plugin-proposal-object-rest-spread": "^7.20.7",
26
- "@babel/plugin-proposal-optional-chaining": "^7.21.0",
27
- "@babel/preset-env": "^7.22.5",
28
- "@babel/preset-react": "^7.22.5",
29
- "@babel/preset-typescript": "^7.22.5",
30
- "@chromatic-com/storybook": "^1.6.1",
31
- "@storybook/addon-a11y": "^8.2.1",
32
- "@storybook/addon-essentials": "^8.2.1",
33
- "@storybook/addon-interactions": "^8.2.1",
34
- "@storybook/addon-links": "^8.2.1",
35
- "@storybook/addon-webpack5-compiler-babel": "^3.0.3",
36
- "@storybook/react": "^8.2.1",
37
- "@testing-library/jest-dom": "^5.16.5",
38
- "@testing-library/react": "^14.0.0",
39
- "@types/testing-library__jest-dom": "^5.14.6",
40
- "@typescript-eslint/eslint-plugin": "^5.60.1",
41
- "@typescript-eslint/parser": "^5.60.1",
42
- "babel-jest": "^29.5.0",
43
- "babel-loader": "^9.1.2",
44
- "chromatic": "^6.19.9",
45
- "css-loader": "^6.8.1",
46
- "eslint": "^8.44.0",
47
- "eslint-config-airbnb": "^19.0.4",
48
- "eslint-import-resolver-typescript": "^3.5.5",
49
- "eslint-plugin-import": "^2.27.5",
50
- "eslint-plugin-jsx-a11y": "^6.7.1",
51
- "eslint-plugin-react": "^7.32.2",
52
- "eslint-plugin-react-hooks": "^4.6.0",
53
- "eslint-plugin-storybook": "^0.8.0",
54
- "eslint-webpack-plugin": "^4.0.1",
55
- "fork-ts-checker-webpack-plugin": "^8.0.0",
56
- "jest": "^29.5.0",
57
- "mini-css-extract-plugin": "^2.7.6",
58
- "react-dom": "18.3.1",
59
- "sass": "^1.63.6",
60
- "sass-loader": "^13.3.2",
61
- "storybook": "^8.2.1",
62
- "ts-jest": "^29.1.1",
63
- "typescript": "^5.1.6",
64
- "wicg-inert": "^3.1.2"
65
- },
66
- "dependencies": {
67
- "@aarhus-university/au-designsystem-delphinus": "^1.7.8",
68
- "@aarhus-university/types": "^1.1.0",
69
- "@reduxjs/toolkit": "^1.9.5",
70
- "@storybook/react-webpack5": "^8.2.1",
71
- "@tinymce/tinymce-react": "^5.1.1",
72
- "@types/react": "^18.2.14",
73
- "@types/react-dom": "^18.2.6",
74
- "@types/react-router-dom": "^5.3.3",
75
- "dayjs": "^1.11.9",
76
- "esbuild": "^0.18.11",
77
- "esbuild-sass-plugin": "^2.10.0",
78
- "lodash.debounce": "^4.0.8",
79
- "prop-types": "^15.8.1",
80
- "query-string": "^8.1.0",
81
- "react": "^18.3.1",
82
- "react-autosuggest": "^10.1.0",
83
- "react-router-dom": "^6.14.1",
84
- "regenerator-runtime": "^0.13.11",
85
- "webpack": "^5.88.1",
86
- "whatwg-fetch": "^3.6.2"
87
- },
88
- "jest": {
89
- "rootDir": "__tests__/jest",
90
- "setupFilesAfterEnv": [
91
- "./setupTests.ts"
92
- ],
93
- "transform": {
94
- "^.+\\.(ts|tsx|js|jsx)$": "ts-jest"
95
- },
96
- "testEnvironment": "jsdom",
97
- "transformIgnorePatterns": [
98
- "node_modules/(?!(@aarhus-university/au-lib-react-components|@aarhus-university/au-designsystem-delphinus|node-fetch|data-uri-to-buffer|fetch-blob|formdata-polyfill)/)"
99
- ],
100
- "testPathIgnorePatterns": [
101
- "factory.ts",
102
- "setupTests.ts"
103
- ]
104
- }
105
- }
1
+ {
2
+ "sideEffects": true,
3
+ "name": "@aarhus-university/au-lib-react-components",
4
+ "version": "12.4.2",
5
+ "description": "Library for shared React components for various applications on au.dk",
6
+ "scripts": {
7
+ "test": "jest",
8
+ "build": "jest && webpack --config ./webpack.config.js",
9
+ "storybook": "storybook dev -p 6006 -h 127.0.0.1",
10
+ "build-storybook": "storybook build",
11
+ "chromatic": "npx chromatic --project-token=0be71d94786b",
12
+ "build-js": "./esbuild.mjs"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://gitlab.au.dk/au-web-og-digital/au-lib-react-components"
17
+ },
18
+ "author": {
19
+ "name": "Thomas Riis Hansen",
20
+ "email": "trh@au.dk"
21
+ },
22
+ "devDependencies": {
23
+ "@babel/core": "^7.22.5",
24
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
25
+ "@babel/plugin-proposal-object-rest-spread": "^7.20.7",
26
+ "@babel/plugin-proposal-optional-chaining": "^7.21.0",
27
+ "@babel/preset-env": "^7.22.5",
28
+ "@babel/preset-react": "^7.22.5",
29
+ "@babel/preset-typescript": "^7.22.5",
30
+ "@chromatic-com/storybook": "^1.6.1",
31
+ "@storybook/addon-a11y": "^8.2.1",
32
+ "@storybook/addon-essentials": "^8.2.1",
33
+ "@storybook/addon-interactions": "^8.2.1",
34
+ "@storybook/addon-links": "^8.2.1",
35
+ "@storybook/addon-webpack5-compiler-babel": "^3.0.3",
36
+ "@storybook/react": "^8.2.1",
37
+ "@testing-library/jest-dom": "^5.16.5",
38
+ "@testing-library/react": "^14.0.0",
39
+ "@types/testing-library__jest-dom": "^5.14.6",
40
+ "@typescript-eslint/eslint-plugin": "^5.60.1",
41
+ "@typescript-eslint/parser": "^5.60.1",
42
+ "babel-jest": "^29.5.0",
43
+ "babel-loader": "^9.1.2",
44
+ "chromatic": "^6.19.9",
45
+ "css-loader": "^6.8.1",
46
+ "eslint": "^8.44.0",
47
+ "eslint-config-airbnb": "^19.0.4",
48
+ "eslint-import-resolver-typescript": "^3.5.5",
49
+ "eslint-plugin-import": "^2.27.5",
50
+ "eslint-plugin-jsx-a11y": "^6.7.1",
51
+ "eslint-plugin-react": "^7.32.2",
52
+ "eslint-plugin-react-hooks": "^4.6.0",
53
+ "eslint-plugin-storybook": "^0.8.0",
54
+ "eslint-webpack-plugin": "^4.0.1",
55
+ "fork-ts-checker-webpack-plugin": "^8.0.0",
56
+ "jest": "^29.5.0",
57
+ "mini-css-extract-plugin": "^2.7.6",
58
+ "react-dom": "18.3.1",
59
+ "sass": "^1.63.6",
60
+ "sass-loader": "^13.3.2",
61
+ "storybook": "^8.2.1",
62
+ "ts-jest": "^29.1.1",
63
+ "typescript": "^5.1.6",
64
+ "wicg-inert": "^3.1.2"
65
+ },
66
+ "dependencies": {
67
+ "@aarhus-university/au-designsystem-delphinus": "^1.7.8",
68
+ "@aarhus-university/types": "^1.1.0",
69
+ "@reduxjs/toolkit": "^1.9.5",
70
+ "@storybook/react-webpack5": "^8.2.1",
71
+ "@tinymce/tinymce-react": "^5.1.1",
72
+ "@types/react": "^18.2.14",
73
+ "@types/react-dom": "^18.2.6",
74
+ "@types/react-router-dom": "^5.3.3",
75
+ "dayjs": "^1.11.9",
76
+ "esbuild": "^0.18.11",
77
+ "esbuild-sass-plugin": "^2.10.0",
78
+ "lodash.debounce": "^4.0.8",
79
+ "prop-types": "^15.8.1",
80
+ "query-string": "^8.1.0",
81
+ "react": "^18.3.1",
82
+ "react-autosuggest": "^10.1.0",
83
+ "react-router-dom": "^6.14.1",
84
+ "regenerator-runtime": "^0.13.11",
85
+ "webpack": "^5.88.1",
86
+ "whatwg-fetch": "^3.6.2"
87
+ },
88
+ "jest": {
89
+ "rootDir": "__tests__/jest",
90
+ "setupFilesAfterEnv": [
91
+ "./setupTests.ts"
92
+ ],
93
+ "transform": {
94
+ "^.+\\.(ts|tsx|js|jsx)$": "ts-jest"
95
+ },
96
+ "testEnvironment": "jsdom",
97
+ "transformIgnorePatterns": [
98
+ "node_modules/(?!(@aarhus-university/au-lib-react-components|@aarhus-university/au-designsystem-delphinus|node-fetch|data-uri-to-buffer|fetch-blob|formdata-polyfill)/)"
99
+ ],
100
+ "testPathIgnorePatterns": [
101
+ "factory.ts",
102
+ "setupTests.ts"
103
+ ]
104
+ }
105
+ }
@@ -14,7 +14,6 @@ class AUAutoSuggestComponent extends React.Component {
14
14
  };
15
15
 
16
16
  this.onChange = this.onChange.bind(this);
17
- this.onEnter = this.onEnter.bind(this);
18
17
  this.onSuggestionsFetchRequested = debounce(this.onSuggestionsFetchRequested.bind(this), 400);
19
18
  this.onSuggestionsClearRequested = this.onSuggestionsClearRequested.bind(this);
20
19
  this.onSuggestionSelected = this.onSuggestionSelected.bind(this);
@@ -29,14 +28,6 @@ class AUAutoSuggestComponent extends React.Component {
29
28
  });
30
29
  }
31
30
 
32
- onEnter(event) {
33
- const { suggestions } = this.state;
34
- const { setResults } = this.props;
35
- if (event.key === 'Enter') {
36
- setResults(suggestions);
37
- }
38
- }
39
-
40
31
  onSuggestionsFetchRequested({ value }) {
41
32
  const { getSuggestions, collection } = this.props;
42
33
  getSuggestions(value, collection, (suggestions) => {
@@ -84,7 +75,6 @@ class AUAutoSuggestComponent extends React.Component {
84
75
  disabled,
85
76
  'aria-label': placeholder,
86
77
  onChange: this.onChange,
87
- onKeyDown: this.onEnter,
88
78
  };
89
79
 
90
80
  return (
@@ -8,6 +8,7 @@ type Props = {
8
8
  withStatus?: boolean;
9
9
  fetchError?: FetchBaseQueryError,
10
10
  serializedError?: SerializedError,
11
+ type?: 'warning' | 'attention' | 'confirm' | 'information';
11
12
  };
12
13
 
13
14
  const AUErrorComponent: FC<Props> = ({
@@ -15,12 +16,13 @@ const AUErrorComponent: FC<Props> = ({
15
16
  fetchError = undefined,
16
17
  serializedError = undefined,
17
18
  withStatus = false,
19
+ type = 'warning',
18
20
  }) => {
19
21
  if (auError) {
20
22
  const { status, header, message } = auError;
21
23
  return (
22
24
  <AUNotificationComponent
23
- type="warning"
25
+ type={type}
24
26
  header={`${withStatus ? `${status}: ` : ''}${header}`}
25
27
  content={[
26
28
  <p dangerouslySetInnerHTML={{ __html: message }} />,
@@ -32,7 +34,7 @@ const AUErrorComponent: FC<Props> = ({
32
34
  const { status, error } = fetchError;
33
35
  return (
34
36
  <AUNotificationComponent
35
- type="warning"
37
+ type={type}
36
38
  header={withStatus ? status : undefined}
37
39
  content={[
38
40
  <p dangerouslySetInnerHTML={{ __html: error }} />,
@@ -44,7 +46,7 @@ const AUErrorComponent: FC<Props> = ({
44
46
  const { status, data } = fetchError;
45
47
  return (
46
48
  <AUNotificationComponent
47
- type="warning"
49
+ type={type}
48
50
  header={withStatus ? `${status}` : undefined}
49
51
  content={[
50
52
  <p dangerouslySetInnerHTML={{ __html: JSON.stringify(data) }} />,
@@ -56,7 +58,7 @@ const AUErrorComponent: FC<Props> = ({
56
58
  const { code, message } = serializedError;
57
59
  return (
58
60
  <AUNotificationComponent
59
- type="warning"
61
+ type={type}
60
62
  header={withStatus ? code : undefined}
61
63
  content={[
62
64
  <p dangerouslySetInnerHTML={{ __html: message || '' }} />,