accessibility-plugin-react 2.13.0 → 2.17.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.
@@ -0,0 +1,149 @@
1
+ # Internationalization and Locale Packs
2
+
3
+ The `accessibility-plugin-react` library includes built-in, native-speaker and accessibility-reviewed localization packs for English (`en`), Sinhala (`si`, `si-LK`), and Tamil (`ta`, `ta-LK`), along with full infrastructure for Right-to-Left (RTL) writing directions and custom locale registrations.
4
+
5
+ ## Guiding Principles & Privacy
6
+
7
+ 1. **Widget Scope Only**: The library's localization only translates the accessibility plugin's own widget controls, headings, hints, options, and live announcements.
8
+ 2. **Untranslated Host Content**: Author host content (article paragraphs, site navigation, headings, form inputs) is **never** translated or modified by the plugin.
9
+ 3. **No External Network Dependencies**: All locale strings are bundled statically. No remote dictionary APIs, external translation calls, or telemetry exist.
10
+ 4. **HTML `lang` Auto-Detection**: When the `locale` prop is omitted, the widget automatically detects `document.documentElement.lang` (e.g. `<html lang="si-LK">` or `<html lang="ta-LK">`) and applies the appropriate dictionary, falling back to English.
11
+ 5. **No Google Translate Mangling**: The root panel is tagged with `translate="no"`, preventing browser auto-translators from altering widget ARIA states or numeric steppers.
12
+
13
+ ---
14
+
15
+ ## Supported Built-in Locales
16
+
17
+ | Locale Code | Language | Variant Codes | Script / Writing Direction | Script Fallback Fonts |
18
+ | ----------- | --------------- | ---------------------------- | -------------------------- | ------------------------------------------------------------------- |
19
+ | `en` | English | `en`, `en-US`, `en-GB`, etc. | Latin / LTR | system-ui, sans-serif |
20
+ | `si` | Sinhala (සිංහල) | `si`, `si-LK` | Sinhala / LTR | `"Noto Sans Sinhala"`, `"Iskoola Pota"`, `"Nirmala UI"`, sans-serif |
21
+ | `ta` | Tamil (தமிழ்) | `ta`, `ta-LK`, `ta-IN` | Tamil / LTR | `"Noto Sans Tamil"`, `"Latha"`, `"Nirmala UI"`, sans-serif |
22
+
23
+ ---
24
+
25
+ ## Typography & Script Fallbacks
26
+
27
+ Sinhala and Tamil are complex Brahmi scripts containing consonant conjuncts, touching characters, and dependent vowel signs. To ensure complex glyphs never clip or render with missing glpyh boxes ("tofu"), the plugin includes typography fallbacks in its scoped styling and typography features:
28
+
29
+ ```css
30
+ /* Scoped fallback stack in .arap-root */
31
+ font:
32
+ 15px/1.5 system-ui,
33
+ -apple-system,
34
+ BlinkMacSystemFont,
35
+ "Segoe UI",
36
+ Roboto,
37
+ "Noto Sans Sinhala",
38
+ "Iskoola Pota",
39
+ "Noto Sans Tamil",
40
+ "Latha",
41
+ "Nirmala UI",
42
+ sans-serif;
43
+ ```
44
+
45
+ When users activate legible font features (via `FontFamilyController`), these scripts are protected and prioritized with verified open-license fonts (Noto Sans Sinhala / Noto Sans Tamil).
46
+
47
+ ---
48
+
49
+ ## Right-to-Left (RTL) Infrastructure
50
+
51
+ While Sinhala and Tamil are Left-to-Right (LTR) languages, the library includes complete RTL support for bidirectional locales (such as Arabic `ar`, Hebrew `he`, Persian `fa`, Urdu `ur`):
52
+
53
+ - **Automatic Direction Assignment**: When an RTL locale is detected via `isRtlLocale(locale)`, the panel element receives `dir="rtl"`.
54
+ - **Bidirectional Alignment**: The widget defaults to `text-align: start`, naturally aligning right in RTL and left in LTR.
55
+ - **Header Alignment**: Close button and heading automatically align in accordance with reading direction.
56
+ - **Spatial Controls Protection**: Movement arrow keys (`arap-position-arrows`) maintain spatial geometry (`← ↑ ↓ →`) regardless of writing direction.
57
+
58
+ ---
59
+
60
+ ## Usage Examples
61
+
62
+ ### 1. Specifying Locale on the Provider
63
+
64
+ ```tsx
65
+ import {
66
+ AccessibilityPlugin,
67
+ AccessibilityButton,
68
+ AccessibilityList,
69
+ TextScaleController,
70
+ ResetController,
71
+ } from "accessibility-plugin-react";
72
+
73
+ export function App() {
74
+ return (
75
+ <AccessibilityPlugin locale="si-LK">
76
+ <AccessibilityButton />
77
+ <AccessibilityList>
78
+ <TextScaleController />
79
+ <ResetController />
80
+ </AccessibilityList>
81
+ </AccessibilityPlugin>
82
+ );
83
+ }
84
+ ```
85
+
86
+ ### 2. Automatic Detection via Document Lang
87
+
88
+ If your application sets `<html lang="ta-LK">`, simply render the plugin without the `locale` prop:
89
+
90
+ ```tsx
91
+ // Document: <html lang="ta-LK">
92
+ <AccessibilityPlugin>
93
+ <AccessibilityButton />
94
+ <AccessibilityList>
95
+ <TextScaleController />
96
+ <ResetController />
97
+ </AccessibilityList>
98
+ </AccessibilityPlugin>
99
+ // Automatically renders in Tamil ("அணுகல்தன்மை அமைப்புகள்", "பெரிய உரை", "அனைத்தையும் மீட்டமை")
100
+ ```
101
+
102
+ ### 3. Registering a Custom Locale
103
+
104
+ You can register custom language packs using `registerLocale`:
105
+
106
+ ```tsx
107
+ import {
108
+ registerLocale,
109
+ enLocale,
110
+ type LocaleStrings,
111
+ } from "accessibility-plugin-react";
112
+
113
+ const frenchLocale: LocaleStrings = {
114
+ ...enLocale,
115
+ title: "Paramètres d'accessibilité",
116
+ description: "Ajustez votre expérience de lecture",
117
+ closeLabel: "Fermer les paramètres d'accessibilité",
118
+ resetAll: "Tout réinitialiser",
119
+ buttonTitle: "Accessibilité",
120
+ };
121
+
122
+ registerLocale("fr", frenchLocale);
123
+
124
+ // Now <AccessibilityPlugin locale="fr-FR"> resolves frenchLocale!
125
+ ```
126
+
127
+ ---
128
+
129
+ ## Reviewed Vocabulary Summary
130
+
131
+ ### Sinhala (`si-LK`)
132
+
133
+ - **Title**: ප්‍රවේශ්‍යතා සැකසුම් (Accessibility settings)
134
+ - **Description**: ඔබේ කියවීමේ අත්දැකීම සකසා ගන්න (Adjust your reading experience)
135
+ - **Close**: ප්‍රවේශ්‍යතා සැකසුම් වසන්න (Close accessibility settings)
136
+ - **Reset All**: සියල්ල යළි සකසන්න (Reset All)
137
+ - **Move button**: බොත්තම ගෙනයන්න (Move button)
138
+ - **Button position**: බොත්තමේ පිහිටීම (Button position)
139
+ - **Statement**: ප්‍රවේශ්‍යතා ප්‍රකාශය (Accessibility Statement)
140
+
141
+ ### Tamil (`ta-LK`)
142
+
143
+ - **Title**: அணுகல்தன்மை அமைப்புகள் (Accessibility settings)
144
+ - **Description**: உங்கள் வாசிப்பு அனுபவத்தை மாற்றியமைக்கவும் (Adjust your reading experience)
145
+ - **Close**: அணுகல்தன்மை அமைப்புகளை மூடுக (Close accessibility settings)
146
+ - **Reset All**: அனைத்தையும் மீட்டமை (Reset All)
147
+ - **Move button**: பொத்தானை நகர்த்து (Move button)
148
+ - **Button position**: பொத்தான் அமைவிடம் (Button position)
149
+ - **Statement**: அணுகல்தன்மை அறிக்கை (Accessibility Statement)
@@ -0,0 +1,90 @@
1
+ # Page Headings and Landmarks Navigator
2
+
3
+ This document details the Page Headings and Landmarks Navigator implemented in `accessibility-plugin-react` in accordance with WCAG 2.1 / 2.2 Success Criterion 2.4.1 (Bypass Blocks), 2.4.6 (Headings and Labels), and issue [A11Y-303](https://github.com/prabothcharith/accessibility-react/issues/51).
4
+
5
+ ---
6
+
7
+ ## 1. Core Principles & Acceptance Criteria
8
+
9
+ 1. **True DOM Tree Order**:
10
+ - Discovers actual `h1`–`h6` elements and ARIA headings (`[role="heading"][aria-level]`) in physical document order.
11
+ - Maps top-level landmarks (`<header>`, `<nav>`, `<main>`, `<aside>`, `<footer>`, `<form role="search">`, and ARIA landmark regions) and named anchors (`<a id="...">`, `<a name="...">`).
12
+ - Ignores scoped `<header>` and `<footer>` elements inside `<article>`, `<aside>`, `<main>`, `<nav>`, or `<section>` which are not top-level page landmarks according to the HTML-AAM specification.
13
+ - Strictly excludes internal heading/landmark structures rendered within the accessibility plugin itself (`[data-arap-ui]`).
14
+ 2. **Safe Navigation with Temporary TabIndex Cleanup**:
15
+ - Navigating to an element scrolls it smoothly into view (`scrollIntoView({ behavior: 'smooth', block: 'start' })`, or instant if reduced motion is requested).
16
+ - If the target element is naturally focusable (links, buttons, inputs, elements with pre-existing `tabindex`), focus is set directly.
17
+ - If the element is not naturally focusable (standard `h1`-`h6` or generic section containers), a temporary `tabindex="-1"` is assigned to receive keyboard focus. On `blur`, the temporary `tabindex` is removed immediately, restoring original host DOM semantics.
18
+ 3. **Truthful Representation on Empty Pages**:
19
+ - If the host document has no headings or no landmarks, the navigator displays an explicit status announcement: `"No headings found on this page."` or `"No landmarks found on this page."`.
20
+ - The plugin never fabricates synthetic headings, phantom landmarks, or placeholder outlines.
21
+ 4. **Dynamic SPA / Route Updates Without Observer Loops**:
22
+ - The navigator watches external DOM mutations (`MutationObserver`) while open so client-side route changes update headings and landmarks in real time.
23
+ - Mutations originating inside the plugin UI are strictly ignored, preventing recursive observer loops.
24
+ 5. **Keyboard Operability & Rapid Dismissal**:
25
+ - Accessible tabs (`role="tablist"`, `role="tab"`) switchable with `Left` / `Right` arrow keys.
26
+ - Jump buttons support `Enter` and `Space`.
27
+ - Pressing `Escape` closes the explorer dialog and returns keyboard focus to the "Explore" button.
28
+
29
+ ---
30
+
31
+ ## 2. Component Reference
32
+
33
+ ### `PageNavigatorController`
34
+
35
+ ```tsx
36
+ import { PageNavigatorController } from "accessibility-plugin-react";
37
+
38
+ <PageNavigatorController
39
+ label="Page Navigator"
40
+ description="Explore headings and landmarks"
41
+ closeOnNavigate={false}
42
+ />;
43
+ ```
44
+
45
+ - **Props**:
46
+ - `label?: string` (default: `"Page Navigator"`): Visible and accessible feature label.
47
+ - `description?: string` (default: `"Explore headings and landmarks"`): Subtitle describing the feature.
48
+ - `closeOnNavigate?: boolean` (default: `false`): If true, automatically closes the navigator explorer once an item is activated.
49
+ - `className?: string`: Custom container classes.
50
+ - **Aliases**: `HeadingsNavigatorController`, `PageStructureController`.
51
+
52
+ ---
53
+
54
+ ## 3. Utility APIs
55
+
56
+ ### `scanHeadings(root?: Document | Element): HeadingItem[]`
57
+
58
+ Discovers all visible `h1`-`h6` headings and `role="heading"` elements in DOM tree order, excluding plugin UI elements and hidden elements.
59
+
60
+ ```ts
61
+ import { scanHeadings } from "accessibility-plugin-react";
62
+
63
+ const headings = scanHeadings();
64
+ // [ { id: "intro", level: 1, text: "Introduction", element: HTMLHeadingElement }, ... ]
65
+ ```
66
+
67
+ ### `scanLandmarks(root?: Document | Element): LandmarkItem[]`
68
+
69
+ Discovers visible landmarks (`banner`, `navigation`, `main`, `complementary`, `contentinfo`, `search`, `region`, `form`) and named anchors in DOM tree order.
70
+
71
+ ```ts
72
+ import { scanLandmarks } from "accessibility-plugin-react";
73
+
74
+ const landmarks = scanLandmarks();
75
+ // [ { id: "site-nav", type: "navigation", label: "Primary Nav", element: HTMLElement }, ... ]
76
+ ```
77
+
78
+ ### `navigateToElement(element: HTMLElement, options?: { behavior?: ScrollBehavior, onComplete?: () => void }): void`
79
+
80
+ Safely scrolls to and focuses an element with automatic temporary `tabindex="-1"` cleanup upon blur.
81
+
82
+ ```ts
83
+ import { navigateToElement } from "accessibility-plugin-react";
84
+
85
+ navigateToElement(document.querySelector("h2"));
86
+ ```
87
+
88
+ ### `subscribePageStructure(callback: () => void): () => void`
89
+
90
+ Listens to external DOM additions and removals outside `[data-arap-ui]`, invoking the callback with a 100ms debounce.
@@ -0,0 +1,134 @@
1
+ # Custom Saved Presets and Settings Import/Export (A11Y-305)
2
+
3
+ The `accessibility-plugin-react` library includes user-editable custom presets and versioned JSON backup and transfer capabilities. Users can save their preferred combination of accessibility preferences under a meaningful name, re-apply them with a single click, and export or import them across browsers and devices.
4
+
5
+ ---
6
+
7
+ ## 1. Core Principles & Guardrails
8
+
9
+ - **Privacy Exclusions**: Presets and exported JSON files contain **only** validated accessibility settings. Private personal data, page contents, form inputs, session tokens, user credentials, transcripts, and recordings are **strictly excluded**.
10
+ - **Deterministic Storage & Reset Survival**: Custom presets are preserved across "Reset All" display resets. While display reset restores visual features to their initial values, the user's saved preset library remains intact unless individually deleted.
11
+ - **Stable IDs**: Each preset receives a persistent, stable identifier (`preset_<timestamp>_<random>`) that is retained during import and deduplicated upon merging.
12
+ - **Versioned Envelope**: Presets are exported in a standard, versioned envelope (`version: 1`) with schema references, export timestamps, and application identity.
13
+ - **Robust Error Handling**: Imports strictly validate incoming data, accepting valid v1 envelopes, legacy arrays, and flat settings objects, while returning clear, descriptive user-facing errors on syntax issues or unsupported future versions.
14
+
15
+ ---
16
+
17
+ ## 2. Versioned JSON Schema (v1)
18
+
19
+ ```json
20
+ {
21
+ "$schema": "https://accessibility-plugin.org/schemas/presets-v1.json",
22
+ "version": 1,
23
+ "app": "accessibility-plugin-react",
24
+ "exportedAt": "2026-10-27T08:00:00.000Z",
25
+ "presets": [
26
+ {
27
+ "id": "preset_1730000000000_a1b2c3",
28
+ "name": "Evening Low Strain",
29
+ "createdAt": "2026-10-27T08:00:00.000Z",
30
+ "settings": {
31
+ "fontScale": 1.25,
32
+ "lineHeight": 1.5,
33
+ "contrastMode": "dark",
34
+ "reduceMotion": true,
35
+ "highlightLinks": true
36
+ }
37
+ }
38
+ ],
39
+ "currentSettings": {
40
+ "contrastMode": "dark",
41
+ "fontScale": 1.25
42
+ }
43
+ }
44
+ ```
45
+
46
+ ---
47
+
48
+ ## 3. Supported Import Formats
49
+
50
+ | Format | Structure | Behavior |
51
+ | ------------------------ | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
52
+ | **Version 1 Envelope** | Object with `version: 1`, `presets: [...]`, and optional `currentSettings` | Validates schema, imports presets (deduped by ID), and applies current settings if present. |
53
+ | **Legacy Preset Array** | Array of objects `[{ id, name, settings }, ...]` | Automatically migrates into valid presets, generating IDs and timestamps if missing. |
54
+ | **Flat Settings Object** | Object with key-value preferences `{ fontScale: 1.2, contrastMode: "high" }` | Applies settings to active feature store as imported settings. |
55
+ | **Unsupported Version** | Object with `version > 1` | Rejects with clear message: _"Unsupported schema version: version X is newer than supported version 1."_ |
56
+ | **Malformed JSON** | Invalid syntax or non-object content | Rejects with syntax error message without corrupting state or store. |
57
+
58
+ ---
59
+
60
+ ## 4. Components & Hooks
61
+
62
+ ### `<PresetsController />`
63
+
64
+ Renders an accessible custom preset manager inside the widget list:
65
+
66
+ - Save current configuration as a new named preset.
67
+ - Browse saved presets with affected settings summary chips.
68
+ - 1-click **Apply** and **Delete** actions.
69
+ - **Export JSON** to download a backup file.
70
+ - **Import JSON** file picker supporting `.json` files.
71
+ - Live announcements with `role="status"` and `aria-live="polite"` for screen readers.
72
+
73
+ Aliases:
74
+
75
+ - `CustomPresetsController`
76
+ - `SettingsImportExportController`
77
+ - `PresetsBackupController`
78
+
79
+ ```tsx
80
+ import {
81
+ AccessibilityPlugin,
82
+ AccessibilityButton,
83
+ AccessibilityList,
84
+ PresetsController,
85
+ } from "accessibility-plugin-react";
86
+
87
+ export function App() {
88
+ return (
89
+ <AccessibilityPlugin>
90
+ <AccessibilityButton />
91
+ <AccessibilityList>
92
+ <PresetsController />
93
+ </AccessibilityList>
94
+ </AccessibilityPlugin>
95
+ );
96
+ }
97
+ ```
98
+
99
+ ### `usePresets()` Hook
100
+
101
+ Headless hook to interact with presets and import/export programmatically:
102
+
103
+ ```tsx
104
+ import { usePresets } from "accessibility-plugin-react";
105
+
106
+ function CustomPresetUI() {
107
+ const {
108
+ presets,
109
+ saveCurrentAsPreset,
110
+ applyPreset,
111
+ deletePreset,
112
+ downloadExport,
113
+ importFromFile,
114
+ } = usePresets();
115
+
116
+ return (
117
+ <div>
118
+ <button onClick={() => saveCurrentAsPreset("My Custom Setup")}>
119
+ Save Preset
120
+ </button>
121
+ <button onClick={() => downloadExport()}>Export Backup</button>
122
+ <ul>
123
+ {presets.map((p) => (
124
+ <li key={p.id}>
125
+ <span>{p.name}</span>
126
+ <button onClick={() => applyPreset(p.id)}>Apply</button>
127
+ <button onClick={() => deletePreset(p.id)}>Delete</button>
128
+ </li>
129
+ ))}
130
+ </ul>
131
+ </div>
132
+ );
133
+ }
134
+ ```
@@ -0,0 +1,113 @@
1
+ # Accessibility Profiles and Deterministic Override Model
2
+
3
+ `accessibility-plugin-react` provides eight neutral, user-editable accessibility profile presets alongside a deterministic override model. The profiles offer tested suggestions of preference combinations without making medical claims or altering keyboard navigation.
4
+
5
+ ## The Eight Presets
6
+
7
+ Each profile is defined in `src/core/preferences/defaults.ts` and exposed through `PROFILE_DEFINITIONS`:
8
+
9
+ | Profile Preset | Identifier | Description & Focus | Settings Applied |
10
+ | ------------------------- | ------------- | -------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
11
+ | **Motor Impaired** | `motor` | Enhanced focus rings, richer tooltips, and reduced motion. | `highlightFocus: true`, `reduceMotion: true`, `tooltips: true` |
12
+ | **Blind & Screen Reader** | `blind` | Semantic assistance and accessible authored descriptions without speech synthesis or mic requests. | `tooltips: true` |
13
+ | **Color Blind** | `color-blind` | High contrast accents and non-color-only link indicators. | `contrastMode: "high"`, `highlightLinks: true` |
14
+ | **Dyslexia Friendly** | `dyslexia` | Legible typeface, reading guide line, and reduced motion. | `fontFamily: "dyslexia-option"`, `readerMode: "guide"`, `reduceMotion: true` |
15
+ | **Low Vision** | `low-vision` | Enlarged text, large cursor pointer, and high-visibility focus. | `fontScale: 1.25`, `cursorSize: "large"`, `highlightFocus: true`, `tooltips: true` |
16
+ | **Cognitive & Learning** | `cognitive` | Mild text scaling, reading guide line, and distraction reduction. | `fontScale: 1.125`, `readerMode: "guide"`, `reduceMotion: true`, `tooltips: true` |
17
+ | **Seizure & Epileptic** | `seizure` | Pauses nonessential motion and reduces transition flashes. | `reduceMotion: true` |
18
+ | **ADHD / Focus** | `adhd` | Reading mask spotlight and reduced animation distraction. | `readerMode: "mask"`, `reduceMotion: true` |
19
+
20
+ ## Deterministic Override Model
21
+
22
+ When a user applies a profile, their pre-existing customizations are never permanently overwritten. The model operates in three distinct layers:
23
+
24
+ ```
25
+ ┌────────────────────────────────────────────────────────┐
26
+ │ 1. User Explicit Overrides (Highest Precedence) │
27
+ │ Any adjustment made while a profile is active. │
28
+ ├────────────────────────────────────────────────────────┤
29
+ │ 2. Active Profile Snapshot (Atomic Suggestion) │
30
+ │ Settings configured by the selected profile preset. │
31
+ ├────────────────────────────────────────────────────────┤
32
+ │ 3. Baseline Preferences (Pre-Profile Custom Settings) │
33
+ │ Settings configured by the user prior to profile. │
34
+ └────────────────────────────────────────────────────────┘
35
+ ```
36
+
37
+ ### Independent Choice Survival
38
+
39
+ - **Snapshotting**: Upon applying a profile, the pre-profile values for all affected settings are recorded in `baseSnapshot`.
40
+ - **Override Tracking**: When a user adjusts any setting while a profile is active, that setting is stored in `overrides`.
41
+ - **Reversion**: When the user clicks **Revert to custom settings**:
42
+ - Settings that were **not** touched by the user return to their pre-profile `baseSnapshot` values.
43
+ - Settings that **were** explicitly overridden by the user **survive** at their adjusted values.
44
+ - The active profile is cleared to `null`.
45
+
46
+ ## Privacy & Safety Guardrails
47
+
48
+ - **Zero Implicit Speech or Microphone Access**: Presets (such as `blind`) strictly provide DOM visual/structural enhancements and never invoke Web Speech API synthesis, microphone permissions, or external audio streams without explicit user consent.
49
+ - **No Medical Efficacy Claims**: Profiles are presented neutrally as assistive suggestions, not diagnostic or therapeutic solutions.
50
+ - **No Keyboard Sequence Mutation**: Profiles never alter standard DOM tab order or create false modal traps.
51
+
52
+ ## Component & Hook Usage
53
+
54
+ ### Controller Component
55
+
56
+ ```tsx
57
+ import {
58
+ AccessibilityPlugin,
59
+ AccessibilityButton,
60
+ AccessibilityList,
61
+ ProfilesController,
62
+ FontSizeController,
63
+ ContrastModeController,
64
+ } from "accessibility-plugin-react";
65
+
66
+ export function Settings() {
67
+ return (
68
+ <AccessibilityPlugin>
69
+ <AccessibilityButton />
70
+ <AccessibilityList>
71
+ <ProfilesController label="Profiles" />
72
+ <FontSizeController />
73
+ <ContrastModeController />
74
+ </AccessibilityList>
75
+ </AccessibilityPlugin>
76
+ );
77
+ }
78
+ ```
79
+
80
+ Aliases: `ProfileController`, `AccessibilityProfilesController`.
81
+
82
+ ### Custom Profile Consumption via `useProfiles()`
83
+
84
+ ```tsx
85
+ import { useProfiles } from "accessibility-plugin-react";
86
+
87
+ export function CustomProfileSelector() {
88
+ const {
89
+ profiles,
90
+ activeProfileId,
91
+ activeProfile,
92
+ applyProfile,
93
+ revertProfile,
94
+ isProfileActive,
95
+ } = useProfiles();
96
+
97
+ return (
98
+ <div>
99
+ {profiles.map((p) => (
100
+ <button
101
+ key={p.id}
102
+ onClick={() =>
103
+ isProfileActive(p.id) ? revertProfile() : applyProfile(p.id)
104
+ }
105
+ aria-pressed={isProfileActive(p.id)}
106
+ >
107
+ {p.label} {isProfileActive(p.id) ? "(Active)" : ""}
108
+ </button>
109
+ ))}
110
+ </div>
111
+ );
112
+ }
113
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accessibility-plugin-react",
3
- "version": "2.13.0",
3
+ "version": "2.17.0",
4
4
  "description": "A composable React display-preference widget with a clean light design, persistent settings and movable accessible controls.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",