@procivis/one-react-native-components 0.1.63
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/LICENSE +201 -0
- package/README.md +66 -0
- package/lib/commonjs/accessibility/accessibility.js +193 -0
- package/lib/commonjs/accessibility/accessibility.js.map +1 -0
- package/lib/commonjs/accessibility/accessibilityHistory.js +81 -0
- package/lib/commonjs/accessibility/accessibilityHistory.js.map +1 -0
- package/lib/commonjs/accessibility/accessibilityHistoryWrappers.js +49 -0
- package/lib/commonjs/accessibility/accessibilityHistoryWrappers.js.map +1 -0
- package/lib/commonjs/accessibility/accessibilityLanguage.js +63 -0
- package/lib/commonjs/accessibility/accessibilityLanguage.js.map +1 -0
- package/lib/commonjs/accessibility/index.js +129 -0
- package/lib/commonjs/accessibility/index.js.map +1 -0
- package/lib/commonjs/accessibility/locale/de.json +21 -0
- package/lib/commonjs/accessibility/locale/en.json +21 -0
- package/lib/commonjs/accessibility/locale/fr.json +21 -0
- package/lib/commonjs/accessibility/locale/index.js +21 -0
- package/lib/commonjs/accessibility/locale/index.js.map +1 -0
- package/lib/commonjs/accessibility/locale/it.json +21 -0
- package/lib/commonjs/accessibility/locale.test.js +15 -0
- package/lib/commonjs/accessibility/locale.test.js.map +1 -0
- package/lib/commonjs/action-modal/ActionModal.js +52 -0
- package/lib/commonjs/action-modal/ActionModal.js.map +1 -0
- package/lib/commonjs/action-modal/index.js +14 -0
- package/lib/commonjs/action-modal/index.js.map +1 -0
- package/lib/commonjs/activity-indicator/activity-indicator.js +34 -0
- package/lib/commonjs/activity-indicator/activity-indicator.js.map +1 -0
- package/lib/commonjs/activity-indicator/index.js +14 -0
- package/lib/commonjs/activity-indicator/index.js.map +1 -0
- package/lib/commonjs/blur/blur-view.js +76 -0
- package/lib/commonjs/blur/blur-view.js.map +1 -0
- package/lib/commonjs/blur/index.js +21 -0
- package/lib/commonjs/blur/index.js.map +1 -0
- package/lib/commonjs/buttons/back-button.js +37 -0
- package/lib/commonjs/buttons/back-button.js.map +1 -0
- package/lib/commonjs/buttons/button.js +153 -0
- package/lib/commonjs/buttons/button.js.map +1 -0
- package/lib/commonjs/buttons/connectivity-button.js +82 -0
- package/lib/commonjs/buttons/connectivity-button.js.map +1 -0
- package/lib/commonjs/buttons/filter-button.js +51 -0
- package/lib/commonjs/buttons/filter-button.js.map +1 -0
- package/lib/commonjs/buttons/ghost-button.js +62 -0
- package/lib/commonjs/buttons/ghost-button.js.map +1 -0
- package/lib/commonjs/buttons/index.js +104 -0
- package/lib/commonjs/buttons/index.js.map +1 -0
- package/lib/commonjs/buttons/scan-button.js +83 -0
- package/lib/commonjs/buttons/scan-button.js.map +1 -0
- package/lib/commonjs/camera/camera-overlay.js +61 -0
- package/lib/commonjs/camera/camera-overlay.js.map +1 -0
- package/lib/commonjs/camera/index.js +21 -0
- package/lib/commonjs/camera/index.js.map +1 -0
- package/lib/commonjs/camera/qr-code-scanner.js +50 -0
- package/lib/commonjs/camera/qr-code-scanner.js.map +1 -0
- package/lib/commonjs/control/checkbox.js +79 -0
- package/lib/commonjs/control/checkbox.js.map +1 -0
- package/lib/commonjs/control/index.js +32 -0
- package/lib/commonjs/control/index.js.map +1 -0
- package/lib/commonjs/control/switch.js +65 -0
- package/lib/commonjs/control/switch.js.map +1 -0
- package/lib/commonjs/credential/card/credential-card.js +189 -0
- package/lib/commonjs/credential/card/credential-card.js.map +1 -0
- package/lib/commonjs/credential/card/credential-details-card.js +201 -0
- package/lib/commonjs/credential/card/credential-details-card.js.map +1 -0
- package/lib/commonjs/credential/card/credential-details-list-item.js +84 -0
- package/lib/commonjs/credential/card/credential-details-list-item.js.map +1 -0
- package/lib/commonjs/credential/card/credential-header.js +172 -0
- package/lib/commonjs/credential/card/credential-header.js.map +1 -0
- package/lib/commonjs/credential/card/credential-image-carousel.js +124 -0
- package/lib/commonjs/credential/card/credential-image-carousel.js.map +1 -0
- package/lib/commonjs/credential/card/index.js +85 -0
- package/lib/commonjs/credential/card/index.js.map +1 -0
- package/lib/commonjs/credential/credential-attribute-item.js +289 -0
- package/lib/commonjs/credential/credential-attribute-item.js.map +1 -0
- package/lib/commonjs/credential/credential-carousel-images.js +98 -0
- package/lib/commonjs/credential/credential-carousel-images.js.map +1 -0
- package/lib/commonjs/credential/index.js +90 -0
- package/lib/commonjs/credential/index.js.map +1 -0
- package/lib/commonjs/credential/selector-status.js +17 -0
- package/lib/commonjs/credential/selector-status.js.map +1 -0
- package/lib/commonjs/credential/selector.js +79 -0
- package/lib/commonjs/credential/selector.js.map +1 -0
- package/lib/commonjs/detail/detail.js +84 -0
- package/lib/commonjs/detail/detail.js.map +1 -0
- package/lib/commonjs/detail/index.js +14 -0
- package/lib/commonjs/detail/index.js.map +1 -0
- package/lib/commonjs/entity/avatar.js +96 -0
- package/lib/commonjs/entity/avatar.js.map +1 -0
- package/lib/commonjs/entity/entity-cluster.js +66 -0
- package/lib/commonjs/entity/entity-cluster.js.map +1 -0
- package/lib/commonjs/entity/index.js +34 -0
- package/lib/commonjs/entity/index.js.map +1 -0
- package/lib/commonjs/header/focus-aware-status-bar.js +20 -0
- package/lib/commonjs/header/focus-aware-status-bar.js.map +1 -0
- package/lib/commonjs/header/foldable-header.js +89 -0
- package/lib/commonjs/header/foldable-header.js.map +1 -0
- package/lib/commonjs/header/header.js +105 -0
- package/lib/commonjs/header/header.js.map +1 -0
- package/lib/commonjs/header/index.js +55 -0
- package/lib/commonjs/header/index.js.map +1 -0
- package/lib/commonjs/header/navigation-header.js +148 -0
- package/lib/commonjs/header/navigation-header.js.map +1 -0
- package/lib/commonjs/history/data-item.js +70 -0
- package/lib/commonjs/history/data-item.js.map +1 -0
- package/lib/commonjs/history/history-list-item.js +90 -0
- package/lib/commonjs/history/history-list-item.js.map +1 -0
- package/lib/commonjs/history/history-section-header.js +49 -0
- package/lib/commonjs/history/history-section-header.js.map +1 -0
- package/lib/commonjs/history/history-section-list-item.js +47 -0
- package/lib/commonjs/history/history-section-list-item.js.map +1 -0
- package/lib/commonjs/history/index.js +55 -0
- package/lib/commonjs/history/index.js.map +1 -0
- package/lib/commonjs/icons/connectivity.js +139 -0
- package/lib/commonjs/icons/connectivity.js.map +1 -0
- package/lib/commonjs/icons/credential.js +162 -0
- package/lib/commonjs/icons/credential.js.map +1 -0
- package/lib/commonjs/icons/entity.js +34 -0
- package/lib/commonjs/icons/entity.js.map +1 -0
- package/lib/commonjs/icons/history.js +408 -0
- package/lib/commonjs/icons/history.js.map +1 -0
- package/lib/commonjs/icons/icons.js +250 -0
- package/lib/commonjs/icons/icons.js.map +1 -0
- package/lib/commonjs/icons/index.js +127 -0
- package/lib/commonjs/icons/index.js.map +1 -0
- package/lib/commonjs/icons/input.js +44 -0
- package/lib/commonjs/icons/input.js.map +1 -0
- package/lib/commonjs/icons/keypad.js +94 -0
- package/lib/commonjs/icons/keypad.js.map +1 -0
- package/lib/commonjs/icons/loader.js +180 -0
- package/lib/commonjs/icons/loader.js.map +1 -0
- package/lib/commonjs/icons/nerd-view.js +123 -0
- package/lib/commonjs/icons/nerd-view.js.map +1 -0
- package/lib/commonjs/icons/selector.js +56 -0
- package/lib/commonjs/icons/selector.js.map +1 -0
- package/lib/commonjs/icons/wallet.js +121 -0
- package/lib/commonjs/icons/wallet.js.map +1 -0
- package/lib/commonjs/image/image-or-component.js +80 -0
- package/lib/commonjs/image/image-or-component.js.map +1 -0
- package/lib/commonjs/image/index.js +21 -0
- package/lib/commonjs/image/index.js.map +1 -0
- package/lib/commonjs/index.js +292 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/input/index.js +65 -0
- package/lib/commonjs/input/index.js.map +1 -0
- package/lib/commonjs/input/radio-group.js +95 -0
- package/lib/commonjs/input/radio-group.js.map +1 -0
- package/lib/commonjs/input/selection-input.js +102 -0
- package/lib/commonjs/input/selection-input.js.map +1 -0
- package/lib/commonjs/input/text-input.js +195 -0
- package/lib/commonjs/input/text-input.js.map +1 -0
- package/lib/commonjs/list/index.js +34 -0
- package/lib/commonjs/list/index.js.map +1 -0
- package/lib/commonjs/list/list-section-header.js +36 -0
- package/lib/commonjs/list/list-section-header.js.map +1 -0
- package/lib/commonjs/list/list-title-header.js +35 -0
- package/lib/commonjs/list/list-title-header.js.map +1 -0
- package/lib/commonjs/loader/index.js +40 -0
- package/lib/commonjs/loader/index.js.map +1 -0
- package/lib/commonjs/loader/loader.js +140 -0
- package/lib/commonjs/loader/loader.js.map +1 -0
- package/lib/commonjs/loader/loading-result.js +92 -0
- package/lib/commonjs/loader/loading-result.js.map +1 -0
- package/lib/commonjs/nerd-view/index.js +27 -0
- package/lib/commonjs/nerd-view/index.js.map +1 -0
- package/lib/commonjs/nerd-view/nerd-mode-item.js +235 -0
- package/lib/commonjs/nerd-view/nerd-mode-item.js.map +1 -0
- package/lib/commonjs/normalize-color.d.js +2 -0
- package/lib/commonjs/normalize-color.d.js.map +1 -0
- package/lib/commonjs/pin/index.js +32 -0
- package/lib/commonjs/pin/index.js.map +1 -0
- package/lib/commonjs/pin/keypad.js +201 -0
- package/lib/commonjs/pin/keypad.js.map +1 -0
- package/lib/commonjs/pin/pin-code-screen.js +162 -0
- package/lib/commonjs/pin/pin-code-screen.js.map +1 -0
- package/lib/commonjs/pin/pins.js +54 -0
- package/lib/commonjs/pin/pins.js.map +1 -0
- package/lib/commonjs/screens/backup-screen.js +87 -0
- package/lib/commonjs/screens/backup-screen.js.map +1 -0
- package/lib/commonjs/screens/image-preview-screen.js +92 -0
- package/lib/commonjs/screens/image-preview-screen.js.map +1 -0
- package/lib/commonjs/screens/index.js +98 -0
- package/lib/commonjs/screens/index.js.map +1 -0
- package/lib/commonjs/screens/nerd-mode-screen.js +142 -0
- package/lib/commonjs/screens/nerd-mode-screen.js.map +1 -0
- package/lib/commonjs/screens/qr-code-scanner-screen.js +120 -0
- package/lib/commonjs/screens/qr-code-scanner-screen.js.map +1 -0
- package/lib/commonjs/screens/scroll-view-screen.js +94 -0
- package/lib/commonjs/screens/scroll-view-screen.js.map +1 -0
- package/lib/commonjs/screens/section-list-screen.js +67 -0
- package/lib/commonjs/screens/section-list-screen.js.map +1 -0
- package/lib/commonjs/searchbar/animated-search-bar.js +88 -0
- package/lib/commonjs/searchbar/animated-search-bar.js.map +1 -0
- package/lib/commonjs/searchbar/index.js +34 -0
- package/lib/commonjs/searchbar/index.js.map +1 -0
- package/lib/commonjs/searchbar/search-bar.js +99 -0
- package/lib/commonjs/searchbar/search-bar.js.map +1 -0
- package/lib/commonjs/settings/button-setting.js +67 -0
- package/lib/commonjs/settings/button-setting.js.map +1 -0
- package/lib/commonjs/settings/index.js +73 -0
- package/lib/commonjs/settings/index.js.map +1 -0
- package/lib/commonjs/settings/setting-item-separator.js +40 -0
- package/lib/commonjs/settings/setting-item-separator.js.map +1 -0
- package/lib/commonjs/settings/setting-item.js +79 -0
- package/lib/commonjs/settings/setting-item.js.map +1 -0
- package/lib/commonjs/settings/settings-button.js +35 -0
- package/lib/commonjs/settings/settings-button.js.map +1 -0
- package/lib/commonjs/settings/switch-setting.js +35 -0
- package/lib/commonjs/settings/switch-setting.js.map +1 -0
- package/lib/commonjs/state/error-screen.js +71 -0
- package/lib/commonjs/state/error-screen.js.map +1 -0
- package/lib/commonjs/state/index.js +27 -0
- package/lib/commonjs/state/index.js.map +1 -0
- package/lib/commonjs/text/base.js +40 -0
- package/lib/commonjs/text/base.js.map +1 -0
- package/lib/commonjs/text/font.js +64 -0
- package/lib/commonjs/text/font.js.map +1 -0
- package/lib/commonjs/text/index.js +21 -0
- package/lib/commonjs/text/index.js.map +1 -0
- package/lib/commonjs/text/typography.js +119 -0
- package/lib/commonjs/text/typography.js.map +1 -0
- package/lib/commonjs/theme/color-scheme-context.js +52 -0
- package/lib/commonjs/theme/color-scheme-context.js.map +1 -0
- package/lib/commonjs/theme/color-scheme.js +2 -0
- package/lib/commonjs/theme/color-scheme.js.map +1 -0
- package/lib/commonjs/theme/index.js +19 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/utils/color.js +34 -0
- package/lib/commonjs/utils/color.js.map +1 -0
- package/lib/commonjs/utils/contrasting-status-bar.js +30 -0
- package/lib/commonjs/utils/contrasting-status-bar.js.map +1 -0
- package/lib/commonjs/utils/date.js +57 -0
- package/lib/commonjs/utils/date.js.map +1 -0
- package/lib/commonjs/utils/hooks/header/on-scroll-header-state.js +21 -0
- package/lib/commonjs/utils/hooks/header/on-scroll-header-state.js.map +1 -0
- package/lib/commonjs/utils/hooks/index.js +20 -0
- package/lib/commonjs/utils/hooks/index.js.map +1 -0
- package/lib/commonjs/utils/hooks/list/list-content-inset.js +31 -0
- package/lib/commonjs/utils/hooks/list/list-content-inset.js.map +1 -0
- package/lib/commonjs/utils/index.js +83 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/commonjs/utils/navigation.js +51 -0
- package/lib/commonjs/utils/navigation.js.map +1 -0
- package/lib/commonjs/utils/ref.js +42 -0
- package/lib/commonjs/utils/ref.js.map +1 -0
- package/lib/commonjs/utils/testID.js +18 -0
- package/lib/commonjs/utils/testID.js.map +1 -0
- package/lib/commonjs/utils/testID.test.js +21 -0
- package/lib/commonjs/utils/testID.test.js.map +1 -0
- package/lib/commonjs/utils/useMemoAsync.js +26 -0
- package/lib/commonjs/utils/useMemoAsync.js.map +1 -0
- package/lib/module/accessibility/accessibility.js +185 -0
- package/lib/module/accessibility/accessibility.js.map +1 -0
- package/lib/module/accessibility/accessibilityHistory.js +71 -0
- package/lib/module/accessibility/accessibilityHistory.js.map +1 -0
- package/lib/module/accessibility/accessibilityHistoryWrappers.js +38 -0
- package/lib/module/accessibility/accessibilityHistoryWrappers.js.map +1 -0
- package/lib/module/accessibility/accessibilityLanguage.js +53 -0
- package/lib/module/accessibility/accessibilityLanguage.js.map +1 -0
- package/lib/module/accessibility/index.js +8 -0
- package/lib/module/accessibility/index.js.map +1 -0
- package/lib/module/accessibility/locale/de.json +21 -0
- package/lib/module/accessibility/locale/en.json +21 -0
- package/lib/module/accessibility/locale/fr.json +21 -0
- package/lib/module/accessibility/locale/index.js +12 -0
- package/lib/module/accessibility/locale/index.js.map +1 -0
- package/lib/module/accessibility/locale/it.json +21 -0
- package/lib/module/accessibility/locale.test.js +13 -0
- package/lib/module/accessibility/locale.test.js.map +1 -0
- package/lib/module/action-modal/ActionModal.js +44 -0
- package/lib/module/action-modal/ActionModal.js.map +1 -0
- package/lib/module/action-modal/index.js +3 -0
- package/lib/module/action-modal/index.js.map +1 -0
- package/lib/module/activity-indicator/activity-indicator.js +24 -0
- package/lib/module/activity-indicator/activity-indicator.js.map +1 -0
- package/lib/module/activity-indicator/index.js +3 -0
- package/lib/module/activity-indicator/index.js.map +1 -0
- package/lib/module/blur/blur-view.js +67 -0
- package/lib/module/blur/blur-view.js.map +1 -0
- package/lib/module/blur/index.js +3 -0
- package/lib/module/blur/index.js.map +1 -0
- package/lib/module/buttons/back-button.js +28 -0
- package/lib/module/buttons/back-button.js.map +1 -0
- package/lib/module/buttons/button.js +143 -0
- package/lib/module/buttons/button.js.map +1 -0
- package/lib/module/buttons/connectivity-button.js +73 -0
- package/lib/module/buttons/connectivity-button.js.map +1 -0
- package/lib/module/buttons/filter-button.js +43 -0
- package/lib/module/buttons/filter-button.js.map +1 -0
- package/lib/module/buttons/ghost-button.js +53 -0
- package/lib/module/buttons/ghost-button.js.map +1 -0
- package/lib/module/buttons/index.js +8 -0
- package/lib/module/buttons/index.js.map +1 -0
- package/lib/module/buttons/scan-button.js +75 -0
- package/lib/module/buttons/scan-button.js.map +1 -0
- package/lib/module/camera/camera-overlay.js +51 -0
- package/lib/module/camera/camera-overlay.js.map +1 -0
- package/lib/module/camera/index.js +3 -0
- package/lib/module/camera/index.js.map +1 -0
- package/lib/module/camera/qr-code-scanner.js +40 -0
- package/lib/module/camera/qr-code-scanner.js.map +1 -0
- package/lib/module/control/checkbox.js +70 -0
- package/lib/module/control/checkbox.js.map +1 -0
- package/lib/module/control/index.js +4 -0
- package/lib/module/control/index.js.map +1 -0
- package/lib/module/control/switch.js +56 -0
- package/lib/module/control/switch.js.map +1 -0
- package/lib/module/credential/card/credential-card.js +177 -0
- package/lib/module/credential/card/credential-card.js.map +1 -0
- package/lib/module/credential/card/credential-details-card.js +191 -0
- package/lib/module/credential/card/credential-details-card.js.map +1 -0
- package/lib/module/credential/card/credential-details-list-item.js +74 -0
- package/lib/module/credential/card/credential-details-list-item.js.map +1 -0
- package/lib/module/credential/card/credential-header.js +162 -0
- package/lib/module/credential/card/credential-header.js.map +1 -0
- package/lib/module/credential/card/credential-image-carousel.js +113 -0
- package/lib/module/credential/card/credential-image-carousel.js.map +1 -0
- package/lib/module/credential/card/index.js +11 -0
- package/lib/module/credential/card/index.js.map +1 -0
- package/lib/module/credential/credential-attribute-item.js +279 -0
- package/lib/module/credential/credential-attribute-item.js.map +1 -0
- package/lib/module/credential/credential-carousel-images.js +86 -0
- package/lib/module/credential/credential-carousel-images.js.map +1 -0
- package/lib/module/credential/index.js +9 -0
- package/lib/module/credential/index.js.map +1 -0
- package/lib/module/credential/selector-status.js +10 -0
- package/lib/module/credential/selector-status.js.map +1 -0
- package/lib/module/credential/selector.js +70 -0
- package/lib/module/credential/selector.js.map +1 -0
- package/lib/module/detail/detail.js +75 -0
- package/lib/module/detail/detail.js.map +1 -0
- package/lib/module/detail/index.js +3 -0
- package/lib/module/detail/index.js.map +1 -0
- package/lib/module/entity/avatar.js +86 -0
- package/lib/module/entity/avatar.js.map +1 -0
- package/lib/module/entity/entity-cluster.js +56 -0
- package/lib/module/entity/entity-cluster.js.map +1 -0
- package/lib/module/entity/index.js +5 -0
- package/lib/module/entity/index.js.map +1 -0
- package/lib/module/header/focus-aware-status-bar.js +12 -0
- package/lib/module/header/focus-aware-status-bar.js.map +1 -0
- package/lib/module/header/foldable-header.js +79 -0
- package/lib/module/header/foldable-header.js.map +1 -0
- package/lib/module/header/header.js +97 -0
- package/lib/module/header/header.js.map +1 -0
- package/lib/module/header/index.js +9 -0
- package/lib/module/header/index.js.map +1 -0
- package/lib/module/header/navigation-header.js +138 -0
- package/lib/module/header/navigation-header.js.map +1 -0
- package/lib/module/history/data-item.js +60 -0
- package/lib/module/history/data-item.js.map +1 -0
- package/lib/module/history/history-list-item.js +80 -0
- package/lib/module/history/history-list-item.js.map +1 -0
- package/lib/module/history/history-section-header.js +42 -0
- package/lib/module/history/history-section-header.js.map +1 -0
- package/lib/module/history/history-section-list-item.js +43 -0
- package/lib/module/history/history-section-list-item.js.map +1 -0
- package/lib/module/history/index.js +9 -0
- package/lib/module/history/index.js.map +1 -0
- package/lib/module/icons/connectivity.js +125 -0
- package/lib/module/icons/connectivity.js.map +1 -0
- package/lib/module/icons/credential.js +147 -0
- package/lib/module/icons/credential.js.map +1 -0
- package/lib/module/icons/entity.js +25 -0
- package/lib/module/icons/entity.js.map +1 -0
- package/lib/module/icons/history.js +391 -0
- package/lib/module/icons/history.js.map +1 -0
- package/lib/module/icons/icons.js +231 -0
- package/lib/module/icons/icons.js.map +1 -0
- package/lib/module/icons/index.js +12 -0
- package/lib/module/icons/index.js.map +1 -0
- package/lib/module/icons/input.js +33 -0
- package/lib/module/icons/input.js.map +1 -0
- package/lib/module/icons/keypad.js +81 -0
- package/lib/module/icons/keypad.js.map +1 -0
- package/lib/module/icons/loader.js +168 -0
- package/lib/module/icons/loader.js.map +1 -0
- package/lib/module/icons/nerd-view.js +110 -0
- package/lib/module/icons/nerd-view.js.map +1 -0
- package/lib/module/icons/selector.js +45 -0
- package/lib/module/icons/selector.js.map +1 -0
- package/lib/module/icons/wallet.js +111 -0
- package/lib/module/icons/wallet.js.map +1 -0
- package/lib/module/image/image-or-component.js +71 -0
- package/lib/module/image/image-or-component.js.map +1 -0
- package/lib/module/image/index.js +3 -0
- package/lib/module/image/index.js.map +1 -0
- package/lib/module/index.js +27 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/input/index.js +7 -0
- package/lib/module/input/index.js.map +1 -0
- package/lib/module/input/radio-group.js +87 -0
- package/lib/module/input/radio-group.js.map +1 -0
- package/lib/module/input/selection-input.js +92 -0
- package/lib/module/input/selection-input.js.map +1 -0
- package/lib/module/input/text-input.js +185 -0
- package/lib/module/input/text-input.js.map +1 -0
- package/lib/module/list/index.js +5 -0
- package/lib/module/list/index.js.map +1 -0
- package/lib/module/list/list-section-header.js +28 -0
- package/lib/module/list/list-section-header.js.map +1 -0
- package/lib/module/list/list-title-header.js +27 -0
- package/lib/module/list/list-title-header.js.map +1 -0
- package/lib/module/loader/index.js +5 -0
- package/lib/module/loader/index.js.map +1 -0
- package/lib/module/loader/loader.js +130 -0
- package/lib/module/loader/loader.js.map +1 -0
- package/lib/module/loader/loading-result.js +84 -0
- package/lib/module/loader/loading-result.js.map +1 -0
- package/lib/module/nerd-view/index.js +3 -0
- package/lib/module/nerd-view/index.js.map +1 -0
- package/lib/module/nerd-view/nerd-mode-item.js +224 -0
- package/lib/module/nerd-view/nerd-mode-item.js.map +1 -0
- package/lib/module/normalize-color.d.js +2 -0
- package/lib/module/normalize-color.d.js.map +1 -0
- package/lib/module/pin/index.js +4 -0
- package/lib/module/pin/index.js.map +1 -0
- package/lib/module/pin/keypad.js +191 -0
- package/lib/module/pin/keypad.js.map +1 -0
- package/lib/module/pin/pin-code-screen.js +152 -0
- package/lib/module/pin/pin-code-screen.js.map +1 -0
- package/lib/module/pin/pins.js +46 -0
- package/lib/module/pin/pins.js.map +1 -0
- package/lib/module/screens/backup-screen.js +78 -0
- package/lib/module/screens/backup-screen.js.map +1 -0
- package/lib/module/screens/image-preview-screen.js +83 -0
- package/lib/module/screens/image-preview-screen.js.map +1 -0
- package/lib/module/screens/index.js +13 -0
- package/lib/module/screens/index.js.map +1 -0
- package/lib/module/screens/nerd-mode-screen.js +132 -0
- package/lib/module/screens/nerd-mode-screen.js.map +1 -0
- package/lib/module/screens/qr-code-scanner-screen.js +110 -0
- package/lib/module/screens/qr-code-scanner-screen.js.map +1 -0
- package/lib/module/screens/scroll-view-screen.js +86 -0
- package/lib/module/screens/scroll-view-screen.js.map +1 -0
- package/lib/module/screens/section-list-screen.js +59 -0
- package/lib/module/screens/section-list-screen.js.map +1 -0
- package/lib/module/searchbar/animated-search-bar.js +78 -0
- package/lib/module/searchbar/animated-search-bar.js.map +1 -0
- package/lib/module/searchbar/index.js +5 -0
- package/lib/module/searchbar/index.js.map +1 -0
- package/lib/module/searchbar/search-bar.js +89 -0
- package/lib/module/searchbar/search-bar.js.map +1 -0
- package/lib/module/settings/button-setting.js +57 -0
- package/lib/module/settings/button-setting.js.map +1 -0
- package/lib/module/settings/index.js +11 -0
- package/lib/module/settings/index.js.map +1 -0
- package/lib/module/settings/setting-item-separator.js +32 -0
- package/lib/module/settings/setting-item-separator.js.map +1 -0
- package/lib/module/settings/setting-item.js +69 -0
- package/lib/module/settings/setting-item.js.map +1 -0
- package/lib/module/settings/settings-button.js +27 -0
- package/lib/module/settings/settings-button.js.map +1 -0
- package/lib/module/settings/switch-setting.js +27 -0
- package/lib/module/settings/switch-setting.js.map +1 -0
- package/lib/module/state/error-screen.js +63 -0
- package/lib/module/state/error-screen.js.map +1 -0
- package/lib/module/state/index.js +3 -0
- package/lib/module/state/index.js.map +1 -0
- package/lib/module/text/base.js +31 -0
- package/lib/module/text/base.js.map +1 -0
- package/lib/module/text/font.js +56 -0
- package/lib/module/text/font.js.map +1 -0
- package/lib/module/text/index.js +3 -0
- package/lib/module/text/index.js.map +1 -0
- package/lib/module/text/typography.js +111 -0
- package/lib/module/text/typography.js.map +1 -0
- package/lib/module/theme/color-scheme-context.js +44 -0
- package/lib/module/theme/color-scheme-context.js.map +1 -0
- package/lib/module/theme/color-scheme.js +2 -0
- package/lib/module/theme/color-scheme.js.map +1 -0
- package/lib/module/theme/index.js +3 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/utils/color.js +23 -0
- package/lib/module/utils/color.js.map +1 -0
- package/lib/module/utils/contrasting-status-bar.js +21 -0
- package/lib/module/utils/contrasting-status-bar.js.map +1 -0
- package/lib/module/utils/date.js +51 -0
- package/lib/module/utils/date.js.map +1 -0
- package/lib/module/utils/hooks/header/on-scroll-header-state.js +14 -0
- package/lib/module/utils/hooks/header/on-scroll-header-state.js.map +1 -0
- package/lib/module/utils/hooks/index.js +5 -0
- package/lib/module/utils/hooks/index.js.map +1 -0
- package/lib/module/utils/hooks/list/list-content-inset.js +24 -0
- package/lib/module/utils/hooks/list/list-content-inset.js.map +1 -0
- package/lib/module/utils/index.js +9 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/module/utils/navigation.js +45 -0
- package/lib/module/utils/navigation.js.map +1 -0
- package/lib/module/utils/ref.js +35 -0
- package/lib/module/utils/ref.js.map +1 -0
- package/lib/module/utils/testID.js +12 -0
- package/lib/module/utils/testID.js.map +1 -0
- package/lib/module/utils/testID.test.js +19 -0
- package/lib/module/utils/testID.test.js.map +1 -0
- package/lib/module/utils/useMemoAsync.js +20 -0
- package/lib/module/utils/useMemoAsync.js.map +1 -0
- package/lib/typescript/accessibility/accessibility.d.ts +55 -0
- package/lib/typescript/accessibility/accessibilityHistory.d.ts +13 -0
- package/lib/typescript/accessibility/accessibilityHistoryWrappers.d.ts +18 -0
- package/lib/typescript/accessibility/accessibilityLanguage.d.ts +20 -0
- package/lib/typescript/accessibility/index.d.ts +6 -0
- package/lib/typescript/accessibility/locale/index.d.ts +90 -0
- package/lib/typescript/accessibility/locale.test.d.ts +1 -0
- package/lib/typescript/action-modal/ActionModal.d.ts +10 -0
- package/lib/typescript/action-modal/index.d.ts +2 -0
- package/lib/typescript/activity-indicator/activity-indicator.d.ts +7 -0
- package/lib/typescript/activity-indicator/index.d.ts +2 -0
- package/lib/typescript/blur/blur-view.d.ts +10 -0
- package/lib/typescript/blur/index.d.ts +2 -0
- package/lib/typescript/buttons/back-button.d.ts +9 -0
- package/lib/typescript/buttons/button.d.ts +22 -0
- package/lib/typescript/buttons/connectivity-button.d.ts +17 -0
- package/lib/typescript/buttons/filter-button.d.ts +7 -0
- package/lib/typescript/buttons/ghost-button.d.ts +11 -0
- package/lib/typescript/buttons/index.d.ts +7 -0
- package/lib/typescript/buttons/scan-button.d.ts +5 -0
- package/lib/typescript/camera/camera-overlay.d.ts +7 -0
- package/lib/typescript/camera/index.d.ts +2 -0
- package/lib/typescript/camera/qr-code-scanner.d.ts +11 -0
- package/lib/typescript/control/checkbox.d.ts +9 -0
- package/lib/typescript/control/index.d.ts +3 -0
- package/lib/typescript/control/switch.d.ts +7 -0
- package/lib/typescript/credential/card/credential-card.d.ts +22 -0
- package/lib/typescript/credential/card/credential-details-card.d.ts +16 -0
- package/lib/typescript/credential/card/credential-details-list-item.d.ts +9 -0
- package/lib/typescript/credential/card/credential-header.d.ts +20 -0
- package/lib/typescript/credential/card/credential-image-carousel.d.ts +23 -0
- package/lib/typescript/credential/card/index.d.ts +10 -0
- package/lib/typescript/credential/credential-attribute-item.d.ts +48 -0
- package/lib/typescript/credential/credential-carousel-images.d.ts +19 -0
- package/lib/typescript/credential/index.d.ts +8 -0
- package/lib/typescript/credential/selector-status.d.ts +8 -0
- package/lib/typescript/credential/selector.d.ts +15 -0
- package/lib/typescript/detail/detail.d.ts +18 -0
- package/lib/typescript/detail/index.d.ts +2 -0
- package/lib/typescript/entity/avatar.d.ts +10 -0
- package/lib/typescript/entity/entity-cluster.d.ts +12 -0
- package/lib/typescript/entity/index.d.ts +4 -0
- package/lib/typescript/header/focus-aware-status-bar.d.ts +4 -0
- package/lib/typescript/header/foldable-header.d.ts +11 -0
- package/lib/typescript/header/header.d.ts +17 -0
- package/lib/typescript/header/index.d.ts +8 -0
- package/lib/typescript/header/navigation-header.d.ts +15 -0
- package/lib/typescript/history/data-item.d.ts +12 -0
- package/lib/typescript/history/history-list-item.d.ts +14 -0
- package/lib/typescript/history/history-section-header.d.ts +7 -0
- package/lib/typescript/history/history-section-list-item.d.ts +7 -0
- package/lib/typescript/history/index.d.ts +8 -0
- package/lib/typescript/icons/connectivity.d.ts +12 -0
- package/lib/typescript/icons/credential.d.ts +9 -0
- package/lib/typescript/icons/entity.d.ts +3 -0
- package/lib/typescript/icons/history.d.ts +42 -0
- package/lib/typescript/icons/icons.d.ts +13 -0
- package/lib/typescript/icons/index.d.ts +11 -0
- package/lib/typescript/icons/input.d.ts +3 -0
- package/lib/typescript/icons/keypad.d.ts +6 -0
- package/lib/typescript/icons/loader.d.ts +6 -0
- package/lib/typescript/icons/nerd-view.d.ts +7 -0
- package/lib/typescript/icons/selector.d.ts +10 -0
- package/lib/typescript/icons/wallet.d.ts +4 -0
- package/lib/typescript/image/image-or-component.d.ts +16 -0
- package/lib/typescript/image/index.d.ts +2 -0
- package/lib/typescript/index.d.ts +26 -0
- package/lib/typescript/input/index.d.ts +6 -0
- package/lib/typescript/input/radio-group.d.ts +23 -0
- package/lib/typescript/input/selection-input.d.ts +32 -0
- package/lib/typescript/input/text-input.d.ts +31 -0
- package/lib/typescript/list/index.d.ts +4 -0
- package/lib/typescript/list/list-section-header.d.ts +7 -0
- package/lib/typescript/list/list-title-header.d.ts +7 -0
- package/lib/typescript/loader/index.d.ts +4 -0
- package/lib/typescript/loader/loader.d.ts +14 -0
- package/lib/typescript/loader/loading-result.d.ts +16 -0
- package/lib/typescript/nerd-view/index.d.ts +2 -0
- package/lib/typescript/nerd-view/nerd-mode-item.d.ts +31 -0
- package/lib/typescript/pin/index.d.ts +3 -0
- package/lib/typescript/pin/keypad.d.ts +16 -0
- package/lib/typescript/pin/pin-code-screen.d.ts +32 -0
- package/lib/typescript/pin/pins.d.ts +7 -0
- package/lib/typescript/screens/backup-screen.d.ts +16 -0
- package/lib/typescript/screens/image-preview-screen.d.ts +9 -0
- package/lib/typescript/screens/index.d.ts +12 -0
- package/lib/typescript/screens/nerd-mode-screen.d.ts +22 -0
- package/lib/typescript/screens/qr-code-scanner-screen.d.ts +14 -0
- package/lib/typescript/screens/scroll-view-screen.d.ts +13 -0
- package/lib/typescript/screens/section-list-screen.d.ts +12 -0
- package/lib/typescript/searchbar/animated-search-bar.d.ts +10 -0
- package/lib/typescript/searchbar/index.d.ts +4 -0
- package/lib/typescript/searchbar/search-bar.d.ts +10 -0
- package/lib/typescript/settings/button-setting.d.ts +13 -0
- package/lib/typescript/settings/index.d.ts +10 -0
- package/lib/typescript/settings/setting-item-separator.d.ts +8 -0
- package/lib/typescript/settings/setting-item.d.ts +9 -0
- package/lib/typescript/settings/settings-button.d.ts +5 -0
- package/lib/typescript/settings/switch-setting.d.ts +13 -0
- package/lib/typescript/state/error-screen.d.ts +15 -0
- package/lib/typescript/state/index.d.ts +2 -0
- package/lib/typescript/text/base.d.ts +20 -0
- package/lib/typescript/text/font.d.ts +26 -0
- package/lib/typescript/text/index.d.ts +2 -0
- package/lib/typescript/text/typography.d.ts +112 -0
- package/lib/typescript/theme/color-scheme-context.d.ts +10 -0
- package/lib/typescript/theme/color-scheme.d.ts +31 -0
- package/lib/typescript/theme/index.d.ts +3 -0
- package/lib/typescript/utils/color.d.ts +4 -0
- package/lib/typescript/utils/contrasting-status-bar.d.ts +10 -0
- package/lib/typescript/utils/date.d.ts +12 -0
- package/lib/typescript/utils/hooks/header/on-scroll-header-state.d.ts +5 -0
- package/lib/typescript/utils/hooks/index.d.ts +4 -0
- package/lib/typescript/utils/hooks/list/list-content-inset.d.ts +8 -0
- package/lib/typescript/utils/index.d.ts +8 -0
- package/lib/typescript/utils/navigation.d.ts +9 -0
- package/lib/typescript/utils/ref.d.ts +11 -0
- package/lib/typescript/utils/testID.d.ts +6 -0
- package/lib/typescript/utils/testID.test.d.ts +1 -0
- package/lib/typescript/utils/useMemoAsync.d.ts +21 -0
- package/package.json +240 -0
- package/src/accessibility/accessibility.ts +215 -0
- package/src/accessibility/accessibilityHistory.tsx +77 -0
- package/src/accessibility/accessibilityHistoryWrappers.tsx +80 -0
- package/src/accessibility/accessibilityLanguage.tsx +66 -0
- package/src/accessibility/index.ts +35 -0
- package/src/accessibility/locale/de.json +21 -0
- package/src/accessibility/locale/en.json +21 -0
- package/src/accessibility/locale/fr.json +21 -0
- package/src/accessibility/locale/index.ts +19 -0
- package/src/accessibility/locale/it.json +21 -0
- package/src/accessibility/locale.test.ts +16 -0
- package/src/action-modal/ActionModal.stories.tsx +35 -0
- package/src/action-modal/ActionModal.tsx +45 -0
- package/src/action-modal/index.ts +3 -0
- package/src/activity-indicator/activity-indicator.stories.tsx +21 -0
- package/src/activity-indicator/activity-indicator.tsx +25 -0
- package/src/activity-indicator/index.ts +3 -0
- package/src/blur/blur-view.tsx +82 -0
- package/src/blur/index.ts +3 -0
- package/src/buttons/back-button.stories.tsx +31 -0
- package/src/buttons/back-button.tsx +31 -0
- package/src/buttons/button.stories.tsx +29 -0
- package/src/buttons/button.tsx +169 -0
- package/src/buttons/connectivity-button.stories.tsx +34 -0
- package/src/buttons/connectivity-button.tsx +95 -0
- package/src/buttons/filter-button.tsx +38 -0
- package/src/buttons/ghost-button.stories.tsx +28 -0
- package/src/buttons/ghost-button.tsx +56 -0
- package/src/buttons/index.ts +24 -0
- package/src/buttons/scan-button.stories.tsx +26 -0
- package/src/buttons/scan-button.tsx +66 -0
- package/src/camera/camera-overlay.tsx +48 -0
- package/src/camera/index.tsx +3 -0
- package/src/camera/qr-code-scanner.tsx +52 -0
- package/src/control/checkbox.stories.tsx +27 -0
- package/src/control/checkbox.tsx +81 -0
- package/src/control/index.ts +4 -0
- package/src/control/switch.stories.tsx +29 -0
- package/src/control/switch.tsx +47 -0
- package/src/credential/card/credential-card.stories.tsx +52 -0
- package/src/credential/card/credential-card.tsx +195 -0
- package/src/credential/card/credential-details-card.stories.tsx +268 -0
- package/src/credential/card/credential-details-card.tsx +242 -0
- package/src/credential/card/credential-details-list-item.tsx +87 -0
- package/src/credential/card/credential-header.stories.tsx +50 -0
- package/src/credential/card/credential-header.tsx +195 -0
- package/src/credential/card/credential-image-carousel.tsx +113 -0
- package/src/credential/card/index.ts +11 -0
- package/src/credential/credential-attribute-item.tsx +372 -0
- package/src/credential/credential-carousel-images.tsx +90 -0
- package/src/credential/index.ts +13 -0
- package/src/credential/selector-status.ts +8 -0
- package/src/credential/selector.stories.tsx +37 -0
- package/src/credential/selector.tsx +64 -0
- package/src/detail/detail.stories.tsx +65 -0
- package/src/detail/detail.tsx +98 -0
- package/src/detail/index.tsx +3 -0
- package/src/entity/avatar.stories.tsx +39 -0
- package/src/entity/avatar.tsx +87 -0
- package/src/entity/entity-cluster.stories.tsx +42 -0
- package/src/entity/entity-cluster.tsx +72 -0
- package/src/entity/index.ts +5 -0
- package/src/header/focus-aware-status-bar.tsx +10 -0
- package/src/header/foldable-header.tsx +107 -0
- package/src/header/header.stories.tsx +59 -0
- package/src/header/header.tsx +105 -0
- package/src/header/index.ts +9 -0
- package/src/header/navigation-header.stories.tsx +56 -0
- package/src/header/navigation-header.tsx +147 -0
- package/src/history/data-item.tsx +79 -0
- package/src/history/history-list-item.tsx +102 -0
- package/src/history/history-section-header.tsx +44 -0
- package/src/history/history-section-list-item.tsx +41 -0
- package/src/history/index.ts +9 -0
- package/src/icons/connectivity.tsx +114 -0
- package/src/icons/credential.tsx +118 -0
- package/src/icons/entity.tsx +21 -0
- package/src/icons/history.tsx +378 -0
- package/src/icons/icons.tsx +134 -0
- package/src/icons/index.ts +11 -0
- package/src/icons/input.tsx +29 -0
- package/src/icons/keypad.tsx +40 -0
- package/src/icons/loader.tsx +117 -0
- package/src/icons/nerd-view.tsx +105 -0
- package/src/icons/selector.tsx +43 -0
- package/src/icons/wallet.tsx +73 -0
- package/src/image/image-or-component.tsx +92 -0
- package/src/image/index.tsx +3 -0
- package/src/index.ts +26 -0
- package/src/input/index.ts +7 -0
- package/src/input/radio-group.tsx +110 -0
- package/src/input/selection-input.stories.tsx +46 -0
- package/src/input/selection-input.tsx +112 -0
- package/src/input/text-input.tsx +253 -0
- package/src/list/index.ts +5 -0
- package/src/list/list-section-header.tsx +37 -0
- package/src/list/list-title-header.tsx +30 -0
- package/src/loader/index.ts +5 -0
- package/src/loader/loader.stories.tsx +31 -0
- package/src/loader/loader.tsx +169 -0
- package/src/loader/loading-result.stories.tsx +67 -0
- package/src/loader/loading-result.tsx +93 -0
- package/src/nerd-view/index.ts +3 -0
- package/src/nerd-view/nerd-mode-item.tsx +296 -0
- package/src/normalize-color.d.ts +1 -0
- package/src/pin/index.ts +4 -0
- package/src/pin/keypad.tsx +166 -0
- package/src/pin/pin-code-screen.stories.tsx +80 -0
- package/src/pin/pin-code-screen.tsx +195 -0
- package/src/pin/pins.tsx +48 -0
- package/src/screens/backup-screen.tsx +92 -0
- package/src/screens/image-preview-screen.stories.tsx +28 -0
- package/src/screens/image-preview-screen.tsx +82 -0
- package/src/screens/index.ts +13 -0
- package/src/screens/nerd-mode-screen.tsx +150 -0
- package/src/screens/qr-code-scanner-screen.stories.tsx +37 -0
- package/src/screens/qr-code-scanner-screen.tsx +124 -0
- package/src/screens/scroll-view-screen.tsx +91 -0
- package/src/screens/section-list-screen.tsx +61 -0
- package/src/searchbar/animated-search-bar.tsx +96 -0
- package/src/searchbar/index.ts +5 -0
- package/src/searchbar/search-bar.stories.tsx +31 -0
- package/src/searchbar/search-bar.tsx +94 -0
- package/src/settings/button-setting.tsx +72 -0
- package/src/settings/index.ts +11 -0
- package/src/settings/setting-item-separator.tsx +32 -0
- package/src/settings/setting-item.tsx +68 -0
- package/src/settings/settings-button.tsx +23 -0
- package/src/settings/switch-setting.tsx +33 -0
- package/src/state/error-screen.stories.tsx +22 -0
- package/src/state/error-screen.tsx +71 -0
- package/src/state/index.ts +3 -0
- package/src/text/base.tsx +53 -0
- package/src/text/font.ts +52 -0
- package/src/text/index.ts +3 -0
- package/src/text/typography.stories.tsx +70 -0
- package/src/text/typography.tsx +117 -0
- package/src/theme/color-scheme-context.tsx +48 -0
- package/src/theme/color-scheme.ts +31 -0
- package/src/theme/index.ts +4 -0
- package/src/utils/color.ts +34 -0
- package/src/utils/contrasting-status-bar.tsx +21 -0
- package/src/utils/date.ts +49 -0
- package/src/utils/hooks/header/on-scroll-header-state.tsx +16 -0
- package/src/utils/hooks/index.ts +5 -0
- package/src/utils/hooks/list/list-content-inset.ts +24 -0
- package/src/utils/index.ts +19 -0
- package/src/utils/navigation.ts +37 -0
- package/src/utils/ref.ts +39 -0
- package/src/utils/testID.test.ts +20 -0
- package/src/utils/testID.ts +9 -0
- package/src/utils/useMemoAsync.ts +50 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { NavigationProp, NavigationState, useIsFocused, useNavigation } from '@react-navigation/native';
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { AccessibilityInfo, EmitterSubscription, findNodeHandle, Platform } from 'react-native';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Global transformer of text for Voice-Over
|
|
7
|
+
* @param {string} text (Visible) text to be announced
|
|
8
|
+
* @returns {string} Text to be read-out by Voice-Over
|
|
9
|
+
*/
|
|
10
|
+
export type AccessibilityTextTransformer = (text: string) => string;
|
|
11
|
+
let textTransformer: AccessibilityTextTransformer | null = null;
|
|
12
|
+
export function setAccessibilityTextTransformer(transformer: AccessibilityTextTransformer | null) {
|
|
13
|
+
textTransformer = transformer;
|
|
14
|
+
}
|
|
15
|
+
export function transformAccessibilityText(text: string) {
|
|
16
|
+
return textTransformer && text ? textTransformer(text) : text;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Make element accessible after navigation transition is done
|
|
21
|
+
* @returns {boolean} flag to be used as `accessible` prop on the target component(s)
|
|
22
|
+
*/
|
|
23
|
+
export function useAccessibleAfterTransition<
|
|
24
|
+
TNavigationProp extends NavigationProp<
|
|
25
|
+
Record<string, any>,
|
|
26
|
+
string,
|
|
27
|
+
NavigationState<Record<string, any>>,
|
|
28
|
+
{},
|
|
29
|
+
{ transitionEnd: {} }
|
|
30
|
+
>,
|
|
31
|
+
>() {
|
|
32
|
+
const navigation = useNavigation<TNavigationProp>();
|
|
33
|
+
const [accessible, setAccessible] = useState(false);
|
|
34
|
+
|
|
35
|
+
const isFocused = useIsFocused();
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (!isFocused) {
|
|
38
|
+
setAccessible(false);
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
const unsubscribe = navigation.addListener('transitionEnd', () => setAccessible(true));
|
|
42
|
+
// fallback for cases when transition doesn't happen (e.g. forceful screen re-render)
|
|
43
|
+
const timeout = setTimeout(() => setAccessible(true), 500);
|
|
44
|
+
return () => {
|
|
45
|
+
unsubscribe();
|
|
46
|
+
clearTimeout(timeout);
|
|
47
|
+
};
|
|
48
|
+
}, [navigation, isFocused]);
|
|
49
|
+
|
|
50
|
+
return isFocused && accessible;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Query whether the current screen is NOT transitioning
|
|
55
|
+
* @returns {boolean} flag signifying whether the current screen is NOT in a transition (either entering or leaving)
|
|
56
|
+
*/
|
|
57
|
+
export function useIsOutsideTransition<
|
|
58
|
+
TNavigationProp extends NavigationProp<
|
|
59
|
+
Record<string, any>,
|
|
60
|
+
string,
|
|
61
|
+
NavigationState<Record<string, any>>,
|
|
62
|
+
{},
|
|
63
|
+
{ transitionStart: {}; transitionEnd: {} }
|
|
64
|
+
>,
|
|
65
|
+
>() {
|
|
66
|
+
const navigation = useNavigation<TNavigationProp>();
|
|
67
|
+
const [inTransition, setInTransition] = useState<boolean>(true);
|
|
68
|
+
|
|
69
|
+
const isFocused = useIsFocused();
|
|
70
|
+
const focused = useRef(isFocused);
|
|
71
|
+
focused.current = isFocused;
|
|
72
|
+
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
const unsubscribeStart = navigation.addListener('transitionStart', () => setInTransition(true));
|
|
75
|
+
const unsubscribeEnd = navigation.addListener('transitionEnd', () => {
|
|
76
|
+
if (focused.current) {
|
|
77
|
+
setInTransition(false);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
return () => {
|
|
81
|
+
unsubscribeStart();
|
|
82
|
+
unsubscribeEnd();
|
|
83
|
+
};
|
|
84
|
+
}, [navigation]);
|
|
85
|
+
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
if (!isFocused) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
setInTransition(true);
|
|
92
|
+
// fallback for cases when transition callback doesn't happen (e.g. forceful screen re-render)
|
|
93
|
+
const timeout = setTimeout(() => setInTransition(false), 500);
|
|
94
|
+
return () => {
|
|
95
|
+
clearTimeout(timeout);
|
|
96
|
+
};
|
|
97
|
+
}, [isFocused]);
|
|
98
|
+
|
|
99
|
+
return isFocused && !inTransition;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Focuses an element for accessibility
|
|
104
|
+
* @param component component ref
|
|
105
|
+
* @note Disabled on android as it is not reliable
|
|
106
|
+
*/
|
|
107
|
+
export const focusAccessibility = (component?: React.Component | React.ComponentClass | null) => {
|
|
108
|
+
if (Platform.OS === 'ios' && component) {
|
|
109
|
+
const nodeHandle = findNodeHandle(component);
|
|
110
|
+
if (nodeHandle) {
|
|
111
|
+
AccessibilityInfo.setAccessibilityFocus(nodeHandle);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Focuses an element for accessibility
|
|
118
|
+
* @param {boolean} focused Focusing happens when this changes to `true`
|
|
119
|
+
* @returns reference to be used with the target element
|
|
120
|
+
*/
|
|
121
|
+
export const useAccessibilityFocus = <T extends React.Component | React.ComponentClass>(focused: boolean = true) => {
|
|
122
|
+
const ref = useRef<T>(null);
|
|
123
|
+
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
if (focused) {
|
|
126
|
+
focusAccessibility(ref.current);
|
|
127
|
+
}
|
|
128
|
+
}, [focused]);
|
|
129
|
+
|
|
130
|
+
return ref;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Posts a screen-reader/voice-over announcement
|
|
135
|
+
* @param {string} message Announcement message
|
|
136
|
+
* * if `null` passed, it resets the cached announcement and the same message can be re-announced again
|
|
137
|
+
* @returns {boolean} When the announcement is successfully finished (only supported on iOS), false otherwise
|
|
138
|
+
* @note Use {@link setAccessibilityTextTransformer} to apply text transformation for the read-out text
|
|
139
|
+
*/
|
|
140
|
+
export const useAccessibilityAnnouncement = (message?: string | null): boolean => {
|
|
141
|
+
const announcement = message ? transformAccessibilityText(message) : message;
|
|
142
|
+
const [announcementFinished, setAnnouncementFinished] = useState<string>();
|
|
143
|
+
useEffect(() => {
|
|
144
|
+
if (announcement === null) {
|
|
145
|
+
// explicitly clearing cached state
|
|
146
|
+
setAnnouncementFinished(undefined);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (!announcement) {
|
|
150
|
+
return undefined;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
let subscription: EmitterSubscription;
|
|
154
|
+
const unsubscribe = () => subscription?.remove();
|
|
155
|
+
if (Platform.OS === 'ios') {
|
|
156
|
+
let retries = 0;
|
|
157
|
+
subscription = AccessibilityInfo.addEventListener(
|
|
158
|
+
'announcementFinished',
|
|
159
|
+
({ announcement: finished, success }) => {
|
|
160
|
+
if (finished === announcement) {
|
|
161
|
+
if (success) {
|
|
162
|
+
setAnnouncementFinished(announcement);
|
|
163
|
+
unsubscribe();
|
|
164
|
+
} else if (retries++ < 2) {
|
|
165
|
+
// when the automatic voice-over cancels the first try (e.g. after screen transition), let's attempt again one more time
|
|
166
|
+
AccessibilityInfo.announceForAccessibility(announcement);
|
|
167
|
+
} else {
|
|
168
|
+
unsubscribe();
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
AccessibilityInfo.announceForAccessibility(announcement);
|
|
176
|
+
return unsubscribe;
|
|
177
|
+
}, [announcement]);
|
|
178
|
+
|
|
179
|
+
return Boolean(announcement && announcementFinished === announcement);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Posts a screen-reader/voice-over announcement
|
|
184
|
+
* @param {string} message Announcement message
|
|
185
|
+
* @param {boolean} waitForPreviousAnnouncement When a new message appears before the previous announcement if finished:
|
|
186
|
+
* - `true`: postpone the new message to be announced after the previous message(s)
|
|
187
|
+
* - `false` (default): cancel the previous announcement and start the new message
|
|
188
|
+
* @returns {boolean} When all announcements are finished (only supported on iOS), false otherwise
|
|
189
|
+
* @see {@link useAccessibilityAnnouncement} for further info
|
|
190
|
+
*/
|
|
191
|
+
export const useAccessibilityAnnouncementCumulative = (
|
|
192
|
+
message?: string,
|
|
193
|
+
waitForPreviousAnnouncement?: boolean,
|
|
194
|
+
): boolean => {
|
|
195
|
+
// waiting only possible on iOS
|
|
196
|
+
const wait = Platform.OS === 'ios' && waitForPreviousAnnouncement;
|
|
197
|
+
|
|
198
|
+
const [announcements, setAnnouncements] = useState<string[]>([]);
|
|
199
|
+
useEffect(() => {
|
|
200
|
+
if (message) {
|
|
201
|
+
setAnnouncements((prev) => [...prev, message]);
|
|
202
|
+
}
|
|
203
|
+
}, [message]);
|
|
204
|
+
|
|
205
|
+
const nextAnnouncement = wait ? announcements[0] : message;
|
|
206
|
+
const finished = useAccessibilityAnnouncement(nextAnnouncement);
|
|
207
|
+
|
|
208
|
+
useEffect(() => {
|
|
209
|
+
if (finished) {
|
|
210
|
+
setAnnouncements((prev) => prev.filter((m) => m !== nextAnnouncement));
|
|
211
|
+
}
|
|
212
|
+
}, [nextAnnouncement, finished]);
|
|
213
|
+
|
|
214
|
+
return wait ? !announcements.length : finished;
|
|
215
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { useRoute } from '@react-navigation/native';
|
|
2
|
+
import React, { FC, PropsWithChildren, useCallback, useContext, useEffect, useMemo, useRef } from 'react';
|
|
3
|
+
|
|
4
|
+
import { useForwardedRef } from '../utils/ref';
|
|
5
|
+
import { focusAccessibility, useAccessibleAfterTransition } from './accessibility';
|
|
6
|
+
|
|
7
|
+
type AccessibilityRefComponent = React.Component | React.ComponentClass | null;
|
|
8
|
+
interface AccessibilityRefContextValue {
|
|
9
|
+
setRef: (route: string, ref: AccessibilityRefComponent) => void;
|
|
10
|
+
getRef: (route: string) => AccessibilityRefComponent;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const accessibilityFocusHistoryContext = React.createContext<AccessibilityRefContextValue>({
|
|
14
|
+
setRef: () => {},
|
|
15
|
+
getRef: () => null,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Adds app support for accessibility focus history
|
|
20
|
+
*/
|
|
21
|
+
export const AccessibilityFocusHistoryProvider: FC<PropsWithChildren<{}>> = ({ children }) => {
|
|
22
|
+
const Provider = accessibilityFocusHistoryContext.Provider;
|
|
23
|
+
const refs = useRef<Record<string, AccessibilityRefComponent>>({});
|
|
24
|
+
const setRef = useCallback((route: string, ref: AccessibilityRefComponent) => {
|
|
25
|
+
refs.current[route] = ref;
|
|
26
|
+
}, []);
|
|
27
|
+
const getRef = useCallback((route: string) => {
|
|
28
|
+
return refs.current[route] ?? null;
|
|
29
|
+
}, []);
|
|
30
|
+
const value = useMemo(() => ({ setRef, getRef }), [getRef, setRef]);
|
|
31
|
+
return <Provider value={value}>{children}</Provider>;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Wraps `onPress` handler and `ref` to support automatic accessibility focus on back navigation
|
|
36
|
+
* @note This needs to be used inside {@link AccessibilityFocusHistoryProvider} and navigation context
|
|
37
|
+
*/
|
|
38
|
+
export const useAccessibilityFocusHistory = <
|
|
39
|
+
Component extends React.Component<any> | React.ComponentClass<any>,
|
|
40
|
+
OnPress extends (...args: never[]) => void = () => void,
|
|
41
|
+
>(
|
|
42
|
+
pressHandler: OnPress | undefined,
|
|
43
|
+
passedRef?: React.Ref<Component>,
|
|
44
|
+
) => {
|
|
45
|
+
const [forwardedRef, refObject] = useForwardedRef<Component>(passedRef);
|
|
46
|
+
|
|
47
|
+
const historyContext = useContext(accessibilityFocusHistoryContext);
|
|
48
|
+
const routeKey = useRoute().key;
|
|
49
|
+
|
|
50
|
+
const previouslyPressed = useRef(false);
|
|
51
|
+
const outsideTransition = useAccessibleAfterTransition();
|
|
52
|
+
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
const isStoredInHistory = historyContext.getRef(routeKey) === refObject.current;
|
|
55
|
+
if (outsideTransition && isStoredInHistory && previouslyPressed.current) {
|
|
56
|
+
focusAccessibility(refObject.current);
|
|
57
|
+
}
|
|
58
|
+
}, [historyContext, outsideTransition, refObject, routeKey]);
|
|
59
|
+
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (outsideTransition) {
|
|
62
|
+
previouslyPressed.current = false;
|
|
63
|
+
}
|
|
64
|
+
}, [outsideTransition]);
|
|
65
|
+
|
|
66
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
67
|
+
const onPress = useCallback(
|
|
68
|
+
((...args) => {
|
|
69
|
+
previouslyPressed.current = true;
|
|
70
|
+
historyContext.setRef(routeKey, refObject.current);
|
|
71
|
+
return pressHandler?.(...args);
|
|
72
|
+
}) as OnPress,
|
|
73
|
+
[historyContext, routeKey, refObject, pressHandler],
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
return { onPress, ref: forwardedRef };
|
|
77
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/* eslint-disable no-restricted-imports */
|
|
2
|
+
import React, { FC, ForwardedRef, forwardRef } from 'react';
|
|
3
|
+
import {
|
|
4
|
+
GestureResponderEvent,
|
|
5
|
+
Pressable as RNPressable,
|
|
6
|
+
PressableProps,
|
|
7
|
+
TouchableHighlight as RNTouchableHighlight,
|
|
8
|
+
TouchableHighlightProps,
|
|
9
|
+
TouchableOpacity as RNTouchableOpacity,
|
|
10
|
+
TouchableOpacityProps,
|
|
11
|
+
TouchableWithoutFeedback as RNTouchableWithoutFeedback,
|
|
12
|
+
TouchableWithoutFeedbackProps,
|
|
13
|
+
View,
|
|
14
|
+
} from 'react-native';
|
|
15
|
+
|
|
16
|
+
import { useAccessibilityFocusHistory } from './accessibilityHistory';
|
|
17
|
+
|
|
18
|
+
type RNOnPress = (event: GestureResponderEvent) => void;
|
|
19
|
+
interface OnPressProps {
|
|
20
|
+
onPress?: RNOnPress | null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const WithAccessibilityFocusHistory = <ComponentProps extends OnPressProps, RefType extends React.Component>(
|
|
24
|
+
C: React.ComponentType<ComponentProps>,
|
|
25
|
+
displayName: string,
|
|
26
|
+
) => {
|
|
27
|
+
type ForwardedProps = ComponentProps & {
|
|
28
|
+
forwardedRef: ForwardedRef<RefType>;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const ComponentWithAccessibilityFocusHistory: FC<ForwardedProps> = ({
|
|
32
|
+
forwardedRef,
|
|
33
|
+
onPress: originalOnPress,
|
|
34
|
+
...props
|
|
35
|
+
}) => {
|
|
36
|
+
const { ref, onPress } = useAccessibilityFocusHistory<RefType, RNOnPress>(
|
|
37
|
+
originalOnPress ?? undefined,
|
|
38
|
+
forwardedRef,
|
|
39
|
+
);
|
|
40
|
+
// @ts-ignore
|
|
41
|
+
return <C ref={ref} onPress={onPress} {...props} />;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const Forwarded = forwardRef<RefType, ComponentProps>((props, ref) => (
|
|
45
|
+
<ComponentWithAccessibilityFocusHistory {...props} forwardedRef={ref} />
|
|
46
|
+
));
|
|
47
|
+
Forwarded.displayName = displayName;
|
|
48
|
+
|
|
49
|
+
return Forwarded;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Wrappers of RN touchable components with accessibilty focus history support
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
export const TouchableOpacity = WithAccessibilityFocusHistory<TouchableOpacityProps, RNTouchableOpacity>(
|
|
57
|
+
RNTouchableOpacity,
|
|
58
|
+
'TouchableOpacity',
|
|
59
|
+
);
|
|
60
|
+
export const TouchableWithoutFeedback = WithAccessibilityFocusHistory<
|
|
61
|
+
TouchableWithoutFeedbackProps,
|
|
62
|
+
RNTouchableWithoutFeedback
|
|
63
|
+
>(RNTouchableWithoutFeedback, 'TouchableWithoutFeedback');
|
|
64
|
+
export const TouchableHighlight = WithAccessibilityFocusHistory<TouchableHighlightProps, RNTouchableHighlight>(
|
|
65
|
+
RNTouchableHighlight,
|
|
66
|
+
'TouchableHighlight',
|
|
67
|
+
);
|
|
68
|
+
export const Pressable = WithAccessibilityFocusHistory<PressableProps, View>(RNPressable, 'Pressable');
|
|
69
|
+
|
|
70
|
+
type WrapperRefType<C extends React.ForwardRefExoticComponent<React.RefAttributes<any>>> =
|
|
71
|
+
C extends React.ForwardRefExoticComponent<React.RefAttributes<infer Ref>> ? Ref : never;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Ref types to be used in forwardRef for the wrappers
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
export type TouchableOpacityRef = WrapperRefType<typeof TouchableOpacity>;
|
|
78
|
+
export type TouchableWithoutFeedbackRef = WrapperRefType<typeof TouchableWithoutFeedback>;
|
|
79
|
+
export type TouchableHighlightRef = WrapperRefType<typeof TouchableHighlight>;
|
|
80
|
+
export type PressableRef = WrapperRefType<typeof Pressable>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React, { FC, PropsWithChildren, useContext, useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
import { AccessibilityLanguageFile, getAccessibilityLanguageFile, SupportedAccessibilityLanguage } from './locale';
|
|
4
|
+
|
|
5
|
+
export type AccessibilityLanguageFileEntryKey = keyof AccessibilityLanguageFile;
|
|
6
|
+
type AccessibilityLanguageTranslate = (
|
|
7
|
+
entryKey: AccessibilityLanguageFileEntryKey,
|
|
8
|
+
params?: Record<string, string | number>,
|
|
9
|
+
) => string;
|
|
10
|
+
|
|
11
|
+
const AccessibilityLanguageContext = React.createContext<AccessibilityLanguageTranslate | undefined>(undefined);
|
|
12
|
+
|
|
13
|
+
export interface AccessibilityLanguageProviderProps {
|
|
14
|
+
language: SupportedAccessibilityLanguage;
|
|
15
|
+
overrides?: Partial<AccessibilityLanguageFile> | AccessibilityLanguageTranslate;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const Provider = AccessibilityLanguageContext.Provider;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Adds app support for accessibility language
|
|
22
|
+
* @param {SupportedAccessibilityLanguage} language Currenty selected language of the app
|
|
23
|
+
* @param {Object} overrides _(optional)_ Custom overrides for specific entries
|
|
24
|
+
*/
|
|
25
|
+
export const AccessibilityLanguageProvider: FC<PropsWithChildren<AccessibilityLanguageProviderProps>> = ({
|
|
26
|
+
language,
|
|
27
|
+
overrides,
|
|
28
|
+
children,
|
|
29
|
+
}) => {
|
|
30
|
+
const translate = useMemo<AccessibilityLanguageTranslate>(() => {
|
|
31
|
+
if (typeof overrides === 'function') {
|
|
32
|
+
return overrides;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const accessibilityFile = getAccessibilityLanguageFile(language, overrides);
|
|
36
|
+
return (entryKey, params) => {
|
|
37
|
+
let translation = accessibilityFile[entryKey];
|
|
38
|
+
|
|
39
|
+
// replace params
|
|
40
|
+
if (translation && params) {
|
|
41
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
42
|
+
translation = translation.replace(new RegExp(`{${key}}`, 'g'), String(value));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return translation;
|
|
47
|
+
};
|
|
48
|
+
}, [language, overrides]);
|
|
49
|
+
|
|
50
|
+
return <Provider value={translate}>{children}</Provider>;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Access accessibility language translations
|
|
55
|
+
* @note This needs to be used inside {@link AccessibilityLanguageProvider} context
|
|
56
|
+
*/
|
|
57
|
+
export const useAccessibilityTranslation = () => {
|
|
58
|
+
const translate = useContext(AccessibilityLanguageContext);
|
|
59
|
+
|
|
60
|
+
// check context provided
|
|
61
|
+
if (!translate) {
|
|
62
|
+
throw new Error('Accessibility Language not provided!, wrap your components in the AccessibilityLanguageProvider');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return translate;
|
|
66
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AccessibilityTextTransformer,
|
|
3
|
+
focusAccessibility,
|
|
4
|
+
setAccessibilityTextTransformer,
|
|
5
|
+
transformAccessibilityText,
|
|
6
|
+
useAccessibilityAnnouncement,
|
|
7
|
+
useAccessibilityAnnouncementCumulative,
|
|
8
|
+
useAccessibilityFocus,
|
|
9
|
+
useAccessibleAfterTransition,
|
|
10
|
+
useIsOutsideTransition,
|
|
11
|
+
} from './accessibility';
|
|
12
|
+
import { AccessibilityFocusHistoryProvider, useAccessibilityFocusHistory } from './accessibilityHistory';
|
|
13
|
+
import { AccessibilityLanguageProvider, AccessibilityLanguageProviderProps } from './accessibilityLanguage';
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
import { AccessibilityLanguageFile, SupportedAccessibilityLanguage } from './locale';
|
|
16
|
+
|
|
17
|
+
export * from './accessibilityHistoryWrappers';
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
AccessibilityFocusHistoryProvider,
|
|
21
|
+
AccessibilityLanguageFile,
|
|
22
|
+
AccessibilityLanguageProvider,
|
|
23
|
+
AccessibilityLanguageProviderProps,
|
|
24
|
+
AccessibilityTextTransformer,
|
|
25
|
+
focusAccessibility,
|
|
26
|
+
setAccessibilityTextTransformer,
|
|
27
|
+
SupportedAccessibilityLanguage,
|
|
28
|
+
transformAccessibilityText,
|
|
29
|
+
useAccessibilityAnnouncement,
|
|
30
|
+
useAccessibilityAnnouncementCumulative,
|
|
31
|
+
useAccessibilityFocus,
|
|
32
|
+
useAccessibilityFocusHistory,
|
|
33
|
+
useAccessibleAfterTransition,
|
|
34
|
+
useIsOutsideTransition,
|
|
35
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"accessibility.control.combobox.expanded": "erweitert",
|
|
3
|
+
"accessibility.control.combobox.tapToSelect": "Zum Auswählen doppeltippen",
|
|
4
|
+
"accessibility.control.order": "{current} von {length}",
|
|
5
|
+
"accessibility.control.progress": "{current} von {length}",
|
|
6
|
+
"accessibility.control.checked": "ausgewählt",
|
|
7
|
+
"accessibility.control.unchecked": "nicht ausgewählt",
|
|
8
|
+
"accessibility.control.clear": "löschen",
|
|
9
|
+
"accessibility.control.delete": "löschen",
|
|
10
|
+
"accessibility.control.list.moveDown": "Nach unten bewegen",
|
|
11
|
+
"accessibility.control.list.moveUp": "Nach oben bewegen",
|
|
12
|
+
"accessibility.nav.back": "zurück",
|
|
13
|
+
"accessibility.nav.close": "schliessen",
|
|
14
|
+
"accessibility.nav.next": "weiter",
|
|
15
|
+
"accessibility.icon.edit": "bearbeiten",
|
|
16
|
+
"accessibility.icon.add": "hinzufügen",
|
|
17
|
+
"accessibility.icon.filter": "filter",
|
|
18
|
+
"accessibility.icon.scan": "scannen",
|
|
19
|
+
"accessibility.key.faceId": "faceId",
|
|
20
|
+
"accessibility.key.fingerprint": "Fingerabdruck"
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"accessibility.control.combobox.expanded": "Expanded",
|
|
3
|
+
"accessibility.control.combobox.tapToSelect": "Double-tap to select",
|
|
4
|
+
"accessibility.control.order": "{current} of {length}",
|
|
5
|
+
"accessibility.control.progress": "{current} out of {length}",
|
|
6
|
+
"accessibility.control.checked": "checked",
|
|
7
|
+
"accessibility.control.unchecked": "not checked",
|
|
8
|
+
"accessibility.control.clear": "clear",
|
|
9
|
+
"accessibility.control.delete": "delete",
|
|
10
|
+
"accessibility.control.list.moveDown": "Move down",
|
|
11
|
+
"accessibility.control.list.moveUp": "Move up",
|
|
12
|
+
"accessibility.nav.back": "back",
|
|
13
|
+
"accessibility.nav.close": "close",
|
|
14
|
+
"accessibility.nav.next": "next",
|
|
15
|
+
"accessibility.icon.edit": "edit",
|
|
16
|
+
"accessibility.icon.add": "add",
|
|
17
|
+
"accessibility.icon.filter": "filter",
|
|
18
|
+
"accessibility.icon.scan": "scan",
|
|
19
|
+
"accessibility.key.faceId": "faceId",
|
|
20
|
+
"accessibility.key.fingerprint": "fingerprint"
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"accessibility.control.combobox.expanded": "Élargi",
|
|
3
|
+
"accessibility.control.combobox.tapToSelect": "Touchez deux fois pour sélectionner",
|
|
4
|
+
"accessibility.control.order": "{current} de {length}",
|
|
5
|
+
"accessibility.control.progress": "{current} sur {length}",
|
|
6
|
+
"accessibility.control.checked": "cochée",
|
|
7
|
+
"accessibility.control.unchecked": "décochée",
|
|
8
|
+
"accessibility.control.clear": "effacer",
|
|
9
|
+
"accessibility.control.delete": "supprimer",
|
|
10
|
+
"accessibility.control.list.moveDown": "Descendre",
|
|
11
|
+
"accessibility.control.list.moveUp": "Avancez",
|
|
12
|
+
"accessibility.nav.back": "retour",
|
|
13
|
+
"accessibility.nav.close": "fermer",
|
|
14
|
+
"accessibility.nav.next": "suivant",
|
|
15
|
+
"accessibility.icon.edit": "modifier",
|
|
16
|
+
"accessibility.icon.add": "ajouter",
|
|
17
|
+
"accessibility.icon.filter": "filtre",
|
|
18
|
+
"accessibility.icon.scan": "scanner",
|
|
19
|
+
"accessibility.key.faceId": "faceId",
|
|
20
|
+
"accessibility.key.fingerprint": "Empreinte digitale"
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import de from './de.json';
|
|
2
|
+
import en from './en.json';
|
|
3
|
+
import fr from './fr.json';
|
|
4
|
+
import it from './it.json';
|
|
5
|
+
|
|
6
|
+
export const defaultLanguageFiles = { en, de, fr, it };
|
|
7
|
+
|
|
8
|
+
export type SupportedAccessibilityLanguage = keyof typeof defaultLanguageFiles;
|
|
9
|
+
export type AccessibilityLanguageFile = typeof en;
|
|
10
|
+
|
|
11
|
+
export const getAccessibilityLanguageFile = (
|
|
12
|
+
language: SupportedAccessibilityLanguage,
|
|
13
|
+
overrides?: Partial<AccessibilityLanguageFile>,
|
|
14
|
+
): AccessibilityLanguageFile =>
|
|
15
|
+
Object.assign<{}, AccessibilityLanguageFile, Partial<AccessibilityLanguageFile> | undefined>(
|
|
16
|
+
{},
|
|
17
|
+
defaultLanguageFiles[language],
|
|
18
|
+
overrides,
|
|
19
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"accessibility.control.combobox.expanded": "Espanso",
|
|
3
|
+
"accessibility.control.combobox.tapToSelect": "Tocca due volte per selezionare",
|
|
4
|
+
"accessibility.control.order": "{current} di {length}",
|
|
5
|
+
"accessibility.control.progress": "{current} su {length}",
|
|
6
|
+
"accessibility.control.checked": "selezionato",
|
|
7
|
+
"accessibility.control.unchecked": "deselezionato",
|
|
8
|
+
"accessibility.control.clear": "cancellare",
|
|
9
|
+
"accessibility.control.delete": "cancellare",
|
|
10
|
+
"accessibility.control.list.moveDown": "Scendere",
|
|
11
|
+
"accessibility.control.list.moveUp": "Salire",
|
|
12
|
+
"accessibility.nav.back": "indietro",
|
|
13
|
+
"accessibility.nav.close": "chiudere",
|
|
14
|
+
"accessibility.nav.next": "prossimo",
|
|
15
|
+
"accessibility.icon.edit": "modificare",
|
|
16
|
+
"accessibility.icon.add": "addizionare",
|
|
17
|
+
"accessibility.icon.scan": "scannerizzare",
|
|
18
|
+
"accessibility.icon.filter": "filtro",
|
|
19
|
+
"accessibility.key.faceId": "faceId",
|
|
20
|
+
"accessibility.key.fingerprint": "Impronta digitale"
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AccessibilityLanguageFile, defaultLanguageFiles, SupportedAccessibilityLanguage } from './locale';
|
|
2
|
+
|
|
3
|
+
it('language files consistency', () => {
|
|
4
|
+
const mainFile: AccessibilityLanguageFile = defaultLanguageFiles.en;
|
|
5
|
+
const getNumberOfEntries = (file: AccessibilityLanguageFile) => Object.keys(file).length;
|
|
6
|
+
|
|
7
|
+
Object.keys(defaultLanguageFiles).forEach((lang) => {
|
|
8
|
+
const checkedFile: AccessibilityLanguageFile = defaultLanguageFiles[lang as SupportedAccessibilityLanguage];
|
|
9
|
+
|
|
10
|
+
expect(getNumberOfEntries(checkedFile)).toBe(getNumberOfEntries(mainFile));
|
|
11
|
+
|
|
12
|
+
Object.keys(checkedFile).forEach((entryKey) => {
|
|
13
|
+
expect(Object.keys(mainFile)).toContain(entryKey);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ComponentMeta, Story } from '@storybook/react';
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { Button } from '../buttons';
|
|
6
|
+
import { Typography } from '../text';
|
|
7
|
+
import ActionModal from './ActionModal';
|
|
8
|
+
|
|
9
|
+
const Basic: Story = () => {
|
|
10
|
+
const [visible, setVisible] = useState(false);
|
|
11
|
+
return (
|
|
12
|
+
<>
|
|
13
|
+
<Button title="Show modal" onPress={() => setVisible(true)} />
|
|
14
|
+
<ActionModal visible={visible}>
|
|
15
|
+
<View>
|
|
16
|
+
<Typography color={'white'}>Example text in modal</Typography>
|
|
17
|
+
<Button title="Hide modal" onPress={() => setVisible(false)} />
|
|
18
|
+
</View>
|
|
19
|
+
</ActionModal>
|
|
20
|
+
</>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { Basic as ActionModal };
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
title: 'base/Action Modal',
|
|
28
|
+
component: ActionModal,
|
|
29
|
+
parameters: {
|
|
30
|
+
design: {
|
|
31
|
+
type: 'figma',
|
|
32
|
+
url: 'https://www.figma.com/file/Gd0Tj0234hxtl3HMcCJThW/App-Component-Library-(Design)?node-id=391-9097&t=WhKthlRU5MCuUWfw-0',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
} as ComponentMeta<typeof ActionModal>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { FunctionComponent, PropsWithChildren } from 'react';
|
|
2
|
+
import { Modal, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { useAppColorScheme } from '../theme';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
contentStyle?: StyleProp<ViewStyle>;
|
|
8
|
+
style?: StyleProp<ViewStyle>;
|
|
9
|
+
visible: boolean;
|
|
10
|
+
testID?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const styles = StyleSheet.create({
|
|
14
|
+
background: {
|
|
15
|
+
height: '100%',
|
|
16
|
+
width: '100%',
|
|
17
|
+
},
|
|
18
|
+
contentContainer: {
|
|
19
|
+
borderTopLeftRadius: 20,
|
|
20
|
+
borderTopRightRadius: 20,
|
|
21
|
+
marginTop: 'auto',
|
|
22
|
+
width: '100%',
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const ActionModal: FunctionComponent<PropsWithChildren<Props>> = ({
|
|
27
|
+
children,
|
|
28
|
+
contentStyle,
|
|
29
|
+
style,
|
|
30
|
+
visible,
|
|
31
|
+
testID,
|
|
32
|
+
}) => {
|
|
33
|
+
const colorScheme = useAppColorScheme();
|
|
34
|
+
const overlay = 'rgba(0, 0, 0, 0.5)';
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Modal animationType="fade" statusBarTranslucent style={style} transparent visible={visible}>
|
|
38
|
+
<View testID={testID} style={[styles.background, { backgroundColor: overlay }]}>
|
|
39
|
+
<View style={[styles.contentContainer, { backgroundColor: colorScheme.white }, contentStyle]}>{children}</View>
|
|
40
|
+
</View>
|
|
41
|
+
</Modal>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default ActionModal;
|