@adobe/spectrum-tokens 12.24.0 → 12.25.0

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 (35) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/json/drover.json +1 -0
  3. package/dist/json/variables.json +12 -0
  4. package/index.js +52 -0
  5. package/moon.yml +3 -2
  6. package/package.json +10 -6
  7. package/schemas/token-types/alias.json +1 -0
  8. package/schemas/token-types/color-set.json +1 -0
  9. package/schemas/token-types/color.json +1 -0
  10. package/schemas/token-types/dimension.json +1 -0
  11. package/schemas/token-types/font-family.json +1 -0
  12. package/schemas/token-types/font-size.json +1 -0
  13. package/schemas/token-types/font-style.json +1 -0
  14. package/schemas/token-types/font-weight.json +1 -0
  15. package/schemas/token-types/multiplier.json +1 -0
  16. package/schemas/token-types/opacity.json +1 -0
  17. package/schemas/token-types/scale-set.json +1 -0
  18. package/schemas/token-types/system-set.json +1 -0
  19. package/schemas/token-types/text-transform.json +1 -0
  20. package/schemas/token-types/token.json +6 -1
  21. package/src/color-palette.json +426 -213
  22. package/src/layout-component.json +23 -3
  23. package/tasks/addPrivate.js +22 -0
  24. package/tasks/diff.js +2 -2
  25. package/test/checkComponentProps.js +25 -0
  26. package/test/checkId.test.js +24 -38
  27. package/test/checkManifest.test.js +1 -1
  28. package/test/checkPrivate.js +22 -0
  29. package/test/checkUniqueTokenNames.js +32 -0
  30. package/test/componentSchemaValidator.test.js +1 -1
  31. package/test/deprecateExpress.test.js +1 -1
  32. package/test/drover.test.js +1 -1
  33. package/test/schemaValidator.test.js +74 -0
  34. package/test/schemaValidators/alias.test.js +1 -1
  35. package/test/tokenSchemaValidator.test.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @adobe/spectrum-tokens
2
2
 
3
+ ## 12.25.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`413ef5a`](https://github.com/adobe/spectrum-tokens/commit/413ef5adad9083b7e133cc867e0436a879004ec8) Thanks [@GarthDB](https://github.com/GarthDB)! - Added `private` metadata to global tokens.
8
+
9
+ ## 12.24.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 9361a58: Fixed misnamed accordion token.
14
+
15
+ ## Token Diff
16
+
17
+ _Tokens added (1):_
18
+
19
+ - `accordion-top-to-text-spacious-small`
20
+
21
+ _Newly deprecated token (1):_
22
+
23
+ - `accordion-small-top-to-text-spacious`
24
+
3
25
  ## 12.24.0
4
26
 
5
27
  ### Minor Changes
@@ -1378,6 +1378,7 @@
1378
1378
  "accordion-top-to-text-spacious-extra-large": "13px",
1379
1379
  "accordion-top-to-text-spacious-large": "12px",
1380
1380
  "accordion-top-to-text-spacious-medium": "12px",
1381
+ "accordion-top-to-text-spacious-small": "9px",
1381
1382
  "action-bar-height": "48px",
1382
1383
  "action-bar-top-to-item-counter": "14px",
1383
1384
  "action-button-edge-to-hold-icon-extra-large": "6px",
@@ -19100,6 +19100,18 @@
19100
19100
  }
19101
19101
  }
19102
19102
  },
19103
+ "accordion-top-to-text-spacious-small": {
19104
+ "sets": {
19105
+ "desktop": {
19106
+ "value": "9px",
19107
+ "uuid": "1f833f34-562b-4874-9f69-db74e80ffef1"
19108
+ },
19109
+ "mobile": {
19110
+ "value": "12px",
19111
+ "uuid": "02e96927-9f33-4878-9ce0-bb825be84bcb"
19112
+ }
19113
+ }
19114
+ },
19103
19115
  "corner-radius-75": {
19104
19116
  "sets": {
19105
19117
  "spectrum": {
package/index.js ADDED
@@ -0,0 +1,52 @@
1
+ /*
2
+ Copyright 2024 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { glob } from "glob";
14
+
15
+ import { resolve } from "path";
16
+ import { readFile } from "fs/promises";
17
+ import * as url from "url";
18
+ import { writeFile } from "fs/promises";
19
+ import { format } from "prettier";
20
+
21
+ export const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
22
+
23
+ export const tokenFileNames = await glob(
24
+ `${resolve(__dirname, "./src")}/**/*.json`,
25
+ );
26
+
27
+ export const readJson = async (fileName) =>
28
+ JSON.parse(await readFile(fileName, "utf8"));
29
+
30
+ export const writeJson = async (fileName, jsonData) => {
31
+ await writeFile(
32
+ fileName,
33
+ await format(JSON.stringify(jsonData), { parser: "json-stringify" }),
34
+ );
35
+ };
36
+
37
+ export const getFileTokens = async (tokenFileName) =>
38
+ await readJson(resolve(__dirname, "src", tokenFileName));
39
+
40
+ export const getAllTokens = async () => {
41
+ return await Promise.all(tokenFileNames.map(getFileTokens)).then(
42
+ (tokenFileDataAr) => {
43
+ return tokenFileDataAr.reduce(
44
+ (tokenDataAcc, tokenFileData) => ({
45
+ ...tokenDataAcc,
46
+ ...tokenFileData,
47
+ }),
48
+ {},
49
+ );
50
+ },
51
+ );
52
+ };
package/moon.yml CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2023 Adobe. All rights reserved.
1
+ # Copyright 2024 Adobe. All rights reserved.
2
2
  # This file is licensed to you under the Apache License, Version 2.0 (the "License");
3
3
  # you may not use this file except in compliance with the License. You may obtain a copy
4
4
  # of the License at http://www.apache.org/licenses/LICENSE-2.0
@@ -7,6 +7,7 @@
7
7
  # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
8
8
  # OF ANY KIND, either express or implied. See the License for the specific language
9
9
  # governing permissions and limitations under the License.
10
+ $schema: "https://moonrepo.dev/schemas/project.json"
10
11
  type: library
11
12
  fileGroups:
12
13
  sources:
@@ -54,7 +55,7 @@ tasks:
54
55
  platform: node
55
56
  test:
56
57
  command:
57
- - npx
58
+ - pnpm
58
59
  - ava
59
60
  inputs:
60
61
  - "tasks/**/*"
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@adobe/spectrum-tokens",
3
- "version": "12.24.0",
3
+ "version": "12.25.0",
4
4
  "description": "Design tokens for Spectrum, Adobe's design system",
5
5
  "type": "module",
6
- "main": "tasks/buildSpectrumTokens.js",
6
+ "main": "index.js",
7
7
  "tokens": "dist/json/variables.json",
8
8
  "repository": {
9
9
  "type": "git",
@@ -17,15 +17,19 @@
17
17
  "bugs": {
18
18
  "url": "https://github.com/adobe/spectrum-tokens/issues"
19
19
  },
20
+ "publishConfig": {
21
+ "provenance": true
22
+ },
20
23
  "homepage": "https://github.com/adobe/spectrum-tokens/tree/main/packages/tokens#readme",
21
24
  "devDependencies": {
22
25
  "ajv": "^8.12.0",
23
- "ajv-formats": "^2.1.1",
26
+ "ajv-formats": "^3.0.1",
24
27
  "deep-object-diff": "^1.1.9",
25
- "glob": "^10.3.3",
26
- "style-dictionary": "^3.8.0",
28
+ "find-duplicated-property-keys": "^1.2.9",
29
+ "glob": "^10.3.12",
30
+ "style-dictionary": "^3.9.2",
27
31
  "style-dictionary-sets": "^2.3.0",
28
- "tar": "^6.1.15",
32
+ "tar": "^7.0.1",
29
33
  "tmp-promise": "^3.0.3"
30
34
  },
31
35
  "scripts": {}
@@ -18,6 +18,7 @@
18
18
  "pattern": "^\\{(\\w|-)*\\}$"
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -70,6 +70,7 @@
70
70
  ]
71
71
  },
72
72
  "component": {},
73
+ "private": {},
73
74
  "deprecated": {},
74
75
  "deprecated_comment": {},
75
76
  "uuid": {}
@@ -18,6 +18,7 @@
18
18
  "pattern": "^rgba\\((([0-1]?[0-9]?[0-9]?|2[0-4][0-9]|25[0-5]),\\s?){3}(0|1|0?\\.\\d+)\\)|rgb\\(([0-1]?[0-9]?[0-9]?|2[0-4][0-9]|25[0-5]){1,3}(,\\s?\\d{1,3}%?){2}\\)$"
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -18,6 +18,7 @@
18
18
  "pattern": "^(?:-?((?:\\d+\\.?\\d*)|(?:\\.?\\d+))(px|rem|em|%))|0|\\d+dp$"
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -18,6 +18,7 @@
18
18
  "pattern": "^(?:\"?\\w+\"? ?,? ?)*\"?\\w+\"?$"
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -18,6 +18,7 @@
18
18
  "pattern": "^(?:-?((?:\\d+\\.?\\d*)|(?:\\.?\\d+))(px|rem|em))$"
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -18,6 +18,7 @@
18
18
  "enum": ["italic", "normal"]
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -18,6 +18,7 @@
18
18
  "enum": ["light", "regular", "medium", "bold", "extra-bold", "black"]
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -18,6 +18,7 @@
18
18
  "pattern": "^(?:\\d+\\.?\\d*)|(?:\\.?\\d+)$"
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -18,6 +18,7 @@
18
18
  "pattern": "^(?:\\d+(?:\\.\\d)+%)|(?:1|0)(?:\\.0)?|0?\\.\\d*$"
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -46,6 +46,7 @@
46
46
  "required": ["mobile", "desktop"]
47
47
  },
48
48
  "component": {},
49
+ "private": {},
49
50
  "deprecated": {},
50
51
  "deprecated_comment": {},
51
52
  "uuid": {}
@@ -74,6 +74,7 @@
74
74
  ]
75
75
  },
76
76
  "component": {},
77
+ "private": {},
77
78
  "deprecated": {},
78
79
  "deprecated_comment": {},
79
80
  "uuid": {}
@@ -18,6 +18,7 @@
18
18
  "enum": ["uppercase", "lowercase", "capitalize", "none"]
19
19
  },
20
20
  "component": {},
21
+ "private": {},
21
22
  "deprecated": {},
22
23
  "deprecated_comment": {},
23
24
  "uuid": {}
@@ -11,8 +11,13 @@
11
11
  "component": {
12
12
  "type": "string"
13
13
  },
14
+ "private": {
15
+ "type": "boolean",
16
+ "default": false
17
+ },
14
18
  "deprecated": {
15
- "type": "boolean"
19
+ "type": "boolean",
20
+ "default": false
16
21
  },
17
22
  "deprecated_comment": {
18
23
  "type": "string"