@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
package/src/Box.test.tsx CHANGED
@@ -2,13 +2,13 @@ import {describe, expect, it, mock, spyOn} from "bun:test";
2
2
  import {act, fireEvent} from "@testing-library/react-native";
3
3
  import {assert} from "chai";
4
4
  import React from "react";
5
- import type {ScrollView} from "react-native";
5
+ import {Platform, type ScrollView} from "react-native";
6
6
 
7
7
  import {Box} from "./Box";
8
8
  import {sharedResponsiveBreakpointStore} from "./ResponsiveBreakpoint";
9
9
  import {Skeleton, SkeletonCircle} from "./Skeleton";
10
10
  import {Text} from "./Text";
11
- import {renderWithTheme} from "./test-utils";
11
+ import {findByHostType, renderWithTheme} from "./test-utils";
12
12
 
13
13
  // Skeletons are hidden from assistive tech, so queries opt in to hidden elements.
14
14
  const HIDDEN = {includeHiddenElements: true};
@@ -44,7 +44,7 @@ describe("Box", () => {
44
44
  describe("layout props", () => {
45
45
  it("should apply direction prop", () => {
46
46
  const {root} = renderWithTheme(<Box direction="column" />);
47
- const view = root.findByType("View");
47
+ const view = findByHostType(root, "View");
48
48
  expect(view.props.style).toMatchObject({
49
49
  display: "flex",
50
50
  flexDirection: "column",
@@ -153,7 +153,7 @@ describe("Box", () => {
153
153
 
154
154
  it("should apply flex grow", () => {
155
155
  const {root} = renderWithTheme(<Box flex="grow" />);
156
- const view = root.findByType("View");
156
+ const view = findByHostType(root, "View");
157
157
  expect(view.props.style).toMatchObject({
158
158
  display: "flex",
159
159
  flexGrow: 1,
@@ -163,7 +163,7 @@ describe("Box", () => {
163
163
 
164
164
  it("should apply flex shrink", () => {
165
165
  const {root} = renderWithTheme(<Box flex="shrink" />);
166
- const view = root.findByType("View");
166
+ const view = findByHostType(root, "View");
167
167
  expect(view.props.style).toMatchObject({
168
168
  display: "flex",
169
169
  flexShrink: 1,
@@ -172,7 +172,7 @@ describe("Box", () => {
172
172
 
173
173
  it("should apply flex none", () => {
174
174
  const {root} = renderWithTheme(<Box flex="none" />);
175
- const view = root.findByType("View");
175
+ const view = findByHostType(root, "View");
176
176
  expect(view.props.style).toMatchObject({
177
177
  display: "flex",
178
178
  flex: 0,
@@ -181,7 +181,7 @@ describe("Box", () => {
181
181
 
182
182
  it("should apply justifyContent", () => {
183
183
  const {root} = renderWithTheme(<Box justifyContent="center" />);
184
- const view = root.findByType("View");
184
+ const view = findByHostType(root, "View");
185
185
  expect(view.props.style).toMatchObject({
186
186
  justifyContent: "center",
187
187
  });
@@ -189,7 +189,7 @@ describe("Box", () => {
189
189
 
190
190
  it("should apply alignItems", () => {
191
191
  const {root} = renderWithTheme(<Box alignItems="center" />);
192
- const view = root.findByType("View");
192
+ const view = findByHostType(root, "View");
193
193
  expect(view.props.style).toMatchObject({
194
194
  alignItems: "center",
195
195
  });
@@ -197,7 +197,7 @@ describe("Box", () => {
197
197
 
198
198
  it("should apply alignContent", () => {
199
199
  const {root} = renderWithTheme(<Box alignContent="center" />);
200
- const view = root.findByType("View");
200
+ const view = findByHostType(root, "View");
201
201
  expect(view.props.style).toMatchObject({
202
202
  alignContent: "center",
203
203
  });
@@ -205,7 +205,7 @@ describe("Box", () => {
205
205
 
206
206
  it("should apply alignSelf", () => {
207
207
  const {root} = renderWithTheme(<Box alignSelf="center" />);
208
- const view = root.findByType("View");
208
+ const view = findByHostType(root, "View");
209
209
  expect(view.props.style).toMatchObject({
210
210
  alignSelf: "center",
211
211
  });
@@ -213,7 +213,7 @@ describe("Box", () => {
213
213
 
214
214
  it("should apply wrap", () => {
215
215
  const {root} = renderWithTheme(<Box wrap />);
216
- const view = root.findByType("View");
216
+ const view = findByHostType(root, "View");
217
217
  expect(view.props.style).toMatchObject({
218
218
  alignItems: "flex-start",
219
219
  flexWrap: "wrap",
@@ -222,7 +222,7 @@ describe("Box", () => {
222
222
 
223
223
  it("should apply gap", () => {
224
224
  const {root} = renderWithTheme(<Box gap={4} />);
225
- const view = root.findByType("View");
225
+ const view = findByHostType(root, "View");
226
226
  expect(view.props.style).toMatchObject({
227
227
  gap: 16,
228
228
  });
@@ -232,7 +232,7 @@ describe("Box", () => {
232
232
  describe("spacing props", () => {
233
233
  it("should apply padding", () => {
234
234
  const {root} = renderWithTheme(<Box padding={4} />);
235
- const view = root.findByType("View");
235
+ const view = findByHostType(root, "View");
236
236
  expect(view.props.style).toMatchObject({
237
237
  padding: 16,
238
238
  });
@@ -240,7 +240,7 @@ describe("Box", () => {
240
240
 
241
241
  it("should apply paddingX", () => {
242
242
  const {root} = renderWithTheme(<Box paddingX={2} />);
243
- const view = root.findByType("View");
243
+ const view = findByHostType(root, "View");
244
244
  expect(view.props.style).toMatchObject({
245
245
  paddingLeft: 8,
246
246
  paddingRight: 8,
@@ -249,7 +249,7 @@ describe("Box", () => {
249
249
 
250
250
  it("should apply paddingY", () => {
251
251
  const {root} = renderWithTheme(<Box paddingY={3} />);
252
- const view = root.findByType("View");
252
+ const view = findByHostType(root, "View");
253
253
  expect(view.props.style).toMatchObject({
254
254
  paddingBottom: 12,
255
255
  paddingTop: 12,
@@ -258,7 +258,7 @@ describe("Box", () => {
258
258
 
259
259
  it("should apply margin", () => {
260
260
  const {root} = renderWithTheme(<Box margin={4} />);
261
- const view = root.findByType("View");
261
+ const view = findByHostType(root, "View");
262
262
  expect(view.props.style).toMatchObject({
263
263
  margin: 16,
264
264
  });
@@ -266,7 +266,7 @@ describe("Box", () => {
266
266
 
267
267
  it("should apply marginTop", () => {
268
268
  const {root} = renderWithTheme(<Box marginTop={2} />);
269
- const view = root.findByType("View");
269
+ const view = findByHostType(root, "View");
270
270
  expect(view.props.style).toMatchObject({
271
271
  marginTop: 8,
272
272
  });
@@ -274,7 +274,7 @@ describe("Box", () => {
274
274
 
275
275
  it("should apply marginBottom", () => {
276
276
  const {root} = renderWithTheme(<Box marginBottom={2} />);
277
- const view = root.findByType("View");
277
+ const view = findByHostType(root, "View");
278
278
  expect(view.props.style).toMatchObject({
279
279
  marginBottom: 8,
280
280
  });
@@ -282,7 +282,7 @@ describe("Box", () => {
282
282
 
283
283
  it("should apply marginLeft", () => {
284
284
  const {root} = renderWithTheme(<Box marginLeft={2} />);
285
- const view = root.findByType("View");
285
+ const view = findByHostType(root, "View");
286
286
  expect(view.props.style).toMatchObject({
287
287
  marginLeft: 8,
288
288
  });
@@ -290,7 +290,7 @@ describe("Box", () => {
290
290
 
291
291
  it("should apply marginRight", () => {
292
292
  const {root} = renderWithTheme(<Box marginRight={2} />);
293
- const view = root.findByType("View");
293
+ const view = findByHostType(root, "View");
294
294
  expect(view.props.style).toMatchObject({
295
295
  marginRight: 8,
296
296
  });
@@ -300,7 +300,7 @@ describe("Box", () => {
300
300
  describe("sizing props", () => {
301
301
  it("should apply width", () => {
302
302
  const {root} = renderWithTheme(<Box width={100} />);
303
- const view = root.findByType("View");
303
+ const view = findByHostType(root, "View");
304
304
  expect(view.props.style).toMatchObject({
305
305
  width: 100,
306
306
  });
@@ -308,7 +308,7 @@ describe("Box", () => {
308
308
 
309
309
  it("should apply height", () => {
310
310
  const {root} = renderWithTheme(<Box height={100} />);
311
- const view = root.findByType("View");
311
+ const view = findByHostType(root, "View");
312
312
  expect(view.props.style).toMatchObject({
313
313
  height: 100,
314
314
  });
@@ -316,7 +316,7 @@ describe("Box", () => {
316
316
 
317
317
  it("should apply string width", () => {
318
318
  const {root} = renderWithTheme(<Box width="50%" />);
319
- const view = root.findByType("View");
319
+ const view = findByHostType(root, "View");
320
320
  expect(view.props.style).toMatchObject({
321
321
  width: "50%",
322
322
  });
@@ -324,7 +324,7 @@ describe("Box", () => {
324
324
 
325
325
  it("should apply string height", () => {
326
326
  const {root} = renderWithTheme(<Box height="50%" />);
327
- const view = root.findByType("View");
327
+ const view = findByHostType(root, "View");
328
328
  expect(view.props.style).toMatchObject({
329
329
  height: "50%",
330
330
  });
@@ -334,7 +334,7 @@ describe("Box", () => {
334
334
  describe("position props", () => {
335
335
  it("should apply position absolute", () => {
336
336
  const {root} = renderWithTheme(<Box position="absolute" />);
337
- const view = root.findByType("View");
337
+ const view = findByHostType(root, "View");
338
338
  expect(view.props.style).toMatchObject({
339
339
  position: "absolute",
340
340
  });
@@ -342,7 +342,7 @@ describe("Box", () => {
342
342
 
343
343
  it("should apply top", () => {
344
344
  const {root} = renderWithTheme(<Box top />);
345
- const view = root.findByType("View");
345
+ const view = findByHostType(root, "View");
346
346
  expect(view.props.style).toMatchObject({
347
347
  top: 0,
348
348
  });
@@ -350,7 +350,7 @@ describe("Box", () => {
350
350
 
351
351
  it("should apply bottom", () => {
352
352
  const {root} = renderWithTheme(<Box bottom />);
353
- const view = root.findByType("View");
353
+ const view = findByHostType(root, "View");
354
354
  expect(view.props.style).toMatchObject({
355
355
  bottom: 0,
356
356
  });
@@ -358,7 +358,7 @@ describe("Box", () => {
358
358
 
359
359
  it("should apply left", () => {
360
360
  const {root} = renderWithTheme(<Box left />);
361
- const view = root.findByType("View");
361
+ const view = findByHostType(root, "View");
362
362
  expect(view.props.style).toMatchObject({
363
363
  left: 0,
364
364
  });
@@ -366,7 +366,7 @@ describe("Box", () => {
366
366
 
367
367
  it("should apply right", () => {
368
368
  const {root} = renderWithTheme(<Box right />);
369
- const view = root.findByType("View");
369
+ const view = findByHostType(root, "View");
370
370
  expect(view.props.style).toMatchObject({
371
371
  right: 0,
372
372
  });
@@ -374,7 +374,7 @@ describe("Box", () => {
374
374
 
375
375
  it("should apply zIndex", () => {
376
376
  const {root} = renderWithTheme(<Box zIndex={10} />);
377
- const view = root.findByType("View");
377
+ const view = findByHostType(root, "View");
378
378
  expect(view.props.style).toMatchObject({
379
379
  zIndex: 10,
380
380
  });
@@ -384,7 +384,7 @@ describe("Box", () => {
384
384
  describe("color and surface props", () => {
385
385
  it("should apply background color", () => {
386
386
  const {root} = renderWithTheme(<Box color="primary" />);
387
- const view = root.findByType("View");
387
+ const view = findByHostType(root, "View");
388
388
  expect(view.props.style.backgroundColor).toBeDefined();
389
389
  });
390
390
  });
@@ -392,48 +392,48 @@ describe("Box", () => {
392
392
  describe("border props", () => {
393
393
  it("should apply border", () => {
394
394
  const {root} = renderWithTheme(<Box border="default" />);
395
- const view = root.findByType("View");
395
+ const view = findByHostType(root, "View");
396
396
  expect(view.props.style.borderColor).toBeDefined();
397
397
  expect(view.props.style.borderWidth).toBe(1);
398
398
  });
399
399
 
400
400
  it("should apply borderTop", () => {
401
401
  const {root} = renderWithTheme(<Box borderTop="default" />);
402
- const view = root.findByType("View");
402
+ const view = findByHostType(root, "View");
403
403
  expect(view.props.style.borderTopColor).toBeDefined();
404
404
  expect(view.props.style.borderTopWidth).toBe(1);
405
405
  });
406
406
 
407
407
  it("should apply borderBottom", () => {
408
408
  const {root} = renderWithTheme(<Box borderBottom="default" />);
409
- const view = root.findByType("View");
409
+ const view = findByHostType(root, "View");
410
410
  expect(view.props.style.borderBottomColor).toBeDefined();
411
411
  expect(view.props.style.borderBottomWidth).toBe(1);
412
412
  });
413
413
 
414
414
  it("should apply borderLeft", () => {
415
415
  const {root} = renderWithTheme(<Box borderLeft="default" />);
416
- const view = root.findByType("View");
416
+ const view = findByHostType(root, "View");
417
417
  expect(view.props.style.borderLeftColor).toBeDefined();
418
418
  expect(view.props.style.borderLeftWidth).toBe(1);
419
419
  });
420
420
 
421
421
  it("should apply borderRight", () => {
422
422
  const {root} = renderWithTheme(<Box borderRight="default" />);
423
- const view = root.findByType("View");
423
+ const view = findByHostType(root, "View");
424
424
  expect(view.props.style.borderRightColor).toBeDefined();
425
425
  expect(view.props.style.borderRightWidth).toBe(1);
426
426
  });
427
427
 
428
428
  it("should adjust width for border", () => {
429
429
  const {root} = renderWithTheme(<Box border="default" width={100} />);
430
- const view = root.findByType("View");
430
+ const view = findByHostType(root, "View");
431
431
  expect(view.props.style.width).toBe(104); // 100 + 2*2 for border
432
432
  });
433
433
 
434
434
  it("should adjust height for border", () => {
435
435
  const {root} = renderWithTheme(<Box border="default" height={100} />);
436
- const view = root.findByType("View");
436
+ const view = findByHostType(root, "View");
437
437
  expect(view.props.style.height).toBe(104); // 100 + 2*2 for border
438
438
  });
439
439
  });
@@ -441,19 +441,19 @@ describe("Box", () => {
441
441
  describe("rounding props", () => {
442
442
  it("should apply rounding", () => {
443
443
  const {root} = renderWithTheme(<Box rounding="md" />);
444
- const view = root.findByType("View");
444
+ const view = findByHostType(root, "View");
445
445
  expect(view.props.style.borderRadius).toBe(4);
446
446
  });
447
447
 
448
448
  it("should apply circle rounding with width", () => {
449
449
  const {root} = renderWithTheme(<Box rounding="circle" width={50} />);
450
- const view = root.findByType("View");
450
+ const view = findByHostType(root, "View");
451
451
  expect(view.props.style.borderRadius).toBe(50);
452
452
  });
453
453
 
454
454
  it("should apply circle rounding with height", () => {
455
455
  const {root} = renderWithTheme(<Box height={50} rounding="circle" />);
456
- const view = root.findByType("View");
456
+ const view = findByHostType(root, "View");
457
457
  expect(view.props.style.borderRadius).toBe(50);
458
458
  });
459
459
 
@@ -470,7 +470,7 @@ describe("Box", () => {
470
470
  describe("display props", () => {
471
471
  it("should apply display none", () => {
472
472
  const {root} = renderWithTheme(<Box display="none" />);
473
- const view = root.findByType("View");
473
+ const view = findByHostType(root, "View");
474
474
  expect(view.props.style).toMatchObject({
475
475
  display: "none",
476
476
  });
@@ -478,7 +478,7 @@ describe("Box", () => {
478
478
 
479
479
  it("should apply display flex", () => {
480
480
  const {root} = renderWithTheme(<Box display="flex" />);
481
- const view = root.findByType("View");
481
+ const view = findByHostType(root, "View");
482
482
  expect(view.props.style).toMatchObject({
483
483
  flex: undefined,
484
484
  });
@@ -486,7 +486,7 @@ describe("Box", () => {
486
486
 
487
487
  it("should apply display block", () => {
488
488
  const {root} = renderWithTheme(<Box display="block" />);
489
- const view = root.findByType("View");
489
+ const view = findByHostType(root, "View");
490
490
  expect(view.props.style).toMatchObject({
491
491
  flex: 0,
492
492
  flexDirection: "row",
@@ -497,7 +497,7 @@ describe("Box", () => {
497
497
  describe("overflow props", () => {
498
498
  it("should apply overflow scroll", () => {
499
499
  const {root} = renderWithTheme(<Box overflow="scroll" />);
500
- const view = root.findByType("View");
500
+ const view = findByHostType(root, "View");
501
501
  expect(view.props.style).toMatchObject({
502
502
  overflow: "scroll",
503
503
  });
@@ -505,7 +505,7 @@ describe("Box", () => {
505
505
 
506
506
  it("should apply overflow scrollY", () => {
507
507
  const {root} = renderWithTheme(<Box overflow="scrollY" />);
508
- const view = root.findByType("View");
508
+ const view = findByHostType(root, "View");
509
509
  expect(view.props.style).toMatchObject({
510
510
  overflow: "scroll",
511
511
  });
@@ -513,7 +513,7 @@ describe("Box", () => {
513
513
 
514
514
  it("should apply overflow hidden", () => {
515
515
  const {root} = renderWithTheme(<Box overflow="hidden" />);
516
- const view = root.findByType("View");
516
+ const view = findByHostType(root, "View");
517
517
  expect(view.props.style).toMatchObject({
518
518
  overflow: "hidden",
519
519
  });
@@ -523,13 +523,13 @@ describe("Box", () => {
523
523
  describe("shadow props", () => {
524
524
  it("should apply shadow", () => {
525
525
  const {root} = renderWithTheme(<Box shadow />);
526
- const view = root.findByType("View");
526
+ const view = findByHostType(root, "View");
527
527
  expect(view.props.style).toBeDefined();
528
528
  });
529
529
 
530
530
  it("applies no shadow style when shadow is false", () => {
531
531
  const {root} = renderWithTheme(<Box shadow={false} />);
532
- const view = root.findByType("View");
532
+ const view = findByHostType(root, "View");
533
533
  expect(view.props.style.boxShadow).toBeUndefined();
534
534
  expect(view.props.style.elevation).toBeUndefined();
535
535
  });
@@ -630,6 +630,66 @@ describe("Box", () => {
630
630
  expect(onClick).not.toHaveBeenCalled();
631
631
  });
632
632
 
633
+ it("marks a selected clickable row with aria-current", () => {
634
+ const originalOS = Platform.OS;
635
+ Platform.OS = "web";
636
+ try {
637
+ const {getByTestId} = renderWithTheme(
638
+ <Box
639
+ accessibilityHint="Opens the message"
640
+ accessibilityLabel="Quarterly report"
641
+ accessibilityState={{selected: true}}
642
+ onClick={() => {}}
643
+ testID="row"
644
+ />
645
+ );
646
+ const pressable = getByTestId("row-clickable");
647
+ expect(pressable.props.accessibilityState).toBeUndefined();
648
+ expect(pressable.props["aria-current"]).toBe("true");
649
+ expect(pressable.props["aria-selected"]).toBeUndefined();
650
+ } finally {
651
+ Platform.OS = originalOS;
652
+ }
653
+ });
654
+
655
+ it("drops aria-current from an unselected row", () => {
656
+ const originalOS = Platform.OS;
657
+ Platform.OS = "web";
658
+ try {
659
+ const {getByTestId} = renderWithTheme(
660
+ <Box
661
+ accessibilityHint="Opens the message"
662
+ accessibilityLabel="Quarterly report"
663
+ accessibilityState={{selected: false}}
664
+ onClick={() => {}}
665
+ testID="row"
666
+ />
667
+ );
668
+ const pressable = getByTestId("row-clickable");
669
+ expect(pressable.props.accessibilityState).toBeUndefined();
670
+ expect(pressable.props["aria-current"]).toBeUndefined();
671
+ expect(pressable.props["aria-selected"]).toBeUndefined();
672
+ } finally {
673
+ Platform.OS = originalOS;
674
+ }
675
+ });
676
+
677
+ it("sends aria-selected for a selectable role", () => {
678
+ const {getByTestId} = renderWithTheme(
679
+ <Box
680
+ accessibilityHint="Shows the inbox"
681
+ accessibilityLabel="Inbox"
682
+ accessibilityRole="tab"
683
+ accessibilityState={{selected: false}}
684
+ onClick={() => {}}
685
+ testID="tab"
686
+ />
687
+ );
688
+ const pressable = getByTestId("tab-clickable");
689
+ expect(pressable.props["aria-selected"]).toBe(false);
690
+ expect(pressable.props["aria-current"]).toBeUndefined();
691
+ });
692
+
633
693
  it("forwards checked to a Box without onClick", () => {
634
694
  const {getByTestId} = renderWithTheme(
635
695
  <Box accessibilityState={{checked: false}} testID="plain" />
@@ -701,7 +761,7 @@ describe("Box", () => {
701
761
  );
702
762
 
703
763
  // RN Testing Library resolves host ScrollView by display name, not the JS class.
704
- const scrollView = root.findByType("ScrollView");
764
+ const scrollView = findByHostType(root, "ScrollView");
705
765
  expect(scrollView.props.style).not.toHaveProperty("scrollRef");
706
766
  expect(scrollView.props.style).not.toHaveProperty("scroll");
707
767
  expect(scrollView.props.style).not.toHaveProperty("onScroll");
@@ -713,7 +773,7 @@ describe("Box", () => {
713
773
  <Box avoidKeyboard keyboardOffset={12} onLayout={mock(() => {})} testID="behavior-box" />
714
774
  );
715
775
 
716
- const view = root.findByType("View");
776
+ const view = findByHostType(root, "View");
717
777
  expect(view.props.style).not.toHaveProperty("onLayout");
718
778
  expect(view.props.style).not.toHaveProperty("avoidKeyboard");
719
779
  expect(view.props.style).not.toHaveProperty("keyboardOffset");
@@ -769,7 +829,7 @@ describe("Box", () => {
769
829
  renderWithTheme(<Box ref={ref} scroll />);
770
830
 
771
831
  expect(ref.current).toBeTruthy();
772
- expect(typeof ref.current.scrollToEnd).toBe("function");
832
+ expect(typeof ref.current!.scrollToEnd).toBe("function");
773
833
  });
774
834
 
775
835
  it("should expose scrollTo method", () => {
@@ -777,7 +837,7 @@ describe("Box", () => {
777
837
  renderWithTheme(<Box ref={ref} scroll />);
778
838
 
779
839
  expect(ref.current).toBeTruthy();
780
- expect(typeof ref.current.scrollTo).toBe("function");
840
+ expect(typeof ref.current!.scrollTo).toBe("function");
781
841
  });
782
842
 
783
843
  it("scrollTo forwards to the underlying scroll ref after the delay", async () => {
@@ -795,8 +855,8 @@ describe("Box", () => {
795
855
  </Box>
796
856
  );
797
857
 
798
- ref.current.scrollTo(42);
799
- ref.current.scrollToEnd();
858
+ ref.current!.scrollTo(42);
859
+ ref.current!.scrollToEnd();
800
860
 
801
861
  await act(async () => {
802
862
  await new Promise((resolve) => setTimeout(resolve, 80));
@@ -812,7 +872,7 @@ describe("Box", () => {
812
872
  const {root} = renderWithTheme(
813
873
  <Box dangerouslySetInlineStyle={{__style: {backgroundColor: "red"}}} />
814
874
  );
815
- const view = root.findByType("View");
875
+ const view = findByHostType(root, "View");
816
876
  expect(view.props.style).toMatchObject({
817
877
  backgroundColor: "red",
818
878
  });
@@ -852,7 +912,7 @@ describe("Box", () => {
852
912
 
853
913
  it("should handle zero values", () => {
854
914
  const {root} = renderWithTheme(<Box gap={0} margin={0} padding={0} />);
855
- const view = root.findByType("View");
915
+ const view = findByHostType(root, "View");
856
916
  expect(view.props.style).toMatchObject({
857
917
  gap: 0,
858
918
  margin: 0,
@@ -966,25 +1026,25 @@ describe("Box", () => {
966
1026
 
967
1027
  it("applies a valid maxHeight value", () => {
968
1028
  const {root} = renderWithTheme(<Box maxHeight={120} />);
969
- const view = root.findByType("View");
1029
+ const view = findByHostType(root, "View");
970
1030
  expect(view.props.style).toMatchObject({maxHeight: 120});
971
1031
  });
972
1032
 
973
1033
  it("applies a valid minHeight value", () => {
974
1034
  const {root} = renderWithTheme(<Box minHeight={"50%"} />);
975
- const view = root.findByType("View");
1035
+ const view = findByHostType(root, "View");
976
1036
  expect(view.props.style).toMatchObject({minHeight: "50%"});
977
1037
  });
978
1038
 
979
1039
  it("applies a valid maxWidth value", () => {
980
1040
  const {root} = renderWithTheme(<Box maxWidth={200} />);
981
- const view = root.findByType("View");
1041
+ const view = findByHostType(root, "View");
982
1042
  expect(view.props.style).toMatchObject({maxWidth: 200});
983
1043
  });
984
1044
 
985
1045
  it("applies a valid minWidth value", () => {
986
1046
  const {root} = renderWithTheme(<Box minWidth={"25%"} />);
987
- const view = root.findByType("View");
1047
+ const view = findByHostType(root, "View");
988
1048
  expect(view.props.style).toMatchObject({minWidth: "25%"});
989
1049
  });
990
1050
 
@@ -1004,19 +1064,19 @@ describe("Box", () => {
1004
1064
 
1005
1065
  it("applies width with border adds 4 pixels", () => {
1006
1066
  const {root} = renderWithTheme(<Box border="default" width={100} />);
1007
- const view = root.findByType("View");
1067
+ const view = findByHostType(root, "View");
1008
1068
  expect(view.props.style.width).toBe(104);
1009
1069
  });
1010
1070
 
1011
1071
  it("applies height with border adds 4 pixels", () => {
1012
1072
  const {root} = renderWithTheme(<Box border="default" height={80} />);
1013
- const view = root.findByType("View");
1073
+ const view = findByHostType(root, "View");
1014
1074
  expect(view.props.style.height).toBe(84);
1015
1075
  });
1016
1076
 
1017
1077
  it("keeps an explicit alignItems when combined with wrap", () => {
1018
1078
  const {root} = renderWithTheme(<Box alignItems="center" wrap />);
1019
- const view = root.findByType("View");
1079
+ const view = findByHostType(root, "View");
1020
1080
  expect(view.props.style).toMatchObject({
1021
1081
  alignItems: "center",
1022
1082
  flexWrap: "wrap",
@@ -1027,13 +1087,13 @@ describe("Box", () => {
1027
1087
  const {root} = renderWithTheme(
1028
1088
  <Box dangerouslySetInlineStyle={{__style: {backgroundColor: "red"}}} />
1029
1089
  );
1030
- const view = root.findByType("View");
1090
+ const view = findByHostType(root, "View");
1031
1091
  expect(view.props.style.backgroundColor).toBe("red");
1032
1092
  });
1033
1093
 
1034
1094
  it("handles rounding='circle' with width/height", () => {
1035
1095
  const {root} = renderWithTheme(<Box height={40} rounding="circle" width={40} />);
1036
- const view = root.findByType("View");
1096
+ const view = findByHostType(root, "View");
1037
1097
  expect(view.props.style.borderRadius).toBe(40);
1038
1098
  });
1039
1099
 
@@ -1046,37 +1106,37 @@ describe("Box", () => {
1046
1106
 
1047
1107
  it("applies shadow on ios/web", () => {
1048
1108
  const {root} = renderWithTheme(<Box shadow />);
1049
- const view = root.findByType("View");
1109
+ const view = findByHostType(root, "View");
1050
1110
  expect(view.props.style.boxShadow).toBeDefined();
1051
1111
  });
1052
1112
 
1053
1113
  it("applies overflow='scroll'", () => {
1054
1114
  const {root} = renderWithTheme(<Box overflow="scroll" />);
1055
- const view = root.findByType("View");
1115
+ const view = findByHostType(root, "View");
1056
1116
  expect(view.props.style.overflow).toBe("scroll");
1057
1117
  });
1058
1118
 
1059
1119
  it("applies overflow='scrollY'", () => {
1060
1120
  const {root} = renderWithTheme(<Box overflow="scrollY" />);
1061
- const view = root.findByType("View");
1121
+ const view = findByHostType(root, "View");
1062
1122
  expect(view.props.style.overflow).toBe("scroll");
1063
1123
  });
1064
1124
 
1065
1125
  it("applies position='absolute'", () => {
1066
1126
  const {root} = renderWithTheme(<Box position="absolute" />);
1067
- const view = root.findByType("View");
1127
+ const view = findByHostType(root, "View");
1068
1128
  expect(view.props.style.position).toBe("absolute");
1069
1129
  });
1070
1130
 
1071
1131
  it("applies zIndex", () => {
1072
1132
  const {root} = renderWithTheme(<Box zIndex={10} />);
1073
- const view = root.findByType("View");
1133
+ const view = findByHostType(root, "View");
1074
1134
  expect(view.props.style.zIndex).toBe(10);
1075
1135
  });
1076
1136
 
1077
1137
  it("applies top/left/right/bottom offsets", () => {
1078
1138
  const {root} = renderWithTheme(<Box bottom left position="absolute" right top />);
1079
- const view = root.findByType("View");
1139
+ const view = findByHostType(root, "View");
1080
1140
  expect(view.props.style.top).toBe(0);
1081
1141
  expect(view.props.style.left).toBe(0);
1082
1142
  expect(view.props.style.right).toBe(0);
@@ -1090,7 +1150,7 @@ describe("Box", () => {
1090
1150
  <Text>Scrollable</Text>
1091
1151
  </Box>
1092
1152
  );
1093
- const scrollView = root.findByType("ScrollView");
1153
+ const scrollView = findByHostType(root, "ScrollView");
1094
1154
  await act(async () => {
1095
1155
  scrollView.props.onScroll?.({nativeEvent: {contentOffset: {y: 100}}});
1096
1156
  });
@@ -1105,7 +1165,7 @@ describe("Box", () => {
1105
1165
  <Text>Hover</Text>
1106
1166
  </Box>
1107
1167
  );
1108
- const view = root.findByType("View");
1168
+ const view = findByHostType(root, "View");
1109
1169
  await act(async () => {
1110
1170
  await view.props.onPointerEnter?.();
1111
1171
  });
@@ -1204,7 +1264,15 @@ describe("Box", () => {
1204
1264
 
1205
1265
  it("ignores presses on a clickable Box while loading", () => {
1206
1266
  const onClick = mock(() => {});
1207
- const {getByTestId} = renderWithTheme(<Box loading onClick={onClick} testID="box" />);
1267
+ const {getByTestId} = renderWithTheme(
1268
+ <Box
1269
+ accessibilityHint="Runs the box action"
1270
+ accessibilityLabel="Box action"
1271
+ loading
1272
+ onClick={onClick}
1273
+ testID="box"
1274
+ />
1275
+ );
1208
1276
  fireEvent.press(getByTestId("box-clickable"));
1209
1277
  expect(onClick).not.toHaveBeenCalled();
1210
1278
  });