@adobe/design-data-spec 0.9.0 → 0.10.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/components/accordion.json +18 -1
- package/components/action-bar.json +12 -1
- package/components/action-button.json +19 -1
- package/components/action-group.json +12 -1
- package/components/alert-banner.json +11 -1
- package/components/alert-dialog.json +19 -1
- package/components/avatar-group.json +4 -1
- package/components/avatar.json +4 -1
- package/components/badge.json +4 -1
- package/components/body.json +3 -0
- package/components/bottom-navigation-android.json +17 -0
- package/components/breadcrumbs.json +19 -2
- package/components/button-group.json +12 -1
- package/components/button.json +21 -3
- package/components/calendar.json +22 -0
- package/components/cards.json +18 -1
- package/components/checkbox-group.json +17 -1
- package/components/checkbox.json +24 -1
- package/components/close-button.json +19 -1
- package/components/coach-indicator.json +4 -1
- package/components/coach-mark.json +13 -1
- package/components/code.json +3 -0
- package/components/color-area.json +24 -1
- package/components/color-handle.json +13 -1
- package/components/color-loupe.json +4 -1
- package/components/color-slider.json +24 -1
- package/components/color-wheel.json +24 -1
- package/components/combo-box.json +24 -1
- package/components/contextual-help.json +18 -1
- package/components/date-picker.json +23 -1
- package/components/detail.json +3 -0
- package/components/divider.json +4 -1
- package/components/drop-zone.json +18 -1
- package/components/field-label.json +4 -1
- package/components/heading.json +3 -0
- package/components/help-text.json +5 -2
- package/components/illustrated-message.json +4 -1
- package/components/in-field-progress-button.json +18 -0
- package/components/in-field-progress-circle.json +4 -1
- package/components/in-line-alert.json +11 -1
- package/components/link.json +19 -1
- package/components/list-view.json +18 -1
- package/components/menu.json +19 -1
- package/components/meter.json +4 -1
- package/components/number-field.json +24 -1
- package/components/opacity-checkerboard.json +4 -1
- package/components/picker.json +24 -1
- package/components/popover.json +12 -1
- package/components/progress-bar.json +4 -1
- package/components/progress-circle.json +4 -1
- package/components/radio-button.json +24 -1
- package/components/radio-group.json +17 -1
- package/components/rating.json +24 -1
- package/components/scroll-zoom-bar.json +12 -0
- package/components/search-field.json +28 -1
- package/components/segmented-control.json +18 -1
- package/components/select-box.json +18 -1
- package/components/side-navigation.json +18 -1
- package/components/slider.json +24 -1
- package/components/standard-dialog.json +19 -1
- package/components/standard-panel.json +3 -0
- package/components/status-light.json +4 -1
- package/components/steplist.json +18 -1
- package/components/swatch-group.json +12 -1
- package/components/swatch.json +18 -1
- package/components/switch.json +19 -1
- package/components/tab-bar-ios.json +17 -0
- package/components/table.json +23 -1
- package/components/tabs.json +18 -1
- package/components/tag-field.json +18 -1
- package/components/tag-group.json +18 -1
- package/components/tag.json +18 -1
- package/components/takeover-dialog.json +19 -1
- package/components/text-area.json +28 -1
- package/components/text-field.json +28 -1
- package/components/thumbnail.json +4 -1
- package/components/title.json +40 -10
- package/components/toast.json +13 -1
- package/components/tooltip.json +17 -1
- package/components/tray.json +11 -0
- package/components/tree-view.json +19 -1
- package/conformance/README.md +7 -7
- package/conformance/invalid/SPEC-001/dataset.json +10 -0
- package/conformance/invalid/SPEC-001/expected-errors.json +1 -1
- package/conformance/invalid/SPEC-002/dataset.json +16 -0
- package/conformance/invalid/SPEC-002/expected-errors.json +1 -1
- package/conformance/invalid/SPEC-003/dataset.json +15 -0
- package/conformance/invalid/SPEC-003/expected-errors.json +1 -1
- package/conformance/invalid/SPEC-004/dataset.json +15 -0
- package/conformance/invalid/SPEC-004/expected-errors.json +1 -1
- package/conformance/invalid/SPEC-005/dataset.json +11 -0
- package/conformance/invalid/SPEC-005/expected-errors.json +1 -1
- package/conformance/invalid/SPEC-006/dataset.json +15 -0
- package/conformance/invalid/SPEC-006/expected-errors.json +1 -1
- package/conformance/invalid/SPEC-007/dataset.json +9 -0
- package/conformance/invalid/SPEC-007/expected-errors.json +10 -0
- package/conformance/invalid/SPEC-008/dataset.json +25 -0
- package/conformance/invalid/SPEC-008/expected-errors.json +2 -1
- package/conformance/invalid/SPEC-009/dataset.json +12 -0
- package/conformance/invalid/SPEC-009/expected-errors.json +10 -0
- package/conformance/invalid/SPEC-010/dataset.json +12 -0
- package/conformance/invalid/SPEC-011/dataset.json +25 -0
- package/conformance/invalid/SPEC-012/dataset.json +16 -0
- package/conformance/invalid/SPEC-013/dataset.json +11 -0
- package/conformance/invalid/SPEC-014/dataset.json +12 -0
- package/conformance/invalid/SPEC-014/expected-errors.json +1 -1
- package/conformance/invalid/SPEC-015/dataset.json +22 -0
- package/conformance/invalid/SPEC-015/expected-errors.json +10 -0
- package/conformance/invalid/SPEC-015/tokens.tokens.json +19 -0
- package/conformance/invalid/SPEC-016/dataset.json +11 -0
- package/conformance/invalid/SPEC-016/expected-errors.json +2 -2
- package/conformance/invalid/SPEC-017/dataset.json +10 -0
- package/conformance/invalid/SPEC-024/dataset.json +4 -3
- package/conformance/invalid/SPEC-024/expected-errors.json +2 -2
- package/conformance/invalid/SPEC-025/dataset.json +12 -0
- package/conformance/invalid/SPEC-025/expected-errors.json +10 -0
- package/conformance/invalid/SPEC-026/dataset.json +18 -0
- package/conformance/invalid/SPEC-026/expected-errors.json +10 -0
- package/conformance/invalid/SPEC-028/dataset.json +21 -0
- package/conformance/invalid/SPEC-028/expected-errors.json +10 -0
- package/conformance/invalid/SPEC-029/dataset.json +20 -0
- package/conformance/invalid/SPEC-029/expected-errors.json +10 -0
- package/conformance/invalid/SPEC-030/dataset.json +15 -0
- package/conformance/invalid/SPEC-030/expected-errors.json +10 -0
- package/conformance/invalid/SPEC-031/dataset.json +17 -0
- package/conformance/invalid/SPEC-031/expected-errors.json +10 -0
- package/conformance/invalid/SPEC-032/dataset.json +27 -0
- package/conformance/invalid/SPEC-032/expected-errors.json +15 -0
- package/conformance/resolution/base-fallback/expected.json +1 -1
- package/conformance/resolution/product-layer-wins/expected.json +5 -0
- package/conformance/resolution/product-layer-wins/input/tokens.tokens.json +7 -0
- package/conformance/resolution/product-layer-wins/product-context.json +11 -0
- package/conformance/resolution/product-layer-wins/query.json +4 -0
- package/conformance/resolution/specificity-wins/expected.json +1 -1
- package/conformance/valid/SPEC-014/dataset.json +12 -0
- package/conformance/valid/SPEC-016/dataset.json +16 -0
- package/conformance/valid/SPEC-025/dataset.json +24 -0
- package/conformance/valid/SPEC-026/dataset.json +15 -0
- package/conformance/valid/SPEC-028/dataset.json +21 -0
- package/conformance/valid/SPEC-029/dataset.json +24 -0
- package/conformance/valid/SPEC-030/dataset.json +17 -0
- package/conformance/valid/SPEC-031/dataset.json +24 -0
- package/conformance/valid/SPEC-032/dataset.json +16 -0
- package/conformance/valid/component-refs/README.md +5 -0
- package/conformance/valid/component-with-accessibility.json +32 -0
- package/fields/color-scheme.json +2 -2
- package/fields/contrast.json +2 -2
- package/fields/density.json +1 -1
- package/fields/scale.json +2 -2
- package/fields/size.json +1 -1
- package/package.json +4 -13
- package/rules/rules.yaml +40 -4
- package/schemas/accessibility.schema.json +60 -0
- package/schemas/component.schema.json +19 -0
- package/schemas/field.schema.json +2 -2
- package/schemas/manifest.schema.json +1 -1
- package/schemas/{dimension.schema.json → mode-set.schema.json} +3 -3
- package/schemas/token.schema.json +5 -5
- package/schemas/value-types/README.md +20 -0
- package/schemas/value-types/drop-shadow.schema.json +5 -5
- package/schemas/value-types/typography-scale.schema.json +2 -2
- package/schemas/value-types/typography.schema.json +5 -5
- package/spec/accessibility-adapters.md +219 -0
- package/spec/agent-surface.md +4 -4
- package/spec/cascade.md +7 -7
- package/spec/component-format.md +32 -0
- package/spec/document-blocks.md +1 -1
- package/spec/index.md +22 -20
- package/spec/manifest.md +2 -2
- package/spec/mode-sets.md +64 -0
- package/spec/query.md +18 -18
- package/spec/taxonomy.md +5 -5
- package/spec/token-format.md +12 -12
- package/spec/dimensions.md +0 -64
- package/src/canonical.js +0 -61
- package/src/validate.js +0 -190
- /package/conformance/resolution/alias-resolved-after-cascade/{dimensions → mode-sets}/color-scheme.json +0 -0
- /package/conformance/resolution/base-fallback/{dimensions → mode-sets}/color-scheme.json +0 -0
- /package/conformance/resolution/specificity-wins/{dimensions → mode-sets}/color-scheme.json +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tokens": [],
|
|
3
|
+
"components": [
|
|
4
|
+
{
|
|
5
|
+
"$id": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/components/button.json",
|
|
6
|
+
"name": "button",
|
|
7
|
+
"displayName": "Button",
|
|
8
|
+
"meta": {
|
|
9
|
+
"category": "actions",
|
|
10
|
+
"documentationUrl": "https://spectrum.adobe.com/page/button/"
|
|
11
|
+
},
|
|
12
|
+
"documentBlocks": [
|
|
13
|
+
{
|
|
14
|
+
"type": "purpose",
|
|
15
|
+
"content": "Triggers an action when clicked."
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "usage",
|
|
19
|
+
"content": "Place in forms and dialogs."
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tokens": [],
|
|
3
|
+
"components": [
|
|
4
|
+
{
|
|
5
|
+
"$id": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/components/button.json",
|
|
6
|
+
"name": "button",
|
|
7
|
+
"displayName": "Button",
|
|
8
|
+
"meta": {
|
|
9
|
+
"category": "actions",
|
|
10
|
+
"documentationUrl": "https://spectrum.adobe.com/page/button/"
|
|
11
|
+
},
|
|
12
|
+
"accessibility": {
|
|
13
|
+
"role": "button"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tokens": [],
|
|
3
|
+
"components": [
|
|
4
|
+
{
|
|
5
|
+
"$id": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/components/button.json",
|
|
6
|
+
"name": "button",
|
|
7
|
+
"displayName": "Button",
|
|
8
|
+
"meta": {
|
|
9
|
+
"category": "actions",
|
|
10
|
+
"documentationUrl": "https://spectrum.adobe.com/page/button/"
|
|
11
|
+
},
|
|
12
|
+
"accessibility": {
|
|
13
|
+
"role": "button",
|
|
14
|
+
"wcag": [
|
|
15
|
+
{
|
|
16
|
+
"criterion": "1.4.3",
|
|
17
|
+
"level": "AA",
|
|
18
|
+
"notes": "Meets minimum contrast."
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tokens": [
|
|
3
|
+
{
|
|
4
|
+
"name": { "property": "background-color-default" },
|
|
5
|
+
"value": "#ffffff",
|
|
6
|
+
"uuid": "dddddddd-0032-4000-8000-000000000001"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"name": { "property": "background-color-default" },
|
|
10
|
+
"value": "#eeeeee",
|
|
11
|
+
"uuid": "dddddddd-0032-4000-8000-000000000001",
|
|
12
|
+
"$layer": "product"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"components": []
|
|
16
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# component-refs
|
|
2
|
+
|
|
3
|
+
Regression fixture for the valid-fixture conformance harness. Not tied to a specific SPEC rule.
|
|
4
|
+
|
|
5
|
+
Contains a realistic button component declaration paired with tokens that reference it, asserting that the full rule set produces zero errors against a well-formed component + token dataset. Guards against new rules accidentally flagging valid cross-reference patterns.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"components": [
|
|
3
|
+
{
|
|
4
|
+
"$id": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/components/button.json",
|
|
5
|
+
"name": "button",
|
|
6
|
+
"displayName": "Button",
|
|
7
|
+
"meta": {
|
|
8
|
+
"category": "actions",
|
|
9
|
+
"documentationUrl": "https://spectrum.adobe.com/page/button/"
|
|
10
|
+
},
|
|
11
|
+
"accessibility": {
|
|
12
|
+
"role": "button",
|
|
13
|
+
"intents": ["trigger"],
|
|
14
|
+
"focusable": true,
|
|
15
|
+
"keyboardIntents": ["activate"],
|
|
16
|
+
"wcag": [
|
|
17
|
+
{ "criterion": "4.1.2", "level": "A", "title": "Name, Role, Value" }
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"states": [
|
|
21
|
+
{
|
|
22
|
+
"name": "disabled",
|
|
23
|
+
"trigger": "prop",
|
|
24
|
+
"precedence": 100,
|
|
25
|
+
"announce": "Button disabled",
|
|
26
|
+
"communicates": "disabled",
|
|
27
|
+
"blocksInteraction": true
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
package/fields/color-scheme.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
|
|
3
3
|
"specVersion": "1.0.0-draft",
|
|
4
4
|
"name": "colorScheme",
|
|
5
|
-
"description": "Theme / appearance
|
|
6
|
-
"kind": "
|
|
5
|
+
"description": "Theme / appearance mode set. Controls which color scheme a token applies to (e.g. light, dark, wireframe). Drives cascade resolution.",
|
|
6
|
+
"kind": "mode-set",
|
|
7
7
|
"registry": null,
|
|
8
8
|
"validation": "strict",
|
|
9
9
|
"serialization": {
|
package/fields/contrast.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
|
|
3
3
|
"specVersion": "1.0.0-draft",
|
|
4
4
|
"name": "contrast",
|
|
5
|
-
"description": "Contrast level
|
|
6
|
-
"kind": "
|
|
5
|
+
"description": "Contrast level mode set (e.g. regular, high). Drives cascade resolution.",
|
|
6
|
+
"kind": "mode-set",
|
|
7
7
|
"registry": null,
|
|
8
8
|
"validation": "strict",
|
|
9
9
|
"serialization": {
|
package/fields/density.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
|
|
3
3
|
"specVersion": "1.0.0-draft",
|
|
4
4
|
"name": "density",
|
|
5
|
-
"description": "Space density within or around component parts (e.g. spacious, compact). Distinct from the
|
|
5
|
+
"description": "Space density within or around component parts (e.g. spacious, compact). Distinct from the `scale` mode set.",
|
|
6
6
|
"kind": "semantic",
|
|
7
7
|
"registry": "packages/design-system-registry/registry/densities.json",
|
|
8
8
|
"validation": "advisory",
|
package/fields/scale.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
|
|
3
3
|
"specVersion": "1.0.0-draft",
|
|
4
4
|
"name": "scale",
|
|
5
|
-
"description": "Platform density scale
|
|
6
|
-
"kind": "
|
|
5
|
+
"description": "Platform density scale mode set (e.g. desktop, mobile). Drives cascade resolution.",
|
|
6
|
+
"kind": "mode-set",
|
|
7
7
|
"registry": null,
|
|
8
8
|
"validation": "strict",
|
|
9
9
|
"serialization": {
|
package/fields/size.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/field.schema.json",
|
|
3
3
|
"specVersion": "1.0.0-draft",
|
|
4
4
|
"name": "size",
|
|
5
|
-
"description": "Relative t-shirt sizing of a component or token (e.g. small, medium, large, extra-large). Distinct from
|
|
5
|
+
"description": "Relative t-shirt sizing of a component or token (e.g. small, medium, large, extra-large). Distinct from the `scale` mode set.",
|
|
6
6
|
"kind": "semantic",
|
|
7
7
|
"registry": "packages/design-system-registry/registry/sizes.json",
|
|
8
8
|
"validation": "advisory",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/design-data-spec",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.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": {
|
|
@@ -22,16 +22,14 @@
|
|
|
22
22
|
"./package.json": "./package.json",
|
|
23
23
|
"./components/*.json": "./components/*.json",
|
|
24
24
|
"./schemas/token.schema.json": "./schemas/token.schema.json",
|
|
25
|
-
"./schemas/
|
|
25
|
+
"./schemas/mode-set.schema.json": "./schemas/mode-set.schema.json",
|
|
26
26
|
"./schemas/field.schema.json": "./schemas/field.schema.json",
|
|
27
27
|
"./schemas/manifest.schema.json": "./schemas/manifest.schema.json",
|
|
28
28
|
"./schemas/value-types/color.schema.json": "./schemas/value-types/color.schema.json",
|
|
29
29
|
"./schemas/component.schema.json": "./schemas/component.schema.json",
|
|
30
30
|
"./schemas/anatomy-part.schema.json": "./schemas/anatomy-part.schema.json",
|
|
31
31
|
"./schemas/state-declaration.schema.json": "./schemas/state-declaration.schema.json",
|
|
32
|
-
"./rules/rules.yaml": "./rules/rules.yaml"
|
|
33
|
-
"./src/validate.js": "./src/validate.js",
|
|
34
|
-
"./src/canonical.js": "./src/canonical.js"
|
|
32
|
+
"./rules/rules.yaml": "./rules/rules.yaml"
|
|
35
33
|
},
|
|
36
34
|
"files": [
|
|
37
35
|
"components",
|
|
@@ -40,13 +38,6 @@
|
|
|
40
38
|
"rules",
|
|
41
39
|
"schemas",
|
|
42
40
|
"spec",
|
|
43
|
-
"src",
|
|
44
41
|
"README.md"
|
|
45
|
-
]
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"ava": "^6.0.1"
|
|
48
|
-
},
|
|
49
|
-
"scripts": {
|
|
50
|
-
"test": "ava"
|
|
51
|
-
}
|
|
42
|
+
]
|
|
52
43
|
}
|
package/rules/rules.yaml
CHANGED
|
@@ -42,9 +42,9 @@ rules:
|
|
|
42
42
|
name: cascade-coverage
|
|
43
43
|
severity: error
|
|
44
44
|
category: completeness
|
|
45
|
-
assert:
|
|
46
|
-
message: "
|
|
47
|
-
spec_ref: spec/
|
|
45
|
+
assert: Mode set declarations MUST satisfy coverage rules (e.g. default ∈ modes; peer mode requirements from coverage metadata).
|
|
46
|
+
message: "Mode-set coverage violation for {mode_set}"
|
|
47
|
+
spec_ref: spec/mode-sets.md#coverage-validation
|
|
48
48
|
introduced_in: "1.0.0-draft"
|
|
49
49
|
|
|
50
50
|
- id: SPEC-006
|
|
@@ -69,7 +69,7 @@ rules:
|
|
|
69
69
|
name: cascade-completeness
|
|
70
70
|
severity: warning
|
|
71
71
|
category: completeness
|
|
72
|
-
assert: For every cascade token that has a non-default mode variant, a base/default variant (name object with no
|
|
72
|
+
assert: For every cascade token that has a non-default mode variant, a base/default variant (name object with no mode set fields for that mode set, or explicitly the default mode value) MUST also exist in the dataset. Ensures all consumers can resolve without a fallback gap.
|
|
73
73
|
message: "Token property '{property}' has mode variant '{mode}' but no base/default variant"
|
|
74
74
|
spec_ref: spec/cascade.md#coverage
|
|
75
75
|
introduced_in: "1.0.0-draft"
|
|
@@ -268,3 +268,39 @@ rules:
|
|
|
268
268
|
message: "'{entity}' has documentBlocks but no purpose block — add a block with type 'purpose'"
|
|
269
269
|
spec_ref: spec/document-blocks.md
|
|
270
270
|
introduced_in: "1.0.0-draft"
|
|
271
|
+
|
|
272
|
+
- id: SPEC-030
|
|
273
|
+
name: accessibility-empty
|
|
274
|
+
severity: warning
|
|
275
|
+
category: completeness
|
|
276
|
+
assert: >
|
|
277
|
+
A component declaration that carries an accessibility object SHOULD populate at least one
|
|
278
|
+
of the five known fields (role, intents, focusable, keyboardIntents, wcag). An entirely
|
|
279
|
+
empty accessibility object provides no semantic value and should be populated or removed.
|
|
280
|
+
message: "Component '{entity}' has an empty accessibility object — populate at least one field or remove the property"
|
|
281
|
+
spec_ref: spec/accessibility.md
|
|
282
|
+
introduced_in: "1.0.0-draft"
|
|
283
|
+
|
|
284
|
+
- id: SPEC-031
|
|
285
|
+
name: accessibility-wcag-missing
|
|
286
|
+
severity: warning
|
|
287
|
+
category: completeness
|
|
288
|
+
assert: >
|
|
289
|
+
A component whose accessibility declaration includes a role SHOULD also include a non-empty
|
|
290
|
+
wcag array listing applicable WCAG 2.x success criteria. WCAG citations improve audit
|
|
291
|
+
traceability for components with a named semantic role.
|
|
292
|
+
message: "Component '{entity}' accessibility has a role but no wcag entries — add applicable WCAG 2.x success criteria"
|
|
293
|
+
spec_ref: spec/accessibility.md
|
|
294
|
+
introduced_in: "1.0.0-draft"
|
|
295
|
+
|
|
296
|
+
- id: SPEC-032
|
|
297
|
+
name: product-layer-override-type-compat
|
|
298
|
+
severity: error
|
|
299
|
+
category: cascade
|
|
300
|
+
assert: >
|
|
301
|
+
A Platform- or Product-layer token that overrides a Foundation token (matched by UUID)
|
|
302
|
+
MUST NOT change the JSON value type of the `value` field. Overrides may change the value
|
|
303
|
+
but must preserve its JSON kind (string, number, object, array, boolean).
|
|
304
|
+
message: "Token '{entity}' override changes value type from '{foundationType}' to '{overrideType}' — overrides MUST NOT change the resolved token's value type"
|
|
305
|
+
spec_ref: spec/cascade.md
|
|
306
|
+
introduced_in: "1.0.0-draft"
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/accessibility.schema.json",
|
|
4
|
+
"title": "Accessibility declaration",
|
|
5
|
+
"description": "Semantic accessibility vocabulary for a component declaration. See spec/accessibility.md.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"role": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"minLength": 1,
|
|
11
|
+
"description": "Semantic role from the canonical vocabulary (e.g. 'button', 'checkbox', 'dialog')."
|
|
12
|
+
},
|
|
13
|
+
"intents": {
|
|
14
|
+
"type": "array",
|
|
15
|
+
"items": { "type": "string", "minLength": 1 },
|
|
16
|
+
"uniqueItems": true,
|
|
17
|
+
"description": "Semantic interaction intents (e.g. 'trigger', 'select', 'expand')."
|
|
18
|
+
},
|
|
19
|
+
"focusable": {
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"description": "Whether the component receives keyboard focus via the Tab key by default."
|
|
22
|
+
},
|
|
23
|
+
"keyboardIntents": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"items": { "type": "string", "minLength": 1 },
|
|
26
|
+
"uniqueItems": true,
|
|
27
|
+
"description": "Keyboard interaction intents when focused (e.g. 'activate', 'expand', 'dismiss')."
|
|
28
|
+
},
|
|
29
|
+
"wcag": {
|
|
30
|
+
"type": "array",
|
|
31
|
+
"items": { "$ref": "#/$defs/wcagEntry" },
|
|
32
|
+
"uniqueItems": true,
|
|
33
|
+
"description": "Applicable WCAG 2.x success criteria."
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"additionalProperties": false,
|
|
37
|
+
"$defs": {
|
|
38
|
+
"wcagEntry": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"required": ["criterion", "level"],
|
|
41
|
+
"properties": {
|
|
42
|
+
"criterion": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"pattern": "^[1-4]\\.[0-9]+\\.[0-9]+$",
|
|
45
|
+
"description": "WCAG 2.x criterion number (e.g. '1.3.1')."
|
|
46
|
+
},
|
|
47
|
+
"level": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"enum": ["A", "AA", "AAA"],
|
|
50
|
+
"description": "WCAG conformance level."
|
|
51
|
+
},
|
|
52
|
+
"title": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"description": "Human-readable criterion title (e.g. 'Info and Relationships')."
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"additionalProperties": false
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -74,6 +74,10 @@
|
|
|
74
74
|
"items": { "$ref": "document-block.schema.json" },
|
|
75
75
|
"minItems": 1,
|
|
76
76
|
"description": "Typed prose blocks for this component. See spec/document-blocks.md (Phase 9)."
|
|
77
|
+
},
|
|
78
|
+
"accessibility": {
|
|
79
|
+
"$ref": "accessibility.schema.json",
|
|
80
|
+
"description": "Semantic accessibility vocabulary for this component. See spec/accessibility.md (Phase 7)."
|
|
77
81
|
}
|
|
78
82
|
},
|
|
79
83
|
"additionalProperties": false,
|
|
@@ -245,6 +249,21 @@
|
|
|
245
249
|
"type": "boolean",
|
|
246
250
|
"default": false,
|
|
247
251
|
"description": "true for states that compose with others (e.g. focus ring layered over hover)."
|
|
252
|
+
},
|
|
253
|
+
"announce": {
|
|
254
|
+
"type": "string",
|
|
255
|
+
"minLength": 1,
|
|
256
|
+
"description": "Screen-reader announcement hint for this state transition. See spec/accessibility.md."
|
|
257
|
+
},
|
|
258
|
+
"communicates": {
|
|
259
|
+
"type": "string",
|
|
260
|
+
"minLength": 1,
|
|
261
|
+
"description": "Semantic meaning conveyed to AT when this state is active (e.g. 'expanded', 'disabled'). See spec/accessibility.md."
|
|
262
|
+
},
|
|
263
|
+
"blocksInteraction": {
|
|
264
|
+
"type": "boolean",
|
|
265
|
+
"default": false,
|
|
266
|
+
"description": "Whether this state prevents all user interaction. See spec/accessibility.md."
|
|
248
267
|
}
|
|
249
268
|
},
|
|
250
269
|
"additionalProperties": false
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
},
|
|
24
24
|
"kind": {
|
|
25
25
|
"type": "string",
|
|
26
|
-
"enum": ["semantic", "
|
|
27
|
-
"description": "Whether this field participates in serialization ordering or cascade resolution. 'semantic' fields describe identity and appear in the standard serialization order; '
|
|
26
|
+
"enum": ["semantic", "mode-set", "numeric"],
|
|
27
|
+
"description": "Whether this field participates in serialization ordering or cascade resolution. 'semantic' fields describe identity and appear in the standard serialization order; 'mode-set' 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": [
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/
|
|
4
|
-
"title": "
|
|
5
|
-
"description": "Layer 1 — declares a
|
|
3
|
+
"$id": "https://opensource.adobe.com/spectrum-design-data/schemas/v0/mode-set.schema.json",
|
|
4
|
+
"title": "Mode Set declaration",
|
|
5
|
+
"description": "Layer 1 — declares a mode set name, allowed modes, and default. default ∈ modes is validated in Layer 2 (SPEC-005) where needed.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"required": ["name", "modes", "default"],
|
|
8
8
|
"properties": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"$defs": {
|
|
16
16
|
"nameObject": {
|
|
17
17
|
"type": "object",
|
|
18
|
-
"description": "Structured token identity. Semantic fields describe identity and structure;
|
|
18
|
+
"description": "Structured token identity. Semantic fields describe identity and structure; mode-set fields drive cascade resolution. See spec/taxonomy.md and spec/token-format.md. Additional mode-set keys MUST be strings.",
|
|
19
19
|
"required": ["property"],
|
|
20
20
|
"properties": {
|
|
21
21
|
"property": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
},
|
|
62
62
|
"size": {
|
|
63
63
|
"type": "string",
|
|
64
|
-
"description": "Semantic: relative t-shirt sizing (e.g. small, medium, large). Distinct from
|
|
64
|
+
"description": "Semantic: relative t-shirt sizing (e.g. small, medium, large). Distinct from the `scale` mode set."
|
|
65
65
|
},
|
|
66
66
|
"density": {
|
|
67
67
|
"type": "string",
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
},
|
|
74
74
|
"colorScheme": {
|
|
75
75
|
"type": "string",
|
|
76
|
-
"description": "
|
|
76
|
+
"description": "Mode set: color scheme mode (e.g. light, dark, wireframe)."
|
|
77
77
|
},
|
|
78
78
|
"scale": {
|
|
79
79
|
"type": "string",
|
|
80
|
-
"description": "
|
|
80
|
+
"description": "Mode set: platform density scale (e.g. desktop, mobile)."
|
|
81
81
|
},
|
|
82
82
|
"contrast": {
|
|
83
83
|
"type": "string",
|
|
84
|
-
"description": "
|
|
84
|
+
"description": "Mode set: contrast level (e.g. regular, high)."
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
"additionalProperties": {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Value-Type Schemas
|
|
2
|
+
|
|
3
|
+
JSON Schema files under this directory define the shape of token `value` fields for each value-type. They are referenced by the `$valueType` field on tokens and validated by SPEC-016.
|
|
4
|
+
|
|
5
|
+
## Composite sub-key type annotations (`x-valueType`)
|
|
6
|
+
|
|
7
|
+
Each property within a composite value-type schema (e.g. typography, drop-shadow) carries an `x-valueType` extension keyword that declares the expected scalar value-type of that sub-value when it is an inline alias reference (`{token-name}`).
|
|
8
|
+
|
|
9
|
+
* **Type**: string or array of strings. Array form means any of the listed types is acceptable.
|
|
10
|
+
* **Recognized scalar type names**: `color`, `dimension`, `number`, `font-family`, `font-weight`.
|
|
11
|
+
* **Consumer**: `sdk/core/src/validate/rules/spec015.rs` (SPEC-015 — composite inline alias type compatibility).
|
|
12
|
+
|
|
13
|
+
Example from `typography.schema.json`:
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
"fontSize": { "type": "string", "x-valueType": "dimension" },
|
|
17
|
+
"lineHeight": { "type": "string", "x-valueType": ["dimension", "number"] }
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The scalar type names are an interim vocabulary. Once individual primitive value-type schemas exist under this directory (e.g. `dimension.schema.json`), `x-valueType` values will migrate to schema-relative paths matching the `$valueType` convention (e.g. `"value-types/dimension.schema.json"`).
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
"items": {
|
|
8
8
|
"type": "object",
|
|
9
9
|
"properties": {
|
|
10
|
-
"x": { "type": "string" },
|
|
11
|
-
"y": { "type": "string" },
|
|
12
|
-
"blur": { "type": "string" },
|
|
13
|
-
"spread": { "type": "string" },
|
|
14
|
-
"color": { "type": "string" }
|
|
10
|
+
"x": { "type": "string", "x-valueType": "dimension" },
|
|
11
|
+
"y": { "type": "string", "x-valueType": "dimension" },
|
|
12
|
+
"blur": { "type": "string", "x-valueType": "dimension" },
|
|
13
|
+
"spread": { "type": "string", "x-valueType": "dimension" },
|
|
14
|
+
"color": { "type": "string", "x-valueType": "color" }
|
|
15
15
|
},
|
|
16
16
|
"required": ["x", "y", "blur", "spread", "color"],
|
|
17
17
|
"additionalProperties": false
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
"description": "Pairs a font size with its corresponding line height at a single typographic tier.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"fontSize": { "type": "string" },
|
|
9
|
-
"lineHeight": { "type": "string" }
|
|
8
|
+
"fontSize": { "type": "string", "x-valueType": "dimension" },
|
|
9
|
+
"lineHeight": { "type": "string", "x-valueType": ["dimension", "number"] }
|
|
10
10
|
},
|
|
11
11
|
"required": ["fontSize", "lineHeight"],
|
|
12
12
|
"additionalProperties": false
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"description": "Object bundling font properties for a typographic style. Sub-values may be literal strings or inline alias references ({token-name}).",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"fontFamily": { "type": "string" },
|
|
9
|
-
"fontSize": { "type": "string" },
|
|
10
|
-
"fontWeight": { "type": "string" },
|
|
11
|
-
"letterSpacing": { "type": "string" },
|
|
12
|
-
"lineHeight": { "type": "string" }
|
|
8
|
+
"fontFamily": { "type": "string", "x-valueType": "font-family" },
|
|
9
|
+
"fontSize": { "type": "string", "x-valueType": "dimension" },
|
|
10
|
+
"fontWeight": { "type": "string", "x-valueType": "font-weight" },
|
|
11
|
+
"letterSpacing": { "type": "string", "x-valueType": "dimension" },
|
|
12
|
+
"lineHeight": { "type": "string", "x-valueType": ["dimension", "number"] }
|
|
13
13
|
},
|
|
14
14
|
"required": ["fontFamily", "fontSize", "fontWeight", "lineHeight"],
|
|
15
15
|
"additionalProperties": false
|