@aarhus-university/au-lib-react-components 12.2.2 → 12.3.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.
@@ -1,11 +1,20 @@
1
1
  const path = require('path');
2
2
  module.exports = {
3
3
  'stories': ['../**/*.stories.mdx', '../**/*.stories.@(js|jsx|ts|tsx)'],
4
- 'addons': ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-interactions', '@storybook/addon-a11y'],
4
+ 'addons': [
5
+ '@storybook/addon-links',
6
+ '@storybook/addon-essentials',
7
+ '@storybook/addon-interactions',
8
+ '@storybook/addon-a11y',
9
+ '@storybook/addon-webpack5-compiler-babel',
10
+ '@chromatic-com/storybook'
11
+ ],
12
+
5
13
  'framework': {
6
14
  name: '@storybook/react-webpack5',
7
15
  options: {}
8
16
  },
17
+
9
18
  webpackFinal: async config => {
10
19
  config.module.rules.push({
11
20
  test: /\.(ts|js)x?$/,
@@ -17,7 +26,10 @@ module.exports = {
17
26
  return config;
18
27
  // return { ...config, module: { ...config.module, rules: custom.module.rules } };
19
28
  },
20
- docs: {
21
- autodocs: true
29
+
30
+ docs: {},
31
+
32
+ typescript: {
33
+ reactDocgen: 'react-docgen-typescript'
22
34
  }
23
35
  };
@@ -2,7 +2,6 @@ import '@aarhus-university/au-designsystem-delphinus/public/style.css';
2
2
  import { globalTheme, globalLang } from '../stories/lib/helpers';
3
3
 
4
4
  export const parameters = {
5
- actions: { argTypesRegex: "^on[A-Z].*" },
6
5
  controls: {
7
6
  matchers: {
8
7
  color: /(background|color)$/i,
@@ -15,3 +14,4 @@ export const globalTypes = {
15
14
  theme: globalTheme.theme,
16
15
  lang: globalLang().lang,
17
16
  };
17
+ export const tags = ['autodocs'];
package/package.json CHANGED
@@ -1,120 +1,105 @@
1
- {
2
- "sideEffects": true,
3
- "name": "@aarhus-university/au-lib-react-components",
4
- "version": "12.2.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/eslint-parser": "^7.22.5",
25
- "@babel/plugin-proposal-class-properties": "^7.18.6",
26
- "@babel/plugin-proposal-object-rest-spread": "^7.20.7",
27
- "@babel/plugin-proposal-optional-chaining": "^7.21.0",
28
- "@babel/preset-env": "^7.22.5",
29
- "@babel/preset-react": "^7.22.5",
30
- "@babel/preset-typescript": "^7.22.5",
31
- "@mdx-js/react": "^2.3.0",
32
- "@storybook/addon-a11y": "^7.6.7",
33
- "@storybook/addon-actions": "^7.6.7",
34
- "@storybook/addon-essentials": "^7.6.7",
35
- "@storybook/addon-interactions": "^7.6.7",
36
- "@storybook/addon-links": "^7.6.7",
37
- "@storybook/jest": "^0.2.3",
38
- "@storybook/react": "^7.6.7",
39
- "@storybook/react-webpack5": "^7.6.7",
40
- "@storybook/testing-library": "^0.2.2",
41
- "@testing-library/jest-dom": "^5.16.5",
42
- "@testing-library/react": "^14.0.0",
43
- "@testing-library/user-event": "^14.4.3",
44
- "@types/jest": "^29.5.2",
45
- "@types/testing-library__jest-dom": "^5.14.6",
46
- "@typescript-eslint/eslint-plugin": "^5.60.1",
47
- "@typescript-eslint/parser": "^5.60.1",
48
- "babel-jest": "^29.5.0",
49
- "babel-loader": "^9.1.2",
50
- "chromatic": "^6.19.9",
51
- "css-loader": "^6.8.1",
52
- "eslint": "^8.44.0",
53
- "eslint-config-airbnb": "^19.0.4",
54
- "eslint-import-resolver-typescript": "^3.5.5",
55
- "eslint-plugin-import": "^2.27.5",
56
- "eslint-plugin-jsx-a11y": "^6.7.1",
57
- "eslint-plugin-react": "^7.32.2",
58
- "eslint-plugin-react-hooks": "^4.6.0",
59
- "eslint-plugin-storybook": "^0.6.15",
60
- "eslint-webpack-plugin": "^4.0.1",
61
- "fork-ts-checker-webpack-plugin": "^8.0.0",
62
- "jest": "^29.5.0",
63
- "jest-environment-jsdom": "^29.5.0",
64
- "mini-css-extract-plugin": "^2.7.6",
65
- "react-dom": "^18.2.0",
66
- "react-test-renderer": "^18.2.0",
67
- "sass": "^1.63.6",
68
- "sass-loader": "^13.3.2",
69
- "storybook": "^7.6.7",
70
- "style-loader": "^3.3.3",
71
- "ts-jest": "^29.1.1",
72
- "ts-loader": "^9.4.4",
73
- "typescript": "^5.1.6",
74
- "webpack-cli": "^5.1.4"
75
- },
76
- "dependencies": {
77
- "@aarhus-university/au-designsystem-delphinus": "1.3.3",
78
- "@aarhus-university/au-designsystem-delphinus-dev": "0.7.0",
79
- "@aarhus-university/types": "1.1.0",
80
- "@reduxjs/toolkit": "^1.9.5",
81
- "@tinymce/tinymce-react": "^4.3.2",
82
- "@types/google.analytics": "^0.0.42",
83
- "@types/react": "^18.2.14",
84
- "@types/react-dom": "^18.2.6",
85
- "@types/react-router-dom": "^5.3.3",
86
- "dayjs": "^1.11.9",
87
- "esbuild": "^0.18.11",
88
- "esbuild-sass-plugin": "^2.10.0",
89
- "lodash.debounce": "^4.0.8",
90
- "prop-types": "^15.8.1",
91
- "query-string": "^8.1.0",
92
- "react": "18.2.0",
93
- "react-autosuggest": "^10.1.0",
94
- "react-router-dom": "^6.14.1",
95
- "regenerator-runtime": "^0.13.11",
96
- "webpack": "^5.88.1",
97
- "whatwg-fetch": "^3.6.2"
98
- },
99
- "peerDependencies": {
100
- "react": "18.2.0",
101
- "react-dom": "18.2.0"
102
- },
103
- "jest": {
104
- "rootDir": "__tests__/jest",
105
- "setupFilesAfterEnv": [
106
- "./setupTests.ts"
107
- ],
108
- "transform": {
109
- "^.+\\.(ts|tsx|js|jsx)$": "ts-jest"
110
- },
111
- "testEnvironment": "jsdom",
112
- "transformIgnorePatterns": [
113
- "node_modules/(?!(@aarhus-university/au-lib-react-components|@aarhus-university/au-designsystem-delphinus|node-fetch|data-uri-to-buffer|fetch-blob|formdata-polyfill)/)"
114
- ],
115
- "testPathIgnorePatterns": [
116
- "factory.ts",
117
- "setupTests.ts"
118
- ]
119
- }
120
- }
1
+ {
2
+ "sideEffects": true,
3
+ "name": "@aarhus-university/au-lib-react-components",
4
+ "version": "12.3.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,32 +1,7 @@
1
1
  import React from 'react';
2
2
  import { StoryObj, Meta } from '@storybook/react';
3
3
  import AUCharacterCountComponent from '../src/components/AUCharacterCountComponent';
4
- import { ThemeWrapper } from './lib/helpers';
5
-
6
- export const translations = {
7
- character_count: {
8
- overflow: {
9
- message: {
10
- recommended: 'Vi anbefaler, at du maksimalt skriver {{maxchars}} tegn.',
11
- allowed: 'Du må maks. skrive {{maxchars}} tegn.'
12
- },
13
- count: {
14
- recommended: {
15
- one: 'Du har skrevet 1 tegn mere end anbefalet.',
16
- other: 'Du har skrevet {{overflow}} tegn mere end anbefalet.'
17
- },
18
- allowed: {
19
- one: 'Du har skrevet 1 tegn for meget.',
20
- other: 'Du har skrevet {{overflow}} tegn for meget.'
21
- }
22
- }
23
- },
24
- count_down: {
25
- one: 'Du har 1 tegn tilbage',
26
- other: 'Du har {{remaining}} tegn tilbage'
27
- }
28
- },
29
- };
4
+ import { ThemeWrapper, translations } from './lib/helpers';
30
5
 
31
6
  export default {
32
7
  title: 'Delphinus/Character Count',
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import { StoryObj, Meta } from '@storybook/react';
3
3
  import AUEditorComponent from '../src/components/AUEditorComponent';
4
- import { ThemeWrapper } from './lib/helpers';
5
- import { translations } from './AUCharacterCountComponent.stories';
4
+ import { ThemeWrapper, translations } from './lib/helpers';
6
5
 
7
6
  export default {
8
7
  title: 'Delphinus/Editor',
@@ -120,9 +120,35 @@ ThemeLanguageWrapper.defaultProps = {
120
120
  withPageContentBlock: true,
121
121
  };
122
122
 
123
+ const translations = {
124
+ character_count: {
125
+ overflow: {
126
+ message: {
127
+ recommended: 'Vi anbefaler, at du maksimalt skriver {{maxchars}} tegn.',
128
+ allowed: 'Du må maks. skrive {{maxchars}} tegn.'
129
+ },
130
+ count: {
131
+ recommended: {
132
+ one: 'Du har skrevet 1 tegn mere end anbefalet.',
133
+ other: 'Du har skrevet {{overflow}} tegn mere end anbefalet.'
134
+ },
135
+ allowed: {
136
+ one: 'Du har skrevet 1 tegn for meget.',
137
+ other: 'Du har skrevet {{overflow}} tegn for meget.'
138
+ }
139
+ }
140
+ },
141
+ count_down: {
142
+ one: 'Du har 1 tegn tilbage',
143
+ other: 'Du har {{remaining}} tegn tilbage'
144
+ }
145
+ },
146
+ };
147
+
123
148
  export {
124
149
  globalTheme,
125
150
  globalLang,
126
151
  ThemeWrapper,
127
152
  ThemeLanguageWrapper,
153
+ translations,
128
154
  };