@primer/primitives 9.1.2 → 10.0.0-rc.6651a0c1

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 (298) hide show
  1. package/dist/css/functional/themes/dark-colorblind.css +4 -4
  2. package/dist/css/functional/themes/dark-high-contrast.css +20 -20
  3. package/dist/css/functional/themes/light-high-contrast.css +14 -14
  4. package/dist/css/functional/typography/typography.css +20 -20
  5. package/dist/css/primitives.css +20 -20
  6. package/dist/docs/base/size/size.json +76 -76
  7. package/dist/docs/base/typography/typography.json +16 -16
  8. package/dist/docs/functional/motion/motion.json +18 -18
  9. package/dist/docs/functional/size/border.json +56 -56
  10. package/dist/docs/functional/size/breakpoints.json +24 -24
  11. package/dist/docs/functional/size/size-coarse.json +12 -12
  12. package/dist/docs/functional/size/size-fine.json +12 -12
  13. package/dist/docs/functional/size/size.json +264 -264
  14. package/dist/docs/functional/size/viewport.json +24 -24
  15. package/dist/docs/functional/themes/dark-colorblind.json +2310 -3186
  16. package/dist/docs/functional/themes/dark-dimmed.json +2300 -2794
  17. package/dist/docs/functional/themes/dark-high-contrast.json +2520 -5038
  18. package/dist/docs/functional/themes/dark-tritanopia.json +2351 -3003
  19. package/dist/docs/functional/themes/dark.json +2270 -2270
  20. package/dist/docs/functional/themes/light-colorblind.json +2298 -3124
  21. package/dist/docs/functional/themes/light-high-contrast.json +2419 -4645
  22. package/dist/docs/functional/themes/light-tritanopia.json +2330 -2990
  23. package/dist/docs/functional/themes/light.json +2260 -2260
  24. package/dist/docs/functional/typography/typography.json +206 -206
  25. package/dist/figma/dimension/dimension.json +489 -489
  26. package/dist/figma/figma.json +11 -3
  27. package/dist/figma/scales/dark-dimmed.json +38 -38
  28. package/dist/figma/scales/dark-high-constrast.json +38 -38
  29. package/dist/figma/scales/dark.json +35 -35
  30. package/dist/figma/scales/light-high-constrast.json +40 -40
  31. package/dist/figma/scales/light.json +40 -40
  32. package/dist/figma/shadows/dark-colorblind.json +280 -280
  33. package/dist/figma/shadows/dark-dimmed.json +280 -280
  34. package/dist/figma/shadows/dark-high-contrast.json +280 -280
  35. package/dist/figma/shadows/dark-tritanopia.json +280 -280
  36. package/dist/figma/shadows/dark.json +280 -280
  37. package/dist/figma/shadows/light-colorblind.json +281 -281
  38. package/dist/figma/shadows/light-high-contrast.json +281 -281
  39. package/dist/figma/shadows/light-tritanopia.json +281 -281
  40. package/dist/figma/shadows/light.json +281 -281
  41. package/dist/figma/themes/dark-colorblind.json +4991 -5854
  42. package/dist/figma/themes/dark-dimmed.json +5314 -5799
  43. package/dist/figma/themes/dark-high-contrast.json +4210 -6679
  44. package/dist/figma/themes/dark-tritanopia.json +5165 -5817
  45. package/dist/figma/themes/dark.json +5534 -5537
  46. package/dist/figma/themes/light-colorblind.json +4857 -5669
  47. package/dist/figma/themes/light-high-contrast.json +4198 -6372
  48. package/dist/figma/themes/light-tritanopia.json +4901 -5529
  49. package/dist/figma/themes/light.json +5349 -5349
  50. package/dist/figma/typography/typography.json +112 -156
  51. package/dist/internalCss/dark-colorblind.css +4 -4
  52. package/dist/internalCss/dark-high-contrast.css +20 -20
  53. package/dist/internalCss/light-high-contrast.css +14 -14
  54. package/dist/styleLint/base/size/size.json +38 -38
  55. package/dist/styleLint/base/typography/typography.json +8 -8
  56. package/dist/styleLint/functional/motion/motion.json +12 -12
  57. package/dist/styleLint/functional/size/border.json +30 -30
  58. package/dist/styleLint/functional/size/breakpoints.json +12 -12
  59. package/dist/styleLint/functional/size/size-coarse.json +6 -6
  60. package/dist/styleLint/functional/size/size-fine.json +6 -6
  61. package/dist/styleLint/functional/size/size.json +132 -132
  62. package/dist/styleLint/functional/size/viewport.json +12 -12
  63. package/dist/styleLint/functional/themes/dark-colorblind.json +1171 -2047
  64. package/dist/styleLint/functional/themes/dark-dimmed.json +1160 -1654
  65. package/dist/styleLint/functional/themes/dark-high-contrast.json +1307 -3825
  66. package/dist/styleLint/functional/themes/dark-tritanopia.json +1232 -1884
  67. package/dist/styleLint/functional/themes/dark.json +1140 -1140
  68. package/dist/styleLint/functional/themes/light-colorblind.json +1198 -2024
  69. package/dist/styleLint/functional/themes/light-high-contrast.json +1270 -3496
  70. package/dist/styleLint/functional/themes/light-tritanopia.json +1205 -1865
  71. package/dist/styleLint/functional/themes/light.json +1130 -1130
  72. package/dist/styleLint/functional/typography/typography.json +114 -114
  73. package/package.json +18 -10
  74. package/src/tokens/functional/color/dark/overrides/dark.high-contrast.json5 +4 -4
  75. package/src/tokens/functional/color/dark/overrides/dark.protanopia-deuteranopia.json5 +6 -0
  76. package/src/tokens/functional/color/dark/overrides/dark.tritanopia.json5 +21 -3
  77. package/src/tokens/functional/color/dark/primitives-dark.json5 +3 -3
  78. package/src/tokens/functional/color/light/overrides/light.protanopia-deuteranopia.json5 +4 -1
  79. package/src/tokens/functional/color/light/overrides/light.tritanopia.json5 +4 -1
  80. package/src/tokens/functional/color/light/primitives-light.json5 +2 -2
  81. package/dist/build/PrimerStyleDictionary.d.ts +0 -9
  82. package/dist/build/PrimerStyleDictionary.js +0 -92
  83. package/dist/build/filters/index.d.ts +0 -13
  84. package/dist/build/filters/index.js +0 -29
  85. package/dist/build/filters/isBorder.d.ts +0 -7
  86. package/dist/build/filters/isBorder.js +0 -12
  87. package/dist/build/filters/isColor.d.ts +0 -7
  88. package/dist/build/filters/isColor.js +0 -12
  89. package/dist/build/filters/isColorWithAlpha.d.ts +0 -7
  90. package/dist/build/filters/isColorWithAlpha.js +0 -13
  91. package/dist/build/filters/isColorWithMix.d.ts +0 -7
  92. package/dist/build/filters/isColorWithMix.js +0 -28
  93. package/dist/build/filters/isDeprecated.d.ts +0 -7
  94. package/dist/build/filters/isDeprecated.js +0 -12
  95. package/dist/build/filters/isDimension.d.ts +0 -7
  96. package/dist/build/filters/isDimension.js +0 -12
  97. package/dist/build/filters/isDuration.d.ts +0 -7
  98. package/dist/build/filters/isDuration.js +0 -12
  99. package/dist/build/filters/isFontFamily.d.ts +0 -7
  100. package/dist/build/filters/isFontFamily.js +0 -12
  101. package/dist/build/filters/isFontWeight.d.ts +0 -7
  102. package/dist/build/filters/isFontWeight.js +0 -12
  103. package/dist/build/filters/isFromFile.d.ts +0 -8
  104. package/dist/build/filters/isFromFile.js +0 -14
  105. package/dist/build/filters/isNumber.d.ts +0 -7
  106. package/dist/build/filters/isNumber.js +0 -10
  107. package/dist/build/filters/isShadow.d.ts +0 -7
  108. package/dist/build/filters/isShadow.js +0 -12
  109. package/dist/build/filters/isSource.d.ts +0 -7
  110. package/dist/build/filters/isSource.js +0 -12
  111. package/dist/build/filters/isTypography.d.ts +0 -7
  112. package/dist/build/filters/isTypography.js +0 -12
  113. package/dist/build/formats/cssAdvanced.d.ts +0 -2
  114. package/dist/build/formats/cssAdvanced.js +0 -84
  115. package/dist/build/formats/cssCustomMedia.d.ts +0 -7
  116. package/dist/build/formats/cssCustomMedia.js +0 -25
  117. package/dist/build/formats/index.d.ts +0 -9
  118. package/dist/build/formats/index.js +0 -21
  119. package/dist/build/formats/javascriptCommonJs.d.ts +0 -7
  120. package/dist/build/formats/javascriptCommonJs.js +0 -25
  121. package/dist/build/formats/javascriptEsm.d.ts +0 -7
  122. package/dist/build/formats/javascriptEsm.js +0 -25
  123. package/dist/build/formats/jsonFigma.d.ts +0 -7
  124. package/dist/build/formats/jsonFigma.js +0 -116
  125. package/dist/build/formats/jsonNestedPrefixed.d.ts +0 -8
  126. package/dist/build/formats/jsonNestedPrefixed.js +0 -28
  127. package/dist/build/formats/jsonOneDimensional.d.ts +0 -8
  128. package/dist/build/formats/jsonOneDimensional.js +0 -24
  129. package/dist/build/formats/jsonPostCssFallback.d.ts +0 -8
  130. package/dist/build/formats/jsonPostCssFallback.js +0 -21
  131. package/dist/build/formats/typescriptExportDefinition.d.ts +0 -7
  132. package/dist/build/formats/typescriptExportDefinition.js +0 -166
  133. package/dist/build/formats/utilities/jsonToFlat.d.ts +0 -11
  134. package/dist/build/formats/utilities/jsonToFlat.js +0 -12
  135. package/dist/build/formats/utilities/jsonToNestedValue.d.ts +0 -8
  136. package/dist/build/formats/utilities/jsonToNestedValue.js +0 -25
  137. package/dist/build/formats/utilities/prefixTokens.d.ts +0 -8
  138. package/dist/build/formats/utilities/prefixTokens.js +0 -17
  139. package/dist/build/parsers/index.d.ts +0 -1
  140. package/dist/build/parsers/index.js +0 -5
  141. package/dist/build/parsers/w3cJsonParser.d.ts +0 -6
  142. package/dist/build/parsers/w3cJsonParser.js +0 -27
  143. package/dist/build/platforms/css.d.ts +0 -2
  144. package/dist/build/platforms/css.js +0 -87
  145. package/dist/build/platforms/deprecatedJson.d.ts +0 -2
  146. package/dist/build/platforms/deprecatedJson.js +0 -17
  147. package/dist/build/platforms/docJson.d.ts +0 -2
  148. package/dist/build/platforms/docJson.js +0 -34
  149. package/dist/build/platforms/fallbacks.d.ts +0 -2
  150. package/dist/build/platforms/fallbacks.js +0 -34
  151. package/dist/build/platforms/figma.d.ts +0 -2
  152. package/dist/build/platforms/figma.js +0 -53
  153. package/dist/build/platforms/index.d.ts +0 -10
  154. package/dist/build/platforms/index.js +0 -23
  155. package/dist/build/platforms/javascript.d.ts +0 -2
  156. package/dist/build/platforms/javascript.js +0 -30
  157. package/dist/build/platforms/json.d.ts +0 -2
  158. package/dist/build/platforms/json.js +0 -32
  159. package/dist/build/platforms/styleLint.d.ts +0 -2
  160. package/dist/build/platforms/styleLint.js +0 -34
  161. package/dist/build/platforms/typeDefinitions.d.ts +0 -2
  162. package/dist/build/platforms/typeDefinitions.js +0 -30
  163. package/dist/build/platforms/typescript.d.ts +0 -2
  164. package/dist/build/platforms/typescript.js +0 -30
  165. package/dist/build/schemas/alphaValue.d.ts +0 -2
  166. package/dist/build/schemas/alphaValue.js +0 -8
  167. package/dist/build/schemas/baseToken.d.ts +0 -11
  168. package/dist/build/schemas/baseToken.js +0 -10
  169. package/dist/build/schemas/borderToken.d.ts +0 -51
  170. package/dist/build/schemas/borderToken.js +0 -20
  171. package/dist/build/schemas/collections.d.ts +0 -6
  172. package/dist/build/schemas/collections.js +0 -18
  173. package/dist/build/schemas/colorHexValue.d.ts +0 -2
  174. package/dist/build/schemas/colorHexValue.js +0 -12
  175. package/dist/build/schemas/colorToken.d.ts +0 -80
  176. package/dist/build/schemas/colorToken.js +0 -52
  177. package/dist/build/schemas/designToken.d.ts +0 -2
  178. package/dist/build/schemas/designToken.js +0 -37
  179. package/dist/build/schemas/dimensionToken.d.ts +0 -52
  180. package/dist/build/schemas/dimensionToken.js +0 -36
  181. package/dist/build/schemas/dimensionValue.d.ts +0 -2
  182. package/dist/build/schemas/dimensionValue.js +0 -12
  183. package/dist/build/schemas/durationToken.d.ts +0 -18
  184. package/dist/build/schemas/durationToken.js +0 -14
  185. package/dist/build/schemas/durationValue.d.ts +0 -2
  186. package/dist/build/schemas/durationValue.js +0 -8
  187. package/dist/build/schemas/fontFamilyToken.d.ts +0 -52
  188. package/dist/build/schemas/fontFamilyToken.js +0 -23
  189. package/dist/build/schemas/fontWeightToken.d.ts +0 -52
  190. package/dist/build/schemas/fontWeightToken.js +0 -24
  191. package/dist/build/schemas/fontWeightValue.d.ts +0 -2
  192. package/dist/build/schemas/fontWeightValue.js +0 -9
  193. package/dist/build/schemas/numberToken.d.ts +0 -71
  194. package/dist/build/schemas/numberToken.js +0 -30
  195. package/dist/build/schemas/referenceValue.d.ts +0 -2
  196. package/dist/build/schemas/referenceValue.js +0 -8
  197. package/dist/build/schemas/scopes.d.ts +0 -5
  198. package/dist/build/schemas/scopes.js +0 -34
  199. package/dist/build/schemas/shadowToken.d.ts +0 -157
  200. package/dist/build/schemas/shadowToken.js +0 -46
  201. package/dist/build/schemas/stringToken.d.ts +0 -18
  202. package/dist/build/schemas/stringToken.js +0 -13
  203. package/dist/build/schemas/tokenName.d.ts +0 -2
  204. package/dist/build/schemas/tokenName.js +0 -8
  205. package/dist/build/schemas/tokenType.d.ts +0 -3
  206. package/dist/build/schemas/tokenType.js +0 -6
  207. package/dist/build/schemas/typographyToken.d.ts +0 -59
  208. package/dist/build/schemas/typographyToken.js +0 -21
  209. package/dist/build/schemas/validTokenType.d.ts +0 -5
  210. package/dist/build/schemas/validTokenType.js +0 -34
  211. package/dist/build/schemas/viewportRangeToken.d.ts +0 -18
  212. package/dist/build/schemas/viewportRangeToken.js +0 -13
  213. package/dist/build/transformers/borderToCss.d.ts +0 -8
  214. package/dist/build/transformers/borderToCss.js +0 -38
  215. package/dist/build/transformers/colorToHex.d.ts +0 -8
  216. package/dist/build/transformers/colorToHex.js +0 -26
  217. package/dist/build/transformers/colorToHexMix.d.ts +0 -8
  218. package/dist/build/transformers/colorToHexMix.js +0 -25
  219. package/dist/build/transformers/colorToRgbAlpha.d.ts +0 -8
  220. package/dist/build/transformers/colorToRgbAlpha.js +0 -22
  221. package/dist/build/transformers/colorToRgbaFloat.d.ts +0 -8
  222. package/dist/build/transformers/colorToRgbaFloat.js +0 -50
  223. package/dist/build/transformers/dimensionToPixelUnitless.d.ts +0 -8
  224. package/dist/build/transformers/dimensionToPixelUnitless.js +0 -50
  225. package/dist/build/transformers/dimensionToRem.d.ts +0 -8
  226. package/dist/build/transformers/dimensionToRem.js +0 -47
  227. package/dist/build/transformers/dimensionToRemPxArray.d.ts +0 -8
  228. package/dist/build/transformers/dimensionToRemPxArray.js +0 -47
  229. package/dist/build/transformers/durationToCss.d.ts +0 -8
  230. package/dist/build/transformers/durationToCss.js +0 -30
  231. package/dist/build/transformers/figmaAttributes.d.ts +0 -8
  232. package/dist/build/transformers/figmaAttributes.js +0 -57
  233. package/dist/build/transformers/floatToPixel.d.ts +0 -15
  234. package/dist/build/transformers/floatToPixel.js +0 -41
  235. package/dist/build/transformers/fontFamilyToCss.d.ts +0 -14
  236. package/dist/build/transformers/fontFamilyToCss.js +0 -40
  237. package/dist/build/transformers/fontFamilyToFigma.d.ts +0 -14
  238. package/dist/build/transformers/fontFamilyToFigma.js +0 -46
  239. package/dist/build/transformers/fontWeightToNumber.d.ts +0 -9
  240. package/dist/build/transformers/fontWeightToNumber.js +0 -53
  241. package/dist/build/transformers/index.d.ts +0 -24
  242. package/dist/build/transformers/index.js +0 -51
  243. package/dist/build/transformers/jsonDeprecated.d.ts +0 -8
  244. package/dist/build/transformers/jsonDeprecated.js +0 -16
  245. package/dist/build/transformers/namePathToCamelCase.d.ts +0 -8
  246. package/dist/build/transformers/namePathToCamelCase.js +0 -14
  247. package/dist/build/transformers/namePathToDotNotation.d.ts +0 -8
  248. package/dist/build/transformers/namePathToDotNotation.js +0 -33
  249. package/dist/build/transformers/namePathToFigma.d.ts +0 -9
  250. package/dist/build/transformers/namePathToFigma.js +0 -24
  251. package/dist/build/transformers/namePathToKebabCase.d.ts +0 -8
  252. package/dist/build/transformers/namePathToKebabCase.js +0 -18
  253. package/dist/build/transformers/namePathToPascalCase.d.ts +0 -8
  254. package/dist/build/transformers/namePathToPascalCase.js +0 -14
  255. package/dist/build/transformers/namePathToSlashNotation.d.ts +0 -8
  256. package/dist/build/transformers/namePathToSlashNotation.js +0 -18
  257. package/dist/build/transformers/shadowToCss.d.ts +0 -8
  258. package/dist/build/transformers/shadowToCss.js +0 -35
  259. package/dist/build/transformers/typographyToCss.d.ts +0 -8
  260. package/dist/build/transformers/typographyToCss.js +0 -29
  261. package/dist/build/transformers/utilities/alpha.d.ts +0 -9
  262. package/dist/build/transformers/utilities/alpha.js +0 -20
  263. package/dist/build/transformers/utilities/checkRequiredTokenProperties.d.ts +0 -7
  264. package/dist/build/transformers/utilities/checkRequiredTokenProperties.js +0 -17
  265. package/dist/build/transformers/utilities/getTokenValue.d.ts +0 -2
  266. package/dist/build/transformers/utilities/getTokenValue.js +0 -18
  267. package/dist/build/transformers/utilities/hasSpaceInString.d.ts +0 -1
  268. package/dist/build/transformers/utilities/hasSpaceInString.js +0 -10
  269. package/dist/build/transformers/utilities/hexToRgbaFloat.d.ts +0 -2
  270. package/dist/build/transformers/utilities/hexToRgbaFloat.js +0 -33
  271. package/dist/build/transformers/utilities/invalidTokenError.d.ts +0 -7
  272. package/dist/build/transformers/utilities/invalidTokenError.js +0 -26
  273. package/dist/build/transformers/utilities/isRgbaFloat.d.ts +0 -7
  274. package/dist/build/transformers/utilities/isRgbaFloat.js +0 -24
  275. package/dist/build/transformers/utilities/mix.d.ts +0 -5
  276. package/dist/build/transformers/utilities/mix.js +0 -40
  277. package/dist/build/transformers/utilities/rgbaFloatToHex.d.ts +0 -6
  278. package/dist/build/transformers/utilities/rgbaFloatToHex.js +0 -15
  279. package/dist/build/utilities/copyFromDir.d.ts +0 -8
  280. package/dist/build/utilities/copyFromDir.js +0 -34
  281. package/dist/build/utilities/filterStringArray.d.ts +0 -1
  282. package/dist/build/utilities/filterStringArray.js +0 -17
  283. package/dist/build/utilities/getFlag.d.ts +0 -8
  284. package/dist/build/utilities/getFlag.js +0 -16
  285. package/dist/build/utilities/index.d.ts +0 -3
  286. package/dist/build/utilities/index.js +0 -9
  287. package/dist/build/utilities/joinFriendly.d.ts +0 -1
  288. package/dist/build/utilities/joinFriendly.js +0 -5
  289. package/dist/build/utilities/schemaErrorMessage.d.ts +0 -1
  290. package/dist/build/utilities/schemaErrorMessage.js +0 -5
  291. package/dist/build/utilities/toCamelCase.d.ts +0 -1
  292. package/dist/build/utilities/toCamelCase.js +0 -20
  293. package/dist/build/utilities/toPascalCase.d.ts +0 -1
  294. package/dist/build/utilities/toPascalCase.js +0 -17
  295. package/dist/build/utilities/treeWalker.d.ts +0 -8
  296. package/dist/build/utilities/treeWalker.js +0 -27
  297. package/dist/build/utilities/upperCaseFirstCharacter.d.ts +0 -8
  298. package/dist/build/utilities/upperCaseFirstCharacter.js +0 -14
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.typographyToken = exports.typographyValue = void 0;
4
- const zod_1 = require("zod");
5
- const referenceValue_1 = require("./referenceValue");
6
- const dimensionValue_1 = require("./dimensionValue");
7
- const baseToken_1 = require("./baseToken");
8
- const fontWeightValue_1 = require("./fontWeightValue");
9
- const tokenType_1 = require("./tokenType");
10
- exports.typographyValue = zod_1.z.object({
11
- fontSize: zod_1.z.union([dimensionValue_1.dimensionValue, referenceValue_1.referenceValue]),
12
- lineHeight: zod_1.z.union([dimensionValue_1.dimensionValue, referenceValue_1.referenceValue]).optional(),
13
- fontWeight: zod_1.z.union([fontWeightValue_1.fontWeightValue, referenceValue_1.referenceValue]),
14
- fontFamily: zod_1.z.union([zod_1.z.string().min(1), referenceValue_1.referenceValue]),
15
- });
16
- exports.typographyToken = baseToken_1.baseToken
17
- .extend({
18
- $value: zod_1.z.union([exports.typographyValue, referenceValue_1.referenceValue]),
19
- $type: (0, tokenType_1.tokenType)('typography'),
20
- })
21
- .strict();
@@ -1,5 +0,0 @@
1
- import { z } from 'zod';
2
- declare const validTypes: readonly ["color", "typography", "dimension", "duration", "border", "shadow", "fontFamily", "fontWeight", "number", "string", "custom-viewportRange"];
3
- export type TokenType = (typeof validTypes)[number];
4
- export declare const validateType: z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodTypeAny>>;
5
- export {};
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateType = void 0;
4
- const zod_1 = require("zod");
5
- const joinFriendly_1 = require("../utilities/joinFriendly");
6
- const schemaErrorMessage_1 = require("../utilities/schemaErrorMessage");
7
- const validTypes = [
8
- 'color',
9
- 'typography',
10
- 'dimension',
11
- 'duration',
12
- 'border',
13
- 'shadow',
14
- 'fontFamily',
15
- 'fontWeight',
16
- 'number',
17
- 'string',
18
- 'custom-viewportRange',
19
- ];
20
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
21
- // @ts-ignore: TODO: fix this
22
- exports.validateType = zod_1.z.record(zod_1.z.string(), zod_1.z.lazy(() => {
23
- return zod_1.z.union([
24
- zod_1.z
25
- .object({
26
- $value: zod_1.z.any(),
27
- $type: zod_1.z.string().refine(type => validTypes.includes(type), val => ({
28
- message: (0, schemaErrorMessage_1.schemaErrorMessage)(`Invalid token $type: "${val}"`, `Must be one of the following: ${(0, joinFriendly_1.joinFriendly)([...validTypes], 'or')}`),
29
- })),
30
- })
31
- .required(),
32
- exports.validateType,
33
- ]);
34
- }));
@@ -1,18 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const viewportRangeToken: z.ZodObject<z.objectUtil.extendShape<{
3
- $description: z.ZodOptional<z.ZodString>;
4
- deprecated: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
5
- }, {
6
- $value: z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, string, string>]>;
7
- $type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange">;
8
- }>, "strict", z.ZodTypeAny, {
9
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
10
- $value: string;
11
- deprecated?: string | boolean | undefined;
12
- $description?: string | undefined;
13
- }, {
14
- $type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "shadow" | "typography" | "duration" | "custom-viewportRange";
15
- $value: string;
16
- deprecated?: string | boolean | undefined;
17
- $description?: string | undefined;
18
- }>;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.viewportRangeToken = void 0;
4
- const zod_1 = require("zod");
5
- const baseToken_1 = require("./baseToken");
6
- const referenceValue_1 = require("./referenceValue");
7
- const tokenType_1 = require("./tokenType");
8
- exports.viewportRangeToken = baseToken_1.baseToken
9
- .extend({
10
- $value: zod_1.z.union([zod_1.z.string(), referenceValue_1.referenceValue]),
11
- $type: (0, tokenType_1.tokenType)('custom-viewportRange'),
12
- })
13
- .strict();
@@ -1,8 +0,0 @@
1
- import type StyleDictionary from 'style-dictionary';
2
- /**
3
- * @description converts w3c border tokens in css border string
4
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
- * @matcher matches all tokens of $type `border`
6
- * @transformer returns css border `string`
7
- */
8
- export declare const borderToCss: StyleDictionary.Transform;
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.borderToCss = void 0;
4
- const isBorder_1 = require("../filters/isBorder");
5
- /**
6
- * checks if all required properties exist on shadow token
7
- * @param object - BorderTokenValue
8
- * @returns void or throws error
9
- */
10
- const checkForBorderTokenProperties = (border) => {
11
- const requiredProperties = ['color', 'width', 'style'];
12
- for (const prop of requiredProperties) {
13
- if (prop in border === false) {
14
- throw new Error(`Missing propery: ${prop} on border token ${JSON.stringify(border)}`);
15
- }
16
- }
17
- };
18
- /**
19
- * @description converts w3c border tokens in css border string
20
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
21
- * @matcher matches all tokens of $type `border`
22
- * @transformer returns css border `string`
23
- */
24
- exports.borderToCss = {
25
- type: `value`,
26
- transitive: true,
27
- matcher: isBorder_1.isBorder,
28
- transformer: ({ value }) => {
29
- //
30
- checkForBorderTokenProperties(value);
31
- // if value === string it was probably already transformed
32
- if (typeof value === 'string') {
33
- return value;
34
- }
35
- /* color | style | width */
36
- return `${value.color} ${value.style} ${value.width}`;
37
- },
38
- };
@@ -1,8 +0,0 @@
1
- import type StyleDictionary from 'style-dictionary';
2
- /**
3
- * @description converts color tokens value to `hex6` or `hex8`
4
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
- * @matcher matches all tokens of $type `color`
6
- * @transformer returns a `hex` string
7
- */
8
- export declare const colorToHex: StyleDictionary.Transform;
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.colorToHex = void 0;
4
- const color2k_1 = require("color2k");
5
- const filters_1 = require("../filters");
6
- const getTokenValue_1 = require("./utilities/getTokenValue");
7
- const alpha_1 = require("./utilities/alpha");
8
- /**
9
- * @description converts color tokens value to `hex6` or `hex8`
10
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
11
- * @matcher matches all tokens of $type `color`
12
- * @transformer returns a `hex` string
13
- */
14
- exports.colorToHex = {
15
- type: `value`,
16
- transitive: true,
17
- matcher: filters_1.isColor,
18
- transformer: (token) => {
19
- var _a, _b;
20
- const alphaValue = (_a = token.alpha) !== null && _a !== void 0 ? _a : (_b = token.$extensions) === null || _b === void 0 ? void 0 : _b.alpha;
21
- if (alphaValue === null || alphaValue === undefined) {
22
- return (0, color2k_1.toHex)((0, getTokenValue_1.getTokenValue)(token));
23
- }
24
- return (0, color2k_1.toHex)((0, alpha_1.alpha)((0, getTokenValue_1.getTokenValue)(token), alphaValue, token));
25
- },
26
- };
@@ -1,8 +0,0 @@
1
- import type StyleDictionary from 'style-dictionary';
2
- /**
3
- * @description replaces tokens value with `hex8` color using the tokens `alpha` property to specify the value used for alpha
4
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
- * @matcher matches all tokens of $type `color` with an `alpha` property
6
- * @transformer returns `hex8` string
7
- */
8
- export declare const colorToHexMix: StyleDictionary.Transform;
@@ -1,25 +0,0 @@
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.colorToHexMix = void 0;
7
- const color2k_1 = require("color2k");
8
- const filters_1 = require("../filters");
9
- const getTokenValue_1 = require("./utilities/getTokenValue");
10
- const mix_1 = __importDefault(require("./utilities/mix"));
11
- /**
12
- * @description replaces tokens value with `hex8` color using the tokens `alpha` property to specify the value used for alpha
13
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
14
- * @matcher matches all tokens of $type `color` with an `alpha` property
15
- * @transformer returns `hex8` string
16
- */
17
- exports.colorToHexMix = {
18
- type: `value`,
19
- transitive: true,
20
- matcher: filters_1.isColorWithMix,
21
- transformer: (token) => {
22
- var _a, _b;
23
- return (0, color2k_1.toHex)((0, mix_1.default)((0, getTokenValue_1.getTokenValue)(token), ((_a = token.mix) === null || _a === void 0 ? void 0 : _a.color) || (0, getTokenValue_1.getTokenValue)(token), ((_b = token.mix) === null || _b === void 0 ? void 0 : _b.weight) || 0));
24
- },
25
- };
@@ -1,8 +0,0 @@
1
- import type StyleDictionary from 'style-dictionary';
2
- /**
3
- * @description replaces tokens value with `rgba` color using the tokens `alpha` property to specify the value used for alpha
4
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
- * @matcher matches all tokens of $type `color` with an `alpha` property
6
- * @transformer returns `rgba` string
7
- */
8
- export declare const colorToRgbAlpha: StyleDictionary.Transform;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.colorToRgbAlpha = void 0;
4
- const filters_1 = require("../filters");
5
- const alpha_1 = require("./utilities/alpha");
6
- const getTokenValue_1 = require("./utilities/getTokenValue");
7
- /**
8
- * @description replaces tokens value with `rgba` color using the tokens `alpha` property to specify the value used for alpha
9
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
10
- * @matcher matches all tokens of $type `color` with an `alpha` property
11
- * @transformer returns `rgba` string
12
- */
13
- exports.colorToRgbAlpha = {
14
- type: `value`,
15
- transitive: true,
16
- matcher: filters_1.isColorWithAlpha,
17
- transformer: (token) => {
18
- if (token.alpha === null)
19
- return (0, getTokenValue_1.getTokenValue)(token);
20
- return (0, alpha_1.alpha)((0, getTokenValue_1.getTokenValue)(token), token.alpha, token);
21
- },
22
- };
@@ -1,8 +0,0 @@
1
- import type StyleDictionary from 'style-dictionary';
2
- /**
3
- * @description converts color tokens rgba float with values from 0 - 1
4
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
- * @matcher matches all tokens of $type `color`
6
- * @transformer returns a `rgb` float object
7
- */
8
- export declare const colorToRgbaFloat: StyleDictionary.Transform;
@@ -1,50 +0,0 @@
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.colorToRgbaFloat = void 0;
7
- const color2k_1 = require("color2k");
8
- const filters_1 = require("../filters");
9
- const getTokenValue_1 = require("./utilities/getTokenValue");
10
- const rgbaFloatToHex_1 = require("./utilities/rgbaFloatToHex");
11
- const mix_1 = __importDefault(require("./utilities/mix"));
12
- const hexToRgbaFloat_1 = require("./utilities/hexToRgbaFloat");
13
- const isRgbaFloat_1 = require("./utilities/isRgbaFloat");
14
- const toRgbaFloat = (token, alpha) => {
15
- var _a;
16
- let tokenValue = (0, getTokenValue_1.getTokenValue)(token);
17
- let tokenMixColor = (_a = token.mix) === null || _a === void 0 ? void 0 : _a.color;
18
- // get hex value from color string
19
- if ((0, isRgbaFloat_1.isRgbaFloat)(tokenValue)) {
20
- tokenValue = (0, rgbaFloatToHex_1.rgbaFloatToHex)(tokenValue, false);
21
- }
22
- if (tokenMixColor && (0, isRgbaFloat_1.isRgbaFloat)(tokenMixColor)) {
23
- tokenMixColor = (0, rgbaFloatToHex_1.rgbaFloatToHex)(tokenMixColor, false);
24
- }
25
- let hex = (0, color2k_1.toHex)(tokenValue);
26
- // mix color with mix color and weight
27
- if (token.mix && token.mix.color && token.mix.weight) {
28
- hex = (0, color2k_1.toHex)((0, mix_1.default)(tokenValue, tokenMixColor, token.mix.weight));
29
- }
30
- // return color as RgbaFloat
31
- return (0, hexToRgbaFloat_1.hexToRgbaFloat)(hex, alpha);
32
- };
33
- /**
34
- * @description converts color tokens rgba float with values from 0 - 1
35
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
36
- * @matcher matches all tokens of $type `color`
37
- * @transformer returns a `rgb` float object
38
- */
39
- exports.colorToRgbaFloat = {
40
- type: `value`,
41
- transitive: true,
42
- matcher: filters_1.isColor,
43
- transformer: (token) => {
44
- // skip if value is already rgb float
45
- if ((0, isRgbaFloat_1.isRgbaFloat)(token.value) && !('mix' in token) && !('alpha' in token))
46
- return token.value;
47
- // convert hex or rgb values to rgba float
48
- return toRgbaFloat(token, token.alpha);
49
- },
50
- };
@@ -1,8 +0,0 @@
1
- import type StyleDictionary from 'style-dictionary';
2
- /**
3
- * @description converts dimension tokens value to pixel value without unit, ignores `em` as they are relative to the font size of the parent element
4
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
- * @matcher matches all tokens of $type `dimension`
6
- * @transformer returns a float number
7
- */
8
- export declare const dimensionToPixelUnitless: StyleDictionary.Transform;
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dimensionToPixelUnitless = void 0;
4
- const filters_1 = require("../filters");
5
- /**
6
- * @description base font size from options or 16
7
- * @param options
8
- * @returns number
9
- */
10
- const getBasePxFontSize = (options) => (options && options.basePxFontSize) || 16;
11
- /**
12
- * @description checks if token value has a specific unit
13
- * @param value token value
14
- * @param unit unit string like px or value
15
- * @returns boolean
16
- */
17
- const hasUnit = (value, unit) => {
18
- if (typeof value === 'number') {
19
- return false;
20
- }
21
- return value.indexOf(unit) > -1;
22
- };
23
- /**
24
- * @description converts dimension tokens value to pixel value without unit, ignores `em` as they are relative to the font size of the parent element
25
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
26
- * @matcher matches all tokens of $type `dimension`
27
- * @transformer returns a float number
28
- */
29
- exports.dimensionToPixelUnitless = {
30
- type: `value`,
31
- transitive: true,
32
- matcher: filters_1.isDimension,
33
- transformer: (token, options) => {
34
- const baseFont = getBasePxFontSize(options);
35
- const floatVal = parseFloat(token.value);
36
- if (isNaN(floatVal)) {
37
- throw new Error(`Invalid dimension token: '${token.name}: ${token.value}' is not valid and cannot be transform to 'float' \n`);
38
- }
39
- if (floatVal === 0) {
40
- return 0;
41
- }
42
- if (hasUnit(token.value, 'rem')) {
43
- return floatVal * baseFont;
44
- }
45
- if (hasUnit(token.value, 'px')) {
46
- return floatVal;
47
- }
48
- return token.value;
49
- },
50
- };
@@ -1,8 +0,0 @@
1
- import type StyleDictionary from 'style-dictionary';
2
- /**
3
- * @description converts dimension tokens value to `rem`, ignores `em` as they are relative to the font size of the parent element
4
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
- * @matcher matches all tokens of $type `dimension`
6
- * @transformer returns a `rem` string
7
- */
8
- export declare const dimensionToRem: StyleDictionary.Transform;
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dimensionToRem = void 0;
4
- const filters_1 = require("../filters");
5
- /**
6
- * @description base font size from options or 16
7
- * @param options
8
- * @returns number
9
- */
10
- const getBasePxFontSize = (options) => (options && options.basePxFontSize) || 16;
11
- /**
12
- * @description checks if token value has a specific unit
13
- * @param value token value
14
- * @param unit unit string like px or value
15
- * @returns boolean
16
- */
17
- const hasUnit = (value, unit) => {
18
- if (typeof value === 'number') {
19
- return false;
20
- }
21
- return value.indexOf(unit) > -1;
22
- };
23
- /**
24
- * @description converts dimension tokens value to `rem`, ignores `em` as they are relative to the font size of the parent element
25
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
26
- * @matcher matches all tokens of $type `dimension`
27
- * @transformer returns a `rem` string
28
- */
29
- exports.dimensionToRem = {
30
- type: `value`,
31
- transitive: true,
32
- matcher: filters_1.isDimension,
33
- transformer: (token, options) => {
34
- const baseFont = getBasePxFontSize(options);
35
- const floatVal = parseFloat(token.value);
36
- if (isNaN(floatVal)) {
37
- throw new Error(`Invalid dimension token: '${token.name}: ${token.value}' is not valid and cannot be transform to 'rem' \n`);
38
- }
39
- if (floatVal === 0) {
40
- return '0';
41
- }
42
- if (hasUnit(token.value, 'rem') || hasUnit(token.value, 'em')) {
43
- return token.value;
44
- }
45
- return `${floatVal / baseFont}rem`;
46
- },
47
- };
@@ -1,8 +0,0 @@
1
- import type StyleDictionary from 'style-dictionary';
2
- /**
3
- * @description converts dimension tokens value to `rem`, ignores `em` as they are relative to the font size of the parent element
4
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
- * @matcher matches all tokens of $type `dimension`
6
- * @transformer returns an array with the `rem` and `pixel` string
7
- */
8
- export declare const dimensionToRemPxArray: StyleDictionary.Transform;
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dimensionToRemPxArray = void 0;
4
- const filters_1 = require("../filters");
5
- /**
6
- * @description base font size from options or 16
7
- * @param options
8
- * @returns number
9
- */
10
- const getBasePxFontSize = (options) => (options && options.basePxFontSize) || 16;
11
- /**
12
- * @description checks if token value has a specific unit
13
- * @param value token value
14
- * @param unit unit string like px or value
15
- * @returns boolean
16
- */
17
- const hasUnit = (value, unit) => {
18
- if (typeof value === 'number') {
19
- return false;
20
- }
21
- return value.indexOf(unit) > -1;
22
- };
23
- /**
24
- * @description converts dimension tokens value to `rem`, ignores `em` as they are relative to the font size of the parent element
25
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
26
- * @matcher matches all tokens of $type `dimension`
27
- * @transformer returns an array with the `rem` and `pixel` string
28
- */
29
- exports.dimensionToRemPxArray = {
30
- type: `value`,
31
- transitive: true,
32
- matcher: filters_1.isDimension,
33
- transformer: (token, options) => {
34
- const baseFont = getBasePxFontSize(options);
35
- const floatVal = parseFloat(token.value);
36
- if (isNaN(floatVal)) {
37
- throw new Error(`Invalid dimension token: '${token.name}: ${token.value}' is not valid and cannot be transform to 'rem' \n`);
38
- }
39
- if (floatVal === 0) {
40
- return ['0', '0'];
41
- }
42
- if (hasUnit(token.value, 'rem') || hasUnit(token.value, 'em')) {
43
- return [token.value, `${floatVal * baseFont}px`];
44
- }
45
- return [`${floatVal / baseFont}rem`, `${floatVal}px`];
46
- },
47
- };
@@ -1,8 +0,0 @@
1
- import type StyleDictionary from 'style-dictionary';
2
- /**
3
- * @description converts duration tokens string value to number with `ms` unit
4
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
- * @matcher matches all tokens of $type `duration`
6
- * @transformer returns a css duration
7
- */
8
- export declare const durationToCss: StyleDictionary.Transform;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.durationToCss = void 0;
4
- const isDuration_1 = require("../filters/isDuration");
5
- /**
6
- * @description converts duration tokens string value to number with `ms` unit
7
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
8
- * @matcher matches all tokens of $type `duration`
9
- * @transformer returns a css duration
10
- */
11
- exports.durationToCss = {
12
- type: `value`,
13
- transitive: true,
14
- matcher: isDuration_1.isDuration,
15
- transformer: (token, _options) => {
16
- // throw an error if token value is not a string or does not end with `ms`
17
- if (typeof token.value !== `string` || !token.value.endsWith(`ms`)) {
18
- throw new Error(`duration token value must be a string with an "ms" unit`);
19
- }
20
- // get value
21
- let value = parseInt(token.value.replace('ms', ''));
22
- let unit = `ms`;
23
- if (value >= 1000) {
24
- value = value / 1000;
25
- unit = `s`;
26
- }
27
- // return value
28
- return `${value}${unit}`;
29
- },
30
- };
@@ -1,8 +0,0 @@
1
- import type StyleDictionary from 'style-dictionary';
2
- /**
3
- * @description retrieves figma attributes from token and adds them to attributes
4
- * @type attribute transformer — [StyleDictionary.AttributeTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
5
- * @matcher matches all tokens
6
- * @transformer returns ab object of figma attributes
7
- */
8
- export declare const figmaAttributes: StyleDictionary.Transform;
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.figmaAttributes = void 0;
4
- const figmaScopes = {
5
- all: ['ALL_SCOPES'],
6
- radius: ['CORNER_RADIUS'],
7
- size: ['WIDTH_HEIGHT'],
8
- gap: ['GAP'],
9
- bgColor: ['FRAME_FILL', 'SHAPE_FILL'],
10
- fgColor: ['TEXT_FILL', 'SHAPE_FILL'],
11
- effectColor: ['EFFECT_COLOR'],
12
- effectFloat: ['EFFECT_FLOAT'],
13
- borderColor: ['STROKE_COLOR'],
14
- borderWidth: ['STROKE_FLOAT'],
15
- opacity: ['OPACITY'],
16
- fontFamily: ['FONT_FAMILY'],
17
- fontStyle: ['FONT_STYLE'],
18
- fontWeight: ['FONT_WEIGHT'],
19
- fontSize: ['FONT_SIZE'],
20
- lineHeight: ['LINE_HEIGHT'],
21
- letterSpacing: ['LETTER_SPACING'],
22
- paragraphSpacing: ['PARAGRAPH_SPACING'],
23
- paragraphIndent: ['PARAGRAPH_INDENT'],
24
- };
25
- const getScopes = (scopes) => {
26
- if (typeof scopes === 'string')
27
- scopes = [scopes];
28
- if (Array.isArray(scopes))
29
- return scopes
30
- .map(scope => {
31
- if (scope in figmaScopes)
32
- return figmaScopes[scope];
33
- throw new Error(`Invalid scope: ${scope}`);
34
- })
35
- .flat();
36
- return ['ALL_SCOPES'];
37
- };
38
- /**
39
- * @description retrieves figma attributes from token and adds them to attributes
40
- * @type attribute transformer — [StyleDictionary.AttributeTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
41
- * @matcher matches all tokens
42
- * @transformer returns ab object of figma attributes
43
- */
44
- exports.figmaAttributes = {
45
- type: `attribute`,
46
- transformer: (token, platform = {}) => {
47
- var _a, _b;
48
- const { mode, collection, scopes, group, codeSyntax } = ((_a = token.$extensions) === null || _a === void 0 ? void 0 : _a['org.primer.figma']) || {};
49
- return {
50
- mode: ((_b = platform.options) === null || _b === void 0 ? void 0 : _b.mode) || mode || 'default',
51
- collection,
52
- group: group || collection,
53
- scopes: getScopes(scopes),
54
- codeSyntax,
55
- };
56
- },
57
- };
@@ -1,15 +0,0 @@
1
- import type StyleDictionary from 'style-dictionary';
2
- /**
3
- * takes a value and returns it if its a px string if it is a float and the token has a fontSize value in extensions['org.primer.data']
4
- * @param value
5
- * @returns string
6
- */
7
- export declare const convertFloatToPixel: (token: StyleDictionary.TransformedToken, unitless?: boolean) => any;
8
- /**
9
- * @description converts a float value to a pixel value based on the provided fontSize on the tokersn extension
10
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
11
- * @matcher matches all tokens of $type `isNumber`
12
- * @transformer returns a pixel string
13
- */
14
- export declare const floatToPixel: StyleDictionary.Transform;
15
- export declare const floatToPixelUnitless: StyleDictionary.Transform;