@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
@@ -8,13 +8,15 @@ describe("SegmentedControl", () => {
8
8
  const defaultItems = ["Tab 1", "Tab 2", "Tab 3"];
9
9
 
10
10
  it("renders correctly with default props", () => {
11
- const {toJSON} = renderWithTheme(<SegmentedControl items={defaultItems} selectedIndex={0} />);
11
+ const {toJSON} = renderWithTheme(
12
+ <SegmentedControl items={defaultItems} onChange={() => {}} selectedIndex={0} />
13
+ );
12
14
  expect(toJSON()).toMatchSnapshot();
13
15
  });
14
16
 
15
17
  it("renders all items", () => {
16
18
  const {getByText} = renderWithTheme(
17
- <SegmentedControl items={defaultItems} selectedIndex={0} />
19
+ <SegmentedControl items={defaultItems} onChange={() => {}} selectedIndex={0} />
18
20
  );
19
21
  expect(getByText("Tab 1")).toBeTruthy();
20
22
  expect(getByText("Tab 2")).toBeTruthy();
@@ -22,7 +24,9 @@ describe("SegmentedControl", () => {
22
24
  });
23
25
 
24
26
  it("highlights selected item", () => {
25
- const {toJSON} = renderWithTheme(<SegmentedControl items={defaultItems} selectedIndex={1} />);
27
+ const {toJSON} = renderWithTheme(
28
+ <SegmentedControl items={defaultItems} onChange={() => {}} selectedIndex={1} />
29
+ );
26
30
  expect(toJSON()).toMatchSnapshot();
27
31
  });
28
32
 
@@ -38,21 +42,21 @@ describe("SegmentedControl", () => {
38
42
 
39
43
  it("renders with medium size (default)", () => {
40
44
  const {toJSON} = renderWithTheme(
41
- <SegmentedControl items={defaultItems} selectedIndex={0} size="md" />
45
+ <SegmentedControl items={defaultItems} onChange={() => {}} selectedIndex={0} size="md" />
42
46
  );
43
47
  expect(toJSON()).toMatchSnapshot();
44
48
  });
45
49
 
46
50
  it("renders a compact control that hugs its labels", () => {
47
51
  const {toJSON} = renderWithTheme(
48
- <SegmentedControl items={defaultItems} selectedIndex={0} size="sm" />
52
+ <SegmentedControl items={defaultItems} onChange={() => {}} selectedIndex={0} size="sm" />
49
53
  );
50
54
  expect(toJSON()).toMatchSnapshot();
51
55
  });
52
56
 
53
57
  it("renders with large size", () => {
54
58
  const {toJSON} = renderWithTheme(
55
- <SegmentedControl items={defaultItems} selectedIndex={0} size="lg" />
59
+ <SegmentedControl items={defaultItems} onChange={() => {}} selectedIndex={0} size="lg" />
56
60
  );
57
61
  expect(toJSON()).toMatchSnapshot();
58
62
  });
@@ -64,7 +68,12 @@ describe("SegmentedControl", () => {
64
68
  {count: 1, status: "error" as const},
65
69
  ];
66
70
  const {toJSON} = renderWithTheme(
67
- <SegmentedControl badges={badges} items={defaultItems} selectedIndex={0} />
71
+ <SegmentedControl
72
+ badges={badges}
73
+ items={defaultItems}
74
+ onChange={() => {}}
75
+ selectedIndex={0}
76
+ />
68
77
  );
69
78
  expect(toJSON()).toMatchSnapshot();
70
79
  });
@@ -72,7 +81,7 @@ describe("SegmentedControl", () => {
72
81
  it("renders with maxItems and scroll buttons", () => {
73
82
  const manyItems = ["Tab 1", "Tab 2", "Tab 3", "Tab 4", "Tab 5", "Tab 6"];
74
83
  const {toJSON} = renderWithTheme(
75
- <SegmentedControl items={manyItems} maxItems={3} selectedIndex={0} />
84
+ <SegmentedControl items={manyItems} maxItems={3} onChange={() => {}} selectedIndex={0} />
76
85
  );
77
86
  expect(toJSON()).toMatchSnapshot();
78
87
  });
@@ -80,7 +89,7 @@ describe("SegmentedControl", () => {
80
89
  it("handles scroll navigation", () => {
81
90
  const manyItems = ["Tab 1", "Tab 2", "Tab 3", "Tab 4", "Tab 5", "Tab 6"];
82
91
  const {getByText, toJSON} = renderWithTheme(
83
- <SegmentedControl items={manyItems} maxItems={3} selectedIndex={0} />
92
+ <SegmentedControl items={manyItems} maxItems={3} onChange={() => {}} selectedIndex={0} />
84
93
  );
85
94
  // Initially shows first 3 items
86
95
  expect(getByText("Tab 1")).toBeTruthy();
@@ -92,7 +101,7 @@ describe("SegmentedControl", () => {
92
101
  it("invokes handleNext when next scroll button is pressed", () => {
93
102
  const manyItems = ["Tab 1", "Tab 2", "Tab 3", "Tab 4", "Tab 5", "Tab 6"];
94
103
  const {UNSAFE_getAllByProps, queryByText} = renderWithTheme(
95
- <SegmentedControl items={manyItems} maxItems={3} selectedIndex={0} />
104
+ <SegmentedControl items={manyItems} maxItems={3} onChange={() => {}} selectedIndex={0} />
96
105
  );
97
106
  // Find the right chevron (next button) by its icon prop
98
107
  const nextIcons = UNSAFE_getAllByProps({iconName: "chevron-right"});
@@ -109,7 +118,7 @@ describe("SegmentedControl", () => {
109
118
 
110
119
  it("uses the default no-op onChange when none is provided", () => {
111
120
  const {getByText} = renderWithTheme(
112
- <SegmentedControl items={defaultItems} selectedIndex={0} />
121
+ <SegmentedControl items={defaultItems} onChange={() => {}} selectedIndex={0} />
113
122
  );
114
123
 
115
124
  expect(() => fireEvent.press(getByText("Tab 2"))).not.toThrow();
@@ -118,7 +127,7 @@ describe("SegmentedControl", () => {
118
127
  it("invokes handlePrevious when previous scroll button is pressed", () => {
119
128
  const manyItems = ["Tab 1", "Tab 2", "Tab 3", "Tab 4", "Tab 5", "Tab 6"];
120
129
  const {UNSAFE_getAllByProps, queryByText} = renderWithTheme(
121
- <SegmentedControl items={manyItems} maxItems={3} selectedIndex={0} />
130
+ <SegmentedControl items={manyItems} maxItems={3} onChange={() => {}} selectedIndex={0} />
122
131
  );
123
132
  const nextIcons = UNSAFE_getAllByProps({iconName: "chevron-right"});
124
133
  const nextPressable = nextIcons[0].parent;
@@ -469,7 +469,7 @@ const SidebarNavigationBase: FC<SidebarNavigationProps> = ({
469
469
  topItems,
470
470
  bottomItems,
471
471
  onNavigate,
472
- initialRouteName,
472
+ initialRouteName: _initialRouteName,
473
473
  screenOptions,
474
474
  panelStyle,
475
475
  itemStyle,
@@ -478,7 +478,7 @@ const SidebarNavigationBase: FC<SidebarNavigationProps> = ({
478
478
  const [isSheetOpen, setIsSheetOpen] = useState(false);
479
479
 
480
480
  return (
481
- <Navigator initialRouteName={initialRouteName} router={TabRouter} screenOptions={screenOptions}>
481
+ <Navigator router={TabRouter} screenOptions={screenOptions}>
482
482
  <View style={{flex: 1}}>
483
483
  <SidebarHeader onOpen={() => setIsSheetOpen(true)} />
484
484
  <SidebarNavigatorContent
@@ -103,7 +103,9 @@ describe("SidebarNavigationPanel", () => {
103
103
  bottomItems={bottomItems}
104
104
  onNavigate={onNavigate}
105
105
  topItems={topItems}
106
- />
106
+ >
107
+ {null}
108
+ </SidebarNavigationPanel>
107
109
  );
108
110
 
109
111
  for (const item of [...topItems, ...bottomItems]) {
@@ -134,7 +136,9 @@ describe("SidebarNavigationPanel", () => {
134
136
  bottomItems={bottomItems}
135
137
  onNavigate={onNavigate}
136
138
  topItems={topItems}
137
- />
139
+ >
140
+ {null}
141
+ </SidebarNavigationPanel>
138
142
  );
139
143
 
140
144
  fireEvent.press(getByLabelText("Settings"));
@@ -148,7 +152,9 @@ describe("SidebarNavigationPanel", () => {
148
152
  bottomItems={bottomItems}
149
153
  onNavigate={mock((_route: string) => {})}
150
154
  topItems={topItems}
151
- />
155
+ >
156
+ {null}
157
+ </SidebarNavigationPanel>
152
158
  );
153
159
 
154
160
  expect(queryByText("Home")).toBeNull();
@@ -175,7 +181,9 @@ describe("SidebarNavigationPanel", () => {
175
181
  bottomItems={bottomItems}
176
182
  onNavigate={mock((_route: string) => {})}
177
183
  topItems={topItems}
178
- />
184
+ >
185
+ {null}
186
+ </SidebarNavigationPanel>
179
187
  );
180
188
 
181
189
  const rail = UNSAFE_getAllByType(View).find((node) => node.props.onMouseEnter !== undefined);
@@ -203,7 +211,9 @@ describe("SidebarNavigationPanel", () => {
203
211
  bottomItems={bottomItems}
204
212
  onNavigate={mock((_route: string) => {})}
205
213
  topItems={topItems}
206
- />
214
+ >
215
+ {null}
216
+ </SidebarNavigationPanel>
207
217
  );
208
218
 
209
219
  const item = getByLabelText("Alerts");
@@ -229,7 +239,9 @@ describe("SidebarNavigationPanel", () => {
229
239
  onNavigate={mock((_route: string) => {})}
230
240
  panelStyle={{borderRightWidth: 4}}
231
241
  topItems={topItems}
232
- />
242
+ >
243
+ {null}
244
+ </SidebarNavigationPanel>
233
245
  );
234
246
 
235
247
  const rail = UNSAFE_getAllByType(View).find((node) => node.props.onMouseEnter !== undefined);
@@ -267,14 +267,14 @@ const SidebarNavigationBase: FC<SidebarNavigationProps> = ({
267
267
  topItems,
268
268
  bottomItems,
269
269
  onNavigate,
270
- initialRouteName,
270
+ initialRouteName: _initialRouteName,
271
271
  screenOptions,
272
272
  panelStyle,
273
273
  itemStyle,
274
274
  children,
275
275
  }) => {
276
276
  return (
277
- <Navigator initialRouteName={initialRouteName} router={TabRouter} screenOptions={screenOptions}>
277
+ <Navigator router={TabRouter} screenOptions={screenOptions}>
278
278
  <SidebarNavigatorContent
279
279
  bottomItems={bottomItems}
280
280
  itemStyle={itemStyle}
@@ -1,9 +1,10 @@
1
1
  import {afterEach, describe, expect, it, mock} from "bun:test";
2
2
  import {act, fireEvent} from "@testing-library/react-native";
3
3
  import {View} from "react-native";
4
+ import type {ReactTestInstance} from "react-test-renderer";
4
5
 
5
6
  import {Signature} from "./Signature";
6
- import {renderWithTheme} from "./test-utils";
7
+ import {findAllByHostType, findByHostType, renderWithTheme} from "./test-utils";
7
8
 
8
9
  const createMockContext = (): Record<string, ReturnType<typeof mock>> => ({
9
10
  beginPath: mock(() => {}),
@@ -14,14 +15,10 @@ const createMockContext = (): Record<string, ReturnType<typeof mock>> => ({
14
15
  });
15
16
 
16
17
  const patchCanvasRefs = (
17
- container: {
18
- findAll: (
19
- predicate: (node: {type: string}) => boolean
20
- ) => Array<{props: Record<string, unknown>}>;
21
- },
18
+ container: ReactTestInstance,
22
19
  ctx: Record<string, ReturnType<typeof mock>>
23
20
  ): HTMLCanvasElement => {
24
- const canvasNodes = container.findAll((node: {type: string}) => node.type === "canvas");
21
+ const canvasNodes = findAllByHostType(container, "canvas");
25
22
  const canvasNode = canvasNodes[0];
26
23
  const canvas = {
27
24
  getContext: mock(() => ctx),
@@ -65,8 +62,8 @@ describe("Signature", () => {
65
62
 
66
63
  it("scales the web canvas to the available container width", () => {
67
64
  const mockOnChange = mock(() => {});
68
- const {UNSAFE_getByType} = renderWithTheme(<Signature onChange={mockOnChange} />);
69
- const canvas = UNSAFE_getByType("canvas");
65
+ const {UNSAFE_root} = renderWithTheme(<Signature onChange={mockOnChange} />);
66
+ const canvas = findByHostType(UNSAFE_root, "canvas");
70
67
  expect(canvas.props.style).toMatchObject({maxWidth: "100%", width: "100%"});
71
68
  });
72
69
 
@@ -81,8 +78,8 @@ describe("Signature", () => {
81
78
  const mockOnChange = mock(() => {});
82
79
  const moveTo = mock(() => {});
83
80
  const lineTo = mock(() => {});
84
- const {UNSAFE_getByType} = renderWithTheme(<Signature onChange={mockOnChange} />);
85
- const canvas = UNSAFE_getByType("canvas");
81
+ const {UNSAFE_root} = renderWithTheme(<Signature onChange={mockOnChange} />);
82
+ const canvas = findByHostType(UNSAFE_root, "canvas");
86
83
  canvas.props.ref.current = {
87
84
  clientHeight: 180,
88
85
  clientWidth: 150,
@@ -131,7 +128,7 @@ describe("Signature", () => {
131
128
 
132
129
  patchCanvasRefs(UNSAFE_root, ctx);
133
130
 
134
- const canvasNodes = UNSAFE_root.findAll((node: {type: string}) => node.type === "canvas");
131
+ const canvasNodes = findAllByHostType(UNSAFE_root, "canvas");
135
132
  const canvasProps = canvasNodes[0].props as Record<string, (...args: unknown[]) => void>;
136
133
 
137
134
  act(() => {
@@ -153,7 +150,7 @@ describe("Signature", () => {
153
150
 
154
151
  patchCanvasRefs(UNSAFE_root, ctx);
155
152
 
156
- const canvasNodes = UNSAFE_root.findAll((node: {type: string}) => node.type === "canvas");
153
+ const canvasNodes = findAllByHostType(UNSAFE_root, "canvas");
157
154
  const canvasProps = canvasNodes[0].props as Record<string, (...args: unknown[]) => void>;
158
155
 
159
156
  act(() => {
@@ -181,7 +178,7 @@ describe("Signature", () => {
181
178
 
182
179
  patchCanvasRefs(UNSAFE_root, ctx);
183
180
 
184
- const canvasNodes = UNSAFE_root.findAll((node: {type: string}) => node.type === "canvas");
181
+ const canvasNodes = findAllByHostType(UNSAFE_root, "canvas");
185
182
  const canvasProps = canvasNodes[0].props as Record<string, (...args: unknown[]) => void>;
186
183
 
187
184
  act(() => {
@@ -202,7 +199,7 @@ describe("Signature", () => {
202
199
 
203
200
  const canvas = patchCanvasRefs(UNSAFE_root, ctx);
204
201
 
205
- const canvasNodes = UNSAFE_root.findAll((node: {type: string}) => node.type === "canvas");
202
+ const canvasNodes = findAllByHostType(UNSAFE_root, "canvas");
206
203
  const canvasProps = canvasNodes[0].props as Record<string, (...args: unknown[]) => void>;
207
204
 
208
205
  // Start drawing
@@ -243,7 +240,7 @@ describe("Signature", () => {
243
240
 
244
241
  patchCanvasRefs(UNSAFE_root, ctx);
245
242
 
246
- const canvasNodes = UNSAFE_root.findAll((node: {type: string}) => node.type === "canvas");
243
+ const canvasNodes = findAllByHostType(UNSAFE_root, "canvas");
247
244
  const canvasProps = canvasNodes[0].props as Record<string, (...args: unknown[]) => void>;
248
245
 
249
246
  // pointerDown without any move (no drawing)
@@ -273,7 +270,7 @@ describe("Signature", () => {
273
270
 
274
271
  patchCanvasRefs(UNSAFE_root, ctx);
275
272
 
276
- const canvasNodes = UNSAFE_root.findAll((node: {type: string}) => node.type === "canvas");
273
+ const canvasNodes = findAllByHostType(UNSAFE_root, "canvas");
277
274
  const canvasProps = canvasNodes[0].props as Record<string, (...args: unknown[]) => void>;
278
275
 
279
276
  act(() => {
@@ -295,7 +292,7 @@ describe("Signature", () => {
295
292
 
296
293
  patchCanvasRefs(UNSAFE_root, ctx);
297
294
 
298
- const canvasNodes = UNSAFE_root.findAll((node: {type: string}) => node.type === "canvas");
295
+ const canvasNodes = findAllByHostType(UNSAFE_root, "canvas");
299
296
  const canvasProps = canvasNodes[0].props as Record<string, (...args: unknown[]) => void>;
300
297
 
301
298
  // Draw something
@@ -331,7 +328,7 @@ describe("Signature", () => {
331
328
 
332
329
  patchCanvasRefs(UNSAFE_root, ctx);
333
330
 
334
- const canvasNodes = UNSAFE_root.findAll((node: {type: string}) => node.type === "canvas");
331
+ const canvasNodes = findAllByHostType(UNSAFE_root, "canvas");
335
332
  const canvasProps = canvasNodes[0].props as Record<string, (...args: unknown[]) => void>;
336
333
 
337
334
  // Draw
@@ -366,10 +363,10 @@ describe("Signature", () => {
366
363
  it("ignores pointer down when the canvas ref is missing", () => {
367
364
  const mockOnChange = mock(() => {});
368
365
  const mockOnStart = mock(() => {});
369
- const {UNSAFE_getByType} = renderWithTheme(
366
+ const {UNSAFE_root} = renderWithTheme(
370
367
  <Signature onChange={mockOnChange} onStart={mockOnStart} />
371
368
  );
372
- const canvas = UNSAFE_getByType("canvas");
369
+ const canvas = findByHostType(UNSAFE_root, "canvas");
373
370
  canvas.props.ref.current = null;
374
371
 
375
372
  act(() => {
@@ -385,8 +382,8 @@ describe("Signature", () => {
385
382
  it("falls back to raw offsets when the canvas has no measurable size", () => {
386
383
  const mockOnChange = mock(() => {});
387
384
  const moveTo = mock(() => {});
388
- const {UNSAFE_getByType} = renderWithTheme(<Signature onChange={mockOnChange} />);
389
- const canvas = UNSAFE_getByType("canvas");
385
+ const {UNSAFE_root} = renderWithTheme(<Signature onChange={mockOnChange} />);
386
+ const canvas = findByHostType(UNSAFE_root, "canvas");
390
387
  canvas.props.ref.current = {
391
388
  clientHeight: 0,
392
389
  clientWidth: 0,
package/src/Skeleton.tsx CHANGED
@@ -242,7 +242,7 @@ export const Skeleton: FC<SkeletonProps> = ({
242
242
  }),
243
243
  }
244
244
  : {}),
245
- } as Animated.WithAnimatedObject<ViewStyle>;
245
+ } as Animated.WithAnimatedValue<ViewStyle>;
246
246
 
247
247
  return (
248
248
  <Animated.View {...HIDDEN_FROM_ACCESSIBILITY} style={style} {...toTestProps(testID)}>
@@ -272,7 +272,7 @@ describe("Slider", () => {
272
272
  const {getByText} = renderWithTheme(
273
273
  <Slider
274
274
  labels={{
275
- custom: [{label: "Middle", value: 50}],
275
+ custom: [{index: 0.5, label: "Middle"}],
276
276
  max: "High",
277
277
  min: "Low",
278
278
  }}
@@ -1,7 +1,15 @@
1
1
  import {afterAll, afterEach, beforeEach, describe, expect, it, mock, spyOn} from "bun:test";
2
2
  import {act, fireEvent} from "@testing-library/react-native";
3
3
  import {forwardRef, type ReactElement, type ReactNode, type Ref, useImperativeHandle} from "react";
4
- import {type ScaledSize, ScrollView, StyleSheet, useWindowDimensions, View} from "react-native";
4
+ import {
5
+ type ScaledSize,
6
+ ScrollView,
7
+ type StyleProp,
8
+ StyleSheet,
9
+ useWindowDimensions,
10
+ View,
11
+ type ViewStyle,
12
+ } from "react-native";
5
13
  import type {ReactTestInstance} from "react-test-renderer";
6
14
 
7
15
  import {getRounding, getSpacing} from "./Common";
@@ -53,11 +61,13 @@ const setWindowWidth = (width: number): (() => void) => {
53
61
  };
54
62
  };
55
63
 
56
- const styleWidth = (style: unknown): unknown => StyleSheet.flatten(style)?.width;
64
+ const styleWidth = (style: StyleProp<ViewStyle>): ViewStyle["width"] =>
65
+ StyleSheet.flatten(style)?.width;
57
66
 
58
- const styleBorderRadius = (style: unknown): unknown => StyleSheet.flatten(style)?.borderRadius;
67
+ const styleBorderRadius = (style: StyleProp<ViewStyle>): ViewStyle["borderRadius"] =>
68
+ StyleSheet.flatten(style)?.borderRadius;
59
69
 
60
- const flattenedStyle = (style: unknown): ReturnType<typeof StyleSheet.flatten> => {
70
+ const flattenedStyle = (style: StyleProp<ViewStyle>): ViewStyle => {
61
71
  return StyleSheet.flatten(style) ?? {};
62
72
  };
63
73
 
@@ -1102,7 +1112,7 @@ describe("SplitPage", () => {
1102
1112
  const expectClippingPane = (
1103
1113
  pane: ReactTestInstance,
1104
1114
  borderRadius: number,
1105
- width: number | string
1115
+ width: ViewStyle["width"]
1106
1116
  ): void => {
1107
1117
  const style = flattenedStyle(pane.props.style);
1108
1118
  expect(style.borderRadius).toBe(borderRadius);
@@ -8,14 +8,14 @@ import {renderWithTheme} from "./test-utils";
8
8
  describe("TapToEdit", () => {
9
9
  it("renders correctly with text value", () => {
10
10
  const {toJSON} = renderWithTheme(
11
- <TapToEdit setValue={() => {}} title="Name" value="John Doe" />
11
+ <TapToEdit setValue={() => {}} title="Name" type="text" value="John Doe" />
12
12
  );
13
13
  expect(toJSON()).toMatchSnapshot();
14
14
  });
15
15
 
16
16
  it("displays title and value", () => {
17
17
  const {getByText} = renderWithTheme(
18
- <TapToEdit setValue={() => {}} title="Email" value="test@example.com" />
18
+ <TapToEdit setValue={() => {}} title="Email" type="text" value="test@example.com" />
19
19
  );
20
20
  expect(getByText("Email")).toBeTruthy();
21
21
  expect(getByText("test@example.com")).toBeTruthy();
@@ -23,21 +23,27 @@ describe("TapToEdit", () => {
23
23
 
24
24
  it("renders non-editable when editable is false", () => {
25
25
  const {toJSON} = renderWithTheme(
26
- <TapToEdit editable={false} title="Read Only" value="Cannot edit this" />
26
+ <TapToEdit editable={false} title="Read Only" type="text" value="Cannot edit this" />
27
27
  );
28
28
  expect(toJSON()).toMatchSnapshot();
29
29
  });
30
30
 
31
31
  it("renders edit icon when editable", () => {
32
32
  const {toJSON} = renderWithTheme(
33
- <TapToEdit editable setValue={() => {}} title="Editable Field" value="Click to edit" />
33
+ <TapToEdit
34
+ editable
35
+ setValue={() => {}}
36
+ title="Editable Field"
37
+ type="text"
38
+ value="Click to edit"
39
+ />
34
40
  );
35
41
  expect(toJSON()).toMatchSnapshot();
36
42
  });
37
43
 
38
44
  it("shows editing mode when isEditing is true", () => {
39
45
  const {toJSON} = renderWithTheme(
40
- <TapToEdit isEditing setValue={() => {}} title="Field" value="Editing..." />
46
+ <TapToEdit isEditing setValue={() => {}} title="Field" type="text" value="Editing..." />
41
47
  );
42
48
  expect(toJSON()).toMatchSnapshot();
43
49
  });
@@ -49,6 +55,7 @@ describe("TapToEdit", () => {
49
55
  onlyShowHelperTextWhileEditing={false}
50
56
  setValue={() => {}}
51
57
  title="Name"
58
+ type="text"
52
59
  value=""
53
60
  />
54
61
  );
@@ -75,6 +82,7 @@ describe("TapToEdit", () => {
75
82
  editable={false}
76
83
  title="Custom"
77
84
  transform={(val) => `Transformed: ${val}`}
85
+ type="text"
78
86
  value="data"
79
87
  />
80
88
  );
@@ -95,7 +103,13 @@ describe("TapToEdit", () => {
95
103
 
96
104
  it("renders multiselect type as comma-joined string", () => {
97
105
  const {getByText} = renderWithTheme(
98
- <TapToEdit editable={false} title="Tags" type="multiselect" value={["a", "b", "c"]} />
106
+ <TapToEdit
107
+ editable={false}
108
+ options={[]}
109
+ title="Tags"
110
+ type="multiselect"
111
+ value={["a", "b", "c"]}
112
+ />
99
113
  );
100
114
  expect(getByText("a, b, c")).toBeTruthy();
101
115
  });
@@ -139,7 +153,7 @@ describe("TapToEdit", () => {
139
153
  });
140
154
 
141
155
  it("invokes Linking.openURL for url type when clicked", async () => {
142
- const openURLSpy = spyOn(Linking, "openURL").mockImplementation(() => Promise.resolve(true));
156
+ const openURLSpy = spyOn(Linking, "openURL").mockImplementation(() => Promise.resolve());
143
157
 
144
158
  const {getByLabelText} = renderWithTheme(
145
159
  <TapToEdit editable={false} title="Site" type="url" value="https://example.com" />
@@ -154,7 +168,7 @@ describe("TapToEdit", () => {
154
168
  });
155
169
 
156
170
  it("invokes Linking.openURL with google maps for address type when clicked", async () => {
157
- const openURLSpy = spyOn(Linking, "openURL").mockImplementation(() => Promise.resolve(true));
171
+ const openURLSpy = spyOn(Linking, "openURL").mockImplementation(() => Promise.resolve());
158
172
 
159
173
  const {getByLabelText} = renderWithTheme(
160
174
  <TapToEdit
@@ -177,14 +191,14 @@ describe("TapToEdit", () => {
177
191
 
178
192
  it("throws when editable is true and setValue is not provided", () => {
179
193
  expect(() =>
180
- renderWithTheme(<TapToEdit editable title="Required Save" value="foo" />)
194
+ renderWithTheme(<TapToEdit editable title="Required Save" type="text" value="foo" />)
181
195
  ).toThrow();
182
196
  });
183
197
 
184
198
  it("enters editing mode when Edit button is pressed", async () => {
185
199
  const setValue = mock(() => {});
186
200
  const {getByLabelText, queryByText} = renderWithTheme(
187
- <TapToEdit setValue={setValue} title="Name" value="Jane" />
201
+ <TapToEdit setValue={setValue} title="Name" type="text" value="Jane" />
188
202
  );
189
203
  await act(async () => {
190
204
  fireEvent.press(getByLabelText("Edit"));
@@ -196,7 +210,7 @@ describe("TapToEdit", () => {
196
210
  it("calls setValue with initial value and exits editing on Cancel", async () => {
197
211
  const setValue = mock(() => {});
198
212
  const {getByLabelText, getByText} = renderWithTheme(
199
- <TapToEdit setValue={setValue} title="Name" value="Jane" />
213
+ <TapToEdit setValue={setValue} title="Name" type="text" value="Jane" />
200
214
  );
201
215
  await act(async () => {
202
216
  fireEvent.press(getByLabelText("Edit"));
@@ -210,7 +224,7 @@ describe("TapToEdit", () => {
210
224
  it("reverts to original value (not edited value) when Cancel is pressed", async () => {
211
225
  const setValue = mock((_v: unknown) => {});
212
226
  const {getByLabelText, getByText} = renderWithTheme(
213
- <TapToEdit setValue={setValue} title="Name" value="Jane" />
227
+ <TapToEdit setValue={setValue} title="Name" type="text" value="Jane" />
214
228
  );
215
229
  await act(async () => {
216
230
  fireEvent.press(getByLabelText("Edit"));
@@ -227,7 +241,14 @@ describe("TapToEdit", () => {
227
241
  const setValue = mock(() => {});
228
242
  const onSave = mock(() => Promise.resolve());
229
243
  const {getByLabelText, getByText} = renderWithTheme(
230
- <TapToEdit onSave={onSave} setValue={setValue} showClearButton title="Name" value="Jane" />
244
+ <TapToEdit
245
+ onSave={onSave}
246
+ setValue={setValue}
247
+ showClearButton
248
+ title="Name"
249
+ type="text"
250
+ value="Jane"
251
+ />
231
252
  );
232
253
  await act(async () => {
233
254
  fireEvent.press(getByLabelText("Edit"));
@@ -243,7 +264,7 @@ describe("TapToEdit", () => {
243
264
  const setValue = mock(() => {});
244
265
  const onSave = mock(() => Promise.resolve());
245
266
  const {getByLabelText, getByText} = renderWithTheme(
246
- <TapToEdit onSave={onSave} setValue={setValue} title="Name" value="Jane" />
267
+ <TapToEdit onSave={onSave} setValue={setValue} title="Name" type="text" value="Jane" />
247
268
  );
248
269
  await act(async () => {
249
270
  fireEvent.press(getByLabelText("Edit"));
@@ -261,7 +282,7 @@ describe("TapToEdit", () => {
261
282
  console.error = errorMock;
262
283
 
263
284
  const {getByLabelText, getByText} = renderWithTheme(
264
- <TapToEdit setValue={setValue} title="Name" value="Jane" />
285
+ <TapToEdit setValue={setValue} title="Name" type="text" value="Jane" />
265
286
  );
266
287
  await act(async () => {
267
288
  fireEvent.press(getByLabelText("Edit"));
@@ -389,6 +410,7 @@ describe("TapToEdit - additional function coverage", () => {
389
410
  editable={false}
390
411
  helperText="Should be hidden in title"
391
412
  title="Field"
413
+ type="text"
392
414
  value="val"
393
415
  />
394
416
  );
@@ -406,7 +428,7 @@ describe("TapToEdit - additional function coverage", () => {
406
428
 
407
429
  it("forwards testID to the edit control", () => {
408
430
  const {getByTestId} = renderWithTheme(
409
- <TapToEdit setValue={() => {}} testID="profile.name" title="Name" value="Jane" />
431
+ <TapToEdit setValue={() => {}} testID="profile.name" title="Name" type="text" value="Jane" />
410
432
  );
411
433
  expect(getByTestId("profile.name.edit-clickable")).toBeTruthy();
412
434
  });
@@ -419,6 +441,7 @@ describe("TapToEdit - additional function coverage", () => {
419
441
  showClearButton
420
442
  testID="profile.name"
421
443
  title="Name"
444
+ type="text"
422
445
  value="Jane"
423
446
  />
424
447
  );
@@ -435,7 +458,7 @@ describe("TapToEdit - additional function coverage", () => {
435
458
 
436
459
  it("does not set action testIDs when testID is omitted", async () => {
437
460
  const {getByLabelText, queryByTestId} = renderWithTheme(
438
- <TapToEdit setValue={() => {}} showClearButton title="Name" value="Jane" />
461
+ <TapToEdit setValue={() => {}} showClearButton title="Name" type="text" value="Jane" />
439
462
  );
440
463
 
441
464
  expect(queryByTestId("undefined.edit-clickable")).toBeNull();
package/src/TapToEdit.tsx CHANGED
@@ -27,7 +27,7 @@ const TapToEditTitle: FC<{
27
27
  );
28
28
  };
29
29
 
30
- export const formatAddress = (address: AddressInterface, asString = false): string => {
30
+ export const formatAddress = (address: Partial<AddressInterface>, asString = false): string => {
31
31
  let city = "";
32
32
  if (address?.city) {
33
33
  city = address?.state || address.zipcode ? `${address.city}, ` : `${address.city}`;
@@ -1,4 +1,4 @@
1
- import type {mock} from "bun:test";
1
+ import {describe, it, type mock} from "bun:test";
2
2
  import {useFonts as useTextFonts} from "@expo-google-fonts/nunito";
3
3
  import {useFonts as useHeadingFonts} from "@expo-google-fonts/titillium-web";
4
4
  import {render} from "@testing-library/react-native";
package/src/Text.test.tsx CHANGED
@@ -1,11 +1,11 @@
1
1
  import {describe, expect, it, spyOn} from "bun:test";
2
2
  import {render} from "@testing-library/react-native";
3
3
  import {createRef} from "react";
4
- import type {Text as NativeText} from "react-native";
4
+ import type {TextInstance as NativeText, TextProps} from "react-native";
5
5
 
6
6
  import {Text} from "./Text";
7
7
  import {ThemeProvider} from "./Theme";
8
- import {renderWithTheme} from "./test-utils";
8
+ import {elementProps, renderWithTheme} from "./test-utils";
9
9
 
10
10
  describe("Text", () => {
11
11
  it("renders correctly with default props", () => {
@@ -116,7 +116,7 @@ describe("Text", () => {
116
116
 
117
117
  // Color tests
118
118
  it("renders with secondary color", () => {
119
- const {toJSON} = renderWithTheme(<Text color="secondary">Secondary color</Text>);
119
+ const {toJSON} = renderWithTheme(<Text color="secondaryDark">Secondary color</Text>);
120
120
  expect(toJSON()).toMatchSnapshot();
121
121
  });
122
122
 
@@ -177,7 +177,7 @@ describe("Text", () => {
177
177
  </Text>,
178
178
  {
179
179
  createNodeMock: (element) =>
180
- element.props.accessibilityRole === "header" ? nativeText : null,
180
+ elementProps<TextProps>(element).accessibilityRole === "header" ? nativeText : null,
181
181
  wrapper: ThemeProvider,
182
182
  }
183
183
  );