@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.
package/.storybook/main.js
CHANGED
|
@@ -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': [
|
|
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
|
-
|
|
21
|
-
|
|
29
|
+
|
|
30
|
+
docs: {},
|
|
31
|
+
|
|
32
|
+
typescript: {
|
|
33
|
+
reactDocgen: 'react-docgen-typescript'
|
|
22
34
|
}
|
|
23
35
|
};
|
package/.storybook/preview.js
CHANGED
|
@@ -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.
|
|
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/
|
|
25
|
-
"@babel/plugin-proposal-
|
|
26
|
-
"@babel/plugin-proposal-
|
|
27
|
-
"@babel/
|
|
28
|
-
"@babel/preset-
|
|
29
|
-
"@babel/preset-
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"@storybook/addon-
|
|
33
|
-
"@storybook/addon-
|
|
34
|
-
"@storybook/addon-
|
|
35
|
-
"@storybook/addon-
|
|
36
|
-
"@storybook/
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"eslint": "^
|
|
53
|
-
"eslint-
|
|
54
|
-
"eslint-
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"jest": "^29.
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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',
|
package/stories/lib/helpers.tsx
CHANGED
|
@@ -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
|
};
|