@oliasoft-open-source/charts-library 2.10.1-beta-1 → 2.10.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 +6 -7
- package/release-notes.md +4 -0
- package/src/style/shared.less +2 -15
- package/src/helpers/styles.js +0 -68
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oliasoft-open-source/charts-library",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.2",
|
|
4
4
|
"description": "React Chart Library (based on Chart.js and react-chart-js-2)",
|
|
5
5
|
"homepage": "https://gitlab.com/oliasoft-open-source/charts-library",
|
|
6
6
|
"bugs": {
|
|
@@ -39,16 +39,17 @@
|
|
|
39
39
|
"chartjs-plugin-zoom": "^1.2.1",
|
|
40
40
|
"classnames": "^2.3.1",
|
|
41
41
|
"fraction.js": "^4.2.0",
|
|
42
|
-
"
|
|
42
|
+
"lodash": "^4",
|
|
43
43
|
"react-base64-downloader": "^2.1.7",
|
|
44
|
-
"react-chartjs-2": "^4.3.1"
|
|
44
|
+
"react-chartjs-2": "^4.3.1",
|
|
45
|
+
"react-icons": "^4"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@babel/core": "^7.18.13",
|
|
48
49
|
"@babel/eslint-parser": "^7.18.9",
|
|
49
50
|
"@babel/preset-env": "^7.18.10",
|
|
50
51
|
"@babel/preset-react": "^7.18.6",
|
|
51
|
-
"@oliasoft-open-source/react-ui-library": "
|
|
52
|
+
"@oliasoft-open-source/react-ui-library": "3.3.11-beta-1",
|
|
52
53
|
"@oliasoft-open-source/units": "^2",
|
|
53
54
|
"@storybook/addon-actions": "^6.5.10",
|
|
54
55
|
"@storybook/addon-docs": "^6.5.10",
|
|
@@ -86,7 +87,6 @@
|
|
|
86
87
|
"prop-types": "^15",
|
|
87
88
|
"react": "^17",
|
|
88
89
|
"react-dom": "^17",
|
|
89
|
-
"react-icons": "^4",
|
|
90
90
|
"storybook-dark-mode": "^1.1.0",
|
|
91
91
|
"terser-webpack-plugin": "^5.3.6",
|
|
92
92
|
"webpack": "^5.74.0",
|
|
@@ -100,7 +100,6 @@
|
|
|
100
100
|
"immer": "^9",
|
|
101
101
|
"prop-types": "^15",
|
|
102
102
|
"react": "^17",
|
|
103
|
-
"react-dom": "^17"
|
|
104
|
-
"react-icons": "^4"
|
|
103
|
+
"react-dom": "^17"
|
|
105
104
|
}
|
|
106
105
|
}
|
package/release-notes.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Charts Library Release Notes
|
|
2
2
|
|
|
3
|
+
## 2.10.2
|
|
4
|
+
|
|
5
|
+
- remove dead `less-vars-to-js` package ([OW-11017](https://oliasoft.atlassian.net/browse/OW-11017))
|
|
6
|
+
|
|
3
7
|
## 2.10.1
|
|
4
8
|
|
|
5
9
|
- Use `peerDependencies` for common versions of shared packages like `units` and `react-ui-library` so reduce double
|
package/src/style/shared.less
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
This file has shared variables that are re-used
|
|
3
|
-
- in other LESS files/modules
|
|
4
|
-
- in JavaScript, via https://www.npmjs.com/package/less-vars-to-js
|
|
5
|
-
|
|
2
|
+
This file has shared variables that are re-used in other LESS files/modules
|
|
6
3
|
Only use simple variables in this file
|
|
7
|
-
|
|
4
|
+
*/
|
|
8
5
|
|
|
9
6
|
// Brand guidelines
|
|
10
7
|
@colorPrimary: #eb6429;
|
|
@@ -12,13 +9,3 @@
|
|
|
12
9
|
@colorWarning: #e2bd27;
|
|
13
10
|
@colorSuccess: #3bbb3b;
|
|
14
11
|
@colorInfo: #29a7eb;
|
|
15
|
-
|
|
16
|
-
/*
|
|
17
|
-
Allow the parent project to optionally override the primary colour palette
|
|
18
|
-
by having an `override.less` file in its root directory
|
|
19
|
-
*/
|
|
20
|
-
@import (optional) '../../../../override.less';
|
|
21
|
-
|
|
22
|
-
/*
|
|
23
|
-
Other shared variables
|
|
24
|
-
*/
|
package/src/helpers/styles.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
This helper allows us to export simple LESS variables as JavaScript objects.
|
|
3
|
-
The intention is for keeping code DRY by allowing primary colour palettes etc
|
|
4
|
-
to be defined in one place only (LESS).
|
|
5
|
-
|
|
6
|
-
These simple variables should be defined in a files called `shared.less` that
|
|
7
|
-
can exist in one of two place:
|
|
8
|
-
|
|
9
|
-
- in `override.less` in the root of the parent project
|
|
10
|
-
(to allow overriding of the default values set in this project)
|
|
11
|
-
- in `src/style/shared.less in this project (default values)
|
|
12
|
-
|
|
13
|
-
The parent and local definitions are merged, with the parent taking
|
|
14
|
-
precedence.
|
|
15
|
-
|
|
16
|
-
The implementation uses Webpack raw-loader to load the shared LESS variables
|
|
17
|
-
file, and a 3rd party package (less-vars-to-js) to parse it, so they can be
|
|
18
|
-
exported for use in JavaScript.
|
|
19
|
-
|
|
20
|
-
When we upgrade to Webpack 5, we'll have to refactor this to use asset modules
|
|
21
|
-
instead.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
import lessToJs from 'less-vars-to-js';
|
|
25
|
-
|
|
26
|
-
// eslint-disable-next-line import/no-unresolved,import/no-webpack-loader-syntax
|
|
27
|
-
import lessVariables from '../style/shared.less?raw';
|
|
28
|
-
|
|
29
|
-
/*
|
|
30
|
-
We need to import the `shared.less` file from the root of the parent project
|
|
31
|
-
conditionally (it may not exist). Would love to use ES6 imports here, but they
|
|
32
|
-
don't allow optional files without throwing an error when the file doesn't
|
|
33
|
-
exist. ES6 dynamic imports would require `async` when we use this helper
|
|
34
|
-
(prefer to avoid that). So falling back to CommonJS require here.
|
|
35
|
-
|
|
36
|
-
Hopefully this will get better once we have Webpack 5 asset modules.
|
|
37
|
-
*/
|
|
38
|
-
let lessParentVariables = '{}';
|
|
39
|
-
try {
|
|
40
|
-
const parentPath = '../../../../override.less?raw';
|
|
41
|
-
// eslint-disable-next-line import/no-unresolved,global-require,import/no-webpack-loader-syntax,import/no-dynamic-require
|
|
42
|
-
lessParentVariables = require(`${parentPath}`).default;
|
|
43
|
-
} catch (e) {
|
|
44
|
-
//do nothing (we fallback to the local definition anyway)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const load = () => {
|
|
48
|
-
/*
|
|
49
|
-
Merge the parent project shared.less with the local shared.less
|
|
50
|
-
(since less-vars-to-js doesn't handle import statements for us)
|
|
51
|
-
|
|
52
|
-
The parent definition takes precedence over the local definition
|
|
53
|
-
*/
|
|
54
|
-
const parent = lessToJs(lessParentVariables, {
|
|
55
|
-
resolveVariables: true,
|
|
56
|
-
stripPrefix: true,
|
|
57
|
-
});
|
|
58
|
-
const local = lessToJs(lessVariables, {
|
|
59
|
-
resolveVariables: true,
|
|
60
|
-
stripPrefix: true,
|
|
61
|
-
});
|
|
62
|
-
return {
|
|
63
|
-
...local,
|
|
64
|
-
...parent,
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export const styleVariables = load();
|