@primer/primitives 9.1.2 → 10.0.0-rc.2963a70e

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 +22 -22
  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,51 +1,25 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.typographyToCss = exports.shadowToCss = exports.namePathToSlashNotation = exports.namePathToKebabCase = exports.namePathToFigma = exports.namePathToDotNotation = exports.namePathToPascalCase = exports.namePathToCamelCase = exports.jsonDeprecated = exports.fontWeightToNumber = exports.fontFamilyToFigma = exports.fontFamilyToCss = exports.figmaAttributes = exports.durationToCss = exports.dimensionToPixelUnitless = exports.dimensionToRemPxArray = exports.dimensionToRem = exports.floatToPixelUnitless = exports.floatToPixel = exports.colorToRgbaFloat = exports.colorToRgbAlpha = exports.colorToHexMix = exports.colorToHex = exports.borderToCss = void 0;
4
- var borderToCss_1 = require("./borderToCss");
5
- Object.defineProperty(exports, "borderToCss", { enumerable: true, get: function () { return borderToCss_1.borderToCss; } });
6
- var colorToHex_1 = require("./colorToHex");
7
- Object.defineProperty(exports, "colorToHex", { enumerable: true, get: function () { return colorToHex_1.colorToHex; } });
8
- var colorToHexMix_1 = require("./colorToHexMix");
9
- Object.defineProperty(exports, "colorToHexMix", { enumerable: true, get: function () { return colorToHexMix_1.colorToHexMix; } });
10
- var colorToRgbAlpha_1 = require("./colorToRgbAlpha");
11
- Object.defineProperty(exports, "colorToRgbAlpha", { enumerable: true, get: function () { return colorToRgbAlpha_1.colorToRgbAlpha; } });
12
- var colorToRgbaFloat_1 = require("./colorToRgbaFloat");
13
- Object.defineProperty(exports, "colorToRgbaFloat", { enumerable: true, get: function () { return colorToRgbaFloat_1.colorToRgbaFloat; } });
14
- var floatToPixel_1 = require("./floatToPixel");
15
- Object.defineProperty(exports, "floatToPixel", { enumerable: true, get: function () { return floatToPixel_1.floatToPixel; } });
16
- var floatToPixel_2 = require("./floatToPixel");
17
- Object.defineProperty(exports, "floatToPixelUnitless", { enumerable: true, get: function () { return floatToPixel_2.floatToPixelUnitless; } });
18
- var dimensionToRem_1 = require("./dimensionToRem");
19
- Object.defineProperty(exports, "dimensionToRem", { enumerable: true, get: function () { return dimensionToRem_1.dimensionToRem; } });
20
- var dimensionToRemPxArray_1 = require("./dimensionToRemPxArray");
21
- Object.defineProperty(exports, "dimensionToRemPxArray", { enumerable: true, get: function () { return dimensionToRemPxArray_1.dimensionToRemPxArray; } });
22
- var dimensionToPixelUnitless_1 = require("./dimensionToPixelUnitless");
23
- Object.defineProperty(exports, "dimensionToPixelUnitless", { enumerable: true, get: function () { return dimensionToPixelUnitless_1.dimensionToPixelUnitless; } });
24
- var durationToCss_1 = require("./durationToCss");
25
- Object.defineProperty(exports, "durationToCss", { enumerable: true, get: function () { return durationToCss_1.durationToCss; } });
26
- var figmaAttributes_1 = require("./figmaAttributes");
27
- Object.defineProperty(exports, "figmaAttributes", { enumerable: true, get: function () { return figmaAttributes_1.figmaAttributes; } });
28
- var fontFamilyToCss_1 = require("./fontFamilyToCss");
29
- Object.defineProperty(exports, "fontFamilyToCss", { enumerable: true, get: function () { return fontFamilyToCss_1.fontFamilyToCss; } });
30
- var fontFamilyToFigma_1 = require("./fontFamilyToFigma");
31
- Object.defineProperty(exports, "fontFamilyToFigma", { enumerable: true, get: function () { return fontFamilyToFigma_1.fontFamilyToFigma; } });
32
- var fontWeightToNumber_1 = require("./fontWeightToNumber");
33
- Object.defineProperty(exports, "fontWeightToNumber", { enumerable: true, get: function () { return fontWeightToNumber_1.fontWeightToNumber; } });
34
- var jsonDeprecated_1 = require("./jsonDeprecated");
35
- Object.defineProperty(exports, "jsonDeprecated", { enumerable: true, get: function () { return jsonDeprecated_1.jsonDeprecated; } });
36
- var namePathToCamelCase_1 = require("./namePathToCamelCase");
37
- Object.defineProperty(exports, "namePathToCamelCase", { enumerable: true, get: function () { return namePathToCamelCase_1.namePathToCamelCase; } });
38
- var namePathToPascalCase_1 = require("./namePathToPascalCase");
39
- Object.defineProperty(exports, "namePathToPascalCase", { enumerable: true, get: function () { return namePathToPascalCase_1.namePathToPascalCase; } });
40
- var namePathToDotNotation_1 = require("./namePathToDotNotation");
41
- Object.defineProperty(exports, "namePathToDotNotation", { enumerable: true, get: function () { return namePathToDotNotation_1.namePathToDotNotation; } });
42
- var namePathToFigma_1 = require("./namePathToFigma");
43
- Object.defineProperty(exports, "namePathToFigma", { enumerable: true, get: function () { return namePathToFigma_1.namePathToFigma; } });
44
- var namePathToKebabCase_1 = require("./namePathToKebabCase");
45
- Object.defineProperty(exports, "namePathToKebabCase", { enumerable: true, get: function () { return namePathToKebabCase_1.namePathToKebabCase; } });
46
- var namePathToSlashNotation_1 = require("./namePathToSlashNotation");
47
- Object.defineProperty(exports, "namePathToSlashNotation", { enumerable: true, get: function () { return namePathToSlashNotation_1.namePathToSlashNotation; } });
48
- var shadowToCss_1 = require("./shadowToCss");
49
- Object.defineProperty(exports, "shadowToCss", { enumerable: true, get: function () { return shadowToCss_1.shadowToCss; } });
50
- var typographyToCss_1 = require("./typographyToCss");
51
- Object.defineProperty(exports, "typographyToCss", { enumerable: true, get: function () { return typographyToCss_1.typographyToCss; } });
1
+ export { borderToCss } from './borderToCss.js';
2
+ export { colorToHex } from './colorToHex.js';
3
+ export { colorToHexMix } from './colorToHexMix.js';
4
+ export { colorToRgbAlpha } from './colorToRgbAlpha.js';
5
+ export { colorToRgbaFloat } from './colorToRgbaFloat.js';
6
+ export { cubicBezierToCss } from './cubicBezierToCss.js';
7
+ export { floatToPixel } from './floatToPixel.js';
8
+ export { floatToPixelUnitless } from './floatToPixel.js';
9
+ export { dimensionToRem } from './dimensionToRem.js';
10
+ export { dimensionToRemPxArray } from './dimensionToRemPxArray.js';
11
+ export { dimensionToPixelUnitless } from './dimensionToPixelUnitless.js';
12
+ export { durationToCss } from './durationToCss.js';
13
+ export { figmaAttributes } from './figmaAttributes.js';
14
+ export { fontFamilyToCss } from './fontFamilyToCss.js';
15
+ export { fontFamilyToFigma } from './fontFamilyToFigma.js';
16
+ export { fontWeightToNumber } from './fontWeightToNumber.js';
17
+ export { jsonDeprecated } from './jsonDeprecated.js';
18
+ export { namePathToCamelCase } from './namePathToCamelCase.js';
19
+ export { namePathToPascalCase } from './namePathToPascalCase.js';
20
+ export { namePathToDotNotation } from './namePathToDotNotation.js';
21
+ export { namePathToFigma } from './namePathToFigma.js';
22
+ export { namePathToKebabCase } from './namePathToKebabCase.js';
23
+ export { namePathToSlashNotation } from './namePathToSlashNotation.js';
24
+ export { shadowToCss } from './shadowToCss.js';
25
+ export { typographyToCss } from './typographyToCss.js';
@@ -1,8 +1,8 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { Transform } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description replaces tokens value with content of tokens `deprecated` property
4
4
  * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
5
  * @matcher matches all tokens with a `deprecated` property
6
6
  * @transformer returns `string` specified in `token.deprecated` or `null`
7
7
  */
8
- export declare const jsonDeprecated: StyleDictionary.Transform;
8
+ export declare const jsonDeprecated: Transform;
@@ -1,16 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jsonDeprecated = void 0;
4
- const filters_1 = require("../filters");
1
+ import { isDeprecated } from '../filters/index.js';
5
2
  /**
6
3
  * @description replaces tokens value with content of tokens `deprecated` property
7
4
  * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
8
5
  * @matcher matches all tokens with a `deprecated` property
9
6
  * @transformer returns `string` specified in `token.deprecated` or `null`
10
7
  */
11
- exports.jsonDeprecated = {
12
- type: `value`,
8
+ export const jsonDeprecated = {
9
+ name: 'json/deprecated',
10
+ type: 'value',
13
11
  transitive: true,
14
- matcher: filters_1.isDeprecated,
15
- transformer: (token) => typeof token.deprecated === 'string' ? token.deprecated.replace(/[{}]/g, '') : null,
12
+ filter: isDeprecated,
13
+ transform: (token) => typeof token.deprecated === 'string' ? token.deprecated.replace(/[{}]/g, '') : null,
16
14
  };
@@ -1,8 +1,8 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { Transform } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description converts the [TransformedToken's](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts) `.path` array to a camelCase string, preserves casing of parts
4
4
  * @type name transformer — [StyleDictionary.NameTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
5
  * @matcher omitted to match all tokens
6
6
  * @transformer returns `string` camelCase
7
7
  */
8
- export declare const namePathToCamelCase: StyleDictionary.Transform;
8
+ export declare const namePathToCamelCase: Transform;
@@ -1,14 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.namePathToCamelCase = void 0;
4
- const utilities_1 = require("../utilities");
1
+ import { toCamelCase } from '../utilities/index.js';
5
2
  /**
6
3
  * @description converts the [TransformedToken's](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts) `.path` array to a camelCase string, preserves casing of parts
7
4
  * @type name transformer — [StyleDictionary.NameTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
8
5
  * @matcher omitted to match all tokens
9
6
  * @transformer returns `string` camelCase
10
7
  */
11
- exports.namePathToCamelCase = {
12
- type: `name`,
13
- transformer: (token, options) => (0, utilities_1.toCamelCase)([(options === null || options === void 0 ? void 0 : options.prefix) || '', ...token.path]),
8
+ export const namePathToCamelCase = {
9
+ name: 'name/pathToCamelCase',
10
+ type: 'name',
11
+ transform: (token, options) => toCamelCase([(options === null || options === void 0 ? void 0 : options.prefix) || '', ...token.path]),
14
12
  };
@@ -1,8 +1,8 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { Transform } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description converts the [TransformedToken's](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts) `.path` array to a dot.notation string
4
4
  * @type name transformer — [StyleDictionary.NameTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
5
  * @matcher omitted to match all tokens
6
6
  * @transformer returns `string` in dot.notation
7
7
  */
8
- export declare const namePathToDotNotation: StyleDictionary.Transform;
8
+ export declare const namePathToDotNotation: Transform;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.namePathToDotNotation = void 0;
4
- const utilities_1 = require("../utilities");
1
+ import { upperCaseFirstCharacter } from '../utilities/index.js';
5
2
  /**
6
3
  * camelCase
7
4
  * @scope custom camelCase implementation should only be used within `name path to dot notation` transformer
@@ -12,7 +9,7 @@ const utilities_1 = require("../utilities");
12
9
  const camelCase = (string) => {
13
10
  return string
14
11
  .split(/[\s-_+]+/g)
15
- .map((stringPart, index) => (index === 0 ? stringPart : (0, utilities_1.upperCaseFirstCharacter)(stringPart)))
12
+ .map((stringPart, index) => (index === 0 ? stringPart : upperCaseFirstCharacter(stringPart)))
16
13
  .join('');
17
14
  };
18
15
  /**
@@ -21,9 +18,10 @@ const camelCase = (string) => {
21
18
  * @matcher omitted to match all tokens
22
19
  * @transformer returns `string` in dot.notation
23
20
  */
24
- exports.namePathToDotNotation = {
25
- type: `name`,
26
- transformer: (token, options) => {
21
+ export const namePathToDotNotation = {
22
+ name: 'name/pathToDotNotation',
23
+ type: 'name',
24
+ transform: (token, options) => {
27
25
  return ([options === null || options === void 0 ? void 0 : options.prefix, ...token.path]
28
26
  // remove undefined if exists
29
27
  .filter((part) => typeof part === 'string' && part !== '@')
@@ -1,9 +1,9 @@
1
- import type StyleDictionary from 'style-dictionary';
2
- export declare const transformNamePathToFigma: (token: StyleDictionary.TransformedToken, options?: StyleDictionary.Platform) => string;
1
+ import type { PlatformConfig, Transform, TransformedToken } from 'style-dictionary/types';
2
+ export declare const transformNamePathToFigma: (token: TransformedToken, options?: PlatformConfig) => string;
3
3
  /**
4
4
  * @description converts the [TransformedToken's](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts) `.path` array to a specific figma name
5
5
  * @type name transformer — [StyleDictionary.NameTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
6
6
  * @matcher omitted to match all tokens
7
7
  * @transformer returns `string`
8
8
  */
9
- export declare const namePathToFigma: StyleDictionary.Transform;
9
+ export declare const namePathToFigma: Transform;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.namePathToFigma = exports.transformNamePathToFigma = void 0;
4
- const transformNamePathToFigma = (token, options) => {
1
+ export const transformNamePathToFigma = (token, options) => {
5
2
  let pathArray = token.path.filter((part) => part !== '@');
6
3
  if (['fgColor', 'borderColor', 'bgColor'].includes(pathArray[0]) && pathArray.length === 3) {
7
4
  pathArray = [pathArray[0], `${pathArray[1]}-${pathArray[2]}`];
@@ -11,14 +8,14 @@ const transformNamePathToFigma = (token, options) => {
11
8
  .filter((part) => typeof part === 'string' && part !== '@')
12
9
  .join('/'));
13
10
  };
14
- exports.transformNamePathToFigma = transformNamePathToFigma;
15
11
  /**
16
12
  * @description converts the [TransformedToken's](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts) `.path` array to a specific figma name
17
13
  * @type name transformer — [StyleDictionary.NameTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
18
14
  * @matcher omitted to match all tokens
19
15
  * @transformer returns `string`
20
16
  */
21
- exports.namePathToFigma = {
22
- type: `name`,
23
- transformer: exports.transformNamePathToFigma,
17
+ export const namePathToFigma = {
18
+ name: 'name/pathToFigma',
19
+ type: 'name',
20
+ transform: transformNamePathToFigma,
24
21
  };
@@ -1,8 +1,8 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { Transform } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description converts the [TransformedToken's](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts) `.path` array to a kebab-case string, preserves casing of parts
4
4
  * @type name transformer — [StyleDictionary.NameTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
5
  * @matcher omitted to match all tokens
6
6
  * @transformer returns `string` kebab-case
7
7
  */
8
- export declare const namePathToKebabCase: StyleDictionary.Transform;
8
+ export declare const namePathToKebabCase: Transform;
@@ -1,15 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.namePathToKebabCase = void 0;
4
1
  /**
5
2
  * @description converts the [TransformedToken's](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts) `.path` array to a kebab-case string, preserves casing of parts
6
3
  * @type name transformer — [StyleDictionary.NameTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
7
4
  * @matcher omitted to match all tokens
8
5
  * @transformer returns `string` kebab-case
9
6
  */
10
- exports.namePathToKebabCase = {
11
- type: `name`,
12
- transformer: (token, options) => {
7
+ export const namePathToKebabCase = {
8
+ name: 'name/pathToKebabCase',
9
+ type: 'name',
10
+ transform: (token, options) => {
13
11
  return ([options === null || options === void 0 ? void 0 : options.prefix, ...token.path]
14
12
  // remove undefined if exists
15
13
  .filter((part) => typeof part === 'string' && part !== '@')
@@ -1,8 +1,8 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { Transform } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description converts the [TransformedToken's](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts) `.path` array to a PascalCase string, preserves casing of parts
4
4
  * @type name transformer — [StyleDictionary.NameTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
5
  * @matcher omitted to match all tokens
6
6
  * @transformer returns `string` PascalCase
7
7
  */
8
- export declare const namePathToPascalCase: StyleDictionary.Transform;
8
+ export declare const namePathToPascalCase: Transform;
@@ -1,14 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.namePathToPascalCase = void 0;
4
- const toPascalCase_1 = require("../utilities/toPascalCase");
1
+ import { toPascalCase } from '../utilities/index.js';
5
2
  /**
6
3
  * @description converts the [TransformedToken's](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts) `.path` array to a PascalCase string, preserves casing of parts
7
4
  * @type name transformer — [StyleDictionary.NameTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
8
5
  * @matcher omitted to match all tokens
9
6
  * @transformer returns `string` PascalCase
10
7
  */
11
- exports.namePathToPascalCase = {
12
- type: `name`,
13
- transformer: (token, options) => (0, toPascalCase_1.toPascalCase)([(options === null || options === void 0 ? void 0 : options.prefix) || '', ...token.path]),
8
+ export const namePathToPascalCase = {
9
+ name: 'name/pathToPascalCase',
10
+ type: 'name',
11
+ transform: (token, options) => toPascalCase([(options === null || options === void 0 ? void 0 : options.prefix) || '', ...token.path]),
14
12
  };
@@ -1,8 +1,8 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { Transform } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description converts the [TransformedToken's](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts) `.path` array to a slash/notation string
4
4
  * @type name transformer — [StyleDictionary.NameTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
5
  * @matcher omitted to match all tokens
6
6
  * @transformer returns `string` on slash/notation
7
7
  */
8
- export declare const namePathToSlashNotation: StyleDictionary.Transform;
8
+ export declare const namePathToSlashNotation: Transform;
@@ -1,15 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.namePathToSlashNotation = void 0;
4
1
  /**
5
2
  * @description converts the [TransformedToken's](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts) `.path` array to a slash/notation string
6
3
  * @type name transformer — [StyleDictionary.NameTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
7
4
  * @matcher omitted to match all tokens
8
5
  * @transformer returns `string` on slash/notation
9
6
  */
10
- exports.namePathToSlashNotation = {
11
- type: `name`,
12
- transformer: (token, options) => {
7
+ export const namePathToSlashNotation = {
8
+ name: 'name/pathToSlashNotation',
9
+ type: 'name',
10
+ transform: (token, options) => {
13
11
  return ([options === null || options === void 0 ? void 0 : options.prefix, ...token.path]
14
12
  // remove undefined if exists
15
13
  .filter((part) => typeof part === 'string' && part !== '@')
@@ -1,8 +1,8 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { Transform } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description converts w3c shadow tokens in css shadow string
4
4
  * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
5
  * @matcher matches all tokens of $type `shadow`
6
6
  * @transformer returns css shadow `string`
7
7
  */
8
- export declare const shadowToCss: StyleDictionary.Transform;
8
+ export declare const shadowToCss: Transform;
@@ -1,24 +1,23 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.shadowToCss = void 0;
4
- const color2k_1 = require("color2k");
5
- const filters_1 = require("../filters");
6
- const alpha_1 = require("./utilities/alpha");
7
- const checkRequiredTokenProperties_1 = require("./utilities/checkRequiredTokenProperties");
8
- const getTokenValue_1 = require("./utilities/getTokenValue");
1
+ import { toHex } from 'color2k';
2
+ import { isShadow } from '../filters/index.js';
3
+ import { alpha } from './utilities/alpha.js';
4
+ import { checkRequiredTokenProperties } from './utilities/checkRequiredTokenProperties.js';
5
+ import { getTokenValue } from './utilities/getTokenValue.js';
9
6
  /**
10
7
  * @description converts w3c shadow tokens in css shadow string
11
8
  * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
12
9
  * @matcher matches all tokens of $type `shadow`
13
10
  * @transformer returns css shadow `string`
14
11
  */
15
- exports.shadowToCss = {
16
- type: `value`,
12
+ export const shadowToCss = {
13
+ name: 'shadow/css',
14
+ type: 'value',
17
15
  transitive: true,
18
- matcher: filters_1.isShadow,
19
- transformer: (token) => {
16
+ filter: isShadow,
17
+ transform: (token) => {
20
18
  // extract value
21
- const { value } = token;
19
+ const value = getTokenValue(token);
20
+ const valueProp = token.$value ? '$value' : 'value';
22
21
  // turn value into array
23
22
  const shadowValues = !Array.isArray(value) ? [value] : value;
24
23
  return shadowValues
@@ -26,9 +25,9 @@ exports.shadowToCss = {
26
25
  // if value === string it was probably already transformed
27
26
  if (typeof shadow === 'string')
28
27
  return shadow;
29
- (0, checkRequiredTokenProperties_1.checkRequiredTokenProperties)(shadow, ['color', 'offsetX', 'offsetY', 'blur', 'spread']);
28
+ checkRequiredTokenProperties(shadow, ['color', 'offsetX', 'offsetY', 'blur', 'spread']);
30
29
  /*css box shadow: inset? | offset-x | offset-y | blur-radius | spread-radius | color */
31
- return `${shadow.inset === true ? 'inset ' : ''}${shadow.offsetX} ${shadow.offsetY} ${shadow.blur} ${shadow.spread} ${(0, color2k_1.toHex)((0, alpha_1.alpha)((0, getTokenValue_1.getTokenValue)(Object.assign(Object.assign({}, token), { value: shadow }), 'color'), shadow.alpha || 1, token))}`;
30
+ return `${shadow.inset === true ? 'inset ' : ''}${shadow.offsetX} ${shadow.offsetY} ${shadow.blur} ${shadow.spread} ${toHex(alpha(getTokenValue(Object.assign(Object.assign({}, token), { [valueProp]: shadow }), 'color'), shadow.alpha || 1, token))}`;
32
31
  })
33
32
  .join(', ');
34
33
  },
@@ -1,8 +1,8 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { Transform } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description converts typograhy token value to css font shorthand
4
4
  * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
5
  * @matcher matches all tokens of $type `typography`
6
6
  * @transformer returns a css font string
7
7
  */
8
- export declare const typographyToCss: StyleDictionary.Transform;
8
+ export declare const typographyToCss: Transform;
@@ -1,28 +1,26 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.typographyToCss = void 0;
4
- const filters_1 = require("../filters");
5
- const checkRequiredTokenProperties_1 = require("./utilities/checkRequiredTokenProperties");
6
- const fontFamilyToCss_1 = require("./fontFamilyToCss");
7
- const fontWeightToNumber_1 = require("./fontWeightToNumber");
8
- const getTokenValue_1 = require("./utilities/getTokenValue");
1
+ import { isTypography } from '../filters/index.js';
2
+ import { checkRequiredTokenProperties } from './utilities/checkRequiredTokenProperties.js';
3
+ import { parseFontFamily } from './fontFamilyToCss.js';
4
+ import { parseFontWeight } from './fontWeightToNumber.js';
5
+ import { getTokenValue } from './utilities/getTokenValue.js';
9
6
  /**
10
7
  * @description converts typograhy token value to css font shorthand
11
8
  * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
12
9
  * @matcher matches all tokens of $type `typography`
13
10
  * @transformer returns a css font string
14
11
  */
15
- exports.typographyToCss = {
16
- type: `value`,
12
+ export const typographyToCss = {
13
+ name: 'typography/css',
14
+ type: 'value',
17
15
  transitive: true,
18
- matcher: filters_1.isTypography,
19
- transformer: (token) => {
16
+ filter: isTypography,
17
+ transform: (token) => {
20
18
  // extract value
21
- const value = (0, getTokenValue_1.getTokenValue)(token);
19
+ const value = getTokenValue(token);
22
20
  // validate token properties
23
- (0, checkRequiredTokenProperties_1.checkRequiredTokenProperties)(value, ['fontWeight', 'fontSize', 'fontFamily']);
21
+ checkRequiredTokenProperties(value, ['fontWeight', 'fontSize', 'fontFamily']);
24
22
  // format output
25
- return `${value.fontStyle || ''} ${(0, fontWeightToNumber_1.parseFontWeight)((0, getTokenValue_1.getTokenValue)(token, 'fontWeight'))} ${value.fontSize}${value.lineHeight ? `/${value.lineHeight}` : ''} ${(0, fontFamilyToCss_1.parseFontFamily)((0, getTokenValue_1.getTokenValue)(token, 'fontFamily'))}`
23
+ return `${value.fontStyle || ''} ${parseFontWeight(getTokenValue(token, 'fontWeight'))} ${value.fontSize}${value.lineHeight ? `/${value.lineHeight}` : ''} ${parseFontFamily(getTokenValue(token, 'fontFamily'))}`
26
24
  .trim()
27
25
  .replace(/\s\s+/g, ' ');
28
26
  },
@@ -1,4 +1,4 @@
1
- import type { TransformedToken } from 'style-dictionary';
1
+ import type { TransformedToken } from 'style-dictionary/types';
2
2
  /**
3
3
  * alpha
4
4
  * @description takes a colors string like hex or rgba and returns an rgba color with the specified alpha value
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.alpha = void 0;
4
- const color2k_1 = require("color2k");
1
+ import { rgba, parseToRgba } from 'color2k';
5
2
  /**
6
3
  * alpha
7
4
  * @description takes a colors string like hex or rgba and returns an rgba color with the specified alpha value
@@ -9,12 +6,11 @@ const color2k_1 = require("color2k");
9
6
  * @param desiredAlpha number
10
7
  * @returns rgba value
11
8
  */
12
- const alpha = (color, desiredAlpha, token) => {
13
- const [r, g, b, a] = (0, color2k_1.parseToRgba)(color);
9
+ export const alpha = (color, desiredAlpha, token) => {
10
+ const [r, g, b, a] = parseToRgba(color);
14
11
  if (a < 1 && desiredAlpha < 1) {
15
12
  // eslint-disable-next-line no-console
16
13
  console.warn(`🚨 You are setting an alpha value of "${desiredAlpha}" for a color with an alpha value (${color}). The previous alpha value will be disregarded as if the color would have been 100% opaque.${token !== undefined ? `\n ↳ Token: "${token.name}" in file: "${token.filePath}"` : ''}`);
17
14
  }
18
- return (0, color2k_1.rgba)(r, g, b, desiredAlpha);
15
+ return rgba(r, g, b, desiredAlpha);
19
16
  };
20
- exports.alpha = alpha;
@@ -1,17 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkRequiredTokenProperties = void 0;
4
1
  /**
5
2
  * checks if all required properties exist on token
6
3
  * @param object - tokenValue
7
4
  * @param array - property names
8
5
  * @returns void or throws error
9
6
  */
10
- const checkRequiredTokenProperties = (tokenValue, requiredProperties) => {
7
+ export const checkRequiredTokenProperties = (tokenValue, requiredProperties) => {
11
8
  for (const prop of requiredProperties) {
12
9
  if (prop in tokenValue === false) {
13
10
  throw new Error(`Missing property: ${prop} on token with value ${JSON.stringify(tokenValue)}`);
14
11
  }
15
12
  }
16
13
  };
17
- exports.checkRequiredTokenProperties = checkRequiredTokenProperties;
@@ -1,2 +1,2 @@
1
- import type StyleDictionary from 'style-dictionary';
2
- export declare const getTokenValue: (token: StyleDictionary.TransformedToken, property?: string) => any;
1
+ import type { TransformedToken } from 'style-dictionary/types';
2
+ export declare const getTokenValue: (token: TransformedToken, property?: string) => any;
@@ -1,18 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTokenValue = void 0;
4
- const invalidTokenError_1 = require("./invalidTokenError");
5
- const getTokenValue = (token, property) => {
6
- if (token.value === undefined) {
7
- throw new invalidTokenError_1.invalidTokenValueError(token);
1
+ import { invalidTokenValueError, invalidTokenValuePropertyError } from './invalidTokenError.js';
2
+ export const getTokenValue = (token, property) => {
3
+ var _a;
4
+ const value = (_a = token.$value) !== null && _a !== void 0 ? _a : token.value;
5
+ if (value === undefined) {
6
+ throw new invalidTokenValueError(token);
8
7
  }
9
8
  // for composite token if subproperty is needed
10
- if (typeof property === 'string' && token.value[property] === undefined) {
11
- throw new invalidTokenError_1.invalidTokenValuePropertyError(token, property);
9
+ if (typeof property === 'string' && value[property] === undefined) {
10
+ throw new invalidTokenValuePropertyError(token, property);
12
11
  }
13
12
  if (typeof property === 'string') {
14
- return token.value[property];
13
+ return value[property];
15
14
  }
16
- return token.value;
15
+ return value;
17
16
  };
18
- exports.getTokenValue = getTokenValue;
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hasSpaceInString = void 0;
4
- const hasSpaceInString = (string) => {
1
+ export const hasSpaceInString = (string) => {
5
2
  if (typeof string !== 'string') {
6
3
  throw new TypeError(`Invalid input. Input must be a string, ${typeof string} provided`);
7
4
  }
8
5
  return /\s/g.test(string);
9
6
  };
10
- exports.hasSpaceInString = hasSpaceInString;
@@ -1,2 +1,2 @@
1
- import type { RgbaFloat } from './isRgbaFloat';
1
+ import type { RgbaFloat } from './isRgbaFloat.js';
2
2
  export declare const hexToRgbaFloat: (hex: string, alpha?: number) => RgbaFloat;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hexToRgbaFloat = void 0;
4
- const hexToRgbaFloat = (hex, alpha) => {
1
+ export const hexToRgbaFloat = (hex, alpha) => {
5
2
  // retrieve spots from hex value (hex 3, hex 4, hex 6 or hex 8)
6
3
  let result;
7
4
  if (hex.length > 5) {
@@ -30,4 +27,3 @@ const hexToRgbaFloat = (hex, alpha) => {
30
27
  a: alpha !== undefined ? alpha : result[4] ? parseInt(result[4], 16) / 255 : 1,
31
28
  };
32
29
  };
33
- exports.hexToRgbaFloat = hexToRgbaFloat;
@@ -1,4 +1,4 @@
1
- import type { TransformedToken } from 'style-dictionary';
1
+ import type { TransformedToken } from 'style-dictionary/types';
2
2
  export declare class invalidTokenValueError extends Error {
3
3
  constructor(token: TransformedToken);
4
4
  }