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

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 (314) hide show
  1. package/dist/build/PrimerStyleDictionary.d.ts +1 -2
  2. package/dist/build/PrimerStyleDictionary.js +52 -64
  3. package/dist/build/filters/index.d.ts +14 -13
  4. package/dist/build/filters/index.js +14 -29
  5. package/dist/build/filters/isBorder.d.ts +3 -3
  6. package/dist/build/filters/isBorder.js +2 -6
  7. package/dist/build/filters/isColor.d.ts +3 -3
  8. package/dist/build/filters/isColor.js +8 -7
  9. package/dist/build/filters/isColorWithAlpha.d.ts +3 -3
  10. package/dist/build/filters/isColorWithAlpha.js +4 -8
  11. package/dist/build/filters/isColorWithMix.d.ts +3 -3
  12. package/dist/build/filters/isColorWithMix.js +4 -8
  13. package/dist/build/filters/isCubicBezier.d.ts +7 -0
  14. package/dist/build/filters/isCubicBezier.js +10 -0
  15. package/dist/build/filters/isDeprecated.d.ts +3 -3
  16. package/dist/build/filters/isDeprecated.js +2 -6
  17. package/dist/build/filters/isDimension.d.ts +3 -3
  18. package/dist/build/filters/isDimension.js +2 -6
  19. package/dist/build/filters/isDuration.d.ts +3 -3
  20. package/dist/build/filters/isDuration.js +2 -6
  21. package/dist/build/filters/isFontFamily.d.ts +3 -3
  22. package/dist/build/filters/isFontFamily.js +2 -6
  23. package/dist/build/filters/isFontWeight.d.ts +3 -3
  24. package/dist/build/filters/isFontWeight.js +2 -6
  25. package/dist/build/filters/isFromFile.d.ts +3 -3
  26. package/dist/build/filters/isFromFile.js +2 -6
  27. package/dist/build/filters/isNumber.d.ts +3 -3
  28. package/dist/build/filters/isNumber.js +4 -6
  29. package/dist/build/filters/isShadow.d.ts +3 -3
  30. package/dist/build/filters/isShadow.js +2 -6
  31. package/dist/build/filters/isSource.d.ts +3 -3
  32. package/dist/build/filters/isSource.js +2 -6
  33. package/dist/build/filters/isTypography.d.ts +3 -3
  34. package/dist/build/filters/isTypography.js +2 -6
  35. package/dist/build/formats/cssAdvanced.d.ts +2 -2
  36. package/dist/build/formats/cssAdvanced.js +22 -20
  37. package/dist/build/formats/cssCustomMedia.d.ts +2 -2
  38. package/dist/build/formats/cssCustomMedia.js +16 -15
  39. package/dist/build/formats/index.d.ts +9 -9
  40. package/dist/build/formats/index.js +9 -21
  41. package/dist/build/formats/javascriptCommonJs.d.ts +2 -2
  42. package/dist/build/formats/javascriptCommonJs.js +17 -16
  43. package/dist/build/formats/javascriptEsm.d.ts +2 -2
  44. package/dist/build/formats/javascriptEsm.js +17 -16
  45. package/dist/build/formats/jsonFigma.d.ts +2 -2
  46. package/dist/build/formats/jsonFigma.js +27 -22
  47. package/dist/build/formats/jsonNestedPrefixed.d.ts +3 -3
  48. package/dist/build/formats/jsonNestedPrefixed.js +17 -15
  49. package/dist/build/formats/jsonOneDimensional.d.ts +3 -3
  50. package/dist/build/formats/jsonOneDimensional.js +24 -16
  51. package/dist/build/formats/jsonPostCssFallback.d.ts +3 -3
  52. package/dist/build/formats/jsonPostCssFallback.js +5 -12
  53. package/dist/build/formats/typescriptExportDefinition.d.ts +2 -2
  54. package/dist/build/formats/typescriptExportDefinition.js +48 -44
  55. package/dist/build/formats/utilities/getPropName.d.ts +1 -0
  56. package/dist/build/formats/utilities/getPropName.js +16 -0
  57. package/dist/build/formats/utilities/jsonToFlat.d.ts +2 -2
  58. package/dist/build/formats/utilities/jsonToFlat.js +1 -5
  59. package/dist/build/formats/utilities/jsonToNestedValue.d.ts +2 -2
  60. package/dist/build/formats/utilities/jsonToNestedValue.js +4 -6
  61. package/dist/build/formats/utilities/prefixTokens.d.ts +2 -2
  62. package/dist/build/formats/utilities/prefixTokens.js +1 -5
  63. package/dist/build/parsers/index.d.ts +1 -1
  64. package/dist/build/parsers/index.js +1 -5
  65. package/dist/build/parsers/w3cJsonParser.d.ts +2 -2
  66. package/dist/build/parsers/w3cJsonParser.js +5 -7
  67. package/dist/build/platforms/css.d.ts +1 -1
  68. package/dist/build/platforms/css.js +20 -11
  69. package/dist/build/platforms/deprecatedJson.d.ts +1 -1
  70. package/dist/build/platforms/deprecatedJson.js +3 -7
  71. package/dist/build/platforms/docJson.d.ts +1 -1
  72. package/dist/build/platforms/docJson.js +8 -7
  73. package/dist/build/platforms/fallbacks.d.ts +1 -1
  74. package/dist/build/platforms/fallbacks.js +3 -7
  75. package/dist/build/platforms/figma.d.ts +1 -1
  76. package/dist/build/platforms/figma.js +21 -14
  77. package/dist/build/platforms/index.d.ts +10 -10
  78. package/dist/build/platforms/index.js +10 -23
  79. package/dist/build/platforms/javascript.d.ts +1 -1
  80. package/dist/build/platforms/javascript.js +3 -7
  81. package/dist/build/platforms/json.d.ts +1 -1
  82. package/dist/build/platforms/json.js +3 -7
  83. package/dist/build/platforms/styleLint.d.ts +1 -1
  84. package/dist/build/platforms/styleLint.js +3 -7
  85. package/dist/build/platforms/typeDefinitions.d.ts +1 -1
  86. package/dist/build/platforms/typeDefinitions.js +6 -10
  87. package/dist/build/platforms/typescript.d.ts +1 -1
  88. package/dist/build/platforms/typescript.js +3 -7
  89. package/dist/build/schemas/alphaValue.js +4 -7
  90. package/dist/build/schemas/baseToken.d.ts +2 -2
  91. package/dist/build/schemas/baseToken.js +4 -7
  92. package/dist/build/schemas/borderToken.d.ts +5 -5
  93. package/dist/build/schemas/borderToken.js +13 -16
  94. package/dist/build/schemas/collections.js +8 -14
  95. package/dist/build/schemas/colorHexValue.js +4 -7
  96. package/dist/build/schemas/colorToken.d.ts +20 -15
  97. package/dist/build/schemas/colorToken.js +24 -24
  98. package/dist/build/schemas/cubicBezierToken.d.ts +18 -0
  99. package/dist/build/schemas/cubicBezierToken.js +8 -0
  100. package/dist/build/schemas/designToken.js +30 -31
  101. package/dist/build/schemas/dimensionToken.d.ts +5 -5
  102. package/dist/build/schemas/dimensionToken.js +14 -17
  103. package/dist/build/schemas/dimensionValue.js +7 -10
  104. package/dist/build/schemas/durationToken.d.ts +5 -5
  105. package/dist/build/schemas/durationToken.js +8 -11
  106. package/dist/build/schemas/durationValue.js +4 -7
  107. package/dist/build/schemas/fontFamilyToken.d.ts +5 -5
  108. package/dist/build/schemas/fontFamilyToken.js +13 -16
  109. package/dist/build/schemas/fontWeightToken.d.ts +5 -5
  110. package/dist/build/schemas/fontWeightToken.js +14 -17
  111. package/dist/build/schemas/fontWeightValue.js +4 -7
  112. package/dist/build/schemas/numberToken.d.ts +5 -5
  113. package/dist/build/schemas/numberToken.js +15 -18
  114. package/dist/build/schemas/referenceValue.js +4 -7
  115. package/dist/build/schemas/scopes.js +5 -10
  116. package/dist/build/schemas/shadowToken.d.ts +5 -5
  117. package/dist/build/schemas/shadowToken.js +23 -26
  118. package/dist/build/schemas/stringToken.d.ts +5 -5
  119. package/dist/build/schemas/stringToken.js +7 -10
  120. package/dist/build/schemas/tokenName.js +4 -7
  121. package/dist/build/schemas/tokenType.d.ts +2 -2
  122. package/dist/build/schemas/tokenType.js +2 -6
  123. package/dist/build/schemas/typographyToken.d.ts +5 -5
  124. package/dist/build/schemas/typographyToken.js +14 -17
  125. package/dist/build/schemas/validTokenType.d.ts +1 -1
  126. package/dist/build/schemas/validTokenType.js +10 -13
  127. package/dist/build/schemas/viewportRangeToken.d.ts +5 -5
  128. package/dist/build/schemas/viewportRangeToken.js +7 -10
  129. package/dist/build/transformers/borderToCss.d.ts +3 -3
  130. package/dist/build/transformers/borderToCss.js +16 -16
  131. package/dist/build/transformers/colorToHex.d.ts +2 -2
  132. package/dist/build/transformers/colorToHex.js +11 -13
  133. package/dist/build/transformers/colorToHexMix.d.ts +2 -2
  134. package/dist/build/transformers/colorToHexMix.js +10 -15
  135. package/dist/build/transformers/colorToRgbAlpha.d.ts +2 -2
  136. package/dist/build/transformers/colorToRgbAlpha.js +10 -12
  137. package/dist/build/transformers/colorToRgbaFloat.d.ts +2 -2
  138. package/dist/build/transformers/colorToRgbaFloat.js +24 -28
  139. package/dist/build/transformers/cubicBezierToCss.d.ts +8 -0
  140. package/dist/build/transformers/cubicBezierToCss.js +23 -0
  141. package/dist/build/transformers/dimensionToPixelUnitless.d.ts +2 -2
  142. package/dist/build/transformers/dimensionToPixelUnitless.js +13 -14
  143. package/dist/build/transformers/dimensionToRem.d.ts +2 -2
  144. package/dist/build/transformers/dimensionToRem.js +12 -13
  145. package/dist/build/transformers/dimensionToRemPxArray.d.ts +2 -2
  146. package/dist/build/transformers/dimensionToRemPxArray.js +11 -12
  147. package/dist/build/transformers/durationToCss.d.ts +2 -2
  148. package/dist/build/transformers/durationToCss.js +9 -10
  149. package/dist/build/transformers/figmaAttributes.d.ts +2 -2
  150. package/dist/build/transformers/figmaAttributes.js +3 -5
  151. package/dist/build/transformers/floatToPixel.d.ts +4 -4
  152. package/dist/build/transformers/floatToPixel.js +12 -14
  153. package/dist/build/transformers/fontFamilyToCss.d.ts +2 -2
  154. package/dist/build/transformers/fontFamilyToCss.js +10 -13
  155. package/dist/build/transformers/fontFamilyToFigma.d.ts +3 -3
  156. package/dist/build/transformers/fontFamilyToFigma.js +15 -17
  157. package/dist/build/transformers/fontWeightToNumber.d.ts +2 -2
  158. package/dist/build/transformers/fontWeightToNumber.js +8 -11
  159. package/dist/build/transformers/index.d.ts +25 -24
  160. package/dist/build/transformers/index.js +25 -51
  161. package/dist/build/transformers/jsonDeprecated.d.ts +2 -2
  162. package/dist/build/transformers/jsonDeprecated.js +6 -8
  163. package/dist/build/transformers/namePathToCamelCase.d.ts +2 -2
  164. package/dist/build/transformers/namePathToCamelCase.js +5 -7
  165. package/dist/build/transformers/namePathToDotNotation.d.ts +2 -2
  166. package/dist/build/transformers/namePathToDotNotation.js +6 -8
  167. package/dist/build/transformers/namePathToFigma.d.ts +3 -3
  168. package/dist/build/transformers/namePathToFigma.js +5 -8
  169. package/dist/build/transformers/namePathToKebabCase.d.ts +2 -2
  170. package/dist/build/transformers/namePathToKebabCase.js +4 -6
  171. package/dist/build/transformers/namePathToPascalCase.d.ts +2 -2
  172. package/dist/build/transformers/namePathToPascalCase.js +5 -7
  173. package/dist/build/transformers/namePathToSlashNotation.d.ts +2 -2
  174. package/dist/build/transformers/namePathToSlashNotation.js +4 -6
  175. package/dist/build/transformers/shadowToCss.d.ts +2 -2
  176. package/dist/build/transformers/shadowToCss.js +14 -15
  177. package/dist/build/transformers/typographyToCss.d.ts +2 -2
  178. package/dist/build/transformers/typographyToCss.js +13 -15
  179. package/dist/build/transformers/utilities/alpha.d.ts +1 -1
  180. package/dist/build/transformers/utilities/alpha.js +4 -8
  181. package/dist/build/transformers/utilities/checkRequiredTokenProperties.js +1 -5
  182. package/dist/build/transformers/utilities/getTokenValue.d.ts +2 -2
  183. package/dist/build/transformers/utilities/getTokenValue.js +10 -12
  184. package/dist/build/transformers/utilities/hasSpaceInString.js +1 -5
  185. package/dist/build/transformers/utilities/hexToRgbaFloat.d.ts +1 -1
  186. package/dist/build/transformers/utilities/hexToRgbaFloat.js +1 -5
  187. package/dist/build/transformers/utilities/invalidTokenError.d.ts +1 -1
  188. package/dist/build/transformers/utilities/invalidTokenError.js +11 -10
  189. package/dist/build/transformers/utilities/isRgbaFloat.js +1 -5
  190. package/dist/build/transformers/utilities/mix.js +5 -7
  191. package/dist/build/transformers/utilities/rgbaFloatToHex.js +1 -5
  192. package/dist/build/types/Border.d.ts +5 -0
  193. package/dist/build/types/BorderTokenValue.d.ts +10 -0
  194. package/dist/build/types/ColorHex.d.ts +4 -0
  195. package/dist/build/types/PlatformInitializer.d.ts +11 -0
  196. package/dist/build/types/Shadow.d.ts +5 -0
  197. package/dist/build/types/ShadowTokenValue.d.ts +14 -0
  198. package/dist/build/types/SizeEm.d.ts +4 -0
  199. package/dist/build/types/SizePx.d.ts +4 -0
  200. package/dist/build/types/SizeRem.d.ts +4 -0
  201. package/dist/build/types/StyleDictionaryConfigGenerator.d.ts +15 -0
  202. package/dist/build/types/TokenBuildInput.d.ts +8 -0
  203. package/dist/build/types/TypographyTokenValue.d.ts +12 -0
  204. package/dist/build/types/w3cTransformedToken.d.ts +8 -0
  205. package/dist/build/utilities/copyFromDir.d.ts +2 -2
  206. package/dist/build/utilities/copyFromDir.js +7 -10
  207. package/dist/build/utilities/filterStringArray.js +1 -5
  208. package/dist/build/utilities/getFlag.js +1 -5
  209. package/dist/build/utilities/index.d.ts +9 -3
  210. package/dist/build/utilities/index.js +9 -9
  211. package/dist/build/utilities/joinFriendly.js +1 -5
  212. package/dist/build/utilities/schemaErrorMessage.js +1 -5
  213. package/dist/build/utilities/toCamelCase.js +5 -9
  214. package/dist/build/utilities/toPascalCase.js +5 -9
  215. package/dist/build/utilities/treeWalker.js +2 -6
  216. package/dist/build/utilities/upperCaseFirstCharacter.js +1 -5
  217. package/dist/css/functional/themes/dark-colorblind.css +56 -38
  218. package/dist/css/functional/themes/dark-dimmed.css +42 -24
  219. package/dist/css/functional/themes/dark-high-contrast.css +60 -42
  220. package/dist/css/functional/themes/dark-tritanopia.css +42 -24
  221. package/dist/css/functional/themes/dark.css +40 -22
  222. package/dist/css/functional/themes/light-colorblind.css +58 -40
  223. package/dist/css/functional/themes/light-high-contrast.css +56 -38
  224. package/dist/css/functional/themes/light-tritanopia.css +40 -22
  225. package/dist/css/functional/themes/light.css +40 -22
  226. package/dist/docs/base/size/size.json +76 -76
  227. package/dist/docs/base/typography/typography.json +16 -16
  228. package/dist/docs/functional/motion/motion.json +18 -18
  229. package/dist/docs/functional/size/border.json +56 -56
  230. package/dist/docs/functional/size/breakpoints.json +24 -24
  231. package/dist/docs/functional/size/size-coarse.json +12 -12
  232. package/dist/docs/functional/size/size-fine.json +12 -12
  233. package/dist/docs/functional/size/size.json +264 -264
  234. package/dist/docs/functional/size/viewport.json +24 -24
  235. package/dist/docs/functional/themes/dark-colorblind.json +2761 -3384
  236. package/dist/docs/functional/themes/dark-dimmed.json +2809 -3028
  237. package/dist/docs/functional/themes/dark-high-contrast.json +2806 -5113
  238. package/dist/docs/functional/themes/dark-tritanopia.json +2800 -3203
  239. package/dist/docs/functional/themes/dark.json +2779 -2520
  240. package/dist/docs/functional/themes/light-colorblind.json +2597 -3172
  241. package/dist/docs/functional/themes/light-high-contrast.json +2642 -4627
  242. package/dist/docs/functional/themes/light-tritanopia.json +2517 -2960
  243. package/dist/docs/functional/themes/light.json +2561 -2312
  244. package/dist/docs/functional/typography/typography.json +206 -206
  245. package/dist/figma/dimension/dimension.json +489 -489
  246. package/dist/figma/figma.json +19 -11
  247. package/dist/figma/scales/dark-dimmed.json +2918 -38
  248. package/dist/figma/scales/dark-high-constrast.json +2918 -38
  249. package/dist/figma/scales/dark.json +2915 -35
  250. package/dist/figma/scales/light-high-constrast.json +2920 -40
  251. package/dist/figma/scales/light.json +2920 -40
  252. package/dist/figma/shadows/dark-colorblind.json +280 -280
  253. package/dist/figma/shadows/dark-dimmed.json +280 -280
  254. package/dist/figma/shadows/dark-high-contrast.json +280 -280
  255. package/dist/figma/shadows/dark-tritanopia.json +280 -280
  256. package/dist/figma/shadows/dark.json +280 -280
  257. package/dist/figma/shadows/light-colorblind.json +281 -281
  258. package/dist/figma/shadows/light-high-contrast.json +281 -281
  259. package/dist/figma/shadows/light-tritanopia.json +281 -281
  260. package/dist/figma/shadows/light.json +281 -281
  261. package/dist/figma/themes/dark-colorblind.json +5054 -5804
  262. package/dist/figma/themes/dark-dimmed.json +5284 -5610
  263. package/dist/figma/themes/dark-high-contrast.json +4249 -6624
  264. package/dist/figma/themes/dark-tritanopia.json +5223 -5763
  265. package/dist/figma/themes/dark.json +5561 -5421
  266. package/dist/figma/themes/light-colorblind.json +4986 -5639
  267. package/dist/figma/themes/light-high-contrast.json +4166 -6213
  268. package/dist/figma/themes/light-tritanopia.json +5082 -5600
  269. package/dist/figma/themes/light.json +5418 -5277
  270. package/dist/figma/typography/typography.json +112 -156
  271. package/dist/internalCss/dark-colorblind.css +56 -38
  272. package/dist/internalCss/dark-dimmed.css +42 -24
  273. package/dist/internalCss/dark-high-contrast.css +60 -42
  274. package/dist/internalCss/dark-tritanopia.css +42 -24
  275. package/dist/internalCss/dark.css +40 -22
  276. package/dist/internalCss/light-colorblind.css +58 -40
  277. package/dist/internalCss/light-high-contrast.css +56 -38
  278. package/dist/internalCss/light-tritanopia.css +40 -22
  279. package/dist/internalCss/light.css +40 -22
  280. package/dist/styleLint/base/size/size.json +38 -38
  281. package/dist/styleLint/base/typography/typography.json +8 -8
  282. package/dist/styleLint/functional/motion/motion.json +12 -12
  283. package/dist/styleLint/functional/size/border.json +30 -30
  284. package/dist/styleLint/functional/size/breakpoints.json +12 -12
  285. package/dist/styleLint/functional/size/size-coarse.json +6 -6
  286. package/dist/styleLint/functional/size/size-fine.json +6 -6
  287. package/dist/styleLint/functional/size/size.json +132 -132
  288. package/dist/styleLint/functional/size/viewport.json +12 -12
  289. package/dist/styleLint/functional/themes/dark-colorblind.json +1642 -2265
  290. package/dist/styleLint/functional/themes/dark-dimmed.json +1726 -1945
  291. package/dist/styleLint/functional/themes/dark-high-contrast.json +1610 -3917
  292. package/dist/styleLint/functional/themes/dark-tritanopia.json +1673 -2076
  293. package/dist/styleLint/functional/themes/dark.json +1663 -1404
  294. package/dist/styleLint/functional/themes/light-colorblind.json +1418 -1993
  295. package/dist/styleLint/functional/themes/light-high-contrast.json +1504 -3489
  296. package/dist/styleLint/functional/themes/light-tritanopia.json +1397 -1840
  297. package/dist/styleLint/functional/themes/light.json +1445 -1196
  298. package/dist/styleLint/functional/typography/typography.json +114 -114
  299. package/package.json +16 -13
  300. package/src/tokens/functional/color/dark/app-dark.json5 +203 -88
  301. package/src/tokens/functional/color/dark/data-vis-dark.json5 +20 -20
  302. package/src/tokens/functional/color/dark/display-dark.json5 +95 -95
  303. package/src/tokens/functional/color/dark/overrides/dark.dimmed.json5 +0 -8
  304. package/src/tokens/functional/color/dark/overrides/dark.high-contrast.json5 +43 -30
  305. package/src/tokens/functional/color/dark/overrides/dark.protanopia-deuteranopia.json5 +62 -30
  306. package/src/tokens/functional/color/dark/overrides/dark.tritanopia.json5 +53 -12
  307. package/src/tokens/functional/color/dark/patterns-dark.json5 +4 -4
  308. package/src/tokens/functional/color/dark/primitives-dark.json5 +4 -4
  309. package/src/tokens/functional/color/light/app-light.json5 +195 -85
  310. package/src/tokens/functional/color/light/data-vis-light.json5 +20 -20
  311. package/src/tokens/functional/color/light/overrides/light.high-contrast.json5 +25 -25
  312. package/src/tokens/functional/color/light/overrides/light.protanopia-deuteranopia.json5 +65 -34
  313. package/src/tokens/functional/color/light/overrides/light.tritanopia.json5 +66 -11
  314. package/src/tokens/functional/color/light/primitives-light.json5 +2 -2
@@ -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,7 +34,7 @@ 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
40
  catch (e) {
@@ -43,8 +46,8 @@ const getTokenType = (tokenTypesPath) => {
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,7 +16,7 @@ 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
21
  catch (e) {
24
22
  throw new Error(`Invalid json5 file "${filePath}".`);
@@ -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;