@primer/primitives 10.0.0-rc.fd912e08 → 10.0.0

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 (339) hide show
  1. package/README.md +2 -2
  2. package/dist/build/PrimerStyleDictionary.d.ts +8 -0
  3. package/dist/build/PrimerStyleDictionary.js +80 -0
  4. package/dist/build/filters/index.d.ts +14 -0
  5. package/dist/build/filters/index.js +14 -0
  6. package/dist/build/filters/isBorder.d.ts +7 -0
  7. package/dist/build/filters/isBorder.js +8 -0
  8. package/dist/build/filters/isColor.d.ts +7 -0
  9. package/dist/build/filters/isColor.js +13 -0
  10. package/dist/build/filters/isColorWithAlpha.d.ts +7 -0
  11. package/dist/build/filters/isColorWithAlpha.js +9 -0
  12. package/dist/build/filters/isColorWithMix.d.ts +7 -0
  13. package/dist/build/filters/isColorWithMix.js +24 -0
  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 +7 -0
  17. package/dist/build/filters/isDeprecated.js +8 -0
  18. package/dist/build/filters/isDimension.d.ts +7 -0
  19. package/dist/build/filters/isDimension.js +8 -0
  20. package/dist/build/filters/isDuration.d.ts +7 -0
  21. package/dist/build/filters/isDuration.js +8 -0
  22. package/dist/build/filters/isFontFamily.d.ts +7 -0
  23. package/dist/build/filters/isFontFamily.js +8 -0
  24. package/dist/build/filters/isFontWeight.d.ts +7 -0
  25. package/dist/build/filters/isFontWeight.js +8 -0
  26. package/dist/build/filters/isFromFile.d.ts +8 -0
  27. package/dist/build/filters/isFromFile.js +10 -0
  28. package/dist/build/filters/isNumber.d.ts +7 -0
  29. package/dist/build/filters/isNumber.js +8 -0
  30. package/dist/build/filters/isShadow.d.ts +7 -0
  31. package/dist/build/filters/isShadow.js +8 -0
  32. package/dist/build/filters/isSource.d.ts +7 -0
  33. package/dist/build/filters/isSource.js +8 -0
  34. package/dist/build/filters/isTypography.d.ts +7 -0
  35. package/dist/build/filters/isTypography.js +8 -0
  36. package/dist/build/formats/cssAdvanced.d.ts +2 -0
  37. package/dist/build/formats/cssAdvanced.js +86 -0
  38. package/dist/build/formats/cssCustomMedia.d.ts +7 -0
  39. package/dist/build/formats/cssCustomMedia.js +26 -0
  40. package/dist/build/formats/index.d.ts +9 -0
  41. package/dist/build/formats/index.js +9 -0
  42. package/dist/build/formats/javascriptCommonJs.d.ts +7 -0
  43. package/dist/build/formats/javascriptCommonJs.js +26 -0
  44. package/dist/build/formats/javascriptEsm.d.ts +7 -0
  45. package/dist/build/formats/javascriptEsm.js +26 -0
  46. package/dist/build/formats/jsonFigma.d.ts +7 -0
  47. package/dist/build/formats/jsonFigma.js +121 -0
  48. package/dist/build/formats/jsonNestedPrefixed.d.ts +8 -0
  49. package/dist/build/formats/jsonNestedPrefixed.js +30 -0
  50. package/dist/build/formats/jsonOneDimensional.d.ts +8 -0
  51. package/dist/build/formats/jsonOneDimensional.js +32 -0
  52. package/dist/build/formats/jsonPostCssFallback.d.ts +8 -0
  53. package/dist/build/formats/jsonPostCssFallback.js +14 -0
  54. package/dist/build/formats/typescriptExportDefinition.d.ts +7 -0
  55. package/dist/build/formats/typescriptExportDefinition.js +170 -0
  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 +11 -0
  59. package/dist/build/formats/utilities/jsonToFlat.js +8 -0
  60. package/dist/build/formats/utilities/jsonToNestedValue.d.ts +8 -0
  61. package/dist/build/formats/utilities/jsonToNestedValue.js +23 -0
  62. package/dist/build/formats/utilities/prefixTokens.d.ts +8 -0
  63. package/dist/build/formats/utilities/prefixTokens.js +13 -0
  64. package/dist/build/parsers/index.d.ts +1 -0
  65. package/dist/build/parsers/index.js +1 -0
  66. package/dist/build/parsers/w3cJsonParser.d.ts +6 -0
  67. package/dist/build/parsers/w3cJsonParser.js +25 -0
  68. package/dist/build/platforms/css.d.ts +2 -0
  69. package/dist/build/platforms/css.js +96 -0
  70. package/dist/build/platforms/deprecatedJson.d.ts +2 -0
  71. package/dist/build/platforms/deprecatedJson.js +13 -0
  72. package/dist/build/platforms/docJson.d.ts +2 -0
  73. package/dist/build/platforms/docJson.js +35 -0
  74. package/dist/build/platforms/fallbacks.d.ts +2 -0
  75. package/dist/build/platforms/fallbacks.js +30 -0
  76. package/dist/build/platforms/figma.d.ts +2 -0
  77. package/dist/build/platforms/figma.js +60 -0
  78. package/dist/build/platforms/index.d.ts +10 -0
  79. package/dist/build/platforms/index.js +10 -0
  80. package/dist/build/platforms/javascript.d.ts +2 -0
  81. package/dist/build/platforms/javascript.js +26 -0
  82. package/dist/build/platforms/json.d.ts +2 -0
  83. package/dist/build/platforms/json.js +28 -0
  84. package/dist/build/platforms/styleLint.d.ts +2 -0
  85. package/dist/build/platforms/styleLint.js +30 -0
  86. package/dist/build/platforms/typeDefinitions.d.ts +2 -0
  87. package/dist/build/platforms/typeDefinitions.js +26 -0
  88. package/dist/build/platforms/typescript.d.ts +2 -0
  89. package/dist/build/platforms/typescript.js +26 -0
  90. package/dist/build/schemas/alphaValue.d.ts +2 -0
  91. package/dist/build/schemas/alphaValue.js +5 -0
  92. package/dist/build/schemas/baseToken.d.ts +11 -0
  93. package/dist/build/schemas/baseToken.js +7 -0
  94. package/dist/build/schemas/borderToken.d.ts +51 -0
  95. package/dist/build/schemas/borderToken.js +17 -0
  96. package/dist/build/schemas/collections.d.ts +6 -0
  97. package/dist/build/schemas/collections.js +12 -0
  98. package/dist/build/schemas/colorHexValue.d.ts +2 -0
  99. package/dist/build/schemas/colorHexValue.js +9 -0
  100. package/dist/build/schemas/colorToken.d.ts +92 -0
  101. package/dist/build/schemas/colorToken.js +53 -0
  102. package/dist/build/schemas/cubicBezierToken.d.ts +18 -0
  103. package/dist/build/schemas/cubicBezierToken.js +8 -0
  104. package/dist/build/schemas/designToken.d.ts +2 -0
  105. package/dist/build/schemas/designToken.js +35 -0
  106. package/dist/build/schemas/dimensionToken.d.ts +59 -0
  107. package/dist/build/schemas/dimensionToken.js +34 -0
  108. package/dist/build/schemas/dimensionValue.d.ts +2 -0
  109. package/dist/build/schemas/dimensionValue.js +9 -0
  110. package/dist/build/schemas/durationToken.d.ts +18 -0
  111. package/dist/build/schemas/durationToken.js +11 -0
  112. package/dist/build/schemas/durationValue.d.ts +2 -0
  113. package/dist/build/schemas/durationValue.js +5 -0
  114. package/dist/build/schemas/fontFamilyToken.d.ts +52 -0
  115. package/dist/build/schemas/fontFamilyToken.js +20 -0
  116. package/dist/build/schemas/fontWeightToken.d.ts +52 -0
  117. package/dist/build/schemas/fontWeightToken.js +21 -0
  118. package/dist/build/schemas/fontWeightValue.d.ts +2 -0
  119. package/dist/build/schemas/fontWeightValue.js +6 -0
  120. package/dist/build/schemas/numberToken.d.ts +71 -0
  121. package/dist/build/schemas/numberToken.js +27 -0
  122. package/dist/build/schemas/referenceValue.d.ts +2 -0
  123. package/dist/build/schemas/referenceValue.js +5 -0
  124. package/dist/build/schemas/scopes.d.ts +5 -0
  125. package/dist/build/schemas/scopes.js +29 -0
  126. package/dist/build/schemas/shadowToken.d.ts +164 -0
  127. package/dist/build/schemas/shadowToken.js +46 -0
  128. package/dist/build/schemas/stringToken.d.ts +18 -0
  129. package/dist/build/schemas/stringToken.js +10 -0
  130. package/dist/build/schemas/tokenName.d.ts +2 -0
  131. package/dist/build/schemas/tokenName.js +5 -0
  132. package/dist/build/schemas/tokenType.d.ts +3 -0
  133. package/dist/build/schemas/tokenType.js +2 -0
  134. package/dist/build/schemas/typographyToken.d.ts +59 -0
  135. package/dist/build/schemas/typographyToken.js +18 -0
  136. package/dist/build/schemas/validTokenType.d.ts +5 -0
  137. package/dist/build/schemas/validTokenType.js +31 -0
  138. package/dist/build/schemas/viewportRangeToken.d.ts +18 -0
  139. package/dist/build/schemas/viewportRangeToken.js +10 -0
  140. package/dist/build/transformers/borderToCss.d.ts +8 -0
  141. package/dist/build/transformers/borderToCss.js +38 -0
  142. package/dist/build/transformers/colorToHex.d.ts +8 -0
  143. package/dist/build/transformers/colorToHex.js +24 -0
  144. package/dist/build/transformers/colorToHexMix.d.ts +8 -0
  145. package/dist/build/transformers/colorToHexMix.js +20 -0
  146. package/dist/build/transformers/colorToRgbAlpha.d.ts +8 -0
  147. package/dist/build/transformers/colorToRgbAlpha.js +20 -0
  148. package/dist/build/transformers/colorToRgbaFloat.d.ts +8 -0
  149. package/dist/build/transformers/colorToRgbaFloat.js +46 -0
  150. package/dist/build/transformers/cubicBezierToCss.d.ts +8 -0
  151. package/dist/build/transformers/cubicBezierToCss.js +23 -0
  152. package/dist/build/transformers/dimensionToPixelUnitless.d.ts +8 -0
  153. package/dist/build/transformers/dimensionToPixelUnitless.js +49 -0
  154. package/dist/build/transformers/dimensionToRem.d.ts +8 -0
  155. package/dist/build/transformers/dimensionToRem.js +46 -0
  156. package/dist/build/transformers/dimensionToRemPxArray.d.ts +8 -0
  157. package/dist/build/transformers/dimensionToRemPxArray.js +46 -0
  158. package/dist/build/transformers/durationToCss.d.ts +8 -0
  159. package/dist/build/transformers/durationToCss.js +29 -0
  160. package/dist/build/transformers/figmaAttributes.d.ts +8 -0
  161. package/dist/build/transformers/figmaAttributes.js +55 -0
  162. package/dist/build/transformers/floatToPixel.d.ts +15 -0
  163. package/dist/build/transformers/floatToPixel.js +39 -0
  164. package/dist/build/transformers/fontFamilyToCss.d.ts +14 -0
  165. package/dist/build/transformers/fontFamilyToCss.js +37 -0
  166. package/dist/build/transformers/fontFamilyToFigma.d.ts +14 -0
  167. package/dist/build/transformers/fontFamilyToFigma.js +44 -0
  168. package/dist/build/transformers/fontWeightToNumber.d.ts +9 -0
  169. package/dist/build/transformers/fontWeightToNumber.js +50 -0
  170. package/dist/build/transformers/index.d.ts +25 -0
  171. package/dist/build/transformers/index.js +25 -0
  172. package/dist/build/transformers/jsonDeprecated.d.ts +8 -0
  173. package/dist/build/transformers/jsonDeprecated.js +14 -0
  174. package/dist/build/transformers/namePathToCamelCase.d.ts +8 -0
  175. package/dist/build/transformers/namePathToCamelCase.js +12 -0
  176. package/dist/build/transformers/namePathToDotNotation.d.ts +8 -0
  177. package/dist/build/transformers/namePathToDotNotation.js +31 -0
  178. package/dist/build/transformers/namePathToFigma.d.ts +9 -0
  179. package/dist/build/transformers/namePathToFigma.js +21 -0
  180. package/dist/build/transformers/namePathToKebabCase.d.ts +8 -0
  181. package/dist/build/transformers/namePathToKebabCase.js +16 -0
  182. package/dist/build/transformers/namePathToPascalCase.d.ts +8 -0
  183. package/dist/build/transformers/namePathToPascalCase.js +12 -0
  184. package/dist/build/transformers/namePathToSlashNotation.d.ts +8 -0
  185. package/dist/build/transformers/namePathToSlashNotation.js +16 -0
  186. package/dist/build/transformers/shadowToCss.d.ts +8 -0
  187. package/dist/build/transformers/shadowToCss.js +34 -0
  188. package/dist/build/transformers/typographyToCss.d.ts +8 -0
  189. package/dist/build/transformers/typographyToCss.js +27 -0
  190. package/dist/build/transformers/utilities/alpha.d.ts +9 -0
  191. package/dist/build/transformers/utilities/alpha.js +16 -0
  192. package/dist/build/transformers/utilities/checkRequiredTokenProperties.d.ts +7 -0
  193. package/dist/build/transformers/utilities/checkRequiredTokenProperties.js +13 -0
  194. package/dist/build/transformers/utilities/getTokenValue.d.ts +2 -0
  195. package/dist/build/transformers/utilities/getTokenValue.js +16 -0
  196. package/dist/build/transformers/utilities/hasSpaceInString.d.ts +1 -0
  197. package/dist/build/transformers/utilities/hasSpaceInString.js +6 -0
  198. package/dist/build/transformers/utilities/hexToRgbaFloat.d.ts +2 -0
  199. package/dist/build/transformers/utilities/hexToRgbaFloat.js +29 -0
  200. package/dist/build/transformers/utilities/invalidTokenError.d.ts +7 -0
  201. package/dist/build/transformers/utilities/invalidTokenError.js +27 -0
  202. package/dist/build/transformers/utilities/isRgbaFloat.d.ts +7 -0
  203. package/dist/build/transformers/utilities/isRgbaFloat.js +20 -0
  204. package/dist/build/transformers/utilities/mix.d.ts +5 -0
  205. package/dist/build/transformers/utilities/mix.js +38 -0
  206. package/dist/build/transformers/utilities/rgbaFloatToHex.d.ts +6 -0
  207. package/dist/build/transformers/utilities/rgbaFloatToHex.js +11 -0
  208. package/dist/build/types/Border.d.ts +5 -0
  209. package/dist/build/types/BorderTokenValue.d.ts +10 -0
  210. package/dist/build/types/ColorHex.d.ts +4 -0
  211. package/dist/build/types/PlatformInitializer.d.ts +11 -0
  212. package/dist/build/types/Shadow.d.ts +5 -0
  213. package/dist/build/types/ShadowTokenValue.d.ts +14 -0
  214. package/dist/build/types/SizeEm.d.ts +4 -0
  215. package/dist/build/types/SizePx.d.ts +4 -0
  216. package/dist/build/types/SizeRem.d.ts +4 -0
  217. package/dist/build/types/StyleDictionaryConfigGenerator.d.ts +15 -0
  218. package/dist/build/types/TokenBuildInput.d.ts +8 -0
  219. package/dist/build/types/TypographyTokenValue.d.ts +12 -0
  220. package/dist/build/types/w3cTransformedToken.d.ts +8 -0
  221. package/dist/build/utilities/copyFromDir.d.ts +8 -0
  222. package/dist/build/utilities/copyFromDir.js +31 -0
  223. package/dist/build/utilities/filterStringArray.d.ts +1 -0
  224. package/dist/build/utilities/filterStringArray.js +13 -0
  225. package/dist/build/utilities/getFlag.d.ts +8 -0
  226. package/dist/build/utilities/getFlag.js +12 -0
  227. package/dist/build/utilities/index.d.ts +9 -0
  228. package/dist/build/utilities/index.js +9 -0
  229. package/dist/build/utilities/joinFriendly.d.ts +1 -0
  230. package/dist/build/utilities/joinFriendly.js +1 -0
  231. package/dist/build/utilities/schemaErrorMessage.d.ts +1 -0
  232. package/dist/build/utilities/schemaErrorMessage.js +1 -0
  233. package/dist/build/utilities/toCamelCase.d.ts +1 -0
  234. package/dist/build/utilities/toCamelCase.js +16 -0
  235. package/dist/build/utilities/toPascalCase.d.ts +1 -0
  236. package/dist/build/utilities/toPascalCase.js +13 -0
  237. package/dist/build/utilities/treeWalker.d.ts +8 -0
  238. package/dist/build/utilities/treeWalker.js +23 -0
  239. package/dist/build/utilities/upperCaseFirstCharacter.d.ts +8 -0
  240. package/dist/build/utilities/upperCaseFirstCharacter.js +10 -0
  241. package/dist/css/base/motion/motion.css +17 -0
  242. package/dist/css/functional/motion/motion.css +4 -3
  243. package/dist/css/functional/themes/dark-colorblind.css +58 -38
  244. package/dist/css/functional/themes/dark-dimmed.css +44 -24
  245. package/dist/css/functional/themes/dark-high-contrast.css +42 -22
  246. package/dist/css/functional/themes/dark-tritanopia.css +44 -24
  247. package/dist/css/functional/themes/dark.css +42 -22
  248. package/dist/css/functional/themes/light-colorblind.css +60 -40
  249. package/dist/css/functional/themes/light-high-contrast.css +44 -24
  250. package/dist/css/functional/themes/light-tritanopia.css +42 -22
  251. package/dist/css/functional/themes/light.css +42 -22
  252. package/dist/css/functional/typography/typography.css +43 -43
  253. package/dist/css/primitives.css +64 -46
  254. package/dist/docs/base/motion/motion.json +205 -0
  255. package/dist/docs/functional/motion/motion.json +18 -3
  256. package/dist/docs/functional/themes/dark-colorblind.json +350 -1114
  257. package/dist/docs/functional/themes/dark-dimmed.json +364 -1152
  258. package/dist/docs/functional/themes/dark-high-contrast.json +312 -922
  259. package/dist/docs/functional/themes/dark-tritanopia.json +344 -1138
  260. package/dist/docs/functional/themes/dark.json +346 -1206
  261. package/dist/docs/functional/themes/light-colorblind.json +366 -1140
  262. package/dist/docs/functional/themes/light-high-contrast.json +335 -949
  263. package/dist/docs/functional/themes/light-tritanopia.json +311 -1135
  264. package/dist/docs/functional/themes/light.json +336 -1202
  265. package/dist/fallbacks/base/motion/motion.json +17 -0
  266. package/dist/fallbacks/functional/motion/motion.json +1 -0
  267. package/dist/figma/dimension/dimension.json +518 -518
  268. package/dist/figma/figma.json +19 -19
  269. package/dist/figma/scales/dark-dimmed.json +3536 -656
  270. package/dist/figma/scales/dark-high-constrast.json +3535 -655
  271. package/dist/figma/scales/dark.json +3371 -491
  272. package/dist/figma/scales/light-high-constrast.json +3533 -653
  273. package/dist/figma/scales/light.json +3370 -490
  274. package/dist/figma/shadows/dark-colorblind.json +285 -285
  275. package/dist/figma/shadows/dark-dimmed.json +285 -285
  276. package/dist/figma/shadows/dark-high-contrast.json +285 -285
  277. package/dist/figma/shadows/dark-tritanopia.json +285 -285
  278. package/dist/figma/shadows/dark.json +285 -285
  279. package/dist/figma/shadows/light-colorblind.json +254 -254
  280. package/dist/figma/shadows/light-high-contrast.json +254 -254
  281. package/dist/figma/shadows/light-tritanopia.json +254 -254
  282. package/dist/figma/shadows/light.json +254 -254
  283. package/dist/figma/themes/dark-colorblind.json +5197 -5068
  284. package/dist/figma/themes/dark-dimmed.json +5526 -5351
  285. package/dist/figma/themes/dark-high-contrast.json +4361 -4251
  286. package/dist/figma/themes/dark-tritanopia.json +5315 -5187
  287. package/dist/figma/themes/dark.json +5740 -5581
  288. package/dist/figma/themes/light-colorblind.json +5104 -4929
  289. package/dist/figma/themes/light-high-contrast.json +4462 -4319
  290. package/dist/figma/themes/light-tritanopia.json +5176 -5050
  291. package/dist/figma/themes/light.json +5657 -5500
  292. package/dist/figma/typography/typography.json +162 -162
  293. package/dist/internalCss/dark-colorblind.css +58 -38
  294. package/dist/internalCss/dark-dimmed.css +44 -24
  295. package/dist/internalCss/dark-high-contrast.css +42 -22
  296. package/dist/internalCss/dark-tritanopia.css +44 -24
  297. package/dist/internalCss/dark.css +42 -22
  298. package/dist/internalCss/light-colorblind.css +60 -40
  299. package/dist/internalCss/light-high-contrast.css +44 -24
  300. package/dist/internalCss/light-tritanopia.css +42 -22
  301. package/dist/internalCss/light.css +42 -22
  302. package/dist/styleLint/base/motion/motion.json +205 -0
  303. package/dist/styleLint/functional/motion/motion.json +18 -3
  304. package/dist/styleLint/functional/themes/dark-colorblind.json +350 -1114
  305. package/dist/styleLint/functional/themes/dark-dimmed.json +364 -1152
  306. package/dist/styleLint/functional/themes/dark-high-contrast.json +311 -921
  307. package/dist/styleLint/functional/themes/dark-tritanopia.json +344 -1138
  308. package/dist/styleLint/functional/themes/dark.json +346 -1206
  309. package/dist/styleLint/functional/themes/light-colorblind.json +366 -1140
  310. package/dist/styleLint/functional/themes/light-high-contrast.json +335 -949
  311. package/dist/styleLint/functional/themes/light-tritanopia.json +311 -1135
  312. package/dist/styleLint/functional/themes/light.json +336 -1202
  313. package/package.json +23 -30
  314. package/src/tokens/base/motion/easing.json5 +26 -0
  315. package/src/tokens/base/motion/timing.json5 +50 -0
  316. package/src/tokens/functional/color/dark/app-dark.json5 +236 -121
  317. package/src/tokens/functional/color/dark/data-vis-dark.json5 +40 -40
  318. package/src/tokens/functional/color/dark/display-dark.json5 +95 -95
  319. package/src/tokens/functional/color/dark/overrides/dark.dimmed.json5 +1 -9
  320. package/src/tokens/functional/color/dark/overrides/dark.high-contrast.json5 +40 -27
  321. package/src/tokens/functional/color/dark/overrides/dark.protanopia-deuteranopia.json5 +56 -30
  322. package/src/tokens/functional/color/dark/overrides/dark.tritanopia.json5 +37 -14
  323. package/src/tokens/functional/color/dark/patterns-dark.json +3963 -0
  324. package/src/tokens/functional/color/dark/patterns-dark.json5 +126 -277
  325. package/src/tokens/functional/color/dark/primitives-dark.json5 +78 -78
  326. package/src/tokens/functional/color/dark/syntax-dark.json5 +47 -47
  327. package/src/tokens/functional/color/light/app-light.json5 +179 -118
  328. package/src/tokens/functional/color/light/data-vis-light.json5 +40 -40
  329. package/src/tokens/functional/color/light/display-light.json5 +0 -95
  330. package/src/tokens/functional/color/light/overrides/light.high-contrast.json5 +25 -27
  331. package/src/tokens/functional/color/light/overrides/light.protanopia-deuteranopia.json5 +58 -33
  332. package/src/tokens/functional/color/light/overrides/light.tritanopia.json5 +59 -10
  333. package/src/tokens/functional/color/light/patterns-light.json5 +126 -276
  334. package/src/tokens/functional/color/light/primitives-light.json5 +0 -78
  335. package/src/tokens/functional/color/light/syntax-light.json5 +0 -47
  336. package/src/tokens/functional/motion/loading.json5 +1 -1
  337. package/src/tokens/functional/motion/patterns.json5 +9 -2
  338. package/src/tokens/functional/shadow/dark.json5 +0 -14
  339. package/src/tokens/functional/shadow/light.json5 +0 -13
@@ -0,0 +1,96 @@
1
+ import { isFromFile, isSource } from '../filters/index.js';
2
+ const getCssSelectors = (outputFile) => {
3
+ // check for dark in the beginning of the output filename
4
+ const lastSlash = outputFile.lastIndexOf('/');
5
+ const outputBasename = outputFile.substring(lastSlash + 1, outputFile.indexOf('.'));
6
+ const themeName = outputBasename.replace(/-/g, '_');
7
+ const mode = outputBasename.substring(0, 4) === 'dark' ? 'dark' : 'light';
8
+ return [
9
+ {
10
+ selector: `[data-color-mode="${mode}"][data-${mode}-theme="${themeName}"], [data-color-mode="${mode}"][data-${mode}-theme="${themeName}"] ::backdrop, [data-color-mode="auto"][data-light-theme="${themeName}"], [data-color-mode="auto"][data-light-theme="${themeName}"] ::backdrop`,
11
+ },
12
+ {
13
+ query: '@media (prefers-color-scheme: dark)',
14
+ selector: `[data-color-mode="auto"][data-dark-theme="${themeName}"], [data-color-mode="auto"][data-dark-theme="${themeName}"] ::backdrop`,
15
+ },
16
+ ];
17
+ };
18
+ export const css = (outputFile, prefix, buildPath, options) => {
19
+ return {
20
+ prefix,
21
+ buildPath,
22
+ transforms: [
23
+ 'name/pathToKebabCase',
24
+ 'color/hex',
25
+ 'color/hexMix',
26
+ 'cubicBezier/css',
27
+ 'dimension/rem',
28
+ 'duration/css',
29
+ 'shadow/css',
30
+ 'border/css',
31
+ 'typography/css',
32
+ 'fontFamily/css',
33
+ 'fontWeight/number',
34
+ ],
35
+ options: {
36
+ basePxFontSize: 16,
37
+ },
38
+ files: [
39
+ {
40
+ destination: `${outputFile}`,
41
+ format: `css/advanced`,
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
+ ]),
49
+ options: Object.assign({ showFileHeader: false, outputReferences: false, descriptions: false, queries: getCssSelectors(outputFile) }, options === null || options === void 0 ? void 0 : options.options),
50
+ },
51
+ {
52
+ destination: `${outputFile}`,
53
+ format: `css/advanced`,
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
+ ]),
61
+ options: Object.assign({ showFileHeader: false, descriptions: false }, options === null || options === void 0 ? void 0 : options.options),
62
+ },
63
+ {
64
+ destination: `${outputFile}`,
65
+ format: `css/customMedia`,
66
+ filter: token => isSource(token) && (options === null || options === void 0 ? void 0 : options.themed) !== true && token.$type === 'custom-viewportRange',
67
+ options: {
68
+ showFileHeader: false,
69
+ },
70
+ },
71
+ {
72
+ destination: `${outputFile}`,
73
+ format: `css/advanced`,
74
+ filter: token => isSource(token) &&
75
+ isFromFile(token, [
76
+ 'src/tokens/functional/size/size-coarse.json',
77
+ 'src/tokens/functional/size/size-fine.json',
78
+ ]),
79
+ options: {
80
+ descriptions: false,
81
+ showFileHeader: false,
82
+ queries: [
83
+ {
84
+ query: '@media (pointer: fine)',
85
+ matcher: (token) => token.filePath.includes('size-fine'),
86
+ },
87
+ {
88
+ query: '@media (pointer: coarse)',
89
+ matcher: (token) => token.filePath.includes('size-coarse'),
90
+ },
91
+ ],
92
+ },
93
+ },
94
+ ],
95
+ };
96
+ };
@@ -0,0 +1,2 @@
1
+ import type { PlatformInitializer } from '../types/PlatformInitializer.js';
2
+ export declare const deprecatedJson: PlatformInitializer;
@@ -0,0 +1,13 @@
1
+ import { isDeprecated } from '../filters/index.js';
2
+ export const deprecatedJson = (outputFile, prefix, buildPath) => ({
3
+ prefix,
4
+ buildPath,
5
+ transforms: ['name/pathToDotNotation', 'json/deprecated'],
6
+ files: [
7
+ {
8
+ destination: outputFile,
9
+ format: `json/flat`,
10
+ filter: isDeprecated,
11
+ },
12
+ ],
13
+ });
@@ -0,0 +1,2 @@
1
+ import type { PlatformInitializer } from '../types/PlatformInitializer.js';
2
+ export declare const docJson: PlatformInitializer;
@@ -0,0 +1,35 @@
1
+ import { isSource } from '../filters/index.js';
2
+ export const docJson = (outputFile, prefix, buildPath) => ({
3
+ prefix,
4
+ buildPath,
5
+ transforms: [
6
+ 'name/pathToKebabCase',
7
+ 'color/hex',
8
+ 'color/hexMix',
9
+ 'dimension/rem',
10
+ 'shadow/css',
11
+ 'border/css',
12
+ 'typography/css',
13
+ 'fontFamily/css',
14
+ 'fontWeight/number',
15
+ ],
16
+ options: {
17
+ basePxFontSize: 16,
18
+ propertyConversion: {
19
+ $value: 'value',
20
+ $type: 'type',
21
+ $description: 'description',
22
+ },
23
+ },
24
+ files: [
25
+ {
26
+ destination: outputFile,
27
+ format: `json/one-dimensional`,
28
+ filter: isSource,
29
+ options: {
30
+ outputReferences: false,
31
+ outputVerbose: true,
32
+ },
33
+ },
34
+ ],
35
+ });
@@ -0,0 +1,2 @@
1
+ import type { PlatformInitializer } from '../types/PlatformInitializer.js';
2
+ export declare const fallbacks: PlatformInitializer;
@@ -0,0 +1,30 @@
1
+ import { isSource } from '../filters/index.js';
2
+ export const fallbacks = (outputFile, prefix, buildPath) => ({
3
+ prefix,
4
+ buildPath,
5
+ transforms: [
6
+ 'name/pathToKebabCase',
7
+ 'color/hex',
8
+ 'color/hexMix',
9
+ 'dimension/rem',
10
+ 'shadow/css',
11
+ 'border/css',
12
+ 'typography/css',
13
+ 'fontFamily/css',
14
+ 'fontWeight/number',
15
+ ],
16
+ options: {
17
+ basePxFontSize: 16,
18
+ },
19
+ files: [
20
+ {
21
+ destination: outputFile,
22
+ format: `json/postCss-fallback`,
23
+ filter: isSource,
24
+ options: {
25
+ outputReferences: false,
26
+ outputVerbose: true,
27
+ },
28
+ },
29
+ ],
30
+ });
@@ -0,0 +1,2 @@
1
+ import type { PlatformInitializer } from '../types/PlatformInitializer.js';
2
+ export declare const figma: PlatformInitializer;
@@ -0,0 +1,60 @@
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
+ });
9
+ };
10
+ import { isSource } from '../filters/index.js';
11
+ const validFigmaToken = (token, options) => __awaiter(void 0, void 0, void 0, function* () {
12
+ const valueProp = options.usesDtcg ? '$value' : 'value';
13
+ const validTypes = ['color', 'dimension', 'shadow', 'fontWeight', 'fontFamily', 'number'];
14
+ // is a siource token, not an included one
15
+ if (!isSource(token) || !token.$type)
16
+ return false;
17
+ if (`${token[valueProp]}`.substring(token[valueProp].length - 2) === 'em')
18
+ return false;
19
+ // has a collection attribute
20
+ if (!('$extensions' in token) ||
21
+ !('org.primer.figma' in token.$extensions) ||
22
+ !('collection' in token.$extensions['org.primer.figma']))
23
+ return false;
24
+ // is a color or dimension type
25
+ return validTypes.includes(token.$type);
26
+ });
27
+ export const figma = (outputFile, prefix, buildPath, options) => ({
28
+ prefix,
29
+ buildPath,
30
+ transforms: [
31
+ 'color/rgbaFloat',
32
+ 'fontFamily/figma',
33
+ 'float/pixelUnitless',
34
+ 'dimension/pixelUnitless',
35
+ // 'border/figma',
36
+ // 'typography/figma',
37
+ 'fontWeight/number',
38
+ 'figma/attributes',
39
+ 'name/pathToFigma',
40
+ ],
41
+ options: Object.assign({ basePxFontSize: 16, fontFamilies: {
42
+ 'fontStack/system': 'SF Pro Text',
43
+ 'fontStack/sansSerif': 'SF Pro Text',
44
+ 'fontStack/sansSerifDisplay': 'SF Pro Display',
45
+ 'fontStack/monospace': 'SF Mono',
46
+ } }, options),
47
+ files: [
48
+ {
49
+ destination: outputFile,
50
+ filter: (token, config) => {
51
+ return validFigmaToken(token, config);
52
+ },
53
+ format: `json/figma`,
54
+ options: {
55
+ outputReferences: true,
56
+ mode: options === null || options === void 0 ? void 0 : options.mode,
57
+ },
58
+ },
59
+ ],
60
+ });
@@ -0,0 +1,10 @@
1
+ export { css } from './css.js';
2
+ export { deprecatedJson } from './deprecatedJson.js';
3
+ export { docJson } from './docJson.js';
4
+ export { fallbacks } from './fallbacks.js';
5
+ export { figma } from './figma.js';
6
+ export { javascript } from './javascript.js';
7
+ export { json } from './json.js';
8
+ export { styleLint } from './styleLint.js';
9
+ export { typeDefinitions } from './typeDefinitions.js';
10
+ export { typescript } from './typescript.js';
@@ -0,0 +1,10 @@
1
+ export { css } from './css.js';
2
+ export { deprecatedJson } from './deprecatedJson.js';
3
+ export { docJson } from './docJson.js';
4
+ export { fallbacks } from './fallbacks.js';
5
+ export { figma } from './figma.js';
6
+ export { javascript } from './javascript.js';
7
+ export { json } from './json.js';
8
+ export { styleLint } from './styleLint.js';
9
+ export { typeDefinitions } from './typeDefinitions.js';
10
+ export { typescript } from './typescript.js';
@@ -0,0 +1,2 @@
1
+ import type { PlatformInitializer } from '../types/PlatformInitializer.js';
2
+ export declare const javascript: PlatformInitializer;
@@ -0,0 +1,26 @@
1
+ import { isSource } from '../filters/index.js';
2
+ export const javascript = (outputFile, prefix, buildPath) => ({
3
+ prefix,
4
+ buildPath,
5
+ transforms: [
6
+ 'color/hex',
7
+ 'color/hexMix',
8
+ 'dimension/rem',
9
+ 'shadow/css',
10
+ 'border/css',
11
+ 'typography/css',
12
+ 'fontFamily/css',
13
+ 'fontWeight/number',
14
+ ],
15
+ options: {
16
+ showFileHeader: false,
17
+ basePxFontSize: 16,
18
+ },
19
+ files: [
20
+ {
21
+ format: 'javascript/commonJs',
22
+ destination: outputFile,
23
+ filter: isSource,
24
+ },
25
+ ],
26
+ });
@@ -0,0 +1,2 @@
1
+ import type { PlatformInitializer } from '../types/PlatformInitializer.js';
2
+ export declare const json: PlatformInitializer;
@@ -0,0 +1,28 @@
1
+ import { isSource } from '../filters/index.js';
2
+ export const json = (outputFile, prefix, buildPath) => ({
3
+ prefix,
4
+ buildPath,
5
+ transforms: [
6
+ 'color/hex',
7
+ 'color/hexMix',
8
+ 'dimension/rem',
9
+ 'shadow/css',
10
+ 'border/css',
11
+ 'typography/css',
12
+ 'fontFamily/css',
13
+ 'fontWeight/number',
14
+ ],
15
+ options: {
16
+ basePxFontSize: 16,
17
+ },
18
+ files: [
19
+ {
20
+ destination: outputFile,
21
+ filter: isSource,
22
+ format: `json/nested-prefixed`,
23
+ options: {
24
+ outputReferences: false,
25
+ },
26
+ },
27
+ ],
28
+ });
@@ -0,0 +1,2 @@
1
+ import type { PlatformInitializer } from '../types/PlatformInitializer.js';
2
+ export declare const styleLint: PlatformInitializer;
@@ -0,0 +1,30 @@
1
+ import { isSource } from '../filters/index.js';
2
+ export const styleLint = (outputFile, prefix, buildPath) => ({
3
+ prefix,
4
+ buildPath,
5
+ transforms: [
6
+ 'name/pathToKebabCase',
7
+ 'color/hex',
8
+ 'color/hexMix',
9
+ 'dimension/remPxArray',
10
+ 'shadow/css',
11
+ 'border/css',
12
+ 'typography/css',
13
+ 'fontFamily/css',
14
+ 'fontWeight/number',
15
+ ],
16
+ options: {
17
+ basePxFontSize: 16,
18
+ },
19
+ files: [
20
+ {
21
+ destination: outputFile,
22
+ format: `json/one-dimensional`,
23
+ filter: isSource,
24
+ options: {
25
+ outputReferences: false,
26
+ outputVerbose: true,
27
+ },
28
+ },
29
+ ],
30
+ });
@@ -0,0 +1,2 @@
1
+ import type { PlatformInitializer } from '../types/PlatformInitializer.js';
2
+ export declare const typeDefinitions: PlatformInitializer;
@@ -0,0 +1,26 @@
1
+ import { isSource } from '../filters/index.js';
2
+ import { upperCaseFirstCharacter } from '../utilities/index.js';
3
+ export const typeDefinitions = (outputFile, prefix, buildPath) => ({
4
+ prefix,
5
+ buildPath,
6
+ transforms: [
7
+ 'color/hex',
8
+ 'shadow/css',
9
+ 'border/css',
10
+ 'dimension/rem',
11
+ 'typography/css',
12
+ 'fontFamily/css',
13
+ 'fontWeight/number',
14
+ ],
15
+ files: [
16
+ {
17
+ format: 'typescript/export-definition',
18
+ destination: `${upperCaseFirstCharacter(outputFile)}DesignTokens.d.ts`,
19
+ filter: isSource,
20
+ options: {
21
+ tokenTypesPath: './src/types/',
22
+ moduleName: `${upperCaseFirstCharacter(outputFile)}DesignTokens`,
23
+ },
24
+ },
25
+ ],
26
+ });
@@ -0,0 +1,2 @@
1
+ import type { PlatformInitializer } from '../types/PlatformInitializer.js';
2
+ export declare const typescript: PlatformInitializer;
@@ -0,0 +1,26 @@
1
+ import { isSource } from '../filters/index.js';
2
+ export const typescript = (outputFile, prefix, buildPath) => ({
3
+ prefix,
4
+ buildPath,
5
+ transforms: [
6
+ 'color/hex',
7
+ 'color/hexMix',
8
+ 'dimension/rem',
9
+ 'shadow/css',
10
+ 'border/css',
11
+ 'typography/css',
12
+ 'fontFamily/css',
13
+ 'fontWeight/number',
14
+ ],
15
+ options: {
16
+ showFileHeader: false,
17
+ basePxFontSize: 16,
18
+ },
19
+ files: [
20
+ {
21
+ format: 'javascript/esm',
22
+ destination: outputFile,
23
+ filter: isSource,
24
+ },
25
+ ],
26
+ });
@@ -0,0 +1,2 @@
1
+ import { z } from 'zod';
2
+ export declare const alphaValue: z.ZodEffects<z.ZodAny, any, any>;
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ import { schemaErrorMessage } from '../utilities/index.js';
3
+ export const alphaValue = z.any().refine(value => typeof value === 'number' && value >= 0 && value <= 1, value => ({
4
+ message: schemaErrorMessage(`Invalid alpha value: "${value}" (${typeof value})`, 'Alpha value must be a number between 0 and 1.'),
5
+ }));
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ export declare const baseToken: z.ZodObject<{
3
+ $description: z.ZodOptional<z.ZodString>;
4
+ $deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
5
+ }, "strict", z.ZodTypeAny, {
6
+ $description?: string | undefined;
7
+ $deprecated?: string | boolean | undefined;
8
+ }, {
9
+ $description?: string | undefined;
10
+ $deprecated?: string | boolean | undefined;
11
+ }>;
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ export const baseToken = z
3
+ .object({
4
+ $description: z.string().optional(),
5
+ $deprecated: z.union([z.string(), z.boolean()]).optional(),
6
+ })
7
+ .strict();
@@ -0,0 +1,51 @@
1
+ import { z } from 'zod';
2
+ export declare const borderValue: z.ZodObject<{
3
+ color: z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodEffects<z.ZodString, string, string>]>;
4
+ style: z.ZodEnum<["solid", "dashed", "dotted", "double", "groove", "ridge", "outset", "inset"]>;
5
+ width: z.ZodUnion<[z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodLiteral<"0">, z.ZodLiteral<0>]>, z.ZodEffects<z.ZodString, string, string>]>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ width: string | 0;
8
+ color: string;
9
+ style: "inset" | "solid" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "outset";
10
+ }, {
11
+ width: string | 0;
12
+ color: string;
13
+ style: "inset" | "solid" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "outset";
14
+ }>;
15
+ export declare const borderToken: z.ZodObject<z.objectUtil.extendShape<{
16
+ $description: z.ZodOptional<z.ZodString>;
17
+ $deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
18
+ }, {
19
+ $value: z.ZodUnion<[z.ZodObject<{
20
+ color: z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodEffects<z.ZodString, string, string>]>;
21
+ style: z.ZodEnum<["solid", "dashed", "dotted", "double", "groove", "ridge", "outset", "inset"]>;
22
+ width: z.ZodUnion<[z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodLiteral<"0">, z.ZodLiteral<0>]>, z.ZodEffects<z.ZodString, string, string>]>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ width: string | 0;
25
+ color: string;
26
+ style: "inset" | "solid" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "outset";
27
+ }, {
28
+ width: string | 0;
29
+ color: string;
30
+ style: "inset" | "solid" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "outset";
31
+ }>, z.ZodEffects<z.ZodString, string, string>]>;
32
+ $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
33
+ }>, "strict", z.ZodTypeAny, {
34
+ $value: string | {
35
+ width: string | 0;
36
+ color: string;
37
+ style: "inset" | "solid" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "outset";
38
+ };
39
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
40
+ $description?: string | undefined;
41
+ $deprecated?: string | boolean | undefined;
42
+ }, {
43
+ $value: string | {
44
+ width: string | 0;
45
+ color: string;
46
+ style: "inset" | "solid" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "outset";
47
+ };
48
+ $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
49
+ $description?: string | undefined;
50
+ $deprecated?: string | boolean | undefined;
51
+ }>;
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ import { baseToken } from './baseToken.js';
3
+ import { referenceValue } from './referenceValue.js';
4
+ import { colorHexValue } from './colorHexValue.js';
5
+ import { dimensionValue } from './dimensionValue.js';
6
+ import { tokenType } from './tokenType.js';
7
+ export const borderValue = z.object({
8
+ color: z.union([colorHexValue, referenceValue]),
9
+ style: z.enum(['solid', 'dashed', 'dotted', 'double', 'groove', 'ridge', 'outset', 'inset']),
10
+ width: z.union([dimensionValue, referenceValue]),
11
+ });
12
+ export const borderToken = baseToken
13
+ .extend({
14
+ $value: z.union([borderValue, referenceValue]),
15
+ $type: tokenType('border'),
16
+ })
17
+ .strict();
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ type Collections = 'base/color/light' | 'base/color/light-high-contrast' | 'base/color/dark' | 'base/color/dark-dimmed' | 'base/color/dark-high-contrast' | 'base/typography' | 'mode' | 'pattern/mode' | 'base/size' | 'functional/size' | 'pattern/size' | 'typography';
3
+ export declare const collection: (collections: Collections[]) => z.ZodEffects<z.ZodString, string, string>;
4
+ type Modes = 'light' | 'dark' | 'dark dimmed' | 'light high contrast' | 'dark high contrast' | 'light colorblind' | 'dark colorblind' | 'light tritanopia' | 'dark tritanopia';
5
+ export declare const mode: (modes: Modes[]) => z.ZodEffects<z.ZodString, string, string>;
6
+ export {};
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ import { joinFriendly, schemaErrorMessage } from '../utilities/index.js';
3
+ export const collection = (collections) => {
4
+ return z.string().refine(value => collections.includes(value), value => ({
5
+ message: schemaErrorMessage(`Invalid collection: "${value}"`, `Valid collections are ${joinFriendly(collections)}`),
6
+ }));
7
+ };
8
+ export const mode = (modes) => {
9
+ return z.string().refine(value => modes.includes(value), value => ({
10
+ message: schemaErrorMessage(`Invalid mode: "${value}"`, `Valid modes are ${joinFriendly(modes)}`),
11
+ }));
12
+ };
@@ -0,0 +1,2 @@
1
+ import { z } from 'zod';
2
+ export declare const colorHexValue: z.ZodEffects<z.ZodString, string, string>;
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ import { schemaErrorMessage } from '../utilities/index.js';
3
+ const colorHex3RegEx = '^#[0-9a-f]{3}$';
4
+ const colorHex6RegEx = '^#[0-9a-f]{6}$';
5
+ const colorHex8RegEx = '^#[0-9a-f]{8}$';
6
+ const colorHexRegex = new RegExp(`(${colorHex3RegEx})|(${colorHex6RegEx})|(${colorHex8RegEx})`, 'i');
7
+ export const colorHexValue = z.string().refine(color => colorHexRegex.test(color), color => ({
8
+ message: schemaErrorMessage(`Invalid color: "${color}"`, 'Color must be a hex string or a reference to a color token.'),
9
+ }));