@adobe/spectrum-tokens 12.24.1 → 12.26.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 (41) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/json/variables.json +6 -2
  3. package/index.js +52 -0
  4. package/moon.yml +3 -2
  5. package/package.json +7 -6
  6. package/schemas/token-types/alias.json +1 -0
  7. package/schemas/token-types/color-set.json +7 -2
  8. package/schemas/token-types/color.json +1 -0
  9. package/schemas/token-types/dimension.json +1 -0
  10. package/schemas/token-types/font-family.json +1 -0
  11. package/schemas/token-types/font-size.json +1 -0
  12. package/schemas/token-types/font-style.json +1 -0
  13. package/schemas/token-types/font-weight.json +1 -0
  14. package/schemas/token-types/multiplier.json +1 -0
  15. package/schemas/token-types/opacity.json +1 -0
  16. package/schemas/token-types/scale-set.json +7 -2
  17. package/schemas/token-types/system-set.json +1 -0
  18. package/schemas/token-types/text-transform.json +1 -0
  19. package/schemas/token-types/token.json +6 -1
  20. package/src/color-aliases.json +136 -68
  21. package/src/color-component.json +2 -1
  22. package/src/color-palette.json +619 -213
  23. package/src/icons.json +109 -55
  24. package/src/layout-component.json +897 -448
  25. package/src/layout.json +277 -139
  26. package/src/semantic-color-palette.json +28 -14
  27. package/src/typography.json +40 -20
  28. package/tasks/addIds.js +2 -1
  29. package/tasks/addPrivate.js +22 -0
  30. package/tasks/diff.js +2 -2
  31. package/test/checkComponentProps.js +25 -0
  32. package/test/checkId.test.js +24 -38
  33. package/test/checkManifest.test.js +1 -1
  34. package/test/checkPrivate.js +22 -0
  35. package/test/checkUniqueTokenNames.js +32 -0
  36. package/test/componentSchemaValidator.test.js +1 -1
  37. package/test/deprecateExpress.test.js +1 -1
  38. package/test/drover.test.js +1 -1
  39. package/test/schemaValidator.test.js +74 -0
  40. package/test/schemaValidators/alias.test.js +1 -1
  41. package/test/tokenSchemaValidator.test.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @adobe/spectrum-tokens
2
2
 
3
+ ## 12.26.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#345](https://github.com/adobe/spectrum-tokens/pull/345) [`fe4c707`](https://github.com/adobe/spectrum-tokens/commit/fe4c707c5ae2cc89efe6439dc775cddc94b706b3) Thanks [@GarthDB](https://github.com/GarthDB)! - Added UUIDs to the base of set tokens.
8
+
9
+ ## 12.25.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`413ef5a`](https://github.com/adobe/spectrum-tokens/commit/413ef5adad9083b7e133cc867e0436a879004ec8) Thanks [@GarthDB](https://github.com/GarthDB)! - Added `private` metadata to global tokens.
14
+
3
15
  ## 12.24.1
4
16
 
5
17
  ### Patch Changes
@@ -16325,8 +16325,12 @@
16325
16325
  "color-area-border-rounding": {
16326
16326
  "ref": "{corner-radius-100}",
16327
16327
  "sets": {
16328
- "spectrum": {},
16329
- "express": {}
16328
+ "spectrum": {
16329
+ "uuid": "67b83ee8-2782-48a5-ba27-70f690c95b4a"
16330
+ },
16331
+ "express": {
16332
+ "uuid": "179b1a27-66f9-47b9-9af9-648c0a3dbbfb"
16333
+ }
16330
16334
  },
16331
16335
  "uuid": "ab656bf4-8814-42fa-9036-b1e67159e4e1"
16332
16336
  },
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.1",
3
+ "version": "12.26.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",
@@ -23,12 +23,13 @@
23
23
  "homepage": "https://github.com/adobe/spectrum-tokens/tree/main/packages/tokens#readme",
24
24
  "devDependencies": {
25
25
  "ajv": "^8.12.0",
26
- "ajv-formats": "^2.1.1",
26
+ "ajv-formats": "^3.0.1",
27
27
  "deep-object-diff": "^1.1.9",
28
- "glob": "^10.3.3",
29
- "style-dictionary": "^3.8.0",
28
+ "find-duplicated-property-keys": "^1.2.9",
29
+ "glob": "^10.3.12",
30
+ "style-dictionary": "^3.9.2",
30
31
  "style-dictionary-sets": "^2.3.0",
31
- "tar": "^6.1.15",
32
+ "tar": "^7.0.1",
32
33
  "tmp-promise": "^3.0.3"
33
34
  },
34
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,9 +70,14 @@
70
70
  ]
71
71
  },
72
72
  "component": {},
73
+ "private": {},
73
74
  "deprecated": {},
74
75
  "deprecated_comment": {},
75
- "uuid": {}
76
+ "uuid": {
77
+ "type": "string",
78
+ "pattern": "^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$",
79
+ "format": "uuid"
80
+ }
76
81
  },
77
- "required": ["sets"]
82
+ "required": ["sets", "uuid"]
78
83
  }
@@ -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,9 +46,14 @@
46
46
  "required": ["mobile", "desktop"]
47
47
  },
48
48
  "component": {},
49
+ "private": {},
49
50
  "deprecated": {},
50
51
  "deprecated_comment": {},
51
- "uuid": {}
52
+ "uuid": {
53
+ "type": "string",
54
+ "pattern": "^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$",
55
+ "format": "uuid"
56
+ }
52
57
  },
53
- "required": ["sets"]
58
+ "required": ["sets", "uuid"]
54
59
  }
@@ -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"