@adobe/spectrum-design-data 0.0.1
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/README.md +75 -0
- package/package.json +27 -0
- package/tokens/color-aliases.tokens.json +4124 -0
- package/tokens/color-component.tokens.json +961 -0
- package/tokens/color-palette.tokens.json +13417 -0
- package/tokens/icons.tokens.json +2367 -0
- package/tokens/layout-component.tokens.json +20162 -0
- package/tokens/layout.tokens.json +5906 -0
- package/tokens/semantic-color-palette.tokens.json +902 -0
- package/tokens/typography.tokens.json +3369 -0
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# [**@adobe/spectrum-design-data**](https://github.com/adobe/spectrum-design-data)
|
|
2
|
+
|
|
3
|
+
Spectrum design tokens in **cascade format** — the canonical source of truth
|
|
4
|
+
for [`@adobe/spectrum-tokens`](../tokens).
|
|
5
|
+
|
|
6
|
+
## What is the cascade format?
|
|
7
|
+
|
|
8
|
+
Each `.tokens.json` file in `tokens/` is a JSON array of spec-compliant token
|
|
9
|
+
objects. Each token carries a structured `name` object with taxonomy fields
|
|
10
|
+
(`component`, `property`, `state`, `colorFamily`, `scaleIndex`, etc.) instead
|
|
11
|
+
of a flat kebab-case string. The format is defined in
|
|
12
|
+
[`packages/design-data-spec`](../design-data-spec).
|
|
13
|
+
|
|
14
|
+
```jsonc
|
|
15
|
+
// tokens/color-palette.tokens.json (excerpt)
|
|
16
|
+
[
|
|
17
|
+
{
|
|
18
|
+
"name": { "property": "color", "colorFamily": "blue", "scaleIndex": 100 },
|
|
19
|
+
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/token-types/color.json",
|
|
20
|
+
"value": "#E9F4FF",
|
|
21
|
+
"uuid": "…"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Relationship to `@adobe/spectrum-tokens`
|
|
27
|
+
|
|
28
|
+
`packages/tokens/src/` (the legacy flat-object format consumed by Style
|
|
29
|
+
Dictionary and downstream tooling) is **generated** from this package. Do not
|
|
30
|
+
edit `packages/tokens/src/` directly — changes will be overwritten.
|
|
31
|
+
|
|
32
|
+
To regenerate the legacy package after editing tokens here:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
moon run design-data:legacy-output
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Token corpus
|
|
39
|
+
|
|
40
|
+
8 files, 4 166 cascade tokens (from 2 460 legacy entries):
|
|
41
|
+
|
|
42
|
+
| File | Description |
|
|
43
|
+
| ----------------------------- | ----------------------------------- |
|
|
44
|
+
| `color-palette.json` | Global color scale (blues, reds, …) |
|
|
45
|
+
| `color-component.json` | Component-scoped color tokens |
|
|
46
|
+
| `color-aliases.json` | Semantic color aliases |
|
|
47
|
+
| `semantic-color-palette.json` | Semantic/contextual palette |
|
|
48
|
+
| `typography.json` | Font sizes, weights, families |
|
|
49
|
+
| `layout.json` | Global spacing and sizing |
|
|
50
|
+
| `layout-component.json` | Component-scoped layout tokens |
|
|
51
|
+
| `icons.json` | Icon sizing tokens |
|
|
52
|
+
|
|
53
|
+
## Name-object quality
|
|
54
|
+
|
|
55
|
+
95% of tokens carry structured name objects:
|
|
56
|
+
|
|
57
|
+
* **23%** enriched from sidecar name metadata (`colorFamily`, `scaleIndex`, `variant`, …)
|
|
58
|
+
* **71%** decomposed from the legacy key (`component` + `property` + `state`)
|
|
59
|
+
* **6%** thin (full legacy key stored in `property`) — tracked as SPEC-017 tech debt
|
|
60
|
+
|
|
61
|
+
## moon tasks
|
|
62
|
+
|
|
63
|
+
| Task | Command | Purpose |
|
|
64
|
+
| ------------------------ | --------------------------------------------- | ----------------------------------------------------- |
|
|
65
|
+
| `validate` | `moon run design-data:validate` | Validate cascade files against spec rules |
|
|
66
|
+
| `legacy-output` | `moon run design-data:legacy-output` | Regenerate `packages/tokens/src/` |
|
|
67
|
+
| `roundtrip-verify` | `moon run design-data:roundtrip-verify` | CI guard: fail if cascade and legacy diverge |
|
|
68
|
+
| `regenerate-from-legacy` | `moon run design-data:regenerate-from-legacy` | Re-sync cascade from legacy (one-time / escape hatch) |
|
|
69
|
+
|
|
70
|
+
## Consuming the cascade format
|
|
71
|
+
|
|
72
|
+
```js
|
|
73
|
+
import colorPalette from "@adobe/spectrum-design-data/tokens/color-palette";
|
|
74
|
+
// colorPalette is an array of cascade token objects
|
|
75
|
+
```
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@adobe/spectrum-design-data",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Spectrum design tokens in cascade format — the canonical source of truth for @adobe/spectrum-tokens",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/adobe/spectrum-design-data.git"
|
|
9
|
+
},
|
|
10
|
+
"author": "Garth Braithwaite <garthdb@gmail.com> (http://garthdb.com/)",
|
|
11
|
+
"license": "Apache-2.0",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/adobe/spectrum-design-data/issues"
|
|
14
|
+
},
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"provenance": true
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/adobe/spectrum-design-data/tree/main/packages/design-data#readme",
|
|
19
|
+
"exports": {
|
|
20
|
+
"./tokens/*": "./tokens/*.tokens.json"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"tokens/",
|
|
24
|
+
"README.md"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {}
|
|
27
|
+
}
|