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.
- package/README.md +26 -22
- package/dist/index.d.mts +269 -6
- package/dist/index.d.ts +269 -6
- package/dist/index.js +2476 -316
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2473 -346
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +371 -1
- package/docs/API.md +7 -4
- package/docs/BUILD_AND_RELEASE_PLAN.md +4 -4
- package/docs/FEATURES.md +30 -26
- package/docs/LOCALES.md +149 -0
- package/docs/PAGE_NAVIGATOR.md +90 -0
- package/docs/PRESETS.md +134 -0
- package/docs/PROFILES.md +113 -0
- package/package.json +1 -1
package/dist/style.css
CHANGED
|
@@ -12,9 +12,18 @@
|
|
|
12
12
|
color-scheme: light;
|
|
13
13
|
font:
|
|
14
14
|
15px/1.5 system-ui,
|
|
15
|
+
-apple-system,
|
|
16
|
+
BlinkMacSystemFont,
|
|
17
|
+
"Segoe UI",
|
|
18
|
+
Roboto,
|
|
19
|
+
"Noto Sans Sinhala",
|
|
20
|
+
"Iskoola Pota",
|
|
21
|
+
"Noto Sans Tamil",
|
|
22
|
+
"Latha",
|
|
23
|
+
"Nirmala UI",
|
|
15
24
|
sans-serif;
|
|
16
25
|
color: var(--arap-text);
|
|
17
|
-
text-align:
|
|
26
|
+
text-align: start;
|
|
18
27
|
letter-spacing: normal;
|
|
19
28
|
}
|
|
20
29
|
.arap-root *,
|
|
@@ -1175,3 +1184,364 @@
|
|
|
1175
1184
|
box-shadow: none !important;
|
|
1176
1185
|
}
|
|
1177
1186
|
}
|
|
1187
|
+
|
|
1188
|
+
/* Page Headings and Landmarks Navigator (A11Y-303) */
|
|
1189
|
+
.arap-navigator-dialog {
|
|
1190
|
+
display: flex;
|
|
1191
|
+
flex-direction: column;
|
|
1192
|
+
gap: 8px;
|
|
1193
|
+
width: 100%;
|
|
1194
|
+
margin-top: 10px;
|
|
1195
|
+
padding: 10px;
|
|
1196
|
+
background: var(--arap-control, #f1f5f9);
|
|
1197
|
+
border: 1px solid var(--arap-border, #e2e8f0);
|
|
1198
|
+
border-radius: 8px;
|
|
1199
|
+
box-sizing: border-box;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
.arap-navigator-tabs {
|
|
1203
|
+
display: flex;
|
|
1204
|
+
gap: 4px;
|
|
1205
|
+
border-bottom: 1px solid var(--arap-border, #cbd5e1);
|
|
1206
|
+
padding-bottom: 6px;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
.arap-navigator-tab {
|
|
1210
|
+
flex: 1;
|
|
1211
|
+
display: inline-flex;
|
|
1212
|
+
align-items: center;
|
|
1213
|
+
justify-content: center;
|
|
1214
|
+
gap: 6px;
|
|
1215
|
+
padding: 6px 10px;
|
|
1216
|
+
font-size: 12px;
|
|
1217
|
+
font-weight: 600;
|
|
1218
|
+
color: var(--arap-muted, #64748b);
|
|
1219
|
+
background: transparent;
|
|
1220
|
+
border: none;
|
|
1221
|
+
border-radius: 6px;
|
|
1222
|
+
cursor: pointer;
|
|
1223
|
+
transition: all 120ms ease;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
.arap-navigator-tab:hover {
|
|
1227
|
+
color: var(--arap-text, #0f172a);
|
|
1228
|
+
background: rgba(0, 0, 0, 0.04);
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
.arap-navigator-tab-active {
|
|
1232
|
+
color: var(--arap-accent, #008060) !important;
|
|
1233
|
+
background: var(--arap-selected, #f0fdf4) !important;
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
.arap-navigator-search-box {
|
|
1237
|
+
width: 100%;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
.arap-navigator-search {
|
|
1241
|
+
width: 100%;
|
|
1242
|
+
box-sizing: border-box;
|
|
1243
|
+
padding: 6px 10px;
|
|
1244
|
+
font-size: 12px;
|
|
1245
|
+
border: 1px solid var(--arap-border, #cbd5e1);
|
|
1246
|
+
border-radius: 6px;
|
|
1247
|
+
background: var(--arap-surface, #ffffff);
|
|
1248
|
+
color: var(--arap-text, #0f172a);
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
.arap-navigator-search:focus {
|
|
1252
|
+
outline: 2px solid var(--arap-accent, #008060);
|
|
1253
|
+
outline-offset: 1px;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
.arap-navigator-content {
|
|
1257
|
+
max-height: 240px;
|
|
1258
|
+
overflow-y: auto;
|
|
1259
|
+
overflow-x: hidden;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
.arap-navigator-list {
|
|
1263
|
+
list-style: none;
|
|
1264
|
+
margin: 0;
|
|
1265
|
+
padding: 0;
|
|
1266
|
+
display: flex;
|
|
1267
|
+
flex-direction: column;
|
|
1268
|
+
gap: 4px;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
.arap-navigator-item {
|
|
1272
|
+
margin: 0;
|
|
1273
|
+
padding: 0;
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
.arap-navigator-jump-btn {
|
|
1277
|
+
width: 100%;
|
|
1278
|
+
box-sizing: border-box;
|
|
1279
|
+
display: flex;
|
|
1280
|
+
align-items: center;
|
|
1281
|
+
gap: 8px;
|
|
1282
|
+
padding: 6px 8px;
|
|
1283
|
+
font-size: 12px;
|
|
1284
|
+
font-weight: 500;
|
|
1285
|
+
text-align: left;
|
|
1286
|
+
background: var(--arap-surface, #ffffff);
|
|
1287
|
+
border: 1px solid var(--arap-border, #e2e8f0);
|
|
1288
|
+
border-radius: 6px;
|
|
1289
|
+
color: var(--arap-text, #0f172a);
|
|
1290
|
+
cursor: pointer;
|
|
1291
|
+
transition:
|
|
1292
|
+
background 100ms ease,
|
|
1293
|
+
border-color 100ms ease;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
.arap-navigator-jump-btn:hover,
|
|
1297
|
+
.arap-navigator-jump-btn:focus-visible {
|
|
1298
|
+
background: var(--arap-selected, #f0fdf4);
|
|
1299
|
+
border-color: var(--arap-accent, #008060);
|
|
1300
|
+
outline: 2px solid var(--arap-accent, #008060);
|
|
1301
|
+
outline-offset: -1px;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
.arap-navigator-badge {
|
|
1305
|
+
display: inline-block;
|
|
1306
|
+
padding: 2px 6px;
|
|
1307
|
+
font-size: 10px;
|
|
1308
|
+
font-weight: 700;
|
|
1309
|
+
border-radius: 4px;
|
|
1310
|
+
flex-shrink: 0;
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
.arap-navigator-badge-h {
|
|
1314
|
+
background: #e0f2fe;
|
|
1315
|
+
color: #0369a1;
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
.arap-navigator-badge-l {
|
|
1319
|
+
background: #fef3c7;
|
|
1320
|
+
color: #b45309;
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
.arap-navigator-item-text {
|
|
1324
|
+
overflow: hidden;
|
|
1325
|
+
text-overflow: ellipsis;
|
|
1326
|
+
white-space: nowrap;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
.arap-navigator-empty {
|
|
1330
|
+
padding: 16px;
|
|
1331
|
+
font-size: 12px;
|
|
1332
|
+
text-align: center;
|
|
1333
|
+
color: var(--arap-muted, #64748b);
|
|
1334
|
+
font-style: italic;
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
/* Accessibility Profiles and Preview Cards (A11Y-304) */
|
|
1338
|
+
.arap-profile-card {
|
|
1339
|
+
padding: 12px;
|
|
1340
|
+
border: 1px solid var(--arap-border, #e2e8f0);
|
|
1341
|
+
border-radius: 8px;
|
|
1342
|
+
background: var(--arap-card-bg, #ffffff);
|
|
1343
|
+
transition:
|
|
1344
|
+
border-color 0.15s ease,
|
|
1345
|
+
box-shadow 0.15s ease;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
.arap-profile-card:hover {
|
|
1349
|
+
border-color: var(--arap-primary, #2563eb);
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
.arap-profile-card-active {
|
|
1353
|
+
border-color: var(--arap-primary, #2563eb);
|
|
1354
|
+
background: rgba(37, 99, 235, 0.03);
|
|
1355
|
+
box-shadow: 0 0 0 1px var(--arap-primary, #2563eb);
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
.arap-profile-header {
|
|
1359
|
+
margin-bottom: 8px;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
.arap-profile-title-row {
|
|
1363
|
+
display: flex;
|
|
1364
|
+
align-items: center;
|
|
1365
|
+
justify-content: space-between;
|
|
1366
|
+
margin-bottom: 4px;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
.arap-profile-title {
|
|
1370
|
+
margin: 0;
|
|
1371
|
+
font-size: 13px;
|
|
1372
|
+
font-weight: 600;
|
|
1373
|
+
color: var(--arap-text, #1e293b);
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
.arap-profile-active-badge {
|
|
1377
|
+
display: inline-block;
|
|
1378
|
+
padding: 2px 8px;
|
|
1379
|
+
font-size: 11px;
|
|
1380
|
+
font-weight: 600;
|
|
1381
|
+
border-radius: 9999px;
|
|
1382
|
+
background: #dbeafe;
|
|
1383
|
+
color: #1d4ed8;
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
.arap-profile-desc {
|
|
1387
|
+
margin: 0;
|
|
1388
|
+
font-size: 11px;
|
|
1389
|
+
color: var(--arap-muted, #64748b);
|
|
1390
|
+
line-height: 1.4;
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
.arap-profile-affected {
|
|
1394
|
+
margin-top: 8px;
|
|
1395
|
+
margin-bottom: 10px;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
.arap-profile-affected-label {
|
|
1399
|
+
display: block;
|
|
1400
|
+
font-size: 10px;
|
|
1401
|
+
font-weight: 600;
|
|
1402
|
+
text-transform: uppercase;
|
|
1403
|
+
letter-spacing: 0.05em;
|
|
1404
|
+
color: var(--arap-muted, #94a3b8);
|
|
1405
|
+
margin-bottom: 4px;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
.arap-profile-chips {
|
|
1409
|
+
display: flex;
|
|
1410
|
+
flex-wrap: wrap;
|
|
1411
|
+
gap: 4px;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
.arap-profile-chip {
|
|
1415
|
+
display: inline-block;
|
|
1416
|
+
padding: 2px 6px;
|
|
1417
|
+
font-size: 10px;
|
|
1418
|
+
background: var(--arap-chip-bg, #f1f5f9);
|
|
1419
|
+
color: var(--arap-text, #334155);
|
|
1420
|
+
border-radius: 4px;
|
|
1421
|
+
border: 1px solid var(--arap-chip-border, #e2e8f0);
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
.arap-profile-actions {
|
|
1425
|
+
display: flex;
|
|
1426
|
+
justify-content: flex-end;
|
|
1427
|
+
margin-top: 8px;
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
.arap-profile-apply-btn,
|
|
1431
|
+
.arap-profile-revert-btn {
|
|
1432
|
+
display: inline-flex;
|
|
1433
|
+
align-items: center;
|
|
1434
|
+
justify-content: center;
|
|
1435
|
+
min-height: 36px;
|
|
1436
|
+
padding: 6px 14px;
|
|
1437
|
+
font-size: 12px;
|
|
1438
|
+
font-weight: 600;
|
|
1439
|
+
border-radius: 6px;
|
|
1440
|
+
cursor: pointer;
|
|
1441
|
+
transition:
|
|
1442
|
+
background 0.15s ease,
|
|
1443
|
+
border-color 0.15s ease;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
.arap-profile-apply-btn {
|
|
1447
|
+
background: var(--arap-primary, #2563eb);
|
|
1448
|
+
color: #ffffff;
|
|
1449
|
+
border: 1px solid var(--arap-primary, #2563eb);
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
.arap-profile-apply-btn:hover {
|
|
1453
|
+
background: #1d4ed8;
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
.arap-profile-revert-btn {
|
|
1457
|
+
background: #ffffff;
|
|
1458
|
+
color: #dc2626;
|
|
1459
|
+
border: 1px solid #fca5a5;
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
.arap-profile-revert-btn:hover {
|
|
1463
|
+
background: #fef2f2;
|
|
1464
|
+
border-color: #f87171;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
.arap-large-controls .arap-profile-apply-btn,
|
|
1468
|
+
.arap-large-controls .arap-profile-revert-btn {
|
|
1469
|
+
min-height: 48px;
|
|
1470
|
+
padding: 10px 18px;
|
|
1471
|
+
font-size: 14px;
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1475
|
+
.arap-profile-card,
|
|
1476
|
+
.arap-profile-apply-btn,
|
|
1477
|
+
.arap-profile-revert-btn,
|
|
1478
|
+
.arap-preset-card {
|
|
1479
|
+
transition: none !important;
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
/* Custom Presets and Transfer (A11Y-305) */
|
|
1484
|
+
.arap-preset-card {
|
|
1485
|
+
transition:
|
|
1486
|
+
border-color 0.15s ease,
|
|
1487
|
+
box-shadow 0.15s ease;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
.arap-preset-card:hover {
|
|
1491
|
+
border-color: var(--arap-border-hover, #cbd5e1);
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
.arap-large-controls .arap-preset-card button {
|
|
1495
|
+
min-height: 48px;
|
|
1496
|
+
padding: 10px 16px;
|
|
1497
|
+
font-size: 14px;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
/* RTL and Bidirectional Writing Infrastructure (A11Y-306) */
|
|
1501
|
+
.arap-root[dir="rtl"],
|
|
1502
|
+
.arap-panel[dir="rtl"] {
|
|
1503
|
+
direction: rtl;
|
|
1504
|
+
text-align: right;
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
.arap-panel[dir="rtl"] .arap-heading {
|
|
1508
|
+
flex-direction: row-reverse;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
.arap-panel[dir="rtl"] .arap-position-arrows {
|
|
1512
|
+
direction: ltr; /* retain physical spatial geometry for navigation arrows */
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
.arap-search-input {
|
|
1516
|
+
width: 100%;
|
|
1517
|
+
box-sizing: border-box;
|
|
1518
|
+
padding: 6px 28px 6px 10px;
|
|
1519
|
+
font-size: 12px;
|
|
1520
|
+
border: 1px solid var(--arap-border, #cbd5e1);
|
|
1521
|
+
border-radius: 6px;
|
|
1522
|
+
background: var(--arap-surface, #ffffff);
|
|
1523
|
+
color: var(--arap-text, #0f172a);
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
.arap-panel[dir="rtl"] .arap-search-input {
|
|
1527
|
+
padding: 6px 10px 6px 28px;
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
.arap-search-clear {
|
|
1531
|
+
position: absolute;
|
|
1532
|
+
inset-inline-end: 8px;
|
|
1533
|
+
top: 50%;
|
|
1534
|
+
transform: translateY(-50%);
|
|
1535
|
+
border: none;
|
|
1536
|
+
background: transparent;
|
|
1537
|
+
cursor: pointer;
|
|
1538
|
+
padding: 2px 6px;
|
|
1539
|
+
font-size: 14px;
|
|
1540
|
+
color: var(--arap-muted, #64748b);
|
|
1541
|
+
border-radius: 4px;
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
.arap-search-clear:hover {
|
|
1545
|
+
background: var(--arap-selected, #eff6ff);
|
|
1546
|
+
color: var(--arap-text, #0f172a);
|
|
1547
|
+
}
|
package/docs/API.md
CHANGED
|
@@ -20,6 +20,9 @@ All exports are named from `accessibility-plugin-react`. JavaScript consumers re
|
|
|
20
20
|
| LetterSpacingController | Optional `min`, `max`, `step`, `steps`. Excludes tables and code blocks; respects language-aware limits (disables on cursive/Arabic, clamps <=1px on Indic/Sinhala/Tamil). |
|
|
21
21
|
| WordSpacingController | Optional `min`, `max`, `step`, `steps` (default 0–10px, step 1). Excludes tables, code blocks, controls, and widget UI. |
|
|
22
22
|
| ParagraphSpacingController | Optional `min`, `max`, `step`, `steps` (default 0–32px, step 4). Increases bottom margin on `p` and `[role="paragraph"]`. |
|
|
23
|
+
| PageNavigatorController | Optional `title?: string`, `headingsLabel?: string`, `landmarksLabel?: string`, `searchPlaceholder?: string`, `largeControls?: boolean`. Interactive headings and landmarks navigator with safe focus and live updates. Aliases: `HeadingsNavigatorController`, `PageStructureController`. See docs/PAGE_NAVIGATOR.md. |
|
|
24
|
+
| ProfilesController | Optional `label?: string`, `description?: string`, `largeControls?: boolean`, `onProfileChange?: (id) => void`. Previews, applies, and reverts eight neutral presets with deterministic override model. Aliases: `ProfileController`, `AccessibilityProfilesController`. See docs/PROFILES.md. |
|
|
25
|
+
| PresetsController | Optional `className?: string`, `label?: string`, `description?: string`, `largeControls?: boolean`. Saves named custom presets and handles versioned JSON import/export with privacy exclusions. Aliases: `CustomPresetsController`, `SettingsImportExportController`, `PresetsBackupController`. See docs/PRESETS.md. |
|
|
23
26
|
| All other controllers in FEATURES.md | Pick/omit in JSX. For custom labels or behavior, compose a control with useAccessibility or the modular control primitives. |
|
|
24
27
|
|
|
25
28
|
Use one button/list pair per provider and one provider per document. UI IDs use React `useId`; do not target the old fixed `arap-panel` ID. Plugin children can include ordinary app content, but mounting the widget as a sibling makes intent clearer. Persistence configuration is fixed at mount; use `<AccessibilityPlugin key={newKey} persistenceKey={newKey}>` when switching storage identity.
|
|
@@ -48,15 +51,15 @@ Definitions/defaults are immutable for the provider lifetime; the first register
|
|
|
48
51
|
|
|
49
52
|
`FeatureRegistration` is `FeatureOptions<unknown>` plus `defaultValue: unknown`. Use the generic hook instead of manually casting callbacks. Legacy `registerReset(key, fn)` / `unregisterReset(key)` remain available; callbacks run before global state is cleared. They are not the primary effect lifecycle API. Callback owners must unregister their callback on teardown.
|
|
50
53
|
|
|
51
|
-
Exported types: `AccessibilityPluginProps`, `AccessibilityButtonProps`, `AccessibilityListProps`, `AccessibilityState`, `AccessibilityContextValue`, `PluginPosition`, `WidgetPlacement`, `FeatureOptions<T>`, `FeatureRegistration`, `ToggleControlProps`, `ChoiceControlProps`, `ChoiceOption<T>`, `ChoiceGroup<T>`, `StepperControlProps`, `FeatureCardProps`, `FeatureStatus`, `SearchCountProps`, `EmptyStateProps`, `ErrorStateProps`, `ProfilePreviewCardProps`, `FontSizeControllerProps`, `TextScaleControllerProps`, `TextScaleStep`, `FontFamilyPreset`, `ContrastModeValue`, `ContrastPalette`, `LineHeightControllerProps`, `LetterSpacingControllerProps`, `WordSpacingControllerProps`, `ParagraphSpacingControllerProps`, `ScriptSpacingConstraints`, `SkipToMainLinkProps`, `HideImagesControllerProps`, `BigCursorControllerProps`, `ReadingMaskControllerProps`, `ReadingGuideControllerProps`, `TooltipsControllerProps`, `AccessibilityPreferences`, `ContrastMode`, `CursorSizePreference`, `FontFamilyPreference`, `ProfileDefinition`, `ProfilePresetId`, `ReaderMode`, `SaturationPreference`, `StorageMode`, `TextAlignPreference`, `LocaleStrings`.
|
|
54
|
+
Exported types: `AccessibilityPluginProps`, `AccessibilityButtonProps`, `AccessibilityListProps`, `AccessibilityState`, `AccessibilityContextValue`, `PluginPosition`, `WidgetPlacement`, `FeatureOptions<T>`, `FeatureRegistration`, `ToggleControlProps`, `ChoiceControlProps`, `ChoiceOption<T>`, `ChoiceGroup<T>`, `StepperControlProps`, `FeatureCardProps`, `FeatureStatus`, `SearchCountProps`, `EmptyStateProps`, `ErrorStateProps`, `ProfilePreviewCardProps`, `FontSizeControllerProps`, `TextScaleControllerProps`, `TextScaleStep`, `FontFamilyPreset`, `ContrastModeValue`, `ContrastPalette`, `LineHeightControllerProps`, `LetterSpacingControllerProps`, `WordSpacingControllerProps`, `ParagraphSpacingControllerProps`, `ScriptSpacingConstraints`, `SkipToMainLinkProps`, `HideImagesControllerProps`, `BigCursorControllerProps`, `ReadingMaskControllerProps`, `ReadingGuideControllerProps`, `TooltipsControllerProps`, `PageNavigatorControllerProps`, `HeadingItem`, `LandmarkItem`, `ProfilesControllerProps`, `ActiveProfileState`, `UseProfilesResult`, `AccessibilityPreferences`, `ContrastMode`, `CursorSizePreference`, `FontFamilyPreference`, `ProfileDefinition`, `ProfilePresetId`, `ReaderMode`, `SaturationPreference`, `StorageMode`, `TextAlignPreference`, `LocaleStrings`, `SupportedLocale`, `FeatureLocaleLabels`, `PresetsControllerProps`, `CustomPreset`, `PresetsExportV1`, `ImportResult`, `UsePresetsResult`.
|
|
52
55
|
|
|
53
|
-
Exported control components: `ToggleControl`, `ChoiceControl`, `StepperControl`, `FeatureCard`, `SearchCount`, `EmptyState`, `ErrorState`, `ProfilePreviewCard`, `FontSizeController`, `TextScaleController`, `LineHeightController`, `LetterSpacingController`, `WordSpacingController`, `ParagraphSpacingController`, `FontFamilyController`, `TextAlignController`, `ContrastController`, `ContrastModeController`, `LinkHighlightController`, `HighlightFocusController`, `FocusHighlightController`, `ReduceMotionController`, `HideImagesController`, `HideDecorativeImagesController`, `BigCursorController`, `ReadingMaskController`, `ReadingGuideController`, `TooltipsController`, `AccessibleTooltipsController`, `SkipToMainLink`.
|
|
56
|
+
Exported control components: `ToggleControl`, `ChoiceControl`, `StepperControl`, `FeatureCard`, `SearchCount`, `EmptyState`, `ErrorState`, `ProfilePreviewCard`, `FontSizeController`, `TextScaleController`, `LineHeightController`, `LetterSpacingController`, `WordSpacingController`, `ParagraphSpacingController`, `FontFamilyController`, `TextAlignController`, `ContrastController`, `ContrastModeController`, `LinkHighlightController`, `HighlightFocusController`, `FocusHighlightController`, `ReduceMotionController`, `HideImagesController`, `HideDecorativeImagesController`, `BigCursorController`, `ReadingMaskController`, `ReadingGuideController`, `TooltipsController`, `AccessibleTooltipsController`, `PageNavigatorController`, `HeadingsNavigatorController`, `PageStructureController`, `ProfilesController`, `ProfileController`, `AccessibilityProfilesController`, `PresetsController`, `CustomPresetsController`, `SettingsImportExportController`, `PresetsBackupController`, `SkipToMainLink`.
|
|
54
57
|
|
|
55
|
-
Exported typography, contrast, reading aids, tooltips, and reflow utilities: `TEXT_SCALE_STEPS`, `TEXT_SCALE_PROTECTED_SELECTOR`, `isProtectedFromTextScale`, `LINE_HEIGHT_STEPS`, `LINE_HEIGHT_RATIOS`, `TEXT_SPACING_EXCLUDED_SELECTOR`, `isProtectedFromTextSpacing`, `getScriptSpacingConstraints`, `FONT_FAMILY_PRESETS`, `LEGIBLE_FONT_STACK`, `DYSLEXIA_FONT_STACK`, `FONT_FAMILY_PROTECTED_SELECTOR`, `isProtectedFromFontFamily`, `TEXT_ALIGN_BLOCK_SELECTOR`, `isProtectedFromTextAlign`, `CONTRAST_MODES`, `isForcedColorsActive`, `subscribeForcedColors`, `isReducedMotionActive`, `subscribeReducedMotion`, `isEligibleDecorativeImage`, `isFunctionalOrMeaningfulImage`, `hasFinePointer`, `subscribeFinePointer`, `nudgeReadingAid`, `DEFAULT_READING_MASK_HEIGHT`, `MIN_READING_MASK_HEIGHT`, `MAX_READING_MASK_HEIGHT`, `READING_MASK_HEIGHT_PRESETS`, `getAuthoredDescription`, `positionTooltip`, `enableAccessibleTooltips`, `CONTRAST_PROTECTED_SELECTOR`, `isProtectedFromContrast`, `CONTRAST_PALETTES`, `findMainLandmark`.
|
|
58
|
+
Exported typography, contrast, reading aids, tooltips, and reflow utilities: `TEXT_SCALE_STEPS`, `TEXT_SCALE_PROTECTED_SELECTOR`, `isProtectedFromTextScale`, `LINE_HEIGHT_STEPS`, `LINE_HEIGHT_RATIOS`, `TEXT_SPACING_EXCLUDED_SELECTOR`, `isProtectedFromTextSpacing`, `getScriptSpacingConstraints`, `FONT_FAMILY_PRESETS`, `LEGIBLE_FONT_STACK`, `DYSLEXIA_FONT_STACK`, `FONT_FAMILY_PROTECTED_SELECTOR`, `isProtectedFromFontFamily`, `TEXT_ALIGN_BLOCK_SELECTOR`, `isProtectedFromTextAlign`, `CONTRAST_MODES`, `isForcedColorsActive`, `subscribeForcedColors`, `isReducedMotionActive`, `subscribeReducedMotion`, `isEligibleDecorativeImage`, `isFunctionalOrMeaningfulImage`, `hasFinePointer`, `subscribeFinePointer`, `nudgeReadingAid`, `DEFAULT_READING_MASK_HEIGHT`, `MIN_READING_MASK_HEIGHT`, `MAX_READING_MASK_HEIGHT`, `READING_MASK_HEIGHT_PRESETS`, `getAuthoredDescription`, `positionTooltip`, `enableAccessibleTooltips`, `scanHeadings`, `scanLandmarks`, `navigateToElement`, `subscribePageStructure`, `useProfiles`, `ALL_PROFILE_IDS`, `getProfileDefinition`, `mapProfileSettingsToFeatures`, `mapFeaturesToProfileSettings`, `applyProfileToStore`, `revertProfileFromStore`, `recordProfileOverride`, `usePresets`, `createCustomPreset`, `isValidCustomPreset`, `exportPresetsToJson`, `downloadJsonFile`, `validateAndParseImport`, `applyCustomPresetToStore`, `sanitizePreferences`, `ALLOWED_PREFERENCE_KEYS`, `CONTRAST_PROTECTED_SELECTOR`, `isProtectedFromContrast`, `CONTRAST_PALETTES`, `findMainLandmark`.
|
|
56
59
|
|
|
57
60
|
Exported preference and profile utilities: `DEFAULT_PREFERENCES`, `PROFILE_DEFINITIONS`, `normalizePreferences`, `normalizePreferenceValue`, `resolveEffectivePreferences`, `preferencesReducer`, `createInitialPreferencesState`.
|
|
58
61
|
|
|
59
|
-
Exported localization utilities: `enLocale`, `registerLocale`, `resolveLocaleStrings`, `isRtlLocale`.
|
|
62
|
+
Exported localization utilities: `enLocale`, `siLocale`, `taLocale`, `registerLocale`, `resolveLocaleStrings`, `isRtlLocale`.
|
|
60
63
|
|
|
61
64
|
## Styling and labels
|
|
62
65
|
|
|
@@ -95,10 +95,10 @@ completed. Closing a child issue does not replace the milestone exit review.
|
|
|
95
95
|
|
|
96
96
|
- [x] [A11Y-301 — Cursor enlargement, reading mask and reading guide #49](https://github.com/prabothcharith/accessibility-react/issues/49) — Add capability-aware large cursor, pointer-transparent reading guide and adjustable reading mask with keyboard/touch alternatives and cleanup.
|
|
97
97
|
- [x] [A11Y-302 — Accessible tooltips from authored descriptions #50](https://github.com/prabothcharith/accessibility-react/issues/50) — Show keyboard/pointer tooltips only from authored accessible descriptions, with Escape dismissal, safe positioning and no private-field disclosure.
|
|
98
|
-
- [
|
|
99
|
-
- [
|
|
100
|
-
- [
|
|
101
|
-
- [
|
|
98
|
+
- [x] [A11Y-303 — Page headings and landmarks navigator #51](https://github.com/prabothcharith/accessibility-react/issues/51) — Build a read-only headings/landmarks navigator that scrolls and focuses safely, updates dynamic routes and never invents semantics.
|
|
99
|
+
- [x] [A11Y-304 — Eight profiles and deterministic override model #52](https://github.com/prabothcharith/accessibility-react/issues/52) — Implement eight neutral editable profiles with previews, atomic application, explicit override layering and no implicit speech or microphone activation.
|
|
100
|
+
- [x] [A11Y-305 — Custom saved presets and settings import/export #53](https://github.com/prabothcharith/accessibility-react/issues/53) — Add named custom presets and validated versioned JSON import/export that excludes personal content and handles malformed data clearly.
|
|
101
|
+
- [x] [A11Y-306 — Sinhala and Tamil locale packs with accessibility review #54](https://github.com/prabothcharith/accessibility-react/issues/54) — Add reviewed Sinhala and Tamil widget locale packs and verify glyphs, long labels, search, announcements, fallback and assistive use.
|
|
102
102
|
- [ ] [A11Y-307 — Non-destructive reading mode proof of concept #55](https://github.com/prabothcharith/accessibility-react/issues/55) — Prototype safe article-focused reading mode without rewriting host DOM, losing content, breaking focus or sending content externally.
|
|
103
103
|
- [ ] [A11Y-308 — Keyboard shortcut help, remapping and link explorer #56](https://github.com/prabothcharith/accessibility-react/issues/56) — Add discoverable shortcut and heading-navigation help, collision-safe remapping and link exploration without hijacking browser or host commands.
|
|
104
104
|
|
package/docs/FEATURES.md
CHANGED
|
@@ -2,32 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
All features are opt-in via controllers, use native buttons, support Enter/Space and ordinary Tab order, and expose pressed/disabled state or a polite numeric output. Defaults leave the host unchanged. Values persist once changed and return to defaults on Reset All. Effects persist when controls/panel disappear and are cleaned on provider removal. Widget portals are excluded. The engine restores prior inline properties and priorities instead of simply deleting them.
|
|
4
4
|
|
|
5
|
-
| Controller / key
|
|
6
|
-
|
|
|
7
|
-
| TextScaleController / fontScale
|
|
8
|
-
| FontSizeController / fontSize
|
|
9
|
-
| LineHeightController / lineHeight
|
|
10
|
-
| LetterSpacingController / letterSpacing
|
|
11
|
-
| WordSpacingController / wordSpacing
|
|
12
|
-
| ParagraphSpacingController / paragraphSpacing
|
|
13
|
-
| ContrastController / contrast
|
|
14
|
-
| ContrastModeController / contrastMode
|
|
15
|
-
| SaturationController / saturation
|
|
16
|
-
| InvertColorsController / invertColors
|
|
17
|
-
| GrayscaleController / grayscale
|
|
18
|
-
| LinkHighlightController / linkHighlight
|
|
19
|
-
| HighlightFocusController / highlightFocus
|
|
20
|
-
| SkipToMainLink / findMainLandmark
|
|
21
|
-
| TextAlignController / textAlign
|
|
22
|
-
| FontFamilyController / fontFamily
|
|
23
|
-
| HideImagesController / HideDecorativeImagesController / hideImages
|
|
24
|
-
| HideVideosController / hideVideos
|
|
25
|
-
| ReduceMotionController / reduceMotion
|
|
26
|
-
| BigCursorController / bigCursor
|
|
27
|
-
| ReadingMaskController / readingMask
|
|
28
|
-
| ReadingGuideController / readingGuide
|
|
29
|
-
| TooltipsController / AccessibleTooltipsController / tooltips
|
|
30
|
-
|
|
|
5
|
+
| Controller / key | Default; states and bounds | Host behavior / edge cases |
|
|
6
|
+
| ------------------------------------------------------------------------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
7
|
+
| TextScaleController / fontScale | 1.0; 1.0, 1.125, 1.25, 1.5, 2.0 (stepwise) | Reflow-safe stepwise text enlargement without CSS transforms or compounding. Protects forms, labels, code, icons, widget, and exempt content. |
|
|
8
|
+
| FontSizeController / fontSize | 100; 50–200%, step 10 or stepwise | Scales computed font size and line height together. Supports optional `stepScale` / `steps` props; protects forms, labels, code blocks, icons, and widget UI. |
|
|
9
|
+
| LineHeightController / lineHeight | 100; 50–200%, step 10 or stepwise presets | Scales computed line height. Supports `stepPresets` (100%, 150%, 175%, 200% / 1.0x, 1.5x, 1.75x, 2.0x) and custom `steps`. Excludes tables, code blocks, controls, and widget UI. |
|
|
10
|
+
| LetterSpacingController / letterSpacing | 0; 0–10px, step 1 | Sets letter spacing on content elements. Protects cursive/Arabic/RTL scripts (disabled) and Indic/Sinhala/Tamil scripts (clamped <=1px). Excludes tables, code, and controls. |
|
|
11
|
+
| WordSpacingController / wordSpacing | 0; 0–10px, step 1 | Sets word spacing on content elements while protecting tables, code, controls, and widget UI. |
|
|
12
|
+
| ParagraphSpacingController / paragraphSpacing | 0; 0–32px, step 4 | Increases paragraph bottom margin (`p`, `[role="paragraph"]`) while protecting tables, code, and controls. |
|
|
13
|
+
| ContrastController / contrast | 0; 0/1/2/3, light, dark, high, invert, reduced, named palettes | Off, 1.25×, 1.5×, 2×; reduced=0.5×. Semantic light, dark, high contrast, and invert tokens protect images/video/SVG/charts and validation states. Bypasses overrides when OS forced-colors is active. |
|
|
14
|
+
| ContrastModeController / contrastMode | off; off/light/dark/high/invert | Semantic light, dark, high contrast, and media-safe invert modes. Preserves images, charts, and validation errors. Native forced-colors protection. See docs/CONTRAST.md. |
|
|
15
|
+
| SaturationController / saturation | 0; 0/1/2 | Off, 0.2×, 2× saturation. Composes with other filters. |
|
|
16
|
+
| InvertColorsController / invertColors | false; boolean | Adds invert(1), includes content images. |
|
|
17
|
+
| GrayscaleController / grayscale | false; boolean | Adds grayscale(1); saturation cannot restore color while this is active. |
|
|
18
|
+
| LinkHighlightController / linkHighlight | false; false/true/underline/palettes | Non-color underline cues (2px thickness, 3px offset) and high-contrast palettes. Preserves disabled links and system LinkText in forced colors. See docs/LINKS_AND_FOCUS.md. |
|
|
19
|
+
| HighlightFocusController / highlightFocus | false; boolean | High-visibility dual-ring focus outline (3px blue + 5px white halo) with forced-colors Highlight support. Preserves disabled controls. See docs/LINKS_AND_FOCUS.md. |
|
|
20
|
+
| SkipToMainLink / findMainLandmark | Dynamic helper / link | Authentic skip-to-main landmark link. Only renders when a real `<main>` or `[role="main"]` exists. Transfers focus and scrolls into view. See docs/LINKS_AND_FOCUS.md. |
|
|
21
|
+
| TextAlignController / textAlign | default; default/left/center/right/justify | Scoped strictly to logical text blocks (p, headings, lists, blockquotes); excludes tables, form controls, and code. Justification displays an accessible WCAG SC 1.4.8 advisory warning. |
|
|
22
|
+
| FontFamilyController / fontFamily | default; default/legible/dyslexia-option | Applies clean system-ui or OpenDyslexic with Sinhala/Tamil fallbacks. Code blocks, icons, and SVGs are protected. See docs/FONTS.md. |
|
|
23
|
+
| HideImagesController / HideDecorativeImagesController / hideImages | false; boolean | Hides only eligible decorative img/picture (alt="", role="presentation", role="none", aria-hidden="true", data-decorative) and removes decorative CSS background images. Strictly preserves interactive controls, CAPTCHA, charts, maps, QR codes, and informative images. Never fabricates alt text. See docs/DECORATIVE_IMAGES.md. |
|
|
24
|
+
| HideVideosController / hideVideos | false; boolean | Hides video and recognized YouTube/Vimeo embed URL patterns. Does not hide unrelated iframe documents, pause video or mute audio. |
|
|
25
|
+
| ReduceMotionController / reduceMotion | false; boolean | Scoped CSS animation and smooth-scroll suppression, tracked WAAPI animation pausing, and explicit media autoplay pause. Honors OS prefers-reduced-motion. See docs/REDUCE_MOTION.md. |
|
|
26
|
+
| BigCursorController / bigCursor | false; boolean | 40px high-contrast pointer via SVG cursor with native fallback. Capability-aware: detects `(pointer: fine)` and suppresses styles on touch-only hardware. Host CSS cursor effects are restored. See docs/READING_AIDS.md. |
|
|
27
|
+
| ReadingMaskController / readingMask | false; boolean / number (height) | Transparent reading aperture window with surrounding screen dimmed. Adjustable height (default 100px, 40–400px), stepper controls, pointer/touch/focus/scroll tracking, Alt+Up/Down nudging, Escape dismissal. See docs/READING_AIDS.md. |
|
|
28
|
+
| ReadingGuideController / readingGuide | false; boolean | 4px blue line with white border. Pointer-transparent (`pointer-events: none !important`), never blocks clicks/selection/focus. Follows pointer, touch drag, keyboard focus, and scroll. Alt+Up/Down nudging, Escape dismissal. See docs/READING_AIDS.md. |
|
|
29
|
+
| TooltipsController / AccessibleTooltipsController / tooltips | false; boolean | Displays authored descriptions (`aria-description`, `aria-describedby`, `aria-label`, `alt`, `title`) on hover and focus. Strictly excludes sensitive/password fields. WCAG 2.1 SC 1.4.13 compliant (Escape dismissal, hoverable, persistent, viewport clamped). See docs/TOOLTIPS.md. |
|
|
30
|
+
| PageNavigatorController / HeadingsNavigatorController / PageStructureController | Action dialog; no persistent preference | Scans real DOM headings (`h1`–`h6`) and named landmarks (`banner`, `navigation`, `main`, `region`, etc.). Safe scroll and focus with temporary tabindex cleanup, live mutation updates without loops, and search filtering. See docs/PAGE_NAVIGATOR.md. |
|
|
31
|
+
| ProfilesController / ProfileController / AccessibilityProfilesController | activeProfile; ProfilePresetId / null | Previews, applies, and reverts eight neutral presets (Motor, Blind, Color Blind, Dyslexia, Low Vision, Cognitive, Seizure, ADHD). Follows deterministic override model where user explicit choices survive reversal. Zero implicit audio/mic. See docs/PROFILES.md. |
|
|
32
|
+
| PresetsController / CustomPresetsController / SettingsImportExportController | customPresets; CustomPreset[] | Saves named user presets, 1-click apply/delete, and versioned JSON backup and transfer. Strict privacy exclusions discard private data, transcripts, and credentials. Saved presets library survives display reset. See docs/PRESETS.md. |
|
|
33
|
+
| Locales & i18n (`en`, `si`, `si-LK`, `ta`, `ta-LK`) | LocaleStrings / `locale` prop | Reviewed English, Sinhala, and Tamil locale packs with typography fallbacks and full RTL infrastructure. Automatic `document.documentElement.lang` resolution; host content is never translated. See docs/LOCALES.md. |
|
|
34
|
+
| ResetController | No feature state | Clears display settings including custom/unmounted controls, preserves widget placement; runs legacy reset callbacks; keeps panel open. |
|
|
31
35
|
|
|
32
36
|
## Accessible control primitives and UI states
|
|
33
37
|
|