@flare-engine/a11y 0.4.5 → 0.4.7

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/dist/index.d.mts CHANGED
@@ -1,13 +1,12 @@
1
1
  import { Color } from "@flare-engine/math";
2
2
  import { Signal } from "@flare-engine/events";
3
- //#region src/audit.d.ts
4
3
  /** WCAG 2.x conformance level for a contrast ratio. */
5
4
  type WcagLevel = 'fail' | 'AA' | 'AAA';
6
5
  /**
7
6
  * WCAG 2.x contrast ratio between two colors. Order-independent; range [1, 21].
8
7
  * Delegates to Color.contrastRatio (relative luminance formula).
9
8
  */
10
- declare function contrastRatio(fg: Color, bg: Color): number;
9
+ export declare function contrastRatio(fg: Color, bg: Color): number;
11
10
  /**
12
11
  * Classify a contrast ratio against WCAG 2.x thresholds.
13
12
  *
@@ -16,19 +15,19 @@ declare function contrastRatio(fg: Color, bg: Color): number;
16
15
  * Large text (largeText = true, >= 18pt normal / >= 14pt bold):
17
16
  * ratio >= 4.5 → AAA, ratio >= 3.0 → AA, else fail
18
17
  */
19
- declare function wcagLevel(ratio: number, largeText?: boolean): WcagLevel;
18
+ export declare function wcagLevel(ratio: number, largeText?: boolean): WcagLevel;
20
19
  /**
21
20
  * Perceptual distinguishability between two colors in OKLab space.
22
21
  * Returns the Euclidean ΔE distance (OKLab). Delegates to Color.deltaEOk.
23
22
  * Rule of thumb: < 0.05 ≈ imperceptibly similar; > 0.1 ≈ distinguishable.
24
23
  */
25
- declare function deltaE(a: Color, b: Color): number;
24
+ export declare function deltaE(a: Color, b: Color): number;
26
25
  /**
27
26
  * Returns true when two colors are perceptually distinguishable.
28
27
  * Uses OKLab ΔE with a caller-supplied threshold (default 0.1).
29
28
  * The threshold is a design-level constant — tune per visual layer.
30
29
  */
31
- declare function isDistinguishable(a: Color, b: Color, threshold?: number): boolean;
30
+ export declare function isDistinguishable(a: Color, b: Color, threshold?: number): boolean;
32
31
  /** Structured result from auditColors. */
33
32
  interface AuditResult {
34
33
  readonly contrastRatio: number;
@@ -46,9 +45,7 @@ interface AuditOptions {
46
45
  * Run contrast ratio + distinguishability check in one call.
47
46
  * Returns structured results, never throws.
48
47
  */
49
- declare function auditColors(fg: Color, bg: Color, options?: AuditOptions): AuditResult;
50
- //#endregion
51
- //#region src/manager.d.ts
48
+ export declare function auditColors(fg: Color, bg: Color, options?: AuditOptions): AuditResult;
52
49
  type ContrastLevel = 'normal' | 'high';
53
50
  interface A11ySettings {
54
51
  /** When true, animations and heavy postfx should be minimized. */
@@ -67,7 +64,7 @@ interface A11yManagerOptions {
67
64
  * host app may bridge OS preferences (e.g., `AccessibilityInfo.isReduceMotionEnabled`)
68
65
  * by pushing values in on startup.
69
66
  */
70
- declare class A11yManager {
67
+ export declare class A11yManager {
71
68
  readonly onChange: Signal<A11ySettings>;
72
69
  private _settings;
73
70
  constructor(options?: A11yManagerOptions);
@@ -80,8 +77,6 @@ declare class A11yManager {
80
77
  setContrast(v: ContrastLevel): void;
81
78
  setUiScale(v: number): void;
82
79
  }
83
- //#endregion
84
- //#region src/bridge.d.ts
85
80
  /** Minimal structural contract. `Camera2D` and `PostFxController` both match. */
86
81
  interface MotionScaleTarget {
87
82
  setMotionScale(k: number): void;
@@ -102,14 +97,12 @@ interface A11yBridgeOptions extends A11yManagerOptions {
102
97
  /** Provide an existing manager — otherwise one is constructed from `initial`. */
103
98
  readonly manager?: A11yManager;
104
99
  }
105
- declare function createA11yBridge(options?: A11yBridgeOptions): A11yBridge;
106
- //#endregion
107
- //#region src/helpers.d.ts
100
+ export declare function createA11yBridge(options?: A11yBridgeOptions): A11yBridge;
108
101
  /**
109
102
  * Strength multiplier used by animation + postfx systems. Caller chooses a
110
103
  * base intensity; this function clamps it for reduced-motion users.
111
104
  */
112
- declare function motionScale(settings: {
105
+ export declare function motionScale(settings: {
113
106
  reducedMotion: boolean;
114
107
  }, base?: number): number;
115
108
  /**
@@ -117,13 +110,12 @@ declare function motionScale(settings: {
117
110
  * but soften (camera shake, chromatic aberration). `reducedFactor` controls
118
111
  * how much survives when reduced-motion is on (default 20%).
119
112
  */
120
- declare function dampenedMotion(settings: {
113
+ export declare function dampenedMotion(settings: {
121
114
  reducedMotion: boolean;
122
115
  }, base: number, reducedFactor?: number): number;
123
116
  /**
124
117
  * Helper for UI layers: pick a color based on contrast preference.
125
118
  */
126
- declare function pickContrast<T>(settings: Pick<A11ySettings, 'contrast'>, normal: T, high: T): T;
127
- //#endregion
128
- export { type A11yBridge, type A11yBridgeOptions, A11yManager, type A11yManagerOptions, type A11ySettings, type AuditOptions, type AuditResult, type ContrastLevel, type MotionScaleTarget, type WcagLevel, auditColors, contrastRatio, createA11yBridge, dampenedMotion, deltaE, isDistinguishable, motionScale, pickContrast, wcagLevel };
119
+ export declare function pickContrast<T>(settings: Pick<A11ySettings, 'contrast'>, normal: T, high: T): T;
120
+ export type { A11yBridge, A11yBridgeOptions, A11yManagerOptions, A11ySettings, AuditOptions, AuditResult, ContrastLevel, MotionScaleTarget, WcagLevel };
129
121
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/audit.ts","../src/manager.ts","../src/bridge.ts","../src/helpers.ts"],"mappings":";;;;KAIY;;;;;iBAMI,cAAc,IAAI,OAAW,IAAI;;;;;;;;;iBAYjC,UAAU,eAAe,sBAAoB;;;;;;iBAgB7C,OAAO,GAAG,OAAW,GAAG;;;;;;iBASxB,kBAAkB,GAAG,OAAW,GAAG,OAAW;;UAK7C;WACN;WACA,WAAW;WACX;WACA;;UAGM;;EAEf;;EAEA;;;;;;iBAOc,YAAY,IAAI,OAAW,IAAI,OAAW,UAAU,eAAe;;;KCpEvE;UAEK;;EAEf;;EAEA,UAAU;;EAEV;;UAGe;EACf,UAAU,QAAQ;;;;;;;;cAeP;WACF,UAAQ,OAAA;UACT;cAEI,UAAS;MAIjB,YAAY;MAIZ;MAIA,YAAY;MAIZ;EAIJ,OAAO,OAAO,QAAQ;EAat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U,KAAK,2BAA2B,QAAQ,GAAG,MAAM,IAAI"}
package/dist/index.d.ts CHANGED
@@ -1,13 +1,12 @@
1
1
  import { Color } from "@flare-engine/math";
2
2
  import { Signal } from "@flare-engine/events";
3
- //#region src/audit.d.ts
4
3
  /** WCAG 2.x conformance level for a contrast ratio. */
5
4
  type WcagLevel = 'fail' | 'AA' | 'AAA';
6
5
  /**
7
6
  * WCAG 2.x contrast ratio between two colors. Order-independent; range [1, 21].
8
7
  * Delegates to Color.contrastRatio (relative luminance formula).
9
8
  */
10
- declare function contrastRatio(fg: Color, bg: Color): number;
9
+ export declare function contrastRatio(fg: Color, bg: Color): number;
11
10
  /**
12
11
  * Classify a contrast ratio against WCAG 2.x thresholds.
13
12
  *
@@ -16,19 +15,19 @@ declare function contrastRatio(fg: Color, bg: Color): number;
16
15
  * Large text (largeText = true, >= 18pt normal / >= 14pt bold):
17
16
  * ratio >= 4.5 → AAA, ratio >= 3.0 → AA, else fail
18
17
  */
19
- declare function wcagLevel(ratio: number, largeText?: boolean): WcagLevel;
18
+ export declare function wcagLevel(ratio: number, largeText?: boolean): WcagLevel;
20
19
  /**
21
20
  * Perceptual distinguishability between two colors in OKLab space.
22
21
  * Returns the Euclidean ΔE distance (OKLab). Delegates to Color.deltaEOk.
23
22
  * Rule of thumb: < 0.05 ≈ imperceptibly similar; > 0.1 ≈ distinguishable.
24
23
  */
25
- declare function deltaE(a: Color, b: Color): number;
24
+ export declare function deltaE(a: Color, b: Color): number;
26
25
  /**
27
26
  * Returns true when two colors are perceptually distinguishable.
28
27
  * Uses OKLab ΔE with a caller-supplied threshold (default 0.1).
29
28
  * The threshold is a design-level constant — tune per visual layer.
30
29
  */
31
- declare function isDistinguishable(a: Color, b: Color, threshold?: number): boolean;
30
+ export declare function isDistinguishable(a: Color, b: Color, threshold?: number): boolean;
32
31
  /** Structured result from auditColors. */
33
32
  interface AuditResult {
34
33
  readonly contrastRatio: number;
@@ -46,9 +45,7 @@ interface AuditOptions {
46
45
  * Run contrast ratio + distinguishability check in one call.
47
46
  * Returns structured results, never throws.
48
47
  */
49
- declare function auditColors(fg: Color, bg: Color, options?: AuditOptions): AuditResult;
50
- //#endregion
51
- //#region src/manager.d.ts
48
+ export declare function auditColors(fg: Color, bg: Color, options?: AuditOptions): AuditResult;
52
49
  type ContrastLevel = 'normal' | 'high';
53
50
  interface A11ySettings {
54
51
  /** When true, animations and heavy postfx should be minimized. */
@@ -67,7 +64,7 @@ interface A11yManagerOptions {
67
64
  * host app may bridge OS preferences (e.g., `AccessibilityInfo.isReduceMotionEnabled`)
68
65
  * by pushing values in on startup.
69
66
  */
70
- declare class A11yManager {
67
+ export declare class A11yManager {
71
68
  readonly onChange: Signal<A11ySettings>;
72
69
  private _settings;
73
70
  constructor(options?: A11yManagerOptions);
@@ -80,8 +77,6 @@ declare class A11yManager {
80
77
  setContrast(v: ContrastLevel): void;
81
78
  setUiScale(v: number): void;
82
79
  }
83
- //#endregion
84
- //#region src/bridge.d.ts
85
80
  /** Minimal structural contract. `Camera2D` and `PostFxController` both match. */
86
81
  interface MotionScaleTarget {
87
82
  setMotionScale(k: number): void;
@@ -102,14 +97,12 @@ interface A11yBridgeOptions extends A11yManagerOptions {
102
97
  /** Provide an existing manager — otherwise one is constructed from `initial`. */
103
98
  readonly manager?: A11yManager;
104
99
  }
105
- declare function createA11yBridge(options?: A11yBridgeOptions): A11yBridge;
106
- //#endregion
107
- //#region src/helpers.d.ts
100
+ export declare function createA11yBridge(options?: A11yBridgeOptions): A11yBridge;
108
101
  /**
109
102
  * Strength multiplier used by animation + postfx systems. Caller chooses a
110
103
  * base intensity; this function clamps it for reduced-motion users.
111
104
  */
112
- declare function motionScale(settings: {
105
+ export declare function motionScale(settings: {
113
106
  reducedMotion: boolean;
114
107
  }, base?: number): number;
115
108
  /**
@@ -117,13 +110,12 @@ declare function motionScale(settings: {
117
110
  * but soften (camera shake, chromatic aberration). `reducedFactor` controls
118
111
  * how much survives when reduced-motion is on (default 20%).
119
112
  */
120
- declare function dampenedMotion(settings: {
113
+ export declare function dampenedMotion(settings: {
121
114
  reducedMotion: boolean;
122
115
  }, base: number, reducedFactor?: number): number;
123
116
  /**
124
117
  * Helper for UI layers: pick a color based on contrast preference.
125
118
  */
126
- declare function pickContrast<T>(settings: Pick<A11ySettings, 'contrast'>, normal: T, high: T): T;
127
- //#endregion
128
- export { type A11yBridge, type A11yBridgeOptions, A11yManager, type A11yManagerOptions, type A11ySettings, type AuditOptions, type AuditResult, type ContrastLevel, type MotionScaleTarget, type WcagLevel, auditColors, contrastRatio, createA11yBridge, dampenedMotion, deltaE, isDistinguishable, motionScale, pickContrast, wcagLevel };
119
+ export declare function pickContrast<T>(settings: Pick<A11ySettings, 'contrast'>, normal: T, high: T): T;
120
+ export type { A11yBridge, A11yBridgeOptions, A11yManagerOptions, A11ySettings, AuditOptions, AuditResult, ContrastLevel, MotionScaleTarget, WcagLevel };
129
121
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/audit.ts","../src/manager.ts","../src/bridge.ts","../src/helpers.ts"],"mappings":";;;;KAIY;;;;;iBAMI,cAAc,IAAI,OAAW,IAAI;;;;;;;;;iBAYjC,UAAU,eAAe,sBAAoB;;;;;;iBAgB7C,OAAO,GAAG,OAAW,GAAG;;;;;;iBASxB,kBAAkB,GAAG,OAAW,GAAG,OAAW;;UAK7C;WACN;WACA,WAAW;WACX;WACA;;UAGM;;EAEf;;EAEA;;;;;;iBAOc,YAAY,IAAI,OAAW,IAAI,OAAW,UAAU,eAAe;;;KCpEvE;UAEK;;EAEf;;EAEA,UAAU;;EAEV;;UAGe;EACf,UAAU,QAAQ;;;;;;;;cAeP;WACF,UAAQ,OAAA;UACT;cAEI,UAAS;MAIjB,YAAY;MAIZ;MAIA,YAAY;MAIZ;EAIJ,OAAO,OAAO,QAAQ;EAatB,iBAAiB;EAIjB,YAAY,GAAG;EAIf,WAAW;;;;;UC1DI;EACf,eAAe;;UAGA;WACN,SAAS;;;;;EAKlB,OAAO,QAAQ;;EAEf,aAAa,QAAQ;;EAErB,aAAa,QAAQ;;UAGN,0BAA0B;;WAEhC,UAAU;;iBAGL,iBAAiB,UAAS,oBAAyB;;;;;;;iBChCnD,YAAY;EAAY;GAA0B;;;;;;iBASlD,eACd;EAAY;GACZ,cACA;;;;iBAQc,aAAa,GAAG,UAAU,KAAK,2BAA2B,QAAQ,GAAG,MAAM,IAAI"}
1
+ {"version":3,"file":"index.d.ts","names":["ColorType"],"sources":["../src/audit.ts","../src/manager.ts","../src/bridge.ts","../src/helpers.ts"],"mappings":";;;KAIY;;;;;wBAMI,cAAc,IAAIA,OAAW,IAAIA;;;;;;;;;wBAYjC,UAAU,eAAe,sBAAoB;;;;;;wBAgB7C,OAAO,GAAGA,OAAW,GAAGA;;;;;;wBASxB,kBAAkB,GAAGA,OAAW,GAAGA,OAAW;;UAK7C;WACN;WACA,WAAW;WACX;WACA;;UAGM;;EAEf;;EAEA;;;;;;wBAOc,YAAY,IAAIA,OAAW,IAAIA,OAAW,UAAU,eAAe;KCpEvE;UAEK;;EAEf;;EAEA,UAAU;;EAEV;;UAGe;EACf,UAAU,QAAQ;;;;;;;;qBAeP;WACF,UAAQ,OAAA;UACT;EAEI,YAAA,UAAS;MAIjB,YAAY;MAIZ;MAIA,YAAY;MAIZ;EAIJ,OAAO,OAAO,QAAQ;EAatB,iBAAiB;EAIjB,YAAY,GAAG;EAIf,WAAW;;;UC1DI;EACf,eAAe;;UAGA;WACN,SAAS;;;;;EAKlB,OAAO,QAAQ;;EAEf,aAAa,QAAQ;;EAErB,aAAa,QAAQ;;UAGN,0BAA0B;;WAEhC,UAAU;;wBAGL,iBAAiB,UAAS,oBAAyB;;;;;wBChCnD,YAAY;EAAY;GAA0B;;;;;;wBASlD,eACd;EAAY;GACZ,cACA;;;;wBAQc,aAAa,GAAG,UAAU,KAAK,2BAA2B,QAAQ,GAAG,MAAM,IAAI"}
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let _flare_engine_math = require("@flare-engine/math");
3
3
  let _flare_engine_events = require("@flare-engine/events");
4
- //#region src/audit.ts
4
+ // src/audit.ts
5
5
  /**
6
6
  * WCAG 2.x contrast ratio between two colors. Order-independent; range [1, 21].
7
7
  * Delegates to Color.contrastRatio (relative luminance formula).
@@ -59,8 +59,7 @@ function auditColors(fg, bg, options) {
59
59
  distinguishable: de >= threshold
60
60
  };
61
61
  }
62
- //#endregion
63
- //#region src/helpers.ts
62
+ // src/helpers.ts
64
63
  /**
65
64
  * Strength multiplier used by animation + postfx systems. Caller chooses a
66
65
  * base intensity; this function clamps it for reduced-motion users.
@@ -82,8 +81,7 @@ function dampenedMotion(settings, base, reducedFactor = .2) {
82
81
  function pickContrast(settings, normal, high) {
83
82
  return settings.contrast === "high" ? high : normal;
84
83
  }
85
- //#endregion
86
- //#region src/manager.ts
84
+ // src/manager.ts
87
85
  const DEFAULTS = {
88
86
  reducedMotion: false,
89
87
  contrast: "normal",
@@ -135,8 +133,7 @@ var A11yManager = class {
135
133
  this.update({ uiScale: v });
136
134
  }
137
135
  };
138
- //#endregion
139
- //#region src/bridge.ts
136
+ // src/bridge.ts
140
137
  /**
141
138
  * A11yBridge — one-liner wiring of an `A11yManager` into runtime systems that
142
139
  * expose `setMotionScale(k)`. Typical targets: `Camera2D` (screen-shake) and
@@ -165,7 +162,6 @@ function createA11yBridge(options = {}) {
165
162
  attachPostfx: attach
166
163
  };
167
164
  }
168
- //#endregion
169
165
  exports.A11yManager = A11yManager;
170
166
  exports.auditColors = auditColors;
171
167
  exports.contrastRatio = contrastRatio;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Color","Signal"],"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,OAAOA,mBAAAA,MAAM,cAAc,IAAI,EAAE;AACnC;;;;;;;;;AAUA,SAAgB,UAAU,OAAe,YAAY,OAAkB;CACrE,IAAI,WAAW;EACb,IAAI,SAAS,KAAK,OAAO;EACzB,IAAI,SAAS,GAAK,OAAO;EACzB,OAAO;CACT;CACA,IAAI,SAAS,GAAK,OAAO;CACzB,IAAI,SAAS,KAAK,OAAO;CACzB,OAAO;AACT;;;;;;AAOA,SAAgB,OAAO,GAAc,GAAsB;CACzD,OAAOA,mBAAAA,MAAM,SAAS,GAAG,CAAC;AAC5B;;;;;;AAOA,SAAgB,kBAAkB,GAAc,GAAc,YAAY,IAAc;CACtF,OAAOA,mBAAAA,MAAM,SAAS,GAAG,CAAC,KAAK;AACjC;;;;;AAqBA,SAAgB,YAAY,IAAe,IAAe,SAAqC;CAC7F,MAAM,YAAY,SAAS,aAAa;CACxC,MAAM,YAAY,SAAS,mBAAmB;CAC9C,MAAM,QAAQA,mBAAAA,MAAM,cAAc,IAAI,EAAE;CACxC,MAAM,KAAKA,mBAAAA,MAAM,SAAS,IAAI,EAAE;CAChC,OAAO;EACL,eAAe;EACf,WAAW,UAAU,OAAO,SAAS;EACrC,QAAQ;EACR,iBAAiB,MAAM;CACzB;AACF;;;;;;;AC3EA,SAAgB,YAAY,UAAsC,OAAO,GAAW;CAClF,OAAO,SAAS,gBAAgB,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D,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"}
1
+ {"version":3,"file":"index.js","names":["Color","Signal"],"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,OAAOA,mBAAAA,MAAM,cAAc,IAAI,EAAE;AACnC;;;;;;;;;AAUA,SAAgB,UAAU,OAAe,YAAY,OAAkB;CACrE,IAAI,WAAW;EACb,IAAI,SAAS,KAAK,OAAO;EACzB,IAAI,SAAS,GAAK,OAAO;EACzB,OAAO;CACT;CACA,IAAI,SAAS,GAAK,OAAO;CACzB,IAAI,SAAS,KAAK,OAAO;CACzB,OAAO;AACT;;;;;;AAOA,SAAgB,OAAO,GAAc,GAAsB;CACzD,OAAOA,mBAAAA,MAAM,SAAS,GAAG,CAAC;AAC5B;;;;;;AAOA,SAAgB,kBAAkB,GAAc,GAAc,YAAY,IAAc;CACtF,OAAOA,mBAAAA,MAAM,SAAS,GAAG,CAAC,KAAK;AACjC;;;;;AAqBA,SA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,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/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Color } from "@flare-engine/math";
2
2
  import { Signal } from "@flare-engine/events";
3
- //#region src/audit.ts
3
+ // src/audit.ts
4
4
  /**
5
5
  * WCAG 2.x contrast ratio between two colors. Order-independent; range [1, 21].
6
6
  * Delegates to Color.contrastRatio (relative luminance formula).
@@ -58,8 +58,7 @@ function auditColors(fg, bg, options) {
58
58
  distinguishable: de >= threshold
59
59
  };
60
60
  }
61
- //#endregion
62
- //#region src/helpers.ts
61
+ // src/helpers.ts
63
62
  /**
64
63
  * Strength multiplier used by animation + postfx systems. Caller chooses a
65
64
  * base intensity; this function clamps it for reduced-motion users.
@@ -81,8 +80,7 @@ function dampenedMotion(settings, base, reducedFactor = .2) {
81
80
  function pickContrast(settings, normal, high) {
82
81
  return settings.contrast === "high" ? high : normal;
83
82
  }
84
- //#endregion
85
- //#region src/manager.ts
83
+ // src/manager.ts
86
84
  const DEFAULTS = {
87
85
  reducedMotion: false,
88
86
  contrast: "normal",
@@ -134,8 +132,7 @@ var A11yManager = class {
134
132
  this.update({ uiScale: v });
135
133
  }
136
134
  };
137
- //#endregion
138
- //#region src/bridge.ts
135
+ // src/bridge.ts
139
136
  /**
140
137
  * A11yBridge — one-liner wiring of an `A11yManager` into runtime systems that
141
138
  * expose `setMotionScale(k)`. Typical targets: `Camera2D` (screen-shake) and
@@ -164,7 +161,6 @@ function createA11yBridge(options = {}) {
164
161
  attachPostfx: attach
165
162
  };
166
163
  }
167
- //#endregion
168
164
  export { A11yManager, auditColors, contrastRatio, createA11yBridge, dampenedMotion, deltaE, isDistinguishable, motionScale, pickContrast, wcagLevel };
169
165
 
170
166
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
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;;;;;;;;;AAUA,SAAgB,UAAU,OAAe,YAAY,OAAkB;CACrE,IAAI,WAAW;EACb,IAAI,SAAS,KAAK,OAAO;EACzB,IAAI,SAAS,GAAK,OAAO;EACzB,OAAO;CACT;CACA,IAAI,SAAS,GAAK,OAAO;CACzB,IAAI,SAAS,KAAK,OAAO;CACzB,OAAO;AACT;;;;;;AAOA,SAAgB,OAAO,G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K,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"}
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,cA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D;CAEA,IAAI,WAAyB;EAC3B,OAAO,KAAK;CACd;CAEA,IAAI,gBAAyB;EAC3B,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,6 +1,6 @@
1
1
  {
2
2
  "name": "@flare-engine/a11y",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
4
4
  "description": "Accessibility primitives — reduced motion, contrast tokens",
5
5
  "keywords": ["flare-engine", "a11y", "accessibility", "reduced-motion"],
6
6
  "license": "Apache-2.0",
@@ -37,8 +37,8 @@
37
37
  "typecheck": "tsc --noEmit"
38
38
  },
39
39
  "dependencies": {
40
- "@flare-engine/events": "^0.4.5",
41
- "@flare-engine/math": "^0.4.5"
40
+ "@flare-engine/events": "^0.4.7",
41
+ "@flare-engine/math": "^0.4.7"
42
42
  },
43
43
  "engines": {
44
44
  "node": ">=20"