@blueprintjs/icons 4.0.0-beta.8 → 4.0.0-rc.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/dist/icons.bundle.js +1 -1
- package/icons.json +1102 -544
- package/lib/cjs/generated/16px/blueprint-icons-16.d.ts +4 -2
- package/lib/cjs/generated/16px/blueprint-icons-16.js +4 -0
- package/lib/cjs/generated/16px/blueprint-icons-16.js.map +1 -1
- package/lib/cjs/generated/16px/paths/index.d.ts +2 -0
- package/lib/cjs/generated/16px/paths/index.js +8 -4
- package/lib/cjs/generated/16px/paths/index.js.map +1 -1
- package/lib/cjs/generated/16px/paths/rectangle.d.ts +2 -0
- package/lib/cjs/generated/16px/paths/rectangle.js +4 -0
- package/lib/cjs/generated/16px/paths/rectangle.js.map +1 -0
- package/lib/cjs/generated/16px/paths/symbol-rectangle.d.ts +2 -0
- package/lib/cjs/generated/16px/paths/symbol-rectangle.js +4 -0
- package/lib/cjs/generated/16px/paths/symbol-rectangle.js.map +1 -0
- package/lib/cjs/generated/20px/blueprint-icons-20.d.ts +4 -2
- package/lib/cjs/generated/20px/blueprint-icons-20.js +4 -0
- package/lib/cjs/generated/20px/blueprint-icons-20.js.map +1 -1
- package/lib/cjs/generated/20px/paths/index.d.ts +2 -0
- package/lib/cjs/generated/20px/paths/index.js +8 -4
- package/lib/cjs/generated/20px/paths/index.js.map +1 -1
- package/lib/cjs/generated/20px/paths/rectangle.d.ts +2 -0
- package/lib/cjs/generated/20px/paths/rectangle.js +4 -0
- package/lib/cjs/generated/20px/paths/rectangle.js.map +1 -0
- package/lib/cjs/generated/20px/paths/symbol-rectangle.d.ts +2 -0
- package/lib/cjs/generated/20px/paths/symbol-rectangle.js +4 -0
- package/lib/cjs/generated/20px/paths/symbol-rectangle.js.map +1 -0
- package/lib/cjs/iconCodepoints.d.ts +2 -0
- package/lib/cjs/iconNames.d.ts +32 -28
- package/lib/cjs/iconNames.js +2 -2
- package/lib/cjs/iconNames.js.map +1 -1
- package/lib/cjs/iconSvgPaths.js +1 -1
- package/lib/cjs/iconSvgPaths.js.map +1 -1
- package/lib/css/blueprint-icons-16.eot +0 -0
- package/lib/css/blueprint-icons-16.ttf +0 -0
- package/lib/css/blueprint-icons-16.woff +0 -0
- package/lib/css/blueprint-icons-16.woff2 +0 -0
- package/lib/css/blueprint-icons-20.eot +0 -0
- package/lib/css/blueprint-icons-20.ttf +0 -0
- package/lib/css/blueprint-icons-20.woff +0 -0
- package/lib/css/blueprint-icons-20.woff2 +0 -0
- package/lib/css/blueprint-icons.css +2 -2
- package/lib/css/blueprint-icons.css.map +1 -1
- package/lib/esm/generated/16px/blueprint-icons-16.d.ts +4 -2
- package/lib/esm/generated/16px/blueprint-icons-16.js +4 -0
- package/lib/esm/generated/16px/blueprint-icons-16.js.map +1 -1
- package/lib/esm/generated/16px/paths/index.d.ts +2 -0
- package/lib/esm/generated/16px/paths/index.js +2 -0
- package/lib/esm/generated/16px/paths/index.js.map +1 -1
- package/lib/esm/generated/16px/paths/rectangle.d.ts +2 -0
- package/lib/esm/generated/16px/paths/rectangle.js +2 -0
- package/lib/esm/generated/16px/paths/rectangle.js.map +1 -0
- package/lib/esm/generated/16px/paths/symbol-rectangle.d.ts +2 -0
- package/lib/esm/generated/16px/paths/symbol-rectangle.js +2 -0
- package/lib/esm/generated/16px/paths/symbol-rectangle.js.map +1 -0
- package/lib/esm/generated/20px/blueprint-icons-20.d.ts +4 -2
- package/lib/esm/generated/20px/blueprint-icons-20.js +4 -0
- package/lib/esm/generated/20px/blueprint-icons-20.js.map +1 -1
- package/lib/esm/generated/20px/paths/index.d.ts +2 -0
- package/lib/esm/generated/20px/paths/index.js +2 -0
- package/lib/esm/generated/20px/paths/index.js.map +1 -1
- package/lib/esm/generated/20px/paths/rectangle.d.ts +2 -0
- package/lib/esm/generated/20px/paths/rectangle.js +2 -0
- package/lib/esm/generated/20px/paths/rectangle.js.map +1 -0
- package/lib/esm/generated/20px/paths/symbol-rectangle.d.ts +2 -0
- package/lib/esm/generated/20px/paths/symbol-rectangle.js +2 -0
- package/lib/esm/generated/20px/paths/symbol-rectangle.js.map +1 -0
- package/lib/esm/iconCodepoints.d.ts +2 -0
- package/lib/esm/iconNames.d.ts +32 -28
- package/lib/esnext/generated/16px/blueprint-icons-16.d.ts +4 -2
- package/lib/esnext/generated/16px/blueprint-icons-16.js +4 -0
- package/lib/esnext/generated/16px/blueprint-icons-16.js.map +1 -1
- package/lib/esnext/generated/16px/paths/index.d.ts +2 -0
- package/lib/esnext/generated/16px/paths/index.js +2 -0
- package/lib/esnext/generated/16px/paths/index.js.map +1 -1
- package/lib/esnext/generated/16px/paths/rectangle.d.ts +2 -0
- package/lib/esnext/generated/16px/paths/rectangle.js +2 -0
- package/lib/esnext/generated/16px/paths/rectangle.js.map +1 -0
- package/lib/esnext/generated/16px/paths/symbol-rectangle.d.ts +2 -0
- package/lib/esnext/generated/16px/paths/symbol-rectangle.js +2 -0
- package/lib/esnext/generated/16px/paths/symbol-rectangle.js.map +1 -0
- package/lib/esnext/generated/20px/blueprint-icons-20.d.ts +4 -2
- package/lib/esnext/generated/20px/blueprint-icons-20.js +4 -0
- package/lib/esnext/generated/20px/blueprint-icons-20.js.map +1 -1
- package/lib/esnext/generated/20px/paths/index.d.ts +2 -0
- package/lib/esnext/generated/20px/paths/index.js +2 -0
- package/lib/esnext/generated/20px/paths/index.js.map +1 -1
- package/lib/esnext/generated/20px/paths/rectangle.d.ts +2 -0
- package/lib/esnext/generated/20px/paths/rectangle.js +2 -0
- package/lib/esnext/generated/20px/paths/rectangle.js.map +1 -0
- package/lib/esnext/generated/20px/paths/symbol-rectangle.d.ts +2 -0
- package/lib/esnext/generated/20px/paths/symbol-rectangle.js +2 -0
- package/lib/esnext/generated/20px/paths/symbol-rectangle.js.map +1 -0
- package/lib/esnext/iconCodepoints.d.ts +2 -0
- package/lib/esnext/iconNames.d.ts +32 -28
- package/lib/scss/blueprint-icons-16.scss +499 -497
- package/package.json +7 -7
- package/scripts/copy-fonts.sh +1 -1
- package/scripts/generate-icon-fonts.js +50 -53
- package/scripts/generate-icon-paths.js +6 -8
- package/src/generated/16px/_icon-variables.scss +499 -497
- package/src/generated/16px/blueprint-icons-16.css +4 -5
- package/src/generated/16px/blueprint-icons-16.eot +0 -0
- package/src/generated/16px/blueprint-icons-16.ts +8 -0
- package/src/generated/16px/blueprint-icons-16.ttf +0 -0
- package/src/generated/16px/blueprint-icons-16.woff +0 -0
- package/src/generated/16px/blueprint-icons-16.woff2 +0 -0
- package/src/generated/16px/paths/index.ts +2 -0
- package/src/generated/16px/paths/rectangle.ts +1 -0
- package/src/generated/16px/paths/symbol-rectangle.ts +1 -0
- package/src/generated/20px/blueprint-icons-20.css +4 -5
- package/src/generated/20px/blueprint-icons-20.eot +0 -0
- package/src/generated/20px/blueprint-icons-20.ts +8 -0
- package/src/generated/20px/blueprint-icons-20.ttf +0 -0
- package/src/generated/20px/blueprint-icons-20.woff +0 -0
- package/src/generated/20px/blueprint-icons-20.woff2 +0 -0
- package/src/generated/20px/paths/index.ts +2 -0
- package/src/generated/20px/paths/rectangle.ts +1 -0
- package/src/generated/20px/paths/symbol-rectangle.ts +1 -0
- package/lib/css/blueprint-icons-16.svg +0 -1644
- package/lib/css/blueprint-icons-20.svg +0 -1644
- package/src/generated/16px/blueprint-icons-16.svg +0 -1644
- package/src/generated/20px/blueprint-icons-20.svg +0 -1644
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blueprintjs/icons",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-rc.2",
|
|
4
4
|
"description": "Components, fonts, icons, and css files for creating and displaying icons.",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -38,20 +38,20 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"change-case": "^4.1.2",
|
|
40
40
|
"classnames": "^2.2",
|
|
41
|
-
"tslib": "~
|
|
41
|
+
"tslib": "~2.3.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@blueprintjs/node-build-scripts": "^2.0.0-
|
|
45
|
-
"@blueprintjs/test-commons": "^1.0.0-
|
|
44
|
+
"@blueprintjs/node-build-scripts": "^2.0.0-rc.2",
|
|
45
|
+
"@blueprintjs/test-commons": "^1.0.0-rc.2",
|
|
46
46
|
"enzyme": "^3.11.0",
|
|
47
|
-
"fantasticon": "^1.2.
|
|
48
|
-
"mocha": "^
|
|
47
|
+
"fantasticon": "^1.2.3",
|
|
48
|
+
"mocha": "^9.2.2",
|
|
49
49
|
"npm-run-all": "^4.1.5",
|
|
50
50
|
"react": "^16.14.0",
|
|
51
51
|
"react-dom": "^16.14.0",
|
|
52
52
|
"react-test-renderer": "^16.14.0",
|
|
53
53
|
"svgo": "^1.3.2",
|
|
54
|
-
"typescript": "~4.
|
|
54
|
+
"typescript": "~4.6.2",
|
|
55
55
|
"webpack-cli": "^3.3.12"
|
|
56
56
|
},
|
|
57
57
|
"repository": {
|
package/scripts/copy-fonts.sh
CHANGED
|
@@ -17,66 +17,63 @@
|
|
|
17
17
|
* @fileoverview Generates icon fonts and codepoints from SVG sources
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
const { generateFonts, FontAssetType, OtherAssetType } = require("fantasticon");
|
|
20
|
+
const { generateFonts: runFantasticon, FontAssetType, OtherAssetType } = require("fantasticon");
|
|
21
21
|
const { getLogger } = require("fantasticon/lib/cli/logger");
|
|
22
22
|
const fs = require("fs");
|
|
23
23
|
const path = require("path");
|
|
24
24
|
|
|
25
|
+
const iconsMetadata = require("../icons.json");
|
|
25
26
|
const { RESOURCES_DIR, GENERATED_SRC_DIR, NS } = require("./common");
|
|
26
27
|
|
|
27
28
|
const logger = getLogger();
|
|
28
|
-
|
|
29
|
+
const codepoints = {};
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
tag: "i",
|
|
48
|
-
prefix: `${NS}-icon-standard`,
|
|
49
|
-
})
|
|
50
|
-
.then(results => {
|
|
51
|
-
logger.results(results);
|
|
52
|
-
})
|
|
53
|
-
.catch(error => {
|
|
54
|
-
logger.error(error);
|
|
55
|
-
});
|
|
31
|
+
(async function () {
|
|
32
|
+
for (const icon of iconsMetadata) {
|
|
33
|
+
if (Object.values(codepoints).indexOf(icon.codepoint) !== -1) {
|
|
34
|
+
throw new Error(
|
|
35
|
+
`[generate-icon-fonts] Invalid metadata entry in icons.json: icon "${icon.iconName}" cannot have codepoint ${icon.codepoint}, it is already in use.`,
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
codepoints[icon.iconName] = icon.codepoint;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
logger.start();
|
|
42
|
+
await Promise.all([
|
|
43
|
+
connectToLogger(generateFonts(16, `${NS}-icon-standard`)),
|
|
44
|
+
connectToLogger(generateFonts(20, `${NS}-icon-large`)),
|
|
45
|
+
]);
|
|
46
|
+
})();
|
|
56
47
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
48
|
+
async function generateFonts(size, prefix) {
|
|
49
|
+
fs.mkdirSync(path.join(GENERATED_SRC_DIR, `${size}px/paths`), { recursive: true });
|
|
50
|
+
return runFantasticon({
|
|
51
|
+
name: `blueprint-icons-${size}`,
|
|
52
|
+
inputDir: path.join(RESOURCES_DIR, `${size}px`),
|
|
53
|
+
outputDir: path.join(GENERATED_SRC_DIR, `${size}px`),
|
|
54
|
+
normalize: true,
|
|
55
|
+
descent: 0,
|
|
56
|
+
// N.B. Important: we need to scale up the font height so that the icons do not get visually degraded
|
|
57
|
+
// or compressed through rounding errors (svgicons2svgfont rasterizes the icons in order to convert them)
|
|
58
|
+
// See https://github.com/palantir/blueprint/issues/5002
|
|
59
|
+
fontHeight: size * 20,
|
|
60
|
+
fontTypes: [FontAssetType.TTF, FontAssetType.EOT, FontAssetType.WOFF2, FontAssetType.WOFF],
|
|
61
|
+
// CSS contains @font-face, SCSS contains codepoints, TS contains enums & codepoints
|
|
62
|
+
assetTypes: [OtherAssetType.CSS, OtherAssetType.SCSS, OtherAssetType.TS],
|
|
63
|
+
templates: {
|
|
64
|
+
// N.B. in icons-20, we don't generate CSS or the codepoints since we expect them to be the same as icons-16
|
|
65
|
+
scss: path.resolve(__dirname, `./icons-${size}.scss.hbs`),
|
|
66
|
+
css: path.resolve(__dirname, "./icons.css.hbs"),
|
|
67
|
+
},
|
|
68
|
+
pathOptions: {
|
|
69
|
+
scss: path.join(GENERATED_SRC_DIR, `${size}px`, "_icon-variables.scss"),
|
|
70
|
+
},
|
|
71
|
+
codepoints,
|
|
72
|
+
tag: "i",
|
|
73
|
+
prefix,
|
|
82
74
|
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function connectToLogger(runner) {
|
|
78
|
+
return runner.then(results => logger.results(results)).catch(error => logger.error(error));
|
|
79
|
+
}
|
|
@@ -47,15 +47,13 @@ const ICON_NAMES = ICONS_METADATA.map(icon => icon.iconName);
|
|
|
47
47
|
const iconPaths = await getIconPaths(iconSize);
|
|
48
48
|
|
|
49
49
|
for (const [iconName, pathStrings] of Object.entries(iconPaths)) {
|
|
50
|
-
const line =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
const line =
|
|
51
|
+
pathStrings.length > 0
|
|
52
|
+
? `export default [${pathStrings.join(", ")}];`
|
|
53
|
+
: // special case for "blank" icon - we need an explicit typedef
|
|
54
|
+
`const p: string[] = []; export default p;`;
|
|
54
55
|
|
|
55
|
-
writeLinesToFile(
|
|
56
|
-
`${iconSize}px/paths/${iconName}.ts`,
|
|
57
|
-
line,
|
|
58
|
-
);
|
|
56
|
+
writeLinesToFile(`${iconSize}px/paths/${iconName}.ts`, line);
|
|
59
57
|
}
|
|
60
58
|
|
|
61
59
|
console.info(`Writing index file for ${iconSize}px icon kit paths...`);
|