@primer/primitives 9.1.2 → 10.0.0-rc.1bc5b670

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 (328) hide show
  1. package/README.md +2 -2
  2. package/dist/build/PrimerStyleDictionary.d.ts +1 -2
  3. package/dist/build/PrimerStyleDictionary.js +52 -64
  4. package/dist/build/filters/index.d.ts +14 -13
  5. package/dist/build/filters/index.js +14 -29
  6. package/dist/build/filters/isBorder.d.ts +3 -3
  7. package/dist/build/filters/isBorder.js +2 -6
  8. package/dist/build/filters/isColor.d.ts +3 -3
  9. package/dist/build/filters/isColor.js +8 -7
  10. package/dist/build/filters/isColorWithAlpha.d.ts +3 -3
  11. package/dist/build/filters/isColorWithAlpha.js +4 -8
  12. package/dist/build/filters/isColorWithMix.d.ts +3 -3
  13. package/dist/build/filters/isColorWithMix.js +4 -8
  14. package/dist/build/filters/isCubicBezier.d.ts +7 -0
  15. package/dist/build/filters/isCubicBezier.js +10 -0
  16. package/dist/build/filters/isDeprecated.d.ts +3 -3
  17. package/dist/build/filters/isDeprecated.js +2 -6
  18. package/dist/build/filters/isDimension.d.ts +3 -3
  19. package/dist/build/filters/isDimension.js +2 -6
  20. package/dist/build/filters/isDuration.d.ts +3 -3
  21. package/dist/build/filters/isDuration.js +2 -6
  22. package/dist/build/filters/isFontFamily.d.ts +3 -3
  23. package/dist/build/filters/isFontFamily.js +2 -6
  24. package/dist/build/filters/isFontWeight.d.ts +3 -3
  25. package/dist/build/filters/isFontWeight.js +2 -6
  26. package/dist/build/filters/isFromFile.d.ts +3 -3
  27. package/dist/build/filters/isFromFile.js +2 -6
  28. package/dist/build/filters/isNumber.d.ts +3 -3
  29. package/dist/build/filters/isNumber.js +4 -6
  30. package/dist/build/filters/isShadow.d.ts +3 -3
  31. package/dist/build/filters/isShadow.js +2 -6
  32. package/dist/build/filters/isSource.d.ts +3 -3
  33. package/dist/build/filters/isSource.js +2 -6
  34. package/dist/build/filters/isTypography.d.ts +3 -3
  35. package/dist/build/filters/isTypography.js +2 -6
  36. package/dist/build/formats/cssAdvanced.d.ts +2 -2
  37. package/dist/build/formats/cssAdvanced.js +22 -20
  38. package/dist/build/formats/cssCustomMedia.d.ts +2 -2
  39. package/dist/build/formats/cssCustomMedia.js +16 -15
  40. package/dist/build/formats/index.d.ts +9 -9
  41. package/dist/build/formats/index.js +9 -21
  42. package/dist/build/formats/javascriptCommonJs.d.ts +2 -2
  43. package/dist/build/formats/javascriptCommonJs.js +17 -16
  44. package/dist/build/formats/javascriptEsm.d.ts +2 -2
  45. package/dist/build/formats/javascriptEsm.js +17 -16
  46. package/dist/build/formats/jsonFigma.d.ts +2 -2
  47. package/dist/build/formats/jsonFigma.js +27 -22
  48. package/dist/build/formats/jsonNestedPrefixed.d.ts +3 -3
  49. package/dist/build/formats/jsonNestedPrefixed.js +17 -15
  50. package/dist/build/formats/jsonOneDimensional.d.ts +3 -3
  51. package/dist/build/formats/jsonOneDimensional.js +24 -16
  52. package/dist/build/formats/jsonPostCssFallback.d.ts +3 -3
  53. package/dist/build/formats/jsonPostCssFallback.js +5 -12
  54. package/dist/build/formats/typescriptExportDefinition.d.ts +2 -2
  55. package/dist/build/formats/typescriptExportDefinition.js +50 -46
  56. package/dist/build/formats/utilities/getPropName.d.ts +1 -0
  57. package/dist/build/formats/utilities/getPropName.js +16 -0
  58. package/dist/build/formats/utilities/jsonToFlat.d.ts +2 -2
  59. package/dist/build/formats/utilities/jsonToFlat.js +1 -5
  60. package/dist/build/formats/utilities/jsonToNestedValue.d.ts +2 -2
  61. package/dist/build/formats/utilities/jsonToNestedValue.js +4 -6
  62. package/dist/build/formats/utilities/prefixTokens.d.ts +2 -2
  63. package/dist/build/formats/utilities/prefixTokens.js +1 -5
  64. package/dist/build/parsers/index.d.ts +1 -1
  65. package/dist/build/parsers/index.js +1 -5
  66. package/dist/build/parsers/w3cJsonParser.d.ts +2 -2
  67. package/dist/build/parsers/w3cJsonParser.js +7 -9
  68. package/dist/build/platforms/css.d.ts +1 -1
  69. package/dist/build/platforms/css.js +20 -11
  70. package/dist/build/platforms/deprecatedJson.d.ts +1 -1
  71. package/dist/build/platforms/deprecatedJson.js +3 -7
  72. package/dist/build/platforms/docJson.d.ts +1 -1
  73. package/dist/build/platforms/docJson.js +8 -7
  74. package/dist/build/platforms/fallbacks.d.ts +1 -1
  75. package/dist/build/platforms/fallbacks.js +3 -7
  76. package/dist/build/platforms/figma.d.ts +1 -1
  77. package/dist/build/platforms/figma.js +21 -14
  78. package/dist/build/platforms/index.d.ts +10 -10
  79. package/dist/build/platforms/index.js +10 -23
  80. package/dist/build/platforms/javascript.d.ts +1 -1
  81. package/dist/build/platforms/javascript.js +3 -7
  82. package/dist/build/platforms/json.d.ts +1 -1
  83. package/dist/build/platforms/json.js +3 -7
  84. package/dist/build/platforms/styleLint.d.ts +1 -1
  85. package/dist/build/platforms/styleLint.js +3 -7
  86. package/dist/build/platforms/typeDefinitions.d.ts +1 -1
  87. package/dist/build/platforms/typeDefinitions.js +6 -10
  88. package/dist/build/platforms/typescript.d.ts +1 -1
  89. package/dist/build/platforms/typescript.js +3 -7
  90. package/dist/build/schemas/alphaValue.js +4 -7
  91. package/dist/build/schemas/baseToken.d.ts +2 -2
  92. package/dist/build/schemas/baseToken.js +4 -7
  93. package/dist/build/schemas/borderToken.d.ts +5 -5
  94. package/dist/build/schemas/borderToken.js +13 -16
  95. package/dist/build/schemas/collections.js +8 -14
  96. package/dist/build/schemas/colorHexValue.js +4 -7
  97. package/dist/build/schemas/colorToken.d.ts +20 -15
  98. package/dist/build/schemas/colorToken.js +24 -24
  99. package/dist/build/schemas/cubicBezierToken.d.ts +18 -0
  100. package/dist/build/schemas/cubicBezierToken.js +8 -0
  101. package/dist/build/schemas/designToken.js +30 -32
  102. package/dist/build/schemas/dimensionToken.d.ts +5 -5
  103. package/dist/build/schemas/dimensionToken.js +14 -17
  104. package/dist/build/schemas/dimensionValue.js +7 -10
  105. package/dist/build/schemas/durationToken.d.ts +5 -5
  106. package/dist/build/schemas/durationToken.js +8 -11
  107. package/dist/build/schemas/durationValue.js +4 -7
  108. package/dist/build/schemas/fontFamilyToken.d.ts +5 -5
  109. package/dist/build/schemas/fontFamilyToken.js +13 -16
  110. package/dist/build/schemas/fontWeightToken.d.ts +5 -5
  111. package/dist/build/schemas/fontWeightToken.js +14 -17
  112. package/dist/build/schemas/fontWeightValue.js +4 -7
  113. package/dist/build/schemas/numberToken.d.ts +5 -5
  114. package/dist/build/schemas/numberToken.js +15 -18
  115. package/dist/build/schemas/referenceValue.js +4 -7
  116. package/dist/build/schemas/scopes.js +5 -10
  117. package/dist/build/schemas/shadowToken.d.ts +5 -5
  118. package/dist/build/schemas/shadowToken.js +23 -26
  119. package/dist/build/schemas/stringToken.d.ts +5 -5
  120. package/dist/build/schemas/stringToken.js +7 -10
  121. package/dist/build/schemas/tokenName.js +4 -7
  122. package/dist/build/schemas/tokenType.d.ts +2 -2
  123. package/dist/build/schemas/tokenType.js +2 -6
  124. package/dist/build/schemas/typographyToken.d.ts +5 -5
  125. package/dist/build/schemas/typographyToken.js +14 -17
  126. package/dist/build/schemas/validTokenType.d.ts +1 -1
  127. package/dist/build/schemas/validTokenType.js +10 -13
  128. package/dist/build/schemas/viewportRangeToken.d.ts +5 -5
  129. package/dist/build/schemas/viewportRangeToken.js +7 -10
  130. package/dist/build/transformers/borderToCss.d.ts +3 -3
  131. package/dist/build/transformers/borderToCss.js +16 -16
  132. package/dist/build/transformers/colorToHex.d.ts +2 -2
  133. package/dist/build/transformers/colorToHex.js +11 -13
  134. package/dist/build/transformers/colorToHexMix.d.ts +2 -2
  135. package/dist/build/transformers/colorToHexMix.js +10 -15
  136. package/dist/build/transformers/colorToRgbAlpha.d.ts +2 -2
  137. package/dist/build/transformers/colorToRgbAlpha.js +10 -12
  138. package/dist/build/transformers/colorToRgbaFloat.d.ts +2 -2
  139. package/dist/build/transformers/colorToRgbaFloat.js +24 -28
  140. package/dist/build/transformers/cubicBezierToCss.d.ts +8 -0
  141. package/dist/build/transformers/cubicBezierToCss.js +23 -0
  142. package/dist/build/transformers/dimensionToPixelUnitless.d.ts +2 -2
  143. package/dist/build/transformers/dimensionToPixelUnitless.js +13 -14
  144. package/dist/build/transformers/dimensionToRem.d.ts +2 -2
  145. package/dist/build/transformers/dimensionToRem.js +12 -13
  146. package/dist/build/transformers/dimensionToRemPxArray.d.ts +2 -2
  147. package/dist/build/transformers/dimensionToRemPxArray.js +11 -12
  148. package/dist/build/transformers/durationToCss.d.ts +2 -2
  149. package/dist/build/transformers/durationToCss.js +10 -11
  150. package/dist/build/transformers/figmaAttributes.d.ts +2 -2
  151. package/dist/build/transformers/figmaAttributes.js +3 -5
  152. package/dist/build/transformers/floatToPixel.d.ts +4 -4
  153. package/dist/build/transformers/floatToPixel.js +12 -14
  154. package/dist/build/transformers/fontFamilyToCss.d.ts +2 -2
  155. package/dist/build/transformers/fontFamilyToCss.js +10 -13
  156. package/dist/build/transformers/fontFamilyToFigma.d.ts +3 -3
  157. package/dist/build/transformers/fontFamilyToFigma.js +15 -17
  158. package/dist/build/transformers/fontWeightToNumber.d.ts +2 -2
  159. package/dist/build/transformers/fontWeightToNumber.js +8 -11
  160. package/dist/build/transformers/index.d.ts +25 -24
  161. package/dist/build/transformers/index.js +25 -51
  162. package/dist/build/transformers/jsonDeprecated.d.ts +2 -2
  163. package/dist/build/transformers/jsonDeprecated.js +6 -8
  164. package/dist/build/transformers/namePathToCamelCase.d.ts +2 -2
  165. package/dist/build/transformers/namePathToCamelCase.js +5 -7
  166. package/dist/build/transformers/namePathToDotNotation.d.ts +2 -2
  167. package/dist/build/transformers/namePathToDotNotation.js +6 -8
  168. package/dist/build/transformers/namePathToFigma.d.ts +3 -3
  169. package/dist/build/transformers/namePathToFigma.js +5 -8
  170. package/dist/build/transformers/namePathToKebabCase.d.ts +2 -2
  171. package/dist/build/transformers/namePathToKebabCase.js +4 -6
  172. package/dist/build/transformers/namePathToPascalCase.d.ts +2 -2
  173. package/dist/build/transformers/namePathToPascalCase.js +5 -7
  174. package/dist/build/transformers/namePathToSlashNotation.d.ts +2 -2
  175. package/dist/build/transformers/namePathToSlashNotation.js +4 -6
  176. package/dist/build/transformers/shadowToCss.d.ts +2 -2
  177. package/dist/build/transformers/shadowToCss.js +14 -15
  178. package/dist/build/transformers/typographyToCss.d.ts +2 -2
  179. package/dist/build/transformers/typographyToCss.js +13 -15
  180. package/dist/build/transformers/utilities/alpha.d.ts +1 -1
  181. package/dist/build/transformers/utilities/alpha.js +4 -8
  182. package/dist/build/transformers/utilities/checkRequiredTokenProperties.js +1 -5
  183. package/dist/build/transformers/utilities/getTokenValue.d.ts +2 -2
  184. package/dist/build/transformers/utilities/getTokenValue.js +10 -12
  185. package/dist/build/transformers/utilities/hasSpaceInString.js +1 -5
  186. package/dist/build/transformers/utilities/hexToRgbaFloat.d.ts +1 -1
  187. package/dist/build/transformers/utilities/hexToRgbaFloat.js +1 -5
  188. package/dist/build/transformers/utilities/invalidTokenError.d.ts +1 -1
  189. package/dist/build/transformers/utilities/invalidTokenError.js +11 -10
  190. package/dist/build/transformers/utilities/isRgbaFloat.js +1 -5
  191. package/dist/build/transformers/utilities/mix.js +5 -7
  192. package/dist/build/transformers/utilities/rgbaFloatToHex.js +1 -5
  193. package/dist/build/types/Border.d.ts +5 -0
  194. package/dist/build/types/BorderTokenValue.d.ts +10 -0
  195. package/dist/build/types/ColorHex.d.ts +4 -0
  196. package/dist/build/types/PlatformInitializer.d.ts +11 -0
  197. package/dist/build/types/Shadow.d.ts +5 -0
  198. package/dist/build/types/ShadowTokenValue.d.ts +14 -0
  199. package/dist/build/types/SizeEm.d.ts +4 -0
  200. package/dist/build/types/SizePx.d.ts +4 -0
  201. package/dist/build/types/SizeRem.d.ts +4 -0
  202. package/dist/build/types/StyleDictionaryConfigGenerator.d.ts +15 -0
  203. package/dist/build/types/TokenBuildInput.d.ts +8 -0
  204. package/dist/build/types/TypographyTokenValue.d.ts +12 -0
  205. package/dist/build/types/w3cTransformedToken.d.ts +8 -0
  206. package/dist/build/utilities/copyFromDir.d.ts +2 -2
  207. package/dist/build/utilities/copyFromDir.js +7 -10
  208. package/dist/build/utilities/filterStringArray.js +1 -5
  209. package/dist/build/utilities/getFlag.js +1 -5
  210. package/dist/build/utilities/index.d.ts +9 -3
  211. package/dist/build/utilities/index.js +9 -9
  212. package/dist/build/utilities/joinFriendly.js +1 -5
  213. package/dist/build/utilities/schemaErrorMessage.js +1 -5
  214. package/dist/build/utilities/toCamelCase.js +5 -9
  215. package/dist/build/utilities/toPascalCase.js +5 -9
  216. package/dist/build/utilities/treeWalker.js +2 -6
  217. package/dist/build/utilities/upperCaseFirstCharacter.js +1 -5
  218. package/dist/css/base/motion/motion.css +17 -0
  219. package/dist/css/functional/motion/motion.css +4 -3
  220. package/dist/css/functional/themes/dark-colorblind.css +58 -38
  221. package/dist/css/functional/themes/dark-dimmed.css +44 -24
  222. package/dist/css/functional/themes/dark-high-contrast.css +62 -42
  223. package/dist/css/functional/themes/dark-tritanopia.css +44 -24
  224. package/dist/css/functional/themes/dark.css +42 -22
  225. package/dist/css/functional/themes/light-colorblind.css +60 -40
  226. package/dist/css/functional/themes/light-high-contrast.css +58 -38
  227. package/dist/css/functional/themes/light-tritanopia.css +42 -22
  228. package/dist/css/functional/themes/light.css +42 -22
  229. package/dist/css/functional/typography/typography.css +43 -43
  230. package/dist/css/primitives.css +64 -46
  231. package/dist/docs/base/motion/motion.json +205 -0
  232. package/dist/docs/base/size/size.json +76 -76
  233. package/dist/docs/base/typography/typography.json +16 -16
  234. package/dist/docs/functional/motion/motion.json +33 -18
  235. package/dist/docs/functional/size/border.json +56 -56
  236. package/dist/docs/functional/size/breakpoints.json +24 -24
  237. package/dist/docs/functional/size/size-coarse.json +12 -12
  238. package/dist/docs/functional/size/size-fine.json +12 -12
  239. package/dist/docs/functional/size/size.json +264 -264
  240. package/dist/docs/functional/size/viewport.json +24 -24
  241. package/dist/docs/functional/themes/dark-colorblind.json +2868 -3462
  242. package/dist/docs/functional/themes/dark-dimmed.json +2826 -3016
  243. package/dist/docs/functional/themes/dark-high-contrast.json +2822 -5100
  244. package/dist/docs/functional/themes/dark-tritanopia.json +2829 -3203
  245. package/dist/docs/functional/themes/dark.json +2808 -2520
  246. package/dist/docs/functional/themes/light-colorblind.json +2604 -3150
  247. package/dist/docs/functional/themes/light-high-contrast.json +2653 -4609
  248. package/dist/docs/functional/themes/light-tritanopia.json +2546 -2960
  249. package/dist/docs/functional/themes/light.json +2590 -2312
  250. package/dist/docs/functional/typography/typography.json +206 -206
  251. package/dist/fallbacks/base/motion/motion.json +17 -0
  252. package/dist/fallbacks/functional/motion/motion.json +1 -0
  253. package/dist/figma/dimension/dimension.json +492 -492
  254. package/dist/figma/figma.json +21 -13
  255. package/dist/figma/scales/dark-dimmed.json +3536 -656
  256. package/dist/figma/scales/dark-high-constrast.json +3535 -655
  257. package/dist/figma/scales/dark.json +3371 -491
  258. package/dist/figma/scales/light-high-constrast.json +3532 -652
  259. package/dist/figma/scales/light.json +3367 -487
  260. package/dist/figma/shadows/dark-colorblind.json +199 -199
  261. package/dist/figma/shadows/dark-dimmed.json +199 -199
  262. package/dist/figma/shadows/dark-high-contrast.json +199 -199
  263. package/dist/figma/shadows/dark-tritanopia.json +199 -199
  264. package/dist/figma/shadows/dark.json +199 -199
  265. package/dist/figma/shadows/light-colorblind.json +189 -189
  266. package/dist/figma/shadows/light-high-contrast.json +191 -191
  267. package/dist/figma/shadows/light-tritanopia.json +189 -189
  268. package/dist/figma/shadows/light.json +189 -189
  269. package/dist/figma/themes/dark-colorblind.json +4470 -5204
  270. package/dist/figma/themes/dark-dimmed.json +4771 -5081
  271. package/dist/figma/themes/dark-high-contrast.json +4189 -6548
  272. package/dist/figma/themes/dark-tritanopia.json +4629 -5153
  273. package/dist/figma/themes/dark.json +5072 -4916
  274. package/dist/figma/themes/light-colorblind.json +4490 -5127
  275. package/dist/figma/themes/light-high-contrast.json +4170 -6201
  276. package/dist/figma/themes/light-tritanopia.json +4525 -5027
  277. package/dist/figma/themes/light.json +4982 -4825
  278. package/dist/figma/typography/typography.json +159 -203
  279. package/dist/internalCss/dark-colorblind.css +58 -38
  280. package/dist/internalCss/dark-dimmed.css +44 -24
  281. package/dist/internalCss/dark-high-contrast.css +62 -42
  282. package/dist/internalCss/dark-tritanopia.css +44 -24
  283. package/dist/internalCss/dark.css +42 -22
  284. package/dist/internalCss/light-colorblind.css +60 -40
  285. package/dist/internalCss/light-high-contrast.css +58 -38
  286. package/dist/internalCss/light-tritanopia.css +42 -22
  287. package/dist/internalCss/light.css +42 -22
  288. package/dist/styleLint/base/motion/motion.json +205 -0
  289. package/dist/styleLint/base/size/size.json +38 -38
  290. package/dist/styleLint/base/typography/typography.json +8 -8
  291. package/dist/styleLint/functional/motion/motion.json +27 -12
  292. package/dist/styleLint/functional/size/border.json +30 -30
  293. package/dist/styleLint/functional/size/breakpoints.json +12 -12
  294. package/dist/styleLint/functional/size/size-coarse.json +6 -6
  295. package/dist/styleLint/functional/size/size-fine.json +6 -6
  296. package/dist/styleLint/functional/size/size.json +132 -132
  297. package/dist/styleLint/functional/size/viewport.json +12 -12
  298. package/dist/styleLint/functional/themes/dark-colorblind.json +1644 -2238
  299. package/dist/styleLint/functional/themes/dark-dimmed.json +1699 -1889
  300. package/dist/styleLint/functional/themes/dark-high-contrast.json +1627 -3905
  301. package/dist/styleLint/functional/themes/dark-tritanopia.json +1704 -2078
  302. package/dist/styleLint/functional/themes/dark.json +1692 -1404
  303. package/dist/styleLint/functional/themes/light-colorblind.json +1506 -2052
  304. package/dist/styleLint/functional/themes/light-high-contrast.json +1515 -3471
  305. package/dist/styleLint/functional/themes/light-tritanopia.json +1434 -1848
  306. package/dist/styleLint/functional/themes/light.json +1474 -1196
  307. package/dist/styleLint/functional/typography/typography.json +114 -114
  308. package/package.json +33 -32
  309. package/src/tokens/base/motion/easing.json5 +26 -0
  310. package/src/tokens/base/motion/timing.json5 +50 -0
  311. package/src/tokens/functional/color/dark/app-dark.json5 +203 -88
  312. package/src/tokens/functional/color/dark/data-vis-dark.json5 +20 -20
  313. package/src/tokens/functional/color/dark/display-dark.json5 +95 -95
  314. package/src/tokens/functional/color/dark/overrides/dark.dimmed.json5 +0 -8
  315. package/src/tokens/functional/color/dark/overrides/dark.high-contrast.json5 +43 -30
  316. package/src/tokens/functional/color/dark/overrides/dark.protanopia-deuteranopia.json5 +62 -30
  317. package/src/tokens/functional/color/dark/overrides/dark.tritanopia.json5 +53 -12
  318. package/src/tokens/functional/color/dark/patterns-dark.json5 +16 -4
  319. package/src/tokens/functional/color/dark/primitives-dark.json5 +4 -4
  320. package/src/tokens/functional/color/light/app-light.json5 +195 -85
  321. package/src/tokens/functional/color/light/data-vis-light.json5 +20 -20
  322. package/src/tokens/functional/color/light/overrides/light.high-contrast.json5 +25 -25
  323. package/src/tokens/functional/color/light/overrides/light.protanopia-deuteranopia.json5 +65 -34
  324. package/src/tokens/functional/color/light/overrides/light.tritanopia.json5 +66 -11
  325. package/src/tokens/functional/color/light/patterns-light.json5 +13 -1
  326. package/src/tokens/functional/color/light/primitives-light.json5 +2 -2
  327. package/src/tokens/functional/motion/loading.json5 +1 -1
  328. package/src/tokens/functional/motion/patterns.json5 +9 -2
@@ -1,8 +1,8 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { FormatFn } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description Takes a style dictionary token dictionary and converts it to a one dimensional json object.
4
- * @param StyleDictionary.FormatterArguments
4
+ * @param FormatFnArguments
5
5
  * @param options.nameSeparator - separator to use for nested token name
6
6
  * @returns formatted json `string`
7
7
  */
8
- export declare const jsonPostCssFallback: StyleDictionary.Formatter;
8
+ export declare const jsonPostCssFallback: FormatFn;
@@ -1,21 +1,14 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.jsonPostCssFallback = void 0;
7
- const sync_1 = __importDefault(require("@prettier/sync"));
1
+ import { format } from 'prettier';
8
2
  /**
9
3
  * @description Takes a style dictionary token dictionary and converts it to a one dimensional json object.
10
- * @param StyleDictionary.FormatterArguments
4
+ * @param FormatFnArguments
11
5
  * @param options.nameSeparator - separator to use for nested token name
12
6
  * @returns formatted json `string`
13
7
  */
14
- const jsonPostCssFallback = ({ dictionary, file: _file }) => {
15
- const tokens = Object.fromEntries(dictionary.allTokens.map(token => [`--${token.name}`, token.value]));
8
+ export const jsonPostCssFallback = ({ dictionary, file: _file }) => {
9
+ const tokens = Object.fromEntries(dictionary.allTokens.map(token => [`--${token.name}`, token.$value]));
16
10
  // add file header and convert output
17
11
  const output = JSON.stringify(tokens, null, 2);
18
12
  // return prettified
19
- return sync_1.default.format(output, { parser: 'json', printWidth: 500 });
13
+ return format(output, { parser: 'json', printWidth: 500 });
20
14
  };
21
- exports.jsonPostCssFallback = jsonPostCssFallback;
@@ -1,7 +1,7 @@
1
- import StyleDictionary from 'style-dictionary';
1
+ import type { FormatFn } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description Converts `StyleDictionary.dictionary.tokens` to typescript definition
4
4
  * @param arguments [FormatterArguments](https://github.com/amzn/style-dictionary/blob/main/types/Format.d.ts)
5
5
  * @returns formatted `string`
6
6
  */
7
- export declare const typescriptExportDefinition: StyleDictionary.Formatter;
7
+ export declare const typescriptExportDefinition: FormatFn;
@@ -1,16 +1,19 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
4
9
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.typescriptExportDefinition = void 0;
7
- const style_dictionary_1 = __importDefault(require("style-dictionary"));
8
- const sync_1 = __importDefault(require("@prettier/sync"));
9
- const fs = require("fs");
10
- const path = require("path");
11
- const treeWalker_1 = require("../utilities/treeWalker");
12
- const prefixTokens_1 = require("./utilities/prefixTokens");
13
- const { fileHeader } = style_dictionary_1.default.formatHelpers;
10
+ import { format } from 'prettier';
11
+ import { readFileSync } from 'fs';
12
+ import { resolve as resolvePath } from 'path';
13
+ import { treeWalker } from '../utilities/treeWalker.js';
14
+ import { prefixTokens } from './utilities/prefixTokens.js';
15
+ import { fileHeader } from 'style-dictionary/utils';
16
+ import { getPropName } from './utilities/getPropName.js';
14
17
  /**
15
18
  * unquoteTypes
16
19
  * @description extract types from designTokenTypes (string with type definitions from file) and replace quoted types "Color" with unquoted Color
@@ -31,20 +34,20 @@ const unquoteTypes = (output, designTokenTypes) => {
31
34
  */
32
35
  const getTokenType = (tokenTypesPath) => {
33
36
  try {
34
- const designTokenType = fs.readFileSync(path.resolve(tokenTypesPath), { encoding: 'utf-8' });
37
+ const designTokenType = readFileSync(resolvePath(tokenTypesPath), { encoding: 'utf-8' });
35
38
  return designTokenType;
36
39
  }
37
- catch (e) {
40
+ catch (error) {
38
41
  // eslint-disable-next-line no-console
39
- throw new Error(`Error trying to load design token type from file "${tokenTypesPath}".`);
42
+ throw new Error(`Error trying to load design token type from file "${tokenTypesPath}". Error: ${error}`);
40
43
  }
41
44
  };
42
45
  /**
43
46
  * @description throws an error stating the token name, type and invalid value
44
47
  * @param token w3cTransformedToken
45
48
  */
46
- const invalidTokenValueError = (token) => {
47
- throw new Error(`Invalid token: "${token.name}" with type "${token.$type}" can not have a value of "${token.value}"`);
49
+ const invalidTokenValueError = (token, options) => {
50
+ throw new Error(`Invalid token: "${token.name}" with type "${token[getPropName('type', options.usesDtcg)]}" can not have a value of "${token[getPropName('value', options.usesDtcg)]}"`);
48
51
  };
49
52
  /**
50
53
  * convertPropToType
@@ -52,34 +55,35 @@ const invalidTokenValueError = (token) => {
52
55
  * @param type
53
56
  * @returns
54
57
  */
55
- const convertPropToType = (tree) => {
56
- if (!Object.prototype.hasOwnProperty.call(tree, 'value')) {
58
+ const convertPropToType = (tree, options) => {
59
+ const valueProp = getPropName('value', options.usesDtcg);
60
+ if (!Object.prototype.hasOwnProperty.call(tree, valueProp)) {
57
61
  throw new Error(`Invalid token: ${tree}`);
58
62
  }
59
63
  switch (tree.$type) {
60
64
  case 'color':
61
- if (typeof tree.value === 'string' && tree.value[0] === '#') {
65
+ if (typeof tree[valueProp] === 'string' && tree[valueProp][0] === '#') {
62
66
  return 'ColorHex';
63
67
  }
64
- return invalidTokenValueError(tree);
68
+ return invalidTokenValueError(tree, options);
65
69
  case 'dimension':
66
- if (typeof tree.value === 'string' && tree.value.substring(tree.value.length - 3) === 'rem')
70
+ if (typeof tree[valueProp] === 'string' && tree[valueProp].substring(tree[valueProp].length - 3) === 'rem')
67
71
  return 'SizeRem';
68
- if (typeof tree.value === 'string' && tree.value.substring(tree.value.length - 2) === 'em')
72
+ if (typeof tree[valueProp] === 'string' && tree[valueProp].substring(tree[valueProp].length - 2) === 'em')
69
73
  return 'SizeEm';
70
- if (typeof tree.value === 'string' && tree.value.substring(tree.value.length - 2) === 'px')
74
+ if (typeof tree[valueProp] === 'string' && tree[valueProp].substring(tree[valueProp].length - 2) === 'px')
71
75
  return 'SizePx';
72
- return invalidTokenValueError(tree);
76
+ return invalidTokenValueError(tree, options);
73
77
  case 'shadow':
74
78
  return 'Shadow';
75
79
  case 'border':
76
80
  return 'Border';
77
81
  default:
78
- if (typeof tree.value === 'number')
82
+ if (typeof tree[valueProp] === 'number')
79
83
  return 'number';
80
- if (typeof tree.value === 'string')
84
+ if (typeof tree[valueProp] === 'string')
81
85
  return 'string';
82
- if (typeof tree.value === 'boolean')
86
+ if (typeof tree[valueProp] === 'boolean')
83
87
  return 'boolean';
84
88
  return 'any';
85
89
  }
@@ -89,8 +93,8 @@ const convertPropToType = (tree) => {
89
93
  * @param item object
90
94
  * @returns boolean
91
95
  */
92
- const validTokenNode = (item) => {
93
- return typeof item === 'object' && item !== null && 'value' in item;
96
+ const validTokenNode = (usesDtcg) => (item) => {
97
+ return typeof item === 'object' && item !== null && getPropName('value', usesDtcg) in item;
94
98
  };
95
99
  /**
96
100
  * returns a set with every used token type
@@ -98,13 +102,13 @@ const validTokenNode = (item) => {
98
102
  * @param validTypes array, all other types will be removed
99
103
  * @returns set of all used token types
100
104
  */
101
- const getUsedTokenTypes = (tokens, validTypes) => {
105
+ const getUsedTokenTypes = (tokens, validTypes, options) => {
102
106
  // using a set to assure every value only exists once
103
107
  const usedTypes = new Set();
104
108
  // adds type to set
105
- const callback = (tree) => usedTypes.add(convertPropToType(tree));
109
+ const callback = (tree) => usedTypes.add(convertPropToType(tree, options));
106
110
  // tree walker adds to usedTypes
107
- (0, treeWalker_1.treeWalker)(tokens, callback, validTokenNode);
111
+ treeWalker(tokens, callback, validTokenNode(options.usesDtcg));
108
112
  // clean up types
109
113
  for (const type of usedTypes) {
110
114
  if (!validTypes.includes(type)) {
@@ -118,11 +122,12 @@ const getUsedTokenTypes = (tokens, validTypes) => {
118
122
  * @param item object
119
123
  * @returns object
120
124
  */
121
- const getTokenObjectWithTypes = (tokens) => {
125
+ const getTokenObjectWithTypes = (tokens, options) => {
126
+ const callback = (tree) => convertPropToType(tree, options);
122
127
  // TODO: FIX typescript issues
123
128
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
124
129
  // @ts-ignore
125
- return (0, treeWalker_1.treeWalker)(tokens, convertPropToType, validTokenNode);
130
+ return treeWalker(tokens, callback, validTokenNode(options.usesDtcg));
126
131
  };
127
132
  /**
128
133
  * getTypeDefinition
@@ -132,9 +137,11 @@ const getTokenObjectWithTypes = (tokens) => {
132
137
  * @param tokenTypesPath
133
138
  * @returns string
134
139
  */
135
- const getTypeDefinition = (tokens, moduleName, tokenTypesPath) => {
136
- const usedTypes = getUsedTokenTypes(tokens, ['ColorHex', 'Shadow', 'Border', 'SizeEm', 'SizeRem', 'SizePx']);
137
- const tokenObjectWithTypes = getTokenObjectWithTypes(tokens);
140
+ const getTypeDefinition = (tokens, options) => {
141
+ // extract options
142
+ const { moduleName = `tokens`, tokenTypesPath = `./src/types/` } = options;
143
+ const usedTypes = getUsedTokenTypes(tokens, ['Shadow', 'ColorHex', 'Border', 'SizeEm', 'SizeRem', 'SizePx'], options);
144
+ const tokenObjectWithTypes = getTokenObjectWithTypes(tokens, options);
138
145
  // get token type declaration from file
139
146
  const designTokenTypes = [];
140
147
  for (const type of usedTypes) {
@@ -153,14 +160,11 @@ const getTypeDefinition = (tokens, moduleName, tokenTypesPath) => {
153
160
  * @param arguments [FormatterArguments](https://github.com/amzn/style-dictionary/blob/main/types/Format.d.ts)
154
161
  * @returns formatted `string`
155
162
  */
156
- const typescriptExportDefinition = ({ dictionary, file, options = {}, platform, }) => {
157
- // extract options
158
- const { moduleName = `tokens`, tokenTypesPath = `./src/types/` } = options;
163
+ export const typescriptExportDefinition = (_a) => __awaiter(void 0, [_a], void 0, function* ({ dictionary, file, options = {}, platform, }) {
159
164
  // add prefix if defined
160
- const tokens = (0, prefixTokens_1.prefixTokens)(dictionary.tokens, platform);
165
+ const tokens = prefixTokens(dictionary.tokens, platform);
161
166
  // add file header and convert output
162
- const output = `${fileHeader({ file })}\n${getTypeDefinition(tokens, moduleName, tokenTypesPath)}\n`;
167
+ const output = `${yield fileHeader({ file })}\n${getTypeDefinition(tokens, options)}\n`;
163
168
  // return prettified
164
- return sync_1.default.format(output, { parser: 'typescript', printWidth: 500 });
165
- };
166
- exports.typescriptExportDefinition = typescriptExportDefinition;
169
+ return format(output, { parser: 'typescript', printWidth: 500 });
170
+ });
@@ -0,0 +1 @@
1
+ export declare const getPropName: (prop: "value" | "type" | "description", usesDtcg?: boolean) => "type" | "value" | "$value" | "$type" | "$description" | "comment";
@@ -0,0 +1,16 @@
1
+ const props = {
2
+ dtcg: {
3
+ value: '$value',
4
+ type: '$type',
5
+ description: '$description',
6
+ },
7
+ legacy: {
8
+ value: 'value',
9
+ type: 'type',
10
+ description: 'comment',
11
+ },
12
+ };
13
+ export const getPropName = (prop, usesDtcg) => {
14
+ const type = usesDtcg ? 'dtcg' : 'legacy';
15
+ return props[type][prop];
16
+ };
@@ -1,4 +1,4 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { TransformedToken } from 'style-dictionary/types';
2
2
  /**
3
3
  * jsonToFlat
4
4
  * @description creates a one dimensional json structure with either a single value or an token object as the value
@@ -6,6 +6,6 @@ import type StyleDictionary from 'style-dictionary';
6
6
  * @param returnObject - boolean
7
7
  * @returns flat json three
8
8
  */
9
- export declare const jsonToFlat: (tokens: StyleDictionary.TransformedToken[], returnObject?: boolean) => {
9
+ export declare const jsonToFlat: (tokens: TransformedToken[], returnObject?: boolean) => {
10
10
  [k: string]: any;
11
11
  };
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jsonToFlat = void 0;
4
1
  /**
5
2
  * jsonToFlat
6
3
  * @description creates a one dimensional json structure with either a single value or an token object as the value
@@ -8,5 +5,4 @@ exports.jsonToFlat = void 0;
8
5
  * @param returnObject - boolean
9
6
  * @returns flat json three
10
7
  */
11
- const jsonToFlat = (tokens, returnObject = false) => Object.fromEntries(tokens.map(token => [token.name, returnObject ? token : token.value]));
12
- exports.jsonToFlat = jsonToFlat;
8
+ export const jsonToFlat = (tokens, returnObject = false) => Object.fromEntries(tokens.map(token => [token.name, returnObject ? token : token.$value]));
@@ -1,8 +1,8 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { DesignToken } from 'style-dictionary/types';
2
2
  /**
3
3
  * jsonToNestedValue
4
4
  * @description creates a nested json tree where every final value is the `.value` prop
5
5
  * @param token StyleDictionary.DesignToken
6
6
  * @returns nested json three
7
7
  */
8
- export declare const jsonToNestedValue: (token: StyleDictionary.DesignToken | Record<string, unknown>) => any;
8
+ export declare const jsonToNestedValue: (token: DesignToken | Record<string, unknown>) => any;
@@ -1,25 +1,23 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jsonToNestedValue = void 0;
4
1
  /**
5
2
  * jsonToNestedValue
6
3
  * @description creates a nested json tree where every final value is the `.value` prop
7
4
  * @param token StyleDictionary.DesignToken
8
5
  * @returns nested json three
9
6
  */
10
- const jsonToNestedValue = (token) => {
7
+ export const jsonToNestedValue = (token) => {
11
8
  // is non-object value
12
9
  if (typeof token !== 'object')
13
10
  return token;
14
11
  // is design token
12
+ if ('$value' in token)
13
+ return token.$value;
15
14
  if ('value' in token)
16
15
  return token.value;
17
16
  // is obj
18
17
  const nextObj = {};
19
18
  for (const [prop, value] of Object.entries(token)) {
20
19
  // @ts-expect-error: can't predict type
21
- nextObj[prop] = (0, exports.jsonToNestedValue)(value);
20
+ nextObj[prop] = jsonToNestedValue(value);
22
21
  }
23
22
  return nextObj;
24
23
  };
25
- exports.jsonToNestedValue = jsonToNestedValue;
@@ -1,8 +1,8 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { PlatformConfig, TransformedTokens } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description extract prefix from platform and add to tokens array if defined
4
4
  * @param tokens StyleDictionary.TransformedTokens
5
5
  * @param platform StyleDictionary.Platform
6
6
  * @return StyleDictionary.TransformedTokens
7
7
  */
8
- export declare const prefixTokens: (tokens: StyleDictionary.TransformedTokens, platform?: StyleDictionary.Platform) => StyleDictionary.TransformedTokens;
8
+ export declare const prefixTokens: (tokens: TransformedTokens, platform?: PlatformConfig) => TransformedTokens;
@@ -1,17 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.prefixTokens = void 0;
4
1
  /**
5
2
  * @description extract prefix from platform and add to tokens array if defined
6
3
  * @param tokens StyleDictionary.TransformedTokens
7
4
  * @param platform StyleDictionary.Platform
8
5
  * @return StyleDictionary.TransformedTokens
9
6
  */
10
- const prefixTokens = (tokens, platform = {}) => {
7
+ export const prefixTokens = (tokens, platform = {}) => {
11
8
  const { prefix } = platform;
12
9
  if (typeof prefix === 'string') {
13
10
  tokens = { [prefix]: tokens };
14
11
  }
15
12
  return tokens;
16
13
  };
17
- exports.prefixTokens = prefixTokens;
@@ -1 +1 @@
1
- export { w3cJsonParser } from './w3cJsonParser';
1
+ export { w3cJsonParser } from './w3cJsonParser.js';
@@ -1,5 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.w3cJsonParser = void 0;
4
- var w3cJsonParser_1 = require("./w3cJsonParser");
5
- Object.defineProperty(exports, "w3cJsonParser", { enumerable: true, get: function () { return w3cJsonParser_1.w3cJsonParser; } });
1
+ export { w3cJsonParser } from './w3cJsonParser.js';
@@ -1,6 +1,6 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { Parser } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description Parses a valid [json5](https://json5.org) file and replaces `$value` with `value` and `$description` with `comment` to make a w3c standard file compatible with style dictionary
4
4
  * @pattern supported file extensions `.json` or `.json5`
5
5
  */
6
- export declare const w3cJsonParser: StyleDictionary.Parser;
6
+ export declare const w3cJsonParser: Parser;
@@ -1,14 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.w3cJsonParser = void 0;
4
- const json5_1 = require("json5");
1
+ import JSON5 from 'json5';
5
2
  /**
6
3
  * @description Parses a valid [json5](https://json5.org) file and replaces `$value` with `value` and `$description` with `comment` to make a w3c standard file compatible with style dictionary
7
4
  * @pattern supported file extensions `.json` or `.json5`
8
5
  */
9
- exports.w3cJsonParser = {
6
+ export const w3cJsonParser = {
7
+ name: 'w3cJsonParser',
10
8
  pattern: /\.json5?$/,
11
- parse: ({ filePath, contents }) => {
9
+ parser: ({ filePath, contents }) => {
12
10
  // replace $value with value so that style dictionary recognizes it
13
11
  try {
14
12
  contents = contents
@@ -18,10 +16,10 @@ exports.w3cJsonParser = {
18
16
  .replace(/["|']?\$?type["|']?:/g, '"$type":')
19
17
  .replace(/["|']?\$?extensions["|']?:/g, '"$extensions":');
20
18
  //
21
- return (0, json5_1.parse)(contents);
19
+ return JSON5.parse(contents);
22
20
  }
23
- catch (e) {
24
- throw new Error(`Invalid json5 file "${filePath}".`);
21
+ catch (error) {
22
+ throw new Error(`Invalid json5 file "${filePath}". Error: ${error}`);
25
23
  }
26
24
  },
27
25
  };
@@ -1,2 +1,2 @@
1
- import type { PlatformInitializer } from '../types/PlatformInitializer';
1
+ import type { PlatformInitializer } from '../types/PlatformInitializer.ts';
2
2
  export declare const css: PlatformInitializer;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.css = void 0;
4
- const filters_1 = require("../filters");
1
+ import { isFromFile, isSource } from '../filters/index.js';
5
2
  const getCssSelectors = (outputFile) => {
6
3
  // check for dark in the beginning of the output filename
7
4
  const lastSlash = outputFile.lastIndexOf('/');
@@ -18,7 +15,7 @@ const getCssSelectors = (outputFile) => {
18
15
  },
19
16
  ];
20
17
  };
21
- const css = (outputFile, prefix, buildPath, options) => {
18
+ export const css = (outputFile, prefix, buildPath, options) => {
22
19
  return {
23
20
  prefix,
24
21
  buildPath,
@@ -26,6 +23,7 @@ const css = (outputFile, prefix, buildPath, options) => {
26
23
  'name/pathToKebabCase',
27
24
  'color/hex',
28
25
  'color/hexMix',
26
+ 'cubicBezier/css',
29
27
  'dimension/rem',
30
28
  'duration/css',
31
29
  'shadow/css',
@@ -41,19 +39,31 @@ const css = (outputFile, prefix, buildPath, options) => {
41
39
  {
42
40
  destination: `${outputFile}`,
43
41
  format: `css/advanced`,
44
- filter: token => (0, filters_1.isSource)(token) && (options === null || options === void 0 ? void 0 : options.themed) === true,
42
+ filter: token => isSource(token) &&
43
+ (options === null || options === void 0 ? void 0 : options.themed) === true &&
44
+ token.$type !== 'custom-viewportRange' &&
45
+ !isFromFile(token, [
46
+ 'src/tokens/functional/size/size-coarse.json',
47
+ 'src/tokens/functional/size/size-fine.json',
48
+ ]),
45
49
  options: Object.assign({ showFileHeader: false, outputReferences: false, descriptions: false, queries: getCssSelectors(outputFile) }, options === null || options === void 0 ? void 0 : options.options),
46
50
  },
47
51
  {
48
52
  destination: `${outputFile}`,
49
53
  format: `css/advanced`,
50
- filter: token => (0, filters_1.isSource)(token) && (options === null || options === void 0 ? void 0 : options.themed) !== true,
54
+ filter: token => isSource(token) &&
55
+ (options === null || options === void 0 ? void 0 : options.themed) !== true &&
56
+ token.$type !== 'custom-viewportRange' &&
57
+ !isFromFile(token, [
58
+ 'src/tokens/functional/size/size-coarse.json',
59
+ 'src/tokens/functional/size/size-fine.json',
60
+ ]),
51
61
  options: Object.assign({ showFileHeader: false, descriptions: false }, options === null || options === void 0 ? void 0 : options.options),
52
62
  },
53
63
  {
54
64
  destination: `${outputFile}`,
55
65
  format: `css/customMedia`,
56
- filter: token => (0, filters_1.isSource)(token) && (options === null || options === void 0 ? void 0 : options.themed) !== true && token.$type === 'custom-viewportRange',
66
+ filter: token => isSource(token) && (options === null || options === void 0 ? void 0 : options.themed) !== true && token.$type === 'custom-viewportRange',
57
67
  options: {
58
68
  showFileHeader: false,
59
69
  },
@@ -61,8 +71,8 @@ const css = (outputFile, prefix, buildPath, options) => {
61
71
  {
62
72
  destination: `${outputFile}`,
63
73
  format: `css/advanced`,
64
- filter: token => (0, filters_1.isSource)(token) &&
65
- (0, filters_1.isFromFile)(token, [
74
+ filter: token => isSource(token) &&
75
+ isFromFile(token, [
66
76
  'src/tokens/functional/size/size-coarse.json',
67
77
  'src/tokens/functional/size/size-fine.json',
68
78
  ]),
@@ -84,4 +94,3 @@ const css = (outputFile, prefix, buildPath, options) => {
84
94
  ],
85
95
  };
86
96
  };
87
- exports.css = css;
@@ -1,2 +1,2 @@
1
- import type { PlatformInitializer } from '../types/PlatformInitializer';
1
+ import type { PlatformInitializer } from '../types/PlatformInitializer.js';
2
2
  export declare const deprecatedJson: PlatformInitializer;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deprecatedJson = void 0;
4
- const filters_1 = require("../filters");
5
- const deprecatedJson = (outputFile, prefix, buildPath) => ({
1
+ import { isDeprecated } from '../filters/index.js';
2
+ export const deprecatedJson = (outputFile, prefix, buildPath) => ({
6
3
  prefix,
7
4
  buildPath,
8
5
  transforms: ['name/pathToDotNotation', 'json/deprecated'],
@@ -10,8 +7,7 @@ const deprecatedJson = (outputFile, prefix, buildPath) => ({
10
7
  {
11
8
  destination: outputFile,
12
9
  format: `json/flat`,
13
- filter: filters_1.isDeprecated,
10
+ filter: isDeprecated,
14
11
  },
15
12
  ],
16
13
  });
17
- exports.deprecatedJson = deprecatedJson;
@@ -1,2 +1,2 @@
1
- import type { PlatformInitializer } from '../types/PlatformInitializer';
1
+ import type { PlatformInitializer } from '../types/PlatformInitializer.js';
2
2
  export declare const docJson: PlatformInitializer;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.docJson = void 0;
4
- const filters_1 = require("../filters");
5
- const docJson = (outputFile, prefix, buildPath) => ({
1
+ import { isSource } from '../filters/index.js';
2
+ export const docJson = (outputFile, prefix, buildPath) => ({
6
3
  prefix,
7
4
  buildPath,
8
5
  transforms: [
@@ -18,12 +15,17 @@ const docJson = (outputFile, prefix, buildPath) => ({
18
15
  ],
19
16
  options: {
20
17
  basePxFontSize: 16,
18
+ propertyConversion: {
19
+ $value: 'value',
20
+ $type: 'type',
21
+ $description: 'description',
22
+ },
21
23
  },
22
24
  files: [
23
25
  {
24
26
  destination: outputFile,
25
27
  format: `json/one-dimensional`,
26
- filter: filters_1.isSource,
28
+ filter: isSource,
27
29
  options: {
28
30
  outputReferences: false,
29
31
  outputVerbose: true,
@@ -31,4 +33,3 @@ const docJson = (outputFile, prefix, buildPath) => ({
31
33
  },
32
34
  ],
33
35
  });
34
- exports.docJson = docJson;
@@ -1,2 +1,2 @@
1
- import type { PlatformInitializer } from '../types/PlatformInitializer';
1
+ import type { PlatformInitializer } from '../types/PlatformInitializer.js';
2
2
  export declare const fallbacks: PlatformInitializer;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fallbacks = void 0;
4
- const filters_1 = require("../filters");
5
- const fallbacks = (outputFile, prefix, buildPath) => ({
1
+ import { isSource } from '../filters/index.js';
2
+ export const fallbacks = (outputFile, prefix, buildPath) => ({
6
3
  prefix,
7
4
  buildPath,
8
5
  transforms: [
@@ -23,7 +20,7 @@ const fallbacks = (outputFile, prefix, buildPath) => ({
23
20
  {
24
21
  destination: outputFile,
25
22
  format: `json/postCss-fallback`,
26
- filter: filters_1.isSource,
23
+ filter: isSource,
27
24
  options: {
28
25
  outputReferences: false,
29
26
  outputVerbose: true,
@@ -31,4 +28,3 @@ const fallbacks = (outputFile, prefix, buildPath) => ({
31
28
  },
32
29
  ],
33
30
  });
34
- exports.fallbacks = fallbacks;
@@ -1,2 +1,2 @@
1
- import type { PlatformInitializer } from '../types/PlatformInitializer';
1
+ import type { PlatformInitializer } from '../types/PlatformInitializer.js';
2
2
  export declare const figma: PlatformInitializer;