@webority-technologies/mobile 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (536) hide show
  1. package/README.md +399 -0
  2. package/lib/commonjs/api/publicClient.js +73 -0
  3. package/lib/commonjs/api/userClient.js +290 -0
  4. package/lib/commonjs/auth/authStore.js +107 -0
  5. package/lib/commonjs/auth/index.js +44 -0
  6. package/lib/commonjs/auth/jwt.js +84 -0
  7. package/lib/commonjs/components/Accordion/Accordion.js +257 -0
  8. package/lib/commonjs/components/Accordion/index.js +26 -0
  9. package/lib/commonjs/components/Avatar/Avatar.js +283 -0
  10. package/lib/commonjs/components/Avatar/index.js +26 -0
  11. package/lib/commonjs/components/Badge/Badge.js +212 -0
  12. package/lib/commonjs/components/Badge/index.js +20 -0
  13. package/lib/commonjs/components/Banner/Banner.js +276 -0
  14. package/lib/commonjs/components/Banner/index.js +20 -0
  15. package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +288 -0
  16. package/lib/commonjs/components/BottomNavigation/index.js +20 -0
  17. package/lib/commonjs/components/BottomSheet/BottomSheet.js +367 -0
  18. package/lib/commonjs/components/BottomSheet/index.js +20 -0
  19. package/lib/commonjs/components/Button/Button.js +281 -0
  20. package/lib/commonjs/components/Button/index.js +20 -0
  21. package/lib/commonjs/components/Card/Card.js +194 -0
  22. package/lib/commonjs/components/Card/index.js +20 -0
  23. package/lib/commonjs/components/Carousel/Carousel.js +475 -0
  24. package/lib/commonjs/components/Carousel/index.js +20 -0
  25. package/lib/commonjs/components/Checkbox/Checkbox.js +165 -0
  26. package/lib/commonjs/components/Checkbox/index.js +20 -0
  27. package/lib/commonjs/components/Chip/Chip.js +272 -0
  28. package/lib/commonjs/components/Chip/index.js +20 -0
  29. package/lib/commonjs/components/DatePicker/DatePicker.js +813 -0
  30. package/lib/commonjs/components/DatePicker/index.js +20 -0
  31. package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +622 -0
  32. package/lib/commonjs/components/DateRangePicker/index.js +20 -0
  33. package/lib/commonjs/components/Dialog/Dialog.js +215 -0
  34. package/lib/commonjs/components/Dialog/index.js +20 -0
  35. package/lib/commonjs/components/Divider/Divider.js +118 -0
  36. package/lib/commonjs/components/Divider/index.js +20 -0
  37. package/lib/commonjs/components/Drawer/Drawer.js +344 -0
  38. package/lib/commonjs/components/Drawer/index.js +20 -0
  39. package/lib/commonjs/components/EmptyState/EmptyState.js +201 -0
  40. package/lib/commonjs/components/EmptyState/index.js +20 -0
  41. package/lib/commonjs/components/FAB/FAB.js +457 -0
  42. package/lib/commonjs/components/FAB/index.js +26 -0
  43. package/lib/commonjs/components/Field/Field.js +127 -0
  44. package/lib/commonjs/components/Field/index.js +20 -0
  45. package/lib/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.js +81 -0
  46. package/lib/commonjs/components/ForceUpdateDialog/index.js +20 -0
  47. package/lib/commonjs/components/Header/Header.js +339 -0
  48. package/lib/commonjs/components/Header/index.js +20 -0
  49. package/lib/commonjs/components/Icon/Icon.js +120 -0
  50. package/lib/commonjs/components/Icon/index.js +20 -0
  51. package/lib/commonjs/components/ImageGallery/ImageGallery.js +463 -0
  52. package/lib/commonjs/components/ImageGallery/index.js +20 -0
  53. package/lib/commonjs/components/Input/Input.js +390 -0
  54. package/lib/commonjs/components/Input/index.js +20 -0
  55. package/lib/commonjs/components/ListItem/ListItem.js +241 -0
  56. package/lib/commonjs/components/ListItem/index.js +20 -0
  57. package/lib/commonjs/components/LoadingSpinner/LoadingSpinner.js +183 -0
  58. package/lib/commonjs/components/LoadingSpinner/index.js +20 -0
  59. package/lib/commonjs/components/Modal/Modal.js +239 -0
  60. package/lib/commonjs/components/Modal/index.js +20 -0
  61. package/lib/commonjs/components/NumberInput/NumberInput.js +392 -0
  62. package/lib/commonjs/components/NumberInput/index.js +20 -0
  63. package/lib/commonjs/components/OTPInput/OTPInput.js +375 -0
  64. package/lib/commonjs/components/OTPInput/index.js +20 -0
  65. package/lib/commonjs/components/ProgressBar/ProgressBar.js +149 -0
  66. package/lib/commonjs/components/ProgressBar/index.js +20 -0
  67. package/lib/commonjs/components/Radio/Radio.js +160 -0
  68. package/lib/commonjs/components/Radio/RadioGroup.js +43 -0
  69. package/lib/commonjs/components/Radio/index.js +39 -0
  70. package/lib/commonjs/components/Rating/Rating.js +236 -0
  71. package/lib/commonjs/components/Rating/index.js +20 -0
  72. package/lib/commonjs/components/SearchBar/SearchBar.js +274 -0
  73. package/lib/commonjs/components/SearchBar/index.js +20 -0
  74. package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +184 -0
  75. package/lib/commonjs/components/SegmentedControl/index.js +20 -0
  76. package/lib/commonjs/components/Select/Select.js +540 -0
  77. package/lib/commonjs/components/Select/index.js +20 -0
  78. package/lib/commonjs/components/SkeletonLoader/SkeletonContent.js +191 -0
  79. package/lib/commonjs/components/SkeletonLoader/SkeletonLoader.js +311 -0
  80. package/lib/commonjs/components/SkeletonLoader/index.js +57 -0
  81. package/lib/commonjs/components/Slider/Slider.js +443 -0
  82. package/lib/commonjs/components/Slider/index.js +20 -0
  83. package/lib/commonjs/components/Stepper/Stepper.js +403 -0
  84. package/lib/commonjs/components/Stepper/index.js +20 -0
  85. package/lib/commonjs/components/Swipeable/Swipeable.js +349 -0
  86. package/lib/commonjs/components/Swipeable/index.js +20 -0
  87. package/lib/commonjs/components/Switch/Switch.js +173 -0
  88. package/lib/commonjs/components/Switch/index.js +20 -0
  89. package/lib/commonjs/components/Tabs/Tabs.js +204 -0
  90. package/lib/commonjs/components/Tabs/index.js +20 -0
  91. package/lib/commonjs/components/TimePicker/TimePicker.js +551 -0
  92. package/lib/commonjs/components/TimePicker/index.js +20 -0
  93. package/lib/commonjs/components/Toast/Toast.js +273 -0
  94. package/lib/commonjs/components/Toast/ToastProvider.js +195 -0
  95. package/lib/commonjs/components/Toast/index.js +39 -0
  96. package/lib/commonjs/components/Tooltip/Tooltip.js +363 -0
  97. package/lib/commonjs/components/Tooltip/index.js +20 -0
  98. package/lib/commonjs/components/index.js +392 -0
  99. package/lib/commonjs/config/index.js +63 -0
  100. package/lib/commonjs/formatters/currency.js +61 -0
  101. package/lib/commonjs/formatters/date.js +156 -0
  102. package/lib/commonjs/formatters/index.js +77 -0
  103. package/lib/commonjs/formatters/initials.js +28 -0
  104. package/lib/commonjs/formatters/number.js +76 -0
  105. package/lib/commonjs/formatters/phone.js +59 -0
  106. package/lib/commonjs/hooks/index.js +27 -0
  107. package/lib/commonjs/hooks/useDebounce.js +17 -0
  108. package/lib/commonjs/hooks/usePressAnimation.js +44 -0
  109. package/lib/commonjs/hooks/useToggle.js +22 -0
  110. package/lib/commonjs/index.js +628 -0
  111. package/lib/commonjs/initSDK.js +47 -0
  112. package/lib/commonjs/initUI.js +24 -0
  113. package/lib/commonjs/initUserAuth.js +40 -0
  114. package/lib/commonjs/logger/index.js +127 -0
  115. package/lib/commonjs/network/NetworkStatusBanner.js +89 -0
  116. package/lib/commonjs/network/index.js +32 -0
  117. package/lib/commonjs/network/networkStatus.js +88 -0
  118. package/lib/commonjs/package.json +1 -0
  119. package/lib/commonjs/permissions/index.js +180 -0
  120. package/lib/commonjs/storage/index.js +187 -0
  121. package/lib/commonjs/theme/ThemeContext.js +73 -0
  122. package/lib/commonjs/theme/index.js +93 -0
  123. package/lib/commonjs/theme/merge.js +30 -0
  124. package/lib/commonjs/theme/tokens.js +319 -0
  125. package/lib/commonjs/theme/types.js +6 -0
  126. package/lib/commonjs/types/vector-icons.d.js +2 -0
  127. package/lib/commonjs/utils/dimensions.js +31 -0
  128. package/lib/commonjs/utils/hapticUtils.js +57 -0
  129. package/lib/commonjs/utils/imageCompression.js +51 -0
  130. package/lib/commonjs/utils/index.js +83 -0
  131. package/lib/commonjs/utils/responsive.js +48 -0
  132. package/lib/commonjs/utils/shadows.js +12 -0
  133. package/lib/commonjs/utils/spacing.js +86 -0
  134. package/lib/commonjs/validators/index.js +165 -0
  135. package/lib/commonjs/versionCheck/index.js +338 -0
  136. package/lib/module/api/publicClient.js +69 -0
  137. package/lib/module/api/userClient.js +283 -0
  138. package/lib/module/auth/authStore.js +100 -0
  139. package/lib/module/auth/index.js +5 -0
  140. package/lib/module/auth/jwt.js +78 -0
  141. package/lib/module/components/Accordion/Accordion.js +251 -0
  142. package/lib/module/components/Accordion/index.js +4 -0
  143. package/lib/module/components/Avatar/Avatar.js +278 -0
  144. package/lib/module/components/Avatar/index.js +4 -0
  145. package/lib/module/components/Badge/Badge.js +208 -0
  146. package/lib/module/components/Badge/index.js +4 -0
  147. package/lib/module/components/Banner/Banner.js +272 -0
  148. package/lib/module/components/Banner/index.js +4 -0
  149. package/lib/module/components/BottomNavigation/BottomNavigation.js +284 -0
  150. package/lib/module/components/BottomNavigation/index.js +4 -0
  151. package/lib/module/components/BottomSheet/BottomSheet.js +363 -0
  152. package/lib/module/components/BottomSheet/index.js +4 -0
  153. package/lib/module/components/Button/Button.js +277 -0
  154. package/lib/module/components/Button/index.js +4 -0
  155. package/lib/module/components/Card/Card.js +190 -0
  156. package/lib/module/components/Card/index.js +4 -0
  157. package/lib/module/components/Carousel/Carousel.js +471 -0
  158. package/lib/module/components/Carousel/index.js +4 -0
  159. package/lib/module/components/Checkbox/Checkbox.js +161 -0
  160. package/lib/module/components/Checkbox/index.js +4 -0
  161. package/lib/module/components/Chip/Chip.js +268 -0
  162. package/lib/module/components/Chip/index.js +4 -0
  163. package/lib/module/components/DatePicker/DatePicker.js +808 -0
  164. package/lib/module/components/DatePicker/index.js +4 -0
  165. package/lib/module/components/DateRangePicker/DateRangePicker.js +618 -0
  166. package/lib/module/components/DateRangePicker/index.js +4 -0
  167. package/lib/module/components/Dialog/Dialog.js +210 -0
  168. package/lib/module/components/Dialog/index.js +4 -0
  169. package/lib/module/components/Divider/Divider.js +114 -0
  170. package/lib/module/components/Divider/index.js +4 -0
  171. package/lib/module/components/Drawer/Drawer.js +340 -0
  172. package/lib/module/components/Drawer/index.js +4 -0
  173. package/lib/module/components/EmptyState/EmptyState.js +197 -0
  174. package/lib/module/components/EmptyState/index.js +4 -0
  175. package/lib/module/components/FAB/FAB.js +452 -0
  176. package/lib/module/components/FAB/index.js +4 -0
  177. package/lib/module/components/Field/Field.js +123 -0
  178. package/lib/module/components/Field/index.js +4 -0
  179. package/lib/module/components/ForceUpdateDialog/ForceUpdateDialog.js +75 -0
  180. package/lib/module/components/ForceUpdateDialog/index.js +4 -0
  181. package/lib/module/components/Header/Header.js +335 -0
  182. package/lib/module/components/Header/index.js +4 -0
  183. package/lib/module/components/Icon/Icon.js +111 -0
  184. package/lib/module/components/Icon/index.js +4 -0
  185. package/lib/module/components/ImageGallery/ImageGallery.js +458 -0
  186. package/lib/module/components/ImageGallery/index.js +4 -0
  187. package/lib/module/components/Input/Input.js +384 -0
  188. package/lib/module/components/Input/index.js +4 -0
  189. package/lib/module/components/ListItem/ListItem.js +237 -0
  190. package/lib/module/components/ListItem/index.js +4 -0
  191. package/lib/module/components/LoadingSpinner/LoadingSpinner.js +179 -0
  192. package/lib/module/components/LoadingSpinner/index.js +4 -0
  193. package/lib/module/components/Modal/Modal.js +235 -0
  194. package/lib/module/components/Modal/index.js +4 -0
  195. package/lib/module/components/NumberInput/NumberInput.js +388 -0
  196. package/lib/module/components/NumberInput/index.js +4 -0
  197. package/lib/module/components/OTPInput/OTPInput.js +371 -0
  198. package/lib/module/components/OTPInput/index.js +4 -0
  199. package/lib/module/components/ProgressBar/ProgressBar.js +145 -0
  200. package/lib/module/components/ProgressBar/index.js +4 -0
  201. package/lib/module/components/Radio/Radio.js +155 -0
  202. package/lib/module/components/Radio/RadioGroup.js +38 -0
  203. package/lib/module/components/Radio/index.js +5 -0
  204. package/lib/module/components/Rating/Rating.js +232 -0
  205. package/lib/module/components/Rating/index.js +4 -0
  206. package/lib/module/components/SearchBar/SearchBar.js +270 -0
  207. package/lib/module/components/SearchBar/index.js +4 -0
  208. package/lib/module/components/SegmentedControl/SegmentedControl.js +180 -0
  209. package/lib/module/components/SegmentedControl/index.js +4 -0
  210. package/lib/module/components/Select/Select.js +536 -0
  211. package/lib/module/components/Select/index.js +4 -0
  212. package/lib/module/components/SkeletonLoader/SkeletonContent.js +186 -0
  213. package/lib/module/components/SkeletonLoader/SkeletonLoader.js +301 -0
  214. package/lib/module/components/SkeletonLoader/index.js +5 -0
  215. package/lib/module/components/Slider/Slider.js +439 -0
  216. package/lib/module/components/Slider/index.js +4 -0
  217. package/lib/module/components/Stepper/Stepper.js +399 -0
  218. package/lib/module/components/Stepper/index.js +4 -0
  219. package/lib/module/components/Swipeable/Swipeable.js +344 -0
  220. package/lib/module/components/Swipeable/index.js +4 -0
  221. package/lib/module/components/Switch/Switch.js +169 -0
  222. package/lib/module/components/Switch/index.js +4 -0
  223. package/lib/module/components/Tabs/Tabs.js +200 -0
  224. package/lib/module/components/Tabs/index.js +4 -0
  225. package/lib/module/components/TimePicker/TimePicker.js +545 -0
  226. package/lib/module/components/TimePicker/index.js +4 -0
  227. package/lib/module/components/Toast/Toast.js +268 -0
  228. package/lib/module/components/Toast/ToastProvider.js +187 -0
  229. package/lib/module/components/Toast/index.js +5 -0
  230. package/lib/module/components/Tooltip/Tooltip.js +358 -0
  231. package/lib/module/components/Tooltip/index.js +4 -0
  232. package/lib/module/components/index.js +47 -0
  233. package/lib/module/config/index.js +55 -0
  234. package/lib/module/formatters/currency.js +56 -0
  235. package/lib/module/formatters/date.js +148 -0
  236. package/lib/module/formatters/index.js +8 -0
  237. package/lib/module/formatters/initials.js +23 -0
  238. package/lib/module/formatters/number.js +69 -0
  239. package/lib/module/formatters/phone.js +53 -0
  240. package/lib/module/hooks/index.js +6 -0
  241. package/lib/module/hooks/useDebounce.js +12 -0
  242. package/lib/module/hooks/usePressAnimation.js +39 -0
  243. package/lib/module/hooks/useToggle.js +17 -0
  244. package/lib/module/index.js +37 -0
  245. package/lib/module/initSDK.js +42 -0
  246. package/lib/module/initUI.js +19 -0
  247. package/lib/module/initUserAuth.js +36 -0
  248. package/lib/module/logger/index.js +123 -0
  249. package/lib/module/network/NetworkStatusBanner.js +83 -0
  250. package/lib/module/network/index.js +5 -0
  251. package/lib/module/network/networkStatus.js +81 -0
  252. package/lib/module/package.json +1 -0
  253. package/lib/module/permissions/index.js +177 -0
  254. package/lib/module/storage/index.js +183 -0
  255. package/lib/module/theme/ThemeContext.js +65 -0
  256. package/lib/module/theme/index.js +48 -0
  257. package/lib/module/theme/merge.js +25 -0
  258. package/lib/module/theme/tokens.js +315 -0
  259. package/lib/module/theme/types.js +4 -0
  260. package/lib/module/types/vector-icons.d.js +2 -0
  261. package/lib/module/utils/dimensions.js +4 -0
  262. package/lib/module/utils/hapticUtils.js +51 -0
  263. package/lib/module/utils/imageCompression.js +46 -0
  264. package/lib/module/utils/index.js +8 -0
  265. package/lib/module/utils/responsive.js +42 -0
  266. package/lib/module/utils/shadows.js +7 -0
  267. package/lib/module/utils/spacing.js +82 -0
  268. package/lib/module/validators/index.js +143 -0
  269. package/lib/module/versionCheck/index.js +334 -0
  270. package/lib/typescript/commonjs/api/publicClient.d.ts +11 -0
  271. package/lib/typescript/commonjs/api/userClient.d.ts +18 -0
  272. package/lib/typescript/commonjs/auth/authStore.d.ts +20 -0
  273. package/lib/typescript/commonjs/auth/index.d.ts +5 -0
  274. package/lib/typescript/commonjs/auth/jwt.d.ts +31 -0
  275. package/lib/typescript/commonjs/components/Accordion/Accordion.d.ts +33 -0
  276. package/lib/typescript/commonjs/components/Accordion/index.d.ts +3 -0
  277. package/lib/typescript/commonjs/components/Avatar/Avatar.d.ts +42 -0
  278. package/lib/typescript/commonjs/components/Avatar/index.d.ts +3 -0
  279. package/lib/typescript/commonjs/components/Badge/Badge.d.ts +27 -0
  280. package/lib/typescript/commonjs/components/Badge/index.d.ts +3 -0
  281. package/lib/typescript/commonjs/components/Banner/Banner.d.ts +27 -0
  282. package/lib/typescript/commonjs/components/Banner/index.d.ts +3 -0
  283. package/lib/typescript/commonjs/components/BottomNavigation/BottomNavigation.d.ts +34 -0
  284. package/lib/typescript/commonjs/components/BottomNavigation/index.d.ts +3 -0
  285. package/lib/typescript/commonjs/components/BottomSheet/BottomSheet.d.ts +45 -0
  286. package/lib/typescript/commonjs/components/BottomSheet/index.d.ts +3 -0
  287. package/lib/typescript/commonjs/components/Button/Button.d.ts +29 -0
  288. package/lib/typescript/commonjs/components/Button/index.d.ts +3 -0
  289. package/lib/typescript/commonjs/components/Card/Card.d.ts +29 -0
  290. package/lib/typescript/commonjs/components/Card/index.d.ts +3 -0
  291. package/lib/typescript/commonjs/components/Carousel/Carousel.d.ts +66 -0
  292. package/lib/typescript/commonjs/components/Carousel/index.d.ts +3 -0
  293. package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +24 -0
  294. package/lib/typescript/commonjs/components/Checkbox/index.d.ts +3 -0
  295. package/lib/typescript/commonjs/components/Chip/Chip.d.ts +25 -0
  296. package/lib/typescript/commonjs/components/Chip/index.d.ts +3 -0
  297. package/lib/typescript/commonjs/components/DatePicker/DatePicker.d.ts +25 -0
  298. package/lib/typescript/commonjs/components/DatePicker/index.d.ts +3 -0
  299. package/lib/typescript/commonjs/components/DateRangePicker/DateRangePicker.d.ts +32 -0
  300. package/lib/typescript/commonjs/components/DateRangePicker/index.d.ts +3 -0
  301. package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +25 -0
  302. package/lib/typescript/commonjs/components/Dialog/index.d.ts +3 -0
  303. package/lib/typescript/commonjs/components/Divider/Divider.d.ts +21 -0
  304. package/lib/typescript/commonjs/components/Divider/index.d.ts +3 -0
  305. package/lib/typescript/commonjs/components/Drawer/Drawer.d.ts +53 -0
  306. package/lib/typescript/commonjs/components/Drawer/index.d.ts +3 -0
  307. package/lib/typescript/commonjs/components/EmptyState/EmptyState.d.ts +25 -0
  308. package/lib/typescript/commonjs/components/EmptyState/index.d.ts +3 -0
  309. package/lib/typescript/commonjs/components/FAB/FAB.d.ts +53 -0
  310. package/lib/typescript/commonjs/components/FAB/index.d.ts +3 -0
  311. package/lib/typescript/commonjs/components/Field/Field.d.ts +28 -0
  312. package/lib/typescript/commonjs/components/Field/index.d.ts +3 -0
  313. package/lib/typescript/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +39 -0
  314. package/lib/typescript/commonjs/components/ForceUpdateDialog/index.d.ts +3 -0
  315. package/lib/typescript/commonjs/components/Header/Header.d.ts +36 -0
  316. package/lib/typescript/commonjs/components/Header/index.d.ts +3 -0
  317. package/lib/typescript/commonjs/components/Icon/Icon.d.ts +20 -0
  318. package/lib/typescript/commonjs/components/Icon/index.d.ts +3 -0
  319. package/lib/typescript/commonjs/components/ImageGallery/ImageGallery.d.ts +41 -0
  320. package/lib/typescript/commonjs/components/ImageGallery/index.d.ts +3 -0
  321. package/lib/typescript/commonjs/components/Input/Input.d.ts +34 -0
  322. package/lib/typescript/commonjs/components/Input/index.d.ts +3 -0
  323. package/lib/typescript/commonjs/components/ListItem/ListItem.d.ts +30 -0
  324. package/lib/typescript/commonjs/components/ListItem/index.d.ts +4 -0
  325. package/lib/typescript/commonjs/components/LoadingSpinner/LoadingSpinner.d.ts +20 -0
  326. package/lib/typescript/commonjs/components/LoadingSpinner/index.d.ts +3 -0
  327. package/lib/typescript/commonjs/components/Modal/Modal.d.ts +29 -0
  328. package/lib/typescript/commonjs/components/Modal/index.d.ts +3 -0
  329. package/lib/typescript/commonjs/components/NumberInput/NumberInput.d.ts +35 -0
  330. package/lib/typescript/commonjs/components/NumberInput/index.d.ts +3 -0
  331. package/lib/typescript/commonjs/components/OTPInput/OTPInput.d.ts +29 -0
  332. package/lib/typescript/commonjs/components/OTPInput/index.d.ts +3 -0
  333. package/lib/typescript/commonjs/components/ProgressBar/ProgressBar.d.ts +21 -0
  334. package/lib/typescript/commonjs/components/ProgressBar/index.d.ts +3 -0
  335. package/lib/typescript/commonjs/components/Radio/Radio.d.ts +32 -0
  336. package/lib/typescript/commonjs/components/Radio/RadioGroup.d.ts +16 -0
  337. package/lib/typescript/commonjs/components/Radio/index.d.ts +5 -0
  338. package/lib/typescript/commonjs/components/Rating/Rating.d.ts +22 -0
  339. package/lib/typescript/commonjs/components/Rating/index.d.ts +3 -0
  340. package/lib/typescript/commonjs/components/SearchBar/SearchBar.d.ts +28 -0
  341. package/lib/typescript/commonjs/components/SearchBar/index.d.ts +3 -0
  342. package/lib/typescript/commonjs/components/SegmentedControl/SegmentedControl.d.ts +36 -0
  343. package/lib/typescript/commonjs/components/SegmentedControl/index.d.ts +3 -0
  344. package/lib/typescript/commonjs/components/Select/Select.d.ts +48 -0
  345. package/lib/typescript/commonjs/components/Select/index.d.ts +3 -0
  346. package/lib/typescript/commonjs/components/SkeletonLoader/SkeletonContent.d.ts +29 -0
  347. package/lib/typescript/commonjs/components/SkeletonLoader/SkeletonLoader.d.ts +42 -0
  348. package/lib/typescript/commonjs/components/SkeletonLoader/index.d.ts +5 -0
  349. package/lib/typescript/commonjs/components/Slider/Slider.d.ts +33 -0
  350. package/lib/typescript/commonjs/components/Slider/index.d.ts +3 -0
  351. package/lib/typescript/commonjs/components/Stepper/Stepper.d.ts +25 -0
  352. package/lib/typescript/commonjs/components/Stepper/index.d.ts +3 -0
  353. package/lib/typescript/commonjs/components/Swipeable/Swipeable.d.ts +45 -0
  354. package/lib/typescript/commonjs/components/Swipeable/index.d.ts +3 -0
  355. package/lib/typescript/commonjs/components/Switch/Switch.d.ts +24 -0
  356. package/lib/typescript/commonjs/components/Switch/index.d.ts +3 -0
  357. package/lib/typescript/commonjs/components/Tabs/Tabs.d.ts +37 -0
  358. package/lib/typescript/commonjs/components/Tabs/index.d.ts +3 -0
  359. package/lib/typescript/commonjs/components/TimePicker/TimePicker.d.ts +26 -0
  360. package/lib/typescript/commonjs/components/TimePicker/index.d.ts +3 -0
  361. package/lib/typescript/commonjs/components/Toast/Toast.d.ts +30 -0
  362. package/lib/typescript/commonjs/components/Toast/ToastProvider.d.ts +26 -0
  363. package/lib/typescript/commonjs/components/Toast/index.d.ts +5 -0
  364. package/lib/typescript/commonjs/components/Tooltip/Tooltip.d.ts +22 -0
  365. package/lib/typescript/commonjs/components/Tooltip/index.d.ts +3 -0
  366. package/lib/typescript/commonjs/components/index.d.ts +89 -0
  367. package/lib/typescript/commonjs/config/index.d.ts +40 -0
  368. package/lib/typescript/commonjs/formatters/currency.d.ts +24 -0
  369. package/lib/typescript/commonjs/formatters/date.d.ts +22 -0
  370. package/lib/typescript/commonjs/formatters/index.d.ts +8 -0
  371. package/lib/typescript/commonjs/formatters/initials.d.ts +11 -0
  372. package/lib/typescript/commonjs/formatters/number.d.ts +15 -0
  373. package/lib/typescript/commonjs/formatters/phone.d.ts +13 -0
  374. package/lib/typescript/commonjs/hooks/index.d.ts +6 -0
  375. package/lib/typescript/commonjs/hooks/useDebounce.d.ts +2 -0
  376. package/lib/typescript/commonjs/hooks/usePressAnimation.d.ts +14 -0
  377. package/lib/typescript/commonjs/hooks/useToggle.d.ts +9 -0
  378. package/lib/typescript/commonjs/index.d.ts +37 -0
  379. package/lib/typescript/commonjs/initSDK.d.ts +40 -0
  380. package/lib/typescript/commonjs/initUI.d.ts +12 -0
  381. package/lib/typescript/commonjs/initUserAuth.d.ts +22 -0
  382. package/lib/typescript/commonjs/logger/index.d.ts +42 -0
  383. package/lib/typescript/commonjs/network/NetworkStatusBanner.d.ts +19 -0
  384. package/lib/typescript/commonjs/network/index.d.ts +5 -0
  385. package/lib/typescript/commonjs/network/networkStatus.d.ts +27 -0
  386. package/lib/typescript/commonjs/package.json +1 -0
  387. package/lib/typescript/commonjs/permissions/index.d.ts +20 -0
  388. package/lib/typescript/commonjs/storage/index.d.ts +42 -0
  389. package/lib/typescript/commonjs/theme/ThemeContext.d.ts +18 -0
  390. package/lib/typescript/commonjs/theme/index.d.ts +13 -0
  391. package/lib/typescript/commonjs/theme/merge.d.ts +3 -0
  392. package/lib/typescript/commonjs/theme/tokens.d.ts +4 -0
  393. package/lib/typescript/commonjs/theme/types.d.ts +161 -0
  394. package/lib/typescript/commonjs/utils/dimensions.d.ts +3 -0
  395. package/lib/typescript/commonjs/utils/hapticUtils.d.ts +4 -0
  396. package/lib/typescript/commonjs/utils/imageCompression.d.ts +15 -0
  397. package/lib/typescript/commonjs/utils/index.d.ts +10 -0
  398. package/lib/typescript/commonjs/utils/responsive.d.ts +23 -0
  399. package/lib/typescript/commonjs/utils/shadows.d.ts +4 -0
  400. package/lib/typescript/commonjs/utils/spacing.d.ts +61 -0
  401. package/lib/typescript/commonjs/validators/index.d.ts +46 -0
  402. package/lib/typescript/commonjs/versionCheck/index.d.ts +59 -0
  403. package/lib/typescript/module/api/publicClient.d.ts +11 -0
  404. package/lib/typescript/module/api/userClient.d.ts +18 -0
  405. package/lib/typescript/module/auth/authStore.d.ts +20 -0
  406. package/lib/typescript/module/auth/index.d.ts +5 -0
  407. package/lib/typescript/module/auth/jwt.d.ts +31 -0
  408. package/lib/typescript/module/components/Accordion/Accordion.d.ts +33 -0
  409. package/lib/typescript/module/components/Accordion/index.d.ts +3 -0
  410. package/lib/typescript/module/components/Avatar/Avatar.d.ts +42 -0
  411. package/lib/typescript/module/components/Avatar/index.d.ts +3 -0
  412. package/lib/typescript/module/components/Badge/Badge.d.ts +27 -0
  413. package/lib/typescript/module/components/Badge/index.d.ts +3 -0
  414. package/lib/typescript/module/components/Banner/Banner.d.ts +27 -0
  415. package/lib/typescript/module/components/Banner/index.d.ts +3 -0
  416. package/lib/typescript/module/components/BottomNavigation/BottomNavigation.d.ts +34 -0
  417. package/lib/typescript/module/components/BottomNavigation/index.d.ts +3 -0
  418. package/lib/typescript/module/components/BottomSheet/BottomSheet.d.ts +45 -0
  419. package/lib/typescript/module/components/BottomSheet/index.d.ts +3 -0
  420. package/lib/typescript/module/components/Button/Button.d.ts +29 -0
  421. package/lib/typescript/module/components/Button/index.d.ts +3 -0
  422. package/lib/typescript/module/components/Card/Card.d.ts +29 -0
  423. package/lib/typescript/module/components/Card/index.d.ts +3 -0
  424. package/lib/typescript/module/components/Carousel/Carousel.d.ts +66 -0
  425. package/lib/typescript/module/components/Carousel/index.d.ts +3 -0
  426. package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +24 -0
  427. package/lib/typescript/module/components/Checkbox/index.d.ts +3 -0
  428. package/lib/typescript/module/components/Chip/Chip.d.ts +25 -0
  429. package/lib/typescript/module/components/Chip/index.d.ts +3 -0
  430. package/lib/typescript/module/components/DatePicker/DatePicker.d.ts +25 -0
  431. package/lib/typescript/module/components/DatePicker/index.d.ts +3 -0
  432. package/lib/typescript/module/components/DateRangePicker/DateRangePicker.d.ts +32 -0
  433. package/lib/typescript/module/components/DateRangePicker/index.d.ts +3 -0
  434. package/lib/typescript/module/components/Dialog/Dialog.d.ts +25 -0
  435. package/lib/typescript/module/components/Dialog/index.d.ts +3 -0
  436. package/lib/typescript/module/components/Divider/Divider.d.ts +21 -0
  437. package/lib/typescript/module/components/Divider/index.d.ts +3 -0
  438. package/lib/typescript/module/components/Drawer/Drawer.d.ts +53 -0
  439. package/lib/typescript/module/components/Drawer/index.d.ts +3 -0
  440. package/lib/typescript/module/components/EmptyState/EmptyState.d.ts +25 -0
  441. package/lib/typescript/module/components/EmptyState/index.d.ts +3 -0
  442. package/lib/typescript/module/components/FAB/FAB.d.ts +53 -0
  443. package/lib/typescript/module/components/FAB/index.d.ts +3 -0
  444. package/lib/typescript/module/components/Field/Field.d.ts +28 -0
  445. package/lib/typescript/module/components/Field/index.d.ts +3 -0
  446. package/lib/typescript/module/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +39 -0
  447. package/lib/typescript/module/components/ForceUpdateDialog/index.d.ts +3 -0
  448. package/lib/typescript/module/components/Header/Header.d.ts +36 -0
  449. package/lib/typescript/module/components/Header/index.d.ts +3 -0
  450. package/lib/typescript/module/components/Icon/Icon.d.ts +20 -0
  451. package/lib/typescript/module/components/Icon/index.d.ts +3 -0
  452. package/lib/typescript/module/components/ImageGallery/ImageGallery.d.ts +41 -0
  453. package/lib/typescript/module/components/ImageGallery/index.d.ts +3 -0
  454. package/lib/typescript/module/components/Input/Input.d.ts +34 -0
  455. package/lib/typescript/module/components/Input/index.d.ts +3 -0
  456. package/lib/typescript/module/components/ListItem/ListItem.d.ts +30 -0
  457. package/lib/typescript/module/components/ListItem/index.d.ts +4 -0
  458. package/lib/typescript/module/components/LoadingSpinner/LoadingSpinner.d.ts +20 -0
  459. package/lib/typescript/module/components/LoadingSpinner/index.d.ts +3 -0
  460. package/lib/typescript/module/components/Modal/Modal.d.ts +29 -0
  461. package/lib/typescript/module/components/Modal/index.d.ts +3 -0
  462. package/lib/typescript/module/components/NumberInput/NumberInput.d.ts +35 -0
  463. package/lib/typescript/module/components/NumberInput/index.d.ts +3 -0
  464. package/lib/typescript/module/components/OTPInput/OTPInput.d.ts +29 -0
  465. package/lib/typescript/module/components/OTPInput/index.d.ts +3 -0
  466. package/lib/typescript/module/components/ProgressBar/ProgressBar.d.ts +21 -0
  467. package/lib/typescript/module/components/ProgressBar/index.d.ts +3 -0
  468. package/lib/typescript/module/components/Radio/Radio.d.ts +32 -0
  469. package/lib/typescript/module/components/Radio/RadioGroup.d.ts +16 -0
  470. package/lib/typescript/module/components/Radio/index.d.ts +5 -0
  471. package/lib/typescript/module/components/Rating/Rating.d.ts +22 -0
  472. package/lib/typescript/module/components/Rating/index.d.ts +3 -0
  473. package/lib/typescript/module/components/SearchBar/SearchBar.d.ts +28 -0
  474. package/lib/typescript/module/components/SearchBar/index.d.ts +3 -0
  475. package/lib/typescript/module/components/SegmentedControl/SegmentedControl.d.ts +36 -0
  476. package/lib/typescript/module/components/SegmentedControl/index.d.ts +3 -0
  477. package/lib/typescript/module/components/Select/Select.d.ts +48 -0
  478. package/lib/typescript/module/components/Select/index.d.ts +3 -0
  479. package/lib/typescript/module/components/SkeletonLoader/SkeletonContent.d.ts +29 -0
  480. package/lib/typescript/module/components/SkeletonLoader/SkeletonLoader.d.ts +42 -0
  481. package/lib/typescript/module/components/SkeletonLoader/index.d.ts +5 -0
  482. package/lib/typescript/module/components/Slider/Slider.d.ts +33 -0
  483. package/lib/typescript/module/components/Slider/index.d.ts +3 -0
  484. package/lib/typescript/module/components/Stepper/Stepper.d.ts +25 -0
  485. package/lib/typescript/module/components/Stepper/index.d.ts +3 -0
  486. package/lib/typescript/module/components/Swipeable/Swipeable.d.ts +45 -0
  487. package/lib/typescript/module/components/Swipeable/index.d.ts +3 -0
  488. package/lib/typescript/module/components/Switch/Switch.d.ts +24 -0
  489. package/lib/typescript/module/components/Switch/index.d.ts +3 -0
  490. package/lib/typescript/module/components/Tabs/Tabs.d.ts +37 -0
  491. package/lib/typescript/module/components/Tabs/index.d.ts +3 -0
  492. package/lib/typescript/module/components/TimePicker/TimePicker.d.ts +26 -0
  493. package/lib/typescript/module/components/TimePicker/index.d.ts +3 -0
  494. package/lib/typescript/module/components/Toast/Toast.d.ts +30 -0
  495. package/lib/typescript/module/components/Toast/ToastProvider.d.ts +26 -0
  496. package/lib/typescript/module/components/Toast/index.d.ts +5 -0
  497. package/lib/typescript/module/components/Tooltip/Tooltip.d.ts +22 -0
  498. package/lib/typescript/module/components/Tooltip/index.d.ts +3 -0
  499. package/lib/typescript/module/components/index.d.ts +89 -0
  500. package/lib/typescript/module/config/index.d.ts +40 -0
  501. package/lib/typescript/module/formatters/currency.d.ts +24 -0
  502. package/lib/typescript/module/formatters/date.d.ts +22 -0
  503. package/lib/typescript/module/formatters/index.d.ts +8 -0
  504. package/lib/typescript/module/formatters/initials.d.ts +11 -0
  505. package/lib/typescript/module/formatters/number.d.ts +15 -0
  506. package/lib/typescript/module/formatters/phone.d.ts +13 -0
  507. package/lib/typescript/module/hooks/index.d.ts +6 -0
  508. package/lib/typescript/module/hooks/useDebounce.d.ts +2 -0
  509. package/lib/typescript/module/hooks/usePressAnimation.d.ts +14 -0
  510. package/lib/typescript/module/hooks/useToggle.d.ts +9 -0
  511. package/lib/typescript/module/index.d.ts +37 -0
  512. package/lib/typescript/module/initSDK.d.ts +40 -0
  513. package/lib/typescript/module/initUI.d.ts +12 -0
  514. package/lib/typescript/module/initUserAuth.d.ts +22 -0
  515. package/lib/typescript/module/logger/index.d.ts +42 -0
  516. package/lib/typescript/module/network/NetworkStatusBanner.d.ts +19 -0
  517. package/lib/typescript/module/network/index.d.ts +5 -0
  518. package/lib/typescript/module/network/networkStatus.d.ts +27 -0
  519. package/lib/typescript/module/package.json +1 -0
  520. package/lib/typescript/module/permissions/index.d.ts +20 -0
  521. package/lib/typescript/module/storage/index.d.ts +42 -0
  522. package/lib/typescript/module/theme/ThemeContext.d.ts +18 -0
  523. package/lib/typescript/module/theme/index.d.ts +13 -0
  524. package/lib/typescript/module/theme/merge.d.ts +3 -0
  525. package/lib/typescript/module/theme/tokens.d.ts +4 -0
  526. package/lib/typescript/module/theme/types.d.ts +161 -0
  527. package/lib/typescript/module/utils/dimensions.d.ts +3 -0
  528. package/lib/typescript/module/utils/hapticUtils.d.ts +4 -0
  529. package/lib/typescript/module/utils/imageCompression.d.ts +15 -0
  530. package/lib/typescript/module/utils/index.d.ts +10 -0
  531. package/lib/typescript/module/utils/responsive.d.ts +23 -0
  532. package/lib/typescript/module/utils/shadows.d.ts +4 -0
  533. package/lib/typescript/module/utils/spacing.d.ts +61 -0
  534. package/lib/typescript/module/validators/index.d.ts +46 -0
  535. package/lib/typescript/module/versionCheck/index.d.ts +59 -0
  536. package/package.json +137 -0
@@ -0,0 +1,358 @@
1
+ "use strict";
2
+
3
+ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
4
+ import { Animated, Dimensions, Modal, Pressable, StyleSheet, Text, View } from 'react-native';
5
+ import { useTheme } from "../../theme/index.js";
6
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
7
+ const TOOLTIP_GAP = 8;
8
+ const SCREEN_PADDING = 8;
9
+ const PRESS_AUTO_HIDE_MS = 4000;
10
+ const ARROW_HALF_WIDTH = 4; // half of 8px arrow base
11
+ const ARROW_HEIGHT = 6;
12
+ const ARROW_CORNER_PADDING = 12;
13
+ const Tooltip = props => {
14
+ const {
15
+ content,
16
+ children,
17
+ placement = 'auto',
18
+ trigger = 'longPress',
19
+ visible: controlledVisible,
20
+ onVisibleChange,
21
+ hideOnContentPress = true,
22
+ maxWidth = 240,
23
+ showArrow = true,
24
+ accessibilityLabel,
25
+ style,
26
+ testID
27
+ } = props;
28
+ const theme = useTheme();
29
+ const styles = useMemo(() => buildStyles(theme), [theme]);
30
+ const isControlled = trigger === 'manual' || typeof controlledVisible === 'boolean';
31
+ const [internalVisible, setInternalVisible] = useState(false);
32
+ const visible = isControlled ? Boolean(controlledVisible) : internalVisible;
33
+ const [anchor, setAnchor] = useState(null);
34
+ const [size, setSize] = useState({
35
+ width: 0,
36
+ height: 0
37
+ });
38
+ const wrapperRef = useRef(null);
39
+ const scale = useRef(new Animated.Value(visible ? 1 : 0.85)).current;
40
+ const opacity = useRef(new Animated.Value(visible ? 1 : 0)).current;
41
+ const autoHideTimer = useRef(null);
42
+ const didMount = useRef(false);
43
+ const setVisible = useCallback(next => {
44
+ if (!isControlled) setInternalVisible(next);
45
+ onVisibleChange?.(next);
46
+ }, [isControlled, onVisibleChange]);
47
+ const measureAnchor = useCallback(() => {
48
+ if (!wrapperRef.current) return;
49
+ wrapperRef.current.measureInWindow((x, y, width, height) => {
50
+ setAnchor({
51
+ x,
52
+ y,
53
+ width,
54
+ height
55
+ });
56
+ });
57
+ }, []);
58
+ const handleTrigger = useCallback(_event => {
59
+ if (trigger === 'manual') return;
60
+ measureAnchor();
61
+ setVisible(true);
62
+ }, [trigger, measureAnchor, setVisible]);
63
+ const handleHide = useCallback(() => {
64
+ setVisible(false);
65
+ }, [setVisible]);
66
+
67
+ // Animations + auto-hide
68
+ useEffect(() => {
69
+ // On first mount, skip the entry animation if we're already visible
70
+ // (avoids native-driver bootstrap issues during render).
71
+ if (!didMount.current) {
72
+ didMount.current = true;
73
+ if (visible) {
74
+ measureAnchor();
75
+ if (trigger === 'press') {
76
+ if (autoHideTimer.current) clearTimeout(autoHideTimer.current);
77
+ autoHideTimer.current = setTimeout(() => {
78
+ handleHide();
79
+ }, PRESS_AUTO_HIDE_MS);
80
+ }
81
+ }
82
+ return () => {
83
+ if (autoHideTimer.current) {
84
+ clearTimeout(autoHideTimer.current);
85
+ autoHideTimer.current = null;
86
+ }
87
+ };
88
+ }
89
+ if (visible) {
90
+ measureAnchor();
91
+ Animated.parallel([Animated.spring(scale, {
92
+ toValue: 1,
93
+ damping: theme.motion.spring.snappy.damping,
94
+ stiffness: theme.motion.spring.snappy.stiffness,
95
+ mass: theme.motion.spring.snappy.mass,
96
+ useNativeDriver: true
97
+ }), Animated.timing(opacity, {
98
+ toValue: 1,
99
+ duration: theme.motion.duration.fast,
100
+ useNativeDriver: true
101
+ })]).start();
102
+ if (trigger === 'press') {
103
+ if (autoHideTimer.current) clearTimeout(autoHideTimer.current);
104
+ autoHideTimer.current = setTimeout(() => {
105
+ handleHide();
106
+ }, PRESS_AUTO_HIDE_MS);
107
+ }
108
+ } else {
109
+ Animated.parallel([Animated.timing(scale, {
110
+ toValue: 0.85,
111
+ duration: 150,
112
+ useNativeDriver: true
113
+ }), Animated.timing(opacity, {
114
+ toValue: 0,
115
+ duration: 150,
116
+ useNativeDriver: true
117
+ })]).start();
118
+ if (autoHideTimer.current) {
119
+ clearTimeout(autoHideTimer.current);
120
+ autoHideTimer.current = null;
121
+ }
122
+ }
123
+ return () => {
124
+ if (autoHideTimer.current) {
125
+ clearTimeout(autoHideTimer.current);
126
+ autoHideTimer.current = null;
127
+ }
128
+ };
129
+ // eslint-disable-next-line react-hooks/exhaustive-deps
130
+ }, [visible]);
131
+ const handleContentLayout = e => {
132
+ const {
133
+ width,
134
+ height
135
+ } = e.nativeEvent.layout;
136
+ if (width !== size.width || height !== size.height) {
137
+ setSize({
138
+ width,
139
+ height
140
+ });
141
+ }
142
+ };
143
+ const position = useMemo(() => {
144
+ const screen = Dimensions.get('window');
145
+ if (!anchor) {
146
+ // Fallback before measurement: render off-screen-ish at top-left, will reposition on layout.
147
+ return {
148
+ top: SCREEN_PADDING,
149
+ left: SCREEN_PADDING,
150
+ placement: 'bottom',
151
+ arrowOffset: 0
152
+ };
153
+ }
154
+ const tooltipWidth = size.width || Math.min(maxWidth, screen.width - SCREEN_PADDING * 2);
155
+ const tooltipHeight = size.height || 0;
156
+
157
+ // Choose placement.
158
+ let resolved;
159
+ if (placement === 'auto') {
160
+ const space = {
161
+ top: anchor.y,
162
+ bottom: screen.height - (anchor.y + anchor.height),
163
+ left: anchor.x,
164
+ right: screen.width - (anchor.x + anchor.width)
165
+ };
166
+ const max = Math.max(space.top, space.bottom, space.left, space.right);
167
+ if (max === space.bottom) resolved = 'bottom';else if (max === space.top) resolved = 'top';else if (max === space.right) resolved = 'right';else resolved = 'left';
168
+ } else {
169
+ resolved = placement;
170
+ }
171
+ let top = 0;
172
+ let left = 0;
173
+ if (resolved === 'top') {
174
+ top = anchor.y - tooltipHeight - TOOLTIP_GAP;
175
+ left = anchor.x + anchor.width / 2 - tooltipWidth / 2;
176
+ } else if (resolved === 'bottom') {
177
+ top = anchor.y + anchor.height + TOOLTIP_GAP;
178
+ left = anchor.x + anchor.width / 2 - tooltipWidth / 2;
179
+ } else if (resolved === 'left') {
180
+ top = anchor.y + anchor.height / 2 - tooltipHeight / 2;
181
+ left = anchor.x - tooltipWidth - TOOLTIP_GAP;
182
+ } else {
183
+ top = anchor.y + anchor.height / 2 - tooltipHeight / 2;
184
+ left = anchor.x + anchor.width + TOOLTIP_GAP;
185
+ }
186
+
187
+ // Clamp to screen.
188
+ left = Math.max(SCREEN_PADDING, Math.min(left, screen.width - tooltipWidth - SCREEN_PADDING));
189
+ top = Math.max(SCREEN_PADDING, Math.min(top, screen.height - tooltipHeight - SCREEN_PADDING));
190
+
191
+ // Compute arrow offset along the card's trigger-facing edge so the caret stays
192
+ // pointing at the trigger even after the card is clamped to the viewport.
193
+ let arrowOffset = 0;
194
+ if (resolved === 'top' || resolved === 'bottom') {
195
+ const triggerCenterX = anchor.x + anchor.width / 2;
196
+ const desired = triggerCenterX - left; // x-offset from card's left edge
197
+ const min = ARROW_CORNER_PADDING;
198
+ const max = Math.max(min, tooltipWidth - ARROW_CORNER_PADDING);
199
+ arrowOffset = Math.max(min, Math.min(desired, max));
200
+ } else {
201
+ const triggerCenterY = anchor.y + anchor.height / 2;
202
+ const desired = triggerCenterY - top;
203
+ const min = ARROW_CORNER_PADDING;
204
+ const max = Math.max(min, tooltipHeight - ARROW_CORNER_PADDING);
205
+ arrowOffset = Math.max(min, Math.min(desired, max));
206
+ }
207
+ return {
208
+ top,
209
+ left,
210
+ placement: resolved,
211
+ arrowOffset
212
+ };
213
+ }, [anchor, size, placement, maxWidth]);
214
+
215
+ // Build the cloned trigger.
216
+ const triggerProps = {};
217
+ if (trigger === 'longPress') {
218
+ triggerProps.onLongPress = handleTrigger;
219
+ triggerProps.accessibilityHint = 'Long press for more info';
220
+ } else if (trigger === 'press') {
221
+ const childOnPress = children.props.onPress;
222
+ triggerProps.onPress = e => {
223
+ childOnPress?.(e);
224
+ handleTrigger(e);
225
+ };
226
+ }
227
+ const clonedChild = /*#__PURE__*/React.cloneElement(children, triggerProps);
228
+ const a11yLabel = accessibilityLabel ?? (typeof content === 'string' ? content : 'Tooltip');
229
+
230
+ // Arrow style: a CSS-triangle implemented via 0-width view with transparent
231
+ // borders. We rotate the base (placement='top' = arrow on bottom-edge pointing
232
+ // down) into the four cardinal orientations.
233
+ const arrowStyle = useMemo(() => {
234
+ if (!showArrow) return null;
235
+ const arrowColor = theme.colors.background.inverse;
236
+ const base = {
237
+ position: 'absolute',
238
+ width: 0,
239
+ height: 0,
240
+ backgroundColor: 'transparent',
241
+ borderStyle: 'solid',
242
+ borderLeftWidth: ARROW_HALF_WIDTH,
243
+ borderRightWidth: ARROW_HALF_WIDTH,
244
+ borderBottomWidth: ARROW_HEIGHT,
245
+ borderTopWidth: 0,
246
+ borderLeftColor: 'transparent',
247
+ borderRightColor: 'transparent',
248
+ borderTopColor: 'transparent',
249
+ borderBottomColor: arrowColor
250
+ };
251
+ if (position.placement === 'top') {
252
+ // Card is above trigger; arrow on bottom edge, pointing down.
253
+ return {
254
+ ...base,
255
+ bottom: -ARROW_HEIGHT,
256
+ left: position.arrowOffset - ARROW_HALF_WIDTH,
257
+ transform: [{
258
+ rotate: '180deg'
259
+ }]
260
+ };
261
+ }
262
+ if (position.placement === 'bottom') {
263
+ // Card below trigger; arrow on top edge, pointing up.
264
+ return {
265
+ ...base,
266
+ top: -ARROW_HEIGHT,
267
+ left: position.arrowOffset - ARROW_HALF_WIDTH
268
+ };
269
+ }
270
+ if (position.placement === 'left') {
271
+ // Card left of trigger; arrow on right edge, pointing right.
272
+ return {
273
+ ...base,
274
+ right: -ARROW_HEIGHT,
275
+ top: position.arrowOffset - ARROW_HALF_WIDTH,
276
+ transform: [{
277
+ rotate: '90deg'
278
+ }]
279
+ };
280
+ }
281
+ // 'right': card right of trigger; arrow on left edge, pointing left.
282
+ return {
283
+ ...base,
284
+ left: -ARROW_HEIGHT,
285
+ top: position.arrowOffset - ARROW_HALF_WIDTH,
286
+ transform: [{
287
+ rotate: '-90deg'
288
+ }]
289
+ };
290
+ }, [showArrow, position, theme]);
291
+ return /*#__PURE__*/_jsxs(_Fragment, {
292
+ children: [/*#__PURE__*/_jsx(View, {
293
+ ref: wrapperRef,
294
+ collapsable: false,
295
+ onLayout: measureAnchor,
296
+ testID: testID,
297
+ children: clonedChild
298
+ }), /*#__PURE__*/_jsx(Modal, {
299
+ visible: visible,
300
+ transparent: true,
301
+ statusBarTranslucent: true,
302
+ presentationStyle: "overFullScreen",
303
+ animationType: "none",
304
+ onRequestClose: handleHide,
305
+ children: /*#__PURE__*/_jsx(Pressable, {
306
+ style: StyleSheet.absoluteFill,
307
+ onPress: hideOnContentPress ? handleHide : undefined,
308
+ accessibilityLabel: "Close tooltip",
309
+ accessibilityRole: "button",
310
+ children: visible ? /*#__PURE__*/_jsxs(Animated.View, {
311
+ accessibilityRole: 'tooltip',
312
+ accessibilityLiveRegion: "polite",
313
+ accessibilityLabel: a11yLabel,
314
+ onLayout: handleContentLayout,
315
+ style: [{
316
+ position: 'absolute',
317
+ top: position.top,
318
+ left: position.left,
319
+ maxWidth,
320
+ opacity,
321
+ transform: [{
322
+ scale
323
+ }]
324
+ }, style],
325
+ children: [/*#__PURE__*/_jsx(View, {
326
+ style: [styles.tooltip, {
327
+ backgroundColor: theme.colors.background.inverse,
328
+ borderRadius: theme.radius.md,
329
+ paddingHorizontal: theme.spacing.md,
330
+ paddingVertical: theme.spacing.sm,
331
+ ...theme.shadows.lg,
332
+ shadowColor: theme.shadows.lg.shadowColor
333
+ }],
334
+ children: typeof content === 'string' ? /*#__PURE__*/_jsx(Text, {
335
+ style: {
336
+ color: theme.colors.text.inverse,
337
+ fontSize: theme.typography.fontSize.sm,
338
+ lineHeight: 18
339
+ },
340
+ children: content
341
+ }) : content
342
+ }), arrowStyle ? /*#__PURE__*/_jsx(View, {
343
+ style: arrowStyle,
344
+ pointerEvents: "none"
345
+ }) : null]
346
+ }) : null
347
+ })
348
+ })]
349
+ });
350
+ };
351
+ const buildStyles = _theme => StyleSheet.create({
352
+ tooltip: {
353
+ overflow: 'hidden'
354
+ }
355
+ });
356
+ export { Tooltip };
357
+ export default Tooltip;
358
+ //# sourceMappingURL=Tooltip.js.map
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export { Tooltip, default } from "./Tooltip.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ export { Accordion, AccordionGroup } from "./Accordion/index.js";
4
+ export { Avatar, AvatarGroup } from "./Avatar/index.js";
5
+ export { Badge } from "./Badge/index.js";
6
+ export { Banner } from "./Banner/index.js";
7
+ export { BottomNavigation } from "./BottomNavigation/index.js";
8
+ export { BottomSheet } from "./BottomSheet/index.js";
9
+ export { Button } from "./Button/index.js";
10
+ export { Card } from "./Card/index.js";
11
+ export { Carousel } from "./Carousel/index.js";
12
+ export { Checkbox } from "./Checkbox/index.js";
13
+ export { Chip } from "./Chip/index.js";
14
+ export { DatePicker } from "./DatePicker/index.js";
15
+ export { DateRangePicker } from "./DateRangePicker/index.js";
16
+ export { Dialog } from "./Dialog/index.js";
17
+ export { Divider } from "./Divider/index.js";
18
+ export { Drawer } from "./Drawer/index.js";
19
+ export { EmptyState } from "./EmptyState/index.js";
20
+ export { Field } from "./Field/index.js";
21
+ export { FAB, FABGroup } from "./FAB/index.js";
22
+ export { ForceUpdateDialog } from "./ForceUpdateDialog/index.js";
23
+ export { Header } from "./Header/index.js";
24
+ export { Icon } from "./Icon/index.js";
25
+ export { ImageGallery } from "./ImageGallery/index.js";
26
+ export { Input } from "./Input/index.js";
27
+ export { ListItem } from "./ListItem/index.js";
28
+ export { LoadingSpinner } from "./LoadingSpinner/index.js";
29
+ export { Modal } from "./Modal/index.js";
30
+ export { NumberInput } from "./NumberInput/index.js";
31
+ export { OTPInput } from "./OTPInput/index.js";
32
+ export { ProgressBar } from "./ProgressBar/index.js";
33
+ export { Radio, RadioGroup } from "./Radio/index.js";
34
+ export { Rating } from "./Rating/index.js";
35
+ export { SearchBar } from "./SearchBar/index.js";
36
+ export { SegmentedControl } from "./SegmentedControl/index.js";
37
+ export { Select } from "./Select/index.js";
38
+ export { Stepper } from "./Stepper/index.js";
39
+ export { Skeleton, SkeletonAvatar, SkeletonCard, SkeletonCircle, SkeletonContent, SkeletonListItem, SkeletonText } from "./SkeletonLoader/index.js";
40
+ export { Slider } from "./Slider/index.js";
41
+ export { Swipeable } from "./Swipeable/index.js";
42
+ export { Switch } from "./Switch/index.js";
43
+ export { Tabs } from "./Tabs/index.js";
44
+ export { TimePicker } from "./TimePicker/index.js";
45
+ export { Toast, ToastProvider, useToast, toast } from "./Toast/index.js";
46
+ export { Tooltip } from "./Tooltip/index.js";
47
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Configuration management for Webority packages
5
+ * Provides a flexible way to inject configuration without hard dependencies
6
+ */
7
+
8
+ const DEFAULT_CONFIG = {
9
+ baseUrl: null,
10
+ loggingEnabled: true,
11
+ logLevel: 'info',
12
+ environment: 'Development',
13
+ country: 'in'
14
+ };
15
+ let globalConfig = {
16
+ ...DEFAULT_CONFIG
17
+ };
18
+
19
+ /**
20
+ * Set global configuration for all Webority packages
21
+ */
22
+ export const setConfig = config => {
23
+ globalConfig = {
24
+ ...globalConfig,
25
+ ...config
26
+ };
27
+ };
28
+
29
+ /**
30
+ * Get current configuration
31
+ */
32
+ export const getConfig = () => globalConfig;
33
+
34
+ /**
35
+ * Get a specific config value with optional fallback.
36
+ * If the stored value is `null`, the fallback is returned (when provided).
37
+ */
38
+
39
+ export function getConfigValue(key, fallback) {
40
+ const value = globalConfig[key];
41
+ if (value !== null) {
42
+ return value;
43
+ }
44
+ return fallback;
45
+ }
46
+
47
+ /**
48
+ * Reset configuration to defaults
49
+ */
50
+ export const resetConfig = () => {
51
+ globalConfig = {
52
+ ...DEFAULT_CONFIG
53
+ };
54
+ };
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ const hasIntlNumber = () => typeof Intl !== 'undefined' && typeof Intl.NumberFormat === 'function';
4
+ const indianGroupingFallback = (n, fractionDigits) => {
5
+ // Indian numbering: 1,23,45,678.90 (last 3 digits, then groups of 2).
6
+ const sign = n < 0 ? '-' : '';
7
+ const abs = Math.abs(n);
8
+ const fixed = abs.toFixed(fractionDigits);
9
+ const [intPart, decPart] = fixed.split('.');
10
+ const last3 = intPart.length > 3 ? intPart.slice(-3) : intPart;
11
+ const rest = intPart.length > 3 ? intPart.slice(0, -3) : '';
12
+ const grouped = rest ? rest.replace(/\B(?=(\d{2})+(?!\d))/g, ',') + ',' + last3 : last3;
13
+ return sign + grouped + (decPart ? `.${decPart}` : '');
14
+ };
15
+
16
+ /**
17
+ * Format an amount as currency. Defaults to **INR** with Indian numbering (`en-IN`),
18
+ * which matches the standard convention across Webority projects.
19
+ *
20
+ * @example
21
+ * formatCurrency(150000) // ₹1,50,000
22
+ * formatCurrency(1234.5) // ₹1,234.50
23
+ * formatCurrency(99, { currency: 'USD', locale: 'en-US' }) // $99.00
24
+ * formatCurrency(150000, { stripSymbol: true }) // 1,50,000
25
+ */
26
+ export const formatCurrency = (amount, options = {}) => {
27
+ if (amount == null || Number.isNaN(amount)) return '';
28
+ const {
29
+ currency = 'INR',
30
+ locale = 'en-IN',
31
+ minimumFractionDigits,
32
+ maximumFractionDigits = 2,
33
+ stripSymbol = false
34
+ } = options;
35
+ const minFrac = minimumFractionDigits ?? (Number.isInteger(amount) ? 0 : 2);
36
+ if (hasIntlNumber()) {
37
+ try {
38
+ const formatted = new Intl.NumberFormat(locale, {
39
+ style: 'currency',
40
+ currency,
41
+ minimumFractionDigits: minFrac,
42
+ maximumFractionDigits
43
+ }).format(amount);
44
+ if (!stripSymbol) return formatted;
45
+ // Strip currency code/symbol while keeping digits, separators and sign.
46
+ return formatted.replace(/[^\d,.\s\-+]/g, '').trim();
47
+ } catch {
48
+ /* fall through to fallback */
49
+ }
50
+ }
51
+ const numeric = indianGroupingFallback(amount, minFrac);
52
+ if (stripSymbol) return numeric;
53
+ if (currency === 'INR') return `₹${numeric}`;
54
+ return `${currency} ${numeric}`;
55
+ };
56
+ //# sourceMappingURL=currency.js.map
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+
3
+ const toDate = value => {
4
+ if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : value;
5
+ const d = new Date(value);
6
+ return Number.isNaN(d.getTime()) ? null : d;
7
+ };
8
+ const hasIntl = () => typeof Intl !== 'undefined' && typeof Intl.DateTimeFormat === 'function';
9
+ const PAD = n => n < 10 ? `0${n}` : `${n}`;
10
+ const fallbackDate = (d, style) => {
11
+ const day = PAD(d.getDate());
12
+ const monthShort = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][d.getMonth()];
13
+ const monthLong = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'][d.getMonth()];
14
+ const year = d.getFullYear();
15
+ const weekdayLong = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][d.getDay()];
16
+ switch (style) {
17
+ case 'short':
18
+ return `${day}/${PAD(d.getMonth() + 1)}/${year}`;
19
+ case 'long':
20
+ return `${day} ${monthLong} ${year}`;
21
+ case 'full':
22
+ return `${weekdayLong}, ${day} ${monthLong} ${year}`;
23
+ case 'medium':
24
+ default:
25
+ return `${day} ${monthShort} ${year}`;
26
+ }
27
+ };
28
+ const fallbackTime = (d, style) => {
29
+ const hh = PAD(d.getHours());
30
+ const mm = PAD(d.getMinutes());
31
+ if (style === 'short') return `${hh}:${mm}`;
32
+ const ss = PAD(d.getSeconds());
33
+ return `${hh}:${mm}:${ss}`;
34
+ };
35
+
36
+ /**
37
+ * Locale-aware date formatter. Defaults to `'medium'` style and `'en-IN'` locale,
38
+ * matching the Indian-locale convention used across Webority apps.
39
+ */
40
+ export const formatDate = (value, style = 'medium', locale = 'en-IN') => {
41
+ const d = toDate(value);
42
+ if (!d) return '';
43
+ if (hasIntl()) {
44
+ try {
45
+ return new Intl.DateTimeFormat(locale, {
46
+ dateStyle: style
47
+ }).format(d);
48
+ } catch {
49
+ /* fall through to fallback */
50
+ }
51
+ }
52
+ return fallbackDate(d, style);
53
+ };
54
+
55
+ /**
56
+ * Locale-aware time formatter (24-hour fallback when Intl is unavailable).
57
+ */
58
+ export const formatTime = (value, style = 'short', locale = 'en-IN') => {
59
+ const d = toDate(value);
60
+ if (!d) return '';
61
+ if (hasIntl()) {
62
+ try {
63
+ return new Intl.DateTimeFormat(locale, {
64
+ timeStyle: style
65
+ }).format(d);
66
+ } catch {
67
+ /* fall through */
68
+ }
69
+ }
70
+ return fallbackTime(d, style);
71
+ };
72
+
73
+ /**
74
+ * Combined date + time formatter.
75
+ */
76
+ export const formatDateTime = (value, dateStyle = 'medium', timeStyle = 'short', locale = 'en-IN') => {
77
+ const d = toDate(value);
78
+ if (!d) return '';
79
+ if (hasIntl()) {
80
+ try {
81
+ return new Intl.DateTimeFormat(locale, {
82
+ dateStyle,
83
+ timeStyle
84
+ }).format(d);
85
+ } catch {
86
+ /* fall through */
87
+ }
88
+ }
89
+ return `${fallbackDate(d, dateStyle)}, ${fallbackTime(d, timeStyle)}`;
90
+ };
91
+ const SECOND = 1000;
92
+ const MINUTE = 60 * SECOND;
93
+ const HOUR = 60 * MINUTE;
94
+ const DAY = 24 * HOUR;
95
+ const WEEK = 7 * DAY;
96
+ const MONTH = 30 * DAY;
97
+ const YEAR = 365 * DAY;
98
+
99
+ /**
100
+ * Returns a humanized relative-time string (e.g. "5 minutes ago", "in 3 days").
101
+ * Uses `Intl.RelativeTimeFormat` when available; otherwise a sensible English fallback.
102
+ */
103
+ export const formatRelativeTime = (value, base = new Date(), locale = 'en-IN') => {
104
+ const target = toDate(value);
105
+ const now = toDate(base);
106
+ if (!target || !now) return '';
107
+ const diffMs = target.getTime() - now.getTime();
108
+ const abs = Math.abs(diffMs);
109
+ let unit;
110
+ let amount;
111
+ if (abs < MINUTE) {
112
+ unit = 'second';
113
+ amount = Math.round(diffMs / SECOND);
114
+ } else if (abs < HOUR) {
115
+ unit = 'minute';
116
+ amount = Math.round(diffMs / MINUTE);
117
+ } else if (abs < DAY) {
118
+ unit = 'hour';
119
+ amount = Math.round(diffMs / HOUR);
120
+ } else if (abs < WEEK) {
121
+ unit = 'day';
122
+ amount = Math.round(diffMs / DAY);
123
+ } else if (abs < MONTH) {
124
+ unit = 'week';
125
+ amount = Math.round(diffMs / WEEK);
126
+ } else if (abs < YEAR) {
127
+ unit = 'month';
128
+ amount = Math.round(diffMs / MONTH);
129
+ } else {
130
+ unit = 'year';
131
+ amount = Math.round(diffMs / YEAR);
132
+ }
133
+ const Rtf = Intl.RelativeTimeFormat;
134
+ if (typeof Rtf === 'function') {
135
+ try {
136
+ return new Rtf(locale, {
137
+ numeric: 'auto'
138
+ }).format(amount, unit);
139
+ } catch {
140
+ /* fall through */
141
+ }
142
+ }
143
+ const past = amount < 0;
144
+ const n = Math.abs(amount);
145
+ const u = n === 1 ? unit : `${unit}s`;
146
+ return past ? `${n} ${u} ago` : `in ${n} ${u}`;
147
+ };
148
+ //# sourceMappingURL=date.js.map
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ export { formatDate, formatTime, formatDateTime, formatRelativeTime } from "./date.js";
4
+ export { formatPhone, normalizePhone } from "./phone.js";
5
+ export { formatCurrency } from "./currency.js";
6
+ export { formatNumber, formatPercent, formatCompactNumber } from "./number.js";
7
+ export { getInitials } from "./initials.js";
8
+ //# sourceMappingURL=index.js.map