@flare-engine/a11y 0.2.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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/manager.ts","../src/helpers.ts","../src/bridge.ts","../src/audit.ts"],"sourcesContent":["import { Signal } from '@flare-engine/events';\n\nexport type ContrastLevel = 'normal' | 'high';\n\nexport interface A11ySettings {\n /** When true, animations and heavy postfx should be minimized. */\n reducedMotion: boolean;\n /** Current contrast preference — UI tokens swap accordingly. */\n contrast: ContrastLevel;\n /** Global UI scale multiplier (`1` = default). */\n uiScale: number;\n}\n\nexport interface A11yManagerOptions {\n initial?: Partial<A11ySettings>;\n}\n\nconst DEFAULTS: A11ySettings = {\n reducedMotion: false,\n contrast: 'normal',\n uiScale: 1,\n};\n\n/**\n * Central accessibility state. Systems subscribe via `onChange` and read the\n * current snapshot via `settings`. The manager owns no platform wiring — a\n * host app may bridge OS preferences (e.g., `AccessibilityInfo.isReduceMotionEnabled`)\n * by pushing values in on startup.\n */\nexport class A11yManager {\n readonly onChange = new Signal<A11ySettings>();\n private _settings: A11ySettings;\n\n constructor(options: A11yManagerOptions = {}) {\n this._settings = { ...DEFAULTS, ...options.initial };\n }\n\n get settings(): A11ySettings {\n return this._settings;\n }\n\n get reducedMotion(): boolean {\n return this._settings.reducedMotion;\n }\n\n get contrast(): ContrastLevel {\n return this._settings.contrast;\n }\n\n get uiScale(): number {\n return this._settings.uiScale;\n }\n\n update(patch: Partial<A11ySettings>): void {\n const next: A11ySettings = { ...this._settings, ...patch };\n if (\n next.reducedMotion === this._settings.reducedMotion &&\n next.contrast === this._settings.contrast &&\n next.uiScale === this._settings.uiScale\n ) {\n return;\n }\n this._settings = next;\n this.onChange.emit(next);\n }\n\n setReducedMotion(v: boolean): void {\n this.update({ reducedMotion: v });\n }\n\n setContrast(v: ContrastLevel): void {\n this.update({ contrast: v });\n }\n\n setUiScale(v: number): void {\n this.update({ uiScale: v });\n }\n}\n","import type { A11ySettings } from './manager.js';\n\n/**\n * Strength multiplier used by animation + postfx systems. Caller chooses a\n * base intensity; this function clamps it for reduced-motion users.\n */\nexport function motionScale(settings: { reducedMotion: boolean }, base = 1): number {\n return settings.reducedMotion ? 0 : base;\n}\n\n/**\n * Returns a second, dampened intensity. Useful for effects you want to keep\n * but soften (camera shake, chromatic aberration). `reducedFactor` controls\n * how much survives when reduced-motion is on (default 20%).\n */\nexport function dampenedMotion(\n settings: { reducedMotion: boolean },\n base: number,\n reducedFactor = 0.2,\n): number {\n return settings.reducedMotion ? base * reducedFactor : base;\n}\n\n/**\n * Helper for UI layers: pick a color based on contrast preference.\n */\nexport function pickContrast<T>(settings: Pick<A11ySettings, 'contrast'>, normal: T, high: T): T {\n return settings.contrast === 'high' ? high : normal;\n}\n","/**\n * A11yBridge — one-liner wiring of an `A11yManager` into runtime systems that\n * expose `setMotionScale(k)`. Typical targets: `Camera2D` (screen-shake) and\n * `PostFxController` (global effect intensity).\n *\n * The bridge owns no platform wiring — callers push OS preferences (e.g.\n * `AccessibilityInfo.isReduceMotionEnabled()`) into the manager; the bridge\n * forwards the derived motion scale to every attached target.\n *\n * Extracted from Pan Tvardowski per Phase 11.14. Duck-typed on the target\n * side so `@flare-engine/a11y` stays dependency-free.\n */\n\nimport { motionScale } from './helpers.js';\nimport { A11yManager, type A11yManagerOptions } from './manager.js';\n\n/** Minimal structural contract. `Camera2D` and `PostFxController` both match. */\nexport interface MotionScaleTarget {\n setMotionScale(k: number): void;\n}\n\nexport interface A11yBridge {\n readonly manager: A11yManager;\n /**\n * Apply the current motion scale to `target` and subscribe for updates.\n * Returns an unsubscribe fn — call on target disposal.\n */\n attach(target: MotionScaleTarget): () => void;\n /** Alias of `attach` with a name that documents intent at call sites. */\n attachCamera(camera: MotionScaleTarget): () => void;\n /** Alias of `attach` with a name that documents intent at call sites. */\n attachPostfx(postfx: MotionScaleTarget): () => void;\n}\n\nexport interface A11yBridgeOptions extends A11yManagerOptions {\n /** Provide an existing manager — otherwise one is constructed from `initial`. */\n readonly manager?: A11yManager;\n}\n\nexport function createA11yBridge(options: A11yBridgeOptions = {}): A11yBridge {\n const manager = options.manager ?? new A11yManager({ initial: options.initial });\n\n function attach(target: MotionScaleTarget): () => void {\n const apply = (): void => {\n target.setMotionScale(motionScale(manager.settings));\n };\n apply();\n manager.onChange.add(apply);\n return () => manager.onChange.remove(apply);\n }\n\n return {\n manager,\n attach,\n attachCamera: attach,\n attachPostfx: attach,\n };\n}\n","import { Color } from '@flare-engine/math';\nimport type { Color as ColorType } from '@flare-engine/math';\n\n/** WCAG 2.x conformance level for a contrast ratio. */\nexport type WcagLevel = 'fail' | 'AA' | 'AAA';\n\n/**\n * WCAG 2.x contrast ratio between two colors. Order-independent; range [1, 21].\n * Delegates to Color.contrastRatio (relative luminance formula).\n */\nexport function contrastRatio(fg: ColorType, bg: ColorType): number {\n return Color.contrastRatio(fg, bg);\n}\n\n/**\n * Classify a contrast ratio against WCAG 2.x thresholds.\n *\n * Normal text (largeText = false):\n * ratio >= 7.0 → AAA, ratio >= 4.5 → AA, else fail\n * Large text (largeText = true, >= 18pt normal / >= 14pt bold):\n * ratio >= 4.5 → AAA, ratio >= 3.0 → AA, else fail\n */\nexport function wcagLevel(ratio: number, largeText = false): WcagLevel {\n if (largeText) {\n if (ratio >= 4.5) return 'AAA';\n if (ratio >= 3.0) return 'AA';\n return 'fail';\n }\n if (ratio >= 7.0) return 'AAA';\n if (ratio >= 4.5) return 'AA';\n return 'fail';\n}\n\n/**\n * Perceptual distinguishability between two colors in OKLab space.\n * Returns the Euclidean ΔE distance (OKLab). Delegates to Color.deltaEOk.\n * Rule of thumb: < 0.05 ≈ imperceptibly similar; > 0.1 ≈ distinguishable.\n */\nexport function deltaE(a: ColorType, b: ColorType): number {\n return Color.deltaEOk(a, b);\n}\n\n/**\n * Returns true when two colors are perceptually distinguishable.\n * Uses OKLab ΔE with a caller-supplied threshold (default 0.1).\n * The threshold is a design-level constant — tune per visual layer.\n */\nexport function isDistinguishable(a: ColorType, b: ColorType, threshold = 0.1): boolean {\n return Color.deltaEOk(a, b) >= threshold;\n}\n\n/** Structured result from auditColors. */\nexport interface AuditResult {\n readonly contrastRatio: number;\n readonly wcagLevel: WcagLevel;\n readonly deltaE: number;\n readonly distinguishable: boolean;\n}\n\nexport interface AuditOptions {\n /** When true, applies large-text WCAG thresholds. Default false. */\n largeText?: boolean;\n /** OKLab ΔE threshold for isDistinguishable. Default 0.1. */\n deltaEThreshold?: number;\n}\n\n/**\n * Run contrast ratio + distinguishability check in one call.\n * Returns structured results, never throws.\n */\nexport function auditColors(fg: ColorType, bg: ColorType, options?: AuditOptions): AuditResult {\n const largeText = options?.largeText ?? false;\n const threshold = options?.deltaEThreshold ?? 0.1;\n const ratio = Color.contrastRatio(fg, bg);\n const de = Color.deltaEOk(fg, bg);\n return {\n contrastRatio: ratio,\n wcagLevel: wcagLevel(ratio, largeText),\n deltaE: de,\n distinguishable: de >= threshold,\n };\n}\n"],"mappings":";AAAA,SAAS,cAAc;AAiBvB,IAAM,WAAyB;AAAA,EAC7B,eAAe;AAAA,EACf,UAAU;AAAA,EACV,SAAS;AACX;AAQO,IAAM,cAAN,MAAkB;AAAA,EACd,WAAW,IAAI,OAAqB;AAAA,EACrC;AAAA,EAER,YAAY,UAA8B,CAAC,GAAG;AAC5C,SAAK,YAAY,EAAE,GAAG,UAAU,GAAG,QAAQ,QAAQ;AAAA,EACrD;AAAA,EAEA,IAAI,WAAyB;AAC3B,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,gBAAyB;AAC3B,WAAO,KAAK,UAAU;AAAA,EACxB;AAAA,EAEA,IAAI,WAA0B;AAC5B,WAAO,KAAK,UAAU;AAAA,EACxB;AAAA,EAEA,IAAI,UAAkB;AACpB,WAAO,KAAK,UAAU;AAAA,EACxB;AAAA,EAEA,OAAO,OAAoC;AACzC,UAAM,OAAqB,EAAE,GAAG,KAAK,WAAW,GAAG,MAAM;AACzD,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ACb,QAAI,SAAS,IAAK,QAAO;AACzB,QAAI,SAAS,EAAK,QAAO;AACzB,WAAO;AAAA,EACT;AACA,MAAI,SAAS,EAAK,QAAO;AACzB,MAAI,SAAS,IAAK,QAAO;AACzB,SAAO;AACT;AAOO,SAAS,OAAO,GAAc,GAAsB;AACzD,SAAO,MAAM,SAAS,GAAG,CAAC;AAC5B;AAOO,SAAS,kBAAkB,GAAc,GAAc,YAAY,KAAc;AACtF,SAAO,MAAM,SAAS,GAAG,CAAC,KAAK;AACjC;AAqBO,SAAS,YAAY,IAAe,IAAe,SAAqC;AAC7F,QAAM,YAAY,SAAS,aAAa;AACxC,QAAM,YAAY,SAAS,mBAAmB;AAC9C,QAAM,QAAQ,MAAM,cAAc,IAAI,EAAE;AACxC,QAAM,KAAK,MAAM,SAAS,IAAI,EAAE;AAChC,SAAO;AAAA,IACL,eAAe;AAAA,IACf,WAAW,UAAU,OAAO,SAAS;AAAA,IACrC,QAAQ;AAAA,IACR,iBAAiB,MAAM;AAAA,EACzB;AACF;","names":[]}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/audit.ts","../src/helpers.ts","../src/manager.ts","../src/bridge.ts"],"sourcesContent":["import type { Color as ColorType } from '@flare-engine/math';\nimport { Color } from '@flare-engine/math';\n\n/** WCAG 2.x conformance level for a contrast ratio. */\nexport type WcagLevel = 'fail' | 'AA' | 'AAA';\n\n/**\n * WCAG 2.x contrast ratio between two colors. Order-independent; range [1, 21].\n * Delegates to Color.contrastRatio (relative luminance formula).\n */\nexport function contrastRatio(fg: ColorType, bg: ColorType): number {\n return Color.contrastRatio(fg, bg);\n}\n\n/**\n * Classify a contrast ratio against WCAG 2.x thresholds.\n *\n * Normal text (largeText = false):\n * ratio >= 7.0 → AAA, ratio >= 4.5 → AA, else fail\n * Large text (largeText = true, >= 18pt normal / >= 14pt bold):\n * ratio >= 4.5 → AAA, ratio >= 3.0 → AA, else fail\n */\nexport function wcagLevel(ratio: number, largeText = false): WcagLevel {\n if (largeText) {\n if (ratio >= 4.5) return 'AAA';\n if (ratio >= 3.0) return 'AA';\n return 'fail';\n }\n if (ratio >= 7.0) return 'AAA';\n if (ratio >= 4.5) return 'AA';\n return 'fail';\n}\n\n/**\n * Perceptual distinguishability between two colors in OKLab space.\n * Returns the Euclidean ΔE distance (OKLab). Delegates to Color.deltaEOk.\n * Rule of thumb: < 0.05 ≈ imperceptibly similar; > 0.1 ≈ distinguishable.\n */\nexport function deltaE(a: ColorType, b: ColorType): number {\n return Color.deltaEOk(a, b);\n}\n\n/**\n * Returns true when two colors are perceptually distinguishable.\n * Uses OKLab ΔE with a caller-supplied threshold (default 0.1).\n * The threshold is a design-level constant — tune per visual layer.\n */\nexport function isDistinguishable(a: ColorType, b: ColorType, threshold = 0.1): boolean {\n return Color.deltaEOk(a, b) >= threshold;\n}\n\n/** Structured result from auditColors. */\nexport interface AuditResult {\n readonly contrastRatio: number;\n readonly wcagLevel: WcagLevel;\n readonly deltaE: number;\n readonly distinguishable: boolean;\n}\n\nexport interface AuditOptions {\n /** When true, applies large-text WCAG thresholds. Default false. */\n largeText?: boolean;\n /** OKLab ΔE threshold for isDistinguishable. Default 0.1. */\n deltaEThreshold?: number;\n}\n\n/**\n * Run contrast ratio + distinguishability check in one call.\n * Returns structured results, never throws.\n */\nexport function auditColors(fg: ColorType, bg: ColorType, options?: AuditOptions): AuditResult {\n const largeText = options?.largeText ?? false;\n const threshold = options?.deltaEThreshold ?? 0.1;\n const ratio = Color.contrastRatio(fg, bg);\n const de = Color.deltaEOk(fg, bg);\n return {\n contrastRatio: ratio,\n wcagLevel: wcagLevel(ratio, largeText),\n deltaE: de,\n distinguishable: de >= threshold,\n };\n}\n","import type { A11ySettings } from './manager.js';\n\n/**\n * Strength multiplier used by animation + postfx systems. Caller chooses a\n * base intensity; this function clamps it for reduced-motion users.\n */\nexport function motionScale(settings: { reducedMotion: boolean }, base = 1): number {\n return settings.reducedMotion ? 0 : base;\n}\n\n/**\n * Returns a second, dampened intensity. Useful for effects you want to keep\n * but soften (camera shake, chromatic aberration). `reducedFactor` controls\n * how much survives when reduced-motion is on (default 20%).\n */\nexport function dampenedMotion(\n settings: { reducedMotion: boolean },\n base: number,\n reducedFactor = 0.2,\n): number {\n return settings.reducedMotion ? base * reducedFactor : base;\n}\n\n/**\n * Helper for UI layers: pick a color based on contrast preference.\n */\nexport function pickContrast<T>(settings: Pick<A11ySettings, 'contrast'>, normal: T, high: T): T {\n return settings.contrast === 'high' ? high : normal;\n}\n","import { Signal } from '@flare-engine/events';\n\nexport type ContrastLevel = 'normal' | 'high';\n\nexport interface A11ySettings {\n /** When true, animations and heavy postfx should be minimized. */\n reducedMotion: boolean;\n /** Current contrast preference — UI tokens swap accordingly. */\n contrast: ContrastLevel;\n /** Global UI scale multiplier (`1` = default). */\n uiScale: number;\n}\n\nexport interface A11yManagerOptions {\n initial?: Partial<A11ySettings>;\n}\n\nconst DEFAULTS: A11ySettings = {\n reducedMotion: false,\n contrast: 'normal',\n uiScale: 1,\n};\n\n/**\n * Central accessibility state. Systems subscribe via `onChange` and read the\n * current snapshot via `settings`. The manager owns no platform wiring — a\n * host app may bridge OS preferences (e.g., `AccessibilityInfo.isReduceMotionEnabled`)\n * by pushing values in on startup.\n */\nexport class A11yManager {\n readonly onChange = new Signal<A11ySettings>();\n private _settings: A11ySettings;\n\n constructor(options: A11yManagerOptions = {}) {\n this._settings = { ...DEFAULTS, ...options.initial };\n }\n\n get settings(): A11ySettings {\n return this._settings;\n }\n\n get reducedMotion(): boolean {\n return this._settings.reducedMotion;\n }\n\n get contrast(): ContrastLevel {\n return this._settings.contrast;\n }\n\n get uiScale(): number {\n return this._settings.uiScale;\n }\n\n update(patch: Partial<A11ySettings>): void {\n const next: A11ySettings = { ...this._settings, ...patch };\n if (\n next.reducedMotion === this._settings.reducedMotion &&\n next.contrast === this._settings.contrast &&\n next.uiScale === this._settings.uiScale\n ) {\n return;\n }\n this._settings = next;\n this.onChange.emit(next);\n }\n\n setReducedMotion(v: boolean): void {\n this.update({ reducedMotion: v });\n }\n\n setContrast(v: ContrastLevel): void {\n this.update({ contrast: v });\n }\n\n setUiScale(v: number): void {\n this.update({ uiScale: v });\n }\n}\n","/**\n * A11yBridge — one-liner wiring of an `A11yManager` into runtime systems that\n * expose `setMotionScale(k)`. Typical targets: `Camera2D` (screen-shake) and\n * `PostFxController` (global effect intensity).\n *\n * The bridge owns no platform wiring — callers push OS preferences (e.g.\n * `AccessibilityInfo.isReduceMotionEnabled()`) into the manager; the bridge\n * forwards the derived motion scale to every attached target.\n *\n * Duck-typed on the target side so `@flare-engine/a11y` stays dependency-free.\n */\n\nimport { motionScale } from './helpers.js';\nimport { A11yManager, type A11yManagerOptions } from './manager.js';\n\n/** Minimal structural contract. `Camera2D` and `PostFxController` both match. */\nexport interface MotionScaleTarget {\n setMotionScale(k: number): void;\n}\n\nexport interface A11yBridge {\n readonly manager: A11yManager;\n /**\n * Apply the current motion scale to `target` and subscribe for updates.\n * Returns an unsubscribe fn — call on target disposal.\n */\n attach(target: MotionScaleTarget): () => void;\n /** Alias of `attach` with a name that documents intent at call sites. */\n attachCamera(camera: MotionScaleTarget): () => void;\n /** Alias of `attach` with a name that documents intent at call sites. */\n attachPostfx(postfx: MotionScaleTarget): () => void;\n}\n\nexport interface A11yBridgeOptions extends A11yManagerOptions {\n /** Provide an existing manager — otherwise one is constructed from `initial`. */\n readonly manager?: A11yManager;\n}\n\nexport function createA11yBridge(options: A11yBridgeOptions = {}): A11yBridge {\n const manager = options.manager ?? new A11yManager({ initial: options.initial });\n\n function attach(target: MotionScaleTarget): () => void {\n const apply = (): void => {\n target.setMotionScale(motionScale(manager.settings));\n };\n apply();\n manager.onChange.add(apply);\n return () => manager.onChange.remove(apply);\n }\n\n return {\n manager,\n attach,\n attachCamera: attach,\n attachPostfx: attach,\n };\n}\n"],"mappings":";;;;;;;AAUA,SAAgB,cAAc,IAAe,IAAuB;CAClE,OAAO,MAAM,cAAc,IAAI,EAAE;AACnC;;;;;;;;;AAU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3B,OAAO,KAAK,UAAU;CACxB;CAEA,IAAI,WAA0B;EAC5B,OAAO,KAAK,UAAU;CACxB;CAEA,IAAI,UAAkB;EACpB,OAAO,KAAK,UAAU;CACxB;CAEA,OAAO,OAAoC;EACzC,MAAM,OAAqB;GAAE,GAAG,KAAK;GAAW,GAAG;EAAM;EACzD,IACE,KAAK,kBAAkB,KAAK,UAAU,iBACtC,KAAK,aAAa,KAAK,UAAU,YACjC,KAAK,YAAY,KAAK,UAAU,SAEhC;EAEF,KAAK,YAAY;EACjB,KAAK,SAAS,KAAK,IAAI;CACzB;CAEA,iBAAiB,GAAkB;EACjC,KAAK,OAAO,EAAE,eAAe,EAAE,CAAC;CAClC;CAEA,YAAY,GAAwB;EAClC,KAAK,OAAO,EAAE,UAAU,EAAE,CAAC;CAC7B;CAEA,WAAW,GAAiB;EAC1B,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC;CAC5B;AACF;;;;;;;;;;;;;;ACvCA,SAAgB,iBAAiB,UAA6B,CAAC,GAAe;CAC5E,MAAM,UAAU,QAAQ,WAAW,IAAI,YAAY,EAAE,SAAS,QAAQ,QAAQ,CAAC;CAE/E,SAAS,OAAO,QAAuC;EACrD,MAAM,cAAoB;GACxB,OAAO,eAAe,YAAY,QAAQ,QAAQ,CAAC;EACrD;EACA,MAAM;EACN,QAAQ,SAAS,IAAI,KAAK;EAC1B,aAAa,QAAQ,SAAS,OAAO,KAAK;CAC5C;CAEA,OAAO;EACL;EACA;EACA,cAAc;EACd,cAAc;CAChB;AACF"}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@flare-engine/a11y",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Accessibility primitives — reduced motion, contrast tokens",
5
5
  "keywords": ["flare-engine", "a11y", "accessibility", "reduced-motion"],
6
- "license": "MIT",
6
+ "license": "Apache-2.0",
7
7
  "author": "Grzegorz Otto",
8
8
  "homepage": "https://github.com/grzott/flare-engine#readme",
9
9
  "bugs": {
@@ -19,21 +19,29 @@
19
19
  "types": "dist/index.d.ts",
20
20
  "exports": {
21
21
  ".": {
22
- "types": "./dist/index.d.ts",
23
- "import": "./dist/index.mjs",
24
- "require": "./dist/index.js"
22
+ "import": {
23
+ "types": "./dist/index.d.mts",
24
+ "default": "./dist/index.mjs"
25
+ },
26
+ "require": {
27
+ "types": "./dist/index.d.ts",
28
+ "default": "./dist/index.js"
29
+ }
25
30
  }
26
31
  },
27
- "files": ["dist", "README.md", "LICENSE"],
32
+ "files": ["dist", "README.md", "LICENSE", "NOTICE"],
28
33
  "scripts": {
29
- "build": "tsup",
34
+ "build": "tsdown",
30
35
  "test": "bun test",
31
36
  "lint": "biome check src/",
32
37
  "typecheck": "tsc --noEmit"
33
38
  },
34
39
  "dependencies": {
35
- "@flare-engine/events": "^0.2.1",
36
- "@flare-engine/math": "^0.2.1"
40
+ "@flare-engine/events": "^0.3.0",
41
+ "@flare-engine/math": "^0.3.0"
42
+ },
43
+ "engines": {
44
+ "node": ">=20"
37
45
  },
38
46
  "publishConfig": {
39
47
  "access": "restricted",