@primer/primitives 9.1.2 → 10.0.0-rc.29e661a3

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 (289) hide show
  1. package/dist/build/PrimerStyleDictionary.d.ts +1 -2
  2. package/dist/build/PrimerStyleDictionary.js +51 -64
  3. package/dist/build/filters/index.d.ts +14 -13
  4. package/dist/build/filters/index.js +14 -29
  5. package/dist/build/filters/isBorder.d.ts +3 -3
  6. package/dist/build/filters/isBorder.js +2 -6
  7. package/dist/build/filters/isColor.d.ts +3 -3
  8. package/dist/build/filters/isColor.js +8 -7
  9. package/dist/build/filters/isColorWithAlpha.d.ts +3 -3
  10. package/dist/build/filters/isColorWithAlpha.js +4 -8
  11. package/dist/build/filters/isColorWithMix.d.ts +3 -3
  12. package/dist/build/filters/isColorWithMix.js +4 -8
  13. package/dist/build/filters/isDeprecated.d.ts +3 -3
  14. package/dist/build/filters/isDeprecated.js +2 -6
  15. package/dist/build/filters/isDimension.d.ts +3 -3
  16. package/dist/build/filters/isDimension.js +2 -6
  17. package/dist/build/filters/isDuration.d.ts +3 -3
  18. package/dist/build/filters/isDuration.js +2 -6
  19. package/dist/build/filters/isFontFamily.d.ts +3 -3
  20. package/dist/build/filters/isFontFamily.js +2 -6
  21. package/dist/build/filters/isFontWeight.d.ts +3 -3
  22. package/dist/build/filters/isFontWeight.js +2 -6
  23. package/dist/build/filters/isFromFile.d.ts +3 -3
  24. package/dist/build/filters/isFromFile.js +2 -6
  25. package/dist/build/filters/isNumber.d.ts +3 -3
  26. package/dist/build/filters/isNumber.js +4 -6
  27. package/dist/build/filters/isShadow.d.ts +3 -3
  28. package/dist/build/filters/isShadow.js +2 -6
  29. package/dist/build/filters/isSource.d.ts +3 -3
  30. package/dist/build/filters/isSource.js +2 -6
  31. package/dist/build/filters/isTypography.d.ts +3 -3
  32. package/dist/build/filters/isTypography.js +2 -6
  33. package/dist/build/formats/cssAdvanced.d.ts +2 -2
  34. package/dist/build/formats/cssAdvanced.js +22 -20
  35. package/dist/build/formats/cssCustomMedia.d.ts +2 -2
  36. package/dist/build/formats/cssCustomMedia.js +16 -15
  37. package/dist/build/formats/index.d.ts +9 -9
  38. package/dist/build/formats/index.js +9 -21
  39. package/dist/build/formats/javascriptCommonJs.d.ts +2 -2
  40. package/dist/build/formats/javascriptCommonJs.js +17 -16
  41. package/dist/build/formats/javascriptEsm.d.ts +2 -2
  42. package/dist/build/formats/javascriptEsm.js +17 -16
  43. package/dist/build/formats/jsonFigma.d.ts +2 -2
  44. package/dist/build/formats/jsonFigma.js +27 -22
  45. package/dist/build/formats/jsonNestedPrefixed.d.ts +3 -3
  46. package/dist/build/formats/jsonNestedPrefixed.js +17 -15
  47. package/dist/build/formats/jsonOneDimensional.d.ts +3 -3
  48. package/dist/build/formats/jsonOneDimensional.js +24 -16
  49. package/dist/build/formats/jsonPostCssFallback.d.ts +3 -3
  50. package/dist/build/formats/jsonPostCssFallback.js +5 -12
  51. package/dist/build/formats/typescriptExportDefinition.d.ts +2 -2
  52. package/dist/build/formats/typescriptExportDefinition.js +48 -44
  53. package/dist/build/formats/utilities/getPropName.d.ts +1 -0
  54. package/dist/build/formats/utilities/getPropName.js +16 -0
  55. package/dist/build/formats/utilities/jsonToFlat.d.ts +2 -2
  56. package/dist/build/formats/utilities/jsonToFlat.js +1 -5
  57. package/dist/build/formats/utilities/jsonToNestedValue.d.ts +2 -2
  58. package/dist/build/formats/utilities/jsonToNestedValue.js +4 -6
  59. package/dist/build/formats/utilities/prefixTokens.d.ts +2 -2
  60. package/dist/build/formats/utilities/prefixTokens.js +1 -5
  61. package/dist/build/parsers/index.d.ts +1 -1
  62. package/dist/build/parsers/index.js +1 -5
  63. package/dist/build/parsers/w3cJsonParser.d.ts +2 -2
  64. package/dist/build/parsers/w3cJsonParser.js +5 -7
  65. package/dist/build/platforms/css.d.ts +1 -1
  66. package/dist/build/platforms/css.js +19 -11
  67. package/dist/build/platforms/deprecatedJson.d.ts +1 -1
  68. package/dist/build/platforms/deprecatedJson.js +3 -7
  69. package/dist/build/platforms/docJson.d.ts +1 -1
  70. package/dist/build/platforms/docJson.js +8 -7
  71. package/dist/build/platforms/fallbacks.d.ts +1 -1
  72. package/dist/build/platforms/fallbacks.js +3 -7
  73. package/dist/build/platforms/figma.d.ts +1 -1
  74. package/dist/build/platforms/figma.js +21 -14
  75. package/dist/build/platforms/index.d.ts +10 -10
  76. package/dist/build/platforms/index.js +10 -23
  77. package/dist/build/platforms/javascript.d.ts +1 -1
  78. package/dist/build/platforms/javascript.js +3 -7
  79. package/dist/build/platforms/json.d.ts +1 -1
  80. package/dist/build/platforms/json.js +3 -7
  81. package/dist/build/platforms/styleLint.d.ts +1 -1
  82. package/dist/build/platforms/styleLint.js +3 -7
  83. package/dist/build/platforms/typeDefinitions.d.ts +1 -1
  84. package/dist/build/platforms/typeDefinitions.js +6 -10
  85. package/dist/build/platforms/typescript.d.ts +1 -1
  86. package/dist/build/platforms/typescript.js +3 -7
  87. package/dist/build/schemas/alphaValue.js +4 -7
  88. package/dist/build/schemas/baseToken.d.ts +2 -2
  89. package/dist/build/schemas/baseToken.js +4 -7
  90. package/dist/build/schemas/borderToken.d.ts +5 -5
  91. package/dist/build/schemas/borderToken.js +13 -16
  92. package/dist/build/schemas/collections.js +8 -14
  93. package/dist/build/schemas/colorHexValue.js +4 -7
  94. package/dist/build/schemas/colorToken.d.ts +20 -15
  95. package/dist/build/schemas/colorToken.js +24 -24
  96. package/dist/build/schemas/designToken.js +28 -31
  97. package/dist/build/schemas/dimensionToken.d.ts +5 -5
  98. package/dist/build/schemas/dimensionToken.js +14 -17
  99. package/dist/build/schemas/dimensionValue.js +7 -10
  100. package/dist/build/schemas/durationToken.d.ts +5 -5
  101. package/dist/build/schemas/durationToken.js +8 -11
  102. package/dist/build/schemas/durationValue.js +4 -7
  103. package/dist/build/schemas/fontFamilyToken.d.ts +5 -5
  104. package/dist/build/schemas/fontFamilyToken.js +13 -16
  105. package/dist/build/schemas/fontWeightToken.d.ts +5 -5
  106. package/dist/build/schemas/fontWeightToken.js +14 -17
  107. package/dist/build/schemas/fontWeightValue.js +4 -7
  108. package/dist/build/schemas/numberToken.d.ts +5 -5
  109. package/dist/build/schemas/numberToken.js +15 -18
  110. package/dist/build/schemas/referenceValue.js +4 -7
  111. package/dist/build/schemas/scopes.js +5 -10
  112. package/dist/build/schemas/shadowToken.d.ts +5 -5
  113. package/dist/build/schemas/shadowToken.js +23 -26
  114. package/dist/build/schemas/stringToken.d.ts +5 -5
  115. package/dist/build/schemas/stringToken.js +7 -10
  116. package/dist/build/schemas/tokenName.js +4 -7
  117. package/dist/build/schemas/tokenType.d.ts +2 -2
  118. package/dist/build/schemas/tokenType.js +2 -6
  119. package/dist/build/schemas/typographyToken.d.ts +5 -5
  120. package/dist/build/schemas/typographyToken.js +14 -17
  121. package/dist/build/schemas/validTokenType.js +9 -13
  122. package/dist/build/schemas/viewportRangeToken.d.ts +5 -5
  123. package/dist/build/schemas/viewportRangeToken.js +7 -10
  124. package/dist/build/transformers/borderToCss.d.ts +3 -3
  125. package/dist/build/transformers/borderToCss.js +16 -16
  126. package/dist/build/transformers/colorToHex.d.ts +2 -2
  127. package/dist/build/transformers/colorToHex.js +11 -13
  128. package/dist/build/transformers/colorToHexMix.d.ts +2 -2
  129. package/dist/build/transformers/colorToHexMix.js +10 -15
  130. package/dist/build/transformers/colorToRgbAlpha.d.ts +2 -2
  131. package/dist/build/transformers/colorToRgbAlpha.js +10 -12
  132. package/dist/build/transformers/colorToRgbaFloat.d.ts +2 -2
  133. package/dist/build/transformers/colorToRgbaFloat.js +24 -28
  134. package/dist/build/transformers/dimensionToPixelUnitless.d.ts +2 -2
  135. package/dist/build/transformers/dimensionToPixelUnitless.js +13 -14
  136. package/dist/build/transformers/dimensionToRem.d.ts +2 -2
  137. package/dist/build/transformers/dimensionToRem.js +12 -13
  138. package/dist/build/transformers/dimensionToRemPxArray.d.ts +2 -2
  139. package/dist/build/transformers/dimensionToRemPxArray.js +11 -12
  140. package/dist/build/transformers/durationToCss.d.ts +2 -2
  141. package/dist/build/transformers/durationToCss.js +9 -10
  142. package/dist/build/transformers/figmaAttributes.d.ts +2 -2
  143. package/dist/build/transformers/figmaAttributes.js +3 -5
  144. package/dist/build/transformers/floatToPixel.d.ts +4 -4
  145. package/dist/build/transformers/floatToPixel.js +12 -14
  146. package/dist/build/transformers/fontFamilyToCss.d.ts +2 -2
  147. package/dist/build/transformers/fontFamilyToCss.js +10 -13
  148. package/dist/build/transformers/fontFamilyToFigma.d.ts +3 -3
  149. package/dist/build/transformers/fontFamilyToFigma.js +15 -17
  150. package/dist/build/transformers/fontWeightToNumber.d.ts +2 -2
  151. package/dist/build/transformers/fontWeightToNumber.js +8 -11
  152. package/dist/build/transformers/index.d.ts +24 -24
  153. package/dist/build/transformers/index.js +24 -51
  154. package/dist/build/transformers/jsonDeprecated.d.ts +2 -2
  155. package/dist/build/transformers/jsonDeprecated.js +6 -8
  156. package/dist/build/transformers/namePathToCamelCase.d.ts +2 -2
  157. package/dist/build/transformers/namePathToCamelCase.js +5 -7
  158. package/dist/build/transformers/namePathToDotNotation.d.ts +2 -2
  159. package/dist/build/transformers/namePathToDotNotation.js +6 -8
  160. package/dist/build/transformers/namePathToFigma.d.ts +3 -3
  161. package/dist/build/transformers/namePathToFigma.js +5 -8
  162. package/dist/build/transformers/namePathToKebabCase.d.ts +2 -2
  163. package/dist/build/transformers/namePathToKebabCase.js +4 -6
  164. package/dist/build/transformers/namePathToPascalCase.d.ts +2 -2
  165. package/dist/build/transformers/namePathToPascalCase.js +5 -7
  166. package/dist/build/transformers/namePathToSlashNotation.d.ts +2 -2
  167. package/dist/build/transformers/namePathToSlashNotation.js +4 -6
  168. package/dist/build/transformers/shadowToCss.d.ts +2 -2
  169. package/dist/build/transformers/shadowToCss.js +14 -15
  170. package/dist/build/transformers/typographyToCss.d.ts +2 -2
  171. package/dist/build/transformers/typographyToCss.js +13 -15
  172. package/dist/build/transformers/utilities/alpha.d.ts +1 -1
  173. package/dist/build/transformers/utilities/alpha.js +4 -8
  174. package/dist/build/transformers/utilities/checkRequiredTokenProperties.js +1 -5
  175. package/dist/build/transformers/utilities/getTokenValue.d.ts +2 -2
  176. package/dist/build/transformers/utilities/getTokenValue.js +10 -12
  177. package/dist/build/transformers/utilities/hasSpaceInString.js +1 -5
  178. package/dist/build/transformers/utilities/hexToRgbaFloat.d.ts +1 -1
  179. package/dist/build/transformers/utilities/hexToRgbaFloat.js +1 -5
  180. package/dist/build/transformers/utilities/invalidTokenError.d.ts +1 -1
  181. package/dist/build/transformers/utilities/invalidTokenError.js +11 -10
  182. package/dist/build/transformers/utilities/isRgbaFloat.js +1 -5
  183. package/dist/build/transformers/utilities/mix.js +5 -7
  184. package/dist/build/transformers/utilities/rgbaFloatToHex.js +1 -5
  185. package/dist/build/types/Border.d.ts +5 -0
  186. package/dist/build/types/BorderTokenValue.d.ts +10 -0
  187. package/dist/build/types/ColorHex.d.ts +4 -0
  188. package/dist/build/types/PlatformInitializer.d.ts +11 -0
  189. package/dist/build/types/Shadow.d.ts +5 -0
  190. package/dist/build/types/ShadowTokenValue.d.ts +14 -0
  191. package/dist/build/types/SizeEm.d.ts +4 -0
  192. package/dist/build/types/SizePx.d.ts +4 -0
  193. package/dist/build/types/SizeRem.d.ts +4 -0
  194. package/dist/build/types/StyleDictionaryConfigGenerator.d.ts +15 -0
  195. package/dist/build/types/TokenBuildInput.d.ts +8 -0
  196. package/dist/build/types/TypographyTokenValue.d.ts +12 -0
  197. package/dist/build/types/w3cTransformedToken.d.ts +8 -0
  198. package/dist/build/utilities/copyFromDir.d.ts +2 -2
  199. package/dist/build/utilities/copyFromDir.js +7 -10
  200. package/dist/build/utilities/filterStringArray.js +1 -5
  201. package/dist/build/utilities/getFlag.js +1 -5
  202. package/dist/build/utilities/index.d.ts +9 -3
  203. package/dist/build/utilities/index.js +9 -9
  204. package/dist/build/utilities/joinFriendly.js +1 -5
  205. package/dist/build/utilities/schemaErrorMessage.js +1 -5
  206. package/dist/build/utilities/toCamelCase.js +5 -9
  207. package/dist/build/utilities/toPascalCase.js +5 -9
  208. package/dist/build/utilities/treeWalker.js +2 -6
  209. package/dist/build/utilities/upperCaseFirstCharacter.js +1 -5
  210. package/dist/css/functional/themes/dark-colorblind.css +4 -4
  211. package/dist/css/functional/themes/dark-high-contrast.css +20 -20
  212. package/dist/css/functional/themes/light-high-contrast.css +14 -14
  213. package/dist/css/functional/typography/typography.css +20 -20
  214. package/dist/css/primitives.css +20 -20
  215. package/dist/docs/base/size/size.json +76 -76
  216. package/dist/docs/base/typography/typography.json +16 -16
  217. package/dist/docs/functional/motion/motion.json +18 -18
  218. package/dist/docs/functional/size/border.json +56 -56
  219. package/dist/docs/functional/size/breakpoints.json +24 -24
  220. package/dist/docs/functional/size/size-coarse.json +12 -12
  221. package/dist/docs/functional/size/size-fine.json +12 -12
  222. package/dist/docs/functional/size/size.json +264 -264
  223. package/dist/docs/functional/size/viewport.json +24 -24
  224. package/dist/docs/functional/themes/dark-colorblind.json +2310 -3186
  225. package/dist/docs/functional/themes/dark-dimmed.json +2300 -2794
  226. package/dist/docs/functional/themes/dark-high-contrast.json +2520 -5038
  227. package/dist/docs/functional/themes/dark-tritanopia.json +2351 -3003
  228. package/dist/docs/functional/themes/dark.json +2270 -2270
  229. package/dist/docs/functional/themes/light-colorblind.json +2298 -3124
  230. package/dist/docs/functional/themes/light-high-contrast.json +2419 -4645
  231. package/dist/docs/functional/themes/light-tritanopia.json +2330 -2990
  232. package/dist/docs/functional/themes/light.json +2260 -2260
  233. package/dist/docs/functional/typography/typography.json +206 -206
  234. package/dist/figma/dimension/dimension.json +489 -489
  235. package/dist/figma/figma.json +11 -3
  236. package/dist/figma/scales/dark-dimmed.json +38 -38
  237. package/dist/figma/scales/dark-high-constrast.json +38 -38
  238. package/dist/figma/scales/dark.json +35 -35
  239. package/dist/figma/scales/light-high-constrast.json +40 -40
  240. package/dist/figma/scales/light.json +40 -40
  241. package/dist/figma/shadows/dark-colorblind.json +280 -280
  242. package/dist/figma/shadows/dark-dimmed.json +280 -280
  243. package/dist/figma/shadows/dark-high-contrast.json +280 -280
  244. package/dist/figma/shadows/dark-tritanopia.json +280 -280
  245. package/dist/figma/shadows/dark.json +280 -280
  246. package/dist/figma/shadows/light-colorblind.json +281 -281
  247. package/dist/figma/shadows/light-high-contrast.json +281 -281
  248. package/dist/figma/shadows/light-tritanopia.json +281 -281
  249. package/dist/figma/shadows/light.json +281 -281
  250. package/dist/figma/themes/dark-colorblind.json +4991 -5854
  251. package/dist/figma/themes/dark-dimmed.json +5314 -5799
  252. package/dist/figma/themes/dark-high-contrast.json +4210 -6679
  253. package/dist/figma/themes/dark-tritanopia.json +5165 -5817
  254. package/dist/figma/themes/dark.json +5534 -5537
  255. package/dist/figma/themes/light-colorblind.json +4857 -5669
  256. package/dist/figma/themes/light-high-contrast.json +4198 -6372
  257. package/dist/figma/themes/light-tritanopia.json +4901 -5529
  258. package/dist/figma/themes/light.json +5349 -5349
  259. package/dist/figma/typography/typography.json +112 -156
  260. package/dist/internalCss/dark-colorblind.css +4 -4
  261. package/dist/internalCss/dark-high-contrast.css +20 -20
  262. package/dist/internalCss/light-high-contrast.css +14 -14
  263. package/dist/styleLint/base/size/size.json +38 -38
  264. package/dist/styleLint/base/typography/typography.json +8 -8
  265. package/dist/styleLint/functional/motion/motion.json +12 -12
  266. package/dist/styleLint/functional/size/border.json +30 -30
  267. package/dist/styleLint/functional/size/breakpoints.json +12 -12
  268. package/dist/styleLint/functional/size/size-coarse.json +6 -6
  269. package/dist/styleLint/functional/size/size-fine.json +6 -6
  270. package/dist/styleLint/functional/size/size.json +132 -132
  271. package/dist/styleLint/functional/size/viewport.json +12 -12
  272. package/dist/styleLint/functional/themes/dark-colorblind.json +1171 -2047
  273. package/dist/styleLint/functional/themes/dark-dimmed.json +1160 -1654
  274. package/dist/styleLint/functional/themes/dark-high-contrast.json +1307 -3825
  275. package/dist/styleLint/functional/themes/dark-tritanopia.json +1232 -1884
  276. package/dist/styleLint/functional/themes/dark.json +1140 -1140
  277. package/dist/styleLint/functional/themes/light-colorblind.json +1198 -2024
  278. package/dist/styleLint/functional/themes/light-high-contrast.json +1270 -3496
  279. package/dist/styleLint/functional/themes/light-tritanopia.json +1205 -1865
  280. package/dist/styleLint/functional/themes/light.json +1130 -1130
  281. package/dist/styleLint/functional/typography/typography.json +114 -114
  282. package/package.json +19 -10
  283. package/src/tokens/functional/color/dark/overrides/dark.high-contrast.json5 +4 -4
  284. package/src/tokens/functional/color/dark/overrides/dark.protanopia-deuteranopia.json5 +6 -0
  285. package/src/tokens/functional/color/dark/overrides/dark.tritanopia.json5 +21 -3
  286. package/src/tokens/functional/color/dark/primitives-dark.json5 +3 -3
  287. package/src/tokens/functional/color/light/overrides/light.protanopia-deuteranopia.json5 +4 -1
  288. package/src/tokens/functional/color/light/overrides/light.tritanopia.json5 +4 -1
  289. package/src/tokens/functional/color/light/primitives-light.json5 +2 -2
@@ -2,8 +2,7 @@ import StyleDictionary from 'style-dictionary';
2
2
  /**
3
3
  * @name {@link PrimerStyleDictionary}
4
4
  * @description Returns style dictionary object with primer preset that includes parsers, formats and transformers
5
- * @parsers [w3cJsonParser](https://github.com/primer/primitives/blob/main/config//parsers/w3c-json-parser.ts)
6
5
  * @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)
7
6
  * @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)
8
7
  */
9
- export declare const PrimerStyleDictionary: StyleDictionary.Core;
8
+ export declare const PrimerStyleDictionary: StyleDictionary;
@@ -1,92 +1,79 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.PrimerStyleDictionary = void 0;
7
- const style_dictionary_1 = __importDefault(require("style-dictionary"));
8
- const parsers_1 = require("./parsers");
9
- const transformers_1 = require("./transformers");
10
- const formats_1 = require("./formats");
1
+ import StyleDictionary from 'style-dictionary';
2
+ import { borderToCss, colorToRgbAlpha, colorToHex, colorToHexMix, colorToRgbaFloat, dimensionToRem, dimensionToPixelUnitless, durationToCss, figmaAttributes, fontFamilyToCss, fontFamilyToFigma, fontWeightToNumber, jsonDeprecated, namePathToDotNotation, namePathToCamelCase, namePathToPascalCase, namePathToKebabCase, namePathToSlashNotation, namePathToFigma, shadowToCss, typographyToCss, dimensionToRemPxArray, floatToPixel, floatToPixelUnitless, } from './transformers/index.js';
3
+ import { javascriptCommonJs, javascriptEsm, typescriptExportDefinition, jsonNestedPrefixed, cssCustomMedia, jsonOneDimensional, jsonPostCssFallback, cssAdvanced, jsonFigma, } from './formats/index.js';
11
4
  /**
12
- * Parsers
13
- *
5
+ * @name {@link PrimerStyleDictionary}
6
+ * @description Returns style dictionary object with primer preset that includes parsers, formats and transformers
7
+ * @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)
8
+ * @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)
14
9
  */
15
- style_dictionary_1.default.registerParser(parsers_1.w3cJsonParser);
10
+ export const PrimerStyleDictionary = new StyleDictionary();
16
11
  /**
17
12
  * Formats
18
13
  *
19
14
  */
20
- style_dictionary_1.default.registerFormat({
15
+ PrimerStyleDictionary.registerFormat({
21
16
  name: 'css/advanced',
22
- formatter: formats_1.cssAdvanced,
17
+ format: cssAdvanced,
23
18
  });
24
- style_dictionary_1.default.registerFormat({
19
+ PrimerStyleDictionary.registerFormat({
25
20
  name: 'css/customMedia',
26
- formatter: formats_1.cssCustomMedia,
21
+ format: cssCustomMedia,
27
22
  });
28
- style_dictionary_1.default.registerFormat({
23
+ PrimerStyleDictionary.registerFormat({
29
24
  name: 'javascript/esm',
30
- formatter: formats_1.javascriptEsm,
25
+ format: javascriptEsm,
31
26
  });
32
- style_dictionary_1.default.registerFormat({
27
+ PrimerStyleDictionary.registerFormat({
33
28
  name: 'javascript/commonJs',
34
- formatter: formats_1.javascriptCommonJs,
29
+ format: javascriptCommonJs,
35
30
  });
36
- style_dictionary_1.default.registerFormat({
31
+ PrimerStyleDictionary.registerFormat({
37
32
  name: 'typescript/export-definition',
38
- formatter: formats_1.typescriptExportDefinition,
33
+ format: typescriptExportDefinition,
39
34
  });
40
- style_dictionary_1.default.registerFormat({
35
+ PrimerStyleDictionary.registerFormat({
41
36
  name: 'json/nested-prefixed',
42
- formatter: formats_1.jsonNestedPrefixed,
37
+ format: jsonNestedPrefixed,
43
38
  });
44
- style_dictionary_1.default.registerFormat({
39
+ PrimerStyleDictionary.registerFormat({
45
40
  name: 'json/one-dimensional',
46
- formatter: formats_1.jsonOneDimensional,
41
+ format: jsonOneDimensional,
47
42
  });
48
- style_dictionary_1.default.registerFormat({
43
+ PrimerStyleDictionary.registerFormat({
49
44
  name: 'json/postCss-fallback',
50
- formatter: formats_1.jsonPostCssFallback,
45
+ format: jsonPostCssFallback,
51
46
  });
52
- style_dictionary_1.default.registerFormat({
47
+ PrimerStyleDictionary.registerFormat({
53
48
  name: 'json/figma',
54
- formatter: formats_1.jsonFigma,
49
+ format: jsonFigma,
55
50
  });
56
51
  /**
57
52
  * Transformers
58
53
  *
59
54
  */
60
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'color/rgbAlpha' }, transformers_1.colorToRgbAlpha));
61
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'color/rgbaFloat' }, transformers_1.colorToRgbaFloat));
62
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'color/hexMix' }, transformers_1.colorToHexMix));
63
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'color/hex' }, transformers_1.colorToHex));
64
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'float/pixel' }, transformers_1.floatToPixel));
65
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'float/pixelUnitless' }, transformers_1.floatToPixelUnitless));
66
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'dimension/rem' }, transformers_1.dimensionToRem));
67
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'dimension/remPxArray' }, transformers_1.dimensionToRemPxArray));
68
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'dimension/pixelUnitless' }, transformers_1.dimensionToPixelUnitless));
69
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'duration/css' }, transformers_1.durationToCss));
70
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'figma/attributes' }, transformers_1.figmaAttributes));
71
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'json/deprecated' }, transformers_1.jsonDeprecated));
72
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'name/pathToCamelCase' }, transformers_1.namePathToCamelCase));
73
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'name/pathToPascalCase' }, transformers_1.namePathToPascalCase));
74
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'name/pathToDotNotation' }, transformers_1.namePathToDotNotation));
75
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'name/pathToFigma' }, transformers_1.namePathToFigma));
76
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'name/pathToCamelCase' }, transformers_1.namePathToCamelCase));
77
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'name/pathToKebabCase' }, transformers_1.namePathToKebabCase));
78
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'name/pathToSlashNotation' }, transformers_1.namePathToSlashNotation));
79
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'shadow/css' }, transformers_1.shadowToCss));
80
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'border/css' }, transformers_1.borderToCss));
81
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'typography/css' }, transformers_1.typographyToCss));
82
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'fontWeight/number' }, transformers_1.fontWeightToNumber));
83
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'fontFamily/css' }, transformers_1.fontFamilyToCss));
84
- style_dictionary_1.default.registerTransform(Object.assign({ name: 'fontFamily/figma' }, transformers_1.fontFamilyToFigma));
85
- /**
86
- * @name {@link PrimerStyleDictionary}
87
- * @description Returns style dictionary object with primer preset that includes parsers, formats and transformers
88
- * @parsers [w3cJsonParser](https://github.com/primer/primitives/blob/main/config//parsers/w3c-json-parser.ts)
89
- * @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)
90
- * @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)
91
- */
92
- exports.PrimerStyleDictionary = style_dictionary_1.default;
55
+ PrimerStyleDictionary.registerTransform(Object.assign({}, colorToRgbAlpha));
56
+ PrimerStyleDictionary.registerTransform(Object.assign({}, colorToRgbaFloat));
57
+ PrimerStyleDictionary.registerTransform(Object.assign({}, colorToHexMix));
58
+ PrimerStyleDictionary.registerTransform(Object.assign({}, colorToHex));
59
+ PrimerStyleDictionary.registerTransform(Object.assign({}, floatToPixel));
60
+ PrimerStyleDictionary.registerTransform(Object.assign({}, floatToPixelUnitless));
61
+ PrimerStyleDictionary.registerTransform(Object.assign({}, dimensionToRem));
62
+ PrimerStyleDictionary.registerTransform(Object.assign({}, dimensionToRemPxArray));
63
+ PrimerStyleDictionary.registerTransform(Object.assign({}, dimensionToPixelUnitless));
64
+ PrimerStyleDictionary.registerTransform(Object.assign({}, durationToCss));
65
+ PrimerStyleDictionary.registerTransform(Object.assign({}, figmaAttributes));
66
+ PrimerStyleDictionary.registerTransform(Object.assign({}, jsonDeprecated));
67
+ PrimerStyleDictionary.registerTransform(Object.assign({}, namePathToCamelCase));
68
+ PrimerStyleDictionary.registerTransform(Object.assign({}, namePathToPascalCase));
69
+ PrimerStyleDictionary.registerTransform(Object.assign({}, namePathToDotNotation));
70
+ PrimerStyleDictionary.registerTransform(Object.assign({}, namePathToFigma));
71
+ PrimerStyleDictionary.registerTransform(Object.assign({}, namePathToCamelCase));
72
+ PrimerStyleDictionary.registerTransform(Object.assign({}, namePathToKebabCase));
73
+ PrimerStyleDictionary.registerTransform(Object.assign({}, namePathToSlashNotation));
74
+ PrimerStyleDictionary.registerTransform(Object.assign({}, shadowToCss));
75
+ PrimerStyleDictionary.registerTransform(Object.assign({}, borderToCss));
76
+ PrimerStyleDictionary.registerTransform(Object.assign({}, typographyToCss));
77
+ PrimerStyleDictionary.registerTransform(Object.assign({}, fontWeightToNumber));
78
+ PrimerStyleDictionary.registerTransform(Object.assign({}, fontFamilyToCss));
79
+ PrimerStyleDictionary.registerTransform(Object.assign({}, fontFamilyToFigma));
@@ -1,13 +1,14 @@
1
- export { isBorder } from './isBorder';
2
- export { isColor } from './isColor';
3
- export { isColorWithAlpha } from './isColorWithAlpha';
4
- export { isColorWithMix } from './isColorWithMix';
5
- export { isDimension } from './isDimension';
6
- export { isDeprecated } from './isDeprecated';
7
- export { isFromFile } from './isFromFile';
8
- export { isFontFamily } from './isFontFamily';
9
- export { isFontWeight } from './isFontWeight';
10
- export { isNumber } from './isNumber';
11
- export { isShadow } from './isShadow';
12
- export { isSource } from './isSource';
13
- export { isTypography } from './isTypography';
1
+ export { isBorder } from './isBorder.js';
2
+ export { isColor } from './isColor.js';
3
+ export { isColorWithAlpha } from './isColorWithAlpha.js';
4
+ export { isColorWithMix } from './isColorWithMix.js';
5
+ export { isDimension } from './isDimension.js';
6
+ export { isDeprecated } from './isDeprecated.js';
7
+ export { isDuration } from './isDuration.js';
8
+ export { isFromFile } from './isFromFile.js';
9
+ export { isFontFamily } from './isFontFamily.js';
10
+ export { isFontWeight } from './isFontWeight.js';
11
+ export { isNumber } from './isNumber.js';
12
+ export { isShadow } from './isShadow.js';
13
+ export { isSource } from './isSource.js';
14
+ export { isTypography } from './isTypography.js';
@@ -1,29 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTypography = exports.isSource = exports.isShadow = exports.isNumber = exports.isFontWeight = exports.isFontFamily = exports.isFromFile = exports.isDeprecated = exports.isDimension = exports.isColorWithMix = exports.isColorWithAlpha = exports.isColor = exports.isBorder = void 0;
4
- var isBorder_1 = require("./isBorder");
5
- Object.defineProperty(exports, "isBorder", { enumerable: true, get: function () { return isBorder_1.isBorder; } });
6
- var isColor_1 = require("./isColor");
7
- Object.defineProperty(exports, "isColor", { enumerable: true, get: function () { return isColor_1.isColor; } });
8
- var isColorWithAlpha_1 = require("./isColorWithAlpha");
9
- Object.defineProperty(exports, "isColorWithAlpha", { enumerable: true, get: function () { return isColorWithAlpha_1.isColorWithAlpha; } });
10
- var isColorWithMix_1 = require("./isColorWithMix");
11
- Object.defineProperty(exports, "isColorWithMix", { enumerable: true, get: function () { return isColorWithMix_1.isColorWithMix; } });
12
- var isDimension_1 = require("./isDimension");
13
- Object.defineProperty(exports, "isDimension", { enumerable: true, get: function () { return isDimension_1.isDimension; } });
14
- var isDeprecated_1 = require("./isDeprecated");
15
- Object.defineProperty(exports, "isDeprecated", { enumerable: true, get: function () { return isDeprecated_1.isDeprecated; } });
16
- var isFromFile_1 = require("./isFromFile");
17
- Object.defineProperty(exports, "isFromFile", { enumerable: true, get: function () { return isFromFile_1.isFromFile; } });
18
- var isFontFamily_1 = require("./isFontFamily");
19
- Object.defineProperty(exports, "isFontFamily", { enumerable: true, get: function () { return isFontFamily_1.isFontFamily; } });
20
- var isFontWeight_1 = require("./isFontWeight");
21
- Object.defineProperty(exports, "isFontWeight", { enumerable: true, get: function () { return isFontWeight_1.isFontWeight; } });
22
- var isNumber_1 = require("./isNumber");
23
- Object.defineProperty(exports, "isNumber", { enumerable: true, get: function () { return isNumber_1.isNumber; } });
24
- var isShadow_1 = require("./isShadow");
25
- Object.defineProperty(exports, "isShadow", { enumerable: true, get: function () { return isShadow_1.isShadow; } });
26
- var isSource_1 = require("./isSource");
27
- Object.defineProperty(exports, "isSource", { enumerable: true, get: function () { return isSource_1.isSource; } });
28
- var isTypography_1 = require("./isTypography");
29
- Object.defineProperty(exports, "isTypography", { enumerable: true, get: function () { return isTypography_1.isTypography; } });
1
+ export { isBorder } from './isBorder.js';
2
+ export { isColor } from './isColor.js';
3
+ export { isColorWithAlpha } from './isColorWithAlpha.js';
4
+ export { isColorWithMix } from './isColorWithMix.js';
5
+ export { isDimension } from './isDimension.js';
6
+ export { isDeprecated } from './isDeprecated.js';
7
+ export { isDuration } from './isDuration.js';
8
+ export { isFromFile } from './isFromFile.js';
9
+ export { isFontFamily } from './isFontFamily.js';
10
+ export { isFontWeight } from './isFontWeight.js';
11
+ export { isNumber } from './isNumber.js';
12
+ export { isShadow } from './isShadow.js';
13
+ export { isSource } from './isSource.js';
14
+ export { isTypography } from './isTypography.js';
@@ -1,7 +1,7 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { TransformedToken } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description Checks if token is of $type `border`
4
- * @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
4
+ * @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
5
5
  * @returns boolean
6
6
  */
7
- export declare const isBorder: (token: StyleDictionary.TransformedToken) => boolean;
7
+ export declare const isBorder: (token: TransformedToken) => boolean;
@@ -1,12 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isBorder = void 0;
4
1
  /**
5
2
  * @description Checks if token is of $type `border`
6
- * @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
3
+ * @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
7
4
  * @returns boolean
8
5
  */
9
- const isBorder = (token) => {
6
+ export const isBorder = (token) => {
10
7
  return token.$type === 'border';
11
8
  };
12
- exports.isBorder = isBorder;
@@ -1,7 +1,7 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { TransformedToken } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description Checks if token is of $type `color`
4
- * @param token [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
4
+ * @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
5
5
  * @returns boolean
6
6
  */
7
- export declare const isColor: (token: StyleDictionary.TransformedToken) => boolean;
7
+ export declare const isColor: (token: TransformedToken) => boolean;
@@ -1,12 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isColor = void 0;
4
1
  /**
5
2
  * @description Checks if token is of $type `color`
6
- * @param token [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
3
+ * @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
7
4
  * @returns boolean
8
5
  */
9
- const isColor = (token) => {
10
- return token.$type === 'color';
6
+ export const isColor = (token) => {
7
+ var _a;
8
+ const typeValue = (_a = token.$type) !== null && _a !== void 0 ? _a : token.type;
9
+ // if (token.path.join('-') === 'control-transparent-bgColor-selected') {
10
+ // console.log(typeValue === 'color', token)
11
+ // }
12
+ return typeValue === 'color';
11
13
  };
12
- exports.isColor = isColor;
@@ -1,7 +1,7 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { TransformedToken } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description Checks if token is color with an alpha value
4
- * @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
4
+ * @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
5
5
  * @returns boolean
6
6
  */
7
- export declare const isColorWithAlpha: (token: StyleDictionary.TransformedToken) => boolean;
7
+ export declare const isColorWithAlpha: (token: TransformedToken) => boolean;
@@ -1,13 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isColorWithAlpha = void 0;
4
- const isColor_1 = require("./isColor");
1
+ import { isColor } from './isColor.js';
5
2
  /**
6
3
  * @description Checks if token is color with an alpha value
7
- * @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
4
+ * @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
8
5
  * @returns boolean
9
6
  */
10
- const isColorWithAlpha = (token) => {
11
- return (0, isColor_1.isColor)(token) && token.alpha !== undefined && typeof token.alpha === 'number';
7
+ export const isColorWithAlpha = (token) => {
8
+ return isColor(token) && token.alpha !== undefined && typeof token.alpha === 'number';
12
9
  };
13
- exports.isColorWithAlpha = isColorWithAlpha;
@@ -1,7 +1,7 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { TransformedToken } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description Checks if token is color and has a mix property
4
- * @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
4
+ * @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
5
5
  * @returns boolean
6
6
  */
7
- export declare const isColorWithMix: (token: StyleDictionary.TransformedToken) => boolean;
7
+ export declare const isColorWithMix: (token: TransformedToken) => boolean;
@@ -1,18 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isColorWithMix = void 0;
4
- const isColor_1 = require("./isColor");
1
+ import { isColor } from './isColor.js';
5
2
  const throwError = (token) => {
6
3
  throw new Error(`Invalid mix property on token: ${token.name}. "mix.color": ${token.mix.color}, "mix.weight": ${typeof token.mix.weight === 'string' ? `"${token.mix.weight}" (string)` : token.mix.weight} must be a number between 0 and 1. In file: "${token.filePath}".`);
7
4
  };
8
5
  /**
9
6
  * @description Checks if token is color and has a mix property
10
- * @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
7
+ * @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
11
8
  * @returns boolean
12
9
  */
13
- const isColorWithMix = (token) => {
10
+ export const isColorWithMix = (token) => {
14
11
  // no color or no mix property
15
- if (!(0, isColor_1.isColor)(token) || token.mix === undefined || token.mix === null) {
12
+ if (!isColor(token) || token.mix === undefined || token.mix === null) {
16
13
  return false;
17
14
  }
18
15
  // invalid mix property
@@ -25,4 +22,3 @@ const isColorWithMix = (token) => {
25
22
  // valid mix property
26
23
  return true;
27
24
  };
28
- exports.isColorWithMix = isColorWithMix;
@@ -1,7 +1,7 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { TransformedToken } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description Checks if token has a valid `deprecated` property
4
- * @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
4
+ * @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
5
5
  * @returns boolean
6
6
  */
7
- export declare const isDeprecated: (token: StyleDictionary.TransformedToken) => boolean;
7
+ export declare const isDeprecated: (token: TransformedToken) => boolean;
@@ -1,12 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isDeprecated = void 0;
4
1
  /**
5
2
  * @description Checks if token has a valid `deprecated` property
6
- * @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
3
+ * @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
7
4
  * @returns boolean
8
5
  */
9
- const isDeprecated = (token) => {
6
+ export const isDeprecated = (token) => {
10
7
  return token.deprecated === true || typeof token.deprecated === 'string';
11
8
  };
12
- exports.isDeprecated = isDeprecated;
@@ -1,7 +1,7 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { TransformedToken } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description Checks if token is of $type `dimension`
4
- * @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
4
+ * @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
5
5
  * @returns boolean
6
6
  */
7
- export declare const isDimension: (token: StyleDictionary.TransformedToken) => boolean;
7
+ export declare const isDimension: (token: TransformedToken) => boolean;
@@ -1,12 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isDimension = void 0;
4
1
  /**
5
2
  * @description Checks if token is of $type `dimension`
6
- * @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
3
+ * @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
7
4
  * @returns boolean
8
5
  */
9
- const isDimension = (token) => {
6
+ export const isDimension = (token) => {
10
7
  return token.$type === 'dimension';
11
8
  };
12
- exports.isDimension = isDimension;
@@ -1,7 +1,7 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { TransformedToken } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description Checks if token is of $type `duration`
4
- * @param token [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
4
+ * @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
5
5
  * @returns boolean
6
6
  */
7
- export declare const isDuration: (token: StyleDictionary.TransformedToken) => boolean;
7
+ export declare const isDuration: (token: TransformedToken) => boolean;
@@ -1,12 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isDuration = void 0;
4
1
  /**
5
2
  * @description Checks if token is of $type `duration`
6
- * @param token [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
3
+ * @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
7
4
  * @returns boolean
8
5
  */
9
- const isDuration = (token) => {
6
+ export const isDuration = (token) => {
10
7
  return token.$type === 'duration';
11
8
  };
12
- exports.isDuration = isDuration;
@@ -1,7 +1,7 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { TransformedToken } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description Checks if token is of $type `isFontFamily`
4
- * @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
4
+ * @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
5
5
  * @returns boolean
6
6
  */
7
- export declare const isFontFamily: (token: StyleDictionary.TransformedToken) => boolean;
7
+ export declare const isFontFamily: (token: TransformedToken) => boolean;
@@ -1,12 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isFontFamily = void 0;
4
1
  /**
5
2
  * @description Checks if token is of $type `isFontFamily`
6
- * @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
3
+ * @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
7
4
  * @returns boolean
8
5
  */
9
- const isFontFamily = (token) => {
6
+ export const isFontFamily = (token) => {
10
7
  return token.$type === 'fontFamily';
11
8
  };
12
- exports.isFontFamily = isFontFamily;
@@ -1,7 +1,7 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { TransformedToken } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description Checks if token is of $type `fontWeight`
4
- * @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
4
+ * @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
5
5
  * @returns boolean
6
6
  */
7
- export declare const isFontWeight: (token: StyleDictionary.TransformedToken) => boolean;
7
+ export declare const isFontWeight: (token: TransformedToken) => boolean;
@@ -1,12 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isFontWeight = void 0;
4
1
  /**
5
2
  * @description Checks if token is of $type `fontWeight`
6
- * @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
3
+ * @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
7
4
  * @returns boolean
8
5
  */
9
- const isFontWeight = (token) => {
6
+ export const isFontWeight = (token) => {
10
7
  return token.$type === 'fontWeight';
11
8
  };
12
- exports.isFontWeight = isFontWeight;
@@ -1,8 +1,8 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { TransformedToken } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description Checks if token comes from a specific file
4
- * @param token [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
4
+ * @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
5
5
  * @param files - array of file paths
6
6
  * @returns boolean
7
7
  */
8
- export declare const isFromFile: (token: StyleDictionary.TransformedToken, files: string[]) => boolean;
8
+ export declare const isFromFile: (token: TransformedToken, files: string[]) => boolean;
@@ -1,14 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isFromFile = void 0;
4
1
  /**
5
2
  * @description Checks if token comes from a specific file
6
- * @param token [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
3
+ * @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
7
4
  * @param files - array of file paths
8
5
  * @returns boolean
9
6
  */
10
- const isFromFile = (token, files) => {
7
+ export const isFromFile = (token, files) => {
11
8
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
12
9
  return (files === null || files === void 0 ? void 0 : files.includes(token.filePath)) === true;
13
10
  };
14
- exports.isFromFile = isFromFile;
@@ -1,7 +1,7 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { TransformedToken } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description Checks if token type is a number
4
- * @param token [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
4
+ * @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
5
5
  * @returns boolean
6
6
  */
7
- export declare const isNumber: (token: StyleDictionary.TransformedToken) => boolean;
7
+ export declare const isNumber: (token: TransformedToken) => boolean;
@@ -1,10 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isNumber = void 0;
4
1
  /**
5
2
  * @description Checks if token type is a number
6
- * @param token [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
3
+ * @param token [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
7
4
  * @returns boolean
8
5
  */
9
- const isNumber = (token) => token.$type === 'number';
10
- exports.isNumber = isNumber;
6
+ export const isNumber = (token) => {
7
+ return token.$type === 'number';
8
+ };
@@ -1,7 +1,7 @@
1
- import type StyleDictionary from 'style-dictionary';
1
+ import type { TransformedToken } from 'style-dictionary/types';
2
2
  /**
3
3
  * @description Checks if token is of $type `shadow`
4
- * @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
4
+ * @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
5
5
  * @returns boolean
6
6
  */
7
- export declare const isShadow: (token: StyleDictionary.TransformedToken) => boolean;
7
+ export declare const isShadow: (token: TransformedToken) => boolean;
@@ -1,12 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isShadow = void 0;
4
1
  /**
5
2
  * @description Checks if token is of $type `shadow`
6
- * @param arguments [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
3
+ * @param arguments [TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
7
4
  * @returns boolean
8
5
  */
9
- const isShadow = (token) => {
6
+ export const isShadow = (token) => {
10
7
  return token.$type === 'shadow';
11
8
  };
12
- exports.isShadow = isShadow;