@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.2.11 → 0.2.17
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/CHANGELOG.md +1 -1
- package/dist/components/ui/accessibility-demo.d.ts +5 -257
- package/dist/components/ui/accessibility-demo.d.ts.map +1 -0
- package/dist/components/ui/accessibility-demo.esm.js +80 -258
- package/dist/components/ui/accessibility-demo.js +80 -258
- package/dist/components/ui/advanced-component-architecture-demo.d.ts +4 -718
- package/dist/components/ui/advanced-component-architecture-demo.d.ts.map +1 -0
- package/dist/components/ui/advanced-component-architecture-demo.esm.js +256 -916
- package/dist/components/ui/advanced-component-architecture-demo.js +256 -916
- package/dist/components/ui/advanced-transition-system-demo.d.ts +3 -660
- package/dist/components/ui/advanced-transition-system-demo.d.ts.map +1 -0
- package/dist/components/ui/advanced-transition-system-demo.esm.js +59 -670
- package/dist/components/ui/advanced-transition-system-demo.js +59 -670
- package/dist/components/ui/advanced-transition-system.d.ts +35 -381
- package/dist/components/ui/advanced-transition-system.d.ts.map +1 -0
- package/dist/components/ui/advanced-transition-system.esm.js +194 -378
- package/dist/components/ui/advanced-transition-system.js +194 -378
- package/dist/components/ui/animation/animated-container.d.ts +11 -160
- package/dist/components/ui/animation/animated-container.d.ts.map +1 -0
- package/dist/components/ui/animation/animated-container.esm.js +98 -159
- package/dist/components/ui/animation/animated-container.js +98 -159
- package/dist/components/ui/animation/index.d.ts +7 -9
- package/dist/components/ui/animation/index.d.ts.map +1 -0
- package/dist/components/ui/animation/index.esm.js +3 -18
- package/dist/components/ui/animation/index.js +3 -18
- package/dist/components/ui/animation/staggered-container.d.ts +8 -62
- package/dist/components/ui/animation/staggered-container.d.ts.map +1 -0
- package/dist/components/ui/animation/staggered-container.esm.js +37 -68
- package/dist/components/ui/animation/staggered-container.js +37 -68
- package/dist/components/ui/animation-demo.d.ts +3 -238
- package/dist/components/ui/animation-demo.d.ts.map +1 -0
- package/dist/components/ui/animation-demo.esm.js +30 -250
- package/dist/components/ui/animation-demo.js +30 -250
- package/dist/components/ui/badge.d.ts +9 -27
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.esm.js +15 -28
- package/dist/components/ui/badge.js +15 -28
- package/dist/components/ui/battery-conscious-animation-demo.d.ts +4 -561
- package/dist/components/ui/battery-conscious-animation-demo.d.ts.map +1 -0
- package/dist/components/ui/battery-conscious-animation-demo.esm.js +136 -565
- package/dist/components/ui/battery-conscious-animation-demo.js +136 -565
- package/dist/components/ui/border-radius-shadow-demo.d.ts +3 -183
- package/dist/components/ui/border-radius-shadow-demo.d.ts.map +1 -0
- package/dist/components/ui/border-radius-shadow-demo.esm.js +3 -184
- package/dist/components/ui/border-radius-shadow-demo.js +3 -184
- package/dist/components/ui/button.d.ts +8 -32
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.esm.js +14 -33
- package/dist/components/ui/button.js +14 -33
- package/dist/components/ui/card.d.ts +25 -193
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.esm.js +74 -188
- package/dist/components/ui/card.js +74 -188
- package/dist/components/ui/checkbox.d.ts +6 -24
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.esm.js +11 -30
- package/dist/components/ui/checkbox.js +11 -30
- package/dist/components/ui/color-preview.d.ts +12 -398
- package/dist/components/ui/color-preview.d.ts.map +1 -0
- package/dist/components/ui/color-preview.esm.js +50 -405
- package/dist/components/ui/color-preview.js +50 -405
- package/dist/components/ui/data-display/chart.d.ts +4 -645
- package/dist/components/ui/data-display/chart.d.ts.map +1 -0
- package/dist/components/ui/data-display/chart.esm.js +210 -632
- package/dist/components/ui/data-display/chart.js +210 -632
- package/dist/components/ui/data-display/data-grid-simple.d.ts +5 -73
- package/dist/components/ui/data-display/data-grid-simple.d.ts.map +1 -0
- package/dist/components/ui/data-display/data-grid-simple.esm.js +16 -74
- package/dist/components/ui/data-display/data-grid-simple.js +16 -74
- package/dist/components/ui/data-display/data-grid.d.ts +4 -669
- package/dist/components/ui/data-display/data-grid.d.ts.map +1 -0
- package/dist/components/ui/data-display/data-grid.esm.js +173 -661
- package/dist/components/ui/data-display/data-grid.js +173 -661
- package/dist/components/ui/data-display/list.d.ts +4 -447
- package/dist/components/ui/data-display/list.d.ts.map +1 -0
- package/dist/components/ui/data-display/list.esm.js +88 -446
- package/dist/components/ui/data-display/list.js +88 -446
- package/dist/components/ui/data-display/table.d.ts +4 -471
- package/dist/components/ui/data-display/table.d.ts.map +1 -0
- package/dist/components/ui/data-display/table.esm.js +109 -468
- package/dist/components/ui/data-display/table.js +109 -468
- package/dist/components/ui/data-display/timeline.d.ts +4 -432
- package/dist/components/ui/data-display/timeline.d.ts.map +1 -0
- package/dist/components/ui/data-display/timeline.esm.js +92 -431
- package/dist/components/ui/data-display/timeline.js +92 -431
- package/dist/components/ui/data-display/tree.d.ts +4 -593
- package/dist/components/ui/data-display/tree.d.ts.map +1 -0
- package/dist/components/ui/data-display/tree.esm.js +211 -585
- package/dist/components/ui/data-display/tree.js +211 -585
- package/dist/components/ui/data-display/types.d.ts +418 -471
- package/dist/components/ui/data-display/types.d.ts.map +1 -0
- package/dist/components/ui/data-display/types.esm.js +1 -530
- package/dist/components/ui/data-display/types.js +1 -530
- package/dist/components/ui/enterprise-mobile-experience-demo.d.ts +3 -735
- package/dist/components/ui/enterprise-mobile-experience-demo.d.ts.map +1 -0
- package/dist/components/ui/enterprise-mobile-experience-demo.esm.js +76 -749
- package/dist/components/ui/enterprise-mobile-experience-demo.js +76 -749
- package/dist/components/ui/enterprise-mobile-experience.d.ts +52 -441
- package/dist/components/ui/enterprise-mobile-experience.d.ts.map +1 -0
- package/dist/components/ui/enterprise-mobile-experience.esm.js +152 -460
- package/dist/components/ui/enterprise-mobile-experience.js +152 -460
- package/dist/components/ui/feedback/alert.d.ts +4 -153
- package/dist/components/ui/feedback/alert.d.ts.map +1 -0
- package/dist/components/ui/feedback/alert.esm.js +40 -148
- package/dist/components/ui/feedback/alert.js +40 -148
- package/dist/components/ui/feedback/progress.d.ts +4 -287
- package/dist/components/ui/feedback/progress.d.ts.map +1 -0
- package/dist/components/ui/feedback/progress.esm.js +74 -278
- package/dist/components/ui/feedback/progress.js +74 -278
- package/dist/components/ui/feedback/skeleton.d.ts +7 -181
- package/dist/components/ui/feedback/skeleton.d.ts.map +1 -0
- package/dist/components/ui/feedback/skeleton.esm.js +64 -173
- package/dist/components/ui/feedback/skeleton.js +64 -173
- package/dist/components/ui/feedback/toast.d.ts +7 -276
- package/dist/components/ui/feedback/toast.d.ts.map +1 -0
- package/dist/components/ui/feedback/toast.esm.js +86 -225
- package/dist/components/ui/feedback/toast.js +86 -225
- package/dist/components/ui/feedback/types.d.ts +85 -99
- package/dist/components/ui/feedback/types.d.ts.map +1 -0
- package/dist/components/ui/feedback/types.esm.js +1 -125
- package/dist/components/ui/feedback/types.js +1 -125
- package/dist/components/ui/font-preview.d.ts +11 -278
- package/dist/components/ui/font-preview.d.ts.map +1 -0
- package/dist/components/ui/font-preview.esm.js +56 -283
- package/dist/components/ui/font-preview.js +56 -283
- package/dist/components/ui/form-demo.d.ts +4 -544
- package/dist/components/ui/form-demo.d.ts.map +1 -0
- package/dist/components/ui/form-demo.esm.js +191 -553
- package/dist/components/ui/form-demo.js +191 -553
- package/dist/components/ui/hardware-acceleration-demo.d.ts +4 -540
- package/dist/components/ui/hardware-acceleration-demo.d.ts.map +1 -0
- package/dist/components/ui/hardware-acceleration-demo.esm.js +103 -544
- package/dist/components/ui/hardware-acceleration-demo.js +103 -544
- package/dist/components/ui/input.d.ts +8 -32
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.esm.js +13 -32
- package/dist/components/ui/input.js +13 -32
- package/dist/components/ui/label.d.ts +5 -13
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.esm.js +6 -16
- package/dist/components/ui/label.js +6 -16
- package/dist/components/ui/layout-demo.d.ts +4 -352
- package/dist/components/ui/layout-demo.d.ts.map +1 -0
- package/dist/components/ui/layout-demo.esm.js +76 -367
- package/dist/components/ui/layout-demo.js +76 -367
- package/dist/components/ui/layouts/adaptive-layout.d.ts +14 -130
- package/dist/components/ui/layouts/adaptive-layout.d.ts.map +1 -0
- package/dist/components/ui/layouts/adaptive-layout.esm.js +60 -139
- package/dist/components/ui/layouts/adaptive-layout.js +60 -139
- package/dist/components/ui/layouts/desktop-layout.d.ts +13 -217
- package/dist/components/ui/layouts/desktop-layout.d.ts.map +1 -0
- package/dist/components/ui/layouts/desktop-layout.esm.js +39 -224
- package/dist/components/ui/layouts/desktop-layout.js +39 -224
- package/dist/components/ui/layouts/index.d.ts +9 -5
- package/dist/components/ui/layouts/index.d.ts.map +1 -0
- package/dist/components/ui/layouts/index.esm.js +4 -10
- package/dist/components/ui/layouts/index.js +4 -10
- package/dist/components/ui/layouts/mobile-layout.d.ts +12 -156
- package/dist/components/ui/layouts/mobile-layout.d.ts.map +1 -0
- package/dist/components/ui/layouts/mobile-layout.esm.js +49 -162
- package/dist/components/ui/layouts/mobile-layout.js +49 -162
- package/dist/components/ui/layouts/tablet-layout.d.ts +12 -190
- package/dist/components/ui/layouts/tablet-layout.d.ts.map +1 -0
- package/dist/components/ui/layouts/tablet-layout.esm.js +53 -197
- package/dist/components/ui/layouts/tablet-layout.js +53 -197
- package/dist/components/ui/mobile-form-validation.d.ts +28 -435
- package/dist/components/ui/mobile-form-validation.d.ts.map +1 -0
- package/dist/components/ui/mobile-form-validation.esm.js +185 -420
- package/dist/components/ui/mobile-form-validation.js +185 -420
- package/dist/components/ui/mobile-input-demo.d.ts +3 -197
- package/dist/components/ui/mobile-input-demo.d.ts.map +1 -0
- package/dist/components/ui/mobile-input-demo.esm.js +11 -198
- package/dist/components/ui/mobile-input-demo.js +11 -198
- package/dist/components/ui/mobile-input.d.ts +61 -268
- package/dist/components/ui/mobile-input.d.ts.map +1 -0
- package/dist/components/ui/mobile-input.esm.js +187 -270
- package/dist/components/ui/mobile-input.js +187 -270
- package/dist/components/ui/mobile-skeleton-loading-demo.d.ts +4 -628
- package/dist/components/ui/mobile-skeleton-loading-demo.d.ts.map +1 -0
- package/dist/components/ui/mobile-skeleton-loading-demo.esm.js +144 -638
- package/dist/components/ui/mobile-skeleton-loading-demo.js +144 -638
- package/dist/components/ui/navigation/breadcrumb.d.ts +8 -148
- package/dist/components/ui/navigation/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/navigation/breadcrumb.esm.js +51 -154
- package/dist/components/ui/navigation/breadcrumb.js +51 -154
- package/dist/components/ui/navigation/index.d.ts +12 -25
- package/dist/components/ui/navigation/index.d.ts.map +1 -0
- package/dist/components/ui/navigation/index.esm.js +0 -3
- package/dist/components/ui/navigation/index.js +0 -3
- package/dist/components/ui/navigation/menu.d.ts +8 -365
- package/dist/components/ui/navigation/menu.d.ts.map +1 -0
- package/dist/components/ui/navigation/menu.esm.js +178 -365
- package/dist/components/ui/navigation/menu.js +178 -365
- package/dist/components/ui/navigation/navigation-demo.d.ts +7 -168
- package/dist/components/ui/navigation/navigation-demo.d.ts.map +1 -0
- package/dist/components/ui/navigation/navigation-demo.esm.js +130 -315
- package/dist/components/ui/navigation/navigation-demo.js +130 -315
- package/dist/components/ui/navigation/pagination.d.ts +8 -260
- package/dist/components/ui/navigation/pagination.d.ts.map +1 -0
- package/dist/components/ui/navigation/pagination.esm.js +142 -264
- package/dist/components/ui/navigation/pagination.js +142 -264
- package/dist/components/ui/navigation/sidebar.d.ts +8 -374
- package/dist/components/ui/navigation/sidebar.d.ts.map +1 -0
- package/dist/components/ui/navigation/sidebar.esm.js +156 -368
- package/dist/components/ui/navigation/sidebar.js +156 -368
- package/dist/components/ui/navigation/stepper.d.ts +8 -293
- package/dist/components/ui/navigation/stepper.d.ts.map +1 -0
- package/dist/components/ui/navigation/stepper.esm.js +131 -295
- package/dist/components/ui/navigation/stepper.js +131 -295
- package/dist/components/ui/navigation/tabs.d.ts +8 -195
- package/dist/components/ui/navigation/tabs.d.ts.map +1 -0
- package/dist/components/ui/navigation/tabs.esm.js +89 -198
- package/dist/components/ui/navigation/tabs.js +89 -198
- package/dist/components/ui/navigation/types.d.ts +216 -254
- package/dist/components/ui/navigation/types.d.ts.map +1 -0
- package/dist/components/ui/navigation/types.esm.js +1 -295
- package/dist/components/ui/navigation/types.js +1 -295
- package/dist/components/ui/overlay/backdrop.d.ts +12 -76
- package/dist/components/ui/overlay/backdrop.d.ts.map +1 -0
- package/dist/components/ui/overlay/backdrop.esm.js +39 -78
- package/dist/components/ui/overlay/backdrop.js +39 -78
- package/dist/components/ui/overlay/focus-manager.d.ts +10 -138
- package/dist/components/ui/overlay/focus-manager.d.ts.map +1 -0
- package/dist/components/ui/overlay/focus-manager.esm.js +96 -140
- package/dist/components/ui/overlay/focus-manager.js +96 -140
- package/dist/components/ui/overlay/index.d.ts +10 -27
- package/dist/components/ui/overlay/index.d.ts.map +1 -0
- package/dist/components/ui/overlay/index.esm.js +0 -5
- package/dist/components/ui/overlay/index.js +0 -5
- package/dist/components/ui/overlay/modal.d.ts +7 -261
- package/dist/components/ui/overlay/modal.d.ts.map +1 -0
- package/dist/components/ui/overlay/modal.esm.js +94 -249
- package/dist/components/ui/overlay/modal.js +94 -249
- package/dist/components/ui/overlay/overlay-manager.d.ts +13 -104
- package/dist/components/ui/overlay/overlay-manager.d.ts.map +1 -0
- package/dist/components/ui/overlay/overlay-manager.esm.js +60 -100
- package/dist/components/ui/overlay/overlay-manager.js +60 -100
- package/dist/components/ui/overlay/popover.d.ts +8 -449
- package/dist/components/ui/overlay/popover.d.ts.map +1 -0
- package/dist/components/ui/overlay/popover.esm.js +258 -438
- package/dist/components/ui/overlay/popover.js +258 -438
- package/dist/components/ui/overlay/portal.d.ts +4 -74
- package/dist/components/ui/overlay/portal.d.ts.map +1 -0
- package/dist/components/ui/overlay/portal.esm.js +45 -74
- package/dist/components/ui/overlay/portal.js +45 -74
- package/dist/components/ui/overlay/tooltip.d.ts +5 -297
- package/dist/components/ui/overlay/tooltip.d.ts.map +1 -0
- package/dist/components/ui/overlay/tooltip.esm.js +202 -288
- package/dist/components/ui/overlay/tooltip.js +202 -288
- package/dist/components/ui/overlay/types.d.ts +144 -167
- package/dist/components/ui/overlay/types.d.ts.map +1 -0
- package/dist/components/ui/overlay/types.esm.js +1 -196
- package/dist/components/ui/overlay/types.js +1 -196
- package/dist/components/ui/performance-demo.d.ts +3 -583
- package/dist/components/ui/performance-demo.d.ts.map +1 -0
- package/dist/components/ui/performance-demo.esm.js +110 -596
- package/dist/components/ui/performance-demo.js +110 -596
- package/dist/components/ui/semantic-input-system-demo.d.ts +3 -490
- package/dist/components/ui/semantic-input-system-demo.d.ts.map +1 -0
- package/dist/components/ui/semantic-input-system-demo.esm.js +87 -501
- package/dist/components/ui/semantic-input-system-demo.js +87 -501
- package/dist/components/ui/theme-customizer.d.ts +19 -370
- package/dist/components/ui/theme-customizer.d.ts.map +1 -0
- package/dist/components/ui/theme-customizer.esm.js +123 -371
- package/dist/components/ui/theme-customizer.js +123 -371
- package/dist/components/ui/theme-preview.d.ts +9 -303
- package/dist/components/ui/theme-preview.d.ts.map +1 -0
- package/dist/components/ui/theme-preview.esm.js +44 -306
- package/dist/components/ui/theme-preview.js +44 -306
- package/dist/components/ui/theme-switcher.d.ts +9 -257
- package/dist/components/ui/theme-switcher.d.ts.map +1 -0
- package/dist/components/ui/theme-switcher.esm.js +79 -258
- package/dist/components/ui/theme-switcher.js +79 -258
- package/dist/components/ui/theme-toggle.d.ts +3 -34
- package/dist/components/ui/theme-toggle.d.ts.map +1 -0
- package/dist/components/ui/theme-toggle.esm.js +22 -35
- package/dist/components/ui/theme-toggle.js +22 -35
- package/dist/components/ui/token-demo.d.ts +3 -188
- package/dist/components/ui/token-demo.d.ts.map +1 -0
- package/dist/components/ui/token-demo.esm.js +42 -189
- package/dist/components/ui/token-demo.js +42 -189
- package/dist/components/ui/touch-demo.d.ts +3 -455
- package/dist/components/ui/touch-demo.d.ts.map +1 -0
- package/dist/components/ui/touch-demo.esm.js +96 -462
- package/dist/components/ui/touch-demo.js +96 -462
- package/dist/components/ui/touch-friendly-interface-demo.d.ts +3 -512
- package/dist/components/ui/touch-friendly-interface-demo.d.ts.map +1 -0
- package/dist/components/ui/touch-friendly-interface-demo.esm.js +63 -519
- package/dist/components/ui/touch-friendly-interface-demo.js +63 -519
- package/dist/components/ui/touch-friendly-interface.d.ts +21 -282
- package/dist/components/ui/touch-friendly-interface.d.ts.map +1 -0
- package/dist/components/ui/touch-friendly-interface.esm.js +103 -281
- package/dist/components/ui/touch-friendly-interface.js +103 -281
- package/dist/hooks/index.d.ts +47 -161
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.esm.js +23 -181
- package/dist/hooks/index.js +23 -181
- package/dist/hooks/use-accessibility-support.d.ts +66 -508
- package/dist/hooks/use-accessibility-support.d.ts.map +1 -0
- package/dist/hooks/use-accessibility-support.esm.js +377 -518
- package/dist/hooks/use-accessibility-support.js +377 -518
- package/dist/hooks/use-adaptive-layout.d.ts +51 -281
- package/dist/hooks/use-adaptive-layout.d.ts.map +1 -0
- package/dist/hooks/use-adaptive-layout.esm.js +212 -287
- package/dist/hooks/use-adaptive-layout.js +212 -287
- package/dist/hooks/use-advanced-patterns.d.ts +78 -282
- package/dist/hooks/use-advanced-patterns.d.ts.map +1 -0
- package/dist/hooks/use-advanced-patterns.esm.js +185 -293
- package/dist/hooks/use-advanced-patterns.js +185 -293
- package/dist/hooks/use-advanced-transition-system.d.ts +51 -382
- package/dist/hooks/use-advanced-transition-system.d.ts.map +1 -0
- package/dist/hooks/use-advanced-transition-system.esm.js +286 -392
- package/dist/hooks/use-advanced-transition-system.js +286 -392
- package/dist/hooks/use-animation-profile.d.ts +39 -279
- package/dist/hooks/use-animation-profile.d.ts.map +1 -0
- package/dist/hooks/use-animation-profile.esm.js +221 -283
- package/dist/hooks/use-animation-profile.js +221 -283
- package/dist/hooks/use-battery-animations.d.ts +47 -376
- package/dist/hooks/use-battery-animations.d.ts.map +1 -0
- package/dist/hooks/use-battery-animations.esm.js +310 -384
- package/dist/hooks/use-battery-animations.js +310 -384
- package/dist/hooks/use-battery-conscious-loading.d.ts +50 -465
- package/dist/hooks/use-battery-conscious-loading.d.ts.map +1 -0
- package/dist/hooks/use-battery-conscious-loading.esm.js +374 -468
- package/dist/hooks/use-battery-conscious-loading.js +374 -468
- package/dist/hooks/use-battery-optimization.d.ts +39 -322
- package/dist/hooks/use-battery-optimization.d.ts.map +1 -0
- package/dist/hooks/use-battery-optimization.esm.js +267 -329
- package/dist/hooks/use-battery-optimization.js +267 -329
- package/dist/hooks/use-battery-status.d.ts +49 -289
- package/dist/hooks/use-battery-status.d.ts.map +1 -0
- package/dist/hooks/use-battery-status.esm.js +213 -293
- package/dist/hooks/use-battery-status.js +213 -293
- package/dist/hooks/use-component-performance.d.ts +60 -336
- package/dist/hooks/use-component-performance.d.ts.map +1 -0
- package/dist/hooks/use-component-performance.esm.js +235 -341
- package/dist/hooks/use-component-performance.js +235 -341
- package/dist/hooks/use-device-loading-states.d.ts +53 -448
- package/dist/hooks/use-device-loading-states.d.ts.map +1 -0
- package/dist/hooks/use-device-loading-states.esm.js +356 -457
- package/dist/hooks/use-device-loading-states.js +356 -457
- package/dist/hooks/use-device.d.ts +18 -102
- package/dist/hooks/use-device.d.ts.map +1 -0
- package/dist/hooks/use-device.esm.js +77 -102
- package/dist/hooks/use-device.js +77 -102
- package/dist/hooks/use-enterprise-mobile-experience.d.ts +72 -474
- package/dist/hooks/use-enterprise-mobile-experience.d.ts.map +1 -0
- package/dist/hooks/use-enterprise-mobile-experience.esm.js +349 -487
- package/dist/hooks/use-enterprise-mobile-experience.js +349 -487
- package/dist/hooks/use-form-feedback.d.ts +81 -391
- package/dist/hooks/use-form-feedback.d.ts.map +1 -0
- package/dist/hooks/use-form-feedback.esm.js +313 -398
- package/dist/hooks/use-form-feedback.js +313 -398
- package/dist/hooks/use-form-performance.d.ts +78 -501
- package/dist/hooks/use-form-performance.d.ts.map +1 -0
- package/dist/hooks/use-form-performance.esm.js +407 -500
- package/dist/hooks/use-form-performance.js +407 -500
- package/dist/hooks/use-frame-rate.d.ts +39 -241
- package/dist/hooks/use-frame-rate.d.ts.map +1 -0
- package/dist/hooks/use-frame-rate.esm.js +178 -251
- package/dist/hooks/use-frame-rate.js +178 -251
- package/dist/hooks/use-gestures.d.ts +84 -326
- package/dist/hooks/use-gestures.d.ts.map +1 -0
- package/dist/hooks/use-gestures.esm.js +230 -332
- package/dist/hooks/use-gestures.js +230 -332
- package/dist/hooks/use-hardware-acceleration.d.ts +45 -331
- package/dist/hooks/use-hardware-acceleration.d.ts.map +1 -0
- package/dist/hooks/use-hardware-acceleration.esm.js +246 -339
- package/dist/hooks/use-hardware-acceleration.js +246 -339
- package/dist/hooks/use-input-accessibility.d.ts +50 -443
- package/dist/hooks/use-input-accessibility.d.ts.map +1 -0
- package/dist/hooks/use-input-accessibility.esm.js +350 -454
- package/dist/hooks/use-input-accessibility.js +350 -454
- package/dist/hooks/use-input-performance.d.ts +47 -495
- package/dist/hooks/use-input-performance.d.ts.map +1 -0
- package/dist/hooks/use-input-performance.esm.js +419 -502
- package/dist/hooks/use-input-performance.js +419 -502
- package/dist/hooks/use-layout-performance.d.ts +33 -311
- package/dist/hooks/use-layout-performance.d.ts.map +1 -0
- package/dist/hooks/use-layout-performance.esm.js +233 -319
- package/dist/hooks/use-layout-performance.js +233 -319
- package/dist/hooks/use-loading-accessibility.d.ts +54 -524
- package/dist/hooks/use-loading-accessibility.d.ts.map +1 -0
- package/dist/hooks/use-loading-accessibility.esm.js +421 -531
- package/dist/hooks/use-loading-accessibility.js +421 -531
- package/dist/hooks/use-loading-performance.d.ts +43 -463
- package/dist/hooks/use-loading-performance.d.ts.map +1 -0
- package/dist/hooks/use-loading-performance.esm.js +398 -469
- package/dist/hooks/use-loading-performance.js +398 -469
- package/dist/hooks/use-memory-usage.d.ts +43 -277
- package/dist/hooks/use-memory-usage.d.ts.map +1 -0
- package/dist/hooks/use-memory-usage.esm.js +211 -287
- package/dist/hooks/use-memory-usage.js +211 -287
- package/dist/hooks/use-mobile-form-layout.d.ts +116 -451
- package/dist/hooks/use-mobile-form-layout.d.ts.map +1 -0
- package/dist/hooks/use-mobile-form-layout.esm.js +365 -458
- package/dist/hooks/use-mobile-form-layout.js +365 -458
- package/dist/hooks/use-mobile-form-validation.d.ts +87 -503
- package/dist/hooks/use-mobile-form-validation.d.ts.map +1 -0
- package/dist/hooks/use-mobile-form-validation.esm.js +384 -497
- package/dist/hooks/use-mobile-form-validation.js +384 -497
- package/dist/hooks/use-mobile-keyboard-optimization.d.ts +62 -461
- package/dist/hooks/use-mobile-keyboard-optimization.d.ts.map +1 -0
- package/dist/hooks/use-mobile-keyboard-optimization.esm.js +354 -468
- package/dist/hooks/use-mobile-keyboard-optimization.js +354 -468
- package/dist/hooks/use-mobile-layout.d.ts +48 -292
- package/dist/hooks/use-mobile-layout.d.ts.map +1 -0
- package/dist/hooks/use-mobile-layout.esm.js +207 -294
- package/dist/hooks/use-mobile-layout.js +207 -294
- package/dist/hooks/use-mobile-optimization.d.ts +49 -398
- package/dist/hooks/use-mobile-optimization.d.ts.map +1 -0
- package/dist/hooks/use-mobile-optimization.esm.js +308 -404
- package/dist/hooks/use-mobile-optimization.js +308 -404
- package/dist/hooks/use-mobile-skeleton.d.ts +51 -391
- package/dist/hooks/use-mobile-skeleton.d.ts.map +1 -0
- package/dist/hooks/use-mobile-skeleton.esm.js +300 -402
- package/dist/hooks/use-mobile-skeleton.js +300 -402
- package/dist/hooks/use-mobile-touch.d.ts +73 -399
- package/dist/hooks/use-mobile-touch.d.ts.map +1 -0
- package/dist/hooks/use-mobile-touch.esm.js +314 -412
- package/dist/hooks/use-mobile-touch.js +314 -412
- package/dist/hooks/use-performance-throttling.d.ts +42 -340
- package/dist/hooks/use-performance-throttling.d.ts.map +1 -0
- package/dist/hooks/use-performance-throttling.esm.js +276 -344
- package/dist/hooks/use-performance-throttling.js +276 -344
- package/dist/hooks/use-performance.d.ts +65 -306
- package/dist/hooks/use-performance.d.ts.map +1 -0
- package/dist/hooks/use-performance.esm.js +216 -313
- package/dist/hooks/use-performance.js +216 -313
- package/dist/hooks/use-reusable-architecture.d.ts +82 -400
- package/dist/hooks/use-reusable-architecture.d.ts.map +1 -0
- package/dist/hooks/use-reusable-architecture.esm.js +255 -408
- package/dist/hooks/use-reusable-architecture.js +255 -408
- package/dist/hooks/use-semantic-input-types.d.ts +51 -348
- package/dist/hooks/use-semantic-input-types.d.ts.map +1 -0
- package/dist/hooks/use-semantic-input-types.esm.js +290 -356
- package/dist/hooks/use-semantic-input-types.js +290 -356
- package/dist/hooks/use-semantic-input.d.ts +62 -552
- package/dist/hooks/use-semantic-input.d.ts.map +1 -0
- package/dist/hooks/use-semantic-input.esm.js +446 -549
- package/dist/hooks/use-semantic-input.js +446 -549
- package/dist/hooks/use-tablet-layout.d.ts +67 -375
- package/dist/hooks/use-tablet-layout.d.ts.map +1 -0
- package/dist/hooks/use-tablet-layout.esm.js +279 -384
- package/dist/hooks/use-tablet-layout.js +279 -384
- package/dist/hooks/use-touch-friendly-input.d.ts +67 -512
- package/dist/hooks/use-touch-friendly-input.d.ts.map +1 -0
- package/dist/hooks/use-touch-friendly-input.esm.js +401 -519
- package/dist/hooks/use-touch-friendly-input.js +401 -519
- package/dist/hooks/use-touch-friendly-interface.d.ts +48 -321
- package/dist/hooks/use-touch-friendly-interface.d.ts.map +1 -0
- package/dist/hooks/use-touch-friendly-interface.esm.js +242 -331
- package/dist/hooks/use-touch-friendly-interface.js +242 -331
- package/dist/hooks/use-touch-optimization.d.ts +56 -363
- package/dist/hooks/use-touch-optimization.d.ts.map +1 -0
- package/dist/hooks/use-touch-optimization.esm.js +288 -370
- package/dist/hooks/use-touch-optimization.js +288 -370
- package/dist/index.d.ts +168 -17
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +150 -161
- package/dist/index.js +150 -161
- package/dist/lib/utils.d.ts +3 -3
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.esm.js +4 -5
- package/dist/lib/utils.js +4 -5
- package/dist/plugins/theme-css-generator.d.ts +3 -345
- package/dist/plugins/theme-css-generator.d.ts.map +1 -0
- package/dist/plugins/theme-css-generator.esm.js +292 -346
- package/dist/plugins/theme-css-generator.js +292 -346
- package/dist/provider.d.ts +6 -14
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.esm.js +3 -19
- package/dist/provider.js +3 -19
- package/dist/styles/layers/validation.d.ts +20 -0
- package/dist/styles/layers/validation.d.ts.map +1 -0
- package/dist/styles/layers/validation.esm.js +275 -0
- package/dist/styles/layers/validation.js +275 -0
- package/dist/styles.css +1 -1
- package/dist/theme.d.ts +7 -678
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.esm.js +654 -658
- package/dist/theme.js +654 -658
- package/dist/themes/ThemeContext.d.ts +18 -22
- package/dist/themes/ThemeContext.d.ts.map +1 -0
- package/dist/themes/ThemeContext.esm.js +1 -27
- package/dist/themes/ThemeContext.js +1 -27
- package/dist/themes/ThemeProvider.d.ts +3 -222
- package/dist/themes/ThemeProvider.d.ts.map +1 -0
- package/dist/themes/ThemeProvider.esm.js +191 -223
- package/dist/themes/ThemeProvider.js +191 -223
- package/dist/themes/accessibility/index.d.ts +18 -6
- package/dist/themes/accessibility/index.d.ts.map +1 -0
- package/dist/themes/accessibility/index.esm.js +0 -4
- package/dist/themes/accessibility/index.js +0 -4
- package/dist/themes/accessibility.d.ts +53 -253
- package/dist/themes/accessibility.d.ts.map +1 -0
- package/dist/themes/accessibility.esm.js +175 -240
- package/dist/themes/accessibility.js +175 -240
- package/dist/themes/aria-patterns.d.ts +145 -410
- package/dist/themes/aria-patterns.d.ts.map +1 -0
- package/dist/themes/aria-patterns.esm.js +345 -401
- package/dist/themes/aria-patterns.js +345 -401
- package/dist/themes/base-themes.d.ts +29 -32
- package/dist/themes/base-themes.d.ts.map +1 -0
- package/dist/themes/base-themes.esm.js +15 -24
- package/dist/themes/base-themes.js +15 -24
- package/dist/themes/colorManager.d.ts +63 -326
- package/dist/themes/colorManager.d.ts.map +1 -0
- package/dist/themes/colorManager.esm.js +293 -357
- package/dist/themes/colorManager.js +293 -357
- package/dist/themes/examples/dark-theme.d.ts +13 -139
- package/dist/themes/examples/dark-theme.d.ts.map +1 -0
- package/dist/themes/examples/dark-theme.esm.js +129 -133
- package/dist/themes/examples/dark-theme.js +129 -133
- package/dist/themes/examples/minimal-theme.d.ts +6 -93
- package/dist/themes/examples/minimal-theme.d.ts.map +1 -0
- package/dist/themes/examples/minimal-theme.esm.js +80 -85
- package/dist/themes/examples/minimal-theme.js +80 -85
- package/dist/themes/focus-management.d.ts +100 -689
- package/dist/themes/focus-management.d.ts.map +1 -0
- package/dist/themes/focus-management.esm.js +541 -677
- package/dist/themes/focus-management.js +541 -677
- package/dist/themes/fontLoader.d.ts +48 -162
- package/dist/themes/fontLoader.d.ts.map +1 -0
- package/dist/themes/fontLoader.esm.js +151 -180
- package/dist/themes/fontLoader.js +151 -180
- package/dist/themes/high-contrast.d.ts +64 -613
- package/dist/themes/high-contrast.d.ts.map +1 -0
- package/dist/themes/high-contrast.esm.js +394 -558
- package/dist/themes/high-contrast.js +394 -558
- package/dist/themes/index.d.ts +3 -6
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/index.esm.js +1 -9
- package/dist/themes/index.js +1 -9
- package/dist/themes/inheritance.d.ts +86 -156
- package/dist/themes/inheritance.d.ts.map +1 -0
- package/dist/themes/inheritance.esm.js +145 -180
- package/dist/themes/inheritance.js +145 -180
- package/dist/themes/keyboard-navigation.d.ts +205 -542
- package/dist/themes/keyboard-navigation.d.ts.map +1 -0
- package/dist/themes/keyboard-navigation.esm.js +418 -510
- package/dist/themes/keyboard-navigation.js +418 -510
- package/dist/themes/motion-reduction.d.ts +107 -646
- package/dist/themes/motion-reduction.d.ts.map +1 -0
- package/dist/themes/motion-reduction.esm.js +434 -591
- package/dist/themes/motion-reduction.js +434 -591
- package/dist/themes/navigation.d.ts +163 -194
- package/dist/themes/navigation.d.ts.map +1 -0
- package/dist/themes/navigation.esm.js +1 -234
- package/dist/themes/navigation.js +1 -234
- package/dist/themes/screen-reader.d.ts +82 -641
- package/dist/themes/screen-reader.d.ts.map +1 -0
- package/dist/themes/screen-reader.esm.js +515 -616
- package/dist/themes/screen-reader.js +515 -616
- package/dist/themes/systemThemeDetector.d.ts +54 -144
- package/dist/themes/systemThemeDetector.d.ts.map +1 -0
- package/dist/themes/systemThemeDetector.esm.js +135 -164
- package/dist/themes/systemThemeDetector.js +135 -164
- package/dist/themes/themeCSSUpdater.d.ts +45 -228
- package/dist/themes/themeCSSUpdater.d.ts.map +1 -0
- package/dist/themes/themeCSSUpdater.esm.js +217 -252
- package/dist/themes/themeCSSUpdater.js +217 -252
- package/dist/themes/themePersistence.d.ts +80 -188
- package/dist/themes/themePersistence.d.ts.map +1 -0
- package/dist/themes/themePersistence.esm.js +181 -212
- package/dist/themes/themePersistence.js +181 -212
- package/dist/themes/themes/default.d.ts +9 -0
- package/dist/themes/themes/default.d.ts.map +1 -0
- package/dist/themes/themes/default.esm.js +584 -0
- package/dist/themes/themes/default.js +584 -0
- package/dist/themes/themes/harvey.d.ts +7 -0
- package/dist/themes/themes/harvey.d.ts.map +1 -0
- package/dist/themes/themes/harvey.esm.js +551 -0
- package/dist/themes/themes/harvey.js +551 -0
- package/dist/themes/themes/stan-design.d.ts +7 -678
- package/dist/themes/themes/stan-design.d.ts.map +1 -0
- package/dist/themes/themes/stan-design.esm.js +654 -658
- package/dist/themes/themes/stan-design.js +654 -658
- package/dist/themes/types.d.ts +330 -385
- package/dist/themes/types.d.ts.map +1 -0
- package/dist/themes/types.esm.js +1 -458
- package/dist/themes/types.js +1 -458
- package/dist/themes/useSystemTheme.d.ts +10 -42
- package/dist/themes/useSystemTheme.d.ts.map +1 -0
- package/dist/themes/useSystemTheme.esm.js +34 -42
- package/dist/themes/useSystemTheme.js +34 -42
- package/dist/themes/useTheme.d.ts +70 -20
- package/dist/themes/useTheme.d.ts.map +1 -0
- package/dist/themes/useTheme.esm.js +23 -28
- package/dist/themes/useTheme.js +23 -28
- package/dist/themes/validation.d.ts +70 -405
- package/dist/themes/validation.d.ts.map +1 -0
- package/dist/themes/validation.esm.js +380 -433
- package/dist/themes/validation.js +380 -433
- package/dist/tokens/index.d.ts +9 -23
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.esm.js +2 -13
- package/dist/tokens/index.js +2 -13
- package/dist/tokens/tokenExporter.d.ts +83 -335
- package/dist/tokens/tokenExporter.d.ts.map +1 -0
- package/dist/tokens/tokenExporter.esm.js +309 -373
- package/dist/tokens/tokenExporter.js +309 -373
- package/dist/tokens/tokenGenerator.d.ts +36 -249
- package/dist/tokens/tokenGenerator.d.ts.map +1 -0
- package/dist/tokens/tokenGenerator.esm.js +241 -273
- package/dist/tokens/tokenGenerator.js +241 -273
- package/dist/tokens/tokenManager.d.ts +87 -189
- package/dist/tokens/tokenManager.d.ts.map +1 -0
- package/dist/tokens/tokenManager.esm.js +187 -241
- package/dist/tokens/tokenManager.js +187 -241
- package/dist/tokens/tokenValidator.d.ts +84 -481
- package/dist/tokens/tokenValidator.d.ts.map +1 -0
- package/dist/tokens/tokenValidator.esm.js +402 -522
- package/dist/tokens/tokenValidator.js +402 -522
- package/dist/tokens/types.d.ts +40 -60
- package/dist/tokens/types.d.ts.map +1 -0
- package/dist/tokens/types.esm.js +1 -78
- package/dist/tokens/types.js +1 -78
- package/dist/types.d.ts +399 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.esm.js +3 -0
- package/dist/types.js +3 -0
- package/dist/utils/bundle-analyzer.d.ts +37 -254
- package/dist/utils/bundle-analyzer.d.ts.map +1 -0
- package/dist/utils/bundle-analyzer.esm.js +188 -246
- package/dist/utils/bundle-analyzer.js +188 -246
- package/dist/utils/bundle-splitting.d.ts +59 -471
- package/dist/utils/bundle-splitting.d.ts.map +1 -0
- package/dist/utils/bundle-splitting.esm.js +330 -458
- package/dist/utils/bundle-splitting.js +330 -458
- package/dist/utils/lazy-loading.d.ts +64 -429
- package/dist/utils/lazy-loading.d.ts.map +1 -0
- package/dist/utils/lazy-loading.esm.js +311 -417
- package/dist/utils/lazy-loading.js +311 -417
- package/dist/utils/performance-monitor.d.ts +72 -504
- package/dist/utils/performance-monitor.d.ts.map +1 -0
- package/dist/utils/performance-monitor.esm.js +369 -490
- package/dist/utils/performance-monitor.js +369 -490
- package/dist/utils/tree-shaking.d.ts +40 -267
- package/dist/utils/tree-shaking.d.ts.map +1 -0
- package/dist/utils/tree-shaking.esm.js +194 -264
- package/dist/utils/tree-shaking.js +194 -264
- package/package.json +18 -2
- package/src/index.ts +150 -149
- package/src/provider.tsx +3 -3
- package/src/theme.ts +1 -1
- package/src/themes/themes/default.ts +586 -0
- package/src/themes/themes/harvey.ts +554 -0
- package/src/types.ts +460 -0
|
@@ -1,368 +1,309 @@
|
|
|
1
1
|
// Screen reader optimization utilities
|
|
2
2
|
export class ScreenReaderOptimizer {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
constructor() {
|
|
4
|
+
this.liveRegions = new Map();
|
|
5
|
+
this.announcementQueue = [];
|
|
6
|
+
this.isProcessingQueue = false;
|
|
7
|
+
this.initializeLiveRegions();
|
|
8
|
+
}
|
|
9
|
+
// Initialize live regions for different priorities
|
|
10
|
+
initializeLiveRegions() {
|
|
11
|
+
const priorities = Object.values(ScreenReaderOptimizer.PRIORITIES);
|
|
12
|
+
priorities.forEach(priority => {
|
|
13
|
+
const region = document.createElement('div');
|
|
14
|
+
region.setAttribute('aria-live', this.getLiveRegionType(priority));
|
|
15
|
+
region.setAttribute('aria-atomic', 'true');
|
|
16
|
+
region.setAttribute('aria-relevant', 'additions text');
|
|
17
|
+
region.style.position = 'absolute';
|
|
18
|
+
region.style.left = '-10000px';
|
|
19
|
+
region.style.width = '1px';
|
|
20
|
+
region.style.height = '1px';
|
|
21
|
+
region.style.overflow = 'hidden';
|
|
22
|
+
region.setAttribute('data-screen-reader-priority', priority);
|
|
23
|
+
document.body.appendChild(region);
|
|
24
|
+
this.liveRegions.set(priority, region);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
// Get appropriate live region type for priority
|
|
28
|
+
getLiveRegionType(priority) {
|
|
29
|
+
switch (priority) {
|
|
30
|
+
case ScreenReaderOptimizer.PRIORITIES.URGENT:
|
|
31
|
+
return ScreenReaderOptimizer.LIVE_REGIONS.ASSERTIVE;
|
|
32
|
+
case ScreenReaderOptimizer.PRIORITIES.HIGH:
|
|
33
|
+
return ScreenReaderOptimizer.LIVE_REGIONS.ASSERTIVE;
|
|
34
|
+
case ScreenReaderOptimizer.PRIORITIES.NORMAL:
|
|
35
|
+
return ScreenReaderOptimizer.LIVE_REGIONS.POLITE;
|
|
36
|
+
case ScreenReaderOptimizer.PRIORITIES.LOW:
|
|
37
|
+
return ScreenReaderOptimizer.LIVE_REGIONS.POLITE;
|
|
38
|
+
default:
|
|
39
|
+
return ScreenReaderOptimizer.LIVE_REGIONS.POLITE;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// Announce message to screen readers
|
|
43
|
+
announce(message, priority = ScreenReaderOptimizer.PRIORITIES.NORMAL) {
|
|
44
|
+
if (!message || typeof message !== 'string')
|
|
45
|
+
return;
|
|
46
|
+
const timestamp = Date.now();
|
|
47
|
+
this.announcementQueue.push({ message, priority, timestamp });
|
|
48
|
+
if (!this.isProcessingQueue) {
|
|
49
|
+
this.processAnnouncementQueue();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// Process announcement queue
|
|
53
|
+
async processAnnouncementQueue() {
|
|
54
|
+
if (this.isProcessingQueue || this.announcementQueue.length === 0)
|
|
55
|
+
return;
|
|
56
|
+
this.isProcessingQueue = true;
|
|
57
|
+
while (this.announcementQueue.length > 0) {
|
|
58
|
+
const announcement = this.announcementQueue.shift();
|
|
59
|
+
if (!announcement)
|
|
60
|
+
continue;
|
|
61
|
+
await this.makeAnnouncement(announcement.message, announcement.priority);
|
|
62
|
+
// Small delay between announcements to prevent overlap
|
|
63
|
+
await this.delay(100);
|
|
64
|
+
}
|
|
65
|
+
this.isProcessingQueue = false;
|
|
66
|
+
}
|
|
67
|
+
// Make individual announcement
|
|
68
|
+
async makeAnnouncement(message, priority) {
|
|
69
|
+
const region = this.liveRegions.get(priority);
|
|
70
|
+
if (!region)
|
|
71
|
+
return;
|
|
72
|
+
// Clear previous content
|
|
73
|
+
region.textContent = '';
|
|
74
|
+
// Add new message
|
|
75
|
+
region.textContent = message;
|
|
76
|
+
// Force screen reader to announce
|
|
77
|
+
region.setAttribute('aria-hidden', 'true');
|
|
78
|
+
await this.delay(10);
|
|
79
|
+
region.setAttribute('aria-hidden', 'false');
|
|
80
|
+
// Clear content after announcement
|
|
81
|
+
setTimeout(() => {
|
|
82
|
+
region.textContent = '';
|
|
83
|
+
}, 1000);
|
|
84
|
+
}
|
|
85
|
+
// Utility delay function
|
|
86
|
+
delay(ms) {
|
|
87
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
88
|
+
}
|
|
89
|
+
// Announce page title change
|
|
90
|
+
announcePageTitle(title) {
|
|
91
|
+
this.announce(`Page title changed to: ${title}`, ScreenReaderOptimizer.PRIORITIES.HIGH);
|
|
92
|
+
}
|
|
93
|
+
// Announce navigation change
|
|
94
|
+
announceNavigation(destination) {
|
|
95
|
+
this.announce(`Navigated to: ${destination}`, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
96
|
+
}
|
|
97
|
+
// Announce form submission
|
|
98
|
+
announceFormSubmission(formName, success) {
|
|
99
|
+
const message = success
|
|
100
|
+
? `Form ${formName} submitted successfully`
|
|
101
|
+
: `Form ${formName} submission failed`;
|
|
102
|
+
this.announce(message, success ? ScreenReaderOptimizer.PRIORITIES.NORMAL : ScreenReaderOptimizer.PRIORITIES.HIGH);
|
|
103
|
+
}
|
|
104
|
+
// Announce loading state
|
|
105
|
+
announceLoading(component, isLoading) {
|
|
106
|
+
const message = isLoading ? `${component} is loading` : `${component} finished loading`;
|
|
107
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.LOW);
|
|
108
|
+
}
|
|
109
|
+
// Announce error
|
|
110
|
+
announceError(error) {
|
|
111
|
+
this.announce(`Error: ${error}`, ScreenReaderOptimizer.PRIORITIES.URGENT);
|
|
112
|
+
}
|
|
113
|
+
// Announce success
|
|
114
|
+
announceSuccess(message) {
|
|
115
|
+
this.announce(`Success: ${message}`, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
116
|
+
}
|
|
117
|
+
// Announce warning
|
|
118
|
+
announceWarning(message) {
|
|
119
|
+
this.announce(`Warning: ${message}`, ScreenReaderOptimizer.PRIORITIES.HIGH);
|
|
120
|
+
}
|
|
121
|
+
// Announce information
|
|
122
|
+
announceInfo(message) {
|
|
123
|
+
this.announce(`Information: ${message}`, ScreenReaderOptimizer.PRIORITIES.LOW);
|
|
124
|
+
}
|
|
125
|
+
// Announce count changes
|
|
126
|
+
announceCountChange(itemType, count, total) {
|
|
127
|
+
let message = `${itemType} count: ${count}`;
|
|
128
|
+
if (total !== undefined) {
|
|
129
|
+
message += ` of ${total}`;
|
|
130
|
+
}
|
|
131
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.LOW);
|
|
132
|
+
}
|
|
133
|
+
// Announce selection changes
|
|
134
|
+
announceSelectionChange(itemType, selected, total) {
|
|
135
|
+
const message = `${selected} of ${total} ${itemType} selected`;
|
|
136
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
137
|
+
}
|
|
138
|
+
// Announce progress updates
|
|
139
|
+
announceProgress(current, total, percentage) {
|
|
140
|
+
const message = `Progress: ${current} of ${total} (${percentage}%)`;
|
|
141
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.LOW);
|
|
142
|
+
}
|
|
143
|
+
// Announce search results
|
|
144
|
+
announceSearchResults(query, count) {
|
|
145
|
+
const message = `Found ${count} results for "${query}"`;
|
|
146
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
147
|
+
}
|
|
148
|
+
// Announce filter changes
|
|
149
|
+
announceFilterChange(filterName, value) {
|
|
150
|
+
const message = `Filter ${filterName} changed to: ${value}`;
|
|
151
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
152
|
+
}
|
|
153
|
+
// Announce sort changes
|
|
154
|
+
announceSortChange(column, direction) {
|
|
155
|
+
const message = `Sorted by ${column} in ${direction} order`;
|
|
156
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
157
|
+
}
|
|
158
|
+
// Announce modal open/close
|
|
159
|
+
announceModalChange(modalName, isOpen) {
|
|
160
|
+
const message = isOpen ? `${modalName} modal opened` : `${modalName} modal closed`;
|
|
161
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.HIGH);
|
|
162
|
+
}
|
|
163
|
+
// Announce tab changes
|
|
164
|
+
announceTabChange(tabName) {
|
|
165
|
+
this.announce(`Switched to ${tabName} tab`, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
166
|
+
}
|
|
167
|
+
// Announce accordion changes
|
|
168
|
+
announceAccordionChange(sectionName, isExpanded) {
|
|
169
|
+
const message = isExpanded ? `${sectionName} section expanded` : `${sectionName} section collapsed`;
|
|
170
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
171
|
+
}
|
|
172
|
+
// Announce tree changes
|
|
173
|
+
announceTreeChange(nodeName, action) {
|
|
174
|
+
const message = `${nodeName} node ${action}`;
|
|
175
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
176
|
+
}
|
|
177
|
+
// Announce list changes
|
|
178
|
+
announceListChange(listName, action, itemName) {
|
|
179
|
+
const message = `${itemName} ${action} from ${listName} list`;
|
|
180
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
181
|
+
}
|
|
182
|
+
// Announce table changes
|
|
183
|
+
announceTableChange(tableName, action) {
|
|
184
|
+
const message = `${tableName} table: ${action}`;
|
|
185
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
186
|
+
}
|
|
187
|
+
// Announce form field changes
|
|
188
|
+
announceFormFieldChange(fieldName, value, isValid) {
|
|
189
|
+
let message = `${fieldName} field changed to: ${value}`;
|
|
190
|
+
if (!isValid) {
|
|
191
|
+
message += '. Field has validation errors';
|
|
192
|
+
}
|
|
193
|
+
this.announce(message, isValid ? ScreenReaderOptimizer.PRIORITIES.LOW : ScreenReaderOptimizer.PRIORITIES.HIGH);
|
|
194
|
+
}
|
|
195
|
+
// Announce validation errors
|
|
196
|
+
announceValidationErrors(fieldName, errors) {
|
|
197
|
+
const errorList = errors.join(', ');
|
|
198
|
+
const message = `${fieldName} validation errors: ${errorList}`;
|
|
199
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.HIGH);
|
|
200
|
+
}
|
|
201
|
+
// Announce focus changes
|
|
202
|
+
announceFocusChange(elementName, context) {
|
|
203
|
+
let message = `Focused on: ${elementName}`;
|
|
204
|
+
if (context) {
|
|
205
|
+
message += ` in ${context}`;
|
|
206
|
+
}
|
|
207
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.LOW);
|
|
208
|
+
}
|
|
209
|
+
// Announce keyboard shortcuts
|
|
210
|
+
announceKeyboardShortcut(action, shortcut) {
|
|
211
|
+
const message = `${action}: ${shortcut}`;
|
|
212
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.LOW);
|
|
213
|
+
}
|
|
214
|
+
// Announce time-sensitive information
|
|
215
|
+
announceTimeSensitive(message, urgency) {
|
|
216
|
+
const priority = urgency === 'high' ? ScreenReaderOptimizer.PRIORITIES.URGENT :
|
|
217
|
+
urgency === 'medium' ? ScreenReaderOptimizer.PRIORITIES.HIGH :
|
|
218
|
+
ScreenReaderOptimizer.PRIORITIES.NORMAL;
|
|
219
|
+
this.announce(message, priority);
|
|
220
|
+
}
|
|
221
|
+
// Announce status changes
|
|
222
|
+
announceStatusChange(component, oldStatus, newStatus) {
|
|
223
|
+
const message = `${component} status changed from ${oldStatus} to ${newStatus}`;
|
|
224
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
225
|
+
}
|
|
226
|
+
// Announce data updates
|
|
227
|
+
announceDataUpdate(dataType, action) {
|
|
228
|
+
const message = `${dataType} ${action}`;
|
|
229
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
230
|
+
}
|
|
231
|
+
// Announce connection status
|
|
232
|
+
announceConnectionStatus(isConnected) {
|
|
233
|
+
const message = isConnected ? 'Connection restored' : 'Connection lost';
|
|
234
|
+
this.announce(message, isConnected ? ScreenReaderOptimizer.PRIORITIES.NORMAL : ScreenReaderOptimizer.PRIORITIES.URGENT);
|
|
235
|
+
}
|
|
236
|
+
// Announce accessibility features
|
|
237
|
+
announceAccessibilityFeature(feature, enabled) {
|
|
238
|
+
const message = `${feature} accessibility feature ${enabled ? 'enabled' : 'disabled'}`;
|
|
239
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.LOW);
|
|
240
|
+
}
|
|
241
|
+
// Announce theme changes
|
|
242
|
+
announceThemeChange(themeName) {
|
|
243
|
+
this.announce(`Theme changed to: ${themeName}`, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
244
|
+
}
|
|
245
|
+
// Announce language changes
|
|
246
|
+
announceLanguageChange(language) {
|
|
247
|
+
this.announce(`Language changed to: ${language}`, ScreenReaderOptimizer.PRIORITIES.HIGH);
|
|
248
|
+
}
|
|
249
|
+
// Announce font size changes
|
|
250
|
+
announceFontSizeChange(size) {
|
|
251
|
+
this.announce(`Font size changed to: ${size}`, ScreenReaderOptimizer.PRIORITIES.LOW);
|
|
252
|
+
}
|
|
253
|
+
// Announce contrast changes
|
|
254
|
+
announceContrastChange(isHighContrast) {
|
|
255
|
+
const message = isHighContrast ? 'High contrast mode enabled' : 'High contrast mode disabled';
|
|
256
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
257
|
+
}
|
|
258
|
+
// Announce motion changes
|
|
259
|
+
announceMotionChange(isReducedMotion) {
|
|
260
|
+
const message = isReducedMotion ? 'Reduced motion enabled' : 'Reduced motion disabled';
|
|
261
|
+
this.announce(message, ScreenReaderOptimizer.PRIORITIES.LOW);
|
|
262
|
+
}
|
|
263
|
+
// Get announcement queue status
|
|
264
|
+
getQueueStatus() {
|
|
265
|
+
return {
|
|
266
|
+
length: this.announcementQueue.length,
|
|
267
|
+
isProcessing: this.isProcessingQueue
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
// Clear announcement queue
|
|
271
|
+
clearQueue() {
|
|
272
|
+
this.announcementQueue = [];
|
|
273
|
+
}
|
|
274
|
+
// Destroy live regions
|
|
275
|
+
destroy() {
|
|
276
|
+
this.liveRegions.forEach(region => {
|
|
277
|
+
if (region.parentNode) {
|
|
278
|
+
region.parentNode.removeChild(region);
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
this.liveRegions.clear();
|
|
282
|
+
this.clearQueue();
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
// Live region types for dynamic content
|
|
286
|
+
ScreenReaderOptimizer.LIVE_REGIONS = {
|
|
5
287
|
POLITE: 'polite',
|
|
6
288
|
ASSERTIVE: 'assertive',
|
|
7
289
|
OFF: 'off'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
static readonly PRIORITIES = {
|
|
290
|
+
};
|
|
291
|
+
// Announcement priorities
|
|
292
|
+
ScreenReaderOptimizer.PRIORITIES = {
|
|
12
293
|
LOW: 'low',
|
|
13
294
|
NORMAL: 'normal',
|
|
14
295
|
HIGH: 'high',
|
|
15
296
|
URGENT: 'urgent'
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
private liveRegions: Map<string, HTMLElement>;
|
|
19
|
-
private announcementQueue: Array<{ message: string; priority: string; timestamp: number }>;
|
|
20
|
-
private isProcessingQueue: boolean;
|
|
21
|
-
|
|
22
|
-
constructor() {
|
|
23
|
-
this.liveRegions = new Map();
|
|
24
|
-
this.announcementQueue = [];
|
|
25
|
-
this.isProcessingQueue = false;
|
|
26
|
-
this.initializeLiveRegions();
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Initialize live regions for different priorities
|
|
30
|
-
private initializeLiveRegions(): void {
|
|
31
|
-
const priorities = Object.values(ScreenReaderOptimizer.PRIORITIES);
|
|
32
|
-
|
|
33
|
-
priorities.forEach(priority => {
|
|
34
|
-
const region = document.createElement('div');
|
|
35
|
-
region.setAttribute('aria-live', this.getLiveRegionType(priority));
|
|
36
|
-
region.setAttribute('aria-atomic', 'true');
|
|
37
|
-
region.setAttribute('aria-relevant', 'additions text');
|
|
38
|
-
region.style.position = 'absolute';
|
|
39
|
-
region.style.left = '-10000px';
|
|
40
|
-
region.style.width = '1px';
|
|
41
|
-
region.style.height = '1px';
|
|
42
|
-
region.style.overflow = 'hidden';
|
|
43
|
-
region.setAttribute('data-screen-reader-priority', priority);
|
|
44
|
-
|
|
45
|
-
document.body.appendChild(region);
|
|
46
|
-
this.liveRegions.set(priority, region);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Get appropriate live region type for priority
|
|
51
|
-
private getLiveRegionType(priority: string): string {
|
|
52
|
-
switch (priority) {
|
|
53
|
-
case ScreenReaderOptimizer.PRIORITIES.URGENT:
|
|
54
|
-
return ScreenReaderOptimizer.LIVE_REGIONS.ASSERTIVE;
|
|
55
|
-
case ScreenReaderOptimizer.PRIORITIES.HIGH:
|
|
56
|
-
return ScreenReaderOptimizer.LIVE_REGIONS.ASSERTIVE;
|
|
57
|
-
case ScreenReaderOptimizer.PRIORITIES.NORMAL:
|
|
58
|
-
return ScreenReaderOptimizer.LIVE_REGIONS.POLITE;
|
|
59
|
-
case ScreenReaderOptimizer.PRIORITIES.LOW:
|
|
60
|
-
return ScreenReaderOptimizer.LIVE_REGIONS.POLITE;
|
|
61
|
-
default:
|
|
62
|
-
return ScreenReaderOptimizer.LIVE_REGIONS.POLITE;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// Announce message to screen readers
|
|
67
|
-
announce(message: string, priority: string = ScreenReaderOptimizer.PRIORITIES.NORMAL): void {
|
|
68
|
-
if (!message || typeof message !== 'string') return;
|
|
69
|
-
|
|
70
|
-
const timestamp = Date.now();
|
|
71
|
-
this.announcementQueue.push({ message, priority, timestamp });
|
|
72
|
-
|
|
73
|
-
if (!this.isProcessingQueue) {
|
|
74
|
-
this.processAnnouncementQueue();
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Process announcement queue
|
|
79
|
-
private async processAnnouncementQueue(): Promise<void> {
|
|
80
|
-
if (this.isProcessingQueue || this.announcementQueue.length === 0) return;
|
|
81
|
-
|
|
82
|
-
this.isProcessingQueue = true;
|
|
83
|
-
|
|
84
|
-
while (this.announcementQueue.length > 0) {
|
|
85
|
-
const announcement = this.announcementQueue.shift();
|
|
86
|
-
if (!announcement) continue;
|
|
87
|
-
|
|
88
|
-
await this.makeAnnouncement(announcement.message, announcement.priority);
|
|
89
|
-
|
|
90
|
-
// Small delay between announcements to prevent overlap
|
|
91
|
-
await this.delay(100);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
this.isProcessingQueue = false;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// Make individual announcement
|
|
98
|
-
private async makeAnnouncement(message: string, priority: string): Promise<void> {
|
|
99
|
-
const region = this.liveRegions.get(priority);
|
|
100
|
-
if (!region) return;
|
|
101
|
-
|
|
102
|
-
// Clear previous content
|
|
103
|
-
region.textContent = '';
|
|
104
|
-
|
|
105
|
-
// Add new message
|
|
106
|
-
region.textContent = message;
|
|
107
|
-
|
|
108
|
-
// Force screen reader to announce
|
|
109
|
-
region.setAttribute('aria-hidden', 'true');
|
|
110
|
-
await this.delay(10);
|
|
111
|
-
region.setAttribute('aria-hidden', 'false');
|
|
112
|
-
|
|
113
|
-
// Clear content after announcement
|
|
114
|
-
setTimeout(() => {
|
|
115
|
-
region.textContent = '';
|
|
116
|
-
}, 1000);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Utility delay function
|
|
120
|
-
private delay(ms: number): Promise<void> {
|
|
121
|
-
return new Promise(resolve => setTimeout(resolve, ms));
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// Announce page title change
|
|
125
|
-
announcePageTitle(title: string): void {
|
|
126
|
-
this.announce(`Page title changed to: ${title}`, ScreenReaderOptimizer.PRIORITIES.HIGH);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// Announce navigation change
|
|
130
|
-
announceNavigation(destination: string): void {
|
|
131
|
-
this.announce(`Navigated to: ${destination}`, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// Announce form submission
|
|
135
|
-
announceFormSubmission(formName: string, success: boolean): void {
|
|
136
|
-
const message = success
|
|
137
|
-
? `Form ${formName} submitted successfully`
|
|
138
|
-
: `Form ${formName} submission failed`;
|
|
139
|
-
this.announce(message, success ? ScreenReaderOptimizer.PRIORITIES.NORMAL : ScreenReaderOptimizer.PRIORITIES.HIGH);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// Announce loading state
|
|
143
|
-
announceLoading(component: string, isLoading: boolean): void {
|
|
144
|
-
const message = isLoading ? `${component} is loading` : `${component} finished loading`;
|
|
145
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.LOW);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// Announce error
|
|
149
|
-
announceError(error: string): void {
|
|
150
|
-
this.announce(`Error: ${error}`, ScreenReaderOptimizer.PRIORITIES.URGENT);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// Announce success
|
|
154
|
-
announceSuccess(message: string): void {
|
|
155
|
-
this.announce(`Success: ${message}`, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// Announce warning
|
|
159
|
-
announceWarning(message: string): void {
|
|
160
|
-
this.announce(`Warning: ${message}`, ScreenReaderOptimizer.PRIORITIES.HIGH);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// Announce information
|
|
164
|
-
announceInfo(message: string): void {
|
|
165
|
-
this.announce(`Information: ${message}`, ScreenReaderOptimizer.PRIORITIES.LOW);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// Announce count changes
|
|
169
|
-
announceCountChange(itemType: string, count: number, total?: number): void {
|
|
170
|
-
let message = `${itemType} count: ${count}`;
|
|
171
|
-
if (total !== undefined) {
|
|
172
|
-
message += ` of ${total}`;
|
|
173
|
-
}
|
|
174
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.LOW);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// Announce selection changes
|
|
178
|
-
announceSelectionChange(itemType: string, selected: number, total: number): void {
|
|
179
|
-
const message = `${selected} of ${total} ${itemType} selected`;
|
|
180
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// Announce progress updates
|
|
184
|
-
announceProgress(current: number, total: number, percentage: number): void {
|
|
185
|
-
const message = `Progress: ${current} of ${total} (${percentage}%)`;
|
|
186
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.LOW);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// Announce search results
|
|
190
|
-
announceSearchResults(query: string, count: number): void {
|
|
191
|
-
const message = `Found ${count} results for "${query}"`;
|
|
192
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
// Announce filter changes
|
|
196
|
-
announceFilterChange(filterName: string, value: string): void {
|
|
197
|
-
const message = `Filter ${filterName} changed to: ${value}`;
|
|
198
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// Announce sort changes
|
|
202
|
-
announceSortChange(column: string, direction: 'ascending' | 'descending'): void {
|
|
203
|
-
const message = `Sorted by ${column} in ${direction} order`;
|
|
204
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// Announce modal open/close
|
|
208
|
-
announceModalChange(modalName: string, isOpen: boolean): void {
|
|
209
|
-
const message = isOpen ? `${modalName} modal opened` : `${modalName} modal closed`;
|
|
210
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.HIGH);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
// Announce tab changes
|
|
214
|
-
announceTabChange(tabName: string): void {
|
|
215
|
-
this.announce(`Switched to ${tabName} tab`, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// Announce accordion changes
|
|
219
|
-
announceAccordionChange(sectionName: string, isExpanded: boolean): void {
|
|
220
|
-
const message = isExpanded ? `${sectionName} section expanded` : `${sectionName} section collapsed`;
|
|
221
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
// Announce tree changes
|
|
225
|
-
announceTreeChange(nodeName: string, action: 'expanded' | 'collapsed' | 'selected'): void {
|
|
226
|
-
const message = `${nodeName} node ${action}`;
|
|
227
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
// Announce list changes
|
|
231
|
-
announceListChange(listName: string, action: 'added' | 'removed' | 'updated', itemName: string): void {
|
|
232
|
-
const message = `${itemName} ${action} from ${listName} list`;
|
|
233
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
// Announce table changes
|
|
237
|
-
announceTableChange(tableName: string, action: 'row added' | 'row removed' | 'row updated' | 'sorted' | 'filtered'): void {
|
|
238
|
-
const message = `${tableName} table: ${action}`;
|
|
239
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
// Announce form field changes
|
|
243
|
-
announceFormFieldChange(fieldName: string, value: string, isValid: boolean): void {
|
|
244
|
-
let message = `${fieldName} field changed to: ${value}`;
|
|
245
|
-
if (!isValid) {
|
|
246
|
-
message += '. Field has validation errors';
|
|
247
|
-
}
|
|
248
|
-
this.announce(message, isValid ? ScreenReaderOptimizer.PRIORITIES.LOW : ScreenReaderOptimizer.PRIORITIES.HIGH);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
// Announce validation errors
|
|
252
|
-
announceValidationErrors(fieldName: string, errors: string[]): void {
|
|
253
|
-
const errorList = errors.join(', ');
|
|
254
|
-
const message = `${fieldName} validation errors: ${errorList}`;
|
|
255
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.HIGH);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
// Announce focus changes
|
|
259
|
-
announceFocusChange(elementName: string, context?: string): void {
|
|
260
|
-
let message = `Focused on: ${elementName}`;
|
|
261
|
-
if (context) {
|
|
262
|
-
message += ` in ${context}`;
|
|
263
|
-
}
|
|
264
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.LOW);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
// Announce keyboard shortcuts
|
|
268
|
-
announceKeyboardShortcut(action: string, shortcut: string): void {
|
|
269
|
-
const message = `${action}: ${shortcut}`;
|
|
270
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.LOW);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
// Announce time-sensitive information
|
|
274
|
-
announceTimeSensitive(message: string, urgency: 'low' | 'medium' | 'high'): void {
|
|
275
|
-
const priority = urgency === 'high' ? ScreenReaderOptimizer.PRIORITIES.URGENT :
|
|
276
|
-
urgency === 'medium' ? ScreenReaderOptimizer.PRIORITIES.HIGH :
|
|
277
|
-
ScreenReaderOptimizer.PRIORITIES.NORMAL;
|
|
278
|
-
this.announce(message, priority);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
// Announce status changes
|
|
282
|
-
announceStatusChange(component: string, oldStatus: string, newStatus: string): void {
|
|
283
|
-
const message = `${component} status changed from ${oldStatus} to ${newStatus}`;
|
|
284
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
// Announce data updates
|
|
288
|
-
announceDataUpdate(dataType: string, action: 'created' | 'updated' | 'deleted'): void {
|
|
289
|
-
const message = `${dataType} ${action}`;
|
|
290
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
// Announce connection status
|
|
294
|
-
announceConnectionStatus(isConnected: boolean): void {
|
|
295
|
-
const message = isConnected ? 'Connection restored' : 'Connection lost';
|
|
296
|
-
this.announce(message, isConnected ? ScreenReaderOptimizer.PRIORITIES.NORMAL : ScreenReaderOptimizer.PRIORITIES.URGENT);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
// Announce accessibility features
|
|
300
|
-
announceAccessibilityFeature(feature: string, enabled: boolean): void {
|
|
301
|
-
const message = `${feature} accessibility feature ${enabled ? 'enabled' : 'disabled'}`;
|
|
302
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.LOW);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
// Announce theme changes
|
|
306
|
-
announceThemeChange(themeName: string): void {
|
|
307
|
-
this.announce(`Theme changed to: ${themeName}`, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
// Announce language changes
|
|
311
|
-
announceLanguageChange(language: string): void {
|
|
312
|
-
this.announce(`Language changed to: ${language}`, ScreenReaderOptimizer.PRIORITIES.HIGH);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
// Announce font size changes
|
|
316
|
-
announceFontSizeChange(size: string): void {
|
|
317
|
-
this.announce(`Font size changed to: ${size}`, ScreenReaderOptimizer.PRIORITIES.LOW);
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
// Announce contrast changes
|
|
321
|
-
announceContrastChange(isHighContrast: boolean): void {
|
|
322
|
-
const message = isHighContrast ? 'High contrast mode enabled' : 'High contrast mode disabled';
|
|
323
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.NORMAL);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
// Announce motion changes
|
|
327
|
-
announceMotionChange(isReducedMotion: boolean): void {
|
|
328
|
-
const message = isReducedMotion ? 'Reduced motion enabled' : 'Reduced motion disabled';
|
|
329
|
-
this.announce(message, ScreenReaderOptimizer.PRIORITIES.LOW);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
// Get announcement queue status
|
|
333
|
-
getQueueStatus(): { length: number; isProcessing: boolean } {
|
|
334
|
-
return {
|
|
335
|
-
length: this.announcementQueue.length,
|
|
336
|
-
isProcessing: this.isProcessingQueue
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
// Clear announcement queue
|
|
341
|
-
clearQueue(): void {
|
|
342
|
-
this.announcementQueue = [];
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
// Destroy live regions
|
|
346
|
-
destroy(): void {
|
|
347
|
-
this.liveRegions.forEach(region => {
|
|
348
|
-
if (region.parentNode) {
|
|
349
|
-
region.parentNode.removeChild(region);
|
|
350
|
-
}
|
|
351
|
-
});
|
|
352
|
-
this.liveRegions.clear();
|
|
353
|
-
this.clearQueue();
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
|
|
297
|
+
};
|
|
357
298
|
// Screen reader navigation utilities
|
|
358
299
|
export class ScreenReaderNavigation {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
300
|
+
// Create skip link for main content
|
|
301
|
+
static createSkipLink(targetId, text = 'Skip to main content') {
|
|
302
|
+
const skipLink = document.createElement('a');
|
|
303
|
+
skipLink.href = `#${targetId}`;
|
|
304
|
+
skipLink.textContent = text;
|
|
305
|
+
skipLink.className = 'sr-only sr-only-focusable';
|
|
306
|
+
skipLink.style.cssText = `
|
|
366
307
|
position: absolute;
|
|
367
308
|
top: -40px;
|
|
368
309
|
left: 6px;
|
|
@@ -375,271 +316,229 @@ export class ScreenReaderNavigation {
|
|
|
375
316
|
font-size: 14px;
|
|
376
317
|
line-height: 1.2;
|
|
377
318
|
`;
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
nav.setAttribute('aria-label', 'Section navigation');
|
|
596
|
-
nav.className = 'sr-only';
|
|
597
|
-
|
|
598
|
-
const sections = document.querySelectorAll('section, article, aside');
|
|
599
|
-
sections.forEach((section, index) => {
|
|
600
|
-
const link = document.createElement('a');
|
|
601
|
-
link.href = `#${section.id || `${section.tagName.toLowerCase()}-${index}`}`;
|
|
602
|
-
const title = (section as HTMLElement).getAttribute('aria-label') ||
|
|
603
|
-
(section as HTMLElement).querySelector('h1, h2, h3, h4, h5, h6')?.textContent ||
|
|
604
|
-
`${section.tagName} ${index + 1}`;
|
|
605
|
-
link.textContent = title;
|
|
606
|
-
link.className = 'sr-only-focusable';
|
|
607
|
-
nav.appendChild(link);
|
|
608
|
-
});
|
|
609
|
-
|
|
610
|
-
return nav;
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
// Create comprehensive navigation
|
|
614
|
-
static createComprehensiveNavigation(): HTMLDivElement {
|
|
615
|
-
const nav = document.createElement('div');
|
|
616
|
-
nav.setAttribute('role', 'navigation');
|
|
617
|
-
nav.setAttribute('aria-label', 'Comprehensive navigation');
|
|
618
|
-
nav.className = 'sr-only';
|
|
619
|
-
|
|
620
|
-
// Add all navigation types
|
|
621
|
-
nav.appendChild(ScreenReaderNavigation.createLandmarkNavigation());
|
|
622
|
-
nav.appendChild(ScreenReaderNavigation.createHeadingNavigation());
|
|
623
|
-
nav.appendChild(ScreenReaderNavigation.createFormNavigation());
|
|
624
|
-
nav.appendChild(ScreenReaderNavigation.createTableNavigation());
|
|
625
|
-
nav.appendChild(ScreenReaderNavigation.createListNavigation());
|
|
626
|
-
nav.appendChild(ScreenReaderNavigation.createLinkNavigation());
|
|
627
|
-
nav.appendChild(ScreenReaderNavigation.createButtonNavigation());
|
|
628
|
-
nav.appendChild(ScreenReaderNavigation.createInputNavigation());
|
|
629
|
-
nav.appendChild(ScreenReaderNavigation.createImageNavigation());
|
|
630
|
-
nav.appendChild(ScreenReaderNavigation.createMediaNavigation());
|
|
631
|
-
nav.appendChild(ScreenReaderNavigation.createSectionNavigation());
|
|
632
|
-
|
|
633
|
-
return nav;
|
|
634
|
-
}
|
|
319
|
+
skipLink.addEventListener('focus', () => {
|
|
320
|
+
skipLink.style.top = '6px';
|
|
321
|
+
});
|
|
322
|
+
skipLink.addEventListener('blur', () => {
|
|
323
|
+
skipLink.style.top = '-40px';
|
|
324
|
+
});
|
|
325
|
+
return skipLink;
|
|
326
|
+
}
|
|
327
|
+
// Create landmark navigation
|
|
328
|
+
static createLandmarkNavigation() {
|
|
329
|
+
const nav = document.createElement('div');
|
|
330
|
+
nav.setAttribute('role', 'navigation');
|
|
331
|
+
nav.setAttribute('aria-label', 'Landmark navigation');
|
|
332
|
+
nav.className = 'sr-only';
|
|
333
|
+
const landmarks = [
|
|
334
|
+
{ role: 'banner', label: 'Header' },
|
|
335
|
+
{ role: 'main', label: 'Main content' },
|
|
336
|
+
{ role: 'complementary', label: 'Sidebar' },
|
|
337
|
+
{ role: 'contentinfo', label: 'Footer' }
|
|
338
|
+
];
|
|
339
|
+
landmarks.forEach(landmark => {
|
|
340
|
+
const link = document.createElement('a');
|
|
341
|
+
link.href = `[role="${landmark.role}"]`;
|
|
342
|
+
link.textContent = `Skip to ${landmark.label}`;
|
|
343
|
+
link.className = 'sr-only-focusable';
|
|
344
|
+
nav.appendChild(link);
|
|
345
|
+
});
|
|
346
|
+
return nav;
|
|
347
|
+
}
|
|
348
|
+
// Create heading navigation
|
|
349
|
+
static createHeadingNavigation() {
|
|
350
|
+
const nav = document.createElement('div');
|
|
351
|
+
nav.setAttribute('role', 'navigation');
|
|
352
|
+
nav.setAttribute('aria-label', 'Heading navigation');
|
|
353
|
+
nav.className = 'sr-only';
|
|
354
|
+
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
|
|
355
|
+
headings.forEach((heading, index) => {
|
|
356
|
+
const link = document.createElement('a');
|
|
357
|
+
link.href = `#${heading.id || `heading-${index}`}`;
|
|
358
|
+
link.textContent = `${heading.tagName.toLowerCase()} ${heading.textContent}`;
|
|
359
|
+
link.className = 'sr-only-focusable';
|
|
360
|
+
nav.appendChild(link);
|
|
361
|
+
});
|
|
362
|
+
return nav;
|
|
363
|
+
}
|
|
364
|
+
// Create form navigation
|
|
365
|
+
static createFormNavigation() {
|
|
366
|
+
const nav = document.createElement('div');
|
|
367
|
+
nav.setAttribute('role', 'navigation');
|
|
368
|
+
nav.setAttribute('aria-label', 'Form navigation');
|
|
369
|
+
nav.className = 'sr-only';
|
|
370
|
+
const forms = document.querySelectorAll('form');
|
|
371
|
+
forms.forEach((form, index) => {
|
|
372
|
+
const link = document.createElement('a');
|
|
373
|
+
link.href = `#${form.id || `form-${index}`}`;
|
|
374
|
+
link.textContent = `Form ${index + 1}`;
|
|
375
|
+
link.className = 'sr-only-focusable';
|
|
376
|
+
nav.appendChild(link);
|
|
377
|
+
});
|
|
378
|
+
return nav;
|
|
379
|
+
}
|
|
380
|
+
// Create table navigation
|
|
381
|
+
static createTableNavigation() {
|
|
382
|
+
const nav = document.createElement('div');
|
|
383
|
+
nav.setAttribute('role', 'navigation');
|
|
384
|
+
nav.setAttribute('aria-label', 'Table navigation');
|
|
385
|
+
nav.className = 'sr-only';
|
|
386
|
+
const tables = document.querySelectorAll('table');
|
|
387
|
+
tables.forEach((table, index) => {
|
|
388
|
+
const link = document.createElement('a');
|
|
389
|
+
link.href = `#${table.id || `table-${index}`}`;
|
|
390
|
+
link.textContent = `Table ${index + 1}`;
|
|
391
|
+
link.className = 'sr-only-focusable';
|
|
392
|
+
nav.appendChild(link);
|
|
393
|
+
});
|
|
394
|
+
return nav;
|
|
395
|
+
}
|
|
396
|
+
// Create list navigation
|
|
397
|
+
static createListNavigation() {
|
|
398
|
+
const nav = document.createElement('div');
|
|
399
|
+
nav.setAttribute('role', 'navigation');
|
|
400
|
+
nav.setAttribute('aria-label', 'List navigation');
|
|
401
|
+
nav.className = 'sr-only';
|
|
402
|
+
const lists = document.querySelectorAll('ul, ol');
|
|
403
|
+
lists.forEach((list, index) => {
|
|
404
|
+
const link = document.createElement('a');
|
|
405
|
+
link.href = `#${list.id || `list-${index}`}`;
|
|
406
|
+
link.textContent = `${list.tagName.toLowerCase()} with ${list.children.length} items`;
|
|
407
|
+
link.className = 'sr-only-focusable';
|
|
408
|
+
nav.appendChild(link);
|
|
409
|
+
});
|
|
410
|
+
return nav;
|
|
411
|
+
}
|
|
412
|
+
// Create link navigation
|
|
413
|
+
static createLinkNavigation() {
|
|
414
|
+
const nav = document.createElement('div');
|
|
415
|
+
nav.setAttribute('role', 'navigation');
|
|
416
|
+
nav.setAttribute('aria-label', 'Link navigation');
|
|
417
|
+
nav.className = 'sr-only';
|
|
418
|
+
const links = document.querySelectorAll('a[href]:not([href="#"])');
|
|
419
|
+
links.forEach((link, index) => {
|
|
420
|
+
const navLink = document.createElement('a');
|
|
421
|
+
navLink.href = link.href;
|
|
422
|
+
navLink.textContent = link.textContent || `Link ${index + 1}`;
|
|
423
|
+
navLink.className = 'sr-only-focusable';
|
|
424
|
+
nav.appendChild(navLink);
|
|
425
|
+
});
|
|
426
|
+
return nav;
|
|
427
|
+
}
|
|
428
|
+
// Create button navigation
|
|
429
|
+
static createButtonNavigation() {
|
|
430
|
+
const nav = document.createElement('div');
|
|
431
|
+
nav.setAttribute('role', 'navigation');
|
|
432
|
+
nav.setAttribute('aria-label', 'Button navigation');
|
|
433
|
+
nav.className = 'sr-only';
|
|
434
|
+
const buttons = document.querySelectorAll('button, [role="button"]');
|
|
435
|
+
buttons.forEach((button, index) => {
|
|
436
|
+
const link = document.createElement('a');
|
|
437
|
+
link.href = `#${button.id || `button-${index}`}`;
|
|
438
|
+
link.textContent = button.textContent || `Button ${index + 1}`;
|
|
439
|
+
link.className = 'sr-only-focusable';
|
|
440
|
+
nav.appendChild(link);
|
|
441
|
+
});
|
|
442
|
+
return nav;
|
|
443
|
+
}
|
|
444
|
+
// Create input navigation
|
|
445
|
+
static createInputNavigation() {
|
|
446
|
+
const nav = document.createElement('div');
|
|
447
|
+
nav.setAttribute('role', 'navigation');
|
|
448
|
+
nav.setAttribute('aria-label', 'Input navigation');
|
|
449
|
+
nav.className = 'sr-only';
|
|
450
|
+
const inputs = document.querySelectorAll('input, textarea, select');
|
|
451
|
+
inputs.forEach((input, index) => {
|
|
452
|
+
const link = document.createElement('a');
|
|
453
|
+
link.href = `#${input.id || `input-${index}`}`;
|
|
454
|
+
const label = input.getAttribute('aria-label') ||
|
|
455
|
+
input.getAttribute('placeholder') ||
|
|
456
|
+
input.getAttribute('name') ||
|
|
457
|
+
`Input ${index + 1}`;
|
|
458
|
+
link.textContent = label;
|
|
459
|
+
link.className = 'sr-only-focusable';
|
|
460
|
+
nav.appendChild(link);
|
|
461
|
+
});
|
|
462
|
+
return nav;
|
|
463
|
+
}
|
|
464
|
+
// Create image navigation
|
|
465
|
+
static createImageNavigation() {
|
|
466
|
+
const nav = document.createElement('div');
|
|
467
|
+
nav.setAttribute('role', 'navigation');
|
|
468
|
+
nav.setAttribute('aria-label', 'Image navigation');
|
|
469
|
+
nav.className = 'sr-only';
|
|
470
|
+
const images = document.querySelectorAll('img');
|
|
471
|
+
images.forEach((img, index) => {
|
|
472
|
+
const link = document.createElement('a');
|
|
473
|
+
link.href = `#${img.id || `image-${index}`}`;
|
|
474
|
+
const alt = img.alt || `Image ${index + 1}`;
|
|
475
|
+
link.textContent = alt;
|
|
476
|
+
link.className = 'sr-only-focusable';
|
|
477
|
+
nav.appendChild(link);
|
|
478
|
+
});
|
|
479
|
+
return nav;
|
|
480
|
+
}
|
|
481
|
+
// Create media navigation
|
|
482
|
+
static createMediaNavigation() {
|
|
483
|
+
const nav = document.createElement('div');
|
|
484
|
+
nav.setAttribute('role', 'navigation');
|
|
485
|
+
nav.setAttribute('aria-label', 'Media navigation');
|
|
486
|
+
nav.className = 'sr-only';
|
|
487
|
+
const media = document.querySelectorAll('video, audio');
|
|
488
|
+
media.forEach((element, index) => {
|
|
489
|
+
const link = document.createElement('a');
|
|
490
|
+
link.href = `#${element.id || `${element.tagName.toLowerCase()}-${index}`}`;
|
|
491
|
+
link.textContent = `${element.tagName} ${index + 1}`;
|
|
492
|
+
link.className = 'sr-only-focusable';
|
|
493
|
+
nav.appendChild(link);
|
|
494
|
+
});
|
|
495
|
+
return nav;
|
|
496
|
+
}
|
|
497
|
+
// Create section navigation
|
|
498
|
+
static createSectionNavigation() {
|
|
499
|
+
const nav = document.createElement('div');
|
|
500
|
+
nav.setAttribute('role', 'navigation');
|
|
501
|
+
nav.setAttribute('aria-label', 'Section navigation');
|
|
502
|
+
nav.className = 'sr-only';
|
|
503
|
+
const sections = document.querySelectorAll('section, article, aside');
|
|
504
|
+
sections.forEach((section, index) => {
|
|
505
|
+
const link = document.createElement('a');
|
|
506
|
+
link.href = `#${section.id || `${section.tagName.toLowerCase()}-${index}`}`;
|
|
507
|
+
const title = section.getAttribute('aria-label') ||
|
|
508
|
+
section.querySelector('h1, h2, h3, h4, h5, h6')?.textContent ||
|
|
509
|
+
`${section.tagName} ${index + 1}`;
|
|
510
|
+
link.textContent = title;
|
|
511
|
+
link.className = 'sr-only-focusable';
|
|
512
|
+
nav.appendChild(link);
|
|
513
|
+
});
|
|
514
|
+
return nav;
|
|
515
|
+
}
|
|
516
|
+
// Create comprehensive navigation
|
|
517
|
+
static createComprehensiveNavigation() {
|
|
518
|
+
const nav = document.createElement('div');
|
|
519
|
+
nav.setAttribute('role', 'navigation');
|
|
520
|
+
nav.setAttribute('aria-label', 'Comprehensive navigation');
|
|
521
|
+
nav.className = 'sr-only';
|
|
522
|
+
// Add all navigation types
|
|
523
|
+
nav.appendChild(ScreenReaderNavigation.createLandmarkNavigation());
|
|
524
|
+
nav.appendChild(ScreenReaderNavigation.createHeadingNavigation());
|
|
525
|
+
nav.appendChild(ScreenReaderNavigation.createFormNavigation());
|
|
526
|
+
nav.appendChild(ScreenReaderNavigation.createTableNavigation());
|
|
527
|
+
nav.appendChild(ScreenReaderNavigation.createListNavigation());
|
|
528
|
+
nav.appendChild(ScreenReaderNavigation.createLinkNavigation());
|
|
529
|
+
nav.appendChild(ScreenReaderNavigation.createButtonNavigation());
|
|
530
|
+
nav.appendChild(ScreenReaderNavigation.createInputNavigation());
|
|
531
|
+
nav.appendChild(ScreenReaderNavigation.createImageNavigation());
|
|
532
|
+
nav.appendChild(ScreenReaderNavigation.createMediaNavigation());
|
|
533
|
+
nav.appendChild(ScreenReaderNavigation.createSectionNavigation());
|
|
534
|
+
return nav;
|
|
535
|
+
}
|
|
635
536
|
}
|
|
636
|
-
|
|
637
537
|
// Export default instances
|
|
638
538
|
export const screenReaderOptimizer = new ScreenReaderOptimizer();
|
|
639
|
-
|
|
640
539
|
// Export default
|
|
641
540
|
export default {
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
541
|
+
ScreenReaderOptimizer,
|
|
542
|
+
ScreenReaderNavigation,
|
|
543
|
+
screenReaderOptimizer
|
|
645
544
|
};
|