@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,68 @@
|
|
|
1
|
+
import React, { ComponentType, FunctionComponent, PropsWithChildren, ReactElement, useMemo } from 'react';
|
|
2
|
+
import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import Typography from '../text/typography';
|
|
5
|
+
import { useAppColorScheme } from '../theme/color-scheme-context';
|
|
6
|
+
|
|
7
|
+
const styles = StyleSheet.create({
|
|
8
|
+
container: {
|
|
9
|
+
alignItems: 'center',
|
|
10
|
+
flexDirection: 'row',
|
|
11
|
+
height: 60,
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
width: '100%',
|
|
14
|
+
},
|
|
15
|
+
icon: {
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
borderRadius: 18,
|
|
18
|
+
height: 36,
|
|
19
|
+
justifyContent: 'center',
|
|
20
|
+
marginRight: 12,
|
|
21
|
+
width: 36,
|
|
22
|
+
},
|
|
23
|
+
label: {
|
|
24
|
+
flex: 1,
|
|
25
|
+
marginBottom: 0,
|
|
26
|
+
marginTop: 0,
|
|
27
|
+
},
|
|
28
|
+
wrapper: {
|
|
29
|
+
justifyContent: 'center',
|
|
30
|
+
marginHorizontal: 16,
|
|
31
|
+
paddingHorizontal: 12,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export type SettingItemProps = {
|
|
36
|
+
icon?: ComponentType<any> | ReactElement;
|
|
37
|
+
style?: StyleProp<ViewStyle>;
|
|
38
|
+
title: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const SettingItem: FunctionComponent<PropsWithChildren<SettingItemProps>> = ({ title, icon, style, children }) => {
|
|
42
|
+
const colorScheme = useAppColorScheme();
|
|
43
|
+
const iconView: React.ReactElement | undefined = useMemo(() => {
|
|
44
|
+
if (!icon) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
if (React.isValidElement(icon)) {
|
|
48
|
+
return icon;
|
|
49
|
+
} else {
|
|
50
|
+
const IconComponent = icon as React.ComponentType<any>;
|
|
51
|
+
return <IconComponent />;
|
|
52
|
+
}
|
|
53
|
+
}, [icon]);
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<View style={[styles.wrapper, { backgroundColor: colorScheme.white }, style]}>
|
|
57
|
+
<View style={styles.container}>
|
|
58
|
+
{iconView && <View style={[styles.icon, { backgroundColor: colorScheme.background }]}>{iconView}</View>}
|
|
59
|
+
<Typography accessible={false} color={colorScheme.text} preset="s" style={styles.label}>
|
|
60
|
+
{title}
|
|
61
|
+
</Typography>
|
|
62
|
+
{children}
|
|
63
|
+
</View>
|
|
64
|
+
</View>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default SettingItem;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { useAppColorScheme } from '../theme/color-scheme-context';
|
|
5
|
+
import ButtonSetting, { ButtonSettingProps } from './button-setting';
|
|
6
|
+
|
|
7
|
+
export type SettingsButtonProps = ButtonSettingProps;
|
|
8
|
+
|
|
9
|
+
const SettingsButton: FC<SettingsButtonProps> = ({ style, ...props }) => {
|
|
10
|
+
const colorScheme = useAppColorScheme();
|
|
11
|
+
return <ButtonSetting style={[styles.button, { backgroundColor: colorScheme.background }, style]} {...props} />;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const styles = StyleSheet.create({
|
|
15
|
+
button: {
|
|
16
|
+
borderRadius: 12,
|
|
17
|
+
height: 68,
|
|
18
|
+
marginHorizontal: 0,
|
|
19
|
+
paddingHorizontal: 12,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export default SettingsButton;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React, { ComponentType, FunctionComponent, ReactElement } from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { Switch } from '../control/switch';
|
|
5
|
+
import SettingItem from './setting-item';
|
|
6
|
+
|
|
7
|
+
export type SwitchSettingProps = {
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
icon?: ComponentType<any> | ReactElement;
|
|
10
|
+
onChange: (newValue: boolean) => void;
|
|
11
|
+
style?: StyleProp<ViewStyle>;
|
|
12
|
+
testID?: string;
|
|
13
|
+
title: string;
|
|
14
|
+
value: boolean;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const SwitchSetting: FunctionComponent<SwitchSettingProps> = ({
|
|
18
|
+
title,
|
|
19
|
+
value,
|
|
20
|
+
onChange,
|
|
21
|
+
icon,
|
|
22
|
+
style,
|
|
23
|
+
disabled = false,
|
|
24
|
+
testID,
|
|
25
|
+
}) => {
|
|
26
|
+
return (
|
|
27
|
+
<SettingItem icon={icon} style={style} title={title}>
|
|
28
|
+
<Switch accessibilityLabel={title} disabled={disabled} onChange={onChange} testID={testID} value={value} />
|
|
29
|
+
</SettingItem>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default SwitchSetting;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ComponentMeta, Story } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import ErrorScreen, { ErrorScreenProps } from './error-screen';
|
|
5
|
+
|
|
6
|
+
const Basic: Story<ErrorScreenProps> = (props) => <ErrorScreen {...props} />;
|
|
7
|
+
|
|
8
|
+
Basic.args = {
|
|
9
|
+
title: 'Error',
|
|
10
|
+
subtitle: 'The app has reached an error state.',
|
|
11
|
+
button: { label: 'Primary', onPress: () => null },
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { Basic as ErrorScreen };
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
title: 'view/loading/Error Screen',
|
|
18
|
+
component: ErrorScreen,
|
|
19
|
+
parameters: {
|
|
20
|
+
noSafeArea: true,
|
|
21
|
+
},
|
|
22
|
+
} as ComponentMeta<typeof ErrorScreen>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { ScrollViewScreen } from '..';
|
|
5
|
+
import { Button } from '../buttons';
|
|
6
|
+
import { CredentialWarningIcon } from '../icons';
|
|
7
|
+
import { Typography } from '../text';
|
|
8
|
+
import { useAppColorScheme } from '../theme';
|
|
9
|
+
|
|
10
|
+
export interface ErrorScreenButton {
|
|
11
|
+
testID?: string;
|
|
12
|
+
label: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
onPress?: () => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ErrorScreenProps {
|
|
18
|
+
testID?: string;
|
|
19
|
+
title: string;
|
|
20
|
+
subtitle: string;
|
|
21
|
+
button: ErrorScreenButton;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const ErrorScreen: FunctionComponent<ErrorScreenProps> = ({ testID, title, subtitle, button }) => {
|
|
25
|
+
const colorScheme = useAppColorScheme();
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<ScrollViewScreen
|
|
29
|
+
header={{
|
|
30
|
+
static: true,
|
|
31
|
+
title: title,
|
|
32
|
+
}}
|
|
33
|
+
modalPresentation
|
|
34
|
+
scrollView={{
|
|
35
|
+
testID,
|
|
36
|
+
}}>
|
|
37
|
+
<View style={[styles.wrapper, { backgroundColor: colorScheme.background }]}>
|
|
38
|
+
<View style={styles.warning}>
|
|
39
|
+
<CredentialWarningIcon height={42} width={42} />
|
|
40
|
+
<Typography color={colorScheme.text} preset="regular" style={styles.message}>
|
|
41
|
+
{subtitle}
|
|
42
|
+
</Typography>
|
|
43
|
+
</View>
|
|
44
|
+
|
|
45
|
+
{button ? (
|
|
46
|
+
<Button disabled={button.disabled} onPress={button.onPress} testID={button.testID} title={button.label} />
|
|
47
|
+
) : undefined}
|
|
48
|
+
</View>
|
|
49
|
+
</ScrollViewScreen>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const styles = StyleSheet.create({
|
|
54
|
+
message: {
|
|
55
|
+
textAlign: 'center',
|
|
56
|
+
},
|
|
57
|
+
warning: {
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
display: 'flex',
|
|
60
|
+
flexGrow: 1,
|
|
61
|
+
justifyContent: 'center',
|
|
62
|
+
},
|
|
63
|
+
wrapper: {
|
|
64
|
+
display: 'flex',
|
|
65
|
+
flexDirection: 'column',
|
|
66
|
+
height: '100%',
|
|
67
|
+
paddingHorizontal: 16,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
export default ErrorScreen;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { PropsWithChildren, useEffect } from 'react';
|
|
2
|
+
import { ColorValue, StyleProp, Text, TextProps, TextStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { useAccessibilityAnnouncementCumulative } from '../accessibility/accessibility';
|
|
5
|
+
|
|
6
|
+
export type BaseTextProps = TextProps & {
|
|
7
|
+
align?: 'center' | 'left' | 'right';
|
|
8
|
+
color: ColorValue;
|
|
9
|
+
style?: StyleProp<TextStyle>;
|
|
10
|
+
|
|
11
|
+
/* accessibility automatic voice-over */
|
|
12
|
+
announcementActive?: boolean;
|
|
13
|
+
announcementCumulative?: boolean;
|
|
14
|
+
/* only supported (fired) on iOS */
|
|
15
|
+
onAnnouncementFinished?: (finished: boolean) => void;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const BaseText = React.forwardRef<Text, PropsWithChildren<BaseTextProps>>(
|
|
19
|
+
(
|
|
20
|
+
{
|
|
21
|
+
align = 'left',
|
|
22
|
+
color,
|
|
23
|
+
style,
|
|
24
|
+
children,
|
|
25
|
+
announcementActive,
|
|
26
|
+
announcementCumulative,
|
|
27
|
+
onAnnouncementFinished,
|
|
28
|
+
...props
|
|
29
|
+
},
|
|
30
|
+
ref,
|
|
31
|
+
) => {
|
|
32
|
+
const announcementFinished = useAccessibilityAnnouncementCumulative(
|
|
33
|
+
announcementActive && typeof children === 'string' ? (children as string) : undefined,
|
|
34
|
+
announcementCumulative,
|
|
35
|
+
);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
onAnnouncementFinished?.(announcementFinished);
|
|
38
|
+
}, [announcementFinished, onAnnouncementFinished]);
|
|
39
|
+
|
|
40
|
+
const baseStyle: TextStyle = {
|
|
41
|
+
textAlign: align,
|
|
42
|
+
color,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<Text ref={ref} style={[baseStyle, style]} maxFontSizeMultiplier={2} {...props}>
|
|
47
|
+
{children}
|
|
48
|
+
</Text>
|
|
49
|
+
);
|
|
50
|
+
},
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
BaseText.displayName = 'BaseText';
|
package/src/text/font.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Platform, TextStyle } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export interface FontStyle {
|
|
4
|
+
fontFamily?: string;
|
|
5
|
+
fontWeight?: TextStyle['fontWeight'];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
enum FontFace {
|
|
9
|
+
OpenSans = 'Open Sans',
|
|
10
|
+
IBMPlexMono = 'IBM Plex Mono',
|
|
11
|
+
ProcivisBook = 'Procivis-Book',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
enum FontWeight {
|
|
15
|
+
Medium = '500',
|
|
16
|
+
Regular = '400',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface FontFactoryProps {
|
|
20
|
+
face: FontFace;
|
|
21
|
+
weight?: FontWeight;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// generate styles for a font with given weight and style
|
|
25
|
+
export const fontFactory = ({ face, weight }: FontFactoryProps): FontStyle => {
|
|
26
|
+
if (Platform.OS === 'android') {
|
|
27
|
+
const filePrefix = Object.values(FontFace)[Object.values(FontFace).indexOf(face)]?.replace(' ', '');
|
|
28
|
+
if (!weight) {
|
|
29
|
+
return {
|
|
30
|
+
fontFamily: filePrefix,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const fileSuffix = Object.keys(FontWeight)[Object.values(FontWeight).indexOf(weight)];
|
|
34
|
+
return {
|
|
35
|
+
fontFamily: `${filePrefix}-${fileSuffix}`,
|
|
36
|
+
};
|
|
37
|
+
} else {
|
|
38
|
+
return {
|
|
39
|
+
fontFamily: face,
|
|
40
|
+
fontWeight: weight,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const font = {
|
|
46
|
+
regular: fontFactory({ face: FontFace.OpenSans, weight: FontWeight.Regular }),
|
|
47
|
+
medium: fontFactory({ face: FontFace.OpenSans, weight: FontWeight.Medium }),
|
|
48
|
+
code: fontFactory({ face: FontFace.IBMPlexMono, weight: FontWeight.Regular }),
|
|
49
|
+
heading: fontFactory({ face: FontFace.ProcivisBook }),
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default font;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { ColorValue } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import ColorSchemes from '../../storybook/colorScheme';
|
|
6
|
+
import { ColorScheme, useAppColorScheme } from '../theme';
|
|
7
|
+
import Typography from './typography';
|
|
8
|
+
|
|
9
|
+
type ColorSchemeKey = keyof Omit<ColorScheme, 'darkMode'>;
|
|
10
|
+
|
|
11
|
+
const Basic: ComponentStory<typeof Typography> = ({ color, ...args }) => {
|
|
12
|
+
const colorScheme = useAppColorScheme();
|
|
13
|
+
return <Typography {...args} color={colorScheme[color as ColorSchemeKey] as ColorValue} />;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
Basic.args = {
|
|
17
|
+
children: 'Text',
|
|
18
|
+
preset: 'regular',
|
|
19
|
+
caps: false,
|
|
20
|
+
color: 'text',
|
|
21
|
+
align: 'left',
|
|
22
|
+
numberOfLines: 1,
|
|
23
|
+
ellipsizeMode: 'tail',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { Basic as Typography };
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
title: 'base/Typography',
|
|
30
|
+
component: Typography,
|
|
31
|
+
argTypes: {
|
|
32
|
+
preset: {
|
|
33
|
+
options: [
|
|
34
|
+
'xl',
|
|
35
|
+
'l',
|
|
36
|
+
'l/line-height-large',
|
|
37
|
+
'regular',
|
|
38
|
+
'm',
|
|
39
|
+
's',
|
|
40
|
+
's/line-height-capped',
|
|
41
|
+
's/line-height-small',
|
|
42
|
+
's/code',
|
|
43
|
+
'xs',
|
|
44
|
+
'xs/line-height-small',
|
|
45
|
+
'xs/code',
|
|
46
|
+
],
|
|
47
|
+
control: { type: 'radio' },
|
|
48
|
+
},
|
|
49
|
+
color: {
|
|
50
|
+
options: Object.entries(ColorSchemes.procivis)
|
|
51
|
+
.filter(([_, value]) => typeof value === 'string')
|
|
52
|
+
.map(([key]) => key),
|
|
53
|
+
control: { type: 'select' },
|
|
54
|
+
},
|
|
55
|
+
align: {
|
|
56
|
+
options: ['left', 'center', 'right'],
|
|
57
|
+
control: { type: 'radio' },
|
|
58
|
+
},
|
|
59
|
+
ellipsizeMode: {
|
|
60
|
+
options: ['head', 'middle', 'tail', 'clip'],
|
|
61
|
+
control: { type: 'select' },
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
parameters: {
|
|
65
|
+
design: {
|
|
66
|
+
type: 'figma',
|
|
67
|
+
url: 'https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=1045-30326',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
} as ComponentMeta<typeof Typography>;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, Text } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { useAppColorScheme } from '../theme';
|
|
5
|
+
import { BaseText, BaseTextProps } from './base';
|
|
6
|
+
import font from './font';
|
|
7
|
+
|
|
8
|
+
const presets = {
|
|
9
|
+
xl: {
|
|
10
|
+
...font.heading,
|
|
11
|
+
fontSize: 26,
|
|
12
|
+
lineHeight: 36,
|
|
13
|
+
letterSpacing: 0.2,
|
|
14
|
+
},
|
|
15
|
+
l: {
|
|
16
|
+
...font.heading,
|
|
17
|
+
fontSize: 24,
|
|
18
|
+
lineHeight: 33,
|
|
19
|
+
},
|
|
20
|
+
'l/line-height-large': {
|
|
21
|
+
...font.heading,
|
|
22
|
+
fontSize: 24,
|
|
23
|
+
lineHeight: 28,
|
|
24
|
+
},
|
|
25
|
+
regular: {
|
|
26
|
+
...font.regular,
|
|
27
|
+
fontSize: 17,
|
|
28
|
+
lineHeight: 24,
|
|
29
|
+
},
|
|
30
|
+
m: {
|
|
31
|
+
...font.medium,
|
|
32
|
+
fontSize: 17,
|
|
33
|
+
lineHeight: 22,
|
|
34
|
+
letterSpacing: -0.2,
|
|
35
|
+
},
|
|
36
|
+
'm/heading': {
|
|
37
|
+
...font.heading,
|
|
38
|
+
fontSize: 17,
|
|
39
|
+
lineHeight: 22,
|
|
40
|
+
letterSpacing: -0.2,
|
|
41
|
+
},
|
|
42
|
+
s: {
|
|
43
|
+
...font.regular,
|
|
44
|
+
fontSize: 14,
|
|
45
|
+
lineHeight: 22,
|
|
46
|
+
},
|
|
47
|
+
's/line-height-capped': {
|
|
48
|
+
...font.regular,
|
|
49
|
+
fontSize: 14,
|
|
50
|
+
lineHeight: 22,
|
|
51
|
+
letterSpacing: -0.2,
|
|
52
|
+
// TODO: vertical trim: cap height
|
|
53
|
+
},
|
|
54
|
+
's/line-height-small': {
|
|
55
|
+
...font.regular,
|
|
56
|
+
fontSize: 14,
|
|
57
|
+
lineHeight: 18,
|
|
58
|
+
letterSpacing: 0.3,
|
|
59
|
+
},
|
|
60
|
+
's/code': {
|
|
61
|
+
...font.code,
|
|
62
|
+
fontSize: 14,
|
|
63
|
+
lineHeight: 22,
|
|
64
|
+
letterSpacing: 0.2,
|
|
65
|
+
},
|
|
66
|
+
xs: {
|
|
67
|
+
...font.regular,
|
|
68
|
+
fontSize: 12,
|
|
69
|
+
lineHeight: 22,
|
|
70
|
+
letterSpacing: -0.1,
|
|
71
|
+
},
|
|
72
|
+
'xs/line-height-small': {
|
|
73
|
+
...font.regular,
|
|
74
|
+
fontSize: 12,
|
|
75
|
+
lineHeight: 18,
|
|
76
|
+
letterSpacing: 0.3,
|
|
77
|
+
},
|
|
78
|
+
'xs/code': {
|
|
79
|
+
...font.code,
|
|
80
|
+
fontSize: 12,
|
|
81
|
+
lineHeight: 18,
|
|
82
|
+
letterSpacing: 0.3,
|
|
83
|
+
},
|
|
84
|
+
} as const;
|
|
85
|
+
|
|
86
|
+
export type TypographyProps = BaseTextProps & {
|
|
87
|
+
preset?: keyof typeof presets;
|
|
88
|
+
caps?: boolean;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* General text component
|
|
93
|
+
* @see https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=1045-30326
|
|
94
|
+
*/
|
|
95
|
+
const Typography = React.forwardRef<Text, TypographyProps>(
|
|
96
|
+
({ preset = 'regular', color, caps, style, ...props }, ref) => {
|
|
97
|
+
const colorScheme = useAppColorScheme();
|
|
98
|
+
return (
|
|
99
|
+
<BaseText
|
|
100
|
+
ref={ref}
|
|
101
|
+
style={[presets[preset], caps && styles.caps, style]}
|
|
102
|
+
color={color ?? colorScheme.text}
|
|
103
|
+
{...props}
|
|
104
|
+
/>
|
|
105
|
+
);
|
|
106
|
+
},
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
Typography.displayName = 'Typography';
|
|
110
|
+
|
|
111
|
+
const styles = StyleSheet.create({
|
|
112
|
+
caps: {
|
|
113
|
+
textTransform: 'uppercase',
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
export default Typography;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
|
|
3
|
+
import type { ColorScheme } from './color-scheme';
|
|
4
|
+
|
|
5
|
+
const defaultColorScheme: ColorScheme = {
|
|
6
|
+
accent: '#0F151A',
|
|
7
|
+
accentText: '#EBF2F4',
|
|
8
|
+
background: '#F1F3F5',
|
|
9
|
+
backgroundScroll: 'rgba(241, 243, 245, 0.7)',
|
|
10
|
+
black: '#000000',
|
|
11
|
+
codeAccent: '#CFD2E7',
|
|
12
|
+
credentialHeaderBackground: 'rgba(255, 255, 255, 0.87)',
|
|
13
|
+
error: '#D90D0D',
|
|
14
|
+
grayDark: '#CDD4DA',
|
|
15
|
+
linkText: '#3F7BA6',
|
|
16
|
+
success: '#00D066',
|
|
17
|
+
successText: '#006B34',
|
|
18
|
+
text: '#0D0E10',
|
|
19
|
+
warning: '#F7BF0B',
|
|
20
|
+
white: '#FFFFFF',
|
|
21
|
+
darkMode: false,
|
|
22
|
+
nerdView: {
|
|
23
|
+
background: 'rgba(2, 4, 21, 0.95)',
|
|
24
|
+
attributeLabel: '#929497',
|
|
25
|
+
attributeValueBackground: 'rgba(255, 255, 255, 0.02)',
|
|
26
|
+
attributeValueBorder: 'rgba(255, 255, 255, 0.2)',
|
|
27
|
+
attributeSectionBackground: 'rgba(2, 4, 21, 0.8)',
|
|
28
|
+
button: 'rgba(255, 255, 255, 0.05)',
|
|
29
|
+
codeHighlightText: 'rgba(232, 135, 114, 1)',
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const ColorSchemeContext = React.createContext<ColorScheme>(defaultColorScheme);
|
|
34
|
+
ColorSchemeContext.displayName = 'ColorSchemeContext';
|
|
35
|
+
|
|
36
|
+
export function ColorSchemeProvider<Scheme extends ColorScheme = ColorScheme>(
|
|
37
|
+
props: PropsWithChildren<{ colorScheme: Scheme }>,
|
|
38
|
+
) {
|
|
39
|
+
return <ColorSchemeContext.Provider value={props.colorScheme}>{props.children}</ColorSchemeContext.Provider>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* A hook to gain access to the current `ColorScheme`
|
|
44
|
+
* @note A custom superset of `ColorScheme` can be used (must also be passed to the `ColorSchemeProvider`)
|
|
45
|
+
*/
|
|
46
|
+
export function useAppColorScheme<Scheme extends ColorScheme = ColorScheme>(): Readonly<Scheme> {
|
|
47
|
+
return React.useContext(ColorSchemeContext) as Scheme;
|
|
48
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color flavour of the application
|
|
3
|
+
* colors according to figma design: https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=0-1
|
|
4
|
+
*/
|
|
5
|
+
export interface ColorScheme {
|
|
6
|
+
accent: string;
|
|
7
|
+
accentText: string;
|
|
8
|
+
background: string;
|
|
9
|
+
backgroundScroll: string;
|
|
10
|
+
black: string;
|
|
11
|
+
codeAccent: string;
|
|
12
|
+
credentialHeaderBackground: string;
|
|
13
|
+
error: string;
|
|
14
|
+
grayDark: string;
|
|
15
|
+
linkText: string;
|
|
16
|
+
success: string;
|
|
17
|
+
successText: string;
|
|
18
|
+
text: string;
|
|
19
|
+
warning: string;
|
|
20
|
+
white: string;
|
|
21
|
+
darkMode: boolean;
|
|
22
|
+
nerdView: {
|
|
23
|
+
background: string;
|
|
24
|
+
attributeLabel: string;
|
|
25
|
+
attributeSectionBackground: string;
|
|
26
|
+
attributeValueBackground: string;
|
|
27
|
+
attributeValueBorder: string;
|
|
28
|
+
button: string;
|
|
29
|
+
codeHighlightText: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* eslint-disable no-bitwise */
|
|
2
|
+
import normalizeColor from '@react-native/normalize-color';
|
|
3
|
+
import type { ColorValue } from 'react-native';
|
|
4
|
+
|
|
5
|
+
export const colorArray = (color: ColorValue) => {
|
|
6
|
+
const normalized = normalizeColor(color);
|
|
7
|
+
|
|
8
|
+
const r = (normalized >> 24) & 0xff;
|
|
9
|
+
const g = (normalized >> 16) & 0xff;
|
|
10
|
+
const b = (normalized >> 8) & 0xff;
|
|
11
|
+
const a = normalized & 0xff;
|
|
12
|
+
|
|
13
|
+
return [r / 255, g / 255, b / 255, a / 255];
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const colorWithAlphaComponent = (color: ColorValue, alpha: number): ColorValue => {
|
|
17
|
+
alpha = Math.min(1, Math.max(0, alpha));
|
|
18
|
+
const colorValues = colorArray(color);
|
|
19
|
+
colorValues[3] = alpha;
|
|
20
|
+
const colorHexString = colorValues
|
|
21
|
+
.map((value) =>
|
|
22
|
+
Math.round(255 * value)
|
|
23
|
+
.toString(16)
|
|
24
|
+
.padStart(2, '0'),
|
|
25
|
+
)
|
|
26
|
+
.join('');
|
|
27
|
+
return `#${colorHexString}`;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const getBrightness = (color: ColorValue) => {
|
|
31
|
+
const rgb = colorArray(color);
|
|
32
|
+
// https://en.wikipedia.org/wiki/Relative_luminance
|
|
33
|
+
return 0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2];
|
|
34
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { FC, useMemo } from 'react';
|
|
2
|
+
import { ColorValue, StatusBar, StatusBarProps, StatusBarStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { getBrightness } from './color';
|
|
5
|
+
|
|
6
|
+
interface ContrastingStatusBarProps extends Omit<StatusBarProps, 'barStyle'> {
|
|
7
|
+
backgroundColor: ColorValue;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Defines transparent status bar with content contrasting to the background
|
|
12
|
+
*/
|
|
13
|
+
const ContrastingStatusBar: FC<ContrastingStatusBarProps> = ({ backgroundColor, ...props }) => {
|
|
14
|
+
const barStyle = useMemo<StatusBarStyle>(
|
|
15
|
+
() => (getBrightness(backgroundColor) > 0.5 ? 'dark-content' : 'light-content'),
|
|
16
|
+
[backgroundColor],
|
|
17
|
+
);
|
|
18
|
+
return <StatusBar translucent={true} barStyle={barStyle} backgroundColor={'transparent'} {...props} />;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default ContrastingStatusBar;
|