@oxyhq/services 22.12.5 → 22.13.1
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/README.md +16 -46
- package/lib/commonjs/index.js +90 -10
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/notifications/deviceNotifications.js +424 -0
- package/lib/commonjs/notifications/deviceNotifications.js.map +1 -0
- package/lib/commonjs/ui/boot/runProviderColdBoot.js +51 -9
- package/lib/commonjs/ui/boot/runProviderColdBoot.js.map +1 -1
- package/lib/commonjs/ui/client.js +0 -13
- package/lib/commonjs/ui/client.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js +27 -4
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAuthChooser.js +74 -1124
- package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/commonjs/ui/components/OxyConsentScreen.js +50 -12
- package/lib/commonjs/ui/components/OxyConsentScreen.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +4 -4
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +74 -40
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInRequestSurface.js +147 -0
- package/lib/commonjs/ui/components/OxySignInRequestSurface.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +527 -0
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/SignInEntryView.js +90 -0
- package/lib/commonjs/ui/components/authChooser/SignInEntryView.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/SignInRequestView.js +106 -0
- package/lib/commonjs/ui/components/authChooser/SignInRequestView.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/SignUpView.js +188 -0
- package/lib/commonjs/ui/components/authChooser/SignUpView.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js +61 -0
- package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/primitives.js +169 -0
- package/lib/commonjs/ui/components/authChooser/primitives.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/requestSurfaces.js +153 -0
- package/lib/commonjs/ui/components/authChooser/requestSurfaces.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/signInProgress.js +54 -0
- package/lib/commonjs/ui/components/authChooser/signInProgress.js.map +1 -0
- package/lib/commonjs/ui/components/{oxyAuthChooserStyles.js → authChooser/styles.js} +19 -1
- package/lib/commonjs/ui/components/authChooser/styles.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/types.js +70 -0
- package/lib/commonjs/ui/components/authChooser/types.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js +50 -0
- package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +205 -30
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/commitSessionFlow.js +46 -0
- package/lib/commonjs/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +15 -2
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/context/useOxyAccountGraph.js +13 -5
- package/lib/commonjs/ui/context/useOxyAccountGraph.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +6 -1
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js.map +1 -1
- package/lib/commonjs/ui/index.js +0 -13
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/oauth/browserAuthTransport.js +170 -0
- package/lib/commonjs/ui/oauth/browserAuthTransport.js.map +1 -0
- package/lib/commonjs/ui/oauth/completeOAuthCode.js +78 -0
- package/lib/commonjs/ui/oauth/completeOAuthCode.js.map +1 -0
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js +48 -0
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js.map +1 -0
- package/lib/commonjs/ui/oauth/oauthHandshake.js +53 -0
- package/lib/commonjs/ui/oauth/oauthHandshake.js.map +1 -0
- package/lib/commonjs/ui/oauth/oauthPopup.js +276 -0
- package/lib/commonjs/ui/oauth/oauthPopup.js.map +1 -0
- package/lib/commonjs/ui/oauth/oauthPopupMessages.js +141 -0
- package/lib/commonjs/ui/oauth/oauthPopupMessages.js.map +1 -0
- package/lib/commonjs/ui/oauth/types.js +2 -0
- package/lib/commonjs/ui/oauth/types.js.map +1 -0
- package/lib/commonjs/ui/server.js +2 -5
- package/lib/commonjs/ui/server.js.map +1 -1
- package/lib/commonjs/ui/session/authStore.js +6 -75
- package/lib/commonjs/ui/session/authStore.js.map +1 -1
- package/lib/commonjs/ui/session/createSessionClient.js +11 -3
- package/lib/commonjs/ui/session/createSessionClient.js.map +1 -1
- package/lib/commonjs/ui/session/identityBinding.js +95 -0
- package/lib/commonjs/ui/session/identityBinding.js.map +1 -0
- package/lib/commonjs/ui/session/index.js +13 -0
- package/lib/commonjs/ui/session/index.js.map +1 -1
- package/lib/commonjs/ui/session/nativeSecureStorage.js +90 -0
- package/lib/commonjs/ui/session/nativeSecureStorage.js.map +1 -0
- package/lib/commonjs/ui/session/tokenTransport.js +11 -1
- package/lib/commonjs/ui/session/tokenTransport.js.map +1 -1
- package/lib/commonjs/ui/utils/crossOriginRestore.js +3 -2
- package/lib/commonjs/ui/utils/crossOriginRestore.js.map +1 -1
- package/lib/commonjs/ui/utils/deliveryPlatform.js +58 -0
- package/lib/commonjs/ui/utils/deliveryPlatform.js.map +1 -0
- package/lib/commonjs/ui/utils/oauthReturn.js +33 -49
- package/lib/commonjs/ui/utils/oauthReturn.js.map +1 -1
- package/lib/module/index.js +27 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/notifications/deviceNotifications.js +414 -0
- package/lib/module/notifications/deviceNotifications.js.map +1 -0
- package/lib/module/ui/boot/runProviderColdBoot.js +51 -9
- package/lib/module/ui/boot/runProviderColdBoot.js.map +1 -1
- package/lib/module/ui/client.js +0 -1
- package/lib/module/ui/client.js.map +1 -1
- package/lib/module/ui/components/OxyAccountDialogScreen.js +27 -4
- package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/module/ui/components/OxyAuthChooser.js +78 -1129
- package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/module/ui/components/OxyConsentScreen.js +50 -12
- package/lib/module/ui/components/OxyConsentScreen.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +4 -4
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +76 -42
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/OxySignInRequestSurface.js +141 -0
- package/lib/module/ui/components/OxySignInRequestSurface.js.map +1 -0
- package/lib/module/ui/components/authChooser/AccountsMenuView.js +523 -0
- package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -0
- package/lib/module/ui/components/authChooser/SignInEntryView.js +85 -0
- package/lib/module/ui/components/authChooser/SignInEntryView.js.map +1 -0
- package/lib/module/ui/components/authChooser/SignInRequestView.js +101 -0
- package/lib/module/ui/components/authChooser/SignInRequestView.js.map +1 -0
- package/lib/module/ui/components/authChooser/SignUpView.js +184 -0
- package/lib/module/ui/components/authChooser/SignUpView.js.map +1 -0
- package/lib/module/ui/components/authChooser/TroubleDisclosure.js +57 -0
- package/lib/module/ui/components/authChooser/TroubleDisclosure.js.map +1 -0
- package/lib/module/ui/components/authChooser/primitives.js +163 -0
- package/lib/module/ui/components/authChooser/primitives.js.map +1 -0
- package/lib/module/ui/components/authChooser/requestSurfaces.js +143 -0
- package/lib/module/ui/components/authChooser/requestSurfaces.js.map +1 -0
- package/lib/module/ui/components/authChooser/signInProgress.js +50 -0
- package/lib/module/ui/components/authChooser/signInProgress.js.map +1 -0
- package/lib/module/ui/components/{oxyAuthChooserStyles.js → authChooser/styles.js} +19 -1
- package/lib/module/ui/components/authChooser/styles.js.map +1 -0
- package/lib/module/ui/components/authChooser/types.js +66 -0
- package/lib/module/ui/components/authChooser/types.js.map +1 -0
- package/lib/module/ui/components/authChooser/useUsernameAvailability.js +46 -0
- package/lib/module/ui/components/authChooser/useUsernameAvailability.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +208 -33
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/commitSessionFlow.js +45 -0
- package/lib/module/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +15 -2
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/context/useOxyAccountGraph.js +13 -5
- package/lib/module/ui/context/useOxyAccountGraph.js.map +1 -1
- package/lib/module/ui/hooks/useSwitchableAccounts.js +6 -1
- package/lib/module/ui/hooks/useSwitchableAccounts.js.map +1 -1
- package/lib/module/ui/index.js +0 -1
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/oauth/browserAuthTransport.js +167 -0
- package/lib/module/ui/oauth/browserAuthTransport.js.map +1 -0
- package/lib/module/ui/oauth/completeOAuthCode.js +75 -0
- package/lib/module/ui/oauth/completeOAuthCode.js.map +1 -0
- package/lib/module/ui/oauth/legacyRedirectLanes.js +44 -0
- package/lib/module/ui/oauth/legacyRedirectLanes.js.map +1 -0
- package/lib/module/ui/oauth/oauthHandshake.js +50 -0
- package/lib/module/ui/oauth/oauthHandshake.js.map +1 -0
- package/lib/module/ui/oauth/oauthPopup.js +268 -0
- package/lib/module/ui/oauth/oauthPopup.js.map +1 -0
- package/lib/module/ui/oauth/oauthPopupMessages.js +135 -0
- package/lib/module/ui/oauth/oauthPopupMessages.js.map +1 -0
- package/lib/module/ui/oauth/types.js +2 -0
- package/lib/module/ui/oauth/types.js.map +1 -0
- package/lib/module/ui/server.js +0 -2
- package/lib/module/ui/server.js.map +1 -1
- package/lib/module/ui/session/authStore.js +5 -75
- package/lib/module/ui/session/authStore.js.map +1 -1
- package/lib/module/ui/session/createSessionClient.js +11 -3
- package/lib/module/ui/session/createSessionClient.js.map +1 -1
- package/lib/module/ui/session/identityBinding.js +89 -0
- package/lib/module/ui/session/identityBinding.js.map +1 -0
- package/lib/module/ui/session/index.js +5 -2
- package/lib/module/ui/session/index.js.map +1 -1
- package/lib/module/ui/session/nativeSecureStorage.js +88 -0
- package/lib/module/ui/session/nativeSecureStorage.js.map +1 -0
- package/lib/module/ui/session/tokenTransport.js +11 -1
- package/lib/module/ui/session/tokenTransport.js.map +1 -1
- package/lib/module/ui/utils/crossOriginRestore.js +4 -3
- package/lib/module/ui/utils/crossOriginRestore.js.map +1 -1
- package/lib/module/ui/utils/deliveryPlatform.js +55 -0
- package/lib/module/ui/utils/deliveryPlatform.js.map +1 -0
- package/lib/module/ui/utils/oauthReturn.js +35 -50
- package/lib/module/ui/utils/oauthReturn.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +9 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts +173 -0
- package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +34 -2
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/client.d.ts +0 -1
- package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +23 -29
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyConsentScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts +17 -12
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxySignInRequestSurface.d.ts +108 -0
- package/lib/typescript/commonjs/ui/components/OxySignInRequestSurface.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts +38 -0
- package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts +32 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts +34 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignUpView.d.ts +34 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignUpView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts +36 -0
- package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts +55 -0
- package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts +58 -0
- package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/signInProgress.d.ts +26 -0
- package/lib/typescript/commonjs/ui/components/authChooser/signInProgress.d.ts.map +1 -0
- package/lib/typescript/{module/ui/components/oxyAuthChooserStyles.d.ts → commonjs/ui/components/authChooser/styles.d.ts} +19 -1
- package/lib/typescript/commonjs/ui/components/authChooser/styles.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +103 -0
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/useUsernameAvailability.d.ts +16 -0
- package/lib/typescript/commonjs/ui/components/authChooser/useUsernameAvailability.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts +40 -0
- package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts +11 -2
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +44 -1
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts +7 -1
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +0 -1
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts +56 -0
- package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/completeOAuthCode.d.ts +49 -0
- package/lib/typescript/commonjs/ui/oauth/completeOAuthCode.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts +40 -0
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/oauthHandshake.d.ts +50 -0
- package/lib/typescript/commonjs/ui/oauth/oauthHandshake.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts +83 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopupMessages.d.ts +67 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopupMessages.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/types.d.ts +176 -0
- package/lib/typescript/commonjs/ui/oauth/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/server.d.ts +0 -2
- package/lib/typescript/commonjs/ui/server.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/authStore.d.ts +3 -7
- package/lib/typescript/commonjs/ui/session/authStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts +8 -1
- package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/identityBinding.d.ts +66 -0
- package/lib/typescript/commonjs/ui/session/identityBinding.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/session/index.d.ts +6 -2
- package/lib/typescript/commonjs/ui/session/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/nativeSecureStorage.d.ts +25 -0
- package/lib/typescript/commonjs/ui/session/nativeSecureStorage.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts +8 -1
- package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +44 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/deliveryPlatform.d.ts +33 -0
- package/lib/typescript/commonjs/ui/utils/deliveryPlatform.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts +11 -16
- package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +9 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/notifications/deviceNotifications.d.ts +173 -0
- package/lib/typescript/module/notifications/deviceNotifications.d.ts.map +1 -0
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +34 -2
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/module/ui/client.d.ts +0 -1
- package/lib/typescript/module/ui/client.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +23 -29
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyConsentScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts +17 -12
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxySignInRequestSurface.d.ts +108 -0
- package/lib/typescript/module/ui/components/OxySignInRequestSurface.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts +38 -0
- package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts +32 -0
- package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts +34 -0
- package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/SignUpView.d.ts +34 -0
- package/lib/typescript/module/ui/components/authChooser/SignUpView.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts +36 -0
- package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/primitives.d.ts +55 -0
- package/lib/typescript/module/ui/components/authChooser/primitives.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts +58 -0
- package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/signInProgress.d.ts +26 -0
- package/lib/typescript/module/ui/components/authChooser/signInProgress.d.ts.map +1 -0
- package/lib/typescript/{commonjs/ui/components/oxyAuthChooserStyles.d.ts → module/ui/components/authChooser/styles.d.ts} +19 -1
- package/lib/typescript/module/ui/components/authChooser/styles.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/types.d.ts +103 -0
- package/lib/typescript/module/ui/components/authChooser/types.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/useUsernameAvailability.d.ts +16 -0
- package/lib/typescript/module/ui/components/authChooser/useUsernameAvailability.d.ts.map +1 -0
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/commitSessionFlow.d.ts +40 -0
- package/lib/typescript/module/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts +11 -2
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +44 -1
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts +7 -1
- package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +0 -1
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts +56 -0
- package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/completeOAuthCode.d.ts +49 -0
- package/lib/typescript/module/ui/oauth/completeOAuthCode.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts +40 -0
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/oauthHandshake.d.ts +50 -0
- package/lib/typescript/module/ui/oauth/oauthHandshake.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/oauthPopup.d.ts +83 -0
- package/lib/typescript/module/ui/oauth/oauthPopup.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/oauthPopupMessages.d.ts +67 -0
- package/lib/typescript/module/ui/oauth/oauthPopupMessages.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/types.d.ts +176 -0
- package/lib/typescript/module/ui/oauth/types.d.ts.map +1 -0
- package/lib/typescript/module/ui/server.d.ts +0 -2
- package/lib/typescript/module/ui/server.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/authStore.d.ts +3 -7
- package/lib/typescript/module/ui/session/authStore.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/createSessionClient.d.ts +8 -1
- package/lib/typescript/module/ui/session/createSessionClient.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/identityBinding.d.ts +66 -0
- package/lib/typescript/module/ui/session/identityBinding.d.ts.map +1 -0
- package/lib/typescript/module/ui/session/index.d.ts +6 -2
- package/lib/typescript/module/ui/session/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/nativeSecureStorage.d.ts +25 -0
- package/lib/typescript/module/ui/session/nativeSecureStorage.d.ts.map +1 -0
- package/lib/typescript/module/ui/session/tokenTransport.d.ts +8 -1
- package/lib/typescript/module/ui/session/tokenTransport.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +44 -0
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/deliveryPlatform.d.ts +33 -0
- package/lib/typescript/module/ui/utils/deliveryPlatform.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/oauthReturn.d.ts +11 -16
- package/lib/typescript/module/ui/utils/oauthReturn.d.ts.map +1 -1
- package/package.json +18 -10
- package/src/index.ts +51 -5
- package/src/notifications/deviceNotifications.ts +458 -0
- package/src/ui/boot/__tests__/coldBootWebAuthMode.test.ts +281 -0
- package/src/ui/boot/runProviderColdBoot.ts +83 -13
- package/src/ui/client.ts +0 -1
- package/src/ui/components/OxyAccountDialogScreen.tsx +33 -4
- package/src/ui/components/OxyAuthChooser.tsx +102 -1231
- package/src/ui/components/OxyConsentScreen.tsx +56 -13
- package/src/ui/components/OxyProvider.tsx +4 -4
- package/src/ui/components/OxySignInButton.tsx +119 -78
- package/src/ui/components/OxySignInRequestSurface.tsx +202 -0
- package/src/ui/components/__tests__/OxyConsentScreen.test.tsx +27 -0
- package/src/ui/components/authChooser/AccountsMenuView.tsx +569 -0
- package/src/ui/components/authChooser/SignInEntryView.tsx +121 -0
- package/src/ui/components/authChooser/SignInRequestView.tsx +130 -0
- package/src/ui/components/authChooser/SignUpView.tsx +174 -0
- package/src/ui/components/authChooser/TroubleDisclosure.tsx +73 -0
- package/src/ui/components/authChooser/primitives.tsx +144 -0
- package/src/ui/components/authChooser/requestSurfaces.tsx +120 -0
- package/src/ui/components/authChooser/signInProgress.ts +54 -0
- package/src/ui/components/{oxyAuthChooserStyles.ts → authChooser/styles.ts} +18 -0
- package/src/ui/components/authChooser/types.ts +120 -0
- package/src/ui/components/authChooser/useUsernameAvailability.ts +60 -0
- package/src/ui/context/OxyContext.tsx +226 -24
- package/src/ui/context/__tests__/commitSessionFlow.test.ts +102 -0
- package/src/ui/context/commitSessionFlow.ts +64 -0
- package/src/ui/context/hooks/useAuthOperations.ts +26 -1
- package/src/ui/context/oxyContextTypes.ts +45 -1
- package/src/ui/context/useOxyAccountGraph.ts +19 -5
- package/src/ui/hooks/useSwitchableAccounts.ts +12 -1
- package/src/ui/index.ts +0 -1
- package/src/ui/oauth/__tests__/browserAuthTransport.test.ts +335 -0
- package/src/ui/oauth/__tests__/completeOAuthCode.test.ts +142 -0
- package/src/ui/oauth/__tests__/oauthPopup.test.ts +352 -0
- package/src/ui/oauth/__tests__/oauthPopupMessages.test.ts +189 -0
- package/src/ui/oauth/__tests__/sharedCompletionPath.test.ts +174 -0
- package/src/ui/oauth/browserAuthTransport.ts +193 -0
- package/src/ui/oauth/completeOAuthCode.ts +93 -0
- package/src/ui/oauth/legacyRedirectLanes.ts +43 -0
- package/src/ui/oauth/oauthHandshake.ts +74 -0
- package/src/ui/oauth/oauthPopup.ts +277 -0
- package/src/ui/oauth/oauthPopupMessages.ts +136 -0
- package/src/ui/oauth/types.ts +150 -0
- package/src/ui/server.ts +0 -2
- package/src/ui/session/__tests__/createSessionClient.test.ts +26 -0
- package/src/ui/session/__tests__/tokenTransport.test.ts +34 -0
- package/src/ui/session/authStore.ts +5 -89
- package/src/ui/session/createSessionClient.ts +15 -2
- package/src/ui/session/identityBinding.ts +116 -0
- package/src/ui/session/index.ts +6 -2
- package/src/ui/session/nativeSecureStorage.ts +98 -0
- package/src/ui/session/tokenTransport.ts +14 -1
- package/src/ui/types/navigation.ts +44 -1
- package/src/ui/utils/__tests__/crossOriginRestore.test.ts +17 -0
- package/src/ui/utils/crossOriginRestore.ts +7 -6
- package/src/ui/utils/deliveryPlatform.ts +65 -0
- package/src/ui/utils/oauthReturn.ts +38 -62
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/commonjs/ui/components/FontLoader.js +0 -35
- package/lib/commonjs/ui/components/FontLoader.js.map +0 -1
- package/lib/commonjs/ui/components/FontLoader.native.js +0 -88
- package/lib/commonjs/ui/components/FontLoader.native.js.map +0 -1
- package/lib/commonjs/ui/components/oxyAuthChooserStyles.js.map +0 -1
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/module/ui/components/FontLoader.js +0 -29
- package/lib/module/ui/components/FontLoader.js.map +0 -1
- package/lib/module/ui/components/FontLoader.native.js +0 -83
- package/lib/module/ui/components/FontLoader.native.js.map +0 -1
- package/lib/module/ui/components/oxyAuthChooserStyles.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/FontLoader.d.ts +0 -24
- package/lib/typescript/commonjs/ui/components/FontLoader.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/FontLoader.native.d.ts +0 -13
- package/lib/typescript/commonjs/ui/components/FontLoader.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/FontLoader.d.ts +0 -24
- package/lib/typescript/module/ui/components/FontLoader.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/FontLoader.native.d.ts +0 -13
- package/lib/typescript/module/ui/components/FontLoader.native.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts.map +0 -1
- package/src/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/src/ui/components/FontLoader.native.tsx +0 -88
- package/src/ui/components/FontLoader.tsx +0 -27
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The ACTIVE REQUEST surface (`qr` view) as the account dialog drives it —
|
|
5
|
+
* `AccountDialogController`'s device flow bound to the shared, presentational
|
|
6
|
+
* {@link OxySignInRequestSurface} (issue #691, Phase 5).
|
|
7
|
+
*
|
|
8
|
+
* This module owns WIRING only. Every pixel comes from the shared surface, which
|
|
9
|
+
* the auth.oxy.so IdP mounts from its own OAuth-bound request; there is one
|
|
10
|
+
* implementation of the request presentation, not two. What lives here is what
|
|
11
|
+
* only the account dialog knows:
|
|
12
|
+
*
|
|
13
|
+
* - which of the controller's facts map onto the surface's props;
|
|
14
|
+
* - which alternatives are genuine ones for the CURRENT presentation (the
|
|
15
|
+
* passkey ceremony is pointless once the request is already being confirmed,
|
|
16
|
+
* and a QR link is redundant while the QR itself is the primary visual);
|
|
17
|
+
* - the one piece of local intent the controller has no opinion on: leaving the
|
|
18
|
+
* acquisition surface via "I have Commons on another device".
|
|
19
|
+
*
|
|
20
|
+
* Failures are NOT rendered here. The container toasts them at the point they
|
|
21
|
+
* arrive (owner mandate: no error renders inline inside the dialog); this view
|
|
22
|
+
* only reports that the request failed, so the surface can offer "Try again".
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { useState } from 'react';
|
|
26
|
+
import OxySignInRequestSurface from "../OxySignInRequestSurface.js";
|
|
27
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
|
+
const SignInRequestView = ({
|
|
29
|
+
snapshot,
|
|
30
|
+
t,
|
|
31
|
+
onRetry,
|
|
32
|
+
alternatives
|
|
33
|
+
}) => {
|
|
34
|
+
const {
|
|
35
|
+
signIn,
|
|
36
|
+
commonsAvailability
|
|
37
|
+
} = snapshot;
|
|
38
|
+
// Set only from the disclosure's own "I have Commons on another device" —
|
|
39
|
+
// an explicit user choice to leave the acquisition surface, never inferred.
|
|
40
|
+
const [qrRequested, setQrRequested] = useState(false);
|
|
41
|
+
const failed = signIn.phase === 'error';
|
|
42
|
+
// A same-device QR is a dead end without Commons, so the acquisition surface
|
|
43
|
+
// leads — until the user explicitly asks for the QR anyway.
|
|
44
|
+
const acquiring = !failed && commonsAvailability === 'unavailable' && !qrRequested;
|
|
45
|
+
|
|
46
|
+
// A ceremony is pointless once the request is already being confirmed, and a
|
|
47
|
+
// ceremony FAILURE is toasted by the container — this link never renders an
|
|
48
|
+
// error of its own (owner mandate).
|
|
49
|
+
const passkeyAction = alternatives.passkeyAvailable && signIn.phase !== 'authorized' && signIn.phase !== 'completed' ? [{
|
|
50
|
+
key: 'passkey-signin-link',
|
|
51
|
+
label: alternatives.passkeyPending ? t('accountSwitcher.passkeySigningIn') : t('accountSwitcher.useIdentityOnDevice'),
|
|
52
|
+
onPress: alternatives.onSignInWithPasskey,
|
|
53
|
+
disabled: alternatives.passkeyPending
|
|
54
|
+
}] : [];
|
|
55
|
+
const troubleActions = (() => {
|
|
56
|
+
// Nothing about the chosen route is actionable any more — only the
|
|
57
|
+
// authentication alternatives are.
|
|
58
|
+
if (failed) return passkeyAction;
|
|
59
|
+
if (acquiring) {
|
|
60
|
+
return [{
|
|
61
|
+
key: 'show-qr-anyway-link',
|
|
62
|
+
label: t('accountSwitcher.showQrAnyway'),
|
|
63
|
+
onPress: () => setQrRequested(true)
|
|
64
|
+
}, ...passkeyAction];
|
|
65
|
+
}
|
|
66
|
+
return [
|
|
67
|
+
// Redundant while the QR already IS the primary surface.
|
|
68
|
+
...(signIn.route === 'qr' ? [] : [{
|
|
69
|
+
key: 'scan-qr-link',
|
|
70
|
+
label: t('accountSwitcher.scanQr'),
|
|
71
|
+
onPress: alternatives.onShowQr
|
|
72
|
+
}]), ...passkeyAction, {
|
|
73
|
+
key: 'get-commons-link',
|
|
74
|
+
label: t('accountSwitcher.getCommons'),
|
|
75
|
+
onPress: alternatives.onGetCommons
|
|
76
|
+
}];
|
|
77
|
+
})();
|
|
78
|
+
return /*#__PURE__*/_jsx(OxySignInRequestSurface, {
|
|
79
|
+
route: signIn.route,
|
|
80
|
+
progress: signIn.progress,
|
|
81
|
+
qrPayload: signIn.qrPayload,
|
|
82
|
+
routeFailed: signIn.routeFailed,
|
|
83
|
+
failed: failed,
|
|
84
|
+
onRetry: onRetry,
|
|
85
|
+
onAcquireCommons: acquiring ? alternatives.onGetCommons : undefined,
|
|
86
|
+
subordinate: [
|
|
87
|
+
// Account CREATION is not an authentication method, and on web this
|
|
88
|
+
// surface is the FIRST one a signed-out user sees (the entry auto-starts
|
|
89
|
+
// straight through it) — so the way in for someone with no Oxy ID stays
|
|
90
|
+
// visible as a subordinate link rather than hiding behind a
|
|
91
|
+
// troubleshooting affordance.
|
|
92
|
+
{
|
|
93
|
+
key: 'create-account-link',
|
|
94
|
+
label: t('signin.createAccountLink'),
|
|
95
|
+
onPress: alternatives.onCreateAccount
|
|
96
|
+
}],
|
|
97
|
+
alternatives: troubleActions
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
export default SignInRequestView;
|
|
101
|
+
//# sourceMappingURL=SignInRequestView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useState","OxySignInRequestSurface","jsx","_jsx","SignInRequestView","snapshot","t","onRetry","alternatives","signIn","commonsAvailability","qrRequested","setQrRequested","failed","phase","acquiring","passkeyAction","passkeyAvailable","key","label","passkeyPending","onPress","onSignInWithPasskey","disabled","troubleActions","route","onShowQr","onGetCommons","progress","qrPayload","routeFailed","onAcquireCommons","undefined","subordinate","onCreateAccount"],"sourceRoot":"../../../../../src","sources":["ui/components/authChooser/SignInRequestView.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,QAAQ,QAAQ,OAAO;AAEhC,OAAOC,uBAAuB,MAAM,+BAA4B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAWjE,MAAMC,iBAAmD,GAAGA,CAAC;EAC3DC,QAAQ;EACRC,CAAC;EACDC,OAAO;EACPC;AACF,CAAC,KAAK;EACJ,MAAM;IAAEC,MAAM;IAAEC;EAAoB,CAAC,GAAGL,QAAQ;EAChD;EACA;EACA,MAAM,CAACM,WAAW,EAAEC,cAAc,CAAC,GAAGZ,QAAQ,CAAC,KAAK,CAAC;EAErD,MAAMa,MAAM,GAAGJ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AAK,EAAEhB,MAAM,CAACgB,KAAM;IACpBG,QAAQ,EAAEnB,MAAM,CAACmB,QAAS;IAC1BC,SAAS,EAAEpB,MAAM,CAACoB,SAAU;IAC5BC,WAAW,EAAErB,MAAM,CAACqB,WAAY;IAChCjB,MAAM,EAAEA,MAAO;IACfN,OAAO,EAAEA,OAAQ;IACjBwB,gBAAgB,EAAEhB,SAAS,GAAGP,YAAY,CAACmB,YAAY,GAAGK,SAAU;IACpEC,WAAW,EAAE;IACX;IACA;IACA;IACA;IACA;IACA;MACEf,GAAG,EAAE,qBAAqB;MAC1BC,KAAK,EAAEb,CAAC,CAAC,0BAA0B,CAAC;MACpCe,OAAO,EAAEb,YAAY,CAAC0B;IACxB,CAAC,CACD;IACF1B,YAAY,EAAEgB;EAAe,CAC9B,CAAC;AAEN,CAAC;AAED,eAAepB,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Account creation (`signup` view).
|
|
5
|
+
*
|
|
6
|
+
* Commons is ALWAYS the priority path (owner mandate) and leads everywhere it
|
|
7
|
+
* appears: native shows only "Create your identity in Commons" (or "Get Commons"
|
|
8
|
+
* first, when it is not installed); web on a first-party Oxy origin leads with
|
|
9
|
+
* the SAME "Get Commons" CTA, with inline passkey creation offered UNDERNEATH as
|
|
10
|
+
* the de-emphasized "don't want to install anything" alternative — never
|
|
11
|
+
* co-equal, never a competing button. Anywhere else (a non-Oxy web origin,
|
|
12
|
+
* before the b2 hub-relay ships) shows an honest "not available here yet"
|
|
13
|
+
* handoff instead of a broken button.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { useState } from 'react';
|
|
17
|
+
import { TextInput, View } from 'react-native';
|
|
18
|
+
import { Button } from '@oxyhq/bloom/button';
|
|
19
|
+
import { Text } from '@oxyhq/bloom/typography';
|
|
20
|
+
import { isWebBrowser } from "../../utils/isWebBrowser.js";
|
|
21
|
+
import { Dividerish, SubtleLink } from "./primitives.js";
|
|
22
|
+
import { authChooserStyles as styles } from "./styles.js";
|
|
23
|
+
import { useUsernameAvailability } from "./useUsernameAvailability.js";
|
|
24
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
+
const SignUpView = ({
|
|
26
|
+
snapshot,
|
|
27
|
+
theme,
|
|
28
|
+
t,
|
|
29
|
+
oxyServices,
|
|
30
|
+
passkeyMode,
|
|
31
|
+
onCreateWithPasskey,
|
|
32
|
+
createPending,
|
|
33
|
+
onOpenHub,
|
|
34
|
+
onCreateIdentityInCommons,
|
|
35
|
+
onGetCommons,
|
|
36
|
+
onBackToSignIn
|
|
37
|
+
}) => {
|
|
38
|
+
const [username, setUsername] = useState('');
|
|
39
|
+
const {
|
|
40
|
+
status: usernameStatus,
|
|
41
|
+
check: checkUsername
|
|
42
|
+
} = useUsernameAvailability(oxyServices, t);
|
|
43
|
+
const canSubmit = username.trim().length >= 3 && usernameStatus === 'available' && !createPending;
|
|
44
|
+
|
|
45
|
+
// Native — Commons owns identity creation. Deep-link straight in when it is
|
|
46
|
+
// installed, else lead with the same "Get Commons" acquisition CTA.
|
|
47
|
+
if (!isWebBrowser()) {
|
|
48
|
+
const commonsInstalled = snapshot.commonsAvailability === 'available';
|
|
49
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
50
|
+
style: styles.centeredBlock,
|
|
51
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
52
|
+
variant: "primary",
|
|
53
|
+
onPress: commonsInstalled ? onCreateIdentityInCommons : onGetCommons,
|
|
54
|
+
style: styles.primaryButton,
|
|
55
|
+
children: commonsInstalled ? t('signup.createInCommons') : t('accountSwitcher.getCommons')
|
|
56
|
+
}), /*#__PURE__*/_jsx(SubtleLink, {
|
|
57
|
+
label: t('signup.backToSignInLink'),
|
|
58
|
+
theme: theme,
|
|
59
|
+
onPress: onBackToSignIn
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Web, first-party Oxy origin. Commons leads with a "Get Commons" CTA; passkey
|
|
65
|
+
// creation is the de-emphasized alternative underneath for someone who doesn't
|
|
66
|
+
// want to install anything — a secondary button introduced by its own "No
|
|
67
|
+
// Commons?" framing, the same subordination the sign-in surfaces use.
|
|
68
|
+
if (passkeyMode === 'direct') {
|
|
69
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
70
|
+
style: styles.signInBlock,
|
|
71
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
72
|
+
style: [styles.qrHeadline, {
|
|
73
|
+
color: theme.colors.text
|
|
74
|
+
}],
|
|
75
|
+
children: t('signup.commonsHeadline')
|
|
76
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
77
|
+
style: [styles.mutedText, {
|
|
78
|
+
color: theme.colors.textSecondary
|
|
79
|
+
}],
|
|
80
|
+
children: t('signup.commonsExplainer')
|
|
81
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
82
|
+
variant: "primary",
|
|
83
|
+
onPress: onGetCommons,
|
|
84
|
+
style: styles.primaryButton,
|
|
85
|
+
children: t('accountSwitcher.getCommons')
|
|
86
|
+
}), /*#__PURE__*/_jsx(Dividerish, {
|
|
87
|
+
theme: theme,
|
|
88
|
+
label: t('signin.or')
|
|
89
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
90
|
+
style: [styles.mutedText, {
|
|
91
|
+
color: theme.colors.textSecondary
|
|
92
|
+
}],
|
|
93
|
+
children: t('signup.passkeyAlternative')
|
|
94
|
+
}), /*#__PURE__*/_jsx(TextInput, {
|
|
95
|
+
style: [styles.usernameInput, {
|
|
96
|
+
borderColor: theme.colors.border,
|
|
97
|
+
color: theme.colors.text
|
|
98
|
+
}],
|
|
99
|
+
placeholder: t('signup.usernamePlaceholder'),
|
|
100
|
+
placeholderTextColor: theme.colors.textSecondary,
|
|
101
|
+
value: username,
|
|
102
|
+
autoCapitalize: "none",
|
|
103
|
+
autoCorrect: false,
|
|
104
|
+
autoComplete: "username",
|
|
105
|
+
onChangeText: value => {
|
|
106
|
+
setUsername(value);
|
|
107
|
+
checkUsername(value.trim());
|
|
108
|
+
},
|
|
109
|
+
testID: "signup-username-input"
|
|
110
|
+
}), /*#__PURE__*/_jsx(UsernameStatusText, {
|
|
111
|
+
status: usernameStatus,
|
|
112
|
+
theme: theme,
|
|
113
|
+
t: t
|
|
114
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
115
|
+
variant: "secondary",
|
|
116
|
+
onPress: () => onCreateWithPasskey(username.trim()),
|
|
117
|
+
disabled: !canSubmit,
|
|
118
|
+
style: styles.secondaryButton,
|
|
119
|
+
testID: "signup-create-button",
|
|
120
|
+
children: createPending ? t('signup.creating') : t('signup.createAccount')
|
|
121
|
+
}), /*#__PURE__*/_jsx(SubtleLink, {
|
|
122
|
+
label: t('signup.backToSignInLink'),
|
|
123
|
+
theme: theme,
|
|
124
|
+
onPress: onBackToSignIn
|
|
125
|
+
})]
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Web, non-Oxy origin (b2): a passkey ceremony cannot run locally here — the
|
|
130
|
+
// same WebAuthn RP-ID boundary the sign-in surfaces hit — so this opens the
|
|
131
|
+
// auth.oxy.so hub popup. Completing EITHER a sign-in OR a fresh sign-up there
|
|
132
|
+
// relays the resulting session back through the SAME poll/socket engine.
|
|
133
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
134
|
+
style: styles.centeredBlock,
|
|
135
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
136
|
+
style: [styles.mutedText, {
|
|
137
|
+
color: theme.colors.textSecondary
|
|
138
|
+
}],
|
|
139
|
+
children: t('signup.hubExplainer')
|
|
140
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
141
|
+
variant: "primary",
|
|
142
|
+
onPress: onOpenHub,
|
|
143
|
+
style: styles.primaryButton,
|
|
144
|
+
children: t('signup.continueInWindow')
|
|
145
|
+
}), /*#__PURE__*/_jsx(SubtleLink, {
|
|
146
|
+
label: t('signup.backToSignInLink'),
|
|
147
|
+
theme: theme,
|
|
148
|
+
onPress: onBackToSignIn
|
|
149
|
+
})]
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/** The inline availability verdict. Network FAILURES are toasted, never shown here. */
|
|
154
|
+
const UsernameStatusText = ({
|
|
155
|
+
status,
|
|
156
|
+
theme,
|
|
157
|
+
t
|
|
158
|
+
}) => {
|
|
159
|
+
if (status === 'idle') return null;
|
|
160
|
+
if (status === 'checking') {
|
|
161
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
162
|
+
style: [styles.mutedText, {
|
|
163
|
+
color: theme.colors.textSecondary
|
|
164
|
+
}],
|
|
165
|
+
children: t('signup.usernameChecking')
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
if (status === 'available') {
|
|
169
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
170
|
+
style: [styles.mutedText, {
|
|
171
|
+
color: theme.colors.success
|
|
172
|
+
}],
|
|
173
|
+
children: t('signup.usernameAvailable')
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
177
|
+
style: [styles.mutedText, {
|
|
178
|
+
color: theme.colors.error
|
|
179
|
+
}],
|
|
180
|
+
children: t('signup.usernameTaken')
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
export default SignUpView;
|
|
184
|
+
//# sourceMappingURL=SignUpView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useState","TextInput","View","Button","Text","isWebBrowser","Dividerish","SubtleLink","authChooserStyles","styles","useUsernameAvailability","jsx","_jsx","jsxs","_jsxs","SignUpView","snapshot","theme","t","oxyServices","passkeyMode","onCreateWithPasskey","createPending","onOpenHub","onCreateIdentityInCommons","onGetCommons","onBackToSignIn","username","setUsername","status","usernameStatus","check","checkUsername","canSubmit","trim","length","commonsInstalled","commonsAvailability","style","centeredBlock","children","variant","onPress","primaryButton","label","signInBlock","qrHeadline","color","colors","text","mutedText","textSecondary","usernameInput","borderColor","border","placeholder","placeholderTextColor","value","autoCapitalize","autoCorrect","autoComplete","onChangeText","testID","UsernameStatusText","disabled","secondaryButton","success","error"],"sourceRoot":"../../../../../src","sources":["ui/components/authChooser/SignUpView.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,QAAQ,QAAQ,OAAO;AAChC,SAASC,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAC9C,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,IAAI,QAAQ,yBAAyB;AAE9C,SAASC,YAAY,QAAQ,6BAA0B;AACvD,SAASC,UAAU,EAAEC,UAAU,QAAQ,iBAAc;AACrD,SAASC,iBAAiB,IAAIC,MAAM,QAAQ,aAAU;AAEtD,SAASC,uBAAuB,QAA6B,8BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAmBzF,MAAMC,UAAqC,GAAGA,CAAC;EAC7CC,QAAQ;EACRC,KAAK;EACLC,CAAC;EACDC,WAAW;EACXC,WAAW;EACXC,mBAAmB;EACnBC,aAAa;EACbC,SAAS;EACTC,yBAAyB;EACzBC,YAAY;EACZC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAG5B,QAAQ,CAAC,EAAE,CAAC;EAC5C,MAAM;IAAE6B,MAAM,EAAEC,cAAc;IAAEC,KAAK,EAAEC;EAAc,CAAC,GAAGtB,uBAAuB,CAACS,WAAW,EAAED,CAAC,CAAC;EAChG,MAAMe,SAAS,GAAGN,QAAQ,CAACO,IAAI,CAAC,CAAC,CAACC,MAAM,IAAI,CAAC,IAAIL,cAAc,KAAK,WAAW,IAAI,CAACR,aAAa;;EAEjG;EACA;EACA,IAAI,CAACjB,YAAY,CAAC,CAAC,EAAE;IACnB,M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B,oBACEjB,IAAA,CAACR,IAAI;MAACkC,KAAK,EAAE,CAAC7B,MAAM,CAACyC,SAAS,EAAE;QAAEH,KAAK,EAAE9B,KAAK,CAAC+B,MAAM,CAACG;MAAc,CAAC,CAAE;MAAAX,QAAA,EACpEtB,CAAC,CAAC,yBAAyB;IAAC,CACzB,CAAC;EAEX;EACA,IAAIW,MAAM,KAAK,WAAW,EAAE;IAC1B,oBACEjB,IAAA,CAACR,IAAI;MAACkC,KAAK,EAAE,CAAC7B,MAAM,CAACyC,SAAS,EAAE;QAAEH,KAAK,EAAE9B,KAAK,CAAC+B,MAAM,CAACkB;MAAQ,CAAC,CAAE;MAAA1B,QAAA,EAC9DtB,CAAC,CAAC,0BAA0B;IAAC,CAC1B,CAAC;EAEX;EACA,oBACEN,IAAA,CAACR,IAAI;IAACkC,KAAK,EAAE,CAAC7B,MAAM,CAACyC,SAAS,EAAE;MAAEH,KAAK,EAAE9B,KAAK,CAAC+B,MAAM,CAACmB;IAAM,CAAC,CAAE;IAAA3B,QAAA,EAC5DtB,CAAC,CAAC,sBAAsB;EAAC,CACtB,CAAC;AAEX,CAAC;AAED,eAAeH,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The "Having trouble?" progressive disclosure (issue #691, Phase 5).
|
|
5
|
+
*
|
|
6
|
+
* The normal sign-in surface presents ONE primary action. Every alternative —
|
|
7
|
+
* scanning a QR from another device, a passkey on this device, getting Commons,
|
|
8
|
+
* creating an account — lives here, hidden until the user asks for it or the
|
|
9
|
+
* chosen primary route fails.
|
|
10
|
+
*
|
|
11
|
+
* Two renderings, deliberately not one controlled component:
|
|
12
|
+
* - `revealed` (the primary route failed, or there IS no primary route): the
|
|
13
|
+
* alternatives ARE the surface's content now, so they render plainly. There
|
|
14
|
+
* is nothing left to hide them behind.
|
|
15
|
+
* - otherwise: Bloom's own `Collapsible`, whose trigger is the small
|
|
16
|
+
* "Having trouble?" affordance.
|
|
17
|
+
*
|
|
18
|
+
* Splitting on `revealed` is what keeps the open state where it belongs — inside
|
|
19
|
+
* Bloom's uncontrolled disclosure — instead of forcing a hand-rolled controlled
|
|
20
|
+
* copy of it here.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import { View } from 'react-native';
|
|
24
|
+
import { Collapsible } from '@oxyhq/bloom/collapsible';
|
|
25
|
+
import { SubtleLink } from "./primitives.js";
|
|
26
|
+
import { authChooserStyles as styles } from "./styles.js";
|
|
27
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
|
+
const TroubleDisclosure = ({
|
|
29
|
+
actions,
|
|
30
|
+
revealed,
|
|
31
|
+
theme,
|
|
32
|
+
t
|
|
33
|
+
}) => {
|
|
34
|
+
if (actions.length === 0) return null;
|
|
35
|
+
const links = /*#__PURE__*/_jsx(View, {
|
|
36
|
+
style: styles.troubleActions,
|
|
37
|
+
children: actions.map(action => /*#__PURE__*/_jsx(SubtleLink, {
|
|
38
|
+
label: action.label,
|
|
39
|
+
theme: theme,
|
|
40
|
+
onPress: action.onPress,
|
|
41
|
+
disabled: action.disabled,
|
|
42
|
+
testID: action.key
|
|
43
|
+
}, action.key))
|
|
44
|
+
});
|
|
45
|
+
if (revealed) return links;
|
|
46
|
+
return /*#__PURE__*/_jsx(Collapsible, {
|
|
47
|
+
title: t('accountSwitcher.havingTrouble'),
|
|
48
|
+
style: styles.troubleTrigger,
|
|
49
|
+
titleStyle: [styles.linkText, {
|
|
50
|
+
color: theme.colors.textSecondary
|
|
51
|
+
}],
|
|
52
|
+
testID: "trouble-disclosure",
|
|
53
|
+
children: links
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
export default TroubleDisclosure;
|
|
57
|
+
//# sourceMappingURL=TroubleDisclosure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","Collapsible","SubtleLink","authChooserStyles","styles","jsx","_jsx","TroubleDisclosure","actions","revealed","theme","t","length","links","style","troubleActions","children","map","action","label","onPress","disabled","testID","key","title","troubleTrigger","titleStyle","linkText","color","colors","textSecondary"],"sourceRoot":"../../../../../src","sources":["ui/components/authChooser/TroubleDisclosure.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,WAAW,QAAQ,0BAA0B;AACtD,SAASC,UAAU,QAAQ,iBAAc;AACzC,SAASC,iBAAiB,IAAIC,MAAM,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAgBvD,MAAMC,iBAAmD,GAAGA,CAAC;EAAEC,OAAO;EAAEC,QAAQ;EAAEC,KAAK;EAAEC;AAAE,CAAC,KAAK;EAC/F,IAAIH,OAAO,CAACI,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI;EAErC,MAAMC,KAAK,gBACTP,IAAA,CAACN,IAAI;IAACc,KAAK,EAAEV,MAAM,CAACW,cAAe;IAAAC,QAAA,EAChCR,OAAO,CAACS,GAAG,CAAEC,MAAM,iBAClBZ,IAAA,CAACJ,UAAU;MAETiB,KAAK,EAAED,MAAM,CAACC,KAAM;MACpBT,KAAK,EAAEA,KAAM;MACbU,OAAO,EAAEF,MAAM,CAACE,OAAQ;MACxBC,QAAQ,EAAEH,MAAM,CAACG,QAAS;MAC1BC,MAAM,EAAEJ,MAAM,CAACK;IAAI,GALdL,MAAM,CAACK,GAMb,CACF;EAAC,CACE,CACP;EAED,IAAId,QAAQ,EAAE,OAAOI,KAAK;EAE1B,oBACEP,IAAA,CAACL,WAAW;IACVuB,KAAK,EAAEb,CAAC,CAAC,+BAA+B,CAAE;IAC1CG,KAAK,EAAEV,MAAM,CAACqB,cAAe;IAC7BC,UAAU,EAAE,CAACtB,MAAM,CAACuB,QAAQ,EAAE;MAAEC,KAAK,EAAElB,KAAK,CAACmB,MAAM,CAACC;IAAc,CAAC,CAAE;IACrER,MAAM,EAAC,oBAAoB;IAAAN,QAAA,EAE1BH;EAAK,CACK,CAAC;AAElB,CAAC;AAED,eAAeN,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The small presentational building blocks shared across the auth chooser's
|
|
5
|
+
* views. One responsibility each, no controller access, no side effects — they
|
|
6
|
+
* take props and render.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { useState } from 'react';
|
|
10
|
+
import { Pressable, View } from 'react-native';
|
|
11
|
+
import { MaterialCommunityIcons } from '@expo/vector-icons';
|
|
12
|
+
import { Avatar } from '@oxyhq/bloom/avatar';
|
|
13
|
+
import { Text } from '@oxyhq/bloom/typography';
|
|
14
|
+
import { BloomColorScope } from '@oxyhq/bloom/theme';
|
|
15
|
+
import { authChooserStyles as styles } from "./styles.js";
|
|
16
|
+
import { resolveAccentHex, toPreset } from "./types.js";
|
|
17
|
+
|
|
18
|
+
/** Diameter of a row avatar (the sign-in view's account rows). */
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
const ROW_AVATAR_SIZE = 40;
|
|
21
|
+
/**
|
|
22
|
+
* A `Pressable` that appends a hover-tint NativeWind token while pointer-hovered.
|
|
23
|
+
* The Metro web pipeline here does NOT emit NativeWind `hover:` variants, so hover
|
|
24
|
+
* is driven by RN's cross-platform `onHoverIn`/`onHoverOut` (they fire only on web
|
|
25
|
+
* via react-native-web; a no-op on native) toggling a plain background token —
|
|
26
|
+
* the tint stays a NativeWind class, only the trigger is JS.
|
|
27
|
+
*/
|
|
28
|
+
export const HoverPressable = ({
|
|
29
|
+
baseClassName,
|
|
30
|
+
hoverClassName,
|
|
31
|
+
...rest
|
|
32
|
+
}) => {
|
|
33
|
+
const [hovered, setHovered] = useState(false);
|
|
34
|
+
return /*#__PURE__*/_jsx(Pressable, {
|
|
35
|
+
...rest,
|
|
36
|
+
className: hovered ? `${baseClassName} ${hoverClassName}` : baseClassName,
|
|
37
|
+
onHoverIn: () => setHovered(true),
|
|
38
|
+
onHoverOut: () => setHovered(false)
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* A SUBORDINATE action: a small centred text link, never a button.
|
|
44
|
+
*
|
|
45
|
+
* This is the single visual grammar for everything that is not the surface's one
|
|
46
|
+
* primary action (issue #691) — the sign-up entry, and every alternative revealed
|
|
47
|
+
* behind "Having trouble?". Keeping them all on one component is what stops an
|
|
48
|
+
* alternative from quietly growing into a co-equal button again.
|
|
49
|
+
*/
|
|
50
|
+
export const SubtleLink = ({
|
|
51
|
+
label,
|
|
52
|
+
theme,
|
|
53
|
+
onPress,
|
|
54
|
+
disabled,
|
|
55
|
+
testID
|
|
56
|
+
}) => /*#__PURE__*/_jsx(Pressable, {
|
|
57
|
+
onPress: onPress,
|
|
58
|
+
disabled: disabled,
|
|
59
|
+
accessibilityRole: "button",
|
|
60
|
+
accessibilityLabel: label,
|
|
61
|
+
style: styles.footerLink,
|
|
62
|
+
testID: testID,
|
|
63
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
64
|
+
style: [styles.linkText, {
|
|
65
|
+
color: theme.colors.textSecondary
|
|
66
|
+
}],
|
|
67
|
+
children: label
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
/** A labelled hairline separating two blocks ("or"). */
|
|
72
|
+
export const Dividerish = ({
|
|
73
|
+
theme,
|
|
74
|
+
label
|
|
75
|
+
}) => /*#__PURE__*/_jsxs(View, {
|
|
76
|
+
style: styles.dividerRow,
|
|
77
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
78
|
+
style: [styles.dividerLine, {
|
|
79
|
+
backgroundColor: theme.colors.border
|
|
80
|
+
}]
|
|
81
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
82
|
+
style: [styles.dividerText, {
|
|
83
|
+
color: theme.colors.textSecondary
|
|
84
|
+
}],
|
|
85
|
+
children: label
|
|
86
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
87
|
+
style: [styles.dividerLine, {
|
|
88
|
+
backgroundColor: theme.colors.border
|
|
89
|
+
}]
|
|
90
|
+
})]
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* An account row on the sign-in entry — "continue as one of these" rather than a
|
|
95
|
+
* choice of authentication METHOD, which is why it stays above the primary CTA
|
|
96
|
+
* instead of behind the trouble disclosure.
|
|
97
|
+
*/
|
|
98
|
+
export const AccountRow = ({
|
|
99
|
+
account,
|
|
100
|
+
theme,
|
|
101
|
+
switching,
|
|
102
|
+
disabled,
|
|
103
|
+
onPress
|
|
104
|
+
}) => {
|
|
105
|
+
const accent = resolveAccentHex(account.color, theme.colors.primary);
|
|
106
|
+
return /*#__PURE__*/_jsx(BloomColorScope, {
|
|
107
|
+
colorPreset: toPreset(account.color),
|
|
108
|
+
asChild: true,
|
|
109
|
+
children: /*#__PURE__*/_jsxs(Pressable, {
|
|
110
|
+
style: [styles.accountRow, {
|
|
111
|
+
borderColor: account.isCurrent ? accent : theme.colors.border,
|
|
112
|
+
backgroundColor: theme.colors.card
|
|
113
|
+
}, disabled && !switching ? styles.rowDisabled : null],
|
|
114
|
+
onPress: onPress,
|
|
115
|
+
disabled: disabled,
|
|
116
|
+
accessibilityRole: "button",
|
|
117
|
+
accessibilityState: {
|
|
118
|
+
selected: account.isCurrent,
|
|
119
|
+
disabled
|
|
120
|
+
},
|
|
121
|
+
accessibilityLabel: account.displayName,
|
|
122
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
123
|
+
style: [styles.avatarRing, {
|
|
124
|
+
borderColor: account.isCurrent ? accent : 'transparent'
|
|
125
|
+
}],
|
|
126
|
+
children: /*#__PURE__*/_jsx(Avatar, {
|
|
127
|
+
source: account.avatarUrl ?? undefined,
|
|
128
|
+
variant: "thumb",
|
|
129
|
+
name: account.displayName,
|
|
130
|
+
size: ROW_AVATAR_SIZE
|
|
131
|
+
})
|
|
132
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
133
|
+
style: styles.rowMeta,
|
|
134
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
135
|
+
style: [styles.rowName, {
|
|
136
|
+
color: theme.colors.text
|
|
137
|
+
}],
|
|
138
|
+
numberOfLines: 1,
|
|
139
|
+
children: account.displayName
|
|
140
|
+
}), account.email ? /*#__PURE__*/_jsx(Text, {
|
|
141
|
+
style: [styles.rowHandle, {
|
|
142
|
+
color: theme.colors.textSecondary
|
|
143
|
+
}],
|
|
144
|
+
numberOfLines: 1,
|
|
145
|
+
children: account.email
|
|
146
|
+
}) : null]
|
|
147
|
+
}), switching ? /*#__PURE__*/_jsx(MaterialCommunityIcons, {
|
|
148
|
+
name: "loading",
|
|
149
|
+
size: 20,
|
|
150
|
+
color: accent
|
|
151
|
+
}) : account.isCurrent ? /*#__PURE__*/_jsx(MaterialCommunityIcons, {
|
|
152
|
+
name: "check-circle",
|
|
153
|
+
size: 20,
|
|
154
|
+
color: accent
|
|
155
|
+
}) : /*#__PURE__*/_jsx(MaterialCommunityIcons, {
|
|
156
|
+
name: "chevron-right",
|
|
157
|
+
size: 20,
|
|
158
|
+
color: theme.colors.textSecondary
|
|
159
|
+
})]
|
|
160
|
+
})
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
//# sourceMappingURL=primitives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useState","Pressable","View","MaterialCommunityIcons","Avatar","Text","BloomColorScope","authChooserStyles","styles","resolveAccentHex","toPreset","jsx","_jsx","jsxs","_jsxs","ROW_AVATAR_SIZE","HoverPressable","baseClassName","hoverClassName","rest","hovered","setHovered","className","onHoverIn","onHoverOut","SubtleLink","label","theme","onPress","disabled","testID","accessibilityRole","accessibilityLabel","style","footerLink","children","linkText","color","colors","textSecondary","Dividerish","dividerRow","dividerLine","backgroundColor","border","dividerText","AccountRow","account","switching","accent","primary","colorPreset","asChild","accountRow","borderColor","isCurrent","card","rowDisabled","accessibilityState","selected","displayName","avatarRing","source","avatarUrl","undefined","variant","name","size","rowMeta","rowName","text","numberOfLines","email","rowHandle"],"sourceRoot":"../../../../../src","sources":["ui/components/authChooser/primitives.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;;AAGA,SAASA,QAAQ,QAAQ,OAAO;AAChC,SAASC,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAC9C,SAASC,sBAAsB,QAAQ,oBAAoB;AAC3D,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,IAAI,QAAQ,yBAAyB;AAC9C,SAASC,eAAe,QAAQ,oBAAoB;AAEpD,SAASC,iBAAiB,IAAIC,MAAM,QAAQ,aAAU;AACtD,SAASC,gBAAgB,EAAEC,QAAQ,QAAoB,YAAS;;AAEhE;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AACA,MAAMC,eAAe,GAAG,EAAE;AAO1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAA6C,GAAGA,CAAC;EAC5DC,aAAa;EACbC,cAAc;EACd,GAAGC;AACL,CAAC,KAAK;EACJ,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGrB,QAAQ,CAAC,KAAK,CAAC;EAC7C,oBACEY,IAAA,CAACX,SAAS;IAAA,GACJkB,IAAI;IACRG,SAAS,EAAEF,OAAO,GAAG,GAAGH,aAAa,IAAIC,cAAc,EAAE,GAAGD,aAAc;IAC1EM,SAAS,EAAEA,CAAA,KAAMF,UAAU,CAAC,IAAI,CAAE;IAClCG,UAAU,EAAEA,CAAA,KAAMH,UAAU,CAAC,KAAK;EAAE,CACrC,CAAC;AAEN,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,UAMX,GAAGA,CAAC;EAAEC,KAAK;EAAEC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