@primer/primitives 7.17.0-rc.3aa69fdf → 7.17.0-rc.4834f81d
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.
- package/dist/docs/functional/typography/typography.json +3 -39
- package/dist/figma/figma.json +1 -10
- package/dist/styleLint/functional/typography/typography.json +3 -39
- package/package.json +1 -1
- package/src/tokens/functional/typography/typography.json +3 -21
- package/src/transformers/fontFamilyToCss.ts +3 -2
- package/src/transformers/fontFamilyToFigma.ts +0 -12
- package/tokens-v2-private/css/tokens/base/size/size.css +1 -1
- package/tokens-v2-private/css/tokens/base/typography/typography.css +1 -1
- package/tokens-v2-private/css/tokens/functional/size/border.css +1 -1
- package/tokens-v2-private/css/tokens/functional/size/breakpoints.css +1 -1
- package/tokens-v2-private/css/tokens/functional/size/size-coarse.css +1 -1
- package/tokens-v2-private/css/tokens/functional/size/size-fine.css +1 -1
- package/tokens-v2-private/css/tokens/functional/size/size.css +1 -1
- package/tokens-v2-private/css/tokens/functional/typography/typography.css +1 -1
- package/tokens-v2-private/js/module/tokens/base/size/size.js +1 -1
- package/tokens-v2-private/js/module/tokens/base/typography/typography.js +1 -1
- package/tokens-v2-private/js/module/tokens/functional/size/border.js +1 -1
- package/tokens-v2-private/js/module/tokens/functional/size/breakpoints.js +1 -1
- package/tokens-v2-private/js/module/tokens/functional/size/size-coarse.js +1 -1
- package/tokens-v2-private/js/module/tokens/functional/size/size-fine.js +1 -1
- package/tokens-v2-private/js/module/tokens/functional/size/size.js +1 -1
- package/tokens-v2-private/js/module/tokens/functional/size/viewport.js +1 -1
- package/tokens-v2-private/js/module/tokens/functional/typography/typography.js +1 -1
- package/tokens-v2-private/js/tokens/base/size/size.js +1 -1
- package/tokens-v2-private/js/tokens/base/typography/typography.js +1 -1
- package/tokens-v2-private/js/tokens/functional/size/border.js +1 -1
- package/tokens-v2-private/js/tokens/functional/size/breakpoints.js +1 -1
- package/tokens-v2-private/js/tokens/functional/size/size-coarse.js +1 -1
- package/tokens-v2-private/js/tokens/functional/size/size-fine.js +1 -1
- package/tokens-v2-private/js/tokens/functional/size/size.js +1 -1
- package/tokens-v2-private/js/tokens/functional/size/viewport.js +1 -1
- package/tokens-v2-private/js/tokens/functional/typography/typography.js +1 -1
- package/tokens-v2-private/scss/tokens/base/size/size.scss +1 -1
- package/tokens-v2-private/scss/tokens/base/typography/typography.scss +1 -1
- package/tokens-v2-private/scss/tokens/functional/size/border.scss +1 -1
- package/tokens-v2-private/scss/tokens/functional/size/breakpoints.scss +1 -1
- package/tokens-v2-private/scss/tokens/functional/size/size-coarse.scss +1 -1
- package/tokens-v2-private/scss/tokens/functional/size/size-fine.scss +1 -1
- package/tokens-v2-private/scss/tokens/functional/size/size.scss +1 -1
- package/tokens-v2-private/scss/tokens/functional/size/viewport.scss +1 -1
- package/tokens-v2-private/scss/tokens/functional/typography/typography.scss +1 -1
- package/tokens-v2-private/ts/tokens/base/size/size.d.ts +1 -1
- package/tokens-v2-private/ts/tokens/base/size/size.js +1 -1
- package/tokens-v2-private/ts/tokens/base/typography/typography.d.ts +1 -1
- package/tokens-v2-private/ts/tokens/base/typography/typography.js +1 -1
- package/tokens-v2-private/ts/tokens/functional/size/border.d.ts +1 -1
- package/tokens-v2-private/ts/tokens/functional/size/border.js +1 -1
- package/tokens-v2-private/ts/tokens/functional/size/breakpoints.d.ts +1 -1
- package/tokens-v2-private/ts/tokens/functional/size/breakpoints.js +1 -1
- package/tokens-v2-private/ts/tokens/functional/size/size-coarse.d.ts +1 -1
- package/tokens-v2-private/ts/tokens/functional/size/size-coarse.js +1 -1
- package/tokens-v2-private/ts/tokens/functional/size/size-fine.d.ts +1 -1
- package/tokens-v2-private/ts/tokens/functional/size/size-fine.js +1 -1
- package/tokens-v2-private/ts/tokens/functional/size/size.d.ts +1 -1
- package/tokens-v2-private/ts/tokens/functional/size/size.js +1 -1
- package/tokens-v2-private/ts/tokens/functional/size/viewport.d.ts +1 -1
- package/tokens-v2-private/ts/tokens/functional/size/viewport.js +1 -1
- package/tokens-v2-private/ts/tokens/functional/typography/typography.d.ts +1 -1
- package/tokens-v2-private/ts/tokens/functional/typography/typography.js +1 -1
- package/dist/figma/typography/typography.json +0 -32
- package/src/transformers/utilities/hasSpaceInString.ts +0 -6
|
@@ -2,23 +2,11 @@
|
|
|
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
|
-
},
|
|
11
5
|
"filePath": "src/tokens/functional/typography/typography.json",
|
|
12
6
|
"isSource": true,
|
|
13
7
|
"original": {
|
|
14
8
|
"value": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
|
|
15
|
-
"$type": "fontFamily"
|
|
16
|
-
"$extensions": {
|
|
17
|
-
"org.primer.figma": {
|
|
18
|
-
"collection": "typography",
|
|
19
|
-
"scopes": ["all"]
|
|
20
|
-
}
|
|
21
|
-
}
|
|
9
|
+
"$type": "fontFamily"
|
|
22
10
|
},
|
|
23
11
|
"name": "fontStack-system",
|
|
24
12
|
"attributes": {},
|
|
@@ -27,23 +15,11 @@
|
|
|
27
15
|
"fontStack-sansSerif": {
|
|
28
16
|
"value": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
|
|
29
17
|
"$type": "fontFamily",
|
|
30
|
-
"$extensions": {
|
|
31
|
-
"org.primer.figma": {
|
|
32
|
-
"collection": "typography",
|
|
33
|
-
"scopes": ["all"]
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
18
|
"filePath": "src/tokens/functional/typography/typography.json",
|
|
37
19
|
"isSource": true,
|
|
38
20
|
"original": {
|
|
39
21
|
"value": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
|
|
40
|
-
"$type": "fontFamily"
|
|
41
|
-
"$extensions": {
|
|
42
|
-
"org.primer.figma": {
|
|
43
|
-
"collection": "typography",
|
|
44
|
-
"scopes": ["all"]
|
|
45
|
-
}
|
|
46
|
-
}
|
|
22
|
+
"$type": "fontFamily"
|
|
47
23
|
},
|
|
48
24
|
"name": "fontStack-sansSerif",
|
|
49
25
|
"attributes": {},
|
|
@@ -52,23 +28,11 @@
|
|
|
52
28
|
"fontStack-monospace": {
|
|
53
29
|
"value": "ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
|
|
54
30
|
"$type": "fontFamily",
|
|
55
|
-
"$extensions": {
|
|
56
|
-
"org.primer.figma": {
|
|
57
|
-
"collection": "typography",
|
|
58
|
-
"scopes": ["all"]
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
31
|
"filePath": "src/tokens/functional/typography/typography.json",
|
|
62
32
|
"isSource": true,
|
|
63
33
|
"original": {
|
|
64
34
|
"value": "ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
|
|
65
|
-
"$type": "fontFamily"
|
|
66
|
-
"$extensions": {
|
|
67
|
-
"org.primer.figma": {
|
|
68
|
-
"collection": "typography",
|
|
69
|
-
"scopes": ["all"]
|
|
70
|
-
}
|
|
71
|
-
}
|
|
35
|
+
"$type": "fontFamily"
|
|
72
36
|
},
|
|
73
37
|
"name": "fontStack-monospace",
|
|
74
38
|
"attributes": {},
|
package/dist/figma/figma.json
CHANGED
|
@@ -85,14 +85,6 @@
|
|
|
85
85
|
"component",
|
|
86
86
|
"component (internal)"
|
|
87
87
|
]
|
|
88
|
-
},
|
|
89
|
-
"typography": {
|
|
90
|
-
"modes": [
|
|
91
|
-
"default"
|
|
92
|
-
],
|
|
93
|
-
"groups": [
|
|
94
|
-
"typography"
|
|
95
|
-
]
|
|
96
88
|
}
|
|
97
89
|
},
|
|
98
90
|
"files": [
|
|
@@ -119,7 +111,6 @@
|
|
|
119
111
|
"dist/figma/themes/light-colorblind.json",
|
|
120
112
|
"dist/figma/themes/light-high-contrast.json",
|
|
121
113
|
"dist/figma/themes/light-tritanopia.json",
|
|
122
|
-
"dist/figma/themes/light.json"
|
|
123
|
-
"dist/figma/typography/typography.json"
|
|
114
|
+
"dist/figma/themes/light.json"
|
|
124
115
|
]
|
|
125
116
|
}
|
|
@@ -2,23 +2,11 @@
|
|
|
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
|
-
},
|
|
11
5
|
"filePath": "src/tokens/functional/typography/typography.json",
|
|
12
6
|
"isSource": true,
|
|
13
7
|
"original": {
|
|
14
8
|
"value": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
|
|
15
|
-
"$type": "fontFamily"
|
|
16
|
-
"$extensions": {
|
|
17
|
-
"org.primer.figma": {
|
|
18
|
-
"collection": "typography",
|
|
19
|
-
"scopes": ["all"]
|
|
20
|
-
}
|
|
21
|
-
}
|
|
9
|
+
"$type": "fontFamily"
|
|
22
10
|
},
|
|
23
11
|
"name": "fontStack-system",
|
|
24
12
|
"attributes": {},
|
|
@@ -27,23 +15,11 @@
|
|
|
27
15
|
"fontStack-sansSerif": {
|
|
28
16
|
"value": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
|
|
29
17
|
"$type": "fontFamily",
|
|
30
|
-
"$extensions": {
|
|
31
|
-
"org.primer.figma": {
|
|
32
|
-
"collection": "typography",
|
|
33
|
-
"scopes": ["all"]
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
18
|
"filePath": "src/tokens/functional/typography/typography.json",
|
|
37
19
|
"isSource": true,
|
|
38
20
|
"original": {
|
|
39
21
|
"value": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
|
|
40
|
-
"$type": "fontFamily"
|
|
41
|
-
"$extensions": {
|
|
42
|
-
"org.primer.figma": {
|
|
43
|
-
"collection": "typography",
|
|
44
|
-
"scopes": ["all"]
|
|
45
|
-
}
|
|
46
|
-
}
|
|
22
|
+
"$type": "fontFamily"
|
|
47
23
|
},
|
|
48
24
|
"name": "fontStack-sansSerif",
|
|
49
25
|
"attributes": {},
|
|
@@ -52,23 +28,11 @@
|
|
|
52
28
|
"fontStack-monospace": {
|
|
53
29
|
"value": "ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
|
|
54
30
|
"$type": "fontFamily",
|
|
55
|
-
"$extensions": {
|
|
56
|
-
"org.primer.figma": {
|
|
57
|
-
"collection": "typography",
|
|
58
|
-
"scopes": ["all"]
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
31
|
"filePath": "src/tokens/functional/typography/typography.json",
|
|
62
32
|
"isSource": true,
|
|
63
33
|
"original": {
|
|
64
34
|
"value": "ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
|
|
65
|
-
"$type": "fontFamily"
|
|
66
|
-
"$extensions": {
|
|
67
|
-
"org.primer.figma": {
|
|
68
|
-
"collection": "typography",
|
|
69
|
-
"scopes": ["all"]
|
|
70
|
-
}
|
|
71
|
-
}
|
|
35
|
+
"$type": "fontFamily"
|
|
72
36
|
},
|
|
73
37
|
"name": "fontStack-monospace",
|
|
74
38
|
"attributes": {},
|
package/package.json
CHANGED
|
@@ -2,33 +2,15 @@
|
|
|
2
2
|
"fontStack": {
|
|
3
3
|
"system": {
|
|
4
4
|
"$value": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
|
|
5
|
-
"$type": "fontFamily"
|
|
6
|
-
"$extensions": {
|
|
7
|
-
"org.primer.figma": {
|
|
8
|
-
"collection": "typography",
|
|
9
|
-
"scopes": ["all"]
|
|
10
|
-
}
|
|
11
|
-
}
|
|
5
|
+
"$type": "fontFamily"
|
|
12
6
|
},
|
|
13
7
|
"sansSerif": {
|
|
14
8
|
"$value": "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
|
|
15
|
-
"$type": "fontFamily"
|
|
16
|
-
"$extensions": {
|
|
17
|
-
"org.primer.figma": {
|
|
18
|
-
"collection": "typography",
|
|
19
|
-
"scopes": ["all"]
|
|
20
|
-
}
|
|
21
|
-
}
|
|
9
|
+
"$type": "fontFamily"
|
|
22
10
|
},
|
|
23
11
|
"monospace": {
|
|
24
12
|
"$value": "ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
|
|
25
|
-
"$type": "fontFamily"
|
|
26
|
-
"$extensions": {
|
|
27
|
-
"org.primer.figma": {
|
|
28
|
-
"collection": "typography",
|
|
29
|
-
"scopes": ["all"]
|
|
30
|
-
}
|
|
31
|
-
}
|
|
13
|
+
"$type": "fontFamily"
|
|
32
14
|
}
|
|
33
15
|
},
|
|
34
16
|
"text": {
|
|
@@ -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
|
-
|
|
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
|
|
21
|
+
return hasSpaceInName(string) ? `'${string}'` : string
|
|
21
22
|
})
|
|
22
23
|
.join(', ')
|
|
23
24
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type StyleDictionary from 'style-dictionary'
|
|
2
2
|
import {isFontFamily} from '../filters'
|
|
3
|
-
import {hasSpaceInString} from './utilities/hasSpaceInString'
|
|
4
3
|
/**
|
|
5
4
|
* takes a value and returns it if its a string or concats strings in an array quoting strings with spaces
|
|
6
5
|
* @param value
|
|
@@ -18,17 +17,6 @@ export const parseFontFamily = (
|
|
|
18
17
|
if (typeof token.value === 'string') {
|
|
19
18
|
return token.value
|
|
20
19
|
}
|
|
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
20
|
// invalid value
|
|
33
21
|
throw new Error(`Invalid value ${token.value}, should be a string or array of strings`)
|
|
34
22
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on Thu, 18 Apr 2024
|
|
3
|
+
* Generated on Thu, 18 Apr 2024 11:37:58 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,32 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"name": "fontStack/monospace",
|
|
4
|
-
"value": "SF Mono",
|
|
5
|
-
"type": "STRING",
|
|
6
|
-
"refId": "typography/fontStack/monospace",
|
|
7
|
-
"collection": "typography",
|
|
8
|
-
"mode": "default",
|
|
9
|
-
"group": "typography",
|
|
10
|
-
"scopes": ["ALL_SCOPES"]
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"name": "fontStack/sansSerif",
|
|
14
|
-
"value": "SF Pro Text",
|
|
15
|
-
"type": "STRING",
|
|
16
|
-
"refId": "typography/fontStack/sansSerif",
|
|
17
|
-
"collection": "typography",
|
|
18
|
-
"mode": "default",
|
|
19
|
-
"group": "typography",
|
|
20
|
-
"scopes": ["ALL_SCOPES"]
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"name": "fontStack/system",
|
|
24
|
-
"value": "SF Pro Text",
|
|
25
|
-
"type": "STRING",
|
|
26
|
-
"refId": "typography/fontStack/system",
|
|
27
|
-
"collection": "typography",
|
|
28
|
-
"mode": "default",
|
|
29
|
-
"group": "typography",
|
|
30
|
-
"scopes": ["ALL_SCOPES"]
|
|
31
|
-
}
|
|
32
|
-
]
|