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