@oxyhq/services 16.0.0 → 17.0.0

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.
Files changed (251) hide show
  1. package/lib/commonjs/index.js +21 -51
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/commonjs/ui/client.js +0 -14
  4. package/lib/commonjs/ui/client.js.map +1 -1
  5. package/lib/commonjs/ui/components/OxyAccountDialog.js +764 -0
  6. package/lib/commonjs/ui/components/OxyAccountDialog.js.map +1 -0
  7. package/lib/commonjs/ui/components/OxyProvider.js +11 -6
  8. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  9. package/lib/commonjs/ui/components/OxySignInButton.js +10 -21
  10. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
  11. package/lib/commonjs/ui/components/ProfileButton.js +25 -112
  12. package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
  13. package/lib/commonjs/ui/components/RequireOxyAuth.js +299 -0
  14. package/lib/commonjs/ui/components/RequireOxyAuth.js.map +1 -0
  15. package/lib/commonjs/ui/context/OxyContext.js +106 -2
  16. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  17. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +1 -1
  18. package/lib/commonjs/ui/hooks/useAuth.js +19 -30
  19. package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
  20. package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +37 -267
  21. package/lib/commonjs/ui/hooks/useSwitchableAccounts.js.map +1 -1
  22. package/lib/commonjs/ui/index.js +5 -40
  23. package/lib/commonjs/ui/index.js.map +1 -1
  24. package/lib/commonjs/ui/navigation/accountDialogManager.js +91 -0
  25. package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -0
  26. package/lib/commonjs/ui/navigation/routes.js +0 -2
  27. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  28. package/lib/commonjs/ui/screens/ManageAccountScreen.js +4 -3
  29. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
  30. package/lib/commonjs/ui/session/createSessionClient.js +10 -2
  31. package/lib/commonjs/ui/session/createSessionClient.js.map +1 -1
  32. package/lib/module/index.js +18 -15
  33. package/lib/module/index.js.map +1 -1
  34. package/lib/module/ui/client.js +1 -2
  35. package/lib/module/ui/client.js.map +1 -1
  36. package/lib/module/ui/components/OxyAccountDialog.js +761 -0
  37. package/lib/module/ui/components/OxyAccountDialog.js.map +1 -0
  38. package/lib/module/ui/components/OxyProvider.js +11 -6
  39. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  40. package/lib/module/ui/components/OxySignInButton.js +10 -21
  41. package/lib/module/ui/components/OxySignInButton.js.map +1 -1
  42. package/lib/module/ui/components/ProfileButton.js +26 -112
  43. package/lib/module/ui/components/ProfileButton.js.map +1 -1
  44. package/lib/module/ui/components/RequireOxyAuth.js +294 -0
  45. package/lib/module/ui/components/RequireOxyAuth.js.map +1 -0
  46. package/lib/module/ui/context/OxyContext.js +107 -3
  47. package/lib/module/ui/context/OxyContext.js.map +1 -1
  48. package/lib/module/ui/hooks/mutations/useAccountMutations.js +1 -1
  49. package/lib/module/ui/hooks/useAuth.js +19 -30
  50. package/lib/module/ui/hooks/useAuth.js.map +1 -1
  51. package/lib/module/ui/hooks/useSwitchableAccounts.js +38 -267
  52. package/lib/module/ui/hooks/useSwitchableAccounts.js.map +1 -1
  53. package/lib/module/ui/index.js +1 -5
  54. package/lib/module/ui/index.js.map +1 -1
  55. package/lib/module/ui/navigation/accountDialogManager.js +81 -0
  56. package/lib/module/ui/navigation/accountDialogManager.js.map +1 -0
  57. package/lib/module/ui/navigation/routes.js +0 -2
  58. package/lib/module/ui/navigation/routes.js.map +1 -1
  59. package/lib/module/ui/screens/ManageAccountScreen.js +4 -3
  60. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
  61. package/lib/module/ui/session/createSessionClient.js +10 -2
  62. package/lib/module/ui/session/createSessionClient.js.map +1 -1
  63. package/lib/typescript/commonjs/index.d.ts +4 -11
  64. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  65. package/lib/typescript/commonjs/ui/client.d.ts +0 -4
  66. package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
  67. package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts +35 -0
  68. package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts.map +1 -0
  69. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts +2 -2
  70. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
  72. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +11 -23
  73. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts +55 -0
  75. package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts.map +1 -0
  76. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +13 -1
  77. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  78. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  80. package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts +13 -152
  81. package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/ui/index.d.ts +2 -5
  83. package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +49 -0
  85. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -0
  86. package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
  87. package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +1 -1
  89. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  90. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts +9 -2
  91. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts.map +1 -1
  92. package/lib/typescript/commonjs/ui/types/navigation.d.ts +9 -0
  93. package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
  94. package/lib/typescript/module/index.d.ts +4 -11
  95. package/lib/typescript/module/index.d.ts.map +1 -1
  96. package/lib/typescript/module/ui/client.d.ts +0 -4
  97. package/lib/typescript/module/ui/client.d.ts.map +1 -1
  98. package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts +35 -0
  99. package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts.map +1 -0
  100. package/lib/typescript/module/ui/components/OxyProvider.d.ts +2 -2
  101. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  102. package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
  103. package/lib/typescript/module/ui/components/ProfileButton.d.ts +11 -23
  104. package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
  105. package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts +55 -0
  106. package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts.map +1 -0
  107. package/lib/typescript/module/ui/context/OxyContext.d.ts +13 -1
  108. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  109. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  110. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  111. package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts +13 -152
  112. package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
  113. package/lib/typescript/module/ui/index.d.ts +2 -5
  114. package/lib/typescript/module/ui/index.d.ts.map +1 -1
  115. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +49 -0
  116. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -0
  117. package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
  118. package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
  119. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +1 -1
  120. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  121. package/lib/typescript/module/ui/session/createSessionClient.d.ts +9 -2
  122. package/lib/typescript/module/ui/session/createSessionClient.d.ts.map +1 -1
  123. package/lib/typescript/module/ui/types/navigation.d.ts +9 -0
  124. package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
  125. package/package.json +2 -2
  126. package/src/index.ts +21 -26
  127. package/src/ui/client.ts +0 -4
  128. package/src/ui/components/OxyAccountDialog.tsx +760 -0
  129. package/src/ui/components/OxyProvider.tsx +12 -6
  130. package/src/ui/components/OxySignInButton.tsx +10 -21
  131. package/src/ui/components/ProfileButton.tsx +23 -126
  132. package/src/ui/components/RequireOxyAuth.tsx +266 -0
  133. package/src/ui/context/OxyContext.tsx +146 -7
  134. package/src/ui/hooks/mutations/useAccountMutations.ts +1 -1
  135. package/src/ui/hooks/useAuth.ts +19 -31
  136. package/src/ui/hooks/useSwitchableAccounts.ts +42 -376
  137. package/src/ui/index.ts +2 -5
  138. package/src/ui/navigation/accountDialogManager.ts +84 -0
  139. package/src/ui/navigation/routes.ts +0 -4
  140. package/src/ui/screens/ManageAccountScreen.tsx +3 -2
  141. package/src/ui/session/createSessionClient.ts +9 -1
  142. package/src/ui/types/navigation.ts +9 -0
  143. package/lib/commonjs/ui/components/AccountMenu.js +0 -598
  144. package/lib/commonjs/ui/components/AccountMenu.js.map +0 -1
  145. package/lib/commonjs/ui/components/AccountMenuButton.js +0 -135
  146. package/lib/commonjs/ui/components/AccountMenuButton.js.map +0 -1
  147. package/lib/commonjs/ui/components/AccountSwitcher.js +0 -780
  148. package/lib/commonjs/ui/components/AccountSwitcher.js.map +0 -1
  149. package/lib/commonjs/ui/components/AnotherDeviceQR.js +0 -116
  150. package/lib/commonjs/ui/components/AnotherDeviceQR.js.map +0 -1
  151. package/lib/commonjs/ui/components/ProfileMenu.js +0 -518
  152. package/lib/commonjs/ui/components/ProfileMenu.js.map +0 -1
  153. package/lib/commonjs/ui/components/SignInAccountChooser.js +0 -189
  154. package/lib/commonjs/ui/components/SignInAccountChooser.js.map +0 -1
  155. package/lib/commonjs/ui/components/SignInModal.js +0 -600
  156. package/lib/commonjs/ui/components/SignInModal.js.map +0 -1
  157. package/lib/commonjs/ui/hooks/useOxyAuthSession.js +0 -501
  158. package/lib/commonjs/ui/hooks/useOxyAuthSession.js.map +0 -1
  159. package/lib/commonjs/ui/hooks/usePasswordSignIn.js +0 -170
  160. package/lib/commonjs/ui/hooks/usePasswordSignIn.js.map +0 -1
  161. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +0 -51
  162. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +0 -1
  163. package/lib/commonjs/ui/screens/OxyAuthScreen.js +0 -312
  164. package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +0 -1
  165. package/lib/commonjs/utils/deviceFlowSignIn.js +0 -109
  166. package/lib/commonjs/utils/deviceFlowSignIn.js.map +0 -1
  167. package/lib/module/ui/components/AccountMenu.js +0 -593
  168. package/lib/module/ui/components/AccountMenu.js.map +0 -1
  169. package/lib/module/ui/components/AccountMenuButton.js +0 -130
  170. package/lib/module/ui/components/AccountMenuButton.js.map +0 -1
  171. package/lib/module/ui/components/AccountSwitcher.js +0 -774
  172. package/lib/module/ui/components/AccountSwitcher.js.map +0 -1
  173. package/lib/module/ui/components/AnotherDeviceQR.js +0 -110
  174. package/lib/module/ui/components/AnotherDeviceQR.js.map +0 -1
  175. package/lib/module/ui/components/ProfileMenu.js +0 -514
  176. package/lib/module/ui/components/ProfileMenu.js.map +0 -1
  177. package/lib/module/ui/components/SignInAccountChooser.js +0 -183
  178. package/lib/module/ui/components/SignInAccountChooser.js.map +0 -1
  179. package/lib/module/ui/components/SignInModal.js +0 -591
  180. package/lib/module/ui/components/SignInModal.js.map +0 -1
  181. package/lib/module/ui/hooks/useOxyAuthSession.js +0 -495
  182. package/lib/module/ui/hooks/useOxyAuthSession.js.map +0 -1
  183. package/lib/module/ui/hooks/usePasswordSignIn.js +0 -165
  184. package/lib/module/ui/hooks/usePasswordSignIn.js.map +0 -1
  185. package/lib/module/ui/screens/AccountSwitcherScreen.js +0 -48
  186. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +0 -1
  187. package/lib/module/ui/screens/OxyAuthScreen.js +0 -306
  188. package/lib/module/ui/screens/OxyAuthScreen.js.map +0 -1
  189. package/lib/module/utils/deviceFlowSignIn.js +0 -106
  190. package/lib/module/utils/deviceFlowSignIn.js.map +0 -1
  191. package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts +0 -47
  192. package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts.map +0 -1
  193. package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts +0 -26
  194. package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts.map +0 -1
  195. package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts +0 -46
  196. package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts.map +0 -1
  197. package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts +0 -34
  198. package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts.map +0 -1
  199. package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts +0 -49
  200. package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts.map +0 -1
  201. package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts +0 -29
  202. package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts.map +0 -1
  203. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts +0 -28
  204. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +0 -1
  205. package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts +0 -105
  206. package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts.map +0 -1
  207. package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts +0 -31
  208. package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts.map +0 -1
  209. package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts +0 -11
  210. package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
  211. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts +0 -22
  212. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +0 -1
  213. package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts +0 -97
  214. package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts.map +0 -1
  215. package/lib/typescript/module/ui/components/AccountMenu.d.ts +0 -47
  216. package/lib/typescript/module/ui/components/AccountMenu.d.ts.map +0 -1
  217. package/lib/typescript/module/ui/components/AccountMenuButton.d.ts +0 -26
  218. package/lib/typescript/module/ui/components/AccountMenuButton.d.ts.map +0 -1
  219. package/lib/typescript/module/ui/components/AccountSwitcher.d.ts +0 -46
  220. package/lib/typescript/module/ui/components/AccountSwitcher.d.ts.map +0 -1
  221. package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts +0 -34
  222. package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts.map +0 -1
  223. package/lib/typescript/module/ui/components/ProfileMenu.d.ts +0 -49
  224. package/lib/typescript/module/ui/components/ProfileMenu.d.ts.map +0 -1
  225. package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts +0 -29
  226. package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts.map +0 -1
  227. package/lib/typescript/module/ui/components/SignInModal.d.ts +0 -28
  228. package/lib/typescript/module/ui/components/SignInModal.d.ts.map +0 -1
  229. package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts +0 -105
  230. package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts.map +0 -1
  231. package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts +0 -31
  232. package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts.map +0 -1
  233. package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts +0 -11
  234. package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
  235. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts +0 -22
  236. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +0 -1
  237. package/lib/typescript/module/utils/deviceFlowSignIn.d.ts +0 -97
  238. package/lib/typescript/module/utils/deviceFlowSignIn.d.ts.map +0 -1
  239. package/src/ui/components/AccountMenu.tsx +0 -645
  240. package/src/ui/components/AccountMenuButton.tsx +0 -126
  241. package/src/ui/components/AccountSwitcher.tsx +0 -751
  242. package/src/ui/components/AnotherDeviceQR.tsx +0 -119
  243. package/src/ui/components/ProfileMenu.tsx +0 -564
  244. package/src/ui/components/SignInAccountChooser.tsx +0 -162
  245. package/src/ui/components/SignInModal.tsx +0 -530
  246. package/src/ui/hooks/useOxyAuthSession.ts +0 -635
  247. package/src/ui/hooks/usePasswordSignIn.ts +0 -207
  248. package/src/ui/screens/AccountSwitcherScreen.tsx +0 -43
  249. package/src/ui/screens/OxyAuthScreen.tsx +0 -324
  250. package/src/utils/__tests__/deviceFlowSignIn.test.ts +0 -231
  251. package/src/utils/deviceFlowSignIn.ts +0 -152
@@ -0,0 +1,761 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * OxyAccountDialog — the ONE unified account dialog for `@oxyhq/services`.
5
+ *
6
+ * A thin React Native binding over the headless `AccountDialogController` in
7
+ * `@oxyhq/core` (bound via `useSyncExternalStore`), presented as a bottom-sheet
8
+ * modal. It REPLACES the five drifting device/account surfaces the SDK shipped
9
+ * before (`ProfileMenu`, `AccountMenu`, `AccountSwitcher`, `SignInAccountChooser`,
10
+ * and `SignInModal`) with a single implementation whose data + state machine live
11
+ * in core, so the RN and web (auth-sdk) bindings render the SAME list from the
12
+ * SAME logic and cannot diverge.
13
+ *
14
+ * Views (from `snapshot.view`):
15
+ * - `accounts` — the unified `SwitchableAccount[]` list (device sign-ins ∪ graph
16
+ * accounts). Tapping a row switches through `controller.switchTo(accountId)`
17
+ * (the uniform switch), the active row is flagged, and a "+ Add account" row
18
+ * opens the sign-in entry. This is what `ProfileButton` opens.
19
+ * - `add` / `signin` — the sign-in entry: primary "Sign in with Oxy" (device
20
+ * flow), "Scan a QR", and a secondary "Use a password" hand-off that opens
21
+ * auth.oxy.so (password + 2FA are NOT in the SDK).
22
+ * - `qr` — the cross-device QR handoff + its waiting state.
23
+ *
24
+ * Per-account color re-theming uses Bloom's `APP_COLOR_PRESETS` + `BloomColorScope`
25
+ * (same visual language auth.oxy.so uses). Base theming is `useTheme()` + a
26
+ * `StyleSheet`, so the dialog renders correctly in EVERY consumer — including apps
27
+ * that do not use NativeWind (e.g. the accounts app). Modal contents are wrapped
28
+ * in `<GestureHandlerRootView>` because RN's `Modal` renders into its own window.
29
+ */
30
+
31
+ import { useCallback, useMemo, useState, useSyncExternalStore } from 'react';
32
+ import { Modal, Platform, Pressable, ScrollView, StyleSheet, View } from 'react-native';
33
+ import { GestureHandlerRootView } from 'react-native-gesture-handler';
34
+ import { MaterialCommunityIcons } from '@expo/vector-icons';
35
+ import QRCode from 'react-native-qrcode-svg';
36
+ import { Avatar } from '@oxyhq/bloom/avatar';
37
+ import { Button } from '@oxyhq/bloom/button';
38
+ import { Text } from '@oxyhq/bloom/typography';
39
+ import { useTheme, BloomColorScope, APP_COLOR_NAMES, APP_COLOR_PRESETS } from '@oxyhq/bloom/theme';
40
+ import { useQueryClient } from '@tanstack/react-query';
41
+ import { useOxy } from "../context/OxyContext.js";
42
+ import { useI18n } from "../hooks/useI18n.js";
43
+ import OxyLogo from "./OxyLogo.js";
44
+
45
+ /** Diameter of a row avatar. */
46
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
47
+ const ROW_AVATAR_SIZE = 40;
48
+ /** High-contrast QR colors — intentionally fixed (NOT themed) for scan reliability. */
49
+ const QR_PLATE_BG = '#FFFFFF';
50
+ const QR_FOREGROUND = '#000000';
51
+ const QR_SIZE = 196;
52
+ const isWeb = Platform.OS === 'web';
53
+
54
+ /**
55
+ * Resolve an account's stored color (a named Bloom preset, e.g. `'purple'`) to
56
+ * a concrete brand hex for the row accent. Falls back to the theme primary when
57
+ * the account has no color or the value is not a recognized preset, so the accent
58
+ * renders in EVERY consumer regardless of NativeWind availability.
59
+ */
60
+ function resolveAccentHex(color, fallback) {
61
+ const preset = toPreset(color);
62
+ return preset ? APP_COLOR_PRESETS[preset].hex : fallback;
63
+ }
64
+
65
+ /** Narrow a stored color string to a known `AppColorName`, or `undefined`. */
66
+ function toPreset(color) {
67
+ if (!color) return undefined;
68
+ return APP_COLOR_NAMES.includes(color) ? color : undefined;
69
+ }
70
+ /**
71
+ * The unified account dialog. Mounted once by `OxyProvider`; opened imperatively
72
+ * via `useOxy().openAccountDialog(view?)` (or the back-compat `showSignInModal`).
73
+ */
74
+ const OxyAccountDialog = () => {
75
+ const {
76
+ accountDialogController: controller,
77
+ isAccountDialogOpen,
78
+ closeAccountDialog,
79
+ showBottomSheet,
80
+ logoutAll,
81
+ refreshAccounts
82
+ } = useOxy();
83
+ const theme = useTheme();
84
+ const {
85
+ t
86
+ } = useI18n();
87
+ const queryClient = useQueryClient();
88
+
89
+ // Bind the headless controller. `getSnapshot` returns a stable reference
90
+ // between changes, so it is `useSyncExternalStore`-safe. Guard the no-provider
91
+ // loading state (`controller` is `null`) with an inert store.
92
+ const subscribe = useCallback(listener => controller ? controller.subscribe(listener) : () => undefined, [controller]);
93
+ const getSnapshot = useCallback(() => controller ? controller.getSnapshot() : EMPTY_SNAPSHOT, [controller]);
94
+ const snapshot = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
95
+ const [switching, setSwitching] = useState(false);
96
+ const handleSwitch = useCallback(async accountId => {
97
+ if (!controller || switching) return;
98
+ if (accountId === snapshot.activeAccountId) {
99
+ closeAccountDialog();
100
+ return;
101
+ }
102
+ setSwitching(true);
103
+ try {
104
+ await controller.switchTo(accountId);
105
+ // A switch succeeds unless the controller recorded an error. On success
106
+ // reload the app's account graph and drop cached account-scoped data so
107
+ // the new active identity re-fetches — the same side effects the
108
+ // context's own `switchToAccount` performs.
109
+ if (!controller.getSnapshot().error) {
110
+ void refreshAccounts();
111
+ queryClient.invalidateQueries();
112
+ closeAccountDialog();
113
+ }
114
+ } finally {
115
+ setSwitching(false);
116
+ }
117
+ }, [controller, switching, snapshot.activeAccountId, closeAccountDialog, refreshAccounts, queryClient]);
118
+ const handleManage = useCallback(() => {
119
+ closeAccountDialog();
120
+ showBottomSheet?.('ManageAccount');
121
+ }, [closeAccountDialog, showBottomSheet]);
122
+ const handleSignOutAll = useCallback(() => {
123
+ closeAccountDialog();
124
+ void logoutAll();
125
+ }, [closeAccountDialog, logoutAll]);
126
+ const handlers = useMemo(() => ({
127
+ onSwitch: accountId => {
128
+ void handleSwitch(accountId);
129
+ },
130
+ onAdd: () => controller?.add(),
131
+ onManage: handleManage,
132
+ onClose: closeAccountDialog
133
+ }), [handleSwitch, controller, handleManage, closeAccountDialog]);
134
+ if (!isAccountDialogOpen || !controller) {
135
+ return null;
136
+ }
137
+ const {
138
+ view
139
+ } = snapshot;
140
+ const showBack = view === 'qr' || view === 'add' && snapshot.accounts.length > 0;
141
+ return /*#__PURE__*/_jsx(Modal, {
142
+ visible: true,
143
+ transparent: true,
144
+ animationType: isWeb ? 'fade' : 'slide',
145
+ statusBarTranslucent: true,
146
+ onRequestClose: closeAccountDialog,
147
+ children: /*#__PURE__*/_jsx(GestureHandlerRootView, {
148
+ style: styles.root,
149
+ children: /*#__PURE__*/_jsxs(View, {
150
+ style: [styles.backdrop, {
151
+ backgroundColor: theme.colors.overlay
152
+ }],
153
+ children: [/*#__PURE__*/_jsx(Pressable, {
154
+ style: StyleSheet.absoluteFill,
155
+ onPress: closeAccountDialog,
156
+ accessibilityLabel: t('common.actions.close') || 'Close',
157
+ accessibilityRole: "button"
158
+ }), /*#__PURE__*/_jsxs(View, {
159
+ style: [styles.card, isWeb ? styles.cardCentered : styles.cardSheet, {
160
+ backgroundColor: theme.colors.card,
161
+ borderColor: theme.colors.border
162
+ }],
163
+ children: [/*#__PURE__*/_jsx(DialogHeader, {
164
+ snapshot: snapshot,
165
+ theme: theme,
166
+ t: t,
167
+ showBack: showBack,
168
+ onBack: () => controller.setView('accounts'),
169
+ onClose: closeAccountDialog
170
+ }), /*#__PURE__*/_jsx(ScrollView, {
171
+ style: styles.body,
172
+ contentContainerStyle: styles.bodyContent,
173
+ showsVerticalScrollIndicator: false,
174
+ children: view === 'accounts' ? /*#__PURE__*/_jsx(AccountsView, {
175
+ snapshot: snapshot,
176
+ theme: theme,
177
+ t: t,
178
+ handlers: handlers
179
+ }) : view === 'qr' ? /*#__PURE__*/_jsx(QrView, {
180
+ snapshot: snapshot,
181
+ theme: theme,
182
+ t: t,
183
+ onRetry: () => void controller.showQr()
184
+ }) : /*#__PURE__*/_jsx(SignInView, {
185
+ snapshot: snapshot,
186
+ theme: theme,
187
+ t: t,
188
+ handlers: handlers,
189
+ onSignInWithOxy: () => void controller.signInWithOxy(),
190
+ onScanQr: () => void controller.showQr(),
191
+ onUsePassword: () => controller.openPasswordAtOxyAuth({
192
+ returnUrl: isWeb ? currentHref() : undefined
193
+ })
194
+ })
195
+ })]
196
+ })]
197
+ })
198
+ })
199
+ });
200
+ };
201
+
202
+ // ---------------------------------------------------------------------------
203
+ // Header
204
+ // ---------------------------------------------------------------------------
205
+
206
+ const DialogHeader = ({
207
+ snapshot,
208
+ theme,
209
+ t,
210
+ showBack,
211
+ onBack,
212
+ onClose
213
+ }) => {
214
+ const {
215
+ title,
216
+ subtitle
217
+ } = headerCopy(snapshot.view, snapshot.accounts.length, t);
218
+ return /*#__PURE__*/_jsxs(View, {
219
+ style: styles.header,
220
+ children: [/*#__PURE__*/_jsxs(View, {
221
+ style: styles.headerBar,
222
+ children: [showBack ? /*#__PURE__*/_jsx(Pressable, {
223
+ onPress: onBack,
224
+ style: [styles.iconButton, {
225
+ backgroundColor: theme.colors.backgroundSecondary
226
+ }],
227
+ accessibilityRole: "button",
228
+ accessibilityLabel: t('common.actions.back') || 'Back',
229
+ children: /*#__PURE__*/_jsx(MaterialCommunityIcons, {
230
+ name: "chevron-left",
231
+ size: 22,
232
+ color: theme.colors.textSecondary
233
+ })
234
+ }) : /*#__PURE__*/_jsx(View, {
235
+ style: styles.iconButton
236
+ }), /*#__PURE__*/_jsx(OxyLogo, {
237
+ variant: "icon",
238
+ size: 34,
239
+ fillColor: theme.colors.primary
240
+ }), /*#__PURE__*/_jsx(Pressable, {
241
+ onPress: onClose,
242
+ style: [styles.iconButton, {
243
+ backgroundColor: theme.colors.backgroundSecondary
244
+ }],
245
+ accessibilityRole: "button",
246
+ accessibilityLabel: t('common.actions.close') || 'Close',
247
+ children: /*#__PURE__*/_jsx(MaterialCommunityIcons, {
248
+ name: "close",
249
+ size: 20,
250
+ color: theme.colors.textSecondary
251
+ })
252
+ })]
253
+ }), /*#__PURE__*/_jsx(Text, {
254
+ style: [styles.title, {
255
+ color: theme.colors.text
256
+ }],
257
+ numberOfLines: 1,
258
+ children: title
259
+ }), subtitle ? /*#__PURE__*/_jsx(Text, {
260
+ style: [styles.subtitle, {
261
+ color: theme.colors.textSecondary
262
+ }],
263
+ numberOfLines: 2,
264
+ children: subtitle
265
+ }) : null]
266
+ });
267
+ };
268
+
269
+ // ---------------------------------------------------------------------------
270
+ // Accounts view
271
+ // ---------------------------------------------------------------------------
272
+
273
+ const AccountsView = ({
274
+ snapshot,
275
+ theme,
276
+ t,
277
+ handlers
278
+ }) => {
279
+ if (snapshot.loading && snapshot.accounts.length === 0) {
280
+ return /*#__PURE__*/_jsxs(View, {
281
+ style: styles.centeredBlock,
282
+ children: [/*#__PURE__*/_jsx(MaterialCommunityIcons, {
283
+ name: "loading",
284
+ size: 24,
285
+ color: theme.colors.textSecondary
286
+ }), /*#__PURE__*/_jsx(Text, {
287
+ style: [styles.mutedText, {
288
+ color: theme.colors.textSecondary
289
+ }],
290
+ children: t('accountSwitcher.loading') || 'Loading accounts…'
291
+ })]
292
+ });
293
+ }
294
+ return /*#__PURE__*/_jsxs(View, {
295
+ style: styles.rows,
296
+ children: [snapshot.accounts.map(account => /*#__PURE__*/_jsx(AccountRow, {
297
+ account: account,
298
+ theme: theme,
299
+ switching: snapshot.switchingAccountId === account.accountId,
300
+ disabled: snapshot.switchingAccountId !== null,
301
+ onPress: () => handlers.onSwitch(account.accountId)
302
+ }, account.accountId)), /*#__PURE__*/_jsxs(Pressable, {
303
+ style: [styles.addRow, {
304
+ borderColor: theme.colors.border
305
+ }],
306
+ onPress: handlers.onAdd,
307
+ accessibilityRole: "button",
308
+ accessibilityLabel: t('signin.addAccountTitle') || 'Add another account',
309
+ children: [/*#__PURE__*/_jsx(View, {
310
+ style: [styles.addBadge, {
311
+ borderColor: theme.colors.border
312
+ }],
313
+ children: /*#__PURE__*/_jsx(MaterialCommunityIcons, {
314
+ name: "plus",
315
+ size: 20,
316
+ color: theme.colors.textSecondary
317
+ })
318
+ }), /*#__PURE__*/_jsx(Text, {
319
+ style: [styles.rowName, {
320
+ color: theme.colors.textSecondary
321
+ }],
322
+ children: t('signin.addAccountTitle') || 'Add another account'
323
+ })]
324
+ }), /*#__PURE__*/_jsx(View, {
325
+ style: styles.footerLinks,
326
+ children: /*#__PURE__*/_jsx(Pressable, {
327
+ onPress: handlers.onManage,
328
+ accessibilityRole: "button",
329
+ children: /*#__PURE__*/_jsx(Text, {
330
+ style: [styles.linkText, {
331
+ color: theme.colors.primary
332
+ }],
333
+ children: t('accountMenu.manage') || 'Manage accounts'
334
+ })
335
+ })
336
+ })]
337
+ });
338
+ };
339
+ const AccountRow = ({
340
+ account,
341
+ theme,
342
+ switching,
343
+ disabled,
344
+ onPress
345
+ }) => {
346
+ const accent = resolveAccentHex(account.color, theme.colors.primary);
347
+ const rowStyle = [styles.accountRow, {
348
+ borderColor: account.isCurrent ? accent : theme.colors.border,
349
+ backgroundColor: theme.colors.card
350
+ }, disabled && !switching ? styles.rowDisabled : null];
351
+ return /*#__PURE__*/_jsx(BloomColorScope, {
352
+ colorPreset: toPreset(account.color),
353
+ asChild: true,
354
+ children: /*#__PURE__*/_jsxs(Pressable, {
355
+ style: rowStyle,
356
+ onPress: onPress,
357
+ disabled: disabled,
358
+ accessibilityRole: "button",
359
+ accessibilityState: {
360
+ selected: account.isCurrent,
361
+ disabled
362
+ },
363
+ accessibilityLabel: account.displayName,
364
+ children: [/*#__PURE__*/_jsx(View, {
365
+ style: [styles.avatarRing, {
366
+ borderColor: account.isCurrent ? accent : 'transparent'
367
+ }],
368
+ children: /*#__PURE__*/_jsx(Avatar, {
369
+ source: account.user.avatar ?? undefined,
370
+ variant: "thumb",
371
+ name: account.displayName,
372
+ size: ROW_AVATAR_SIZE
373
+ })
374
+ }), /*#__PURE__*/_jsxs(View, {
375
+ style: styles.rowMeta,
376
+ children: [/*#__PURE__*/_jsx(Text, {
377
+ style: [styles.rowName, {
378
+ color: theme.colors.text
379
+ }],
380
+ numberOfLines: 1,
381
+ children: account.displayName
382
+ }), account.email ? /*#__PURE__*/_jsx(Text, {
383
+ style: [styles.rowHandle, {
384
+ color: theme.colors.textSecondary
385
+ }],
386
+ numberOfLines: 1,
387
+ children: account.email
388
+ }) : null]
389
+ }), switching ? /*#__PURE__*/_jsx(MaterialCommunityIcons, {
390
+ name: "loading",
391
+ size: 20,
392
+ color: accent
393
+ }) : account.isCurrent ? /*#__PURE__*/_jsx(MaterialCommunityIcons, {
394
+ name: "check-circle",
395
+ size: 20,
396
+ color: accent
397
+ }) : /*#__PURE__*/_jsx(MaterialCommunityIcons, {
398
+ name: "chevron-right",
399
+ size: 20,
400
+ color: theme.colors.textSecondary
401
+ })]
402
+ })
403
+ });
404
+ };
405
+
406
+ // ---------------------------------------------------------------------------
407
+ // Sign-in view (add / signin)
408
+ // ---------------------------------------------------------------------------
409
+
410
+ const SignInView = ({
411
+ snapshot,
412
+ theme,
413
+ t,
414
+ handlers,
415
+ onSignInWithOxy,
416
+ onScanQr,
417
+ onUsePassword
418
+ }) => /*#__PURE__*/_jsxs(View, {
419
+ style: styles.signInBlock,
420
+ children: [snapshot.accounts.length > 0 ? /*#__PURE__*/_jsxs(View, {
421
+ style: styles.rows,
422
+ children: [snapshot.accounts.map(account => /*#__PURE__*/_jsx(AccountRow, {
423
+ account: account,
424
+ theme: theme,
425
+ switching: snapshot.switchingAccountId === account.accountId,
426
+ disabled: snapshot.switchingAccountId !== null,
427
+ onPress: () => handlers.onSwitch(account.accountId)
428
+ }, account.accountId)), /*#__PURE__*/_jsx(Dividerish, {
429
+ theme: theme,
430
+ label: t('signin.or') || 'or'
431
+ })]
432
+ }) : null, /*#__PURE__*/_jsx(Button, {
433
+ variant: "primary",
434
+ onPress: onSignInWithOxy,
435
+ style: styles.primaryButton,
436
+ children: "Sign in with Oxy"
437
+ }), /*#__PURE__*/_jsx(Button, {
438
+ variant: "secondary",
439
+ onPress: onScanQr,
440
+ style: styles.secondaryButton,
441
+ children: t('accountSwitcher.scanQr') || 'Scan a QR from another device'
442
+ }), /*#__PURE__*/_jsx(Pressable, {
443
+ onPress: onUsePassword,
444
+ accessibilityRole: "button",
445
+ style: styles.passwordLink,
446
+ children: /*#__PURE__*/_jsx(Text, {
447
+ style: [styles.linkText, {
448
+ color: theme.colors.textSecondary
449
+ }],
450
+ children: "Use a password instead"
451
+ })
452
+ })]
453
+ });
454
+ const Dividerish = ({
455
+ theme,
456
+ label
457
+ }) => /*#__PURE__*/_jsxs(View, {
458
+ style: styles.dividerRow,
459
+ children: [/*#__PURE__*/_jsx(View, {
460
+ style: [styles.dividerLine, {
461
+ backgroundColor: theme.colors.border
462
+ }]
463
+ }), /*#__PURE__*/_jsx(Text, {
464
+ style: [styles.dividerText, {
465
+ color: theme.colors.textSecondary
466
+ }],
467
+ children: label
468
+ }), /*#__PURE__*/_jsx(View, {
469
+ style: [styles.dividerLine, {
470
+ backgroundColor: theme.colors.border
471
+ }]
472
+ })]
473
+ });
474
+
475
+ // ---------------------------------------------------------------------------
476
+ // QR view
477
+ // ---------------------------------------------------------------------------
478
+
479
+ const QrView = ({
480
+ snapshot,
481
+ theme,
482
+ t,
483
+ onRetry
484
+ }) => {
485
+ const {
486
+ signIn
487
+ } = snapshot;
488
+ if (signIn.phase === 'error') {
489
+ return /*#__PURE__*/_jsxs(View, {
490
+ style: styles.centeredBlock,
491
+ children: [/*#__PURE__*/_jsx(Text, {
492
+ style: [styles.errorText, {
493
+ color: theme.colors.error
494
+ }],
495
+ children: signIn.error || 'Sign-in failed. Please try again.'
496
+ }), /*#__PURE__*/_jsx(Button, {
497
+ variant: "secondary",
498
+ onPress: onRetry,
499
+ style: styles.secondaryButton,
500
+ children: t('common.actions.tryAgain') || 'Try again'
501
+ })]
502
+ });
503
+ }
504
+ if (signIn.phase === 'starting' || signIn.phase === 'authorized' || !signIn.qrPayload) {
505
+ const label = signIn.phase === 'authorized' ? t('signin.status.signingIn') || 'Signing in…' : t('accountSwitcher.loading') || 'Preparing sign-in…';
506
+ return /*#__PURE__*/_jsxs(View, {
507
+ style: styles.centeredBlock,
508
+ children: [/*#__PURE__*/_jsx(MaterialCommunityIcons, {
509
+ name: "loading",
510
+ size: 26,
511
+ color: theme.colors.primary
512
+ }), /*#__PURE__*/_jsx(Text, {
513
+ style: [styles.mutedText, {
514
+ color: theme.colors.textSecondary
515
+ }],
516
+ children: label
517
+ })]
518
+ });
519
+ }
520
+ return /*#__PURE__*/_jsxs(View, {
521
+ style: styles.centeredBlock,
522
+ children: [/*#__PURE__*/_jsx(View, {
523
+ style: styles.qrPlate,
524
+ children: /*#__PURE__*/_jsx(QRCode, {
525
+ value: signIn.qrPayload,
526
+ size: QR_SIZE,
527
+ backgroundColor: QR_PLATE_BG,
528
+ color: QR_FOREGROUND
529
+ })
530
+ }), /*#__PURE__*/_jsx(Text, {
531
+ style: [styles.mutedText, {
532
+ color: theme.colors.textSecondary
533
+ }],
534
+ children: t('accountSwitcher.scanWithOxy') || 'Scan with any Oxy app and approve.'
535
+ })]
536
+ });
537
+ };
538
+
539
+ // ---------------------------------------------------------------------------
540
+ // Copy + helpers
541
+ // ---------------------------------------------------------------------------
542
+
543
+ function headerCopy(view, accountCount, t) {
544
+ switch (view) {
545
+ case 'accounts':
546
+ return {
547
+ title: t('accountSwitcher.sections.yourAccounts') || 'Your accounts',
548
+ subtitle: t('signin.chooser.subtitle') || 'Choose which account to continue with.'
549
+ };
550
+ case 'qr':
551
+ return {
552
+ title: t('accountSwitcher.scanTitle') || 'Scan with Oxy',
553
+ subtitle: t('accountSwitcher.scanSubtitle') || 'Approve from your phone.'
554
+ };
555
+ default:
556
+ return accountCount > 0 ? {
557
+ title: t('signin.addAccountTitle') || 'Add another account',
558
+ subtitle: t('signin.addAccountSubtitle') || 'Sign in with another account.'
559
+ } : {
560
+ title: t('signin.title') || 'Sign in',
561
+ subtitle: t('signin.subtitle') || 'One identity for the whole ecosystem.'
562
+ };
563
+ }
564
+ }
565
+
566
+ /** Current document URL on web; `undefined` where `location` is absent. */
567
+ function currentHref() {
568
+ const location = globalThis.location;
569
+ return typeof location?.href === 'string' ? location.href : undefined;
570
+ }
571
+ const EMPTY_SNAPSHOT = {
572
+ view: 'accounts',
573
+ accounts: [],
574
+ activeAccountId: null,
575
+ loading: false,
576
+ error: null,
577
+ switchingAccountId: null,
578
+ signIn: {
579
+ phase: 'idle',
580
+ authorizeCode: null,
581
+ qrPayload: null,
582
+ expiresAt: null,
583
+ error: null
584
+ }
585
+ };
586
+ const styles = StyleSheet.create({
587
+ root: {
588
+ flex: 1
589
+ },
590
+ backdrop: {
591
+ flex: 1,
592
+ justifyContent: isWeb ? 'center' : 'flex-end',
593
+ alignItems: 'center'
594
+ },
595
+ card: {
596
+ width: '100%',
597
+ maxWidth: 420,
598
+ borderWidth: StyleSheet.hairlineWidth,
599
+ paddingHorizontal: 20,
600
+ paddingTop: 16,
601
+ paddingBottom: 24
602
+ },
603
+ cardCentered: {
604
+ borderRadius: 28
605
+ },
606
+ cardSheet: {
607
+ borderTopLeftRadius: 28,
608
+ borderTopRightRadius: 28
609
+ },
610
+ header: {
611
+ alignItems: 'center',
612
+ marginBottom: 12
613
+ },
614
+ headerBar: {
615
+ width: '100%',
616
+ flexDirection: 'row',
617
+ alignItems: 'center',
618
+ justifyContent: 'space-between',
619
+ marginBottom: 8
620
+ },
621
+ iconButton: {
622
+ width: 32,
623
+ height: 32,
624
+ borderRadius: 16,
625
+ alignItems: 'center',
626
+ justifyContent: 'center'
627
+ },
628
+ title: {
629
+ fontSize: 22,
630
+ fontWeight: '800',
631
+ letterSpacing: -0.4,
632
+ textAlign: 'center',
633
+ marginTop: 6
634
+ },
635
+ subtitle: {
636
+ fontSize: 14,
637
+ lineHeight: 19,
638
+ textAlign: 'center',
639
+ marginTop: 4
640
+ },
641
+ body: {
642
+ width: '100%'
643
+ },
644
+ bodyContent: {
645
+ paddingTop: 4,
646
+ paddingBottom: 4
647
+ },
648
+ rows: {
649
+ width: '100%',
650
+ gap: 8
651
+ },
652
+ accountRow: {
653
+ flexDirection: 'row',
654
+ alignItems: 'center',
655
+ gap: 12,
656
+ borderWidth: StyleSheet.hairlineWidth,
657
+ borderRadius: 16,
658
+ paddingVertical: 10,
659
+ paddingHorizontal: 12
660
+ },
661
+ rowDisabled: {
662
+ opacity: 0.6
663
+ },
664
+ avatarRing: {
665
+ borderRadius: 9999,
666
+ borderWidth: 2,
667
+ padding: 1
668
+ },
669
+ rowMeta: {
670
+ flex: 1,
671
+ minWidth: 0
672
+ },
673
+ rowName: {
674
+ fontSize: 15,
675
+ fontWeight: '600'
676
+ },
677
+ rowHandle: {
678
+ fontSize: 12.5,
679
+ marginTop: 1
680
+ },
681
+ addRow: {
682
+ flexDirection: 'row',
683
+ alignItems: 'center',
684
+ gap: 12,
685
+ borderWidth: StyleSheet.hairlineWidth,
686
+ borderStyle: 'dashed',
687
+ borderRadius: 16,
688
+ paddingVertical: 10,
689
+ paddingHorizontal: 12,
690
+ marginTop: 8
691
+ },
692
+ addBadge: {
693
+ width: ROW_AVATAR_SIZE,
694
+ height: ROW_AVATAR_SIZE,
695
+ borderRadius: 9999,
696
+ borderWidth: StyleSheet.hairlineWidth,
697
+ alignItems: 'center',
698
+ justifyContent: 'center'
699
+ },
700
+ footerLinks: {
701
+ alignItems: 'center',
702
+ marginTop: 16
703
+ },
704
+ linkText: {
705
+ fontSize: 14,
706
+ fontWeight: '600'
707
+ },
708
+ signInBlock: {
709
+ width: '100%'
710
+ },
711
+ primaryButton: {
712
+ width: '100%',
713
+ borderRadius: 14,
714
+ marginTop: 8
715
+ },
716
+ secondaryButton: {
717
+ width: '100%',
718
+ borderRadius: 14,
719
+ marginTop: 10
720
+ },
721
+ passwordLink: {
722
+ alignSelf: 'center',
723
+ paddingVertical: 10,
724
+ marginTop: 12
725
+ },
726
+ dividerRow: {
727
+ flexDirection: 'row',
728
+ alignItems: 'center',
729
+ width: '100%',
730
+ marginVertical: 14
731
+ },
732
+ dividerLine: {
733
+ flex: 1,
734
+ height: StyleSheet.hairlineWidth
735
+ },
736
+ dividerText: {
737
+ marginHorizontal: 12,
738
+ fontSize: 13
739
+ },
740
+ centeredBlock: {
741
+ alignItems: 'center',
742
+ justifyContent: 'center',
743
+ gap: 12,
744
+ paddingVertical: 24
745
+ },
746
+ mutedText: {
747
+ fontSize: 14,
748
+ textAlign: 'center'
749
+ },
750
+ errorText: {
751
+ fontSize: 14,
752
+ textAlign: 'center'
753
+ },
754
+ qrPlate: {
755
+ padding: 16,
756
+ borderRadius: 16,
757
+ backgroundColor: QR_PLATE_BG
758
+ }
759
+ });
760
+ export default OxyAccountDialog;
761
+ //# sourceMappingURL=OxyAccountDialog.js.map