@codeleap/mobile 7.0.0 → 7.0.2

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 (379) hide show
  1. package/dist/Registry.js +47 -0
  2. package/dist/Registry.js.map +1 -0
  3. package/dist/components/ActivityIndicator/index.js +28 -0
  4. package/dist/components/ActivityIndicator/index.js.map +1 -0
  5. package/dist/components/ActivityIndicator/styles.js +2 -0
  6. package/dist/components/ActivityIndicator/styles.js.map +1 -0
  7. package/dist/components/ActivityIndicator/types.js +2 -0
  8. package/dist/components/ActivityIndicator/types.js.map +1 -0
  9. package/dist/components/Autocomplete/index.js +150 -0
  10. package/dist/components/Autocomplete/index.js.map +1 -0
  11. package/dist/components/Autocomplete/styles.js +2 -0
  12. package/dist/components/Autocomplete/styles.js.map +1 -0
  13. package/dist/components/Autocomplete/types.js +2 -0
  14. package/dist/components/Autocomplete/types.js.map +1 -0
  15. package/dist/components/Avatar/components/Badge.js +13 -0
  16. package/dist/components/Avatar/components/Badge.js.map +1 -0
  17. package/dist/components/Avatar/components/Content.js +19 -0
  18. package/dist/components/Avatar/components/Content.js.map +1 -0
  19. package/dist/components/Avatar/components/Illustration.js +11 -0
  20. package/dist/components/Avatar/components/Illustration.js.map +1 -0
  21. package/dist/components/Avatar/components/OverlayIcon.js +11 -0
  22. package/dist/components/Avatar/components/OverlayIcon.js.map +1 -0
  23. package/dist/components/Avatar/components/Text.js +19 -0
  24. package/dist/components/Avatar/components/Text.js.map +1 -0
  25. package/dist/components/Avatar/components/Wrapper.js +30 -0
  26. package/dist/components/Avatar/components/Wrapper.js.map +1 -0
  27. package/dist/components/Avatar/context.js +13 -0
  28. package/dist/components/Avatar/context.js.map +1 -0
  29. package/dist/components/Avatar/index.js +35 -0
  30. package/dist/components/Avatar/index.js.map +1 -0
  31. package/dist/components/Avatar/styles.js +2 -0
  32. package/dist/components/Avatar/styles.js.map +1 -0
  33. package/dist/components/Avatar/types.js +2 -0
  34. package/dist/components/Avatar/types.js.map +1 -0
  35. package/dist/components/AvatarGroup/index.js +36 -0
  36. package/dist/components/AvatarGroup/index.js.map +1 -0
  37. package/dist/components/AvatarGroup/styles.js +2 -0
  38. package/dist/components/AvatarGroup/styles.js.map +1 -0
  39. package/dist/components/AvatarGroup/types.js +2 -0
  40. package/dist/components/AvatarGroup/types.js.map +1 -0
  41. package/dist/components/Backdrop/index.js +34 -0
  42. package/dist/components/Backdrop/index.js.map +1 -0
  43. package/dist/components/Backdrop/styles.js +2 -0
  44. package/dist/components/Backdrop/styles.js.map +1 -0
  45. package/dist/components/Backdrop/types.js +2 -0
  46. package/dist/components/Backdrop/types.js.map +1 -0
  47. package/dist/components/Badge/index.js +66 -0
  48. package/dist/components/Badge/index.js.map +1 -0
  49. package/dist/components/Badge/styles.js +2 -0
  50. package/dist/components/Badge/styles.js.map +1 -0
  51. package/dist/components/Badge/types.js +2 -0
  52. package/dist/components/Badge/types.js.map +1 -0
  53. package/dist/components/Button/index.js +73 -0
  54. package/dist/components/Button/index.js.map +1 -0
  55. package/dist/components/Button/styles.js +2 -0
  56. package/dist/components/Button/styles.js.map +1 -0
  57. package/dist/components/Button/types.js +2 -0
  58. package/dist/components/Button/types.js.map +1 -0
  59. package/dist/components/Calendar/index.js +100 -0
  60. package/dist/components/Calendar/index.js.map +1 -0
  61. package/dist/components/Calendar/styles.js +2 -0
  62. package/dist/components/Calendar/styles.js.map +1 -0
  63. package/dist/components/Calendar/types.js +2 -0
  64. package/dist/components/Calendar/types.js.map +1 -0
  65. package/dist/components/CalendarInput/index.js +67 -0
  66. package/dist/components/CalendarInput/index.js.map +1 -0
  67. package/dist/components/CalendarInput/styles.js +2 -0
  68. package/dist/components/CalendarInput/styles.js.map +1 -0
  69. package/dist/components/CalendarInput/types.js +2 -0
  70. package/dist/components/CalendarInput/types.js.map +1 -0
  71. package/dist/components/Checkbox/index.js +85 -0
  72. package/dist/components/Checkbox/index.js.map +1 -0
  73. package/dist/components/Checkbox/styles.js +2 -0
  74. package/dist/components/Checkbox/styles.js.map +1 -0
  75. package/dist/components/Checkbox/types.js +2 -0
  76. package/dist/components/Checkbox/types.js.map +1 -0
  77. package/dist/components/Collapse/index.js +45 -0
  78. package/dist/components/Collapse/index.js.map +1 -0
  79. package/dist/components/Collapse/types.js +2 -0
  80. package/dist/components/Collapse/types.js.map +1 -0
  81. package/dist/components/DatePickerModal/index.js +107 -0
  82. package/dist/components/DatePickerModal/index.js.map +1 -0
  83. package/dist/components/DatePickerModal/styles.js +2 -0
  84. package/dist/components/DatePickerModal/styles.js.map +1 -0
  85. package/dist/components/DatePickerModal/types.js +2 -0
  86. package/dist/components/DatePickerModal/types.js.map +1 -0
  87. package/dist/components/EmptyPlaceholder/components/Button.js +15 -0
  88. package/dist/components/EmptyPlaceholder/components/Button.js.map +1 -0
  89. package/dist/components/EmptyPlaceholder/components/Content.js +36 -0
  90. package/dist/components/EmptyPlaceholder/components/Content.js.map +1 -0
  91. package/dist/components/EmptyPlaceholder/components/Illustration.js +9 -0
  92. package/dist/components/EmptyPlaceholder/components/Illustration.js.map +1 -0
  93. package/dist/components/EmptyPlaceholder/components/Info.js +9 -0
  94. package/dist/components/EmptyPlaceholder/components/Info.js.map +1 -0
  95. package/dist/components/EmptyPlaceholder/components/Loading.js +20 -0
  96. package/dist/components/EmptyPlaceholder/components/Loading.js.map +1 -0
  97. package/dist/components/EmptyPlaceholder/context.js +13 -0
  98. package/dist/components/EmptyPlaceholder/context.js.map +1 -0
  99. package/dist/components/EmptyPlaceholder/index.js +38 -0
  100. package/dist/components/EmptyPlaceholder/index.js.map +1 -0
  101. package/dist/components/EmptyPlaceholder/styles.js +2 -0
  102. package/dist/components/EmptyPlaceholder/styles.js.map +1 -0
  103. package/dist/components/EmptyPlaceholder/types.js +2 -0
  104. package/dist/components/EmptyPlaceholder/types.js.map +1 -0
  105. package/dist/components/FileInput/index.js +126 -0
  106. package/dist/components/FileInput/index.js.map +1 -0
  107. package/dist/components/FileInput/types.js +2 -0
  108. package/dist/components/FileInput/types.js.map +1 -0
  109. package/dist/components/Grid/index.js +65 -0
  110. package/dist/components/Grid/index.js.map +1 -0
  111. package/dist/components/Grid/styles.js +2 -0
  112. package/dist/components/Grid/styles.js.map +1 -0
  113. package/dist/components/Grid/types.js +2 -0
  114. package/dist/components/Grid/types.js.map +1 -0
  115. package/dist/components/Icon/index.js +59 -0
  116. package/dist/components/Icon/index.js.map +1 -0
  117. package/dist/components/Icon/styles.js +2 -0
  118. package/dist/components/Icon/styles.js.map +1 -0
  119. package/dist/components/Icon/types.js +2 -0
  120. package/dist/components/Icon/types.js.map +1 -0
  121. package/dist/components/Image/index.js +108 -0
  122. package/dist/components/Image/index.js.map +1 -0
  123. package/dist/components/Image/styles.js +2 -0
  124. package/dist/components/Image/styles.js.map +1 -0
  125. package/dist/components/Image/types.js +2 -0
  126. package/dist/components/Image/types.js.map +1 -0
  127. package/dist/components/ImageView/Spotlight.js +139 -0
  128. package/dist/components/ImageView/Spotlight.js.map +1 -0
  129. package/dist/components/ImageView/component.js +17 -0
  130. package/dist/components/ImageView/component.js.map +1 -0
  131. package/dist/components/ImageView/index.js +3 -0
  132. package/dist/components/ImageView/index.js.map +1 -0
  133. package/dist/components/InputBase/index.js +37 -0
  134. package/dist/components/InputBase/index.js.map +1 -0
  135. package/dist/components/InputBase/styles.js +98 -0
  136. package/dist/components/InputBase/styles.js.map +1 -0
  137. package/dist/components/InputBase/types.js +2 -0
  138. package/dist/components/InputBase/types.js.map +1 -0
  139. package/dist/components/InputBase/useInputBase.js +48 -0
  140. package/dist/components/InputBase/useInputBase.js.map +1 -0
  141. package/dist/components/InputBase/useInputBasePartialStyles.js +35 -0
  142. package/dist/components/InputBase/useInputBasePartialStyles.js.map +1 -0
  143. package/dist/components/InputBase/utils.js +31 -0
  144. package/dist/components/InputBase/utils.js.map +1 -0
  145. package/dist/components/InputOverlay/index.js +68 -0
  146. package/dist/components/InputOverlay/index.js.map +1 -0
  147. package/dist/components/InputOverlay/store.js +49 -0
  148. package/dist/components/InputOverlay/store.js.map +1 -0
  149. package/dist/components/InputOverlay/types.js +2 -0
  150. package/dist/components/InputOverlay/types.js.map +1 -0
  151. package/dist/components/List/index.js +66 -0
  152. package/dist/components/List/index.js.map +1 -0
  153. package/dist/components/List/styles.js +2 -0
  154. package/dist/components/List/styles.js.map +1 -0
  155. package/dist/components/List/types.js +2 -0
  156. package/dist/components/List/types.js.map +1 -0
  157. package/dist/components/LoadingOverlay/index.js +51 -0
  158. package/dist/components/LoadingOverlay/index.js.map +1 -0
  159. package/dist/components/LoadingOverlay/styles.js +2 -0
  160. package/dist/components/LoadingOverlay/styles.js.map +1 -0
  161. package/dist/components/LoadingOverlay/types.js +2 -0
  162. package/dist/components/LoadingOverlay/types.js.map +1 -0
  163. package/dist/components/Modal/index.js +76 -0
  164. package/dist/components/Modal/index.js.map +1 -0
  165. package/dist/components/Modal/styles.js +2 -0
  166. package/dist/components/Modal/styles.js.map +1 -0
  167. package/dist/components/Modal/types.js +2 -0
  168. package/dist/components/Modal/types.js.map +1 -0
  169. package/dist/components/NumberIncrement/index.js +120 -0
  170. package/dist/components/NumberIncrement/index.js.map +1 -0
  171. package/dist/components/NumberIncrement/styles.js +2 -0
  172. package/dist/components/NumberIncrement/styles.js.map +1 -0
  173. package/dist/components/NumberIncrement/types.js +2 -0
  174. package/dist/components/NumberIncrement/types.js.map +1 -0
  175. package/dist/components/NumberIncrement/useNumberIncrement.js +116 -0
  176. package/dist/components/NumberIncrement/useNumberIncrement.js.map +1 -0
  177. package/dist/components/Pager/PagerDots.js +19 -0
  178. package/dist/components/Pager/PagerDots.js.map +1 -0
  179. package/dist/components/Pager/PagerItem.js +14 -0
  180. package/dist/components/Pager/PagerItem.js.map +1 -0
  181. package/dist/components/Pager/index.js +78 -0
  182. package/dist/components/Pager/index.js.map +1 -0
  183. package/dist/components/Pager/styles.js +2 -0
  184. package/dist/components/Pager/styles.js.map +1 -0
  185. package/dist/components/Pager/types.js +2 -0
  186. package/dist/components/Pager/types.js.map +1 -0
  187. package/dist/components/PaginationIndicator/index.js +36 -0
  188. package/dist/components/PaginationIndicator/index.js.map +1 -0
  189. package/dist/components/PaginationIndicator/styles.js +2 -0
  190. package/dist/components/PaginationIndicator/styles.js.map +1 -0
  191. package/dist/components/PaginationIndicator/types.js +2 -0
  192. package/dist/components/PaginationIndicator/types.js.map +1 -0
  193. package/dist/components/PlacesAutocomplete/index.js +71 -0
  194. package/dist/components/PlacesAutocomplete/index.js.map +1 -0
  195. package/dist/components/PlacesAutocomplete/styles.js +2 -0
  196. package/dist/components/PlacesAutocomplete/styles.js.map +1 -0
  197. package/dist/components/PlacesAutocomplete/types.js +2 -0
  198. package/dist/components/PlacesAutocomplete/types.js.map +1 -0
  199. package/dist/components/RadioInput/index.js +47 -0
  200. package/dist/components/RadioInput/index.js.map +1 -0
  201. package/dist/components/RadioInput/styles.js +2 -0
  202. package/dist/components/RadioInput/styles.js.map +1 -0
  203. package/dist/components/RadioInput/types.js +2 -0
  204. package/dist/components/RadioInput/types.js.map +1 -0
  205. package/dist/components/RefreshControl/index.js +27 -0
  206. package/dist/components/RefreshControl/index.js.map +1 -0
  207. package/dist/components/RefreshControl/styles.js +2 -0
  208. package/dist/components/RefreshControl/styles.js.map +1 -0
  209. package/dist/components/RefreshControl/types.js +2 -0
  210. package/dist/components/RefreshControl/types.js.map +1 -0
  211. package/dist/components/Scroll/index.js +40 -0
  212. package/dist/components/Scroll/index.js.map +1 -0
  213. package/dist/components/Scroll/styles.js +2 -0
  214. package/dist/components/Scroll/styles.js.map +1 -0
  215. package/dist/components/Scroll/types.js +2 -0
  216. package/dist/components/Scroll/types.js.map +1 -0
  217. package/dist/components/SearchInput/index.js +48 -0
  218. package/dist/components/SearchInput/index.js.map +1 -0
  219. package/dist/components/SectionFilters/context.js +6 -0
  220. package/dist/components/SectionFilters/context.js.map +1 -0
  221. package/dist/components/SectionFilters/index.js +47 -0
  222. package/dist/components/SectionFilters/index.js.map +1 -0
  223. package/dist/components/SectionFilters/types.js +2 -0
  224. package/dist/components/SectionFilters/types.js.map +1 -0
  225. package/dist/components/SectionFilters/useSectionFilters.js +148 -0
  226. package/dist/components/SectionFilters/useSectionFilters.js.map +1 -0
  227. package/dist/components/Sections/index.js +105 -0
  228. package/dist/components/Sections/index.js.map +1 -0
  229. package/dist/components/Sections/styles.js +2 -0
  230. package/dist/components/Sections/styles.js.map +1 -0
  231. package/dist/components/Sections/types.js +2 -0
  232. package/dist/components/Sections/types.js.map +1 -0
  233. package/dist/components/SegmentedControl/Option.js +20 -0
  234. package/dist/components/SegmentedControl/Option.js.map +1 -0
  235. package/dist/components/SegmentedControl/index.js +130 -0
  236. package/dist/components/SegmentedControl/index.js.map +1 -0
  237. package/dist/components/SegmentedControl/styles.js +2 -0
  238. package/dist/components/SegmentedControl/styles.js.map +1 -0
  239. package/dist/components/SegmentedControl/types.js +2 -0
  240. package/dist/components/SegmentedControl/types.js.map +1 -0
  241. package/dist/components/Select/index.js +204 -0
  242. package/dist/components/Select/index.js.map +1 -0
  243. package/dist/components/Select/styles.js +2 -0
  244. package/dist/components/Select/styles.js.map +1 -0
  245. package/dist/components/Select/types.js +2 -0
  246. package/dist/components/Select/types.js.map +1 -0
  247. package/dist/components/Slider/index.js +99 -0
  248. package/dist/components/Slider/index.js.map +1 -0
  249. package/dist/components/Slider/styles.js +2 -0
  250. package/dist/components/Slider/styles.js.map +1 -0
  251. package/dist/components/Slider/types.js +2 -0
  252. package/dist/components/Slider/types.js.map +1 -0
  253. package/dist/components/SortablePhotos/index.js +85 -0
  254. package/dist/components/SortablePhotos/index.js.map +1 -0
  255. package/dist/components/SortablePhotos/styles.js +2 -0
  256. package/dist/components/SortablePhotos/styles.js.map +1 -0
  257. package/dist/components/SortablePhotos/types.js +2 -0
  258. package/dist/components/SortablePhotos/types.js.map +1 -0
  259. package/dist/components/SortablePhotos/useSortablePhotos.js +143 -0
  260. package/dist/components/SortablePhotos/useSortablePhotos.js.map +1 -0
  261. package/dist/components/Switch/index.js +81 -0
  262. package/dist/components/Switch/index.js.map +1 -0
  263. package/dist/components/Switch/styles.js +2 -0
  264. package/dist/components/Switch/styles.js.map +1 -0
  265. package/dist/components/Switch/types.js +2 -0
  266. package/dist/components/Switch/types.js.map +1 -0
  267. package/dist/components/Tabs/Context.js +44 -0
  268. package/dist/components/Tabs/Context.js.map +1 -0
  269. package/dist/components/Tabs/Panel.js +21 -0
  270. package/dist/components/Tabs/Panel.js.map +1 -0
  271. package/dist/components/Tabs/Tab.js +28 -0
  272. package/dist/components/Tabs/Tab.js.map +1 -0
  273. package/dist/components/Tabs/TabList.js +16 -0
  274. package/dist/components/Tabs/TabList.js.map +1 -0
  275. package/dist/components/Tabs/index.js +34 -0
  276. package/dist/components/Tabs/index.js.map +1 -0
  277. package/dist/components/Tabs/styles.js +2 -0
  278. package/dist/components/Tabs/styles.js.map +1 -0
  279. package/dist/components/Tabs/types.js +2 -0
  280. package/dist/components/Tabs/types.js.map +1 -0
  281. package/dist/components/Text/index.js +82 -0
  282. package/dist/components/Text/index.js.map +1 -0
  283. package/dist/components/Text/styles.js +2 -0
  284. package/dist/components/Text/styles.js.map +1 -0
  285. package/dist/components/Text/types.js +2 -0
  286. package/dist/components/Text/types.js.map +1 -0
  287. package/dist/components/TextInput/index.js +99 -0
  288. package/dist/components/TextInput/index.js.map +1 -0
  289. package/dist/components/TextInput/styles.js +2 -0
  290. package/dist/components/TextInput/styles.js.map +1 -0
  291. package/dist/components/TextInput/types.js +2 -0
  292. package/dist/components/TextInput/types.js.map +1 -0
  293. package/dist/components/TextInput/useTextInput.js +66 -0
  294. package/dist/components/TextInput/useTextInput.js.map +1 -0
  295. package/dist/components/TimeInput/index.js +50 -0
  296. package/dist/components/TimeInput/index.js.map +1 -0
  297. package/dist/components/TimeInput/styles.js +2 -0
  298. package/dist/components/TimeInput/styles.js.map +1 -0
  299. package/dist/components/TimeInput/types.js +2 -0
  300. package/dist/components/TimeInput/types.js.map +1 -0
  301. package/dist/components/Touchable/index.js +170 -0
  302. package/dist/components/Touchable/index.js.map +1 -0
  303. package/dist/components/Touchable/styles.js +2 -0
  304. package/dist/components/Touchable/styles.js.map +1 -0
  305. package/dist/components/Touchable/types.js +2 -0
  306. package/dist/components/Touchable/types.js.map +1 -0
  307. package/dist/components/View/index.js +28 -0
  308. package/dist/components/View/index.js.map +1 -0
  309. package/dist/components/View/styles.js +2 -0
  310. package/dist/components/View/styles.js.map +1 -0
  311. package/dist/components/View/types.js +2 -0
  312. package/dist/components/View/types.js.map +1 -0
  313. package/dist/components/components.js +46 -0
  314. package/dist/components/components.js.map +1 -0
  315. package/dist/hooks/index.js +6 -0
  316. package/dist/hooks/index.js.map +1 -0
  317. package/dist/hooks/useAnimatedState.js +28 -0
  318. package/dist/hooks/useAnimatedState.js.map +1 -0
  319. package/dist/hooks/useAppState.js +16 -0
  320. package/dist/hooks/useAppState.js.map +1 -0
  321. package/dist/hooks/useKeyboardController.js +22 -0
  322. package/dist/hooks/useKeyboardController.js.map +1 -0
  323. package/dist/hooks/useStatusBar.js +18 -0
  324. package/dist/hooks/useStatusBar.js.map +1 -0
  325. package/dist/hooks/useStylesFor.js +13 -0
  326. package/dist/hooks/useStylesFor.js.map +1 -0
  327. package/dist/index.js +11 -0
  328. package/dist/index.js.map +1 -0
  329. package/dist/modules/PressableRipple/index.js +3 -0
  330. package/dist/modules/PressableRipple/index.js.map +1 -0
  331. package/dist/modules/PressableRipple/ripple.js +168 -0
  332. package/dist/modules/PressableRipple/ripple.js.map +1 -0
  333. package/dist/modules/PressableRipple/styles.js +18 -0
  334. package/dist/modules/PressableRipple/styles.js.map +1 -0
  335. package/dist/modules/PressableRipple/type.js +2 -0
  336. package/dist/modules/PressableRipple/type.js.map +1 -0
  337. package/dist/modules/backgroundTimer.js +33 -0
  338. package/dist/modules/backgroundTimer.js.map +1 -0
  339. package/dist/modules/formConfig.js +26 -0
  340. package/dist/modules/formConfig.js.map +1 -0
  341. package/dist/modules/index.js +3 -0
  342. package/dist/modules/index.js.map +1 -0
  343. package/dist/modules/reactNavigation.js +39 -0
  344. package/dist/modules/reactNavigation.js.map +1 -0
  345. package/dist/modules/scroll.js +59 -0
  346. package/dist/modules/scroll.js.map +1 -0
  347. package/dist/modules/textInputMask.js +7 -0
  348. package/dist/modules/textInputMask.js.map +1 -0
  349. package/dist/modules/types/textInputMask.js +2 -0
  350. package/dist/modules/types/textInputMask.js.map +1 -0
  351. package/dist/types/index.js +2 -0
  352. package/dist/types/index.js.map +1 -0
  353. package/dist/types/utility.js +2 -0
  354. package/dist/types/utility.js.map +1 -0
  355. package/dist/utils/NotificationManager/index.js +170 -0
  356. package/dist/utils/NotificationManager/index.js.map +1 -0
  357. package/dist/utils/NotificationManager/types.js +2 -0
  358. package/dist/utils/NotificationManager/types.js.map +1 -0
  359. package/dist/utils/OSAlert.js +128 -0
  360. package/dist/utils/OSAlert.js.map +1 -0
  361. package/dist/utils/StorageManager.js +84 -0
  362. package/dist/utils/StorageManager.js.map +1 -0
  363. package/dist/utils/Subscription.js +48 -0
  364. package/dist/utils/Subscription.js.map +1 -0
  365. package/dist/utils/hooks.js +199 -0
  366. package/dist/utils/hooks.js.map +1 -0
  367. package/dist/utils/index.js +11 -0
  368. package/dist/utils/index.js.map +1 -0
  369. package/dist/utils/input.js +45 -0
  370. package/dist/utils/input.js.map +1 -0
  371. package/dist/utils/locale.js +11 -0
  372. package/dist/utils/locale.js.map +1 -0
  373. package/dist/utils/misc.js +111 -0
  374. package/dist/utils/misc.js.map +1 -0
  375. package/dist/utils/theme.js +37 -0
  376. package/dist/utils/theme.js.map +1 -0
  377. package/dist/utils/useQueryListRefresh.js +33 -0
  378. package/dist/utils/useQueryListRefresh.js.map +1 -0
  379. package/package.json +19 -19
@@ -0,0 +1,68 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback, useState } from 'react';
3
+ import { StyleSheet, View } from 'react-native';
4
+ import { Gesture, GestureDetector } from 'react-native-gesture-handler';
5
+ import Animated, { FadeOut, FadeIn } from 'react-native-reanimated';
6
+ import { inputOverlayManager } from './store';
7
+ export * from './store';
8
+ /**
9
+ * Wraps a screen area so that tapping anywhere outside an `InputOverlay.Layout` closes all open overlays.
10
+ * `.runOnJS(true)` is mandatory because `inputOverlayManager.closeAll` mutates a nanostores atom on the JS thread.
11
+ */
12
+ const Detector = ({ children, style, withWrapper = true }) => {
13
+ const tapGesture = Gesture.Tap()
14
+ .onEnd((event) => {
15
+ inputOverlayManager.closeAll();
16
+ })
17
+ .runOnJS(true);
18
+ if (!withWrapper) {
19
+ _jsx(GestureDetector, { gesture: tapGesture, children: children });
20
+ }
21
+ return (_jsx(GestureDetector, { gesture: tapGesture, children: _jsx(View, { style: [style, styles.detectorContainer], children: children }) }));
22
+ };
23
+ /**
24
+ * Stops tap events from bubbling up to the `Detector` layer — without this, tapping inside a dropdown would immediately close it.
25
+ * RNGH does not bubble gestures natively; this works because both gestures are `Tap` and RNGH resolves same-type competing gestures by which `GestureDetector` is closer in the tree.
26
+ */
27
+ const Interceptor = ({ children }) => {
28
+ const tapGesture = Gesture.Tap()
29
+ .onEnd(() => {
30
+ // Intercepts the tap to prevent it from propagating to the parent
31
+ // Does nothing, just consumes the event
32
+ })
33
+ .runOnJS(true);
34
+ return (_jsx(GestureDetector, { gesture: tapGesture, children: children }));
35
+ };
36
+ const Layout = (props) => {
37
+ const { style, children, hideOverlay = false, isOpen, animationDuration = 150, mode = 'overlay', position, gap, content, id, } = props;
38
+ const [inputHeight, setInputHeight] = useState(0);
39
+ const handleLayout = useCallback((event) => {
40
+ const height = event?.nativeEvent?.layout?.height ?? 0;
41
+ setInputHeight(height);
42
+ }, []);
43
+ const isOverlayMode = mode === 'overlay';
44
+ const shouldShowOverlay = isOpen && !hideOverlay;
45
+ const overlayStyle = isOverlayMode ? {
46
+ position: 'absolute',
47
+ zIndex: 1,
48
+ [position]: 0,
49
+ top: inputHeight + gap,
50
+ } : {
51
+ marginTop: gap,
52
+ };
53
+ return (_jsxs(View, { style: [style, styles.layoutContainer], onLayout: handleLayout, children: [children, shouldShowOverlay ? (_jsx(Interceptor, { children: _jsx(Animated.View, { exiting: FadeOut.duration(animationDuration), entering: FadeIn.duration(animationDuration), style: overlayStyle, children: content }) })) : null] }));
54
+ };
55
+ const styles = StyleSheet.create({
56
+ detectorContainer: {
57
+ flex: 1,
58
+ },
59
+ layoutContainer: {
60
+ position: 'relative',
61
+ },
62
+ });
63
+ export const InputOverlay = {
64
+ Detector,
65
+ Interceptor,
66
+ Layout,
67
+ };
68
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/InputOverlay/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,EAAqB,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,QAAQ,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAG7C,cAAc,SAAS,CAAA;AAEvB;;;GAGG;AACH,MAAM,QAAQ,GAAG,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,EAAiB,EAAE,EAAE;IAC1E,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE;SAC7B,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACf,mBAAmB,CAAC,QAAQ,EAAE,CAAA;IAChC,CAAC,CAAC;SACD,OAAO,CAAC,IAAI,CAAC,CAAA;IAEhB,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,KAAC,eAAe,IAAC,OAAO,EAAE,UAAU,YACjC,QAAQ,GACO,CAAA;IACpB,CAAC;IAED,OAAO,CACL,KAAC,eAAe,IAAC,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ACT,CAAC,QAAQ,CAAC,EAAE,CAAC;QACb,GAAG,EAAE,WAAW,GAAG,GAAG;KACvB,CAAC,CAAC,CAAC;QACF,SAAS,EAAE,GAAG;KACf,CAAA;IAED,OAAO,CACL,MAAC,IAAI,IAAC,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,eAAe,CAAC,EAAE,QAAQ,EAAE,YAAY,aACjE,QAAQ,EAER,iBAAiB,CAAC,CAAC,CAAC,CACnB,KAAC,WAAW,cACV,KAAC,QAAQ,CAAC,IAAI,IACZ,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAC5C,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAC5C,KAAK,EAAE,YAAY,YAElB,OAAO,GACM,GACJ,CACf,CAAC,CAAC,CAAC,IAAI,IACH,CACR,CAAA;AACH,CAAC,CAAA;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,iBAAiB,EAAE;QACjB,IAAI,EAAE,CAAC;KACR;IACD,eAAe,EAAE;QACf,QAAQ,EAAE,UAAU;KACrB;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,QAAQ;IACR,WAAW;IACX,MAAM;CACP,CAAA"}
@@ -0,0 +1,49 @@
1
+ import { useCallback } from 'react';
2
+ import { useId } from '@codeleap/hooks';
3
+ import { atom } from 'nanostores';
4
+ import { useStore } from '@nanostores/react';
5
+ const defaultValue = '@input.atom';
6
+ const inputIdAtom = atom(defaultValue);
7
+ /** The 100 ms delay lets any in-flight `FadeOut` animation on `Layout` complete before the atom resets, avoiding a flicker caused by React re-rendering before the Reanimated exit animation finishes. */
8
+ const closeInputOverlays = () => {
9
+ const currentInputId = inputIdAtom.get();
10
+ if (currentInputId === defaultValue)
11
+ return;
12
+ setTimeout(() => inputIdAtom.set(defaultValue), 100);
13
+ };
14
+ const toggleOverlay = (id) => {
15
+ const currentInputId = inputIdAtom.get();
16
+ const isOpen = currentInputId === id;
17
+ inputIdAtom.set(isOpen ? defaultValue : id);
18
+ };
19
+ const useInputOverlay = (providedId) => {
20
+ const id = useId(providedId);
21
+ const isCurrentlyOpen = useStore(inputIdAtom) === id;
22
+ const toggle = useCallback(() => {
23
+ const currentInputId = inputIdAtom.get();
24
+ const isAnyOtherOpen = currentInputId !== defaultValue && currentInputId !== id;
25
+ const isOpen = currentInputId === id;
26
+ if (isAnyOtherOpen && !isOpen) {
27
+ /** Close the current overlay first and wait for its exit animation before opening the new one; opening both simultaneously causes z-index and animation conflicts. */
28
+ inputIdAtom.set(defaultValue);
29
+ setTimeout(() => {
30
+ inputIdAtom.set(id);
31
+ }, 100);
32
+ }
33
+ else {
34
+ inputIdAtom.set(isOpen ? defaultValue : id);
35
+ }
36
+ }, [id]);
37
+ return {
38
+ id,
39
+ isOpen: isCurrentlyOpen,
40
+ toggle,
41
+ };
42
+ };
43
+ export const inputOverlayManager = {
44
+ store: inputIdAtom,
45
+ use: useInputOverlay,
46
+ toggle: toggleOverlay,
47
+ closeAll: closeInputOverlays,
48
+ };
49
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/components/InputOverlay/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAU,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,MAAM,YAAY,GAAG,aAAa,CAAA;AAElC,MAAM,WAAW,GAAG,IAAI,CAAS,YAAY,CAAC,CAAA;AAE9C,0MAA0M;AAC1M,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC9B,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE,CAAA;IAExC,IAAI,cAAc,KAAK,YA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M,EAAE,eAAe;QACvB,MAAM;KACP,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,KAAK,EAAE,WAAW;IAClB,GAAG,EAAE,eAAe;IACpB,MAAM,EAAE,aAAa;IACrB,QAAQ,EAAE,kBAAkB;CAC7B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/InputOverlay/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,66 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ import { TypeGuards } from '@codeleap/types';
4
+ import { useCallback } from '@codeleap/hooks';
5
+ import { FlatList } from 'react-native';
6
+ import { View } from '../View';
7
+ import { EmptyPlaceholder } from '../EmptyPlaceholder';
8
+ import { RefreshControl } from '../RefreshControl';
9
+ import { useKeyboardPaddingStyle } from '../../utils';
10
+ import { MobileStyleRegistry } from '../../Registry';
11
+ import { useStylesFor } from '../../hooks';
12
+ export * from './styles';
13
+ export * from './types';
14
+ const RenderSeparator = (props) => {
15
+ return _jsx(View, { style: props.separatorStyles });
16
+ };
17
+ export const List = forwardRef((flatListProps, ref) => {
18
+ const { style, onRefresh, refreshing, placeholder, refreshControlProps, loading, keyboardAware, fakeEmpty = loading, contentContainerStyle, renderItem: providedRenderItem, data, ...props } = {
19
+ ...List.defaultProps,
20
+ ...flatListProps,
21
+ };
22
+ const styles = useStylesFor(List.styleRegistryName, style);
23
+ const separator = props?.separators && _jsx(RenderSeparator, { separatorStyles: styles.separator });
24
+ const dataLength = data?.length || 0;
25
+ const renderItem = useCallback((data) => {
26
+ if (!providedRenderItem)
27
+ return null;
28
+ const isFirst = data.index === 0;
29
+ const isLast = data.index === dataLength - 1;
30
+ const isOnly = isFirst && isLast;
31
+ const itemProps = {
32
+ ...data,
33
+ isFirst,
34
+ isLast,
35
+ isOnly,
36
+ };
37
+ return providedRenderItem(itemProps);
38
+ }, [dataLength, providedRenderItem]);
39
+ const isEmpty = !data || !data?.length;
40
+ const _placeholder = {
41
+ ...placeholder,
42
+ loading: TypeGuards.isBoolean(placeholder?.loading) ? placeholder.loading : loading,
43
+ };
44
+ const keyboardStyle = useKeyboardPaddingStyle([
45
+ styles.content,
46
+ contentContainerStyle,
47
+ isEmpty && styles['content:empty'],
48
+ loading && styles['content:loading'],
49
+ ], keyboardAware && !props.horizontal);
50
+ const wrapperStyle = [styles.wrapper, isEmpty && styles['wrapper:empty'], loading && styles['wrapper:loading']];
51
+ return (_jsx(FlatList, { ItemSeparatorComponent: separator, refreshControl: TypeGuards.isFunction(onRefresh) ? (_jsx(RefreshControl, { refreshing: refreshing, onRefresh: onRefresh, ...refreshControlProps })) : null, ListEmptyComponent: _jsx(EmptyPlaceholder, { ..._placeholder }), showsVerticalScrollIndicator: false, showsHorizontalScrollIndicator: false, ...props, ListHeaderComponentStyle: styles.header, style: wrapperStyle, contentContainerStyle: keyboardStyle, data: fakeEmpty ? [] : data, ref: ref, renderItem: renderItem }));
52
+ });
53
+ List.styleRegistryName = 'List';
54
+ List.elements = ['wrapper', 'content', 'separator', 'header', 'refreshControl'];
55
+ List.rootElement = 'wrapper';
56
+ List.withVariantTypes = (styles) => {
57
+ return List;
58
+ };
59
+ List.defaultProps = {
60
+ keyboardShouldPersistTaps: 'handled',
61
+ fakeEmpty: false,
62
+ loading: false,
63
+ keyboardAware: true,
64
+ };
65
+ MobileStyleRegistry.registerComponent(List);
66
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/List/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,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CACH,CAAC,CAAC,CAAC,IAAI,EACR,kBAAkB,EAAE,KAAC,gBAAgB,OAAK,YAAY,GAAI,EAC1D,4BAA4B,EAAE,KAAK,EACnC,8BAA8B,EAAE,KAAK,KACjC,KAAK,EACT,wBAAwB,EAAE,MAAM,CAAC,MAAM,EACvC,KAAK,EAAE,YAAY,EACnB,qBAAqB,EAAE,aAAa,EACpC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAC3B,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,GACtB,CACH,CAAA;AACH,CAAC,CAA4C,CAAA;AAE7C,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAA;AAC/B,IAAI,CAAC,QAAQ,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAA;AAC/E,IAAI,CAAC,WAAW,GAAG,SAAS,CAAA;AAE5B,IAAI,CAAC,gBAAgB,GAAG,CAAsB,MAAS,EAAE,EAAE;IACzD,OAAO,IAAkG,CAAA;AAC3G,CAAC,CAAA;AAED,IAAI,CAAC,YAAY,GAAG;IAClB,yBAAyB,EAAE,SAAS;IACpC,SAAS,EAAE,KAAK;IAChB,OAAO,EAAE,KAAK;IACd,aAAa,EAAE,IAAI;CACM,CAAA;AAE3B,mBAAmB,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/List/styles.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/List/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRef } from 'react';
3
+ import { ActivityIndicator } from '../ActivityIndicator';
4
+ import { View } from '../View';
5
+ import { useAnimatedVariantStyles } from '../../utils';
6
+ import { MobileStyleRegistry } from '../../Registry';
7
+ import { useNestedStylesByKey } from '@codeleap/styles';
8
+ import { useStylesFor } from '../../hooks';
9
+ export * from './styles';
10
+ export * from './types';
11
+ /**
12
+ * Renders in-place (not in a portal) — it does NOT block touch events on sibling content
13
+ * outside its own subtree. Position it as a full-screen absolute layer in the style variant
14
+ * if you need to cover the screen. The visibility transition is driven by Reanimated worklets
15
+ * via `useAnimatedVariantStyles`; the transition config is snapshotted into a ref on first
16
+ * render because mutating `styles.transition` after mount has no effect.
17
+ */
18
+ export const LoadingOverlay = (props) => {
19
+ const { children, visible, style, } = {
20
+ ...LoadingOverlay.defaultProps,
21
+ ...props
22
+ };
23
+ const transition = useRef(null);
24
+ const styles = useStylesFor(LoadingOverlay.styleRegistryName, style);
25
+ const loaderStyles = useNestedStylesByKey('loader', styles);
26
+ const wrapperAnimation = useAnimatedVariantStyles({
27
+ variantStyles: styles,
28
+ animatedProperties: ['wrapper:visible', 'wrapper:hidden'],
29
+ updater: (s) => {
30
+ 'worklet';
31
+ return visible ? s['wrapper:visible'] : s['wrapper:hidden'];
32
+ },
33
+ transition: styles.transition,
34
+ dependencies: [visible],
35
+ });
36
+ if (!transition.current) {
37
+ transition.current = JSON.parse(JSON.stringify(styles['wrapper:transition']));
38
+ }
39
+ return (_jsxs(View, { animated: true, animatedStyle: wrapperAnimation, style: styles.wrapper,
40
+ // @ts-expect-error
41
+ transition: transition.current, children: [_jsx(ActivityIndicator, { style: loaderStyles }), children] }));
42
+ };
43
+ LoadingOverlay.styleRegistryName = 'LoadingOverlay';
44
+ LoadingOverlay.elements = ['wrapper', 'loader', 'transition'];
45
+ LoadingOverlay.rootElement = 'wrapper';
46
+ LoadingOverlay.defaultProps = {};
47
+ LoadingOverlay.withVariantTypes = (styles) => {
48
+ return LoadingOverlay;
49
+ };
50
+ MobileStyleRegistry.registerComponent(LoadingOverlay);
51
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/LoadingOverlay/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAEtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAa,oBAAoB,EAA8B,MAAM,kBAAkB,CAAA;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AAEvB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAA0B,EAAE,EAAE;IAC3D,MAAM,EACJ,QAAQ,EACR,OAAO,EACP,KAAK,GACN,GAAG;QACF,GAAG,cAAc,CAAC,YAAY;QAC9B,GAAG,KAAK;KACT,CAAA;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;IAE/B,MAAM,MAAM,GAAG,YAAY,CAAC,cAAc,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAA;IAEpE,MAAM,YAAY,GAAG,oBAAoB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;IAE3D,MAAM,gBAAgB,GAAG,wBAAwB,CAAC;QAChD,aAAa,EAAE,MAAM;QACrB,kBAAkB,EAAE,CAAC,iBAAiB,EAAE,gBAAgB,CAAC;QACzD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,SAAS,CAAA;YACT,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAA;QAC7D,CAAC;QACD,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,YAAY,EAAE,CAAC,OAAO,CAAC;KACxB,CAAC,CAAA;IAEF,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;QACxB,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAA;IAC/E,CAAC;IAED,OAAO,CACL,MAAC,IAAI,IACH,QAAQ,QACR,aAAa,EAAE,gBAAgB,EAC/B,KAAK,EAAE,MAAM,CAAC,OAAO;QACrB,mBAAmB;QACnB,UAAU,EAAE,UAAU,CAAC,OAAO,aAE9B,KAAC,iBAAiB,IAAC,KAAK,EAAE,YAAY,GAAI,EACzC,QAAQ,IACJ,CACR,CAAA;AACH,CAAC,CAAA;AAED,cAAc,CAAC,iBAAiB,GAAG,gBAAgB,CAAA;AACnD,cAAc,CAAC,QAAQ,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAA;AAC7D,cAAc,CAAC,WAAW,GAAG,SAAS,CAAA;AAEtC,cAAc,CAAC,YAAY,GAAG,EAAkC,CAAA;AAEhE,cAAc,CAAC,gBAAgB,GAAG,CAAsB,MAAS,EAAE,EAAE;IACnE,OAAO,cAA2F,CAAA;AACpG,CAAC,CAAA;AAED,mBAAmB,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/LoadingOverlay/styles.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/LoadingOverlay/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,76 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { View } from '../View';
3
+ import { Scroll } from '../Scroll';
4
+ import { TypeGuards } from '@codeleap/types';
5
+ import { Backdrop } from '../Backdrop';
6
+ import { useBackButton } from '../../utils/hooks';
7
+ import { Text } from '../Text';
8
+ import { Touchable } from '../Touchable';
9
+ import { useNestedStylesByKey } from '@codeleap/styles';
10
+ import { MobileStyleRegistry } from '../../Registry';
11
+ import { useStylesFor } from '../../hooks';
12
+ import { FadeIn, FadeOut } from 'react-native-reanimated';
13
+ import { Platform, Modal as RNModal } from 'react-native';
14
+ import { FullWindowOverlay } from 'react-native-screens';
15
+ import { Button } from '../Button';
16
+ export * from './styles';
17
+ export * from './types';
18
+ /**
19
+ * On iOS, React Native's `Modal` renders into a separate UIWindow that sits below the system keyboard, causing keyboard-aware layouts to break inside modals.
20
+ * `FullWindowOverlay` from react-native-screens renders at the top of the main UIWindow's view hierarchy instead, which the keyboard responder chain can reach.
21
+ * Android does not have this issue, so the standard `RNModal` is used there.
22
+ */
23
+ const Overlay = Platform.select({
24
+ ios: FullWindowOverlay,
25
+ android: RNModal,
26
+ });
27
+ const DefaultHeader = (props) => {
28
+ const { styles, buttonStyles, title = null, showClose = false, description = null, closable, debugName, closeIconName = 'x', toggle, } = props;
29
+ return _jsx(_Fragment, { children: (title || showClose || description) && (_jsxs(View, { style: styles.header, children: [_jsxs(View, { style: styles.titleWrapper, children: [TypeGuards.isString(title) ? (_jsx(Text, { text: title, style: styles.title })) : (title), (showClose && closable) ? (_jsx(Button, { debugName: `${debugName} modal close button`, icon: closeIconName, onPress: toggle, style: buttonStyles })) : null] }), TypeGuards.isString(description) ? (_jsx(Text, { text: description, style: styles.description })) : (description)] })) });
30
+ };
31
+ export const Modal = (modalProps) => {
32
+ const { visible, closable, footer, children, toggle = () => null, dismissOnBackdrop, header, debugName, scroll, renderHeader: Header, scrollProps = {}, closeOnHardwareBackPress, style, boxExiting, boxEntering, withPortal, ...props } = {
33
+ ...Modal.defaultProps,
34
+ ...modalProps,
35
+ };
36
+ const styles = useStylesFor(Modal.styleRegistryName, style);
37
+ const buttonStyles = useNestedStylesByKey('closeButton', styles);
38
+ const ScrollComponent = scroll ? Scroll : View;
39
+ const scrollStyle = scroll ? styles?.scroll : styles?.innerWrapper;
40
+ /** Returning `true` from the back-button handler is required to signal to Android that the event was consumed; without it the OS will still perform the default back navigation. */
41
+ useBackButton(() => {
42
+ if (visible && closeOnHardwareBackPress) {
43
+ toggle();
44
+ return true;
45
+ }
46
+ }, [visible, toggle, closeOnHardwareBackPress]);
47
+ return (_jsx(Overlay, { transparent: true, visible: visible, children: _jsxs(View, { style: styles?.wrapper, pointerEvents: visible ? 'auto' : 'none', children: [_jsx(Backdrop, { visible: visible, debugName: `Modal ${debugName} backdrop`, style: {
48
+ 'wrapper:hidden': styles['backdrop:hidden'],
49
+ 'wrapper:visible': styles['backdrop:visible'],
50
+ 'wrapper': styles?.backdrop,
51
+ }, wrapperProps: {
52
+ // @ts-expect-error
53
+ transition: styles['backdrop:transition'],
54
+ } }), _jsxs(ScrollComponent, { contentContainerStyle: styles?.scrollContent, showsVerticalScrollIndicator: false, keyboardAware: true, animated: true, ...scrollProps, style: scrollStyle, children: [dismissOnBackdrop ? (_jsx(Touchable, { onPress: closable && visible ? toggle : (() => { }), debounce: 400, debugName: 'Modal backdrop touchable', style: styles?.backdropTouchable, android_ripple: null, noFeedback: true })) : null, visible ? (_jsxs(View, { animated: true,
55
+ // @ts-ignore
56
+ entering: boxEntering, exiting: boxExiting, ...props, style: styles?.box, children: [header ? header : (_jsx(Header, { ...modalProps, closable: closable, styles: styles, buttonStyles: buttonStyles })), _jsx(View, { style: styles?.body, children: children }), footer ? (_jsx(View, { style: styles?.footer, children: typeof footer === 'string' ? _jsx(Text, { text: footer }) : footer })) : null] })) : null] })] }) }));
57
+ };
58
+ Modal.styleRegistryName = 'Modal';
59
+ Modal.elements = ['wrapper', 'box', 'backdrop', 'innerWrapper', 'scroll', 'body', 'footer', 'header', 'title', 'description', 'closeButton'];
60
+ Modal.rootElement = 'wrapper';
61
+ Modal.withVariantTypes = (styles) => {
62
+ return Modal;
63
+ };
64
+ Modal.defaultProps = {
65
+ closeIconName: 'close',
66
+ closable: true,
67
+ dismissOnBackdrop: true,
68
+ scroll: true,
69
+ closeOnHardwareBackPress: true,
70
+ boxEntering: FadeIn.duration(100).delay(50).build(),
71
+ boxExiting: FadeOut.duration(100).build(),
72
+ withPortal: true,
73
+ renderHeader: DefaultHeader,
74
+ };
75
+ MobileStyleRegistry.registerComponent(Modal);
76
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Modal/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,OAAO,EAAsB,oBAAoB,EAA8B,MAAM,kBAAkB,CAAA;AACvG,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,O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KAAK,EAAE,MAAM,EAAE,MAAM,YACxB,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAE,MAAM,GAAI,CAAC,CAAC,CAAC,MAAM,GACxD,CACR,CAAC,CAAC,CAAC,IAAI,IACH,CACR,CAAC,CAAC,CAAC,IAAI,IAEM,IACb,GACC,CACX,CAAA;AACH,CAAC,CAAA;AAED,KAAK,CAAC,iBAAiB,GAAG,OAAO,CAAA;AACjC,KAAK,CAAC,QAAQ,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,CAAC,CAAA;AAC5I,KAAK,CAAC,WAAW,GAAG,SAAS,CAAA;AAE7B,KAAK,CAAC,gBAAgB,GAAG,CAAsB,MAAS,EAAE,EAAE;IAC1D,OAAO,KAAyE,CAAA;AAClF,CAAC,CAAA;AAED,KAAK,CAAC,YAAY,GAAG;IACnB,aAAa,EAAE,OAAkB;IACjC,QAAQ,EAAE,IAAI;IACd,iBAAiB,EAAE,IAAI;IACvB,MAAM,EAAE,IAAI;IACZ,wBAAwB,EAAE,IAAI;IAC9B,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE;IACnD,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE;IACzC,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,aAAa;CACL,CAAA;AAExB,mBAAmB,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/Modal/styles.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/Modal/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,120 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { TypeGuards } from '@codeleap/types';
3
+ import { forwardRef } from 'react';
4
+ import { InputBase, selectInputBaseProps } from '../InputBase';
5
+ import { Text } from '../Text';
6
+ import { MaskedTextInput } from '../../modules/textInputMask';
7
+ import { TextInput as NativeTextInput } from 'react-native';
8
+ import { Touchable } from '../Touchable';
9
+ import { MobileStyleRegistry } from '../../Registry';
10
+ import { useStylesFor } from '../../hooks';
11
+ import CurrencyInput from 'react-native-currency-input';
12
+ import { useInputBasePartialStyles } from '../InputBase/useInputBasePartialStyles';
13
+ import { MAX_VALID_DIGITS, useNumberIncrement } from './useNumberIncrement';
14
+ export * from './styles';
15
+ export * from './types';
16
+ const defaultParseValue = (_value) => {
17
+ const value = _value?.length > 0 ? _value : '0';
18
+ const parsedValue = value?.replace(/[^\d.]/g, '');
19
+ return parseFloat(parsedValue);
20
+ };
21
+ export const NumberIncrement = forwardRef((props, inputRef) => {
22
+ const allProps = {
23
+ ...NumberIncrement.defaultProps,
24
+ ...props,
25
+ };
26
+ const { inputBaseProps, others, } = selectInputBaseProps(allProps);
27
+ const { style, disabled, onChangeMask, step, editable, onPress, forceError, masking, separator, prefix, suffix, delimiter, formatter, actionPressAutoFocus, parseValue, timeoutActionFocus, mask, actionDebounce, precision, field, ...textInputProps } = others;
28
+ const styles = useStylesFor(NumberIncrement.styleRegistryName, style);
29
+ const { validation, min, max, innerInputRef, wrapperRef, isFocused, hasValue, hasError, incrementDisabled, decrementDisabled, handleChangeInput, handleChange, handleMaskChange, handleBlur, handleFocus, inputValue, onInputValueChange, } = useNumberIncrement(allProps);
30
+ const isFormatted = TypeGuards.isFunction(formatter);
31
+ const hasMaskProps = [masking, mask].some(v => !!v);
32
+ const hasCurrencyProps = [prefix, suffix, delimiter, separator, precision].some(v => !!v);
33
+ const isCurrency = hasCurrencyProps;
34
+ const isMasked = hasMaskProps && !isFormatted && !isCurrency;
35
+ const InputElement = isMasked ? MaskedTextInput : isCurrency ? CurrencyInput : NativeTextInput;
36
+ const partialStyles = useInputBasePartialStyles(styles, [['input', false], 'placeholder', 'selection'], {
37
+ disabled,
38
+ error: !!hasError,
39
+ focus: isFocused,
40
+ typed: hasValue,
41
+ });
42
+ const maskingExtraProps = isMasked ? {
43
+ type: TypeGuards.isNil(mask) ? 'money' : 'custom',
44
+ onChangeText: handleMaskChange,
45
+ ...masking,
46
+ options: {
47
+ unit: prefix,
48
+ separator: separator ?? '.',
49
+ suffixUnit: suffix,
50
+ delimiter: delimiter ?? ',',
51
+ mask: mask,
52
+ ...masking?.options,
53
+ },
54
+ ref: null,
55
+ refInput: (inputRef) => {
56
+ if (!!inputRef) {
57
+ innerInputRef.current = inputRef;
58
+ }
59
+ },
60
+ } : {};
61
+ const currencyExtraProps = isCurrency ? {
62
+ value: inputValue,
63
+ onChangeText: null,
64
+ onChangeValue: onInputValueChange,
65
+ prefix: prefix,
66
+ separator: separator ?? '.',
67
+ suffix: suffix,
68
+ delimiter: delimiter ?? ',',
69
+ minValue: min,
70
+ maxValue: max,
71
+ precision,
72
+ } : {};
73
+ const onPressInnerWrapper = () => {
74
+ handleFocus(null);
75
+ if (editable)
76
+ innerInputRef.current?.focus?.();
77
+ if (onPress)
78
+ onPress?.();
79
+ };
80
+ return (_jsx(InputBase, { ...inputBaseProps, ref: wrapperRef, error: hasError ? validation?.message || forceError : null, style: styles, rightIcon: TypeGuards.isComponentOrElement(inputBaseProps.rightIcon) ? inputBaseProps.rightIcon : {
81
+ name: 'plus',
82
+ disabled: disabled || incrementDisabled || !editable,
83
+ onPress: () => handleChange('increment'),
84
+ debounce: actionDebounce,
85
+ ...inputBaseProps.rightIcon,
86
+ }, leftIcon: TypeGuards.isComponentOrElement(inputBaseProps.leftIcon) ? inputBaseProps.leftIcon : {
87
+ name: 'minus',
88
+ disabled: disabled || decrementDisabled || !editable,
89
+ onPress: () => handleChange('decrement'),
90
+ debounce: actionDebounce,
91
+ ...inputBaseProps.leftIcon,
92
+ }, disabled: disabled, focused: isFocused, innerWrapper: Touchable, innerWrapperProps: {
93
+ ...(inputBaseProps.innerWrapperProps || {}),
94
+ rippleDisabled: true,
95
+ onPress: onPressInnerWrapper,
96
+ }, hasValue: hasValue, children: editable && !disabled ? (_jsx(InputElement, { keyboardType: 'numeric', textAlign: 'center', textAlignVertical: 'center', allowFontScaling: false, editable: !disabled, placeholderTextColor: partialStyles?.placeholder?.color, selectionColor: partialStyles?.selection?.color, ...textInputProps, onChangeText: handleChangeInput, value: isFormatted ? formatter(inputValue ?? min) : String(inputValue ?? min), onBlur: handleBlur, onFocus: handleFocus, style: [styles.input, partialStyles.input], ref: innerInputRef, ...maskingExtraProps, ...currencyExtraProps })) : (_jsx(Text, { text: isFormatted ? formatter(inputValue) : String(inputValue), style: [styles.input, partialStyles.input] })) }));
97
+ });
98
+ NumberIncrement.styleRegistryName = 'NumberIncrement';
99
+ NumberIncrement.elements = [...InputBase.elements, 'input', 'placeholder', 'selection'];
100
+ NumberIncrement.rootElement = 'wrapper';
101
+ NumberIncrement.withVariantTypes = (styles) => {
102
+ return NumberIncrement;
103
+ };
104
+ NumberIncrement.defaultProps = {
105
+ step: 1,
106
+ editable: true,
107
+ separator: null,
108
+ formatter: null,
109
+ parseValue: defaultParseValue,
110
+ delimiter: null,
111
+ mask: null,
112
+ masking: null,
113
+ timeoutActionFocus: 300,
114
+ actionPressAutoFocus: true,
115
+ actionDebounce: null,
116
+ min: 0,
117
+ max: MAX_VALID_DIGITS
118
+ };
119
+ MobileStyleRegistry.registerComponent(NumberIncrement);
120
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/NumberIncrement/index.tsx"],"names":[],"mappings":";AACA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eAA6F,CAAA;AACtG,CAAC,CAAA;AAED,eAAe,CAAC,YAAY,GAAG;IAC7B,IAAI,EAAE,CAAC;IACP,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,iBAAiB;IAC7B,SAAS,EAAE,IAAI;IACf,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,IAAI;IACb,kBAAkB,EAAE,GAAG;IACvB,oBAAoB,EAAE,IAAI;IAC1B,cAAc,EAAE,IAAI;IACpB,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,gBAAgB;CACW,CAAA;AAElC,mBAAmB,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/NumberIncrement/styles.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/NumberIncrement/types.ts"],"names":[],"mappings":""}