@patternfly/react-styles 5.4.0-prerelease.6 → 5.4.0-prerelease.8
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 +8 -0
- package/css/components/MenuToggle/menu-toggle.css +7 -0
- package/css/components/ProgressStepper/progress-stepper.css +1 -0
- package/package.json +6 -9
- package/scripts/copyStyles.mjs +8 -0
- package/scripts/{generateClassMaps.js → generateClassMaps.mjs} +8 -11
- package/scripts/{writeClassMaps.js → writeClassMaps.mjs} +15 -13
- package/scripts/copyStyles.js +0 -7
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,14 @@
|
|
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
|
+
# [5.4.0-prerelease.8](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-styles@5.4.0-prerelease.7...@patternfly/react-styles@5.4.0-prerelease.8) (2024-07-01)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @patternfly/react-styles
|
9
|
+
|
10
|
+
# [5.4.0-prerelease.7](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-styles@5.4.0-prerelease.6...@patternfly/react-styles@5.4.0-prerelease.7) (2024-06-13)
|
11
|
+
|
12
|
+
**Note:** Version bump only for package @patternfly/react-styles
|
13
|
+
|
6
14
|
# [5.4.0-prerelease.6](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-styles@5.4.0-prerelease.5...@patternfly/react-styles@5.4.0-prerelease.6) (2024-05-31)
|
7
15
|
|
8
16
|
**Note:** Version bump only for package @patternfly/react-styles
|
@@ -113,6 +113,7 @@
|
|
113
113
|
--pf-v5-c-menu-toggle__button--PaddingRight: var(--pf-v5-global--spacer--sm);
|
114
114
|
--pf-v5-c-menu-toggle__button__controls--MarginRight: var(--pf-v5-global--spacer--sm);
|
115
115
|
--pf-v5-c-menu-toggle__button__controls--MarginLeft: var(--pf-v5-global--spacer--sm);
|
116
|
+
--pf-v5-c-menu-toggle__button--m-text--PaddingInlineStart: var(--pf-v5-global--spacer--xs);
|
116
117
|
--pf-v5-c-menu-toggle--m-typeahead__controls--MarginRight: var(--pf-v5-global--spacer--sm);
|
117
118
|
--pf-v5-c-menu-toggle--m-typeahead__controls--MarginLeft: var(--pf-v5-global--spacer--sm);
|
118
119
|
--pf-v5-c-menu-toggle--m-typeahead--c-text-input-group__utilities--c-button--PaddingRight: var(--pf-v5-global--spacer--sm);
|
@@ -415,6 +416,12 @@
|
|
415
416
|
background-color: var(--pf-v5-c-menu-toggle__button--BackgroundColor);
|
416
417
|
border: 0;
|
417
418
|
}
|
419
|
+
.pf-v5-c-menu-toggle__button.pf-m-text {
|
420
|
+
--pf-v5-c-menu-toggle--m-split-button--last-child--PaddingLeft: var(--pf-v5-c-menu-toggle__button--m-text--PaddingInlineStart);
|
421
|
+
display: inline-flex;
|
422
|
+
align-items: baseline;
|
423
|
+
padding-inline-start: var(--pf-v5-c-menu-toggle__button--m-text--PaddingInlineStart);
|
424
|
+
}
|
418
425
|
|
419
426
|
.pf-v5-c-menu-toggle__icon {
|
420
427
|
flex-shrink: 0;
|
@@ -308,6 +308,7 @@
|
|
308
308
|
border: 0;
|
309
309
|
}
|
310
310
|
.pf-v5-c-progress-stepper__step-title.pf-m-help-text {
|
311
|
+
padding: 0;
|
311
312
|
text-decoration: underline;
|
312
313
|
text-decoration-thickness: var(--pf-v5-c-progress-stepper__step-title--m-help-text--TextDecorationThickness);
|
313
314
|
text-decoration-style: dashed;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@patternfly/react-styles",
|
3
|
-
"version": "5.4.0-prerelease.
|
3
|
+
"version": "5.4.0-prerelease.8",
|
4
4
|
"main": "dist/js/index.js",
|
5
5
|
"module": "dist/esm/index.js",
|
6
6
|
"types": "dist/esm/index.d.ts",
|
@@ -14,17 +14,14 @@
|
|
14
14
|
"access": "public"
|
15
15
|
},
|
16
16
|
"scripts": {
|
17
|
-
"generate": "rimraf css && node scripts/writeClassMaps.
|
17
|
+
"generate": "rimraf css && node scripts/writeClassMaps.mjs && node scripts/copyStyles.mjs",
|
18
18
|
"clean": "rimraf dist css"
|
19
19
|
},
|
20
20
|
"devDependencies": {
|
21
|
-
"@patternfly/patternfly": "5.4.0-prerelease.
|
22
|
-
"
|
23
|
-
"
|
24
|
-
"fs-extra": "^11.1.1",
|
25
|
-
"glob": "^7.1.2",
|
26
|
-
"jsdom": "^15.1.0"
|
21
|
+
"@patternfly/patternfly": "5.4.0-prerelease.5",
|
22
|
+
"change-case": "^5.4.4",
|
23
|
+
"fs-extra": "^11.2.0"
|
27
24
|
},
|
28
25
|
"license": "MIT",
|
29
|
-
"gitHead": "
|
26
|
+
"gitHead": "58f3aa5896e2111ea1ee9a680afc40929247b05a"
|
30
27
|
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { copySync } from 'fs-extra/esm';
|
2
|
+
import path from 'node:path';
|
3
|
+
import url from 'node:url';
|
4
|
+
|
5
|
+
const toDir = path.resolve(import.meta.dirname, '../css');
|
6
|
+
const fromDir = path.dirname(url.fileURLToPath(import.meta.resolve('@patternfly/patternfly/package.json')));
|
7
|
+
|
8
|
+
copySync(path.join(fromDir, 'assets/images'), path.join(toDir, 'assets/images'));
|
@@ -1,7 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
import { camelCase } from 'change-case';
|
2
|
+
import { glob } from 'glob';
|
3
|
+
import fs from 'node:fs';
|
4
|
+
import path from 'node:path';
|
5
|
+
import url from 'node:url';
|
5
6
|
|
6
7
|
/**
|
7
8
|
* @param {string} cssString - CSS string
|
@@ -14,7 +15,7 @@ function getCSSClasses(cssString) {
|
|
14
15
|
* @param {string} className - Class name
|
15
16
|
*/
|
16
17
|
function formatClassName(className) {
|
17
|
-
return
|
18
|
+
return camelCase(className.replace(/pf-(v5-)?((c|l|m|u|is|has)-)?/g, ''));
|
18
19
|
}
|
19
20
|
|
20
21
|
/**
|
@@ -53,8 +54,8 @@ function getClassMaps(cssString) {
|
|
53
54
|
/**
|
54
55
|
* @returns {any} Map of file names to classMaps
|
55
56
|
*/
|
56
|
-
function generateClassMaps() {
|
57
|
-
const pfStylesDir = path.dirname(
|
57
|
+
export function generateClassMaps() {
|
58
|
+
const pfStylesDir = path.dirname(url.fileURLToPath(import.meta.resolve('@patternfly/patternfly/patternfly.css')));
|
58
59
|
|
59
60
|
const patternflyCSSFiles = glob.sync('**/*.css', {
|
60
61
|
cwd: pfStylesDir,
|
@@ -73,7 +74,3 @@ function generateClassMaps() {
|
|
73
74
|
|
74
75
|
return res;
|
75
76
|
}
|
76
|
-
|
77
|
-
module.exports = {
|
78
|
-
generateClassMaps
|
79
|
-
};
|
@@ -1,34 +1,36 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
import { outputFileSync } from 'fs-extra/esm';
|
2
|
+
import fs from 'node:fs';
|
3
|
+
import path from 'node:path';
|
4
|
+
import url from 'node:url';
|
5
|
+
import { generateClassMaps } from './generateClassMaps.mjs';
|
4
6
|
|
5
|
-
const outDir = resolve(
|
7
|
+
const outDir = path.resolve(import.meta.dirname, '../css');
|
6
8
|
|
7
9
|
const writeCJSExport = (file, classMap) =>
|
8
10
|
outputFileSync(
|
9
|
-
join(outDir, file.replace(/.css$/, '.js')),
|
11
|
+
path.join(outDir, file.replace(/.css$/, '.js')),
|
10
12
|
`
|
11
13
|
"use strict";
|
12
14
|
exports.__esModule = true;
|
13
|
-
require('./${basename(file, '.css.js')}');
|
15
|
+
require('./${path.basename(file, '.css.js')}');
|
14
16
|
exports.default = ${JSON.stringify(classMap, null, 2)};
|
15
17
|
`.trim()
|
16
18
|
);
|
17
19
|
|
18
20
|
const writeESMExport = (file, classMap) =>
|
19
21
|
outputFileSync(
|
20
|
-
join(outDir, file.replace(/.css$/, '.mjs')),
|
22
|
+
path.join(outDir, file.replace(/.css$/, '.mjs')),
|
21
23
|
`
|
22
|
-
import './${basename(file, '.css.js')}';
|
24
|
+
import './${path.basename(file, '.css.js')}';
|
23
25
|
export default ${JSON.stringify(classMap, null, 2)};
|
24
26
|
`.trim()
|
25
27
|
);
|
26
28
|
|
27
29
|
const writeDTSExport = (file, classMap) =>
|
28
30
|
outputFileSync(
|
29
|
-
join(outDir, file.replace(/.css$/, '.d.ts')),
|
31
|
+
path.join(outDir, file.replace(/.css$/, '.d.ts')),
|
30
32
|
`
|
31
|
-
import './${basename(file, '.css.js')}';
|
33
|
+
import './${path.basename(file, '.css.js')}';
|
32
34
|
declare const _default: ${JSON.stringify(classMap, null, 2)};
|
33
35
|
export default _default;
|
34
36
|
`.trim()
|
@@ -38,15 +40,15 @@ export default _default;
|
|
38
40
|
* @param {any} classMaps Map of file names to classMaps
|
39
41
|
*/
|
40
42
|
function writeClassMaps(classMaps) {
|
41
|
-
const pfStylesDir = dirname(
|
43
|
+
const pfStylesDir = path.dirname(url.fileURLToPath(import.meta.resolve('@patternfly/patternfly/patternfly.css')));
|
42
44
|
|
43
45
|
Object.entries(classMaps).forEach(([file, classMap]) => {
|
44
|
-
const outPath = file.includes(pfStylesDir) ? relative(pfStylesDir, file) : relative('src/css', file);
|
46
|
+
const outPath = file.includes(pfStylesDir) ? path.relative(pfStylesDir, file) : path.relative('src/css', file);
|
45
47
|
|
46
48
|
writeCJSExport(outPath, classMap);
|
47
49
|
writeDTSExport(outPath, classMap);
|
48
50
|
writeESMExport(outPath, classMap);
|
49
|
-
copyFileSync(file, join(outDir, outPath));
|
51
|
+
fs.copyFileSync(file, path.join(outDir, outPath));
|
50
52
|
});
|
51
53
|
|
52
54
|
// eslint-disable-next-line no-console
|
package/scripts/copyStyles.js
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
const { copySync } = require('fs-extra');
|
2
|
-
const { resolve, dirname, join } = require('path');
|
3
|
-
|
4
|
-
const toDir = resolve(__dirname, '../css');
|
5
|
-
const fromDir = dirname(require.resolve('@patternfly/patternfly/package.json'));
|
6
|
-
|
7
|
-
copySync(join(fromDir, 'assets/images'), join(toDir, 'assets/images'));
|