@adobe/design-data-spec 0.1.1 → 0.3.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/README.md +3 -3
- package/components/button.json +70 -0
- package/conformance/README.md +0 -1
- package/conformance/invalid/SPEC-016/expected-errors.json +10 -0
- package/conformance/invalid/SPEC-016/tokens.tokens.json +8 -0
- package/conformance/invalid/SPEC-017/expected-errors.json +10 -0
- package/conformance/invalid/SPEC-017/tokens.tokens.json +7 -0
- package/conformance/invalid/SPEC-018/dataset.json +9 -0
- package/conformance/invalid/SPEC-018/expected-errors.json +10 -0
- package/conformance/invalid/SPEC-019/dataset.json +29 -0
- package/conformance/invalid/SPEC-019/expected-errors.json +10 -0
- package/conformance/invalid/SPEC-020/dataset.json +27 -0
- package/conformance/invalid/SPEC-020/expected-errors.json +10 -0
- package/conformance/invalid/SPEC-021/dataset.json +18 -0
- package/conformance/invalid/SPEC-021/expected-errors.json +10 -0
- package/conformance/invalid/SPEC-022/dataset.json +33 -0
- package/conformance/invalid/SPEC-022/expected-errors.json +10 -0
- package/conformance/invalid/SPEC-023/dataset.json +18 -0
- package/conformance/invalid/SPEC-023/expected-errors.json +10 -0
- package/conformance/invalid/SPEC-024/dataset.json +18 -0
- package/conformance/invalid/SPEC-024/expected-errors.json +10 -0
- package/conformance/valid/component-refs/dataset.json +63 -0
- package/conformance/valid/composite-drop-shadow.json +14 -0
- package/conformance/valid/composite-typography-scale.json +6 -0
- package/conformance/valid/composite-typography.json +12 -0
- package/conformance/valid/string-name-escape-hatch.json +7 -0
- package/fields/scaleIndex.json +15 -0
- package/package.json +18 -6
- package/rules/rules.yaml +113 -5
- package/schemas/anatomy-part.schema.json +35 -0
- package/schemas/component.schema.json +267 -0
- package/schemas/field.schema.json +2 -2
- package/schemas/state-declaration.schema.json +36 -0
- package/schemas/token.schema.json +26 -10
- package/schemas/value-types/drop-shadow.schema.json +20 -0
- package/schemas/value-types/typography-scale.schema.json +13 -0
- package/schemas/value-types/typography.schema.json +16 -0
- package/spec/agent-surface.md +116 -0
- package/spec/anatomy-format.md +167 -0
- package/spec/component-format.md +326 -0
- package/spec/evolution.md +0 -1
- package/spec/index.md +27 -21
- package/spec/state-model.md +245 -0
- package/spec/token-format.md +80 -15
- package/src/canonical.js +61 -0
- package/src/validate.js +166 -0
package/rules/rules.yaml
CHANGED
|
@@ -120,10 +120,118 @@ rules:
|
|
|
120
120
|
introduced_in: "1.0.0-draft"
|
|
121
121
|
|
|
122
122
|
- id: SPEC-014
|
|
123
|
-
name:
|
|
123
|
+
name: composite-inline-alias-exists
|
|
124
124
|
severity: error
|
|
125
|
-
category:
|
|
126
|
-
assert:
|
|
127
|
-
message: "
|
|
128
|
-
spec_ref: spec/token-format.md#
|
|
125
|
+
category: reference-integrity
|
|
126
|
+
assert: Inline alias references ({token-name}) within composite values MUST resolve to an existing token in the dataset.
|
|
127
|
+
message: "Inline alias target not found within composite value: {path}"
|
|
128
|
+
spec_ref: spec/token-format.md#inline-alias-references
|
|
129
|
+
introduced_in: "1.0.0-draft"
|
|
130
|
+
|
|
131
|
+
- id: SPEC-015
|
|
132
|
+
name: composite-inline-alias-type-compatible
|
|
133
|
+
severity: error
|
|
134
|
+
category: type-safety
|
|
135
|
+
assert: Resolved inline alias target within a composite value MUST have a value type compatible with the sub-value's expected type.
|
|
136
|
+
message: "Inline alias {path} within composite resolves to incompatible type"
|
|
137
|
+
spec_ref: spec/token-format.md#inline-alias-references
|
|
138
|
+
introduced_in: "1.0.0-draft"
|
|
139
|
+
|
|
140
|
+
- id: SPEC-016
|
|
141
|
+
name: value-type-match
|
|
142
|
+
severity: error
|
|
143
|
+
category: type-safety
|
|
144
|
+
assert: When $valueType is present on a token with a literal value, the value MUST validate against the referenced value-type schema.
|
|
145
|
+
message: "Token {token} value does not validate against declared $valueType schema {schema}"
|
|
146
|
+
spec_ref: spec/token-format.md#value-type-declaration-valuetype
|
|
147
|
+
introduced_in: "1.0.0-draft"
|
|
148
|
+
|
|
149
|
+
- id: SPEC-017
|
|
150
|
+
name: string-name-tech-debt
|
|
151
|
+
severity: warning
|
|
152
|
+
category: tech-debt
|
|
153
|
+
assert: Token names SHOULD be structured name objects. A plain string name is permitted as a temporary escape hatch but MUST be treated as tech debt and tracked for remediation.
|
|
154
|
+
message: 'Token "{name}" uses a string name instead of a name object — treat as tech debt and plan remediation'
|
|
155
|
+
spec_ref: spec/token-format.md#string-name-escape-hatch
|
|
156
|
+
introduced_in: "1.0.0-draft"
|
|
157
|
+
|
|
158
|
+
- id: SPEC-018
|
|
159
|
+
name: component-name-exists
|
|
160
|
+
severity: error
|
|
161
|
+
category: reference-integrity
|
|
162
|
+
assert: Token name-object 'component' field value MUST match the 'name' of a declared component in the dataset.
|
|
163
|
+
message: "Token '{token}' references undeclared component '{component}'"
|
|
164
|
+
spec_ref: spec/component-format.md#name
|
|
165
|
+
introduced_in: "1.0.0-draft"
|
|
166
|
+
|
|
167
|
+
- id: SPEC-019
|
|
168
|
+
name: component-variant-valid
|
|
169
|
+
severity: error
|
|
170
|
+
category: reference-integrity
|
|
171
|
+
assert: Token name-object 'variant' field value MUST match a value in the declared 'variant' option enum for the referenced component, when that enum exists.
|
|
172
|
+
message: "Token '{token}' has variant '{variant}' which is not declared on component '{component}'"
|
|
173
|
+
spec_ref: spec/component-format.md#options
|
|
174
|
+
introduced_in: "1.0.0-draft"
|
|
175
|
+
|
|
176
|
+
- id: SPEC-020
|
|
177
|
+
name: component-anatomy-valid
|
|
178
|
+
severity: error
|
|
179
|
+
category: reference-integrity
|
|
180
|
+
assert: Token name-object 'anatomy' field value MUST match the 'name' of a declared anatomy part on the referenced component.
|
|
181
|
+
message: "Token '{token}' references undeclared anatomy part '{anatomy}' on component '{component}'"
|
|
182
|
+
spec_ref: spec/component-format.md#anatomy-stub
|
|
183
|
+
introduced_in: "1.0.0-draft"
|
|
184
|
+
|
|
185
|
+
- id: SPEC-021
|
|
186
|
+
name: component-slot-vocabulary
|
|
187
|
+
severity: warning
|
|
188
|
+
category: component-contract
|
|
189
|
+
assert: Component slot declarations with a 'name' outside the canonical slot vocabulary SHOULD include a 'description' field documenting the custom slot's purpose.
|
|
190
|
+
message: "Component '{component}' has custom slot '{slot}' with no description — add a description or use a canonical slot name"
|
|
191
|
+
spec_ref: spec/component-format.md#canonical-slot-vocabulary
|
|
192
|
+
introduced_in: "1.0.0-draft"
|
|
193
|
+
|
|
194
|
+
- id: SPEC-022
|
|
195
|
+
name: component-state-valid
|
|
196
|
+
severity: error
|
|
197
|
+
category: reference-integrity
|
|
198
|
+
assert: Token name-object 'state' field value MUST match the 'name' of a declared state on the referenced component, when state declarations are present.
|
|
199
|
+
message: "Token '{token}' references undeclared state '{state}' on component '{component}'"
|
|
200
|
+
spec_ref: spec/component-format.md#spec-rules
|
|
201
|
+
introduced_in: "1.0.0-draft"
|
|
202
|
+
|
|
203
|
+
- id: SPEC-023
|
|
204
|
+
name: anatomy-custom-part-documented
|
|
205
|
+
severity: warning
|
|
206
|
+
category: component-contract
|
|
207
|
+
assert: Anatomy part declarations with a 'name' outside the canonical anatomy vocabulary SHOULD include a 'description' field.
|
|
208
|
+
message: "Component '{component}' has custom anatomy part '{part}' with no description"
|
|
209
|
+
spec_ref: spec/anatomy-format.md#canonical-anatomy-vocabulary
|
|
210
|
+
introduced_in: "1.0.0-draft"
|
|
211
|
+
|
|
212
|
+
- id: SPEC-024
|
|
213
|
+
name: anatomy-part-name-unique
|
|
214
|
+
severity: error
|
|
215
|
+
category: component-contract
|
|
216
|
+
assert: Anatomy part names within a single component's anatomy array MUST be unique.
|
|
217
|
+
message: "Component '{component}' declares duplicate anatomy part name '{part}'"
|
|
218
|
+
spec_ref: spec/anatomy-format.md#name
|
|
219
|
+
introduced_in: "1.0.0-draft"
|
|
220
|
+
|
|
221
|
+
- id: SPEC-025
|
|
222
|
+
name: anatomy-requires-component
|
|
223
|
+
severity: error
|
|
224
|
+
category: reference-integrity
|
|
225
|
+
assert: A token name object MUST NOT include an 'anatomy' field unless a 'component' field is also present.
|
|
226
|
+
message: "Token '{token}' has 'anatomy' field without a 'component' field"
|
|
227
|
+
spec_ref: spec/anatomy-format.md#cross-reference-with-token-name-objects
|
|
228
|
+
introduced_in: "1.0.0-draft"
|
|
229
|
+
|
|
230
|
+
- id: SPEC-026
|
|
231
|
+
name: state-custom-name-documented
|
|
232
|
+
severity: warning
|
|
233
|
+
category: component-contract
|
|
234
|
+
assert: State declarations with a 'name' outside the canonical state vocabulary SHOULD include a 'description' field.
|
|
235
|
+
message: "Component '{component}' has custom state '{state}' with no description"
|
|
236
|
+
spec_ref: spec/state-model.md#canonical-state-vocabulary
|
|
129
237
|
introduced_in: "1.0.0-draft"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/anatomy-part.schema.json",
|
|
4
|
+
"title": "Anatomy part declaration",
|
|
5
|
+
"description": "Layer 1 structural schema for a single anatomy part object within a component declaration. Semantic rules (component-anatomy-valid, anatomy-custom-part-documented, anatomy-part-name-unique, anatomy-requires-component) are Layer 2.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["name"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"name": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"pattern": "^[a-z][a-z0-9-]*$",
|
|
12
|
+
"minLength": 1,
|
|
13
|
+
"description": "Kebab-case anatomy part identifier. Must match the value used in token name-object 'anatomy' fields."
|
|
14
|
+
},
|
|
15
|
+
"description": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Plain-text description of the part's visual role and boundaries."
|
|
18
|
+
},
|
|
19
|
+
"required": {
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"default": false,
|
|
22
|
+
"description": "Whether this part is always rendered regardless of component configuration."
|
|
23
|
+
},
|
|
24
|
+
"contains": {
|
|
25
|
+
"type": "array",
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
29
|
+
},
|
|
30
|
+
"uniqueItems": true,
|
|
31
|
+
"description": "Informative list of child anatomy part names nested within this part. Does not carry enforcement semantics."
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"additionalProperties": false
|
|
35
|
+
}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/component.schema.json",
|
|
4
|
+
"title": "Design data component declaration",
|
|
5
|
+
"description": "Layer 1 structural schema for a component declaration. Semantic cross-reference rules (component-name-exists, component-variant-valid, etc.) are Layer 2.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["$id", "name", "displayName", "meta"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"$schema": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"format": "uri"
|
|
12
|
+
},
|
|
13
|
+
"specVersion": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Spec version this document targets (e.g. '1.0.0-draft')."
|
|
16
|
+
},
|
|
17
|
+
"$id": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"format": "uri",
|
|
20
|
+
"description": "Canonical identifier for this component declaration."
|
|
21
|
+
},
|
|
22
|
+
"name": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"pattern": "^[a-z][a-z0-9-]*$",
|
|
25
|
+
"minLength": 1,
|
|
26
|
+
"description": "Machine identifier (kebab-case). Must match the value used in token name-object 'component' fields."
|
|
27
|
+
},
|
|
28
|
+
"displayName": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"minLength": 1,
|
|
31
|
+
"description": "Human-readable component name (e.g. 'Button')."
|
|
32
|
+
},
|
|
33
|
+
"description": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "Plain-text description of the component's purpose."
|
|
36
|
+
},
|
|
37
|
+
"meta": {
|
|
38
|
+
"$ref": "#/$defs/meta"
|
|
39
|
+
},
|
|
40
|
+
"options": {
|
|
41
|
+
"$ref": "#/$defs/optionsMap"
|
|
42
|
+
},
|
|
43
|
+
"slots": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"items": {
|
|
46
|
+
"$ref": "#/$defs/slotDeclaration"
|
|
47
|
+
},
|
|
48
|
+
"description": "Named content injection points. See spec/component-format.md#slots."
|
|
49
|
+
},
|
|
50
|
+
"anatomy": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"items": {
|
|
53
|
+
"$ref": "#/$defs/anatomyPart"
|
|
54
|
+
},
|
|
55
|
+
"description": "Named visible parts of the component. Full spec in spec/anatomy-format.md (Phase 6.2)."
|
|
56
|
+
},
|
|
57
|
+
"states": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"items": {
|
|
60
|
+
"$ref": "#/$defs/stateDeclaration"
|
|
61
|
+
},
|
|
62
|
+
"description": "Per-component state declarations. Full spec in spec/state-model.md (Phase 6.3)."
|
|
63
|
+
},
|
|
64
|
+
"lifecycle": {
|
|
65
|
+
"$ref": "#/$defs/lifecycle"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"additionalProperties": false,
|
|
69
|
+
"$defs": {
|
|
70
|
+
"meta": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"required": ["category", "documentationUrl"],
|
|
73
|
+
"properties": {
|
|
74
|
+
"category": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"enum": [
|
|
77
|
+
"actions",
|
|
78
|
+
"containers",
|
|
79
|
+
"data visualization",
|
|
80
|
+
"feedback",
|
|
81
|
+
"inputs",
|
|
82
|
+
"navigation",
|
|
83
|
+
"status",
|
|
84
|
+
"typography"
|
|
85
|
+
],
|
|
86
|
+
"description": "Design system category for this component."
|
|
87
|
+
},
|
|
88
|
+
"documentationUrl": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"format": "uri",
|
|
91
|
+
"description": "URL of the component's documentation page."
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"additionalProperties": false
|
|
95
|
+
},
|
|
96
|
+
"optionsMap": {
|
|
97
|
+
"type": "object",
|
|
98
|
+
"description": "Component API options. Each key is a camelCase option name; each value is an option descriptor.",
|
|
99
|
+
"additionalProperties": {
|
|
100
|
+
"$ref": "#/$defs/optionDescriptor"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"optionDescriptor": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"description": "JSON Schema-compatible descriptor for a single component option.",
|
|
106
|
+
"properties": {
|
|
107
|
+
"type": {
|
|
108
|
+
"oneOf": [
|
|
109
|
+
{
|
|
110
|
+
"type": "string",
|
|
111
|
+
"enum": [
|
|
112
|
+
"string",
|
|
113
|
+
"boolean",
|
|
114
|
+
"number",
|
|
115
|
+
"integer",
|
|
116
|
+
"object",
|
|
117
|
+
"array",
|
|
118
|
+
"null"
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"type": "array",
|
|
123
|
+
"items": {
|
|
124
|
+
"type": "string",
|
|
125
|
+
"enum": [
|
|
126
|
+
"string",
|
|
127
|
+
"boolean",
|
|
128
|
+
"number",
|
|
129
|
+
"integer",
|
|
130
|
+
"object",
|
|
131
|
+
"array",
|
|
132
|
+
"null"
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
"minItems": 1
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
"enum": {
|
|
140
|
+
"type": "array",
|
|
141
|
+
"minItems": 1,
|
|
142
|
+
"description": "Exhaustive list of permitted values."
|
|
143
|
+
},
|
|
144
|
+
"default": {
|
|
145
|
+
"description": "Default value when the option is not specified."
|
|
146
|
+
},
|
|
147
|
+
"description": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"description": "Plain-text description of what the option controls."
|
|
150
|
+
},
|
|
151
|
+
"$ref": {
|
|
152
|
+
"type": "string",
|
|
153
|
+
"format": "uri-reference",
|
|
154
|
+
"description": "Reference to a shared type schema."
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"additionalProperties": false
|
|
158
|
+
},
|
|
159
|
+
"slotDeclaration": {
|
|
160
|
+
"type": "object",
|
|
161
|
+
"required": ["name"],
|
|
162
|
+
"properties": {
|
|
163
|
+
"name": {
|
|
164
|
+
"type": "string",
|
|
165
|
+
"minLength": 1,
|
|
166
|
+
"description": "Slot identifier. Should come from the canonical slot vocabulary."
|
|
167
|
+
},
|
|
168
|
+
"description": {
|
|
169
|
+
"type": "string",
|
|
170
|
+
"description": "What content belongs in this slot."
|
|
171
|
+
},
|
|
172
|
+
"required": {
|
|
173
|
+
"type": "boolean",
|
|
174
|
+
"default": false,
|
|
175
|
+
"description": "Whether consumers must populate this slot."
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"additionalProperties": false
|
|
179
|
+
},
|
|
180
|
+
"anatomyPart": {
|
|
181
|
+
"type": "object",
|
|
182
|
+
"required": ["name"],
|
|
183
|
+
"description": "Named visible part of a component. Full spec in spec/anatomy-format.md (Phase 6.2).",
|
|
184
|
+
"properties": {
|
|
185
|
+
"name": {
|
|
186
|
+
"type": "string",
|
|
187
|
+
"minLength": 1,
|
|
188
|
+
"description": "Anatomy part identifier (e.g. 'icon', 'label', 'handle')."
|
|
189
|
+
},
|
|
190
|
+
"description": {
|
|
191
|
+
"type": "string"
|
|
192
|
+
},
|
|
193
|
+
"required": {
|
|
194
|
+
"type": "boolean",
|
|
195
|
+
"default": false
|
|
196
|
+
},
|
|
197
|
+
"contains": {
|
|
198
|
+
"type": "array",
|
|
199
|
+
"items": { "type": "string" },
|
|
200
|
+
"description": "Informative: anatomy part names nested within this part."
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"additionalProperties": false
|
|
204
|
+
},
|
|
205
|
+
"stateDeclaration": {
|
|
206
|
+
"type": "object",
|
|
207
|
+
"required": ["name"],
|
|
208
|
+
"description": "Per-component state declaration. Full spec in spec/state-model.md.",
|
|
209
|
+
"properties": {
|
|
210
|
+
"name": {
|
|
211
|
+
"type": "string",
|
|
212
|
+
"minLength": 1,
|
|
213
|
+
"description": "State identifier (e.g. 'hover', 'focus', 'disabled')."
|
|
214
|
+
},
|
|
215
|
+
"description": {
|
|
216
|
+
"type": "string"
|
|
217
|
+
},
|
|
218
|
+
"trigger": {
|
|
219
|
+
"type": "string",
|
|
220
|
+
"enum": ["prop", "interaction"],
|
|
221
|
+
"description": "'prop' for persistent prop-driven states (isDisabled); 'interaction' for runtime states (hover, focus, pressed)."
|
|
222
|
+
},
|
|
223
|
+
"precedence": {
|
|
224
|
+
"type": "integer",
|
|
225
|
+
"minimum": 0,
|
|
226
|
+
"description": "Resolution precedence; higher integer wins when multiple states are active simultaneously."
|
|
227
|
+
},
|
|
228
|
+
"layered": {
|
|
229
|
+
"type": "boolean",
|
|
230
|
+
"default": false,
|
|
231
|
+
"description": "true for states that compose with others (e.g. focus ring layered over hover)."
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
"additionalProperties": false
|
|
235
|
+
},
|
|
236
|
+
"lifecycle": {
|
|
237
|
+
"type": "object",
|
|
238
|
+
"description": "Version lifecycle metadata, mirroring the token lifecycle pattern.",
|
|
239
|
+
"properties": {
|
|
240
|
+
"introduced": {
|
|
241
|
+
"type": "string",
|
|
242
|
+
"description": "Spec version when this component declaration was added (e.g. '1.0.0-draft')."
|
|
243
|
+
},
|
|
244
|
+
"deprecated": {
|
|
245
|
+
"type": "string",
|
|
246
|
+
"description": "Spec version when this component was deprecated. Truthy = deprecated."
|
|
247
|
+
},
|
|
248
|
+
"deprecatedComment": {
|
|
249
|
+
"type": "string",
|
|
250
|
+
"description": "Human-readable explanation of the deprecation and migration path."
|
|
251
|
+
},
|
|
252
|
+
"replacedBy": {
|
|
253
|
+
"oneOf": [
|
|
254
|
+
{ "type": "string", "minLength": 1 },
|
|
255
|
+
{
|
|
256
|
+
"type": "array",
|
|
257
|
+
"items": { "type": "string", "minLength": 1 },
|
|
258
|
+
"minItems": 1
|
|
259
|
+
}
|
|
260
|
+
],
|
|
261
|
+
"description": "name value(s) of the replacement component(s)."
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
"additionalProperties": false
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
},
|
|
24
24
|
"kind": {
|
|
25
25
|
"type": "string",
|
|
26
|
-
"enum": ["semantic", "dimension"],
|
|
27
|
-
"description": "Whether this field participates in cascade resolution. 'dimension' fields drive cascade specificity; '
|
|
26
|
+
"enum": ["semantic", "dimension", "numeric"],
|
|
27
|
+
"description": "Whether this field participates in serialization ordering or cascade resolution. 'semantic' fields describe identity and appear in the standard serialization order; 'dimension' fields drive cascade specificity; 'numeric' fields hold integer indices appended at the end of the serialized name."
|
|
28
28
|
},
|
|
29
29
|
"registry": {
|
|
30
30
|
"oneOf": [
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/state-declaration.schema.json",
|
|
4
|
+
"title": "State declaration",
|
|
5
|
+
"description": "Layer 1 structural schema for a single state declaration object within a component declaration. Semantic rules (component-state-valid, state-custom-name-documented) are Layer 2.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["name"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"name": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"pattern": "^[a-z][a-z0-9-]*$",
|
|
12
|
+
"minLength": 1,
|
|
13
|
+
"description": "Kebab-case state identifier. Must match the value used in token name-object 'state' fields."
|
|
14
|
+
},
|
|
15
|
+
"description": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Plain-text description of the state's semantics and the conditions under which it is active."
|
|
18
|
+
},
|
|
19
|
+
"trigger": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"enum": ["prop", "interaction"],
|
|
22
|
+
"description": "'prop' for persistent prop-driven states (e.g. isDisabled); 'interaction' for transient runtime interaction states (hover, focus, pressed)."
|
|
23
|
+
},
|
|
24
|
+
"precedence": {
|
|
25
|
+
"type": "integer",
|
|
26
|
+
"minimum": 0,
|
|
27
|
+
"description": "Resolution precedence. Higher value wins when multiple non-layered states are active simultaneously. Defaults to 0 when omitted."
|
|
28
|
+
},
|
|
29
|
+
"layered": {
|
|
30
|
+
"type": "boolean",
|
|
31
|
+
"default": false,
|
|
32
|
+
"description": "When true, this state composes on top of the winning non-layered state rather than competing with it. Use for focus rings, selection overlays, and similar compositing states."
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"additionalProperties": false
|
|
36
|
+
}
|
|
@@ -99,7 +99,19 @@
|
|
|
99
99
|
"const": "1.0.0-draft"
|
|
100
100
|
},
|
|
101
101
|
"name": {
|
|
102
|
-
"
|
|
102
|
+
"oneOf": [
|
|
103
|
+
{ "$ref": "#/$defs/nameObject" },
|
|
104
|
+
{
|
|
105
|
+
"type": "string",
|
|
106
|
+
"minLength": 1,
|
|
107
|
+
"description": "String escape hatch for tokens that cannot be expressed as a name object. Valid but triggers SPEC-017 (tech-debt warning). See token-format.md#string-name-escape-hatch."
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"$valueType": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"format": "uri-reference",
|
|
114
|
+
"description": "URI reference to a value-type schema under schemas/value-types/. When present, value MUST validate against the referenced schema (rule SPEC-016)."
|
|
103
115
|
},
|
|
104
116
|
"value": {
|
|
105
117
|
"description": "Literal value; type narrowed by value-type schemas where applicable.",
|
|
@@ -131,10 +143,6 @@
|
|
|
131
143
|
"introduced": {
|
|
132
144
|
"type": "string"
|
|
133
145
|
},
|
|
134
|
-
"lastModified": {
|
|
135
|
-
"type": "string",
|
|
136
|
-
"description": "Spec version when token value or metadata last changed (e.g. \"2.1.0\"). MUST be >= introduced (see SPEC-014)."
|
|
137
|
-
},
|
|
138
146
|
"deprecated": {
|
|
139
147
|
"type": "string",
|
|
140
148
|
"description": "Spec version when token was deprecated (e.g. \"3.2.0\"). Truthy = deprecated."
|
|
@@ -178,7 +186,19 @@
|
|
|
178
186
|
"const": "1.0.0-draft"
|
|
179
187
|
},
|
|
180
188
|
"name": {
|
|
181
|
-
"
|
|
189
|
+
"oneOf": [
|
|
190
|
+
{ "$ref": "#/$defs/nameObject" },
|
|
191
|
+
{
|
|
192
|
+
"type": "string",
|
|
193
|
+
"minLength": 1,
|
|
194
|
+
"description": "String escape hatch for tokens that cannot be expressed as a name object. Valid but triggers SPEC-017 (tech-debt warning). See token-format.md#string-name-escape-hatch."
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
"$valueType": {
|
|
199
|
+
"type": "string",
|
|
200
|
+
"format": "uri-reference",
|
|
201
|
+
"description": "URI reference to a value-type schema under schemas/value-types/. When present, the alias resolution chain MUST terminate at a token whose value validates against this schema."
|
|
182
202
|
},
|
|
183
203
|
"$ref": {
|
|
184
204
|
"type": "string",
|
|
@@ -192,10 +212,6 @@
|
|
|
192
212
|
"introduced": {
|
|
193
213
|
"type": "string"
|
|
194
214
|
},
|
|
195
|
-
"lastModified": {
|
|
196
|
-
"type": "string",
|
|
197
|
-
"description": "Spec version when token value or metadata last changed (e.g. \"2.1.0\"). MUST be >= introduced (see SPEC-014)."
|
|
198
|
-
},
|
|
199
215
|
"deprecated": {
|
|
200
216
|
"type": "string",
|
|
201
217
|
"description": "Spec version when token was deprecated (e.g. \"3.2.0\"). Truthy = deprecated."
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/value-types/drop-shadow.schema.json",
|
|
4
|
+
"title": "Drop shadow composite value",
|
|
5
|
+
"description": "Array of shadow layers. Each layer defines offset, blur, spread, and color.",
|
|
6
|
+
"type": "array",
|
|
7
|
+
"items": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"x": { "type": "string" },
|
|
11
|
+
"y": { "type": "string" },
|
|
12
|
+
"blur": { "type": "string" },
|
|
13
|
+
"spread": { "type": "string" },
|
|
14
|
+
"color": { "type": "string" }
|
|
15
|
+
},
|
|
16
|
+
"required": ["x", "y", "blur", "spread", "color"],
|
|
17
|
+
"additionalProperties": false
|
|
18
|
+
},
|
|
19
|
+
"minItems": 1
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/value-types/typography-scale.schema.json",
|
|
4
|
+
"title": "Typography scale composite value",
|
|
5
|
+
"description": "Pairs a font size with its corresponding line height at a single typographic tier.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"fontSize": { "type": "string" },
|
|
9
|
+
"lineHeight": { "type": "string" }
|
|
10
|
+
},
|
|
11
|
+
"required": ["fontSize", "lineHeight"],
|
|
12
|
+
"additionalProperties": false
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/value-types/typography.schema.json",
|
|
4
|
+
"title": "Typography composite value",
|
|
5
|
+
"description": "Object bundling font properties for a typographic style. Sub-values may be literal strings or inline alias references ({token-name}).",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"fontFamily": { "type": "string" },
|
|
9
|
+
"fontSize": { "type": "string" },
|
|
10
|
+
"fontWeight": { "type": "string" },
|
|
11
|
+
"letterSpacing": { "type": "string" },
|
|
12
|
+
"lineHeight": { "type": "string" }
|
|
13
|
+
},
|
|
14
|
+
"required": ["fontFamily", "fontSize", "fontWeight", "lineHeight"],
|
|
15
|
+
"additionalProperties": false
|
|
16
|
+
}
|