@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,80 @@
|
|
|
1
|
+
import type { ComponentMeta, Story } from '@storybook/react';
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
|
+
import { StyleSheet } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { Button } from '../buttons';
|
|
6
|
+
import { Biometry } from './keypad';
|
|
7
|
+
import { PinCodeScreen, PinCodeScreenActions, PinCodeScreenProps } from './pin-code-screen';
|
|
8
|
+
|
|
9
|
+
type Props = PinCodeScreenProps & {
|
|
10
|
+
withBackButton: boolean;
|
|
11
|
+
showActions: boolean;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const styles = StyleSheet.create({
|
|
15
|
+
actionButton: { position: 'absolute', right: 24, top: 40 },
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const Basic: Story<Props> = ({
|
|
19
|
+
title,
|
|
20
|
+
instruction,
|
|
21
|
+
onAccessibilityAnnounced,
|
|
22
|
+
withBackButton,
|
|
23
|
+
onBack,
|
|
24
|
+
showActions,
|
|
25
|
+
...args
|
|
26
|
+
}) => {
|
|
27
|
+
const subtitle = instruction ? { instruction, onAccessibilityAnnounced } : {};
|
|
28
|
+
const actionsRef = useRef<PinCodeScreenActions>(null);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<>
|
|
32
|
+
<PinCodeScreen
|
|
33
|
+
ref={actionsRef}
|
|
34
|
+
title={title}
|
|
35
|
+
{...subtitle}
|
|
36
|
+
onBack={withBackButton ? onBack : undefined}
|
|
37
|
+
{...args}
|
|
38
|
+
/>
|
|
39
|
+
{showActions && (
|
|
40
|
+
<Button style={styles.actionButton} onPress={() => actionsRef.current?.shakeKeypad()} title="shake" />
|
|
41
|
+
)}
|
|
42
|
+
</>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
Basic.args = {
|
|
47
|
+
length: 6,
|
|
48
|
+
enteredLength: 0,
|
|
49
|
+
withBackButton: true,
|
|
50
|
+
title: 'Title',
|
|
51
|
+
instruction: 'Instruction',
|
|
52
|
+
error: '',
|
|
53
|
+
biometry: Biometry.FaceID,
|
|
54
|
+
showActions: false,
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export { Basic as PINScreen };
|
|
58
|
+
|
|
59
|
+
export default {
|
|
60
|
+
title: 'screen/PIN Screen',
|
|
61
|
+
component: PinCodeScreen,
|
|
62
|
+
parameters: {
|
|
63
|
+
noSafeArea: true,
|
|
64
|
+
design: {
|
|
65
|
+
type: 'figma',
|
|
66
|
+
url: 'https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=621-21892&mode=design&t=nCa9UdCDzPYtOPgu-4',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
argTypes: {
|
|
70
|
+
onBack: { action: 'onBack' },
|
|
71
|
+
onBiometricPress: { action: 'onBiometricPress' },
|
|
72
|
+
onPressDigit: { action: 'onPressDigit' },
|
|
73
|
+
onPressDelete: { action: 'onPressDelete' },
|
|
74
|
+
onDeleteAll: { action: 'onDeleteAll' },
|
|
75
|
+
biometry: {
|
|
76
|
+
options: [Biometry.FaceID, Biometry.Other],
|
|
77
|
+
control: { type: 'radio' },
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
} as ComponentMeta<typeof PinCodeScreen>;
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import React, { forwardRef, Ref, useImperativeHandle, useState } from 'react';
|
|
2
|
+
import { Animated, Easing, StyleSheet, View } from 'react-native';
|
|
3
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
4
|
+
|
|
5
|
+
import type { TouchableOpacityRef } from '../accessibility';
|
|
6
|
+
import { BackButton } from '../buttons';
|
|
7
|
+
import { Typography } from '../text';
|
|
8
|
+
import { useAppColorScheme } from '../theme';
|
|
9
|
+
import { concatTestID } from '../utils';
|
|
10
|
+
import ContrastingStatusBar from '../utils/contrasting-status-bar';
|
|
11
|
+
import { Biometry, Keypad } from './keypad';
|
|
12
|
+
import { Pins } from './pins';
|
|
13
|
+
|
|
14
|
+
export type PinCodeScreenProps = {
|
|
15
|
+
title: string;
|
|
16
|
+
|
|
17
|
+
testID?: string;
|
|
18
|
+
length: number;
|
|
19
|
+
enteredLength: number;
|
|
20
|
+
onBack?: () => void;
|
|
21
|
+
error?: string;
|
|
22
|
+
|
|
23
|
+
keypadRef?: Ref<TouchableOpacityRef>;
|
|
24
|
+
onPressDigit: (digit: number) => void;
|
|
25
|
+
onPressDelete: () => void;
|
|
26
|
+
onDeleteAll: () => void;
|
|
27
|
+
|
|
28
|
+
biometry?: Biometry | null;
|
|
29
|
+
onBiometricPress?: () => void;
|
|
30
|
+
} & (
|
|
31
|
+
| {
|
|
32
|
+
instruction: string;
|
|
33
|
+
onAccessibilityAnnounced?: (finished: boolean) => void;
|
|
34
|
+
}
|
|
35
|
+
| {
|
|
36
|
+
instruction?: undefined;
|
|
37
|
+
onAccessibilityAnnounced?: undefined;
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export interface PinCodeScreenActions {
|
|
42
|
+
shakeKeypad: (params?: { amount?: number; duration?: number }) => Promise<{ finished: boolean }>;
|
|
43
|
+
}
|
|
44
|
+
const SHAKE_ITERATIONS = 4;
|
|
45
|
+
const animationConfig = {
|
|
46
|
+
useNativeDriver: true,
|
|
47
|
+
easing: Easing.linear,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const PinCodeScreen = forwardRef<PinCodeScreenActions, PinCodeScreenProps>(
|
|
51
|
+
(
|
|
52
|
+
{
|
|
53
|
+
testID,
|
|
54
|
+
length,
|
|
55
|
+
instruction,
|
|
56
|
+
title,
|
|
57
|
+
onBack,
|
|
58
|
+
enteredLength,
|
|
59
|
+
error,
|
|
60
|
+
onPressDigit,
|
|
61
|
+
onPressDelete,
|
|
62
|
+
biometry,
|
|
63
|
+
onBiometricPress,
|
|
64
|
+
keypadRef,
|
|
65
|
+
onDeleteAll,
|
|
66
|
+
...props
|
|
67
|
+
},
|
|
68
|
+
ref,
|
|
69
|
+
) => {
|
|
70
|
+
const colorScheme = useAppColorScheme();
|
|
71
|
+
const [shakePosition] = useState(() => new Animated.Value(0));
|
|
72
|
+
useImperativeHandle(
|
|
73
|
+
ref,
|
|
74
|
+
() => ({
|
|
75
|
+
shakeKeypad: (params) => {
|
|
76
|
+
const { amount = 10, duration = 300 } = params ?? {};
|
|
77
|
+
const partialDuration = duration / SHAKE_ITERATIONS / 4;
|
|
78
|
+
return new Promise((resolve) =>
|
|
79
|
+
Animated.loop(
|
|
80
|
+
Animated.sequence([
|
|
81
|
+
Animated.timing(shakePosition, { ...animationConfig, toValue: -amount, duration: partialDuration }),
|
|
82
|
+
Animated.timing(shakePosition, {
|
|
83
|
+
...animationConfig,
|
|
84
|
+
toValue: amount,
|
|
85
|
+
duration: 2 * partialDuration,
|
|
86
|
+
}),
|
|
87
|
+
Animated.timing(shakePosition, { ...animationConfig, toValue: 0, duration: partialDuration }),
|
|
88
|
+
]),
|
|
89
|
+
{ iterations: SHAKE_ITERATIONS },
|
|
90
|
+
).start(resolve),
|
|
91
|
+
);
|
|
92
|
+
},
|
|
93
|
+
}),
|
|
94
|
+
[shakePosition],
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<SafeAreaView testID={testID} style={[styles.container, { backgroundColor: colorScheme.white }]}>
|
|
99
|
+
<ContrastingStatusBar backgroundColor={colorScheme.white} />
|
|
100
|
+
<View style={styles.backButton}>
|
|
101
|
+
{onBack && <BackButton testID={concatTestID(testID, 'back')} onPress={onBack} />}
|
|
102
|
+
</View>
|
|
103
|
+
<View style={styles.content}>
|
|
104
|
+
<View style={styles.upperContent}>
|
|
105
|
+
<Typography
|
|
106
|
+
testID={concatTestID(testID, 'title')}
|
|
107
|
+
accessible={false}
|
|
108
|
+
color={colorScheme.text}
|
|
109
|
+
align="center"
|
|
110
|
+
preset="l"
|
|
111
|
+
style={styles.title}>
|
|
112
|
+
{title}
|
|
113
|
+
</Typography>
|
|
114
|
+
<Pins style={styles.pins} enteredLength={enteredLength} maxLength={length} />
|
|
115
|
+
{instruction ? (
|
|
116
|
+
<Typography
|
|
117
|
+
testID={concatTestID(testID, 'instruction')}
|
|
118
|
+
align="center"
|
|
119
|
+
announcementActive={true}
|
|
120
|
+
onAnnouncementFinished={props.onAccessibilityAnnounced}
|
|
121
|
+
color={colorScheme.text}
|
|
122
|
+
style={styles.instruction}>
|
|
123
|
+
{instruction}
|
|
124
|
+
</Typography>
|
|
125
|
+
) : null}
|
|
126
|
+
<Typography
|
|
127
|
+
testID={concatTestID(testID, 'error')}
|
|
128
|
+
announcementActive={true}
|
|
129
|
+
accessible={Boolean(error)}
|
|
130
|
+
color={colorScheme.error}>
|
|
131
|
+
{error ?? '' /* always displayed to keep the same layout */}
|
|
132
|
+
</Typography>
|
|
133
|
+
</View>
|
|
134
|
+
<Animated.View
|
|
135
|
+
style={[
|
|
136
|
+
styles.keyboard,
|
|
137
|
+
{
|
|
138
|
+
transform: [{ translateX: shakePosition }],
|
|
139
|
+
},
|
|
140
|
+
]}>
|
|
141
|
+
<Keypad
|
|
142
|
+
testID={concatTestID(testID, 'keypad')}
|
|
143
|
+
ref={keypadRef}
|
|
144
|
+
onPressDigit={enteredLength < length ? onPressDigit : undefined}
|
|
145
|
+
onPressDelete={enteredLength && enteredLength < length ? onPressDelete : undefined}
|
|
146
|
+
biometry={!enteredLength ? biometry : undefined}
|
|
147
|
+
onBiometricPress={onBiometricPress}
|
|
148
|
+
onDeleteAll={enteredLength && enteredLength < length ? onDeleteAll : undefined}
|
|
149
|
+
/>
|
|
150
|
+
</Animated.View>
|
|
151
|
+
</View>
|
|
152
|
+
</SafeAreaView>
|
|
153
|
+
);
|
|
154
|
+
},
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
const styles = StyleSheet.create({
|
|
158
|
+
backButton: {
|
|
159
|
+
minHeight: 24,
|
|
160
|
+
paddingHorizontal: 24,
|
|
161
|
+
},
|
|
162
|
+
container: {
|
|
163
|
+
flex: 1,
|
|
164
|
+
paddingTop: 8,
|
|
165
|
+
},
|
|
166
|
+
content: {
|
|
167
|
+
flex: 1,
|
|
168
|
+
justifyContent: 'space-between',
|
|
169
|
+
paddingHorizontal: 24,
|
|
170
|
+
},
|
|
171
|
+
instruction: {
|
|
172
|
+
marginVertical: 24,
|
|
173
|
+
opacity: 0.7,
|
|
174
|
+
},
|
|
175
|
+
keyboard: {
|
|
176
|
+
alignItems: 'center',
|
|
177
|
+
flex: 5,
|
|
178
|
+
justifyContent: 'center',
|
|
179
|
+
marginVertical: 24,
|
|
180
|
+
},
|
|
181
|
+
pins: {
|
|
182
|
+
paddingHorizontal: 20,
|
|
183
|
+
},
|
|
184
|
+
title: {
|
|
185
|
+
marginBottom: 24,
|
|
186
|
+
},
|
|
187
|
+
upperContent: {
|
|
188
|
+
alignItems: 'center',
|
|
189
|
+
flex: 3,
|
|
190
|
+
marginTop: 12,
|
|
191
|
+
paddingHorizontal: 20,
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
PinCodeScreen.displayName = 'PinCodeScreen';
|
package/src/pin/pins.tsx
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import { StyleSheet, View, ViewProps } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { useAccessibilityTranslation } from '../accessibility/accessibilityLanguage';
|
|
5
|
+
import { useAppColorScheme } from '../theme';
|
|
6
|
+
|
|
7
|
+
export interface PinsProps extends ViewProps {
|
|
8
|
+
enteredLength: number;
|
|
9
|
+
maxLength: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const Pins: FC<PinsProps> = ({ enteredLength, maxLength, style, ...props }) => {
|
|
13
|
+
const t = useAccessibilityTranslation();
|
|
14
|
+
const colorScheme = useAppColorScheme();
|
|
15
|
+
return (
|
|
16
|
+
<View
|
|
17
|
+
style={[styles.pinsWrapper, style]}
|
|
18
|
+
accessible={true}
|
|
19
|
+
accessibilityRole="progressbar"
|
|
20
|
+
accessibilityValue={{ text: t('accessibility.control.progress', { current: enteredLength, length: maxLength }) }}
|
|
21
|
+
{...props}>
|
|
22
|
+
{Array.from({ length: maxLength }).map((_, index) => (
|
|
23
|
+
<View
|
|
24
|
+
key={`pin${index}`}
|
|
25
|
+
style={[
|
|
26
|
+
styles.pin,
|
|
27
|
+
{
|
|
28
|
+
backgroundColor: enteredLength > index ? colorScheme.black : colorScheme.background,
|
|
29
|
+
},
|
|
30
|
+
]}
|
|
31
|
+
/>
|
|
32
|
+
))}
|
|
33
|
+
</View>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const styles = StyleSheet.create({
|
|
38
|
+
pin: {
|
|
39
|
+
borderRadius: 3,
|
|
40
|
+
height: 10,
|
|
41
|
+
width: 10,
|
|
42
|
+
},
|
|
43
|
+
pinsWrapper: {
|
|
44
|
+
flexDirection: 'row',
|
|
45
|
+
justifyContent: 'space-evenly',
|
|
46
|
+
width: '100%',
|
|
47
|
+
},
|
|
48
|
+
});
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React, { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import BackButton from '../buttons/back-button';
|
|
5
|
+
import { Button, ButtonType } from '../buttons/button';
|
|
6
|
+
import ScrollViewScreen from '../screens/scroll-view-screen';
|
|
7
|
+
import Typography from '../text/typography';
|
|
8
|
+
import { useAppColorScheme } from '../theme/color-scheme-context';
|
|
9
|
+
import { concatTestID } from '../utils/testID';
|
|
10
|
+
|
|
11
|
+
export enum BackupScreenMode {
|
|
12
|
+
Create = 'create',
|
|
13
|
+
Restore = 'restore',
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type BackupScreenProps = PropsWithChildren<{
|
|
17
|
+
cta: string;
|
|
18
|
+
description: string;
|
|
19
|
+
isCtaDisabled?: boolean;
|
|
20
|
+
onBack: () => void;
|
|
21
|
+
onCta: () => void;
|
|
22
|
+
testID: string;
|
|
23
|
+
title: string;
|
|
24
|
+
}>;
|
|
25
|
+
|
|
26
|
+
const BackupScreen: FC<BackupScreenProps> = ({
|
|
27
|
+
children,
|
|
28
|
+
cta,
|
|
29
|
+
description,
|
|
30
|
+
isCtaDisabled,
|
|
31
|
+
onBack,
|
|
32
|
+
onCta,
|
|
33
|
+
testID,
|
|
34
|
+
title,
|
|
35
|
+
}) => {
|
|
36
|
+
const colorScheme = useAppColorScheme();
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<ScrollViewScreen
|
|
40
|
+
header={{
|
|
41
|
+
backgroundColor: colorScheme.white,
|
|
42
|
+
leftItem: <BackButton onPress={onBack} testID={concatTestID(testID, 'back')} />,
|
|
43
|
+
title,
|
|
44
|
+
}}
|
|
45
|
+
scrollView={{
|
|
46
|
+
testID: concatTestID(testID, 'scroll'),
|
|
47
|
+
}}
|
|
48
|
+
style={{ backgroundColor: colorScheme.white }}
|
|
49
|
+
testID={testID}>
|
|
50
|
+
<View style={styles.contentWrapper}>
|
|
51
|
+
<View style={styles.content}>
|
|
52
|
+
<Typography color={colorScheme.text} style={styles.description}>
|
|
53
|
+
{description}
|
|
54
|
+
</Typography>
|
|
55
|
+
|
|
56
|
+
{children}
|
|
57
|
+
</View>
|
|
58
|
+
|
|
59
|
+
<View style={styles.bottom}>
|
|
60
|
+
<Button
|
|
61
|
+
disabled={isCtaDisabled}
|
|
62
|
+
onPress={onCta}
|
|
63
|
+
testID={concatTestID(testID, 'mainButton')}
|
|
64
|
+
title={cta}
|
|
65
|
+
type={isCtaDisabled ? ButtonType.Border : ButtonType.Primary}
|
|
66
|
+
/>
|
|
67
|
+
</View>
|
|
68
|
+
</View>
|
|
69
|
+
</ScrollViewScreen>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const styles = StyleSheet.create({
|
|
74
|
+
bottom: {
|
|
75
|
+
flex: 1,
|
|
76
|
+
justifyContent: 'flex-end',
|
|
77
|
+
minHeight: 84,
|
|
78
|
+
},
|
|
79
|
+
content: {
|
|
80
|
+
marginHorizontal: 8,
|
|
81
|
+
},
|
|
82
|
+
contentWrapper: {
|
|
83
|
+
flex: 1,
|
|
84
|
+
marginHorizontal: 12,
|
|
85
|
+
},
|
|
86
|
+
description: {
|
|
87
|
+
marginBottom: 24,
|
|
88
|
+
opacity: 0.7,
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
export default BackupScreen;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import ImagePreviewScreen from './image-preview-screen';
|
|
5
|
+
|
|
6
|
+
const profileImage = require('../../storybook/assets/ProfileImage.png');
|
|
7
|
+
|
|
8
|
+
const Basic: ComponentStory<typeof ImagePreviewScreen> = ({ ...args }) => {
|
|
9
|
+
return <ImagePreviewScreen {...args} image={profileImage} />;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
Basic.args = {
|
|
13
|
+
title: 'Title',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { Basic as ImagePreviewScreen };
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
title: 'screen/Image Preview Screen',
|
|
20
|
+
component: ImagePreviewScreen,
|
|
21
|
+
parameters: {
|
|
22
|
+
noSafeArea: true,
|
|
23
|
+
design: {
|
|
24
|
+
type: 'figma',
|
|
25
|
+
url: 'https://www.figma.com/design/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=493-79444&m=dev',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
} as ComponentMeta<typeof ImagePreviewScreen>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React, { FC, useCallback, useState } from 'react';
|
|
2
|
+
import { Image, ImageSourcePropType, ImageStyle, LayoutChangeEvent, StyleSheet, View, ViewProps } from 'react-native';
|
|
3
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
|
+
|
|
5
|
+
import { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';
|
|
6
|
+
import { NavigationHeader } from '../header';
|
|
7
|
+
import { CloseIcon } from '../icons';
|
|
8
|
+
import { useAppColorScheme } from '../theme';
|
|
9
|
+
import { concatTestID, ContrastingStatusBar } from '../utils';
|
|
10
|
+
|
|
11
|
+
export type ImagePreviewScreenProps = ViewProps & {
|
|
12
|
+
image: ImageSourcePropType;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
title: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const ImagePreviewScreen: FC<ImagePreviewScreenProps> = ({ image, onClose, title, testID, style, ...viewProps }) => {
|
|
18
|
+
const colorScheme = useAppColorScheme();
|
|
19
|
+
const insets = useSafeAreaInsets();
|
|
20
|
+
|
|
21
|
+
const [imageSize, setImageSize] = useState<ImageStyle>();
|
|
22
|
+
const layoutHandler = useCallback((event: LayoutChangeEvent) => {
|
|
23
|
+
const { width, height } = event.nativeEvent.layout;
|
|
24
|
+
setImageSize({ height, width });
|
|
25
|
+
}, []);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<View
|
|
29
|
+
style={[styles.screen, { backgroundColor: colorScheme.nerdView.background }, style]}
|
|
30
|
+
testID={testID}
|
|
31
|
+
{...viewProps}>
|
|
32
|
+
<ContrastingStatusBar backgroundColor={colorScheme.nerdView.background} />
|
|
33
|
+
<NavigationHeader
|
|
34
|
+
backgroundColor="transparent"
|
|
35
|
+
blurred={false}
|
|
36
|
+
leftItem={
|
|
37
|
+
<TouchableOpacity onPress={onClose} testID={concatTestID(testID, 'close')}>
|
|
38
|
+
<CloseIcon color={colorScheme.white} />
|
|
39
|
+
</TouchableOpacity>
|
|
40
|
+
}
|
|
41
|
+
style={{
|
|
42
|
+
paddingTop: insets.top,
|
|
43
|
+
}}
|
|
44
|
+
title={title}
|
|
45
|
+
titleColor={colorScheme.white}
|
|
46
|
+
testID={concatTestID(testID, 'header')}
|
|
47
|
+
/>
|
|
48
|
+
|
|
49
|
+
<View onLayout={layoutHandler} style={styles.imageContainer}>
|
|
50
|
+
{imageSize && (
|
|
51
|
+
<Image
|
|
52
|
+
accessibilityLabel={title}
|
|
53
|
+
accessibilityRole="image"
|
|
54
|
+
accessible={true}
|
|
55
|
+
resizeMethod="resize"
|
|
56
|
+
resizeMode="contain"
|
|
57
|
+
source={image}
|
|
58
|
+
style={[styles.image, imageSize]}
|
|
59
|
+
testID={concatTestID(testID, 'image')}
|
|
60
|
+
/>
|
|
61
|
+
)}
|
|
62
|
+
</View>
|
|
63
|
+
</View>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const styles = StyleSheet.create({
|
|
68
|
+
image: {
|
|
69
|
+
position: 'absolute',
|
|
70
|
+
},
|
|
71
|
+
imageContainer: {
|
|
72
|
+
alignItems: 'center',
|
|
73
|
+
flex: 1,
|
|
74
|
+
justifyContent: 'center',
|
|
75
|
+
marginHorizontal: 18,
|
|
76
|
+
},
|
|
77
|
+
screen: {
|
|
78
|
+
flex: 1,
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
export default ImagePreviewScreen;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import BackupScreen, { BackupScreenMode, BackupScreenProps } from './backup-screen';
|
|
2
|
+
import ImagePreviewScreen, { ImagePreviewScreenProps } from './image-preview-screen';
|
|
3
|
+
import NerdModeScreen, { NerdModeScreenProps, NerdModeSection } from './nerd-mode-screen';
|
|
4
|
+
import QRCodeScannerScreen, { QRCodeScannerScreenProps } from './qr-code-scanner-screen';
|
|
5
|
+
import ScrollViewScreen, { ScrollViewScreenProps } from './scroll-view-screen';
|
|
6
|
+
import SectionListScreen, { SectionListScreenProps } from './section-list-screen';
|
|
7
|
+
|
|
8
|
+
export { BackupScreen, BackupScreenMode, BackupScreenProps };
|
|
9
|
+
export { ImagePreviewScreen, ImagePreviewScreenProps };
|
|
10
|
+
export { NerdModeScreen, NerdModeScreenProps, NerdModeSection };
|
|
11
|
+
export { QRCodeScannerScreen, QRCodeScannerScreenProps };
|
|
12
|
+
export { ScrollViewScreen, ScrollViewScreenProps };
|
|
13
|
+
export { SectionListScreen, SectionListScreenProps };
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import React, { FunctionComponent, useState } from 'react';
|
|
2
|
+
import { SectionList, StyleSheet, View } from 'react-native';
|
|
3
|
+
import { TouchableOpacity } from 'react-native-gesture-handler';
|
|
4
|
+
import Animated, { useAnimatedScrollHandler, useSharedValue } from 'react-native-reanimated';
|
|
5
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
|
+
|
|
7
|
+
import NerdModeItem, { NerdModeItemProps } from '..//nerd-view/nerd-mode-item';
|
|
8
|
+
import EntityCluster from '../entity/entity-cluster';
|
|
9
|
+
import NavigationHeader from '../header/navigation-header';
|
|
10
|
+
import { CloseIcon } from '../icons/icons';
|
|
11
|
+
import Typography from '../text/typography';
|
|
12
|
+
import { useAppColorScheme } from '../theme/color-scheme-context';
|
|
13
|
+
import ContrastingStatusBar from '../utils/contrasting-status-bar';
|
|
14
|
+
import { concatTestID } from '../utils/testID';
|
|
15
|
+
|
|
16
|
+
const styles = StyleSheet.create({
|
|
17
|
+
entityCluster: {
|
|
18
|
+
paddingHorizontal: 24,
|
|
19
|
+
paddingVertical: 20,
|
|
20
|
+
},
|
|
21
|
+
sectionHeaderContainer: {
|
|
22
|
+
justifyContent: 'center',
|
|
23
|
+
marginTop: 20,
|
|
24
|
+
paddingVertical: 16,
|
|
25
|
+
},
|
|
26
|
+
sectionHeaderText: {
|
|
27
|
+
opacity: 0.7,
|
|
28
|
+
paddingHorizontal: 20,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export type NerdModeSection = {
|
|
33
|
+
data: Array<Omit<NerdModeItemProps, 'labels' | 'onCopyToClipboard'>>;
|
|
34
|
+
title: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type NerdModeScreenProps = {
|
|
38
|
+
entityCluster?: {
|
|
39
|
+
entityName: string;
|
|
40
|
+
};
|
|
41
|
+
labels: {
|
|
42
|
+
expand: string;
|
|
43
|
+
collapse: string;
|
|
44
|
+
};
|
|
45
|
+
onClose: () => void;
|
|
46
|
+
onCopyToClipboard: (value: string) => void;
|
|
47
|
+
sections: NerdModeSection[];
|
|
48
|
+
testID: string;
|
|
49
|
+
title: string;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const AnimatedSectionList = Animated.createAnimatedComponent(
|
|
53
|
+
SectionList<Omit<NerdModeItemProps, 'labels' | 'onCopyToClipboard'>>,
|
|
54
|
+
);
|
|
55
|
+
const NerdModeScreen: FunctionComponent<NerdModeScreenProps> = ({
|
|
56
|
+
sections,
|
|
57
|
+
labels,
|
|
58
|
+
onClose,
|
|
59
|
+
onCopyToClipboard,
|
|
60
|
+
entityCluster,
|
|
61
|
+
testID,
|
|
62
|
+
title,
|
|
63
|
+
}) => {
|
|
64
|
+
const insets = useSafeAreaInsets();
|
|
65
|
+
const colorScheme = useAppColorScheme();
|
|
66
|
+
const scrollOffset = useSharedValue(0);
|
|
67
|
+
const [expandedAttributes, setExpandedAttributes] = useState(0);
|
|
68
|
+
|
|
69
|
+
// This is a bit of a hack. It's used to notify attributes that another attribute has been expanded
|
|
70
|
+
// which will allow them to update their scroll offset accordingly.
|
|
71
|
+
const onExpand = (expanded: boolean) => {
|
|
72
|
+
setExpandedAttributes((prev) => (expanded ? prev + 1 : prev - 1));
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const onScroll = useAnimatedScrollHandler({
|
|
76
|
+
onScroll: ({ contentOffset }) => {
|
|
77
|
+
scrollOffset.value = contentOffset.y;
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const lastElementsForSection = sections.reduce((acc, { title: sectionTitle, data }) => {
|
|
82
|
+
const lastElement = data[data.length - 1];
|
|
83
|
+
return { ...acc, [sectionTitle]: lastElement.attributeKey };
|
|
84
|
+
}, {} as Record<string, string>);
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<>
|
|
88
|
+
<ContrastingStatusBar backgroundColor={colorScheme.nerdView.background} />
|
|
89
|
+
<NavigationHeader
|
|
90
|
+
leftItem={
|
|
91
|
+
<TouchableOpacity onPress={onClose} testID={concatTestID(testID, 'closeIcon')}>
|
|
92
|
+
<CloseIcon color={colorScheme.white} />
|
|
93
|
+
</TouchableOpacity>
|
|
94
|
+
}
|
|
95
|
+
style={{
|
|
96
|
+
backgroundColor: colorScheme.nerdView.background,
|
|
97
|
+
paddingTop: insets.top,
|
|
98
|
+
}}
|
|
99
|
+
title={title}
|
|
100
|
+
titleColor={colorScheme.white}
|
|
101
|
+
/>
|
|
102
|
+
<AnimatedSectionList
|
|
103
|
+
ListHeaderComponent={
|
|
104
|
+
entityCluster ? (
|
|
105
|
+
<EntityCluster
|
|
106
|
+
entityName={entityCluster?.entityName}
|
|
107
|
+
style={[
|
|
108
|
+
styles.entityCluster,
|
|
109
|
+
{
|
|
110
|
+
backgroundColor: colorScheme.nerdView.background,
|
|
111
|
+
},
|
|
112
|
+
]}
|
|
113
|
+
testID={concatTestID(testID, 'entityCluster')}
|
|
114
|
+
textColor={colorScheme.white}
|
|
115
|
+
/>
|
|
116
|
+
) : null
|
|
117
|
+
}
|
|
118
|
+
onScroll={onScroll}
|
|
119
|
+
renderItem={({ item, section }) => (
|
|
120
|
+
<NerdModeItem
|
|
121
|
+
{...item}
|
|
122
|
+
expandedAttributes={expandedAttributes}
|
|
123
|
+
labels={labels}
|
|
124
|
+
last={lastElementsForSection[section.title] === item.attributeKey}
|
|
125
|
+
onCopyToClipboard={onCopyToClipboard}
|
|
126
|
+
onExpand={onExpand}
|
|
127
|
+
scrollOffset={scrollOffset}
|
|
128
|
+
testID={concatTestID(testID, item.testID)}
|
|
129
|
+
/>
|
|
130
|
+
)}
|
|
131
|
+
renderSectionHeader={({ section }) => {
|
|
132
|
+
return (
|
|
133
|
+
<View style={styles.sectionHeaderContainer} testID={concatTestID(testID, section.title)}>
|
|
134
|
+
<Typography color={colorScheme.white} style={styles.sectionHeaderText}>
|
|
135
|
+
{section.title}
|
|
136
|
+
</Typography>
|
|
137
|
+
</View>
|
|
138
|
+
);
|
|
139
|
+
}}
|
|
140
|
+
scrollEventThrottle={16}
|
|
141
|
+
sections={sections}
|
|
142
|
+
stickySectionHeadersEnabled={false}
|
|
143
|
+
style={{ backgroundColor: colorScheme.nerdView.background }}
|
|
144
|
+
testID={testID}
|
|
145
|
+
/>
|
|
146
|
+
</>
|
|
147
|
+
);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export default NerdModeScreen;
|