rn-custom-ui 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (332) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +477 -0
  3. package/lib/module/assets/images/close.png +0 -0
  4. package/lib/module/components/CustomCheckbox/index.js +99 -0
  5. package/lib/module/components/CustomCheckbox/index.js.map +1 -0
  6. package/lib/module/components/CustomCheckbox/styles.js +213 -0
  7. package/lib/module/components/CustomCheckbox/styles.js.map +1 -0
  8. package/lib/module/components/CustomCheckbox/types.js +4 -0
  9. package/lib/module/components/CustomCheckbox/types.js.map +1 -0
  10. package/lib/module/components/closeButton/index.js +45 -0
  11. package/lib/module/components/closeButton/index.js.map +1 -0
  12. package/lib/module/components/closeButton/types.js +4 -0
  13. package/lib/module/components/closeButton/types.js.map +1 -0
  14. package/lib/module/components/customButton/index.js +176 -0
  15. package/lib/module/components/customButton/index.js.map +1 -0
  16. package/lib/module/components/customButton/styles.js +282 -0
  17. package/lib/module/components/customButton/styles.js.map +1 -0
  18. package/lib/module/components/customButton/types.js +4 -0
  19. package/lib/module/components/customButton/types.js.map +1 -0
  20. package/lib/module/components/customDropDown/DropDownBottomSheet.js +57 -0
  21. package/lib/module/components/customDropDown/DropDownBottomSheet.js.map +1 -0
  22. package/lib/module/components/customDropDown/DropDownList.js +51 -0
  23. package/lib/module/components/customDropDown/DropDownList.js.map +1 -0
  24. package/lib/module/components/customDropDown/DropDownListItem.js +38 -0
  25. package/lib/module/components/customDropDown/DropDownListItem.js.map +1 -0
  26. package/lib/module/components/customDropDown/DropDownListModal.js +63 -0
  27. package/lib/module/components/customDropDown/DropDownListModal.js.map +1 -0
  28. package/lib/module/components/customDropDown/index.js +143 -0
  29. package/lib/module/components/customDropDown/index.js.map +1 -0
  30. package/lib/module/components/customDropDown/styles.js +189 -0
  31. package/lib/module/components/customDropDown/styles.js.map +1 -0
  32. package/lib/module/components/customDropDown/types.js +4 -0
  33. package/lib/module/components/customDropDown/types.js.map +1 -0
  34. package/lib/module/components/customDropDown/utils.js +17 -0
  35. package/lib/module/components/customDropDown/utils.js.map +1 -0
  36. package/lib/module/components/customList/ListEmpty.js +33 -0
  37. package/lib/module/components/customList/ListEmpty.js.map +1 -0
  38. package/lib/module/components/customList/ListFooterLoader.js +14 -0
  39. package/lib/module/components/customList/ListFooterLoader.js.map +1 -0
  40. package/lib/module/components/customList/defaultKeyExtractor.js +9 -0
  41. package/lib/module/components/customList/defaultKeyExtractor.js.map +1 -0
  42. package/lib/module/components/customList/getFlashList.js +19 -0
  43. package/lib/module/components/customList/getFlashList.js.map +1 -0
  44. package/lib/module/components/customList/index.js +117 -0
  45. package/lib/module/components/customList/index.js.map +1 -0
  46. package/lib/module/components/customList/styles.js +45 -0
  47. package/lib/module/components/customList/styles.js.map +1 -0
  48. package/lib/module/components/customList/types.js +4 -0
  49. package/lib/module/components/customList/types.js.map +1 -0
  50. package/lib/module/components/customModal/ModalFooter.js +44 -0
  51. package/lib/module/components/customModal/ModalFooter.js.map +1 -0
  52. package/lib/module/components/customModal/index.js +132 -0
  53. package/lib/module/components/customModal/index.js.map +1 -0
  54. package/lib/module/components/customModal/styles.js +123 -0
  55. package/lib/module/components/customModal/styles.js.map +1 -0
  56. package/lib/module/components/customModal/types.js +4 -0
  57. package/lib/module/components/customModal/types.js.map +1 -0
  58. package/lib/module/components/customModal/useCustomModal.js +23 -0
  59. package/lib/module/components/customModal/useCustomModal.js.map +1 -0
  60. package/lib/module/components/customNumberPad/NumberPadKey.js +39 -0
  61. package/lib/module/components/customNumberPad/NumberPadKey.js.map +1 -0
  62. package/lib/module/components/customNumberPad/index.js +156 -0
  63. package/lib/module/components/customNumberPad/index.js.map +1 -0
  64. package/lib/module/components/customNumberPad/styles.js +131 -0
  65. package/lib/module/components/customNumberPad/styles.js.map +1 -0
  66. package/lib/module/components/customNumberPad/types.js +4 -0
  67. package/lib/module/components/customNumberPad/types.js.map +1 -0
  68. package/lib/module/components/customNumberPad/useNumberPadInput.js +44 -0
  69. package/lib/module/components/customNumberPad/useNumberPadInput.js.map +1 -0
  70. package/lib/module/components/customNumberPad/utils.js +38 -0
  71. package/lib/module/components/customNumberPad/utils.js.map +1 -0
  72. package/lib/module/components/customSlideTabs/AnimatedTabIndicator.js +66 -0
  73. package/lib/module/components/customSlideTabs/AnimatedTabIndicator.js.map +1 -0
  74. package/lib/module/components/customSlideTabs/TabBarItem.js +61 -0
  75. package/lib/module/components/customSlideTabs/TabBarItem.js.map +1 -0
  76. package/lib/module/components/customSlideTabs/TabScene.js +88 -0
  77. package/lib/module/components/customSlideTabs/TabScene.js.map +1 -0
  78. package/lib/module/components/customSlideTabs/index.js +277 -0
  79. package/lib/module/components/customSlideTabs/index.js.map +1 -0
  80. package/lib/module/components/customSlideTabs/styles.js +132 -0
  81. package/lib/module/components/customSlideTabs/styles.js.map +1 -0
  82. package/lib/module/components/customSlideTabs/tabBarScroll.js +65 -0
  83. package/lib/module/components/customSlideTabs/tabBarScroll.js.map +1 -0
  84. package/lib/module/components/customSlideTabs/types.js +4 -0
  85. package/lib/module/components/customSlideTabs/types.js.map +1 -0
  86. package/lib/module/components/loading/index.js +34 -0
  87. package/lib/module/components/loading/index.js.map +1 -0
  88. package/lib/module/customFunctions/array.js +61 -0
  89. package/lib/module/customFunctions/array.js.map +1 -0
  90. package/lib/module/customFunctions/async.js +62 -0
  91. package/lib/module/customFunctions/async.js.map +1 -0
  92. package/lib/module/customFunctions/date.js +109 -0
  93. package/lib/module/customFunctions/date.js.map +1 -0
  94. package/lib/module/customFunctions/general.js +29 -0
  95. package/lib/module/customFunctions/general.js.map +1 -0
  96. package/lib/module/customFunctions/id.js +20 -0
  97. package/lib/module/customFunctions/id.js.map +1 -0
  98. package/lib/module/customFunctions/index.js +29 -0
  99. package/lib/module/customFunctions/index.js.map +1 -0
  100. package/lib/module/customFunctions/number.js +94 -0
  101. package/lib/module/customFunctions/number.js.map +1 -0
  102. package/lib/module/customFunctions/object.js +39 -0
  103. package/lib/module/customFunctions/object.js.map +1 -0
  104. package/lib/module/customFunctions/string.js +63 -0
  105. package/lib/module/customFunctions/string.js.map +1 -0
  106. package/lib/module/customFunctions/types.js +2 -0
  107. package/lib/module/customFunctions/types.js.map +1 -0
  108. package/lib/module/customFunctions/validation.js +34 -0
  109. package/lib/module/customFunctions/validation.js.map +1 -0
  110. package/lib/module/customHooks/errors.js +61 -0
  111. package/lib/module/customHooks/errors.js.map +1 -0
  112. package/lib/module/customHooks/fetchJson.js +36 -0
  113. package/lib/module/customHooks/fetchJson.js.map +1 -0
  114. package/lib/module/customHooks/index.js +10 -0
  115. package/lib/module/customHooks/index.js.map +1 -0
  116. package/lib/module/customHooks/internal.js +49 -0
  117. package/lib/module/customHooks/internal.js.map +1 -0
  118. package/lib/module/customHooks/types.js +2 -0
  119. package/lib/module/customHooks/types.js.map +1 -0
  120. package/lib/module/customHooks/useApi.js +91 -0
  121. package/lib/module/customHooks/useApi.js.map +1 -0
  122. package/lib/module/customHooks/useLazyApi.js +80 -0
  123. package/lib/module/customHooks/useLazyApi.js.map +1 -0
  124. package/lib/module/customHooks/useMutation.js +69 -0
  125. package/lib/module/customHooks/useMutation.js.map +1 -0
  126. package/lib/module/customHooks/usePaginatedApi.js +127 -0
  127. package/lib/module/customHooks/usePaginatedApi.js.map +1 -0
  128. package/lib/module/customHooks/usePollingApi.js +37 -0
  129. package/lib/module/customHooks/usePollingApi.js.map +1 -0
  130. package/lib/module/index.js +13 -0
  131. package/lib/module/index.js.map +1 -0
  132. package/lib/module/multiply.js +6 -0
  133. package/lib/module/multiply.js.map +1 -0
  134. package/lib/module/package.json +1 -0
  135. package/lib/typescript/package.json +1 -0
  136. package/lib/typescript/src/components/CustomCheckbox/index.d.ts +5 -0
  137. package/lib/typescript/src/components/CustomCheckbox/index.d.ts.map +1 -0
  138. package/lib/typescript/src/components/CustomCheckbox/styles.d.ts +67 -0
  139. package/lib/typescript/src/components/CustomCheckbox/styles.d.ts.map +1 -0
  140. package/lib/typescript/src/components/CustomCheckbox/types.d.ts +28 -0
  141. package/lib/typescript/src/components/CustomCheckbox/types.d.ts.map +1 -0
  142. package/lib/typescript/src/components/closeButton/index.d.ts +4 -0
  143. package/lib/typescript/src/components/closeButton/index.d.ts.map +1 -0
  144. package/lib/typescript/src/components/closeButton/types.d.ts +8 -0
  145. package/lib/typescript/src/components/closeButton/types.d.ts.map +1 -0
  146. package/lib/typescript/src/components/customButton/index.d.ts +5 -0
  147. package/lib/typescript/src/components/customButton/index.d.ts.map +1 -0
  148. package/lib/typescript/src/components/customButton/styles.d.ts +231 -0
  149. package/lib/typescript/src/components/customButton/styles.d.ts.map +1 -0
  150. package/lib/typescript/src/components/customButton/types.d.ts +46 -0
  151. package/lib/typescript/src/components/customButton/types.d.ts.map +1 -0
  152. package/lib/typescript/src/components/customDropDown/DropDownBottomSheet.d.ts +18 -0
  153. package/lib/typescript/src/components/customDropDown/DropDownBottomSheet.d.ts.map +1 -0
  154. package/lib/typescript/src/components/customDropDown/DropDownList.d.ts +17 -0
  155. package/lib/typescript/src/components/customDropDown/DropDownList.d.ts.map +1 -0
  156. package/lib/typescript/src/components/customDropDown/DropDownListItem.d.ts +15 -0
  157. package/lib/typescript/src/components/customDropDown/DropDownListItem.d.ts.map +1 -0
  158. package/lib/typescript/src/components/customDropDown/DropDownListModal.d.ts +19 -0
  159. package/lib/typescript/src/components/customDropDown/DropDownListModal.d.ts.map +1 -0
  160. package/lib/typescript/src/components/customDropDown/index.d.ts +5 -0
  161. package/lib/typescript/src/components/customDropDown/index.d.ts.map +1 -0
  162. package/lib/typescript/src/components/customDropDown/styles.d.ts +190 -0
  163. package/lib/typescript/src/components/customDropDown/styles.d.ts.map +1 -0
  164. package/lib/typescript/src/components/customDropDown/types.d.ts +37 -0
  165. package/lib/typescript/src/components/customDropDown/types.d.ts.map +1 -0
  166. package/lib/typescript/src/components/customDropDown/utils.d.ts +4 -0
  167. package/lib/typescript/src/components/customDropDown/utils.d.ts.map +1 -0
  168. package/lib/typescript/src/components/customList/ListEmpty.d.ts +10 -0
  169. package/lib/typescript/src/components/customList/ListEmpty.d.ts.map +1 -0
  170. package/lib/typescript/src/components/customList/ListFooterLoader.d.ts +3 -0
  171. package/lib/typescript/src/components/customList/ListFooterLoader.d.ts.map +1 -0
  172. package/lib/typescript/src/components/customList/defaultKeyExtractor.d.ts +2 -0
  173. package/lib/typescript/src/components/customList/defaultKeyExtractor.d.ts.map +1 -0
  174. package/lib/typescript/src/components/customList/getFlashList.d.ts +6 -0
  175. package/lib/typescript/src/components/customList/getFlashList.d.ts.map +1 -0
  176. package/lib/typescript/src/components/customList/index.d.ts +11 -0
  177. package/lib/typescript/src/components/customList/index.d.ts.map +1 -0
  178. package/lib/typescript/src/components/customList/styles.d.ts +42 -0
  179. package/lib/typescript/src/components/customList/styles.d.ts.map +1 -0
  180. package/lib/typescript/src/components/customList/types.d.ts +33 -0
  181. package/lib/typescript/src/components/customList/types.d.ts.map +1 -0
  182. package/lib/typescript/src/components/customModal/ModalFooter.d.ts +12 -0
  183. package/lib/typescript/src/components/customModal/ModalFooter.d.ts.map +1 -0
  184. package/lib/typescript/src/components/customModal/index.d.ts +6 -0
  185. package/lib/typescript/src/components/customModal/index.d.ts.map +1 -0
  186. package/lib/typescript/src/components/customModal/styles.d.ts +83 -0
  187. package/lib/typescript/src/components/customModal/styles.d.ts.map +1 -0
  188. package/lib/typescript/src/components/customModal/types.d.ts +36 -0
  189. package/lib/typescript/src/components/customModal/types.d.ts.map +1 -0
  190. package/lib/typescript/src/components/customModal/useCustomModal.d.ts +8 -0
  191. package/lib/typescript/src/components/customModal/useCustomModal.d.ts.map +1 -0
  192. package/lib/typescript/src/components/customNumberPad/NumberPadKey.d.ts +23 -0
  193. package/lib/typescript/src/components/customNumberPad/NumberPadKey.d.ts.map +1 -0
  194. package/lib/typescript/src/components/customNumberPad/index.d.ts +7 -0
  195. package/lib/typescript/src/components/customNumberPad/index.d.ts.map +1 -0
  196. package/lib/typescript/src/components/customNumberPad/styles.d.ts +37 -0
  197. package/lib/typescript/src/components/customNumberPad/styles.d.ts.map +1 -0
  198. package/lib/typescript/src/components/customNumberPad/types.d.ts +47 -0
  199. package/lib/typescript/src/components/customNumberPad/types.d.ts.map +1 -0
  200. package/lib/typescript/src/components/customNumberPad/useNumberPadInput.d.ts +16 -0
  201. package/lib/typescript/src/components/customNumberPad/useNumberPadInput.d.ts.map +1 -0
  202. package/lib/typescript/src/components/customNumberPad/utils.d.ts +4 -0
  203. package/lib/typescript/src/components/customNumberPad/utils.d.ts.map +1 -0
  204. package/lib/typescript/src/components/customSlideTabs/AnimatedTabIndicator.d.ts +16 -0
  205. package/lib/typescript/src/components/customSlideTabs/AnimatedTabIndicator.d.ts.map +1 -0
  206. package/lib/typescript/src/components/customSlideTabs/TabBarItem.d.ts +23 -0
  207. package/lib/typescript/src/components/customSlideTabs/TabBarItem.d.ts.map +1 -0
  208. package/lib/typescript/src/components/customSlideTabs/TabScene.d.ts +21 -0
  209. package/lib/typescript/src/components/customSlideTabs/TabScene.d.ts.map +1 -0
  210. package/lib/typescript/src/components/customSlideTabs/index.d.ts +5 -0
  211. package/lib/typescript/src/components/customSlideTabs/index.d.ts.map +1 -0
  212. package/lib/typescript/src/components/customSlideTabs/styles.d.ts +130 -0
  213. package/lib/typescript/src/components/customSlideTabs/styles.d.ts.map +1 -0
  214. package/lib/typescript/src/components/customSlideTabs/tabBarScroll.d.ts +15 -0
  215. package/lib/typescript/src/components/customSlideTabs/tabBarScroll.d.ts.map +1 -0
  216. package/lib/typescript/src/components/customSlideTabs/types.d.ts +68 -0
  217. package/lib/typescript/src/components/customSlideTabs/types.d.ts.map +1 -0
  218. package/lib/typescript/src/components/loading/index.d.ts +7 -0
  219. package/lib/typescript/src/components/loading/index.d.ts.map +1 -0
  220. package/lib/typescript/src/customFunctions/array.d.ts +7 -0
  221. package/lib/typescript/src/customFunctions/array.d.ts.map +1 -0
  222. package/lib/typescript/src/customFunctions/async.d.ts +9 -0
  223. package/lib/typescript/src/customFunctions/async.d.ts.map +1 -0
  224. package/lib/typescript/src/customFunctions/date.d.ts +18 -0
  225. package/lib/typescript/src/customFunctions/date.d.ts.map +1 -0
  226. package/lib/typescript/src/customFunctions/general.d.ts +7 -0
  227. package/lib/typescript/src/customFunctions/general.d.ts.map +1 -0
  228. package/lib/typescript/src/customFunctions/id.d.ts +4 -0
  229. package/lib/typescript/src/customFunctions/id.d.ts.map +1 -0
  230. package/lib/typescript/src/customFunctions/index.d.ts +26 -0
  231. package/lib/typescript/src/customFunctions/index.d.ts.map +1 -0
  232. package/lib/typescript/src/customFunctions/number.d.ts +15 -0
  233. package/lib/typescript/src/customFunctions/number.d.ts.map +1 -0
  234. package/lib/typescript/src/customFunctions/object.d.ts +6 -0
  235. package/lib/typescript/src/customFunctions/object.d.ts.map +1 -0
  236. package/lib/typescript/src/customFunctions/string.d.ts +20 -0
  237. package/lib/typescript/src/customFunctions/string.d.ts.map +1 -0
  238. package/lib/typescript/src/customFunctions/types.d.ts +22 -0
  239. package/lib/typescript/src/customFunctions/types.d.ts.map +1 -0
  240. package/lib/typescript/src/customFunctions/validation.d.ts +11 -0
  241. package/lib/typescript/src/customFunctions/validation.d.ts.map +1 -0
  242. package/lib/typescript/src/customHooks/errors.d.ts +16 -0
  243. package/lib/typescript/src/customHooks/errors.d.ts.map +1 -0
  244. package/lib/typescript/src/customHooks/fetchJson.d.ts +5 -0
  245. package/lib/typescript/src/customHooks/fetchJson.d.ts.map +1 -0
  246. package/lib/typescript/src/customHooks/index.d.ts +9 -0
  247. package/lib/typescript/src/customHooks/index.d.ts.map +1 -0
  248. package/lib/typescript/src/customHooks/internal.d.ts +12 -0
  249. package/lib/typescript/src/customHooks/internal.d.ts.map +1 -0
  250. package/lib/typescript/src/customHooks/types.d.ts +49 -0
  251. package/lib/typescript/src/customHooks/types.d.ts.map +1 -0
  252. package/lib/typescript/src/customHooks/useApi.d.ts +13 -0
  253. package/lib/typescript/src/customHooks/useApi.d.ts.map +1 -0
  254. package/lib/typescript/src/customHooks/useLazyApi.d.ts +14 -0
  255. package/lib/typescript/src/customHooks/useLazyApi.d.ts.map +1 -0
  256. package/lib/typescript/src/customHooks/useMutation.d.ts +15 -0
  257. package/lib/typescript/src/customHooks/useMutation.d.ts.map +1 -0
  258. package/lib/typescript/src/customHooks/usePaginatedApi.d.ts +19 -0
  259. package/lib/typescript/src/customHooks/usePaginatedApi.d.ts.map +1 -0
  260. package/lib/typescript/src/customHooks/usePollingApi.d.ts +13 -0
  261. package/lib/typescript/src/customHooks/usePollingApi.d.ts.map +1 -0
  262. package/lib/typescript/src/index.d.ts +11 -0
  263. package/lib/typescript/src/index.d.ts.map +1 -0
  264. package/lib/typescript/src/multiply.d.ts +2 -0
  265. package/lib/typescript/src/multiply.d.ts.map +1 -0
  266. package/package.json +181 -0
  267. package/src/assets/images/close.png +0 -0
  268. package/src/components/CustomCheckbox/index.tsx +143 -0
  269. package/src/components/CustomCheckbox/styles.ts +146 -0
  270. package/src/components/CustomCheckbox/types.ts +33 -0
  271. package/src/components/closeButton/index.tsx +40 -0
  272. package/src/components/closeButton/types.ts +13 -0
  273. package/src/components/customButton/index.tsx +288 -0
  274. package/src/components/customButton/styles.ts +247 -0
  275. package/src/components/customButton/types.ts +71 -0
  276. package/src/components/customDropDown/DropDownBottomSheet.tsx +70 -0
  277. package/src/components/customDropDown/DropDownList.tsx +88 -0
  278. package/src/components/customDropDown/DropDownListItem.tsx +74 -0
  279. package/src/components/customDropDown/DropDownListModal.tsx +86 -0
  280. package/src/components/customDropDown/index.tsx +213 -0
  281. package/src/components/customDropDown/styles.ts +184 -0
  282. package/src/components/customDropDown/types.ts +48 -0
  283. package/src/components/customDropDown/utils.ts +24 -0
  284. package/src/components/customList/ListEmpty.tsx +36 -0
  285. package/src/components/customList/ListFooterLoader.tsx +11 -0
  286. package/src/components/customList/defaultKeyExtractor.ts +7 -0
  287. package/src/components/customList/getFlashList.ts +26 -0
  288. package/src/components/customList/index.tsx +142 -0
  289. package/src/components/customList/styles.ts +43 -0
  290. package/src/components/customList/types.ts +60 -0
  291. package/src/components/customModal/ModalFooter.tsx +57 -0
  292. package/src/components/customModal/index.tsx +166 -0
  293. package/src/components/customModal/styles.ts +131 -0
  294. package/src/components/customModal/types.ts +48 -0
  295. package/src/components/customModal/useCustomModal.ts +25 -0
  296. package/src/components/customNumberPad/NumberPadKey.tsx +81 -0
  297. package/src/components/customNumberPad/index.tsx +204 -0
  298. package/src/components/customNumberPad/styles.ts +146 -0
  299. package/src/components/customNumberPad/types.ts +53 -0
  300. package/src/components/customNumberPad/useNumberPadInput.ts +56 -0
  301. package/src/components/customNumberPad/utils.ts +54 -0
  302. package/src/components/customSlideTabs/AnimatedTabIndicator.tsx +103 -0
  303. package/src/components/customSlideTabs/TabBarItem.tsx +118 -0
  304. package/src/components/customSlideTabs/TabScene.tsx +136 -0
  305. package/src/components/customSlideTabs/index.tsx +385 -0
  306. package/src/components/customSlideTabs/styles.ts +136 -0
  307. package/src/components/customSlideTabs/tabBarScroll.ts +92 -0
  308. package/src/components/customSlideTabs/types.ts +87 -0
  309. package/src/components/loading/index.tsx +34 -0
  310. package/src/customFunctions/array.ts +83 -0
  311. package/src/customFunctions/async.ts +85 -0
  312. package/src/customFunctions/date.ts +158 -0
  313. package/src/customFunctions/general.ts +35 -0
  314. package/src/customFunctions/id.ts +25 -0
  315. package/src/customFunctions/index.ts +91 -0
  316. package/src/customFunctions/number.ts +139 -0
  317. package/src/customFunctions/object.ts +59 -0
  318. package/src/customFunctions/string.ts +119 -0
  319. package/src/customFunctions/types.ts +25 -0
  320. package/src/customFunctions/validation.ts +49 -0
  321. package/src/customHooks/errors.ts +87 -0
  322. package/src/customHooks/fetchJson.ts +49 -0
  323. package/src/customHooks/index.ts +20 -0
  324. package/src/customHooks/internal.ts +67 -0
  325. package/src/customHooks/types.ts +71 -0
  326. package/src/customHooks/useApi.ts +107 -0
  327. package/src/customHooks/useLazyApi.ts +92 -0
  328. package/src/customHooks/useMutation.ts +97 -0
  329. package/src/customHooks/usePaginatedApi.ts +168 -0
  330. package/src/customHooks/usePollingApi.ts +48 -0
  331. package/src/index.tsx +63 -0
  332. package/src/multiply.tsx +3 -0
@@ -0,0 +1,288 @@
1
+ import {
2
+ Image,
3
+ Text,
4
+ TouchableOpacity,
5
+ View,
6
+ type ColorValue,
7
+ } from 'react-native';
8
+ import { useMemo } from 'react';
9
+
10
+ import type { CustomButtonProps } from './types';
11
+ import {
12
+ iconOnlySizeStyles,
13
+ sizeStyles,
14
+ contentAlignStyles,
15
+ styles,
16
+ variantTheme,
17
+ } from './styles';
18
+ import Loader from '../loading';
19
+
20
+ const toColorString = (color: ColorValue | undefined, fallback: string) =>
21
+ typeof color === 'string' ? color : fallback;
22
+
23
+ const CustomButton = ({
24
+ text = 'Submit',
25
+ children,
26
+ variant = 'default',
27
+ size = 'md',
28
+ contentAlign = 'center',
29
+ iconOnly = false,
30
+ iconOnlyShape = 'square',
31
+ rightImage,
32
+ leftImage,
33
+ style,
34
+ buttonStyles,
35
+ textStyles,
36
+ opacity = 0.7,
37
+ onPress,
38
+ imageStyles,
39
+ imageOuterStyle,
40
+ rotateRight = '0deg',
41
+ rotateLeft = '0deg',
42
+ disabled = false,
43
+ isLoading = false,
44
+ itemCount,
45
+ showCount = false,
46
+ isCapital = false,
47
+ borderRadius = 0,
48
+ RightIcon,
49
+ LeftIcon,
50
+ rightIconColor,
51
+ leftIconColor,
52
+ rightIconSize,
53
+ leftIconSize,
54
+ rightIconProps = {},
55
+ leftIconProps = {},
56
+ accessibilityRole = 'button',
57
+ accessibilityLabel,
58
+ accessibilityState,
59
+ ...touchableProps
60
+ }: CustomButtonProps) => {
61
+ const iconOnlyMetrics = iconOnlySizeStyles[size];
62
+ const theme = variantTheme[variant];
63
+ const fallbackIconColor = toColorString(theme.text.color, '#000000');
64
+ const resolvedLeftIconColor = leftIconColor ?? fallbackIconColor;
65
+ const resolvedRightIconColor = rightIconColor ?? fallbackIconColor;
66
+ const resolvedLeftIconSize =
67
+ leftIconSize ?? (iconOnly ? iconOnlyMetrics.iconSize : 20);
68
+ const resolvedRightIconSize =
69
+ rightIconSize ?? (iconOnly ? iconOnlyMetrics.iconSize : 20);
70
+ const resolvedImageSize = iconOnly ? iconOnlyMetrics.imageSize : undefined;
71
+
72
+ const IconComponent = LeftIcon ?? RightIcon;
73
+ const imageSource = leftImage ?? rightImage;
74
+ const hasIconOnlyContent = Boolean(IconComponent || imageSource || children);
75
+
76
+ if (__DEV__ && iconOnly && !hasIconOnlyContent) {
77
+ console.warn(
78
+ 'CustomButton: iconOnly requires LeftIcon, RightIcon, leftImage, rightImage, or children.'
79
+ );
80
+ }
81
+
82
+ if (__DEV__ && iconOnly && !accessibilityLabel && !text) {
83
+ console.warn(
84
+ 'CustomButton: iconOnly buttons should include accessibilityLabel for screen readers.'
85
+ );
86
+ }
87
+
88
+ const alignment = iconOnly
89
+ ? contentAlignStyles.center
90
+ : contentAlignStyles[contentAlign];
91
+
92
+ const iconOnlyBorderRadius =
93
+ iconOnly && iconOnlyShape === 'circle'
94
+ ? (iconOnlyMetrics.button.width as number) / 2
95
+ : borderRadius;
96
+
97
+ const buttonStyle = useMemo(
98
+ () => [
99
+ styles.button,
100
+ theme.button,
101
+ !iconOnly && sizeStyles[size],
102
+ iconOnly && iconOnlyMetrics.button,
103
+ disabled && styles.disabledButton,
104
+ buttonStyles,
105
+ style,
106
+ { borderRadius: iconOnly ? iconOnlyBorderRadius : borderRadius },
107
+ ],
108
+ [
109
+ theme.button,
110
+ size,
111
+ iconOnly,
112
+ iconOnlyMetrics.button,
113
+ disabled,
114
+ buttonStyles,
115
+ style,
116
+ iconOnlyBorderRadius,
117
+ borderRadius,
118
+ ]
119
+ );
120
+
121
+ const labelStyle = useMemo(
122
+ () => [
123
+ styles.text,
124
+ alignment.text,
125
+ theme.text,
126
+ textStyles,
127
+ disabled && styles.disabledText,
128
+ ],
129
+ [alignment.text, theme.text, textStyles, disabled]
130
+ );
131
+
132
+ const imageTintStyle = theme.imageTint
133
+ ? { tintColor: theme.imageTint }
134
+ : undefined;
135
+
136
+ const getLabel = () => {
137
+ if (typeof text !== 'string') {
138
+ return text;
139
+ }
140
+
141
+ return isCapital ? text.toUpperCase() : text;
142
+ };
143
+
144
+ const renderLabel = () => {
145
+ if (iconOnly) {
146
+ return null;
147
+ }
148
+
149
+ if (children) {
150
+ return children;
151
+ }
152
+
153
+ const label = getLabel();
154
+
155
+ if (!label) {
156
+ return null;
157
+ }
158
+
159
+ return <Text style={labelStyle}>{label}</Text>;
160
+ };
161
+
162
+ const renderIconOnlyContent = () => {
163
+ if (!iconOnly) {
164
+ return null;
165
+ }
166
+
167
+ if (children) {
168
+ return children;
169
+ }
170
+
171
+ if (IconComponent) {
172
+ return (
173
+ <IconComponent
174
+ size={LeftIcon ? resolvedLeftIconSize : resolvedRightIconSize}
175
+ color={LeftIcon ? resolvedLeftIconColor : resolvedRightIconColor}
176
+ {...(LeftIcon ? leftIconProps : rightIconProps)}
177
+ />
178
+ );
179
+ }
180
+
181
+ if (imageSource) {
182
+ return (
183
+ <Image
184
+ resizeMode="contain"
185
+ source={imageSource}
186
+ style={[
187
+ iconOnly &&
188
+ resolvedImageSize != null && {
189
+ width: resolvedImageSize,
190
+ height: resolvedImageSize,
191
+ },
192
+ imageTintStyle,
193
+ imageStyles,
194
+ ]}
195
+ />
196
+ );
197
+ }
198
+
199
+ return null;
200
+ };
201
+
202
+ return (
203
+ <TouchableOpacity
204
+ {...touchableProps}
205
+ accessibilityRole={accessibilityRole}
206
+ accessibilityLabel={accessibilityLabel ?? text}
207
+ accessibilityState={{
208
+ disabled: disabled || isLoading,
209
+ busy: isLoading,
210
+ ...accessibilityState,
211
+ }}
212
+ disabled={disabled || isLoading}
213
+ activeOpacity={opacity}
214
+ style={buttonStyle}
215
+ onPress={onPress}
216
+ >
217
+ {showCount && (
218
+ <View style={styles.countContainer}>
219
+ <Text style={styles.countText}>{itemCount}</Text>
220
+ </View>
221
+ )}
222
+ <View
223
+ style={[
224
+ styles.container,
225
+ alignment.container,
226
+ iconOnly && styles.iconOnlyContainer,
227
+ imageOuterStyle,
228
+ ]}
229
+ >
230
+ {iconOnly ? (
231
+ renderIconOnlyContent()
232
+ ) : (
233
+ <>
234
+ {LeftIcon && (
235
+ <LeftIcon
236
+ size={resolvedLeftIconSize}
237
+ color={resolvedLeftIconColor}
238
+ {...leftIconProps}
239
+ />
240
+ )}
241
+ {leftImage && (
242
+ <Image
243
+ resizeMode="contain"
244
+ source={leftImage}
245
+ style={[
246
+ styles.leftImage,
247
+ imageTintStyle,
248
+ imageStyles,
249
+ { transform: [{ rotate: rotateLeft }] },
250
+ ]}
251
+ />
252
+ )}
253
+ {renderLabel()}
254
+ {RightIcon && (
255
+ <RightIcon
256
+ size={resolvedRightIconSize}
257
+ color={resolvedRightIconColor}
258
+ {...rightIconProps}
259
+ />
260
+ )}
261
+ {rightImage && (
262
+ <Image
263
+ resizeMode="contain"
264
+ source={rightImage}
265
+ style={[
266
+ styles.rightImage,
267
+ imageTintStyle,
268
+ imageStyles,
269
+ { transform: [{ rotate: rotateRight }] },
270
+ ]}
271
+ />
272
+ )}
273
+ </>
274
+ )}
275
+ </View>
276
+ {isLoading && <Loader small color={theme.loaderColor} />}
277
+ </TouchableOpacity>
278
+ );
279
+ };
280
+
281
+ export default CustomButton;
282
+ export type {
283
+ ButtonContentAlign,
284
+ ButtonSize,
285
+ ButtonVariant,
286
+ CustomButtonProps,
287
+ IconOnlyShape,
288
+ } from './types';
@@ -0,0 +1,247 @@
1
+ import { StyleSheet, type TextStyle, type ViewStyle } from 'react-native';
2
+
3
+ import type { ButtonContentAlign, ButtonSize, ButtonVariant } from './types';
4
+
5
+ const baseButton: ViewStyle = {
6
+ paddingHorizontal: 20,
7
+ paddingVertical: 15,
8
+ alignItems: 'center',
9
+ justifyContent: 'center',
10
+ alignSelf: 'stretch',
11
+ };
12
+
13
+ export const sizeStyles: Record<ButtonSize, ViewStyle> = {
14
+ sm: {
15
+ paddingHorizontal: 12,
16
+ paddingVertical: 8,
17
+ },
18
+ md: {},
19
+ lg: {
20
+ paddingHorizontal: 24,
21
+ paddingVertical: 18,
22
+ },
23
+ };
24
+
25
+ export const iconOnlySizeStyles: Record<
26
+ ButtonSize,
27
+ { button: ViewStyle; iconSize: number; imageSize: number }
28
+ > = {
29
+ sm: {
30
+ button: {
31
+ width: 36,
32
+ height: 36,
33
+ paddingHorizontal: 0,
34
+ paddingVertical: 0,
35
+ alignSelf: 'flex-start',
36
+ },
37
+ iconSize: 16,
38
+ imageSize: 18,
39
+ },
40
+ md: {
41
+ button: {
42
+ width: 44,
43
+ height: 44,
44
+ paddingHorizontal: 0,
45
+ paddingVertical: 0,
46
+ alignSelf: 'flex-start',
47
+ },
48
+ iconSize: 20,
49
+ imageSize: 22,
50
+ },
51
+ lg: {
52
+ button: {
53
+ width: 52,
54
+ height: 52,
55
+ paddingHorizontal: 0,
56
+ paddingVertical: 0,
57
+ alignSelf: 'flex-start',
58
+ },
59
+ iconSize: 24,
60
+ imageSize: 26,
61
+ },
62
+ };
63
+
64
+ export const variantTheme: Record<
65
+ ButtonVariant,
66
+ {
67
+ button: ViewStyle;
68
+ text: TextStyle;
69
+ imageTint?: string;
70
+ loaderColor: string;
71
+ }
72
+ > = {
73
+ default: {
74
+ button: { backgroundColor: '#FFFFFF' },
75
+ text: { color: '#000000', fontWeight: '600' },
76
+ loaderColor: '#000000',
77
+ },
78
+ primary: {
79
+ button: { backgroundColor: '#0D6EFD' },
80
+ text: { color: '#FFFFFF', fontWeight: '600' },
81
+ imageTint: '#FFFFFF',
82
+ loaderColor: '#FFFFFF',
83
+ },
84
+ danger: {
85
+ button: { backgroundColor: '#DC3545' },
86
+ text: { color: '#FFFFFF', fontWeight: '600' },
87
+ imageTint: '#FFFFFF',
88
+ loaderColor: '#FFFFFF',
89
+ },
90
+ warning: {
91
+ button: { backgroundColor: '#FFC107' },
92
+ text: { color: '#212529', fontWeight: '600' },
93
+ imageTint: '#212529',
94
+ loaderColor: '#212529',
95
+ },
96
+ info: {
97
+ button: { backgroundColor: '#407BFF' },
98
+ text: { color: '#FFFFFF', fontWeight: '600' },
99
+ imageTint: '#FFFFFF',
100
+ loaderColor: '#FFFFFF',
101
+ },
102
+ success: {
103
+ button: { backgroundColor: '#198754' },
104
+ text: { color: '#FFFFFF', fontWeight: '600' },
105
+ imageTint: '#FFFFFF',
106
+ loaderColor: '#FFFFFF',
107
+ },
108
+ secondary: {
109
+ button: { backgroundColor: '#6C757D' },
110
+ text: { color: '#FFFFFF', fontWeight: '600' },
111
+ imageTint: '#FFFFFF',
112
+ loaderColor: '#FFFFFF',
113
+ },
114
+ light: {
115
+ button: { backgroundColor: '#F8F9FA' },
116
+ text: { color: '#212529', fontWeight: '600' },
117
+ imageTint: '#212529',
118
+ loaderColor: '#212529',
119
+ },
120
+ dark: {
121
+ button: { backgroundColor: '#212529' },
122
+ text: { color: '#FFFFFF', fontWeight: '600' },
123
+ imageTint: '#FFFFFF',
124
+ loaderColor: '#FFFFFF',
125
+ },
126
+ link: {
127
+ button: {
128
+ backgroundColor: 'transparent',
129
+ paddingHorizontal: 4,
130
+ paddingVertical: 4,
131
+ },
132
+ text: {
133
+ color: '#0D6EFD',
134
+ fontWeight: '600',
135
+ textDecorationLine: 'underline',
136
+ },
137
+ loaderColor: '#0D6EFD',
138
+ },
139
+ outline: {
140
+ button: {
141
+ backgroundColor: 'transparent',
142
+ borderWidth: 1,
143
+ borderColor: '#0D6EFD',
144
+ },
145
+ text: { color: '#0D6EFD', fontWeight: '600' },
146
+ imageTint: '#0D6EFD',
147
+ loaderColor: '#0D6EFD',
148
+ },
149
+ ghost: {
150
+ button: {
151
+ backgroundColor: 'transparent',
152
+ borderWidth: 1,
153
+ borderColor: '#DEE2E6',
154
+ },
155
+ text: { color: '#212529', fontWeight: '600' },
156
+ imageTint: '#212529',
157
+ loaderColor: '#212529',
158
+ },
159
+ text: {
160
+ button: {
161
+ backgroundColor: 'transparent',
162
+ paddingHorizontal: 4,
163
+ paddingVertical: 4,
164
+ },
165
+ text: { color: '#212529', fontWeight: '600' },
166
+ imageTint: '#212529',
167
+ loaderColor: '#212529',
168
+ },
169
+ };
170
+
171
+ export const contentAlignStyles: Record<
172
+ ButtonContentAlign,
173
+ { container: ViewStyle; text: TextStyle }
174
+ > = {
175
+ left: {
176
+ container: {
177
+ alignSelf: 'stretch',
178
+ justifyContent: 'flex-start',
179
+ },
180
+ text: {
181
+ textAlign: 'left',
182
+ },
183
+ },
184
+ center: {
185
+ container: {
186
+ justifyContent: 'center',
187
+ },
188
+ text: {
189
+ textAlign: 'center',
190
+ },
191
+ },
192
+ right: {
193
+ container: {
194
+ alignSelf: 'stretch',
195
+ justifyContent: 'flex-end',
196
+ },
197
+ text: {
198
+ textAlign: 'right',
199
+ },
200
+ },
201
+ };
202
+
203
+ export const styles = StyleSheet.create({
204
+ button: baseButton,
205
+ container: {
206
+ flexDirection: 'row',
207
+ alignItems: 'center',
208
+ justifyContent: 'center',
209
+ gap: 8,
210
+ },
211
+ iconOnlyContainer: {
212
+ gap: 0,
213
+ },
214
+ text: {},
215
+ leftImage: {
216
+ height: 20,
217
+ width: 25,
218
+ marginRight: 2,
219
+ },
220
+ rightImage: {
221
+ height: 20,
222
+ width: 20,
223
+ marginLeft: 2,
224
+ },
225
+ disabledButton: {
226
+ opacity: 0.55,
227
+ },
228
+ disabledText: {
229
+ opacity: 0.7,
230
+ },
231
+ countContainer: {
232
+ position: 'absolute',
233
+ top: -10,
234
+ right: -10,
235
+ height: 35,
236
+ width: 35,
237
+ borderRadius: 17.5,
238
+ backgroundColor: '#FFFFFF',
239
+ justifyContent: 'center',
240
+ alignItems: 'center',
241
+ zIndex: 2,
242
+ },
243
+ countText: {
244
+ color: '#000000',
245
+ fontWeight: '600',
246
+ },
247
+ });
@@ -0,0 +1,71 @@
1
+ import type { ComponentType, ReactNode } from 'react';
2
+ import type {
3
+ ImageSourcePropType,
4
+ ImageStyle,
5
+ StyleProp,
6
+ TextStyle,
7
+ TouchableOpacityProps,
8
+ ViewStyle,
9
+ } from 'react-native';
10
+
11
+ export type ButtonVariant =
12
+ | 'default'
13
+ | 'primary'
14
+ | 'danger'
15
+ | 'warning'
16
+ | 'info'
17
+ | 'success'
18
+ | 'secondary'
19
+ | 'light'
20
+ | 'dark'
21
+ | 'link'
22
+ | 'outline'
23
+ | 'ghost'
24
+ | 'text';
25
+
26
+ export type ButtonSize = 'sm' | 'md' | 'lg';
27
+
28
+ export type ButtonContentAlign = 'left' | 'center' | 'right';
29
+
30
+ export type IconOnlyShape = 'square' | 'circle';
31
+
32
+ export type IconComponent = ComponentType<{
33
+ size?: number;
34
+ color?: string;
35
+ [key: string]: unknown;
36
+ }>;
37
+
38
+ export type CustomButtonProps = Omit<TouchableOpacityProps, 'children'> & {
39
+ variant?: ButtonVariant;
40
+ size?: ButtonSize;
41
+ contentAlign?: ButtonContentAlign;
42
+ /** Square icon-only button — requires LeftIcon/RightIcon/leftImage/rightImage and accessibilityLabel */
43
+ iconOnly?: boolean;
44
+ iconOnlyShape?: IconOnlyShape;
45
+ text?: string;
46
+ children?: ReactNode;
47
+ rightImage?: ImageSourcePropType;
48
+ leftImage?: ImageSourcePropType;
49
+ buttonStyles?: StyleProp<ViewStyle>;
50
+ imageOuterStyle?: StyleProp<ViewStyle>;
51
+ textStyles?: StyleProp<TextStyle>;
52
+ opacity?: number;
53
+ onPress?: () => void;
54
+ imageStyles?: StyleProp<ImageStyle>;
55
+ rotateRight?: string;
56
+ rotateLeft?: string;
57
+ disabled?: boolean;
58
+ isLoading?: boolean;
59
+ itemCount?: number;
60
+ showCount?: boolean;
61
+ isCapital?: boolean;
62
+ borderRadius?: number;
63
+ RightIcon?: IconComponent;
64
+ LeftIcon?: IconComponent;
65
+ rightIconColor?: string;
66
+ leftIconColor?: string;
67
+ rightIconSize?: number;
68
+ leftIconSize?: number;
69
+ rightIconProps?: Record<string, unknown>;
70
+ leftIconProps?: Record<string, unknown>;
71
+ };
@@ -0,0 +1,70 @@
1
+ import { Modal, Pressable, Text, View } from 'react-native';
2
+ import type { ImageStyle, StyleProp, TextStyle } from 'react-native';
3
+
4
+ import DropDownList from './DropDownList';
5
+ import { dropdownStyles } from './styles';
6
+ import type { DropDownItemImageAlign, DropDownListItem } from './types';
7
+
8
+ type DropDownBottomSheetProps = {
9
+ data: DropDownListItem[];
10
+ visible: boolean;
11
+ title?: string;
12
+ selectedText?: string;
13
+ onClose: () => void;
14
+ onSelect: (item: string, index: number) => void;
15
+ maxListHeight?: number;
16
+ itemImageAlign?: DropDownItemImageAlign;
17
+ itemImageGap?: number;
18
+ itemTextStyle?: StyleProp<TextStyle>;
19
+ itemImageStyle?: StyleProp<ImageStyle>;
20
+ };
21
+
22
+ const DropDownBottomSheet = ({
23
+ data,
24
+ visible,
25
+ title,
26
+ selectedText,
27
+ onClose,
28
+ onSelect,
29
+ maxListHeight,
30
+ itemImageAlign,
31
+ itemImageGap,
32
+ itemTextStyle,
33
+ itemImageStyle,
34
+ }: DropDownBottomSheetProps) => {
35
+ return (
36
+ <Modal
37
+ transparent
38
+ visible={visible}
39
+ supportedOrientations={['landscape', 'portrait']}
40
+ animationType="slide"
41
+ onRequestClose={onClose}
42
+ >
43
+ <View style={dropdownStyles.bottomSheetBackdrop}>
44
+ <Pressable style={dropdownStyles.backdropDismiss} onPress={onClose} />
45
+ <View style={dropdownStyles.bottomSheetContent}>
46
+ <View style={dropdownStyles.bottomSheetHandle} />
47
+ {!!title && (
48
+ <Text style={dropdownStyles.bottomSheetTitle}>{title}</Text>
49
+ )}
50
+ <DropDownList
51
+ data={data}
52
+ selectedText={selectedText}
53
+ maxHeight={maxListHeight}
54
+ itemImageAlign={itemImageAlign}
55
+ itemImageGap={itemImageGap}
56
+ itemTextStyle={itemTextStyle}
57
+ itemImageStyle={itemImageStyle}
58
+ containerStyle={dropdownStyles.bottomSheetList}
59
+ onSelect={(item, index) => {
60
+ onSelect(item, index);
61
+ onClose();
62
+ }}
63
+ />
64
+ </View>
65
+ </View>
66
+ </Modal>
67
+ );
68
+ };
69
+
70
+ export default DropDownBottomSheet;