@adobe/design-system-registry 3.0.0 → 3.1.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 +18 -0
- package/index.js +4 -0
- package/package.json +2 -2
- package/registry/property-terms.json +177 -0
- package/test/registry.test.js +34 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @adobe/design-system-registry
|
|
2
2
|
|
|
3
|
+
## 3.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#955](https://github.com/adobe/spectrum-design-data/pull/955) [`e05c3ef`](https://github.com/adobe/spectrum-design-data/commit/e05c3eff28caecbdb9782eb62023876e0d1f4947) Thanks [@GarthDB](https://github.com/GarthDB)! - feat(spec): property field migration path + property-terms registry (#941)
|
|
8
|
+
|
|
9
|
+
Adds normative migration policy for the `name.property` field per RFC #806:
|
|
10
|
+
- New `### Name-object migration policy` section in `spec/token-format.md` —
|
|
11
|
+
documents SPEC-017 severity escalation to `error` at spec `2.0.0`, narrowed
|
|
12
|
+
`property` semantics (CSS/styling attribute only), and author migration steps.
|
|
13
|
+
- New `property-terms.json` registry — 35 seeded CSS/styling attribute terms
|
|
14
|
+
(`color`, `background-color`, `border-radius`, `font-size`, `gap`, etc.).
|
|
15
|
+
- Updated `fields/property.json` — sets `registry` path to `property-terms.json`;
|
|
16
|
+
exports `propertyTerms` from registry index.
|
|
17
|
+
- Updated `spec/taxonomy.md` Property row — links to migration section and
|
|
18
|
+
calls out anatomy/surface values as migration debt.
|
|
19
|
+
- Closed RFC #806 open question in `docs/rfc-coordination.md`.
|
|
20
|
+
|
|
3
21
|
## 3.0.0
|
|
4
22
|
|
|
5
23
|
### Major Changes
|
package/index.js
CHANGED
|
@@ -34,6 +34,10 @@ export const anatomyTerms = JSON.parse(
|
|
|
34
34
|
readFileSync(join(__dirname, "registry", "anatomy-terms.json"), "utf-8"),
|
|
35
35
|
);
|
|
36
36
|
|
|
37
|
+
export const propertyTerms = JSON.parse(
|
|
38
|
+
readFileSync(join(__dirname, "registry", "property-terms.json"), "utf-8"),
|
|
39
|
+
);
|
|
40
|
+
|
|
37
41
|
export const components = JSON.parse(
|
|
38
42
|
readFileSync(join(__dirname, "registry", "components.json"), "utf-8"),
|
|
39
43
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/design-system-registry",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "A single source of truth for design system terminology used across Spectrum tokens, component schemas, and anatomy",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"ajv": "^8.17.1",
|
|
45
45
|
"ajv-formats": "^3.0.1",
|
|
46
46
|
"ava": "^6.0.1",
|
|
47
|
-
"@adobe/spectrum-component-api-schemas": "6.1.
|
|
47
|
+
"@adobe/spectrum-component-api-schemas": "6.1.14"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"validate": "node scripts/validate-registry.js",
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/registry-value.json",
|
|
3
|
+
"type": "property-term",
|
|
4
|
+
"description": "CSS/styling attributes or design-system abstractions thereof, assigned to token name objects via the `property` field. Not all entries are valid CSS property identifiers — some (e.g. padding-horizontal, overlay-color, size) are design-system-level abstractions. Not anatomy parts (which belong in anatomy-terms.json) and not styling surfaces (which belong in token-objects.json). Examples: color, width, padding, font-size.",
|
|
5
|
+
"values": [
|
|
6
|
+
{
|
|
7
|
+
"id": "color",
|
|
8
|
+
"label": "Color",
|
|
9
|
+
"description": "Text or foreground color"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": "background-color",
|
|
13
|
+
"label": "Background Color",
|
|
14
|
+
"description": "Background fill color"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "border-color",
|
|
18
|
+
"label": "Border Color",
|
|
19
|
+
"description": "Border or outline color"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "fill-color",
|
|
23
|
+
"label": "Fill Color",
|
|
24
|
+
"description": "SVG or icon fill color"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "shadow-color",
|
|
28
|
+
"label": "Shadow Color",
|
|
29
|
+
"description": "Drop shadow color component"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "overlay-color",
|
|
33
|
+
"label": "Overlay Color",
|
|
34
|
+
"description": "Overlay or scrim tint color"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "outline-color",
|
|
38
|
+
"label": "Outline Color",
|
|
39
|
+
"description": "CSS outline color"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"id": "opacity",
|
|
43
|
+
"label": "Opacity",
|
|
44
|
+
"description": "Element transparency level"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": "border-opacity",
|
|
48
|
+
"label": "Border Opacity",
|
|
49
|
+
"description": "Border transparency level"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "overlay-opacity",
|
|
53
|
+
"label": "Overlay Opacity",
|
|
54
|
+
"description": "Overlay or scrim transparency level"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"id": "width",
|
|
58
|
+
"label": "Width",
|
|
59
|
+
"description": "Element width"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"id": "height",
|
|
63
|
+
"label": "Height",
|
|
64
|
+
"description": "Element height"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"id": "min-width",
|
|
68
|
+
"label": "Min Width",
|
|
69
|
+
"description": "Minimum element width"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"id": "max-width",
|
|
73
|
+
"label": "Max Width",
|
|
74
|
+
"description": "Maximum element width"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": "min-height",
|
|
78
|
+
"label": "Min Height",
|
|
79
|
+
"description": "Minimum element height"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"id": "max-height",
|
|
83
|
+
"label": "Max Height",
|
|
84
|
+
"description": "Maximum element height"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"id": "size",
|
|
88
|
+
"label": "Size",
|
|
89
|
+
"description": "General dimension size (non-directional)"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": "padding",
|
|
93
|
+
"label": "Padding",
|
|
94
|
+
"description": "Internal spacing on all sides"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"id": "padding-horizontal",
|
|
98
|
+
"label": "Horizontal Padding",
|
|
99
|
+
"description": "Internal horizontal (left/right) spacing"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"id": "padding-vertical",
|
|
103
|
+
"label": "Vertical Padding",
|
|
104
|
+
"description": "Internal vertical (top/bottom) spacing"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"id": "gap",
|
|
108
|
+
"label": "Gap",
|
|
109
|
+
"description": "Space between flex or grid children"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"id": "spacing",
|
|
113
|
+
"label": "Spacing",
|
|
114
|
+
"description": "General spacing between elements"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"id": "border-width",
|
|
118
|
+
"label": "Border Width",
|
|
119
|
+
"description": "Border or stroke thickness"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"id": "border-radius",
|
|
123
|
+
"label": "Border Radius",
|
|
124
|
+
"description": "Corner rounding radius"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"id": "outline-width",
|
|
128
|
+
"label": "Outline Width",
|
|
129
|
+
"description": "CSS outline thickness"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"id": "blur",
|
|
133
|
+
"label": "Blur",
|
|
134
|
+
"description": "Blur radius (backdrop or drop shadow)"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"id": "shadow",
|
|
138
|
+
"label": "Shadow",
|
|
139
|
+
"description": "Full box or drop shadow definition"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"id": "font-size",
|
|
143
|
+
"label": "Font Size",
|
|
144
|
+
"description": "Typeface size"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"id": "font-weight",
|
|
148
|
+
"label": "Font Weight",
|
|
149
|
+
"description": "Typeface weight (boldness)"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"id": "font-family",
|
|
153
|
+
"label": "Font Family",
|
|
154
|
+
"description": "Typeface family name"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"id": "line-height",
|
|
158
|
+
"label": "Line Height",
|
|
159
|
+
"description": "Vertical spacing between lines of text"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"id": "letter-spacing",
|
|
163
|
+
"label": "Letter Spacing",
|
|
164
|
+
"description": "Horizontal spacing between characters"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"id": "duration",
|
|
168
|
+
"label": "Duration",
|
|
169
|
+
"description": "Animation or transition duration"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"id": "easing",
|
|
173
|
+
"label": "Easing",
|
|
174
|
+
"description": "Animation or transition easing function"
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
}
|
package/test/registry.test.js
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
states,
|
|
17
17
|
variants,
|
|
18
18
|
anatomyTerms,
|
|
19
|
+
propertyTerms,
|
|
19
20
|
components,
|
|
20
21
|
scaleValues,
|
|
21
22
|
categories,
|
|
@@ -63,6 +64,13 @@ test("anatomyTerms registry loads successfully", (t) => {
|
|
|
63
64
|
t.true(anatomyTerms.values.length > 0);
|
|
64
65
|
});
|
|
65
66
|
|
|
67
|
+
test("propertyTerms registry loads successfully", (t) => {
|
|
68
|
+
t.truthy(propertyTerms);
|
|
69
|
+
t.truthy(propertyTerms.values);
|
|
70
|
+
t.true(Array.isArray(propertyTerms.values));
|
|
71
|
+
t.true(propertyTerms.values.length > 0);
|
|
72
|
+
});
|
|
73
|
+
|
|
66
74
|
test("components registry loads successfully", (t) => {
|
|
67
75
|
t.truthy(components);
|
|
68
76
|
t.truthy(components.values);
|
|
@@ -121,6 +129,11 @@ test("anatomyTerms registry has no duplicate IDs", (t) => {
|
|
|
121
129
|
t.is(ids.length, new Set(ids).size);
|
|
122
130
|
});
|
|
123
131
|
|
|
132
|
+
test("propertyTerms registry has no duplicate IDs", (t) => {
|
|
133
|
+
const ids = propertyTerms.values.map((v) => v.id);
|
|
134
|
+
t.is(ids.length, new Set(ids).size);
|
|
135
|
+
});
|
|
136
|
+
|
|
124
137
|
// Test for duplicate aliases
|
|
125
138
|
test("sizes registry has no duplicate aliases", (t) => {
|
|
126
139
|
const aliases = sizes.values.flatMap((v) => v.aliases || []);
|
|
@@ -276,6 +289,27 @@ test("anatomyTerms does not include styling surfaces", (t) => {
|
|
|
276
289
|
t.false(ids.includes("visual"));
|
|
277
290
|
});
|
|
278
291
|
|
|
292
|
+
test("propertyTerms includes core CSS styling attributes", (t) => {
|
|
293
|
+
const ids = getValues(propertyTerms);
|
|
294
|
+
t.true(ids.includes("color"));
|
|
295
|
+
t.true(ids.includes("background-color"));
|
|
296
|
+
t.true(ids.includes("border-color"));
|
|
297
|
+
t.true(ids.includes("opacity"));
|
|
298
|
+
t.true(ids.includes("width"));
|
|
299
|
+
t.true(ids.includes("height"));
|
|
300
|
+
t.true(ids.includes("font-size"));
|
|
301
|
+
t.true(ids.includes("gap"));
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
test("propertyTerms does not include anatomy parts or styling surfaces", (t) => {
|
|
305
|
+
const ids = getValues(propertyTerms);
|
|
306
|
+
t.false(ids.includes("background"));
|
|
307
|
+
t.false(ids.includes("border"));
|
|
308
|
+
t.false(ids.includes("icon"));
|
|
309
|
+
t.false(ids.includes("label"));
|
|
310
|
+
t.false(ids.includes("handle"));
|
|
311
|
+
});
|
|
312
|
+
|
|
279
313
|
test("tokenObjects includes styling surfaces", (t) => {
|
|
280
314
|
const ids = getValues(tokenObjects);
|
|
281
315
|
t.true(ids.includes("background"));
|