@adobe/design-data-spec 0.0.1 → 0.1.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.
Files changed (128) hide show
  1. package/LICENSE +201 -0
  2. package/conformance/README.md +83 -10
  3. package/conformance/diff/cross-format/expected.json +27 -0
  4. package/conformance/diff/cross-format/new/tokens.tokens.json +8 -0
  5. package/conformance/diff/cross-format/old/tokens.json +7 -0
  6. package/conformance/diff/deprecated-new-token/expected.json +13 -0
  7. package/conformance/diff/deprecated-new-token/new/tokens.tokens.json +8 -0
  8. package/conformance/diff/deprecated-new-token/old/tokens.tokens.json +1 -0
  9. package/conformance/diff/deprecated-set-level/expected.json +13 -0
  10. package/conformance/diff/deprecated-set-level/new/tokens.tokens.json +10 -0
  11. package/conformance/diff/deprecated-set-level/old/tokens.tokens.json +1 -0
  12. package/conformance/diff/identical-tokens/expected.json +8 -0
  13. package/conformance/diff/identical-tokens/new/tokens.tokens.json +12 -0
  14. package/conformance/diff/identical-tokens/old/tokens.tokens.json +12 -0
  15. package/conformance/diff/matched-gaining-deprecated/expected.json +20 -0
  16. package/conformance/diff/matched-gaining-deprecated/new/tokens.tokens.json +8 -0
  17. package/conformance/diff/matched-gaining-deprecated/old/tokens.tokens.json +7 -0
  18. package/conformance/diff/property-nested-change/expected.json +27 -0
  19. package/conformance/diff/property-nested-change/new/tokens.tokens.json +10 -0
  20. package/conformance/diff/property-nested-change/old/tokens.tokens.json +10 -0
  21. package/conformance/diff/property-value-update/expected.json +21 -0
  22. package/conformance/diff/property-value-update/new/tokens.tokens.json +7 -0
  23. package/conformance/diff/property-value-update/old/tokens.tokens.json +7 -0
  24. package/conformance/diff/rename-by-uuid/expected.json +22 -0
  25. package/conformance/diff/rename-by-uuid/new/tokens.tokens.json +7 -0
  26. package/conformance/diff/rename-by-uuid/old/tokens.tokens.json +7 -0
  27. package/conformance/diff/rename-with-property-changes/expected.json +28 -0
  28. package/conformance/diff/rename-with-property-changes/new/tokens.tokens.json +7 -0
  29. package/conformance/diff/rename-with-property-changes/old/tokens.tokens.json +7 -0
  30. package/conformance/diff/replaced-by-pairing/expected.json +43 -0
  31. package/conformance/diff/replaced-by-pairing/new/tokens.tokens.json +7 -0
  32. package/conformance/diff/replaced-by-pairing/old/tokens.tokens.json +10 -0
  33. package/conformance/diff/reverted-token/expected.json +13 -0
  34. package/conformance/diff/reverted-token/new/tokens.tokens.json +7 -0
  35. package/conformance/diff/reverted-token/old/tokens.tokens.json +8 -0
  36. package/conformance/diff/simple-add-delete/expected.json +18 -0
  37. package/conformance/diff/simple-add-delete/new/tokens.tokens.json +7 -0
  38. package/conformance/diff/simple-add-delete/old/tokens.tokens.json +7 -0
  39. package/conformance/diff/uuid-backfill/expected.json +20 -0
  40. package/conformance/diff/uuid-backfill/new/tokens.tokens.json +7 -0
  41. package/conformance/diff/uuid-backfill/old/tokens.tokens.json +6 -0
  42. package/conformance/invalid/SPEC-008/dimension.json +5 -0
  43. package/conformance/invalid/SPEC-008/expected-errors.json +10 -0
  44. package/conformance/invalid/SPEC-008/tokens.tokens.json +15 -0
  45. package/conformance/invalid/SPEC-010/expected-errors.json +10 -0
  46. package/conformance/invalid/SPEC-010/tokens.tokens.json +9 -0
  47. package/conformance/invalid/SPEC-011/expected-errors.json +10 -0
  48. package/conformance/invalid/SPEC-011/tokens.tokens.json +22 -0
  49. package/conformance/invalid/SPEC-012/expected-errors.json +10 -0
  50. package/conformance/invalid/SPEC-012/tokens.tokens.json +13 -0
  51. package/conformance/invalid/SPEC-013/expected-errors.json +10 -0
  52. package/conformance/invalid/SPEC-013/tokens.tokens.json +8 -0
  53. package/conformance/invalid/SPEC-014/expected-errors.json +10 -0
  54. package/conformance/invalid/SPEC-014/tokens.tokens.json +9 -0
  55. package/conformance/query/and-conditions/expected.json +1 -0
  56. package/conformance/query/and-conditions/input/tokens.tokens.json +17 -0
  57. package/conformance/query/and-conditions/query.txt +1 -0
  58. package/conformance/query/and-or-precedence/expected.json +1 -0
  59. package/conformance/query/and-or-precedence/input/tokens.tokens.json +22 -0
  60. package/conformance/query/and-or-precedence/query.txt +1 -0
  61. package/conformance/query/empty-matches-all/expected.json +1 -0
  62. package/conformance/query/empty-matches-all/input/tokens.tokens.json +17 -0
  63. package/conformance/query/empty-matches-all/query.txt +1 -0
  64. package/conformance/query/negation/expected.json +1 -0
  65. package/conformance/query/negation/input/tokens.tokens.json +17 -0
  66. package/conformance/query/negation/query.txt +1 -0
  67. package/conformance/query/no-matches/expected.json +1 -0
  68. package/conformance/query/no-matches/input/tokens.tokens.json +7 -0
  69. package/conformance/query/no-matches/query.txt +1 -0
  70. package/conformance/query/or-conditions/expected.json +1 -0
  71. package/conformance/query/or-conditions/input/tokens.tokens.json +17 -0
  72. package/conformance/query/or-conditions/query.txt +1 -0
  73. package/conformance/query/schema-key/expected.json +1 -0
  74. package/conformance/query/schema-key/input/tokens.tokens.json +14 -0
  75. package/conformance/query/schema-key/query.txt +1 -0
  76. package/conformance/query/single-field/expected.json +1 -0
  77. package/conformance/query/single-field/input/tokens.tokens.json +17 -0
  78. package/conformance/query/single-field/query.txt +1 -0
  79. package/conformance/query/wildcard-prefix/expected.json +1 -0
  80. package/conformance/query/wildcard-prefix/input/tokens.tokens.json +17 -0
  81. package/conformance/query/wildcard-prefix/query.txt +1 -0
  82. package/conformance/query/wildcard-suffix/expected.json +1 -0
  83. package/conformance/query/wildcard-suffix/input/tokens.tokens.json +17 -0
  84. package/conformance/query/wildcard-suffix/query.txt +1 -0
  85. package/conformance/resolution/alias-resolved-after-cascade/dimensions/color-scheme.json +5 -0
  86. package/conformance/resolution/alias-resolved-after-cascade/expected.json +5 -0
  87. package/conformance/resolution/alias-resolved-after-cascade/input/tokens.tokens.json +12 -0
  88. package/conformance/resolution/alias-resolved-after-cascade/query.json +4 -0
  89. package/conformance/resolution/base-fallback/dimensions/color-scheme.json +5 -0
  90. package/conformance/resolution/base-fallback/expected.json +5 -0
  91. package/conformance/resolution/base-fallback/input/tokens.tokens.json +7 -0
  92. package/conformance/resolution/base-fallback/query.json +4 -0
  93. package/conformance/resolution/specificity-wins/dimensions/color-scheme.json +5 -0
  94. package/conformance/resolution/specificity-wins/expected.json +5 -0
  95. package/conformance/resolution/specificity-wins/input/tokens.tokens.json +12 -0
  96. package/conformance/resolution/specificity-wins/query.json +4 -0
  97. package/conformance/valid/lifecycle-with-last-modified.json +12 -0
  98. package/fields/anatomy.json +15 -0
  99. package/fields/color-scheme.json +15 -0
  100. package/fields/component.json +15 -0
  101. package/fields/contrast.json +15 -0
  102. package/fields/density.json +15 -0
  103. package/fields/object.json +15 -0
  104. package/fields/orientation.json +15 -0
  105. package/fields/position.json +15 -0
  106. package/fields/property.json +15 -0
  107. package/fields/scale.json +15 -0
  108. package/fields/shape.json +15 -0
  109. package/fields/size.json +15 -0
  110. package/fields/state.json +15 -0
  111. package/fields/structure.json +15 -0
  112. package/fields/substructure.json +15 -0
  113. package/fields/variant.json +15 -0
  114. package/package.json +4 -3
  115. package/rules/rules.yaml +65 -2
  116. package/schemas/cascade-file.schema.json +10 -0
  117. package/schemas/field.schema.json +85 -0
  118. package/schemas/manifest.schema.json +55 -1
  119. package/schemas/token.schema.json +97 -18
  120. package/spec/cascade.md +18 -2
  121. package/spec/diff.md +97 -0
  122. package/spec/dimensions.md +15 -6
  123. package/spec/evolution.md +99 -0
  124. package/spec/index.md +11 -8
  125. package/spec/manifest.md +18 -1
  126. package/spec/query.md +135 -0
  127. package/spec/taxonomy.md +189 -0
  128. package/spec/token-format.md +118 -19
@@ -0,0 +1,7 @@
1
+ [
2
+ {
3
+ "name": { "property": "background-color-default" },
4
+ "value": "#ffffff",
5
+ "uuid": "aaaaaaaa-0001-4000-8000-000000000001"
6
+ }
7
+ ]
@@ -0,0 +1,4 @@
1
+ {
2
+ "property": "background-color-default",
3
+ "context": { "colorScheme": "dark" }
4
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "colorScheme",
3
+ "modes": ["light", "dark", "wireframe"],
4
+ "default": "light"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "description": "When both a base (dimensionless) and a non-default dimension variant exist, the higher-specificity variant MUST win.",
3
+ "resolved": true,
4
+ "expected_uuid": "bbbbbbbb-0002-4000-8000-000000000002"
5
+ }
@@ -0,0 +1,12 @@
1
+ [
2
+ {
3
+ "name": { "property": "background-color-default" },
4
+ "value": "#ffffff",
5
+ "uuid": "bbbbbbbb-0001-4000-8000-000000000001"
6
+ },
7
+ {
8
+ "name": { "property": "background-color-default", "colorScheme": "dark" },
9
+ "value": "#000000",
10
+ "uuid": "bbbbbbbb-0002-4000-8000-000000000002"
11
+ }
12
+ ]
@@ -0,0 +1,4 @@
1
+ {
2
+ "property": "background-color-default",
3
+ "context": { "colorScheme": "dark" }
4
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": {
3
+ "component": "button",
4
+ "object": "background",
5
+ "property": "color",
6
+ "variant": "primary"
7
+ },
8
+ "value": "#0265dc",
9
+ "uuid": "aaaaaaaa-0001-4000-8000-000000000001",
10
+ "introduced": "1.0.0",
11
+ "lastModified": "2.1.0"
12
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
3
+ "specVersion": "1.0.0-draft",
4
+ "name": "anatomy",
5
+ "description": "Visible named part of a component (e.g. handle, icon, label, track). Refers to a specific sub-element, not a styling surface.",
6
+ "kind": "semantic",
7
+ "registry": "packages/design-system-registry/registry/anatomy-terms.json",
8
+ "validation": "advisory",
9
+ "serialization": {
10
+ "position": 4
11
+ },
12
+ "scope": null,
13
+ "required": false,
14
+ "valueType": "string"
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
3
+ "specVersion": "1.0.0-draft",
4
+ "name": "colorScheme",
5
+ "description": "Theme / appearance dimension. Controls which color scheme a token applies to (e.g. light, dark, wireframe). Drives cascade resolution.",
6
+ "kind": "dimension",
7
+ "registry": null,
8
+ "validation": "strict",
9
+ "serialization": {
10
+ "position": 13
11
+ },
12
+ "scope": null,
13
+ "required": false,
14
+ "valueType": "string"
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
3
+ "specVersion": "1.0.0-draft",
4
+ "name": "component",
5
+ "description": "Component scope — the UI component this token belongs to (e.g. button, checkbox, slider).",
6
+ "kind": "semantic",
7
+ "registry": "packages/design-system-registry/registry/components.json",
8
+ "validation": "advisory",
9
+ "serialization": {
10
+ "position": 1
11
+ },
12
+ "scope": null,
13
+ "required": false,
14
+ "valueType": "string"
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
3
+ "specVersion": "1.0.0-draft",
4
+ "name": "contrast",
5
+ "description": "Contrast level dimension (e.g. regular, high). Drives cascade resolution.",
6
+ "kind": "dimension",
7
+ "registry": null,
8
+ "validation": "strict",
9
+ "serialization": {
10
+ "position": 15
11
+ },
12
+ "scope": null,
13
+ "required": false,
14
+ "valueType": "string"
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
3
+ "specVersion": "1.0.0-draft",
4
+ "name": "density",
5
+ "description": "Space density within or around component parts (e.g. spacious, compact). Distinct from the dimension scale field.",
6
+ "kind": "semantic",
7
+ "registry": "packages/design-system-registry/registry/densities.json",
8
+ "validation": "advisory",
9
+ "serialization": {
10
+ "position": 10
11
+ },
12
+ "scope": null,
13
+ "required": false,
14
+ "valueType": "string"
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
3
+ "specVersion": "1.0.0-draft",
4
+ "name": "object",
5
+ "description": "Styling surface being targeted (e.g. background, border, edge, visual). Refers to what is being styled, not the property value.",
6
+ "kind": "semantic",
7
+ "registry": "packages/design-system-registry/registry/token-objects.json",
8
+ "validation": "advisory",
9
+ "serialization": {
10
+ "position": 5
11
+ },
12
+ "scope": null,
13
+ "required": false,
14
+ "valueType": "string"
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
3
+ "specVersion": "1.0.0-draft",
4
+ "name": "orientation",
5
+ "description": "Direction or layout axis (e.g. vertical, horizontal).",
6
+ "kind": "semantic",
7
+ "registry": "packages/design-system-registry/registry/orientations.json",
8
+ "validation": "advisory",
9
+ "serialization": {
10
+ "position": 7
11
+ },
12
+ "scope": null,
13
+ "required": false,
14
+ "valueType": "string"
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
3
+ "specVersion": "1.0.0-draft",
4
+ "name": "position",
5
+ "description": "Location relative to another object or edge (e.g. top, bottom, start, end, affixed).",
6
+ "kind": "semantic",
7
+ "registry": "packages/design-system-registry/registry/positions.json",
8
+ "validation": "advisory",
9
+ "serialization": {
10
+ "position": 8
11
+ },
12
+ "scope": null,
13
+ "required": false,
14
+ "valueType": "string"
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
3
+ "specVersion": "1.0.0-draft",
4
+ "name": "property",
5
+ "description": "The stylistic attribute being defined (e.g. color, width, padding, gap). The only required field on every name object.",
6
+ "kind": "semantic",
7
+ "registry": null,
8
+ "validation": "advisory",
9
+ "serialization": {
10
+ "position": 6
11
+ },
12
+ "scope": null,
13
+ "required": true,
14
+ "valueType": "string"
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
3
+ "specVersion": "1.0.0-draft",
4
+ "name": "scale",
5
+ "description": "Platform density scale dimension (e.g. desktop, mobile). Drives cascade resolution.",
6
+ "kind": "dimension",
7
+ "registry": null,
8
+ "validation": "strict",
9
+ "serialization": {
10
+ "position": 14
11
+ },
12
+ "scope": null,
13
+ "required": false,
14
+ "valueType": "string"
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
3
+ "specVersion": "1.0.0-draft",
4
+ "name": "shape",
5
+ "description": "Overall component shape qualifier (e.g. uniform, rounded).",
6
+ "kind": "semantic",
7
+ "registry": "packages/design-system-registry/registry/shapes.json",
8
+ "validation": "advisory",
9
+ "serialization": {
10
+ "position": 11
11
+ },
12
+ "scope": null,
13
+ "required": false,
14
+ "valueType": "string"
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
3
+ "specVersion": "1.0.0-draft",
4
+ "name": "size",
5
+ "description": "Relative t-shirt sizing of a component or token (e.g. small, medium, large, extra-large). Distinct from dimension scale.",
6
+ "kind": "semantic",
7
+ "registry": "packages/design-system-registry/registry/sizes.json",
8
+ "validation": "advisory",
9
+ "serialization": {
10
+ "position": 9
11
+ },
12
+ "scope": null,
13
+ "required": false,
14
+ "valueType": "string"
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
3
+ "specVersion": "1.0.0-draft",
4
+ "name": "state",
5
+ "description": "Interactive or semantic state (e.g. hover, focus, disabled, selected). Compound states use hyphenation (e.g. selected-hover).",
6
+ "kind": "semantic",
7
+ "registry": "packages/design-system-registry/registry/states.json",
8
+ "validation": "advisory",
9
+ "serialization": {
10
+ "position": 12
11
+ },
12
+ "scope": null,
13
+ "required": false,
14
+ "valueType": "string"
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
3
+ "specVersion": "1.0.0-draft",
4
+ "name": "structure",
5
+ "description": "Reusable visual pattern that occurs across many components (e.g. drop-shadow, overlay). Distinct from component.",
6
+ "kind": "semantic",
7
+ "registry": "packages/design-system-registry/registry/structures.json",
8
+ "validation": "advisory",
9
+ "serialization": {
10
+ "position": 2
11
+ },
12
+ "scope": null,
13
+ "required": false,
14
+ "valueType": "string"
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
3
+ "specVersion": "1.0.0-draft",
4
+ "name": "substructure",
5
+ "description": "Child element within a parent structure (e.g. item within list-item, cell within table).",
6
+ "kind": "semantic",
7
+ "registry": "packages/design-system-registry/registry/substructures.json",
8
+ "validation": "advisory",
9
+ "serialization": {
10
+ "position": 3
11
+ },
12
+ "scope": null,
13
+ "required": false,
14
+ "valueType": "string"
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
3
+ "specVersion": "1.0.0-draft",
4
+ "name": "variant",
5
+ "description": "Primary color or semantic variant (e.g. accent, negative, informative, neutral). Not for visual style treatment — see style field for that.",
6
+ "kind": "semantic",
7
+ "registry": "packages/design-system-registry/registry/variants.json",
8
+ "validation": "advisory",
9
+ "serialization": {
10
+ "position": 0
11
+ },
12
+ "scope": null,
13
+ "required": false,
14
+ "valueType": "string"
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/design-data-spec",
3
- "version": "0.0.1",
3
+ "version": "0.1.1",
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": {
@@ -18,11 +18,11 @@
18
18
  "node": ">=20.12.0",
19
19
  "pnpm": ">=10.17.1"
20
20
  },
21
- "packageManager": "pnpm@10.17.1",
22
21
  "exports": {
23
22
  "./package.json": "./package.json",
24
23
  "./schemas/token.schema.json": "./schemas/token.schema.json",
25
24
  "./schemas/dimension.schema.json": "./schemas/dimension.schema.json",
25
+ "./schemas/field.schema.json": "./schemas/field.schema.json",
26
26
  "./schemas/manifest.schema.json": "./schemas/manifest.schema.json",
27
27
  "./schemas/value-types/color.schema.json": "./schemas/value-types/color.schema.json",
28
28
  "./rules/rules.yaml": "./rules/rules.yaml"
@@ -30,9 +30,10 @@
30
30
  "files": [
31
31
  "spec",
32
32
  "schemas",
33
+ "fields",
33
34
  "rules",
34
35
  "conformance",
35
36
  "README.md"
36
37
  ],
37
38
  "scripts": {}
38
- }
39
+ }
package/rules/rules.yaml CHANGED
@@ -51,8 +51,8 @@ rules:
51
51
  name: specificity-correctness
52
52
  severity: warning
53
53
  category: type-safety
54
- assert: When two tokens from the same layer match a context, the more specific name object MUST win; ties MUST be reported.
55
- message: "Ambiguous cascade resolution (specificity tie) for context {context}"
54
+ assert: When two tokens from the same layer match a context with equal specificity, the tie MUST be broken by document order (earlier in file wins; lexicographically earlier file path wins across files). Ties MUST be reported as warnings.
55
+ message: "Ambiguous cascade resolution (specificity tie) between {token_a} and {token_b} for context {context}; resolved by document order"
56
56
  spec_ref: spec/cascade.md#semantic-specificity
57
57
  introduced_in: "1.0.0-draft"
58
58
 
@@ -64,3 +64,66 @@ rules:
64
64
  message: "Token '{token}' does not roundtrip through name-object generation rules"
65
65
  spec_ref: spec/token-format.md#name-object
66
66
  introduced_in: "1.0.0-draft"
67
+
68
+ - id: SPEC-008
69
+ name: cascade-completeness
70
+ severity: warning
71
+ category: completeness
72
+ assert: For every cascade token that has a non-default mode variant, a base/default variant (name object with no dimension fields for that dimension, or explicitly the default mode value) MUST also exist in the dataset. Ensures all consumers can resolve without a fallback gap.
73
+ message: "Token property '{property}' has mode variant '{mode}' but no base/default variant"
74
+ spec_ref: spec/cascade.md#coverage
75
+ introduced_in: "1.0.0-draft"
76
+
77
+ - id: SPEC-009
78
+ name: name-field-enum-sync
79
+ severity: warning
80
+ category: naming-consistency
81
+ assert: Recognized name object fields (component, state, variant, etc.) SHOULD use values drawn from the corresponding design-system-registry enums when those enums are available.
82
+ message: "Token name field '{field}' value '{value}' is not in the design-system-registry enum for '{field}'"
83
+ spec_ref: spec/token-format.md#name-object
84
+ introduced_in: "1.0.0-draft"
85
+
86
+ - id: SPEC-010
87
+ name: replaced-by-target-exists
88
+ severity: error
89
+ category: reference-integrity
90
+ assert: Every UUID in replaced_by MUST resolve to an existing token in the dataset.
91
+ message: "replaced_by target UUID not found: {uuid}"
92
+ spec_ref: spec/token-format.md#lifecycle-and-metadata
93
+ introduced_in: "1.0.0-draft"
94
+
95
+ - id: SPEC-011
96
+ name: replaced-by-array-requires-comment
97
+ severity: error
98
+ category: completeness
99
+ assert: When replaced_by is an array, deprecated_comment MUST be present to explain which replacement applies in which context.
100
+ message: "replaced_by is an array but deprecated_comment is missing on token {token}"
101
+ spec_ref: spec/token-format.md#lifecycle-and-metadata
102
+ introduced_in: "1.0.0-draft"
103
+
104
+ - id: SPEC-012
105
+ name: replaced-by-requires-deprecated
106
+ severity: error
107
+ category: completeness
108
+ assert: If replaced_by is present, deprecated MUST also be present.
109
+ message: "Token {token} has replaced_by but is not marked deprecated"
110
+ spec_ref: spec/token-format.md#lifecycle-and-metadata
111
+ introduced_in: "1.0.0-draft"
112
+
113
+ - id: SPEC-013
114
+ name: planned-removal-requires-deprecated
115
+ severity: error
116
+ category: completeness
117
+ assert: If plannedRemoval is present, deprecated MUST also be present.
118
+ message: "Token {token} has plannedRemoval but is not marked deprecated"
119
+ spec_ref: spec/token-format.md#lifecycle-and-metadata
120
+ introduced_in: "1.0.0-draft"
121
+
122
+ - id: SPEC-014
123
+ name: last-modified-not-before-introduced
124
+ severity: error
125
+ category: completeness
126
+ assert: If lastModified is present, its semver MUST NOT precede introduced.
127
+ message: "Token {token} has lastModified {lastModified} earlier than introduced {introduced}"
128
+ spec_ref: spec/token-format.md#lifecycle-and-metadata
129
+ introduced_in: "1.0.0-draft"
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/cascade-file.schema.json",
4
+ "title": "Cascade token file",
5
+ "description": "Layer 1 — document envelope for cascade-format tokens. A cascade file is an ordered array of token objects; document order determines tie-breaking during cascade resolution.",
6
+ "type": "array",
7
+ "items": {
8
+ "$ref": "token.schema.json"
9
+ }
10
+ }
@@ -0,0 +1,85 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
4
+ "title": "Name-object field declaration",
5
+ "description": "Declares a single field on the token name object — its kind, vocabulary source, validation severity, and serialization position. Design systems provide a catalog of these declarations to make the name object schema configurable rather than hardcoded.",
6
+ "type": "object",
7
+ "required": ["name", "kind", "validation", "serialization"],
8
+ "properties": {
9
+ "$schema": {
10
+ "type": "string"
11
+ },
12
+ "specVersion": {
13
+ "const": "1.0.0-draft"
14
+ },
15
+ "name": {
16
+ "type": "string",
17
+ "minLength": 1,
18
+ "description": "Field key on the name object (e.g. 'property', 'component', 'scaleIndex')."
19
+ },
20
+ "description": {
21
+ "type": "string",
22
+ "description": "Human-readable description of the field's purpose."
23
+ },
24
+ "kind": {
25
+ "type": "string",
26
+ "enum": ["semantic", "dimension"],
27
+ "description": "Whether this field participates in cascade resolution. 'dimension' fields drive cascade specificity; 'semantic' fields describe identity only."
28
+ },
29
+ "registry": {
30
+ "oneOf": [
31
+ {
32
+ "type": "string",
33
+ "minLength": 1,
34
+ "description": "Path to the registry file containing valid values for this field (relative to the design system root)."
35
+ },
36
+ {
37
+ "type": "null",
38
+ "description": "No registry — field accepts free-form values."
39
+ }
40
+ ]
41
+ },
42
+ "validation": {
43
+ "type": "string",
44
+ "enum": ["strict", "advisory", "none"],
45
+ "description": "Validation severity when a value is not found in the registry. 'strict' = error, 'advisory' = warning, 'none' = no check."
46
+ },
47
+ "serialization": {
48
+ "type": "object",
49
+ "required": ["position"],
50
+ "properties": {
51
+ "position": {
52
+ "type": "integer",
53
+ "minimum": 0,
54
+ "description": "Default position in the serialized name string (0-based). Used when the platform manifest does not specify a custom conceptOrder."
55
+ }
56
+ },
57
+ "additionalProperties": false
58
+ },
59
+ "scope": {
60
+ "oneOf": [
61
+ {
62
+ "type": "string",
63
+ "minLength": 1,
64
+ "description": "Restrict this field to a specific token type scope (e.g. 'typography', 'color'). Null = universal."
65
+ },
66
+ {
67
+ "type": "null",
68
+ "description": "Field applies to all token types."
69
+ }
70
+ ]
71
+ },
72
+ "required": {
73
+ "type": "boolean",
74
+ "description": "Whether this field must be present on every name object. Default: false.",
75
+ "default": false
76
+ },
77
+ "valueType": {
78
+ "type": "string",
79
+ "enum": ["string", "integer"],
80
+ "description": "Type of the field value. Default: 'string'.",
81
+ "default": "string"
82
+ }
83
+ },
84
+ "additionalProperties": false
85
+ }
@@ -64,7 +64,61 @@
64
64
  },
65
65
  "extensions": {
66
66
  "type": "object",
67
- "description": "Platform-local tokens or dimensions; structure validated by separate documents.",
67
+ "description": "Platform-local tokens, dimensions, and formatting rules.",
68
+ "properties": {
69
+ "formatting": {
70
+ "type": "object",
71
+ "description": "Rules for serializing structured name objects into platform-specific token name strings.",
72
+ "properties": {
73
+ "conceptOrder": {
74
+ "type": "array",
75
+ "items": {
76
+ "type": "string",
77
+ "enum": [
78
+ "variant",
79
+ "component",
80
+ "structure",
81
+ "substructure",
82
+ "anatomy",
83
+ "object",
84
+ "property",
85
+ "orientation",
86
+ "position",
87
+ "size",
88
+ "density",
89
+ "shape",
90
+ "state"
91
+ ]
92
+ },
93
+ "uniqueItems": true,
94
+ "description": "Ordered list of field names for serialization. Values must match declared field names from the design system's field catalog (field.schema.json declarations). Replaces the default serialization.position order from each field declaration."
95
+ },
96
+ "casing": {
97
+ "type": "string",
98
+ "enum": [
99
+ "kebab-case",
100
+ "camelCase",
101
+ "PascalCase",
102
+ "SCREAMING_SNAKE_CASE"
103
+ ],
104
+ "description": "Casing style for serialized token names. Default: kebab-case."
105
+ },
106
+ "delimiter": {
107
+ "type": "string",
108
+ "minLength": 1,
109
+ "description": "Character(s) separating concepts in the serialized string. Default: -."
110
+ },
111
+ "abbreviations": {
112
+ "type": "object",
113
+ "additionalProperties": {
114
+ "type": "string"
115
+ },
116
+ "description": "Map of full term to abbreviated form, applied after ordering and before casing."
117
+ }
118
+ },
119
+ "additionalProperties": false
120
+ }
121
+ },
68
122
  "additionalProperties": true
69
123
  }
70
124
  },