@adobe/spectrum-tokens 14.13.2 → 14.15.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 +185 -0
- package/naming-exceptions.json +294 -0
- package/package.json +1 -2
- package/snapshots/validation-snapshot.json +343 -0
- package/src/color-component.json +5 -5
- package/src/layout-component.json +62 -62
- package/src/layout.json +10 -9
- package/src/typography.json +16 -0
- package/test/checkComponentProps.js +24 -4
package/src/typography.json
CHANGED
|
@@ -42,41 +42,49 @@
|
|
|
42
42
|
},
|
|
43
43
|
"body-cjk-size-l": {
|
|
44
44
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/alias.json",
|
|
45
|
+
"component": "body",
|
|
45
46
|
"value": "{font-size-200}",
|
|
46
47
|
"uuid": "9f0e0ddb-a4d2-416e-a425-8d71527f77b2"
|
|
47
48
|
},
|
|
48
49
|
"body-cjk-size-m": {
|
|
49
50
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/alias.json",
|
|
51
|
+
"component": "body",
|
|
50
52
|
"value": "{font-size-100}",
|
|
51
53
|
"uuid": "7e01bc65-5823-456f-a830-9848a96ad85a"
|
|
52
54
|
},
|
|
53
55
|
"body-cjk-size-s": {
|
|
54
56
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/alias.json",
|
|
57
|
+
"component": "body",
|
|
55
58
|
"value": "{font-size-75}",
|
|
56
59
|
"uuid": "081aa502-e2f1-4bc8-8fb2-a00dcd4236dd"
|
|
57
60
|
},
|
|
58
61
|
"body-cjk-size-xl": {
|
|
59
62
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/alias.json",
|
|
63
|
+
"component": "body",
|
|
60
64
|
"value": "{font-size-300}",
|
|
61
65
|
"uuid": "25d65a6e-e8e1-4849-848a-984373fd9cf9"
|
|
62
66
|
},
|
|
63
67
|
"body-cjk-size-xs": {
|
|
64
68
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/alias.json",
|
|
69
|
+
"component": "body",
|
|
65
70
|
"value": "{font-size-50}",
|
|
66
71
|
"uuid": "ba73926d-2ef4-4d7b-86c2-9044aa1cdf95"
|
|
67
72
|
},
|
|
68
73
|
"body-cjk-size-xxl": {
|
|
69
74
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/alias.json",
|
|
75
|
+
"component": "body",
|
|
70
76
|
"value": "{font-size-400}",
|
|
71
77
|
"uuid": "9aab03eb-c0c1-462c-aa7c-88c93b06f714"
|
|
72
78
|
},
|
|
73
79
|
"body-cjk-size-xxs": {
|
|
74
80
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/alias.json",
|
|
81
|
+
"component": "body",
|
|
75
82
|
"value": "{font-size-25}",
|
|
76
83
|
"uuid": "218f04ed-0679-4090-b1ad-76ef062dd07c"
|
|
77
84
|
},
|
|
78
85
|
"body-cjk-size-xxxl": {
|
|
79
86
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/alias.json",
|
|
87
|
+
"component": "body",
|
|
80
88
|
"value": "{font-size-500}",
|
|
81
89
|
"uuid": "71a41f9e-73da-4632-8877-7af7acf4db03"
|
|
82
90
|
},
|
|
@@ -268,6 +276,7 @@
|
|
|
268
276
|
},
|
|
269
277
|
"body-size-xxs": {
|
|
270
278
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/alias.json",
|
|
279
|
+
"component": "body",
|
|
271
280
|
"value": "{font-size-50}",
|
|
272
281
|
"uuid": "3aa79ac7-9e78-4413-b500-b8d1937705cb"
|
|
273
282
|
},
|
|
@@ -1393,6 +1402,7 @@
|
|
|
1393
1402
|
},
|
|
1394
1403
|
"heading-cjk-font-weight": {
|
|
1395
1404
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/alias.json",
|
|
1405
|
+
"component": "heading",
|
|
1396
1406
|
"value": "{extra-bold-font-weight}",
|
|
1397
1407
|
"uuid": "bd54516c-2fda-4421-ab62-720c3a887a34"
|
|
1398
1408
|
},
|
|
@@ -1557,6 +1567,7 @@
|
|
|
1557
1567
|
},
|
|
1558
1568
|
"heading-cjk-size-xxxxl": {
|
|
1559
1569
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/alias.json",
|
|
1570
|
+
"component": "heading",
|
|
1560
1571
|
"value": "{font-size-1400}",
|
|
1561
1572
|
"uuid": "3b954e15-341a-40f4-a47e-9abd2813fec4"
|
|
1562
1573
|
},
|
|
@@ -1616,6 +1627,7 @@
|
|
|
1616
1627
|
},
|
|
1617
1628
|
"heading-sans-serif-emphasized-font-weight": {
|
|
1618
1629
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/alias.json",
|
|
1630
|
+
"component": "heading",
|
|
1619
1631
|
"value": "{extra-bold-font-weight}",
|
|
1620
1632
|
"uuid": "e4a183fd-53c5-4dbb-afd1-6308e2e74f80"
|
|
1621
1633
|
},
|
|
@@ -1633,6 +1645,7 @@
|
|
|
1633
1645
|
},
|
|
1634
1646
|
"heading-sans-serif-font-weight": {
|
|
1635
1647
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/alias.json",
|
|
1648
|
+
"component": "heading",
|
|
1636
1649
|
"value": "{extra-bold-font-weight}",
|
|
1637
1650
|
"uuid": "1d4d09b4-021a-48e8-a724-bfecc13df325"
|
|
1638
1651
|
},
|
|
@@ -1772,6 +1785,7 @@
|
|
|
1772
1785
|
},
|
|
1773
1786
|
"heading-serif-emphasized-font-weight": {
|
|
1774
1787
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/alias.json",
|
|
1788
|
+
"component": "heading",
|
|
1775
1789
|
"value": "{bold-font-weight}",
|
|
1776
1790
|
"uuid": "a0983216-b0c5-4a3f-97dc-96ee711acb1f"
|
|
1777
1791
|
},
|
|
@@ -1789,6 +1803,7 @@
|
|
|
1789
1803
|
},
|
|
1790
1804
|
"heading-serif-font-weight": {
|
|
1791
1805
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/alias.json",
|
|
1806
|
+
"component": "heading",
|
|
1792
1807
|
"value": "{bold-font-weight}",
|
|
1793
1808
|
"uuid": "350aa193-9996-49c8-b5e4-54d4f7bef3c2"
|
|
1794
1809
|
},
|
|
@@ -1971,6 +1986,7 @@
|
|
|
1971
1986
|
},
|
|
1972
1987
|
"heading-size-xxxxl": {
|
|
1973
1988
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/alias.json",
|
|
1989
|
+
"component": "heading",
|
|
1974
1990
|
"value": "{font-size-1500}",
|
|
1975
1991
|
"uuid": "517d86cc-2e66-4cdc-8841-cb32db9e56f4"
|
|
1976
1992
|
},
|
|
@@ -10,9 +10,30 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import { readFileSync } from "node:fs";
|
|
13
14
|
import test from "ava";
|
|
14
15
|
import { getFileTokens } from "../index.js";
|
|
15
16
|
|
|
17
|
+
// Anatomy sub-part tokens (e.g. tab-item-*) keep their legacy key (the
|
|
18
|
+
// sub-part name) but carry their real parent component (e.g. "tabs"), so the
|
|
19
|
+
// key no longer starts with the component value. The cascade source of
|
|
20
|
+
// truth (packages/design-data/tokens/*.tokens.json) declares this explicitly
|
|
21
|
+
// via a pinned `legacyKey` alongside `anatomy`; read that exact set instead
|
|
22
|
+
// of loosely matching any anatomy-registry id prefix, since many ids (icon,
|
|
23
|
+
// label, field, item, ...) also legitimately prefix unrelated component keys.
|
|
24
|
+
const cascadeDecomposedKeys = new Set(
|
|
25
|
+
["color-component.tokens.json", "layout-component.tokens.json"].flatMap(
|
|
26
|
+
(file) =>
|
|
27
|
+
JSON.parse(
|
|
28
|
+
readFileSync(
|
|
29
|
+
new URL(`../../design-data/tokens/${file}`, import.meta.url),
|
|
30
|
+
),
|
|
31
|
+
)
|
|
32
|
+
.filter((t) => t.name?.anatomy && t.name?.legacyKey)
|
|
33
|
+
.map((t) => t.name.legacyKey),
|
|
34
|
+
),
|
|
35
|
+
);
|
|
36
|
+
|
|
16
37
|
test("ensure all component tokens are have component data", async (t) => {
|
|
17
38
|
const tokenData = {
|
|
18
39
|
...(await getFileTokens("color-component.json")),
|
|
@@ -20,10 +41,9 @@ test("ensure all component tokens are have component data", async (t) => {
|
|
|
20
41
|
...(await getFileTokens("icons.json")),
|
|
21
42
|
};
|
|
22
43
|
const result = Object.keys(tokenData).filter((tokenName) => {
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
);
|
|
44
|
+
if (cascadeDecomposedKeys.has(tokenName)) return false;
|
|
45
|
+
const { component } = tokenData[tokenName];
|
|
46
|
+
return !component || tokenName.indexOf(component) != 0;
|
|
27
47
|
});
|
|
28
48
|
t.deepEqual(result, []);
|
|
29
49
|
});
|