style-dictionary 4.0.0-prerelease.9 → 4.0.1

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 (372) hide show
  1. package/README.md +29 -4
  2. package/bin/style-dictionary.js +33 -15
  3. package/examples/README.md +0 -4
  4. package/examples/advanced/assets-base64-embed/README.md +2 -2
  5. package/examples/advanced/assets-base64-embed/config.json +77 -68
  6. package/examples/advanced/assets-base64-embed/package.json +2 -1
  7. package/examples/advanced/assets-base64-embed/tokens/assets/fonts.json +6 -6
  8. package/examples/advanced/assets-base64-embed/tokens/assets/icons.json +28 -28
  9. package/examples/advanced/assets-base64-embed/tokens/assets/images.json +1 -1
  10. package/examples/advanced/assets-base64-embed/tokens/color/base.json +5 -5
  11. package/examples/advanced/assets-base64-embed/tokens/color/font.json +3 -3
  12. package/examples/advanced/assets-base64-embed/tokens/size/font.json +11 -7
  13. package/examples/advanced/create-react-app/package.json +2 -1
  14. package/examples/advanced/create-react-app/style-dictionary/config.json +13 -9
  15. package/examples/advanced/create-react-app/style-dictionary/tokens/color.json +22 -0
  16. package/examples/advanced/create-react-app/style-dictionary/tokens/font.json +34 -0
  17. package/examples/advanced/create-react-app/style-dictionary/tokens/spacing.json +16 -0
  18. package/examples/advanced/create-react-native-app/config.json +1 -1
  19. package/examples/advanced/create-react-native-app/metro.config.js +2 -1
  20. package/examples/advanced/create-react-native-app/package.json +2 -1
  21. package/examples/advanced/create-react-native-app/src/App.js +1 -0
  22. package/examples/advanced/create-react-native-app/style-dictionary/{properties → tokens}/color/brand.json +2 -6
  23. package/examples/advanced/create-react-native-app/style-dictionary/{properties → tokens}/size/size.json +2 -6
  24. package/examples/advanced/custom-parser/README.md +7 -4
  25. package/examples/advanced/custom-parser/package.json +2 -1
  26. package/examples/advanced/custom-parser/sd.config.js +14 -27
  27. package/examples/advanced/custom-parser/tokens/color/core.json +2 -2
  28. package/examples/advanced/custom-transforms/README.md +11 -11
  29. package/examples/advanced/custom-transforms/build.js +22 -30
  30. package/examples/advanced/custom-transforms/package.json +2 -1
  31. package/examples/advanced/custom-transforms/tokens/button.json +4 -3
  32. package/examples/advanced/custom-transforms/tokens/colors.json +7 -7
  33. package/examples/advanced/custom-transforms/tokens/font.json +7 -7
  34. package/examples/advanced/custom-transforms/tokens/spacing.json +5 -5
  35. package/examples/advanced/flutter/style_dictionary/config.json +42 -42
  36. package/examples/advanced/flutter/style_dictionary/tokens/color/background.json +9 -0
  37. package/examples/advanced/flutter/style_dictionary/tokens/color/core.json +10 -0
  38. package/examples/advanced/flutter/style_dictionary/tokens/color/font.json +9 -0
  39. package/examples/advanced/flutter/style_dictionary/tokens/size/font.json +9 -0
  40. package/examples/advanced/flutter/style_dictionary/tokens/size/padding.json +9 -0
  41. package/examples/advanced/font-face-rules/README.md +3 -2
  42. package/examples/advanced/font-face-rules/package.json +2 -1
  43. package/examples/advanced/font-face-rules/sd.config.js +4 -4
  44. package/examples/advanced/font-face-rules/tokens.json +8 -4
  45. package/examples/advanced/format-helpers/package.json +1 -1
  46. package/examples/advanced/format-helpers/sd.config.js +66 -62
  47. package/examples/advanced/format-helpers/tokens/color.json +5 -5
  48. package/examples/advanced/matching-build-files/config.js +17 -17
  49. package/examples/advanced/matching-build-files/package.json +2 -1
  50. package/examples/advanced/matching-build-files/tokens/button/base.json +14 -12
  51. package/examples/advanced/matching-build-files/tokens/color/base.json +10 -8
  52. package/examples/advanced/matching-build-files/tokens/index.js +3 -3
  53. package/examples/advanced/matching-build-files/tokens/size/base.json +14 -11
  54. package/examples/advanced/multi-brand-multi-platform/README.md +21 -21
  55. package/examples/advanced/multi-brand-multi-platform/build.js +3 -8
  56. package/examples/advanced/multi-brand-multi-platform/package.json +2 -1
  57. package/examples/advanced/multi-brand-multi-platform/tokens/brands/brand-1/color.json +3 -3
  58. package/examples/advanced/multi-brand-multi-platform/tokens/brands/brand-2/color.json +3 -3
  59. package/examples/advanced/multi-brand-multi-platform/tokens/brands/brand-3/color.json +3 -3
  60. package/examples/advanced/multi-brand-multi-platform/tokens/globals/button.json +4 -2
  61. package/examples/advanced/multi-brand-multi-platform/tokens/globals/color/base.json +11 -11
  62. package/examples/advanced/multi-brand-multi-platform/tokens/globals/color/font.json +4 -4
  63. package/examples/advanced/multi-brand-multi-platform/tokens/globals/font/index.json +3 -3
  64. package/examples/advanced/multi-brand-multi-platform/tokens/platforms/android/button.json +3 -2
  65. package/examples/advanced/multi-brand-multi-platform/tokens/platforms/android/font.json +2 -2
  66. package/examples/advanced/multi-brand-multi-platform/tokens/platforms/ios/button.json +3 -2
  67. package/examples/advanced/multi-brand-multi-platform/tokens/platforms/ios/font.json +2 -2
  68. package/examples/advanced/multi-brand-multi-platform/tokens/platforms/web/button.json +3 -2
  69. package/examples/advanced/multi-brand-multi-platform/tokens/platforms/web/font.json +2 -2
  70. package/examples/advanced/node-modules-as-config-and-properties/README.md +2 -2
  71. package/examples/advanced/node-modules-as-config-and-properties/components/button/base.js +3 -3
  72. package/examples/advanced/node-modules-as-config-and-properties/components/button/index.js +6 -3
  73. package/examples/advanced/node-modules-as-config-and-properties/components/button/primary.js +4 -3
  74. package/examples/advanced/node-modules-as-config-and-properties/components/button/secondary.js +4 -3
  75. package/examples/advanced/node-modules-as-config-and-properties/components/index.js +4 -2
  76. package/examples/advanced/node-modules-as-config-and-properties/config.js +23 -20
  77. package/examples/advanced/node-modules-as-config-and-properties/package.json +2 -1
  78. package/examples/advanced/node-modules-as-config-and-properties/tokens/color/background.js +1 -1
  79. package/examples/advanced/node-modules-as-config-and-properties/tokens/color/border.js +1 -1
  80. package/examples/advanced/node-modules-as-config-and-properties/tokens/color/brand.js +1 -1
  81. package/examples/advanced/node-modules-as-config-and-properties/tokens/color/core.js +5 -4
  82. package/examples/advanced/node-modules-as-config-and-properties/tokens/color/font.js +1 -1
  83. package/examples/advanced/node-modules-as-config-and-properties/tokens/color/index.js +12 -6
  84. package/examples/advanced/node-modules-as-config-and-properties/tokens/index.js +6 -3
  85. package/examples/advanced/node-modules-as-config-and-properties/tokens/size/border.js +1 -1
  86. package/examples/advanced/node-modules-as-config-and-properties/tokens/size/font.js +1 -1
  87. package/examples/advanced/node-modules-as-config-and-properties/tokens/size/index.js +1 -1
  88. package/examples/advanced/node-modules-as-config-and-properties/tokens/size/padding.js +1 -1
  89. package/examples/advanced/npm-module/package.json +2 -1
  90. package/examples/advanced/npm-module/tokens/color/base.json +5 -5
  91. package/examples/advanced/npm-module/tokens/color/font.json +3 -3
  92. package/examples/advanced/npm-module/tokens/size/font.json +11 -7
  93. package/examples/advanced/referencing_aliasing/package.json +2 -1
  94. package/examples/advanced/referencing_aliasing/tokens/button/button.json +8 -4
  95. package/examples/advanced/referencing_aliasing/tokens/color/base.json +9 -9
  96. package/examples/advanced/referencing_aliasing/tokens/color/font.json +3 -3
  97. package/examples/advanced/referencing_aliasing/tokens/size/font.json +11 -7
  98. package/examples/advanced/s3/config.json +63 -51
  99. package/examples/advanced/s3/package.json +2 -1
  100. package/examples/advanced/s3/tokens/assets/fonts.json +18 -0
  101. package/examples/advanced/s3/tokens/assets/icons.json +34 -0
  102. package/examples/advanced/s3/tokens/color/base.json +13 -0
  103. package/examples/advanced/s3/tokens/color/font.json +9 -0
  104. package/examples/advanced/s3/tokens/size/font.json +26 -0
  105. package/examples/advanced/s3/upload.js +2 -2
  106. package/examples/advanced/tokens-deprecation/build.js +13 -5
  107. package/examples/advanced/tokens-deprecation/package.json +2 -2
  108. package/examples/advanced/tokens-deprecation/templates/ios-plist.template.js +70 -0
  109. package/examples/advanced/tokens-deprecation/templates/web-scss.template.js +30 -0
  110. package/examples/advanced/transitive-transforms/package.json +3 -2
  111. package/examples/advanced/transitive-transforms/sd.config.js +37 -24
  112. package/examples/advanced/transitive-transforms/tokens/color/core.json5 +223 -155
  113. package/examples/advanced/transitive-transforms/tokens/color/font.json5 +21 -17
  114. package/examples/advanced/transitive-transforms/tokens/color/overlay.json5 +21 -15
  115. package/examples/advanced/variables-in-outputs/package.json +2 -1
  116. package/examples/advanced/variables-in-outputs/sd.config.js +26 -24
  117. package/examples/advanced/variables-in-outputs/tokens/color/background.json +4 -4
  118. package/examples/advanced/variables-in-outputs/tokens/color/palette.json +11 -11
  119. package/examples/advanced/yaml-tokens/package.json +2 -1
  120. package/examples/advanced/yaml-tokens/sd.config.js +17 -14
  121. package/examples/advanced/yaml-tokens/tokens/color/core.yaml +4 -0
  122. package/examples/basic/README.md +5 -179
  123. package/examples/basic/config.json +126 -105
  124. package/examples/basic/tokens/colors.json +40 -0
  125. package/examples/basic/tokens/dimensions.json +56 -0
  126. package/examples/basic/tokens/object-values.json +115 -0
  127. package/examples/basic/tokens/text.json +62 -0
  128. package/examples/complete/config.json +116 -85
  129. package/examples/complete/package.json +4 -3
  130. package/examples/complete/tokens/asset/font.json +10 -10
  131. package/examples/complete/tokens/color/background.json +58 -18
  132. package/examples/complete/tokens/color/base.json +256 -256
  133. package/examples/complete/tokens/color/border.json +10 -10
  134. package/examples/complete/tokens/color/brand.json +10 -10
  135. package/examples/complete/tokens/color/chart.json +9 -9
  136. package/examples/complete/tokens/color/font.json +22 -23
  137. package/examples/complete/tokens/content/icon.json +970 -970
  138. package/examples/complete/tokens/font.json +4 -2
  139. package/examples/complete/tokens/size/font.json +8 -8
  140. package/examples/complete/tokens/size/icon.json +5 -5
  141. package/examples/complete/tokens/size/padding.json +7 -7
  142. package/examples/complete/tokens/time.json +19 -19
  143. package/lib/Register.d.ts +24 -67
  144. package/lib/Register.js +146 -163
  145. package/lib/StyleDictionary.d.ts +114 -26
  146. package/lib/StyleDictionary.js +598 -86
  147. package/lib/cleanActions.d.ts +12 -6
  148. package/lib/cleanActions.js +16 -10
  149. package/lib/cleanDir.d.ts +8 -5
  150. package/lib/cleanDir.js +13 -8
  151. package/lib/cleanDirs.d.ts +6 -3
  152. package/lib/cleanDirs.js +15 -10
  153. package/lib/cleanFile.d.ts +8 -5
  154. package/lib/cleanFile.js +18 -10
  155. package/lib/cleanFiles.d.ts +6 -3
  156. package/lib/cleanFiles.js +15 -10
  157. package/lib/common/actions.d.ts +5 -5
  158. package/lib/common/actions.js +39 -30
  159. package/lib/common/filters.d.ts +2 -2
  160. package/lib/common/filters.js +2 -2
  161. package/lib/common/formatHelpers/createPropertyFormatter.d.ts +16 -12
  162. package/lib/common/formatHelpers/createPropertyFormatter.js +41 -24
  163. package/lib/common/formatHelpers/fileHeader.d.ts +17 -14
  164. package/lib/common/formatHelpers/fileHeader.js +27 -15
  165. package/lib/common/formatHelpers/formattedVariables.d.ts +16 -11
  166. package/lib/common/formatHelpers/formattedVariables.js +15 -8
  167. package/lib/common/formatHelpers/getTypeScriptType.d.ts +8 -6
  168. package/lib/common/formatHelpers/getTypeScriptType.js +7 -6
  169. package/lib/common/formatHelpers/iconsWithPrefix.d.ts +11 -8
  170. package/lib/common/formatHelpers/iconsWithPrefix.js +12 -9
  171. package/lib/common/formatHelpers/minifyDictionary.d.ts +5 -4
  172. package/lib/common/formatHelpers/minifyDictionary.js +7 -6
  173. package/lib/common/formatHelpers/setComposeObjectProperties.d.ts +6 -6
  174. package/lib/common/formatHelpers/setComposeObjectProperties.js +2 -2
  175. package/lib/common/formatHelpers/setSwiftFileProperties.d.ts +12 -9
  176. package/lib/common/formatHelpers/setSwiftFileProperties.js +7 -10
  177. package/lib/common/formatHelpers/sortByName.d.ts +3 -3
  178. package/lib/common/formatHelpers/sortByName.js +2 -2
  179. package/lib/common/formatHelpers/sortByReference.d.ts +5 -5
  180. package/lib/common/formatHelpers/sortByReference.js +5 -3
  181. package/lib/common/formats.d.ts +8 -17
  182. package/lib/common/formats.js +423 -252
  183. package/lib/common/templates/android/colors.template.d.ts +8 -1
  184. package/lib/common/templates/android/colors.template.js +24 -23
  185. package/lib/common/templates/android/dimens.template.d.ts +8 -1
  186. package/lib/common/templates/android/dimens.template.js +24 -22
  187. package/lib/common/templates/android/fontDimens.template.d.ts +8 -1
  188. package/lib/common/templates/android/fontDimens.template.js +24 -22
  189. package/lib/common/templates/android/integers.template.d.ts +8 -1
  190. package/lib/common/templates/android/integers.template.js +24 -22
  191. package/lib/common/templates/android/resources.template.d.ts +8 -6
  192. package/lib/common/templates/android/resources.template.js +33 -20
  193. package/lib/common/templates/android/strings.template.d.ts +8 -1
  194. package/lib/common/templates/android/strings.template.js +24 -22
  195. package/lib/common/templates/compose/object.kt.template.d.ts +9 -1
  196. package/lib/common/templates/compose/object.kt.template.js +25 -29
  197. package/lib/common/templates/css/fonts.css.template.d.ts +2 -1
  198. package/lib/common/templates/css/fonts.css.template.js +45 -28
  199. package/lib/common/templates/flutter/class.dart.template.d.ts +11 -1
  200. package/lib/common/templates/flutter/class.dart.template.js +22 -19
  201. package/lib/common/templates/ios/colors.h.template.d.ts +10 -1
  202. package/lib/common/templates/ios/colors.h.template.js +22 -21
  203. package/lib/common/templates/ios/colors.m.template.d.ts +10 -1
  204. package/lib/common/templates/ios/colors.m.template.js +22 -21
  205. package/lib/common/templates/ios/macros.template.d.ts +10 -1
  206. package/lib/common/templates/ios/macros.template.js +22 -20
  207. package/lib/common/templates/ios/plist.template.d.ts +9 -1
  208. package/lib/common/templates/ios/plist.template.js +53 -37
  209. package/lib/common/templates/ios/singleton.h.template.d.ts +8 -1
  210. package/lib/common/templates/ios/singleton.h.template.js +17 -18
  211. package/lib/common/templates/ios/singleton.m.template.d.ts +12 -1
  212. package/lib/common/templates/ios/singleton.m.template.js +61 -47
  213. package/lib/common/templates/ios/static.h.template.d.ts +10 -1
  214. package/lib/common/templates/ios/static.h.template.js +22 -20
  215. package/lib/common/templates/ios/static.m.template.d.ts +10 -1
  216. package/lib/common/templates/ios/static.m.template.js +28 -20
  217. package/lib/common/templates/ios/strings.h.template.d.ts +10 -1
  218. package/lib/common/templates/ios/strings.h.template.js +21 -20
  219. package/lib/common/templates/ios/strings.m.template.d.ts +11 -1
  220. package/lib/common/templates/ios/strings.m.template.js +50 -36
  221. package/lib/common/templates/ios-swift/any.swift.template.d.ts +11 -1
  222. package/lib/common/templates/ios-swift/any.swift.template.js +31 -25
  223. package/lib/common/templates/scss/map-deep.template.d.ts +8 -1
  224. package/lib/common/templates/scss/map-deep.template.js +45 -44
  225. package/lib/common/templates/scss/map-flat.template.d.ts +8 -1
  226. package/lib/common/templates/scss/map-flat.template.js +23 -30
  227. package/lib/common/templates/static-style-guide/index.html.template.d.ts +1 -1
  228. package/lib/common/templates/static-style-guide/index.html.template.js +2 -2
  229. package/lib/common/transformGroups.js +147 -99
  230. package/lib/common/transforms.d.ts +11 -4
  231. package/lib/common/transforms.js +565 -313
  232. package/lib/filterTokens.d.ts +9 -7
  233. package/lib/filterTokens.js +36 -16
  234. package/lib/fs-node.d.ts +5 -2
  235. package/lib/fs-node.js +14 -2
  236. package/lib/fs.d.ts +6 -7
  237. package/lib/fs.js +13 -5
  238. package/lib/performActions.d.ts +12 -7
  239. package/lib/performActions.js +16 -11
  240. package/lib/resolve.d.ts +1 -7
  241. package/lib/resolve.js +11 -2
  242. package/lib/transform/config.d.ts +5 -5
  243. package/lib/transform/config.js +97 -84
  244. package/lib/transform/object.d.ts +22 -16
  245. package/lib/transform/object.js +20 -12
  246. package/lib/transform/token.d.ts +17 -11
  247. package/lib/transform/token.js +30 -19
  248. package/lib/transform/tokenSetup.d.ts +4 -4
  249. package/lib/transform/tokenSetup.js +5 -5
  250. package/lib/utils/combineJSON.d.ts +12 -6
  251. package/lib/utils/combineJSON.js +44 -23
  252. package/lib/utils/convertToBase64.d.ts +7 -1
  253. package/lib/utils/convertToBase64.js +7 -3
  254. package/lib/utils/convertToDTCG.d.ts +38 -0
  255. package/lib/utils/convertToDTCG.js +199 -0
  256. package/lib/utils/createFormatArgs.d.ts +11 -24
  257. package/lib/utils/createFormatArgs.js +15 -15
  258. package/lib/utils/deepExtend.d.ts +9 -6
  259. package/lib/utils/deepExtend.js +18 -7
  260. package/lib/utils/deepmerge.d.ts +1 -1
  261. package/lib/utils/deepmerge.js +20 -2
  262. package/lib/utils/detectDtcgSyntax.d.ts +8 -0
  263. package/lib/utils/detectDtcgSyntax.js +39 -0
  264. package/lib/utils/downloadFile.d.ts +10 -0
  265. package/lib/utils/downloadFile.js +62 -0
  266. package/lib/utils/expandObjectTokens.d.ts +55 -0
  267. package/lib/utils/expandObjectTokens.js +258 -0
  268. package/lib/utils/flattenTokens.d.ts +4 -9
  269. package/lib/utils/flattenTokens.js +23 -16
  270. package/lib/utils/groupMessages.d.ts +10 -3
  271. package/lib/utils/groupMessages.js +17 -1
  272. package/lib/utils/index.d.ts +8 -1
  273. package/lib/utils/index.js +17 -1
  274. package/lib/utils/preprocess.d.ts +14 -7
  275. package/lib/utils/preprocess.js +22 -46
  276. package/lib/utils/references/createReferenceRegex.d.ts +2 -2
  277. package/lib/utils/references/createReferenceRegex.js +1 -1
  278. package/lib/utils/references/defaults.d.ts +1 -1
  279. package/lib/utils/references/defaults.js +1 -1
  280. package/lib/utils/references/getName.d.ts +3 -3
  281. package/lib/utils/references/getName.js +2 -2
  282. package/lib/utils/references/getPathFromName.js +1 -1
  283. package/lib/utils/references/getReferences.d.ts +10 -30
  284. package/lib/utils/references/getReferences.js +30 -38
  285. package/lib/utils/references/getValueByPath.d.ts +4 -4
  286. package/lib/utils/references/getValueByPath.js +2 -2
  287. package/lib/utils/references/outputReferencesFilter.d.ts +14 -0
  288. package/lib/utils/references/outputReferencesFilter.js +32 -0
  289. package/lib/utils/references/outputReferencesTransformed.d.ts +14 -0
  290. package/lib/utils/references/outputReferencesTransformed.js +30 -0
  291. package/lib/utils/references/resolveReferences.d.ts +12 -12
  292. package/lib/utils/references/resolveReferences.js +27 -27
  293. package/lib/utils/references/usesReferences.d.ts +3 -3
  294. package/lib/utils/references/usesReferences.js +1 -1
  295. package/lib/utils/resolveObject.d.ts +5 -4
  296. package/lib/utils/resolveObject.js +6 -4
  297. package/lib/utils/typeDtcgDelegate.d.ts +13 -0
  298. package/lib/utils/typeDtcgDelegate.js +44 -0
  299. package/package.json +36 -22
  300. package/types/Action.d.ts +8 -22
  301. package/types/Config.d.ts +76 -65
  302. package/types/DesignToken.d.ts +40 -59
  303. package/types/File.d.ts +19 -24
  304. package/types/Filter.d.ts +4 -18
  305. package/types/Format.d.ts +30 -41
  306. package/types/Parser.d.ts +6 -20
  307. package/types/Preprocessor.d.ts +4 -19
  308. package/types/Transform.d.ts +10 -24
  309. package/types/Volume.d.ts +4 -0
  310. package/types/index.d.ts +10 -27
  311. package/examples/advanced/auto-rebuild-watcher/README.md +0 -31
  312. package/examples/advanced/auto-rebuild-watcher/config.json +0 -69
  313. package/examples/advanced/auto-rebuild-watcher/package.json +0 -22
  314. package/examples/advanced/auto-rebuild-watcher/tokens/color/base.json +0 -13
  315. package/examples/advanced/auto-rebuild-watcher/tokens/color/font.json +0 -9
  316. package/examples/advanced/auto-rebuild-watcher/tokens/size/font.json +0 -22
  317. package/examples/advanced/component-cti/README.md +0 -88
  318. package/examples/advanced/component-cti/config.js +0 -73
  319. package/examples/advanced/component-cti/package.json +0 -20
  320. package/examples/advanced/component-cti/tokens/color/background.json +0 -9
  321. package/examples/advanced/component-cti/tokens/color/core.json +0 -10
  322. package/examples/advanced/component-cti/tokens/color/font.json +0 -9
  323. package/examples/advanced/component-cti/tokens/component/button.json +0 -19
  324. package/examples/advanced/component-cti/tokens/size/font.json +0 -9
  325. package/examples/advanced/component-cti/tokens/size/padding.json +0 -9
  326. package/examples/advanced/create-react-app/style-dictionary/properties/color.json +0 -18
  327. package/examples/advanced/create-react-app/style-dictionary/properties/font.json +0 -28
  328. package/examples/advanced/create-react-app/style-dictionary/properties/spacing.json +0 -13
  329. package/examples/advanced/custom-file-header/README.md +0 -44
  330. package/examples/advanced/custom-file-header/build.js +0 -120
  331. package/examples/advanced/custom-file-header/package.json +0 -15
  332. package/examples/advanced/custom-file-header/tokens/color.json +0 -9
  333. package/examples/advanced/custom-filters/README.md +0 -99
  334. package/examples/advanced/custom-filters/build.js +0 -24
  335. package/examples/advanced/custom-filters/config.json +0 -21
  336. package/examples/advanced/custom-filters/package.json +0 -20
  337. package/examples/advanced/custom-filters/tokens/spacing.json +0 -20
  338. package/examples/advanced/custom-formats-with-templates/README.md +0 -56
  339. package/examples/advanced/custom-formats-with-templates/build.js +0 -72
  340. package/examples/advanced/custom-formats-with-templates/config.json +0 -35
  341. package/examples/advanced/custom-formats-with-templates/package.json +0 -23
  342. package/examples/advanced/custom-formats-with-templates/properties/color/base.json +0 -13
  343. package/examples/advanced/custom-formats-with-templates/properties/color/font.json +0 -9
  344. package/examples/advanced/custom-formats-with-templates/properties/size/font.json +0 -22
  345. package/examples/advanced/custom-formats-with-templates/templates/android-xml.template +0 -30
  346. package/examples/advanced/custom-formats-with-templates/templates/android-xml_alt.hbs +0 -4
  347. package/examples/advanced/custom-formats-with-templates/templates/ios-plist.template +0 -24
  348. package/examples/advanced/custom-formats-with-templates/templates/ios-plist_alt.pug +0 -24
  349. package/examples/advanced/custom-formats-with-templates/templates/web-scss.template +0 -3
  350. package/examples/advanced/flutter/style_dictionary/properties/color/background.json +0 -9
  351. package/examples/advanced/flutter/style_dictionary/properties/color/core.json +0 -10
  352. package/examples/advanced/flutter/style_dictionary/properties/color/font.json +0 -9
  353. package/examples/advanced/flutter/style_dictionary/properties/size/font.json +0 -9
  354. package/examples/advanced/flutter/style_dictionary/properties/size/padding.json +0 -9
  355. package/examples/advanced/s3/properties/assets/fonts.json +0 -18
  356. package/examples/advanced/s3/properties/assets/icons.json +0 -34
  357. package/examples/advanced/s3/properties/color/base.json +0 -13
  358. package/examples/advanced/s3/properties/color/font.json +0 -9
  359. package/examples/advanced/s3/properties/size/font.json +0 -22
  360. package/examples/advanced/tokens-deprecation/templates/ios-plist.template +0 -30
  361. package/examples/advanced/tokens-deprecation/templates/web-scss.template +0 -16
  362. package/examples/basic/tokens/color/base.json +0 -13
  363. package/examples/basic/tokens/color/font.json +0 -9
  364. package/examples/basic/tokens/size/font.json +0 -22
  365. package/examples/complete/ios/README.md +0 -29
  366. package/lib/buildFile.d.ts +0 -19
  367. package/lib/buildFile.js +0 -186
  368. package/lib/buildFiles.d.ts +0 -16
  369. package/lib/buildFiles.js +0 -46
  370. package/types/FormatHelpers.d.ts +0 -0
  371. package/types/typeless-modules/bundled-glob.d.ts +0 -1
  372. package/types/typeless-modules/bundled-memfs.d.ts +0 -1
package/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
  <a href="https://amzn.github.io/style-dictionary/#/version_3">What's new in Style Dictionary 3.0!</a>
3
3
  </pre>
4
4
 
5
+ <pre>
6
+ <a href="https://github.com/amzn/style-dictionary#version-4">What's coming in Style Dictionary 4.0?</a>
7
+ </pre>
8
+
5
9
  <img src="docs/assets/logo.png" alt="Style Dictionary logo and mascot" title="&quot;Pascal&quot;" width="100" align="right" />
6
10
 
7
11
  [![npm version](https://img.shields.io/npm/v/style-dictionary.svg?style=flat-square)](https://badge.fury.io/js/style-dictionary)
@@ -162,7 +166,7 @@ This tells the style dictionary build system how and what to build. The default
162
166
  }
163
167
  ```
164
168
 
165
- | Attribute | Type | Description |
169
+ | Property | Type | Description |
166
170
  | :----------------------------------- | :---------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
167
171
  | source | Array | An array of file path [globs](https://github.com/isaacs/node-glob) to design token files. Style Dictionary will do a deep merge of all of the token files, allowing you to organize your files files however you want. |
168
172
  | include | Array | An array of file path [globs](https://github.com/isaacs/node-glob) to design token files that contain default styles. The Style Dictionary uses this as a base collection of tokens. The tokens found using the "source" attribute will overwrite tokens found using include. |
@@ -298,10 +302,10 @@ const StyleDictionary = require('style-dictionary').extend('config.json');
298
302
  StyleDictionary.registerTransform({
299
303
  name: 'time/seconds',
300
304
  type: 'value',
301
- matcher: function (token) {
302
- return token.attributes.category === 'time';
305
+ filter: function (token) {
306
+ return token.type === 'time';
303
307
  },
304
- transformer: function (token) {
308
+ transform: function (token) {
305
309
  return (parseInt(token.original.value) / 1000).toString() + 's';
306
310
  },
307
311
  });
@@ -311,6 +315,27 @@ StyleDictionary.buildAllPlatforms();
311
315
 
312
316
  For more information on creating your own transforms and formats, take a look at our [docs](https://amzn.github.io/style-dictionary/).
313
317
 
318
+ ## Version 4
319
+
320
+ In May 2021, we started [an issue / RFC, "What would you like to see in Style-Dictionary 4.0?"](https://github.com/amzn/style-dictionary/issues/643) to gather feedback on what the community would like to see.
321
+ Fortunately, in August 2023, the folks at [Tokens Studio](https://tokens.studio/) contacted us about co-maintaining this project, and leading the v4 release (and beyond)!
322
+
323
+ We have started working on the biggest and most important changes, like migrating to ESM, making the library browser-compatible out of the box, and supporting asynchronicity in Style-Dictionary's various APIs. There will be multiple prereleases to battle-test these changes before a final v4.0 is released.
324
+
325
+ You can follow [this roadmap board](https://github.com/orgs/amzn/projects/4/views/1?layout=board) to keep an eye on the developments for v4.0, we will also keep adding to this board when we encounter changes we'd like to see in v4.0 that would entail a breaking change. Absence of something in this roadmap does not mean we don't see value in it, but rather that it could also be added in a (non-breaking) minor release within v4.x.x.
326
+
327
+ ### From the folks at Tokens Studio
328
+
329
+ Hi everyone! I'm Joren from Tokens Studio, a big fan of this project (see [Style-Dictionary-Play](https://www.style-dictionary-play.dev/), [Token Configurator](https://configurator.tokens.studio/), [sd-transforms](https://github.com/tokens-studio/sd-transforms)) and the main pusher behind leading a 4.0 release of this project, I think it would be good to explain from our perspective why we've made the move to collaborate with Amazon on this.
330
+
331
+ At Tokens Studio, we're a huge fan of Design Tokens and the workflows they enable. We believe exporting design tokens to various platforms is a key ingredient in ensuring that the journey from design to implementation code is smooth.
332
+ In our minds, Style-Dictionary has been the most popular and most flexible library for reaching that goal, and so we want to build on top of that.
333
+ Rather than starting our own spinoff tool, we much prefer bringing Style-Dictionary further, together with its vibrant community of contributors, which is why we reached out to Danny Banks.
334
+
335
+ I think it's important to stress that it is our shared vision to keep Style-Dictionary as an agnostic (so not "Tokens Studio"-specific) and flexible tool. As Tokens Studio, while we are highly incentivized to see this project progress further to strengthen our product journey, we value the open source community highly and want to make sure this library remains the go-to tool for exporting Design Tokens, whether you use Tokens Studio or not.
336
+
337
+ We are very open to feedback and collaboration, feel free to reach out to us in [our Slack](https://join.slack.com/t/tokens-studio/shared_invite/zt-1p8ea3m6t-C163oJcN9g3~YZTKRgo2hg) -> `style-dictionary-v4` channel!
338
+
314
339
  ## Mascot
315
340
 
316
341
  The mascot for Style Dictionary is ["Pascal"](https://github.com/amzn/style-dictionary/issues/97) the chameleon (seen below). You can also find them blending in as the logo throughout the documentation.
@@ -43,6 +43,12 @@ program
43
43
  .command('build')
44
44
  .description('Builds a style dictionary package from the current directory.')
45
45
  .option('-c, --config <path>', 'set config path. defaults to ./config.json')
46
+ .option(
47
+ '-v, --verbose',
48
+ 'enable verbose logging for reference errors, token collisions and filtered tokens with outputReferences',
49
+ )
50
+ .option('-n, --no-warn', 'disable all warnings, only success logs and fatal errors shown')
51
+ .option('-s, --silent', 'silence all logging, except for fatal errors')
46
52
  .option(
47
53
  '-p, --platform [platform]',
48
54
  'only build specific platforms. Must be defined in the config',
@@ -57,6 +63,12 @@ program
57
63
  'Removes files specified in the config of the style dictionary package of the current directory.',
58
64
  )
59
65
  .option('-c, --config <path>', 'set config path. defaults to ./config.json')
66
+ .option(
67
+ '-v, --verbose',
68
+ 'enable verbose logging for reference errors, token collisions and filtered tokens with outputReferences',
69
+ )
70
+ .option('-n, --no-warn', 'disable all warnings, only success logs and fatal errors shown')
71
+ .option('-s, --silent', 'silence all logging, except for fatal errors')
60
72
  .option(
61
73
  '-p, --platform [platform]',
62
74
  'only clean specific platform(s). Must be defined in the config',
@@ -76,7 +88,9 @@ program
76
88
  }
77
89
  /* eslint-disable no-console */
78
90
  console.log('Copying starter files...\n');
79
- node_fs.copySync(path.join(__dirname, '..', 'examples', type), process.cwd());
91
+ node_fs.cpSync(path.join(__dirname, '..', 'examples', type), process.cwd(), {
92
+ recursive: true,
93
+ });
80
94
  console.log('Source style dictionary starter files created!\n');
81
95
  console.log(
82
96
  'Running `style-dictionary build` for the first time to generate build artifacts.\n',
@@ -94,35 +108,39 @@ program.on('command:*', function () {
94
108
  process.exit(1);
95
109
  });
96
110
 
111
+ function getSD(configPath, options) {
112
+ let verbosity;
113
+ let warnings;
114
+ if (options.verbose || options.silent) {
115
+ verbosity = options.verbose ? 'verbose' : 'silent';
116
+ }
117
+ if (options.warn === false) {
118
+ warnings = 'disabled';
119
+ }
120
+ return new StyleDictionary(configPath, { verbosity, warnings });
121
+ }
122
+
97
123
  async function styleDictionaryBuild(options) {
98
124
  options = options || {};
99
125
  const configPath = getConfigPath(options);
100
-
101
- // Create a style dictionary object with the config
102
- const styleDictionary = new StyleDictionary(configPath);
126
+ const sd = getSD(configPath, options);
103
127
 
104
128
  if (options.platform && options.platform.length > 0) {
105
- return Promise.all(
106
- options.platforms.map((platform) => styleDictionary.buildPlatform(platform)),
107
- );
129
+ return Promise.all(options.platforms.map((platform) => sd.buildPlatform(platform)));
108
130
  } else {
109
- return styleDictionary.buildAllPlatforms();
131
+ return sd.buildAllPlatforms();
110
132
  }
111
133
  }
112
134
 
113
135
  async function styleDictionaryClean(options) {
114
136
  options = options || {};
115
137
  const configPath = getConfigPath(options);
116
-
117
- // Create a style dictionary object with the config
118
- const styleDictionary = new StyleDictionary(configPath);
138
+ const sd = getSD(configPath, options);
119
139
 
120
140
  if (options.platform && options.platform.length > 0) {
121
- return Promise.all(
122
- options.platforms.map((platform) => styleDictionary.cleanPlatform(platform)),
123
- );
141
+ return Promise.all(options.platforms.map((platform) => sd.cleanPlatform(platform)));
124
142
  } else {
125
- return styleDictionary.cleanAllPlatforms();
143
+ return sd.cleanAllPlatforms();
126
144
  }
127
145
  }
128
146
 
@@ -31,12 +31,8 @@ This is a more complete package and should have everything you need to get start
31
31
  If you want to look at more advanced examples of possible applications and customizations of Style Dictionary, the [`examples/advanced`](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/) folder on GitHub contains these extra folders:
32
32
 
33
33
  - [**assets-base64-embed**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/assets-base64-embed) shows how it's possible to embed and distribute assets – like images, icons and fonts – directly as design tokens.
34
- - [**auto-rebuild-watcher**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/auto-rebuild-watcher) shows how to setup a "watcher" that auto-rebuilds the tokens every time there is a change in the tokens.
35
- - [**component-cti**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/component-cti) shows how to write component tokens and still use the CTI structure.
36
34
  - [**create-react-app**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/create-react-app) shows how to integrate Style Dictionary into a React application.
37
35
  - [**create-react-native-app**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/create-react-native-app) shows how to integrate Style Dictionary into a React Native application.
38
- - [**custom-file-header**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/custom-file-header) shows how to define custom file headers and use them in output files.
39
- - [**custom-formats-with-templates**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/custom-formats-with-templates) shows how to generate custom output formats using templates, useful when you need to distribute your design tokens into your own pipelines or scripts.
40
36
  - [**custom-parser**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/custom-parser) shows how to use custom parsers for token files.
41
37
  - [**custom-transforms**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/custom-transforms) shows how to use custom transforms (and transformGroups) to apply custom "transformations" to the design tokens.
42
38
  - [**flutter**](https://github.com/amzn/style-dictionary/tree/main/examples/advanced/flutter) shows how to integrate with Flutter applications.
@@ -44,7 +44,7 @@ Open the `config.json` file and see how all the "assets/embed/\*" platform block
44
44
 
45
45
  ```
46
46
  "assets/embed/json": {
47
- "transforms": ["attribute/cti", "name/cti/kebab", "asset/base64"],
47
+ "transforms": ["attribute/cti", "name/kebab", "asset/base64"],
48
48
  "buildPath": "build/json/",
49
49
  "files": [{
50
50
  "destination": "assets_icons.json",
@@ -56,7 +56,7 @@ Open the `config.json` file and see how all the "assets/embed/\*" platform block
56
56
  ...
57
57
  ```
58
58
 
59
- Here there are **three specific transforms**: _attribute/cti_ to assign the Category/Type/Item attributes to the tokens, _name/cti/kebab_ to assign them the correct name, and finally _asset/base64_ to take the path declared in the "value" of the tokens, convert the file at that path in base64 format, and assign the output of the base64 conversion to the "value" of the token.
59
+ Here there are **three specific transforms**: _attribute/cti_ to assign the Category/Type/Item attributes to the tokens, _name/kebab_ to assign them the correct name, and finally _asset/base64_ to take the path declared in the "value" of the tokens, convert the file at that path in base64 format, and assign the output of the base64 conversion to the "value" of the token.
60
60
 
61
61
  If you take for example the file `assets/icons.json` you will see this declaration:
62
62
 
@@ -4,95 +4,104 @@
4
4
  "scss": {
5
5
  "transformGroup": "scss",
6
6
  "buildPath": "build/scss/",
7
- "files": [{
8
- "destination": "colors.scss",
9
- "format": "scss/variables",
10
- "filter": {
11
- "attributes": {
12
- "category": "color"
7
+ "files": [
8
+ {
9
+ "destination": "colors.scss",
10
+ "format": "scss/variables",
11
+ "filter": {
12
+ "type": "color"
13
13
  }
14
- }
15
- },{
16
- "destination": "sizes.scss",
17
- "format": "scss/variables",
18
- "filter": {
19
- "attributes": {
20
- "category": "size"
14
+ },
15
+ {
16
+ "destination": "sizes.scss",
17
+ "format": "scss/variables",
18
+ "filter": {
19
+ "type": "fontSize"
21
20
  }
22
21
  }
23
- }]
22
+ ]
24
23
  },
25
24
  "json": {
26
25
  "transformGroup": "web",
27
26
  "buildPath": "build/json/",
28
- "files": [{
29
- "destination": "variables.json",
30
- "format": "json/flat"
31
- }]
27
+ "files": [
28
+ {
29
+ "destination": "variables.json",
30
+ "format": "json/flat"
31
+ }
32
+ ]
32
33
  },
33
34
  "assets/embed/scss": {
34
- "transforms": ["attribute/cti", "name/cti/kebab", "asset/base64"],
35
+ "transforms": ["attribute/cti", "name/kebab", "asset/base64"],
35
36
  "buildPath": "build/scss/",
36
- "files": [{
37
- "destination": "assets_icons.scss",
38
- "format": "scss/variables",
39
- "filter": {
40
- "attributes": {
41
- "category": "asset",
42
- "type": "icon"
37
+ "files": [
38
+ {
39
+ "destination": "assets_icons.scss",
40
+ "format": "scss/variables",
41
+ "filter": {
42
+ "attributes": {
43
+ "category": "asset",
44
+ "type": "icon"
45
+ }
43
46
  }
44
- }
45
- },{
46
- "destination": "assets_images.scss",
47
- "format": "scss/variables",
48
- "filter": {
49
- "attributes": {
50
- "category": "asset",
51
- "type": "image"
47
+ },
48
+ {
49
+ "destination": "assets_images.scss",
50
+ "format": "scss/variables",
51
+ "filter": {
52
+ "attributes": {
53
+ "category": "asset",
54
+ "type": "image"
55
+ }
52
56
  }
53
- }
54
- },{
55
- "destination": "assets_fonts.scss",
56
- "format": "scss/variables",
57
- "filter": {
58
- "attributes": {
59
- "category": "asset",
60
- "type": "font"
57
+ },
58
+ {
59
+ "destination": "assets_fonts.scss",
60
+ "format": "scss/variables",
61
+ "filter": {
62
+ "attributes": {
63
+ "category": "asset",
64
+ "type": "font"
65
+ }
61
66
  }
62
67
  }
63
- }]
68
+ ]
64
69
  },
65
70
  "assets/embed/json": {
66
- "transforms": ["attribute/cti", "name/cti/kebab", "asset/base64"],
71
+ "transforms": ["attribute/cti", "name/kebab", "asset/base64"],
67
72
  "buildPath": "build/json/",
68
- "files": [{
69
- "destination": "assets_icons.json",
70
- "format": "json/flat",
71
- "filter": {
72
- "attributes": {
73
- "category": "asset",
74
- "type": "icon"
73
+ "files": [
74
+ {
75
+ "destination": "assets_icons.json",
76
+ "format": "json/flat",
77
+ "filter": {
78
+ "attributes": {
79
+ "category": "asset",
80
+ "type": "icon"
81
+ }
75
82
  }
76
- }
77
- },{
78
- "destination": "assets_images.json",
79
- "format": "json/flat",
80
- "filter": {
81
- "attributes": {
82
- "category": "asset",
83
- "type": "image"
83
+ },
84
+ {
85
+ "destination": "assets_images.json",
86
+ "format": "json/flat",
87
+ "filter": {
88
+ "attributes": {
89
+ "category": "asset",
90
+ "type": "image"
91
+ }
84
92
  }
85
- }
86
- },{
87
- "destination": "assets_fonts.json",
88
- "format": "json/flat",
89
- "filter": {
90
- "attributes": {
91
- "category": "asset",
92
- "type": "font"
93
+ },
94
+ {
95
+ "destination": "assets_fonts.json",
96
+ "format": "json/flat",
97
+ "filter": {
98
+ "attributes": {
99
+ "category": "asset",
100
+ "type": "font"
101
+ }
93
102
  }
94
103
  }
95
- }]
104
+ ]
96
105
  }
97
106
  }
98
107
  }
@@ -3,6 +3,7 @@
3
3
  "version": "1.0.0",
4
4
  "description": "",
5
5
  "main": "build.js",
6
+ "type": "module",
6
7
  "scripts": {
7
8
  "build": "node_modules/.bin/style-dictionary build",
8
9
  "clean": "rm -rf build",
@@ -11,6 +12,6 @@
11
12
  "author": "",
12
13
  "license": "Apache-2.0",
13
14
  "devDependencies": {
14
- "style-dictionary": "4.0.0-prerelease.9"
15
+ "style-dictionary": "^4.0.1"
15
16
  }
16
17
  }
@@ -2,16 +2,16 @@
2
2
  "asset": {
3
3
  "font": {
4
4
  "materialicons": {
5
- "ttf" : { "value": "assets/fonts/MaterialIcons-Regular.ttf" },
6
- "eot" : { "value": "assets/fonts/MaterialIcons-Regular.eot" },
7
- "woff" : { "value": "assets/fonts/MaterialIcons-Regular.woff" },
8
- "woff2": { "value": "assets/fonts/MaterialIcons-Regular.woff2" }
5
+ "ttf": { "value": "assets/fonts/MaterialIcons-Regular.ttf", "type": "asset" },
6
+ "eot": { "value": "assets/fonts/MaterialIcons-Regular.eot", "type": "asset" },
7
+ "woff": { "value": "assets/fonts/MaterialIcons-Regular.woff", "type": "asset" },
8
+ "woff2": { "value": "assets/fonts/MaterialIcons-Regular.woff2", "type": "asset" }
9
9
  },
10
10
  "opensans": {
11
- "ttf" : { "value": "assets/fonts/OpenSans-Regular.ttf" }
11
+ "ttf": { "value": "assets/fonts/OpenSans-Regular.ttf", "type": "asset" }
12
12
  },
13
13
  "roboto": {
14
- "ttf" : { "value": "assets/fonts/Roboto-Regular.ttf" }
14
+ "ttf": { "value": "assets/fonts/Roboto-Regular.ttf", "type": "asset" }
15
15
  }
16
16
  }
17
17
  }
@@ -1,34 +1,34 @@
1
1
  {
2
2
  "asset": {
3
3
  "icon": {
4
- "alert-circle": { "value": "assets/icons/alert-circle.svg" },
5
- "alert-octagon": { "value": "assets/icons/alert-octagon.svg" },
6
- "alert-triangle": { "value": "assets/icons/alert-triangle.svg" },
7
- "archive": { "value": "assets/icons/archive.svg" },
8
- "book-open": { "value": "assets/icons/book-open.svg" },
9
- "book": { "value": "assets/icons/book.svg" },
10
- "bookmark": { "value": "assets/icons/bookmark.svg" },
11
- "briefcase": { "value": "assets/icons/briefcase.svg" },
12
- "calendar": { "value": "assets/icons/calendar.svg" },
13
- "camera": { "value": "assets/icons/camera.svg" },
14
- "check-circle": { "value": "assets/icons/check-circle.svg" },
15
- "check-square": { "value": "assets/icons/check-square.svg" },
16
- "database": { "value": "assets/icons/database.svg" },
17
- "delete": { "value": "assets/icons/delete.svg" },
18
- "dollar-sign": { "value": "assets/icons/dollar-sign.svg" },
19
- "download-cloud": { "value": "assets/icons/download-cloud.svg" },
20
- "edit-1": { "value": "assets/icons/edit-1.svg" },
21
- "edit-2": { "value": "assets/icons/edit-2.svg" },
22
- "edit-3": { "value": "assets/icons/edit-3.svg" },
23
- "external-link": { "value": "assets/icons/external-link.svg" },
24
- "file-text": { "value": "assets/icons/file-text.svg" },
25
- "file": { "value": "assets/icons/file.svg" },
26
- "film": { "value": "assets/icons/film.svg" },
27
- "folder": { "value": "assets/icons/folder.svg" },
28
- "gift": { "value": "assets/icons/gift.svg" },
29
- "github": { "value": "assets/icons/github.svg" },
30
- "globe": { "value": "assets/icons/globe.svg" },
31
- "grid": { "value": "assets/icons/grid.svg" }
4
+ "alert-circle": { "value": "assets/icons/alert-circle.svg", "type": "asset" },
5
+ "alert-octagon": { "value": "assets/icons/alert-octagon.svg", "type": "asset" },
6
+ "alert-triangle": { "value": "assets/icons/alert-triangle.svg", "type": "asset" },
7
+ "archive": { "value": "assets/icons/archive.svg", "type": "asset" },
8
+ "book-open": { "value": "assets/icons/book-open.svg", "type": "asset" },
9
+ "book": { "value": "assets/icons/book.svg", "type": "asset" },
10
+ "bookmark": { "value": "assets/icons/bookmark.svg", "type": "asset" },
11
+ "briefcase": { "value": "assets/icons/briefcase.svg", "type": "asset" },
12
+ "calendar": { "value": "assets/icons/calendar.svg", "type": "asset" },
13
+ "camera": { "value": "assets/icons/camera.svg", "type": "asset" },
14
+ "check-circle": { "value": "assets/icons/check-circle.svg", "type": "asset" },
15
+ "check-square": { "value": "assets/icons/check-square.svg", "type": "asset" },
16
+ "database": { "value": "assets/icons/database.svg", "type": "asset" },
17
+ "delete": { "value": "assets/icons/delete.svg", "type": "asset" },
18
+ "dollar-sign": { "value": "assets/icons/dollar-sign.svg", "type": "asset" },
19
+ "download-cloud": { "value": "assets/icons/download-cloud.svg", "type": "asset" },
20
+ "edit-1": { "value": "assets/icons/edit-1.svg", "type": "asset" },
21
+ "edit-2": { "value": "assets/icons/edit-2.svg", "type": "asset" },
22
+ "edit-3": { "value": "assets/icons/edit-3.svg", "type": "asset" },
23
+ "external-link": { "value": "assets/icons/external-link.svg", "type": "asset" },
24
+ "file-text": { "value": "assets/icons/file-text.svg", "type": "asset" },
25
+ "file": { "value": "assets/icons/file.svg", "type": "asset" },
26
+ "film": { "value": "assets/icons/film.svg", "type": "asset" },
27
+ "folder": { "value": "assets/icons/folder.svg", "type": "asset" },
28
+ "gift": { "value": "assets/icons/gift.svg", "type": "asset" },
29
+ "github": { "value": "assets/icons/github.svg", "type": "asset" },
30
+ "globe": { "value": "assets/icons/globe.svg", "type": "asset" },
31
+ "grid": { "value": "assets/icons/grid.svg", "type": "asset" }
32
32
  }
33
33
  }
34
34
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "asset": {
3
3
  "image": {
4
- "logo": { "value": "assets/images/logo.png" }
4
+ "logo": { "value": "assets/images/logo.png", "type": "asset" }
5
5
  }
6
6
  }
7
7
  }
@@ -2,12 +2,12 @@
2
2
  "color": {
3
3
  "base": {
4
4
  "gray": {
5
- "light" : { "value": "#CCCCCC" },
6
- "medium": { "value": "#999999" },
7
- "dark" : { "value": "#111111" }
5
+ "light": { "value": "#CCCCCC", "type": "color" },
6
+ "medium": { "value": "#999999", "type": "color" },
7
+ "dark": { "value": "#111111", "type": "color" }
8
8
  },
9
- "red": { "value": "#FF0000" },
10
- "green": { "value": "#00FF00" }
9
+ "red": { "value": "#FF0000", "type": "color" },
10
+ "green": { "value": "#00FF00", "type": "color" }
11
11
  }
12
12
  }
13
13
  }
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "color": {
3
3
  "font": {
4
- "base" : { "value": "{color.base.red.value}" },
5
- "secondary": { "value": "{color.base.green.value}" },
6
- "tertiary" : { "value": "{color.base.gray.light.value}" }
4
+ "base": { "value": "{color.base.red.value}", "type": "color" },
5
+ "secondary": { "value": "{color.base.green.value}", "type": "color" },
6
+ "tertiary": { "value": "{color.base.gray.light.value}", "type": "color" }
7
7
  }
8
8
  }
9
9
  }
@@ -1,21 +1,25 @@
1
1
  {
2
2
  "size": {
3
3
  "font": {
4
- "small" : {
4
+ "small": {
5
5
  "value": "0.75",
6
- "comment": "the small size of the font"
6
+ "comment": "the small size of the font",
7
+ "type": "fontSize"
7
8
  },
8
9
  "medium": {
9
10
  "value": "1",
10
- "comment": "the medium size of the font"
11
+ "comment": "the medium size of the font",
12
+ "type": "fontSize"
11
13
  },
12
- "large" : {
14
+ "large": {
13
15
  "value": "2",
14
- "comment": "the large size of the font"
16
+ "comment": "the large size of the font",
17
+ "type": "fontSize"
15
18
  },
16
- "base" : {
19
+ "base": {
17
20
  "value": "{size.font.medium.value}",
18
- "comment": "the base size of the font"
21
+ "comment": "the base size of the font",
22
+ "type": "fontSize"
19
23
  }
20
24
  }
21
25
  }
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "style-dictionary-create-react-app",
3
3
  "description": "",
4
+ "type": "module",
4
5
  "version": "1.0.0",
5
6
  "dependencies": {
6
7
  "node-sass": "^7.0.0",
@@ -11,7 +12,7 @@
11
12
  },
12
13
  "devDependencies": {
13
14
  "eslint-config-react-app": "^7.0.1",
14
- "style-dictionary": "4.0.0-prerelease.9"
15
+ "style-dictionary": "^4.0.1"
15
16
  },
16
17
  "resolutions": {
17
18
  "immer": "8.0.1",
@@ -1,22 +1,26 @@
1
1
  {
2
- "source": ["./style-dictionary/properties/**/*.json"],
2
+ "source": ["./style-dictionary/tokens/**/*.json"],
3
3
  "platforms": {
4
4
  "scss": {
5
5
  "transformGroup": "scss",
6
6
  "buildPath": "./src/style-dictionary-dist/",
7
7
  "prefix": "token",
8
- "files": [{
9
- "destination": "variables.scss",
10
- "format": "scss/variables"
11
- }]
8
+ "files": [
9
+ {
10
+ "destination": "variables.scss",
11
+ "format": "scss/variables"
12
+ }
13
+ ]
12
14
  },
13
15
  "js": {
14
16
  "transformGroup": "js",
15
17
  "buildPath": "./src/style-dictionary-dist/",
16
- "files": [{
17
- "destination": "variables.js",
18
- "format": "javascript/es6"
19
- }]
18
+ "files": [
19
+ {
20
+ "destination": "variables.js",
21
+ "format": "javascript/es6"
22
+ }
23
+ ]
20
24
  }
21
25
  }
22
26
  }
@@ -0,0 +1,22 @@
1
+ {
2
+ "color": {
3
+ "base": {
4
+ "primary": {
5
+ "value": "#61dafb",
6
+ "type": "color"
7
+ },
8
+ "secondary": {
9
+ "value": "#fc7aa5",
10
+ "type": "color"
11
+ }
12
+ },
13
+ "text": {
14
+ "value": "#666666",
15
+ "type": "color"
16
+ },
17
+ "background": {
18
+ "value": "#EEEEEE",
19
+ "type": "color"
20
+ }
21
+ }
22
+ }