@ebay/skin 16.0.0-2 → 16.1.0-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.
Files changed (269) hide show
  1. package/.github/workflows/jekyll-gh-pages.yml +56 -0
  2. package/.github/workflows/pages-html-proofer.yml +5 -0
  3. package/.percy.yml +4 -3
  4. package/.prettierrc.json +1 -12
  5. package/.storybook/main.js +44 -40
  6. package/.storybook/manager.js +6 -6
  7. package/.storybook/preview-head.html +49 -11
  8. package/.storybook/theme.js +9 -9
  9. package/.stylelintrc +80 -73
  10. package/ICON-CREATION.md +22 -45
  11. package/README.md +1 -1
  12. package/_cdn/skin/v16.1.0-0/skin-default.min.css +6 -0
  13. package/_cdn/skin/v16.1.0-0/skin-full.min.css +6 -0
  14. package/_cdn/skin/v16.1.0-0/skin-headless.min.css +6 -0
  15. package/_cdn/skin/v16.1.0-0/skin-legacy.min.css +6 -0
  16. package/dist/alert-dialog/alert-dialog.css +16 -11
  17. package/dist/breadcrumbs/breadcrumbs.css +1 -1
  18. package/dist/button/button.css +3 -5
  19. package/dist/calendar/calendar.css +11 -10
  20. package/dist/carousel/carousel.css +11 -15
  21. package/dist/combobox/combobox.css +0 -2
  22. package/dist/confirm-dialog/confirm-dialog.css +16 -11
  23. package/dist/date-textbox/date-textbox.css +4 -1
  24. package/dist/drawer-dialog/drawer-dialog.css +11 -8
  25. package/dist/fullscreen-dialog/fullscreen-dialog.css +11 -8
  26. package/dist/icon/icon.css +17 -5
  27. package/dist/image-placeholder/image-placeholder.css +4 -0
  28. package/dist/infotip/infotip.css +2 -5
  29. package/dist/legacy-theme/legacy-theme.css +2 -2
  30. package/dist/legacy-tokens/ds4-light.css +2 -0
  31. package/dist/lightbox-dialog/lightbox-dialog.css +24 -17
  32. package/dist/listbox/listbox.css +0 -2
  33. package/dist/listbox-button/listbox-button.css +0 -2
  34. package/dist/menu/menu.css +0 -2
  35. package/dist/menu-button/menu-button.css +0 -2
  36. package/dist/mixins/utility-mixins.less +1 -4
  37. package/dist/page-grid/page-grid.css +15 -5
  38. package/dist/page-notice/page-notice.css +1 -1
  39. package/dist/panel-dialog/panel-dialog.css +12 -9
  40. package/dist/progress-bar/progress-bar.css +1 -1
  41. package/dist/progress-stepper/progress-stepper.css +1 -1
  42. package/dist/section-notice/section-notice.css +1 -1
  43. package/dist/section-title/section-title.css +1 -1
  44. package/dist/snackbar-dialog/snackbar-dialog.css +7 -1
  45. package/dist/square-corner-theme/square-corner-theme.css +3 -3
  46. package/dist/svg/icon/icon-bookmark-16.svg +7 -0
  47. package/dist/svg/icon/icon-bookmark-24.svg +7 -0
  48. package/dist/svg/icon/icon-play-filled-16-colored.svg +13 -0
  49. package/dist/svg/icon/icon-play-filled-24-colored.svg +11 -0
  50. package/dist/svg/icon/image-placeholder.svg +3 -0
  51. package/dist/svg/icons.svg +49 -11
  52. package/dist/toast-dialog/toast-dialog.css +7 -1
  53. package/dist/tokens/evo-dark.css +2 -0
  54. package/dist/tokens/evo-light.css +2 -0
  55. package/dist/tooltip/tooltip.css +2 -5
  56. package/dist/tourtip/tourtip.css +2 -5
  57. package/dist/typography/typography.css +1 -1
  58. package/dist/utility/utility.css +2 -8
  59. package/dist/video/video.css +1 -4
  60. package/image-placeholder.browser.json +1 -0
  61. package/image-placeholder.css +1 -0
  62. package/image-placeholder.js +1 -0
  63. package/image-placeholder.mjs +1 -0
  64. package/index.browser.json +1 -0
  65. package/index.css +1 -0
  66. package/index.js +1 -0
  67. package/index.mjs +1 -0
  68. package/package.json +13 -12
  69. package/scripts/develop-module_proper/code-generators/doc-generator.js +32 -16
  70. package/scripts/develop-module_proper/code-generators/style-generator.js +89 -34
  71. package/scripts/develop-module_proper/code-generators/test-generator.js +18 -12
  72. package/scripts/develop-module_proper/errors/illegal-input.js +1 -1
  73. package/scripts/develop-module_proper/index.js +6 -6
  74. package/scripts/develop-module_proper/input/module-name.js +9 -7
  75. package/scripts/develop-module_proper/input/parse-input.js +10 -8
  76. package/scripts/develop-module_proper/util/line-writer.js +31 -18
  77. package/scripts/develop-module_proper/util/title-case.js +4 -3
  78. package/scripts/generate-bundle.js +58 -33
  79. package/scripts/generate-images.js +72 -45
  80. package/scripts/generate-imports/config.json +21 -3
  81. package/scripts/generate-imports/index.js +35 -29
  82. package/scripts/generate-imports/module-builder.js +58 -36
  83. package/scripts/import-svgs.js +33 -25
  84. package/scripts/index.js +68 -68
  85. package/scripts/jekyll-config.js +8 -5
  86. package/scripts/log.js +5 -3
  87. package/scripts/split-icon.js +20 -15
  88. package/scripts/storybook/copy.js +29 -10
  89. package/scripts/svgo.config.js +42 -42
  90. package/scripts/util.js +15 -11
  91. package/scripts/verify-build.js +12 -12
  92. package/src/fonts/marketsans/MarketSans-Regular-WebS.css +6 -3
  93. package/src/fonts/marketsans/MarketSans-SemiBold-WebS.css +6 -3
  94. package/src/less/alert-dialog/alert-dialog.less +5 -6
  95. package/src/less/alert-dialog/stories/alert-dialog.stories.js +1 -1
  96. package/src/less/badge/stories/badge.stories.js +1 -1
  97. package/src/less/breadcrumbs/breadcrumbs.less +5 -2
  98. package/src/less/breadcrumbs/stories/button-cascade.stories.js +1 -1
  99. package/src/less/breadcrumbs/stories/button-overflow.stories.js +1 -1
  100. package/src/less/breadcrumbs/stories/buttons.stories.js +1 -1
  101. package/src/less/breadcrumbs/stories/link-cascade.stories.js +1 -1
  102. package/src/less/breadcrumbs/stories/link-overflow.stories.js +1 -1
  103. package/src/less/breadcrumbs/stories/links.stories.js +1 -1
  104. package/src/less/bundles/skin-headless.less +1 -0
  105. package/src/less/button/button.less +16 -10
  106. package/src/less/button/stories/button/base.stories.js +1 -1
  107. package/src/less/button/stories/button/borderless.stories.js +5 -3
  108. package/src/less/button/stories/button/cascade.stories.js +1 -1
  109. package/src/less/button/stories/button/dimensions.stories.js +1 -1
  110. package/src/less/button/stories/button/primary.stories.js +3 -2
  111. package/src/less/button/stories/button/secondary.stories.js +3 -2
  112. package/src/less/button/stories/button/tertiary.stories.js +1 -1
  113. package/src/less/button/stories/destructive-button/primary.stories.js +1 -1
  114. package/src/less/button/stories/destructive-button/secondary.stories.js +1 -1
  115. package/src/less/button/stories/destructive-button/tertiary.stories.js +1 -1
  116. package/src/less/button/stories/fake-button/base.stories.js +3 -2
  117. package/src/less/button/stories/fake-button/cascade.stories.js +1 -1
  118. package/src/less/button/stories/fake-button/dimensions.stories.js +1 -1
  119. package/src/less/button/stories/fake-button/primary.stories.js +1 -1
  120. package/src/less/button/stories/fake-button/secondary.stories.js +1 -1
  121. package/src/less/calendar/calendar.less +31 -13
  122. package/src/less/calendar/stories/calendar.stories.js +601 -108
  123. package/src/less/carousel/carousel.less +14 -9
  124. package/src/less/carousel/stories/carousel.stories.js +1 -1
  125. package/src/less/checkbox/checkbox.less +14 -5
  126. package/src/less/checkbox/stories/checked.stories.js +1 -1
  127. package/src/less/checkbox/stories/mixed.stories.js +2 -2
  128. package/src/less/checkbox/stories/unchecked.stories.js +1 -1
  129. package/src/less/combobox/combobox.less +4 -1
  130. package/src/less/combobox/stories/combobox.stories.js +1 -1
  131. package/src/less/confirm-dialog/confirm-dialog.less +5 -6
  132. package/src/less/confirm-dialog/stories/confirm-dialog.stories.js +1 -1
  133. package/src/less/cta-button/stories/cascade.stories.js +1 -1
  134. package/src/less/cta-button/stories/cta-button.stories.js +1 -1
  135. package/src/less/cta-button/stories/dimensions.stories.js +1 -1
  136. package/src/less/date-textbox/date-textbox.less +5 -1
  137. package/src/less/details/stories/cascade.stories.js +1 -1
  138. package/src/less/details/stories/details.stories.js +1 -1
  139. package/src/less/drawer-dialog/drawer-dialog.less +2 -2
  140. package/src/less/drawer-dialog/stories/drawer-dialog.stories.js +1 -1
  141. package/src/less/eek/eek.less +2 -2
  142. package/src/less/field/stories/stacked.stories.js +1 -1
  143. package/src/less/field/stories/unstacked.stories.js +1 -1
  144. package/src/less/filter-button/stories/button.stories.js +1 -1
  145. package/src/less/filter-button/stories/group.stories.js +1 -1
  146. package/src/less/filter-button/stories/link.stories.js +1 -1
  147. package/src/less/filter-menu/filter-menu.less +8 -4
  148. package/src/less/filter-menu/stories/filter-menu.stories.js +1 -1
  149. package/src/less/filter-menu-button/filter-menu-button.less +2 -1
  150. package/src/less/filter-menu-button/stories/filter-menu-button.stories.js +1 -1
  151. package/src/less/floating-label/stories/floating-label.stories.js +1 -1
  152. package/src/less/fullscreen-dialog/fullscreen-dialog.less +2 -2
  153. package/src/less/fullscreen-dialog/stories/fullscreen-dialog.stories.js +1 -1
  154. package/src/less/global/stories/global.stories.js +1 -1
  155. package/src/less/icon/generated/icon.less +17 -5
  156. package/src/less/icon/stories/icon.stories.js +1 -1
  157. package/src/less/icon-button/stories/alignment.stories.js +1 -1
  158. package/src/less/image-placeholder/image-placeholder.less +4 -0
  159. package/src/less/image-placeholder/stories/image-placeholder.stories.js +35 -0
  160. package/src/less/index.stories.js +1 -1
  161. package/src/less/infotip/infotip.less +1 -1
  162. package/src/less/infotip/stories/infotip.stories.js +1 -1
  163. package/src/less/inline-notice/stories/inline.stories.js +1 -1
  164. package/src/less/legacy-theme/legacy-theme.less +2 -2
  165. package/src/less/lightbox-dialog/lightbox-dialog.less +12 -9
  166. package/src/less/lightbox-dialog/stories/lightbox-dialog.stories.js +91 -1
  167. package/src/less/link/stories/link.stories.js +3 -2
  168. package/src/less/listbox/listbox.less +2 -1
  169. package/src/less/listbox/stories/cascade.stories.js +1 -1
  170. package/src/less/listbox/stories/listbox.stories.js +1 -1
  171. package/src/less/listbox-button/listbox-button.less +2 -1
  172. package/src/less/listbox-button/stories/base.stories.js +1 -1
  173. package/src/less/listbox-button/stories/cascade.stories.js +1 -1
  174. package/src/less/listbox-button/stories/dimensions.stories.js +1 -1
  175. package/src/less/listbox-button/stories/form.stories.js +1 -1
  176. package/src/less/marketsans/marketsans.less +12 -6
  177. package/src/less/menu/stories/fake-menu.stories.js +1 -1
  178. package/src/less/menu/stories/misc.stories.js +1 -1
  179. package/src/less/menu/stories/multiSelect.stories.js +1 -1
  180. package/src/less/menu-button/menu-button.less +2 -1
  181. package/src/less/menu-button/stories/base.stories.js +1 -1
  182. package/src/less/menu-button/stories/cascade.stories.js +1 -1
  183. package/src/less/menu-button/stories/dimensions.stories.js +1 -1
  184. package/src/less/menu-button/stories/fake-menu-button.stories.js +1 -1
  185. package/src/less/mixins/private/bubble-mixins.less +1 -4
  186. package/src/less/mixins/private/dialog-mixins.less +12 -10
  187. package/src/less/mixins/private/filter-menu-mixins.less +4 -1
  188. package/src/less/mixins/private/selection-list-mixins.less +0 -2
  189. package/src/less/mixins/private/token-mixins.less +2 -1
  190. package/src/less/mixins/public/utility-mixins.less +1 -4
  191. package/src/less/page-grid/page-grid.less +32 -10
  192. package/src/less/page-notice/page-notice.less +1 -1
  193. package/src/less/page-notice/stories/page-notice.stories.js +1 -1
  194. package/src/less/page-notice/stories/test.stories.js +1 -1
  195. package/src/less/pagination/stories/button-cascade.stories.js +1 -1
  196. package/src/less/pagination/stories/buttons.stories.js +1 -1
  197. package/src/less/pagination/stories/link-cascade.stories.js +1 -1
  198. package/src/less/pagination/stories/links.stories.js +1 -1
  199. package/src/less/pagination/stories/overflow.stories.js +1 -1
  200. package/src/less/panel-dialog/panel-dialog.less +5 -4
  201. package/src/less/panel-dialog/stories/panel-dialog.stories.js +1 -1
  202. package/src/less/progress-bar/progress-bar.less +1 -1
  203. package/src/less/progress-bar/stories/progress-bar.stories.js +10 -7
  204. package/src/less/progress-spinner/stories/progress-spinner.stories.js +1 -1
  205. package/src/less/progress-stepper/progress-stepper.less +29 -9
  206. package/src/less/progress-stepper/stories/progress-stepper.stories.js +1 -1
  207. package/src/less/radio/radio.less +8 -3
  208. package/src/less/radio/stories/checked.stories.js +1 -1
  209. package/src/less/radio/stories/unchecked.stories.js +1 -1
  210. package/src/less/section-notice/section-notice.less +1 -1
  211. package/src/less/section-notice/stories/rtl.stories.js +1 -1
  212. package/src/less/section-notice/stories/section-notice.stories.js +1 -1
  213. package/src/less/section-notice/stories/test.stories.js +1 -1
  214. package/src/less/section-title/section-title.less +1 -1
  215. package/src/less/section-title/stories/rtl.stories.js +1 -1
  216. package/src/less/section-title/stories/section-title.stories.js +1 -1
  217. package/src/less/select/stories/cascade.stories.js +1 -1
  218. package/src/less/select/stories/default.stories.js +1 -1
  219. package/src/less/select/stories/floating-label.stories.js +1 -1
  220. package/src/less/signal/stories/signal.stories.js +1 -1
  221. package/src/less/snackbar-dialog/snackbar-dialog.less +1 -1
  222. package/src/less/snackbar-dialog/stories/base.stories.js +1 -1
  223. package/src/less/snackbar-dialog/stories/font-size.stories.js +1 -1
  224. package/src/less/snackbar-dialog/stories/rtl.stories.js +1 -1
  225. package/src/less/split-button/stories/base.stories.js +1 -1
  226. package/src/less/split-button/stories/rtl.stories.js +1 -1
  227. package/src/less/split-button/stories/size.stories.js +1 -1
  228. package/src/less/square-corner-theme/square-corner-theme.less +3 -3
  229. package/src/less/star-rating/stories/star-rating.stories.js +1 -1
  230. package/src/less/star-rating-select/star-rating-select.less +6 -2
  231. package/src/less/star-rating-select/stories/star-rating-select.stories.js +1 -1
  232. package/src/less/switch/stories/form.stories.js +1 -1
  233. package/src/less/switch/stories/script.stories.js +1 -1
  234. package/src/less/switch/switch.less +12 -6
  235. package/src/less/tabs/stories/fake-tabs/block.stories.js +1 -1
  236. package/src/less/tabs/stories/fake-tabs/inlineBlock.stories.js +1 -1
  237. package/src/less/tabs/stories/tabs/block.stories.js +1 -1
  238. package/src/less/tabs/stories/tabs/inlineBlock.stories.js +1 -1
  239. package/src/less/textbox/stories/icon.stories.js +1 -1
  240. package/src/less/textbox/stories/rtl/icon.stories.js +1 -1
  241. package/src/less/textbox/stories/rtl/textbox.stories.js +1 -1
  242. package/src/less/textbox/stories/textbox.stories.js +1 -1
  243. package/src/less/toast-dialog/stories/toast-dialog.stories.js +1 -1
  244. package/src/less/toast-dialog/toast-dialog.less +1 -1
  245. package/src/less/tooltip/stories/pointer.stories.js +84 -78
  246. package/src/less/tooltip/stories/tooltip.stories.js +1 -1
  247. package/src/less/tooltip/tooltip.less +1 -1
  248. package/src/less/tourtip/stories/tourtip.stories.js +1 -1
  249. package/src/less/tourtip/tourtip.less +1 -1
  250. package/src/less/typography/typography.less +1 -1
  251. package/src/less/video/video.less +1 -4
  252. package/src/svg/icon/icon-bookmark-16.svg +7 -0
  253. package/src/svg/icon/icon-bookmark-24.svg +7 -0
  254. package/src/svg/icon/icon-play-filled-16-colored.svg +13 -0
  255. package/src/svg/icon/icon-play-filled-24-colored.svg +11 -0
  256. package/src/svg/icon/image-placeholder.svg +3 -0
  257. package/src/svg/icons.svg +49 -11
  258. package/src/tokens/evo-dark.css +2 -0
  259. package/src/tokens/evo-light.css +2 -0
  260. package/svg.svg +49 -11
  261. package/webpack.config.js +6 -6
  262. package/_cdn/skin/v16.0.0-2/skin-default.min.css +0 -6
  263. package/_cdn/skin/v16.0.0-2/skin-full.min.css +0 -6
  264. package/_cdn/skin/v16.0.0-2/skin-headless.min.css +0 -6
  265. package/_cdn/skin/v16.0.0-2/skin-legacy.min.css +0 -6
  266. package/dist/svg/icon/icon-image-placeholder.svg +0 -10
  267. package/src/svg/icon/icon-image-placeholder.svg +0 -10
  268. /package/dist/svg/icon/{icon-zoom-In-16.svg → icon-zoom-in-16.svg} +0 -0
  269. /package/src/svg/icon/{icon-zoom-In-16.svg → icon-zoom-in-16.svg} +0 -0
@@ -1,27 +1,27 @@
1
1
  #!/usr/bin/env node
2
2
  /* eslint-disable no-console */
3
- const glob = require('glob');
4
- const path = require('path');
5
- const less = require('less');
6
- const fs = require('fs');
7
- const pkg = require('../package.json');
8
- const rimraf = require('rimraf');
9
- const CleanCSS = require('clean-css');
3
+ const glob = require("glob");
4
+ const path = require("path");
5
+ const less = require("less");
6
+ const fs = require("fs");
7
+ const pkg = require("../package.json");
8
+ const rimraf = require("rimraf");
9
+ const CleanCSS = require("clean-css");
10
10
  const cleanCSSInstance = new CleanCSS({
11
11
  advanced: true,
12
12
  promise: true,
13
13
  });
14
14
  const currentDir = path.dirname(__dirname);
15
- const { exec } = require('child_process');
16
- const bodyMatch = new RegExp('body ?({(?:.|\\s|\\S)*?})', 'm');
17
- const rootMatch = new RegExp(':root ?({(?:.|\\s|\\S)*?})', 'm');
15
+ const { exec } = require("child_process");
16
+ const bodyMatch = new RegExp("body ?({(?:.|\\s|\\S)*?})", "m");
17
+ const rootMatch = new RegExp(":root ?({(?:.|\\s|\\S)*?})", "m");
18
18
 
19
19
  // The list of directories in the dist to pull
20
20
  const tokensList = [
21
- ['evo-core', 'evo-light'],
22
- ['ds4-core', 'ds4-light'],
21
+ ["evo-core", "evo-light"],
22
+ ["ds4-core", "ds4-light"],
23
23
  ];
24
- const tokensDirList = ['evo', 'ds4'];
24
+ const tokensDirList = ["evo", "ds4"];
25
25
 
26
26
  /**
27
27
  * Main Processing class. Holds info about args passed and ds version
@@ -34,7 +34,7 @@ class CssProcesser {
34
34
  this.processed = [];
35
35
  this.skipped = [];
36
36
 
37
- let classDef = '';
37
+ let classDef = "";
38
38
  const scopeClass = args.scopeClass;
39
39
  if (scopeClass) {
40
40
  for (let i = 0; i < args.scopeSpecificity; i++) {
@@ -51,7 +51,9 @@ class CssProcesser {
51
51
  run() {
52
52
  return this.generateLESS()
53
53
  .then((raw) => this.compileLess(raw))
54
- .then((raw) => (this.minify ? cleanCSSInstance.minify(raw) : { styles: raw }))
54
+ .then((raw) =>
55
+ this.minify ? cleanCSSInstance.minify(raw) : { styles: raw }
56
+ )
55
57
  .then((raw) => this.writeAllFiles(raw.styles))
56
58
  .catch((e) => console.error(e));
57
59
  }
@@ -79,7 +81,7 @@ class CssProcesser {
79
81
  const body = bodyMatch.exec(cssContents);
80
82
  if (body && body[1]) {
81
83
  // Add new body
82
- const newContents = cssContents.replace(bodyMatch, '');
84
+ const newContents = cssContents.replace(bodyMatch, "");
83
85
  return `body ${this.classDef} ${body[1]}
84
86
  ${this.wrap(newContents)}
85
87
  `;
@@ -91,7 +93,7 @@ class CssProcesser {
91
93
  const root = rootMatch.exec(cssContents);
92
94
  if (root && root[1]) {
93
95
  // Add newroot
94
- const newContents = cssContents.replace(rootMatch, '');
96
+ const newContents = cssContents.replace(rootMatch, "");
95
97
  return `${this.classDef} ${root[1]}
96
98
  ${this.wrap(newContents)}
97
99
  `;
@@ -104,11 +106,14 @@ class CssProcesser {
104
106
  * @param {*} file
105
107
  */
106
108
  generateRawLess(file) {
107
- const fileName = path.basename(file, '.css');
108
- if (this.args.modules.length > 0 && this.args.modules.indexOf(fileName) === -1) {
109
+ const fileName = path.basename(file, ".css");
110
+ if (
111
+ this.args.modules.length > 0 &&
112
+ this.args.modules.indexOf(fileName) === -1
113
+ ) {
109
114
  if (this.tokensFile.indexOf(fileName) === -1) {
110
115
  this.skipped.push(fileName);
111
- return '';
116
+ return "";
112
117
  }
113
118
  }
114
119
  this.processed.push(fileName);
@@ -117,7 +122,7 @@ class CssProcesser {
117
122
  // Need to read file and output
118
123
  const cssContents = fs.readFileSync(file).toString();
119
124
  // Check if it's global module and change body
120
- if (fileName === 'global') {
125
+ if (fileName === "global") {
121
126
  return this.rewrapBody(cssContents);
122
127
  }
123
128
  if (this.tokensFile.indexOf(fileName) > -1) {
@@ -130,26 +135,40 @@ class CssProcesser {
130
135
 
131
136
  processFiles(files) {
132
137
  return new Promise((resolve) => {
133
- const compiled = files.map((file) => this.generateRawLess(file)).join('\n');
138
+ const compiled = files
139
+ .map((file) => this.generateRawLess(file))
140
+ .join("\n");
134
141
  const processed = this.processed;
135
142
  const skipped = this.skipped;
136
143
  const tokensFile = this.tokensFile;
137
144
 
138
145
  if (this.args.modules.length > 0 || this.args.verbose) {
139
- console.log(`Processed ${processed.length} modules for ${tokensFile}`);
146
+ console.log(
147
+ `Processed ${processed.length} modules for ${tokensFile}`
148
+ );
140
149
  }
141
150
  if (this.args.verbose) {
142
- console.log(`Modules processed: ${processed.join(',')} for ${tokensFile}`);
151
+ console.log(
152
+ `Modules processed: ${processed.join(
153
+ ","
154
+ )} for ${tokensFile}`
155
+ );
143
156
 
144
- console.log(`Skipped ${skipped.length} modules for ${tokensFile}`);
145
- console.log(`Modules skipped: ${skipped.join(',')} for ${tokensFile}`);
157
+ console.log(
158
+ `Skipped ${skipped.length} modules for ${tokensFile}`
159
+ );
160
+ console.log(
161
+ `Modules skipped: ${skipped.join(",")} for ${tokensFile}`
162
+ );
146
163
  }
147
164
  resolve(compiled);
148
165
  });
149
166
  }
150
167
 
151
168
  generateLESS() {
152
- return this.getDistCss(this.tokensFile).then((files) => this.processFiles(files));
169
+ return this.getDistCss(this.tokensFile).then((files) =>
170
+ this.processFiles(files)
171
+ );
153
172
  }
154
173
 
155
174
  compileLess(raw) {
@@ -161,7 +180,9 @@ class CssProcesser {
161
180
  rimraf.sync(cdnPath);
162
181
  return makeDir(cdnPath).then(() =>
163
182
  writeFile(
164
- `${cdnPath}/skin-${this.tokensDir}.${this.minify ? 'min.' : ''}css`,
183
+ `${cdnPath}/skin-${this.tokensDir}.${
184
+ this.minify ? "min." : ""
185
+ }css`,
165
186
  `/* autoprefixer: off */\n${raw}\n/* autoprefixer: on */`
166
187
  )
167
188
  );
@@ -182,12 +203,12 @@ function getCDNPath(bundle) {
182
203
  */
183
204
  function prebuild() {
184
205
  return new Promise((resolve, reject) => {
185
- console.log('Running build...');
186
- exec('npm run build:css', (err) => {
206
+ console.log("Running build...");
207
+ exec("npm run build:css", (err) => {
187
208
  if (err) {
188
209
  return reject(err);
189
210
  }
190
- console.log('npm build successful');
211
+ console.log("npm build successful");
191
212
  return resolve();
192
213
  });
193
214
  });
@@ -225,7 +246,11 @@ function runCSSBuild(name, args) {
225
246
  .then(() =>
226
247
  Promise.all(
227
248
  tokensList.map((token, index) => {
228
- const cssProcesser = new CssProcesser(token, tokensDirList[index], args);
249
+ const cssProcesser = new CssProcesser(
250
+ token,
251
+ tokensDirList[index],
252
+ args
253
+ );
229
254
  return cssProcesser.run();
230
255
  })
231
256
  )
@@ -249,7 +274,7 @@ async function listBundles(argv) {
249
274
  console.log(`${tokensFile} - modules avaiable`);
250
275
  console.log(`======================`);
251
276
  files.forEach((file) => {
252
- console.log(path.basename(file, '.css'));
277
+ console.log(path.basename(file, ".css"));
253
278
  });
254
279
  });
255
280
  });
@@ -1,20 +1,20 @@
1
- 'use strict';
2
- const fs = require('fs');
3
- const path = require('path');
1
+ "use strict";
2
+ const fs = require("fs");
3
+ const path = require("path");
4
4
  const currentDir = path.dirname(__dirname);
5
- const svgDir = path.resolve(currentDir, 'src', 'svg');
6
- const svgIconDir = path.resolve(currentDir, 'src', 'svg', 'icon');
7
- const masterIconPath = path.resolve(svgDir, 'icons.svg');
8
- const jsdom = require('jsdom');
9
- const prettier = require('prettier');
5
+ const svgDir = path.resolve(currentDir, "src", "svg");
6
+ const svgIconDir = path.resolve(currentDir, "src", "svg", "icon");
7
+ const masterIconPath = path.resolve(svgDir, "icons.svg");
8
+ const jsdom = require("jsdom");
9
+ const prettier = require("prettier");
10
10
  const { JSDOM } = jsdom;
11
- const configFilePath = path.resolve(currentDir, 'docs', '_data', 'icons.yaml');
12
- const file = fs.readFileSync(configFilePath, 'utf8');
13
- const YAML = require('yaml');
11
+ const configFilePath = path.resolve(currentDir, "docs", "_data", "icons.yaml");
12
+ const file = fs.readFileSync(configFilePath, "utf8");
13
+ const YAML = require("yaml");
14
14
  const config = YAML.parse(file);
15
- const { html2xhtml } = require('./util');
16
- const { query } = require('winston');
17
- const genText = 'This is a generated file, DO NOT EDIT';
15
+ const { html2xhtml } = require("./util");
16
+ const { query } = require("winston");
17
+ const genText = "This is a generated file, DO NOT EDIT";
18
18
 
19
19
  async function getFiles(dir) {
20
20
  const dirents = await fs.promises.readdir(dir, { withFileTypes: true });
@@ -41,32 +41,48 @@ async function processFilePrefixing(dir) {
41
41
  }
42
42
 
43
43
  async function prefixIcon(fileDir, fileBase) {
44
- const renameFrom = fileDir + '/' + fileBase;
45
- const renameTo = fileDir + '/' + config.icons.prefix + '-' + fileBase;
44
+ const renameFrom = fileDir + "/" + fileBase;
45
+ const renameTo = fileDir + "/" + config.icons.prefix + "-" + fileBase;
46
46
 
47
47
  await fs.rename(renameFrom, renameTo, (error) => {
48
48
  if (error) return console.log(error);
49
49
 
50
- console.log('Prefixed Icon: ' + fileBase + ' > ' + config.icons.prefix + '-' + fileBase);
50
+ console.log(
51
+ "Prefixed Icon: " +
52
+ fileBase +
53
+ " > " +
54
+ config.icons.prefix +
55
+ "-" +
56
+ fileBase
57
+ );
51
58
  });
52
59
  }
53
60
 
54
61
  async function normalizeFiles(svgs) {
55
- const svgFiles = svgs.filter((f) => f.endsWith('.svg') && f !== 'icons.svg');
62
+ const svgFiles = svgs.filter(
63
+ (f) => f.endsWith(".svg") && f !== "icons.svg"
64
+ );
56
65
 
57
66
  svgFiles.map(async (filePath) => {
58
67
  const fileDir = path.parse(filePath).dir;
59
68
  const fileBase = path.parse(filePath).base;
60
- const data = await fs.promises.readFile(filePath, 'utf8');
61
- const svgJsDom = new JSDOM(data, { contentType: 'text/xml' });
62
- const querySelector = svgJsDom.window.document.querySelector('svg');
63
- if (querySelector.hasAttribute('height') || querySelector.hasAttribute('width')) {
64
- querySelector.removeAttribute('height');
65
- querySelector.removeAttribute('width');
69
+ const data = await fs.promises.readFile(filePath, "utf8");
70
+ const svgJsDom = new JSDOM(data, { contentType: "text/xml" });
71
+ const querySelector = svgJsDom.window.document.querySelector("svg");
72
+ if (
73
+ querySelector.hasAttribute("height") ||
74
+ querySelector.hasAttribute("width")
75
+ ) {
76
+ querySelector.removeAttribute("height");
77
+ querySelector.removeAttribute("width");
66
78
  await fs.promises.writeFile(filePath, html2xhtml(svgJsDom, true));
67
79
  }
68
80
 
69
- if (!fileBase.startsWith('icon-') && !fileBase.startsWith('star-rating-')) {
81
+ if (
82
+ !fileBase.startsWith("icon-") &&
83
+ !fileBase.startsWith("star-rating-") &&
84
+ !fileBase.startsWith("image-placeholder")
85
+ ) {
70
86
  await prefixIcon(fileDir, fileBase);
71
87
  }
72
88
  });
@@ -87,29 +103,33 @@ function sortMethod({ id: a }, { id: b }) {
87
103
  class GenerateImages {
88
104
  constructor(files, masterIconFile) {
89
105
  this.imageList = [];
90
- this.svgs = files.filter((f) => f.endsWith('.svg') && f !== 'icons.svg');
106
+ this.svgs = files.filter(
107
+ (f) => f.endsWith(".svg") && f !== "icons.svg"
108
+ );
91
109
  this.masterIconSymbols = new JSDOM(masterIconFile);
92
110
  this.masterDocument = this.masterIconSymbols.window.document;
93
111
  this.masterList = [];
94
112
  }
95
113
 
96
114
  processSymbolToSVG(symbol, name) {
97
- const newSVGCode = symbol.outerHTML.replace('<svg', '<symbol').replace('</svg', '</symbol');
115
+ const newSVGCode = symbol.outerHTML
116
+ .replace("<svg", "<symbol")
117
+ .replace("</svg", "</symbol");
98
118
 
99
- const svgJsDom = new JSDOM(newSVGCode, { contentType: 'text/xml' });
100
- const svgFragment = svgJsDom.window.document.querySelector('symbol');
101
- svgFragment.setAttribute('id', name);
102
- svgFragment.removeAttribute('xmlns');
103
- svgFragment.removeAttribute('width');
104
- svgFragment.removeAttribute('heightt');
119
+ const svgJsDom = new JSDOM(newSVGCode, { contentType: "text/xml" });
120
+ const svgFragment = svgJsDom.window.document.querySelector("symbol");
121
+ svgFragment.setAttribute("id", name);
122
+ svgFragment.removeAttribute("xmlns");
123
+ svgFragment.removeAttribute("width");
124
+ svgFragment.removeAttribute("heightt");
105
125
 
106
126
  return svgFragment;
107
127
  }
108
128
 
109
129
  async processSvg(filePath, filename, lessFile) {
110
- const data = await fs.promises.readFile(filePath, 'utf8');
130
+ const data = await fs.promises.readFile(filePath, "utf8");
111
131
  const symbols = JSDOM.fragment(data);
112
- const symbol = symbols.querySelector('svg');
132
+ const symbol = symbols.querySelector("svg");
113
133
 
114
134
  const nameObj = stripName(filename);
115
135
  if (config.skipDocs.indexOf(nameObj.simpleName) === -1) {
@@ -122,14 +142,14 @@ class GenerateImages {
122
142
  if (config.skip.indexOf(filename) > -1) {
123
143
  return;
124
144
  }
125
- const sizes = symbol.getAttribute('viewBox');
145
+ const sizes = symbol.getAttribute("viewBox");
126
146
 
127
147
  if (sizes === null) {
128
- console.log('ERROR: viewbox dimensions missing from ' + filename);
148
+ console.log("ERROR: viewbox dimensions missing from " + filename);
129
149
  return;
130
150
  }
131
151
 
132
- const [, , width, height] = sizes.split(' ');
152
+ const [, , width, height] = sizes.split(" ");
133
153
  const id = `${nameObj.prefix}-${nameObj.fullName}`;
134
154
  lessFile.push({
135
155
  id,
@@ -138,7 +158,7 @@ class GenerateImages {
138
158
  }
139
159
 
140
160
  async run() {
141
- const masterSvg = this.masterDocument.querySelector('svg');
161
+ const masterSvg = this.masterDocument.querySelector("svg");
142
162
 
143
163
  while (masterSvg.lastChild) {
144
164
  masterSvg.removeChild(masterSvg.lastChild);
@@ -158,8 +178,10 @@ class GenerateImages {
158
178
  await fs.promises.writeFile(
159
179
  `src/less/icon/generated/icon.less`,
160
180
  prettier.format(
161
- [`/* ${genText} */`].concat(lessFile.map(({ data }) => data)).join('\n'),
162
- { parser: 'less', tabWidth: 4 }
181
+ [`/* ${genText} */`]
182
+ .concat(lessFile.map(({ data }) => data))
183
+ .join("\n"),
184
+ { parser: "less", tabWidth: 4 }
163
185
  )
164
186
  );
165
187
 
@@ -170,15 +192,20 @@ class GenerateImages {
170
192
 
171
193
  this.masterList.sort(sortMethod);
172
194
  this.masterList.forEach((symbol) => {
173
- this.masterDocument.querySelector('svg').appendChild(symbol);
195
+ this.masterDocument.querySelector("svg").appendChild(symbol);
174
196
  });
175
197
 
176
- await fs.promises.writeFile(masterIconPath, html2xhtml(this.masterIconSymbols));
198
+ await fs.promises.writeFile(
199
+ masterIconPath,
200
+ html2xhtml(this.masterIconSymbols)
201
+ );
177
202
  }
178
203
  }
179
204
 
180
205
  function stripName(name, mappedPrefix, mappedPostfix) {
181
- const matcher = new RegExp(`^((?:icon-|program-badge-|star-rating-)?)([\\w-]+?)((?:|-small))$`);
206
+ const matcher = new RegExp(
207
+ `^((?:icon-|program-badge-|star-rating-)?)([\\w-]+?)((?:|-small))$`
208
+ );
182
209
  const nameMatch = name.match(matcher);
183
210
  if (nameMatch) {
184
211
  const [, prefix, newName, postfix] = nameMatch;
@@ -187,7 +214,7 @@ function stripName(name, mappedPrefix, mappedPostfix) {
187
214
  prefix,
188
215
  name: newName,
189
216
  postfix,
190
- simpleName: prefix === 'icon-' ? fullName : `${prefix}${fullName}`,
217
+ simpleName: prefix === "icon-" ? fullName : `${prefix}${fullName}`,
191
218
  fullName,
192
219
  };
193
220
  }
@@ -2,9 +2,24 @@
2
2
  "modules": {
3
3
  "core": ["global", "utility"],
4
4
  "combo": ["core", "lightbox-dialog", "form", "progress-spinner"],
5
- "form": ["button", "checkbox", "field", "radio", "select", "switch", "textbox"]
5
+ "form": [
6
+ "button",
7
+ "checkbox",
8
+ "field",
9
+ "radio",
10
+ "select",
11
+ "switch",
12
+ "textbox"
13
+ ]
6
14
  },
7
- "skip": ["mixins", "legacy-tokens", "tokens", "svg", "icon-large", "variables"],
15
+ "skip": [
16
+ "mixins",
17
+ "legacy-tokens",
18
+ "tokens",
19
+ "svg",
20
+ "icon-large",
21
+ "variables"
22
+ ],
8
23
  "skipIndex": [
9
24
  "dark-mode",
10
25
  "legacy-textbox",
@@ -44,7 +59,10 @@
44
59
  },
45
60
  "legacy-tokens": {
46
61
  "index": ["ds4-core", "ds4-light"],
47
- "legacy-tokens": ["legacy-tokens/ds4-core", "legacy-tokens/ds4-light"]
62
+ "legacy-tokens": [
63
+ "legacy-tokens/ds4-core",
64
+ "legacy-tokens/ds4-light"
65
+ ]
48
66
  }
49
67
  }
50
68
  }
@@ -1,21 +1,25 @@
1
- const fs = require('fs');
2
- const prettier = require('prettier');
3
- const path = require('path');
4
- const config = require('./config.json');
5
- const { removeFile } = require('../util');
1
+ const fs = require("fs");
2
+ const prettier = require("prettier");
3
+ const path = require("path");
4
+ const config = require("./config.json");
5
+ const { removeFile } = require("../util");
6
6
  const currentDir = path.dirname(path.dirname(__dirname));
7
- const distDir = path.join(currentDir, 'dist');
7
+ const distDir = path.join(currentDir, "dist");
8
8
  const files = fs
9
9
  .readdirSync(distDir)
10
- .filter((filename) => config.skip.indexOf(filename) === -1 && !config.nested[filename]);
10
+ .filter(
11
+ (filename) =>
12
+ config.skip.indexOf(filename) === -1 && !config.nested[filename]
13
+ );
11
14
  const indexFiles = fs
12
15
  .readdirSync(distDir)
13
16
  .filter(
14
17
  (filename) =>
15
- config.skip.indexOf(filename) === -1 && config.skipIndex.indexOf(filename) === -1
18
+ config.skip.indexOf(filename) === -1 &&
19
+ config.skipIndex.indexOf(filename) === -1
16
20
  );
17
21
 
18
- const { ModuleBuilder } = require('./module-builder');
22
+ const { ModuleBuilder } = require("./module-builder");
19
23
 
20
24
  async function generateTopLevelFiles() {
21
25
  const browser = {};
@@ -24,50 +28,52 @@ async function generateTopLevelFiles() {
24
28
  .map((item) => {
25
29
  return `require('./${item}.js');\n`;
26
30
  })
27
- .join('');
31
+ .join("");
28
32
  const contentMJS = indexFiles
29
33
  .map((item) => {
30
34
  return `import './${item}.css';\n`;
31
35
  })
32
- .join('');
36
+ .join("");
33
37
 
34
38
  const contentBrowser = indexFiles
35
39
  .map((item) => {
36
40
  return `"require: ./${item}.js"`;
37
41
  })
38
- .join(',');
42
+ .join(",");
39
43
  const contentCSS = indexFiles
40
44
  .map((item) => {
41
45
  return `@import "./${item}.css";\n`;
42
46
  })
43
- .join('');
47
+ .join("");
44
48
  await fs.promises.writeFile(
45
- path.join(currentDir, 'browser.json'),
46
- prettier.format(JSON.stringify(browser), { parser: 'json' })
49
+ path.join(currentDir, "browser.json"),
50
+ prettier.format(JSON.stringify(browser), { parser: "json" })
47
51
  );
48
- await fs.promises.writeFile(path.join(currentDir, 'index.js'), contentJS);
49
- await fs.promises.writeFile(path.join(currentDir, 'index.mjs'), contentMJS);
50
- await fs.promises.writeFile(path.join(currentDir, 'index.css'), contentCSS);
52
+ await fs.promises.writeFile(path.join(currentDir, "index.js"), contentJS);
53
+ await fs.promises.writeFile(path.join(currentDir, "index.mjs"), contentMJS);
54
+ await fs.promises.writeFile(path.join(currentDir, "index.css"), contentCSS);
51
55
  await fs.promises.writeFile(
52
- path.join(currentDir, 'index.browser.json'),
53
- prettier.format(`{ "dependencies": [ ${contentBrowser} ]}`, { parser: 'json' })
56
+ path.join(currentDir, "index.browser.json"),
57
+ prettier.format(`{ "dependencies": [ ${contentBrowser} ]}`, {
58
+ parser: "json",
59
+ })
54
60
  );
55
61
 
56
62
  // Generate SVGs
57
- const svgDistDir = path.join(distDir, 'svg');
63
+ const svgDistDir = path.join(distDir, "svg");
58
64
  await fs.promises.copyFile(
59
- path.join(svgDistDir, 'icons.svg'),
60
- path.join(currentDir, 'svg.svg')
65
+ path.join(svgDistDir, "icons.svg"),
66
+ path.join(currentDir, "svg.svg")
61
67
  );
62
68
  }
63
69
 
64
70
  async function cleanTopLevelFiles() {
65
- await removeFile(path.join(currentDir, 'browser.json'));
66
- await removeFile(path.join(currentDir, 'index.js'));
67
- await removeFile(path.join(currentDir, 'index.mjs'));
68
- await removeFile(path.join(currentDir, 'index.css'));
69
- await removeFile(path.join(currentDir, 'index.browser.json'));
70
- await removeFile(path.join(currentDir, 'svg.svg'));
71
+ await removeFile(path.join(currentDir, "browser.json"));
72
+ await removeFile(path.join(currentDir, "index.js"));
73
+ await removeFile(path.join(currentDir, "index.mjs"));
74
+ await removeFile(path.join(currentDir, "index.css"));
75
+ await removeFile(path.join(currentDir, "index.browser.json"));
76
+ await removeFile(path.join(currentDir, "svg.svg"));
71
77
  }
72
78
 
73
79
  const moduleData = [].concat(