@primer/primitives 7.17.0-rc.9ac79423 → 7.17.0-rc.9ef8a8c3
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/package.json +1 -1
- package/src/formats/jsonFigma.ts +2 -0
- package/src/platforms/figma.ts +1 -1
- package/src/schemas/collections.ts +2 -0
- package/src/schemas/dimensionToken.ts +1 -1
- package/src/schemas/fontFamilyToken.ts +10 -0
- package/src/schemas/fontWeightToken.ts +10 -0
- 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/tokens-next-private/css/base/size/size.css +0 -19
- package/tokens-next-private/css/base/typography/typography.css +0 -6
- package/tokens-next-private/css/functional/motion/motion.css +0 -5
- package/tokens-next-private/css/functional/size/border.css +0 -14
- package/tokens-next-private/css/functional/size/breakpoints.css +0 -8
- package/tokens-next-private/css/functional/size/size-coarse.css +0 -7
- package/tokens-next-private/css/functional/size/size-fine.css +0 -7
- package/tokens-next-private/css/functional/size/size.css +0 -74
- package/tokens-next-private/css/functional/size/viewport.css +0 -6
- package/tokens-next-private/css/functional/themes/dark-colorblind.css +0 -1078
- package/tokens-next-private/css/functional/themes/dark-dimmed.css +0 -1078
- package/tokens-next-private/css/functional/themes/dark-high-contrast.css +0 -1078
- package/tokens-next-private/css/functional/themes/dark-tritanopia.css +0 -1078
- package/tokens-next-private/css/functional/themes/dark.css +0 -1078
- package/tokens-next-private/css/functional/themes/light-colorblind.css +0 -1078
- package/tokens-next-private/css/functional/themes/light-high-contrast.css +0 -1078
- package/tokens-next-private/css/functional/themes/light-tritanopia.css +0 -1078
- package/tokens-next-private/css/functional/themes/light.css +0 -1078
- package/tokens-next-private/css/functional/typography/typography.css +0 -47
- package/tokens-next-private/docs/base/size/size.json +0 -427
- package/tokens-next-private/docs/base/typography/typography.json +0 -54
- package/tokens-next-private/docs/functional/motion/motion.json +0 -47
- package/tokens-next-private/docs/functional/size/border.json +0 -234
- package/tokens-next-private/docs/functional/size/breakpoints.json +0 -152
- package/tokens-next-private/docs/functional/size/size-coarse.json +0 -41
- package/tokens-next-private/docs/functional/size/size-fine.json +0 -41
- package/tokens-next-private/docs/functional/size/size.json +0 -1838
- package/tokens-next-private/docs/functional/size/viewport.json +0 -80
- package/tokens-next-private/docs/functional/themes/dark-colorblind.json +0 -16155
- package/tokens-next-private/docs/functional/themes/dark-dimmed.json +0 -16159
- package/tokens-next-private/docs/functional/themes/dark-high-contrast.json +0 -16175
- package/tokens-next-private/docs/functional/themes/dark-tritanopia.json +0 -16161
- package/tokens-next-private/docs/functional/themes/dark.json +0 -16159
- package/tokens-next-private/docs/functional/themes/light-colorblind.json +0 -16123
- package/tokens-next-private/docs/functional/themes/light-high-contrast.json +0 -16125
- package/tokens-next-private/docs/functional/themes/light-tritanopia.json +0 -16115
- package/tokens-next-private/docs/functional/themes/light.json +0 -16113
- package/tokens-next-private/docs/functional/typography/typography.json +0 -663
- package/tokens-next-private/fallbacks/base/size/size.json +0 -19
- package/tokens-next-private/fallbacks/base/typography/typography.json +0 -6
- package/tokens-next-private/fallbacks/color-fallbacks.json +0 -260
- package/tokens-next-private/fallbacks/functional/motion/motion.json +0 -5
- package/tokens-next-private/fallbacks/functional/size/border.json +0 -14
- package/tokens-next-private/fallbacks/functional/size/breakpoints.json +0 -8
- package/tokens-next-private/fallbacks/functional/size/size-coarse.json +0 -5
- package/tokens-next-private/fallbacks/functional/size/size-fine.json +0 -5
- package/tokens-next-private/fallbacks/functional/size/size.json +0 -74
- package/tokens-next-private/fallbacks/functional/size/viewport.json +0 -8
- package/tokens-next-private/fallbacks/functional/typography/typography.json +0 -47
- package/tokens-next-private/internalCss/dark-colorblind.css +0 -1648
- package/tokens-next-private/internalCss/dark-dimmed.css +0 -1648
- package/tokens-next-private/internalCss/dark-high-contrast.css +0 -1648
- package/tokens-next-private/internalCss/dark-tritanopia.css +0 -1648
- package/tokens-next-private/internalCss/dark.css +0 -1648
- package/tokens-next-private/internalCss/light-colorblind.css +0 -1648
- package/tokens-next-private/internalCss/light-high-contrast.css +0 -1648
- package/tokens-next-private/internalCss/light-tritanopia.css +0 -1648
- package/tokens-next-private/internalCss/light.css +0 -1648
- package/tokens-next-private/removed/color.json +0 -421
- package/tokens-next-private/styleLint/base/size/size.json +0 -427
- package/tokens-next-private/styleLint/base/typography/typography.json +0 -54
- package/tokens-next-private/styleLint/functional/motion/motion.json +0 -47
- package/tokens-next-private/styleLint/functional/size/border.json +0 -234
- package/tokens-next-private/styleLint/functional/size/breakpoints.json +0 -152
- package/tokens-next-private/styleLint/functional/size/size-coarse.json +0 -41
- package/tokens-next-private/styleLint/functional/size/size-fine.json +0 -41
- package/tokens-next-private/styleLint/functional/size/size.json +0 -1838
- package/tokens-next-private/styleLint/functional/size/viewport.json +0 -80
- package/tokens-next-private/styleLint/functional/themes/dark-colorblind.json +0 -16155
- package/tokens-next-private/styleLint/functional/themes/dark-dimmed.json +0 -16159
- package/tokens-next-private/styleLint/functional/themes/dark-high-contrast.json +0 -16175
- package/tokens-next-private/styleLint/functional/themes/dark-tritanopia.json +0 -16161
- package/tokens-next-private/styleLint/functional/themes/dark.json +0 -16159
- package/tokens-next-private/styleLint/functional/themes/light-colorblind.json +0 -16123
- package/tokens-next-private/styleLint/functional/themes/light-high-contrast.json +0 -16125
- package/tokens-next-private/styleLint/functional/themes/light-tritanopia.json +0 -16115
- package/tokens-next-private/styleLint/functional/themes/light.json +0 -16113
- package/tokens-next-private/styleLint/functional/typography/typography.json +0 -663
package/package.json
CHANGED
package/src/formats/jsonFigma.ts
CHANGED
|
@@ -27,6 +27,8 @@ const getFigmaType = (type: string): string => {
|
|
|
27
27
|
const validTypes = {
|
|
28
28
|
color: 'COLOR',
|
|
29
29
|
dimension: 'FLOAT',
|
|
30
|
+
fontWeight: 'FLOAT',
|
|
31
|
+
fontFamily: 'STRING',
|
|
30
32
|
}
|
|
31
33
|
if (type in validTypes) return validTypes[type as keyof typeof validTypes]
|
|
32
34
|
throw new Error(`Invalid type: ${type}`)
|
package/src/platforms/figma.ts
CHANGED
|
@@ -3,7 +3,7 @@ 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']
|
|
6
|
+
const validTypes = ['color', 'dimension', 'shadow', 'fontWeight', 'fontFamily']
|
|
7
7
|
// is a siource token, not an included one
|
|
8
8
|
if (!isSource(token)) return false
|
|
9
9
|
// has a collection attribute
|
|
@@ -8,11 +8,13 @@ type Collections =
|
|
|
8
8
|
| 'base/color/dark'
|
|
9
9
|
| 'base/color/dark-dimmed'
|
|
10
10
|
| 'base/color/dark-high-contrast'
|
|
11
|
+
| 'base/typography'
|
|
11
12
|
| 'mode'
|
|
12
13
|
| 'pattern/mode'
|
|
13
14
|
| 'base/size'
|
|
14
15
|
| 'functional/size'
|
|
15
16
|
| 'pattern/size'
|
|
17
|
+
| 'typography'
|
|
16
18
|
|
|
17
19
|
export const collection = (collections: Collections[]) => {
|
|
18
20
|
return z.string().refine(
|
|
@@ -13,7 +13,7 @@ export const dimensionToken = baseToken
|
|
|
13
13
|
$extensions: z
|
|
14
14
|
.object({
|
|
15
15
|
'org.primer.figma': z.object({
|
|
16
|
-
collection: collection(['base/size', 'functional/size', 'pattern/size']),
|
|
16
|
+
collection: collection(['base/size', 'functional/size', 'pattern/size', 'typography']),
|
|
17
17
|
scopes: scopes(['all', 'size', 'gap', 'radius', 'borderColor']),
|
|
18
18
|
}),
|
|
19
19
|
})
|
|
@@ -2,10 +2,20 @@ import {z} from 'zod'
|
|
|
2
2
|
import {referenceValue} from './referenceValue'
|
|
3
3
|
import {baseToken} from './baseToken'
|
|
4
4
|
import {tokenType} from './tokenType'
|
|
5
|
+
import {collection} from './collections'
|
|
6
|
+
import {scopes} from './scopes'
|
|
5
7
|
|
|
6
8
|
export const fontFamilyToken = baseToken
|
|
7
9
|
.extend({
|
|
8
10
|
$value: z.union([z.string(), referenceValue]),
|
|
9
11
|
$type: tokenType('fontFamily'),
|
|
12
|
+
$extensions: z
|
|
13
|
+
.object({
|
|
14
|
+
'org.primer.figma': z.object({
|
|
15
|
+
collection: collection(['base/typography', 'typography']).optional(),
|
|
16
|
+
scopes: scopes(['all']).optional(),
|
|
17
|
+
}),
|
|
18
|
+
})
|
|
19
|
+
.optional(),
|
|
10
20
|
})
|
|
11
21
|
.strict()
|
|
@@ -3,10 +3,20 @@ import {fontWeightValue} from './fontWeightValue'
|
|
|
3
3
|
import {referenceValue} from './referenceValue'
|
|
4
4
|
import {baseToken} from './baseToken'
|
|
5
5
|
import {tokenType} from './tokenType'
|
|
6
|
+
import {collection} from './collections'
|
|
7
|
+
import {scopes} from './scopes'
|
|
6
8
|
|
|
7
9
|
export const fontWeightToken = baseToken
|
|
8
10
|
.extend({
|
|
9
11
|
$type: tokenType('fontWeight'),
|
|
10
12
|
$value: z.union([fontWeightValue, referenceValue]),
|
|
13
|
+
$extensions: z
|
|
14
|
+
.object({
|
|
15
|
+
'org.primer.figma': z.object({
|
|
16
|
+
collection: collection(['base/typography', 'typography']).optional(),
|
|
17
|
+
scopes: scopes(['all']).optional(),
|
|
18
|
+
}),
|
|
19
|
+
})
|
|
20
|
+
.optional(),
|
|
11
21
|
})
|
|
12
22
|
.strict()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on
|
|
3
|
+
* Generated on Wed, 17 Apr 2024 17:50:20 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,19 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--base-size-4: 0.25rem;
|
|
3
|
-
--base-size-8: 0.5rem;
|
|
4
|
-
--base-size-12: 0.75rem;
|
|
5
|
-
--base-size-16: 1rem;
|
|
6
|
-
--base-size-20: 1.25rem;
|
|
7
|
-
--base-size-24: 1.5rem;
|
|
8
|
-
--base-size-28: 1.75rem;
|
|
9
|
-
--base-size-32: 2rem;
|
|
10
|
-
--base-size-36: 2.25rem;
|
|
11
|
-
--base-size-40: 2.5rem;
|
|
12
|
-
--base-size-44: 2.75rem;
|
|
13
|
-
--base-size-48: 3rem;
|
|
14
|
-
--base-size-64: 4rem;
|
|
15
|
-
--base-size-80: 5rem;
|
|
16
|
-
--base-size-96: 6rem;
|
|
17
|
-
--base-size-112: 7rem;
|
|
18
|
-
--base-size-128: 8rem;
|
|
19
|
-
}
|