@primer/primitives 7.17.0-rc.6fa44402 → 7.17.0-rc.8ff6ed39

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 (60) hide show
  1. package/package.json +1 -1
  2. package/src/PrimerStyleDictionary.ts +0 -6
  3. package/src/platforms/figma.ts +0 -6
  4. package/src/transformers/fontFamilyToCss.ts +4 -3
  5. package/src/transformers/index.ts +0 -1
  6. package/tokens-v2-private/css/tokens/base/size/size.css +1 -1
  7. package/tokens-v2-private/css/tokens/base/typography/typography.css +1 -1
  8. package/tokens-v2-private/css/tokens/functional/size/border.css +1 -1
  9. package/tokens-v2-private/css/tokens/functional/size/breakpoints.css +1 -1
  10. package/tokens-v2-private/css/tokens/functional/size/size-coarse.css +1 -1
  11. package/tokens-v2-private/css/tokens/functional/size/size-fine.css +1 -1
  12. package/tokens-v2-private/css/tokens/functional/size/size.css +1 -1
  13. package/tokens-v2-private/css/tokens/functional/typography/typography.css +1 -1
  14. package/tokens-v2-private/js/module/tokens/base/size/size.js +1 -1
  15. package/tokens-v2-private/js/module/tokens/base/typography/typography.js +1 -1
  16. package/tokens-v2-private/js/module/tokens/functional/size/border.js +1 -1
  17. package/tokens-v2-private/js/module/tokens/functional/size/breakpoints.js +1 -1
  18. package/tokens-v2-private/js/module/tokens/functional/size/size-coarse.js +1 -1
  19. package/tokens-v2-private/js/module/tokens/functional/size/size-fine.js +1 -1
  20. package/tokens-v2-private/js/module/tokens/functional/size/size.js +1 -1
  21. package/tokens-v2-private/js/module/tokens/functional/size/viewport.js +1 -1
  22. package/tokens-v2-private/js/module/tokens/functional/typography/typography.js +1 -1
  23. package/tokens-v2-private/js/tokens/base/size/size.js +1 -1
  24. package/tokens-v2-private/js/tokens/base/typography/typography.js +1 -1
  25. package/tokens-v2-private/js/tokens/functional/size/border.js +1 -1
  26. package/tokens-v2-private/js/tokens/functional/size/breakpoints.js +1 -1
  27. package/tokens-v2-private/js/tokens/functional/size/size-coarse.js +1 -1
  28. package/tokens-v2-private/js/tokens/functional/size/size-fine.js +1 -1
  29. package/tokens-v2-private/js/tokens/functional/size/size.js +1 -1
  30. package/tokens-v2-private/js/tokens/functional/size/viewport.js +1 -1
  31. package/tokens-v2-private/js/tokens/functional/typography/typography.js +1 -1
  32. package/tokens-v2-private/scss/tokens/base/size/size.scss +1 -1
  33. package/tokens-v2-private/scss/tokens/base/typography/typography.scss +1 -1
  34. package/tokens-v2-private/scss/tokens/functional/size/border.scss +1 -1
  35. package/tokens-v2-private/scss/tokens/functional/size/breakpoints.scss +1 -1
  36. package/tokens-v2-private/scss/tokens/functional/size/size-coarse.scss +1 -1
  37. package/tokens-v2-private/scss/tokens/functional/size/size-fine.scss +1 -1
  38. package/tokens-v2-private/scss/tokens/functional/size/size.scss +1 -1
  39. package/tokens-v2-private/scss/tokens/functional/size/viewport.scss +1 -1
  40. package/tokens-v2-private/scss/tokens/functional/typography/typography.scss +1 -1
  41. package/tokens-v2-private/ts/tokens/base/size/size.d.ts +1 -1
  42. package/tokens-v2-private/ts/tokens/base/size/size.js +1 -1
  43. package/tokens-v2-private/ts/tokens/base/typography/typography.d.ts +1 -1
  44. package/tokens-v2-private/ts/tokens/base/typography/typography.js +1 -1
  45. package/tokens-v2-private/ts/tokens/functional/size/border.d.ts +1 -1
  46. package/tokens-v2-private/ts/tokens/functional/size/border.js +1 -1
  47. package/tokens-v2-private/ts/tokens/functional/size/breakpoints.d.ts +1 -1
  48. package/tokens-v2-private/ts/tokens/functional/size/breakpoints.js +1 -1
  49. package/tokens-v2-private/ts/tokens/functional/size/size-coarse.d.ts +1 -1
  50. package/tokens-v2-private/ts/tokens/functional/size/size-coarse.js +1 -1
  51. package/tokens-v2-private/ts/tokens/functional/size/size-fine.d.ts +1 -1
  52. package/tokens-v2-private/ts/tokens/functional/size/size-fine.js +1 -1
  53. package/tokens-v2-private/ts/tokens/functional/size/size.d.ts +1 -1
  54. package/tokens-v2-private/ts/tokens/functional/size/size.js +1 -1
  55. package/tokens-v2-private/ts/tokens/functional/size/viewport.d.ts +1 -1
  56. package/tokens-v2-private/ts/tokens/functional/size/viewport.js +1 -1
  57. package/tokens-v2-private/ts/tokens/functional/typography/typography.d.ts +1 -1
  58. package/tokens-v2-private/ts/tokens/functional/typography/typography.js +1 -1
  59. package/src/transformers/fontFamilyToFigma.ts +0 -47
  60. package/src/transformers/utilities/hasSpaceInString.ts +0 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/primitives",
3
- "version": "7.17.0-rc.6fa44402",
3
+ "version": "7.17.0-rc.8ff6ed39",
4
4
  "description": "Typography, spacing, and color primitives for Primer design system",
5
5
  "files": [
6
6
  "dist",
@@ -12,7 +12,6 @@ import {
12
12
  durationToCss,
13
13
  figmaAttributes,
14
14
  fontFamilyToCss,
15
- fontFamilyToFigma,
16
15
  fontWeightToNumber,
17
16
  jsonDeprecated,
18
17
  namePathToDotNotation,
@@ -217,11 +216,6 @@ StyleDictionary.registerTransform({
217
216
  ...fontFamilyToCss,
218
217
  })
219
218
 
220
- StyleDictionary.registerTransform({
221
- name: 'fontFamily/figma',
222
- ...fontFamilyToFigma,
223
- })
224
-
225
219
  /**
226
220
  * @name {@link PrimerStyleDictionary}
227
221
  * @description Returns style dictionary object with primer preset that includes parsers, formats and transformers
@@ -25,7 +25,6 @@ export const figma: PlatformInitializer = (outputFile, prefix, buildPath, option
25
25
  'name/pathToFigma',
26
26
  // 'name/pathToSlashNotation',
27
27
  'figma/attributes',
28
- 'fontFamily/figma',
29
28
  'dimension/pixelUnitless',
30
29
  // 'border/figma',
31
30
  // 'typography/figma',
@@ -33,11 +32,6 @@ export const figma: PlatformInitializer = (outputFile, prefix, buildPath, option
33
32
  ],
34
33
  options: {
35
34
  basePxFontSize: 16,
36
- fontFamilies: {
37
- 'fontStack/system': 'SF Pro Text',
38
- 'fontStack/sansSerif': 'SF Pro Text',
39
- 'fontStack/monospace': 'SF Mono',
40
- },
41
35
  ...options,
42
36
  },
43
37
  files: [
@@ -1,7 +1,8 @@
1
1
  import type StyleDictionary from 'style-dictionary'
2
2
  import {isFontFamily} from '../filters'
3
3
  import {getTokenValue} from './utilities/getTokenValue'
4
- import {hasSpaceInString} from './utilities/hasSpaceInString'
4
+
5
+ const hasSpaceInName = (string: string) => /\s/g.test(string)
5
6
  /**
6
7
  * takes a value and returns it if its a string or concats strings in an array quoting strings with spaces
7
8
  * @param value
@@ -17,7 +18,7 @@ export const parseFontFamily = (value: unknown): string => {
17
18
  if (typeof string !== 'string') {
18
19
  throw new Error(`Invalid value in array ${string}, must be a string`)
19
20
  }
20
- return hasSpaceInString(string) ? `'${string}'` : string
21
+ return hasSpaceInName(string) ? `'${string}'` : string
21
22
  })
22
23
  .join(', ')
23
24
  }
@@ -27,7 +28,7 @@ export const parseFontFamily = (value: unknown): string => {
27
28
  * @description converts fontFamily tokens value to string
28
29
  * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
29
30
  * @matcher matches all tokens of $type `fontFamily`
30
- * @transformer returns a string
31
+ * @transformer returns a number
31
32
  */
32
33
  export const fontFamilyToCss: StyleDictionary.Transform = {
33
34
  type: `value`,
@@ -10,7 +10,6 @@ export {dimensionToPixelUnitless} from './dimensionToPixelUnitless'
10
10
  export {durationToCss} from './durationToCss'
11
11
  export {figmaAttributes} from './figmaAttributes'
12
12
  export {fontFamilyToCss} from './fontFamilyToCss'
13
- export {fontFamilyToFigma} from './fontFamilyToFigma'
14
13
  export {fontWeightToNumber} from './fontWeightToNumber'
15
14
  export {jsonDeprecated} from './jsonDeprecated'
16
15
  export {namePathToCamelCase} from './namePathToCamelCase'
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  module.exports = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  module.exports = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  module.exports = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  module.exports = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  module.exports = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  module.exports = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  module.exports = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  module.exports = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  module.exports = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  export const BaseSize4 = "0.25rem";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  export const BaseTextWeightLight = "300";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  export const PrimerBorderInsetThin = "inset 0 0 0 max(1px, 0.0625rem)";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  export const PrimerBreakpointXsmall = "20rem";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  export const PrimerControlMinTargetAuto = "2.75rem";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  export const PrimerControlMinTargetAuto = "1rem";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  export const PrimerControlMinTargetFine = "1rem";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  export const PrimerViewportRangeNarrow = "(max-width: calc(48rem - 0.02px))";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
  export const PrimerFontStackSystem = "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'";
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ // Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
 
5
5
  $base-size-128: 8rem;
6
6
  $base-size-112: 7rem;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ // Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
 
5
5
  $base-text-weight-semibold: 600;
6
6
  $base-text-weight-medium: 500;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ // Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
 
5
5
  $primer-borderRadius-full: 100vh;
6
6
  $primer-borderRadius-large: 0.75rem;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ // Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
 
5
5
  $primer-breakpoint-xxlarge: 90rem;
6
6
  $primer-breakpoint-xlarge: 80rem;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ // Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
 
5
5
  $primer-controlStack-medium-gap-auto: $base-size-12;
6
6
  $primer-controlStack-small-gap-auto: $base-size-16;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ // Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
 
5
5
  $primer-controlStack-medium-gap-auto: $base-size-8;
6
6
  $primer-controlStack-small-gap-auto: $base-size-8;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ // Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
 
5
5
  $primer-controlStack-large-gap-spacious: $base-size-12;
6
6
  $primer-controlStack-large-gap-condensed: $base-size-8;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ // Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
 
5
5
  $primer-viewportRange-landscape: (orientation: landscape);
6
6
  $primer-viewportRange-portrait: (orientation: portrait);
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ // Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
 
5
5
  $primer-text-codeInline-size: 0.9285em;
6
6
  $primer-text-codeBlock-lineHeight: calc(20/13);
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Apr 2024 11:52:56 GMT
3
+ * Generated on Thu, 18 Apr 2024 08:11:38 GMT
4
4
  */
5
5
 
6
6
 
@@ -1,47 +0,0 @@
1
- import type StyleDictionary from 'style-dictionary'
2
- import {isFontFamily} from '../filters'
3
- import {hasSpaceInString} from './utilities/hasSpaceInString'
4
- /**
5
- * takes a value and returns it if its a string or concats strings in an array quoting strings with spaces
6
- * @param value
7
- * @returns string
8
- */
9
- export const parseFontFamily = (
10
- token: StyleDictionary.TransformedToken,
11
- fontFamilies: Record<string, string> = {},
12
- ): string => {
13
- // return value from fontFamilies
14
- if (token.name in fontFamilies) {
15
- return fontFamilies[token.name]
16
- }
17
- // return string
18
- if (typeof token.value === 'string') {
19
- return token.value
20
- }
21
- // return stringified array
22
- if (Array.isArray(token.value)) {
23
- return token.value
24
- .map((string: string) => {
25
- if (typeof string !== 'string') {
26
- throw new Error(`Invalid value in array ${string}, must be a string`)
27
- }
28
- return hasSpaceInString(string) ? `'${string}'` : string
29
- })
30
- .join(', ')
31
- }
32
- // invalid value
33
- throw new Error(`Invalid value ${token.value}, should be a string or array of strings`)
34
- }
35
- /**
36
- * @description converts fontFamily tokens value to string
37
- * @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
38
- * @matcher matches all tokens of $type `fontFamily`
39
- * @transformer returns a string
40
- */
41
- export const fontFamilyToFigma: StyleDictionary.Transform = {
42
- type: `value`,
43
- transitive: true,
44
- matcher: isFontFamily,
45
- transformer: (token: StyleDictionary.TransformedToken, platform: StyleDictionary.Platform): string =>
46
- parseFontFamily(token, platform.options?.fontFamilies),
47
- }
@@ -1,6 +0,0 @@
1
- export const hasSpaceInString = (string: string): boolean => {
2
- if (typeof string !== 'string') {
3
- throw new TypeError(`Invalid input. Input must be a string, ${typeof string} provided`)
4
- }
5
- return /\s/g.test(string)
6
- }