@gooddata/sdk-ui-theme-provider 11.57.0-alpha.0 → 11.57.0-alpha.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/esm/index.js
CHANGED
package/esm/internal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// (C) 2024-2026 GoodData Corporation
|
|
2
|
-
|
|
2
|
+
// oxlint-disable no-barrel-files/no-barrel-files
|
|
3
3
|
export { blueLightTheme } from "./defaultThemes/blueLight.js";
|
|
4
4
|
export { greenDarkTheme } from "./defaultThemes/greenDark.js";
|
|
5
5
|
export { indigoTheme } from "./defaultThemes/indigo.js";
|
|
@@ -10,14 +10,14 @@ export function logError(message) {
|
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
12
12
|
export function logSuccess(message) {
|
|
13
|
-
//
|
|
13
|
+
// oxlint-disable-next-line eslint-js/no-console
|
|
14
14
|
console.log(chalk.green(message));
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* @internal
|
|
18
18
|
*/
|
|
19
19
|
export function logInfo(message) {
|
|
20
|
-
//
|
|
20
|
+
// oxlint-disable-next-line eslint-js/no-console
|
|
21
21
|
console.log(chalk.gray(message));
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
@@ -185,14 +185,26 @@ function normalizeColorsInValue(value) {
|
|
|
185
185
|
return `rgba(${red},${green},${blue},${alphaRounded})`;
|
|
186
186
|
});
|
|
187
187
|
// Normalize rgb()/rgba() values to consistent rgba() format.
|
|
188
|
-
// Sass 1.79+ no longer rounds color channels,
|
|
189
|
-
//
|
|
190
|
-
//
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
188
|
+
// Sass 1.79+ no longer rounds color channels, and since 1.104 such fractional-channel colors
|
|
189
|
+
// are serialized in the CSS Color 4 percentage form (e.g. rgb(90.78%,96.98%,98.86%)) - parse
|
|
190
|
+
// both numeric and percentage channels and round them to integers so they compare equal to
|
|
191
|
+
// the hex/rgba values in the specification.
|
|
192
|
+
// The percentage form prints ~10 decimals, so a channel that is exactly N.5 in 0-255 space
|
|
193
|
+
// (e.g. 216.5 -> "84.9019607843%") converts back to fractionally BELOW the half (216.4999...)
|
|
194
|
+
// and would round down where Sass's own serializer rounded up. Snap to 6 decimals first so the
|
|
195
|
+
// conversion rounds the same way the specification values were derived.
|
|
196
|
+
const channelTo255 = (channel) => {
|
|
197
|
+
if (!channel.endsWith("%")) {
|
|
198
|
+
return Math.round(parseFloat(channel));
|
|
199
|
+
}
|
|
200
|
+
const raw = (parseFloat(channel) * 255) / 100;
|
|
201
|
+
return Math.round(Math.round(raw * 1e6) / 1e6);
|
|
202
|
+
};
|
|
203
|
+
result = result.replace(/rgba?\(([\d.]+%?),([\d.]+%?),([\d.]+%?)(?:,([\d.]+%?))?\)/g, (_match, r, g, b, a) => {
|
|
204
|
+
const red = channelTo255(r);
|
|
205
|
+
const green = channelTo255(g);
|
|
206
|
+
const blue = channelTo255(b);
|
|
207
|
+
const alpha = a === undefined ? 1 : a.endsWith("%") ? parseFloat(a) / 100 : parseFloat(a);
|
|
196
208
|
// Round alpha to 2 decimal places for consistent comparison
|
|
197
209
|
const alphaRounded = Math.round(alpha * 100) / 100;
|
|
198
210
|
return `rgba(${red},${green},${blue},${alphaRounded})`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-theme-provider",
|
|
3
|
-
"version": "11.57.0-alpha.
|
|
3
|
+
"version": "11.57.0-alpha.2",
|
|
4
4
|
"description": "GoodData SDK - Theme provider",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"postcss-value-parser": "4.2.0",
|
|
33
33
|
"ts-invariant": "0.10.3",
|
|
34
34
|
"tslib": "2.8.1",
|
|
35
|
-
"@gooddata/sdk-
|
|
36
|
-
"@gooddata/sdk-
|
|
37
|
-
"@gooddata/sdk-
|
|
38
|
-
"@gooddata/util": "11.57.0-alpha.
|
|
35
|
+
"@gooddata/sdk-backend-spi": "11.57.0-alpha.2",
|
|
36
|
+
"@gooddata/sdk-model": "11.57.0-alpha.2",
|
|
37
|
+
"@gooddata/sdk-ui": "11.57.0-alpha.2",
|
|
38
|
+
"@gooddata/util": "11.57.0-alpha.2"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@microsoft/api-documenter": "7.30.10",
|
|
@@ -62,17 +62,18 @@
|
|
|
62
62
|
"happy-dom": "20.12.0",
|
|
63
63
|
"npm-run-all": "4.1.5",
|
|
64
64
|
"oxfmt": "0.66.0",
|
|
65
|
-
"oxlint": "1.
|
|
66
|
-
"oxlint-
|
|
65
|
+
"oxlint": "1.66.0",
|
|
66
|
+
"oxlint-plugin-eslint": "1.82.0",
|
|
67
|
+
"oxlint-tsgolint": "0.18.1",
|
|
67
68
|
"raf": "3.4.1",
|
|
68
69
|
"react": "19.1.1",
|
|
69
70
|
"react-dom": "19.1.1",
|
|
70
71
|
"typescript": "7.0.2",
|
|
71
72
|
"vitest": "4.1.8",
|
|
72
|
-
"@gooddata/eslint-config": "11.57.0-alpha.
|
|
73
|
-
"@gooddata/oxlint-config": "11.57.0-alpha.
|
|
74
|
-
"@gooddata/reference-workspace": "11.57.0-alpha.
|
|
75
|
-
"@gooddata/sdk-backend-mockingbird": "11.57.0-alpha.
|
|
73
|
+
"@gooddata/eslint-config": "11.57.0-alpha.2",
|
|
74
|
+
"@gooddata/oxlint-config": "11.57.0-alpha.2",
|
|
75
|
+
"@gooddata/reference-workspace": "11.57.0-alpha.2",
|
|
76
|
+
"@gooddata/sdk-backend-mockingbird": "11.57.0-alpha.2"
|
|
76
77
|
},
|
|
77
78
|
"peerDependencies": {
|
|
78
79
|
"react": "^18.0.0 || ^19.0.0",
|