@primer/primitives 8.2.4-rc.d955f312 → 8.2.4-rc.f820602a

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 (65) hide show
  1. package/README.md +17 -18
  2. package/dist/css/functional/themes/dark-colorblind.css +12 -12
  3. package/dist/css/functional/themes/dark-dimmed.css +14 -14
  4. package/dist/css/functional/themes/dark-high-contrast.css +250 -250
  5. package/dist/css/functional/themes/dark-tritanopia.css +14 -14
  6. package/dist/css/functional/themes/dark.css +14 -14
  7. package/dist/css/functional/themes/light-colorblind.css +24 -24
  8. package/dist/css/functional/themes/light-high-contrast.css +146 -146
  9. package/dist/css/functional/themes/light-tritanopia.css +24 -24
  10. package/dist/css/functional/themes/light.css +12 -12
  11. package/dist/docs/functional/themes/dark-colorblind.json +149 -149
  12. package/dist/docs/functional/themes/dark-dimmed.json +160 -158
  13. package/dist/docs/functional/themes/dark-high-contrast.json +464 -454
  14. package/dist/docs/functional/themes/dark-tritanopia.json +153 -153
  15. package/dist/docs/functional/themes/dark.json +160 -158
  16. package/dist/docs/functional/themes/light-colorblind.json +167 -173
  17. package/dist/docs/functional/themes/light-high-contrast.json +362 -358
  18. package/dist/docs/functional/themes/light-tritanopia.json +165 -171
  19. package/dist/docs/functional/themes/light.json +159 -157
  20. package/dist/figma/themes/dark-colorblind.json +198 -198
  21. package/dist/figma/themes/dark-dimmed.json +201 -200
  22. package/dist/figma/themes/dark-high-contrast.json +598 -596
  23. package/dist/figma/themes/dark-tritanopia.json +200 -200
  24. package/dist/figma/themes/dark.json +201 -200
  25. package/dist/figma/themes/light-colorblind.json +217 -218
  26. package/dist/figma/themes/light-high-contrast.json +393 -391
  27. package/dist/figma/themes/light-tritanopia.json +216 -217
  28. package/dist/figma/themes/light.json +139 -138
  29. package/dist/internalCss/dark-colorblind.css +12 -12
  30. package/dist/internalCss/dark-dimmed.css +14 -14
  31. package/dist/internalCss/dark-high-contrast.css +250 -250
  32. package/dist/internalCss/dark-tritanopia.css +14 -14
  33. package/dist/internalCss/dark.css +14 -14
  34. package/dist/internalCss/light-colorblind.css +24 -24
  35. package/dist/internalCss/light-high-contrast.css +146 -146
  36. package/dist/internalCss/light-tritanopia.css +24 -24
  37. package/dist/internalCss/light.css +12 -12
  38. package/dist/styleLint/functional/themes/dark-colorblind.json +149 -149
  39. package/dist/styleLint/functional/themes/dark-dimmed.json +160 -158
  40. package/dist/styleLint/functional/themes/dark-high-contrast.json +464 -454
  41. package/dist/styleLint/functional/themes/dark-tritanopia.json +153 -153
  42. package/dist/styleLint/functional/themes/dark.json +160 -158
  43. package/dist/styleLint/functional/themes/light-colorblind.json +167 -173
  44. package/dist/styleLint/functional/themes/light-high-contrast.json +362 -358
  45. package/dist/styleLint/functional/themes/light-tritanopia.json +165 -171
  46. package/dist/styleLint/functional/themes/light.json +159 -157
  47. package/package.json +28 -28
  48. package/src/formats/cssAdvanced.ts +3 -3
  49. package/src/formats/cssCustomMedia.ts +2 -2
  50. package/src/formats/javascriptCommonJs.ts +2 -2
  51. package/src/formats/javascriptEsm.ts +2 -2
  52. package/src/formats/jsonFigma.ts +2 -2
  53. package/src/formats/jsonNestedPrefixed.ts +2 -2
  54. package/src/formats/jsonOneDimensional.ts +2 -2
  55. package/src/formats/jsonPostCssFallback.ts +2 -2
  56. package/src/formats/typescriptExportDefinition.ts +2 -2
  57. package/src/schemas/designToken.ts +1 -1
  58. package/src/schemas/validTokenType.ts +1 -1
  59. package/src/tokens/functional/color/dark/overrides/dark.high-contrast.json5 +512 -2
  60. package/src/tokens/functional/color/dark/overrides/dark.tritanopia.json5 +4 -0
  61. package/src/tokens/functional/color/dark/primitives-dark.json5 +66 -65
  62. package/src/tokens/functional/color/light/overrides/light.high-contrast.json5 +394 -0
  63. package/src/tokens/functional/color/light/overrides/light.protanopia-deuteranopia.json5 +3 -6
  64. package/src/tokens/functional/color/light/overrides/light.tritanopia.json5 +3 -6
  65. 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.d955f312",
3
+ "version": "8.2.4-rc.f820602a",
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.js && npm run lint:tokens",
37
- "lint:fix": "eslint '**/*.{js,ts,tsx,md,mdx}' --fix --max-warnings=0 --config .eslintrc.js",
36
+ "lint": "ESLINT_USE_FLAT_CONFIG=false eslint '**/*.{js,ts,tsx,md,mdx}' --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": "jest --verbose --coverage"
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.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/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.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
70
  "json5": "^2.2.1",
71
71
  "markdown-table-ts": "^1.0.3",
72
- "prettier": "^2.7.1",
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": "^5.4.5",
77
- "zod": "^3.22.4",
78
- "zod-validation-error": "^3.1.0"
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 {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({