@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.2.10 → 0.2.16
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 +80 -258
- package/dist/components/ui/accessibility-demo.js +80 -258
- 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.esm.js +59 -670
- package/dist/components/ui/advanced-transition-system-demo.js +59 -670
- 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.esm.js +98 -159
- package/dist/components/ui/animation/animated-container.js +98 -159
- 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.esm.js +37 -68
- package/dist/components/ui/animation/staggered-container.js +37 -68
- package/dist/components/ui/animation-demo.esm.js +30 -250
- package/dist/components/ui/animation-demo.js +30 -250
- 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.esm.js +136 -565
- package/dist/components/ui/battery-conscious-animation-demo.js +136 -565
- 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.esm.js +14 -33
- package/dist/components/ui/button.js +14 -33
- package/dist/components/ui/card.esm.js +74 -188
- package/dist/components/ui/card.js +74 -188
- package/dist/components/ui/checkbox.esm.js +11 -30
- package/dist/components/ui/checkbox.js +11 -30
- 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.esm.js +210 -632
- package/dist/components/ui/data-display/chart.js +210 -632
- 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.esm.js +173 -661
- package/dist/components/ui/data-display/data-grid.js +173 -661
- 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.esm.js +109 -468
- package/dist/components/ui/data-display/table.js +109 -468
- 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.esm.js +211 -585
- package/dist/components/ui/data-display/tree.js +211 -585
- 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.esm.js +76 -749
- package/dist/components/ui/enterprise-mobile-experience-demo.js +76 -749
- 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.esm.js +40 -148
- package/dist/components/ui/feedback/alert.js +40 -148
- 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.esm.js +64 -173
- package/dist/components/ui/feedback/skeleton.js +64 -173
- 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.esm.js +1 -125
- package/dist/components/ui/feedback/types.js +1 -125
- 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.esm.js +191 -553
- package/dist/components/ui/form-demo.js +191 -553
- 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.esm.js +13 -32
- package/dist/components/ui/input.js +13 -32
- package/dist/components/ui/label.esm.js +6 -16
- package/dist/components/ui/label.js +6 -16
- 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.esm.js +60 -139
- package/dist/components/ui/layouts/adaptive-layout.js +60 -139
- 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.esm.js +4 -10
- package/dist/components/ui/layouts/index.js +4 -10
- 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.esm.js +53 -197
- package/dist/components/ui/layouts/tablet-layout.js +53 -197
- 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.esm.js +11 -198
- package/dist/components/ui/mobile-input-demo.js +11 -198
- 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.esm.js +144 -638
- package/dist/components/ui/mobile-skeleton-loading-demo.js +144 -638
- 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.esm.js +0 -26
- package/dist/components/ui/navigation/index.js +0 -26
- 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.esm.js +130 -315
- package/dist/components/ui/navigation/navigation-demo.js +130 -315
- 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.esm.js +156 -368
- package/dist/components/ui/navigation/sidebar.js +156 -368
- 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.esm.js +89 -198
- package/dist/components/ui/navigation/tabs.js +89 -198
- 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.esm.js +39 -78
- package/dist/components/ui/overlay/backdrop.js +39 -78
- 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.esm.js +0 -27
- package/dist/components/ui/overlay/index.js +0 -27
- 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.esm.js +60 -100
- package/dist/components/ui/overlay/overlay-manager.js +60 -100
- 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.esm.js +45 -74
- package/dist/components/ui/overlay/portal.js +45 -74
- 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.esm.js +1 -196
- package/dist/components/ui/overlay/types.js +1 -196
- 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.esm.js +87 -501
- package/dist/components/ui/semantic-input-system-demo.js +87 -501
- 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.esm.js +44 -306
- package/dist/components/ui/theme-preview.js +44 -306
- 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.esm.js +22 -35
- package/dist/components/ui/theme-toggle.js +22 -35
- 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.esm.js +96 -462
- package/dist/components/ui/touch-demo.js +96 -462
- 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.esm.js +103 -281
- package/dist/components/ui/touch-friendly-interface.js +103 -281
- package/dist/hooks/index.esm.js +23 -181
- package/dist/hooks/index.js +23 -181
- 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.esm.js +212 -287
- package/dist/hooks/use-adaptive-layout.js +212 -287
- 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.esm.js +286 -392
- package/dist/hooks/use-advanced-transition-system.js +286 -392
- 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.esm.js +310 -384
- package/dist/hooks/use-battery-animations.js +310 -384
- 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.esm.js +267 -329
- package/dist/hooks/use-battery-optimization.js +267 -329
- 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.esm.js +235 -341
- package/dist/hooks/use-component-performance.js +235 -341
- 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.esm.js +77 -102
- package/dist/hooks/use-device.js +77 -102
- 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.esm.js +313 -398
- package/dist/hooks/use-form-feedback.js +313 -398
- 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.esm.js +178 -251
- package/dist/hooks/use-frame-rate.js +178 -251
- package/dist/hooks/use-gestures.esm.js +230 -332
- package/dist/hooks/use-gestures.js +230 -332
- 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.esm.js +350 -454
- package/dist/hooks/use-input-accessibility.js +350 -454
- 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.esm.js +233 -319
- package/dist/hooks/use-layout-performance.js +233 -319
- 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.esm.js +398 -469
- package/dist/hooks/use-loading-performance.js +398 -469
- 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.esm.js +365 -458
- package/dist/hooks/use-mobile-form-layout.js +365 -458
- 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.esm.js +354 -468
- package/dist/hooks/use-mobile-keyboard-optimization.js +354 -468
- 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.esm.js +308 -404
- package/dist/hooks/use-mobile-optimization.js +308 -404
- 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.esm.js +314 -412
- package/dist/hooks/use-mobile-touch.js +314 -412
- package/dist/hooks/use-performance-throttling.esm.js +276 -344
- package/dist/hooks/use-performance-throttling.js +276 -344
- package/dist/hooks/use-performance.esm.js +216 -313
- package/dist/hooks/use-performance.js +216 -313
- 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.esm.js +290 -356
- package/dist/hooks/use-semantic-input-types.js +290 -356
- 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.esm.js +279 -384
- package/dist/hooks/use-tablet-layout.js +279 -384
- 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.esm.js +242 -331
- package/dist/hooks/use-touch-friendly-interface.js +242 -331
- package/dist/hooks/use-touch-optimization.esm.js +288 -370
- package/dist/hooks/use-touch-optimization.js +288 -370
- package/dist/index.esm.js +150 -294
- package/dist/index.js +150 -294
- package/dist/lib/utils.esm.js +4 -5
- package/dist/lib/utils.js +4 -5
- package/dist/plugins/theme-css-generator.esm.js +292 -346
- package/dist/plugins/theme-css-generator.js +292 -346
- package/dist/provider.esm.js +3 -19
- package/dist/provider.js +3 -19
- 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.esm.js +654 -658
- package/dist/theme.js +654 -658
- package/dist/themes/ThemeContext.esm.js +1 -27
- package/dist/themes/ThemeContext.js +1 -27
- package/dist/themes/ThemeProvider.esm.js +191 -223
- package/dist/themes/ThemeProvider.js +191 -223
- package/dist/themes/accessibility/index.esm.js +0 -4
- package/dist/themes/accessibility/index.js +0 -4
- package/dist/themes/accessibility.esm.js +175 -240
- package/dist/themes/accessibility.js +175 -240
- package/dist/themes/aria-patterns.esm.js +345 -401
- package/dist/themes/aria-patterns.js +345 -401
- package/dist/themes/base-themes.esm.js +15 -24
- package/dist/themes/base-themes.js +15 -24
- package/dist/themes/colorManager.esm.js +293 -357
- package/dist/themes/colorManager.js +293 -357
- 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.esm.js +80 -85
- package/dist/themes/examples/minimal-theme.js +80 -85
- package/dist/themes/focus-management.esm.js +541 -677
- package/dist/themes/focus-management.js +541 -677
- package/dist/themes/fontLoader.esm.js +151 -180
- package/dist/themes/fontLoader.js +151 -180
- package/dist/themes/high-contrast.esm.js +394 -558
- package/dist/themes/high-contrast.js +394 -558
- package/dist/themes/index.esm.js +1 -9
- package/dist/themes/index.js +1 -9
- package/dist/themes/inheritance.esm.js +145 -180
- package/dist/themes/inheritance.js +145 -180
- package/dist/themes/keyboard-navigation.esm.js +418 -510
- package/dist/themes/keyboard-navigation.js +418 -510
- package/dist/themes/motion-reduction.esm.js +434 -591
- package/dist/themes/motion-reduction.js +434 -591
- package/dist/themes/navigation.esm.js +1 -234
- package/dist/themes/navigation.js +1 -234
- package/dist/themes/screen-reader.esm.js +515 -616
- package/dist/themes/screen-reader.js +515 -616
- package/dist/themes/systemThemeDetector.esm.js +135 -164
- package/dist/themes/systemThemeDetector.js +135 -164
- package/dist/themes/themeCSSUpdater.esm.js +217 -252
- package/dist/themes/themeCSSUpdater.js +217 -252
- package/dist/themes/themePersistence.esm.js +181 -212
- package/dist/themes/themePersistence.js +181 -212
- package/dist/themes/themes/default.esm.js +584 -0
- package/dist/themes/themes/default.js +584 -0
- package/dist/themes/themes/harvey.esm.js +551 -0
- package/dist/themes/themes/harvey.js +551 -0
- package/dist/themes/themes/stan-design.esm.js +654 -658
- package/dist/themes/themes/stan-design.js +654 -658
- package/dist/themes/types.esm.js +1 -458
- package/dist/themes/types.js +1 -458
- package/dist/themes/useSystemTheme.esm.js +34 -42
- package/dist/themes/useSystemTheme.js +34 -42
- package/dist/themes/useTheme.esm.js +23 -28
- package/dist/themes/useTheme.js +23 -28
- package/dist/themes/validation.esm.js +380 -433
- package/dist/themes/validation.js +380 -433
- package/dist/tokens/index.esm.js +2 -25
- package/dist/tokens/index.js +2 -25
- package/dist/tokens/tokenExporter.esm.js +309 -373
- package/dist/tokens/tokenExporter.js +309 -373
- package/dist/tokens/tokenGenerator.esm.js +241 -273
- package/dist/tokens/tokenGenerator.js +241 -273
- package/dist/tokens/tokenManager.esm.js +187 -241
- package/dist/tokens/tokenManager.js +187 -241
- package/dist/tokens/tokenValidator.esm.js +402 -522
- package/dist/tokens/tokenValidator.js +402 -522
- package/dist/tokens/types.esm.js +1 -78
- package/dist/tokens/types.js +1 -78
- package/dist/types.esm.js +3 -0
- package/dist/types.js +3 -0
- package/dist/utils/bundle-analyzer.esm.js +188 -246
- package/dist/utils/bundle-analyzer.js +188 -246
- package/dist/utils/bundle-splitting.esm.js +330 -458
- package/dist/utils/bundle-splitting.js +330 -458
- package/dist/utils/lazy-loading.esm.js +311 -417
- package/dist/utils/lazy-loading.js +311 -417
- package/dist/utils/performance-monitor.esm.js +369 -490
- package/dist/utils/performance-monitor.js +369 -490
- 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/{dist/theme.d.ts → src/themes/themes/default.ts} +77 -169
- package/src/themes/themes/harvey.ts +554 -0
- package/{dist/themes/types.d.ts → src/types.ts} +7 -1
- package/dist/components/ui/accessibility-demo.d.ts +0 -259
- package/dist/components/ui/advanced-component-architecture-demo.d.ts +0 -718
- package/dist/components/ui/advanced-transition-system-demo.d.ts +0 -660
- package/dist/components/ui/advanced-transition-system.d.ts +0 -391
- package/dist/components/ui/animation/animated-container.d.ts +0 -162
- package/dist/components/ui/animation/index.d.ts +0 -9
- package/dist/components/ui/animation/staggered-container.d.ts +0 -64
- package/dist/components/ui/animation-demo.d.ts +0 -238
- package/dist/components/ui/badge.d.ts +0 -28
- package/dist/components/ui/battery-conscious-animation-demo.d.ts +0 -561
- package/dist/components/ui/border-radius-shadow-demo.d.ts +0 -183
- package/dist/components/ui/button.d.ts +0 -33
- package/dist/components/ui/card.d.ts +0 -205
- package/dist/components/ui/checkbox.d.ts +0 -26
- package/dist/components/ui/color-preview.d.ts +0 -402
- package/dist/components/ui/data-display/chart.d.ts +0 -646
- package/dist/components/ui/data-display/data-grid-simple.d.ts +0 -73
- package/dist/components/ui/data-display/data-grid.d.ts +0 -670
- package/dist/components/ui/data-display/list.d.ts +0 -448
- package/dist/components/ui/data-display/table.d.ts +0 -472
- package/dist/components/ui/data-display/timeline.d.ts +0 -433
- package/dist/components/ui/data-display/tree.d.ts +0 -594
- package/dist/components/ui/data-display/types.d.ts +0 -534
- package/dist/components/ui/enterprise-mobile-experience-demo.d.ts +0 -735
- package/dist/components/ui/enterprise-mobile-experience.d.ts +0 -461
- package/dist/components/ui/feedback/alert.d.ts +0 -154
- package/dist/components/ui/feedback/progress.d.ts +0 -288
- package/dist/components/ui/feedback/skeleton.d.ts +0 -182
- package/dist/components/ui/feedback/toast.d.ts +0 -277
- package/dist/components/ui/feedback/types.d.ts +0 -123
- package/dist/components/ui/font-preview.d.ts +0 -282
- package/dist/components/ui/form-demo.d.ts +0 -544
- package/dist/components/ui/hardware-acceleration-demo.d.ts +0 -540
- package/dist/components/ui/input.d.ts +0 -33
- package/dist/components/ui/label.d.ts +0 -13
- package/dist/components/ui/layout-demo.d.ts +0 -352
- package/dist/components/ui/layouts/adaptive-layout.d.ts +0 -132
- package/dist/components/ui/layouts/desktop-layout.d.ts +0 -219
- package/dist/components/ui/layouts/index.d.ts +0 -5
- package/dist/components/ui/layouts/mobile-layout.d.ts +0 -158
- package/dist/components/ui/layouts/tablet-layout.d.ts +0 -192
- package/dist/components/ui/mobile-form-validation.d.ts +0 -439
- package/dist/components/ui/mobile-input-demo.d.ts +0 -197
- package/dist/components/ui/mobile-input.d.ts +0 -273
- package/dist/components/ui/mobile-skeleton-loading-demo.d.ts +0 -628
- package/dist/components/ui/navigation/breadcrumb.d.ts +0 -149
- package/dist/components/ui/navigation/index.d.ts +0 -25
- package/dist/components/ui/navigation/menu.d.ts +0 -366
- package/dist/components/ui/navigation/navigation-demo.d.ts +0 -169
- package/dist/components/ui/navigation/pagination.d.ts +0 -261
- package/dist/components/ui/navigation/sidebar.d.ts +0 -375
- package/dist/components/ui/navigation/stepper.d.ts +0 -294
- package/dist/components/ui/navigation/tabs.d.ts +0 -196
- package/dist/components/ui/navigation/types.d.ts +0 -293
- package/dist/components/ui/overlay/backdrop.d.ts +0 -79
- package/dist/components/ui/overlay/focus-manager.d.ts +0 -141
- package/dist/components/ui/overlay/index.d.ts +0 -27
- package/dist/components/ui/overlay/modal.d.ts +0 -262
- package/dist/components/ui/overlay/overlay-manager.d.ts +0 -107
- package/dist/components/ui/overlay/popover.d.ts +0 -450
- package/dist/components/ui/overlay/portal.d.ts +0 -75
- package/dist/components/ui/overlay/tooltip.d.ts +0 -298
- package/dist/components/ui/overlay/types.d.ts +0 -194
- package/dist/components/ui/performance-demo.d.ts +0 -583
- package/dist/components/ui/semantic-input-system-demo.d.ts +0 -490
- package/dist/components/ui/theme-customizer.d.ts +0 -378
- package/dist/components/ui/theme-preview.d.ts +0 -305
- package/dist/components/ui/theme-switcher.d.ts +0 -259
- package/dist/components/ui/theme-toggle.d.ts +0 -34
- package/dist/components/ui/token-demo.d.ts +0 -188
- package/dist/components/ui/touch-demo.d.ts +0 -455
- package/dist/components/ui/touch-friendly-interface-demo.d.ts +0 -512
- package/dist/components/ui/touch-friendly-interface.d.ts +0 -292
- package/dist/hooks/index.d.ts +0 -161
- package/dist/hooks/use-accessibility-support.d.ts +0 -516
- package/dist/hooks/use-adaptive-layout.d.ts +0 -287
- package/dist/hooks/use-advanced-patterns.d.ts +0 -292
- package/dist/hooks/use-advanced-transition-system.d.ts +0 -390
- package/dist/hooks/use-animation-profile.d.ts +0 -285
- package/dist/hooks/use-battery-animations.d.ts +0 -382
- package/dist/hooks/use-battery-conscious-loading.d.ts +0 -473
- package/dist/hooks/use-battery-optimization.d.ts +0 -328
- package/dist/hooks/use-battery-status.d.ts +0 -297
- package/dist/hooks/use-component-performance.d.ts +0 -342
- package/dist/hooks/use-device-loading-states.d.ts +0 -456
- package/dist/hooks/use-device.d.ts +0 -104
- package/dist/hooks/use-enterprise-mobile-experience.d.ts +0 -486
- package/dist/hooks/use-form-feedback.d.ts +0 -401
- package/dist/hooks/use-form-performance.d.ts +0 -511
- package/dist/hooks/use-frame-rate.d.ts +0 -249
- package/dist/hooks/use-gestures.d.ts +0 -336
- package/dist/hooks/use-hardware-acceleration.d.ts +0 -339
- package/dist/hooks/use-input-accessibility.d.ts +0 -451
- package/dist/hooks/use-input-performance.d.ts +0 -503
- package/dist/hooks/use-layout-performance.d.ts +0 -317
- package/dist/hooks/use-loading-accessibility.d.ts +0 -532
- package/dist/hooks/use-loading-performance.d.ts +0 -471
- package/dist/hooks/use-memory-usage.d.ts +0 -285
- package/dist/hooks/use-mobile-form-layout.d.ts +0 -462
- package/dist/hooks/use-mobile-form-validation.d.ts +0 -516
- package/dist/hooks/use-mobile-keyboard-optimization.d.ts +0 -469
- package/dist/hooks/use-mobile-layout.d.ts +0 -300
- package/dist/hooks/use-mobile-optimization.d.ts +0 -404
- package/dist/hooks/use-mobile-skeleton.d.ts +0 -399
- package/dist/hooks/use-mobile-touch.d.ts +0 -412
- package/dist/hooks/use-performance-throttling.d.ts +0 -346
- package/dist/hooks/use-performance.d.ts +0 -314
- package/dist/hooks/use-reusable-architecture.d.ts +0 -412
- package/dist/hooks/use-semantic-input-types.d.ts +0 -354
- package/dist/hooks/use-semantic-input.d.ts +0 -563
- package/dist/hooks/use-tablet-layout.d.ts +0 -382
- package/dist/hooks/use-touch-friendly-input.d.ts +0 -520
- package/dist/hooks/use-touch-friendly-interface.d.ts +0 -329
- package/dist/hooks/use-touch-optimization.d.ts +0 -373
- package/dist/index.d.ts +0 -149
- package/dist/lib/utils.d.ts +0 -3
- package/dist/plugins/theme-css-generator.d.ts +0 -345
- package/dist/provider.d.ts +0 -17
- package/dist/themes/ThemeContext.d.ts +0 -27
- package/dist/themes/ThemeProvider.d.ts +0 -222
- package/dist/themes/accessibility/index.d.ts +0 -7
- package/dist/themes/accessibility.d.ts +0 -259
- package/dist/themes/aria-patterns.d.ts +0 -418
- package/dist/themes/base-themes.d.ts +0 -34
- package/dist/themes/colorManager.d.ts +0 -327
- package/dist/themes/examples/dark-theme.d.ts +0 -139
- package/dist/themes/examples/minimal-theme.d.ts +0 -93
- package/dist/themes/focus-management.d.ts +0 -699
- package/dist/themes/fontLoader.d.ts +0 -163
- package/dist/themes/high-contrast.d.ts +0 -619
- package/dist/themes/index.d.ts +0 -11
- package/dist/themes/inheritance.d.ts +0 -160
- package/dist/themes/keyboard-navigation.d.ts +0 -550
- package/dist/themes/motion-reduction.d.ts +0 -660
- package/dist/themes/navigation.d.ts +0 -232
- package/dist/themes/screen-reader.d.ts +0 -645
- package/dist/themes/systemThemeDetector.d.ts +0 -148
- package/dist/themes/themeCSSUpdater.d.ts +0 -229
- package/dist/themes/themePersistence.d.ts +0 -192
- package/dist/themes/themes/stan-design.d.ts +0 -678
- package/dist/themes/useSystemTheme.d.ts +0 -43
- package/dist/themes/useTheme.d.ts +0 -20
- package/dist/themes/validation.d.ts +0 -406
- package/dist/tokens/index.d.ts +0 -25
- package/dist/tokens/tokenExporter.d.ts +0 -336
- package/dist/tokens/tokenGenerator.d.ts +0 -250
- package/dist/tokens/tokenManager.d.ts +0 -194
- package/dist/tokens/tokenValidator.d.ts +0 -488
- package/dist/tokens/types.d.ts +0 -78
- package/dist/utils/bundle-analyzer.d.ts +0 -260
- package/dist/utils/bundle-splitting.d.ts +0 -483
- package/dist/utils/lazy-loading.d.ts +0 -437
- package/dist/utils/performance-monitor.d.ts +0 -513
- package/dist/utils/tree-shaking.d.ts +0 -274
|
@@ -1,176 +1,118 @@
|
|
|
1
1
|
import { screenReaderOptimizer } from './screen-reader';
|
|
2
|
-
|
|
3
|
-
// Motion reduction theme configuration
|
|
4
|
-
export interface MotionReductionThemeConfig {
|
|
5
|
-
motion: {
|
|
6
|
-
reduced: boolean;
|
|
7
|
-
duration: {
|
|
8
|
-
fast: string;
|
|
9
|
-
normal: string;
|
|
10
|
-
slow: string;
|
|
11
|
-
};
|
|
12
|
-
easing: {
|
|
13
|
-
ease: string;
|
|
14
|
-
easeIn: string;
|
|
15
|
-
easeOut: string;
|
|
16
|
-
easeInOut: string;
|
|
17
|
-
};
|
|
18
|
-
animations: {
|
|
19
|
-
enabled: boolean;
|
|
20
|
-
type: 'none' | 'reduced' | 'full';
|
|
21
|
-
preferences: {
|
|
22
|
-
reduceMotion: boolean;
|
|
23
|
-
reduceAnimation: boolean;
|
|
24
|
-
reduceTransition: boolean;
|
|
25
|
-
reduceTransform: boolean;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
2
|
// Motion reduction utilities
|
|
32
3
|
export class MotionReductionManager {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
4
|
+
constructor() {
|
|
5
|
+
this.isReducedMotion = false;
|
|
6
|
+
this.isReducedAnimation = false;
|
|
7
|
+
this.isReducedTransition = false;
|
|
8
|
+
this.isReducedTransform = false;
|
|
9
|
+
// private motionPreferences: Set<string> = new Set(); // Unused for now
|
|
10
|
+
this.originalStyles = new Map();
|
|
11
|
+
this.reducedMotionStyles = new Map();
|
|
12
|
+
this.initializeSystemPreference();
|
|
13
|
+
this.setupEventListeners();
|
|
14
|
+
}
|
|
15
|
+
// Initialize system preference detection
|
|
16
|
+
initializeSystemPreference() {
|
|
17
|
+
if (typeof window !== 'undefined' && window.matchMedia) {
|
|
18
|
+
const reducedMotionQuery = window.matchMedia('(prefers-reduced-motion: reduce)');
|
|
19
|
+
this.isReducedMotion = reducedMotionQuery.matches;
|
|
20
|
+
reducedMotionQuery.addEventListener('change', (e) => {
|
|
21
|
+
this.isReducedMotion = e.matches;
|
|
22
|
+
this.applyMotionReduction();
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
// Setup event listeners
|
|
27
|
+
setupEventListeners() {
|
|
28
|
+
// Listen for preference changes
|
|
29
|
+
if (typeof window !== 'undefined') {
|
|
30
|
+
window.addEventListener('storage', (e) => {
|
|
31
|
+
if (e.key === 'motion-reduction-preferences') {
|
|
32
|
+
this.loadPreferences();
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// Enable motion reduction
|
|
38
|
+
enable() {
|
|
39
|
+
this.isReducedMotion = true;
|
|
40
|
+
this.applyMotionReduction();
|
|
41
|
+
}
|
|
42
|
+
// Disable motion reduction
|
|
43
|
+
disable() {
|
|
44
|
+
this.isReducedMotion = false;
|
|
45
|
+
this.removeMotionReduction();
|
|
46
|
+
}
|
|
47
|
+
// Toggle motion reduction
|
|
48
|
+
toggle() {
|
|
49
|
+
if (this.isReducedMotion) {
|
|
50
|
+
this.disable();
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
this.enable();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// Check if motion reduction is enabled
|
|
57
|
+
isMotionReduced() {
|
|
58
|
+
return this.isReducedMotion;
|
|
59
|
+
}
|
|
60
|
+
// Set specific motion reduction preferences
|
|
61
|
+
setPreferences(preferences) {
|
|
62
|
+
if (preferences.reduceAnimation !== undefined) {
|
|
63
|
+
this.isReducedAnimation = preferences.reduceAnimation;
|
|
64
|
+
}
|
|
65
|
+
if (preferences.reduceTransition !== undefined) {
|
|
66
|
+
this.isReducedTransition = preferences.reduceTransition;
|
|
67
|
+
}
|
|
68
|
+
if (preferences.reduceTransform !== undefined) {
|
|
69
|
+
this.isReducedTransform = preferences.reduceTransform;
|
|
70
|
+
}
|
|
71
|
+
this.savePreferences();
|
|
54
72
|
this.applyMotionReduction();
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
isMotionReduced(): boolean {
|
|
94
|
-
return this.isReducedMotion;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// Set specific motion reduction preferences
|
|
98
|
-
setPreferences(preferences: {
|
|
99
|
-
reduceAnimation?: boolean;
|
|
100
|
-
reduceTransition?: boolean;
|
|
101
|
-
reduceTransform?: boolean;
|
|
102
|
-
}): void {
|
|
103
|
-
if (preferences.reduceAnimation !== undefined) {
|
|
104
|
-
this.isReducedAnimation = preferences.reduceAnimation;
|
|
105
|
-
}
|
|
106
|
-
if (preferences.reduceTransition !== undefined) {
|
|
107
|
-
this.isReducedTransition = preferences.reduceTransition;
|
|
108
|
-
}
|
|
109
|
-
if (preferences.reduceTransform !== undefined) {
|
|
110
|
-
this.isReducedTransform = preferences.reduceTransform;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
this.savePreferences();
|
|
114
|
-
this.applyMotionReduction();
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// Get current motion reduction preferences
|
|
118
|
-
getPreferences(): {
|
|
119
|
-
reduceMotion: boolean;
|
|
120
|
-
reduceAnimation: boolean;
|
|
121
|
-
reduceTransition: boolean;
|
|
122
|
-
reduceTransform: boolean;
|
|
123
|
-
} {
|
|
124
|
-
return {
|
|
125
|
-
reduceMotion: this.isReducedMotion,
|
|
126
|
-
reduceAnimation: this.isReducedAnimation,
|
|
127
|
-
reduceTransition: this.isReducedTransition,
|
|
128
|
-
reduceTransform: this.isReducedTransform
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// Apply motion reduction to the document
|
|
133
|
-
applyMotionReduction(): void {
|
|
134
|
-
if (!this.isReducedMotion) return;
|
|
135
|
-
|
|
136
|
-
// Add reduced motion class to document
|
|
137
|
-
document.documentElement.classList.add('reduced-motion');
|
|
138
|
-
|
|
73
|
+
}
|
|
74
|
+
// Get current motion reduction preferences
|
|
75
|
+
getPreferences() {
|
|
76
|
+
return {
|
|
77
|
+
reduceMotion: this.isReducedMotion,
|
|
78
|
+
reduceAnimation: this.isReducedAnimation,
|
|
79
|
+
reduceTransition: this.isReducedTransition,
|
|
80
|
+
reduceTransform: this.isReducedTransform
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
// Apply motion reduction to the document
|
|
84
|
+
applyMotionReduction() {
|
|
85
|
+
if (!this.isReducedMotion)
|
|
86
|
+
return;
|
|
87
|
+
// Add reduced motion class to document
|
|
88
|
+
document.documentElement.classList.add('reduced-motion');
|
|
89
|
+
// Apply reduced motion styles
|
|
90
|
+
this.applyReducedMotionStyles();
|
|
91
|
+
// Process existing elements
|
|
92
|
+
this.processExistingElements();
|
|
93
|
+
// Announce motion reduction change
|
|
94
|
+
if (screenReaderOptimizer) {
|
|
95
|
+
screenReaderOptimizer.announceMotionChange(true);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// Remove motion reduction from the document
|
|
99
|
+
removeMotionReduction() {
|
|
100
|
+
// Remove reduced motion class
|
|
101
|
+
document.documentElement.classList.remove('reduced-motion');
|
|
102
|
+
// Remove reduced motion styles
|
|
103
|
+
this.removeReducedMotionStyles();
|
|
104
|
+
// Restore original styles
|
|
105
|
+
this.restoreOriginalStyles();
|
|
106
|
+
// Announce motion reduction change
|
|
107
|
+
if (screenReaderOptimizer) {
|
|
108
|
+
screenReaderOptimizer.announceMotionChange(false);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
139
111
|
// Apply reduced motion styles
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
// Announce motion reduction change
|
|
146
|
-
if (screenReaderOptimizer) {
|
|
147
|
-
screenReaderOptimizer.announceMotionChange(true);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// Remove motion reduction from the document
|
|
152
|
-
removeMotionReduction(): void {
|
|
153
|
-
// Remove reduced motion class
|
|
154
|
-
document.documentElement.classList.remove('reduced-motion');
|
|
155
|
-
|
|
156
|
-
// Remove reduced motion styles
|
|
157
|
-
this.removeReducedMotionStyles();
|
|
158
|
-
|
|
159
|
-
// Restore original styles
|
|
160
|
-
this.restoreOriginalStyles();
|
|
161
|
-
|
|
162
|
-
// Announce motion reduction change
|
|
163
|
-
if (screenReaderOptimizer) {
|
|
164
|
-
screenReaderOptimizer.announceMotionChange(false);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// Apply reduced motion styles
|
|
169
|
-
private applyReducedMotionStyles(): void {
|
|
170
|
-
const style = document.createElement('style');
|
|
171
|
-
style.id = 'reduced-motion-styles';
|
|
172
|
-
|
|
173
|
-
style.textContent = `
|
|
112
|
+
applyReducedMotionStyles() {
|
|
113
|
+
const style = document.createElement('style');
|
|
114
|
+
style.id = 'reduced-motion-styles';
|
|
115
|
+
style.textContent = `
|
|
174
116
|
.reduced-motion,
|
|
175
117
|
.reduced-motion * {
|
|
176
118
|
/* Disable animations */
|
|
@@ -224,439 +166,340 @@ export class MotionReductionManager {
|
|
|
224
166
|
scroll-behavior: auto !important;
|
|
225
167
|
}
|
|
226
168
|
`;
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
//
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
169
|
+
document.head.appendChild(style);
|
|
170
|
+
}
|
|
171
|
+
// Remove reduced motion styles
|
|
172
|
+
removeReducedMotionStyles() {
|
|
173
|
+
const style = document.getElementById('reduced-motion-styles');
|
|
174
|
+
if (style) {
|
|
175
|
+
style.remove();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
// Process existing elements
|
|
179
|
+
processExistingElements() {
|
|
180
|
+
// Process elements with animations
|
|
181
|
+
const animatedElements = document.querySelectorAll('[class*="animate"], [class*="transition"], [class*="transform"]');
|
|
182
|
+
animatedElements.forEach(element => {
|
|
183
|
+
this.processElement(element);
|
|
184
|
+
});
|
|
185
|
+
// Process elements with data attributes
|
|
186
|
+
const motionElements = document.querySelectorAll('[data-motion], [data-animation], [data-transition]');
|
|
187
|
+
motionElements.forEach(element => {
|
|
188
|
+
this.processElement(element);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
// Process individual element
|
|
192
|
+
processElement(element) {
|
|
193
|
+
// Store original styles if not already stored
|
|
194
|
+
if (!this.originalStyles.has(element)) {
|
|
195
|
+
this.originalStyles.set(element, element.style.cssText);
|
|
196
|
+
}
|
|
197
|
+
// Apply reduced motion styles
|
|
198
|
+
const reducedStyles = this.getReducedMotionStyles(element);
|
|
199
|
+
element.style.cssText = reducedStyles;
|
|
200
|
+
// Store reduced styles
|
|
201
|
+
this.reducedMotionStyles.set(element, reducedStyles);
|
|
202
|
+
}
|
|
203
|
+
// Get reduced motion styles for element
|
|
204
|
+
getReducedMotionStyles(element) {
|
|
205
|
+
const originalStyles = element.style.cssText;
|
|
206
|
+
let reducedStyles = originalStyles;
|
|
207
|
+
// Remove animation properties
|
|
208
|
+
if (this.isReducedAnimation) {
|
|
209
|
+
reducedStyles = reducedStyles.replace(/animation[^;]*;?/g, '');
|
|
210
|
+
reducedStyles += 'animation: none !important;';
|
|
211
|
+
}
|
|
212
|
+
// Remove transition properties
|
|
213
|
+
if (this.isReducedTransition) {
|
|
214
|
+
reducedStyles = reducedStyles.replace(/transition[^;]*;?/g, '');
|
|
215
|
+
reducedStyles += 'transition: none !important;';
|
|
216
|
+
}
|
|
217
|
+
// Remove transform properties
|
|
218
|
+
if (this.isReducedTransform) {
|
|
219
|
+
reducedStyles = reducedStyles.replace(/transform[^;]*;?/g, '');
|
|
220
|
+
reducedStyles += 'transform: none !important;';
|
|
221
|
+
}
|
|
222
|
+
return reducedStyles;
|
|
223
|
+
}
|
|
224
|
+
// Restore original styles
|
|
225
|
+
restoreOriginalStyles() {
|
|
226
|
+
this.originalStyles.forEach((originalStyle, element) => {
|
|
227
|
+
if (element && element.offsetParent !== null) {
|
|
228
|
+
element.style.cssText = originalStyle;
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
this.originalStyles.clear();
|
|
232
|
+
this.reducedMotionStyles.clear();
|
|
233
|
+
}
|
|
234
|
+
// Save preferences to localStorage
|
|
235
|
+
savePreferences() {
|
|
236
|
+
if (typeof window !== 'undefined' && window.localStorage) {
|
|
237
|
+
const preferences = {
|
|
238
|
+
reduceAnimation: this.isReducedAnimation,
|
|
239
|
+
reduceTransition: this.isReducedTransition,
|
|
240
|
+
reduceTransform: this.isReducedTransform,
|
|
241
|
+
timestamp: Date.now()
|
|
242
|
+
};
|
|
243
|
+
window.localStorage.setItem('motion-reduction-preferences', JSON.stringify(preferences));
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
// Load preferences from localStorage
|
|
247
|
+
loadPreferences() {
|
|
248
|
+
if (typeof window !== 'undefined' && window.localStorage) {
|
|
249
|
+
try {
|
|
250
|
+
const stored = window.localStorage.getItem('motion-reduction-preferences');
|
|
251
|
+
if (stored) {
|
|
252
|
+
const preferences = JSON.parse(stored);
|
|
253
|
+
this.isReducedAnimation = preferences.reduceAnimation || false;
|
|
254
|
+
this.isReducedTransition = preferences.reduceTransition || false;
|
|
255
|
+
this.isReducedTransform = preferences.reduceTransform || false;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
catch (error) {
|
|
259
|
+
console.warn('Failed to load motion reduction preferences:', error);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
// Check if element should have motion reduced
|
|
264
|
+
shouldReduceMotion(element) {
|
|
265
|
+
if (!this.isReducedMotion)
|
|
266
|
+
return false;
|
|
267
|
+
// Check for motion-safe override
|
|
268
|
+
if (element.classList.contains('motion-safe') || element.getAttribute('data-motion-safe') === 'true') {
|
|
269
|
+
return false;
|
|
270
|
+
}
|
|
271
|
+
// Check for motion-reduce override
|
|
272
|
+
if (element.classList.contains('motion-reduce') || element.getAttribute('data-motion-reduce') === 'true') {
|
|
273
|
+
return true;
|
|
274
|
+
}
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
// Get appropriate duration for element
|
|
278
|
+
getDuration(element, defaultDuration, type) {
|
|
279
|
+
if (!this.shouldReduceMotion(element)) {
|
|
280
|
+
return defaultDuration;
|
|
281
|
+
}
|
|
282
|
+
// Parse duration
|
|
283
|
+
const duration = parseFloat(defaultDuration);
|
|
284
|
+
const unit = defaultDuration.replace(/[\d.]/g, '');
|
|
285
|
+
if (type === 'animation') {
|
|
286
|
+
return this.isReducedAnimation ? '0.01ms' : `${Math.min(duration * 0.1, 50)}${unit}`;
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
return this.isReducedTransition ? '0.01ms' : `${Math.min(duration * 0.1, 50)}${unit}`;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
// Get appropriate easing for element
|
|
293
|
+
getEasing(element, defaultEasing) {
|
|
294
|
+
if (!this.shouldReduceMotion(element)) {
|
|
295
|
+
return defaultEasing;
|
|
296
|
+
}
|
|
297
|
+
// Use linear easing for reduced motion
|
|
298
|
+
return 'linear';
|
|
299
|
+
}
|
|
300
|
+
// Create motion-safe wrapper
|
|
301
|
+
createMotionSafeWrapper(element, callback) {
|
|
302
|
+
if (!this.shouldReduceMotion(element)) {
|
|
303
|
+
callback();
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
// Execute callback without motion
|
|
307
|
+
const originalReducedMotion = this.isReducedMotion;
|
|
308
|
+
this.isReducedMotion = false;
|
|
309
|
+
try {
|
|
310
|
+
callback();
|
|
311
|
+
}
|
|
312
|
+
finally {
|
|
313
|
+
this.isReducedMotion = originalReducedMotion;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
// Animate element with motion reduction awareness
|
|
317
|
+
animateElement(element, keyframes, options) {
|
|
318
|
+
if (this.shouldReduceMotion(element)) {
|
|
319
|
+
// Apply reduced motion options
|
|
320
|
+
const reducedOptions = {
|
|
321
|
+
...options,
|
|
322
|
+
duration: Math.min(typeof options.duration === 'number' ? options.duration : 300, 50),
|
|
323
|
+
easing: 'linear'
|
|
324
|
+
};
|
|
325
|
+
return element.animate(keyframes, reducedOptions);
|
|
326
|
+
}
|
|
327
|
+
return element.animate(keyframes, options);
|
|
328
|
+
}
|
|
329
|
+
// Add motion reduction observer
|
|
330
|
+
addMotionReductionObserver(callback) {
|
|
331
|
+
const observer = new MutationObserver(() => {
|
|
332
|
+
callback(this.isReducedMotion);
|
|
333
|
+
});
|
|
334
|
+
observer.observe(document.documentElement, {
|
|
335
|
+
attributes: true,
|
|
336
|
+
attributeFilter: ['class']
|
|
337
|
+
});
|
|
338
|
+
// Return cleanup function
|
|
339
|
+
return () => observer.disconnect();
|
|
340
|
+
}
|
|
341
|
+
// Get motion reduction statistics
|
|
342
|
+
getStatistics() {
|
|
343
|
+
const totalElements = document.querySelectorAll('*').length;
|
|
344
|
+
const reducedElements = document.querySelectorAll('.reduced-motion *').length;
|
|
345
|
+
const safeElements = document.querySelectorAll('.motion-safe, [data-motion-safe="true"]').length;
|
|
346
|
+
return {
|
|
347
|
+
totalElements,
|
|
348
|
+
reducedElements,
|
|
349
|
+
safeElements,
|
|
350
|
+
preferences: this.getPreferences()
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
// Reset all motion reduction settings
|
|
354
|
+
reset() {
|
|
355
|
+
this.isReducedMotion = false;
|
|
356
|
+
this.isReducedAnimation = false;
|
|
357
|
+
this.isReducedTransition = false;
|
|
358
|
+
this.isReducedTransform = false;
|
|
359
|
+
this.removeMotionReduction();
|
|
360
|
+
this.clearPreferences();
|
|
361
|
+
}
|
|
362
|
+
// Clear stored preferences
|
|
363
|
+
clearPreferences() {
|
|
364
|
+
if (typeof window !== 'undefined' && window.localStorage) {
|
|
365
|
+
window.localStorage.removeItem('motion-reduction-preferences');
|
|
366
|
+
}
|
|
367
|
+
this.originalStyles.clear();
|
|
368
|
+
this.reducedMotionStyles.clear();
|
|
369
|
+
}
|
|
370
|
+
// Destroy motion reduction manager
|
|
371
|
+
destroy() {
|
|
372
|
+
this.removeMotionReduction();
|
|
373
|
+
this.clearPreferences();
|
|
374
|
+
// Remove event listeners
|
|
375
|
+
if (typeof window !== 'undefined') {
|
|
376
|
+
window.removeEventListener('storage', this.loadPreferences.bind(this));
|
|
377
|
+
}
|
|
337
378
|
}
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
// Check if element should have motion reduced
|
|
341
|
-
shouldReduceMotion(element: HTMLElement): boolean {
|
|
342
|
-
if (!this.isReducedMotion) return false;
|
|
343
|
-
|
|
344
|
-
// Check for motion-safe override
|
|
345
|
-
if (element.classList.contains('motion-safe') || element.getAttribute('data-motion-safe') === 'true') {
|
|
346
|
-
return false;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
// Check for motion-reduce override
|
|
350
|
-
if (element.classList.contains('motion-reduce') || element.getAttribute('data-motion-reduce') === 'true') {
|
|
351
|
-
return true;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
return true;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
// Get appropriate duration for element
|
|
358
|
-
getDuration(element: HTMLElement, defaultDuration: string, type: 'animation' | 'transition'): string {
|
|
359
|
-
if (!this.shouldReduceMotion(element)) {
|
|
360
|
-
return defaultDuration;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
// Parse duration
|
|
364
|
-
const duration = parseFloat(defaultDuration);
|
|
365
|
-
const unit = defaultDuration.replace(/[\d.]/g, '');
|
|
366
|
-
|
|
367
|
-
if (type === 'animation') {
|
|
368
|
-
return this.isReducedAnimation ? '0.01ms' : `${Math.min(duration * 0.1, 50)}${unit}`;
|
|
369
|
-
} else {
|
|
370
|
-
return this.isReducedTransition ? '0.01ms' : `${Math.min(duration * 0.1, 50)}${unit}`;
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
// Get appropriate easing for element
|
|
375
|
-
getEasing(element: HTMLElement, defaultEasing: string): string {
|
|
376
|
-
if (!this.shouldReduceMotion(element)) {
|
|
377
|
-
return defaultEasing;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
// Use linear easing for reduced motion
|
|
381
|
-
return 'linear';
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
// Create motion-safe wrapper
|
|
385
|
-
createMotionSafeWrapper(element: HTMLElement, callback: () => void): void {
|
|
386
|
-
if (!this.shouldReduceMotion(element)) {
|
|
387
|
-
callback();
|
|
388
|
-
return;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
// Execute callback without motion
|
|
392
|
-
const originalReducedMotion = this.isReducedMotion;
|
|
393
|
-
this.isReducedMotion = false;
|
|
394
|
-
|
|
395
|
-
try {
|
|
396
|
-
callback();
|
|
397
|
-
} finally {
|
|
398
|
-
this.isReducedMotion = originalReducedMotion;
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
// Animate element with motion reduction awareness
|
|
403
|
-
animateElement(
|
|
404
|
-
element: HTMLElement,
|
|
405
|
-
keyframes: Keyframe[],
|
|
406
|
-
options: KeyframeAnimationOptions
|
|
407
|
-
): Animation {
|
|
408
|
-
if (this.shouldReduceMotion(element)) {
|
|
409
|
-
// Apply reduced motion options
|
|
410
|
-
const reducedOptions = {
|
|
411
|
-
...options,
|
|
412
|
-
duration: Math.min(typeof options.duration === 'number' ? options.duration : 300, 50),
|
|
413
|
-
easing: 'linear'
|
|
414
|
-
};
|
|
415
|
-
|
|
416
|
-
return element.animate(keyframes, reducedOptions);
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
return element.animate(keyframes, options);
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
// Add motion reduction observer
|
|
423
|
-
addMotionReductionObserver(callback: (isReduced: boolean) => void): () => void {
|
|
424
|
-
const observer = new MutationObserver(() => {
|
|
425
|
-
callback(this.isReducedMotion);
|
|
426
|
-
});
|
|
427
|
-
|
|
428
|
-
observer.observe(document.documentElement, {
|
|
429
|
-
attributes: true,
|
|
430
|
-
attributeFilter: ['class']
|
|
431
|
-
});
|
|
432
|
-
|
|
433
|
-
// Return cleanup function
|
|
434
|
-
return () => observer.disconnect();
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
// Get motion reduction statistics
|
|
438
|
-
getStatistics(): {
|
|
439
|
-
totalElements: number;
|
|
440
|
-
reducedElements: number;
|
|
441
|
-
safeElements: number;
|
|
442
|
-
preferences: {
|
|
443
|
-
reduceMotion: boolean;
|
|
444
|
-
reduceAnimation: boolean;
|
|
445
|
-
reduceTransition: boolean;
|
|
446
|
-
reduceTransform: boolean;
|
|
447
|
-
};
|
|
448
|
-
} {
|
|
449
|
-
const totalElements = document.querySelectorAll('*').length;
|
|
450
|
-
const reducedElements = document.querySelectorAll('.reduced-motion *').length;
|
|
451
|
-
const safeElements = document.querySelectorAll('.motion-safe, [data-motion-safe="true"]').length;
|
|
452
|
-
|
|
453
|
-
return {
|
|
454
|
-
totalElements,
|
|
455
|
-
reducedElements,
|
|
456
|
-
safeElements,
|
|
457
|
-
preferences: this.getPreferences()
|
|
458
|
-
};
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
// Reset all motion reduction settings
|
|
462
|
-
reset(): void {
|
|
463
|
-
this.isReducedMotion = false;
|
|
464
|
-
this.isReducedAnimation = false;
|
|
465
|
-
this.isReducedTransition = false;
|
|
466
|
-
this.isReducedTransform = false;
|
|
467
|
-
|
|
468
|
-
this.removeMotionReduction();
|
|
469
|
-
this.clearPreferences();
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
// Clear stored preferences
|
|
473
|
-
private clearPreferences(): void {
|
|
474
|
-
if (typeof window !== 'undefined' && window.localStorage) {
|
|
475
|
-
window.localStorage.removeItem('motion-reduction-preferences');
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
this.originalStyles.clear();
|
|
479
|
-
this.reducedMotionStyles.clear();
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
// Destroy motion reduction manager
|
|
483
|
-
destroy(): void {
|
|
484
|
-
this.removeMotionReduction();
|
|
485
|
-
this.clearPreferences();
|
|
486
|
-
|
|
487
|
-
// Remove event listeners
|
|
488
|
-
if (typeof window !== 'undefined') {
|
|
489
|
-
window.removeEventListener('storage', this.loadPreferences.bind(this));
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
379
|
}
|
|
493
|
-
|
|
494
380
|
// Motion reduction utilities
|
|
495
381
|
export class MotionReductionUtils {
|
|
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
|
-
static hasMotion(element: HTMLElement): boolean {
|
|
584
|
-
const computedStyle = window.getComputedStyle(element);
|
|
585
|
-
|
|
586
|
-
return (
|
|
587
|
-
computedStyle.animation !== 'none' ||
|
|
588
|
-
computedStyle.transition !== 'all 0s ease 0s' ||
|
|
589
|
-
computedStyle.transform !== 'none'
|
|
590
|
-
);
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
// Get motion information for element
|
|
594
|
-
static getMotionInfo(element: HTMLElement): {
|
|
595
|
-
hasAnimation: boolean;
|
|
596
|
-
hasTransition: boolean;
|
|
597
|
-
hasTransform: boolean;
|
|
598
|
-
animationDuration: string;
|
|
599
|
-
transitionDuration: string;
|
|
600
|
-
transform: string;
|
|
601
|
-
} {
|
|
602
|
-
const computedStyle = window.getComputedStyle(element);
|
|
603
|
-
|
|
604
|
-
return {
|
|
605
|
-
hasAnimation: computedStyle.animation !== 'none',
|
|
606
|
-
hasTransition: computedStyle.transition !== 'all 0s ease 0s',
|
|
607
|
-
hasTransform: computedStyle.transform !== 'none',
|
|
608
|
-
animationDuration: computedStyle.animationDuration,
|
|
609
|
-
transitionDuration: computedStyle.transitionDuration,
|
|
610
|
-
transform: computedStyle.transform
|
|
611
|
-
};
|
|
612
|
-
}
|
|
382
|
+
// Check if motion should be reduced for element
|
|
383
|
+
static shouldReduceMotion(element) {
|
|
384
|
+
// Check system preference
|
|
385
|
+
if (typeof window !== 'undefined' && window.matchMedia) {
|
|
386
|
+
const reducedMotionQuery = window.matchMedia('(prefers-reduced-motion: reduce)');
|
|
387
|
+
if (reducedMotionQuery.matches)
|
|
388
|
+
return true;
|
|
389
|
+
}
|
|
390
|
+
// Check element attributes
|
|
391
|
+
if (element.classList.contains('motion-reduce') || element.getAttribute('data-motion-reduce') === 'true') {
|
|
392
|
+
return true;
|
|
393
|
+
}
|
|
394
|
+
// Check parent elements
|
|
395
|
+
const parent = element.closest('.motion-reduce, [data-motion-reduce="true"]');
|
|
396
|
+
if (parent)
|
|
397
|
+
return true;
|
|
398
|
+
return false;
|
|
399
|
+
}
|
|
400
|
+
// Get reduced duration
|
|
401
|
+
static getReducedDuration(duration, reductionFactor = 0.1) {
|
|
402
|
+
const parsed = parseFloat(duration);
|
|
403
|
+
const unit = duration.replace(/[\d.]/g, '');
|
|
404
|
+
return `${Math.max(parsed * reductionFactor, 1)}${unit}`;
|
|
405
|
+
}
|
|
406
|
+
// Get reduced easing
|
|
407
|
+
static getReducedEasing(_easing) {
|
|
408
|
+
return 'linear';
|
|
409
|
+
}
|
|
410
|
+
// Create motion-safe animation
|
|
411
|
+
static createMotionSafeAnimation(element, keyframes, options) {
|
|
412
|
+
if (this.shouldReduceMotion(element)) {
|
|
413
|
+
// Return null to indicate no animation should be performed
|
|
414
|
+
return null;
|
|
415
|
+
}
|
|
416
|
+
return element.animate(keyframes, options);
|
|
417
|
+
}
|
|
418
|
+
// Apply motion reduction to CSS custom properties
|
|
419
|
+
static applyMotionReductionToCSS(element) {
|
|
420
|
+
if (!this.shouldReduceMotion(element))
|
|
421
|
+
return;
|
|
422
|
+
const style = element.style;
|
|
423
|
+
// Reduce animation duration
|
|
424
|
+
if (style.getPropertyValue('--animation-duration')) {
|
|
425
|
+
const duration = style.getPropertyValue('--animation-duration');
|
|
426
|
+
style.setProperty('--animation-duration', this.getReducedDuration(duration));
|
|
427
|
+
}
|
|
428
|
+
// Reduce transition duration
|
|
429
|
+
if (style.getPropertyValue('--transition-duration')) {
|
|
430
|
+
const duration = style.getPropertyValue('--transition-duration');
|
|
431
|
+
style.setProperty('--transition-duration', this.getReducedDuration(duration));
|
|
432
|
+
}
|
|
433
|
+
// Set easing to linear
|
|
434
|
+
if (style.getPropertyValue('--animation-easing')) {
|
|
435
|
+
style.setProperty('--animation-easing', 'linear');
|
|
436
|
+
}
|
|
437
|
+
if (style.getPropertyValue('--transition-easing')) {
|
|
438
|
+
style.setProperty('--transition-easing', 'linear');
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
// Remove motion reduction from CSS custom properties
|
|
442
|
+
static removeMotionReductionFromCSS(element) {
|
|
443
|
+
const style = element.style;
|
|
444
|
+
// Remove custom properties
|
|
445
|
+
style.removeProperty('--animation-duration');
|
|
446
|
+
style.removeProperty('--transition-duration');
|
|
447
|
+
style.removeProperty('--animation-easing');
|
|
448
|
+
style.removeProperty('--transition-easing');
|
|
449
|
+
}
|
|
450
|
+
// Check if element has motion
|
|
451
|
+
static hasMotion(element) {
|
|
452
|
+
const computedStyle = window.getComputedStyle(element);
|
|
453
|
+
return (computedStyle.animation !== 'none' ||
|
|
454
|
+
computedStyle.transition !== 'all 0s ease 0s' ||
|
|
455
|
+
computedStyle.transform !== 'none');
|
|
456
|
+
}
|
|
457
|
+
// Get motion information for element
|
|
458
|
+
static getMotionInfo(element) {
|
|
459
|
+
const computedStyle = window.getComputedStyle(element);
|
|
460
|
+
return {
|
|
461
|
+
hasAnimation: computedStyle.animation !== 'none',
|
|
462
|
+
hasTransition: computedStyle.transition !== 'all 0s ease 0s',
|
|
463
|
+
hasTransform: computedStyle.transform !== 'none',
|
|
464
|
+
animationDuration: computedStyle.animationDuration,
|
|
465
|
+
transitionDuration: computedStyle.transitionDuration,
|
|
466
|
+
transform: computedStyle.transform
|
|
467
|
+
};
|
|
468
|
+
}
|
|
613
469
|
}
|
|
614
|
-
|
|
615
470
|
// Motion reduction hooks for React
|
|
616
471
|
export class MotionReductionHooks {
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
static useMotionSafeDuration(defaultDuration: string, _type: 'animation' | 'transition'): string {
|
|
642
|
-
// This would be implemented in a React component
|
|
643
|
-
return defaultDuration;
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
// Get motion-safe easing
|
|
647
|
-
static useMotionSafeEasing(defaultEasing: string): string {
|
|
648
|
-
// This would be implemented in a React component
|
|
649
|
-
return defaultEasing;
|
|
650
|
-
}
|
|
472
|
+
// Get motion reduction state
|
|
473
|
+
static useMotionReduction() {
|
|
474
|
+
// This would be implemented in a React component
|
|
475
|
+
// For now, return a mock implementation
|
|
476
|
+
return {
|
|
477
|
+
isReduced: false,
|
|
478
|
+
preferences: {
|
|
479
|
+
reduceAnimation: false,
|
|
480
|
+
reduceTransition: false,
|
|
481
|
+
reduceTransform: false
|
|
482
|
+
},
|
|
483
|
+
shouldReduceMotion: () => false
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
// Get motion-safe duration
|
|
487
|
+
static useMotionSafeDuration(defaultDuration, _type) {
|
|
488
|
+
// This would be implemented in a React component
|
|
489
|
+
return defaultDuration;
|
|
490
|
+
}
|
|
491
|
+
// Get motion-safe easing
|
|
492
|
+
static useMotionSafeEasing(defaultEasing) {
|
|
493
|
+
// This would be implemented in a React component
|
|
494
|
+
return defaultEasing;
|
|
495
|
+
}
|
|
651
496
|
}
|
|
652
|
-
|
|
653
497
|
// Export default instances
|
|
654
498
|
export const motionReductionManager = new MotionReductionManager();
|
|
655
|
-
|
|
656
499
|
// Export default
|
|
657
500
|
export default {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
501
|
+
MotionReductionManager,
|
|
502
|
+
MotionReductionUtils,
|
|
503
|
+
MotionReductionHooks,
|
|
504
|
+
motionReductionManager
|
|
662
505
|
};
|