@terreno/ui 57.20.0 → 58.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) hide show
  1. package/.ai/guidelines/core.md +1 -1
  2. package/CHANGELOG.md +93 -0
  3. package/dist/ActionSheet.d.ts +9 -9
  4. package/dist/ActionSheet.d.ts.map +1 -1
  5. package/dist/ActionSheet.js +11 -4
  6. package/dist/ActionSheet.js.map +1 -1
  7. package/dist/AnnouncementNavigator.d.ts +7 -1
  8. package/dist/AnnouncementNavigator.d.ts.map +1 -1
  9. package/dist/AnnouncementNavigator.js +15 -16
  10. package/dist/AnnouncementNavigator.js.map +1 -1
  11. package/dist/Avatar.d.ts.map +1 -1
  12. package/dist/Avatar.js +1 -1
  13. package/dist/Avatar.js.map +1 -1
  14. package/dist/Box.d.ts.map +1 -1
  15. package/dist/Box.js +3 -1
  16. package/dist/Box.js.map +1 -1
  17. package/dist/Common.d.ts +71 -39
  18. package/dist/Common.d.ts.map +1 -1
  19. package/dist/Common.js.map +1 -1
  20. package/dist/ConsentFormScreen.d.ts.map +1 -1
  21. package/dist/ConsentFormScreen.js.map +1 -1
  22. package/dist/ConsentNavigator.d.ts +5 -3
  23. package/dist/ConsentNavigator.d.ts.map +1 -1
  24. package/dist/ConsentNavigator.js +4 -4
  25. package/dist/ConsentNavigator.js.map +1 -1
  26. package/dist/CustomSelectField.js.map +1 -1
  27. package/dist/DataTable.d.ts.map +1 -1
  28. package/dist/DataTable.js +37 -12
  29. package/dist/DataTable.js.map +1 -1
  30. package/dist/DateTimeField.js +6 -6
  31. package/dist/DateTimeField.js.map +1 -1
  32. package/dist/DropdownPanel.d.ts +0 -5
  33. package/dist/DropdownPanel.d.ts.map +1 -1
  34. package/dist/DropdownPanel.js +0 -5
  35. package/dist/DropdownPanel.js.map +1 -1
  36. package/dist/FilterAccordion.d.ts.map +1 -1
  37. package/dist/FilterAccordion.js.map +1 -1
  38. package/dist/FilterBoolean.d.ts.map +1 -1
  39. package/dist/FilterBoolean.js.map +1 -1
  40. package/dist/FilterSelectMenu.js +1 -1
  41. package/dist/FilterSelectMenu.js.map +1 -1
  42. package/dist/GPTChat.d.ts.map +1 -1
  43. package/dist/GPTChat.js.map +1 -1
  44. package/dist/Heading.d.ts.map +1 -1
  45. package/dist/Heading.js +6 -12
  46. package/dist/Heading.js.map +1 -1
  47. package/dist/HeightField.d.ts.map +1 -1
  48. package/dist/HeightField.js +9 -9
  49. package/dist/HeightField.js.map +1 -1
  50. package/dist/Hyperlink.d.ts.map +1 -1
  51. package/dist/Hyperlink.js +6 -1
  52. package/dist/Hyperlink.js.map +1 -1
  53. package/dist/Image.d.ts +1 -1
  54. package/dist/MarkdownEditorField.d.ts.map +1 -1
  55. package/dist/MarkdownEditorField.js +1 -1
  56. package/dist/MarkdownEditorField.js.map +1 -1
  57. package/dist/OfflineBanner.d.ts +3 -2
  58. package/dist/OfflineBanner.d.ts.map +1 -1
  59. package/dist/OfflineBanner.js +3 -2
  60. package/dist/OfflineBanner.js.map +1 -1
  61. package/dist/OtpField.d.ts.map +1 -1
  62. package/dist/OtpField.js +4 -4
  63. package/dist/OtpField.js.map +1 -1
  64. package/dist/PickerSelect.d.ts +4 -4
  65. package/dist/PickerSelect.d.ts.map +1 -1
  66. package/dist/PickerSelect.js +9 -9
  67. package/dist/PickerSelect.js.map +1 -1
  68. package/dist/ProvisionalConsentSigner.d.ts +3 -2
  69. package/dist/ProvisionalConsentSigner.d.ts.map +1 -1
  70. package/dist/ProvisionalConsentSigner.js +2 -2
  71. package/dist/ProvisionalConsentSigner.js.map +1 -1
  72. package/dist/SidebarNavigation.js +2 -2
  73. package/dist/SidebarNavigation.js.map +1 -1
  74. package/dist/SidebarNavigation.native.js +2 -2
  75. package/dist/SidebarNavigation.native.js.map +1 -1
  76. package/dist/Skeleton.js.map +1 -1
  77. package/dist/TapToEdit.d.ts +1 -1
  78. package/dist/TapToEdit.d.ts.map +1 -1
  79. package/dist/TapToEdit.js.map +1 -1
  80. package/dist/Text.d.ts.map +1 -1
  81. package/dist/Text.js +27 -50
  82. package/dist/Text.js.map +1 -1
  83. package/dist/TextField.d.ts.map +1 -1
  84. package/dist/TextField.js +4 -4
  85. package/dist/TextField.js.map +1 -1
  86. package/dist/Theme.d.ts.map +1 -1
  87. package/dist/Theme.js +16 -0
  88. package/dist/Theme.js.map +1 -1
  89. package/dist/ThumbsUpDownFeedback.d.ts.map +1 -1
  90. package/dist/ThumbsUpDownFeedback.js.map +1 -1
  91. package/dist/ToastNotifications.d.ts.map +1 -1
  92. package/dist/ToastNotifications.js.map +1 -1
  93. package/dist/Tooltip.d.ts.map +1 -1
  94. package/dist/Tooltip.js.map +1 -1
  95. package/dist/Unifier.d.ts +1 -1
  96. package/dist/WebAddressAutocomplete.js.map +1 -1
  97. package/dist/WebDropdownMenu.d.ts +3 -3
  98. package/dist/WebDropdownMenu.d.ts.map +1 -1
  99. package/dist/WebDropdownMenu.js +1 -1
  100. package/dist/WebDropdownMenu.js.map +1 -1
  101. package/dist/announcementPlatform.d.ts +5 -0
  102. package/dist/announcementPlatform.d.ts.map +1 -1
  103. package/dist/announcementPlatform.js +9 -0
  104. package/dist/announcementPlatform.js.map +1 -1
  105. package/dist/asks/AskCard.d.ts +2 -2
  106. package/dist/asks/AskCard.d.ts.map +1 -1
  107. package/dist/dataTableColumnWidths.d.ts +76 -0
  108. package/dist/dataTableColumnWidths.d.ts.map +1 -0
  109. package/dist/dataTableColumnWidths.js +181 -0
  110. package/dist/dataTableColumnWidths.js.map +1 -0
  111. package/dist/index.d.ts +2 -1
  112. package/dist/index.d.ts.map +1 -1
  113. package/dist/index.js.map +1 -1
  114. package/dist/login/LoginScreen.js.map +1 -1
  115. package/dist/requestClient.d.ts +71 -0
  116. package/dist/requestClient.d.ts.map +1 -0
  117. package/dist/requestClient.js +139 -0
  118. package/dist/requestClient.js.map +1 -0
  119. package/dist/security/PasswordCard.d.ts.map +1 -1
  120. package/dist/security/PasswordCard.js.map +1 -1
  121. package/dist/security/TwoFactorSettingsCard.d.ts.map +1 -1
  122. package/dist/security/TwoFactorSettingsCard.js +1 -1
  123. package/dist/security/TwoFactorSettingsCard.js.map +1 -1
  124. package/dist/signUp/SignUpScreen.js.map +1 -1
  125. package/dist/table/Table.d.ts.map +1 -1
  126. package/dist/table/Table.js.map +1 -1
  127. package/dist/table/TableTitle.d.ts.map +1 -1
  128. package/dist/table/TableTitle.js +2 -1
  129. package/dist/table/TableTitle.js.map +1 -1
  130. package/dist/textFontSizes.d.ts +12 -0
  131. package/dist/textFontSizes.d.ts.map +1 -0
  132. package/dist/textFontSizes.js +21 -0
  133. package/dist/textFontSizes.js.map +1 -0
  134. package/dist/useAcknowledgeAnnouncement.d.ts +8 -63
  135. package/dist/useAcknowledgeAnnouncement.d.ts.map +1 -1
  136. package/dist/useAcknowledgeAnnouncement.js +31 -80
  137. package/dist/useAcknowledgeAnnouncement.js.map +1 -1
  138. package/dist/useAnnouncements.d.ts +14 -47
  139. package/dist/useAnnouncements.d.ts.map +1 -1
  140. package/dist/useAnnouncements.js +30 -57
  141. package/dist/useAnnouncements.js.map +1 -1
  142. package/dist/useConsentForms.d.ts +6 -38
  143. package/dist/useConsentForms.d.ts.map +1 -1
  144. package/dist/useConsentForms.js +25 -48
  145. package/dist/useConsentForms.js.map +1 -1
  146. package/dist/useProvisionalConsent.d.ts +7 -58
  147. package/dist/useProvisionalConsent.d.ts.map +1 -1
  148. package/dist/useProvisionalConsent.js +57 -67
  149. package/dist/useProvisionalConsent.js.map +1 -1
  150. package/dist/useSubmitConsent.d.ts +9 -39
  151. package/dist/useSubmitConsent.d.ts.map +1 -1
  152. package/dist/useSubmitConsent.js +10 -39
  153. package/dist/useSubmitConsent.js.map +1 -1
  154. package/package.json +40 -38
  155. package/src/ActionSheet.test.tsx +13 -13
  156. package/src/ActionSheet.tsx +18 -5
  157. package/src/AddressField.test.tsx +9 -3
  158. package/src/AnnouncementNavigator.test.tsx +219 -319
  159. package/src/AnnouncementNavigator.tsx +25 -20
  160. package/src/Avatar.tsx +2 -9
  161. package/src/Badge.test.tsx +1 -1
  162. package/src/Banner.test.tsx +0 -1
  163. package/src/Box.test.tsx +85 -77
  164. package/src/Box.tsx +4 -2
  165. package/src/Button.test.tsx +11 -6
  166. package/src/Card.test.tsx +2 -2
  167. package/src/Common.ts +79 -44
  168. package/src/ConflictSheet.test.tsx +5 -5
  169. package/src/ConsentFormScreen.test.tsx +3 -1
  170. package/src/ConsentFormScreen.tsx +2 -1
  171. package/src/ConsentNavigator.test.tsx +166 -243
  172. package/src/ConsentNavigator.tsx +9 -13
  173. package/src/CustomSelectField.test.tsx +16 -4
  174. package/src/CustomSelectField.tsx +3 -3
  175. package/src/DataTable.test.tsx +73 -5
  176. package/src/DataTable.tsx +72 -19
  177. package/src/DataTableVirtualizationRegression.test.tsx +1 -0
  178. package/src/DateTimeActionSheet.test.tsx +2 -0
  179. package/src/DateTimeField.test.tsx +3 -12
  180. package/src/DateTimeField.tsx +10 -10
  181. package/src/DismissButton.test.tsx +22 -4
  182. package/src/DropdownPanel.tsx +0 -6
  183. package/src/EmailField.test.tsx +13 -22
  184. package/src/EmojiSelector.test.tsx +2 -2
  185. package/src/ErrorBoundary.test.tsx +5 -3
  186. package/src/Field.test.tsx +20 -44
  187. package/src/FilterAccordion.tsx +3 -3
  188. package/src/FilterBoolean.tsx +3 -3
  189. package/src/FilterSelectMenu.tsx +1 -1
  190. package/src/GPTChat.test.tsx +24 -16
  191. package/src/GPTChat.tsx +10 -9
  192. package/src/Heading.test.tsx +1 -1
  193. package/src/Heading.tsx +7 -14
  194. package/src/HeightField.tsx +17 -10
  195. package/src/Hyperlink.tsx +6 -3
  196. package/src/Icon.test.tsx +2 -2
  197. package/src/Image.test.tsx +1 -1
  198. package/src/Link.test.tsx +13 -6
  199. package/src/MarkdownEditorField.tsx +10 -2
  200. package/src/MarkdownView.test.tsx +10 -6
  201. package/src/MobileAddressAutoComplete.test.tsx +2 -1
  202. package/src/Modal.test.tsx +10 -3
  203. package/src/ModalSheet.test.tsx +11 -10
  204. package/src/MultiselectField.test.tsx +17 -3
  205. package/src/NumberField.test.tsx +14 -14
  206. package/src/NumberPickerActionSheet.test.tsx +1 -1
  207. package/src/OfflineBanner.tsx +3 -2
  208. package/src/OpenAPIContext.test.tsx +4 -4
  209. package/src/OpenAPIRenderRegression.test.tsx +1 -1
  210. package/src/OtpField.tsx +6 -5
  211. package/src/P0RenderRegression.test.tsx +7 -1
  212. package/src/P1RenderRegression.test.tsx +1 -0
  213. package/src/P2ButtonRenderRegression.test.tsx +1 -0
  214. package/src/Page.test.tsx +1 -1
  215. package/src/PhoneNumberField.test.tsx +14 -38
  216. package/src/PickerSelect.tsx +12 -11
  217. package/src/Popover.test.tsx +2 -2
  218. package/src/ProvisionalConsentSigner.test.tsx +140 -113
  219. package/src/ProvisionalConsentSigner.tsx +5 -4
  220. package/src/RadioField.test.tsx +7 -2
  221. package/src/SegmentedControl.test.tsx +21 -12
  222. package/src/SidebarNavigation.native.tsx +2 -2
  223. package/src/SidebarNavigation.test.tsx +18 -6
  224. package/src/SidebarNavigation.tsx +2 -2
  225. package/src/Signature.test.tsx +20 -23
  226. package/src/Skeleton.tsx +1 -1
  227. package/src/Slider.test.tsx +1 -1
  228. package/src/SplitPage.test.tsx +15 -5
  229. package/src/TapToEdit.test.tsx +40 -17
  230. package/src/TapToEdit.tsx +1 -1
  231. package/src/TerrenoFontProvider.test.tsx +1 -1
  232. package/src/Text.test.tsx +4 -4
  233. package/src/Text.tsx +25 -51
  234. package/src/TextField.test.tsx +82 -9
  235. package/src/TextField.tsx +6 -5
  236. package/src/Theme.test.tsx +49 -0
  237. package/src/Theme.tsx +16 -0
  238. package/src/ThumbsUpDownFeedback.tsx +3 -3
  239. package/src/Toast.test.tsx +5 -5
  240. package/src/ToastNotifications.test.tsx +73 -70
  241. package/src/ToastNotifications.tsx +3 -2
  242. package/src/ToastNotifications.webModal.test.tsx +6 -3
  243. package/src/Tooltip.test.tsx +3 -3
  244. package/src/Tooltip.tsx +2 -1
  245. package/src/UnifiedAddressAutoComplete.test.tsx +1 -1
  246. package/src/UserInactivity.test.tsx +1 -0
  247. package/src/WebAddressAutocomplete.test.tsx +12 -12
  248. package/src/WebAddressAutocomplete.tsx +3 -3
  249. package/src/WebDropdownMenu.test.tsx +16 -15
  250. package/src/WebDropdownMenu.tsx +16 -5
  251. package/src/__snapshots__/Card.test.tsx.snap +1 -1
  252. package/src/__snapshots__/DataTable.test.tsx.snap +13 -0
  253. package/src/__snapshots__/DismissButton.test.tsx.snap +3 -3
  254. package/src/__snapshots__/Field.test.tsx.snap +4 -2
  255. package/src/__snapshots__/Heading.test.tsx.snap +1 -1
  256. package/src/__snapshots__/Image.test.tsx.snap +1 -1
  257. package/src/__snapshots__/Page.test.tsx.snap +2 -2
  258. package/src/__snapshots__/Text.test.tsx.snap +1 -1
  259. package/src/announcementPlatform.ts +10 -0
  260. package/src/asks/AskCard.test.tsx +20 -15
  261. package/src/asks/AskCard.tsx +2 -2
  262. package/src/asks/AskFiles.test.tsx +5 -1
  263. package/src/asks/askFileRefs.test.ts +1 -1
  264. package/src/asks/askSummary.test.ts +2 -2
  265. package/src/benchmarks/importTiming.ts +1 -1
  266. package/src/blocks/BlocksView.test.tsx +20 -11
  267. package/src/bunSetup.ts +43 -1
  268. package/src/dataTableColumnWidths.test.ts +266 -0
  269. package/src/dataTableColumnWidths.ts +272 -0
  270. package/src/dataTableFilters.test.tsx +1 -1
  271. package/src/index.tsx +9 -2
  272. package/src/isolated/ListDetailLayout.isolated.tsx +2 -4
  273. package/src/login/LoginScreen.test.tsx +6 -6
  274. package/src/login/LoginScreen.tsx +2 -2
  275. package/src/requestClient.test.ts +288 -0
  276. package/src/requestClient.ts +228 -0
  277. package/src/security/PasswordCard.test.tsx +3 -3
  278. package/src/security/PasswordCard.tsx +7 -5
  279. package/src/security/TwoFactorSettingsCard.tsx +10 -3
  280. package/src/signUp/SignUpScreen.test.tsx +4 -4
  281. package/src/signUp/SignUpScreen.tsx +2 -2
  282. package/src/table/Table.tsx +1 -2
  283. package/src/table/TableTitle.tsx +2 -1
  284. package/src/table/tableContext.test.tsx +5 -5
  285. package/src/test-utils.tsx +132 -1
  286. package/src/testing/reactDomServer.d.ts +7 -0
  287. package/src/textFontSizes.ts +31 -0
  288. package/src/useAcknowledgeAnnouncement.test.ts +101 -193
  289. package/src/useAcknowledgeAnnouncement.ts +69 -147
  290. package/src/useAnnouncements.test.ts +122 -186
  291. package/src/useAnnouncements.ts +49 -105
  292. package/src/useConsentForms.test.ts +59 -112
  293. package/src/useConsentForms.ts +37 -87
  294. package/src/useProvisionalConsent.test.ts +74 -150
  295. package/src/useProvisionalConsent.ts +79 -125
  296. package/src/useSubmitConsent.test.ts +59 -85
  297. package/src/useSubmitConsent.ts +22 -77
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 {Platform, type ScrollView} from "react-native";
5
+ import {Platform, type ScrollViewInstance} 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
  });
@@ -753,7 +753,7 @@ describe("Box", () => {
753
753
  // values: a ref object in style is cyclical (host instance points back at the
754
754
  // node) and gets dev-frozen, so React throws when detaching it on unmount.
755
755
  it("should keep behavior props out of the ScrollView style", () => {
756
- const scrollRef = React.createRef<ScrollView>();
756
+ const scrollRef = React.createRef<ScrollViewInstance>();
757
757
  const {root} = renderWithTheme(
758
758
  <Box onScroll={mock(() => {})} scroll scrollRef={scrollRef}>
759
759
  <Text>Scrollable</Text>
@@ -761,7 +761,7 @@ describe("Box", () => {
761
761
  );
762
762
 
763
763
  // RN Testing Library resolves host ScrollView by display name, not the JS class.
764
- const scrollView = root.findByType("ScrollView");
764
+ const scrollView = findByHostType(root, "ScrollView");
765
765
  expect(scrollView.props.style).not.toHaveProperty("scrollRef");
766
766
  expect(scrollView.props.style).not.toHaveProperty("scroll");
767
767
  expect(scrollView.props.style).not.toHaveProperty("onScroll");
@@ -773,7 +773,7 @@ describe("Box", () => {
773
773
  <Box avoidKeyboard keyboardOffset={12} onLayout={mock(() => {})} testID="behavior-box" />
774
774
  );
775
775
 
776
- const view = root.findByType("View");
776
+ const view = findByHostType(root, "View");
777
777
  expect(view.props.style).not.toHaveProperty("onLayout");
778
778
  expect(view.props.style).not.toHaveProperty("avoidKeyboard");
779
779
  expect(view.props.style).not.toHaveProperty("keyboardOffset");
@@ -829,7 +829,7 @@ describe("Box", () => {
829
829
  renderWithTheme(<Box ref={ref} scroll />);
830
830
 
831
831
  expect(ref.current).toBeTruthy();
832
- expect(typeof ref.current.scrollToEnd).toBe("function");
832
+ expect(typeof ref.current!.scrollToEnd).toBe("function");
833
833
  });
834
834
 
835
835
  it("should expose scrollTo method", () => {
@@ -837,7 +837,7 @@ describe("Box", () => {
837
837
  renderWithTheme(<Box ref={ref} scroll />);
838
838
 
839
839
  expect(ref.current).toBeTruthy();
840
- expect(typeof ref.current.scrollTo).toBe("function");
840
+ expect(typeof ref.current!.scrollTo).toBe("function");
841
841
  });
842
842
 
843
843
  it("scrollTo forwards to the underlying scroll ref after the delay", async () => {
@@ -845,7 +845,7 @@ describe("Box", () => {
845
845
  const scrollToEnd = mock(() => {});
846
846
  const scrollRef = {
847
847
  current: {scrollTo, scrollToEnd},
848
- } as unknown as React.RefObject<ScrollView>;
848
+ } as unknown as React.RefObject<ScrollViewInstance>;
849
849
  const ref = React.createRef<BoxScrollHandle>();
850
850
  // Intentionally omit `scroll` so the ScrollView does not claim `scrollRef`
851
851
  // and overwrite `.current`; the imperative handle still reads it.
@@ -855,8 +855,8 @@ describe("Box", () => {
855
855
  </Box>
856
856
  );
857
857
 
858
- ref.current.scrollTo(42);
859
- ref.current.scrollToEnd();
858
+ ref.current!.scrollTo(42);
859
+ ref.current!.scrollToEnd();
860
860
 
861
861
  await act(async () => {
862
862
  await new Promise((resolve) => setTimeout(resolve, 80));
@@ -872,7 +872,7 @@ describe("Box", () => {
872
872
  const {root} = renderWithTheme(
873
873
  <Box dangerouslySetInlineStyle={{__style: {backgroundColor: "red"}}} />
874
874
  );
875
- const view = root.findByType("View");
875
+ const view = findByHostType(root, "View");
876
876
  expect(view.props.style).toMatchObject({
877
877
  backgroundColor: "red",
878
878
  });
@@ -912,7 +912,7 @@ describe("Box", () => {
912
912
 
913
913
  it("should handle zero values", () => {
914
914
  const {root} = renderWithTheme(<Box gap={0} margin={0} padding={0} />);
915
- const view = root.findByType("View");
915
+ const view = findByHostType(root, "View");
916
916
  expect(view.props.style).toMatchObject({
917
917
  gap: 0,
918
918
  margin: 0,
@@ -1026,25 +1026,25 @@ describe("Box", () => {
1026
1026
 
1027
1027
  it("applies a valid maxHeight value", () => {
1028
1028
  const {root} = renderWithTheme(<Box maxHeight={120} />);
1029
- const view = root.findByType("View");
1029
+ const view = findByHostType(root, "View");
1030
1030
  expect(view.props.style).toMatchObject({maxHeight: 120});
1031
1031
  });
1032
1032
 
1033
1033
  it("applies a valid minHeight value", () => {
1034
1034
  const {root} = renderWithTheme(<Box minHeight={"50%"} />);
1035
- const view = root.findByType("View");
1035
+ const view = findByHostType(root, "View");
1036
1036
  expect(view.props.style).toMatchObject({minHeight: "50%"});
1037
1037
  });
1038
1038
 
1039
1039
  it("applies a valid maxWidth value", () => {
1040
1040
  const {root} = renderWithTheme(<Box maxWidth={200} />);
1041
- const view = root.findByType("View");
1041
+ const view = findByHostType(root, "View");
1042
1042
  expect(view.props.style).toMatchObject({maxWidth: 200});
1043
1043
  });
1044
1044
 
1045
1045
  it("applies a valid minWidth value", () => {
1046
1046
  const {root} = renderWithTheme(<Box minWidth={"25%"} />);
1047
- const view = root.findByType("View");
1047
+ const view = findByHostType(root, "View");
1048
1048
  expect(view.props.style).toMatchObject({minWidth: "25%"});
1049
1049
  });
1050
1050
 
@@ -1064,19 +1064,19 @@ describe("Box", () => {
1064
1064
 
1065
1065
  it("applies width with border adds 4 pixels", () => {
1066
1066
  const {root} = renderWithTheme(<Box border="default" width={100} />);
1067
- const view = root.findByType("View");
1067
+ const view = findByHostType(root, "View");
1068
1068
  expect(view.props.style.width).toBe(104);
1069
1069
  });
1070
1070
 
1071
1071
  it("applies height with border adds 4 pixels", () => {
1072
1072
  const {root} = renderWithTheme(<Box border="default" height={80} />);
1073
- const view = root.findByType("View");
1073
+ const view = findByHostType(root, "View");
1074
1074
  expect(view.props.style.height).toBe(84);
1075
1075
  });
1076
1076
 
1077
1077
  it("keeps an explicit alignItems when combined with wrap", () => {
1078
1078
  const {root} = renderWithTheme(<Box alignItems="center" wrap />);
1079
- const view = root.findByType("View");
1079
+ const view = findByHostType(root, "View");
1080
1080
  expect(view.props.style).toMatchObject({
1081
1081
  alignItems: "center",
1082
1082
  flexWrap: "wrap",
@@ -1087,13 +1087,13 @@ describe("Box", () => {
1087
1087
  const {root} = renderWithTheme(
1088
1088
  <Box dangerouslySetInlineStyle={{__style: {backgroundColor: "red"}}} />
1089
1089
  );
1090
- const view = root.findByType("View");
1090
+ const view = findByHostType(root, "View");
1091
1091
  expect(view.props.style.backgroundColor).toBe("red");
1092
1092
  });
1093
1093
 
1094
1094
  it("handles rounding='circle' with width/height", () => {
1095
1095
  const {root} = renderWithTheme(<Box height={40} rounding="circle" width={40} />);
1096
- const view = root.findByType("View");
1096
+ const view = findByHostType(root, "View");
1097
1097
  expect(view.props.style.borderRadius).toBe(40);
1098
1098
  });
1099
1099
 
@@ -1106,37 +1106,37 @@ describe("Box", () => {
1106
1106
 
1107
1107
  it("applies shadow on ios/web", () => {
1108
1108
  const {root} = renderWithTheme(<Box shadow />);
1109
- const view = root.findByType("View");
1109
+ const view = findByHostType(root, "View");
1110
1110
  expect(view.props.style.boxShadow).toBeDefined();
1111
1111
  });
1112
1112
 
1113
1113
  it("applies overflow='scroll'", () => {
1114
1114
  const {root} = renderWithTheme(<Box overflow="scroll" />);
1115
- const view = root.findByType("View");
1115
+ const view = findByHostType(root, "View");
1116
1116
  expect(view.props.style.overflow).toBe("scroll");
1117
1117
  });
1118
1118
 
1119
1119
  it("applies overflow='scrollY'", () => {
1120
1120
  const {root} = renderWithTheme(<Box overflow="scrollY" />);
1121
- const view = root.findByType("View");
1121
+ const view = findByHostType(root, "View");
1122
1122
  expect(view.props.style.overflow).toBe("scroll");
1123
1123
  });
1124
1124
 
1125
1125
  it("applies position='absolute'", () => {
1126
1126
  const {root} = renderWithTheme(<Box position="absolute" />);
1127
- const view = root.findByType("View");
1127
+ const view = findByHostType(root, "View");
1128
1128
  expect(view.props.style.position).toBe("absolute");
1129
1129
  });
1130
1130
 
1131
1131
  it("applies zIndex", () => {
1132
1132
  const {root} = renderWithTheme(<Box zIndex={10} />);
1133
- const view = root.findByType("View");
1133
+ const view = findByHostType(root, "View");
1134
1134
  expect(view.props.style.zIndex).toBe(10);
1135
1135
  });
1136
1136
 
1137
1137
  it("applies top/left/right/bottom offsets", () => {
1138
1138
  const {root} = renderWithTheme(<Box bottom left position="absolute" right top />);
1139
- const view = root.findByType("View");
1139
+ const view = findByHostType(root, "View");
1140
1140
  expect(view.props.style.top).toBe(0);
1141
1141
  expect(view.props.style.left).toBe(0);
1142
1142
  expect(view.props.style.right).toBe(0);
@@ -1150,7 +1150,7 @@ describe("Box", () => {
1150
1150
  <Text>Scrollable</Text>
1151
1151
  </Box>
1152
1152
  );
1153
- const scrollView = root.findByType("ScrollView");
1153
+ const scrollView = findByHostType(root, "ScrollView");
1154
1154
  await act(async () => {
1155
1155
  scrollView.props.onScroll?.({nativeEvent: {contentOffset: {y: 100}}});
1156
1156
  });
@@ -1165,7 +1165,7 @@ describe("Box", () => {
1165
1165
  <Text>Hover</Text>
1166
1166
  </Box>
1167
1167
  );
1168
- const view = root.findByType("View");
1168
+ const view = findByHostType(root, "View");
1169
1169
  await act(async () => {
1170
1170
  await view.props.onPointerEnter?.();
1171
1171
  });
@@ -1264,7 +1264,15 @@ describe("Box", () => {
1264
1264
 
1265
1265
  it("ignores presses on a clickable Box while loading", () => {
1266
1266
  const onClick = mock(() => {});
1267
- 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
+ );
1268
1276
  fireEvent.press(getByTestId("box-clickable"));
1269
1277
  expect(onClick).not.toHaveBeenCalled();
1270
1278
  });
package/src/Box.tsx CHANGED
@@ -6,6 +6,7 @@ import {
6
6
  Pressable,
7
7
  SafeAreaView,
8
8
  ScrollView,
9
+ type ScrollViewInstance,
9
10
  View,
10
11
  type ViewStyle,
11
12
  } from "react-native";
@@ -156,7 +157,7 @@ const boxStyleMapCache = new WeakMap<object, BoxStyleMap>();
156
157
  const BoxComponent = React.forwardRef((props: BoxProps, ref) => {
157
158
  const {theme} = useTheme();
158
159
  const resolvedTestID = props.testID;
159
- const internalScrollRef = useRef<ScrollView>(null);
160
+ const internalScrollRef = useRef<ScrollViewInstance>(null);
160
161
  const scrollRef = props.scrollRef ?? internalScrollRef;
161
162
  const hasResponsiveDirection = Boolean(
162
163
  props.smDirection || props.mdDirection || props.lgDirection || props.xlDirection
@@ -508,7 +509,8 @@ const BoxComponent = React.forwardRef((props: BoxProps, ref) => {
508
509
  : {};
509
510
  box = (
510
511
  <Pressable
511
- {...toggleKeyDownProps}
512
+ // RN 0.88 types `onKeyDown` with a native event that has no `key`; RNW passes the DOM event.
513
+ {...(toggleKeyDownProps as object)}
512
514
  accessibilityHint={(props as AccessibilityProps).accessibilityHint}
513
515
  {...(explicitAccessibilityRole
514
516
  ? {accessibilityRole: explicitAccessibilityRole as never}