@lumx/core 3.0.7-alpha.3 → 3.0.7-alpha.4

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 (287) 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/{dist/js → js}/custom-colors.min.js.map +0 -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/{dist/js → js}/date-picker.min.js.map +0 -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/{dist/js → js}/utils.min.js.map +0 -0
  29. package/{dist/js → js}/utils.ts +0 -0
  30. package/{dist/lumx.css → lumx.css} +0 -0
  31. package/{dist/lumx.min.css → lumx.min.css} +0 -0
  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/{dist/scss → scss}/components/tabs/_index.scss +0 -0
  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/package.json +0 -81
  142. package/src/css/_retro-compat-v2.css +0 -117
  143. package/src/css/design-tokens.css +0 -544
  144. package/src/css/material.css +0 -62
  145. package/src/js/constants/design-tokens.ts +0 -2157
  146. package/src/js/constants/index.ts +0 -35
  147. package/src/js/constants/keycodes.ts +0 -44
  148. package/src/js/custom-colors.ts +0 -56
  149. package/src/js/date-picker.ts +0 -71
  150. package/src/js/utils.ts +0 -296
  151. package/src/scss/_components.scss +0 -35
  152. package/src/scss/_core.scss +0 -12
  153. package/src/scss/_design-tokens.scss +0 -1667
  154. package/src/scss/_retro-compat-v2.scss +0 -95
  155. package/src/scss/components/avatar/_index.scss +0 -42
  156. package/src/scss/components/badge/_index.scss +0 -47
  157. package/src/scss/components/button/_index.scss +0 -166
  158. package/src/scss/components/button/_mixins.scss +0 -271
  159. package/src/scss/components/button/_variables.scss +0 -6
  160. package/src/scss/components/checkbox/_index.scss +0 -231
  161. package/src/scss/components/checkbox/_mixins.scss +0 -69
  162. package/src/scss/components/chip/_index.scss +0 -156
  163. package/src/scss/components/chip/_mixins.scss +0 -37
  164. package/src/scss/components/chip/_variables.scss +0 -1
  165. package/src/scss/components/comment-block/_index.scss +0 -170
  166. package/src/scss/components/date-picker/_index.scss +0 -67
  167. package/src/scss/components/dialog/_index.scss +0 -169
  168. package/src/scss/components/dialog/_variables.scss +0 -8
  169. package/src/scss/components/divider/_index.scss +0 -39
  170. package/src/scss/components/divider/_mixins.scss +0 -60
  171. package/src/scss/components/divider/_variables.scss +0 -7
  172. package/src/scss/components/drag-handle/_index.scss +0 -7
  173. package/src/scss/components/dropdown/_index.scss +0 -22
  174. package/src/scss/components/expansion-panel/_index.scss +0 -80
  175. package/src/scss/components/expansion-panel/_variables.scss +0 -2
  176. package/src/scss/components/flag/_index.scss +0 -41
  177. package/src/scss/components/flex-box/_index.scss +0 -132
  178. package/src/scss/components/generic-block/_index.scss +0 -11
  179. package/src/scss/components/grid/_index.scss +0 -147
  180. package/src/scss/components/grid-column/_index.scss +0 -18
  181. package/src/scss/components/icon/_index.scss +0 -106
  182. package/src/scss/components/icon/_mixins.scss +0 -42
  183. package/src/scss/components/icon/_variables.scss +0 -6
  184. package/src/scss/components/image-block/_index.scss +0 -108
  185. package/src/scss/components/inline-list/_index.scss +0 -15
  186. package/src/scss/components/input-helper/_index.scss +0 -27
  187. package/src/scss/components/input-helper/_mixins.scss +0 -12
  188. package/src/scss/components/input-helper/_variables.scss +0 -1
  189. package/src/scss/components/input-label/_index.scss +0 -23
  190. package/src/scss/components/input-label/_mixins.scss +0 -12
  191. package/src/scss/components/lightbox/_index.scss +0 -59
  192. package/src/scss/components/lightbox/_variables.scss +0 -1
  193. package/src/scss/components/link/_index.scss +0 -35
  194. package/src/scss/components/link/_mixins.scss +0 -25
  195. package/src/scss/components/link-preview/_index.scss +0 -95
  196. package/src/scss/components/list/_index.scss +0 -96
  197. package/src/scss/components/list/_mixins.scss +0 -128
  198. package/src/scss/components/list/_variables.scss +0 -7
  199. package/src/scss/components/message/_index.scss +0 -36
  200. package/src/scss/components/mosaic/_index.scss +0 -120
  201. package/src/scss/components/notification/_index.scss +0 -78
  202. package/src/scss/components/notification/_variables.scss +0 -3
  203. package/src/scss/components/notification-block/_index.scss +0 -42
  204. package/src/scss/components/popover/_index.scss +0 -64
  205. package/src/scss/components/popover/_variables.scss +0 -1
  206. package/src/scss/components/post-block/_index.scss +0 -101
  207. package/src/scss/components/progress/_index.scss +0 -190
  208. package/src/scss/components/progress/_variables.scss +0 -12
  209. package/src/scss/components/progress-tracker/_index.scss +0 -131
  210. package/src/scss/components/progress-tracker/_variables.scss +0 -2
  211. package/src/scss/components/radio-button/_index.scss +0 -180
  212. package/src/scss/components/radio-button/_mixins.scss +0 -82
  213. package/src/scss/components/select/_index.scss +0 -295
  214. package/src/scss/components/select/_mixins.scss +0 -36
  215. package/src/scss/components/side-navigation/_index.scss +0 -69
  216. package/src/scss/components/side-navigation/_mixins.scss +0 -61
  217. package/src/scss/components/skeleton/_index.scss +0 -143
  218. package/src/scss/components/skeleton/_mixins.scss +0 -9
  219. package/src/scss/components/slider/_index.scss +0 -209
  220. package/src/scss/components/slideshow/_index.scss +0 -171
  221. package/src/scss/components/slideshow/_variables.scss +0 -1
  222. package/src/scss/components/switch/_index.scss +0 -257
  223. package/src/scss/components/switch/_mixins.scss +0 -77
  224. package/src/scss/components/table/_index.scss +0 -138
  225. package/src/scss/components/table/_mixins.scss +0 -115
  226. package/src/scss/components/tabs/_index.scss +0 -111
  227. package/src/scss/components/tabs/_mixins.scss +0 -104
  228. package/src/scss/components/text/_index.scss +0 -29
  229. package/src/scss/components/text-field/_index.scss +0 -323
  230. package/src/scss/components/text-field/_mixins.scss +0 -149
  231. package/src/scss/components/text-field/_variables.scss +0 -2
  232. package/src/scss/components/thumbnail/_index.scss +0 -227
  233. package/src/scss/components/thumbnail/_variables.scss +0 -6
  234. package/src/scss/components/toolbar/_index.scss +0 -38
  235. package/src/scss/components/toolbar/_variables.scss +0 -1
  236. package/src/scss/components/tooltip/_index.scss +0 -91
  237. package/src/scss/components/tooltip/_variables.scss +0 -4
  238. package/src/scss/components/uploader/_index.scss +0 -115
  239. package/src/scss/components/user-block/_index.scss +0 -106
  240. package/src/scss/core/base/_functions.scss +0 -3
  241. package/src/scss/core/base/_helpers.scss +0 -21
  242. package/src/scss/core/base/_index.scss +0 -54
  243. package/src/scss/core/base/_normalize.scss +0 -353
  244. package/src/scss/core/base/_variables.scss +0 -39
  245. package/src/scss/core/color/_functions.scss +0 -7
  246. package/src/scss/core/color/_index.scss +0 -15
  247. package/src/scss/core/color/_variables.scss +0 -4
  248. package/src/scss/core/elevation/_mixins.scss +0 -10
  249. package/src/scss/core/elevation/_variables.scss +0 -7
  250. package/src/scss/core/size/_variables.scss +0 -3
  251. package/src/scss/core/spacing/_index.scss +0 -15
  252. package/src/scss/core/spacing/_variables.scss +0 -22
  253. package/src/scss/core/state/_mixins.scss +0 -127
  254. package/src/scss/core/state/_variables.scss +0 -1
  255. package/src/scss/core/typography/_index.scss +0 -16
  256. package/src/scss/core/typography/_mixins.scss +0 -25
  257. package/src/scss/core/typography/_variables.scss +0 -6
  258. package/src/scss/lumx.scss +0 -69
  259. package/style-dictionary/.eslintignore +0 -1
  260. package/style-dictionary/README.md +0 -19
  261. package/style-dictionary/config/_run.js +0 -12
  262. package/style-dictionary/config/_transform-group.js +0 -16
  263. package/style-dictionary/config/gen-css-variables.js +0 -25
  264. package/style-dictionary/config/gen-scss-variables.js +0 -65
  265. package/style-dictionary/config/gen-ts-variables.js +0 -52
  266. package/style-dictionary/config/utils/_color-attributes.js +0 -24
  267. package/style-dictionary/config/utils/_color-rgba-value.js +0 -22
  268. package/style-dictionary/config/utils/_css-prefer-variable.js +0 -24
  269. package/style-dictionary/config/utils/_genHeader.js +0 -3
  270. package/style-dictionary/config/utils/_lumx-variables.js +0 -12
  271. package/style-dictionary/config/utils/_pickFieldsInTree.js +0 -22
  272. package/style-dictionary/config/utils/_prettier-scss.js +0 -13
  273. package/style-dictionary/config/utils/_prettier-ts.js +0 -13
  274. package/style-dictionary/config/utils/_resolve-structure-alias.js +0 -76
  275. package/style-dictionary/index.js +0 -11
  276. package/style-dictionary/properties/components/button.json +0 -206
  277. package/style-dictionary/properties/components/material.json +0 -64
  278. package/style-dictionary/properties/components/navigation.json +0 -207
  279. package/style-dictionary/properties/components/tabs.json +0 -168
  280. package/style-dictionary/properties/components/text-field.json +0 -167
  281. package/style-dictionary/properties/core/border-radius.json +0 -3
  282. package/style-dictionary/properties/core/color.json +0 -421
  283. package/style-dictionary/properties/core/size.json +0 -11
  284. package/style-dictionary/properties/core/spacing.json +0 -11
  285. package/style-dictionary/properties/core/typography.json +0 -127
  286. package/tsconfig.json +0 -3
  287. 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
- }