microsoft/hve-core

Public

mirrored from https://github.com/microsoft/hve-coreAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
7226b4c1944c0773b20eeb1b3be5a4aebf11d4e9

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

scripts/linting/schemas/aria-pattern.schema.json

101lines · modecode

1{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "$id": "https://raw.githubusercontent.com/microsoft/hve-core/main/scripts/linting/schemas/aria-pattern.schema.json",
4 "title": "Accessibility Framework Skill ARIA Pattern",
5 "description": "Validates per-pattern YAML items authored under .github/skills/accessibility/<framework-id>/items/<id>.yml for itemKind 'pattern'. The shape captures W3C ARIA Authoring Practices Guide composite-widget patterns: identifier, human-readable name, paraphrased summary, keyboard model taxonomy, focus-management strategy, related ARIA roles/states/properties, cross-walk to sibling Framework Skills (typically wcag-2-2 success criteria), and authoritative reference URLs. Identifiers are lower-kebab with hyphenated slugs matching the canonical APG pattern URL slug.",
6 "type": "object",
7 "required": ["id", "title", "itemKind", "summary", "references"],
8 "additionalProperties": false,
9 "properties": {
10 "id": {
11 "type": "string",
12 "minLength": 1,
13 "pattern": "^[a-z0-9][a-z0-9.-]*$",
14 "description": "Lower-kebab pattern identifier matching the canonical W3C APG URL slug (for example 'combobox-autocomplete-list', 'dialog-modal', 'treeview-file-directory')."
15 },
16 "title": {
17 "type": "string",
18 "minLength": 1,
19 "description": "Human-readable pattern name as it appears in the W3C APG table of contents."
20 },
21 "itemKind": {
22 "const": "pattern",
23 "description": "Discriminator marking this item as an ARIA APG pattern."
24 },
25 "summary": {
26 "type": "string",
27 "minLength": 1,
28 "maxLength": 200,
29 "description": "Paraphrased one-sentence description of the pattern (<=200 chars). Authors MUST NOT fabricate; paraphrase the canonical APG pattern page."
30 },
31 "keyboardModel": {
32 "type": "array",
33 "items": { "type": "string", "minLength": 1 },
34 "uniqueItems": true,
35 "description": "Coarse-grained taxonomy labels describing the dominant keyboard interaction model (for example 'menu', 'listbox', 'grid', 'modal', 'inline', 'tabs', 'tree', 'spinbutton', 'slider', 'toolbar')."
36 },
37 "focusManagement": {
38 "type": "string",
39 "enum": ["trap", "roving", "single", "none"],
40 "description": "Focus-management strategy: 'trap' (focus is trapped within the widget, e.g. modal dialog), 'roving' (single tab stop with arrow-key navigation among descendants), 'single' (widget is a single tab stop with no descendant focus), 'none' (no special focus handling beyond browser defaults)."
41 },
42 "relatedRoles": {
43 "type": "array",
44 "items": { "type": "string", "minLength": 1 },
45 "uniqueItems": true,
46 "description": "ARIA role identifiers participating in the pattern (for example 'combobox', 'listbox', 'option')."
47 },
48 "requiredStates": {
49 "type": "array",
50 "items": { "type": "string", "minLength": 1 },
51 "uniqueItems": true,
52 "description": "ARIA state attributes the pattern requires authors to manage (for example 'aria-expanded', 'aria-selected', 'aria-checked')."
53 },
54 "requiredProperties": {
55 "type": "array",
56 "items": { "type": "string", "minLength": 1 },
57 "uniqueItems": true,
58 "description": "ARIA property attributes the pattern requires authors to declare (for example 'aria-controls', 'aria-haspopup', 'aria-labelledby')."
59 },
60 "relatedSuccessCriteria": {
61 "type": "array",
62 "items": {
63 "type": "string",
64 "minLength": 1,
65 "pattern": "^[a-z][a-z0-9-]*:[a-z0-9][a-z0-9.-]*$"
66 },
67 "uniqueItems": true,
68 "description": "Cross-walk identifiers to sibling Framework Skill items, formatted as '<framework>:<item-id>' (for example 'wcag-2-2:2-1-1', 'wcag-2-2:4-1-2')."
69 },
70 "referenceImplementationUrl": {
71 "type": "string",
72 "format": "uri",
73 "description": "Canonical W3C APG pattern page URL containing the normative description and reference example."
74 },
75 "applicability": {
76 "type": "object",
77 "additionalProperties": false,
78 "properties": {
79 "discriminator": { "type": "string", "minLength": 1 },
80 "appliesWhen": {
81 "type": "array",
82 "items": { "type": "string", "minLength": 1 },
83 "uniqueItems": true
84 },
85 "naWhen": {
86 "type": "array",
87 "items": { "type": "string", "minLength": 1 },
88 "uniqueItems": true
89 },
90 "naReason": { "type": "string" }
91 }
92 },
93 "references": {
94 "type": "array",
95 "minItems": 1,
96 "items": { "type": "string", "format": "uri" },
97 "uniqueItems": true,
98 "description": "Authoritative references (canonical APG pattern URL is required; additional links MAY include WAI-ARIA spec sections or technique pages)."
99 }
100 }
101}
102