@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 @@
|
|
|
1
|
+
{"version":3,"names":["React","FlatList","StyleSheet","View","TouchableOpacity","Selector","SelectorStatus","Typography","useAppColorScheme","RadioGroup","_ref","containerStyle","items","selectedItem","onSelected","style","listFooter","listFooterStyle","onEndReached","onGetItemAccessibilityLabel","testID","scrollEnabled","colorScheme","createElement","ListFooterComponent","ListFooterComponentStyle","contentContainerStyle","data","renderItem","_ref2","item","index","selected","key","Fragment","accessibilityLabel","label","accessibilityRole","accessibilityState","accessibilityValue","length","text","undefined","activeOpacity","onPress","styles","color","status","SelectedRadio","Empty","selector","divider","backgroundColor","background","showsVerticalScrollIndicator","create","height","width","alignItems","flexDirection","justifyContent","paddingVertical","marginLeft","paddingTop"],"sources":["radio-group.tsx"],"sourcesContent":["import React, { FunctionComponent } from 'react';\nimport { FlatList, FlatListProps, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport Selector from '../credential/selector';\nimport { SelectorStatus } from '../credential/selector-status';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport type RadioGroupItem = {\n key: React.Key;\n label: string;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n};\n\nexport type RadioGroupProps = {\n containerStyle?: StyleProp<ViewStyle>;\n items: RadioGroupItem[];\n listFooter?: FlatListProps<RadioGroupItem>['ListFooterComponent'];\n listFooterStyle?: FlatListProps<RadioGroupItem>['ListFooterComponentStyle'];\n onEndReached?: FlatListProps<RadioGroupItem>['onEndReached'];\n onGetItemAccessibilityLabel?: (current: number, length: number) => string;\n onSelected: (item: RadioGroupItem, index: number) => void;\n selectedItem?: React.Key;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n scrollEnabled?: boolean;\n};\n\nconst RadioGroup: FunctionComponent<RadioGroupProps> = ({\n containerStyle,\n items,\n selectedItem,\n onSelected,\n style,\n listFooter,\n listFooterStyle,\n onEndReached,\n onGetItemAccessibilityLabel,\n testID,\n scrollEnabled = true,\n}) => {\n const colorScheme = useAppColorScheme();\n\n return (\n <FlatList<RadioGroupItem>\n scrollEnabled={scrollEnabled}\n ListFooterComponent={listFooter}\n ListFooterComponentStyle={listFooterStyle}\n contentContainerStyle={containerStyle}\n data={items}\n onEndReached={onEndReached}\n renderItem={({ item, index }) => {\n const selected = selectedItem === item.key;\n return (\n <React.Fragment key={item.key}>\n <TouchableOpacity\n accessibilityLabel={item.label}\n accessibilityRole=\"button\"\n accessibilityState={{ selected }}\n accessibilityValue={\n items.length > 1 && onGetItemAccessibilityLabel\n ? {\n text: onGetItemAccessibilityLabel(index + 1, items.length),\n }\n : undefined\n }\n activeOpacity={selected ? 1 : undefined}\n onPress={() => {\n onSelected(item, index);\n }}\n style={[styles.item, item.style]}\n testID={item.testID}>\n <Typography color={colorScheme.text}>{item.label}</Typography>\n <Selector\n status={selected ? SelectorStatus.SelectedRadio : SelectorStatus.Empty}\n style={styles.selector}\n />\n </TouchableOpacity>\n <View style={[styles.divider, { backgroundColor: colorScheme.background }]} />\n </React.Fragment>\n );\n }}\n showsVerticalScrollIndicator={false}\n style={style}\n testID={testID}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n divider: {\n height: 1,\n width: '100%',\n },\n item: {\n alignItems: 'center',\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingVertical: 24,\n width: '100%',\n },\n selector: {\n marginLeft: 4,\n paddingTop: 0,\n },\n});\n\nexport default RadioGroup;\n"],"mappings":"AAAA,OAAOA,KAAK,MAA6B,OAAO;AAChD,SAASC,QAAQ,EAA4BC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAE9F,SAASC,gBAAgB,QAAQ,+CAA+C;AAChF,OAAOC,QAAQ,MAAM,wBAAwB;AAC7C,SAASC,cAAc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,OAAO,EAAEA,CAAA,KAAM;UACb9B,UAAU,CAACgB,IAAI,EAAEC,KAAK,CAAC;QACzB,CAAE;QACFhB,KAAK,EAAE,CAAC8B,MAAM,CAACf,IAAI,EAAEA,IAAI,CAACf,KAAK,CAAE;QACjCK,MAAM,EAAEU,IAAI,CAACV;MAAO,gBACpBpB,KAAA,CAAAuB,aAAA,CAAChB,UAAU;QAACuC,KAAK,EAAExB,WAAW,CAACmB;MAAK,GAAEX,IAAI,CAACM,KAAK,CAAc,eAC9DpC,KAAA,CAAAuB,aAAA,CAAClB,QAAQ;QACP0C,MAAM,EAAEf,QAAQ,GAAG1B,cAAc,CAAC0C,aAAa,GAAG1C,cAAc,CAAC2C,KAAM;QACvElC,KAAK,EAAE8B,MAAM,CAACK;MAAS,EACvB,CACe,eACnBlD,KAAA,CAAAuB,aAAA,CAACpB,IAAI;QAACY,KAAK,EAAE,CAAC8B,MAAM,CAACM,OAAO,EAAE;UAAEC,eAAe,EAAE9B,WAAW,CAAC+B;QAAW,CAAC;MAAE,EAAG,CAC/D;IAErB,CAAE;IACFC,4BAA4B,EAAE,KAAM;IACpCvC,KAAK,EAAEA,KAAM;IACbK,MAAM,EAAEA;EAAO,EACf;AAEN,CAAC;AAED,MAAMyB,MAAM,GAAG3C,UAAU,CAACqD,MAAM,CAAC;EAC/BJ,OAAO,EAAE;IACPK,MAAM,EAAE,CAAC;IACTC,KAAK,EAAE;EACT,CAAC;EACD3B,IAAI,EAAE;IACJ4B,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,eAAe;IAC/BC,eAAe,EAAE,EAAE;IACnBJ,KAAK,EAAE;EACT,CAAC;EACDP,QAAQ,EAAE;IACRY,UAAU,EAAE,CAAC;IACbC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,eAAetD,UAAU"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
import Picker from '@procivis/react-native-picker';
|
|
3
|
+
import React, { forwardRef, useCallback, useMemo, useState } from 'react';
|
|
4
|
+
import { focusAccessibility } from '../accessibility/accessibility';
|
|
5
|
+
import { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';
|
|
6
|
+
import { useAccessibilityTranslation } from '../accessibility/accessibilityLanguage';
|
|
7
|
+
import { useAppColorScheme } from '../theme';
|
|
8
|
+
import { useForwardedRef } from '../utils/ref';
|
|
9
|
+
import TextInput, { TextInputAccessory } from './text-input';
|
|
10
|
+
/**
|
|
11
|
+
* Generic selection input component
|
|
12
|
+
* @see https://www.figma.com/file/Gd0Tj0234hxtl3HMcCJThW/App-Component-Library-(Design)?node-id=4%3A127&t=B2Y3PtJHH22XDPkx-0
|
|
13
|
+
*/
|
|
14
|
+
const SelectionInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
15
|
+
var _selectedChoice$short;
|
|
16
|
+
let {
|
|
17
|
+
selectedValue,
|
|
18
|
+
values,
|
|
19
|
+
label,
|
|
20
|
+
pickerTitle,
|
|
21
|
+
pickerConfirmLabel,
|
|
22
|
+
pickerCancelLabel,
|
|
23
|
+
onChange,
|
|
24
|
+
error,
|
|
25
|
+
...props
|
|
26
|
+
} = _ref;
|
|
27
|
+
const t = useAccessibilityTranslation();
|
|
28
|
+
const colorScheme = useAppColorScheme();
|
|
29
|
+
const selectedChoice = useMemo(() => selectedValue !== undefined ? values.find(_ref2 => {
|
|
30
|
+
let {
|
|
31
|
+
value
|
|
32
|
+
} = _ref2;
|
|
33
|
+
return value === selectedValue;
|
|
34
|
+
}) : undefined, [selectedValue, values]);
|
|
35
|
+
const [forwardedRef, refObject] = useForwardedRef(ref);
|
|
36
|
+
const [pickerOpen, setPickerOpen] = useState(false);
|
|
37
|
+
const onOpen = useCallback(() => setPickerOpen(true), []);
|
|
38
|
+
const onConfirm = useCallback(valueLabel => {
|
|
39
|
+
setPickerOpen(false);
|
|
40
|
+
const choice = values.find(_ref3 => {
|
|
41
|
+
let {
|
|
42
|
+
label: choiceLabel
|
|
43
|
+
} = _ref3;
|
|
44
|
+
return choiceLabel === valueLabel;
|
|
45
|
+
});
|
|
46
|
+
if (!choice || !(onChange !== null && onChange !== void 0 && onChange(choice))) {
|
|
47
|
+
setTimeout(() => focusAccessibility(refObject.current), 200);
|
|
48
|
+
}
|
|
49
|
+
}, [onChange, refObject, values]);
|
|
50
|
+
const onCancel = useCallback(() => {
|
|
51
|
+
setPickerOpen(false);
|
|
52
|
+
requestAnimationFrame(() => focusAccessibility(refObject.current));
|
|
53
|
+
}, [refObject]);
|
|
54
|
+
const accessibilityLabel = error ? `${label}, ${error}` : label;
|
|
55
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, _extends({
|
|
56
|
+
accessibilityHint: t('accessibility.control.combobox.tapToSelect'),
|
|
57
|
+
accessibilityLabel: accessibilityLabel,
|
|
58
|
+
accessibilityRole: "combobox",
|
|
59
|
+
accessibilityValue: {
|
|
60
|
+
text: selectedChoice === null || selectedChoice === void 0 ? void 0 : selectedChoice.label
|
|
61
|
+
},
|
|
62
|
+
onPress: onOpen,
|
|
63
|
+
ref: forwardedRef
|
|
64
|
+
}, props), /*#__PURE__*/React.createElement(TextInput, {
|
|
65
|
+
accessory: TextInputAccessory.Dropdown,
|
|
66
|
+
disabled: true,
|
|
67
|
+
error: error,
|
|
68
|
+
label: label,
|
|
69
|
+
pointerEvents: "none",
|
|
70
|
+
value: (_selectedChoice$short = selectedChoice === null || selectedChoice === void 0 ? void 0 : selectedChoice.shortLabel) !== null && _selectedChoice$short !== void 0 ? _selectedChoice$short : selectedChoice === null || selectedChoice === void 0 ? void 0 : selectedChoice.label
|
|
71
|
+
}), /*#__PURE__*/React.createElement(Picker, {
|
|
72
|
+
cancelText: pickerCancelLabel,
|
|
73
|
+
confirmText: pickerConfirmLabel,
|
|
74
|
+
items: values.map(_ref4 => {
|
|
75
|
+
let {
|
|
76
|
+
label: itemLabel
|
|
77
|
+
} = _ref4;
|
|
78
|
+
return itemLabel;
|
|
79
|
+
}),
|
|
80
|
+
modal: true,
|
|
81
|
+
mode: "list",
|
|
82
|
+
onCancel: onCancel,
|
|
83
|
+
onConfirm: onConfirm,
|
|
84
|
+
open: pickerOpen,
|
|
85
|
+
selectedValue: selectedChoice === null || selectedChoice === void 0 ? void 0 : selectedChoice.label,
|
|
86
|
+
textColor: colorScheme.text,
|
|
87
|
+
title: pickerTitle !== null && pickerTitle !== void 0 ? pickerTitle : label
|
|
88
|
+
}));
|
|
89
|
+
});
|
|
90
|
+
SelectionInput.displayName = 'SelectionInput';
|
|
91
|
+
export default SelectionInput;
|
|
92
|
+
//# sourceMappingURL=selection-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Picker","React","forwardRef","useCallback","useMemo","useState","focusAccessibility","TouchableOpacity","useAccessibilityTranslation","useAppColorScheme","useForwardedRef","TextInput","TextInputAccessory","SelectionInput","_ref","ref","_selectedChoice$short","selectedValue","values","label","pickerTitle","pickerConfirmLabel","pickerCancelLabel","onChange","error","props","t","colorScheme","selectedChoice","undefined","find","_ref2","value","forwardedRef","refObject","pickerOpen","setPickerOpen","onOpen","onConfirm","valueLabel","choice","_ref3","choiceLabel","setTimeout","current","onCancel","requestAnimationFrame","accessibilityLabel","createElement","_extends","accessibilityHint","accessibilityRole","accessibilityValue","text","onPress","accessory","Dropdown","disabled","pointerEvents","shortLabel","cancelText","confirmText","items","map","_ref4","itemLabel","modal","mode","open","textColor","title","displayName"],"sources":["selection-input.tsx"],"sourcesContent":["import Picker from '@procivis/react-native-picker';\nimport React, { forwardRef, useCallback, useMemo, useState } from 'react';\nimport type { TouchableOpacityProps } from 'react-native';\n\nimport { focusAccessibility } from '../accessibility/accessibility';\nimport { TouchableOpacity, TouchableOpacityRef } from '../accessibility/accessibilityHistoryWrappers';\nimport { useAccessibilityTranslation } from '../accessibility/accessibilityLanguage';\nimport { useAppColorScheme } from '../theme';\nimport { useForwardedRef } from '../utils/ref';\nimport TextInput, { TextInputAccessory } from './text-input';\n\nexport interface SelectionInputChoice {\n label: string;\n /**\n * If specified used in the input display, otherwise {@link label} used.\n * The {@link label} is always used for the picker values.\n */\n shortLabel?: string;\n value: string | number;\n}\n\nexport interface SelectionInputProps extends TouchableOpacityProps {\n error?: string;\n label: string;\n /**\n * Called when selection changes\n * @return `true` to avoid accessibility auto-focusing, `false` otherwise\n */\n onChange?: (value: SelectionInputChoice) => boolean;\n pickerCancelLabel: string;\n\n pickerConfirmLabel: string;\n pickerTitle?: string;\n /** {@link SelectionInputChoice.label} of the selected choice */\n selectedValue?: string | number;\n\n values: SelectionInputChoice[];\n}\n\n/**\n * Generic selection input component\n * @see https://www.figma.com/file/Gd0Tj0234hxtl3HMcCJThW/App-Component-Library-(Design)?node-id=4%3A127&t=B2Y3PtJHH22XDPkx-0\n */\nconst SelectionInput = forwardRef<TouchableOpacityRef, SelectionInputProps>(\n (\n { selectedValue, values, label, pickerTitle, pickerConfirmLabel, pickerCancelLabel, onChange, error, ...props },\n ref,\n ) => {\n const t = useAccessibilityTranslation();\n const colorScheme = useAppColorScheme();\n const selectedChoice = useMemo(\n () => (selectedValue !== undefined ? values.find(({ value }) => value === selectedValue) : undefined),\n [selectedValue, values],\n );\n\n const [forwardedRef, refObject] = useForwardedRef(ref);\n const [pickerOpen, setPickerOpen] = useState(false);\n\n const onOpen = useCallback(() => setPickerOpen(true), []);\n const onConfirm = useCallback(\n (valueLabel: any) => {\n setPickerOpen(false);\n const choice = values.find(({ label: choiceLabel }) => choiceLabel === valueLabel);\n if (!choice || !onChange?.(choice)) {\n setTimeout(() => focusAccessibility(refObject.current), 200);\n }\n },\n [onChange, refObject, values],\n );\n const onCancel = useCallback(() => {\n setPickerOpen(false);\n requestAnimationFrame(() => focusAccessibility(refObject.current));\n }, [refObject]);\n\n const accessibilityLabel = error ? `${label}, ${error}` : label;\n return (\n <TouchableOpacity\n accessibilityHint={t('accessibility.control.combobox.tapToSelect')}\n accessibilityLabel={accessibilityLabel}\n accessibilityRole=\"combobox\"\n accessibilityValue={{ text: selectedChoice?.label }}\n onPress={onOpen}\n ref={forwardedRef}\n {...props}>\n <TextInput\n accessory={TextInputAccessory.Dropdown}\n disabled={true}\n error={error}\n label={label}\n pointerEvents=\"none\"\n value={selectedChoice?.shortLabel ?? selectedChoice?.label}\n />\n <Picker\n cancelText={pickerCancelLabel}\n confirmText={pickerConfirmLabel}\n items={values.map(({ label: itemLabel }) => itemLabel)}\n modal\n mode=\"list\"\n onCancel={onCancel}\n onConfirm={onConfirm}\n open={pickerOpen}\n selectedValue={selectedChoice?.label}\n textColor={colorScheme.text}\n title={pickerTitle ?? label}\n />\n </TouchableOpacity>\n );\n },\n);\n\nSelectionInput.displayName = 'SelectionInput';\nexport default SelectionInput;\n"],"mappings":";AAAA,OAAOA,MAAM,MAAM,+BAA+B;AAClD,OAAOC,KAAK,IAAIC,UAAU,EAAEC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAGzE,SAASC,kBAAkB,QAAQ,gCAAgC;AACnE,SAASC,gBAAgB,QAA6B,+CAA+C;AACrG,SAASC,2BAA2B,QAAQ,wCAAwC;AACpF,SAASC,iBAAiB,QAAQ,UAAU;AAC5C,SAASC,eAAe,QAAQ,cAAc;AAC9C,OAAOC,SAAS,IAAIC,kBAAkB,QAAQ,cAAc;AA8B5D;AACA;AACA;AACA;AACA,MAAMC,cAAc,gBAAGX,UAAU,CAC/B,CAAAY,IAAA,EAEEC,GAAG,KACA;EAAA,IAAAC,qBAAA;EAAA,IAFH;IAAEC,aAAa;IAAEC,MAAM;IAAEC,KAAK;IAAEC,WAAW;IAAEC,kBAAkB;IAAEC,iBAAiB;IAAEC,QAAQ;IAAEC,KAAK;IAAE,GAAGC;EAAM,CAAC,GAAAX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ACjBlB,aAAa,EAAEW,cAAc,aAAdA,cAAc,uBAAdA,cAAc,CAAET,KAAM;IACrCkD,SAAS,EAAE1C,WAAW,CAAC0B,IAAK;IAC5BiB,KAAK,EAAElD,WAAW,aAAXA,WAAW,cAAXA,WAAW,GAAID;EAAM,EAC5B,CACe;AAEvB,CAAC,CACF;AAEDN,cAAc,CAAC0D,WAAW,GAAG,gBAAgB;AAC7C,eAAe1D,cAAc"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
import React, { forwardRef, useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import { Animated, Platform, StyleSheet, TextInput as RNTextInput, useWindowDimensions, View } from 'react-native';
|
|
4
|
+
import { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';
|
|
5
|
+
import { ClearInputIcon, DropdownInputIcon } from '../icons/input';
|
|
6
|
+
import font from '../text/font';
|
|
7
|
+
import Typography from '../text/typography';
|
|
8
|
+
import { useAppColorScheme } from '../theme/color-scheme-context';
|
|
9
|
+
import { concatTestID } from '../utils/testID';
|
|
10
|
+
|
|
11
|
+
// difference between font sizes
|
|
12
|
+
const LABEL_SCALE_RATIO = 14 / 12;
|
|
13
|
+
export let TextInputAccessory;
|
|
14
|
+
(function (TextInputAccessory) {
|
|
15
|
+
TextInputAccessory["Dropdown"] = "dropdown";
|
|
16
|
+
TextInputAccessory["Clear"] = "clear";
|
|
17
|
+
})(TextInputAccessory || (TextInputAccessory = {}));
|
|
18
|
+
const hitSlop = {
|
|
19
|
+
bottom: 10,
|
|
20
|
+
left: 10,
|
|
21
|
+
right: 10,
|
|
22
|
+
top: 10
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Generic text input component
|
|
26
|
+
* @see https://www.figma.com/file/Gd0Tj0234hxtl3HMcCJThW/App-Component-Library-(Design)?node-id=3%3A824&t=r7HhHF1rsNLmOBL2-4
|
|
27
|
+
*/
|
|
28
|
+
const TextInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
29
|
+
let {
|
|
30
|
+
value,
|
|
31
|
+
label,
|
|
32
|
+
accessory = TextInputAccessory.Clear,
|
|
33
|
+
accessoryAccessibilityLabel,
|
|
34
|
+
onAccessoryPress,
|
|
35
|
+
onSubmit,
|
|
36
|
+
onFocus,
|
|
37
|
+
onBlur,
|
|
38
|
+
disabled,
|
|
39
|
+
error,
|
|
40
|
+
style,
|
|
41
|
+
placeholder,
|
|
42
|
+
...props
|
|
43
|
+
} = _ref;
|
|
44
|
+
const colorScheme = useAppColorScheme();
|
|
45
|
+
const {
|
|
46
|
+
fontScale
|
|
47
|
+
} = useWindowDimensions();
|
|
48
|
+
const [focused, setFocused] = useState(false);
|
|
49
|
+
const onFocusAction = useCallback(e => {
|
|
50
|
+
setFocused(true);
|
|
51
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
52
|
+
}, [onFocus]);
|
|
53
|
+
const onBlurAction = useCallback(e => {
|
|
54
|
+
setFocused(false);
|
|
55
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
56
|
+
}, [onBlur]);
|
|
57
|
+
const onSubmitEditing = useCallback(e => onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(e.nativeEvent.text), [onSubmit]);
|
|
58
|
+
const accessoryIcon = useMemo(() => {
|
|
59
|
+
switch (accessory) {
|
|
60
|
+
case TextInputAccessory.Dropdown:
|
|
61
|
+
return /*#__PURE__*/React.createElement(DropdownInputIcon, null);
|
|
62
|
+
case TextInputAccessory.Clear:
|
|
63
|
+
return value && !disabled ? /*#__PURE__*/React.createElement(ClearInputIcon, null) : undefined;
|
|
64
|
+
}
|
|
65
|
+
}, [accessory, disabled, value]);
|
|
66
|
+
const accessoryComponent = accessoryIcon ? /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
67
|
+
accessibilityLabel: accessoryAccessibilityLabel,
|
|
68
|
+
accessibilityRole: "button",
|
|
69
|
+
accessible: !disabled,
|
|
70
|
+
disabled: disabled,
|
|
71
|
+
hitSlop: hitSlop,
|
|
72
|
+
onPress: onAccessoryPress,
|
|
73
|
+
testID: concatTestID(props.testID, 'accessoryButton')
|
|
74
|
+
}, accessoryIcon) : null;
|
|
75
|
+
const labelPosition = focused || value ? 0 : 1;
|
|
76
|
+
const [labelAnimation] = useState(() => new Animated.Value(labelPosition));
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
Animated.timing(labelAnimation, {
|
|
79
|
+
duration: 200,
|
|
80
|
+
toValue: labelPosition,
|
|
81
|
+
useNativeDriver: true
|
|
82
|
+
}).start();
|
|
83
|
+
}, [labelAnimation, labelPosition]);
|
|
84
|
+
const [labelLayout, setLabelLayout] = useState();
|
|
85
|
+
const onLabelLayout = useCallback(event => setLabelLayout(event.nativeEvent.layout), []);
|
|
86
|
+
const accessibilityLabel = disabled ? undefined : label;
|
|
87
|
+
const inputStyle = {
|
|
88
|
+
height: Math.min(2, fontScale) * 24
|
|
89
|
+
};
|
|
90
|
+
const input = /*#__PURE__*/React.createElement(RNTextInput, _extends({
|
|
91
|
+
accessibilityLabel: accessibilityLabel,
|
|
92
|
+
defaultValue: value || '',
|
|
93
|
+
editable: !disabled,
|
|
94
|
+
hitSlop: hitSlop,
|
|
95
|
+
maxFontSizeMultiplier: 2,
|
|
96
|
+
numberOfLines: 1,
|
|
97
|
+
onBlur: onBlurAction,
|
|
98
|
+
onFocus: onFocusAction,
|
|
99
|
+
onSubmitEditing: onSubmitEditing,
|
|
100
|
+
placeholder: focused ? placeholder : undefined,
|
|
101
|
+
ref: ref,
|
|
102
|
+
returnKeyType: "next",
|
|
103
|
+
style: [font.regular, styles.inputText, Platform.OS === 'android' ? styles.inputAndroid : styles.inputIOS, {
|
|
104
|
+
color: colorScheme.text
|
|
105
|
+
}],
|
|
106
|
+
textAlignVertical: "center"
|
|
107
|
+
// https://github.com/facebook/react-native/issues/17530
|
|
108
|
+
,
|
|
109
|
+
underlineColorAndroid: "#00000000",
|
|
110
|
+
value: value
|
|
111
|
+
}, props));
|
|
112
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
113
|
+
style: style
|
|
114
|
+
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
115
|
+
onLayout: onLabelLayout,
|
|
116
|
+
style: labelLayout ? {
|
|
117
|
+
transform: [{
|
|
118
|
+
// move label into the position of placeholder
|
|
119
|
+
translateY: labelAnimation.interpolate({
|
|
120
|
+
inputRange: [0, 1],
|
|
121
|
+
outputRange: [0, labelLayout.height + 4]
|
|
122
|
+
})
|
|
123
|
+
}, {
|
|
124
|
+
// compensate scale position in X direction
|
|
125
|
+
translateX: labelAnimation.interpolate({
|
|
126
|
+
inputRange: [0, 1],
|
|
127
|
+
outputRange: [0, labelLayout.width * (LABEL_SCALE_RATIO - 1) / 2]
|
|
128
|
+
})
|
|
129
|
+
}, {
|
|
130
|
+
// scale label into the size of placeholder
|
|
131
|
+
scale: labelAnimation.interpolate({
|
|
132
|
+
inputRange: [0, 1],
|
|
133
|
+
outputRange: [1, LABEL_SCALE_RATIO]
|
|
134
|
+
})
|
|
135
|
+
}]
|
|
136
|
+
} : undefined
|
|
137
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
138
|
+
accessible: false,
|
|
139
|
+
color: 'rgba(0, 0, 0, 0.50)',
|
|
140
|
+
preset: "s"
|
|
141
|
+
}, label)), /*#__PURE__*/React.createElement(View, {
|
|
142
|
+
style: [styles.inputRow, {
|
|
143
|
+
borderColor: focused ? colorScheme.accent : colorScheme.grayDark
|
|
144
|
+
}]
|
|
145
|
+
}, Platform.OS === 'android' ? /*#__PURE__*/React.createElement(View, {
|
|
146
|
+
style: [styles.inputWrapperAndroid, inputStyle]
|
|
147
|
+
}, input) : input, accessoryComponent), error ? /*#__PURE__*/React.createElement(Typography, {
|
|
148
|
+
color: colorScheme.error,
|
|
149
|
+
preset: "s"
|
|
150
|
+
}, error) : null);
|
|
151
|
+
});
|
|
152
|
+
const styles = StyleSheet.create({
|
|
153
|
+
inputAndroid: {
|
|
154
|
+
fontSize: 14,
|
|
155
|
+
left: 0,
|
|
156
|
+
letterSpacing: 0.2,
|
|
157
|
+
lineHeight: 22,
|
|
158
|
+
position: 'absolute',
|
|
159
|
+
right: 0
|
|
160
|
+
},
|
|
161
|
+
inputIOS: {
|
|
162
|
+
flex: 1
|
|
163
|
+
},
|
|
164
|
+
inputRow: {
|
|
165
|
+
alignItems: 'center',
|
|
166
|
+
borderBottomWidth: 1,
|
|
167
|
+
flexDirection: 'row',
|
|
168
|
+
marginBottom: 4,
|
|
169
|
+
paddingVertical: 4
|
|
170
|
+
},
|
|
171
|
+
inputText: {
|
|
172
|
+
fontSize: 14,
|
|
173
|
+
letterSpacing: 0.2,
|
|
174
|
+
lineHeight: Platform.OS === 'android' ? 22 : 20,
|
|
175
|
+
minHeight: 24
|
|
176
|
+
},
|
|
177
|
+
inputWrapperAndroid: {
|
|
178
|
+
flex: 1,
|
|
179
|
+
justifyContent: 'center',
|
|
180
|
+
overflow: 'visible'
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
TextInput.displayName = 'Input';
|
|
184
|
+
export default TextInput;
|
|
185
|
+
//# sourceMappingURL=text-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useCallback","useEffect","useMemo","useState","Animated","Platform","StyleSheet","TextInput","RNTextInput","useWindowDimensions","View","TouchableOpacity","ClearInputIcon","DropdownInputIcon","font","Typography","useAppColorScheme","concatTestID","LABEL_SCALE_RATIO","TextInputAccessory","hitSlop","bottom","left","right","top","_ref","ref","value","label","accessory","Clear","accessoryAccessibilityLabel","onAccessoryPress","onSubmit","onFocus","onBlur","disabled","error","style","placeholder","props","colorScheme","fontScale","focused","setFocused","onFocusAction","e","onBlurAction","onSubmitEditing","nativeEvent","text","accessoryIcon","Dropdown","createElement","undefined","accessoryComponent","accessibilityLabel","accessibilityRole","accessible","onPress","testID","labelPosition","labelAnimation","Value","timing","duration","toValue","useNativeDriver","start","labelLayout","setLabelLayout","onLabelLayout","event","layout","inputStyle","height","Math","min","input","_extends","defaultValue","editable","maxFontSizeMultiplier","numberOfLines","returnKeyType","regular","styles","inputText","OS","inputAndroid","inputIOS","color","textAlignVertical","underlineColorAndroid","onLayout","transform","translateY","interpolate","inputRange","outputRange","translateX","width","scale","preset","inputRow","borderColor","accent","grayDark","inputWrapperAndroid","create","fontSize","letterSpacing","lineHeight","position","flex","alignItems","borderBottomWidth","flexDirection","marginBottom","paddingVertical","minHeight","justifyContent","overflow","displayName"],"sources":["text-input.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useEffect, useMemo, useState } from 'react';\nimport {\n Animated,\n Insets,\n LayoutChangeEvent,\n LayoutRectangle,\n NativeSyntheticEvent,\n Platform,\n StyleProp,\n StyleSheet,\n TextInput as RNTextInput,\n TextInputFocusEventData as RNTextInputFocusEventData,\n TextInputProps as RNTextInputProps,\n TextInputSubmitEditingEventData as RNTextInputSubmitEditingEventData,\n useWindowDimensions,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport { ClearInputIcon, DropdownInputIcon } from '../icons/input';\nimport font from '../text/font';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\nimport { concatTestID } from '../utils/testID';\n\n// difference between font sizes\nconst LABEL_SCALE_RATIO = 14 / 12;\n\nexport enum TextInputAccessory {\n Dropdown = 'dropdown',\n Clear = 'clear',\n}\n\nconst hitSlop: Insets = { bottom: 10, left: 10, right: 10, top: 10 };\n\nexport type TextInputProps = Omit<RNTextInputProps, 'editable' | 'onSubmitEditing' | 'style'> & {\n accessory?: TextInputAccessory;\n accessoryAccessibilityLabel?: string;\n disabled?: boolean;\n error?: string;\n label: string;\n onAccessoryPress?: () => void;\n onSubmit?: (value: string) => void;\n style?: StyleProp<ViewStyle>;\n};\n\n/**\n * Generic text input component\n * @see https://www.figma.com/file/Gd0Tj0234hxtl3HMcCJThW/App-Component-Library-(Design)?node-id=3%3A824&t=r7HhHF1rsNLmOBL2-4\n */\nconst TextInput = forwardRef<RNTextInput, TextInputProps>(\n (\n {\n value,\n label,\n accessory = TextInputAccessory.Clear,\n accessoryAccessibilityLabel,\n onAccessoryPress,\n onSubmit,\n onFocus,\n onBlur,\n disabled,\n error,\n style,\n placeholder,\n ...props\n },\n ref,\n ) => {\n const colorScheme = useAppColorScheme();\n const { fontScale } = useWindowDimensions();\n\n const [focused, setFocused] = useState(false);\n const onFocusAction = useCallback(\n (e: NativeSyntheticEvent<RNTextInputFocusEventData>) => {\n setFocused(true);\n onFocus?.(e);\n },\n [onFocus],\n );\n const onBlurAction = useCallback(\n (e: NativeSyntheticEvent<RNTextInputFocusEventData>) => {\n setFocused(false);\n onBlur?.(e);\n },\n [onBlur],\n );\n\n const onSubmitEditing = useCallback(\n (e: NativeSyntheticEvent<RNTextInputSubmitEditingEventData>) => onSubmit?.(e.nativeEvent.text),\n [onSubmit],\n );\n\n const accessoryIcon = useMemo(() => {\n switch (accessory) {\n case TextInputAccessory.Dropdown:\n return <DropdownInputIcon />;\n case TextInputAccessory.Clear:\n return value && !disabled ? <ClearInputIcon /> : undefined;\n }\n }, [accessory, disabled, value]);\n\n const accessoryComponent = accessoryIcon ? (\n <TouchableOpacity\n accessibilityLabel={accessoryAccessibilityLabel}\n accessibilityRole=\"button\"\n accessible={!disabled}\n disabled={disabled}\n hitSlop={hitSlop}\n onPress={onAccessoryPress}\n testID={concatTestID(props.testID, 'accessoryButton')}>\n {accessoryIcon}\n </TouchableOpacity>\n ) : null;\n\n const labelPosition = focused || value ? 0 : 1;\n const [labelAnimation] = useState<Animated.Value>(() => new Animated.Value(labelPosition));\n useEffect(() => {\n Animated.timing(labelAnimation, {\n duration: 200,\n toValue: labelPosition,\n useNativeDriver: true,\n }).start();\n }, [labelAnimation, labelPosition]);\n\n const [labelLayout, setLabelLayout] = useState<LayoutRectangle>();\n const onLabelLayout = useCallback((event: LayoutChangeEvent) => setLabelLayout(event.nativeEvent.layout), []);\n\n const accessibilityLabel = disabled ? undefined : label;\n const inputStyle = { height: Math.min(2, fontScale) * 24 };\n\n const input = (\n <RNTextInput\n accessibilityLabel={accessibilityLabel}\n defaultValue={value || ''}\n editable={!disabled}\n hitSlop={hitSlop}\n maxFontSizeMultiplier={2}\n numberOfLines={1}\n onBlur={onBlurAction}\n onFocus={onFocusAction}\n onSubmitEditing={onSubmitEditing}\n placeholder={focused ? placeholder : undefined}\n ref={ref}\n returnKeyType=\"next\"\n style={[\n font.regular,\n styles.inputText,\n Platform.OS === 'android' ? styles.inputAndroid : styles.inputIOS,\n {\n color: colorScheme.text,\n },\n ]}\n textAlignVertical=\"center\"\n // https://github.com/facebook/react-native/issues/17530\n underlineColorAndroid=\"#00000000\"\n value={value}\n {...props}\n />\n );\n return (\n <View style={style}>\n <Animated.View\n onLayout={onLabelLayout}\n style={\n labelLayout\n ? {\n transform: [\n {\n // move label into the position of placeholder\n translateY: labelAnimation.interpolate({\n inputRange: [0, 1],\n outputRange: [0, labelLayout.height + 4],\n }),\n },\n {\n // compensate scale position in X direction\n translateX: labelAnimation.interpolate({\n inputRange: [0, 1],\n outputRange: [0, (labelLayout.width * (LABEL_SCALE_RATIO - 1)) / 2],\n }),\n },\n {\n // scale label into the size of placeholder\n scale: labelAnimation.interpolate({\n inputRange: [0, 1],\n outputRange: [1, LABEL_SCALE_RATIO],\n }),\n },\n ],\n }\n : undefined\n }>\n <Typography accessible={false} color={'rgba(0, 0, 0, 0.50)'} preset=\"s\">\n {label}\n </Typography>\n </Animated.View>\n <View\n style={[\n styles.inputRow,\n {\n borderColor: focused ? colorScheme.accent : colorScheme.grayDark,\n },\n ]}>\n {Platform.OS === 'android' ? <View style={[styles.inputWrapperAndroid, inputStyle]}>{input}</View> : input}\n {accessoryComponent}\n </View>\n {error ? (\n <Typography color={colorScheme.error} preset=\"s\">\n {error}\n </Typography>\n ) : null}\n </View>\n );\n },\n);\n\nconst styles = StyleSheet.create({\n inputAndroid: {\n fontSize: 14,\n left: 0,\n letterSpacing: 0.2,\n lineHeight: 22,\n position: 'absolute',\n right: 0,\n },\n inputIOS: {\n flex: 1,\n },\n inputRow: {\n alignItems: 'center',\n borderBottomWidth: 1,\n flexDirection: 'row',\n marginBottom: 4,\n paddingVertical: 4,\n },\n inputText: {\n fontSize: 14,\n letterSpacing: 0.2,\n lineHeight: Platform.OS === 'android' ? 22 : 20,\n minHeight: 24,\n },\n inputWrapperAndroid: {\n flex: 1,\n justifyContent: 'center',\n overflow: 'visible',\n },\n});\n\nTextInput.displayName = 'Input';\n\nexport default TextInput;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACpF,SACEC,QAAQ,EAKRC,QAAQ,EAERC,UAAU,EACVC,SAAS,IAAIC,WAAW,EAIxBC,mBAAmB,EACnBC,IAAI,QAEC,cAAc;AAErB,SAASC,gBAAgB,QAAQ,+CAA+C;AAChF,SAASC,cAAc,EAAEC,iBAAiB,QAAQ,gBAAgB;AAClE,OAAOC,IAAI,MAAM,cAAc;AAC/B,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;AACjE,SAASC,YAAY,QAAQ,iBAAiB;;AAE9C;AACA,MAAMC,iBAAiB,GAAG,EAAE,GAAG,EAAE;AAEjC,WAAYC,kBAAkB;AAG7B,WAHWA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;AAAA,GAAlBA,kBAAkB,KAAlBA,kBAAkB;AAK9B,MAAMC,OAAe,GAAG;EAAEC,MAAM,EAAE,EAAE;EAAEC,IAAI,EAAE,EAAE;EAAEC,KAAK,E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GAC7ClE,KAAK,CACK,GACX,IAAI,CACH;AAEX,CAAC,CACF;AAED,MAAMiD,MAAM,GAAGhF,UAAU,CAACuG,MAAM,CAAC;EAC/BpB,YAAY,EAAE;IACZqB,QAAQ,EAAE,EAAE;IACZxF,IAAI,EAAE,CAAC;IACPyF,aAAa,EAAE,GAAG;IAClBC,UAAU,EAAE,EAAE;IACdC,QAAQ,EAAE,UAAU;IACpB1F,KAAK,EAAE;EACT,CAAC;EACDmE,QAAQ,EAAE;IACRwB,IAAI,EAAE;EACR,CAAC;EACDV,QAAQ,EAAE;IACRW,UAAU,EAAE,QAAQ;IACpBC,iBAAiB,EAAE,CAAC;IACpBC,aAAa,EAAE,KAAK;IACpBC,YAAY,EAAE,CAAC;IACfC,eAAe,EAAE;EACnB,CAAC;EACDhC,SAAS,EAAE;IACTuB,QAAQ,EAAE,EAAE;IACZC,aAAa,EAAE,GAAG;IAClBC,UAAU,EAAE3G,QAAQ,CAACmF,EAAE,KAAK,SAAS,GAAG,EAAE,GAAG,EAAE;IAC/CgC,SAAS,EAAE;EACb,CAAC;EACDZ,mBAAmB,EAAE;IACnBM,IAAI,EAAE,CAAC;IACPO,cAAc,EAAE,QAAQ;IACxBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAEFnH,SAAS,CAACoH,WAAW,GAAG,OAAO;AAE/B,eAAepH,SAAS"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import ListSectionHeader, { ListSectionHeaderProps } from './list-section-header';
|
|
2
|
+
import ListTitleHeader, { ListTitleHeaderProps } from './list-title-header';
|
|
3
|
+
export { ListSectionHeader, ListSectionHeaderProps };
|
|
4
|
+
export { ListTitleHeader, ListTitleHeaderProps };
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ListSectionHeader","ListSectionHeaderProps","ListTitleHeader","ListTitleHeaderProps"],"sources":["index.ts"],"sourcesContent":["import ListSectionHeader, { ListSectionHeaderProps } from './list-section-header';\nimport ListTitleHeader, { ListTitleHeaderProps } from './list-title-header';\n\nexport { ListSectionHeader, ListSectionHeaderProps };\nexport { ListTitleHeader, ListTitleHeaderProps };\n"],"mappings":"AAAA,OAAOA,iBAAiB,IAAIC,sBAAsB,QAAQ,uBAAuB;AACjF,OAAOC,eAAe,IAAIC,oBAAoB,QAAQ,qBAAqB;AAE3E,SAASH,iBAAiB,EAAEC,sBAAsB;AAClD,SAASC,eAAe,EAAEC,oBAAoB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { StyleSheet } from 'react-native';
|
|
4
|
+
import Typography from '../text/typography';
|
|
5
|
+
import { useAppColorScheme } from '../theme/color-scheme-context';
|
|
6
|
+
const ListSectionHeader = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
accessibilityRole,
|
|
9
|
+
color,
|
|
10
|
+
style,
|
|
11
|
+
title,
|
|
12
|
+
...typographyProps
|
|
13
|
+
} = _ref;
|
|
14
|
+
const colorScheme = useAppColorScheme();
|
|
15
|
+
return /*#__PURE__*/React.createElement(Typography, _extends({
|
|
16
|
+
accessibilityRole: accessibilityRole !== null && accessibilityRole !== void 0 ? accessibilityRole : 'header',
|
|
17
|
+
color: color !== null && color !== void 0 ? color : colorScheme.text,
|
|
18
|
+
style: [styles.sectionHeader, style]
|
|
19
|
+
}, typographyProps), title);
|
|
20
|
+
};
|
|
21
|
+
const styles = StyleSheet.create({
|
|
22
|
+
sectionHeader: {
|
|
23
|
+
marginHorizontal: 20,
|
|
24
|
+
marginVertical: 16
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
export default ListSectionHeader;
|
|
28
|
+
//# sourceMappingURL=list-section-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","Typography","useAppColorScheme","ListSectionHeader","_ref","accessibilityRole","color","style","title","typographyProps","colorScheme","createElement","_extends","text","styles","sectionHeader","create","marginHorizontal","marginVertical"],"sources":["list-section-header.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport Typography, { TypographyProps } from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport type ListSectionHeaderProps = Partial<TypographyProps> & {\n title: string;\n};\n\nconst ListSectionHeader: FC<ListSectionHeaderProps> = ({\n accessibilityRole,\n color,\n style,\n title,\n ...typographyProps\n}) => {\n const colorScheme = useAppColorScheme();\n return (\n <Typography\n accessibilityRole={accessibilityRole ?? 'header'}\n color={color ?? colorScheme.text}\n style={[styles.sectionHeader, style]}\n {...typographyProps}>\n {title}\n </Typography>\n );\n};\n\nconst styles = StyleSheet.create({\n sectionHeader: {\n marginHorizontal: 20,\n marginVertical: 16,\n },\n});\n\nexport default ListSectionHeader;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAc,OAAO;AACjC,SAASC,UAAU,QAAQ,cAAc;AAEzC,OAAOC,UAAU,MAA2B,oBAAoB;AAChE,SAASC,iBAAiB,QAAQ,+BAA+B;AAMjE,MAAMC,iBAA6C,GAAGC,IAAA,IAMhD;EAAA,IANiD;IACrDC,iBAAiB;IACjBC,KAAK;IACLC,KAAK;IACLC,KAAK;IACL,GAAGC;EACL,CAAC,GAAAL,IAAA;EACC,MAAMM,WAAW,GAAGR,iBAAiB,EAAE;EACvC,oBACEH,KAAA,CAAAY,aAAA,CAACV,UAAU,EAAAW,QAAA;IACTP,iBAAiB,EAAEA,iBAAiB,aAAjBA,iBAAiB,cAAjBA,iBAAiB,GAAI,QAAS;IACjDC,KAAK,EAAEA,KAAK,aAALA,KAAK,cAALA,KAAK,GAAII,WAAW,CAACG,IAAK;IACjCN,KAAK,EAAE,CAACO,MAAM,CAACC,aAAa,EAAER,KAAK;EAAE,GACjCE,eAAe,GAClBD,KAAK,CACK;AAEjB,CAAC;AAED,MAAMM,MAAM,GAAGd,UAAU,CAACgB,MAAM,CAAC;EAC/BD,aAAa,EAAE;IACbE,gBAAgB,EAAE,EAAE;IACpBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;AAEF,eAAef,iBAAiB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
import Typography from '../text/typography';
|
|
4
|
+
import { useAppColorScheme } from '../theme/color-scheme-context';
|
|
5
|
+
const ListTitleHeader = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
title,
|
|
8
|
+
testID
|
|
9
|
+
} = _ref;
|
|
10
|
+
const colorScheme = useAppColorScheme();
|
|
11
|
+
return /*#__PURE__*/React.createElement(Typography, {
|
|
12
|
+
testID: testID,
|
|
13
|
+
accessibilityRole: "header",
|
|
14
|
+
color: colorScheme.text,
|
|
15
|
+
preset: "l",
|
|
16
|
+
style: styles.listTitle
|
|
17
|
+
}, title);
|
|
18
|
+
};
|
|
19
|
+
const styles = StyleSheet.create({
|
|
20
|
+
listTitle: {
|
|
21
|
+
marginBottom: 20,
|
|
22
|
+
marginHorizontal: 20,
|
|
23
|
+
marginTop: 9
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
export default ListTitleHeader;
|
|
27
|
+
//# sourceMappingURL=list-title-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","Typography","useAppColorScheme","ListTitleHeader","_ref","title","testID","colorScheme","createElement","accessibilityRole","color","text","preset","style","styles","listTitle","create","marginBottom","marginHorizontal","marginTop"],"sources":["list-title-header.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport type ListTitleHeaderProps = {\n title: string;\n testID?: string;\n};\n\nconst ListTitleHeader: FC<ListTitleHeaderProps> = ({ title, testID }) => {\n const colorScheme = useAppColorScheme();\n\n return (\n <Typography testID={testID} accessibilityRole=\"header\" color={colorScheme.text} preset=\"l\" style={styles.listTitle}>\n {title}\n </Typography>\n );\n};\n\nconst styles = StyleSheet.create({\n listTitle: {\n marginBottom: 20,\n marginHorizontal: 20,\n marginTop: 9,\n },\n});\n\nexport default ListTitleHeader;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAc,OAAO;AACjC,SAASC,UAAU,QAAQ,cAAc;AAEzC,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;AAOjE,MAAMC,eAAyC,GAAGC,IAAA,IAAuB;EAAA,IAAtB;IAAEC,KAAK;IAAEC;EAAO,CAAC,GAAAF,IAAA;EAClE,MAAMG,WAAW,GAAGL,iBAAiB,EAAE;EAEvC,oBACEH,KAAA,CAAAS,aAAA,CAACP,UAAU;IAACK,MAAM,EAAEA,MAAO;IAACG,iBAAiB,EAAC,QAAQ;IAACC,KAAK,EAAEH,WAAW,CAACI,IAAK;IAACC,MAAM,EAAC,GAAG;IAACC,KAAK,EAAEC,MAAM,CAACC;EAAU,GAChHV,KAAK,CACK;AAEjB,CAAC;AAED,MAAMS,MAAM,GAAGd,UAAU,CAACgB,MAAM,CAAC;EAC/BD,SAAS,EAAE;IACTE,YAAY,EAAE,EAAE;IAChBC,gBAAgB,EAAE,EAAE;IACpBC,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAEF,eAAehB,eAAe"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import LoaderView, { LoaderViewProps, LoaderViewState } from './loader';
|
|
2
|
+
import LoadingResultScreen, { LoadingResultScreenProps } from './loading-result';
|
|
3
|
+
export { LoaderView, LoaderViewProps, LoaderViewState };
|
|
4
|
+
export { LoadingResultScreen, LoadingResultScreenProps };
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LoaderView","LoaderViewProps","LoaderViewState","LoadingResultScreen","LoadingResultScreenProps"],"sources":["index.ts"],"sourcesContent":["import LoaderView, { LoaderViewProps, LoaderViewState } from './loader';\nimport LoadingResultScreen, { LoadingResultScreenProps } from './loading-result';\n\nexport { LoaderView, LoaderViewProps, LoaderViewState };\nexport { LoadingResultScreen, LoadingResultScreenProps };\n"],"mappings":"AAAA,OAAOA,UAAU,IAAIC,eAAe,EAAEC,eAAe,QAAQ,UAAU;AACvE,OAAOC,mBAAmB,IAAIC,wBAAwB,QAAQ,kBAAkB;AAEhF,SAASJ,UAAU,EAAEC,eAAe,EAAEC,eAAe;AACrD,SAASC,mBAAmB,EAAEC,wBAAwB"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { InteractionManager, StyleSheet, View } from 'react-native';
|
|
3
|
+
import Animated, { cancelAnimation, Easing, runOnJS, useAnimatedStyle, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated';
|
|
4
|
+
import { LoaderError, LoaderProgressSpinner, LoaderSuccess, LoaderWarning } from '../icons/loader';
|
|
5
|
+
import { concatTestID } from '../utils';
|
|
6
|
+
export let LoaderViewState;
|
|
7
|
+
(function (LoaderViewState) {
|
|
8
|
+
LoaderViewState["Error"] = "error";
|
|
9
|
+
LoaderViewState["InProgress"] = "inProgress";
|
|
10
|
+
LoaderViewState["Success"] = "success";
|
|
11
|
+
LoaderViewState["Warning"] = "warning";
|
|
12
|
+
})(LoaderViewState || (LoaderViewState = {}));
|
|
13
|
+
const LoaderView = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
animate,
|
|
16
|
+
state,
|
|
17
|
+
testID
|
|
18
|
+
} = _ref;
|
|
19
|
+
const [initialDelayPassed, setInitialDelayPassed] = useState(false);
|
|
20
|
+
const rotationIsAnimating = useRef(false);
|
|
21
|
+
const rotation = useSharedValue(0);
|
|
22
|
+
const opacity = useSharedValue(state === LoaderViewState.InProgress ? 0 : 1);
|
|
23
|
+
const finished = state !== LoaderViewState.InProgress;
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const timeout = setTimeout(() => {
|
|
26
|
+
setInitialDelayPassed(true);
|
|
27
|
+
}, 1000);
|
|
28
|
+
return () => {
|
|
29
|
+
clearTimeout(timeout);
|
|
30
|
+
};
|
|
31
|
+
}, []);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
return () => {
|
|
34
|
+
cancelAnimation(rotation);
|
|
35
|
+
};
|
|
36
|
+
}, [rotation]);
|
|
37
|
+
const startRotationAnimation = useCallback(() => {
|
|
38
|
+
if (rotationIsAnimating.current) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
rotationIsAnimating.current = true;
|
|
42
|
+
rotation.value = withRepeat(withTiming(360, {
|
|
43
|
+
duration: 1000,
|
|
44
|
+
easing: Easing.linear
|
|
45
|
+
}), -1);
|
|
46
|
+
}, [rotationIsAnimating, rotation]);
|
|
47
|
+
const stopRotationAnimation = useCallback(() => {
|
|
48
|
+
InteractionManager.runAfterInteractions(() => {
|
|
49
|
+
rotationIsAnimating.current = false;
|
|
50
|
+
cancelAnimation(rotation);
|
|
51
|
+
rotation.value = 0;
|
|
52
|
+
});
|
|
53
|
+
}, [rotationIsAnimating, rotation]);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (animate) {
|
|
56
|
+
startRotationAnimation();
|
|
57
|
+
} else {
|
|
58
|
+
stopRotationAnimation();
|
|
59
|
+
}
|
|
60
|
+
}, [animate, startRotationAnimation, stopRotationAnimation]);
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (!initialDelayPassed) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const toValue = finished ? 1 : 0;
|
|
66
|
+
if (opacity.value === toValue) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (animate) {
|
|
70
|
+
if (!finished) {
|
|
71
|
+
startRotationAnimation();
|
|
72
|
+
}
|
|
73
|
+
opacity.value = withTiming(toValue, {
|
|
74
|
+
duration: 300,
|
|
75
|
+
easing: Easing.ease
|
|
76
|
+
}, () => {
|
|
77
|
+
if (finished) {
|
|
78
|
+
runOnJS(stopRotationAnimation)();
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
} else {
|
|
82
|
+
opacity.value = toValue;
|
|
83
|
+
stopRotationAnimation();
|
|
84
|
+
}
|
|
85
|
+
}, [opacity, finished, initialDelayPassed, animate, stopRotationAnimation, startRotationAnimation]);
|
|
86
|
+
const spinnerAnimatedStyle = useAnimatedStyle(() => ({
|
|
87
|
+
opacity: 1 - opacity.value,
|
|
88
|
+
transform: [{
|
|
89
|
+
rotateZ: `${rotation.value}deg`
|
|
90
|
+
}]
|
|
91
|
+
}), [opacity, rotation]);
|
|
92
|
+
const resultAnimatedStyle = useAnimatedStyle(() => ({
|
|
93
|
+
opacity: opacity.value
|
|
94
|
+
}), [opacity]);
|
|
95
|
+
const finishedIcon = useMemo(() => {
|
|
96
|
+
switch (state) {
|
|
97
|
+
case LoaderViewState.Success:
|
|
98
|
+
return /*#__PURE__*/React.createElement(LoaderSuccess, null);
|
|
99
|
+
case LoaderViewState.Warning:
|
|
100
|
+
return /*#__PURE__*/React.createElement(LoaderWarning, null);
|
|
101
|
+
case LoaderViewState.Error:
|
|
102
|
+
return /*#__PURE__*/React.createElement(LoaderError, null);
|
|
103
|
+
default:
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
}, [state]);
|
|
107
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
108
|
+
style: styles.loader,
|
|
109
|
+
testID: concatTestID(testID, state)
|
|
110
|
+
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
111
|
+
style: [styles.loaderElement, spinnerAnimatedStyle]
|
|
112
|
+
}, /*#__PURE__*/React.createElement(LoaderProgressSpinner, null)), /*#__PURE__*/React.createElement(Animated.View, {
|
|
113
|
+
style: [styles.loaderElement, resultAnimatedStyle]
|
|
114
|
+
}, finishedIcon));
|
|
115
|
+
};
|
|
116
|
+
const styles = StyleSheet.create({
|
|
117
|
+
loader: {
|
|
118
|
+
height: 64,
|
|
119
|
+
width: 64
|
|
120
|
+
},
|
|
121
|
+
loaderElement: {
|
|
122
|
+
height: 64,
|
|
123
|
+
left: 0,
|
|
124
|
+
position: 'absolute',
|
|
125
|
+
top: 0,
|
|
126
|
+
width: 64
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
export default LoaderView;
|
|
130
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useMemo","useRef","useState","InteractionManager","StyleSheet","View","Animated","cancelAnimation","Easing","runOnJS","useAnimatedStyle","useSharedValue","withRepeat","withTiming","LoaderError","LoaderProgressSpinner","LoaderSuccess","LoaderWarning","concatTestID","LoaderViewState","LoaderView","_ref","animate","state","testID","initialDelayPassed","setInitialDelayPassed","rotationIsAnimating","rotation","opacity","InProgress","finished","timeout","setTimeout","clearTimeout","startRotationAnimation","current","value","duration","easing","linear","stopRotationAnimation","runAfterInteractions","toValue","ease","spinnerAnimatedStyle","transform","rotateZ","resultAnimatedStyle","finishedIcon","Success","createElement","Warning","Error","style","styles","loader","loaderElement","create","height","width","left","position","top"],"sources":["loader.tsx"],"sourcesContent":["import React, { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { InteractionManager, StyleSheet, View } from 'react-native';\nimport Animated, {\n cancelAnimation,\n Easing,\n runOnJS,\n useAnimatedStyle,\n useSharedValue,\n withRepeat,\n withTiming,\n} from 'react-native-reanimated';\n\nimport { LoaderError, LoaderProgressSpinner, LoaderSuccess, LoaderWarning } from '../icons/loader';\nimport { concatTestID } from '../utils';\n\nexport enum LoaderViewState {\n Error = 'error',\n InProgress = 'inProgress',\n Success = 'success',\n Warning = 'warning',\n}\n\nexport type LoaderViewProps = {\n animate: boolean;\n state?: LoaderViewState;\n testID?: string;\n};\n\nconst LoaderView: FC<LoaderViewProps> = ({ animate, state, testID }) => {\n const [initialDelayPassed, setInitialDelayPassed] = useState(false);\n const rotationIsAnimating = useRef(false);\n const rotation = useSharedValue(0);\n const opacity = useSharedValue(state === LoaderViewState.InProgress ? 0 : 1);\n\n const finished = state !== LoaderViewState.InProgress;\n\n useEffect(() => {\n const timeout = setTimeout(() => {\n setInitialDelayPassed(true);\n }, 1000);\n\n return () => {\n clearTimeout(timeout);\n };\n }, []);\n\n useEffect(() => {\n return () => {\n cancelAnimation(rotation);\n };\n }, [rotation]);\n\n const startRotationAnimation = useCallback(() => {\n if (rotationIsAnimating.current) {\n return;\n }\n rotationIsAnimating.current = true;\n rotation.value = withRepeat(\n withTiming(360, {\n duration: 1000,\n easing: Easing.linear,\n }),\n -1,\n );\n }, [rotationIsAnimating, rotation]);\n\n const stopRotationAnimation = useCallback(() => {\n InteractionManager.runAfterInteractions(() => {\n rotationIsAnimating.current = false;\n cancelAnimation(rotation);\n rotation.value = 0;\n });\n }, [rotationIsAnimating, rotation]);\n\n useEffect(() => {\n if (animate) {\n startRotationAnimation();\n } else {\n stopRotationAnimation();\n }\n }, [animate, startRotationAnimation, stopRotationAnimation]);\n\n useEffect(() => {\n if (!initialDelayPassed) {\n return;\n }\n const toValue = finished ? 1 : 0;\n if (opacity.value === toValue) {\n return;\n }\n if (animate) {\n if (!finished) {\n startRotationAnimation();\n }\n opacity.value = withTiming(\n toValue,\n {\n duration: 300,\n easing: Easing.ease,\n },\n () => {\n if (finished) {\n runOnJS(stopRotationAnimation)();\n }\n },\n );\n } else {\n opacity.value = toValue;\n stopRotationAnimation();\n }\n }, [opacity, finished, initialDelayPassed, animate, stopRotationAnimation, startRotationAnimation]);\n\n const spinnerAnimatedStyle = useAnimatedStyle(\n () => ({\n opacity: 1 - opacity.value,\n transform: [\n {\n rotateZ: `${rotation.value}deg`,\n },\n ],\n }),\n [opacity, rotation],\n );\n\n const resultAnimatedStyle = useAnimatedStyle(\n () => ({\n opacity: opacity.value,\n }),\n [opacity],\n );\n\n const finishedIcon = useMemo(() => {\n switch (state) {\n case LoaderViewState.Success:\n return <LoaderSuccess />;\n case LoaderViewState.Warning:\n return <LoaderWarning />;\n case LoaderViewState.Error:\n return <LoaderError />;\n default:\n return null;\n }\n }, [state]);\n\n return (\n <View style={styles.loader} testID={concatTestID(testID, state)}>\n <Animated.View style={[styles.loaderElement, spinnerAnimatedStyle]}>\n <LoaderProgressSpinner />\n </Animated.View>\n <Animated.View style={[styles.loaderElement, resultAnimatedStyle]}>{finishedIcon}</Animated.View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n loader: {\n height: 64,\n width: 64,\n },\n loaderElement: {\n height: 64,\n left: 0,\n position: 'absolute',\n top: 0,\n width: 64,\n },\n});\n\nexport default LoaderView;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACpF,SAASC,kBAAkB,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AACnE,OAAOC,QAAQ,IACbC,eAAe,EACfC,MAAM,EACNC,OAAO,EACPC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,EACVC,UAAU,QACL,yBAAyB;AAEhC,SAASC,WAAW,EAAEC,qBAAqB,EAAEC,aAAa,EAAEC,aAAa,QAAQ,iBAAiB;AAClG,SAASC,YAAY,QAAQ,UAAU;AAEvC,WAAYC,eAAe;AAK1B,WALWA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;AAAA,GAAfA,eAAe,KAAfA,eAAe;AAa3B,MAAMC,UAA+B,GAAGC,IAAA,IAAgC;EAAA,IAA/B;IAAEC,OAAO;IAAEC,KAAK;IAAEC;EAAO,CAAC,GAAAH,IAAA;EACjE,MAAM,CAACI,kBAAkB,EAAEC,qBAAqB,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