@lumx/core 3.1.0 → 3.1.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 (290) hide show
  1. package/{dist/CONTRIBUTING.md → CONTRIBUTING.md} +0 -0
  2. package/{dist/LICENSE.md → LICENSE.md} +0 -0
  3. package/{dist/css → css}/_retro-compat-v2.css +0 -0
  4. package/{dist/css → css}/design-tokens.css +0 -0
  5. package/{dist/css → css}/material.css +0 -0
  6. package/{dist/js → js}/constants/design-tokens.js +0 -0
  7. package/{dist/js → js}/constants/design-tokens.min.js +0 -0
  8. package/{dist/js → js}/constants/design-tokens.min.js.map +0 -0
  9. package/{dist/js → js}/constants/design-tokens.ts +0 -0
  10. package/{dist/js → js}/constants/index.js +0 -0
  11. package/{dist/js → js}/constants/index.min.js +0 -0
  12. package/{dist/js → js}/constants/index.min.js.map +0 -0
  13. package/{dist/js → js}/constants/index.ts +0 -0
  14. package/{dist/js → js}/constants/keycodes.js +0 -0
  15. package/{dist/js → js}/constants/keycodes.min.js +0 -0
  16. package/{dist/js → js}/constants/keycodes.min.js.map +0 -0
  17. package/{dist/js → js}/constants/keycodes.ts +0 -0
  18. package/{dist/js → js}/custom-colors.js +0 -0
  19. package/{dist/js → js}/custom-colors.min.js +0 -0
  20. package/js/custom-colors.min.js.map +1 -0
  21. package/{dist/js → js}/custom-colors.ts +0 -0
  22. package/{dist/js → js}/date-picker.js +0 -0
  23. package/{dist/js → js}/date-picker.min.js +0 -0
  24. package/js/date-picker.min.js.map +1 -0
  25. package/{dist/js → js}/date-picker.ts +0 -0
  26. package/{dist/js → js}/utils.js +0 -0
  27. package/{dist/js → js}/utils.min.js +0 -0
  28. package/js/utils.min.js.map +1 -0
  29. package/{dist/js → js}/utils.ts +0 -0
  30. package/{dist/lumx.css → lumx.css} +1 -1
  31. package/{dist/lumx.min.css → lumx.min.css} +1 -1
  32. package/package.json +1 -1
  33. package/{dist/scss → scss}/_components.scss +0 -0
  34. package/{dist/scss → scss}/_core.scss +0 -0
  35. package/{dist/scss → scss}/_design-tokens.scss +0 -0
  36. package/{dist/scss → scss}/_retro-compat-v2.scss +0 -0
  37. package/{dist/scss → scss}/components/avatar/_index.scss +0 -0
  38. package/{dist/scss → scss}/components/badge/_index.scss +0 -0
  39. package/{dist/scss → scss}/components/button/_index.scss +0 -0
  40. package/{dist/scss → scss}/components/button/_mixins.scss +0 -0
  41. package/{dist/scss → scss}/components/button/_variables.scss +0 -0
  42. package/{dist/scss → scss}/components/checkbox/_index.scss +0 -0
  43. package/{dist/scss → scss}/components/checkbox/_mixins.scss +0 -0
  44. package/{dist/scss → scss}/components/chip/_index.scss +0 -0
  45. package/{dist/scss → scss}/components/chip/_mixins.scss +0 -0
  46. package/{dist/scss → scss}/components/chip/_variables.scss +0 -0
  47. package/{dist/scss → scss}/components/comment-block/_index.scss +0 -0
  48. package/{dist/scss → scss}/components/date-picker/_index.scss +0 -0
  49. package/{dist/scss → scss}/components/dialog/_index.scss +0 -0
  50. package/{dist/scss → scss}/components/dialog/_variables.scss +0 -0
  51. package/{dist/scss → scss}/components/divider/_index.scss +0 -0
  52. package/{dist/scss → scss}/components/divider/_mixins.scss +0 -0
  53. package/{dist/scss → scss}/components/divider/_variables.scss +0 -0
  54. package/{dist/scss → scss}/components/drag-handle/_index.scss +0 -0
  55. package/{dist/scss → scss}/components/dropdown/_index.scss +0 -0
  56. package/{dist/scss → scss}/components/expansion-panel/_index.scss +0 -0
  57. package/{dist/scss → scss}/components/expansion-panel/_variables.scss +0 -0
  58. package/{dist/scss → scss}/components/flag/_index.scss +0 -0
  59. package/{dist/scss → scss}/components/flex-box/_index.scss +0 -0
  60. package/{dist/scss → scss}/components/generic-block/_index.scss +0 -0
  61. package/{dist/scss → scss}/components/grid/_index.scss +0 -0
  62. package/{dist/scss → scss}/components/grid-column/_index.scss +0 -0
  63. package/{dist/scss → scss}/components/icon/_index.scss +0 -0
  64. package/{dist/scss → scss}/components/icon/_mixins.scss +0 -0
  65. package/{dist/scss → scss}/components/icon/_variables.scss +0 -0
  66. package/{dist/scss → scss}/components/image-block/_index.scss +0 -0
  67. package/{dist/scss → scss}/components/inline-list/_index.scss +0 -0
  68. package/{dist/scss → scss}/components/input-helper/_index.scss +0 -0
  69. package/{dist/scss → scss}/components/input-helper/_mixins.scss +0 -0
  70. package/{dist/scss → scss}/components/input-helper/_variables.scss +0 -0
  71. package/{dist/scss → scss}/components/input-label/_index.scss +0 -0
  72. package/{dist/scss → scss}/components/input-label/_mixins.scss +0 -0
  73. package/{dist/scss → scss}/components/lightbox/_index.scss +0 -0
  74. package/{dist/scss → scss}/components/lightbox/_variables.scss +0 -0
  75. package/{dist/scss → scss}/components/link/_index.scss +0 -0
  76. package/{dist/scss → scss}/components/link/_mixins.scss +0 -0
  77. package/{dist/scss → scss}/components/link-preview/_index.scss +0 -0
  78. package/{dist/scss → scss}/components/list/_index.scss +0 -0
  79. package/{dist/scss → scss}/components/list/_mixins.scss +0 -0
  80. package/{dist/scss → scss}/components/list/_variables.scss +0 -0
  81. package/{dist/scss → scss}/components/message/_index.scss +0 -0
  82. package/{dist/scss → scss}/components/mosaic/_index.scss +0 -0
  83. package/{dist/scss → scss}/components/notification/_index.scss +0 -0
  84. package/{dist/scss → scss}/components/notification/_variables.scss +0 -0
  85. package/{dist/scss → scss}/components/notification-block/_index.scss +0 -0
  86. package/{dist/scss → scss}/components/popover/_index.scss +0 -0
  87. package/{dist/scss → scss}/components/popover/_variables.scss +0 -0
  88. package/{dist/scss → scss}/components/post-block/_index.scss +0 -0
  89. package/{dist/scss → scss}/components/progress/_index.scss +0 -0
  90. package/{dist/scss → scss}/components/progress/_variables.scss +0 -0
  91. package/{dist/scss → scss}/components/progress-tracker/_index.scss +0 -0
  92. package/{dist/scss → scss}/components/progress-tracker/_variables.scss +0 -0
  93. package/{dist/scss → scss}/components/radio-button/_index.scss +0 -0
  94. package/{dist/scss → scss}/components/radio-button/_mixins.scss +0 -0
  95. package/{dist/scss → scss}/components/select/_index.scss +0 -0
  96. package/{dist/scss → scss}/components/select/_mixins.scss +0 -0
  97. package/{dist/scss → scss}/components/side-navigation/_index.scss +0 -0
  98. package/{dist/scss → scss}/components/side-navigation/_mixins.scss +0 -0
  99. package/{dist/scss → scss}/components/skeleton/_index.scss +0 -0
  100. package/{dist/scss → scss}/components/skeleton/_mixins.scss +0 -0
  101. package/{dist/scss → scss}/components/slider/_index.scss +0 -0
  102. package/{dist/scss → scss}/components/slideshow/_index.scss +0 -0
  103. package/{dist/scss → scss}/components/slideshow/_variables.scss +0 -0
  104. package/{dist/scss → scss}/components/switch/_index.scss +0 -0
  105. package/{dist/scss → scss}/components/switch/_mixins.scss +0 -0
  106. package/{dist/scss → scss}/components/table/_index.scss +0 -0
  107. package/{dist/scss → scss}/components/table/_mixins.scss +0 -0
  108. package/{src/scss → scss}/components/tabs/_index.scss +5 -1
  109. package/{dist/scss → scss}/components/tabs/_mixins.scss +0 -0
  110. package/{dist/scss → scss}/components/text/_index.scss +0 -0
  111. package/{dist/scss → scss}/components/text-field/_index.scss +0 -0
  112. package/{dist/scss → scss}/components/text-field/_mixins.scss +0 -0
  113. package/{dist/scss → scss}/components/text-field/_variables.scss +0 -0
  114. package/{dist/scss → scss}/components/thumbnail/_index.scss +0 -0
  115. package/{dist/scss → scss}/components/thumbnail/_variables.scss +0 -0
  116. package/{dist/scss → scss}/components/toolbar/_index.scss +0 -0
  117. package/{dist/scss → scss}/components/toolbar/_variables.scss +0 -0
  118. package/{dist/scss → scss}/components/tooltip/_index.scss +0 -0
  119. package/{dist/scss → scss}/components/tooltip/_variables.scss +0 -0
  120. package/{dist/scss → scss}/components/uploader/_index.scss +0 -0
  121. package/{dist/scss → scss}/components/user-block/_index.scss +0 -0
  122. package/{dist/scss → scss}/core/base/_functions.scss +0 -0
  123. package/{dist/scss → scss}/core/base/_helpers.scss +0 -0
  124. package/{dist/scss → scss}/core/base/_index.scss +0 -0
  125. package/{dist/scss → scss}/core/base/_normalize.scss +0 -0
  126. package/{dist/scss → scss}/core/base/_variables.scss +0 -0
  127. package/{dist/scss → scss}/core/color/_functions.scss +0 -0
  128. package/{dist/scss → scss}/core/color/_index.scss +0 -0
  129. package/{dist/scss → scss}/core/color/_variables.scss +0 -0
  130. package/{dist/scss → scss}/core/elevation/_mixins.scss +0 -0
  131. package/{dist/scss → scss}/core/elevation/_variables.scss +0 -0
  132. package/{dist/scss → scss}/core/size/_variables.scss +0 -0
  133. package/{dist/scss → scss}/core/spacing/_index.scss +0 -0
  134. package/{dist/scss → scss}/core/spacing/_variables.scss +0 -0
  135. package/{dist/scss → scss}/core/state/_mixins.scss +0 -0
  136. package/{dist/scss → scss}/core/state/_variables.scss +0 -0
  137. package/{dist/scss → scss}/core/typography/_index.scss +0 -0
  138. package/{dist/scss → scss}/core/typography/_mixins.scss +0 -0
  139. package/{dist/scss → scss}/core/typography/_variables.scss +0 -0
  140. package/{dist/scss → scss}/lumx.scss +0 -0
  141. package/dist/js/custom-colors.min.js.map +0 -1
  142. package/dist/js/date-picker.min.js.map +0 -1
  143. package/dist/js/utils.min.js.map +0 -1
  144. package/dist/package.json +0 -81
  145. package/dist/scss/components/tabs/_index.scss +0 -111
  146. package/src/css/_retro-compat-v2.css +0 -117
  147. package/src/css/design-tokens.css +0 -544
  148. package/src/css/material.css +0 -62
  149. package/src/js/constants/design-tokens.ts +0 -2157
  150. package/src/js/constants/index.ts +0 -35
  151. package/src/js/constants/keycodes.ts +0 -44
  152. package/src/js/custom-colors.ts +0 -56
  153. package/src/js/date-picker.ts +0 -71
  154. package/src/js/utils.ts +0 -296
  155. package/src/scss/_components.scss +0 -35
  156. package/src/scss/_core.scss +0 -12
  157. package/src/scss/_design-tokens.scss +0 -1667
  158. package/src/scss/_retro-compat-v2.scss +0 -95
  159. package/src/scss/components/avatar/_index.scss +0 -42
  160. package/src/scss/components/badge/_index.scss +0 -47
  161. package/src/scss/components/button/_index.scss +0 -166
  162. package/src/scss/components/button/_mixins.scss +0 -271
  163. package/src/scss/components/button/_variables.scss +0 -6
  164. package/src/scss/components/checkbox/_index.scss +0 -231
  165. package/src/scss/components/checkbox/_mixins.scss +0 -69
  166. package/src/scss/components/chip/_index.scss +0 -156
  167. package/src/scss/components/chip/_mixins.scss +0 -37
  168. package/src/scss/components/chip/_variables.scss +0 -1
  169. package/src/scss/components/comment-block/_index.scss +0 -170
  170. package/src/scss/components/date-picker/_index.scss +0 -67
  171. package/src/scss/components/dialog/_index.scss +0 -169
  172. package/src/scss/components/dialog/_variables.scss +0 -8
  173. package/src/scss/components/divider/_index.scss +0 -39
  174. package/src/scss/components/divider/_mixins.scss +0 -60
  175. package/src/scss/components/divider/_variables.scss +0 -7
  176. package/src/scss/components/drag-handle/_index.scss +0 -7
  177. package/src/scss/components/dropdown/_index.scss +0 -22
  178. package/src/scss/components/expansion-panel/_index.scss +0 -80
  179. package/src/scss/components/expansion-panel/_variables.scss +0 -2
  180. package/src/scss/components/flag/_index.scss +0 -41
  181. package/src/scss/components/flex-box/_index.scss +0 -132
  182. package/src/scss/components/generic-block/_index.scss +0 -11
  183. package/src/scss/components/grid/_index.scss +0 -147
  184. package/src/scss/components/grid-column/_index.scss +0 -18
  185. package/src/scss/components/icon/_index.scss +0 -106
  186. package/src/scss/components/icon/_mixins.scss +0 -42
  187. package/src/scss/components/icon/_variables.scss +0 -6
  188. package/src/scss/components/image-block/_index.scss +0 -108
  189. package/src/scss/components/inline-list/_index.scss +0 -15
  190. package/src/scss/components/input-helper/_index.scss +0 -27
  191. package/src/scss/components/input-helper/_mixins.scss +0 -12
  192. package/src/scss/components/input-helper/_variables.scss +0 -1
  193. package/src/scss/components/input-label/_index.scss +0 -23
  194. package/src/scss/components/input-label/_mixins.scss +0 -12
  195. package/src/scss/components/lightbox/_index.scss +0 -59
  196. package/src/scss/components/lightbox/_variables.scss +0 -1
  197. package/src/scss/components/link/_index.scss +0 -35
  198. package/src/scss/components/link/_mixins.scss +0 -25
  199. package/src/scss/components/link-preview/_index.scss +0 -95
  200. package/src/scss/components/list/_index.scss +0 -96
  201. package/src/scss/components/list/_mixins.scss +0 -128
  202. package/src/scss/components/list/_variables.scss +0 -7
  203. package/src/scss/components/message/_index.scss +0 -36
  204. package/src/scss/components/mosaic/_index.scss +0 -120
  205. package/src/scss/components/notification/_index.scss +0 -78
  206. package/src/scss/components/notification/_variables.scss +0 -3
  207. package/src/scss/components/notification-block/_index.scss +0 -42
  208. package/src/scss/components/popover/_index.scss +0 -64
  209. package/src/scss/components/popover/_variables.scss +0 -1
  210. package/src/scss/components/post-block/_index.scss +0 -101
  211. package/src/scss/components/progress/_index.scss +0 -190
  212. package/src/scss/components/progress/_variables.scss +0 -12
  213. package/src/scss/components/progress-tracker/_index.scss +0 -131
  214. package/src/scss/components/progress-tracker/_variables.scss +0 -2
  215. package/src/scss/components/radio-button/_index.scss +0 -180
  216. package/src/scss/components/radio-button/_mixins.scss +0 -82
  217. package/src/scss/components/select/_index.scss +0 -295
  218. package/src/scss/components/select/_mixins.scss +0 -36
  219. package/src/scss/components/side-navigation/_index.scss +0 -69
  220. package/src/scss/components/side-navigation/_mixins.scss +0 -61
  221. package/src/scss/components/skeleton/_index.scss +0 -143
  222. package/src/scss/components/skeleton/_mixins.scss +0 -9
  223. package/src/scss/components/slider/_index.scss +0 -209
  224. package/src/scss/components/slideshow/_index.scss +0 -171
  225. package/src/scss/components/slideshow/_variables.scss +0 -1
  226. package/src/scss/components/switch/_index.scss +0 -257
  227. package/src/scss/components/switch/_mixins.scss +0 -77
  228. package/src/scss/components/table/_index.scss +0 -138
  229. package/src/scss/components/table/_mixins.scss +0 -115
  230. package/src/scss/components/tabs/_mixins.scss +0 -104
  231. package/src/scss/components/text/_index.scss +0 -29
  232. package/src/scss/components/text-field/_index.scss +0 -323
  233. package/src/scss/components/text-field/_mixins.scss +0 -149
  234. package/src/scss/components/text-field/_variables.scss +0 -2
  235. package/src/scss/components/thumbnail/_index.scss +0 -227
  236. package/src/scss/components/thumbnail/_variables.scss +0 -6
  237. package/src/scss/components/toolbar/_index.scss +0 -38
  238. package/src/scss/components/toolbar/_variables.scss +0 -1
  239. package/src/scss/components/tooltip/_index.scss +0 -91
  240. package/src/scss/components/tooltip/_variables.scss +0 -4
  241. package/src/scss/components/uploader/_index.scss +0 -115
  242. package/src/scss/components/user-block/_index.scss +0 -106
  243. package/src/scss/core/base/_functions.scss +0 -3
  244. package/src/scss/core/base/_helpers.scss +0 -21
  245. package/src/scss/core/base/_index.scss +0 -54
  246. package/src/scss/core/base/_normalize.scss +0 -353
  247. package/src/scss/core/base/_variables.scss +0 -39
  248. package/src/scss/core/color/_functions.scss +0 -7
  249. package/src/scss/core/color/_index.scss +0 -15
  250. package/src/scss/core/color/_variables.scss +0 -4
  251. package/src/scss/core/elevation/_mixins.scss +0 -10
  252. package/src/scss/core/elevation/_variables.scss +0 -7
  253. package/src/scss/core/size/_variables.scss +0 -3
  254. package/src/scss/core/spacing/_index.scss +0 -15
  255. package/src/scss/core/spacing/_variables.scss +0 -22
  256. package/src/scss/core/state/_mixins.scss +0 -127
  257. package/src/scss/core/state/_variables.scss +0 -1
  258. package/src/scss/core/typography/_index.scss +0 -16
  259. package/src/scss/core/typography/_mixins.scss +0 -25
  260. package/src/scss/core/typography/_variables.scss +0 -6
  261. package/src/scss/lumx.scss +0 -69
  262. package/style-dictionary/.eslintignore +0 -1
  263. package/style-dictionary/README.md +0 -19
  264. package/style-dictionary/config/_run.js +0 -12
  265. package/style-dictionary/config/_transform-group.js +0 -16
  266. package/style-dictionary/config/gen-css-variables.js +0 -25
  267. package/style-dictionary/config/gen-scss-variables.js +0 -65
  268. package/style-dictionary/config/gen-ts-variables.js +0 -52
  269. package/style-dictionary/config/utils/_color-attributes.js +0 -24
  270. package/style-dictionary/config/utils/_color-rgba-value.js +0 -22
  271. package/style-dictionary/config/utils/_css-prefer-variable.js +0 -24
  272. package/style-dictionary/config/utils/_genHeader.js +0 -3
  273. package/style-dictionary/config/utils/_lumx-variables.js +0 -12
  274. package/style-dictionary/config/utils/_pickFieldsInTree.js +0 -22
  275. package/style-dictionary/config/utils/_prettier-scss.js +0 -13
  276. package/style-dictionary/config/utils/_prettier-ts.js +0 -13
  277. package/style-dictionary/config/utils/_resolve-structure-alias.js +0 -76
  278. package/style-dictionary/index.js +0 -11
  279. package/style-dictionary/properties/components/button.json +0 -206
  280. package/style-dictionary/properties/components/material.json +0 -64
  281. package/style-dictionary/properties/components/navigation.json +0 -207
  282. package/style-dictionary/properties/components/tabs.json +0 -168
  283. package/style-dictionary/properties/components/text-field.json +0 -167
  284. package/style-dictionary/properties/core/border-radius.json +0 -3
  285. package/style-dictionary/properties/core/color.json +0 -421
  286. package/style-dictionary/properties/core/size.json +0 -11
  287. package/style-dictionary/properties/core/spacing.json +0 -11
  288. package/style-dictionary/properties/core/typography.json +0 -127
  289. package/tsconfig.json +0 -3
  290. package/webpack.config.js +0 -202
@@ -1,69 +0,0 @@
1
- /** LUMX THEME */
2
-
3
- @import "~sass-mq";
4
- @import "../css/design-tokens";
5
-
6
- // TODO: remove in next major version
7
- @import "../css/retro-compat-v2";
8
- @import "./design-tokens";
9
-
10
- // TODO: remove in next major version
11
- @import "./retro-compat-v2";
12
- @import "./core";
13
- @import "./components";
14
- @import "./core/base/normalize";
15
- @import "./core/base/index";
16
- @import "./core/base/helpers";
17
- @import "./core/spacing/index";
18
- @import "./core/color/index";
19
- @import "./core/typography/index";
20
- @import "./components/avatar/index";
21
- @import "./components/badge/index";
22
- @import "./components/button/index";
23
- @import "./components/checkbox/index";
24
- @import "./components/chip/index";
25
- @import "./components/comment-block/index";
26
- @import "./components/date-picker/index";
27
- @import "./components/dialog/index";
28
- @import "./components/divider/index";
29
- @import "./components/drag-handle/index";
30
- @import "./components/dropdown/index";
31
- @import "./components/expansion-panel/index";
32
- @import "./components/flag/index";
33
- @import "./components/flex-box/index";
34
- @import "./components/generic-block/index";
35
- @import "./components/grid/index";
36
- @import "./components/grid-column/index";
37
- @import "./components/icon/index";
38
- @import "./components/image-block/index";
39
- @import "./components/inline-list/index";
40
- @import "./components/input-helper/index";
41
- @import "./components/input-label/index";
42
- @import "./components/lightbox/index";
43
- @import "./components/link/index";
44
- @import "./components/link-preview/index";
45
- @import "./components/list/index";
46
- @import "./components/message/index";
47
- @import "./components/mosaic/index";
48
- @import "./components/notification/index";
49
- @import "./components/notification-block/index";
50
- @import "./components/popover/index";
51
- @import "./components/post-block/index";
52
- @import "./components/progress/index";
53
- @import "./components/progress-tracker/index";
54
- @import "./components/radio-button/index";
55
- @import "./components/select/index";
56
- @import "./components/side-navigation/index";
57
- @import "./components/skeleton/index";
58
- @import "./components/slideshow/index";
59
- @import "./components/slider/index";
60
- @import "./components/switch/index";
61
- @import "./components/table/index";
62
- @import "./components/tabs/index";
63
- @import "./components/text/index";
64
- @import "./components/text-field/index";
65
- @import "./components/thumbnail/index";
66
- @import "./components/toolbar/index";
67
- @import "./components/tooltip/index";
68
- @import "./components/uploader/index";
69
- @import "./components/user-block/index";
@@ -1 +0,0 @@
1
- **
@@ -1,19 +0,0 @@
1
- # Style dictionary
2
-
3
- This folder contains the [style dictionary](https://amzn.github.io/style-dictionary/) for the LumX Design System.
4
-
5
- ## Directory structure
6
-
7
- ```
8
- - properties => style dictionary properties
9
- - config => build configs (export to SCSS, to TS, etc.)
10
- - index.js => main build script
11
- ```
12
-
13
- ## Generate code (SCSS, JS, etc.) from the style dictionary
14
-
15
- To generate everything, simply run:
16
-
17
- ```sh
18
- yarn generate:design-tokens
19
- ```
@@ -1,12 +0,0 @@
1
- const resolveStructureAlias = require('./utils/_resolve-structure-alias');
2
- const StyleDictionary = require('style-dictionary');
3
-
4
- const [config] = process.argv.slice(2);
5
- if (config) {
6
- // Load style dictionary config.
7
- const dictionary = StyleDictionary.extend(require(`./${config}`)());
8
- resolveStructureAlias(dictionary.properties);
9
-
10
- // Build.
11
- dictionary.buildAllPlatforms();
12
- }
@@ -1,16 +0,0 @@
1
- const StyleDictionary = require("style-dictionary");
2
-
3
- /**
4
- * Transform group:
5
- */
6
- const name = "transform-group-custom";
7
- StyleDictionary.registerTransformGroup({
8
- name,
9
- transforms: [
10
- require("./utils/_lumx-variables"),
11
- require("./utils/_color-attributes"),
12
- require("./utils/_color-rgba-value"),
13
- require("./utils/_css-prefer-variable")
14
- ]
15
- });
16
- module.exports = name;
@@ -1,25 +0,0 @@
1
- const path = require('path');
2
- const transformGroup = require('./_transform-group');
3
-
4
- module.exports = () => {
5
- const baseDir = `${__dirname}/../`;
6
- const buildPath = `${path.resolve(baseDir, `../src/css/`)}/`;
7
-
8
- return {
9
- source: [`${baseDir}/properties/**/*.json`],
10
- platforms: {
11
- css: {
12
- transformGroup,
13
- buildPath,
14
- files: [
15
- {
16
- format: 'css/variables',
17
- destination: 'design-tokens.css',
18
- mapName: 'lumx-design-tokens',
19
- },
20
- ],
21
- actions: [require('./utils/_prettier-scss')({ buildPath })],
22
- },
23
- },
24
- };
25
- };
@@ -1,65 +0,0 @@
1
- const StyleDictionary = require('style-dictionary');
2
- const path = require('path');
3
- const _ = require('lodash');
4
- const transformGroup = require('./_transform-group');
5
-
6
- /**
7
- * SCSS generator
8
- * Inspired by https://raw.githubusercontent.com/amzn/style-dictionary/9d867ef3ad72cf68557434ce1a28ba996a5ac467/lib/common/templates/scss/map-deep.template
9
- */
10
- const format = 'scss/custom-map-deep';
11
- StyleDictionary.registerFormat({
12
- name: format,
13
- formatter(dictionary, depth = 0) {
14
- // List SCSS variables.
15
- const scssVariables = dictionary.allProperties
16
- .map(({ name, value, comment }) => `$${name}: ${value} !default;${comment ? ` // ${comment}` : ''}`)
17
- .join('\n');
18
-
19
- // Build SCSS map (from SCSS variable values).
20
- function processProperties(prop) {
21
- const indent = ' '.repeat(depth + 1);
22
- if (prop.hasOwnProperty('value')) {
23
- return `$${prop.name}`;
24
- } else {
25
- const subProps = Object.keys(prop)
26
- .filter(key => !key.startsWith('$') &&_.isPlainObject(prop[key]))
27
- .map((key) => `${indent}'${key}': ${processProperties(prop[key], depth + 1)}`)
28
- .join(',\n');
29
- return `(\n${subProps}\n${' '.repeat(depth)})`;
30
- }
31
- }
32
- const scssMapName = this.mapName || 'tokens';
33
- const scssMap = `$${scssMapName}: ${processProperties(dictionary.properties)} !default;`;
34
-
35
- return `
36
- ${require('./utils/_genHeader')()}
37
-
38
- ${scssVariables}
39
-
40
- ${scssMap}
41
- `;
42
- },
43
- });
44
-
45
- module.exports = () => {
46
- const baseDir = `${__dirname}/../`;
47
- const buildPath = `${path.resolve(baseDir, `../src/scss/`)}/`;
48
- return {
49
- source: [`${baseDir}/properties/**/*.json`],
50
- platforms: {
51
- scss: {
52
- transformGroup,
53
- buildPath,
54
- files: [
55
- {
56
- destination: '_design-tokens.scss',
57
- format,
58
- mapName: 'lumx-design-tokens',
59
- },
60
- ],
61
- actions: [require('./utils/_prettier-scss')({ buildPath })],
62
- },
63
- },
64
- };
65
- };
@@ -1,52 +0,0 @@
1
- const StyleDictionary = require('style-dictionary');
2
- const path = require('path');
3
- const pickFieldsInTree = require('./utils/_pickFieldsInTree');
4
- const transformGroup = require('./_transform-group');
5
-
6
- /**
7
- * Typescript generator:
8
- */
9
- const format = 'typescript/map-deep';
10
- StyleDictionary.registerFormat({
11
- name: format,
12
- formatter(dictionary) {
13
- const properties = this.pickFields
14
- ? pickFieldsInTree(dictionary.properties, this.pickFields)
15
- : dictionary.properties;
16
- return `
17
- ${require('./utils/_genHeader')()}
18
-
19
- export const DESIGN_TOKENS = ${JSON.stringify(properties)}
20
- `;
21
- },
22
- });
23
-
24
- module.exports = () => {
25
- const baseDir = `${__dirname}/../`;
26
- const buildPath = `${path.resolve(baseDir, `../src/js/constants/`)}/`;
27
-
28
- return {
29
- source: [`${baseDir}/properties/**/*.json`],
30
- platforms: {
31
- ts: {
32
- transformGroup,
33
- buildPath,
34
- files: [
35
- {
36
- format,
37
- destination: 'design-tokens.ts',
38
- pickFields: [
39
- 'version',
40
- 'comment',
41
- 'value',
42
- 'attributes.hex',
43
- 'attributes.rgb',
44
- '$aliasedFrom'
45
- ],
46
- },
47
- ],
48
- actions: [require('./utils/_prettier-ts')({ buildPath })],
49
- },
50
- },
51
- };
52
- };
@@ -1,24 +0,0 @@
1
- const StyleDictionary = require("style-dictionary");
2
- const tinycolor2 = require("tinycolor2");
3
-
4
- /**
5
- * Color value transform to RGBA object with added opacity if provided.
6
- */
7
- const name = "color/attributes";
8
-
9
- StyleDictionary.registerTransform({
10
- name,
11
- type: "attribute",
12
- matcher: (prop) => /\bcolor\b/.exec(prop.name),
13
- transformer: ({ value, attributes = {}, opacity = 1 }) => {
14
- const color = tinycolor2(value);
15
- if (!color.getFormat() || color.getFormat() === "name") {
16
- // Skip if format "name" or undefined.
17
- return attributes;
18
- }
19
-
20
- const colorWithAlpha = color.setAlpha(opacity);
21
- return { ...attributes, rgb: colorWithAlpha.toRgb(), hex: colorWithAlpha.toHex() };
22
- }
23
- });
24
- module.exports = name;
@@ -1,22 +0,0 @@
1
- const StyleDictionary = require("style-dictionary");
2
- const tinycolor2 = require("tinycolor2");
3
-
4
- /**
5
- * Color value transform to RGBA object with added opacity if provided.
6
- */
7
- const name = "color/rgba-value";
8
-
9
- StyleDictionary.registerTransform({
10
- name,
11
- type: "value",
12
- matcher: (prop) => /\bcolor\b/.exec(prop.name),
13
- transformer: ({ value, attributes = {} }) => {
14
- const color = tinycolor2(attributes.rgb);
15
- if (!color.getFormat() || color.getFormat() === "name") {
16
- // Skip if format "name" or undefined.
17
- return value;
18
- }
19
- return color.toRgbString();
20
- }
21
- });
22
- module.exports = name;
@@ -1,24 +0,0 @@
1
- const StyleDictionary = require("style-dictionary");
2
-
3
- const name = "css/prefer-variable";
4
-
5
- StyleDictionary.registerTransform({
6
- name,
7
- type: "value",
8
- matcher: (prop) => prop.preferCSSVariable,
9
- transformer: (prop, config) => {
10
- const extension = config.files[0].destination.replace(/.*\./, '');
11
- let name;
12
- if ((prop[`$config.${extension}`] || {}).aliasEquivalentCSSVariable) {
13
- // Keep original prop name.
14
- name = prop.name;
15
- } else if (prop.$aliasedFrom) {
16
- // Use the prop name for the original prop.
17
- name = ('lumx.'+prop.$aliasedFrom).replace(/\./g, '-');
18
- }
19
-
20
- if (!name) return prop.value;
21
- return`var(--${name})`;
22
- }
23
- });
24
- module.exports = name;
@@ -1,3 +0,0 @@
1
- module.exports = function () {
2
- return `/**\n * Do not edit directly\n * Generated on ${new Date().toUTCString()}\n */`;
3
- }
@@ -1,12 +0,0 @@
1
- const StyleDictionary = require('style-dictionary');
2
-
3
- /**
4
- * Transform variable names.
5
- */
6
- const name = 'name/lumx-variables';
7
- StyleDictionary.registerTransform({
8
- name,
9
- type: 'name',
10
- transformer: (prop) => `lumx-${prop.path.join('-')}`,
11
- });
12
- module.exports = name;
@@ -1,22 +0,0 @@
1
- const _ = require('lodash');
2
- const fp = require('lodash/fp');
3
-
4
- module.exports = function pickFieldsInTree(object, fields) {
5
- if (!_.isPlainObject(object)) return null;
6
-
7
- const values = fields.map((field) => _.get(object, field));
8
- if (values.filter(Boolean).length > 0) {
9
- return values.reduce((acc, value, index) => {
10
- if (value) return _.set(acc, fields[index], value);
11
- return acc;
12
- }, {});
13
- }
14
-
15
- return fp.flow(
16
- Object.entries,
17
- fp.filter(([, value]) => _.isPlainObject(value)),
18
- fp.map(([key, value]) => [key, pickFieldsInTree(value, fields)]),
19
- fp.filter(([, value]) => !_.isEmpty(value)),
20
- Object.fromEntries,
21
- )(object);
22
- };
@@ -1,13 +0,0 @@
1
- const StyleDictionary = require('style-dictionary');
2
- const execSync = require('child_process').execSync;
3
- const path = require('path');
4
- const bin = path.resolve(__dirname, '../../../../../node_modules/.bin');
5
-
6
- module.exports = function ({ buildPath }) {
7
- const name = 'prettier/style';
8
- StyleDictionary.registerAction({
9
- name,
10
- do: () => execSync(`${bin}/prettier --write '${path.resolve(buildPath)}/**'`),
11
- });
12
- return name;
13
- };
@@ -1,13 +0,0 @@
1
- const StyleDictionary = require('style-dictionary');
2
- const execSync = require('child_process').execSync;
3
- const path = require('path');
4
- const bin = path.resolve(__dirname, '../../../../../node_modules/.bin');
5
-
6
- module.exports = function ({ buildPath }) {
7
- const name = 'prettier/ts';
8
- StyleDictionary.registerAction({
9
- name,
10
- do: () => execSync(`${bin}/eslint --fix '${path.resolve(buildPath)}'`),
11
- });
12
- return name;
13
- };
@@ -1,76 +0,0 @@
1
- const _ = require("lodash");
2
- const RGX = /^{([^}]+)}$/;
3
-
4
- // Returns the string path matching the regexp or null if invalid.
5
- const asAliasPath = (maybePath) => _.get(_.isString(maybePath) && maybePath.match(RGX), [1], null);
6
-
7
- function getNested(tree, path) {
8
- function recur(node, path) {
9
- if (!path || !node) return undefined;
10
- const [first, ...rest] = path.split(".");
11
- const value = node[first];
12
- if (rest.length === 0 || !value) return value;
13
- const aliasPath = asAliasPath(value);
14
- if (aliasPath) return recur(recur(tree, aliasPath), rest.join("."));
15
- if (_.isPlainObject(value)) return recur(value, rest.join("."));
16
- return value;
17
- }
18
-
19
- return recur(tree, path);
20
- }
21
-
22
- function copyPropsRecursively(node, props) {
23
- if (_.isPlainObject(node)) {
24
- if ('value' in node) {
25
- Object.assign(node, props);
26
- } else {
27
- for (let value of Object.values(node)) {
28
- copyPropsRecursively(value, props)
29
- }
30
- }
31
- }
32
- }
33
-
34
- /**
35
- * Style dictionary does not resolve alias in the property tree, only in property object (= object with a value key).
36
- *
37
- * By default
38
- * This works : `{ "color": { "value": "{theme.baseColor}", "attr": "{foo.bar}" }}`
39
- * This does not : `{ "color": "{foo.bar}" }`
40
- *
41
- * This function resolve the second use case.
42
- */
43
- module.exports = function(tree) {
44
- function resolveAliasInNode(node) {
45
- // Skip if not object.
46
- if (!_.isPlainObject(node)) return;
47
-
48
- // Resolve alias (if any).
49
- for (const [key, value] of Object.entries(node)) {
50
- let aliasPath = asAliasPath(value);
51
- let aliasValue = getNested(tree, aliasPath);
52
- if (typeof aliasValue === "object" && "value" in aliasValue) {
53
- aliasValue = Object.fromEntries(Object.entries(aliasValue).filter(([key]) => !key.startsWith('$config') && key !== "version" && key !== "comment"));
54
- }
55
- if (key === "$extend") {
56
- if (typeof aliasValue !== "object") {
57
- throw new Error("Can't $extend a value that is not an object.");
58
- }
59
- delete node["$extend"];
60
- const baseProps = _.cloneDeep(node);
61
- Object.assign(node, _.cloneDeep(aliasValue));
62
- copyPropsRecursively(node, baseProps);
63
- } else if (aliasValue) {
64
- node[key] = aliasValue;
65
- if (typeof aliasValue === "object" && "value" in aliasValue) {
66
- node[key]["$aliasedFrom"] = aliasPath;
67
- }
68
- } else if (_.isPlainObject(value)) {
69
- resolveAliasInNode(value);
70
- }
71
- }
72
- }
73
-
74
- resolveAliasInNode(tree);
75
- resolveAliasInNode(tree);
76
- };
@@ -1,11 +0,0 @@
1
- const exec = require('child_process').exec;
2
-
3
- const CONFIGS = ['gen-scss-variables', 'gen-ts-variables', 'gen-css-variables'];
4
-
5
- // For each config
6
- for (const config of CONFIGS) {
7
- exec(`yarn node '${__dirname}/config/_run' '${config}'`, (error, stdout, stderr) => {
8
- console.error(stderr);
9
- console.log(stdout);
10
- });
11
- }