@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.
Files changed (122) hide show
  1. package/dist/icons.bundle.js +1 -1
  2. package/icons.json +1102 -544
  3. package/lib/cjs/generated/16px/blueprint-icons-16.d.ts +4 -2
  4. package/lib/cjs/generated/16px/blueprint-icons-16.js +4 -0
  5. package/lib/cjs/generated/16px/blueprint-icons-16.js.map +1 -1
  6. package/lib/cjs/generated/16px/paths/index.d.ts +2 -0
  7. package/lib/cjs/generated/16px/paths/index.js +8 -4
  8. package/lib/cjs/generated/16px/paths/index.js.map +1 -1
  9. package/lib/cjs/generated/16px/paths/rectangle.d.ts +2 -0
  10. package/lib/cjs/generated/16px/paths/rectangle.js +4 -0
  11. package/lib/cjs/generated/16px/paths/rectangle.js.map +1 -0
  12. package/lib/cjs/generated/16px/paths/symbol-rectangle.d.ts +2 -0
  13. package/lib/cjs/generated/16px/paths/symbol-rectangle.js +4 -0
  14. package/lib/cjs/generated/16px/paths/symbol-rectangle.js.map +1 -0
  15. package/lib/cjs/generated/20px/blueprint-icons-20.d.ts +4 -2
  16. package/lib/cjs/generated/20px/blueprint-icons-20.js +4 -0
  17. package/lib/cjs/generated/20px/blueprint-icons-20.js.map +1 -1
  18. package/lib/cjs/generated/20px/paths/index.d.ts +2 -0
  19. package/lib/cjs/generated/20px/paths/index.js +8 -4
  20. package/lib/cjs/generated/20px/paths/index.js.map +1 -1
  21. package/lib/cjs/generated/20px/paths/rectangle.d.ts +2 -0
  22. package/lib/cjs/generated/20px/paths/rectangle.js +4 -0
  23. package/lib/cjs/generated/20px/paths/rectangle.js.map +1 -0
  24. package/lib/cjs/generated/20px/paths/symbol-rectangle.d.ts +2 -0
  25. package/lib/cjs/generated/20px/paths/symbol-rectangle.js +4 -0
  26. package/lib/cjs/generated/20px/paths/symbol-rectangle.js.map +1 -0
  27. package/lib/cjs/iconCodepoints.d.ts +2 -0
  28. package/lib/cjs/iconNames.d.ts +32 -28
  29. package/lib/cjs/iconNames.js +2 -2
  30. package/lib/cjs/iconNames.js.map +1 -1
  31. package/lib/cjs/iconSvgPaths.js +1 -1
  32. package/lib/cjs/iconSvgPaths.js.map +1 -1
  33. package/lib/css/blueprint-icons-16.eot +0 -0
  34. package/lib/css/blueprint-icons-16.ttf +0 -0
  35. package/lib/css/blueprint-icons-16.woff +0 -0
  36. package/lib/css/blueprint-icons-16.woff2 +0 -0
  37. package/lib/css/blueprint-icons-20.eot +0 -0
  38. package/lib/css/blueprint-icons-20.ttf +0 -0
  39. package/lib/css/blueprint-icons-20.woff +0 -0
  40. package/lib/css/blueprint-icons-20.woff2 +0 -0
  41. package/lib/css/blueprint-icons.css +2 -2
  42. package/lib/css/blueprint-icons.css.map +1 -1
  43. package/lib/esm/generated/16px/blueprint-icons-16.d.ts +4 -2
  44. package/lib/esm/generated/16px/blueprint-icons-16.js +4 -0
  45. package/lib/esm/generated/16px/blueprint-icons-16.js.map +1 -1
  46. package/lib/esm/generated/16px/paths/index.d.ts +2 -0
  47. package/lib/esm/generated/16px/paths/index.js +2 -0
  48. package/lib/esm/generated/16px/paths/index.js.map +1 -1
  49. package/lib/esm/generated/16px/paths/rectangle.d.ts +2 -0
  50. package/lib/esm/generated/16px/paths/rectangle.js +2 -0
  51. package/lib/esm/generated/16px/paths/rectangle.js.map +1 -0
  52. package/lib/esm/generated/16px/paths/symbol-rectangle.d.ts +2 -0
  53. package/lib/esm/generated/16px/paths/symbol-rectangle.js +2 -0
  54. package/lib/esm/generated/16px/paths/symbol-rectangle.js.map +1 -0
  55. package/lib/esm/generated/20px/blueprint-icons-20.d.ts +4 -2
  56. package/lib/esm/generated/20px/blueprint-icons-20.js +4 -0
  57. package/lib/esm/generated/20px/blueprint-icons-20.js.map +1 -1
  58. package/lib/esm/generated/20px/paths/index.d.ts +2 -0
  59. package/lib/esm/generated/20px/paths/index.js +2 -0
  60. package/lib/esm/generated/20px/paths/index.js.map +1 -1
  61. package/lib/esm/generated/20px/paths/rectangle.d.ts +2 -0
  62. package/lib/esm/generated/20px/paths/rectangle.js +2 -0
  63. package/lib/esm/generated/20px/paths/rectangle.js.map +1 -0
  64. package/lib/esm/generated/20px/paths/symbol-rectangle.d.ts +2 -0
  65. package/lib/esm/generated/20px/paths/symbol-rectangle.js +2 -0
  66. package/lib/esm/generated/20px/paths/symbol-rectangle.js.map +1 -0
  67. package/lib/esm/iconCodepoints.d.ts +2 -0
  68. package/lib/esm/iconNames.d.ts +32 -28
  69. package/lib/esnext/generated/16px/blueprint-icons-16.d.ts +4 -2
  70. package/lib/esnext/generated/16px/blueprint-icons-16.js +4 -0
  71. package/lib/esnext/generated/16px/blueprint-icons-16.js.map +1 -1
  72. package/lib/esnext/generated/16px/paths/index.d.ts +2 -0
  73. package/lib/esnext/generated/16px/paths/index.js +2 -0
  74. package/lib/esnext/generated/16px/paths/index.js.map +1 -1
  75. package/lib/esnext/generated/16px/paths/rectangle.d.ts +2 -0
  76. package/lib/esnext/generated/16px/paths/rectangle.js +2 -0
  77. package/lib/esnext/generated/16px/paths/rectangle.js.map +1 -0
  78. package/lib/esnext/generated/16px/paths/symbol-rectangle.d.ts +2 -0
  79. package/lib/esnext/generated/16px/paths/symbol-rectangle.js +2 -0
  80. package/lib/esnext/generated/16px/paths/symbol-rectangle.js.map +1 -0
  81. package/lib/esnext/generated/20px/blueprint-icons-20.d.ts +4 -2
  82. package/lib/esnext/generated/20px/blueprint-icons-20.js +4 -0
  83. package/lib/esnext/generated/20px/blueprint-icons-20.js.map +1 -1
  84. package/lib/esnext/generated/20px/paths/index.d.ts +2 -0
  85. package/lib/esnext/generated/20px/paths/index.js +2 -0
  86. package/lib/esnext/generated/20px/paths/index.js.map +1 -1
  87. package/lib/esnext/generated/20px/paths/rectangle.d.ts +2 -0
  88. package/lib/esnext/generated/20px/paths/rectangle.js +2 -0
  89. package/lib/esnext/generated/20px/paths/rectangle.js.map +1 -0
  90. package/lib/esnext/generated/20px/paths/symbol-rectangle.d.ts +2 -0
  91. package/lib/esnext/generated/20px/paths/symbol-rectangle.js +2 -0
  92. package/lib/esnext/generated/20px/paths/symbol-rectangle.js.map +1 -0
  93. package/lib/esnext/iconCodepoints.d.ts +2 -0
  94. package/lib/esnext/iconNames.d.ts +32 -28
  95. package/lib/scss/blueprint-icons-16.scss +499 -497
  96. package/package.json +7 -7
  97. package/scripts/copy-fonts.sh +1 -1
  98. package/scripts/generate-icon-fonts.js +50 -53
  99. package/scripts/generate-icon-paths.js +6 -8
  100. package/src/generated/16px/_icon-variables.scss +499 -497
  101. package/src/generated/16px/blueprint-icons-16.css +4 -5
  102. package/src/generated/16px/blueprint-icons-16.eot +0 -0
  103. package/src/generated/16px/blueprint-icons-16.ts +8 -0
  104. package/src/generated/16px/blueprint-icons-16.ttf +0 -0
  105. package/src/generated/16px/blueprint-icons-16.woff +0 -0
  106. package/src/generated/16px/blueprint-icons-16.woff2 +0 -0
  107. package/src/generated/16px/paths/index.ts +2 -0
  108. package/src/generated/16px/paths/rectangle.ts +1 -0
  109. package/src/generated/16px/paths/symbol-rectangle.ts +1 -0
  110. package/src/generated/20px/blueprint-icons-20.css +4 -5
  111. package/src/generated/20px/blueprint-icons-20.eot +0 -0
  112. package/src/generated/20px/blueprint-icons-20.ts +8 -0
  113. package/src/generated/20px/blueprint-icons-20.ttf +0 -0
  114. package/src/generated/20px/blueprint-icons-20.woff +0 -0
  115. package/src/generated/20px/blueprint-icons-20.woff2 +0 -0
  116. package/src/generated/20px/paths/index.ts +2 -0
  117. package/src/generated/20px/paths/rectangle.ts +1 -0
  118. package/src/generated/20px/paths/symbol-rectangle.ts +1 -0
  119. package/lib/css/blueprint-icons-16.svg +0 -1644
  120. package/lib/css/blueprint-icons-20.svg +0 -1644
  121. package/src/generated/16px/blueprint-icons-16.svg +0 -1644
  122. 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-beta.8",
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": "~1.13.0"
41
+ "tslib": "~2.3.1"
42
42
  },
43
43
  "devDependencies": {
44
- "@blueprintjs/node-build-scripts": "^2.0.0-beta.1",
45
- "@blueprintjs/test-commons": "^1.0.0-beta.2",
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.2",
48
- "mocha": "^8.2.1",
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.1.2",
54
+ "typescript": "~4.6.2",
55
55
  "webpack-cli": "^3.3.12"
56
56
  },
57
57
  "repository": {
@@ -12,7 +12,7 @@ mkdir -p "$OUTPUT"
12
12
  iconSizes=(16 20)
13
13
 
14
14
  for size in "${iconSizes[@]}"; do
15
- for font in "$INPUT"/"$size"px/*.{eot,svg,ttf,woff,woff2}; do
15
+ for font in "$INPUT"/"$size"px/*.{eot,ttf,woff,woff2}; do
16
16
  cp "$font" "$OUTPUT/"
17
17
  done
18
18
  done
@@ -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
- logger.start();
29
+ const codepoints = {};
29
30
 
30
- fs.mkdirSync(path.join(GENERATED_SRC_DIR, `16px/paths`), { recursive: true });
31
- generateFonts({
32
- name: "blueprint-icons-16",
33
- inputDir: path.join(RESOURCES_DIR, "16px"),
34
- outputDir: path.join(GENERATED_SRC_DIR, "16px"),
35
- fontHeight: 16,
36
- fontTypes: [FontAssetType.TTF, FontAssetType.EOT, FontAssetType.WOFF2, FontAssetType.WOFF, FontAssetType.SVG],
37
- // CSS contains @font-face, SCSS contains codepoints, TS contains enums & codepoints
38
- assetTypes: [OtherAssetType.CSS, OtherAssetType.SCSS, OtherAssetType.TS],
39
- templates: {
40
- // N.B. we don't generate CSS, just the map of code points which we can use downstream
41
- scss: path.resolve(__dirname, "./icons-16.scss.hbs"),
42
- css: path.resolve(__dirname, "./icons.css.hbs"),
43
- },
44
- pathOptions: {
45
- scss: path.join(GENERATED_SRC_DIR, "16px", "_icon-variables.scss"),
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
- fs.mkdirSync(path.join(GENERATED_SRC_DIR, `20px/paths`), { recursive: true });
58
- generateFonts({
59
- name: "blueprint-icons-20",
60
- inputDir: path.join(RESOURCES_DIR, "20px"),
61
- outputDir: path.join(GENERATED_SRC_DIR, "20px"),
62
- fontHeight: 20,
63
- fontTypes: [FontAssetType.TTF, FontAssetType.EOT, FontAssetType.WOFF2, FontAssetType.WOFF, FontAssetType.SVG],
64
- // CSS contains @font-face, SCSS contains codepoints, TS contains enums & codepoints
65
- assetTypes: [OtherAssetType.CSS, OtherAssetType.SCSS, OtherAssetType.TS],
66
- templates: {
67
- // N.B. here we don't generate CSS, or even the code points (we expect them to be the same as icons-16)
68
- scss: path.resolve(__dirname, "./icons-20.scss.hbs"),
69
- css: path.resolve(__dirname, "./icons.css.hbs"),
70
- },
71
- pathOptions: {
72
- scss: path.join(GENERATED_SRC_DIR, "20px", "_icon-variables.scss"),
73
- },
74
- tag: "i",
75
- prefix: `${NS}-icon-large`,
76
- })
77
- .then(results => {
78
- logger.results(results);
79
- })
80
- .catch(error => {
81
- logger.error(error);
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 = pathStrings.length > 0
51
- ? `export default [${pathStrings.join(", ")}];`
52
- // special case for "blank" icon - we need an explicit typedef
53
- : `const p: string[] = []; export default p;`
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...`);