@primer/primitives 8.2.4-rc.cbbd0a9a → 8.2.4-rc.d08fdd34

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 (61) hide show
  1. package/dist/css/functional/themes/dark-colorblind.css +2 -2
  2. package/dist/css/functional/themes/dark-dimmed.css +2 -2
  3. package/dist/css/functional/themes/dark-high-contrast.css +172 -172
  4. package/dist/css/functional/themes/dark-tritanopia.css +2 -2
  5. package/dist/css/functional/themes/dark.css +2 -2
  6. package/dist/css/functional/themes/light-colorblind.css +2 -2
  7. package/dist/css/functional/themes/light-high-contrast.css +116 -116
  8. package/dist/css/functional/themes/light-tritanopia.css +2 -2
  9. package/dist/css/functional/themes/light.css +2 -2
  10. package/dist/docs/functional/themes/dark-colorblind.json +4 -4
  11. package/dist/docs/functional/themes/dark-dimmed.json +5 -5
  12. package/dist/docs/functional/themes/dark-high-contrast.json +226 -226
  13. package/dist/docs/functional/themes/dark-tritanopia.json +4 -4
  14. package/dist/docs/functional/themes/dark.json +5 -5
  15. package/dist/docs/functional/themes/light-colorblind.json +2 -2
  16. package/dist/docs/functional/themes/light-high-contrast.json +174 -174
  17. package/dist/docs/functional/themes/light-tritanopia.json +2 -2
  18. package/dist/docs/functional/themes/light.json +2 -2
  19. package/dist/figma/themes/dark-colorblind.json +43 -43
  20. package/dist/figma/themes/dark-dimmed.json +62 -62
  21. package/dist/figma/themes/dark-high-contrast.json +358 -358
  22. package/dist/figma/themes/dark-tritanopia.json +43 -43
  23. package/dist/figma/themes/dark.json +62 -62
  24. package/dist/figma/themes/light-colorblind.json +4 -4
  25. package/dist/figma/themes/light-high-contrast.json +222 -222
  26. package/dist/figma/themes/light-tritanopia.json +4 -4
  27. package/dist/figma/themes/light.json +4 -4
  28. package/dist/internalCss/dark-colorblind.css +2 -2
  29. package/dist/internalCss/dark-dimmed.css +2 -2
  30. package/dist/internalCss/dark-high-contrast.css +172 -172
  31. package/dist/internalCss/dark-tritanopia.css +2 -2
  32. package/dist/internalCss/dark.css +2 -2
  33. package/dist/internalCss/light-colorblind.css +2 -2
  34. package/dist/internalCss/light-high-contrast.css +116 -116
  35. package/dist/internalCss/light-tritanopia.css +2 -2
  36. package/dist/internalCss/light.css +2 -2
  37. package/dist/styleLint/functional/themes/dark-colorblind.json +4 -4
  38. package/dist/styleLint/functional/themes/dark-dimmed.json +5 -5
  39. package/dist/styleLint/functional/themes/dark-high-contrast.json +226 -226
  40. package/dist/styleLint/functional/themes/dark-tritanopia.json +4 -4
  41. package/dist/styleLint/functional/themes/dark.json +5 -5
  42. package/dist/styleLint/functional/themes/light-colorblind.json +2 -2
  43. package/dist/styleLint/functional/themes/light-high-contrast.json +174 -174
  44. package/dist/styleLint/functional/themes/light-tritanopia.json +2 -2
  45. package/dist/styleLint/functional/themes/light.json +2 -2
  46. package/package.json +27 -26
  47. package/src/formats/cssAdvanced.ts +3 -3
  48. package/src/formats/cssCustomMedia.ts +2 -2
  49. package/src/formats/javascriptCommonJs.ts +2 -2
  50. package/src/formats/javascriptEsm.ts +2 -2
  51. package/src/formats/jsonFigma.ts +2 -2
  52. package/src/formats/jsonNestedPrefixed.ts +2 -2
  53. package/src/formats/jsonOneDimensional.ts +2 -2
  54. package/src/formats/jsonPostCssFallback.ts +2 -2
  55. package/src/formats/typescriptExportDefinition.ts +2 -2
  56. package/src/schemas/designToken.ts +1 -1
  57. package/src/schemas/validTokenType.ts +1 -1
  58. package/src/tokens/functional/color/dark/overrides/dark.high-contrast.json5 +397 -0
  59. package/src/tokens/functional/color/dark/primitives-dark.json5 +4 -4
  60. package/src/tokens/functional/color/light/overrides/light.high-contrast.json5 +348 -0
  61. package/src/tokens/functional/color/light/primitives-light.json5 +2 -2
@@ -12807,7 +12807,7 @@
12807
12807
  "path": ["fgColor", "link"]
12808
12808
  },
12809
12809
  "fgColor-neutral": {
12810
- "value": "#6e7781",
12810
+ "value": "#57606a",
12811
12811
  "$type": "color",
12812
12812
  "$extensions": {
12813
12813
  "org.primer.figma": {
@@ -12820,7 +12820,7 @@
12820
12820
  "filePath": "src/tokens/functional/color/light/primitives-light.json5",
12821
12821
  "isSource": true,
12822
12822
  "original": {
12823
- "value": "{base.color.neutral.5}",
12823
+ "value": "{base.color.neutral.6}",
12824
12824
  "$type": "color",
12825
12825
  "$extensions": {
12826
12826
  "org.primer.figma": {
@@ -12807,7 +12807,7 @@
12807
12807
  "path": ["fgColor", "link"]
12808
12808
  },
12809
12809
  "fgColor-neutral": {
12810
- "value": "#6e7781",
12810
+ "value": "#57606a",
12811
12811
  "$type": "color",
12812
12812
  "$extensions": {
12813
12813
  "org.primer.figma": {
@@ -12820,7 +12820,7 @@
12820
12820
  "filePath": "src/tokens/functional/color/light/primitives-light.json5",
12821
12821
  "isSource": true,
12822
12822
  "original": {
12823
- "value": "{base.color.neutral.5}",
12823
+ "value": "{base.color.neutral.6}",
12824
12824
  "$type": "color",
12825
12825
  "$extensions": {
12826
12826
  "org.primer.figma": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/primitives",
3
- "version": "8.2.4-rc.cbbd0a9a",
3
+ "version": "8.2.4-rc.d08fdd34",
4
4
  "description": "Typography, spacing, and color primitives for Primer design system",
5
5
  "files": [
6
6
  "dist",
@@ -33,7 +33,7 @@
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.js && npm run lint:tokens",
36
+ "lint": "ESLINT_USE_FLAT_CONFIG=false eslint '**/*.{js,ts,tsx,md,mdx}' --max-warnings=0 --config .eslintrc.js && npm run lint:tokens",
37
37
  "lint:fix": "eslint '**/*.{js,ts,tsx,md,mdx}' --fix --max-warnings=0 --config .eslintrc.js",
38
38
  "lint:tokens": "ts-node ./scripts/validateTokenJson.ts",
39
39
  "prebuild": "rm -rf dist",
@@ -46,35 +46,36 @@
46
46
  "devDependencies": {
47
47
  "@actions/github": "^6.0.0",
48
48
  "@changesets/changelog-github": "^0.5.0",
49
- "@changesets/cli": "^2.27.1",
49
+ "@changesets/cli": "^2.27.7",
50
50
  "@github/prettier-config": "^0.0.6",
51
- "@playwright/test": "^1.43.0",
52
- "@types/jest": "^29.5.2",
53
- "@types/node": "^20.4.0",
54
- "@typescript-eslint/eslint-plugin": "^5.61.0",
55
- "@typescript-eslint/parser": "^5.61.0",
51
+ "@playwright/test": "^1.45.1",
52
+ "@prettier/sync": "^0.5.2",
53
+ "@types/jest": "^29.5.12",
54
+ "@types/node": "^20.14.9",
55
+ "@typescript-eslint/eslint-plugin": "^7.15.0",
56
+ "@typescript-eslint/parser": "^7.15.0",
56
57
  "color-blend": "^4.0.0",
57
- "color2k": "^2.0.0",
58
- "console-table-printer": "^2.11.1",
59
- "eslint": "^8.12.0",
60
- "eslint-config-prettier": "^8.6.0",
61
- "eslint-import-resolver-typescript": "^3.5.3",
62
- "eslint-plugin-github": "^4.3.6",
63
- "eslint-plugin-jsx-a11y": "^6.5.1",
64
- "eslint-plugin-mdx": "^2.0.5",
65
- "eslint-plugin-primer-react": "^1.0.1",
66
- "eslint-plugin-react": "^7.29.4",
67
- "eslint-plugin-react-hooks": "^4.4.0",
68
- "eslint-plugin-storybook": "^0.6.15",
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
+ "jest": "29.7",
70
71
  "json5": "^2.2.1",
71
72
  "markdown-table-ts": "^1.0.3",
72
- "prettier": "^2.7.1",
73
+ "prettier": "3.3",
73
74
  "style-dictionary": "^3.9.2",
74
- "ts-jest": "^29.1.2",
75
+ "ts-jest": "^29.1.5",
75
76
  "ts-node": "^10.9.2",
76
- "typescript": "^5.4.5",
77
- "zod": "^3.22.4",
78
- "zod-validation-error": "^3.1.0"
77
+ "typescript": "5.5",
78
+ "zod": "3.23",
79
+ "zod-validation-error": "3.3"
79
80
  }
80
81
  }
@@ -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 {format} from 'prettier'
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 {format} from 'prettier'
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 {format} from 'prettier'
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 {format} from 'prettier'
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
  }
@@ -1,5 +1,5 @@
1
1
  import StyleDictionary from 'style-dictionary'
2
- import {format} from 'prettier'
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 {format} from 'prettier'
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 {format} from 'prettier'
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 {format} from 'prettier'
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 {format} from 'prettier'
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
  }
@@ -16,7 +16,7 @@ import {durationToken} from './durationToken'
16
16
  // @ts-ignore: TODO: fix this
17
17
  export const designToken = z.record(
18
18
  tokenName,
19
- z.lazy(() => {
19
+ z.lazy((): z.ZodTypeAny => {
20
20
  return z.union([
21
21
  z.discriminatedUnion('$type', [
22
22
  colorToken,
@@ -22,7 +22,7 @@ export type TokenType = (typeof validTypes)[number]
22
22
  // @ts-ignore: TODO: fix this
23
23
  export const validateType = z.record(
24
24
  z.string(),
25
- z.lazy(() => {
25
+ z.lazy((): z.ZodTypeAny => {
26
26
  return z.union([
27
27
  z
28
28
  .object({