@diegovelasquezweb/a11y-engine 0.6.4 → 0.6.5

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.
@@ -107,7 +107,7 @@ export default {
107
107
  {
108
108
  id: "A",
109
109
  label: "Level A",
110
- badge: "Minimum",
110
+ tag: "Minimum",
111
111
  description: "The baseline: essential requirements that remove the most severe barriers.",
112
112
  shortDescription: "Minimum baseline",
113
113
  hint: "Failing Level A means some users cannot access the content at all.",
@@ -116,7 +116,7 @@ export default {
116
116
  {
117
117
  id: "AA",
118
118
  label: "Level AA",
119
- badge: "Standard",
119
+ tag: "Standard",
120
120
  description: "The recommended target for most websites — required by most accessibility laws.",
121
121
  shortDescription: "Recommended for most websites",
122
122
  hint: "Referenced by ADA, Section 508, EN 301 549, and EAA.",
@@ -125,7 +125,7 @@ export default {
125
125
  {
126
126
  id: "AAA",
127
127
  label: "Level AAA",
128
- badge: "Enhanced",
128
+ tag: "Enhanced",
129
129
  description: "The highest conformance level — not required but beneficial for specialized audiences.",
130
130
  shortDescription: "Strictest — not required by most regulations",
131
131
  hint: "Full AAA conformance is not recommended as a general policy for entire sites.",
@@ -251,21 +251,21 @@ export default {
251
251
  {
252
252
  id: "wcag-2-0",
253
253
  title: "WCAG 2.0",
254
- badge: "2008",
254
+ tag: "2008",
255
255
  summary: "The original W3C recommendation that established the foundation for web accessibility.",
256
256
  body: "Introduced the four principles (Perceivable, Operable, Understandable, Robust) and three conformance levels (A, AA, AAA). Covers core requirements like text alternatives, keyboard access, color contrast, and form labels. Still widely referenced in legal frameworks worldwide.",
257
257
  },
258
258
  {
259
259
  id: "wcag-2-1",
260
260
  title: "WCAG 2.1",
261
- badge: "2018",
261
+ tag: "2018",
262
262
  summary: "Extended 2.0 with 17 new success criteria for mobile, low vision, and cognitive disabilities.",
263
263
  body: "Added criteria for touch targets (2.5.5), text spacing (1.4.12), content reflow (1.4.10), orientation (1.3.4), and input purpose (1.3.5). Required by the European Accessibility Act (EAA) and referenced in updated ADA guidance. All 2.0 criteria remain \u2014 2.1 is a superset.",
264
264
  },
265
265
  {
266
266
  id: "wcag-2-2",
267
267
  title: "WCAG 2.2",
268
- badge: "2023",
268
+ tag: "2023",
269
269
  summary: "The latest version, adding 9 new criteria focused on cognitive accessibility and consistent help.",
270
270
  body: "Key additions include consistent help (3.2.6), accessible authentication (3.3.8), dragging movements (2.5.7), and focus appearance (2.4.11/2.4.12). Removed criterion 4.1.1 (Parsing) as it\u2019s now handled by modern browsers. Supersedes both 2.0 and 2.1 \u2014 all prior criteria are included.",
271
271
  },
@@ -278,21 +278,21 @@ export default {
278
278
  {
279
279
  id: "level-a",
280
280
  title: "Level A",
281
- badge: "Minimum",
281
+ tag: "Minimum",
282
282
  summary: "The baseline: essential requirements that remove the most severe barriers.",
283
283
  body: "Covers fundamentals like non-text content alternatives (1.1.1), keyboard operability (2.1.1), page titles (2.4.2), and language of the page (3.1.1). Failing Level A means some users cannot access the content at all. Every site should meet Level A at minimum.",
284
284
  },
285
285
  {
286
286
  id: "level-aa",
287
287
  title: "Level AA",
288
- badge: "Standard",
288
+ tag: "Standard",
289
289
  summary: "The recommended target for most websites \u2014 required by most accessibility laws.",
290
290
  body: "Includes all Level A criteria plus requirements for color contrast (1.4.3 \u2014 4.5:1 ratio), resize text (1.4.4), focus visible (2.4.7), error suggestion (3.3.3), and consistent navigation (3.2.3). Referenced by ADA, Section 508, EN 301 549, and EAA. This is the standard the scanner defaults to.",
291
291
  },
292
292
  {
293
293
  id: "level-aaa",
294
294
  title: "Level AAA",
295
- badge: "Enhanced",
295
+ tag: "Enhanced",
296
296
  summary: "The highest conformance level \u2014 not required but beneficial for specialized audiences.",
297
297
  body: "Adds stricter contrast (1.4.6 \u2014 7:1 ratio), sign language for audio (1.2.6), extended audio description (1.2.7), and reading level (3.1.5). Full AAA conformance is not recommended as a general policy because some criteria cannot be satisfied for all content types. Useful for targeted sections like education or government services.",
298
298
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegovelasquezweb/a11y-engine",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "WCAG 2.2 AA accessibility audit engine — scanner, analyzer, and report builders",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- // ---------------------------------------------------------------------------
2
- // Core types
3
- // ---------------------------------------------------------------------------
1
+
2
+
3
+
4
4
 
5
5
  export interface Finding {
6
6
  id: string;
@@ -135,9 +135,9 @@ export interface AuditSummary {
135
135
  totalFindings: number;
136
136
  }
137
137
 
138
- // ---------------------------------------------------------------------------
139
- // Report types
140
- // ---------------------------------------------------------------------------
138
+
139
+
140
+
141
141
 
142
142
  export interface ScanPayload {
143
143
  findings: Finding[] | Record<string, unknown>[];
@@ -209,9 +209,9 @@ export interface SourcePatternOptions {
209
209
  onlyPattern?: string;
210
210
  }
211
211
 
212
- // ---------------------------------------------------------------------------
213
- // Knowledge APIs
214
- // ---------------------------------------------------------------------------
212
+
213
+
214
+
215
215
 
216
216
  export interface ScannerEngineHelp {
217
217
  id: "axe" | "cdp" | "pa11y" | string;
@@ -222,25 +222,53 @@ export interface ScannerEngineHelp {
222
222
  defaultEnabled: boolean;
223
223
  }
224
224
 
225
- export interface EnumOptionValue {
226
- value: string;
227
- label: string;
228
- description?: string;
229
- }
230
-
231
225
  export interface ScannerOptionHelp {
232
226
  id: string;
233
227
  label: string;
234
228
  description: string;
235
229
  defaultValue: unknown;
236
230
  type: string;
237
- allowedValues?: unknown[] | EnumOptionValue[];
231
+ allowedValues?: unknown[];
232
+ }
233
+
234
+ export interface GlossaryEntry {
235
+ term: string;
236
+ definition: string;
237
+ }
238
+
239
+ export interface ConceptEntry {
240
+ title: string;
241
+ body: string;
242
+ context?: string;
243
+ }
244
+
245
+ export interface PersonaReferenceItem {
246
+ id: string;
247
+ icon: string;
248
+ label: string;
249
+ description: string;
250
+ keywords: string[];
251
+ mappedRules: string[];
252
+ }
253
+
254
+ export interface PersonaReference {
255
+ locale: string;
256
+ version: string;
257
+ personas: PersonaReferenceItem[];
258
+ }
259
+
260
+ export interface ScannerHelp {
261
+ locale: string;
262
+ version: string;
263
+ title: string;
264
+ engines: ScannerEngineHelp[];
265
+ options: ScannerOptionHelp[];
238
266
  }
239
267
 
240
268
  export interface ConformanceLevel {
241
269
  id: "A" | "AA" | "AAA";
242
270
  label: string;
243
- badge: string;
271
+ tag: string;
244
272
  description: string;
245
273
  shortDescription: string;
246
274
  hint: string;
@@ -267,7 +295,7 @@ export interface DocArticle {
267
295
  id: string;
268
296
  title: string;
269
297
  icon?: string;
270
- badge?: string;
298
+ tag?: string;
271
299
  summary: string;
272
300
  body: string;
273
301
  }
@@ -335,9 +363,9 @@ export interface KnowledgeOptions {
335
363
  locale?: string;
336
364
  }
337
365
 
338
- // ---------------------------------------------------------------------------
339
- // Engine selection
340
- // ---------------------------------------------------------------------------
366
+
367
+
368
+
341
369
 
342
370
  export interface EngineSelection {
343
371
  axe?: boolean;
@@ -345,9 +373,9 @@ export interface EngineSelection {
345
373
  pa11y?: boolean;
346
374
  }
347
375
 
348
- // ---------------------------------------------------------------------------
349
- // Audit options
350
- // ---------------------------------------------------------------------------
376
+
377
+
378
+
351
379
 
352
380
  export interface RunAuditOptions {
353
381
  baseUrl: string;
@@ -372,17 +400,17 @@ export interface RunAuditOptions {
372
400
  onProgress?: (step: string, status: string, extra?: Record<string, unknown>) => void;
373
401
  }
374
402
 
375
- // ---------------------------------------------------------------------------
376
- // Enrichment options
377
- // ---------------------------------------------------------------------------
403
+
404
+
405
+
378
406
 
379
407
  export interface EnrichmentOptions {
380
408
  screenshotUrlBuilder?: (rawPath: string) => string;
381
409
  }
382
410
 
383
- // ---------------------------------------------------------------------------
384
- // Public API
385
- // ---------------------------------------------------------------------------
411
+
412
+
413
+
386
414
 
387
415
  export function runAudit(options: RunAuditOptions): Promise<ScanPayload>;
388
416