@primer/primitives 7.17.0-rc.9ef8a8c3 → 7.17.0-rc.a85cfb75

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 (198) hide show
  1. package/dist/css/functional/themes/dark-colorblind.css +10 -0
  2. package/dist/css/functional/themes/dark-dimmed.css +10 -0
  3. package/dist/css/functional/themes/dark-high-contrast.css +10 -0
  4. package/dist/css/functional/themes/dark-tritanopia.css +10 -0
  5. package/dist/css/functional/themes/dark.css +10 -0
  6. package/dist/css/functional/themes/light-colorblind.css +10 -0
  7. package/dist/css/functional/themes/light-high-contrast.css +10 -0
  8. package/dist/css/functional/themes/light-tritanopia.css +10 -0
  9. package/dist/css/functional/themes/light.css +10 -0
  10. package/dist/docs/functional/themes/dark-colorblind.json +145 -0
  11. package/dist/docs/functional/themes/dark-dimmed.json +145 -0
  12. package/dist/docs/functional/themes/dark-high-contrast.json +145 -0
  13. package/dist/docs/functional/themes/dark-tritanopia.json +145 -0
  14. package/dist/docs/functional/themes/dark.json +145 -0
  15. package/dist/docs/functional/themes/light-colorblind.json +145 -0
  16. package/dist/docs/functional/themes/light-high-contrast.json +145 -0
  17. package/dist/docs/functional/themes/light-tritanopia.json +145 -0
  18. package/dist/docs/functional/themes/light.json +145 -0
  19. package/dist/docs/functional/typography/typography.json +39 -3
  20. package/dist/figma/figma.json +10 -1
  21. package/dist/figma/themes/dark-colorblind.json +80 -0
  22. package/dist/figma/themes/dark-dimmed.json +80 -0
  23. package/dist/figma/themes/dark-high-contrast.json +80 -0
  24. package/dist/figma/themes/dark-tritanopia.json +80 -0
  25. package/dist/figma/themes/dark.json +80 -0
  26. package/dist/figma/themes/light-colorblind.json +80 -0
  27. package/dist/figma/themes/light-high-contrast.json +80 -0
  28. package/dist/figma/themes/light-tritanopia.json +80 -0
  29. package/dist/figma/themes/light.json +80 -0
  30. package/dist/figma/typography/typography.json +32 -0
  31. package/dist/internalCss/dark-colorblind.css +10 -0
  32. package/dist/internalCss/dark-dimmed.css +10 -0
  33. package/dist/internalCss/dark-high-contrast.css +10 -0
  34. package/dist/internalCss/dark-tritanopia.css +10 -0
  35. package/dist/internalCss/dark.css +10 -0
  36. package/dist/internalCss/light-colorblind.css +10 -0
  37. package/dist/internalCss/light-high-contrast.css +10 -0
  38. package/dist/internalCss/light-tritanopia.css +10 -0
  39. package/dist/internalCss/light.css +10 -0
  40. package/dist/styleLint/functional/themes/dark-colorblind.json +145 -0
  41. package/dist/styleLint/functional/themes/dark-dimmed.json +145 -0
  42. package/dist/styleLint/functional/themes/dark-high-contrast.json +145 -0
  43. package/dist/styleLint/functional/themes/dark-tritanopia.json +145 -0
  44. package/dist/styleLint/functional/themes/dark.json +145 -0
  45. package/dist/styleLint/functional/themes/light-colorblind.json +145 -0
  46. package/dist/styleLint/functional/themes/light-high-contrast.json +145 -0
  47. package/dist/styleLint/functional/themes/light-tritanopia.json +145 -0
  48. package/dist/styleLint/functional/themes/light.json +145 -0
  49. package/dist/styleLint/functional/typography/typography.json +39 -3
  50. package/package.json +5 -13
  51. package/src/PrimerStyleDictionary.ts +12 -0
  52. package/src/filters/index.ts +1 -0
  53. package/src/filters/isNumber.ts +8 -0
  54. package/src/formats/jsonFigma.ts +1 -0
  55. package/src/platforms/figma.ts +9 -1
  56. package/src/tokens/functional/color/dark/display-dark.json5 +66 -0
  57. package/src/tokens/functional/color/light/display-light.json5 +66 -0
  58. package/src/tokens/functional/typography/typography.json +21 -3
  59. package/src/transformers/floatToPixel.ts +33 -0
  60. package/src/transformers/fontFamilyToCss.ts +3 -4
  61. package/src/transformers/fontFamilyToFigma.ts +47 -0
  62. package/src/transformers/index.ts +2 -0
  63. package/src/transformers/utilities/hasSpaceInString.ts +6 -0
  64. package/build.js +0 -578
  65. package/dist/deprecated/colors.json +0 -7
  66. package/dist/js/colors/dark.d.ts +0 -516
  67. package/dist/js/colors/dark.js +0 -616
  68. package/dist/js/colors/dark_colorblind.d.ts +0 -516
  69. package/dist/js/colors/dark_colorblind.js +0 -616
  70. package/dist/js/colors/dark_dimmed.d.ts +0 -516
  71. package/dist/js/colors/dark_dimmed.js +0 -616
  72. package/dist/js/colors/dark_high_contrast.d.ts +0 -516
  73. package/dist/js/colors/dark_high_contrast.js +0 -616
  74. package/dist/js/colors/dark_tritanopia.d.ts +0 -516
  75. package/dist/js/colors/dark_tritanopia.js +0 -616
  76. package/dist/js/colors/index.d.ts +0 -4638
  77. package/dist/js/colors/index.js +0 -15
  78. package/dist/js/colors/light.d.ts +0 -516
  79. package/dist/js/colors/light.js +0 -616
  80. package/dist/js/colors/light_colorblind.d.ts +0 -516
  81. package/dist/js/colors/light_colorblind.js +0 -616
  82. package/dist/js/colors/light_high_contrast.d.ts +0 -516
  83. package/dist/js/colors/light_high_contrast.js +0 -616
  84. package/dist/js/colors/light_tritanopia.d.ts +0 -516
  85. package/dist/js/colors/light_tritanopia.js +0 -616
  86. package/dist/js/index.d.ts +0 -4655
  87. package/dist/js/index.js +0 -9
  88. package/dist/js/spacing/index.d.ts +0 -6
  89. package/dist/js/spacing/index.js +0 -7
  90. package/dist/js/spacing/normal.d.ts +0 -4
  91. package/dist/js/spacing/normal.js +0 -13
  92. package/dist/js/typography/index.d.ts +0 -11
  93. package/dist/js/typography/index.js +0 -7
  94. package/dist/js/typography/normal.d.ts +0 -9
  95. package/dist/js/typography/normal.js +0 -19
  96. package/dist/json/colors/dark.json +0 -614
  97. package/dist/json/colors/dark_colorblind.json +0 -614
  98. package/dist/json/colors/dark_dimmed.json +0 -614
  99. package/dist/json/colors/dark_high_contrast.json +0 -614
  100. package/dist/json/colors/dark_tritanopia.json +0 -614
  101. package/dist/json/colors/light.json +0 -614
  102. package/dist/json/colors/light_colorblind.json +0 -614
  103. package/dist/json/colors/light_high_contrast.json +0 -614
  104. package/dist/json/colors/light_tritanopia.json +0 -614
  105. package/dist/json/spacing/normal.json +0 -11
  106. package/dist/json/typography/normal.json +0 -17
  107. package/dist/removed/colors.json +0 -432
  108. package/dist/scss/colors/_dark.scss +0 -452
  109. package/dist/scss/colors/_dark_colorblind.scss +0 -452
  110. package/dist/scss/colors/_dark_dimmed.scss +0 -452
  111. package/dist/scss/colors/_dark_high_contrast.scss +0 -452
  112. package/dist/scss/colors/_dark_tritanopia.scss +0 -452
  113. package/dist/scss/colors/_light.scss +0 -452
  114. package/dist/scss/colors/_light_colorblind.scss +0 -452
  115. package/dist/scss/colors/_light_high_contrast.scss +0 -452
  116. package/dist/scss/colors/_light_tritanopia.scss +0 -452
  117. package/dist/scss/spacing/_normal.scss +0 -11
  118. package/dist/scss/typography/_normal.scss +0 -15
  119. package/dist/ts/colors/dark.ts +0 -614
  120. package/dist/ts/colors/dark_colorblind.ts +0 -614
  121. package/dist/ts/colors/dark_dimmed.ts +0 -614
  122. package/dist/ts/colors/dark_high_contrast.ts +0 -614
  123. package/dist/ts/colors/dark_tritanopia.ts +0 -614
  124. package/dist/ts/colors/index.ts +0 -10
  125. package/dist/ts/colors/light.ts +0 -614
  126. package/dist/ts/colors/light_colorblind.ts +0 -614
  127. package/dist/ts/colors/light_high_contrast.ts +0 -614
  128. package/dist/ts/colors/light_tritanopia.ts +0 -614
  129. package/dist/ts/index.ts +0 -4
  130. package/dist/ts/spacing/index.ts +0 -2
  131. package/dist/ts/spacing/normal.ts +0 -11
  132. package/dist/ts/typography/index.ts +0 -2
  133. package/dist/ts/typography/normal.ts +0 -17
  134. package/tokens/base/size/size.json +0 -57
  135. package/tokens/base/typography/typography.json +0 -20
  136. package/tokens/functional/size/border.json +0 -48
  137. package/tokens/functional/size/breakpoints.json +0 -24
  138. package/tokens/functional/size/size-coarse.json +0 -27
  139. package/tokens/functional/size/size-fine.json +0 -27
  140. package/tokens/functional/size/size.json +0 -189
  141. package/tokens/functional/size/viewport.json +0 -24
  142. package/tokens/functional/typography/typography.json +0 -213
  143. package/tokens/removed/color.json +0 -421
  144. package/tokens-v2-private/css/tokens/base/size/size.css +0 -24
  145. package/tokens-v2-private/css/tokens/base/typography/typography.css +0 -11
  146. package/tokens-v2-private/css/tokens/functional/size/border.css +0 -17
  147. package/tokens-v2-private/css/tokens/functional/size/breakpoints.css +0 -13
  148. package/tokens-v2-private/css/tokens/functional/size/size-coarse.css +0 -11
  149. package/tokens-v2-private/css/tokens/functional/size/size-fine.css +0 -11
  150. package/tokens-v2-private/css/tokens/functional/size/size.css +0 -54
  151. package/tokens-v2-private/css/tokens/functional/size/viewport.css +0 -6
  152. package/tokens-v2-private/css/tokens/functional/typography/typography.css +0 -47
  153. package/tokens-v2-private/docs/docValues.json +0 -2209
  154. package/tokens-v2-private/js/module/tokens/base/size/size.js +0 -266
  155. package/tokens-v2-private/js/module/tokens/base/typography/typography.js +0 -77
  156. package/tokens-v2-private/js/module/tokens/functional/size/border.js +0 -165
  157. package/tokens-v2-private/js/module/tokens/functional/size/breakpoints.js +0 -101
  158. package/tokens-v2-private/js/module/tokens/functional/size/size-coarse.js +0 -73
  159. package/tokens-v2-private/js/module/tokens/functional/size/size-fine.js +0 -73
  160. package/tokens-v2-private/js/module/tokens/functional/size/size.js +0 -824
  161. package/tokens-v2-private/js/module/tokens/functional/size/viewport.js +0 -101
  162. package/tokens-v2-private/js/module/tokens/functional/typography/typography.js +0 -809
  163. package/tokens-v2-private/js/tokens/base/size/size.js +0 -22
  164. package/tokens-v2-private/js/tokens/base/typography/typography.js +0 -9
  165. package/tokens-v2-private/js/tokens/functional/size/border.js +0 -15
  166. package/tokens-v2-private/js/tokens/functional/size/breakpoints.js +0 -11
  167. package/tokens-v2-private/js/tokens/functional/size/size-coarse.js +0 -8
  168. package/tokens-v2-private/js/tokens/functional/size/size-fine.js +0 -8
  169. package/tokens-v2-private/js/tokens/functional/size/size.js +0 -52
  170. package/tokens-v2-private/js/tokens/functional/size/viewport.js +0 -11
  171. package/tokens-v2-private/js/tokens/functional/typography/typography.js +0 -45
  172. package/tokens-v2-private/scss/tokens/base/size/size.scss +0 -21
  173. package/tokens-v2-private/scss/tokens/base/typography/typography.scss +0 -8
  174. package/tokens-v2-private/scss/tokens/functional/size/border.scss +0 -14
  175. package/tokens-v2-private/scss/tokens/functional/size/breakpoints.scss +0 -10
  176. package/tokens-v2-private/scss/tokens/functional/size/size-coarse.scss +0 -7
  177. package/tokens-v2-private/scss/tokens/functional/size/size-fine.scss +0 -7
  178. package/tokens-v2-private/scss/tokens/functional/size/size.scss +0 -51
  179. package/tokens-v2-private/scss/tokens/functional/size/viewport.scss +0 -10
  180. package/tokens-v2-private/scss/tokens/functional/typography/typography.scss +0 -44
  181. package/tokens-v2-private/ts/tokens/base/size/size.d.ts +0 -31
  182. package/tokens-v2-private/ts/tokens/base/size/size.js +0 -30
  183. package/tokens-v2-private/ts/tokens/base/typography/typography.d.ts +0 -20
  184. package/tokens-v2-private/ts/tokens/base/typography/typography.js +0 -19
  185. package/tokens-v2-private/ts/tokens/functional/size/border.d.ts +0 -28
  186. package/tokens-v2-private/ts/tokens/functional/size/border.js +0 -27
  187. package/tokens-v2-private/ts/tokens/functional/size/breakpoints.d.ts +0 -20
  188. package/tokens-v2-private/ts/tokens/functional/size/breakpoints.js +0 -19
  189. package/tokens-v2-private/ts/tokens/functional/size/size-coarse.d.ts +0 -29
  190. package/tokens-v2-private/ts/tokens/functional/size/size-coarse.js +0 -28
  191. package/tokens-v2-private/ts/tokens/functional/size/size-fine.d.ts +0 -29
  192. package/tokens-v2-private/ts/tokens/functional/size/size-fine.js +0 -28
  193. package/tokens-v2-private/ts/tokens/functional/size/size.d.ts +0 -103
  194. package/tokens-v2-private/ts/tokens/functional/size/size.js +0 -102
  195. package/tokens-v2-private/ts/tokens/functional/size/viewport.d.ts +0 -20
  196. package/tokens-v2-private/ts/tokens/functional/size/viewport.js +0 -19
  197. package/tokens-v2-private/ts/tokens/functional/typography/typography.d.ts +0 -131
  198. package/tokens-v2-private/ts/tokens/functional/typography/typography.js +0 -130
@@ -3783,6 +3783,151 @@
3783
3783
  "attributes": {},
3784
3784
  "path": ["display", "indigo", "borderColor", "emphasis"]
3785
3785
  },
3786
+ "display-pink-bgColor-muted": {
3787
+ "value": "#ffe5f1",
3788
+ "$type": "color",
3789
+ "$extensions": {
3790
+ "org.primer.figma": {
3791
+ "collection": "mode",
3792
+ "mode": "light",
3793
+ "group": "component (internal)",
3794
+ "scopes": ["bgColor"]
3795
+ }
3796
+ },
3797
+ "filePath": "src/tokens/functional/color/light/display-light.json5",
3798
+ "isSource": true,
3799
+ "original": {
3800
+ "value": "{base.display.color.pink.0}",
3801
+ "$type": "color",
3802
+ "$extensions": {
3803
+ "org.primer.figma": {
3804
+ "collection": "mode",
3805
+ "mode": "light",
3806
+ "group": "component (internal)",
3807
+ "scopes": ["bgColor"]
3808
+ }
3809
+ }
3810
+ },
3811
+ "name": "display-pink-bgColor-muted",
3812
+ "attributes": {},
3813
+ "path": ["display", "pink", "bgColor", "muted"]
3814
+ },
3815
+ "display-pink-bgColor-emphasis": {
3816
+ "value": "#ce2c85",
3817
+ "$type": "color",
3818
+ "$extensions": {
3819
+ "org.primer.figma": {
3820
+ "collection": "mode",
3821
+ "mode": "light",
3822
+ "group": "component (internal)",
3823
+ "scopes": ["bgColor"]
3824
+ }
3825
+ },
3826
+ "filePath": "src/tokens/functional/color/light/display-light.json5",
3827
+ "isSource": true,
3828
+ "original": {
3829
+ "value": "{base.display.color.pink.5}",
3830
+ "$type": "color",
3831
+ "$extensions": {
3832
+ "org.primer.figma": {
3833
+ "collection": "mode",
3834
+ "mode": "light",
3835
+ "group": "component (internal)",
3836
+ "scopes": ["bgColor"]
3837
+ }
3838
+ }
3839
+ },
3840
+ "name": "display-pink-bgColor-emphasis",
3841
+ "attributes": {},
3842
+ "path": ["display", "pink", "bgColor", "emphasis"]
3843
+ },
3844
+ "display-pink-fgColor": {
3845
+ "value": "#b12f79",
3846
+ "$type": "color",
3847
+ "$extensions": {
3848
+ "org.primer.figma": {
3849
+ "collection": "mode",
3850
+ "mode": "light",
3851
+ "group": "component (internal)",
3852
+ "scopes": ["fgColor"]
3853
+ }
3854
+ },
3855
+ "filePath": "src/tokens/functional/color/light/display-light.json5",
3856
+ "isSource": true,
3857
+ "original": {
3858
+ "value": "{base.display.color.pink.6}",
3859
+ "$type": "color",
3860
+ "$extensions": {
3861
+ "org.primer.figma": {
3862
+ "collection": "mode",
3863
+ "mode": "light",
3864
+ "group": "component (internal)",
3865
+ "scopes": ["fgColor"]
3866
+ }
3867
+ }
3868
+ },
3869
+ "name": "display-pink-fgColor",
3870
+ "attributes": {},
3871
+ "path": ["display", "pink", "fgColor"]
3872
+ },
3873
+ "display-pink-borderColor-muted": {
3874
+ "value": "#fdc9e2",
3875
+ "$type": "color",
3876
+ "$extensions": {
3877
+ "org.primer.figma": {
3878
+ "collection": "mode",
3879
+ "mode": "light",
3880
+ "group": "component (internal)",
3881
+ "scopes": ["borderColor"]
3882
+ }
3883
+ },
3884
+ "filePath": "src/tokens/functional/color/light/display-light.json5",
3885
+ "isSource": true,
3886
+ "original": {
3887
+ "value": "{base.display.color.pink.1}",
3888
+ "$type": "color",
3889
+ "$extensions": {
3890
+ "org.primer.figma": {
3891
+ "collection": "mode",
3892
+ "mode": "light",
3893
+ "group": "component (internal)",
3894
+ "scopes": ["borderColor"]
3895
+ }
3896
+ }
3897
+ },
3898
+ "name": "display-pink-borderColor-muted",
3899
+ "attributes": {},
3900
+ "path": ["display", "pink", "borderColor", "muted"]
3901
+ },
3902
+ "display-pink-borderColor-emphasis": {
3903
+ "value": "#ce2c85",
3904
+ "$type": "color",
3905
+ "$extensions": {
3906
+ "org.primer.figma": {
3907
+ "collection": "mode",
3908
+ "mode": "light",
3909
+ "group": "component (internal)",
3910
+ "scopes": ["borderColor"]
3911
+ }
3912
+ },
3913
+ "filePath": "src/tokens/functional/color/light/display-light.json5",
3914
+ "isSource": true,
3915
+ "original": {
3916
+ "value": "{base.display.color.pink.5}",
3917
+ "$type": "color",
3918
+ "$extensions": {
3919
+ "org.primer.figma": {
3920
+ "collection": "mode",
3921
+ "mode": "light",
3922
+ "group": "component (internal)",
3923
+ "scopes": ["borderColor"]
3924
+ }
3925
+ }
3926
+ },
3927
+ "name": "display-pink-borderColor-emphasis",
3928
+ "attributes": {},
3929
+ "path": ["display", "pink", "borderColor", "emphasis"]
3930
+ },
3786
3931
  "avatar-bgColor": {
3787
3932
  "value": "#ffffff",
3788
3933
  "$type": "color",
@@ -3783,6 +3783,151 @@
3783
3783
  "attributes": {},
3784
3784
  "path": ["display", "indigo", "borderColor", "emphasis"]
3785
3785
  },
3786
+ "display-pink-bgColor-muted": {
3787
+ "value": "#ffe5f1",
3788
+ "$type": "color",
3789
+ "$extensions": {
3790
+ "org.primer.figma": {
3791
+ "collection": "mode",
3792
+ "mode": "light",
3793
+ "group": "component (internal)",
3794
+ "scopes": ["bgColor"]
3795
+ }
3796
+ },
3797
+ "filePath": "src/tokens/functional/color/light/display-light.json5",
3798
+ "isSource": true,
3799
+ "original": {
3800
+ "value": "{base.display.color.pink.0}",
3801
+ "$type": "color",
3802
+ "$extensions": {
3803
+ "org.primer.figma": {
3804
+ "collection": "mode",
3805
+ "mode": "light",
3806
+ "group": "component (internal)",
3807
+ "scopes": ["bgColor"]
3808
+ }
3809
+ }
3810
+ },
3811
+ "name": "display-pink-bgColor-muted",
3812
+ "attributes": {},
3813
+ "path": ["display", "pink", "bgColor", "muted"]
3814
+ },
3815
+ "display-pink-bgColor-emphasis": {
3816
+ "value": "#ce2c85",
3817
+ "$type": "color",
3818
+ "$extensions": {
3819
+ "org.primer.figma": {
3820
+ "collection": "mode",
3821
+ "mode": "light",
3822
+ "group": "component (internal)",
3823
+ "scopes": ["bgColor"]
3824
+ }
3825
+ },
3826
+ "filePath": "src/tokens/functional/color/light/display-light.json5",
3827
+ "isSource": true,
3828
+ "original": {
3829
+ "value": "{base.display.color.pink.5}",
3830
+ "$type": "color",
3831
+ "$extensions": {
3832
+ "org.primer.figma": {
3833
+ "collection": "mode",
3834
+ "mode": "light",
3835
+ "group": "component (internal)",
3836
+ "scopes": ["bgColor"]
3837
+ }
3838
+ }
3839
+ },
3840
+ "name": "display-pink-bgColor-emphasis",
3841
+ "attributes": {},
3842
+ "path": ["display", "pink", "bgColor", "emphasis"]
3843
+ },
3844
+ "display-pink-fgColor": {
3845
+ "value": "#b12f79",
3846
+ "$type": "color",
3847
+ "$extensions": {
3848
+ "org.primer.figma": {
3849
+ "collection": "mode",
3850
+ "mode": "light",
3851
+ "group": "component (internal)",
3852
+ "scopes": ["fgColor"]
3853
+ }
3854
+ },
3855
+ "filePath": "src/tokens/functional/color/light/display-light.json5",
3856
+ "isSource": true,
3857
+ "original": {
3858
+ "value": "{base.display.color.pink.6}",
3859
+ "$type": "color",
3860
+ "$extensions": {
3861
+ "org.primer.figma": {
3862
+ "collection": "mode",
3863
+ "mode": "light",
3864
+ "group": "component (internal)",
3865
+ "scopes": ["fgColor"]
3866
+ }
3867
+ }
3868
+ },
3869
+ "name": "display-pink-fgColor",
3870
+ "attributes": {},
3871
+ "path": ["display", "pink", "fgColor"]
3872
+ },
3873
+ "display-pink-borderColor-muted": {
3874
+ "value": "#fdc9e2",
3875
+ "$type": "color",
3876
+ "$extensions": {
3877
+ "org.primer.figma": {
3878
+ "collection": "mode",
3879
+ "mode": "light",
3880
+ "group": "component (internal)",
3881
+ "scopes": ["borderColor"]
3882
+ }
3883
+ },
3884
+ "filePath": "src/tokens/functional/color/light/display-light.json5",
3885
+ "isSource": true,
3886
+ "original": {
3887
+ "value": "{base.display.color.pink.1}",
3888
+ "$type": "color",
3889
+ "$extensions": {
3890
+ "org.primer.figma": {
3891
+ "collection": "mode",
3892
+ "mode": "light",
3893
+ "group": "component (internal)",
3894
+ "scopes": ["borderColor"]
3895
+ }
3896
+ }
3897
+ },
3898
+ "name": "display-pink-borderColor-muted",
3899
+ "attributes": {},
3900
+ "path": ["display", "pink", "borderColor", "muted"]
3901
+ },
3902
+ "display-pink-borderColor-emphasis": {
3903
+ "value": "#ce2c85",
3904
+ "$type": "color",
3905
+ "$extensions": {
3906
+ "org.primer.figma": {
3907
+ "collection": "mode",
3908
+ "mode": "light",
3909
+ "group": "component (internal)",
3910
+ "scopes": ["borderColor"]
3911
+ }
3912
+ },
3913
+ "filePath": "src/tokens/functional/color/light/display-light.json5",
3914
+ "isSource": true,
3915
+ "original": {
3916
+ "value": "{base.display.color.pink.5}",
3917
+ "$type": "color",
3918
+ "$extensions": {
3919
+ "org.primer.figma": {
3920
+ "collection": "mode",
3921
+ "mode": "light",
3922
+ "group": "component (internal)",
3923
+ "scopes": ["borderColor"]
3924
+ }
3925
+ }
3926
+ },
3927
+ "name": "display-pink-borderColor-emphasis",
3928
+ "attributes": {},
3929
+ "path": ["display", "pink", "borderColor", "emphasis"]
3930
+ },
3786
3931
  "avatar-bgColor": {
3787
3932
  "value": "#ffffff",
3788
3933
  "$type": "color",
@@ -2,11 +2,23 @@
2
2
  "fontStack-system": {
3
3
  "value": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
4
4
  "$type": "fontFamily",
5
+ "$extensions": {
6
+ "org.primer.figma": {
7
+ "collection": "typography",
8
+ "scopes": ["all"]
9
+ }
10
+ },
5
11
  "filePath": "src/tokens/functional/typography/typography.json",
6
12
  "isSource": true,
7
13
  "original": {
8
14
  "value": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
9
- "$type": "fontFamily"
15
+ "$type": "fontFamily",
16
+ "$extensions": {
17
+ "org.primer.figma": {
18
+ "collection": "typography",
19
+ "scopes": ["all"]
20
+ }
21
+ }
10
22
  },
11
23
  "name": "fontStack-system",
12
24
  "attributes": {},
@@ -15,11 +27,23 @@
15
27
  "fontStack-sansSerif": {
16
28
  "value": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
17
29
  "$type": "fontFamily",
30
+ "$extensions": {
31
+ "org.primer.figma": {
32
+ "collection": "typography",
33
+ "scopes": ["all"]
34
+ }
35
+ },
18
36
  "filePath": "src/tokens/functional/typography/typography.json",
19
37
  "isSource": true,
20
38
  "original": {
21
39
  "value": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
22
- "$type": "fontFamily"
40
+ "$type": "fontFamily",
41
+ "$extensions": {
42
+ "org.primer.figma": {
43
+ "collection": "typography",
44
+ "scopes": ["all"]
45
+ }
46
+ }
23
47
  },
24
48
  "name": "fontStack-sansSerif",
25
49
  "attributes": {},
@@ -28,11 +52,23 @@
28
52
  "fontStack-monospace": {
29
53
  "value": "ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
30
54
  "$type": "fontFamily",
55
+ "$extensions": {
56
+ "org.primer.figma": {
57
+ "collection": "typography",
58
+ "scopes": ["all"]
59
+ }
60
+ },
31
61
  "filePath": "src/tokens/functional/typography/typography.json",
32
62
  "isSource": true,
33
63
  "original": {
34
64
  "value": "ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
35
- "$type": "fontFamily"
65
+ "$type": "fontFamily",
66
+ "$extensions": {
67
+ "org.primer.figma": {
68
+ "collection": "typography",
69
+ "scopes": ["all"]
70
+ }
71
+ }
36
72
  },
37
73
  "name": "fontStack-monospace",
38
74
  "attributes": {},
package/package.json CHANGED
@@ -1,13 +1,9 @@
1
1
  {
2
2
  "name": "@primer/primitives",
3
- "version": "7.17.0-rc.9ef8a8c3",
3
+ "version": "7.17.0-rc.a85cfb75",
4
4
  "description": "Typography, spacing, and color primitives for Primer design system",
5
5
  "files": [
6
6
  "dist",
7
- "tokens-v2-private",
8
- "tokens-next-private",
9
- "build.js",
10
- "tokens/",
11
7
  "src/**/*",
12
8
  "!src/**/*.test.ts"
13
9
  ],
@@ -34,8 +30,6 @@
34
30
  "build:v8": "ts-node ./scripts/buildTokens.ts",
35
31
  "build:fallbacks": "ts-node ./scripts/buildFallbacks.ts",
36
32
  "build:figma": "ts-node scripts/buildFigma.ts",
37
- "build:tokens": "node -e \"require('./build')._init()\"",
38
- "build:new-tokens": "npm run build:tokens && npm run build:next && npm run build:figma",
39
33
  "tokenJson:check": "ts-node scripts/diffThemes.ts && ts-node scripts/diffTokenProps.ts",
40
34
  "contrast:check": "ts-node scripts/color-contrast.ts",
41
35
  "format": "prettier --write '**/*.{js,jsx,ts,tsx,md,mdx,css}'",
@@ -45,14 +39,12 @@
45
39
  "lint:fix": "eslint '**/*.{js,ts,tsx,md,mdx}' --fix --max-warnings=0 --config .eslintrc.js",
46
40
  "lint:tokens": "ts-node ./scripts/validateTokenJson.ts",
47
41
  "prebuild": "rm -rf dist",
48
- "prebuild:tokens": "rm -rf tokens-v2-private",
49
- "prebuild:next": "rm -rf tokens-next-private",
50
- "prepack": "npm run build && npm run build:tokens && npm run build:next",
42
+ "prebuild:next": "rm -rf dist",
43
+ "prepack": "npm run build && npm run build:next",
51
44
  "prepare": "husky",
52
45
  "release": "changeset publish",
53
- "start:storybook": "npm run build:next && cd docs/storybook && npm run storybook",
54
- "test": "jest --verbose --coverage",
55
- "watch": "ls data/**/*.scss scripts/**/*.ts | entr -s 'npm run build'"
46
+ "start:storybook": "npm run build && cd docs/storybook && npm run storybook",
47
+ "test": "jest --verbose --coverage"
56
48
  },
57
49
  "prettier": "@github/prettier-config",
58
50
  "devDependencies": {
@@ -12,6 +12,7 @@ import {
12
12
  durationToCss,
13
13
  figmaAttributes,
14
14
  fontFamilyToCss,
15
+ fontFamilyToFigma,
15
16
  fontWeightToNumber,
16
17
  jsonDeprecated,
17
18
  namePathToDotNotation,
@@ -22,6 +23,7 @@ import {
22
23
  shadowToCss,
23
24
  typographyToCss,
24
25
  dimensionToRemPxArray,
26
+ floatToPixel,
25
27
  } from './transformers'
26
28
  import {
27
29
  javascriptCommonJs,
@@ -131,6 +133,11 @@ StyleDictionary.registerTransform({
131
133
  ...colorToHex,
132
134
  })
133
135
 
136
+ StyleDictionary.registerTransform({
137
+ name: 'float/pixel',
138
+ ...floatToPixel,
139
+ })
140
+
134
141
  StyleDictionary.registerTransform({
135
142
  name: 'dimension/rem',
136
143
  ...dimensionToRem,
@@ -216,6 +223,11 @@ StyleDictionary.registerTransform({
216
223
  ...fontFamilyToCss,
217
224
  })
218
225
 
226
+ StyleDictionary.registerTransform({
227
+ name: 'fontFamily/figma',
228
+ ...fontFamilyToFigma,
229
+ })
230
+
219
231
  /**
220
232
  * @name {@link PrimerStyleDictionary}
221
233
  * @description Returns style dictionary object with primer preset that includes parsers, formats and transformers
@@ -7,6 +7,7 @@ export {isDeprecated} from './isDeprecated'
7
7
  export {isFromFile} from './isFromFile'
8
8
  export {isFontFamily} from './isFontFamily'
9
9
  export {isFontWeight} from './isFontWeight'
10
+ export {isNumber} from './isNumber'
10
11
  export {isShadow} from './isShadow'
11
12
  export {isSource} from './isSource'
12
13
  export {isTypography} from './isTypography'
@@ -0,0 +1,8 @@
1
+ import type StyleDictionary from 'style-dictionary'
2
+
3
+ /**
4
+ * @description Checks if token type is a number
5
+ * @param token [StyleDictionary.TransformedToken](https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
6
+ * @returns boolean
7
+ */
8
+ export const isNumber = (token: StyleDictionary.TransformedToken): boolean => token.$type === 'number'
@@ -28,6 +28,7 @@ const getFigmaType = (type: string): string => {
28
28
  color: 'COLOR',
29
29
  dimension: 'FLOAT',
30
30
  fontWeight: 'FLOAT',
31
+ number: 'FLOAT',
31
32
  fontFamily: 'STRING',
32
33
  }
33
34
  if (type in validTypes) return validTypes[type as keyof typeof validTypes]
@@ -3,9 +3,11 @@ import type {PlatformInitializer} from '../types/PlatformInitializer'
3
3
  import {isSource} from '../filters'
4
4
 
5
5
  const validFigmaToken = (token: StyleDictionary.TransformedToken) => {
6
- const validTypes = ['color', 'dimension', 'shadow', 'fontWeight', 'fontFamily']
6
+ const validTypes = ['color', 'dimension', 'shadow', 'fontWeight', 'fontFamily', 'number']
7
7
  // is a siource token, not an included one
8
8
  if (!isSource(token)) return false
9
+
10
+ if (`${token.value}`.substring(token.value.length - 2) === 'em') return false
9
11
  // has a collection attribute
10
12
  if (
11
13
  !('$extensions' in token) ||
@@ -25,6 +27,7 @@ export const figma: PlatformInitializer = (outputFile, prefix, buildPath, option
25
27
  'name/pathToFigma',
26
28
  // 'name/pathToSlashNotation',
27
29
  'figma/attributes',
30
+ 'fontFamily/figma',
28
31
  'dimension/pixelUnitless',
29
32
  // 'border/figma',
30
33
  // 'typography/figma',
@@ -32,6 +35,11 @@ export const figma: PlatformInitializer = (outputFile, prefix, buildPath, option
32
35
  ],
33
36
  options: {
34
37
  basePxFontSize: 16,
38
+ fontFamilies: {
39
+ 'fontStack/system': 'SF Pro Text',
40
+ 'fontStack/sansSerif': 'SF Pro Text',
41
+ 'fontStack/monospace': 'SF Mono',
42
+ },
35
43
  ...options,
36
44
  },
37
45
  files: [
@@ -1056,5 +1056,71 @@
1056
1056
  },
1057
1057
  },
1058
1058
  },
1059
+ pink: {
1060
+ bgColor: {
1061
+ muted: {
1062
+ $value: '{base.display.color.pink.0}',
1063
+ $type: 'color',
1064
+ $extensions: {
1065
+ 'org.primer.figma': {
1066
+ collection: 'mode',
1067
+ mode: 'light',
1068
+ group: 'component (internal)',
1069
+ scopes: ['bgColor'],
1070
+ },
1071
+ },
1072
+ },
1073
+ emphasis: {
1074
+ $value: '{base.display.color.pink.5}',
1075
+ $type: 'color',
1076
+ $extensions: {
1077
+ 'org.primer.figma': {
1078
+ collection: 'mode',
1079
+ mode: 'light',
1080
+ group: 'component (internal)',
1081
+ scopes: ['bgColor'],
1082
+ },
1083
+ },
1084
+ },
1085
+ },
1086
+ fgColor: {
1087
+ $value: '{base.display.color.pink.6}',
1088
+ $type: 'color',
1089
+ $extensions: {
1090
+ 'org.primer.figma': {
1091
+ collection: 'mode',
1092
+ mode: 'light',
1093
+ group: 'component (internal)',
1094
+ scopes: ['fgColor'],
1095
+ },
1096
+ },
1097
+ },
1098
+ borderColor: {
1099
+ muted: {
1100
+ $value: '{base.display.color.pink.1}',
1101
+ $type: 'color',
1102
+ $extensions: {
1103
+ 'org.primer.figma': {
1104
+ collection: 'mode',
1105
+ mode: 'light',
1106
+ group: 'component (internal)',
1107
+ scopes: ['borderColor'],
1108
+ },
1109
+ },
1110
+ },
1111
+ emphasis: {
1112
+ $value: '{base.display.color.pink.5}',
1113
+ $type: 'color',
1114
+ $extensions: {
1115
+ 'org.primer.figma': {
1116
+ collection: 'mode',
1117
+ mode: 'light',
1118
+ group: 'component (internal)',
1119
+ scopes: ['borderColor'],
1120
+ },
1121
+ },
1122
+ },
1123
+ },
1124
+ },
1059
1125
  },
1060
1126
  }
@@ -1056,5 +1056,71 @@
1056
1056
  },
1057
1057
  },
1058
1058
  },
1059
+ pink: {
1060
+ bgColor: {
1061
+ muted: {
1062
+ $value: '{base.display.color.pink.0}',
1063
+ $type: 'color',
1064
+ $extensions: {
1065
+ 'org.primer.figma': {
1066
+ collection: 'mode',
1067
+ mode: 'light',
1068
+ group: 'component (internal)',
1069
+ scopes: ['bgColor'],
1070
+ },
1071
+ },
1072
+ },
1073
+ emphasis: {
1074
+ $value: '{base.display.color.pink.5}',
1075
+ $type: 'color',
1076
+ $extensions: {
1077
+ 'org.primer.figma': {
1078
+ collection: 'mode',
1079
+ mode: 'light',
1080
+ group: 'component (internal)',
1081
+ scopes: ['bgColor'],
1082
+ },
1083
+ },
1084
+ },
1085
+ },
1086
+ fgColor: {
1087
+ $value: '{base.display.color.pink.6}',
1088
+ $type: 'color',
1089
+ $extensions: {
1090
+ 'org.primer.figma': {
1091
+ collection: 'mode',
1092
+ mode: 'light',
1093
+ group: 'component (internal)',
1094
+ scopes: ['fgColor'],
1095
+ },
1096
+ },
1097
+ },
1098
+ borderColor: {
1099
+ muted: {
1100
+ $value: '{base.display.color.pink.1}',
1101
+ $type: 'color',
1102
+ $extensions: {
1103
+ 'org.primer.figma': {
1104
+ collection: 'mode',
1105
+ mode: 'light',
1106
+ group: 'component (internal)',
1107
+ scopes: ['borderColor'],
1108
+ },
1109
+ },
1110
+ },
1111
+ emphasis: {
1112
+ $value: '{base.display.color.pink.5}',
1113
+ $type: 'color',
1114
+ $extensions: {
1115
+ 'org.primer.figma': {
1116
+ collection: 'mode',
1117
+ mode: 'light',
1118
+ group: 'component (internal)',
1119
+ scopes: ['borderColor'],
1120
+ },
1121
+ },
1122
+ },
1123
+ },
1124
+ },
1059
1125
  },
1060
1126
  }