@terreno/ui 57.19.2 → 57.21.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 (379) hide show
  1. package/.ai/guidelines/core.md +1 -1
  2. package/CHANGELOG.md +443 -0
  3. package/dist/Accordion.d.ts.map +1 -1
  4. package/dist/Accordion.js +3 -3
  5. package/dist/Accordion.js.map +1 -1
  6. package/dist/Avatar.d.ts.map +1 -1
  7. package/dist/Avatar.js +3 -1
  8. package/dist/Avatar.js.map +1 -1
  9. package/dist/Box.d.ts.map +1 -1
  10. package/dist/Box.js +38 -2
  11. package/dist/Box.js.map +1 -1
  12. package/dist/Card.js +2 -2
  13. package/dist/Card.js.map +1 -1
  14. package/dist/Common.d.ts +175 -34
  15. package/dist/Common.d.ts.map +1 -1
  16. package/dist/Common.js.map +1 -1
  17. package/dist/ConsentFormScreen.d.ts +1 -1
  18. package/dist/ConsentFormScreen.d.ts.map +1 -1
  19. package/dist/ConsentFormScreen.js +13 -4
  20. package/dist/ConsentFormScreen.js.map +1 -1
  21. package/dist/DateTimeField.d.ts.map +1 -1
  22. package/dist/DateTimeField.js +11 -9
  23. package/dist/DateTimeField.js.map +1 -1
  24. package/dist/Field.d.ts.map +1 -1
  25. package/dist/Field.js +2 -0
  26. package/dist/Field.js.map +1 -1
  27. package/dist/FormContainer.d.ts +68 -0
  28. package/dist/FormContainer.d.ts.map +1 -0
  29. package/dist/FormContainer.js +79 -0
  30. package/dist/FormContainer.js.map +1 -0
  31. package/dist/GPTChat.d.ts.map +1 -1
  32. package/dist/GPTChat.js +2 -1
  33. package/dist/GPTChat.js.map +1 -1
  34. package/dist/Heading.d.ts +1 -1
  35. package/dist/Heading.d.ts.map +1 -1
  36. package/dist/Heading.js +5 -2
  37. package/dist/Heading.js.map +1 -1
  38. package/dist/HeightField.js +8 -8
  39. package/dist/HeightField.js.map +1 -1
  40. package/dist/Icon.d.ts +4 -0
  41. package/dist/Icon.d.ts.map +1 -1
  42. package/dist/Icon.js +43 -2
  43. package/dist/Icon.js.map +1 -1
  44. package/dist/LabeledCheckBox.d.ts +22 -0
  45. package/dist/LabeledCheckBox.d.ts.map +1 -0
  46. package/dist/LabeledCheckBox.js +30 -0
  47. package/dist/LabeledCheckBox.js.map +1 -0
  48. package/dist/ListDetailLayout.d.ts +36 -0
  49. package/dist/ListDetailLayout.d.ts.map +1 -0
  50. package/dist/ListDetailLayout.js +153 -0
  51. package/dist/ListDetailLayout.js.map +1 -0
  52. package/dist/MarkdownEditor.d.ts.map +1 -1
  53. package/dist/MarkdownEditor.js +2 -1
  54. package/dist/MarkdownEditor.js.map +1 -1
  55. package/dist/MediaQuery.d.ts +1 -1
  56. package/dist/MediaQuery.d.ts.map +1 -1
  57. package/dist/MediaQuery.js +1 -1
  58. package/dist/MediaQuery.js.map +1 -1
  59. package/dist/OtpField.d.ts +60 -0
  60. package/dist/OtpField.d.ts.map +1 -0
  61. package/dist/OtpField.js +154 -0
  62. package/dist/OtpField.js.map +1 -0
  63. package/dist/PickerSelect.js +9 -9
  64. package/dist/PickerSelect.js.map +1 -1
  65. package/dist/ProvisionalConsentSigner.d.ts +21 -0
  66. package/dist/ProvisionalConsentSigner.d.ts.map +1 -0
  67. package/dist/ProvisionalConsentSigner.js +199 -0
  68. package/dist/ProvisionalConsentSigner.js.map +1 -0
  69. package/dist/ResponsiveBreakpoint.d.ts +5 -0
  70. package/dist/ResponsiveBreakpoint.d.ts.map +1 -1
  71. package/dist/ResponsiveBreakpoint.js +7 -0
  72. package/dist/ResponsiveBreakpoint.js.map +1 -1
  73. package/dist/SocialLoginButton.d.ts +10 -0
  74. package/dist/SocialLoginButton.d.ts.map +1 -1
  75. package/dist/SocialLoginButton.js +26 -8
  76. package/dist/SocialLoginButton.js.map +1 -1
  77. package/dist/SplitPage.d.ts +11 -0
  78. package/dist/SplitPage.d.ts.map +1 -1
  79. package/dist/SplitPage.js +11 -5
  80. package/dist/SplitPage.js.map +1 -1
  81. package/dist/SplitPage.native.d.ts.map +1 -1
  82. package/dist/SplitPage.native.js +3 -1
  83. package/dist/SplitPage.native.js.map +1 -1
  84. package/dist/SyncStatusBanner.d.ts +7 -1
  85. package/dist/SyncStatusBanner.d.ts.map +1 -1
  86. package/dist/SyncStatusBanner.js +20 -4
  87. package/dist/SyncStatusBanner.js.map +1 -1
  88. package/dist/TapToEdit.d.ts +1 -1
  89. package/dist/TapToEdit.d.ts.map +1 -1
  90. package/dist/TapToEdit.js.map +1 -1
  91. package/dist/TextField.d.ts.map +1 -1
  92. package/dist/TextField.js +48 -14
  93. package/dist/TextField.js.map +1 -1
  94. package/dist/Theme.d.ts.map +1 -1
  95. package/dist/Theme.js +16 -0
  96. package/dist/Theme.js.map +1 -1
  97. package/dist/fieldElements/FieldError.d.ts.map +1 -1
  98. package/dist/fieldElements/FieldError.js +1 -1
  99. package/dist/fieldElements/FieldError.js.map +1 -1
  100. package/dist/index.d.ts +19 -3
  101. package/dist/index.d.ts.map +1 -1
  102. package/dist/index.js +14 -1
  103. package/dist/index.js.map +1 -1
  104. package/dist/lazyBoundaries/heavyOptionalExports.d.ts +3 -0
  105. package/dist/lazyBoundaries/heavyOptionalExports.d.ts.map +1 -1
  106. package/dist/lazyBoundaries/heavyOptionalExports.js +2 -0
  107. package/dist/lazyBoundaries/heavyOptionalExports.js.map +1 -1
  108. package/dist/login/LastUsedBadge.d.ts +14 -0
  109. package/dist/login/LastUsedBadge.d.ts.map +1 -0
  110. package/dist/login/LastUsedBadge.js +23 -0
  111. package/dist/login/LastUsedBadge.js.map +1 -0
  112. package/dist/login/LoginAccountCard.d.ts +38 -0
  113. package/dist/login/LoginAccountCard.d.ts.map +1 -0
  114. package/dist/login/LoginAccountCard.js +72 -0
  115. package/dist/login/LoginAccountCard.js.map +1 -0
  116. package/dist/login/LoginAccountList.d.ts +33 -0
  117. package/dist/login/LoginAccountList.d.ts.map +1 -0
  118. package/dist/login/LoginAccountList.js +30 -0
  119. package/dist/login/LoginAccountList.js.map +1 -0
  120. package/dist/login/LoginScreen.d.ts +4 -4
  121. package/dist/login/LoginScreen.d.ts.map +1 -1
  122. package/dist/login/LoginScreen.js +294 -13
  123. package/dist/login/LoginScreen.js.map +1 -1
  124. package/dist/login/OutlinePill.d.ts +28 -0
  125. package/dist/login/OutlinePill.d.ts.map +1 -0
  126. package/dist/login/OutlinePill.js +48 -0
  127. package/dist/login/OutlinePill.js.map +1 -0
  128. package/dist/login/TwoFactorChallengeScreen.d.ts +26 -0
  129. package/dist/login/TwoFactorChallengeScreen.d.ts.map +1 -0
  130. package/dist/login/TwoFactorChallengeScreen.js +139 -0
  131. package/dist/login/TwoFactorChallengeScreen.js.map +1 -0
  132. package/dist/login/loginMethods.d.ts +27 -0
  133. package/dist/login/loginMethods.d.ts.map +1 -0
  134. package/dist/login/loginMethods.js +37 -0
  135. package/dist/login/loginMethods.js.map +1 -0
  136. package/dist/login/loginTypes.d.ts +202 -5
  137. package/dist/login/loginTypes.d.ts.map +1 -1
  138. package/dist/pdfHtmlTemplate.d.ts +17 -0
  139. package/dist/pdfHtmlTemplate.d.ts.map +1 -1
  140. package/dist/pdfHtmlTemplate.js +78 -0
  141. package/dist/pdfHtmlTemplate.js.map +1 -1
  142. package/dist/security/AccountSecurityScreen.d.ts +10 -0
  143. package/dist/security/AccountSecurityScreen.d.ts.map +1 -0
  144. package/dist/security/AccountSecurityScreen.js +50 -0
  145. package/dist/security/AccountSecurityScreen.js.map +1 -0
  146. package/dist/security/LinkedAccountsCard.d.ts +32 -0
  147. package/dist/security/LinkedAccountsCard.d.ts.map +1 -0
  148. package/dist/security/LinkedAccountsCard.js +145 -0
  149. package/dist/security/LinkedAccountsCard.js.map +1 -0
  150. package/dist/security/PasskeysCard.d.ts +39 -0
  151. package/dist/security/PasskeysCard.d.ts.map +1 -0
  152. package/dist/security/PasskeysCard.js +168 -0
  153. package/dist/security/PasskeysCard.js.map +1 -0
  154. package/dist/security/PasswordCard.d.ts +32 -0
  155. package/dist/security/PasswordCard.d.ts.map +1 -0
  156. package/dist/security/PasswordCard.js +198 -0
  157. package/dist/security/PasswordCard.js.map +1 -0
  158. package/dist/security/SessionsCard.d.ts +39 -0
  159. package/dist/security/SessionsCard.d.ts.map +1 -0
  160. package/dist/security/SessionsCard.js +168 -0
  161. package/dist/security/SessionsCard.js.map +1 -0
  162. package/dist/security/TwoFactorSettingsCard.d.ts +55 -0
  163. package/dist/security/TwoFactorSettingsCard.d.ts.map +1 -0
  164. package/dist/security/TwoFactorSettingsCard.js +458 -0
  165. package/dist/security/TwoFactorSettingsCard.js.map +1 -0
  166. package/dist/security/securityMethods.d.ts +40 -0
  167. package/dist/security/securityMethods.d.ts.map +1 -0
  168. package/dist/security/securityMethods.js +66 -0
  169. package/dist/security/securityMethods.js.map +1 -0
  170. package/dist/security/securityTypes.d.ts +467 -0
  171. package/dist/security/securityTypes.d.ts.map +1 -0
  172. package/dist/security/securityTypes.js +2 -0
  173. package/dist/security/securityTypes.js.map +1 -0
  174. package/dist/security/userAgent.d.ts +26 -0
  175. package/dist/security/userAgent.d.ts.map +1 -0
  176. package/dist/security/userAgent.js +80 -0
  177. package/dist/security/userAgent.js.map +1 -0
  178. package/dist/signUp/OAuthButtons.d.ts +28 -5
  179. package/dist/signUp/OAuthButtons.d.ts.map +1 -1
  180. package/dist/signUp/OAuthButtons.js +44 -5
  181. package/dist/signUp/OAuthButtons.js.map +1 -1
  182. package/dist/signUp/SignUpScreen.d.ts.map +1 -1
  183. package/dist/signUp/SignUpScreen.js +50 -5
  184. package/dist/signUp/SignUpScreen.js.map +1 -1
  185. package/dist/signUp/signUpTypes.d.ts +21 -1
  186. package/dist/signUp/signUpTypes.d.ts.map +1 -1
  187. package/dist/useConsentForms.d.ts +9 -0
  188. package/dist/useConsentForms.d.ts.map +1 -1
  189. package/dist/useConsentForms.js +18 -0
  190. package/dist/useConsentForms.js.map +1 -1
  191. package/dist/useProvisionalConsent.d.ts +124 -0
  192. package/dist/useProvisionalConsent.d.ts.map +1 -0
  193. package/dist/useProvisionalConsent.js +79 -0
  194. package/dist/useProvisionalConsent.js.map +1 -0
  195. package/package.json +5 -2
  196. package/src/Accordion.test.tsx +5 -0
  197. package/src/Accordion.tsx +3 -8
  198. package/src/ActionSheet.test.tsx +13 -13
  199. package/src/AddressField.test.tsx +9 -3
  200. package/src/AnnouncementNavigator.test.tsx +4 -4
  201. package/src/AreaChart.test.tsx +15 -0
  202. package/src/Avatar.test.tsx +8 -0
  203. package/src/Avatar.tsx +2 -0
  204. package/src/Badge.test.tsx +1 -1
  205. package/src/Banner.test.tsx +0 -1
  206. package/src/BarChart.test.tsx +15 -0
  207. package/src/Box.test.tsx +143 -75
  208. package/src/Box.tsx +44 -2
  209. package/src/Button.test.tsx +11 -6
  210. package/src/Card.test.tsx +2 -2
  211. package/src/Card.tsx +2 -2
  212. package/src/Common.ts +194 -36
  213. package/src/ConflictSheet.test.tsx +5 -5
  214. package/src/ConsentFormScreen.test.tsx +87 -1
  215. package/src/ConsentFormScreen.tsx +28 -4
  216. package/src/ConsentNavigator.test.tsx +1 -2
  217. package/src/CustomSelectField.test.tsx +16 -4
  218. package/src/DataTable.test.tsx +4 -4
  219. package/src/DataTableVirtualizationRegression.test.tsx +1 -0
  220. package/src/DateTimeActionSheet.test.tsx +2 -0
  221. package/src/DateTimeField.test.tsx +3 -12
  222. package/src/DateTimeField.tsx +11 -9
  223. package/src/DismissButton.test.tsx +22 -4
  224. package/src/DonutChart.test.tsx +15 -0
  225. package/src/EmailField.test.tsx +13 -22
  226. package/src/EmojiSelector.test.tsx +2 -2
  227. package/src/ErrorBoundary.test.tsx +5 -3
  228. package/src/Field.test.tsx +20 -44
  229. package/src/Field.tsx +2 -0
  230. package/src/FilePickerButton.test.tsx +35 -0
  231. package/src/FormContainer.test.tsx +242 -0
  232. package/src/FormContainer.tsx +177 -0
  233. package/src/GPTChat.test.tsx +40 -16
  234. package/src/GPTChat.tsx +8 -2
  235. package/src/Heading.test.tsx +15 -1
  236. package/src/Heading.tsx +6 -1
  237. package/src/HeightField.tsx +8 -8
  238. package/src/Icon.test.tsx +54 -3
  239. package/src/Icon.tsx +92 -3
  240. package/src/IconButton.test.tsx +85 -0
  241. package/src/Image.test.tsx +1 -1
  242. package/src/LabeledCheckBox.test.tsx +45 -0
  243. package/src/LabeledCheckBox.tsx +89 -0
  244. package/src/Link.test.tsx +11 -4
  245. package/src/ListDetailLayout.tsx +247 -0
  246. package/src/MarkdownEditor.tsx +2 -1
  247. package/src/MarkdownView.test.tsx +1 -1
  248. package/src/MediaQuery.ts +1 -0
  249. package/src/MobileAddressAutoComplete.test.tsx +2 -1
  250. package/src/Modal.test.tsx +7 -2
  251. package/src/ModalSheet.test.tsx +5 -4
  252. package/src/MultiselectField.test.tsx +17 -3
  253. package/src/NumberField.test.tsx +14 -14
  254. package/src/NumberPickerActionSheet.test.tsx +1 -1
  255. package/src/OpenAPIContext.test.tsx +4 -4
  256. package/src/OpenAPIRenderRegression.test.tsx +1 -1
  257. package/src/OtpField.test.tsx +280 -0
  258. package/src/OtpField.tsx +307 -0
  259. package/src/P0RenderRegression.test.tsx +7 -1
  260. package/src/P1RenderRegression.test.tsx +1 -0
  261. package/src/P2ButtonRenderRegression.test.tsx +1 -0
  262. package/src/Page.test.tsx +1 -1
  263. package/src/PhoneNumberField.test.tsx +14 -38
  264. package/src/PickerSelect.tsx +9 -9
  265. package/src/Popover.test.tsx +2 -2
  266. package/src/ProvisionalConsentSigner.test.tsx +625 -0
  267. package/src/ProvisionalConsentSigner.tsx +423 -0
  268. package/src/RadioField.test.tsx +7 -2
  269. package/src/ResponsiveBreakpoint.test.tsx +7 -0
  270. package/src/ResponsiveBreakpoint.tsx +14 -0
  271. package/src/RootImportRegression.test.tsx +3 -0
  272. package/src/SegmentedControl.test.tsx +21 -12
  273. package/src/SidebarNavigation.test.tsx +18 -6
  274. package/src/Signature.test.tsx +20 -23
  275. package/src/Slider.test.tsx +1 -1
  276. package/src/SocialLoginButton.test.tsx +14 -0
  277. package/src/SocialLoginButton.tsx +51 -7
  278. package/src/SplitPage.native.tsx +3 -1
  279. package/src/SplitPage.test.tsx +15 -5
  280. package/src/SplitPage.tsx +11 -5
  281. package/src/SyncStatusBanner.test.tsx +61 -4
  282. package/src/SyncStatusBanner.tsx +29 -3
  283. package/src/TapToEdit.test.tsx +38 -15
  284. package/src/TapToEdit.tsx +1 -1
  285. package/src/TerrenoFontProvider.test.tsx +1 -1
  286. package/src/Text.test.tsx +4 -4
  287. package/src/TextField.test.tsx +232 -9
  288. package/src/TextField.tsx +70 -12
  289. package/src/Theme.test.tsx +49 -0
  290. package/src/Theme.tsx +16 -0
  291. package/src/Toast.test.tsx +5 -5
  292. package/src/ToastNotifications.test.tsx +73 -70
  293. package/src/ToastNotifications.webModal.test.tsx +2 -2
  294. package/src/Tooltip.test.tsx +3 -3
  295. package/src/UnifiedAddressAutoComplete.test.tsx +1 -1
  296. package/src/UserInactivity.test.tsx +4 -2
  297. package/src/WebAddressAutocomplete.test.tsx +12 -12
  298. package/src/WebDropdownMenu.test.tsx +16 -15
  299. package/src/__snapshots__/AddressField.test.tsx.snap +12 -0
  300. package/src/__snapshots__/AiSuggestionBox.test.tsx.snap +15 -0
  301. package/src/__snapshots__/Avatar.test.tsx.snap +1 -0
  302. package/src/__snapshots__/Card.test.tsx.snap +1 -1
  303. package/src/__snapshots__/CustomSelectField.test.tsx.snap +3 -0
  304. package/src/__snapshots__/DismissButton.test.tsx.snap +3 -3
  305. package/src/__snapshots__/EmailField.test.tsx.snap +6 -0
  306. package/src/__snapshots__/Field.test.tsx.snap +41 -2
  307. package/src/__snapshots__/Heading.test.tsx.snap +1 -1
  308. package/src/__snapshots__/HeightField.test.tsx.snap +2 -0
  309. package/src/__snapshots__/Image.test.tsx.snap +1 -1
  310. package/src/__snapshots__/MobileAddressAutoComplete.test.tsx.snap +3 -0
  311. package/src/__snapshots__/NumberField.test.tsx.snap +3 -0
  312. package/src/__snapshots__/Page.test.tsx.snap +2 -2
  313. package/src/__snapshots__/PhoneNumberField.test.tsx.snap +12 -0
  314. package/src/__snapshots__/Slider.test.tsx.snap +1 -0
  315. package/src/__snapshots__/SocialLoginButton.test.tsx.snap +43 -22
  316. package/src/__snapshots__/TapToEdit.test.tsx.snap +3 -0
  317. package/src/__snapshots__/Text.test.tsx.snap +1 -1
  318. package/src/__snapshots__/TextArea.test.tsx.snap +17 -1
  319. package/src/__snapshots__/TextField.test.tsx.snap +19 -2
  320. package/src/__snapshots__/TypedSignatureField.test.tsx.snap +3 -0
  321. package/src/__snapshots__/UnifiedAddressAutoComplete.test.tsx.snap +18 -0
  322. package/src/__snapshots__/WebAddressAutocomplete.test.tsx.snap +12 -0
  323. package/src/asks/AskCard.test.tsx +16 -13
  324. package/src/asks/AskFiles.test.tsx +5 -1
  325. package/src/asks/askFileRefs.test.ts +1 -1
  326. package/src/asks/askSummary.test.ts +2 -2
  327. package/src/benchmarks/importTiming.ts +1 -1
  328. package/src/blocks/BlocksView.test.tsx +20 -11
  329. package/src/bunSetup.ts +14 -2
  330. package/src/dataTableFilters.test.tsx +1 -1
  331. package/src/fieldElements/FieldError.tsx +1 -0
  332. package/src/fieldElements/__snapshots__/FieldError.test.tsx.snap +2 -0
  333. package/src/index.tsx +42 -1
  334. package/src/isolated/ListDetailLayout.isolated.tsx +632 -0
  335. package/src/lazyBoundaries/heavyOptionalExports.tsx +7 -0
  336. package/src/login/LastUsedBadge.tsx +40 -0
  337. package/src/login/LoginAccountCard.tsx +205 -0
  338. package/src/login/LoginAccountList.tsx +115 -0
  339. package/src/login/LoginScreen.test.tsx +839 -3
  340. package/src/login/LoginScreen.tsx +674 -91
  341. package/src/login/OutlinePill.tsx +110 -0
  342. package/src/login/TwoFactorChallengeScreen.test.tsx +376 -0
  343. package/src/login/TwoFactorChallengeScreen.tsx +307 -0
  344. package/src/login/__snapshots__/LoginScreen.test.tsx.snap +1454 -334
  345. package/src/login/loginMethods.test.ts +53 -0
  346. package/src/login/loginMethods.ts +60 -0
  347. package/src/login/loginTypes.ts +208 -5
  348. package/src/pdfHtmlTemplate.test.ts +243 -4
  349. package/src/pdfHtmlTemplate.ts +93 -0
  350. package/src/security/AccountSecurityScreen.test.tsx +262 -0
  351. package/src/security/AccountSecurityScreen.tsx +156 -0
  352. package/src/security/LinkedAccountsCard.test.tsx +371 -0
  353. package/src/security/LinkedAccountsCard.tsx +297 -0
  354. package/src/security/PasskeysCard.test.tsx +378 -0
  355. package/src/security/PasskeysCard.tsx +371 -0
  356. package/src/security/PasswordCard.test.tsx +445 -0
  357. package/src/security/PasswordCard.tsx +342 -0
  358. package/src/security/SessionsCard.test.tsx +349 -0
  359. package/src/security/SessionsCard.tsx +362 -0
  360. package/src/security/TwoFactorSettingsCard.test.tsx +700 -0
  361. package/src/security/TwoFactorSettingsCard.tsx +872 -0
  362. package/src/security/securityMethods.test.ts +101 -0
  363. package/src/security/securityMethods.ts +104 -0
  364. package/src/security/securityTypes.ts +480 -0
  365. package/src/security/userAgent.test.ts +119 -0
  366. package/src/security/userAgent.ts +102 -0
  367. package/src/signUp/OAuthButtons.test.tsx +27 -0
  368. package/src/signUp/OAuthButtons.tsx +153 -19
  369. package/src/signUp/SignUpScreen.test.tsx +171 -2
  370. package/src/signUp/SignUpScreen.tsx +87 -25
  371. package/src/signUp/__snapshots__/SignUpScreen.test.tsx.snap +22 -11
  372. package/src/signUp/signUpTypes.ts +23 -1
  373. package/src/table/tableContext.test.tsx +5 -5
  374. package/src/test-utils.tsx +56 -1
  375. package/src/testing/reactDomServer.d.ts +7 -0
  376. package/src/useConsentForms.test.ts +38 -2
  377. package/src/useConsentForms.ts +25 -0
  378. package/src/useProvisionalConsent.test.ts +256 -0
  379. package/src/useProvisionalConsent.ts +218 -0
@@ -1,8 +1,11 @@
1
1
  import type {FC} from "react";
2
- import {useCallback, useState} from "react";
2
+ import {useCallback, useRef, useState} from "react";
3
+ import type {TextInput} from "react-native";
3
4
 
4
5
  import {Box} from "../Box";
5
6
  import {Button} from "../Button";
7
+ import type {TextFieldProps} from "../Common";
8
+ import {FormContainer, type FormContainerHandle} from "../FormContainer";
6
9
  import {Heading} from "../Heading";
7
10
  import {Page} from "../Page";
8
11
  import {Text} from "../Text";
@@ -10,7 +13,22 @@ import {TextField} from "../TextField";
10
13
  import {OAuthButtons} from "./OAuthButtons";
11
14
  import {PasswordRequirements} from "./PasswordRequirements";
12
15
  import {Swiper} from "./Swiper";
13
- import type {SignUpScreenProps} from "./signUpTypes";
16
+ import type {SignUpFieldConfig, SignUpScreenProps} from "./signUpTypes";
17
+
18
+ /**
19
+ * The autofill hint for a field: its own hint, else "username" for the email field (password
20
+ * managers save it with the new password) and "new-password" for password fields (browsers and
21
+ * iOS then offer a strong password).
22
+ */
23
+ const getFieldAutoComplete = (field: SignUpFieldConfig): TextFieldProps["autoComplete"] => {
24
+ if (field.autoComplete) {
25
+ return field.autoComplete;
26
+ }
27
+ if (field.type === "email" || field.name === "email") {
28
+ return "username";
29
+ }
30
+ return field.type === "password" ? "new-password" : undefined;
31
+ };
14
32
 
15
33
  /**
16
34
  * A configurable sign-up screen component with support for custom fields,
@@ -61,10 +79,6 @@ export const SignUpScreen: FC<SignUpScreenProps> = ({
61
79
  setFormValues((prev) => ({...prev, [fieldName]: value}));
62
80
  }, []);
63
81
 
64
- const handleSubmit = useCallback(async () => {
65
- await onSubmit(formValues);
66
- }, [formValues, onSubmit]);
67
-
68
82
  const passwordField = fields.find((f) => f.type === "password");
69
83
  const passwordValue = passwordField ? (formValues[passwordField.name] ?? "") : "";
70
84
 
@@ -79,6 +93,36 @@ export const SignUpScreen: FC<SignUpScreenProps> = ({
79
93
 
80
94
  const isSubmitDisabled = loading || !requiredFieldsFilled || !allRequirementsMet;
81
95
 
96
+ const formRef = useRef<FormContainerHandle>(null);
97
+ const inputRefs = useRef<Record<string, TextInput | null>>({});
98
+ // Blocks a second submission (Enter plus a press, or a double Enter) before `loading` lands.
99
+ const isSubmittingRef = useRef(false);
100
+
101
+ // Every submission (Enter, the Sign Up button, or the browser) arrives here through the form.
102
+ const handleSubmit = useCallback(async (): Promise<void> => {
103
+ if (isSubmitDisabled || isSubmittingRef.current) {
104
+ return;
105
+ }
106
+ isSubmittingRef.current = true;
107
+ try {
108
+ await onSubmit(formValues);
109
+ } finally {
110
+ isSubmittingRef.current = false;
111
+ }
112
+ }, [formValues, isSubmitDisabled, onSubmit]);
113
+
114
+ // On web this goes through the <form>, so password managers see a real submit.
115
+ const requestSubmit = useCallback(async (): Promise<void> => {
116
+ if (isSubmitDisabled) {
117
+ return;
118
+ }
119
+ await formRef.current?.requestSubmit();
120
+ }, [isSubmitDisabled]);
121
+
122
+ const focusField = useCallback((fieldName: string): void => {
123
+ inputRefs.current[fieldName]?.focus();
124
+ }, []);
125
+
82
126
  return (
83
127
  <Page navigation={undefined}>
84
128
  <Box
@@ -103,23 +147,41 @@ export const SignUpScreen: FC<SignUpScreenProps> = ({
103
147
  <Heading testID={`${testID}-title`}>{title}</Heading>
104
148
  </Box>
105
149
 
106
- <Box gap={4} width="100%">
107
- {fields.map((field) => (
108
- <TextField
109
- autoComplete={field.autoComplete}
110
- disabled={loading}
111
- id={`${testID}-${field.name}-input`}
112
- key={field.name}
113
- onChange={(value: string) => handleFieldChange(field.name, value)}
114
- placeholder={field.placeholder ?? field.label}
115
- testID={`${testID}-${field.name}-input`}
116
- title={field.label}
117
- type={
118
- field.type === "email" ? "email" : field.type === "password" ? "password" : "text"
119
- }
120
- value={formValues[field.name]}
121
- />
122
- ))}
150
+ <FormContainer
151
+ accessibilityLabel={title}
152
+ gap={4}
153
+ onSubmit={handleSubmit}
154
+ ref={formRef}
155
+ testID={`${testID}-form`}
156
+ width="100%"
157
+ >
158
+ {fields.map((field, index) => {
159
+ // Enter moves to the next field; in the last field it submits.
160
+ const nextField = fields[index + 1];
161
+ return (
162
+ <TextField
163
+ accessibilityLabel={field.label}
164
+ autoComplete={getFieldAutoComplete(field)}
165
+ blurOnSubmit={!nextField}
166
+ disabled={loading}
167
+ id={`${testID}-${field.name}-input`}
168
+ inputRef={(ref) => {
169
+ inputRefs.current[field.name] = ref;
170
+ }}
171
+ key={field.name}
172
+ onChange={(value: string) => handleFieldChange(field.name, value)}
173
+ onEnter={nextField ? () => focusField(nextField.name) : requestSubmit}
174
+ placeholder={field.placeholder ?? field.label}
175
+ returnKeyType={nextField ? "next" : "go"}
176
+ testID={`${testID}-${field.name}-input`}
177
+ title={field.label}
178
+ type={
179
+ field.type === "email" ? "email" : field.type === "password" ? "password" : "text"
180
+ }
181
+ value={formValues[field.name]}
182
+ />
183
+ );
184
+ })}
123
185
 
124
186
  {Boolean(passwordRequirements && passwordRequirements.length > 0 && passwordField) && (
125
187
  <PasswordRequirements
@@ -140,7 +202,7 @@ export const SignUpScreen: FC<SignUpScreenProps> = ({
140
202
  disabled={isSubmitDisabled}
141
203
  fullWidth
142
204
  loading={loading}
143
- onClick={handleSubmit}
205
+ onClick={requestSubmit}
144
206
  testID={`${testID}-submit-button`}
145
207
  text="Sign Up"
146
208
  />
@@ -166,7 +228,7 @@ export const SignUpScreen: FC<SignUpScreenProps> = ({
166
228
  testID={`${testID}-oauth`}
167
229
  />
168
230
  )}
169
- </Box>
231
+ </FormContainer>
170
232
  </Box>
171
233
  </Page>
172
234
  );
@@ -82,11 +82,13 @@ exports[`SignUpScreen renders correctly with all props 1`] = `
82
82
  "accessibilityState": {
83
83
  "disabled": true,
84
84
  },
85
- "aria-label": "Text input field",
85
+ "aria-describedby": undefined,
86
+ "aria-invalid": false,
87
+ "aria-label": "Name",
86
88
  "autoCapitalize": "sentences",
87
89
  "autoCorrect": true,
88
- "blurOnSubmit": true,
89
- "enterKeyHint": undefined,
90
+ "blurOnSubmit": false,
91
+ "enterKeyHint": "next",
90
92
  "keyboardType": "default",
91
93
  "multiline": undefined,
92
94
  "nativeID": "signup-screen-name-input",
@@ -108,6 +110,7 @@ exports[`SignUpScreen renders correctly with all props 1`] = `
108
110
  "fontSize": 16,
109
111
  "gap": 10,
110
112
  "height": 24,
113
+ "letterSpacing": undefined,
111
114
  "paddingVertical": 0,
112
115
  "width": "100%",
113
116
  },
@@ -188,11 +191,14 @@ exports[`SignUpScreen renders correctly with all props 1`] = `
188
191
  "accessibilityState": {
189
192
  "disabled": true,
190
193
  },
191
- "aria-label": "Text input field",
194
+ "aria-describedby": undefined,
195
+ "aria-invalid": false,
196
+ "aria-label": "Email",
192
197
  "autoCapitalize": "none",
198
+ "autoComplete": "username",
193
199
  "autoCorrect": false,
194
- "blurOnSubmit": true,
195
- "enterKeyHint": undefined,
200
+ "blurOnSubmit": false,
201
+ "enterKeyHint": "next",
196
202
  "keyboardType": "email-address",
197
203
  "multiline": undefined,
198
204
  "nativeID": "signup-screen-email-input",
@@ -214,11 +220,12 @@ exports[`SignUpScreen renders correctly with all props 1`] = `
214
220
  "fontSize": 16,
215
221
  "gap": 10,
216
222
  "height": 24,
223
+ "letterSpacing": undefined,
217
224
  "paddingVertical": 0,
218
225
  "width": "100%",
219
226
  },
220
227
  "testID": "signup-screen-email-input",
221
- "textContentType": "emailAddress",
228
+ "textContentType": "username",
222
229
  "underlineColorAndroid": "transparent",
223
230
  "value": "",
224
231
  },
@@ -294,11 +301,14 @@ exports[`SignUpScreen renders correctly with all props 1`] = `
294
301
  "accessibilityState": {
295
302
  "disabled": true,
296
303
  },
297
- "aria-label": "Text input field",
304
+ "aria-describedby": undefined,
305
+ "aria-invalid": false,
306
+ "aria-label": "Password",
298
307
  "autoCapitalize": "none",
308
+ "autoComplete": "new-password",
299
309
  "autoCorrect": false,
300
310
  "blurOnSubmit": true,
301
- "enterKeyHint": undefined,
311
+ "enterKeyHint": "go",
302
312
  "keyboardType": "default",
303
313
  "multiline": undefined,
304
314
  "nativeID": "signup-screen-password-input",
@@ -320,11 +330,12 @@ exports[`SignUpScreen renders correctly with all props 1`] = `
320
330
  "fontSize": 16,
321
331
  "gap": 10,
322
332
  "height": 24,
333
+ "letterSpacing": undefined,
323
334
  "paddingVertical": 0,
324
335
  "width": "100%",
325
336
  },
326
337
  "testID": "signup-screen-password-input",
327
- "textContentType": "password",
338
+ "textContentType": "newPassword",
328
339
  "underlineColorAndroid": "transparent",
329
340
  "value": "",
330
341
  },
@@ -838,7 +849,7 @@ exports[`SignUpScreen renders correctly with all props 1`] = `
838
849
  "gap": 16,
839
850
  "width": "100%",
840
851
  },
841
- "testID": undefined,
852
+ "testID": "signup-screen-form",
842
853
  },
843
854
  "type": "View",
844
855
  },
@@ -1,5 +1,7 @@
1
1
  import type {ReactNode} from "react";
2
2
 
3
+ import type {IconName} from "../Common";
4
+
3
5
  /**
4
6
  * Supported OAuth providers for social login buttons.
5
7
  */
@@ -19,6 +21,26 @@ export interface OAuthProviderConfig {
19
21
  disabled?: boolean;
20
22
  }
21
23
 
24
+ /**
25
+ * Configuration for a sign-in provider without a branded `SocialLoginButton`, such as a Better
26
+ * Auth generic OAuth/OIDC provider (`mock-oidc`, a company SSO). It renders as an outline
27
+ * `Button` reading "Continue with {label}".
28
+ */
29
+ export interface GenericOAuthProviderConfig {
30
+ /** Provider id, matching the id passed to `signIn.social` and to `lastUsedMethod`. */
31
+ id: string;
32
+ /** Display name. The button reads "Continue with {label}". */
33
+ label: string;
34
+ /** Callback triggered when the provider button is pressed. */
35
+ onPress: () => Promise<void>;
36
+ /** Whether the button is in a loading state. */
37
+ loading?: boolean;
38
+ /** Whether the button is disabled. */
39
+ disabled?: boolean;
40
+ /** Optional FontAwesome icon shown before the label. */
41
+ iconName?: IconName;
42
+ }
43
+
22
44
  /**
23
45
  * Configuration for a sign-up form field.
24
46
  */
@@ -34,7 +56,7 @@ export interface SignUpFieldConfig {
34
56
  /** Whether the field is required. */
35
57
  required?: boolean;
36
58
  /** Auto-complete hint for the field. */
37
- autoComplete?: "current-password" | "on" | "off" | "username";
59
+ autoComplete?: "current-password" | "email" | "new-password" | "on" | "off" | "username";
38
60
  }
39
61
 
40
62
  /**
@@ -37,7 +37,7 @@ describe("tableContext", () => {
37
37
  expect(ctx.hasDrawerContents).toBe(false);
38
38
  expect(typeof ctx.setSortColumn).toBe("function");
39
39
  // Invoke default setSortColumn to cover the no-op default
40
- expect(() => ctx.setSortColumn({column: 0, direction: "asc"})).not.toThrow();
40
+ expect(() => ctx.setSortColumn!({column: 0, direction: "asc"})).not.toThrow();
41
41
  });
42
42
 
43
43
  it("passes provided values through the provider", () => {
@@ -46,7 +46,7 @@ describe("tableContext", () => {
46
46
  render(
47
47
  <TableContextProvider
48
48
  alternateRowBackground={false}
49
- borderStyle="lg"
49
+ borderStyle="none"
50
50
  columns={[100, 200]}
51
51
  hasDrawerContents
52
52
  page={3}
@@ -62,9 +62,9 @@ describe("tableContext", () => {
62
62
  expect(ctx.hasDrawerContents).toBe(true);
63
63
  expect(ctx.stickyHeader).toBe(false);
64
64
  expect(ctx.alternateRowBackground).toBe(false);
65
- expect(ctx.borderStyle).toBe("lg");
65
+ expect(ctx.borderStyle).toBe("none");
66
66
  expect(ctx.sortColumn).toEqual({column: 1, direction: "desc"});
67
- ctx.setSortColumn({column: 0, direction: "asc"});
67
+ ctx.setSortColumn!({column: 0, direction: "asc"});
68
68
  expect(setSortColumn).toHaveBeenCalled();
69
69
  });
70
70
 
@@ -73,7 +73,7 @@ describe("tableContext", () => {
73
73
  const Consumer = () => {
74
74
  const {setSortColumn: setter} = useTableContext();
75
75
  useEffect(() => {
76
- setter({column: 2, direction: "desc"});
76
+ setter!({column: 2, direction: "desc"});
77
77
  }, [setter]);
78
78
  return <Text>ok</Text>;
79
79
  };
@@ -1,7 +1,9 @@
1
1
  import {mock} from "bun:test";
2
2
  import {render} from "@testing-library/react-native";
3
+ import type {JestNativeMatchers} from "@testing-library/react-native/build/matchers/types";
3
4
  import type React from "react";
4
5
  import {View} from "react-native";
6
+ import type {ReactTestInstance, ReactTestRendererJSON} from "react-test-renderer";
5
7
 
6
8
  import type {CustomIconProps, IconRegistryMap} from "./Common";
7
9
  import {IconRegistryProvider} from "./IconRegistry";
@@ -15,6 +17,12 @@ declare module "./Common" {
15
17
  }
16
18
  }
17
19
 
20
+ // @testing-library/react-native registers its matchers (toHaveStyle, toHaveProp, ...) on the
21
+ // global expect at import time; expose their types on bun:test's expect as well.
22
+ declare module "bun:test" {
23
+ interface Matchers<T> extends JestNativeMatchers<void> {}
24
+ }
25
+
18
26
  export const TEST_CUSTOM_ICON_TEST_ID = "test-custom-icon";
19
27
 
20
28
  export const TestCustomIcon: React.FC<CustomIconProps> = ({size, testID}) => {
@@ -42,7 +50,7 @@ export const renderWithIcons = (
42
50
 
43
51
  export const createCommonMocks = () => ({
44
52
  onBlur: mock(() => {}),
45
- onChange: mock(() => {}),
53
+ onChange: mock((_value: string) => {}),
46
54
  onEnter: mock(() => {}),
47
55
  onFocus: mock(() => {}),
48
56
  onIconClick: mock(() => {}),
@@ -57,3 +65,50 @@ export const teardownComponentTest = () => {
57
65
  // In Bun, mocks are automatically cleaned up
58
66
  // No-op for compatibility
59
67
  };
68
+
69
+ /**
70
+ * Host element name (e.g. "View") of a test-renderer node. The react-native mock in bunSetup.ts
71
+ * renders string host types that React's DOM-only JSX typings do not list, so read it as a string.
72
+ */
73
+ const hostTypeName = (node: ReactTestInstance): string | undefined => {
74
+ const type: unknown = node.type;
75
+ return typeof type === "string" ? type : undefined;
76
+ };
77
+
78
+ const isHostType = (node: ReactTestInstance, name: string): boolean => {
79
+ return hostTypeName(node) === name;
80
+ };
81
+
82
+ /** Typed equivalent of `root.findByType("View")` for string host types. */
83
+ export const findByHostType = (root: ReactTestInstance, name: string): ReactTestInstance => {
84
+ return root.find((node) => isHostType(node, name));
85
+ };
86
+
87
+ /** Typed equivalent of `root.findAllByType("View")` for string host types. */
88
+ export const findAllByHostType = (
89
+ root: ReactTestInstance,
90
+ name: string,
91
+ options?: {deep: boolean}
92
+ ): ReactTestInstance[] => {
93
+ return root.findAll((node) => isHostType(node, name), options);
94
+ };
95
+
96
+ /**
97
+ * Props of a React element handed to `createNodeMock` or returned from a render method. React
98
+ * types element props as `unknown`; tests read the few host props they inspect through this.
99
+ */
100
+ export const elementProps = <P extends object = Record<string, unknown>>(
101
+ element: React.ReactElement
102
+ ): Partial<P> => {
103
+ return (element.props ?? {}) as Partial<P>;
104
+ };
105
+
106
+ /** Narrows a `toJSON()` result to its single root node; fails when the render has several roots. */
107
+ export const rootJSONNode = (
108
+ tree: ReactTestRendererJSON | ReactTestRendererJSON[] | null
109
+ ): ReactTestRendererJSON | null => {
110
+ if (Array.isArray(tree)) {
111
+ throw new Error(`Expected a single root node, got ${tree.length}`);
112
+ }
113
+ return tree;
114
+ };
@@ -0,0 +1,7 @@
1
+ // ResponsiveBreakpoint.test.tsx renders through react-dom/server to cover the SSR path, and the
2
+ // workspace does not install @types/react-dom. Declare only the entry point the tests use.
3
+ declare module "react-dom/server" {
4
+ import type {ReactNode} from "react";
5
+
6
+ export const renderToString: (element: ReactNode) => string;
7
+ }
@@ -2,7 +2,12 @@ import {describe, expect, it, mock} from "bun:test";
2
2
  import {renderHook} from "@testing-library/react-native";
3
3
 
4
4
  import type {ConsentFormPublic} from "./useConsentForms";
5
- import {detectLocale, useConsentForms} from "./useConsentForms";
5
+ import {
6
+ applyConsentVariables,
7
+ detectLocale,
8
+ resolveConsentLocale,
9
+ useConsentForms,
10
+ } from "./useConsentForms";
6
11
 
7
12
  type ConsentFormsApi = Parameters<typeof useConsentForms>[0];
8
13
 
@@ -13,7 +18,7 @@ interface GlobalThisWithNavigator {
13
18
  interface MockQueryDef {
14
19
  onQueryStarted?: (
15
20
  _arg: unknown,
16
- helpers: {queryFulfilled: Promise<{data: ConsentFormPublic[]}> | Promise<never>}
21
+ helpers: {queryFulfilled: Promise<{data: Partial<ConsentFormPublic>[]}> | Promise<never>}
17
22
  ) => Promise<void>;
18
23
  query: () => string;
19
24
  }
@@ -26,6 +31,37 @@ mock.module("expo-localization", () => ({
26
31
  getLocales: () => [{languageTag: "es-ES"}],
27
32
  }));
28
33
 
34
+ describe("resolveConsentLocale", () => {
35
+ const form = {
36
+ content: {en: "Hi", "pt-BR": "Oi"},
37
+ defaultLocale: "en",
38
+ } as unknown as ConsentFormPublic;
39
+
40
+ it("uses the exact locale when the form has it", () => {
41
+ expect(resolveConsentLocale(form, "pt-BR")).toBe("pt-BR");
42
+ });
43
+
44
+ it("falls back to the language when the exact locale is missing", () => {
45
+ expect(resolveConsentLocale(form, "en-GB")).toBe("en");
46
+ });
47
+
48
+ it("falls back to the form default otherwise", () => {
49
+ expect(resolveConsentLocale(form, "fr-FR")).toBe("en");
50
+ });
51
+ });
52
+
53
+ describe("applyConsentVariables", () => {
54
+ it("replaces known placeholders and keeps unknown ones", () => {
55
+ expect(applyConsentVariables("Hi {{name}}, {{missing}}", {name: "Ada"})).toBe(
56
+ "Hi Ada, {{missing}}"
57
+ );
58
+ });
59
+
60
+ it("returns content unchanged without variables", () => {
61
+ expect(applyConsentVariables("Hi {{name}}")).toBe("Hi {{name}}");
62
+ });
63
+ });
64
+
29
65
  describe("detectLocale", () => {
30
66
  it("returns locale from expo-localization in native test env", () => {
31
67
  const g = globalThis as unknown as GlobalThisWithNavigator;
@@ -15,6 +15,8 @@ export interface ConsentFormPublic {
15
15
  allowDecline: boolean;
16
16
  declineButtonText: string;
17
17
  required: boolean;
18
+ /** Set when staff signed this form provisionally for the user; the user still signs it. */
19
+ provisionalSignature?: {signedAt: string; signedByName: string};
18
20
  }
19
21
 
20
22
  import {getLocales} from "expo-localization";
@@ -56,6 +58,29 @@ interface ConsentFormsApi {
56
58
  enhanceEndpoints: (options: {addTagTypes: string[]}) => ConsentFormsApiWithTags;
57
59
  }
58
60
 
61
+ /** Replace `{{name}}` placeholders in consent content; unknown placeholders stay as written. */
62
+ export const applyConsentVariables = (
63
+ content: string,
64
+ variables?: Record<string, string>
65
+ ): string => {
66
+ if (!variables) {
67
+ return content;
68
+ }
69
+ return content.replace(/\{\{(\w+)\}\}/g, (match, key) => variables[key] ?? match);
70
+ };
71
+
72
+ /** The content locale to show: the exact locale, then its language, then the form default. */
73
+ export const resolveConsentLocale = (form: ConsentFormPublic, locale: string): string => {
74
+ if (form.content[locale] !== undefined) {
75
+ return locale;
76
+ }
77
+ const language = locale.split("-")[0];
78
+ if (form.content[language] !== undefined) {
79
+ return language;
80
+ }
81
+ return form.defaultLocale;
82
+ };
83
+
59
84
  export const detectLocale = (): string => {
60
85
  // Web
61
86
  if (typeof navigator !== "undefined" && navigator.language) {