@terreno/ui 0.0.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 (446) hide show
  1. package/LICENSE +203 -0
  2. package/README.md +160 -0
  3. package/dist/Accordion.d.ts +3 -0
  4. package/dist/Accordion.js +30 -0
  5. package/dist/Accordion.js.map +1 -0
  6. package/dist/ActionSheet.d.ts +169 -0
  7. package/dist/ActionSheet.js +637 -0
  8. package/dist/ActionSheet.js.map +1 -0
  9. package/dist/AddressField.d.ts +3 -0
  10. package/dist/AddressField.js +18 -0
  11. package/dist/AddressField.js.map +1 -0
  12. package/dist/Avatar.d.ts +3 -0
  13. package/dist/Avatar.js +189 -0
  14. package/dist/Avatar.js.map +1 -0
  15. package/dist/Badge.d.ts +3 -0
  16. package/dist/Badge.js +100 -0
  17. package/dist/Badge.js.map +1 -0
  18. package/dist/Banner.d.ts +4 -0
  19. package/dist/Banner.js +103 -0
  20. package/dist/Banner.js.map +1 -0
  21. package/dist/Body.d.ts +3 -0
  22. package/dist/Body.js +17 -0
  23. package/dist/Body.js.map +1 -0
  24. package/dist/BooleanField.d.ts +3 -0
  25. package/dist/BooleanField.js +89 -0
  26. package/dist/BooleanField.js.map +1 -0
  27. package/dist/Box.d.ts +3 -0
  28. package/dist/Box.js +289 -0
  29. package/dist/Box.js.map +1 -0
  30. package/dist/Button.d.ts +3 -0
  31. package/dist/Button.js +105 -0
  32. package/dist/Button.js.map +1 -0
  33. package/dist/Card.d.ts +2 -0
  34. package/dist/Card.js +18 -0
  35. package/dist/Card.js.map +1 -0
  36. package/dist/CheckBox.d.ts +3 -0
  37. package/dist/CheckBox.js +28 -0
  38. package/dist/CheckBox.js.map +1 -0
  39. package/dist/Common.d.ts +2325 -0
  40. package/dist/Common.js +47 -0
  41. package/dist/Common.js.map +1 -0
  42. package/dist/CommonIconTypes.d.ts +3 -0
  43. package/dist/CommonIconTypes.js +2 -0
  44. package/dist/CommonIconTypes.js.map +1 -0
  45. package/dist/Constants.d.ts +12685 -0
  46. package/dist/Constants.js +3310 -0
  47. package/dist/Constants.js.map +1 -0
  48. package/dist/CustomSelectField.d.ts +3 -0
  49. package/dist/CustomSelectField.js +59 -0
  50. package/dist/CustomSelectField.js.map +1 -0
  51. package/dist/DataTable.d.ts +3 -0
  52. package/dist/DataTable.js +190 -0
  53. package/dist/DataTable.js.map +1 -0
  54. package/dist/DateTimeActionSheet.d.ts +2 -0
  55. package/dist/DateTimeActionSheet.js +270 -0
  56. package/dist/DateTimeActionSheet.js.map +1 -0
  57. package/dist/DateTimeField.d.ts +3 -0
  58. package/dist/DateTimeField.js +514 -0
  59. package/dist/DateTimeField.js.map +1 -0
  60. package/dist/DateUtilities.d.ts +57 -0
  61. package/dist/DateUtilities.js +308 -0
  62. package/dist/DateUtilities.js.map +1 -0
  63. package/dist/DecimalRangeActionSheet.d.ts +6 -0
  64. package/dist/DecimalRangeActionSheet.js +45 -0
  65. package/dist/DecimalRangeActionSheet.js.map +1 -0
  66. package/dist/DismissButton.d.ts +3 -0
  67. package/dist/DismissButton.js +12 -0
  68. package/dist/DismissButton.js.map +1 -0
  69. package/dist/EmailField.d.ts +3 -0
  70. package/dist/EmailField.js +48 -0
  71. package/dist/EmailField.js.map +1 -0
  72. package/dist/EmojiSelector.d.ts +113 -0
  73. package/dist/EmojiSelector.js +322 -0
  74. package/dist/EmojiSelector.js.map +1 -0
  75. package/dist/ErrorBoundary.d.ts +19 -0
  76. package/dist/ErrorBoundary.js +30 -0
  77. package/dist/ErrorBoundary.js.map +1 -0
  78. package/dist/ErrorPage.d.ts +6 -0
  79. package/dist/ErrorPage.js +15 -0
  80. package/dist/ErrorPage.js.map +1 -0
  81. package/dist/Field.d.ts +3 -0
  82. package/dist/Field.js +80 -0
  83. package/dist/Field.js.map +1 -0
  84. package/dist/FlatList.d.ts +2 -0
  85. package/dist/FlatList.js +3 -0
  86. package/dist/FlatList.js.map +1 -0
  87. package/dist/Heading.d.ts +3 -0
  88. package/dist/Heading.js +43 -0
  89. package/dist/Heading.js.map +1 -0
  90. package/dist/HeightActionSheet.d.ts +11 -0
  91. package/dist/HeightActionSheet.js +46 -0
  92. package/dist/HeightActionSheet.js.map +1 -0
  93. package/dist/Hyperlink.d.ts +30 -0
  94. package/dist/Hyperlink.js +144 -0
  95. package/dist/Hyperlink.js.map +1 -0
  96. package/dist/Icon.d.ts +3 -0
  97. package/dist/Icon.js +15 -0
  98. package/dist/Icon.js.map +1 -0
  99. package/dist/IconButton.d.ts +3 -0
  100. package/dist/IconButton.js +111 -0
  101. package/dist/IconButton.js.map +1 -0
  102. package/dist/Image.d.ts +8 -0
  103. package/dist/Image.js +37 -0
  104. package/dist/Image.js.map +1 -0
  105. package/dist/ImageBackground.d.ts +10 -0
  106. package/dist/ImageBackground.js +9 -0
  107. package/dist/ImageBackground.js.map +1 -0
  108. package/dist/InfoModalIcon.d.ts +3 -0
  109. package/dist/InfoModalIcon.js +10 -0
  110. package/dist/InfoModalIcon.js.map +1 -0
  111. package/dist/InfoTooltipButton.d.ts +3 -0
  112. package/dist/InfoTooltipButton.js +6 -0
  113. package/dist/InfoTooltipButton.js.map +1 -0
  114. package/dist/Link.d.ts +3 -0
  115. package/dist/Link.js +10 -0
  116. package/dist/Link.js.map +1 -0
  117. package/dist/MarkdownView.d.ts +5 -0
  118. package/dist/MarkdownView.js +44 -0
  119. package/dist/MarkdownView.js.map +1 -0
  120. package/dist/MediaQuery.d.ts +4 -0
  121. package/dist/MediaQuery.js +52 -0
  122. package/dist/MediaQuery.js.map +1 -0
  123. package/dist/MobileAddressAutoComplete.d.ts +2 -0
  124. package/dist/MobileAddressAutoComplete.js +54 -0
  125. package/dist/MobileAddressAutoComplete.js.map +1 -0
  126. package/dist/Modal.d.ts +3 -0
  127. package/dist/Modal.js +127 -0
  128. package/dist/Modal.js.map +1 -0
  129. package/dist/ModalSheet.d.ts +6 -0
  130. package/dist/ModalSheet.js +42 -0
  131. package/dist/ModalSheet.js.map +1 -0
  132. package/dist/MultiselectField.d.ts +3 -0
  133. package/dist/MultiselectField.js +45 -0
  134. package/dist/MultiselectField.js.map +1 -0
  135. package/dist/NumberField.d.ts +3 -0
  136. package/dist/NumberField.js +60 -0
  137. package/dist/NumberField.js.map +1 -0
  138. package/dist/NumberPickerActionSheet.d.ts +7 -0
  139. package/dist/NumberPickerActionSheet.js +22 -0
  140. package/dist/NumberPickerActionSheet.js.map +1 -0
  141. package/dist/OpenAPIContext.d.ts +4 -0
  142. package/dist/OpenAPIContext.js +53 -0
  143. package/dist/OpenAPIContext.js.map +1 -0
  144. package/dist/Page.d.ts +7 -0
  145. package/dist/Page.js +24 -0
  146. package/dist/Page.js.map +1 -0
  147. package/dist/Pagination.d.ts +3 -0
  148. package/dist/Pagination.js +106 -0
  149. package/dist/Pagination.js.map +1 -0
  150. package/dist/PasswordField.d.ts +2 -0
  151. package/dist/PasswordField.js +6 -0
  152. package/dist/PasswordField.js.map +1 -0
  153. package/dist/Permissions.d.ts +2 -0
  154. package/dist/Permissions.js +35 -0
  155. package/dist/Permissions.js.map +1 -0
  156. package/dist/PhoneNumberField.d.ts +3 -0
  157. package/dist/PhoneNumberField.js +83 -0
  158. package/dist/PhoneNumberField.js.map +1 -0
  159. package/dist/PickerSelect.d.ts +46 -0
  160. package/dist/PickerSelect.js +306 -0
  161. package/dist/PickerSelect.js.map +1 -0
  162. package/dist/Radio.d.ts +3 -0
  163. package/dist/Radio.js +21 -0
  164. package/dist/Radio.js.map +1 -0
  165. package/dist/RadioField.d.ts +3 -0
  166. package/dist/RadioField.js +16 -0
  167. package/dist/RadioField.js.map +1 -0
  168. package/dist/ScrollView.d.ts +2 -0
  169. package/dist/ScrollView.js +3 -0
  170. package/dist/ScrollView.js.map +1 -0
  171. package/dist/SectionDivider.d.ts +2 -0
  172. package/dist/SectionDivider.js +12 -0
  173. package/dist/SectionDivider.js.map +1 -0
  174. package/dist/SegmentedControl.d.ts +3 -0
  175. package/dist/SegmentedControl.js +65 -0
  176. package/dist/SegmentedControl.js.map +1 -0
  177. package/dist/SelectBadge.d.ts +3 -0
  178. package/dist/SelectBadge.js +166 -0
  179. package/dist/SelectBadge.js.map +1 -0
  180. package/dist/SelectField.d.ts +3 -0
  181. package/dist/SelectField.js +16 -0
  182. package/dist/SelectField.js.map +1 -0
  183. package/dist/SideDrawer.d.ts +3 -0
  184. package/dist/SideDrawer.js +32 -0
  185. package/dist/SideDrawer.js.map +1 -0
  186. package/dist/Signature.d.ts +8 -0
  187. package/dist/Signature.js +21 -0
  188. package/dist/Signature.js.map +1 -0
  189. package/dist/Signature.native.d.ts +8 -0
  190. package/dist/Signature.native.js +26 -0
  191. package/dist/Signature.native.js.map +1 -0
  192. package/dist/SignatureField.d.ts +3 -0
  193. package/dist/SignatureField.js +42 -0
  194. package/dist/SignatureField.js.map +1 -0
  195. package/dist/Slider.d.ts +3 -0
  196. package/dist/Slider.js +78 -0
  197. package/dist/Slider.js.map +1 -0
  198. package/dist/Spinner.d.ts +3 -0
  199. package/dist/Spinner.js +33 -0
  200. package/dist/Spinner.js.map +1 -0
  201. package/dist/SplitPage.d.ts +2 -0
  202. package/dist/SplitPage.js +139 -0
  203. package/dist/SplitPage.js.map +1 -0
  204. package/dist/SplitPage.native.d.ts +2 -0
  205. package/dist/SplitPage.native.js +75 -0
  206. package/dist/SplitPage.native.js.map +1 -0
  207. package/dist/TapToEdit.d.ts +4 -0
  208. package/dist/TapToEdit.js +170 -0
  209. package/dist/TapToEdit.js.map +1 -0
  210. package/dist/TerrenoProvider.d.ts +6 -0
  211. package/dist/TerrenoProvider.js +10 -0
  212. package/dist/TerrenoProvider.js.map +1 -0
  213. package/dist/Text.d.ts +3 -0
  214. package/dist/Text.js +95 -0
  215. package/dist/Text.js.map +1 -0
  216. package/dist/TextArea.d.ts +3 -0
  217. package/dist/TextArea.js +6 -0
  218. package/dist/TextArea.js.map +1 -0
  219. package/dist/TextField.d.ts +3 -0
  220. package/dist/TextField.js +144 -0
  221. package/dist/TextField.js.map +1 -0
  222. package/dist/TextFieldNumberActionSheet.d.ts +7 -0
  223. package/dist/TextFieldNumberActionSheet.js +20 -0
  224. package/dist/TextFieldNumberActionSheet.js.map +1 -0
  225. package/dist/Theme.d.ts +96 -0
  226. package/dist/Theme.js +213 -0
  227. package/dist/Theme.js.map +1 -0
  228. package/dist/TimezonePicker.d.ts +11 -0
  229. package/dist/TimezonePicker.js +27 -0
  230. package/dist/TimezonePicker.js.map +1 -0
  231. package/dist/Toast.d.ts +23 -0
  232. package/dist/Toast.js +157 -0
  233. package/dist/Toast.js.map +1 -0
  234. package/dist/Tooltip.d.ts +3 -0
  235. package/dist/Tooltip.js +289 -0
  236. package/dist/Tooltip.js.map +1 -0
  237. package/dist/UnifiedAddressAutoComplete.d.ts +2 -0
  238. package/dist/UnifiedAddressAutoComplete.js +23 -0
  239. package/dist/UnifiedAddressAutoComplete.js.map +1 -0
  240. package/dist/Unifier.d.ts +43 -0
  241. package/dist/Unifier.js +154 -0
  242. package/dist/Unifier.js.map +1 -0
  243. package/dist/Utilities.d.ts +56 -0
  244. package/dist/Utilities.js +193 -0
  245. package/dist/Utilities.js.map +1 -0
  246. package/dist/WebAddressAutocomplete.d.ts +3 -0
  247. package/dist/WebAddressAutocomplete.js +61 -0
  248. package/dist/WebAddressAutocomplete.js.map +1 -0
  249. package/dist/fieldElements/FieldError.d.ts +6 -0
  250. package/dist/fieldElements/FieldError.js +9 -0
  251. package/dist/fieldElements/FieldError.js.map +1 -0
  252. package/dist/fieldElements/FieldHelperText.d.ts +6 -0
  253. package/dist/fieldElements/FieldHelperText.js +8 -0
  254. package/dist/fieldElements/FieldHelperText.js.map +1 -0
  255. package/dist/fieldElements/FieldTitle.d.ts +6 -0
  256. package/dist/fieldElements/FieldTitle.js +16 -0
  257. package/dist/fieldElements/FieldTitle.js.map +1 -0
  258. package/dist/fieldElements/index.d.ts +3 -0
  259. package/dist/fieldElements/index.js +4 -0
  260. package/dist/fieldElements/index.js.map +1 -0
  261. package/dist/icons/MobileIcon.d.ts +2 -0
  262. package/dist/icons/MobileIcon.js +18 -0
  263. package/dist/icons/MobileIcon.js.map +1 -0
  264. package/dist/icons/OfflineIcon.d.ts +2 -0
  265. package/dist/icons/OfflineIcon.js +18 -0
  266. package/dist/icons/OfflineIcon.js.map +1 -0
  267. package/dist/icons/OnlineIcon.d.ts +2 -0
  268. package/dist/icons/OnlineIcon.js +19 -0
  269. package/dist/icons/OnlineIcon.js.map +1 -0
  270. package/dist/icons/OutOfficeIcon.d.ts +2 -0
  271. package/dist/icons/OutOfficeIcon.js +18 -0
  272. package/dist/icons/OutOfficeIcon.js.map +1 -0
  273. package/dist/icons/index.d.ts +4 -0
  274. package/dist/icons/index.js +5 -0
  275. package/dist/icons/index.js.map +1 -0
  276. package/dist/index.d.ts +1328 -0
  277. package/dist/index.js +89 -0
  278. package/dist/index.js.map +1 -0
  279. package/dist/table/Table.d.ts +3 -0
  280. package/dist/table/Table.js +53 -0
  281. package/dist/table/Table.js.map +1 -0
  282. package/dist/table/TableBadge.d.ts +6 -0
  283. package/dist/table/TableBadge.js +23 -0
  284. package/dist/table/TableBadge.js.map +1 -0
  285. package/dist/table/TableBoolean.d.ts +6 -0
  286. package/dist/table/TableBoolean.js +37 -0
  287. package/dist/table/TableBoolean.js.map +1 -0
  288. package/dist/table/TableDate.d.ts +3 -0
  289. package/dist/table/TableDate.js +27 -0
  290. package/dist/table/TableDate.js.map +1 -0
  291. package/dist/table/TableHeader.d.ts +6 -0
  292. package/dist/table/TableHeader.js +10 -0
  293. package/dist/table/TableHeader.js.map +1 -0
  294. package/dist/table/TableHeaderCell.d.ts +6 -0
  295. package/dist/table/TableHeaderCell.js +54 -0
  296. package/dist/table/TableHeaderCell.js.map +1 -0
  297. package/dist/table/TableIconButton.d.ts +3 -0
  298. package/dist/table/TableIconButton.js +39 -0
  299. package/dist/table/TableIconButton.js.map +1 -0
  300. package/dist/table/TableNumber.d.ts +3 -0
  301. package/dist/table/TableNumber.js +18 -0
  302. package/dist/table/TableNumber.js.map +1 -0
  303. package/dist/table/TableRow.d.ts +6 -0
  304. package/dist/table/TableRow.js +22 -0
  305. package/dist/table/TableRow.js.map +1 -0
  306. package/dist/table/TableText.d.ts +3 -0
  307. package/dist/table/TableText.js +18 -0
  308. package/dist/table/TableText.js.map +1 -0
  309. package/dist/table/TableTitle.d.ts +3 -0
  310. package/dist/table/TableTitle.js +21 -0
  311. package/dist/table/TableTitle.js.map +1 -0
  312. package/dist/table/tableContext.d.ts +5 -0
  313. package/dist/table/tableContext.js +38 -0
  314. package/dist/table/tableContext.js.map +1 -0
  315. package/dist/useStoredState.d.ts +1 -0
  316. package/dist/useStoredState.js +49 -0
  317. package/dist/useStoredState.js.map +1 -0
  318. package/package.json +123 -0
  319. package/src/Accordion.test.tsx +104 -0
  320. package/src/Accordion.tsx +81 -0
  321. package/src/ActionSheet.tsx +881 -0
  322. package/src/AddressField.test.tsx +120 -0
  323. package/src/AddressField.tsx +122 -0
  324. package/src/Avatar.test.tsx +163 -0
  325. package/src/Avatar.tsx +298 -0
  326. package/src/Badge.test.tsx +116 -0
  327. package/src/Badge.tsx +136 -0
  328. package/src/Banner.tsx +200 -0
  329. package/src/Body.tsx +34 -0
  330. package/src/BooleanField.tsx +141 -0
  331. package/src/Box.test.tsx +662 -0
  332. package/src/Box.tsx +368 -0
  333. package/src/Button.tsx +196 -0
  334. package/src/Card.tsx +19 -0
  335. package/src/CheckBox.tsx +45 -0
  336. package/src/Common.ts +2787 -0
  337. package/src/CommonIconTypes.ts +2030 -0
  338. package/src/Constants.ts +3311 -0
  339. package/src/CustomSelectField.tsx +115 -0
  340. package/src/DataTable.tsx +674 -0
  341. package/src/DateTimeActionSheet.tsx +559 -0
  342. package/src/DateTimeField.test.tsx +393 -0
  343. package/src/DateTimeField.tsx +777 -0
  344. package/src/DateUtilities.test.ts +440 -0
  345. package/src/DateUtilities.tsx +370 -0
  346. package/src/DecimalRangeActionSheet.tsx +85 -0
  347. package/src/DismissButton.tsx +31 -0
  348. package/src/EmailField.tsx +66 -0
  349. package/src/EmojiSelector.test.tsx +61 -0
  350. package/src/EmojiSelector.tsx +510 -0
  351. package/src/ErrorBoundary.tsx +37 -0
  352. package/src/ErrorPage.tsx +41 -0
  353. package/src/Field.tsx +101 -0
  354. package/src/FlatList.tsx +2 -0
  355. package/src/Heading.tsx +66 -0
  356. package/src/HeightActionSheet.tsx +91 -0
  357. package/src/Hyperlink.tsx +179 -0
  358. package/src/Icon.tsx +36 -0
  359. package/src/IconButton.tsx +217 -0
  360. package/src/Image.tsx +51 -0
  361. package/src/ImageBackground.tsx +14 -0
  362. package/src/InfoModalIcon.tsx +42 -0
  363. package/src/InfoTooltipButton.tsx +16 -0
  364. package/src/Link.tsx +22 -0
  365. package/src/MarkdownView.tsx +67 -0
  366. package/src/MediaQuery.ts +46 -0
  367. package/src/MobileAddressAutoComplete.tsx +126 -0
  368. package/src/Modal.tsx +300 -0
  369. package/src/ModalSheet.tsx +58 -0
  370. package/src/MultiselectField.tsx +112 -0
  371. package/src/NumberField.tsx +67 -0
  372. package/src/NumberPickerActionSheet.tsx +51 -0
  373. package/src/OpenAPIContext.tsx +74 -0
  374. package/src/Page.tsx +105 -0
  375. package/src/Pagination.tsx +169 -0
  376. package/src/PasswordField.tsx +7 -0
  377. package/src/Permissions.ts +43 -0
  378. package/src/PhoneNumberField.tsx +109 -0
  379. package/src/PickerSelect.tsx +571 -0
  380. package/src/Radio.tsx +33 -0
  381. package/src/RadioField.tsx +43 -0
  382. package/src/ScrollView.tsx +2 -0
  383. package/src/SectionDivider.tsx +18 -0
  384. package/src/SegmentedControl.tsx +126 -0
  385. package/src/SelectBadge.tsx +280 -0
  386. package/src/SelectField.tsx +41 -0
  387. package/src/SideDrawer.tsx +56 -0
  388. package/src/Signature.native.tsx +57 -0
  389. package/src/Signature.tsx +44 -0
  390. package/src/SignatureField.tsx +92 -0
  391. package/src/Slider.tsx +199 -0
  392. package/src/Spinner.tsx +35 -0
  393. package/src/SplitPage.native.tsx +163 -0
  394. package/src/SplitPage.tsx +304 -0
  395. package/src/TapToEdit.tsx +292 -0
  396. package/src/TerrenoProvider.tsx +31 -0
  397. package/src/Text.tsx +123 -0
  398. package/src/TextArea.test.tsx +255 -0
  399. package/src/TextArea.tsx +8 -0
  400. package/src/TextField.test.tsx +487 -0
  401. package/src/TextField.tsx +260 -0
  402. package/src/TextFieldNumberActionSheet.tsx +46 -0
  403. package/src/Theme.tsx +248 -0
  404. package/src/TimezonePicker.tsx +45 -0
  405. package/src/Toast.tsx +234 -0
  406. package/src/Tooltip.tsx +407 -0
  407. package/src/UnifiedAddressAutoComplete.tsx +66 -0
  408. package/src/Unifier.ts +172 -0
  409. package/src/Utilities.tsx +329 -0
  410. package/src/WebAddressAutocomplete.tsx +84 -0
  411. package/src/__snapshots__/Accordion.test.tsx.snap +126 -0
  412. package/src/__snapshots__/AddressField.test.tsx.snap +1197 -0
  413. package/src/__snapshots__/Avatar.test.tsx.snap +57 -0
  414. package/src/__snapshots__/Badge.test.tsx.snap +55 -0
  415. package/src/__snapshots__/Box.test.tsx.snap +162 -0
  416. package/src/__snapshots__/EmojiSelector.test.tsx.snap +422 -0
  417. package/src/__snapshots__/TextArea.test.tsx.snap +521 -0
  418. package/src/__snapshots__/TextField.test.tsx.snap +569 -0
  419. package/src/bunSetup.ts +1235 -0
  420. package/src/fieldElements/FieldError.tsx +24 -0
  421. package/src/fieldElements/FieldHelperText.tsx +20 -0
  422. package/src/fieldElements/FieldTitle.tsx +31 -0
  423. package/src/fieldElements/index.tsx +3 -0
  424. package/src/icons/MobileIcon.tsx +40 -0
  425. package/src/icons/OfflineIcon.tsx +37 -0
  426. package/src/icons/OnlineIcon.tsx +39 -0
  427. package/src/icons/OutOfficeIcon.tsx +36 -0
  428. package/src/icons/index.ts +4 -0
  429. package/src/index.tsx +1375 -0
  430. package/src/polyfill.d.ts +11 -0
  431. package/src/table/Table.tsx +109 -0
  432. package/src/table/TableBadge.tsx +46 -0
  433. package/src/table/TableBoolean.tsx +70 -0
  434. package/src/table/TableDate.tsx +38 -0
  435. package/src/table/TableHeader.tsx +20 -0
  436. package/src/table/TableHeaderCell.tsx +94 -0
  437. package/src/table/TableIconButton.tsx +61 -0
  438. package/src/table/TableNumber.tsx +29 -0
  439. package/src/table/TableRow.tsx +67 -0
  440. package/src/table/TableText.tsx +29 -0
  441. package/src/table/TableTitle.tsx +31 -0
  442. package/src/table/tableContext.tsx +67 -0
  443. package/src/test-utils.tsx +27 -0
  444. package/src/types/react-native-swiper-flatlist.d.ts +56 -0
  445. package/src/useStoredState.test.tsx +143 -0
  446. package/src/useStoredState.ts +56 -0
@@ -0,0 +1,66 @@
1
+ import {
2
+ TitilliumWeb_600SemiBold,
3
+ TitilliumWeb_700Bold,
4
+ useFonts,
5
+ } from "@expo-google-fonts/titillium-web";
6
+ import type React from "react";
7
+ import {Text as NativeText, Platform, type StyleProp, type TextStyle} from "react-native";
8
+
9
+ import type {HeadingProps} from "./Common";
10
+ import {useTheme} from "./Theme";
11
+
12
+ const fontSizeAndWeightWeb = {
13
+ "2xl": {size: 48, weight: "bold"},
14
+ lg: {size: 24, weight: "bold"},
15
+ md: {size: 18, weight: "bold"},
16
+ sm: {size: 16, weight: "semibold"},
17
+ xl: {size: 32, weight: "bold"},
18
+ };
19
+
20
+ const fontSizeAndWeighMobile = {
21
+ "2xl": {size: 32, weight: "bold"},
22
+ lg: {size: 20, weight: "bold"},
23
+ md: {size: 16, weight: "bold"},
24
+ sm: {size: 14, weight: "semibold"},
25
+ xl: {size: 28, weight: "bold"},
26
+ };
27
+
28
+ const fontSizes = Platform.OS === "web" ? fontSizeAndWeightWeb : fontSizeAndWeighMobile;
29
+
30
+ export const Heading = ({
31
+ align,
32
+ children,
33
+ color = "primary",
34
+ size,
35
+ testID,
36
+ }: HeadingProps): React.ReactElement => {
37
+ const {theme} = useTheme();
38
+
39
+ // TODO: make fonts part of theme.
40
+ useFonts({
41
+ heading: TitilliumWeb_600SemiBold,
42
+ "heading-bold": TitilliumWeb_700Bold,
43
+ "heading-semibold": TitilliumWeb_600SemiBold,
44
+ });
45
+
46
+ const style: StyleProp<TextStyle> = {};
47
+
48
+ if (size === "sm") {
49
+ style.fontFamily = "heading-semibold";
50
+ } else {
51
+ style.fontFamily = "heading-bold";
52
+ }
53
+
54
+ style.fontSize = fontSizes[size || "md"].size;
55
+ if (align) {
56
+ style.textAlign = align;
57
+ }
58
+ style.color = theme.text[color];
59
+
60
+ const lines = 0;
61
+ return (
62
+ <NativeText numberOfLines={lines} style={style} testID={testID}>
63
+ {children}
64
+ </NativeText>
65
+ );
66
+ };
@@ -0,0 +1,91 @@
1
+ import {Picker} from "@react-native-picker/picker";
2
+ import range from "lodash/range";
3
+ import React from "react";
4
+
5
+ import {ActionSheet} from "./ActionSheet";
6
+ import {Box} from "./Box";
7
+ import {Button} from "./Button";
8
+ import type {HeightActionSheetProps} from "./Common";
9
+
10
+ const PICKER_HEIGHT = 104;
11
+
12
+ interface HeightActionSheetState {
13
+ feet: string;
14
+ inches: string;
15
+ }
16
+
17
+ export class HeightActionSheet extends React.Component<
18
+ HeightActionSheetProps,
19
+ HeightActionSheetState
20
+ > {
21
+ constructor(props: HeightActionSheetProps) {
22
+ super(props);
23
+ this.state = {
24
+ feet: String(Math.floor(Number(props.value) / 12)),
25
+ inches: String(Number(props.value) % 12),
26
+ };
27
+ }
28
+
29
+ render() {
30
+ return (
31
+ <ActionSheet bounceOnOpen gestureEnabled ref={this.props.actionSheetRef}>
32
+ <Box marginBottom={8} paddingX={4} width="100%">
33
+ <Box alignItems="end" display="flex" width="100%">
34
+ <Box width="33%">
35
+ <Button
36
+ onClick={() => {
37
+ this.props.actionSheetRef?.current?.setModalVisible(false);
38
+ }}
39
+ text="Close"
40
+ />
41
+ </Box>
42
+ </Box>
43
+ <Box direction="row" width="100%">
44
+ <Box width="50%">
45
+ <Picker
46
+ itemStyle={{
47
+ height: PICKER_HEIGHT,
48
+ }}
49
+ onValueChange={(feet) => {
50
+ this.setState({feet: String(feet)});
51
+ this.props.onChange(String(Number(feet) * 12 + Number(this.state.inches)));
52
+ }}
53
+ selectedValue={this.state.feet}
54
+ style={{
55
+ backgroundColor: "#FFFFFF",
56
+ height: PICKER_HEIGHT,
57
+ }}
58
+ >
59
+ {range(4, 8).map((n) => {
60
+ // console.log("FIRST", String(n));
61
+ return <Picker.Item key={String(n)} label={`${String(n)}ft`} value={String(n)} />;
62
+ })}
63
+ </Picker>
64
+ </Box>
65
+ <Box width="50%">
66
+ <Picker
67
+ itemStyle={{
68
+ height: PICKER_HEIGHT,
69
+ }}
70
+ onValueChange={(inches) => {
71
+ this.setState({inches: String(inches)});
72
+ this.props.onChange(String(Number(this.state.feet) * 12 + Number(inches)));
73
+ }}
74
+ selectedValue={this.state.inches}
75
+ style={{
76
+ backgroundColor: "#FFFFFF",
77
+ height: PICKER_HEIGHT,
78
+ }}
79
+ >
80
+ {range(0, 12).map((n) => {
81
+ // console.log("N", n);
82
+ return <Picker.Item key={String(n)} label={`${String(n)}in`} value={String(n)} />;
83
+ })}
84
+ </Picker>
85
+ </Box>
86
+ </Box>
87
+ </Box>
88
+ </ActionSheet>
89
+ );
90
+ }
91
+ }
@@ -0,0 +1,179 @@
1
+ /**
2
+ * @providesModule Hyperlink
3
+ *
4
+ * Forked from https://github.com/obipawan/react-native-hyperlink
5
+ *
6
+ *
7
+ * MIT License
8
+ *
9
+ * Copyright (c) 2019 Pawan
10
+ *
11
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ * of this software and associated documentation files (the "Software"), to deal
13
+ * in the Software without restriction, including without limitation the rights
14
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ * copies of the Software, and to permit persons to whom the Software is
16
+ * furnished to do so, subject to the following conditions:
17
+ *
18
+ * The above copyright notice and this permission notice shall be included in all
19
+ * copies or substantial portions of the Software.
20
+ *
21
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ * SOFTWARE.
28
+ * */
29
+
30
+ /**
31
+ * Hyperlink is used to wrap text that should be clickable.
32
+ * It will automatically detect URLs and open them in the browser. For example,
33
+ * this is great for wrapping text in a chat app so any link in a chat message is clickable.
34
+ * This is different than <Link> which is meant for specifically linking to a URL.
35
+ */
36
+
37
+ import * as mdurl from "mdurl";
38
+ import React from "react";
39
+ import {Linking, Platform, Text, View} from "react-native";
40
+
41
+ import type {HyperlinkProps} from "./Common";
42
+
43
+ const linkifyLib = require("linkify-it")();
44
+
45
+ const {OS} = Platform;
46
+
47
+ // Leaving this as a class component because it was easier to handle the `parse(this)` in
48
+ // `render()`
49
+ class HyperlinkComponent extends React.Component<HyperlinkProps> {
50
+ isTextNested = (component: any) => {
51
+ if (!React.isValidElement(component)) throw new Error("Invalid component");
52
+ const {type: {displayName} = {} as any} = component;
53
+ if (displayName !== "Text") throw new Error("Not a Text component");
54
+ return typeof (component.props as any).children !== "string";
55
+ };
56
+
57
+ linkify = (component: any) => {
58
+ const linkifyIt = this.props.linkify || linkifyLib;
59
+
60
+ if (!linkifyIt.pretest(component.props.children) || !linkifyIt.test(component.props.children))
61
+ return component;
62
+
63
+ const elements = [];
64
+ let _lastIndex = 0;
65
+
66
+ const componentProps = {
67
+ ...component.props,
68
+ key: undefined,
69
+ ref: undefined,
70
+ };
71
+
72
+ try {
73
+ linkifyIt.match(component.props.children).forEach(({index, lastIndex, text, url}: any) => {
74
+ const nonLinkedText = component.props.children.substring(_lastIndex, index);
75
+ nonLinkedText && elements.push(nonLinkedText);
76
+ _lastIndex = lastIndex;
77
+ if (this.props.linkText)
78
+ text =
79
+ typeof this.props.linkText === "function"
80
+ ? this.props.linkText(url)
81
+ : this.props.linkText;
82
+
83
+ const clickHandlerProps: any = {};
84
+ if (OS !== "web") {
85
+ if (this.props.onLongPress) {
86
+ clickHandlerProps.onLongPress = () => (this.props as any).onLongPress(url, text);
87
+ }
88
+ }
89
+ if (this.props.onPress) {
90
+ clickHandlerProps.onPress = () => (this.props as any).onPress(url, text);
91
+ }
92
+
93
+ let injected: any = {};
94
+ if (this.props.injectViewProps) {
95
+ injected = this.props.injectViewProps(url);
96
+ }
97
+
98
+ elements.push(
99
+ <Text
100
+ {...componentProps}
101
+ {...clickHandlerProps}
102
+ key={url + index}
103
+ style={[component.props.style, this.props.linkStyle]}
104
+ {...injected}
105
+ >
106
+ {text}
107
+ </Text>
108
+ );
109
+ });
110
+ elements.push(
111
+ component.props.children.substring(_lastIndex, component.props.children.length)
112
+ );
113
+ return React.cloneElement(component, componentProps, elements);
114
+ } catch (_error) {
115
+ return component;
116
+ }
117
+ };
118
+
119
+ parse = (component: any): React.ReactElement => {
120
+ const {props: {children} = {} as any} = component || {};
121
+ if (!children) return component;
122
+
123
+ const componentProps = {
124
+ ...component.props,
125
+ key: undefined,
126
+ ref: undefined,
127
+ };
128
+
129
+ const linkifyIt = this.props.linkify || linkifyLib;
130
+
131
+ return React.cloneElement(
132
+ component,
133
+ componentProps,
134
+ React.Children.map(children, (child) => {
135
+ const {type: {displayName} = {} as any} = child || {};
136
+ if (typeof child === "string" && linkifyIt.pretest(child))
137
+ return this.linkify(
138
+ <Text {...componentProps} style={component.props.style}>
139
+ {child}
140
+ </Text>
141
+ );
142
+ if (displayName === "Text" && !this.isTextNested(child)) return this.linkify(child);
143
+ return this.parse(child);
144
+ })
145
+ );
146
+ };
147
+
148
+ render() {
149
+ const {...viewProps} = this.props;
150
+ delete viewProps.onPress;
151
+ delete viewProps.linkDefault;
152
+ delete viewProps.onLongPress;
153
+ delete viewProps.linkStyle;
154
+
155
+ return (
156
+ <View {...viewProps} style={this.props.style}>
157
+ {!this.props.onPress && !this.props.onLongPress && !this.props.linkStyle
158
+ ? this.props.children
159
+ : (this.parse(this).props as {children?: React.ReactNode}).children}
160
+ </View>
161
+ );
162
+ }
163
+ }
164
+
165
+ export const Hyperlink = (props: HyperlinkProps) => {
166
+ const handleLink = (url: string) => {
167
+ const urlObject = mdurl.parse(url);
168
+ urlObject.protocol = urlObject.protocol.toLowerCase();
169
+ const normalizedURL = mdurl.format(urlObject);
170
+
171
+ void Linking.canOpenURL(normalizedURL).then(
172
+ (supported) => supported && Linking.openURL(normalizedURL)
173
+ );
174
+ };
175
+
176
+ const onPress = handleLink || props.onPress;
177
+ if (props.linkDefault) return <HyperlinkComponent {...props} onPress={onPress} />;
178
+ return <HyperlinkComponent {...props} />;
179
+ };
package/src/Icon.tsx ADDED
@@ -0,0 +1,36 @@
1
+ import FontAwesome6 from "@expo/vector-icons/FontAwesome6";
2
+ import type {FC} from "react";
3
+
4
+ import {type IconProps, iconSizeToNumber} from "./Common";
5
+ import {useTheme} from "./Theme";
6
+
7
+ // TODO: Update <Icon /> to be closer to Expo's Vector Icon, letting multiple icon packs be used,
8
+ // etc.
9
+ // TODO: Add documentation for adding FA6-Pro icons.
10
+ export const Icon: FC<IconProps> = ({
11
+ color = "primary",
12
+ size = "md",
13
+ iconName,
14
+ type = "solid",
15
+ testID,
16
+ }) => {
17
+ const {theme} = useTheme();
18
+ const iconColor = theme.text[color] ?? color;
19
+ const iconSize = iconSizeToNumber(size);
20
+ return (
21
+ <FontAwesome6
22
+ brand={type === "brand"}
23
+ color={iconColor}
24
+ duotone={type === "duotone"}
25
+ light={type === "light" || type === "sharpLight"}
26
+ name={iconName}
27
+ regular={type === "regular"}
28
+ selectable={undefined}
29
+ sharp={type === "sharp"}
30
+ size={iconSize}
31
+ solid={type === "solid" || type === "sharpSolid"}
32
+ testID={testID}
33
+ thin={type === "thin"}
34
+ />
35
+ );
36
+ };
@@ -0,0 +1,217 @@
1
+ import FontAwesome6 from "@expo/vector-icons/FontAwesome6";
2
+ import debounce from "lodash/debounce";
3
+ import {type FC, useState} from "react";
4
+ import {ActivityIndicator, Text as NativeText, Pressable, View} from "react-native";
5
+
6
+ import type {IconButtonProps} from "./Common";
7
+ import {isMobileDevice} from "./MediaQuery";
8
+ import {Modal} from "./Modal";
9
+ import {Text} from "./Text";
10
+ import {useTheme} from "./Theme";
11
+ import {Tooltip} from "./Tooltip";
12
+ import {Unifier} from "./Unifier";
13
+ import {isNative} from "./Utilities";
14
+
15
+ type ConfirmationModalProps = {
16
+ visible: boolean;
17
+ title: string;
18
+ subtitle?: string;
19
+ text: string;
20
+ onConfirm: () => void;
21
+ onCancel: () => void;
22
+ };
23
+
24
+ const ConfirmationModal: FC<ConfirmationModalProps> = ({
25
+ visible,
26
+ title,
27
+ subtitle,
28
+ text,
29
+ onConfirm,
30
+ onCancel,
31
+ }) => {
32
+ return (
33
+ <Modal
34
+ onDismiss={onCancel}
35
+ primaryButtonOnClick={onConfirm}
36
+ primaryButtonText="Confirm"
37
+ secondaryButtonOnClick={onCancel}
38
+ secondaryButtonText="Cancel"
39
+ subtitle={subtitle}
40
+ title={title}
41
+ visible={visible}
42
+ >
43
+ <Text>{text}</Text>
44
+ </Modal>
45
+ );
46
+ };
47
+
48
+ const IconButtonComponent: FC<IconButtonProps> = ({
49
+ accessibilityHint,
50
+ accessibilityLabel,
51
+ confirmationHeading = "Confirm",
52
+ confirmationText = "Are you sure you want to continue?",
53
+ disabled = false,
54
+ iconName,
55
+ indicator,
56
+ indicatorText,
57
+ loading: propsLoading = false,
58
+ testID,
59
+ variant = "primary",
60
+ withConfirmation = false,
61
+ tooltipText,
62
+ onClick,
63
+ }) => {
64
+ const [loading, setLoading] = useState(propsLoading);
65
+ const [showConfirmation, setShowConfirmation] = useState(false);
66
+ const {theme} = useTheme();
67
+ let accessLabel = accessibilityLabel;
68
+ if (tooltipText && accessibilityLabel === "") {
69
+ accessLabel = tooltipText;
70
+ }
71
+
72
+ if (!theme) {
73
+ return null;
74
+ }
75
+
76
+ let backgroundColor = theme.surface.primary;
77
+ let color = theme.text.inverted;
78
+
79
+ if (disabled) {
80
+ backgroundColor = theme.surface.disabled;
81
+ color = theme.text.secondaryLight;
82
+ } else if (variant === "secondary") {
83
+ backgroundColor = theme.surface.neutralLight;
84
+ color = theme.surface.secondaryDark;
85
+ } else if (variant === "muted") {
86
+ backgroundColor = theme.text.inverted;
87
+ color = theme.surface.primary;
88
+ } else if (variant === "navigation") {
89
+ backgroundColor = theme.text.inverted;
90
+ color = theme.text.primary;
91
+ } else if (variant === "destructive") {
92
+ backgroundColor = theme.text.inverted;
93
+ color = theme.text.error;
94
+ }
95
+
96
+ const indicatorColor = indicator ? theme.surface[indicator] : undefined;
97
+
98
+ return (
99
+ <Pressable
100
+ accessibilityHint={
101
+ (accessibilityHint ?? withConfirmation)
102
+ ? `Opens a confirmation dialog to confirm ${accessLabel}`
103
+ : `Press to perform ${accessLabel} action`
104
+ }
105
+ aria-label={accessLabel}
106
+ aria-role="button"
107
+ disabled={loading || disabled}
108
+ onPress={debounce(
109
+ // TODO: Allow for a click outside of the confirmation modal to close it.
110
+ async () => {
111
+ await Unifier.utils.haptic();
112
+ setLoading(true);
113
+ try {
114
+ // If a confirmation is required, and the confirmation modal is not currently open,
115
+ // open it
116
+ if (withConfirmation && !showConfirmation) {
117
+ setShowConfirmation(true);
118
+ } else if (!withConfirmation && onClick) {
119
+ // If a confirmation is not required, perform the action.
120
+ await onClick();
121
+ }
122
+ } catch (error) {
123
+ setLoading(false);
124
+ throw error;
125
+ }
126
+ setLoading(false);
127
+ },
128
+ 500,
129
+ {leading: true}
130
+ )}
131
+ style={{
132
+ alignItems: "center",
133
+ backgroundColor,
134
+ borderRadius: theme.radius.rounded,
135
+ height: 32,
136
+ justifyContent: "center",
137
+ width: 32,
138
+ }}
139
+ testID={testID}
140
+ >
141
+ {loading ? (
142
+ <ActivityIndicator color={color} size="small" />
143
+ ) : (
144
+ <FontAwesome6
145
+ color={color}
146
+ name={iconName}
147
+ selectable={undefined}
148
+ size={variant === "navigation" ? 20 : 16}
149
+ solid
150
+ />
151
+ )}
152
+ {Boolean(indicator) && (
153
+ <View
154
+ style={{
155
+ alignItems: "center",
156
+ backgroundColor: indicatorColor,
157
+ borderRadius: 10,
158
+ bottom: 0,
159
+ display: "flex",
160
+ height: 12,
161
+ justifyContent: "center",
162
+ padding: theme.spacing.xs as any,
163
+ position: "absolute",
164
+ right: 0,
165
+ width: 12,
166
+ }}
167
+ >
168
+ {Boolean(indicatorText) && (
169
+ <NativeText
170
+ style={{
171
+ color: theme.text.inverted,
172
+ fontFamily: "text",
173
+ fontSize: 10,
174
+ fontWeight: 700,
175
+ textAlign: "center",
176
+ }}
177
+ >
178
+ {indicatorText}
179
+ </NativeText>
180
+ )}
181
+ </View>
182
+ )}
183
+ {withConfirmation && (
184
+ <ConfirmationModal
185
+ onCancel={() => setShowConfirmation(false)}
186
+ onConfirm={async () => {
187
+ await onClick();
188
+ setShowConfirmation(false);
189
+ }}
190
+ subtitle={undefined}
191
+ text={confirmationText}
192
+ title={confirmationHeading}
193
+ visible={showConfirmation}
194
+ />
195
+ )}
196
+ </Pressable>
197
+ );
198
+ };
199
+
200
+ export const IconButton: FC<IconButtonProps> = (props) => {
201
+ const {tooltipText, tooltipIdealPosition, tooltipIncludeArrow = false} = props;
202
+ const isMobileOrNative = isMobileDevice() || isNative();
203
+
204
+ if (tooltipText && !isMobileOrNative) {
205
+ return (
206
+ <Tooltip
207
+ idealPosition={tooltipIdealPosition}
208
+ includeArrow={tooltipIncludeArrow}
209
+ text={tooltipText}
210
+ >
211
+ <IconButtonComponent {...props} />
212
+ </Tooltip>
213
+ );
214
+ }
215
+
216
+ return <IconButtonComponent {...props} />;
217
+ };
package/src/Image.tsx ADDED
@@ -0,0 +1,51 @@
1
+ import React from "react";
2
+ import {Dimensions, Image as NativeImage} from "react-native";
3
+
4
+ import {Box} from "./Box";
5
+ import type {ImageProps} from "./Common";
6
+
7
+ const {width: DEVICE_WIDTH} = Dimensions.get("window");
8
+
9
+ export class Image extends React.Component<ImageProps, {}> {
10
+ resizeMode = (fit?: "cover" | "contain" | "none") => {
11
+ if (!fit || fit === "none") {
12
+ return undefined;
13
+ } else {
14
+ return fit;
15
+ }
16
+ };
17
+
18
+ width = () => {
19
+ if (this.props.naturalWidth) {
20
+ return this.props.naturalWidth;
21
+ } else if (this.props.fullWidth) {
22
+ return DEVICE_WIDTH;
23
+ }
24
+ throw new Error("Width required for Image");
25
+ };
26
+
27
+ height = () => {
28
+ if (this.props.naturalWidth) {
29
+ return this.props.naturalWidth;
30
+ }
31
+ return this.width() * (9 / 16);
32
+ };
33
+
34
+ render() {
35
+ return (
36
+ <Box color={this.props.color}>
37
+ <NativeImage
38
+ resizeMode={this.resizeMode(this.props.fit)}
39
+ source={{cache: "force-cache", uri: this.props.src}}
40
+ style={{
41
+ height: this.height(),
42
+ maxHeight: this.props.maxHeight,
43
+ maxWidth: this.props.maxWidth,
44
+ width: this.width(),
45
+ ...this.props.style,
46
+ }}
47
+ />
48
+ </Box>
49
+ );
50
+ }
51
+ }
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import {ImageBackground as ImageBackgroundNative} from "react-native";
3
+
4
+ interface ImageBackgroundProps {
5
+ children?: any;
6
+ style?: any;
7
+ source: any;
8
+ }
9
+
10
+ export class ImageBackground extends React.Component<ImageBackgroundProps, {}> {
11
+ render() {
12
+ return <ImageBackgroundNative {...this.props} />;
13
+ }
14
+ }
@@ -0,0 +1,42 @@
1
+ import {type FC, useState} from "react";
2
+ import {Pressable} from "react-native";
3
+
4
+ import type {InfoModalIconProps} from "./Common";
5
+ import {Heading} from "./Heading";
6
+ import {Modal} from "./Modal";
7
+
8
+ export const InfoModalIcon: FC<InfoModalIconProps> = ({
9
+ infoModalChildren,
10
+ infoModalSubtitle,
11
+ infoModalText,
12
+ infoModalTitle,
13
+ }) => {
14
+ const [infoModalVisibleState, setInfoModalVisibleState] = useState(false);
15
+ return (
16
+ <>
17
+ <Modal
18
+ onDismiss={() => setInfoModalVisibleState(false)}
19
+ primaryButtonOnClick={() => setInfoModalVisibleState(false)}
20
+ primaryButtonText="Close"
21
+ size="md"
22
+ subtitle={infoModalSubtitle}
23
+ text={infoModalText}
24
+ title={infoModalTitle}
25
+ visible={infoModalVisibleState}
26
+ >
27
+ {infoModalChildren}
28
+ </Modal>
29
+ <Pressable
30
+ aria-role="button"
31
+ hitSlop={{bottom: 10, left: 10, right: 10, top: 10}}
32
+ onPress={() => setInfoModalVisibleState(true)}
33
+ style={{marginLeft: 8}}
34
+ testID="info-icon"
35
+ >
36
+ <Heading color="secondaryLight" size="sm">
37
+
38
+ </Heading>
39
+ </Pressable>
40
+ </>
41
+ );
42
+ };