@adobe/spectrum-tokens 13.12.0 → 13.14.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # @adobe/spectrum-tokens
2
2
 
3
+ ## 13.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`336f672`](https://github.com/adobe/spectrum-tokens/commit/336f67216dfd875f0feb65c10059d9f3fe6dcaf7) Thanks [@larz0](https://github.com/larz0)! - SDS-14319 generic avatar updates (Pre-multidimensional-theming)
8
+
9
+ Source: [spectrum-tokens-studio-data#281](https://github.com/adobe/spectrum-tokens-studio-data/pull/281)
10
+
11
+ ## 13.13.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#559](https://github.com/adobe/spectrum-tokens/pull/559) [`1d4973e`](https://github.com/adobe/spectrum-tokens/commit/1d4973e78d814575da231c2c4080ead8a190d2fc) Thanks [@mrcjhicks](https://github.com/mrcjhicks)! - ## Token sync from Spectrum Tokens Studio
16
+
17
+ ### Design motivation
18
+
19
+ A new visual treatment for select box.
20
+
21
+ ### Token changes
22
+
23
+ ## Tokens Changed (4)
24
+
25
+ **Original Branch:** `main`
26
+ **New Branch:** `tokens-sync/patch-spectrum2-from-main`
27
+
28
+ <details open><summary><strong>Added (1)</strong></summary>
29
+ - `select-box-horizontal-minimum-width`
30
+ </details>
31
+
32
+ ### Updated (3)
33
+
34
+ <details open><summary><strong>Added Properties (1)</strong></summary>
35
+ - `select-box-edge-to-checkbox` - `value`: `8px` - `uuid`: `70a20970-ebd9-48a7-8324-44d352f79978`
36
+ </details>
37
+ <details open><summary><strong>Deleted Properties (1)</strong></summary>
38
+ - `select-box-edge-to-checkbox` - `desktop.schema`: -> `dimension.json` - `desktop.value`: -> `12px` - `desktop.uuid`: -> `70a20970-ebd9-48a7-8324-44d352f79978` - `mobile.schema`: -> `dimension.json` - `mobile.value`: -> `15px` - `mobile.uuid`: -> `f028974a-20d1-4e03-af77-921b1dfc2469`
39
+ </details>
40
+ <details open><summary><strong>Updated Properties (1)</strong></summary>
41
+ - `select-box-edge-to-checkbox` - `schema`: `scale-set.json` -> `dimension.json`
42
+ </details>
43
+
44
+ ### References
45
+ - Tokens Studio PR: https://github.com/adobe/spectrum-tokens-studio-data/pull/275
46
+ - Spectrum Tokens PR: https://github.com/adobe/spectrum-tokens/pull/559
47
+
3
48
  ## 13.12.0
4
49
 
5
50
  ### Minor Changes
@@ -2372,11 +2372,12 @@
2372
2372
  "segmented-control-selection-border-width": "2px",
2373
2373
  "segmented-text-field-gap": "0px",
2374
2374
  "segmented-text-field-rounding": "2px",
2375
- "select-box-edge-to-checkbox": "12px",
2375
+ "select-box-edge-to-checkbox": "8px",
2376
2376
  "select-box-horizontal-end-to-content": "32px",
2377
2377
  "select-box-horizontal-illustration-to-label": "10px",
2378
2378
  "select-box-horizontal-label-to-description": "2px",
2379
2379
  "select-box-horizontal-minimum-height": "80px",
2380
+ "select-box-horizontal-minimum-width": "188px",
2380
2381
  "select-box-horizontal-start-to-content": "24px",
2381
2382
  "select-box-horizontal-top-to-content": "16px",
2382
2383
  "select-box-horizontal-width": "368px",
@@ -25020,16 +25020,8 @@
25020
25020
  }
25021
25021
  },
25022
25022
  "select-box-edge-to-checkbox": {
25023
- "sets": {
25024
- "desktop": {
25025
- "value": "12px",
25026
- "uuid": "70a20970-ebd9-48a7-8324-44d352f79978"
25027
- },
25028
- "mobile": {
25029
- "value": "15px",
25030
- "uuid": "f028974a-20d1-4e03-af77-921b1dfc2469"
25031
- }
25032
- }
25023
+ "value": "8px",
25024
+ "uuid": "70a20970-ebd9-48a7-8324-44d352f79978"
25033
25025
  },
25034
25026
  "select-box-horizontal-end-to-content": {
25035
25027
  "sets": {
@@ -26672,6 +26664,18 @@
26672
26664
  }
26673
26665
  }
26674
26666
  },
26667
+ "select-box-horizontal-minimum-width": {
26668
+ "sets": {
26669
+ "desktop": {
26670
+ "value": "188px",
26671
+ "uuid": "b2104b40-4b34-4d98-a564-1688900de75d"
26672
+ },
26673
+ "mobile": {
26674
+ "value": "220px",
26675
+ "uuid": "0a6c3623-dd05-40df-a3d8-b724e8a88178"
26676
+ }
26677
+ }
26678
+ },
26675
26679
  "corner-radius-0": {
26676
26680
  "value": "0px",
26677
26681
  "uuid": "bb9d8350-b1fb-4496-9c22-6ec9647ff117"
package/moon.yml CHANGED
@@ -8,6 +8,7 @@
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
10
  $schema: "https://moonrepo.dev/schemas/project.json"
11
+ layer: library
11
12
  fileGroups:
12
13
  sources:
13
14
  - "src/**/*"
@@ -45,13 +46,6 @@ tasks:
45
46
  - dist
46
47
  local: true
47
48
  platform: system
48
- generateDiffResult:
49
- command:
50
- - node
51
- - tasks/diff.js
52
- deps:
53
- - ~:buildTokens
54
- platform: node
55
49
  test:
56
50
  command:
57
51
  - pnpm
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spectrum-tokens",
3
- "version": "13.12.0",
3
+ "version": "13.14.0",
4
4
  "description": "Design tokens for Spectrum, Adobe's design system",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -29,8 +29,7 @@
29
29
  "style-dictionary": "^3.9.2",
30
30
  "style-dictionary-sets": "^2.3.0",
31
31
  "tar": "^7.4.3",
32
- "tmp-promise": "^3.0.3",
33
- "@adobe/token-diff-generator": "2.0.0"
32
+ "tmp-promise": "^3.0.3"
34
33
  },
35
34
  "scripts": {}
36
35
  }
@@ -9448,19 +9448,9 @@
9448
9448
  },
9449
9449
  "select-box-edge-to-checkbox": {
9450
9450
  "component": "select-box",
9451
- "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/scale-set.json",
9452
- "sets": {
9453
- "desktop": {
9454
- "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/dimension.json",
9455
- "value": "12px",
9456
- "uuid": "70a20970-ebd9-48a7-8324-44d352f79978"
9457
- },
9458
- "mobile": {
9459
- "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/dimension.json",
9460
- "value": "15px",
9461
- "uuid": "f028974a-20d1-4e03-af77-921b1dfc2469"
9462
- }
9463
- }
9451
+ "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/dimension.json",
9452
+ "value": "8px",
9453
+ "uuid": "70a20970-ebd9-48a7-8324-44d352f79978"
9464
9454
  },
9465
9455
  "select-box-horizontal-end-to-content": {
9466
9456
  "component": "select-box",
@@ -11714,5 +11704,21 @@
11714
11704
  "uuid": "0dea279c-62ca-4670-a693-03eaa7ccecb5"
11715
11705
  }
11716
11706
  }
11707
+ },
11708
+ "select-box-horizontal-minimum-width": {
11709
+ "component": "select-box",
11710
+ "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/scale-set.json",
11711
+ "sets": {
11712
+ "desktop": {
11713
+ "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/dimension.json",
11714
+ "value": "188px",
11715
+ "uuid": "b2104b40-4b34-4d98-a564-1688900de75d"
11716
+ },
11717
+ "mobile": {
11718
+ "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/dimension.json",
11719
+ "value": "220px",
11720
+ "uuid": "0a6c3623-dd05-40df-a3d8-b724e8a88178"
11721
+ }
11722
+ }
11717
11723
  }
11718
- }
11724
+ }
package/tasks/diff.js DELETED
@@ -1,145 +0,0 @@
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 { access, readFile } from "fs/promises";
14
- import { join, dirname } from "path";
15
- import { fileURLToPath } from "url";
16
- import { detailedDiff, diff } from "deep-object-diff";
17
- import { exec } from "node:child_process";
18
- import { promisify } from "util";
19
- import { x } from "tar";
20
- import tmp from "tmp-promise";
21
-
22
- const execP = promisify(exec);
23
-
24
- const tag = process.argv[2] || "latest";
25
- const tokenPath = "dist/json/variables.json";
26
- const localRootDir = join(dirname(fileURLToPath(import.meta.url)), "..");
27
- const localTokenPath = join(localRootDir, tokenPath);
28
-
29
- run()
30
- .then(() => {
31
- process.exit();
32
- })
33
- .catch((err) => {
34
- console.error(err);
35
- process.exit(1);
36
- });
37
-
38
- async function run() {
39
- const [newTokens, oldTokens] = await Promise.all([
40
- getNewTokens(),
41
- getOldTokens(),
42
- ]);
43
-
44
- const diffResult = detailedDiff(oldTokens, newTokens);
45
-
46
- calculatePossibleRenames(diffResult, oldTokens, newTokens);
47
-
48
- logResultCategory(diffResult, "added");
49
- logResultCategory(diffResult, "deleted");
50
- logResultCategory(diffResult, "updated", "Token values updated");
51
- logResultCategory(diffResult, "possiblyRenamed", "Tokens possibly renamed");
52
- }
53
-
54
- async function getNewTokens() {
55
- try {
56
- await access(localTokenPath);
57
- return JSON.parse(
58
- convertNumberStringsToNumbers(
59
- await readFile(localTokenPath, { encoding: "utf8" }),
60
- ),
61
- );
62
- } catch {
63
- console.error("cannot access");
64
- }
65
- }
66
-
67
- async function getOldTokens() {
68
- const tmpDir = await tmp.dir();
69
- const { stdout, stderr } = await execP(
70
- `npm pack @adobe/spectrum-tokens@${tag} --pack-destination ${tmpDir.path}`,
71
- );
72
- await x({
73
- cwd: tmpDir.path,
74
- file: join(tmpDir.path, stdout.trim()),
75
- });
76
- const oldTokenPath = join(tmpDir.path, "package", tokenPath);
77
- await access(oldTokenPath);
78
- console.log(`Comparing against ${stdout.trim()}`);
79
- return JSON.parse(
80
- convertNumberStringsToNumbers(
81
- await readFile(oldTokenPath, { encoding: "utf8" }),
82
- ),
83
- );
84
- }
85
-
86
- function calculatePossibleRenames(diffResult, oldTokens, newTokens) {
87
- diffResult.possiblyRenamed = {};
88
- Object.keys(diffResult.deleted).forEach((deletedTokenName) => {
89
- const oldTokenValue = oldTokens[deletedTokenName];
90
- const allValueMatches = [];
91
- Object.keys(diffResult.added).forEach((addedTokenName, i) => {
92
- const newTokenValue = newTokens[addedTokenName];
93
- if (Object.keys(diff(oldTokenValue, newTokenValue)).length === 0) {
94
- allValueMatches.push(addedTokenName);
95
- }
96
- });
97
- if (allValueMatches.length > 0) {
98
- diffResult.possiblyRenamed[deletedTokenName] = allValueMatches;
99
- }
100
- });
101
- }
102
-
103
- function convertNumberStringsToNumbers(dataString) {
104
- return dataString.replace(/"([\d]*\.?[\d]*)"/g, (match, p1) => {
105
- return p1;
106
- });
107
- }
108
-
109
- function logResultCategory(diffResult, categoryKey, msg) {
110
- const results = diffResult[categoryKey];
111
- const resultCount = Object.keys(results).length;
112
- if (!msg) {
113
- msg = `Tokens ${categoryKey}`;
114
- }
115
- if (resultCount > 0) {
116
- console.log(`\n*${msg} (${resultCount}):*`);
117
- switch (categoryKey) {
118
- case "possiblyRenamed":
119
- Object.keys(results)
120
- .sort()
121
- .forEach((oldTokenName, i) => {
122
- if (
123
- Array.isArray(results[oldTokenName]) &&
124
- results[oldTokenName].length > 1
125
- ) {
126
- console.log(
127
- ` - Old name: \`${oldTokenName}\`, new name options:`,
128
- );
129
- results[oldTokenName].forEach((newTokenName) =>
130
- console.log(` - \`${newTokenName}\``),
131
- );
132
- } else {
133
- console.log(
134
- ` - \`${oldTokenName}\` -> \`${results[oldTokenName][0]}\``,
135
- );
136
- }
137
- });
138
- break;
139
- default:
140
- Object.keys(results)
141
- .sort()
142
- .forEach((tokenName, i) => console.log(` - \`${tokenName}\``));
143
- }
144
- }
145
- }