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