@primer/primitives 9.0.3 → 9.1.0-rc.56a8ee48

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 (335) hide show
  1. package/dist/build/PrimerStyleDictionary.d.ts +9 -0
  2. package/dist/build/PrimerStyleDictionary.js +93 -0
  3. package/dist/build/filters/index.d.ts +13 -0
  4. package/dist/build/filters/index.js +29 -0
  5. package/{src/filters/isBorder.ts → dist/build/filters/isBorder.d.ts} +2 -5
  6. package/dist/build/filters/isBorder.js +12 -0
  7. package/{src/filters/isColor.ts → dist/build/filters/isColor.d.ts} +2 -5
  8. package/dist/build/filters/isColor.js +12 -0
  9. package/dist/build/filters/isColorWithAlpha.d.ts +7 -0
  10. package/dist/build/filters/isColorWithAlpha.js +13 -0
  11. package/dist/build/filters/isColorWithMix.d.ts +7 -0
  12. package/dist/build/filters/isColorWithMix.js +28 -0
  13. package/{src/filters/isDeprecated.ts → dist/build/filters/isDeprecated.d.ts} +2 -5
  14. package/dist/build/filters/isDeprecated.js +12 -0
  15. package/{src/filters/isDimension.ts → dist/build/filters/isDimension.d.ts} +2 -5
  16. package/dist/build/filters/isDimension.js +12 -0
  17. package/{src/filters/isDuration.ts → dist/build/filters/isDuration.d.ts} +2 -5
  18. package/dist/build/filters/isDuration.js +12 -0
  19. package/{src/filters/isFontFamily.ts → dist/build/filters/isFontFamily.d.ts} +2 -5
  20. package/dist/build/filters/isFontFamily.js +12 -0
  21. package/{src/filters/isFontWeight.ts → dist/build/filters/isFontWeight.d.ts} +2 -5
  22. package/dist/build/filters/isFontWeight.js +12 -0
  23. package/dist/build/filters/isFromFile.d.ts +8 -0
  24. package/dist/build/filters/isFromFile.js +14 -0
  25. package/{src/filters/isNumber.ts → dist/build/filters/isNumber.d.ts} +2 -3
  26. package/dist/build/filters/isNumber.js +10 -0
  27. package/{src/filters/isShadow.ts → dist/build/filters/isShadow.d.ts} +2 -5
  28. package/dist/build/filters/isShadow.js +12 -0
  29. package/{src/filters/isSource.ts → dist/build/filters/isSource.d.ts} +2 -5
  30. package/dist/build/filters/isSource.js +12 -0
  31. package/{src/filters/isTypography.ts → dist/build/filters/isTypography.d.ts} +2 -5
  32. package/dist/build/filters/isTypography.js +12 -0
  33. package/dist/build/formats/cssAdvanced.d.ts +2 -0
  34. package/dist/build/formats/cssAdvanced.js +84 -0
  35. package/dist/build/formats/cssCustomMedia.d.ts +7 -0
  36. package/dist/build/formats/cssCustomMedia.js +25 -0
  37. package/dist/build/formats/index.d.ts +9 -0
  38. package/dist/build/formats/index.js +21 -0
  39. package/dist/build/formats/javascriptCommonJs.d.ts +7 -0
  40. package/dist/build/formats/javascriptCommonJs.js +25 -0
  41. package/dist/build/formats/javascriptEsm.d.ts +7 -0
  42. package/dist/build/formats/javascriptEsm.js +25 -0
  43. package/dist/build/formats/jsonFigma.d.ts +7 -0
  44. package/dist/build/formats/jsonFigma.js +116 -0
  45. package/dist/build/formats/jsonNestedPrefixed.d.ts +8 -0
  46. package/dist/build/formats/jsonNestedPrefixed.js +28 -0
  47. package/dist/build/formats/jsonOneDimensional.d.ts +8 -0
  48. package/dist/build/formats/jsonOneDimensional.js +24 -0
  49. package/dist/build/formats/jsonPostCssFallback.d.ts +8 -0
  50. package/dist/build/formats/jsonPostCssFallback.js +21 -0
  51. package/dist/build/formats/typescriptExportDefinition.d.ts +7 -0
  52. package/dist/build/formats/typescriptExportDefinition.js +166 -0
  53. package/{src/formats/utilities/jsonToFlat.ts → dist/build/formats/utilities/jsonToFlat.d.ts} +4 -3
  54. package/dist/build/formats/utilities/jsonToFlat.js +12 -0
  55. package/dist/build/formats/utilities/jsonToNestedValue.d.ts +8 -0
  56. package/dist/build/formats/utilities/jsonToNestedValue.js +25 -0
  57. package/dist/build/formats/utilities/prefixTokens.d.ts +8 -0
  58. package/dist/build/formats/utilities/prefixTokens.js +17 -0
  59. package/dist/build/parsers/index.d.ts +1 -0
  60. package/dist/build/parsers/index.js +5 -0
  61. package/dist/build/parsers/w3cJsonParser.d.ts +6 -0
  62. package/dist/build/parsers/w3cJsonParser.js +27 -0
  63. package/dist/build/platforms/css.d.ts +2 -0
  64. package/dist/build/platforms/css.js +88 -0
  65. package/dist/build/platforms/deprecatedJson.d.ts +2 -0
  66. package/dist/build/platforms/deprecatedJson.js +17 -0
  67. package/dist/build/platforms/docJson.d.ts +2 -0
  68. package/dist/build/platforms/docJson.js +35 -0
  69. package/dist/build/platforms/fallbacks.d.ts +2 -0
  70. package/dist/build/platforms/fallbacks.js +35 -0
  71. package/dist/build/platforms/figma.d.ts +2 -0
  72. package/dist/build/platforms/figma.js +53 -0
  73. package/dist/build/platforms/index.d.ts +10 -0
  74. package/dist/build/platforms/index.js +23 -0
  75. package/dist/build/platforms/javascript.d.ts +2 -0
  76. package/dist/build/platforms/javascript.js +31 -0
  77. package/dist/build/platforms/json.d.ts +2 -0
  78. package/dist/build/platforms/json.js +33 -0
  79. package/dist/build/platforms/styleLint.d.ts +2 -0
  80. package/dist/build/platforms/styleLint.js +35 -0
  81. package/dist/build/platforms/typeDefinitions.d.ts +2 -0
  82. package/dist/build/platforms/typeDefinitions.js +31 -0
  83. package/dist/build/platforms/typescript.d.ts +2 -0
  84. package/dist/build/platforms/typescript.js +31 -0
  85. package/dist/build/schemas/alphaValue.d.ts +2 -0
  86. package/dist/build/schemas/alphaValue.js +8 -0
  87. package/dist/build/schemas/baseToken.d.ts +11 -0
  88. package/dist/build/schemas/baseToken.js +10 -0
  89. package/dist/build/schemas/borderToken.d.ts +51 -0
  90. package/dist/build/schemas/borderToken.js +20 -0
  91. package/dist/build/schemas/collections.d.ts +6 -0
  92. package/dist/build/schemas/collections.js +18 -0
  93. package/dist/build/schemas/colorHexValue.d.ts +2 -0
  94. package/dist/build/schemas/colorHexValue.js +12 -0
  95. package/dist/build/schemas/colorToken.d.ts +80 -0
  96. package/dist/build/schemas/colorToken.js +52 -0
  97. package/dist/build/schemas/designToken.d.ts +2 -0
  98. package/dist/build/schemas/designToken.js +37 -0
  99. package/dist/build/schemas/dimensionToken.d.ts +52 -0
  100. package/dist/build/schemas/dimensionToken.js +36 -0
  101. package/dist/build/schemas/dimensionValue.d.ts +2 -0
  102. package/dist/build/schemas/dimensionValue.js +12 -0
  103. package/dist/build/schemas/durationToken.d.ts +18 -0
  104. package/dist/build/schemas/durationToken.js +14 -0
  105. package/dist/build/schemas/durationValue.d.ts +2 -0
  106. package/dist/build/schemas/durationValue.js +8 -0
  107. package/dist/build/schemas/fontFamilyToken.d.ts +52 -0
  108. package/dist/build/schemas/fontFamilyToken.js +23 -0
  109. package/dist/build/schemas/fontWeightToken.d.ts +52 -0
  110. package/dist/build/schemas/fontWeightToken.js +24 -0
  111. package/dist/build/schemas/fontWeightValue.d.ts +2 -0
  112. package/dist/build/schemas/fontWeightValue.js +9 -0
  113. package/dist/build/schemas/numberToken.d.ts +71 -0
  114. package/dist/build/schemas/numberToken.js +30 -0
  115. package/dist/build/schemas/referenceValue.d.ts +2 -0
  116. package/dist/build/schemas/referenceValue.js +8 -0
  117. package/dist/build/schemas/scopes.d.ts +5 -0
  118. package/dist/build/schemas/scopes.js +34 -0
  119. package/dist/build/schemas/shadowToken.d.ts +157 -0
  120. package/dist/build/schemas/shadowToken.js +46 -0
  121. package/dist/build/schemas/stringToken.d.ts +18 -0
  122. package/dist/build/schemas/stringToken.js +13 -0
  123. package/dist/build/schemas/tokenName.d.ts +2 -0
  124. package/dist/build/schemas/tokenName.js +8 -0
  125. package/dist/build/schemas/tokenType.d.ts +3 -0
  126. package/dist/build/schemas/tokenType.js +6 -0
  127. package/dist/build/schemas/typographyToken.d.ts +59 -0
  128. package/dist/build/schemas/typographyToken.js +21 -0
  129. package/dist/build/schemas/validTokenType.d.ts +5 -0
  130. package/dist/build/schemas/validTokenType.js +34 -0
  131. package/dist/build/schemas/viewportRangeToken.d.ts +18 -0
  132. package/dist/build/schemas/viewportRangeToken.js +13 -0
  133. package/dist/build/transformers/borderToCss.d.ts +8 -0
  134. package/dist/build/transformers/borderToCss.js +38 -0
  135. package/dist/build/transformers/colorToHex.d.ts +8 -0
  136. package/dist/build/transformers/colorToHex.js +18 -0
  137. package/dist/build/transformers/colorToHexAlpha.d.ts +8 -0
  138. package/dist/build/transformers/colorToHexAlpha.js +25 -0
  139. package/dist/build/transformers/colorToHexMix.d.ts +8 -0
  140. package/dist/build/transformers/colorToHexMix.js +25 -0
  141. package/dist/build/transformers/colorToRgbAlpha.d.ts +8 -0
  142. package/dist/build/transformers/colorToRgbAlpha.js +22 -0
  143. package/dist/build/transformers/colorToRgbaFloat.d.ts +8 -0
  144. package/dist/build/transformers/colorToRgbaFloat.js +50 -0
  145. package/dist/build/transformers/dimensionToPixelUnitless.d.ts +8 -0
  146. package/dist/build/transformers/dimensionToPixelUnitless.js +50 -0
  147. package/dist/build/transformers/dimensionToRem.d.ts +8 -0
  148. package/dist/build/transformers/dimensionToRem.js +47 -0
  149. package/dist/build/transformers/dimensionToRemPxArray.d.ts +8 -0
  150. package/dist/build/transformers/dimensionToRemPxArray.js +47 -0
  151. package/dist/build/transformers/durationToCss.d.ts +8 -0
  152. package/dist/build/transformers/durationToCss.js +30 -0
  153. package/dist/build/transformers/figmaAttributes.d.ts +8 -0
  154. package/dist/build/transformers/figmaAttributes.js +57 -0
  155. package/dist/build/transformers/floatToPixel.d.ts +15 -0
  156. package/dist/build/transformers/floatToPixel.js +41 -0
  157. package/dist/build/transformers/fontFamilyToCss.d.ts +14 -0
  158. package/dist/build/transformers/fontFamilyToCss.js +40 -0
  159. package/dist/build/transformers/fontFamilyToFigma.d.ts +14 -0
  160. package/dist/build/transformers/fontFamilyToFigma.js +46 -0
  161. package/dist/build/transformers/fontWeightToNumber.d.ts +9 -0
  162. package/dist/build/transformers/fontWeightToNumber.js +53 -0
  163. package/dist/build/transformers/index.d.ts +25 -0
  164. package/dist/build/transformers/index.js +53 -0
  165. package/dist/build/transformers/jsonDeprecated.d.ts +8 -0
  166. package/dist/build/transformers/jsonDeprecated.js +16 -0
  167. package/{src/transformers/namePathToCamelCase.ts → dist/build/transformers/namePathToCamelCase.d.ts} +2 -8
  168. package/dist/build/transformers/namePathToCamelCase.js +14 -0
  169. package/dist/build/transformers/namePathToDotNotation.d.ts +8 -0
  170. package/dist/build/transformers/namePathToDotNotation.js +33 -0
  171. package/dist/build/transformers/namePathToFigma.d.ts +9 -0
  172. package/dist/build/transformers/namePathToFigma.js +24 -0
  173. package/dist/build/transformers/namePathToKebabCase.d.ts +8 -0
  174. package/dist/build/transformers/namePathToKebabCase.js +18 -0
  175. package/dist/build/transformers/namePathToPascalCase.d.ts +8 -0
  176. package/dist/build/transformers/namePathToPascalCase.js +14 -0
  177. package/dist/build/transformers/namePathToSlashNotation.d.ts +8 -0
  178. package/dist/build/transformers/namePathToSlashNotation.js +18 -0
  179. package/dist/build/transformers/shadowToCss.d.ts +8 -0
  180. package/dist/build/transformers/shadowToCss.js +35 -0
  181. package/dist/build/transformers/typographyToCss.d.ts +8 -0
  182. package/dist/build/transformers/typographyToCss.js +29 -0
  183. package/dist/build/transformers/utilities/alpha.d.ts +9 -0
  184. package/dist/build/transformers/utilities/alpha.js +20 -0
  185. package/dist/build/transformers/utilities/checkRequiredTokenProperties.d.ts +7 -0
  186. package/dist/build/transformers/utilities/checkRequiredTokenProperties.js +17 -0
  187. package/dist/build/transformers/utilities/getTokenValue.d.ts +2 -0
  188. package/dist/build/transformers/utilities/getTokenValue.js +18 -0
  189. package/dist/build/transformers/utilities/hasSpaceInString.d.ts +1 -0
  190. package/dist/build/transformers/utilities/hasSpaceInString.js +10 -0
  191. package/dist/build/transformers/utilities/hexToRgbaFloat.d.ts +2 -0
  192. package/dist/build/transformers/utilities/hexToRgbaFloat.js +33 -0
  193. package/dist/build/transformers/utilities/invalidTokenError.d.ts +7 -0
  194. package/dist/build/transformers/utilities/invalidTokenError.js +26 -0
  195. package/dist/build/transformers/utilities/isRgbaFloat.d.ts +7 -0
  196. package/dist/build/transformers/utilities/isRgbaFloat.js +24 -0
  197. package/dist/build/transformers/utilities/mix.d.ts +5 -0
  198. package/dist/build/transformers/utilities/mix.js +40 -0
  199. package/dist/build/transformers/utilities/rgbaFloatToHex.d.ts +6 -0
  200. package/dist/build/transformers/utilities/rgbaFloatToHex.js +15 -0
  201. package/dist/build/utilities/copyFromDir.d.ts +8 -0
  202. package/dist/build/utilities/copyFromDir.js +34 -0
  203. package/dist/build/utilities/filterStringArray.d.ts +1 -0
  204. package/dist/build/utilities/filterStringArray.js +17 -0
  205. package/{src/utilities/getFlag.ts → dist/build/utilities/getFlag.d.ts} +1 -5
  206. package/dist/build/utilities/getFlag.js +16 -0
  207. package/dist/build/utilities/index.d.ts +3 -0
  208. package/dist/build/utilities/index.js +9 -0
  209. package/dist/build/utilities/joinFriendly.d.ts +1 -0
  210. package/dist/build/utilities/joinFriendly.js +5 -0
  211. package/dist/build/utilities/schemaErrorMessage.d.ts +1 -0
  212. package/dist/build/utilities/schemaErrorMessage.js +5 -0
  213. package/dist/build/utilities/toCamelCase.d.ts +1 -0
  214. package/dist/build/utilities/toCamelCase.js +20 -0
  215. package/dist/build/utilities/toPascalCase.d.ts +1 -0
  216. package/dist/build/utilities/toPascalCase.js +17 -0
  217. package/dist/build/utilities/treeWalker.d.ts +8 -0
  218. package/dist/build/utilities/treeWalker.js +27 -0
  219. package/{src/utilities/upperCaseFirstCharacter.ts → dist/build/utilities/upperCaseFirstCharacter.d.ts} +1 -3
  220. package/dist/build/utilities/upperCaseFirstCharacter.js +14 -0
  221. package/dist/css/functional/motion/motion.css +3 -3
  222. package/dist/css/functional/size/border.css +2 -2
  223. package/dist/css/functional/typography/typography.css +11 -11
  224. package/dist/css/primitives.css +16 -16
  225. package/package.json +6 -8
  226. package/src/PrimerStyleDictionary.ts +0 -232
  227. package/src/filters/index.ts +0 -13
  228. package/src/filters/isColorWithAlpha.ts +0 -11
  229. package/src/filters/isColorWithMix.ts +0 -33
  230. package/src/filters/isFromFile.ts +0 -12
  231. package/src/formats/cssAdvanced.ts +0 -99
  232. package/src/formats/cssCustomMedia.ts +0 -24
  233. package/src/formats/index.ts +0 -9
  234. package/src/formats/javascriptCommonJs.ts +0 -21
  235. package/src/formats/javascriptEsm.ts +0 -21
  236. package/src/formats/jsonFigma.ts +0 -134
  237. package/src/formats/jsonNestedPrefixed.ts +0 -23
  238. package/src/formats/jsonOneDimensional.ts +0 -18
  239. package/src/formats/jsonPostCssFallback.ts +0 -16
  240. package/src/formats/typescriptExportDefinition.ts +0 -170
  241. package/src/formats/utilities/jsonToNestedValue.ts +0 -20
  242. package/src/formats/utilities/prefixTokens.ts +0 -17
  243. package/src/parsers/index.ts +0 -1
  244. package/src/parsers/w3cJsonParser.ts +0 -25
  245. package/src/platforms/css.ts +0 -101
  246. package/src/platforms/deprecatedJson.ts +0 -16
  247. package/src/platforms/docJson.ts +0 -34
  248. package/src/platforms/fallbacks.ts +0 -34
  249. package/src/platforms/figma.ts +0 -58
  250. package/src/platforms/index.ts +0 -10
  251. package/src/platforms/javascript.ts +0 -30
  252. package/src/platforms/json.ts +0 -32
  253. package/src/platforms/styleLint.ts +0 -34
  254. package/src/platforms/typeDefinitions.ts +0 -30
  255. package/src/platforms/typescript.ts +0 -30
  256. package/src/schemas/alphaValue.ts +0 -12
  257. package/src/schemas/baseToken.ts +0 -8
  258. package/src/schemas/borderToken.ts +0 -19
  259. package/src/schemas/collections.ts +0 -49
  260. package/src/schemas/colorHexValue.ts +0 -18
  261. package/src/schemas/colorToken.ts +0 -50
  262. package/src/schemas/designToken.ts +0 -38
  263. package/src/schemas/dimensionToken.ts +0 -34
  264. package/src/schemas/dimensionValue.ts +0 -16
  265. package/src/schemas/durationToken.ts +0 -12
  266. package/src/schemas/durationValue.ts +0 -9
  267. package/src/schemas/fontFamilyToken.ts +0 -21
  268. package/src/schemas/fontWeightToken.ts +0 -22
  269. package/src/schemas/fontWeightValue.ts +0 -14
  270. package/src/schemas/numberToken.ts +0 -28
  271. package/src/schemas/referenceValue.ts +0 -12
  272. package/src/schemas/scopes.ts +0 -40
  273. package/src/schemas/shadowToken.ts +0 -45
  274. package/src/schemas/stringToken.ts +0 -11
  275. package/src/schemas/tokenName.ts +0 -12
  276. package/src/schemas/tokenType.ts +0 -4
  277. package/src/schemas/typographyToken.ts +0 -20
  278. package/src/schemas/validTokenType.ts +0 -44
  279. package/src/schemas/viewportRangeToken.ts +0 -11
  280. package/src/test-utilities/getMockDictionary.ts +0 -22
  281. package/src/test-utilities/getMockFormatterArguments.ts +0 -21
  282. package/src/test-utilities/getMockParserInput.ts +0 -72
  283. package/src/test-utilities/getMockToken.ts +0 -25
  284. package/src/test-utilities/index.ts +0 -4
  285. package/src/transformers/borderToCss.ts +0 -38
  286. package/src/transformers/colorToHex.ts +0 -16
  287. package/src/transformers/colorToHexAlpha.ts +0 -23
  288. package/src/transformers/colorToHexMix.ts +0 -19
  289. package/src/transformers/colorToRgbAlpha.ts +0 -19
  290. package/src/transformers/colorToRgbaFloat.ts +0 -45
  291. package/src/transformers/dimensionToPixelUnitless.ts +0 -60
  292. package/src/transformers/dimensionToRem.ts +0 -56
  293. package/src/transformers/dimensionToRemPxArray.ts +0 -60
  294. package/src/transformers/durationToCss.ts +0 -29
  295. package/src/transformers/figmaAttributes.ts +0 -79
  296. package/src/transformers/floatToPixel.ts +0 -40
  297. package/src/transformers/fontFamilyToCss.ts +0 -37
  298. package/src/transformers/fontFamilyToFigma.ts +0 -47
  299. package/src/transformers/fontWeightToNumber.ts +0 -53
  300. package/src/transformers/index.ts +0 -24
  301. package/src/transformers/jsonDeprecated.ts +0 -15
  302. package/src/transformers/namePathToDotNotation.ts +0 -34
  303. package/src/transformers/namePathToFigma.ts +0 -28
  304. package/src/transformers/namePathToKebabCase.ts +0 -19
  305. package/src/transformers/namePathToSlashNotation.ts +0 -19
  306. package/src/transformers/shadowToCss.ts +0 -37
  307. package/src/transformers/typographyToCss.ts +0 -31
  308. package/src/transformers/utilities/alpha.ts +0 -23
  309. package/src/transformers/utilities/checkRequiredTokenProperties.ts +0 -16
  310. package/src/transformers/utilities/getTokenValue.ts +0 -18
  311. package/src/transformers/utilities/hasSpaceInString.ts +0 -6
  312. package/src/transformers/utilities/hexToRgbaFloat.ts +0 -31
  313. package/src/transformers/utilities/invalidTokenError.ts +0 -34
  314. package/src/transformers/utilities/isRgbaFloat.ts +0 -29
  315. package/src/transformers/utilities/mix.ts +0 -46
  316. package/src/transformers/utilities/rgbaFloatToHex.ts +0 -15
  317. package/src/types/Border.d.ts +0 -5
  318. package/src/types/BorderTokenValue.d.ts +0 -10
  319. package/src/types/ColorHex.d.ts +0 -4
  320. package/src/types/PlatformInitializer.d.ts +0 -11
  321. package/src/types/Shadow.d.ts +0 -5
  322. package/src/types/ShadowTokenValue.d.ts +0 -14
  323. package/src/types/SizeEm.d.ts +0 -4
  324. package/src/types/SizePx.d.ts +0 -4
  325. package/src/types/SizeRem.d.ts +0 -4
  326. package/src/types/StyleDictionaryConfigGenerator.d.ts +0 -15
  327. package/src/types/TokenBuildInput.d.ts +0 -8
  328. package/src/types/TypographyTokenValue.d.ts +0 -12
  329. package/src/types/w3cTransformedToken.d.ts +0 -8
  330. package/src/utilities/copyFromDir.ts +0 -21
  331. package/src/utilities/index.ts +0 -3
  332. package/src/utilities/joinFriendly.ts +0 -2
  333. package/src/utilities/schemaErrorMessage.ts +0 -2
  334. package/src/utilities/toCamelCase.ts +0 -29
  335. package/src/utilities/treeWalker.ts +0 -27
@@ -0,0 +1,6 @@
1
+ export declare const rgbaFloatToHex: ({ r, g, b, a }: {
2
+ r: number;
3
+ g: number;
4
+ b: number;
5
+ a?: number;
6
+ }, alpha?: boolean) => string;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rgbaFloatToHex = void 0;
4
+ const rgbaFloatToHex = ({ r, g, b, a }, alpha = true) => {
5
+ const values = [r, g, b, alpha === true && a && a < 1 ? a : undefined].filter(item => item !== undefined);
6
+ if (r > 1 || r < 0 || g > 1 || g < 0 || b > 1 || b < 0) {
7
+ throw new Error('Invalid RgbaFloat value. R, G and B values must be between 0 and 1.');
8
+ }
9
+ return `#${values
10
+ .map(v => Number(parseInt(`${v * 255}`, 10))
11
+ .toString(16)
12
+ .padStart(2, '0'))
13
+ .join('')}`;
14
+ };
15
+ exports.rgbaFloatToHex = rgbaFloatToHex;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * copyFromDir
3
+ * @description Copies all files from source folder to destination
4
+ * @param source path
5
+ * @param destination path
6
+ * @returns promise
7
+ */
8
+ export declare const copyFromDir: (source: string, destination: string) => Promise<void>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.copyFromDir = void 0;
13
+ /* istanbul ignore file */
14
+ const promises_1 = require("fs/promises");
15
+ /**
16
+ * copyFromDir
17
+ * @description Copies all files from source folder to destination
18
+ * @param source path
19
+ * @param destination path
20
+ * @returns promise
21
+ */
22
+ const copyFromDir = (source, destination) => __awaiter(void 0, void 0, void 0, function* () {
23
+ // adjust trailing slash
24
+ const src = `${source.replace(/\/$/, '')}`;
25
+ const dest = `${destination.replace(/\/$/, '')}`;
26
+ // create dest if it does not exists
27
+ yield (0, promises_1.mkdir)(dest, { recursive: true });
28
+ // read files from source
29
+ const files = yield (0, promises_1.readdir)(src);
30
+ for (const file of files) {
31
+ (0, promises_1.copyFile)(`${src}/${file}`, `${dest}/${file}`);
32
+ }
33
+ });
34
+ exports.copyFromDir = copyFromDir;
@@ -0,0 +1 @@
1
+ export declare const filterStringArray: (string: string[]) => string[];
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.filterStringArray = void 0;
4
+ const filterStringArray = (string) => {
5
+ // match unsupported characters
6
+ const regex = /[^a-zA-Z0-9]+/g;
7
+ // replace any non-letter and non-number character and split into word array
8
+ const stringArray = string
9
+ .filter(Boolean)
10
+ .join(' ')
11
+ .replace(regex, ' ')
12
+ .split(' ')
13
+ // remove undefined if exists
14
+ .filter((part) => Boolean(part) && typeof part === 'string');
15
+ return stringArray;
16
+ };
17
+ exports.filterStringArray = filterStringArray;
@@ -5,8 +5,4 @@
5
5
  * @returns null if flag is not found, otherwise the value of the flag or the flag name if the flag has no value
6
6
  * @example `getFlag('--silent')` returns `null` if `--silent` is not found, `--silent` if `--silent` is found with no value, and `true` if `--silent=true` is found
7
7
  */
8
- export const getFlag = (flag: string, prefix = '--') => {
9
- flag = `${prefix}${flag.replace(prefix, '')}`
10
- const index = process.argv.findIndex(arg => arg === flag || arg.startsWith(`${flag}=`))
11
- return index === -1 ? null : process.argv[index].replace(`${flag}=`, '')
12
- }
8
+ export declare const getFlag: (flag: string, prefix?: string) => string | null;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFlag = void 0;
4
+ /**
5
+ * Get the value of a flag from the command line
6
+ * @param flag name of the flag to get
7
+ * @param prefix default `--` but can be changed to `-` the part to the left of the flag name
8
+ * @returns null if flag is not found, otherwise the value of the flag or the flag name if the flag has no value
9
+ * @example `getFlag('--silent')` returns `null` if `--silent` is not found, `--silent` if `--silent` is found with no value, and `true` if `--silent=true` is found
10
+ */
11
+ const getFlag = (flag, prefix = '--') => {
12
+ flag = `${prefix}${flag.replace(prefix, '')}`;
13
+ const index = process.argv.findIndex(arg => arg === flag || arg.startsWith(`${flag}=`));
14
+ return index === -1 ? null : process.argv[index].replace(`${flag}=`, '');
15
+ };
16
+ exports.getFlag = getFlag;
@@ -0,0 +1,3 @@
1
+ export { copyFromDir } from './copyFromDir';
2
+ export { upperCaseFirstCharacter } from './upperCaseFirstCharacter';
3
+ export { toCamelCase } from './toCamelCase';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toCamelCase = exports.upperCaseFirstCharacter = exports.copyFromDir = void 0;
4
+ var copyFromDir_1 = require("./copyFromDir");
5
+ Object.defineProperty(exports, "copyFromDir", { enumerable: true, get: function () { return copyFromDir_1.copyFromDir; } });
6
+ var upperCaseFirstCharacter_1 = require("./upperCaseFirstCharacter");
7
+ Object.defineProperty(exports, "upperCaseFirstCharacter", { enumerable: true, get: function () { return upperCaseFirstCharacter_1.upperCaseFirstCharacter; } });
8
+ var toCamelCase_1 = require("./toCamelCase");
9
+ Object.defineProperty(exports, "toCamelCase", { enumerable: true, get: function () { return toCamelCase_1.toCamelCase; } });
@@ -0,0 +1 @@
1
+ export declare const joinFriendly: (array: string[], lastJoin?: string) => string;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.joinFriendly = void 0;
4
+ const joinFriendly = (array, lastJoin = 'and') => array.length > 1 ? `${array.slice(0, -1).join(', ')} ${lastJoin} ${array.slice(-1)}` : `${array[0]}`;
5
+ exports.joinFriendly = joinFriendly;
@@ -0,0 +1 @@
1
+ export declare const schemaErrorMessage: (title: string, description?: string) => string;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.schemaErrorMessage = void 0;
4
+ const schemaErrorMessage = (title, description) => `**${title}**${description ? `\n${description}` : ``}`;
5
+ exports.schemaErrorMessage = schemaErrorMessage;
@@ -0,0 +1 @@
1
+ export declare const toCamelCase: (string: string | string[]) => string;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toCamelCase = void 0;
4
+ const filterStringArray_1 = require("./filterStringArray");
5
+ const upperCaseFirstCharacter_1 = require("./upperCaseFirstCharacter");
6
+ const toCamelCase = (string) => {
7
+ if (!Array.isArray(string)) {
8
+ string = [string];
9
+ }
10
+ return ((0, filterStringArray_1.filterStringArray)(string)
11
+ // ucFirst all but first part
12
+ .map((part, index) => {
13
+ if (index > 0) {
14
+ return (0, upperCaseFirstCharacter_1.upperCaseFirstCharacter)(part);
15
+ }
16
+ return part;
17
+ })
18
+ .join(''));
19
+ };
20
+ exports.toCamelCase = toCamelCase;
@@ -0,0 +1 @@
1
+ export declare const toPascalCase: (string: string | string[]) => string;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toPascalCase = void 0;
4
+ const filterStringArray_1 = require("./filterStringArray");
5
+ const upperCaseFirstCharacter_1 = require("./upperCaseFirstCharacter");
6
+ const toPascalCase = (string) => {
7
+ if (!Array.isArray(string)) {
8
+ string = [string];
9
+ }
10
+ return ((0, filterStringArray_1.filterStringArray)(string)
11
+ // ucFirst all but first part
12
+ .map((part) => {
13
+ return (0, upperCaseFirstCharacter_1.upperCaseFirstCharacter)(part);
14
+ })
15
+ .join(''));
16
+ };
17
+ exports.toPascalCase = toPascalCase;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @description converts tokens to type and returns array with used type
3
+ * @param tree object
4
+ * @param callback function to be run on valid items
5
+ * @param validItem function to test if a node is a validItem to be transformed
6
+ * @returns object
7
+ */
8
+ export declare const treeWalker: (tree: unknown, callback: <T>(argument: T) => unknown, isValidItem: (argument: unknown) => boolean) => unknown;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.treeWalker = void 0;
4
+ /**
5
+ * @description converts tokens to type and returns array with used type
6
+ * @param tree object
7
+ * @param callback function to be run on valid items
8
+ * @param validItem function to test if a node is a validItem to be transformed
9
+ * @returns object
10
+ */
11
+ const treeWalker = (tree, callback, isValidItem) => {
12
+ // is a valid item -> pass through callback
13
+ if (isValidItem(tree)) {
14
+ return callback(tree);
15
+ }
16
+ // is non-object value -> ignore
17
+ if (typeof tree !== 'object' || tree === null) {
18
+ return;
19
+ }
20
+ // is obj -> continue
21
+ const nextObj = {};
22
+ for (const [prop, value] of Object.entries(tree)) {
23
+ nextObj[prop] = (0, exports.treeWalker)(value, callback, isValidItem);
24
+ }
25
+ return nextObj;
26
+ };
27
+ exports.treeWalker = treeWalker;
@@ -5,6 +5,4 @@
5
5
  * @param string
6
6
  * @returns string
7
7
  */
8
- export const upperCaseFirstCharacter = ([firstLetter, ...restOfWord]: string): string => {
9
- return firstLetter.toUpperCase() + restOfWord.join('')
10
- }
8
+ export declare const upperCaseFirstCharacter: ([firstLetter, ...restOfWord]: string) => string;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.upperCaseFirstCharacter = void 0;
4
+ /**
5
+ * upperCaseFirstCharacter
6
+ * @scope custom implementation should only be used within `name path to ...` transformer
7
+ * @description changes first letter to uppercase but keeps the rest of the word as is
8
+ * @param string
9
+ * @returns string
10
+ */
11
+ const upperCaseFirstCharacter = ([firstLetter, ...restOfWord]) => {
12
+ return firstLetter.toUpperCase() + restOfWord.join('');
13
+ };
14
+ exports.upperCaseFirstCharacter = upperCaseFirstCharacter;
@@ -1,5 +1,5 @@
1
1
  :root {
2
- --motion-skeletonLoader-shimmer-duration-scale: 1s;
3
- --motion-spinner-duration-rotation: 1s;
4
- --motion-loading-delay-default: 1s;
2
+ --motion-skeletonLoader-shimmer-duration-scale: 1s; /* The amount of times it takes the "shimmer" effect to go from the start (left) of the skeleton loader to the end (right) */
3
+ --motion-spinner-duration-rotation: 1s; /* The amount of time it takes the "Spinner" loading indicator to make a full 360deg rotation */
4
+ --motion-loading-delay-default: 1s; /* The amount of time to wait before showing a loading indicator or announcing a loading state to assistive technologies. */
5
5
  }
@@ -1,5 +1,5 @@
1
1
  :root {
2
- --boxShadow-thin: inset 0 0 0 max(1px, 0.0625rem);
2
+ --boxShadow-thin: inset 0 0 0 max(1px, 0.0625rem); /* Thin shadow for borders */
3
3
  --boxShadow-thick: inset 0 0 0 max(2px, 0.125rem);
4
4
  --boxShadow-thicker: inset 0 0 0 max(4px, 0.25rem);
5
5
  --borderWidth-thin: max(1px, 0.0625rem);
@@ -8,7 +8,7 @@
8
8
  --borderRadius-small: 0.1875rem;
9
9
  --borderRadius-medium: 0.375rem;
10
10
  --borderRadius-large: 0.75rem;
11
- --borderRadius-full: 624.9375rem;
11
+ --borderRadius-full: 624.9375rem; /* Use this border radius for pill shaped elements */
12
12
  --borderRadius-default: 0.375rem;
13
13
  --outline-focus-offset: -0.125rem;
14
14
  --outline-focus-width: 0.125rem;
@@ -34,15 +34,15 @@
34
34
  --text-title-weight-medium: var(--base-text-weight-semibold);
35
35
  --text-title-weight-large: var(--base-text-weight-semibold);
36
36
  --text-display-weight: var(--base-text-weight-medium);
37
- --text-codeInline-shorthand: var(--text-codeInline-weight) var(--text-codeInline-size) var(--fontStack-monospace);
38
- --text-codeBlock-shorthand: var(--text-codeBlock-weight) var(--text-codeBlock-size) / var(--text-codeBlock-lineHeight) var(--fontStack-monospace);
39
- --text-caption-shorthand: var(--text-caption-weight) var(--text-caption-size) / var(--text-caption-lineHeight) var(--fontStack-sansSerif);
40
- --text-body-shorthand-small: var(--text-body-weight) var(--text-body-size-small) / var(--text-body-lineHeight-small) var(--fontStack-sansSerif);
41
- --text-body-shorthand-medium: var(--text-body-weight) var(--text-body-size-medium) / var(--text-body-lineHeight-medium) var(--fontStack-sansSerif);
42
- --text-body-shorthand-large: var(--text-body-weight) var(--text-body-size-large) / var(--text-body-lineHeight-large) var(--fontStack-sansSerif);
43
- --text-subtitle-shorthand: var(--text-subtitle-weight) var(--text-subtitle-size) / var(--text-subtitle-lineHeight) var(--fontStack-sansSerifDisplay);
44
- --text-title-shorthand-small: var(--text-title-weight-small) var(--text-title-size-small) / var(--text-title-lineHeight-small) var(--fontStack-sansSerif);
45
- --text-title-shorthand-medium: var(--text-title-weight-medium) var(--text-title-size-medium) / var(--text-title-lineHeight-medium) var(--fontStack-sansSerifDisplay);
46
- --text-title-shorthand-large: var(--text-title-weight-large) var(--text-title-size-large) / var(--text-title-lineHeight-large) var(--fontStack-sansSerifDisplay);
47
- --text-display-shorthand: var(--text-display-weight) var(--text-display-size) / var(--text-display-lineHeight) var(--fontStack-sansSerifDisplay);
37
+ --text-codeInline-shorthand: var(--text-codeInline-weight) var(--text-codeInline-size) var(--fontStack-monospace); /* Inline code blocks using em units to inherit size from its parent. */
38
+ --text-codeBlock-shorthand: var(--text-codeBlock-weight) var(--text-codeBlock-size) / var(--text-codeBlock-lineHeight) var(--fontStack-monospace); /* Default style for rendering code blocks. */
39
+ --text-caption-shorthand: var(--text-caption-weight) var(--text-caption-size) / var(--text-caption-lineHeight) var(--fontStack-sansSerif); /* Compact small font with a smaller line height of 16px. Use it for single-line scenarios, as the small sizing doesn’t pass accessibility requirements. */
40
+ --text-body-shorthand-small: var(--text-body-weight) var(--text-body-size-small) / var(--text-body-lineHeight-small) var(--fontStack-sansSerif); /* Small body text for discrete UI applications, such as helper, footnote text. Should be used sparingly across pages. Line-height matches Body (medium) at 20px. */
41
+ --text-body-shorthand-medium: var(--text-body-weight) var(--text-body-size-medium) / var(--text-body-lineHeight-medium) var(--fontStack-sansSerif); /* Default UI font. Most commonly used for body text. */
42
+ --text-body-shorthand-large: var(--text-body-weight) var(--text-body-size-large) / var(--text-body-lineHeight-large) var(--fontStack-sansSerif); /* User-generated content, markdown rendering. */
43
+ --text-subtitle-shorthand: var(--text-subtitle-weight) var(--text-subtitle-size) / var(--text-subtitle-lineHeight) var(--fontStack-sansSerifDisplay); /* Page sections/sub headings, or less important object names in page titles (automated action titles, for example). Same line-height as title (medium). */
44
+ --text-title-shorthand-small: var(--text-title-weight-small) var(--text-title-size-small) / var(--text-title-lineHeight-small) var(--fontStack-sansSerif); /* Uses the same size as body (large) with a heavier weight of semibold (600). */
45
+ --text-title-shorthand-medium: var(--text-title-weight-medium) var(--text-title-size-medium) / var(--text-title-lineHeight-medium) var(--fontStack-sansSerifDisplay); /* Default page title. The 32px-equivalent line-height matches with button and other medium control heights. Great for page header composition. */
46
+ --text-title-shorthand-large: var(--text-title-weight-large) var(--text-title-size-large) / var(--text-title-lineHeight-large) var(--fontStack-sansSerifDisplay); /* Page headings for user-created objects, such as issues or pull requests. Utilize title (medium) styles on narrow viewports. */
47
+ --text-display-shorthand: var(--text-display-weight) var(--text-display-size) / var(--text-display-lineHeight) var(--fontStack-sansSerifDisplay); /* Hero-style text for brand to product transition pages. Utilize Title (large) styles on narrow viewports. */
48
48
  }
@@ -26,12 +26,12 @@
26
26
  --base-text-weight-semibold: 600;
27
27
  }
28
28
  :root {
29
- --motion-skeletonLoader-shimmer-duration-scale: 1s;
30
- --motion-spinner-duration-rotation: 1s;
31
- --motion-loading-delay-default: 1s;
29
+ --motion-skeletonLoader-shimmer-duration-scale: 1s; /* The amount of times it takes the "shimmer" effect to go from the start (left) of the skeleton loader to the end (right) */
30
+ --motion-spinner-duration-rotation: 1s; /* The amount of time it takes the "Spinner" loading indicator to make a full 360deg rotation */
31
+ --motion-loading-delay-default: 1s; /* The amount of time to wait before showing a loading indicator or announcing a loading state to assistive technologies. */
32
32
  }
33
33
  :root {
34
- --boxShadow-thin: inset 0 0 0 max(1px, 0.0625rem);
34
+ --boxShadow-thin: inset 0 0 0 max(1px, 0.0625rem); /* Thin shadow for borders */
35
35
  --boxShadow-thick: inset 0 0 0 max(2px, 0.125rem);
36
36
  --boxShadow-thicker: inset 0 0 0 max(4px, 0.25rem);
37
37
  --borderWidth-thin: max(1px, 0.0625rem);
@@ -40,7 +40,7 @@
40
40
  --borderRadius-small: 0.1875rem;
41
41
  --borderRadius-medium: 0.375rem;
42
42
  --borderRadius-large: 0.75rem;
43
- --borderRadius-full: 624.9375rem;
43
+ --borderRadius-full: 624.9375rem; /* Use this border radius for pill shaped elements */
44
44
  --borderRadius-default: 0.375rem;
45
45
  --outline-focus-offset: -0.125rem;
46
46
  --outline-focus-width: 0.125rem;
@@ -171,15 +171,15 @@
171
171
  --text-title-weight-medium: var(--base-text-weight-semibold);
172
172
  --text-title-weight-large: var(--base-text-weight-semibold);
173
173
  --text-display-weight: var(--base-text-weight-medium);
174
- --text-codeInline-shorthand: var(--text-codeInline-weight) var(--text-codeInline-size) var(--fontStack-monospace);
175
- --text-codeBlock-shorthand: var(--text-codeBlock-weight) var(--text-codeBlock-size) / var(--text-codeBlock-lineHeight) var(--fontStack-monospace);
176
- --text-caption-shorthand: var(--text-caption-weight) var(--text-caption-size) / var(--text-caption-lineHeight) var(--fontStack-sansSerif);
177
- --text-body-shorthand-small: var(--text-body-weight) var(--text-body-size-small) / var(--text-body-lineHeight-small) var(--fontStack-sansSerif);
178
- --text-body-shorthand-medium: var(--text-body-weight) var(--text-body-size-medium) / var(--text-body-lineHeight-medium) var(--fontStack-sansSerif);
179
- --text-body-shorthand-large: var(--text-body-weight) var(--text-body-size-large) / var(--text-body-lineHeight-large) var(--fontStack-sansSerif);
180
- --text-subtitle-shorthand: var(--text-subtitle-weight) var(--text-subtitle-size) / var(--text-subtitle-lineHeight) var(--fontStack-sansSerifDisplay);
181
- --text-title-shorthand-small: var(--text-title-weight-small) var(--text-title-size-small) / var(--text-title-lineHeight-small) var(--fontStack-sansSerif);
182
- --text-title-shorthand-medium: var(--text-title-weight-medium) var(--text-title-size-medium) / var(--text-title-lineHeight-medium) var(--fontStack-sansSerifDisplay);
183
- --text-title-shorthand-large: var(--text-title-weight-large) var(--text-title-size-large) / var(--text-title-lineHeight-large) var(--fontStack-sansSerifDisplay);
184
- --text-display-shorthand: var(--text-display-weight) var(--text-display-size) / var(--text-display-lineHeight) var(--fontStack-sansSerifDisplay);
174
+ --text-codeInline-shorthand: var(--text-codeInline-weight) var(--text-codeInline-size) var(--fontStack-monospace); /* Inline code blocks using em units to inherit size from its parent. */
175
+ --text-codeBlock-shorthand: var(--text-codeBlock-weight) var(--text-codeBlock-size) / var(--text-codeBlock-lineHeight) var(--fontStack-monospace); /* Default style for rendering code blocks. */
176
+ --text-caption-shorthand: var(--text-caption-weight) var(--text-caption-size) / var(--text-caption-lineHeight) var(--fontStack-sansSerif); /* Compact small font with a smaller line height of 16px. Use it for single-line scenarios, as the small sizing doesn’t pass accessibility requirements. */
177
+ --text-body-shorthand-small: var(--text-body-weight) var(--text-body-size-small) / var(--text-body-lineHeight-small) var(--fontStack-sansSerif); /* Small body text for discrete UI applications, such as helper, footnote text. Should be used sparingly across pages. Line-height matches Body (medium) at 20px. */
178
+ --text-body-shorthand-medium: var(--text-body-weight) var(--text-body-size-medium) / var(--text-body-lineHeight-medium) var(--fontStack-sansSerif); /* Default UI font. Most commonly used for body text. */
179
+ --text-body-shorthand-large: var(--text-body-weight) var(--text-body-size-large) / var(--text-body-lineHeight-large) var(--fontStack-sansSerif); /* User-generated content, markdown rendering. */
180
+ --text-subtitle-shorthand: var(--text-subtitle-weight) var(--text-subtitle-size) / var(--text-subtitle-lineHeight) var(--fontStack-sansSerifDisplay); /* Page sections/sub headings, or less important object names in page titles (automated action titles, for example). Same line-height as title (medium). */
181
+ --text-title-shorthand-small: var(--text-title-weight-small) var(--text-title-size-small) / var(--text-title-lineHeight-small) var(--fontStack-sansSerif); /* Uses the same size as body (large) with a heavier weight of semibold (600). */
182
+ --text-title-shorthand-medium: var(--text-title-weight-medium) var(--text-title-size-medium) / var(--text-title-lineHeight-medium) var(--fontStack-sansSerifDisplay); /* Default page title. The 32px-equivalent line-height matches with button and other medium control heights. Great for page header composition. */
183
+ --text-title-shorthand-large: var(--text-title-weight-large) var(--text-title-size-large) / var(--text-title-lineHeight-large) var(--fontStack-sansSerifDisplay); /* Page headings for user-created objects, such as issues or pull requests. Utilize title (medium) styles on narrow viewports. */
184
+ --text-display-shorthand: var(--text-display-weight) var(--text-display-size) / var(--text-display-lineHeight) var(--fontStack-sansSerifDisplay); /* Hero-style text for brand to product transition pages. Utilize Title (large) styles on narrow viewports. */
185
185
  }
package/package.json CHANGED
@@ -1,14 +1,10 @@
1
1
  {
2
2
  "name": "@primer/primitives",
3
- "version": "9.0.3",
3
+ "version": "9.1.0-rc.56a8ee48",
4
4
  "description": "Typography, spacing, and color primitives for Primer design system",
5
- "engines": {
6
- "node": ">=18.18.0 <18.19.0"
7
- },
8
5
  "files": [
9
6
  "dist",
10
- "src/**/*",
11
- "!src/**/*.test.ts"
7
+ "src/tokens"
12
8
  ],
13
9
  "repository": "https://github.com/primer/primitives",
14
10
  "keywords": [
@@ -26,11 +22,12 @@
26
22
  },
27
23
  "homepage": "https://github.com/primer/primitives#readme",
28
24
  "scripts": {
29
- "build": "npm run build:v8 && npm run build:fallbacks && npm run build:figma",
25
+ "build": "npm run build:v8 && npm run build:fallbacks && npm run build:figma && npm run build:config",
30
26
  "build:next": "echo '\\033[31m 🛑 Use npm run build instead of npm run build:next\\033[0m'",
31
27
  "build:v8": "tsx ./scripts/buildTokens.ts",
32
28
  "build:fallbacks": "tsx ./scripts/buildFallbacks.ts",
33
29
  "build:figma": "tsx scripts/buildFigma.ts",
30
+ "build:config": "tsc -p buildConfig.tsconfig.jsonc",
34
31
  "tokenJson:check": "tsx scripts/diffThemes.ts && tsx scripts/diffTokenProps.ts",
35
32
  "contrast:check": "tsx scripts/color-contrast.ts",
36
33
  "format": "prettier --write '**/*.{js,jsx,ts,tsx,md,mdx,css}'",
@@ -43,7 +40,8 @@
43
40
  "prepack": "npm run build",
44
41
  "release": "changeset publish",
45
42
  "start:storybook": "npm run build && cd docs/storybook && npm run storybook",
46
- "test": "vitest run --coverage"
43
+ "test": "vitest run --coverage",
44
+ "test:integration": "vitest run -r integration"
47
45
  },
48
46
  "prettier": "@github/prettier-config",
49
47
  "devDependencies": {
@@ -1,232 +0,0 @@
1
- import StyleDictionary from 'style-dictionary'
2
- import {w3cJsonParser} from './parsers'
3
- import {
4
- borderToCss,
5
- colorToHexAlpha,
6
- colorToRgbAlpha,
7
- colorToHex,
8
- colorToHexMix,
9
- colorToRgbaFloat,
10
- dimensionToRem,
11
- dimensionToPixelUnitless,
12
- durationToCss,
13
- figmaAttributes,
14
- fontFamilyToCss,
15
- fontFamilyToFigma,
16
- fontWeightToNumber,
17
- jsonDeprecated,
18
- namePathToDotNotation,
19
- namePathToCamelCase,
20
- namePathToKebabCase,
21
- namePathToSlashNotation,
22
- namePathToFigma,
23
- shadowToCss,
24
- typographyToCss,
25
- dimensionToRemPxArray,
26
- floatToPixel,
27
- floatToPixelUnitless,
28
- } from './transformers'
29
- import {
30
- javascriptCommonJs,
31
- javascriptEsm,
32
- typescriptExportDefinition,
33
- jsonNestedPrefixed,
34
- cssCustomMedia,
35
- jsonOneDimensional,
36
- jsonPostCssFallback,
37
- cssAdvanced,
38
- jsonFigma,
39
- } from './formats'
40
-
41
- /**
42
- * Parsers
43
- *
44
- */
45
- StyleDictionary.registerParser(w3cJsonParser)
46
-
47
- /**
48
- * Formats
49
- *
50
- */
51
- StyleDictionary.registerFormat({
52
- name: 'css/advanced',
53
- formatter: cssAdvanced,
54
- })
55
-
56
- StyleDictionary.registerFormat({
57
- name: 'css/customMedia',
58
- formatter: cssCustomMedia,
59
- })
60
-
61
- StyleDictionary.registerFormat({
62
- name: 'javascript/esm',
63
- formatter: javascriptEsm,
64
- })
65
-
66
- StyleDictionary.registerFormat({
67
- name: 'javascript/commonJs',
68
- formatter: javascriptCommonJs,
69
- })
70
-
71
- StyleDictionary.registerFormat({
72
- name: 'typescript/export-definition',
73
- formatter: typescriptExportDefinition,
74
- })
75
-
76
- StyleDictionary.registerFormat({
77
- name: 'json/nested-prefixed',
78
- formatter: jsonNestedPrefixed,
79
- })
80
-
81
- StyleDictionary.registerFormat({
82
- name: 'json/one-dimensional',
83
- formatter: jsonOneDimensional,
84
- })
85
-
86
- StyleDictionary.registerFormat({
87
- name: 'json/postCss-fallback',
88
- formatter: jsonPostCssFallback,
89
- })
90
-
91
- StyleDictionary.registerFormat({
92
- name: 'json/figma',
93
- formatter: jsonFigma,
94
- })
95
-
96
- /**
97
- * Transformers
98
- *
99
- */
100
- StyleDictionary.registerTransform({
101
- name: 'color/rgbAlpha',
102
- ...colorToRgbAlpha,
103
- })
104
-
105
- StyleDictionary.registerTransform({
106
- name: 'color/rgbaFloat',
107
- ...colorToRgbaFloat,
108
- })
109
-
110
- StyleDictionary.registerTransform({
111
- name: 'color/hexAlpha',
112
- ...colorToHexAlpha,
113
- })
114
-
115
- StyleDictionary.registerTransform({
116
- name: 'color/hexMix',
117
- ...colorToHexMix,
118
- })
119
-
120
- StyleDictionary.registerTransform({
121
- name: 'color/hex',
122
- ...colorToHex,
123
- })
124
-
125
- StyleDictionary.registerTransform({
126
- name: 'float/pixel',
127
- ...floatToPixel,
128
- })
129
-
130
- StyleDictionary.registerTransform({
131
- name: 'float/pixelUnitless',
132
- ...floatToPixelUnitless,
133
- })
134
-
135
- StyleDictionary.registerTransform({
136
- name: 'dimension/rem',
137
- ...dimensionToRem,
138
- })
139
-
140
- StyleDictionary.registerTransform({
141
- name: 'dimension/remPxArray',
142
- ...dimensionToRemPxArray,
143
- })
144
-
145
- StyleDictionary.registerTransform({
146
- name: 'dimension/pixelUnitless',
147
- ...dimensionToPixelUnitless,
148
- })
149
-
150
- StyleDictionary.registerTransform({
151
- name: 'duration/css',
152
- ...durationToCss,
153
- })
154
-
155
- StyleDictionary.registerTransform({
156
- name: 'figma/attributes',
157
- ...figmaAttributes,
158
- })
159
-
160
- StyleDictionary.registerTransform({
161
- name: 'json/deprecated',
162
- ...jsonDeprecated,
163
- })
164
-
165
- StyleDictionary.registerTransform({
166
- name: 'name/pathToCamelCase',
167
- ...namePathToCamelCase,
168
- })
169
-
170
- StyleDictionary.registerTransform({
171
- name: 'name/pathToDotNotation',
172
- ...namePathToDotNotation,
173
- })
174
-
175
- StyleDictionary.registerTransform({
176
- name: 'name/pathToFigma',
177
- ...namePathToFigma,
178
- })
179
-
180
- StyleDictionary.registerTransform({
181
- name: 'name/pathToCamelCase',
182
- ...namePathToCamelCase,
183
- })
184
-
185
- StyleDictionary.registerTransform({
186
- name: 'name/pathToKebabCase',
187
- ...namePathToKebabCase,
188
- })
189
-
190
- StyleDictionary.registerTransform({
191
- name: 'name/pathToSlashNotation',
192
- ...namePathToSlashNotation,
193
- })
194
-
195
- StyleDictionary.registerTransform({
196
- name: 'shadow/css',
197
- ...shadowToCss,
198
- })
199
-
200
- StyleDictionary.registerTransform({
201
- name: 'border/css',
202
- ...borderToCss,
203
- })
204
-
205
- StyleDictionary.registerTransform({
206
- name: 'typography/css',
207
- ...typographyToCss,
208
- })
209
-
210
- StyleDictionary.registerTransform({
211
- name: 'fontWeight/number',
212
- ...fontWeightToNumber,
213
- })
214
-
215
- StyleDictionary.registerTransform({
216
- name: 'fontFamily/css',
217
- ...fontFamilyToCss,
218
- })
219
-
220
- StyleDictionary.registerTransform({
221
- name: 'fontFamily/figma',
222
- ...fontFamilyToFigma,
223
- })
224
-
225
- /**
226
- * @name {@link PrimerStyleDictionary}
227
- * @description Returns style dictionary object with primer preset that includes parsers, formats and transformers
228
- * @parsers [w3cJsonParser](https://github.com/primer/primitives/blob/main/config//parsers/w3c-json-parser.ts)
229
- * @formats [javascript/esm](https://github.com/primer/primitives/blob/main/config/formats/javascript-esm.ts), [javascript/commonJs](https://github.com/primer/primitives/blob/main/config/formats/javascript-commonJs.ts), [typescript/export-definition](https://github.com/primer/primitives/blob/main/config/formats/typescript-export-defition.ts)
230
- * @transformers [color/rgbAlpha](https://github.com/primer/primitives/blob/main/config/tranformers/color-to-rgb-alpha.ts), [color/hexAlpha](https://github.com/primer/primitives/blob/main/config/tranformers/color-to-hex-alpha.ts), [color/hex](https://github.com/primer/primitives/blob/main/config/tranformers/color-to-hex6.ts), [json/deprecated](https://github.com/primer/primitives/blob/main/config/tranformers/json-deprecated.ts), [name/pathToDotNotation](https://github.com/primer/primitives/blob/main/config/tranformers/name-path-to-dot-notation.ts)
231
- */
232
- export const PrimerStyleDictionary: StyleDictionary.Core = StyleDictionary