@adobe/design-data-spec 0.12.0 → 0.13.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.
@@ -0,0 +1,20 @@
1
+ {
2
+ "tokens": [],
3
+ "components": [
4
+ {
5
+ "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/components/widget.json",
6
+ "name": "widget",
7
+ "displayName": "Widget",
8
+ "meta": {
9
+ "category": "feedback",
10
+ "documentationUrl": "https://spectrum.adobe.com/page/widget/"
11
+ },
12
+ "anatomy": [
13
+ {
14
+ "name": "not-a-real-part",
15
+ "description": "A custom part not in the anatomy-terms registry."
16
+ }
17
+ ]
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "layer": 2,
3
+ "errors": [
4
+ {
5
+ "rule_id": "SPEC-035",
6
+ "severity": "warning",
7
+ "message_pattern": ".*not in the design-system-registry anatomy-terms vocabulary.*"
8
+ }
9
+ ]
10
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "tokens": [],
3
+ "components": [
4
+ {
5
+ "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/components/dialog.json",
6
+ "name": "dialog",
7
+ "displayName": "Dialog",
8
+ "meta": {
9
+ "category": "feedback",
10
+ "documentationUrl": "https://spectrum.adobe.com/page/dialog/"
11
+ },
12
+ "anatomy": [
13
+ {
14
+ "name": "header",
15
+ "description": "Top section of the dialog containing the title.",
16
+ "required": true
17
+ },
18
+ {
19
+ "name": "body",
20
+ "description": "Main content area of the dialog.",
21
+ "required": true
22
+ },
23
+ {
24
+ "name": "label",
25
+ "description": "Dialog title text.",
26
+ "required": true
27
+ }
28
+ ]
29
+ }
30
+ ]
31
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/design-data-spec",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Design Data Specification — prose, JSON Schemas, rule catalog, and conformance fixtures for Spectrum design data",
5
5
  "type": "module",
6
6
  "repository": {
package/rules/rules.yaml CHANGED
@@ -332,3 +332,14 @@ rules:
332
332
  message: "Component '{entity}' meta.category value '{value}' is not in the design-system-registry categories vocabulary"
333
333
  spec_ref: spec/registry.md#categories
334
334
  introduced_in: "1.0.0-draft"
335
+ - id: SPEC-035
336
+ name: anatomy-part-name-registry-sync
337
+ severity: warning
338
+ category: naming-consistency
339
+ assert: >
340
+ A component anatomy part's name SHOULD reference an id from the anatomy-terms registry in
341
+ @adobe/design-system-registry (anatomy-terms.json). Unknown values are reported as
342
+ warnings; custom names remain permitted but the registry is the authoritative vocabulary.
343
+ message: "Component '{entity}' anatomy part name '{value}' is not in the design-system-registry anatomy-terms vocabulary"
344
+ spec_ref: spec/anatomy-format.md#canonical-anatomy-vocabulary
345
+ introduced_in: "1.0.0-draft"
@@ -86,6 +86,8 @@ The following anatomy part names are defined by the cross-platform design audit
86
86
 
87
87
  Custom part names are permitted. When a custom name is used, the anatomy part object **SHOULD** include a `description` field explaining its visual role (rule SPEC-023).
88
88
 
89
+ The table above is informative; the authoritative vocabulary is `@adobe/design-system-registry/registry/anatomy-terms.json` (119 entries). SPEC-035 fires advisory warnings when a declared anatomy part `name` is not in that registry, pointing authors at the canonical list. Custom names remain valid — SPEC-035 is advisory, not an error.
90
+
89
91
  ## Cross-reference with token name objects
90
92
 
91
93
  Token name objects use an `anatomy` field to scope a token to a specific visible part of a component. The `anatomy` field value must correspond to a part declared in the component's `anatomy` array.
@@ -112,12 +114,13 @@ See [Token format — Name object](token-format.md#name-object) for the full nam
112
114
 
113
115
  The following rules in the Layer 2 rule catalog (`rules/rules.yaml`) apply to anatomy part declarations. SPEC-020 was introduced in Phase 6.1 (component-format); SPEC-023, SPEC-024, and SPEC-025 are introduced by this chapter.
114
116
 
115
- | Rule ID | Name | Severity | Assert |
116
- | -------- | -------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
117
- | SPEC-020 | `component-anatomy-valid` | error | Token `anatomy` field value **MUST** match the `name` of a declared anatomy part on the referenced component. |
118
- | SPEC-023 | `anatomy-custom-part-documented` | warning | Anatomy part declarations with a `name` outside the canonical anatomy vocabulary **SHOULD** include a `description` field documenting the part's purpose. |
119
- | SPEC-024 | `anatomy-part-name-unique` | error | Anatomy part `name` values **MUST** be unique within a single component's `anatomy` array. |
120
- | SPEC-025 | `anatomy-requires-component` | error | A token name object **MUST NOT** include an `anatomy` field unless a `component` field is also present. |
117
+ | Rule ID | Name | Severity | Assert |
118
+ | -------- | --------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
119
+ | SPEC-020 | `component-anatomy-valid` | error | Token `anatomy` field value **MUST** match the `name` of a declared anatomy part on the referenced component. |
120
+ | SPEC-023 | `anatomy-custom-part-documented` | warning | Anatomy part declarations with a `name` outside the canonical anatomy vocabulary **SHOULD** include a `description` field documenting the part's purpose. |
121
+ | SPEC-024 | `anatomy-part-name-unique` | error | Anatomy part `name` values **MUST** be unique within a single component's `anatomy` array. |
122
+ | SPEC-025 | `anatomy-requires-component` | error | A token name object **MUST NOT** include an `anatomy` field unless a `component` field is also present. |
123
+ | SPEC-035 | `anatomy-part-name-registry-sync` | warning | A component anatomy part's `name` **SHOULD** appear in the canonical anatomy-terms registry (`anatomy-terms.json`). |
121
124
 
122
125
  ## Full example
123
126
 
package/spec/registry.md CHANGED
@@ -33,7 +33,7 @@ Anatomy terms fall into three tiers:
33
33
  | Component-specific | Unique to one component | `loupe`, `gripper`, `hold-icon` |
34
34
 
35
35
  **File:** `packages/design-system-registry/registry/anatomy-terms.json`\
36
- **Validated by:** SPEC-020, SPEC-023, SPEC-024, SPEC-025\
36
+ **Validated by:** SPEC-020, SPEC-023, SPEC-024, SPEC-025, SPEC-035 (advisory — anatomy part `name` values SHOULD match the anatomy-terms registry)\
37
37
  **See also:** [Taxonomy — Component anatomy vs. token objects](taxonomy.md#component-anatomy-vs-token-objects), [Anatomy format](anatomy-format.md)
38
38
 
39
39
  ### Token objects (`token-objects.json`)