@primer/primitives 8.2.4-rc.b28008e7 → 8.2.4-rc.b7bbf7a5
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/css/functional/themes/dark-colorblind.css +12 -12
- package/dist/css/functional/themes/dark-dimmed.css +14 -14
- package/dist/css/functional/themes/dark-high-contrast.css +250 -250
- package/dist/css/functional/themes/dark-tritanopia.css +14 -14
- package/dist/css/functional/themes/dark.css +14 -14
- package/dist/css/functional/themes/light-colorblind.css +24 -24
- package/dist/css/functional/themes/light-high-contrast.css +146 -146
- package/dist/css/functional/themes/light-tritanopia.css +24 -24
- package/dist/css/functional/themes/light.css +12 -12
- package/dist/docs/functional/themes/dark-colorblind.json +149 -149
- package/dist/docs/functional/themes/dark-dimmed.json +160 -158
- package/dist/docs/functional/themes/dark-high-contrast.json +464 -454
- package/dist/docs/functional/themes/dark-tritanopia.json +153 -153
- package/dist/docs/functional/themes/dark.json +160 -158
- package/dist/docs/functional/themes/light-colorblind.json +167 -173
- package/dist/docs/functional/themes/light-high-contrast.json +362 -358
- package/dist/docs/functional/themes/light-tritanopia.json +165 -171
- package/dist/docs/functional/themes/light.json +159 -157
- package/dist/figma/themes/dark-colorblind.json +198 -198
- package/dist/figma/themes/dark-dimmed.json +201 -200
- package/dist/figma/themes/dark-high-contrast.json +598 -596
- package/dist/figma/themes/dark-tritanopia.json +200 -200
- package/dist/figma/themes/dark.json +201 -200
- package/dist/figma/themes/light-colorblind.json +217 -218
- package/dist/figma/themes/light-high-contrast.json +393 -391
- package/dist/figma/themes/light-tritanopia.json +216 -217
- package/dist/figma/themes/light.json +139 -138
- package/dist/internalCss/dark-colorblind.css +12 -12
- package/dist/internalCss/dark-dimmed.css +14 -14
- package/dist/internalCss/dark-high-contrast.css +250 -250
- package/dist/internalCss/dark-tritanopia.css +14 -14
- package/dist/internalCss/dark.css +14 -14
- package/dist/internalCss/light-colorblind.css +24 -24
- package/dist/internalCss/light-high-contrast.css +146 -146
- package/dist/internalCss/light-tritanopia.css +24 -24
- package/dist/internalCss/light.css +12 -12
- package/dist/styleLint/functional/themes/dark-colorblind.json +149 -149
- package/dist/styleLint/functional/themes/dark-dimmed.json +160 -158
- package/dist/styleLint/functional/themes/dark-high-contrast.json +464 -454
- package/dist/styleLint/functional/themes/dark-tritanopia.json +153 -153
- package/dist/styleLint/functional/themes/dark.json +160 -158
- package/dist/styleLint/functional/themes/light-colorblind.json +167 -173
- package/dist/styleLint/functional/themes/light-high-contrast.json +362 -358
- package/dist/styleLint/functional/themes/light-tritanopia.json +165 -171
- package/dist/styleLint/functional/themes/light.json +159 -157
- package/package.json +28 -28
- package/src/formats/cssAdvanced.ts +3 -3
- package/src/formats/cssCustomMedia.ts +2 -2
- package/src/formats/javascriptCommonJs.ts +2 -2
- package/src/formats/javascriptEsm.ts +2 -2
- package/src/formats/jsonFigma.ts +2 -2
- package/src/formats/jsonNestedPrefixed.ts +2 -2
- package/src/formats/jsonOneDimensional.ts +2 -2
- package/src/formats/jsonPostCssFallback.ts +2 -2
- package/src/formats/typescriptExportDefinition.ts +2 -2
- package/src/schemas/designToken.ts +1 -1
- package/src/schemas/validTokenType.ts +1 -1
- package/src/tokens/functional/color/dark/overrides/dark.high-contrast.json5 +512 -2
- package/src/tokens/functional/color/dark/overrides/dark.tritanopia.json5 +4 -0
- package/src/tokens/functional/color/dark/primitives-dark.json5 +66 -65
- package/src/tokens/functional/color/light/overrides/light.high-contrast.json5 +394 -0
- package/src/tokens/functional/color/light/overrides/light.protanopia-deuteranopia.json5 +3 -6
- package/src/tokens/functional/color/light/overrides/light.tritanopia.json5 +3 -6
- package/src/tokens/functional/color/light/primitives-light.json5 +65 -64
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/primitives",
|
|
3
|
-
"version": "8.2.4-rc.
|
|
3
|
+
"version": "8.2.4-rc.b7bbf7a5",
|
|
4
4
|
"description": "Typography, spacing, and color primitives for Primer design system",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -33,48 +33,48 @@
|
|
|
33
33
|
"format": "prettier --write '**/*.{js,jsx,ts,tsx,md,mdx,css}'",
|
|
34
34
|
"format:check": "prettier --check '**/*.{js,jsx,ts,tsx,md,mdx,css}'",
|
|
35
35
|
"install:storybook": "cd docs/storybook && npm ci --legacy-peer-deps --no-audit --no-fund",
|
|
36
|
-
"lint": "eslint '**/*.{js,ts,tsx,md,mdx}' --max-warnings=0 --config .eslintrc.
|
|
37
|
-
"lint:fix": "eslint '**/*.{js,ts,tsx,md,mdx}' --fix --max-warnings=0 --config .eslintrc.
|
|
36
|
+
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint '**/*.{js,ts,tsx,md,mdx}' --max-warnings=0 --config .eslintrc.cjs && npm run lint:tokens",
|
|
37
|
+
"lint:fix": "eslint '**/*.{js,ts,tsx,md,mdx}' --fix --max-warnings=0 --config .eslintrc.cjs",
|
|
38
38
|
"lint:tokens": "ts-node ./scripts/validateTokenJson.ts",
|
|
39
39
|
"prebuild": "rm -rf dist",
|
|
40
40
|
"prepack": "npm run build",
|
|
41
41
|
"release": "changeset publish",
|
|
42
42
|
"start:storybook": "npm run build && cd docs/storybook && npm run storybook",
|
|
43
|
-
"test": "
|
|
43
|
+
"test": "vitest run --coverage"
|
|
44
44
|
},
|
|
45
45
|
"prettier": "@github/prettier-config",
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@actions/github": "^6.0.0",
|
|
48
48
|
"@changesets/changelog-github": "^0.5.0",
|
|
49
|
-
"@changesets/cli": "^2.27.
|
|
49
|
+
"@changesets/cli": "^2.27.7",
|
|
50
50
|
"@github/prettier-config": "^0.0.6",
|
|
51
|
-
"@playwright/test": "^1.
|
|
52
|
-
"@
|
|
53
|
-
"@types/node": "^20.
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
55
|
-
"@typescript-eslint/parser": "^
|
|
51
|
+
"@playwright/test": "^1.45.1",
|
|
52
|
+
"@prettier/sync": "^0.5.2",
|
|
53
|
+
"@types/node": "^20.14.9",
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "^7.15.0",
|
|
55
|
+
"@typescript-eslint/parser": "^7.15.0",
|
|
56
|
+
"@vitest/coverage-v8": "^2.0.1",
|
|
56
57
|
"color-blend": "^4.0.0",
|
|
57
|
-
"color2k": "^2.0.
|
|
58
|
-
"console-table-printer": "^2.
|
|
59
|
-
"eslint": "^8.
|
|
60
|
-
"eslint-config-prettier": "^
|
|
61
|
-
"eslint-import-resolver-typescript": "
|
|
62
|
-
"eslint-plugin-github": "^
|
|
63
|
-
"eslint-plugin-jsx-a11y": "
|
|
64
|
-
"eslint-plugin-mdx": "^
|
|
65
|
-
"eslint-plugin-primer-react": "^
|
|
66
|
-
"eslint-plugin-react": "
|
|
67
|
-
"eslint-plugin-react-hooks": "^4.
|
|
68
|
-
"eslint-plugin-storybook": "^0.
|
|
69
|
-
"jest": "^29.6.1",
|
|
58
|
+
"color2k": "^2.0.3",
|
|
59
|
+
"console-table-printer": "^2.12.1",
|
|
60
|
+
"eslint": "^8.57.0",
|
|
61
|
+
"eslint-config-prettier": "^9.1.0",
|
|
62
|
+
"eslint-import-resolver-typescript": "3.6",
|
|
63
|
+
"eslint-plugin-github": "^5.0.1",
|
|
64
|
+
"eslint-plugin-jsx-a11y": "6.9",
|
|
65
|
+
"eslint-plugin-mdx": "^3.1.5",
|
|
66
|
+
"eslint-plugin-primer-react": "^5.3.0",
|
|
67
|
+
"eslint-plugin-react": "7.34",
|
|
68
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
69
|
+
"eslint-plugin-storybook": "^0.8.0",
|
|
70
70
|
"json5": "^2.2.1",
|
|
71
71
|
"markdown-table-ts": "^1.0.3",
|
|
72
|
-
"prettier": "
|
|
72
|
+
"prettier": "3.3",
|
|
73
73
|
"style-dictionary": "^3.9.2",
|
|
74
|
-
"ts-jest": "^29.1.2",
|
|
75
74
|
"ts-node": "^10.9.2",
|
|
76
|
-
"typescript": "
|
|
77
|
-
"
|
|
78
|
-
"zod
|
|
75
|
+
"typescript": "5.5",
|
|
76
|
+
"vitest": "^2.0.1",
|
|
77
|
+
"zod": "3.23",
|
|
78
|
+
"zod-validation-error": "3.3"
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {TransformedToken} from 'style-dictionary'
|
|
2
2
|
import StyleDictionary from 'style-dictionary'
|
|
3
3
|
import type {FormatterArguments} from 'style-dictionary/types/Format'
|
|
4
|
-
import
|
|
4
|
+
import syncPrettier from '@prettier/sync'
|
|
5
5
|
import type {LineFormatting} from 'style-dictionary/types/FormatHelpers'
|
|
6
6
|
const {fileHeader, formattedVariables} = StyleDictionary.formatHelpers
|
|
7
7
|
|
|
@@ -47,7 +47,7 @@ export const cssAdvanced: StyleDictionary.Formatter = ({
|
|
|
47
47
|
...token,
|
|
48
48
|
name: `${platform.prefix}-${token.name}`,
|
|
49
49
|
path: [platform.prefix, ...token.path],
|
|
50
|
-
} as TransformedToken
|
|
50
|
+
}) as TransformedToken,
|
|
51
51
|
)
|
|
52
52
|
}
|
|
53
53
|
// get queries from tokens
|
|
@@ -95,5 +95,5 @@ export const cssAdvanced: StyleDictionary.Formatter = ({
|
|
|
95
95
|
output.push(queryString ? `${queryString} { ${cssWithSelector} }` : cssWithSelector)
|
|
96
96
|
}
|
|
97
97
|
// return prettified
|
|
98
|
-
return format(output.join('\n'), {parser: 'css', printWidth: 500})
|
|
98
|
+
return syncPrettier.format(output.join('\n'), {parser: 'css', printWidth: 500})
|
|
99
99
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import StyleDictionary from 'style-dictionary'
|
|
2
2
|
import type {FormatterArguments} from 'style-dictionary/types/Format'
|
|
3
|
-
import
|
|
3
|
+
import syncPrettier from '@prettier/sync'
|
|
4
4
|
const {fileHeader} = StyleDictionary.formatHelpers
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -20,5 +20,5 @@ export const cssCustomMedia: StyleDictionary.Formatter = ({
|
|
|
20
20
|
output.push(`@custom-media --${name} ${value};`)
|
|
21
21
|
})
|
|
22
22
|
// return prettified
|
|
23
|
-
return format(output.join('\n'), {parser: 'css', printWidth: 500})
|
|
23
|
+
return syncPrettier.format(output.join('\n'), {parser: 'css', printWidth: 500})
|
|
24
24
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import syncPrettier from '@prettier/sync'
|
|
2
2
|
import {jsonToNestedValue} from './utilities/jsonToNestedValue'
|
|
3
3
|
import {prefixTokens} from './utilities/prefixTokens'
|
|
4
4
|
import StyleDictionary from 'style-dictionary'
|
|
@@ -17,5 +17,5 @@ export const javascriptCommonJs: StyleDictionary.Formatter = ({dictionary, file,
|
|
|
17
17
|
// add file header and convert output
|
|
18
18
|
const output = `${fileHeader({file})}exports.default = ${JSON.stringify(jsonToNestedValue(tokens), null, 2)}\n`
|
|
19
19
|
// return prettified
|
|
20
|
-
return format(output, {parser: 'typescript', printWidth: 500})
|
|
20
|
+
return syncPrettier.format(output, {parser: 'typescript', printWidth: 500})
|
|
21
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import StyleDictionary from 'style-dictionary'
|
|
2
|
-
import
|
|
2
|
+
import syncPrettier from '@prettier/sync'
|
|
3
3
|
import {jsonToNestedValue} from './utilities/jsonToNestedValue'
|
|
4
4
|
import {prefixTokens} from './utilities/prefixTokens'
|
|
5
5
|
import type {FormatterArguments} from 'style-dictionary/types/Format'
|
|
@@ -17,5 +17,5 @@ export const javascriptEsm: StyleDictionary.Formatter = ({dictionary, file, plat
|
|
|
17
17
|
// add file header and convert output
|
|
18
18
|
const output = `${fileHeader({file})}export default \n${JSON.stringify(jsonToNestedValue(tokens), null, 2)}\n`
|
|
19
19
|
// return prettified
|
|
20
|
-
return format(output, {parser: 'typescript', printWidth: 500})
|
|
20
|
+
return syncPrettier.format(output, {parser: 'typescript', printWidth: 500})
|
|
21
21
|
}
|
package/src/formats/jsonFigma.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import StyleDictionary from 'style-dictionary'
|
|
2
|
-
import
|
|
2
|
+
import syncPrettier from '@prettier/sync'
|
|
3
3
|
import type {FormatterArguments} from 'style-dictionary/types/Format'
|
|
4
4
|
import {transformNamePathToFigma} from '../transformers/namePathToFigma'
|
|
5
5
|
import type {ShadowTokenValue} from '../types/ShadowTokenValue'
|
|
@@ -130,5 +130,5 @@ export const jsonFigma: StyleDictionary.Formatter = ({dictionary, file: _file, p
|
|
|
130
130
|
// add file header and convert output
|
|
131
131
|
const output = JSON.stringify(tokens, null, 2)
|
|
132
132
|
// return prettified
|
|
133
|
-
return format(output, {parser: 'json', printWidth: 500})
|
|
133
|
+
return syncPrettier.format(output, {parser: 'json', printWidth: 500})
|
|
134
134
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type StyleDictionary from 'style-dictionary'
|
|
2
|
-
import
|
|
2
|
+
import syncPrettier from '@prettier/sync'
|
|
3
3
|
import {prefixTokens} from './utilities/prefixTokens'
|
|
4
4
|
import {jsonToNestedValue} from './utilities/jsonToNestedValue'
|
|
5
5
|
|
|
@@ -19,5 +19,5 @@ export const jsonNestedPrefixed: StyleDictionary.Formatter = ({dictionary, file:
|
|
|
19
19
|
// add file header and convert output
|
|
20
20
|
const output = JSON.stringify(tokens, null, 2)
|
|
21
21
|
// return prettified
|
|
22
|
-
return format(output, {parser: 'json', printWidth: 500})
|
|
22
|
+
return syncPrettier.format(output, {parser: 'json', printWidth: 500})
|
|
23
23
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type StyleDictionary from 'style-dictionary'
|
|
2
|
-
import
|
|
2
|
+
import syncPrettier from '@prettier/sync'
|
|
3
3
|
import {jsonToFlat} from './utilities/jsonToFlat'
|
|
4
4
|
/**
|
|
5
5
|
* @description Takes a style dictionary token dictionary and converts it to a one dimensional json object.
|
|
@@ -14,5 +14,5 @@ export const jsonOneDimensional: StyleDictionary.Formatter = ({dictionary, file:
|
|
|
14
14
|
// add file header and convert output
|
|
15
15
|
const output = JSON.stringify(tokens, null, 2)
|
|
16
16
|
// return prettified
|
|
17
|
-
return format(output, {parser: 'json', printWidth: 500})
|
|
17
|
+
return syncPrettier.format(output, {parser: 'json', printWidth: 500})
|
|
18
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type StyleDictionary from 'style-dictionary'
|
|
2
|
-
import
|
|
2
|
+
import syncPrettier from '@prettier/sync'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @description Takes a style dictionary token dictionary and converts it to a one dimensional json object.
|
|
@@ -12,5 +12,5 @@ export const jsonPostCssFallback: StyleDictionary.Formatter = ({dictionary, file
|
|
|
12
12
|
// add file header and convert output
|
|
13
13
|
const output = JSON.stringify(tokens, null, 2)
|
|
14
14
|
// return prettified
|
|
15
|
-
return format(output, {parser: 'json', printWidth: 500})
|
|
15
|
+
return syncPrettier.format(output, {parser: 'json', printWidth: 500})
|
|
16
16
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import StyleDictionary from 'style-dictionary'
|
|
2
|
-
import
|
|
2
|
+
import syncPrettier from '@prettier/sync'
|
|
3
3
|
import fs = require('fs')
|
|
4
4
|
import path = require('path')
|
|
5
5
|
import {treeWalker} from '../utilities/treeWalker'
|
|
@@ -166,5 +166,5 @@ export const typescriptExportDefinition: StyleDictionary.Formatter = ({
|
|
|
166
166
|
// add file header and convert output
|
|
167
167
|
const output = `${fileHeader({file})}\n${getTypeDefinition(tokens, moduleName, tokenTypesPath)}\n`
|
|
168
168
|
// return prettified
|
|
169
|
-
return format(output, {parser: 'typescript', printWidth: 500})
|
|
169
|
+
return syncPrettier.format(output, {parser: 'typescript', printWidth: 500})
|
|
170
170
|
}
|