@patternfly/react-tokens 4.72.0 → 4.73.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/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.73.0 (2022-06-01)
7
+
8
+
9
+ ### Features
10
+
11
+ * **table:** full screen demo for sticky first column ([#7451](https://github.com/patternfly/patternfly-react/issues/7451)) ([f610dd4](https://github.com/patternfly/patternfly-react/commit/f610dd4726b16d73a166f7a57da0fa3588b8201d))
12
+
13
+
14
+
15
+
16
+
17
+ ## 4.72.2 (2022-05-31)
18
+
19
+ **Note:** Version bump only for package @patternfly/react-tokens
20
+
21
+
22
+
23
+
24
+
25
+ ## 4.72.1 (2022-05-31)
26
+
27
+ **Note:** Version bump only for package @patternfly/react-tokens
28
+
29
+
30
+
31
+
32
+
6
33
  # 4.72.0 (2022-05-31)
7
34
 
8
35
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-tokens",
3
- "version": "4.72.0",
3
+ "version": "4.73.0",
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": "ac2570b4006ca5bd89b16da7e499a54459f6a2a2"
38
+ "gitHead": "1aecd4152e3be5cfa7b1fb20d9797243f050253d"
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,