@patternfly/react-tokens 4.71.1 → 4.72.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 4.72.1 (2022-05-31)
7
+
8
+ **Note:** Version bump only for package @patternfly/react-tokens
9
+
10
+
11
+
12
+
13
+
14
+ # 4.72.0 (2022-05-31)
15
+
16
+
17
+ ### Features
18
+
19
+ * **table:** add fullscreen demo for error state ([#7443](https://github.com/patternfly/patternfly-react/issues/7443)) ([eeab219](https://github.com/patternfly/patternfly-react/commit/eeab2197765589262ee7c328e57dbf1606da6d7f))
20
+
21
+
22
+
23
+
24
+
25
+ ## 4.71.2 (2022-05-27)
26
+
27
+ **Note:** Version bump only for package @patternfly/react-tokens
28
+
29
+
30
+
31
+
32
+
6
33
  ## 4.71.1 (2022-05-27)
7
34
 
8
35
  **Note:** Version bump only for package @patternfly/react-tokens
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-tokens",
3
- "version": "4.71.1",
3
+ "version": "4.72.1",
4
4
  "description": "This library provides access to the design tokens of PatternFly 4 from JavaScript",
5
5
  "main": "dist/js/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -35,5 +35,5 @@
35
35
  "glob": "^7.1.2",
36
36
  "rimraf": "^2.6.2"
37
37
  },
38
- "gitHead": "7a00f2e2733a593e840464c786f7096e004d02f1"
38
+ "gitHead": "5e656c560b00e485a3a5a8d6e97c5677624a13ed"
39
39
  }
@@ -1,6 +1,6 @@
1
1
  const glob = require('glob');
2
2
  const { dirname, basename, sep } = require('path');
3
- const { parse } = require('css');
3
+ const { parse, stringify } = require('css');
4
4
  const { readFileSync } = require('fs');
5
5
 
6
6
  const pfStylesDir = dirname(require.resolve('@patternfly/patternfly/patternfly.css'));
@@ -19,7 +19,12 @@ const getRegexMatches = (string, regex) => {
19
19
 
20
20
  const getDeclarations = cssAst =>
21
21
  cssAst.stylesheet.rules
22
- .filter(node => node.type === 'rule' && !node.selectors.includes('.pf-t-dark'))
22
+ .filter(
23
+ node =>
24
+ node.type === 'rule' &&
25
+ !node.selectors.includes('.pf-t-dark') &&
26
+ (!node.selectors || !node.selectors.some(item => item.includes('.pf-theme-dark'))) // exclude dark theme blocks since dark theme variable values override default token values
27
+ )
23
28
  .map(node => node.declarations.filter(decl => decl.type === 'declaration'))
24
29
  .reduce((acc, val) => acc.concat(val), []); // flatten
25
30
 
@@ -100,11 +105,15 @@ function generateTokens() {
100
105
  const scssColorsMap = getRegexMatches(scssColorVariables, /(\$.*):\s*([^\s]+)\s*(?:!default);/g);
101
106
 
102
107
  // contains default values and mappings to colors.scss for color values
103
- const cssGlobalVariables = readFileSync(
104
- require.resolve('@patternfly/patternfly/base/patternfly-variables.css'),
105
- 'utf8'
108
+ const cssGlobalVariablesAst = parse(
109
+ readFileSync(require.resolve('@patternfly/patternfly/base/patternfly-variables.css'), 'utf8')
110
+ );
111
+
112
+ cssGlobalVariablesAst.stylesheet.rules = cssGlobalVariablesAst.stylesheet.rules.filter(
113
+ node => !node.selectors || !node.selectors.some(item => item.includes('.pf-theme-dark'))
106
114
  );
107
- const cssGlobalVariablesMap = getRegexMatches(cssGlobalVariables, /(--pf-[\w-]*):\s*([\w -_]+);/g);
115
+
116
+ const cssGlobalVariablesMap = getRegexMatches(stringify(cssGlobalVariablesAst), /(--pf-[\w-]*):\s*([\w -_]+);/g);
108
117
 
109
118
  const combinedScssVarsColorsMap = {
110
119
  ...scssVarsMap,