@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,2325 @@
1
+ import type { CountryCode } from "libphonenumber-js";
2
+ import type React from "react";
3
+ import type { ReactElement, ReactNode } from "react";
4
+ import type { ListRenderItemInfo, StyleProp, TextStyle, ViewStyle } from "react-native";
5
+ import type { DimensionValue } from "react-native/Libraries/StyleSheet/StyleSheetTypes";
6
+ import type { Styles } from "react-native-google-places-autocomplete";
7
+ import type { SvgProps } from "react-native-svg";
8
+ import type { FontAwesome6BrandNames, FontAwesome6RegularNames, FontAwesome6SolidNames } from "./CommonIconTypes";
9
+ export type PercentageString = `${number}%`;
10
+ export type NumberOrPercentage = number | PercentageString | string;
11
+ export interface InfoModalIconProps {
12
+ /**
13
+ * The content of the information modal.
14
+ */
15
+ infoModalChildren?: ModalProps["children"];
16
+ /**
17
+ * The subtitle of the information modal.
18
+ */
19
+ infoModalSubtitle?: ModalProps["subtitle"];
20
+ /**
21
+ * The text content of the information modal.
22
+ */
23
+ infoModalText?: ModalProps["text"];
24
+ /**
25
+ * The title of the information modal.
26
+ */
27
+ infoModalTitle?: ModalProps["title"];
28
+ }
29
+ export interface AccordionProps extends InfoModalIconProps {
30
+ /**
31
+ * The content to be displayed inside the accordion.
32
+ */
33
+ children: React.ReactNode;
34
+ /**
35
+ * If true, an information modal will be included.
36
+ * @default false
37
+ */
38
+ includeInfoModal?: boolean;
39
+ /**
40
+ * If true, the accordion will be collapsed.
41
+ * @default true
42
+ */
43
+ isCollapsed?: boolean;
44
+ subtitle?: string;
45
+ /**
46
+ * The title of the accordion.
47
+ */
48
+ title: string;
49
+ /**
50
+ * * Callback fired when the accordion is toggled.
51
+ * */
52
+ onToggle?: (isCollapse: boolean) => void;
53
+ }
54
+ export interface BaseProfile {
55
+ email: string;
56
+ id: string;
57
+ backOffice: {
58
+ testUser?: boolean;
59
+ };
60
+ }
61
+ export interface ThemePrimitiveColors {
62
+ neutral000: string;
63
+ neutral050: string;
64
+ neutral100: string;
65
+ neutral200: string;
66
+ neutral300: string;
67
+ neutral400: string;
68
+ neutral500: string;
69
+ neutral600: string;
70
+ neutral700: string;
71
+ neutral800: string;
72
+ neutral900: string;
73
+ primary000: string;
74
+ primary050: string;
75
+ primary100: string;
76
+ primary200: string;
77
+ primary300: string;
78
+ primary400: string;
79
+ primary500: string;
80
+ primary600: string;
81
+ primary700: string;
82
+ primary800: string;
83
+ primary900: string;
84
+ secondary000: string;
85
+ secondary050: string;
86
+ secondary100: string;
87
+ secondary200: string;
88
+ secondary300: string;
89
+ secondary400: string;
90
+ secondary500: string;
91
+ secondary600: string;
92
+ secondary700: string;
93
+ secondary800: string;
94
+ secondary900: string;
95
+ accent000: string;
96
+ accent050: string;
97
+ accent100: string;
98
+ accent200: string;
99
+ accent300: string;
100
+ accent400: string;
101
+ accent500: string;
102
+ accent600: string;
103
+ accent700: string;
104
+ accent800: string;
105
+ accent900: string;
106
+ error000: string;
107
+ error100: string;
108
+ error200: string;
109
+ warning000: string;
110
+ warning100: string;
111
+ warning200: string;
112
+ success000: string;
113
+ success100: string;
114
+ success200: string;
115
+ }
116
+ export interface ThemePrimitiveRadius {
117
+ radiusSm: number;
118
+ radiusMd: number;
119
+ radiusLg: number;
120
+ radiusXl: number;
121
+ radius2xl: number;
122
+ radius3xl: number;
123
+ }
124
+ export interface ThemePrimitiveSpacing {
125
+ spacing0: number;
126
+ spacing1: number;
127
+ spacing2: number;
128
+ spacing3: number;
129
+ spacing4: number;
130
+ spacing5: number;
131
+ spacing6: number;
132
+ spacing7: number;
133
+ spacing8: number;
134
+ spacing9: number;
135
+ spacing10: number;
136
+ spacing11: number;
137
+ spacing12: number;
138
+ }
139
+ export type ThemePrimitives = ThemePrimitiveColors & ThemePrimitiveRadius & ThemePrimitiveSpacing;
140
+ export interface TextThemeConfig {
141
+ primary: keyof ThemePrimitiveColors;
142
+ inverted: keyof ThemePrimitiveColors;
143
+ secondaryLight: keyof ThemePrimitiveColors;
144
+ extraLight: keyof ThemePrimitiveColors;
145
+ secondaryDark: keyof ThemePrimitiveColors;
146
+ link: keyof ThemePrimitiveColors;
147
+ linkLight: keyof ThemePrimitiveColors;
148
+ accent: keyof ThemePrimitiveColors;
149
+ error: keyof ThemePrimitiveColors;
150
+ warning: keyof ThemePrimitiveColors;
151
+ success: keyof ThemePrimitiveColors;
152
+ }
153
+ export interface SurfaceThemeConfig {
154
+ base: keyof ThemePrimitiveColors;
155
+ primary: keyof ThemePrimitiveColors;
156
+ secondaryLight: keyof ThemePrimitiveColors;
157
+ secondaryDark: keyof ThemePrimitiveColors;
158
+ secondaryExtraDark: keyof ThemePrimitiveColors;
159
+ neutral: keyof ThemePrimitiveColors;
160
+ neutralLight: keyof ThemePrimitiveColors;
161
+ neutralDark: keyof ThemePrimitiveColors;
162
+ disabled: keyof ThemePrimitiveColors;
163
+ error: keyof ThemePrimitiveColors;
164
+ errorLight: keyof ThemePrimitiveColors;
165
+ success: keyof ThemePrimitiveColors;
166
+ successLight: keyof ThemePrimitiveColors;
167
+ warning: keyof ThemePrimitiveColors;
168
+ warningLight: keyof ThemePrimitiveColors;
169
+ }
170
+ export interface BorderThemeConfig {
171
+ default: keyof ThemePrimitiveColors;
172
+ dark: keyof ThemePrimitiveColors;
173
+ activeNeutral: keyof ThemePrimitiveColors;
174
+ activeAccent: keyof ThemePrimitiveColors;
175
+ hover: keyof ThemePrimitiveColors;
176
+ focus: keyof ThemePrimitiveColors;
177
+ error: keyof ThemePrimitiveColors;
178
+ success: keyof ThemePrimitiveColors;
179
+ warning: keyof ThemePrimitiveColors;
180
+ }
181
+ export interface StatusThemeConfig {
182
+ active: keyof ThemePrimitiveColors;
183
+ doNotDisturb: keyof ThemePrimitiveColors;
184
+ away: keyof ThemePrimitiveColors;
185
+ }
186
+ export interface RadiusThemeConfig {
187
+ minimal: keyof ThemePrimitiveRadius;
188
+ default: keyof ThemePrimitiveRadius;
189
+ full: keyof ThemePrimitiveRadius;
190
+ rounded: keyof ThemePrimitiveRadius;
191
+ }
192
+ export interface SpacingThemeConfig {
193
+ none: keyof ThemePrimitiveSpacing;
194
+ xs: keyof ThemePrimitiveSpacing;
195
+ sm: keyof ThemePrimitiveSpacing;
196
+ md: keyof ThemePrimitiveSpacing;
197
+ lg: keyof ThemePrimitiveSpacing;
198
+ xl: keyof ThemePrimitiveSpacing;
199
+ "2xl": keyof ThemePrimitiveSpacing;
200
+ "3xl": keyof ThemePrimitiveSpacing;
201
+ }
202
+ export interface TextTheme {
203
+ primary: string;
204
+ inverted: string;
205
+ secondaryLight: string;
206
+ extraLight: string;
207
+ secondaryDark: string;
208
+ link: string;
209
+ linkLight: string;
210
+ accent: string;
211
+ error: string;
212
+ warning: string;
213
+ success: string;
214
+ }
215
+ export interface SurfaceTheme {
216
+ base: string;
217
+ primary: string;
218
+ secondaryLight: string;
219
+ secondaryDark: string;
220
+ secondaryExtraDark: string;
221
+ neutral: string;
222
+ neutralLight: string;
223
+ neutralDark: string;
224
+ disabled: string;
225
+ error: string;
226
+ errorLight: string;
227
+ success: string;
228
+ successLight: string;
229
+ warning: string;
230
+ warningLight: string;
231
+ }
232
+ export interface BorderTheme {
233
+ default: string;
234
+ dark: string;
235
+ activeNeutral: string;
236
+ activeAccent: string;
237
+ hover: string;
238
+ focus: string;
239
+ error: string;
240
+ success: string;
241
+ warning: string;
242
+ }
243
+ export interface StatusTheme {
244
+ active: string;
245
+ doNotDisturb: string;
246
+ away: string;
247
+ }
248
+ export interface RadiusTheme {
249
+ minimal: number;
250
+ default: number;
251
+ full: number;
252
+ rounded: number;
253
+ }
254
+ export interface SpacingTheme {
255
+ none: number;
256
+ xs: number;
257
+ sm: number;
258
+ md: number;
259
+ lg: number;
260
+ xl: number;
261
+ "2xl": number;
262
+ "3xl": number;
263
+ }
264
+ export type TextColor = keyof TextTheme;
265
+ export type SurfaceColor = keyof SurfaceTheme;
266
+ export type BorderColor = keyof BorderTheme;
267
+ export type StatusColor = keyof StatusTheme;
268
+ export type IconColor = TextColor;
269
+ export interface FontTheme {
270
+ primary: string;
271
+ title: string;
272
+ }
273
+ export type Font = keyof FontTheme;
274
+ export interface TerrenoTheme {
275
+ text: TextTheme;
276
+ surface: SurfaceTheme;
277
+ border: BorderTheme;
278
+ status: StatusTheme;
279
+ radius: RadiusTheme;
280
+ spacing: SpacingTheme;
281
+ font: FontTheme;
282
+ primitives: ThemePrimitives;
283
+ }
284
+ export interface TerrenoThemeConfig {
285
+ text: TextThemeConfig;
286
+ surface: SurfaceThemeConfig;
287
+ border: BorderThemeConfig;
288
+ status: StatusThemeConfig;
289
+ radius: RadiusThemeConfig;
290
+ spacing: SpacingThemeConfig;
291
+ font: FontTheme;
292
+ primitives: ThemePrimitives;
293
+ }
294
+ export type Direction = "up" | "right" | "down" | "left";
295
+ export type OnChangeCallback = (result: string) => void;
296
+ export type IconName = FontAwesome6SolidNames | FontAwesome6BrandNames | FontAwesome6RegularNames;
297
+ export type AlignContent = "start" | "end" | "center" | "between" | "around" | "stretch";
298
+ export type AlignSelf = "auto" | "start" | "end" | "center" | "baseline" | "stretch";
299
+ export type AlignItems = "start" | "end" | "center" | "baseline" | "stretch";
300
+ export type JustifyContent = "start" | "end" | "center" | "between" | "around";
301
+ export type UnsignedUpTo12 = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
302
+ export type SignedUpTo12 = -12 | -11 | -10 | -9 | -8 | -7 | -6 | -5 | -4 | -3 | -2 | -1 | UnsignedUpTo12;
303
+ export type Margin = SignedUpTo12 | "auto";
304
+ export declare const SPACING_MAP: {
305
+ 0: number;
306
+ 1: number;
307
+ 2: number;
308
+ 3: number;
309
+ 4: number;
310
+ 5: number;
311
+ 6: number;
312
+ 7: number;
313
+ 8: number;
314
+ 9: number;
315
+ 10: number;
316
+ 11: number;
317
+ 12: number;
318
+ };
319
+ export declare function getSpacing(spacing: SignedUpTo12): number;
320
+ export type TextFieldType = "date" | "datetime" | "decimal" | "decimalRange" | "email" | "password" | "phoneNumber" | "number" | "numberRange" | "search" | "text" | "time" | "url" | "username";
321
+ export type IconSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
322
+ export declare const iconSizeToNumber: (size?: IconSize) => number;
323
+ export type TextSize = "sm" | "md" | "lg" | "xl" | "2xl";
324
+ export interface ValueMappingItem {
325
+ value: number;
326
+ label: string;
327
+ size?: IconSize;
328
+ }
329
+ export type IconPrefix = "far" | "fas";
330
+ export interface LayerProps {
331
+ children: ReactChildren;
332
+ }
333
+ export interface AccessibilityProps {
334
+ accessibilityLabel: string;
335
+ accessibilityHint: string;
336
+ }
337
+ export interface BoxPropsBase {
338
+ alignContent?: AlignContent;
339
+ alignItems?: AlignItems;
340
+ alignSelf?: AlignSelf;
341
+ bottom?: boolean;
342
+ children?: ReactChildren;
343
+ color?: BoxColor;
344
+ column?: UnsignedUpTo12;
345
+ smColumn?: UnsignedUpTo12;
346
+ mdColumn?: UnsignedUpTo12;
347
+ lgColumn?: UnsignedUpTo12;
348
+ dangerouslySetInlineStyle?: {
349
+ __style: {
350
+ [key: string]: any;
351
+ };
352
+ };
353
+ direction?: "row" | "column";
354
+ smDirection?: "row" | "column";
355
+ mdDirection?: "row" | "column";
356
+ lgDirection?: "row" | "column";
357
+ display?: "none" | "flex" | "block" | "inlineBlock" | "visuallyHidden";
358
+ smDisplay?: "none" | "flex" | "block" | "inlineBlock" | "visuallyHidden";
359
+ mdDisplay?: "none" | "flex" | "block" | "inlineBlock" | "visuallyHidden";
360
+ lgDisplay?: "none" | "flex" | "block" | "inlineBlock" | "visuallyHidden";
361
+ fit?: boolean;
362
+ flex?: "grow" | "shrink" | "none";
363
+ gap?: SignedUpTo12;
364
+ height?: NumberOrPercentage;
365
+ justifyContent?: "start" | "end" | "center" | "between" | "around";
366
+ left?: boolean;
367
+ margin?: SignedUpTo12;
368
+ smMargin?: SignedUpTo12;
369
+ mdMargin?: SignedUpTo12;
370
+ lgMargin?: SignedUpTo12;
371
+ marginBottom?: SignedUpTo12;
372
+ smMarginBottom?: SignedUpTo12;
373
+ mdMarginBottom?: SignedUpTo12;
374
+ lgMarginBottom?: SignedUpTo12;
375
+ marginEnd?: SignedUpTo12;
376
+ smMarginEnd?: SignedUpTo12;
377
+ mdMarginEnd?: SignedUpTo12;
378
+ lgMarginEnd?: SignedUpTo12;
379
+ marginLeft?: SignedUpTo12;
380
+ smMarginLeft?: SignedUpTo12;
381
+ mdMarginLeft?: SignedUpTo12;
382
+ lgMarginLeft?: SignedUpTo12;
383
+ marginRight?: SignedUpTo12;
384
+ smMarginRight?: SignedUpTo12;
385
+ mdMarginRight?: SignedUpTo12;
386
+ lgMarginRight?: SignedUpTo12;
387
+ marginStart?: SignedUpTo12;
388
+ smMarginStart?: SignedUpTo12;
389
+ mdMarginStart?: SignedUpTo12;
390
+ lgMarginStart?: SignedUpTo12;
391
+ marginTop?: SignedUpTo12;
392
+ smMarginTop?: SignedUpTo12;
393
+ mdMarginTop?: SignedUpTo12;
394
+ lgMarginTop?: SignedUpTo12;
395
+ maxHeight?: NumberOrPercentage;
396
+ maxWidth?: NumberOrPercentage;
397
+ minHeight?: NumberOrPercentage;
398
+ minWidth?: NumberOrPercentage;
399
+ overflow?: "visible" | "hidden" | "scroll" | "scrollX" | "scrollY" | "auto";
400
+ padding?: UnsignedUpTo12;
401
+ smPadding?: UnsignedUpTo12;
402
+ mdPadding?: UnsignedUpTo12;
403
+ lgPadding?: UnsignedUpTo12;
404
+ paddingX?: UnsignedUpTo12;
405
+ smPaddingX?: UnsignedUpTo12;
406
+ mdPaddingX?: UnsignedUpTo12;
407
+ lgPaddingX?: UnsignedUpTo12;
408
+ paddingY?: UnsignedUpTo12;
409
+ smPaddingY?: UnsignedUpTo12;
410
+ mdPaddingY?: UnsignedUpTo12;
411
+ lgPaddingY?: UnsignedUpTo12;
412
+ position?: "static" | "absolute" | "relative" | "fixed";
413
+ right?: boolean;
414
+ rounding?: Rounding | "circle";
415
+ top?: boolean;
416
+ width?: NumberOrPercentage;
417
+ wrap?: boolean;
418
+ zIndex?: number | "auto";
419
+ onClick?: () => void | Promise<void>;
420
+ className?: string;
421
+ style?: any;
422
+ onHoverStart?: () => void | Promise<void>;
423
+ onHoverEnd?: () => void | Promise<void>;
424
+ scroll?: boolean;
425
+ shadow?: boolean;
426
+ border?: BorderColor;
427
+ borderBottom?: BorderColor;
428
+ borderTop?: BorderColor;
429
+ borderLeft?: BorderColor;
430
+ borderRight?: BorderColor;
431
+ avoidKeyboard?: boolean;
432
+ keyboardOffset?: number;
433
+ scrollRef?: React.RefObject<any>;
434
+ onScroll?: (offsetY: number) => void;
435
+ onLayout?: (event: LayoutChangeEvent) => void;
436
+ testID?: string;
437
+ }
438
+ export type BoxProps = (BoxPropsBase & {
439
+ onClick?: undefined;
440
+ }) | (BoxPropsBase & {
441
+ onClick: () => void;
442
+ } & AccessibilityProps);
443
+ export type BoxColor = SurfaceColor | "transparent";
444
+ export interface ErrorBoundaryProps {
445
+ onError?: (error: Error, stack: any) => void;
446
+ children?: ReactNode;
447
+ }
448
+ export interface IconProps {
449
+ iconName: IconName;
450
+ type?: "regular" | "brand" | "solid" | "light" | "thin" | "duotone" | "sharpSolid" | "sharpLight" | "sharp";
451
+ color?: IconColor;
452
+ size?: IconSize;
453
+ testID?: string;
454
+ }
455
+ export type TooltipPosition = "top" | "bottom" | "left" | "right";
456
+ export type IndicatorDirection = "topLeft" | "topRight" | "bottomLeft" | "bottomRight";
457
+ export interface SegmentedControlBadgeConfig {
458
+ count: number;
459
+ status?: "info" | "error" | "warning" | "success" | "neutral";
460
+ }
461
+ export interface SegmentedControlProps {
462
+ items: string[];
463
+ size?: "md" | "lg";
464
+ onChange: (activeIndex: number) => void;
465
+ selectedIndex?: number;
466
+ maxItems?: number;
467
+ badges?: SegmentedControlBadgeConfig[];
468
+ }
469
+ export interface TimezonePickerProps {
470
+ timezone?: string;
471
+ onChange: (tz: string | undefined) => void | Promise<void>;
472
+ showLabel?: boolean;
473
+ width?: number | string;
474
+ }
475
+ export interface TextStyleWithOutline extends TextStyle {
476
+ outline?: string;
477
+ }
478
+ interface BaseFieldProps {
479
+ id?: string;
480
+ testID?: string;
481
+ title?: string;
482
+ placeholder?: string;
483
+ iconName?: IconName;
484
+ onIconClick?: () => void;
485
+ onBlur?: OnChangeCallback;
486
+ onChange: OnChangeCallback;
487
+ onEnter?: () => void;
488
+ onFocus?: () => void;
489
+ onSubmitEditing?: () => void;
490
+ blurOnSubmit?: boolean;
491
+ disabled?: boolean;
492
+ value?: string;
493
+ }
494
+ export interface HelperTextProps {
495
+ helperText?: string;
496
+ }
497
+ export interface ErrorTextProps {
498
+ errorText?: string;
499
+ }
500
+ export interface TextFieldProps extends BaseFieldProps, HelperTextProps, ErrorTextProps {
501
+ type?: "email" | "password" | "phoneNumber" | "search" | "text" | "url";
502
+ autoComplete?: "current-password" | "on" | "off" | "username";
503
+ returnKeyType?: "done" | "go" | "next" | "search" | "send";
504
+ grow?: boolean;
505
+ multiline?: boolean;
506
+ rows?: number;
507
+ inputRef?: any;
508
+ trimOnBlur?: boolean;
509
+ }
510
+ export interface TextAreaProps extends Omit<TextFieldProps, "multiline" | "type"> {
511
+ }
512
+ export interface NumberFieldProps extends BaseFieldProps, HelperTextProps, ErrorTextProps {
513
+ type: "number" | "decimal";
514
+ min?: number;
515
+ max?: number;
516
+ }
517
+ export interface NumberRangeFieldProps extends BaseFieldProps, HelperTextProps, ErrorTextProps {
518
+ type: "numberRange" | "decimalRange";
519
+ min: number;
520
+ max: number;
521
+ }
522
+ export interface DateTimeFieldProps extends BaseFieldProps, HelperTextProps, ErrorTextProps {
523
+ type: "date" | "datetime" | "time";
524
+ value?: string;
525
+ onChange: (date: string) => void;
526
+ onTimezoneChange?: (timezone: string) => void;
527
+ dateFormat?: string;
528
+ pickerType?: "default" | "compact" | "inline" | "spinner";
529
+ showTimezone?: boolean;
530
+ timezone?: string;
531
+ }
532
+ export interface EmailFieldProps extends BaseFieldProps, HelperTextProps, ErrorTextProps {
533
+ }
534
+ export interface PhoneNumberFieldProps extends BaseFieldProps, HelperTextProps, ErrorTextProps {
535
+ /**
536
+ * Defaults to "US"
537
+ */
538
+ defaultCountryCode?: CountryCode;
539
+ }
540
+ export interface URLFieldProps extends BaseFieldProps, HelperTextProps, ErrorTextProps {
541
+ }
542
+ export interface SearchFieldProps extends BaseFieldProps, HelperTextProps, ErrorTextProps {
543
+ }
544
+ export interface PercentFieldProps extends BaseFieldProps, HelperTextProps, ErrorTextProps {
545
+ }
546
+ export interface CurrencyFieldProps extends BaseFieldProps, HelperTextProps, ErrorTextProps {
547
+ }
548
+ export interface AddressFieldProps extends Omit<BaseFieldProps, "value" | "onChange" | "onBlur">, HelperTextProps, ErrorTextProps {
549
+ includeCounty?: boolean;
550
+ googleMapsApiKey?: string;
551
+ googlePlacesMobileStyles?: Styles;
552
+ value: AddressInterface;
553
+ onChange: (value: AddressInterface) => void;
554
+ onBlur?: (value: AddressInterface) => void;
555
+ }
556
+ export type Rounding = "minimal" | "default" | "full" | "rounded" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
557
+ export declare function getRounding(rounding: Rounding): number;
558
+ export interface HeadingProps {
559
+ align?: "left" | "right" | "center" | "justify";
560
+ children?: React.ReactNode;
561
+ color?: TextColor;
562
+ overflow?: "normal" | "breakWord";
563
+ size?: "sm" | "md" | "lg" | "xl" | "2xl";
564
+ truncate?: boolean;
565
+ testID?: string;
566
+ }
567
+ export interface MetaProps {
568
+ itemProp?: string;
569
+ content?: string;
570
+ itemType?: string;
571
+ key?: string;
572
+ property?: string;
573
+ children?: ReactNode;
574
+ }
575
+ export interface ImageProps {
576
+ alt?: string;
577
+ color: BoxColor;
578
+ naturalHeight?: number;
579
+ naturalWidth?: number;
580
+ maxWidth?: number;
581
+ maxHeight?: number;
582
+ src: string;
583
+ children?: ReactChildren;
584
+ fit?: "cover" | "contain" | "none";
585
+ onError?: () => void;
586
+ onLoad?: () => void;
587
+ size?: string;
588
+ srcSet?: string;
589
+ fullWidth?: boolean;
590
+ style?: any;
591
+ }
592
+ export interface BackButtonInterface {
593
+ onBack: () => void;
594
+ }
595
+ export interface BooleanFieldProps extends HelperTextProps, ErrorTextProps {
596
+ title?: string;
597
+ variant?: "simple" | "title";
598
+ disabled?: boolean;
599
+ disabledHelperText?: string;
600
+ value: boolean;
601
+ onChange: (value: boolean) => void;
602
+ }
603
+ export interface CheckBoxProps {
604
+ /**
605
+ * The background color of the checkbox.
606
+ * @default "default"
607
+ */
608
+ bgColor?: "default" | "accent" | "black";
609
+ /**
610
+ * If true, the checkbox is selected.
611
+ */
612
+ selected: boolean;
613
+ /**
614
+ * The size of the checkbox.
615
+ * @default "md"
616
+ */
617
+ size?: "sm" | "md" | "lg";
618
+ }
619
+ export interface LayoutRectangle {
620
+ x: number;
621
+ y: number;
622
+ width: number;
623
+ height: number;
624
+ }
625
+ export interface LayoutChangeEvent {
626
+ nativeEvent: {
627
+ layout: LayoutRectangle;
628
+ };
629
+ }
630
+ export interface SplitPageProps {
631
+ /**
632
+ * can accept either one React Child or any array of ReactChild. If this is not provided,
633
+ * renderContent must return one or many ReactChild.
634
+ */
635
+ children?: ReactChild | ReactChild[] | null;
636
+ /**
637
+ * The names of the tabs that will be generated per ReactChild provided.
638
+ * Tabs will not be generated if renderContent is provided in place of children
639
+ */
640
+ tabs?: string[];
641
+ selectLimit?: number;
642
+ bottomNavBarHeight?: number;
643
+ showItemList?: boolean;
644
+ loading?: boolean;
645
+ color?: SurfaceColor;
646
+ keyboardOffset?: number;
647
+ renderListViewItem: (itemInfo: ListRenderItemInfo<any>) => ReactElement | null;
648
+ renderListViewHeader?: () => ReactElement | null;
649
+ renderContent?: (index?: number) => ReactElement | ReactElement[] | null;
650
+ listViewData: any[];
651
+ listViewExtraData?: any;
652
+ listViewWidth?: number;
653
+ listViewMaxWidth?: number;
654
+ renderChild?: () => ReactChild;
655
+ onSelectionChange?: (value?: any) => void | Promise<void>;
656
+ }
657
+ export type PermissionKind = "location" | "locationAlways" | "camera" | "microphone" | "photo" | "contacts" | "event" | "reminder" | "bluetooth" | "notification" | "backgroundRefresh" | "speechRecognition" | "mediaLibrary" | "motion";
658
+ export type PermissionStatus = "authorized" | "denied" | "softDenied" | "restricted" | "undetermined";
659
+ export interface AddressInterface {
660
+ address1: string;
661
+ address2?: string;
662
+ city: string;
663
+ state: string;
664
+ zipcode: string;
665
+ countyName?: string;
666
+ countyCode?: string;
667
+ }
668
+ export interface TransformValueOptions {
669
+ func?: (value: string) => string;
670
+ options?: {
671
+ [key: string]: any;
672
+ };
673
+ }
674
+ export type ReactChild = ReactNode;
675
+ export type ReactChildren = ReactNode;
676
+ export type WithChildren<P> = P & {
677
+ children?: ReactNode;
678
+ };
679
+ export interface AddressAutocompleteProps {
680
+ disabled?: boolean;
681
+ googleMapsApiKey?: string;
682
+ includeCounty?: boolean;
683
+ inputValue: string;
684
+ styles?: Styles;
685
+ handleAddressChange: OnChangeCallback;
686
+ handleAutoCompleteChange: (value: AddressInterface) => void;
687
+ googlePlacesMobileStyles?: Styles;
688
+ testID?: string;
689
+ }
690
+ export interface ActionSheetProps {
691
+ children?: React.ReactNode;
692
+ ref?: React.MutableRefObject<{
693
+ /**
694
+ * Open or close the ActionSheet.
695
+ */
696
+ setModalVisible(visible?: boolean): void;
697
+ /**
698
+ * Open the Action Sheet.
699
+ */
700
+ show(): void;
701
+ /**
702
+ * Close the ActionSheet.
703
+ */
704
+ hide(): void;
705
+ /**
706
+ * Attach this to any child ScrollView Component's onScrollEndDrag,
707
+ * onMomentumScrollEnd,onScrollAnimationEnd callbacks to handle the ActionSheet
708
+ * closing and bouncing back properly.
709
+ */
710
+ handleChildScrollEnd(): void;
711
+ /**
712
+ * Snap ActionSheet to given offset
713
+ */
714
+ snapToOffset(offset: number): void;
715
+ }>;
716
+ /**
717
+ * Animate the opening and closing of ActionSheet.
718
+
719
+ | Type | Required |
720
+ | ---- | -------- |
721
+ | boolean | no |
722
+
723
+ Default: `true`
724
+ */
725
+ animated?: boolean;
726
+ /**
727
+ * Use if you want to show the ActionSheet Partially on Opening.
728
+ * **Requires `gestureEnabled=true`**
729
+
730
+ | Type | Required |
731
+ | ---- | -------- |
732
+ | boolean | no |
733
+
734
+ Default:`1`
735
+ */
736
+ initialOffsetFromBottom?: number;
737
+ /**
738
+ * When touch ends and user has not moved farther from the set springOffset,
739
+ * the ActionSheet will return to previous position.
740
+
741
+ | Type | Required |
742
+ | ---- | -------- |
743
+ | number | no |
744
+
745
+ Default: `50`
746
+ */
747
+ springOffset?: number;
748
+ /**
749
+ * Add elevation to the ActionSheet container.
750
+
751
+ | Type | Required |
752
+ | ---- | -------- |
753
+ | number | no |
754
+
755
+ Default: `0`
756
+
757
+ #
758
+ */
759
+ elevation?: number;
760
+ /**
761
+ * Color of the gestureEnabled Indicator.
762
+
763
+ | Type | Required |
764
+ | ---- | -------- |
765
+ | string | no |
766
+
767
+ Default: `"#f0f0f0"`
768
+ */
769
+ indicatorColor?: string;
770
+ /**
771
+ * Normally when the ActionSheet is fully opened, a small portion from the bottom is hidden by
772
+ * default. Use this prop if you want the ActionSheet to hover over the bottom of screen and not
773
+ * hide a little behind it.
774
+
775
+ | Type | Required |
776
+ | ---- | -------- |
777
+ | number | no |
778
+
779
+ Default:`0`
780
+ */
781
+ extraScroll?: number;
782
+ /**
783
+ * Color of the overlay/backdrop.
784
+
785
+ | Type | Required |
786
+ | ---- | -------- |
787
+ | string | no |
788
+
789
+ Default: `"black"`
790
+ */
791
+ overlayColor?: string;
792
+ /**
793
+ * Keep the header always visible even when gestures are disabled.
794
+
795
+ | Type | Required |
796
+ | ---- | -------- |
797
+ | boolean | no |
798
+
799
+ Default: `false`
800
+ */
801
+ headerAlwaysVisible?: boolean;
802
+ /**
803
+ * Delay draw of ActionSheet on open for android.
804
+
805
+ | Type | Required |
806
+ | ---- | -------- |
807
+ | boolean | no |
808
+
809
+ Default: `false`
810
+ */
811
+ delayActionSheetDraw?: boolean;
812
+ /**
813
+ * Delay draw of ActionSheet on open for android time.
814
+
815
+ | Type | Required |
816
+ | ---- | -------- |
817
+ | number (ms) | no |
818
+
819
+ Default: `50`
820
+ */
821
+ delayActionSheetDrawTime?: number;
822
+ /**
823
+ * Your custom header component. Using this will hide the default indicator.
824
+
825
+ | Type | Required |
826
+ | ---- | -------- |
827
+ | React.Component | no |
828
+ */
829
+ CustomHeaderComponent?: React.ReactNode;
830
+ /**
831
+ * Any custom styles for the container.
832
+
833
+ | Type | Required |
834
+ | ---- | -------- |
835
+ | Object | no |
836
+ */
837
+ containerStyle?: ViewStyle;
838
+ /**
839
+ * Control closing ActionSheet by touching on backdrop.
840
+
841
+ | Type | Required |
842
+ | ---- | -------- |
843
+ | boolean | no |
844
+
845
+ Default: `true`
846
+ */
847
+ closeOnTouchBackdrop?: boolean;
848
+ /**
849
+ * Speed of opening animation. Higher means the ActionSheet will open more quickly.
850
+
851
+ | Type | Required |
852
+ | ---- | -------- |
853
+ | number | no |
854
+
855
+ Default: `12`
856
+ */
857
+ openAnimationSpeed?: number;
858
+ /**
859
+ * Duration of closing animation.
860
+
861
+ | Type | Required |
862
+ | ---- | -------- |
863
+ | number | no |
864
+
865
+ Default: `300`
866
+ */
867
+ closeAnimationDuration?: number;
868
+ /**
869
+ *
870
+ How much you want the ActionSheet to bounce when it is opened.
871
+
872
+ | Type | Required |
873
+ | ---- | -------- |
874
+ | number | no |
875
+
876
+ Default: `8`
877
+ */
878
+ bounciness?: number;
879
+ /**
880
+ * Will the ActionSheet close on `hardwareBackPress` event.
881
+
882
+ | Type | Required |
883
+ | ---- | -------- |
884
+ | boolean | no |
885
+
886
+ Default: `true`
887
+ */
888
+ closeOnPressBack?: boolean;
889
+ /**
890
+ * Default opacity of the overlay/backdrop.
891
+
892
+ | Type | Required |
893
+ | ---- | -------- |
894
+ | number 0 - 1 | no |
895
+
896
+ Default: `0.3`
897
+ */
898
+ defaultOverlayOpacity?: number;
899
+ /**
900
+ * Enables gesture control of ActionSheet
901
+
902
+ | Type | Required |
903
+ | ---- | -------- |
904
+ | boolean | no |
905
+
906
+ Default: `false`
907
+ */
908
+ gestureEnabled?: boolean;
909
+ /**
910
+ * Bounces the ActionSheet on open.
911
+
912
+ | Type | Required |
913
+ | ---- | -------- |
914
+ | boolean | no |
915
+
916
+ Default: `false`
917
+ */
918
+ bounceOnOpen?: boolean;
919
+ /**
920
+ * Setting the keyboard persistence of the ScrollView component, should be one of "never",
921
+ * "always", or "handled"
922
+
923
+ | Type | Required |
924
+ | ---- | -------- |
925
+ | string | no |
926
+
927
+ Default: `"never"`
928
+ */
929
+ keyboardShouldPersistTaps?: boolean | "always" | "never" | "handled";
930
+ /**
931
+ * Determine whether the modal should go under the system statusbar.
932
+
933
+ | Type | Required |
934
+ | ---- | -------- |
935
+ | boolean | no |
936
+
937
+ Default: `true`
938
+ */
939
+ statusBarTranslucent?: boolean;
940
+ /**
941
+ * Prevent ActionSheet from closing on
942
+ * gesture or tapping on backdrop.
943
+ * Instead snap it to `bottomOffset` location
944
+ *
945
+ *
946
+ * | Type | Required |
947
+ | ---- | -------- |
948
+ | boolean | no |
949
+ */
950
+ closable?: boolean;
951
+ /**
952
+ * Allow ActionSheet to draw under the StatusBar.
953
+ * This is enabled by default.
954
+ *
955
+ *
956
+ * | Type | Required |
957
+ | ---- | -------- |
958
+ | boolean | no |
959
+ Default: `true`
960
+ */
961
+ drawUnderStatusBar?: boolean;
962
+ /**
963
+ * Snap ActionSheet to this location if `closable` is set to false;
964
+ *
965
+ *
966
+ * | Type | Required |
967
+ | ---- | -------- |
968
+ | number | no |
969
+ */
970
+ bottomOffset?: number;
971
+ /**
972
+ * Change how ActionSheet behaves when keyboard is opened.
973
+ *
974
+ *
975
+ * | Type | Required |
976
+ | ---- | -------- |
977
+ | "padding" | "position" | no |
978
+ Default:`padding`
979
+ */
980
+ keyboardMode?: "padding" | "position";
981
+ /**
982
+ * Test ID for unit testing
983
+ */
984
+ testID?: string;
985
+ /**
986
+ *
987
+ Event called when the ActionSheet closes.
988
+
989
+
990
+ * | Type | Required |
991
+ | ---- | -------- |
992
+ | function | no |
993
+
994
+
995
+ #
996
+ */
997
+ onClose?: () => void;
998
+ /**
999
+ * An event called when the ActionSheet Opens.
1000
+
1001
+ | Type | Required |
1002
+ | ---- | -------- |
1003
+ | function | no |
1004
+ */
1005
+ onOpen?: () => void;
1006
+ /**
1007
+ * Event called when position of ActionSheet changes.
1008
+ */
1009
+ onPositionChanged?: (hasReachedTop: boolean) => void;
1010
+ }
1011
+ export type AvatarStatus = "offline" | "online" | "outOfOffice" | "activeMobile" | "imagePicker";
1012
+ export interface AvatarImagePickerEvent {
1013
+ avatarImageFormat?: string;
1014
+ base64?: string;
1015
+ uri?: string;
1016
+ height?: number;
1017
+ width?: number;
1018
+ }
1019
+ export interface CustomSvgProps extends SvgProps {
1020
+ doNotDisturb?: boolean;
1021
+ }
1022
+ export interface AvatarProps {
1023
+ /**
1024
+ * The name of the user. This is used for the placeholder treatment if an image is not available.
1025
+ */
1026
+ name: string;
1027
+ /**
1028
+ * Adds a white border around Avatar so it's visible when displayed on other images.
1029
+ */
1030
+ hasBorder?: boolean;
1031
+ /**
1032
+ * xs: 24px, sm: 32px, md: 48px, lg: 64px, xl: 120px.
1033
+ */
1034
+ size?: "xs" | "sm" | "md" | "lg" | "xl";
1035
+ /**
1036
+ * The URL of the user's image.
1037
+ */
1038
+ src?: string;
1039
+ /**
1040
+ * Function to handle the avatar image edit
1041
+ */
1042
+ onChange?: (val: AvatarImagePickerEvent) => void;
1043
+ /**
1044
+ * The status of the user to display with the avatar.
1045
+ */
1046
+ status?: AvatarStatus;
1047
+ /**
1048
+ * If true, the status will have a "Z" to indicate the user has snoozed notifications.
1049
+ */
1050
+ doNotDisturb?: boolean;
1051
+ /**
1052
+ * Accessibility label for the avatar image.
1053
+ */
1054
+ accessibilityLabel?: string;
1055
+ /**
1056
+ * Test ID for unit testing
1057
+ */
1058
+ testID?: string;
1059
+ }
1060
+ export interface BadgeProps {
1061
+ /**
1062
+ * When status is "custom", determines the badge's background color.
1063
+ */
1064
+ customBackgroundColor?: string;
1065
+ /**
1066
+ * When status is "custom", determines the badge's border color.
1067
+ */
1068
+ customBorderColor?: string;
1069
+ /**
1070
+ * When status is "custom", determines the badge's icon color
1071
+ */
1072
+ customIconColor?: IconColor;
1073
+ /**
1074
+ * When status is "custom", determines the badge's icon
1075
+ */
1076
+ customIconName?: IconName;
1077
+ /**
1078
+ * When status is "custom", determines the badge's text color.
1079
+ */
1080
+ customTextColor?: string;
1081
+ /**
1082
+ * The name of the icon to display in the badge.
1083
+ */
1084
+ iconName?: IconName;
1085
+ /**
1086
+ * The maximum value to display. Used for "numberOnly" variant to display "${maxValue}+" when
1087
+ * value is greater than max.
1088
+ */
1089
+ maxValue?: number;
1090
+ /**
1091
+ * If true, the badge will have a secondary style.
1092
+ * @default false
1093
+ */
1094
+ secondary?: boolean;
1095
+ /**
1096
+ * The status of the badge. Determines its color and appearance.
1097
+ * @default "info"
1098
+ */
1099
+ status?: "info" | "error" | "warning" | "success" | "neutral" | "custom";
1100
+ /**
1101
+ * Test ID for unit testing
1102
+ */
1103
+ testID?: string;
1104
+ /**
1105
+ * The text or number to display inside the badge.
1106
+ */
1107
+ value?: number | string;
1108
+ /**
1109
+ * The variant of the badge. Determines if it displays an icon or number only.
1110
+ */
1111
+ variant?: "iconOnly" | "numberOnly";
1112
+ }
1113
+ export interface SelectBadgeProps {
1114
+ /**
1115
+ * When status is "custom", determines the badge's background color.
1116
+ */
1117
+ customBackgroundColor?: string;
1118
+ /**
1119
+ * When status is "custom", determines the badge's border color.
1120
+ */
1121
+ customBorderColor?: string;
1122
+ /**
1123
+ * When status is "custom", determines the badge's text color.
1124
+ */
1125
+ customTextColor?: string;
1126
+ /**
1127
+ * If true, the badge will be disabled and not interactive.
1128
+ * @default false
1129
+ */
1130
+ disabled?: boolean;
1131
+ /**
1132
+ * The options available for the dropdown badge.
1133
+ * Each option should have a label and a value.
1134
+ */
1135
+ options: FieldOption[];
1136
+ /**
1137
+ * The current value of the select field.
1138
+ */
1139
+ value?: string;
1140
+ /**
1141
+ * If true, the badge will have a secondary style.
1142
+ * @default false
1143
+ */
1144
+ secondary?: boolean;
1145
+ /**
1146
+ * The status of the badge. Determines its color and appearance.
1147
+ * @default "info"
1148
+ */
1149
+ status?: "info" | "error" | "warning" | "success" | "neutral" | "custom";
1150
+ /**
1151
+ * The function to call when the selected value changes.
1152
+ */
1153
+ onChange: (value: string) => void;
1154
+ }
1155
+ export interface BannerButtonProps {
1156
+ /**
1157
+ * Text to display on optional banner button, will display button if provided
1158
+ */
1159
+ buttonText: string;
1160
+ /**
1161
+ * Icon to display on optional banner button
1162
+ */
1163
+ buttonIconName?: IconName;
1164
+ }
1165
+ export interface BannerPropsBase {
1166
+ /**
1167
+ * Used to identify if banner has been dismissed by the user.
1168
+ */
1169
+ id: string;
1170
+ /**
1171
+ * The text to display in the main body of the banner.
1172
+ */
1173
+ text: string;
1174
+ /**
1175
+ * The status of the banner changes the color of the banner.
1176
+ * @default "info"
1177
+ */
1178
+ status?: "info" | "alert" | "warning";
1179
+ /**
1180
+ * Allows the banner to be dismissed and removed by clicking X button on the right.
1181
+ * @default false
1182
+ */
1183
+ dismissible?: boolean;
1184
+ /**
1185
+ * Renders triangle with exclamation mark icon to the left of banner content.
1186
+ * @default false
1187
+ */
1188
+ hasIcon?: boolean;
1189
+ /**
1190
+ * Function called when optional button on banner is clicked.
1191
+ */
1192
+ buttonOnClick?: () => void | Promise<void>;
1193
+ }
1194
+ export type BannerProps = (BannerPropsBase & {
1195
+ buttonOnClick?: undefined;
1196
+ }) | (BannerPropsBase & {
1197
+ buttonOnClick: () => void | Promise<void>;
1198
+ } & BannerButtonProps);
1199
+ export interface BodyProps {
1200
+ scroll?: boolean;
1201
+ loading?: boolean;
1202
+ padding?: UnsignedUpTo12;
1203
+ height?: number | string;
1204
+ avoidKeyboard?: boolean;
1205
+ children?: ReactNode;
1206
+ }
1207
+ export interface ButtonProps {
1208
+ /**
1209
+ * The text content of the confirmation modal.
1210
+ * @default "Are you sure you want to continue?"
1211
+ */
1212
+ confirmationText?: string;
1213
+ /**
1214
+ * If true, the button will be disabled.
1215
+ * @default false
1216
+ */
1217
+ disabled?: boolean;
1218
+ /**
1219
+ * If true, the button will take the full width of its container.
1220
+ * @default false
1221
+ */
1222
+ fullWidth?: boolean;
1223
+ /**
1224
+ * The name of the icon to display in the button.
1225
+ */
1226
+ iconName?: IconName;
1227
+ /**
1228
+ * The position of the icon within the button.
1229
+ * @default "left"
1230
+ */
1231
+ iconPosition?: "left" | "right";
1232
+ /**
1233
+ * If true, a loading spinner will be shown in the button.
1234
+ */
1235
+ loading?: boolean;
1236
+ /**
1237
+ * The title of the confirmation modal.
1238
+ * @default "Confirm"
1239
+ */
1240
+ modalTitle?: string;
1241
+ /**
1242
+ * The subtitle of the confirmation modal.
1243
+ */
1244
+ modalSubTitle?: string;
1245
+ /**
1246
+ * The test ID for the button, used for testing purposes.
1247
+ */
1248
+ testID?: string;
1249
+ /**
1250
+ * The text content of the button.
1251
+ */
1252
+ text: string;
1253
+ /**
1254
+ * The position of the tooltip.
1255
+ */
1256
+ tooltipIdealPosition?: TooltipPosition;
1257
+ /**
1258
+ * Include an arrow in the tooltip. Pointing to the button.
1259
+ * @default false
1260
+ */
1261
+ tooltipIncludeArrow?: boolean;
1262
+ /**
1263
+ * The text content of the tooltip.
1264
+ */
1265
+ tooltipText?: string;
1266
+ /**
1267
+ * The type of the button, which determines its style.
1268
+ * @default "primary"
1269
+ */
1270
+ variant?: "primary" | "secondary" | "muted" | "outline" | "destructive";
1271
+ /**
1272
+ * If true, a confirmation modal will be shown before the onClick action.
1273
+ */
1274
+ withConfirmation?: boolean;
1275
+ /**
1276
+ * The function to call when the button is clicked.
1277
+ */
1278
+ onClick: () => void | Promise<void>;
1279
+ }
1280
+ export interface CustomSelectFieldProps {
1281
+ /**
1282
+ * The current value of the custom select field.
1283
+ */
1284
+ value: string | undefined;
1285
+ /**
1286
+ * The function to call when the custom select field value changes.
1287
+ */
1288
+ onChange: (value: string | undefined) => void;
1289
+ /**
1290
+ * The options available for selection in the select field.
1291
+ * Each option should have a label and a value.
1292
+ */
1293
+ options: FieldOption[];
1294
+ /**
1295
+ * The placeholder text to display when no option is selected.
1296
+ */
1297
+ placeholder?: string;
1298
+ /**
1299
+ * If true, the select field will be disabled.
1300
+ * @default false
1301
+ */
1302
+ disabled?: boolean;
1303
+ /**
1304
+ * The error text to display if there is an error.
1305
+ */
1306
+ errorText?: string;
1307
+ /**
1308
+ * The helper text to display below the select field.
1309
+ */
1310
+ helperText?: string;
1311
+ /**
1312
+ * The title of the custom select field.
1313
+ */
1314
+ title?: string;
1315
+ }
1316
+ export interface DateTimeActionSheetProps {
1317
+ value?: string;
1318
+ type?: "date" | "time" | "datetime";
1319
+ onChange: OnChangeCallback;
1320
+ actionSheetRef: React.RefObject<any>;
1321
+ visible: boolean;
1322
+ onDismiss: () => void;
1323
+ timezone?: string;
1324
+ }
1325
+ export interface DecimalRangeActionSheetProps {
1326
+ value: string;
1327
+ min: number;
1328
+ max: number;
1329
+ onChange: OnChangeCallback;
1330
+ actionSheetRef: React.RefObject<any>;
1331
+ }
1332
+ export interface DecimalRangeActionSheetState {
1333
+ whole: string;
1334
+ decimal: string;
1335
+ }
1336
+ export interface DismissButtonProps {
1337
+ /**
1338
+ * The accessibility hint describes the results of performing an action on a control or view.
1339
+ * It should be a very brief description of the result of interacting with the button.
1340
+ */
1341
+ accessibilityHint: string;
1342
+ /**
1343
+ * The accessibility label attribute identifies the user interface element.
1344
+ * It should be a very brief description of the element, such as "Dismiss".
1345
+ */
1346
+ accessibilityLabel: string;
1347
+ /**
1348
+ * A function to call when the button is clicked,
1349
+ * function should result in hiding the element rendering the dismiss button.
1350
+ */
1351
+ onClick: () => void;
1352
+ /**
1353
+ * Color of the icon on the dismiss button
1354
+ * @default "primary"
1355
+ */
1356
+ color?: IconColor;
1357
+ }
1358
+ export interface ErrorPageProps {
1359
+ error: Error;
1360
+ resetError: () => void;
1361
+ }
1362
+ export type FieldProps = TextFieldProps | NumberFieldProps | NumberRangeFieldProps | DateTimeFieldProps | (MultiselectFieldProps & {
1363
+ type: "multiselect";
1364
+ }) | (TextAreaProps & {
1365
+ type: "textarea";
1366
+ }) | (SelectFieldProps & {
1367
+ type: "select";
1368
+ }) | (CustomSelectFieldProps & {
1369
+ type: "customSelect";
1370
+ }) | (EmailFieldProps & {
1371
+ type: "email";
1372
+ }) | (PhoneNumberFieldProps & {
1373
+ type: "phoneNumber";
1374
+ }) | (BooleanFieldProps & {
1375
+ type: "boolean";
1376
+ }) | (RadioFieldProps & {
1377
+ type: "radio";
1378
+ }) | (SignatureFieldProps & {
1379
+ type: "signature";
1380
+ }) | (SearchFieldProps & {
1381
+ type: "search";
1382
+ }) | (AddressFieldProps & {
1383
+ type: "address";
1384
+ });
1385
+ export interface HeightActionSheetProps {
1386
+ value?: string;
1387
+ onChange: OnChangeCallback;
1388
+ actionSheetRef: React.RefObject<any>;
1389
+ }
1390
+ export interface HyperlinkProps {
1391
+ linkDefault?: boolean;
1392
+ linkify?: any;
1393
+ linkStyle?: StyleProp<any>;
1394
+ linkText?: string | ((url: string) => string);
1395
+ onPress?: (url: string) => void;
1396
+ onLongPress?: (url: string, text: string) => void;
1397
+ injectViewProps?: (url: string) => any;
1398
+ children?: React.ReactNode;
1399
+ style?: StyleProp<any>;
1400
+ }
1401
+ export interface IconButtonProps {
1402
+ /**
1403
+ * The accessibility hint describes the results of performing an action on a control or view.
1404
+ * It should be a very brief description of the result of interacting with the button.
1405
+ */
1406
+ accessibilityHint?: string;
1407
+ /**
1408
+ * The accessibility label attribute identifies the user interface element.
1409
+ * It should be a very brief description of the element, such as "Add", "Play", "Deleted", etc.
1410
+ */
1411
+ accessibilityLabel: string;
1412
+ /**
1413
+ * The heading of the confirmation modal.
1414
+ * @default "Confirm"
1415
+ */
1416
+ confirmationHeading?: string;
1417
+ /**
1418
+ * The text content of the confirmation modal.
1419
+ * @default "Are you sure you want to continue?"
1420
+ */
1421
+ confirmationText?: string;
1422
+ /**
1423
+ * If true, the button will be disabled.
1424
+ * @default false
1425
+ */
1426
+ disabled?: boolean;
1427
+ /**
1428
+ * Show a small indicator icon in the lower right corner of the button.
1429
+ */
1430
+ indicator?: "error" | "warning" | "success" | "primary" | "neutral";
1431
+ /**
1432
+ * The text or number to display in the indicator. If not provided,
1433
+ * the indicator will be a solid circle.
1434
+ */
1435
+ indicatorText?: number | string;
1436
+ /**
1437
+ * The name of the icon to display in the button.
1438
+ */
1439
+ iconName: IconName;
1440
+ /**
1441
+ * If true, a loading spinner will be shown in the button.
1442
+ */
1443
+ loading?: boolean;
1444
+ /**
1445
+ * The test ID for the button, used for testing purposes.
1446
+ */
1447
+ testID?: string;
1448
+ /**
1449
+ * The ideal position of the tooltip.
1450
+ */
1451
+ tooltipIdealPosition?: TooltipPosition;
1452
+ /**
1453
+ * Include an arrow in the tooltip. Pointing to the button.
1454
+ * @default false
1455
+ */
1456
+ tooltipIncludeArrow?: boolean;
1457
+ /**
1458
+ * The text content of the tooltip.
1459
+ */
1460
+ tooltipText?: string;
1461
+ /**
1462
+ * The variant of the button, which determines its style.
1463
+ * @default "primary"
1464
+ */
1465
+ variant?: "primary" | "secondary" | "muted" | "destructive" | "navigation";
1466
+ /**
1467
+ * If true, a confirmation modal will be shown before the onClick action.
1468
+ * @default false
1469
+ */
1470
+ withConfirmation?: boolean;
1471
+ /**
1472
+ * The function to call when the button is clicked.
1473
+ */
1474
+ onClick: () => void | Promise<void>;
1475
+ }
1476
+ export interface InfoTooltipButtonProps {
1477
+ text: string;
1478
+ size?: IconSize;
1479
+ }
1480
+ export interface ModalProps {
1481
+ /**
1482
+ * The content of the modal.
1483
+ */
1484
+ children?: React.ReactElement;
1485
+ /**
1486
+ * If true, the modal will be closed when the background is clicked.
1487
+ * @default false
1488
+ */
1489
+ persistOnBackgroundClick?: boolean;
1490
+ /**
1491
+ * If true, the primary button will be disabled.
1492
+ * @default false
1493
+ */
1494
+ primaryButtonDisabled?: boolean;
1495
+ /**
1496
+ * The text content of the primary button.
1497
+ */
1498
+ primaryButtonText?: string;
1499
+ /**
1500
+ * The text content of the secondary button.
1501
+ */
1502
+ secondaryButtonText?: string;
1503
+ /**
1504
+ * The size of the modal.
1505
+ * @default "sm"
1506
+ */
1507
+ size?: "sm" | "md" | "lg";
1508
+ /**
1509
+ * The subtitle of the modal.
1510
+ */
1511
+ subtitle?: string;
1512
+ /**
1513
+ * The text content of the modal.
1514
+ */
1515
+ text?: string;
1516
+ /**
1517
+ * The title of the modal.
1518
+ */
1519
+ title?: string;
1520
+ /**
1521
+ * If true, the modal will be visible.
1522
+ */
1523
+ visible: boolean;
1524
+ /**
1525
+ */
1526
+ onDismiss: () => void;
1527
+ /**
1528
+ * The function to call when the primary button is clicked.
1529
+ */
1530
+ primaryButtonOnClick?: (value?: any) => void | Promise<void>;
1531
+ /**
1532
+ * The function to call when the secondary button is clicked.
1533
+ */
1534
+ secondaryButtonOnClick?: (value?: any) => void | Promise<void>;
1535
+ }
1536
+ export interface NumberPickerActionSheetProps {
1537
+ value: string;
1538
+ min: number;
1539
+ max: number;
1540
+ onChange: OnChangeCallback;
1541
+ actionSheetRef: React.RefObject<any>;
1542
+ }
1543
+ export interface PageProps {
1544
+ navigation: any;
1545
+ scroll?: boolean;
1546
+ loading?: boolean;
1547
+ display?: "flex" | "none" | "block" | "inlineBlock";
1548
+ title?: string;
1549
+ backButton?: boolean;
1550
+ closeButton?: boolean;
1551
+ direction?: "row" | "column";
1552
+ padding?: UnsignedUpTo12;
1553
+ color?: SurfaceColor;
1554
+ maxWidth?: number | string;
1555
+ keyboardOffset?: number;
1556
+ footer?: any;
1557
+ rightButton?: string;
1558
+ rightButtonOnClick?: () => void;
1559
+ children?: any;
1560
+ onError?: (error: Error, stack: any) => void;
1561
+ }
1562
+ export interface ProgressBarProps {
1563
+ color: SurfaceColor;
1564
+ completed: number;
1565
+ }
1566
+ export interface RadioProps {
1567
+ selected?: boolean;
1568
+ }
1569
+ export interface RadioFieldProps {
1570
+ title: string;
1571
+ variant?: "leftText" | "rightText";
1572
+ value: string;
1573
+ onChange: (value: string) => void;
1574
+ options: FieldOption[];
1575
+ }
1576
+ export interface SignatureFieldProps {
1577
+ disabled?: boolean;
1578
+ value?: string;
1579
+ onChange: (value: any) => void;
1580
+ title?: string;
1581
+ onStart?: () => void;
1582
+ onEnd?: () => void;
1583
+ disabledText?: string;
1584
+ errorText?: string;
1585
+ }
1586
+ export interface SideDrawerProps {
1587
+ position?: "right" | "left";
1588
+ isOpen: boolean;
1589
+ renderContent: () => ReactElement | ReactElement[];
1590
+ onClose?: () => void;
1591
+ onOpen?: () => void;
1592
+ drawerType?: "front" | "back" | "slide" | "permanent";
1593
+ children?: ReactElement;
1594
+ drawerStyles?: StyleProp<ViewStyle>;
1595
+ }
1596
+ export interface SpinnerProps {
1597
+ size?: "sm" | "md";
1598
+ color?: "light" | "dark" | "accent" | "secondary";
1599
+ }
1600
+ export interface ColumnSortInterface {
1601
+ column: number;
1602
+ direction: "asc" | "desc";
1603
+ }
1604
+ export interface TableProps {
1605
+ /**
1606
+ * Must be instances of TableHeader, TableRow, and/or TableFooter components.
1607
+ */
1608
+ children: React.ReactNode | React.ReactNode[];
1609
+ /**
1610
+ * Width of columns in the table. This is used to calculate the width of each column.
1611
+ * Can be numbers for pixels or strings for percentages.
1612
+ */
1613
+ /**
1614
+ * The size of the table title.
1615
+ * Can be one of "sm", "md", "lg", or "xl".
1616
+ */
1617
+ columns: Array<number | string>;
1618
+ /**
1619
+ * Specify a border width for Table: "sm" is 1px.
1620
+ */
1621
+ borderStyle?: "sm" | "none";
1622
+ /**
1623
+ * Use numbers for pixels: `maxHeight={100}` and strings for percentages: `maxHeight="100%"`.
1624
+ */
1625
+ maxHeight?: DimensionValue;
1626
+ /**
1627
+ * If true, the header will stick to the top of the table when scrolling. Defaults to true.
1628
+ */
1629
+ stickyHeader?: boolean;
1630
+ /**
1631
+ * If true, alternate rows will have a light gray background. Defaults to true.
1632
+ */
1633
+ alternateRowBackground?: boolean;
1634
+ /**
1635
+ * Control sort outside of the Table
1636
+ */
1637
+ sort?: ColumnSortInterface;
1638
+ /**
1639
+ * Set the page outside of the Table
1640
+ */
1641
+ page?: number;
1642
+ /**
1643
+ * Set the page outside of the Table
1644
+ */
1645
+ setPage?: (page: number) => void;
1646
+ /**
1647
+ * Set the total number of pages of the Table
1648
+ */
1649
+ totalPages?: number;
1650
+ /**
1651
+ * If true, the table will render a next page button. Defaults to true.
1652
+ */
1653
+ more?: boolean;
1654
+ /**
1655
+ * Extra controls to render below the table next to pagination
1656
+ */
1657
+ extraControls?: React.ReactElement;
1658
+ }
1659
+ export interface PaginationProps {
1660
+ page: number;
1661
+ setPage: (page: number) => void;
1662
+ totalPages: number;
1663
+ }
1664
+ /**
1665
+ * Data Table
1666
+ */
1667
+ export interface DataTableCellData {
1668
+ value: any;
1669
+ highlight?: SurfaceColor;
1670
+ textSize?: "sm" | "md" | "lg";
1671
+ }
1672
+ export type DataTableCustomComponentMap = Record<string, React.ComponentType<{
1673
+ column: DataTableColumn;
1674
+ cellData: DataTableCellData;
1675
+ }>>;
1676
+ export interface DataTableColumn {
1677
+ title: string;
1678
+ columnType: "text" | "number" | "date" | "boolean" | string;
1679
+ width: number;
1680
+ highlight?: SurfaceColor;
1681
+ sortable?: boolean;
1682
+ infoModalText?: string;
1683
+ }
1684
+ export interface DataTableProps {
1685
+ data: {
1686
+ value: any;
1687
+ highlight?: SurfaceColor;
1688
+ textSize?: "sm" | "md" | "lg";
1689
+ }[][];
1690
+ columns: DataTableColumn[];
1691
+ alternateRowBackground?: boolean;
1692
+ totalPages?: number;
1693
+ page?: number;
1694
+ setPage?: (page: number) => void;
1695
+ pinnedColumns?: number;
1696
+ sortColumn?: ColumnSortInterface;
1697
+ setSortColumn?: (sortColumn?: ColumnSortInterface) => void;
1698
+ rowHeight?: number;
1699
+ headerHeight?: number;
1700
+ defaultTextSize?: "sm" | "md" | "lg";
1701
+ /**
1702
+ * When tapping the eye icon, a modal is shown with more info about the row.
1703
+ */
1704
+ moreContentComponent?: React.ComponentType<{
1705
+ column: DataTableColumn;
1706
+ rowData: any[];
1707
+ rowIndex: number;
1708
+ }>;
1709
+ moreContentExtraData?: any[];
1710
+ customColumnComponentMap?: DataTableCustomComponentMap;
1711
+ }
1712
+ export interface DataTableCellProps {
1713
+ value: any;
1714
+ columnDef: DataTableColumn;
1715
+ colIndex: number;
1716
+ isPinnedHorizontal: boolean;
1717
+ isPinnedRow?: boolean;
1718
+ pinnedColumns: number;
1719
+ columnWidths: number[];
1720
+ backgroundColor: string;
1721
+ highlight?: SurfaceColor;
1722
+ customColumnComponentMap?: DataTableCustomComponentMap;
1723
+ height: number;
1724
+ textSize?: "sm" | "md" | "lg";
1725
+ }
1726
+ export interface TableHeaderProps {
1727
+ /**
1728
+ * Must be an instance of TableRow.
1729
+ */
1730
+ children: React.ReactNode | React.ReactNode[];
1731
+ /**
1732
+ * Display `visuallyHidden` ensures the component is visually hidden but still is read by screen
1733
+ * readers.
1734
+ */
1735
+ display?: "tableHeaderGroup" | "visuallyHidden";
1736
+ /**
1737
+ * If true, the table header will be sticky and the table body will be scrollable. Not yet
1738
+ * implemented.
1739
+ */
1740
+ sticky?: boolean;
1741
+ color?: BoxColor;
1742
+ }
1743
+ export interface TableHeaderCellProps extends InfoModalIconProps {
1744
+ /**
1745
+ * The content of the table header cell.
1746
+ */
1747
+ children?: ReactElement;
1748
+ index: number;
1749
+ sortable?: boolean;
1750
+ onSortChange?: (direction: "asc" | "desc" | undefined) => void;
1751
+ /**
1752
+ * The alignment of the text/components in the cell. Most cells should be left aligned,
1753
+ * unless the column is for a badge, icon, or boolean, then center align.
1754
+ * It should be right if the column is right aligned text or numbers.
1755
+ */
1756
+ align?: "left" | "center" | "right";
1757
+ /**
1758
+ * If title is provided, the text will be wrapped in a TableTitle, saving you from having to
1759
+ * wrap the text yourself. Alignments will match between the cell and the title.
1760
+ */
1761
+ title?: string;
1762
+ /**
1763
+ * If provided, a tooltip icon will be shown and a tooltip will be shown when hovering over the
1764
+ * icon.
1765
+ */
1766
+ infoText?: string;
1767
+ }
1768
+ export interface TableRowProps {
1769
+ /**
1770
+ * Must be instances of TableCell or TableHeaderCell.
1771
+ */
1772
+ children: React.ReactNode | React.ReactNode[];
1773
+ /**
1774
+ * Header rows have an extra thick bottom border.
1775
+ */
1776
+ headerRow?: boolean;
1777
+ /**
1778
+ * Whether the row should start expanded or not.
1779
+ */
1780
+ expanded?: boolean;
1781
+ /**
1782
+ * When the row is expanded, the drawerContents are shown. If not
1783
+ */
1784
+ drawerContents?: React.ReactNode | React.ReactNode[];
1785
+ /**
1786
+ * Background color of the row. Defaults to white.
1787
+ */
1788
+ color?: BoxColor;
1789
+ }
1790
+ export type TableFilters = Record<string, string[]>;
1791
+ export interface TableSearch {
1792
+ search: string;
1793
+ field: string;
1794
+ }
1795
+ export interface TableContextType {
1796
+ columns: Array<number | string>;
1797
+ hasDrawerContents: boolean;
1798
+ sortColumn?: ColumnSortInterface | undefined;
1799
+ setSortColumn?: (sort: ColumnSortInterface | undefined) => void;
1800
+ stickyHeader?: boolean;
1801
+ borderStyle?: "sm" | "none";
1802
+ alternateRowBackground?: boolean;
1803
+ page?: number;
1804
+ }
1805
+ export interface TableContextProviderProps extends TableContextType {
1806
+ children: React.ReactNode;
1807
+ }
1808
+ export interface TextProps {
1809
+ align?: "left" | "right" | "center" | "justify";
1810
+ children?: React.ReactNode;
1811
+ bold?: boolean;
1812
+ color?: TextColor;
1813
+ italic?: boolean;
1814
+ size?: TextSize;
1815
+ truncate?: boolean;
1816
+ underline?: boolean;
1817
+ numberOfLines?: number;
1818
+ skipLinking?: boolean;
1819
+ testID?: string;
1820
+ }
1821
+ export interface TextFieldPickerActionSheetProps {
1822
+ value?: string;
1823
+ mode?: "date" | "time";
1824
+ onChange: OnChangeCallback;
1825
+ actionSheetRef: React.RefObject<any>;
1826
+ }
1827
+ export interface ToastProps {
1828
+ title: string;
1829
+ variant?: "error" | "info" | "success" | "warning";
1830
+ secondary?: boolean;
1831
+ size?: "sm" | "lg";
1832
+ onDismiss?: () => void;
1833
+ persistent?: boolean;
1834
+ subtitle?: string;
1835
+ }
1836
+ export interface TooltipProps {
1837
+ /**
1838
+ * The content of the tooltip.
1839
+ */
1840
+ children: React.ReactElement;
1841
+ /**
1842
+ * If true, an arrow will be included in the tooltip.
1843
+ * @default false
1844
+ */
1845
+ includeArrow?: boolean;
1846
+ /**
1847
+ * The ideal position of the tooltip.
1848
+ * @default "top"
1849
+ */
1850
+ idealPosition?: "top" | "bottom" | "left" | "right";
1851
+ /**
1852
+ * The text content of the tooltip. If text is undefined,
1853
+ * the children will be rendered without a tooltip.
1854
+ */
1855
+ text?: string;
1856
+ }
1857
+ export type LinkProps = TextProps & {
1858
+ text: string;
1859
+ } & ({
1860
+ href: string;
1861
+ onClick?: never;
1862
+ } | {
1863
+ href?: never;
1864
+ onClick: () => void | Promise<void>;
1865
+ });
1866
+ export type TapToEditProps = (BaseTapToEditProps & Omit<TextFieldProps, "onChange" | "value"> & {
1867
+ type: "password" | "text" | "url";
1868
+ }) | (BaseTapToEditProps & Omit<NumberFieldProps, "onChange" | "value"> & {
1869
+ type: "number" | "decimal";
1870
+ }) | (BaseTapToEditProps & Omit<NumberRangeFieldProps, "onChange" | "value"> & {
1871
+ type: "numberRange" | "decimalRange";
1872
+ }) | (BaseTapToEditProps & Omit<DateTimeFieldProps, "onChange" | "value"> & {
1873
+ type: "date" | "datetime" | "time";
1874
+ }) | (BaseTapToEditProps & Omit<MultiselectFieldProps, "onChange" | "value"> & {
1875
+ type: "multiselect";
1876
+ }) | (BaseTapToEditProps & Omit<TextAreaProps, "onChange" | "value"> & {
1877
+ type: "textarea";
1878
+ }) | (BaseTapToEditProps & Omit<SelectFieldProps, "onChange" | "value"> & {
1879
+ type: "select";
1880
+ }) | (BaseTapToEditProps & Omit<CustomSelectFieldProps, "onChange" | "value"> & {
1881
+ type: "customSelect";
1882
+ }) | (BaseTapToEditProps & Omit<EmailFieldProps, "onChange" | "value"> & {
1883
+ type: "email";
1884
+ }) | (BaseTapToEditProps & Omit<PhoneNumberFieldProps, "onChange" | "value"> & {
1885
+ type: "phoneNumber";
1886
+ }) | (BaseTapToEditProps & Omit<BooleanFieldProps, "onChange" | "value"> & {
1887
+ type: "boolean";
1888
+ }) | (BaseTapToEditProps & Omit<RadioFieldProps, "onChange" | "value"> & {
1889
+ type: "radio";
1890
+ }) | (BaseTapToEditProps & Omit<SignatureFieldProps, "onChange" | "value"> & {
1891
+ type: "signature";
1892
+ }) | (BaseTapToEditProps & Omit<SearchFieldProps, "onChange" | "value"> & {
1893
+ type: "search";
1894
+ }) | (BaseTapToEditProps & Omit<AddressFieldProps, "onChange" | "value"> & {
1895
+ type: "address";
1896
+ });
1897
+ export interface BaseTapToEditProps extends Omit<FieldProps, "onChange" | "value"> {
1898
+ title: string;
1899
+ value: any;
1900
+ /**
1901
+ * Not required if not editable.
1902
+ */
1903
+ setValue?: (value: any) => void;
1904
+ /**
1905
+ * Not required if not editable.
1906
+ */
1907
+ onSave?: (value: any) => void | Promise<void>;
1908
+ /**
1909
+ * If false, the field will not be editable and will be disabled
1910
+ * @default true
1911
+ */
1912
+ editable?: boolean;
1913
+ /**
1914
+ * Enable edit mode from outside the component.
1915
+ */
1916
+ isEditing?: boolean;
1917
+ transform?: (value: any) => string;
1918
+ /**
1919
+ * Show a confirmation modal before saving the value.
1920
+ * @default false
1921
+ */
1922
+ withConfirmation?: boolean;
1923
+ /**
1924
+ * The text content of the confirmation modal.
1925
+ * @default "Are you sure you want save your changes?"
1926
+ */
1927
+ confirmationText?: string;
1928
+ /**
1929
+ * The title of the confirmation modal.
1930
+ * @default "Confirm"
1931
+ */
1932
+ confirmationTitle?: string;
1933
+ /**
1934
+ * Field helperText, a description of the field surfaced in the UI
1935
+ * @default "Confirm"
1936
+ */
1937
+ helperText?: string;
1938
+ /**
1939
+ * Only display the helperText in the UI while editing. if false, the helperText is always shown below the value.
1940
+ * @default true
1941
+ */
1942
+ onlyShowHelperTextWhileEditing?: boolean;
1943
+ /**
1944
+ * Show a clear button in the button row alongside Cancel/Save for clearing the field value.
1945
+ * @default false
1946
+ */
1947
+ showClearButton?: boolean;
1948
+ }
1949
+ export interface APIError {
1950
+ status: number;
1951
+ data: {
1952
+ title: string;
1953
+ detail?: string;
1954
+ id?: string;
1955
+ links?: string;
1956
+ about?: string;
1957
+ status?: number;
1958
+ code?: string;
1959
+ source?: string;
1960
+ pointer?: string;
1961
+ parameter?: string;
1962
+ meta?: {
1963
+ [id: string]: any;
1964
+ };
1965
+ };
1966
+ }
1967
+ export type OpenApiPropertyType = "string" | "date" | "datetime" | "boolean" | "array" | "object" | "number" | "any";
1968
+ export interface OpenApiProperty {
1969
+ type?: OpenApiPropertyType;
1970
+ format?: string;
1971
+ properties?: OpenApiProperty;
1972
+ items?: OpenApiProperty[];
1973
+ description?: string;
1974
+ required?: string[];
1975
+ enum?: string[];
1976
+ }
1977
+ export interface ModelFields {
1978
+ type: "object" | "array";
1979
+ required: string[];
1980
+ properties: {
1981
+ [name: string]: OpenApiProperty;
1982
+ };
1983
+ }
1984
+ export interface OpenAPISpec {
1985
+ paths: {
1986
+ [key: string]: any;
1987
+ };
1988
+ }
1989
+ export type ModelFieldConfig = any;
1990
+ export interface OpenAPIProviderProps {
1991
+ children: React.ReactElement;
1992
+ specUrl?: string;
1993
+ }
1994
+ export interface OpenAPIContextType {
1995
+ spec: OpenAPISpec | null;
1996
+ getModelFields: (modelName: string) => ModelFields | null;
1997
+ getModelField: (modelName: string, field: string) => OpenApiProperty | null;
1998
+ }
1999
+ export interface ModelAdminFieldConfig {
2000
+ fieldKey: string;
2001
+ title: string;
2002
+ description?: string;
2003
+ type: OpenApiPropertyType;
2004
+ width?: number;
2005
+ minWidth?: number;
2006
+ options?: string[];
2007
+ sort?: string;
2008
+ CustomComponent?: (props: ModelAdminCustomComponentProps) => React.ReactElement | null;
2009
+ }
2010
+ export interface ModelAdminCustomComponentProps extends Omit<FieldProps, "name"> {
2011
+ doc: any;
2012
+ fieldKey: string;
2013
+ editing: boolean;
2014
+ }
2015
+ export interface MultiselectFieldProps extends HelperTextProps, ErrorTextProps {
2016
+ /**
2017
+ * The available options for the multiselect field.
2018
+ */
2019
+ options: FieldOption[];
2020
+ /**
2021
+ * The title of the multiselect field.
2022
+ */
2023
+ title: string;
2024
+ /**
2025
+ * The selected values of the multiselect field.
2026
+ */
2027
+ value: string[];
2028
+ /**
2029
+ * The variant of the multiselect field, which determines the position of the text.
2030
+ * @default "rightText"
2031
+ */
2032
+ variant?: "rightText" | "leftText";
2033
+ /**
2034
+ * The function to call when the selected values change.
2035
+ */
2036
+ onChange: (selected: string[]) => void;
2037
+ /**
2038
+ * The disabled state of multiselect. Removes checkboxes and only shows the values.
2039
+ */
2040
+ disabled?: boolean;
2041
+ }
2042
+ export interface TableTitleProps {
2043
+ /**
2044
+ * The text content of the table title.
2045
+ */
2046
+ title: string;
2047
+ /**
2048
+ * Most titles should be left aligned, but some may be centered, such as badges or booleans.
2049
+ * It should match the alignment of the column.
2050
+ * @default "left"
2051
+ */
2052
+ align?: "left" | "center" | "right";
2053
+ }
2054
+ export interface TableBooleanProps {
2055
+ /**
2056
+ * If true, the component is in editing mode.
2057
+ * @default false
2058
+ */
2059
+ isEditing?: boolean;
2060
+ /**
2061
+ * The function to call when the value is saved.
2062
+ */
2063
+ onSave?: () => void | Promise<void>;
2064
+ /**
2065
+ * The boolean value to be displayed or edited.
2066
+ */
2067
+ value: boolean;
2068
+ }
2069
+ export interface TableDateProps {
2070
+ /**
2071
+ * If true, the date is annotated.
2072
+ * @default false
2073
+ */
2074
+ annotated?: boolean;
2075
+ /**
2076
+ * If true, the component is in editing mode.
2077
+ * @default false
2078
+ */
2079
+ isEditing?: boolean;
2080
+ /**
2081
+ * The function to call when the value is saved.
2082
+ */
2083
+ onSave?: () => void;
2084
+ /**
2085
+ * The date value to be displayed or edited. Can be a string or a Date object.
2086
+ */
2087
+ value: string | Date;
2088
+ }
2089
+ export interface TableIconButtonProps {
2090
+ /**
2091
+ * The name of the icon button to display in the table.
2092
+ * Can be one of "edit", "saveAndClose", "insert", "drawerOpen", or "drawerClose".
2093
+ */
2094
+ tableIconButtonName: "edit" | "saveAndClose" | "insert" | "drawerOpen" | "drawerClose";
2095
+ /**
2096
+ * The function to call when the icon button is clicked.
2097
+ */
2098
+ onClick: () => void | Promise<void>;
2099
+ }
2100
+ export interface FieldOption {
2101
+ /**
2102
+ * The label to display for the option.
2103
+ */
2104
+ label: string;
2105
+ /**
2106
+ * The key of the option. Useful for uniquely identifying the option.
2107
+ */
2108
+ key?: string;
2109
+ /**
2110
+ * The value of the option.
2111
+ */
2112
+ value: string;
2113
+ }
2114
+ export interface SelectFieldPropsBase {
2115
+ /**
2116
+ * If true, the select field will be disabled.
2117
+ * @default false
2118
+ */
2119
+ disabled?: boolean;
2120
+ /**
2121
+ * The error text to display if there is an error.
2122
+ */
2123
+ errorText?: string;
2124
+ /**
2125
+ * The helper text to display below the select field.
2126
+ */
2127
+ helperText?: string;
2128
+ /**
2129
+ * The function to call when the selected value changes.
2130
+ * If requireValue is false and value is undefined, onChange will return empty string.
2131
+ */
2132
+ onChange: (value: string) => void;
2133
+ /**
2134
+ * The options available for selection in the select field.
2135
+ * Each option should have a label and a value.
2136
+ */
2137
+ options: FieldOption[];
2138
+ /**
2139
+ * The placeholder text to display when no option is selected.
2140
+ */
2141
+ placeholder?: string;
2142
+ /**
2143
+ * The title of the select field.
2144
+ */
2145
+ title?: string;
2146
+ }
2147
+ export interface SelectFieldPropsWithoutRequire extends SelectFieldPropsBase {
2148
+ /**
2149
+ * Whether the select field should have an empty "---" button to return undefined.
2150
+ * @default false
2151
+ */
2152
+ requireValue?: false;
2153
+ /**
2154
+ * The current value of the select field (optional when requireValue is false).
2155
+ */
2156
+ value?: string;
2157
+ }
2158
+ export interface SelectFieldPropsWithRequire extends SelectFieldPropsBase {
2159
+ /**
2160
+ * When requireValue is true, the value is required and onChange will return a string.
2161
+ */
2162
+ requireValue: true;
2163
+ /**
2164
+ * The current value of the select field (required when requireValue is true).
2165
+ */
2166
+ value: string;
2167
+ /**
2168
+ * The function to call when the required select field value changes.
2169
+ */
2170
+ onChange: (value: string) => void;
2171
+ }
2172
+ export type SelectFieldProps = SelectFieldPropsWithoutRequire | SelectFieldPropsWithRequire;
2173
+ export interface TableBadgeProps {
2174
+ /**
2175
+ * The icon name of the badge.
2176
+ */
2177
+ badgeIconName?: BadgeProps["iconName"];
2178
+ /**
2179
+ * The status of the badge.
2180
+ * @default "info"
2181
+ */
2182
+ badgeStatus?: BadgeProps["status"];
2183
+ /**
2184
+ * If true, the component is in editing mode.
2185
+ * @default false
2186
+ */
2187
+ isEditing?: boolean;
2188
+ /**
2189
+ * The options available for editing the badge.
2190
+ */
2191
+ editingOptions?: FieldOption[];
2192
+ /**
2193
+ * The function to call when the badge status is saved.
2194
+ */
2195
+ onSave?: (newStatus: string | undefined) => void | Promise<void>;
2196
+ /**
2197
+ * The value of the badge.
2198
+ */
2199
+ value: string;
2200
+ }
2201
+ export interface TableTextProps {
2202
+ /**
2203
+ * Whether the text field is in editing mode.
2204
+ */
2205
+ isEditing?: boolean;
2206
+ /**
2207
+ * The text to display in the text field.
2208
+ */
2209
+ value: string;
2210
+ /**
2211
+ * Callback to save the text field value.
2212
+ */
2213
+ onSave?: () => void | Promise<void>;
2214
+ /**
2215
+ * The alignment of the text field. Most text fields should be left aligned.
2216
+ * @default "left"
2217
+ */
2218
+ align?: "left" | "center" | "right";
2219
+ }
2220
+ export interface TableNumberProps {
2221
+ /**
2222
+ * Whether the text field is in editing mode.
2223
+ */
2224
+ isEditing?: boolean;
2225
+ /**
2226
+ * The number to display in the text field.
2227
+ */
2228
+ value: string;
2229
+ /**
2230
+ * Callback to save the text field value.
2231
+ */
2232
+ onSave?: () => void | Promise<void>;
2233
+ /**
2234
+ * Numbers generally should be right aligned for ease of scanability.
2235
+ * @default "right"
2236
+ */
2237
+ align?: "left" | "right";
2238
+ }
2239
+ export interface SliderProps extends HelperTextProps, ErrorTextProps {
2240
+ /**
2241
+ * The title of the slider field.
2242
+ */
2243
+ title?: string;
2244
+ /**
2245
+ * The current value of the slider.
2246
+ */
2247
+ value: number;
2248
+ /**
2249
+ * The function to call when the slider value changes.
2250
+ */
2251
+ onChange: (value: number) => void;
2252
+ /**
2253
+ * The minimum value of the slider.
2254
+ * @default 0
2255
+ */
2256
+ minimumValue?: number;
2257
+ /**
2258
+ * The maximum value of the slider.
2259
+ * @default 1
2260
+ */
2261
+ maximumValue?: number;
2262
+ /**
2263
+ * The step value of the slider.
2264
+ * @default 0
2265
+ */
2266
+ step?: number;
2267
+ /**
2268
+ * If true, the slider will be disabled.
2269
+ * @default false
2270
+ */
2271
+ disabled?: boolean;
2272
+ /**
2273
+ * The color of the track to the left of the thumb.
2274
+ */
2275
+ minimumTrackTintColor?: string;
2276
+ /**
2277
+ * The color of the track to the right of the thumb.
2278
+ */
2279
+ maximumTrackTintColor?: string;
2280
+ /**
2281
+ * The color of the thumb.
2282
+ */
2283
+ thumbTintColor?: string;
2284
+ /**
2285
+ * If true, the slider will show the current value as text.
2286
+ * @default false
2287
+ */
2288
+ showSelection?: boolean;
2289
+ /**
2290
+ * Labels to show below the slider track.
2291
+ */
2292
+ labels?: {
2293
+ /**
2294
+ * The minimum value label.
2295
+ */
2296
+ min?: string;
2297
+ /**
2298
+ * The maximum value label.
2299
+ */
2300
+ max?: string;
2301
+ /**
2302
+ * Additional labels with their positions (0-1 range).
2303
+ */
2304
+ custom?: Array<{
2305
+ index: number;
2306
+ label: string;
2307
+ }>;
2308
+ };
2309
+ /**
2310
+ * If true, displays min and max labels inline on both ends of the track.
2311
+ * @default false
2312
+ */
2313
+ inlineLabels?: boolean;
2314
+ /**
2315
+ * If true, icons will be displayed instead of numeric values when valueMapping is provided.
2316
+ * @default false
2317
+ */
2318
+ useIcons?: boolean;
2319
+ /**
2320
+ * Graphics/icons to display instead of numeric values.
2321
+ * Maps slider values to icon names or any string.
2322
+ */
2323
+ valueMapping?: ValueMappingItem[];
2324
+ }
2325
+ export {};