@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
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2024 Procivis AG
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+

|
|
2
|
+

|
|
3
|
+
|
|
4
|
+
# One Core React Components
|
|
5
|
+
|
|
6
|
+
React Native UI components for the [Procivis One Wallet][wallet].
|
|
7
|
+
|
|
8
|
+
The Procivis One Wallet uses the [Procivis One Core][core] for all SSI functionality
|
|
9
|
+
via the [One Core React Native SDK][rncore].
|
|
10
|
+
|
|
11
|
+
The Procivis One Core is a complete solution capable of powering every element
|
|
12
|
+
of the digital identity credential lifecycle. See the complete solution [architecture][archi].
|
|
13
|
+
|
|
14
|
+
## How to use the One Core React Components
|
|
15
|
+
|
|
16
|
+
- Use the library for UI elements for your digital wallet app
|
|
17
|
+
- Use the [Procivis One Wallet][wallet] for a free-standing solution that can be white-labeled
|
|
18
|
+
- Use the [One Core React Native SDK][rncore] to embed wallet capabilities into an existing app
|
|
19
|
+
|
|
20
|
+
## Getting started
|
|
21
|
+
|
|
22
|
+
### Trial
|
|
23
|
+
|
|
24
|
+
The fastest way to get started with the Procivis One Wallet is to download the app
|
|
25
|
+
from the iOS or Android app stores and [join our Trial Environment][trial].
|
|
26
|
+
In the trial environment, you are given control of an organization on our server
|
|
27
|
+
solution, the Procivis One Desk, and can quickly begin issuing and verifying credentials.
|
|
28
|
+
|
|
29
|
+
### Documentation
|
|
30
|
+
|
|
31
|
+
See our documentation:
|
|
32
|
+
|
|
33
|
+
- [Core SDK Reference][sdkref]
|
|
34
|
+
- [Docs home][docs]
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
```shell
|
|
39
|
+
npm install @procivis/one-react-native-components
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```shell
|
|
43
|
+
yarn add @procivis/one-react-native-components
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Support
|
|
47
|
+
|
|
48
|
+
Need support or have feedback? [Contact us](https://www.procivis.ch/en/contact).
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
Some rights reserved. This library is published under the [Apache License
|
|
53
|
+
Version 2.0](./LICENSE).
|
|
54
|
+
|
|
55
|
+

|
|
56
|
+

|
|
57
|
+
|
|
58
|
+
© Procivis AG, [https://www.procivis.ch](https://www.procivis.ch).
|
|
59
|
+
|
|
60
|
+
[archi]: https://github.com/procivis#architecture
|
|
61
|
+
[core]: https://github.com/procivis/one-core
|
|
62
|
+
[docs]: https://docs.procivis.ch/
|
|
63
|
+
[rncore]: https://github.com/procivis/react-native-one-core
|
|
64
|
+
[sdkref]: https://docs.procivis.ch/sdk/overview
|
|
65
|
+
[trial]: https://docs.procivis.ch/trial/intro
|
|
66
|
+
[wallet]: https://github.com/procivis/one-wallet
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.focusAccessibility = void 0;
|
|
7
|
+
exports.setAccessibilityTextTransformer = setAccessibilityTextTransformer;
|
|
8
|
+
exports.transformAccessibilityText = transformAccessibilityText;
|
|
9
|
+
exports.useAccessibilityFocus = exports.useAccessibilityAnnouncementCumulative = exports.useAccessibilityAnnouncement = void 0;
|
|
10
|
+
exports.useAccessibleAfterTransition = useAccessibleAfterTransition;
|
|
11
|
+
exports.useIsOutsideTransition = useIsOutsideTransition;
|
|
12
|
+
var _native = require("@react-navigation/native");
|
|
13
|
+
var _react = require("react");
|
|
14
|
+
var _reactNative = require("react-native");
|
|
15
|
+
let textTransformer = null;
|
|
16
|
+
function setAccessibilityTextTransformer(transformer) {
|
|
17
|
+
textTransformer = transformer;
|
|
18
|
+
}
|
|
19
|
+
function transformAccessibilityText(text) {
|
|
20
|
+
return textTransformer && text ? textTransformer(text) : text;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Make element accessible after navigation transition is done
|
|
25
|
+
* @returns {boolean} flag to be used as `accessible` prop on the target component(s)
|
|
26
|
+
*/
|
|
27
|
+
function useAccessibleAfterTransition() {
|
|
28
|
+
const navigation = (0, _native.useNavigation)();
|
|
29
|
+
const [accessible, setAccessible] = (0, _react.useState)(false);
|
|
30
|
+
const isFocused = (0, _native.useIsFocused)();
|
|
31
|
+
(0, _react.useEffect)(() => {
|
|
32
|
+
if (!isFocused) {
|
|
33
|
+
setAccessible(false);
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
const unsubscribe = navigation.addListener('transitionEnd', () => setAccessible(true));
|
|
37
|
+
// fallback for cases when transition doesn't happen (e.g. forceful screen re-render)
|
|
38
|
+
const timeout = setTimeout(() => setAccessible(true), 500);
|
|
39
|
+
return () => {
|
|
40
|
+
unsubscribe();
|
|
41
|
+
clearTimeout(timeout);
|
|
42
|
+
};
|
|
43
|
+
}, [navigation, isFocused]);
|
|
44
|
+
return isFocused && accessible;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Query whether the current screen is NOT transitioning
|
|
49
|
+
* @returns {boolean} flag signifying whether the current screen is NOT in a transition (either entering or leaving)
|
|
50
|
+
*/
|
|
51
|
+
function useIsOutsideTransition() {
|
|
52
|
+
const navigation = (0, _native.useNavigation)();
|
|
53
|
+
const [inTransition, setInTransition] = (0, _react.useState)(true);
|
|
54
|
+
const isFocused = (0, _native.useIsFocused)();
|
|
55
|
+
const focused = (0, _react.useRef)(isFocused);
|
|
56
|
+
focused.current = isFocused;
|
|
57
|
+
(0, _react.useEffect)(() => {
|
|
58
|
+
const unsubscribeStart = navigation.addListener('transitionStart', () => setInTransition(true));
|
|
59
|
+
const unsubscribeEnd = navigation.addListener('transitionEnd', () => {
|
|
60
|
+
if (focused.current) {
|
|
61
|
+
setInTransition(false);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return () => {
|
|
65
|
+
unsubscribeStart();
|
|
66
|
+
unsubscribeEnd();
|
|
67
|
+
};
|
|
68
|
+
}, [navigation]);
|
|
69
|
+
(0, _react.useEffect)(() => {
|
|
70
|
+
if (!isFocused) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
setInTransition(true);
|
|
74
|
+
// fallback for cases when transition callback doesn't happen (e.g. forceful screen re-render)
|
|
75
|
+
const timeout = setTimeout(() => setInTransition(false), 500);
|
|
76
|
+
return () => {
|
|
77
|
+
clearTimeout(timeout);
|
|
78
|
+
};
|
|
79
|
+
}, [isFocused]);
|
|
80
|
+
return isFocused && !inTransition;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Focuses an element for accessibility
|
|
85
|
+
* @param component component ref
|
|
86
|
+
* @note Disabled on android as it is not reliable
|
|
87
|
+
*/
|
|
88
|
+
const focusAccessibility = component => {
|
|
89
|
+
if (_reactNative.Platform.OS === 'ios' && component) {
|
|
90
|
+
const nodeHandle = (0, _reactNative.findNodeHandle)(component);
|
|
91
|
+
if (nodeHandle) {
|
|
92
|
+
_reactNative.AccessibilityInfo.setAccessibilityFocus(nodeHandle);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Focuses an element for accessibility
|
|
99
|
+
* @param {boolean} focused Focusing happens when this changes to `true`
|
|
100
|
+
* @returns reference to be used with the target element
|
|
101
|
+
*/
|
|
102
|
+
exports.focusAccessibility = focusAccessibility;
|
|
103
|
+
const useAccessibilityFocus = function () {
|
|
104
|
+
let focused = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
105
|
+
const ref = (0, _react.useRef)(null);
|
|
106
|
+
(0, _react.useEffect)(() => {
|
|
107
|
+
if (focused) {
|
|
108
|
+
focusAccessibility(ref.current);
|
|
109
|
+
}
|
|
110
|
+
}, [focused]);
|
|
111
|
+
return ref;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Posts a screen-reader/voice-over announcement
|
|
116
|
+
* @param {string} message Announcement message
|
|
117
|
+
* * if `null` passed, it resets the cached announcement and the same message can be re-announced again
|
|
118
|
+
* @returns {boolean} When the announcement is successfully finished (only supported on iOS), false otherwise
|
|
119
|
+
* @note Use {@link setAccessibilityTextTransformer} to apply text transformation for the read-out text
|
|
120
|
+
*/
|
|
121
|
+
exports.useAccessibilityFocus = useAccessibilityFocus;
|
|
122
|
+
const useAccessibilityAnnouncement = message => {
|
|
123
|
+
const announcement = message ? transformAccessibilityText(message) : message;
|
|
124
|
+
const [announcementFinished, setAnnouncementFinished] = (0, _react.useState)();
|
|
125
|
+
(0, _react.useEffect)(() => {
|
|
126
|
+
if (announcement === null) {
|
|
127
|
+
// explicitly clearing cached state
|
|
128
|
+
setAnnouncementFinished(undefined);
|
|
129
|
+
}
|
|
130
|
+
if (!announcement) {
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
let subscription;
|
|
134
|
+
const unsubscribe = () => {
|
|
135
|
+
var _subscription;
|
|
136
|
+
return (_subscription = subscription) === null || _subscription === void 0 ? void 0 : _subscription.remove();
|
|
137
|
+
};
|
|
138
|
+
if (_reactNative.Platform.OS === 'ios') {
|
|
139
|
+
let retries = 0;
|
|
140
|
+
subscription = _reactNative.AccessibilityInfo.addEventListener('announcementFinished', _ref => {
|
|
141
|
+
let {
|
|
142
|
+
announcement: finished,
|
|
143
|
+
success
|
|
144
|
+
} = _ref;
|
|
145
|
+
if (finished === announcement) {
|
|
146
|
+
if (success) {
|
|
147
|
+
setAnnouncementFinished(announcement);
|
|
148
|
+
unsubscribe();
|
|
149
|
+
} else if (retries++ < 2) {
|
|
150
|
+
// when the automatic voice-over cancels the first try (e.g. after screen transition), let's attempt again one more time
|
|
151
|
+
_reactNative.AccessibilityInfo.announceForAccessibility(announcement);
|
|
152
|
+
} else {
|
|
153
|
+
unsubscribe();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
_reactNative.AccessibilityInfo.announceForAccessibility(announcement);
|
|
159
|
+
return unsubscribe;
|
|
160
|
+
}, [announcement]);
|
|
161
|
+
return Boolean(announcement && announcementFinished === announcement);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Posts a screen-reader/voice-over announcement
|
|
166
|
+
* @param {string} message Announcement message
|
|
167
|
+
* @param {boolean} waitForPreviousAnnouncement When a new message appears before the previous announcement if finished:
|
|
168
|
+
* - `true`: postpone the new message to be announced after the previous message(s)
|
|
169
|
+
* - `false` (default): cancel the previous announcement and start the new message
|
|
170
|
+
* @returns {boolean} When all announcements are finished (only supported on iOS), false otherwise
|
|
171
|
+
* @see {@link useAccessibilityAnnouncement} for further info
|
|
172
|
+
*/
|
|
173
|
+
exports.useAccessibilityAnnouncement = useAccessibilityAnnouncement;
|
|
174
|
+
const useAccessibilityAnnouncementCumulative = (message, waitForPreviousAnnouncement) => {
|
|
175
|
+
// waiting only possible on iOS
|
|
176
|
+
const wait = _reactNative.Platform.OS === 'ios' && waitForPreviousAnnouncement;
|
|
177
|
+
const [announcements, setAnnouncements] = (0, _react.useState)([]);
|
|
178
|
+
(0, _react.useEffect)(() => {
|
|
179
|
+
if (message) {
|
|
180
|
+
setAnnouncements(prev => [...prev, message]);
|
|
181
|
+
}
|
|
182
|
+
}, [message]);
|
|
183
|
+
const nextAnnouncement = wait ? announcements[0] : message;
|
|
184
|
+
const finished = useAccessibilityAnnouncement(nextAnnouncement);
|
|
185
|
+
(0, _react.useEffect)(() => {
|
|
186
|
+
if (finished) {
|
|
187
|
+
setAnnouncements(prev => prev.filter(m => m !== nextAnnouncement));
|
|
188
|
+
}
|
|
189
|
+
}, [nextAnnouncement, finished]);
|
|
190
|
+
return wait ? !announcements.length : finished;
|
|
191
|
+
};
|
|
192
|
+
exports.useAccessibilityAnnouncementCumulative = useAccessibilityAnnouncementCumulative;
|
|
193
|
+
//# sourceMappingURL=accessibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_native","require","_react","_reactNative","textTransformer","setAccessibilityTextTransformer","transformer","transformAccessibilityText","text","useAccessibleAfterTransition","navigation","useNavigation","accessible","setAccessible","useState","isFocused","useIsFocused","useEffect","undefined","unsubscribe","addListener","timeout","setTimeout","clearTimeout","useIsOutsideTransition","inTransition","setInTransition","focused","useRef","current","unsubscribeStart","unsubscribeEnd","focusAccessibility","component","Platform","OS","nodeHandle","findNodeHandle","AccessibilityInfo","setAccessibilityFocus","exports","useAccessibilityFocus","arguments","length","ref","useAccessibilityAnnouncement","message","announcement","announcementFinished","setAnnouncementFinished","subscription","_subscription","remove","retries","addEventListener","_ref","finished","success","announceForAccessibility","Boolean","useAccessibilityAnnouncementCumulative","waitForPreviousAnnouncement","wait","announcements","setAnnouncements","prev","nextAnnouncement","filter","m"],"sources":["accessibility.ts"],"sourcesContent":["import { NavigationProp, NavigationState, useIsFocused, useNavigation } from '@react-navigation/native';\nimport { useEffect, useRef, useState } from 'react';\nimport { AccessibilityInfo, EmitterSubscription, findNodeHandle, Platform } from 'react-native';\n\n/**\n * Global transformer of text for Voice-Over\n * @param {string} text (Visible) text to be announced\n * @returns {string} Text to be read-out by Voice-Over\n */\nexport type AccessibilityTextTransformer = (text: string) => string;\nlet textTransformer: AccessibilityTextTransformer | null = null;\nexport function setAccessibilityTextTransformer(transformer: AccessibilityTextTransformer | null) {\n textTransformer = transformer;\n}\nexport function transformAccessibilityText(text: string) {\n return textTransformer && text ? textTransformer(text) : text;\n}\n\n/**\n * Make element accessible after navigation transition is done\n * @returns {boolean} flag to be used as `accessible` prop on the target component(s)\n */\nexport function useAccessibleAfterTransition<\n TNavigationProp extends NavigationProp<\n Record<string, any>,\n string,\n NavigationState<Record<string, any>>,\n {},\n { transitionEnd: {} }\n >,\n>() {\n const navigation = useNavigation<TNavigationProp>();\n const [accessible, setAccessible] = useState(false);\n\n const isFocused = useIsFocused();\n useEffect(() => {\n if (!isFocused) {\n setAccessible(false);\n return undefined;\n }\n const unsubscribe = navigation.addListener('transitionEnd', () => setAccessible(true));\n // fallback for cases when transition doesn't happen (e.g. forceful screen re-render)\n const timeout = setTimeout(() => setAccessible(true), 500);\n return () => {\n unsubscribe();\n clearTimeout(timeout);\n };\n }, [navigation, isFocused]);\n\n return isFocused && accessible;\n}\n\n/**\n * Query whether the current screen is NOT transitioning\n * @returns {boolean} flag signifying whether the current screen is NOT in a transition (either entering or leaving)\n */\nexport function useIsOutsideTransition<\n TNavigationProp extends NavigationProp<\n Record<string, any>,\n string,\n NavigationState<Record<string, any>>,\n {},\n { transitionStart: {}; transitionEnd: {} }\n >,\n>() {\n const navigation = useNavigation<TNavigationProp>();\n const [inTransition, setInTransition] = useState<boolean>(true);\n\n const isFocused = useIsFocused();\n const focused = useRef(isFocused);\n focused.current = isFocused;\n\n useEffect(() => {\n const unsubscribeStart = navigation.addListener('transitionStart', () => setInTransition(true));\n const unsubscribeEnd = navigation.addListener('transitionEnd', () => {\n if (focused.current) {\n setInTransition(false);\n }\n });\n return () => {\n unsubscribeStart();\n unsubscribeEnd();\n };\n }, [navigation]);\n\n useEffect(() => {\n if (!isFocused) {\n return undefined;\n }\n\n setInTransition(true);\n // fallback for cases when transition callback doesn't happen (e.g. forceful screen re-render)\n const timeout = setTimeout(() => setInTransition(false), 500);\n return () => {\n clearTimeout(timeout);\n };\n }, [isFocused]);\n\n return isFocused && !inTransition;\n}\n\n/**\n * Focuses an element for accessibility\n * @param component component ref\n * @note Disabled on android as it is not reliable\n */\nexport const focusAccessibility = (component?: React.Component | React.ComponentClass | null) => {\n if (Platform.OS === 'ios' && component) {\n const nodeHandle = findNodeHandle(component);\n if (nodeHandle) {\n AccessibilityInfo.setAccessibilityFocus(nodeHandle);\n }\n }\n};\n\n/**\n * Focuses an element for accessibility\n * @param {boolean} focused Focusing happens when this changes to `true`\n * @returns reference to be used with the target element\n */\nexport const useAccessibilityFocus = <T extends React.Component | React.ComponentClass>(focused: boolean = true) => {\n const ref = useRef<T>(null);\n\n useEffect(() => {\n if (focused) {\n focusAccessibility(ref.current);\n }\n }, [focused]);\n\n return ref;\n};\n\n/**\n * Posts a screen-reader/voice-over announcement\n * @param {string} message Announcement message\n * * if `null` passed, it resets the cached announcement and the same message can be re-announced again\n * @returns {boolean} When the announcement is successfully finished (only supported on iOS), false otherwise\n * @note Use {@link setAccessibilityTextTransformer} to apply text transformation for the read-out text\n */\nexport const useAccessibilityAnnouncement = (message?: string | null): boolean => {\n const announcement = message ? transformAccessibilityText(message) : message;\n const [announcementFinished, setAnnouncementFinished] = useState<string>();\n useEffect(() => {\n if (announcement === null) {\n // explicitly clearing cached state\n setAnnouncementFinished(undefined);\n }\n\n if (!announcement) {\n return undefined;\n }\n\n let subscription: EmitterSubscription;\n const unsubscribe = () => subscription?.remove();\n if (Platform.OS === 'ios') {\n let retries = 0;\n subscription = AccessibilityInfo.addEventListener(\n 'announcementFinished',\n ({ announcement: finished, success }) => {\n if (finished === announcement) {\n if (success) {\n setAnnouncementFinished(announcement);\n unsubscribe();\n } else if (retries++ < 2) {\n // when the automatic voice-over cancels the first try (e.g. after screen transition), let's attempt again one more time\n AccessibilityInfo.announceForAccessibility(announcement);\n } else {\n unsubscribe();\n }\n }\n },\n );\n }\n\n AccessibilityInfo.announceForAccessibility(announcement);\n return unsubscribe;\n }, [announcement]);\n\n return Boolean(announcement && announcementFinished === announcement);\n};\n\n/**\n * Posts a screen-reader/voice-over announcement\n * @param {string} message Announcement message\n * @param {boolean} waitForPreviousAnnouncement When a new message appears before the previous announcement if finished:\n * - `true`: postpone the new message to be announced after the previous message(s)\n * - `false` (default): cancel the previous announcement and start the new message\n * @returns {boolean} When all announcements are finished (only supported on iOS), false otherwise\n * @see {@link useAccessibilityAnnouncement} for further info\n */\nexport const useAccessibilityAnnouncementCumulative = (\n message?: string,\n waitForPreviousAnnouncement?: boolean,\n): boolean => {\n // waiting only possible on iOS\n const wait = Platform.OS === 'ios' && waitForPreviousAnnouncement;\n\n const [announcements, setAnnouncements] = useState<string[]>([]);\n useEffect(() => {\n if (message) {\n setAnnouncements((prev) => [...prev, message]);\n }\n }, [message]);\n\n const nextAnnouncement = wait ? announcements[0] : message;\n const finished = useAccessibilityAnnouncement(nextAnnouncement);\n\n useEffect(() => {\n if (finished) {\n setAnnouncements((prev) => prev.filter((m) => m !== nextAnnouncement));\n }\n }, [nextAnnouncement, finished]);\n\n return wait ? !announcements.length : finished;\n};\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAQA,IAAIG,eAAoD,GAAG,IAAI;AACxD,SAASC,+BAA+BA,CAACC,WAAgD,EAAE;EAChGF,eAAe,GAAGE,WAAW;AAC/B;AACO,SAASC,0BAA0BA,CAACC,IAAY,EAAE;EACvD,OAAOJ,eAAe,IAAII,IAAI,GAAGJ,eAAe,CAACI,IAAI,CAAC,GAAGA,IAAI;AAC/D;;AAEA;AACA;AACA;AACA;AACO,SAASC,4BAA4BA,CAAA,EAQxC;EACF,MAAMC,UAAU,GAAG,IAAAC,qBAAa,GAAmB;EACnD,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAEnD,MAAMC,SAAS,GAAG,IAAAC,oBAAY,GAAE;EAChC,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;AACA;AACA;AARAP,OAAA,CAAAK,4BAAA,GAAAA,4BAAA;AASO,MAAMe,sCAAsC,GAAGA,CACpDd,OAAgB,EAChBe,2BAAqC,KACzB;EACZ;EACA,MAAMC,IAAI,GAAG5B,qBAAQ,CAACC,EAAE,KAAK,KAAK,IAAI0B,2BAA2B;EAEjE,MAAM,CAACE,aAAa,EAAEC,gBAAgB,CAAC,GAAG,IAAAlD,eAAQ,EAAW,EAAE,CAAC;EAChE,IAAAG,gBAAS,EAAC,MAAM;IACd,IAAI6B,OAAO,EAAE;MACXkB,gBAAgB,CAAEC,IAAI,IAAK,CAAC,GAAGA,IAAI,EAAEnB,OAAO,CAAC,CAAC;IAChD;EACF,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;EAEb,MAAMoB,gBAAgB,GAAGJ,IAAI,GAAGC,aAAa,CAAC,CAAC,CAAC,GAAGjB,OAAO;EAC1D,MAAMU,QAAQ,GAAGX,4BAA4B,CAACqB,gBAAgB,CAAC;EAE/D,IAAAjD,gBAAS,EAAC,MAAM;IACd,IAAIuC,QAAQ,EAAE;MACZQ,gBAAgB,CAAEC,IAAI,IAAKA,IAAI,CAACE,MAAM,CAAEC,CAAC,IAAKA,CAAC,KAAKF,gBAAgB,CAAC,CAAC;IACxE;EACF,CAAC,EAAE,CAACA,gBAAgB,EAAEV,QAAQ,CAAC,CAAC;EAEhC,OAAOM,IAAI,GAAG,CAACC,aAAa,CAACpB,MAAM,GAAGa,QAAQ;AAChD,CAAC;AAAChB,OAAA,CAAAoB,sCAAA,GAAAA,sCAAA"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useAccessibilityFocusHistory = exports.AccessibilityFocusHistoryProvider = void 0;
|
|
7
|
+
var _native = require("@react-navigation/native");
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _ref2 = require("../utils/ref");
|
|
10
|
+
var _accessibility = require("./accessibility");
|
|
11
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
+
const accessibilityFocusHistoryContext = /*#__PURE__*/_react.default.createContext({
|
|
14
|
+
setRef: () => {},
|
|
15
|
+
getRef: () => null
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Adds app support for accessibility focus history
|
|
20
|
+
*/
|
|
21
|
+
const AccessibilityFocusHistoryProvider = _ref => {
|
|
22
|
+
let {
|
|
23
|
+
children
|
|
24
|
+
} = _ref;
|
|
25
|
+
const Provider = accessibilityFocusHistoryContext.Provider;
|
|
26
|
+
const refs = (0, _react.useRef)({});
|
|
27
|
+
const setRef = (0, _react.useCallback)((route, ref) => {
|
|
28
|
+
refs.current[route] = ref;
|
|
29
|
+
}, []);
|
|
30
|
+
const getRef = (0, _react.useCallback)(route => {
|
|
31
|
+
var _refs$current$route;
|
|
32
|
+
return (_refs$current$route = refs.current[route]) !== null && _refs$current$route !== void 0 ? _refs$current$route : null;
|
|
33
|
+
}, []);
|
|
34
|
+
const value = (0, _react.useMemo)(() => ({
|
|
35
|
+
setRef,
|
|
36
|
+
getRef
|
|
37
|
+
}), [getRef, setRef]);
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement(Provider, {
|
|
39
|
+
value: value
|
|
40
|
+
}, children);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Wraps `onPress` handler and `ref` to support automatic accessibility focus on back navigation
|
|
45
|
+
* @note This needs to be used inside {@link AccessibilityFocusHistoryProvider} and navigation context
|
|
46
|
+
*/
|
|
47
|
+
exports.AccessibilityFocusHistoryProvider = AccessibilityFocusHistoryProvider;
|
|
48
|
+
const useAccessibilityFocusHistory = (pressHandler, passedRef) => {
|
|
49
|
+
const [forwardedRef, refObject] = (0, _ref2.useForwardedRef)(passedRef);
|
|
50
|
+
const historyContext = (0, _react.useContext)(accessibilityFocusHistoryContext);
|
|
51
|
+
const routeKey = (0, _native.useRoute)().key;
|
|
52
|
+
const previouslyPressed = (0, _react.useRef)(false);
|
|
53
|
+
const outsideTransition = (0, _accessibility.useAccessibleAfterTransition)();
|
|
54
|
+
(0, _react.useEffect)(() => {
|
|
55
|
+
const isStoredInHistory = historyContext.getRef(routeKey) === refObject.current;
|
|
56
|
+
if (outsideTransition && isStoredInHistory && previouslyPressed.current) {
|
|
57
|
+
(0, _accessibility.focusAccessibility)(refObject.current);
|
|
58
|
+
}
|
|
59
|
+
}, [historyContext, outsideTransition, refObject, routeKey]);
|
|
60
|
+
(0, _react.useEffect)(() => {
|
|
61
|
+
if (outsideTransition) {
|
|
62
|
+
previouslyPressed.current = false;
|
|
63
|
+
}
|
|
64
|
+
}, [outsideTransition]);
|
|
65
|
+
|
|
66
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
67
|
+
const onPress = (0, _react.useCallback)(function () {
|
|
68
|
+
previouslyPressed.current = true;
|
|
69
|
+
historyContext.setRef(routeKey, refObject.current);
|
|
70
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
71
|
+
args[_key] = arguments[_key];
|
|
72
|
+
}
|
|
73
|
+
return pressHandler === null || pressHandler === void 0 ? void 0 : pressHandler(...args);
|
|
74
|
+
}, [historyContext, routeKey, refObject, pressHandler]);
|
|
75
|
+
return {
|
|
76
|
+
onPress,
|
|
77
|
+
ref: forwardedRef
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
exports.useAccessibilityFocusHistory = useAccessibilityFocusHistory;
|
|
81
|
+
//# sourceMappingURL=accessibilityHistory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_native","require","_react","_interopRequireWildcard","_ref2","_accessibility","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","accessibilityFocusHistoryContext","React","createContext","setRef","getRef","AccessibilityFocusHistoryProvider","_ref","children","Provider","refs","useRef","useCallback","route","ref","current","_refs$current$route","value","useMemo","createElement","exports","useAccessibilityFocusHistory","pressHandler","passedRef","forwardedRef","refObject","useForwardedRef","historyContext","useContext","routeKey","useRoute","previouslyPressed","outsideTransition","useAccessibleAfterTransition","useEffect","isStoredInHistory","focusAccessibility","onPress","_len","arguments","length","args","Array","_key"],"sources":["accessibilityHistory.tsx"],"sourcesContent":["import { useRoute } from '@react-navigation/native';\nimport React, { FC, PropsWithChildren, useCallback, useContext, useEffect, useMemo, useRef } from 'react';\n\nimport { useForwardedRef } from '../utils/ref';\nimport { focusAccessibility, useAccessibleAfterTransition } from './accessibility';\n\ntype AccessibilityRefComponent = React.Component | React.ComponentClass | null;\ninterface AccessibilityRefContextValue {\n setRef: (route: string, ref: AccessibilityRefComponent) => void;\n getRef: (route: string) => AccessibilityRefComponent;\n}\n\nconst accessibilityFocusHistoryContext = React.createContext<AccessibilityRefContextValue>({\n setRef: () => {},\n getRef: () => null,\n});\n\n/**\n * Adds app support for accessibility focus history\n */\nexport const AccessibilityFocusHistoryProvider: FC<PropsWithChildren<{}>> = ({ children }) => {\n const Provider = accessibilityFocusHistoryContext.Provider;\n const refs = useRef<Record<string, AccessibilityRefComponent>>({});\n const setRef = useCallback((route: string, ref: AccessibilityRefComponent) => {\n refs.current[route] = ref;\n }, []);\n const getRef = useCallback((route: string) => {\n return refs.current[route] ?? null;\n }, []);\n const value = useMemo(() => ({ setRef, getRef }), [getRef, setRef]);\n return <Provider value={value}>{children}</Provider>;\n};\n\n/**\n * Wraps `onPress` handler and `ref` to support automatic accessibility focus on back navigation\n * @note This needs to be used inside {@link AccessibilityFocusHistoryProvider} and navigation context\n */\nexport const useAccessibilityFocusHistory = <\n Component extends React.Component<any> | React.ComponentClass<any>,\n OnPress extends (...args: never[]) => void = () => void,\n>(\n pressHandler: OnPress | undefined,\n passedRef?: React.Ref<Component>,\n) => {\n const [forwardedRef, refObject] = useForwardedRef<Component>(passedRef);\n\n const historyContext = useContext(accessibilityFocusHistoryContext);\n const routeKey = useRoute().key;\n\n const previouslyPressed = useRef(false);\n const outsideTransition = useAccessibleAfterTransition();\n\n useEffect(() => {\n const isStoredInHistory = historyContext.getRef(routeKey) === refObject.current;\n if (outsideTransition && isStoredInHistory && previouslyPressed.current) {\n focusAccessibility(refObject.current);\n }\n }, [historyContext, outsideTransition, refObject, routeKey]);\n\n useEffect(() => {\n if (outsideTransition) {\n previouslyPressed.current = false;\n }\n }, [outsideTransition]);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const onPress = useCallback(\n ((...args) => {\n previouslyPressed.current = true;\n historyContext.setRef(routeKey, refObject.current);\n return pressHandler?.(...args);\n }) as OnPress,\n [historyContext, routeKey, refObject, pressHandler],\n );\n\n return { onPress, ref: forwardedRef };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,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AEvB,GAAG,EAAEU;EAAa,CAAC;AACvC,CAAC;AAACJ,OAAA,CAAAC,4BAAA,GAAAA,4BAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TouchableWithoutFeedback = exports.TouchableOpacity = exports.TouchableHighlight = exports.Pressable = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _accessibilityHistory = require("./accessibilityHistory");
|
|
10
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
|
+
const WithAccessibilityFocusHistory = (C, displayName) => {
|
|
14
|
+
const ComponentWithAccessibilityFocusHistory = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
forwardedRef,
|
|
17
|
+
onPress: originalOnPress,
|
|
18
|
+
...props
|
|
19
|
+
} = _ref;
|
|
20
|
+
const {
|
|
21
|
+
ref,
|
|
22
|
+
onPress
|
|
23
|
+
} = (0, _accessibilityHistory.useAccessibilityFocusHistory)(originalOnPress !== null && originalOnPress !== void 0 ? originalOnPress : undefined, forwardedRef);
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(C, _extends({
|
|
26
|
+
ref: ref,
|
|
27
|
+
onPress: onPress
|
|
28
|
+
}, props));
|
|
29
|
+
};
|
|
30
|
+
const Forwarded = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(ComponentWithAccessibilityFocusHistory, _extends({}, props, {
|
|
31
|
+
forwardedRef: ref
|
|
32
|
+
})));
|
|
33
|
+
Forwarded.displayName = displayName;
|
|
34
|
+
return Forwarded;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Wrappers of RN touchable components with accessibilty focus history support
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
const TouchableOpacity = WithAccessibilityFocusHistory(_reactNative.TouchableOpacity, 'TouchableOpacity');
|
|
42
|
+
exports.TouchableOpacity = TouchableOpacity;
|
|
43
|
+
const TouchableWithoutFeedback = WithAccessibilityFocusHistory(_reactNative.TouchableWithoutFeedback, 'TouchableWithoutFeedback');
|
|
44
|
+
exports.TouchableWithoutFeedback = TouchableWithoutFeedback;
|
|
45
|
+
const TouchableHighlight = WithAccessibilityFocusHistory(_reactNative.TouchableHighlight, 'TouchableHighlight');
|
|
46
|
+
exports.TouchableHighlight = TouchableHighlight;
|
|
47
|
+
const Pressable = WithAccessibilityFocusHistory(_reactNative.Pressable, 'Pressable');
|
|
48
|
+
exports.Pressable = Pressable;
|
|
49
|
+
//# sourceMappingURL=accessibilityHistoryWrappers.js.map
|