@stream-io/video-react-native-sdk 0.0.1-alpha.141

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 (360) hide show
  1. package/CHANGELOG.md +739 -0
  2. package/LICENSE +219 -0
  3. package/README.md +19 -0
  4. package/dist/__tests__/components/ActiveCall.test.d.ts +1 -0
  5. package/dist/__tests__/components/ActiveCall.test.js +89 -0
  6. package/dist/__tests__/components/ActiveCall.test.js.map +1 -0
  7. package/dist/__tests__/components/Avatar.test.d.ts +1 -0
  8. package/dist/__tests__/components/Avatar.test.js +34 -0
  9. package/dist/__tests__/components/Avatar.test.js.map +1 -0
  10. package/dist/__tests__/components/ParticipantView.test.d.ts +1 -0
  11. package/dist/__tests__/components/ParticipantView.test.js +66 -0
  12. package/dist/__tests__/components/ParticipantView.test.js.map +1 -0
  13. package/dist/__tests__/mocks/call.d.ts +2 -0
  14. package/dist/__tests__/mocks/call.js +21 -0
  15. package/dist/__tests__/mocks/call.js.map +1 -0
  16. package/dist/__tests__/mocks/client.d.ts +2 -0
  17. package/dist/__tests__/mocks/client.js +31 -0
  18. package/dist/__tests__/mocks/client.js.map +1 -0
  19. package/dist/__tests__/mocks/participant.d.ts +3 -0
  20. package/dist/__tests__/mocks/participant.js +25 -0
  21. package/dist/__tests__/mocks/participant.js.map +1 -0
  22. package/dist/__tests__/utils/RNTLTools.d.ts +15 -0
  23. package/dist/__tests__/utils/RNTLTools.js +54 -0
  24. package/dist/__tests__/utils/RNTLTools.js.map +1 -0
  25. package/dist/index.d.ts +9 -0
  26. package/dist/index.js +39 -0
  27. package/dist/index.js.map +1 -0
  28. package/dist/jest-setup.d.ts +1 -0
  29. package/dist/jest-setup.js +34 -0
  30. package/dist/jest-setup.js.map +1 -0
  31. package/dist/src/components/ActiveCall.d.ts +18 -0
  32. package/dist/src/components/ActiveCall.js +117 -0
  33. package/dist/src/components/ActiveCall.js.map +1 -0
  34. package/dist/src/components/Avatar.d.ts +25 -0
  35. package/dist/src/components/Avatar.js +55 -0
  36. package/dist/src/components/Avatar.js.map +1 -0
  37. package/dist/src/components/CallControlsButton.d.ts +22 -0
  38. package/dist/src/components/CallControlsButton.js +43 -0
  39. package/dist/src/components/CallControlsButton.js.map +1 -0
  40. package/dist/src/components/CallControlsView.d.ts +9 -0
  41. package/dist/src/components/CallControlsView.js +95 -0
  42. package/dist/src/components/CallControlsView.js.map +1 -0
  43. package/dist/src/components/CallParticipantsBadge.d.ts +1 -0
  44. package/dist/src/components/CallParticipantsBadge.js +48 -0
  45. package/dist/src/components/CallParticipantsBadge.js.map +1 -0
  46. package/dist/src/components/CallParticipantsInfoView.d.ts +21 -0
  47. package/dist/src/components/CallParticipantsInfoView.js +213 -0
  48. package/dist/src/components/CallParticipantsInfoView.js.map +1 -0
  49. package/dist/src/components/CallParticipantsList.d.ts +25 -0
  50. package/dist/src/components/CallParticipantsList.js +124 -0
  51. package/dist/src/components/CallParticipantsList.js.map +1 -0
  52. package/dist/src/components/CallParticipantsOptions.d.ts +8 -0
  53. package/dist/src/components/CallParticipantsOptions.js +189 -0
  54. package/dist/src/components/CallParticipantsOptions.js.map +1 -0
  55. package/dist/src/components/CallParticipantsSpotlightView.d.ts +1 -0
  56. package/dist/src/components/CallParticipantsSpotlightView.js +40 -0
  57. package/dist/src/components/CallParticipantsSpotlightView.js.map +1 -0
  58. package/dist/src/components/CallParticipantsView.d.ts +1 -0
  59. package/dist/src/components/CallParticipantsView.js +31 -0
  60. package/dist/src/components/CallParticipantsView.js.map +1 -0
  61. package/dist/src/components/IncomingCallView.d.ts +1 -0
  62. package/dist/src/components/IncomingCallView.js +98 -0
  63. package/dist/src/components/IncomingCallView.js.map +1 -0
  64. package/dist/src/components/LobbyView.d.ts +1 -0
  65. package/dist/src/components/LobbyView.js +215 -0
  66. package/dist/src/components/LobbyView.js.map +1 -0
  67. package/dist/src/components/LocalVideoView.d.ts +34 -0
  68. package/dist/src/components/LocalVideoView.js +100 -0
  69. package/dist/src/components/LocalVideoView.js.map +1 -0
  70. package/dist/src/components/NetworkQualityIndicator.d.ts +8 -0
  71. package/dist/src/components/NetworkQualityIndicator.js +36 -0
  72. package/dist/src/components/NetworkQualityIndicator.js.map +1 -0
  73. package/dist/src/components/OutgoingCallView.d.ts +1 -0
  74. package/dist/src/components/OutgoingCallView.js +103 -0
  75. package/dist/src/components/OutgoingCallView.js.map +1 -0
  76. package/dist/src/components/ParticipantReaction.d.ts +7 -0
  77. package/dist/src/components/ParticipantReaction.js +45 -0
  78. package/dist/src/components/ParticipantReaction.js.map +1 -0
  79. package/dist/src/components/ParticipantView.d.ts +42 -0
  80. package/dist/src/components/ParticipantView.js +256 -0
  81. package/dist/src/components/ParticipantView.js.map +1 -0
  82. package/dist/src/components/ReactionsModal.d.ts +7 -0
  83. package/dist/src/components/ReactionsModal.js +65 -0
  84. package/dist/src/components/ReactionsModal.js.map +1 -0
  85. package/dist/src/components/ToggleAudioButton.d.ts +1 -0
  86. package/dist/src/components/ToggleAudioButton.js +78 -0
  87. package/dist/src/components/ToggleAudioButton.js.map +1 -0
  88. package/dist/src/components/ToggleVideoButton.d.ts +1 -0
  89. package/dist/src/components/ToggleVideoButton.js +78 -0
  90. package/dist/src/components/ToggleVideoButton.js.map +1 -0
  91. package/dist/src/components/UserInfoView.d.ts +13 -0
  92. package/dist/src/components/UserInfoView.js +82 -0
  93. package/dist/src/components/UserInfoView.js.map +1 -0
  94. package/dist/src/components/VideoRenderer.d.ts +65 -0
  95. package/dist/src/components/VideoRenderer.js +18 -0
  96. package/dist/src/components/VideoRenderer.js.map +1 -0
  97. package/dist/src/components/index.d.ts +12 -0
  98. package/dist/src/components/index.js +29 -0
  99. package/dist/src/components/index.js.map +1 -0
  100. package/dist/src/constants/A11yLabels.d.ts +20 -0
  101. package/dist/src/constants/A11yLabels.js +29 -0
  102. package/dist/src/constants/A11yLabels.js.map +1 -0
  103. package/dist/src/constants/index.d.ts +11 -0
  104. package/dist/src/constants/index.js +30 -0
  105. package/dist/src/constants/index.js.map +1 -0
  106. package/dist/src/contexts/StreamVideoContext/createStoreContext.d.ts +14 -0
  107. package/dist/src/contexts/StreamVideoContext/createStoreContext.js +100 -0
  108. package/dist/src/contexts/StreamVideoContext/createStoreContext.js.map +1 -0
  109. package/dist/src/contexts/StreamVideoContext/index.d.ts +30 -0
  110. package/dist/src/contexts/StreamVideoContext/index.js +18 -0
  111. package/dist/src/contexts/StreamVideoContext/index.js.map +1 -0
  112. package/dist/src/contexts/index.d.ts +1 -0
  113. package/dist/src/contexts/index.js +18 -0
  114. package/dist/src/contexts/index.js.map +1 -0
  115. package/dist/src/hooks/index.d.ts +10 -0
  116. package/dist/src/hooks/index.js +27 -0
  117. package/dist/src/hooks/index.js.map +1 -0
  118. package/dist/src/hooks/useCallControls.d.ts +14 -0
  119. package/dist/src/hooks/useCallControls.js +148 -0
  120. package/dist/src/hooks/useCallControls.js.map +1 -0
  121. package/dist/src/hooks/useCallCycleEffect.d.ts +8 -0
  122. package/dist/src/hooks/useCallCycleEffect.js +62 -0
  123. package/dist/src/hooks/useCallCycleEffect.js.map +1 -0
  124. package/dist/src/hooks/useCallKeep.d.ts +11 -0
  125. package/dist/src/hooks/useCallKeep.js +41 -0
  126. package/dist/src/hooks/useCallKeep.js.map +1 -0
  127. package/dist/src/hooks/useCreateStreamVideoClient.d.ts +33 -0
  128. package/dist/src/hooks/useCreateStreamVideoClient.js +40 -0
  129. package/dist/src/hooks/useCreateStreamVideoClient.js.map +1 -0
  130. package/dist/src/hooks/useIncallManager.d.ts +13 -0
  131. package/dist/src/hooks/useIncallManager.js +24 -0
  132. package/dist/src/hooks/useIncallManager.js.map +1 -0
  133. package/dist/src/hooks/useLocalVideoStream.d.ts +7 -0
  134. package/dist/src/hooks/useLocalVideoStream.js +34 -0
  135. package/dist/src/hooks/useLocalVideoStream.js.map +1 -0
  136. package/dist/src/hooks/useMutingState.d.ts +12 -0
  137. package/dist/src/hooks/useMutingState.js +25 -0
  138. package/dist/src/hooks/useMutingState.js.map +1 -0
  139. package/dist/src/hooks/usePermissionNotification.d.ts +18 -0
  140. package/dist/src/hooks/usePermissionNotification.js +33 -0
  141. package/dist/src/hooks/usePermissionNotification.js.map +1 -0
  142. package/dist/src/hooks/usePermissionRequest.d.ts +1 -0
  143. package/dist/src/hooks/usePermissionRequest.js +62 -0
  144. package/dist/src/hooks/usePermissionRequest.js.map +1 -0
  145. package/dist/src/hooks/usePublishMediaStreams.d.ts +6 -0
  146. package/dist/src/hooks/usePublishMediaStreams.js +49 -0
  147. package/dist/src/hooks/usePublishMediaStreams.js.map +1 -0
  148. package/dist/src/icons/ArrowRight.d.ts +5 -0
  149. package/dist/src/icons/ArrowRight.js +9 -0
  150. package/dist/src/icons/ArrowRight.js.map +1 -0
  151. package/dist/src/icons/CameraSwitch.d.ts +5 -0
  152. package/dist/src/icons/CameraSwitch.js +9 -0
  153. package/dist/src/icons/CameraSwitch.js.map +1 -0
  154. package/dist/src/icons/Chat.d.ts +5 -0
  155. package/dist/src/icons/Chat.js +9 -0
  156. package/dist/src/icons/Chat.js.map +1 -0
  157. package/dist/src/icons/Cross.d.ts +5 -0
  158. package/dist/src/icons/Cross.js +9 -0
  159. package/dist/src/icons/Cross.js.map +1 -0
  160. package/dist/src/icons/Mic.d.ts +5 -0
  161. package/dist/src/icons/Mic.js +10 -0
  162. package/dist/src/icons/Mic.js.map +1 -0
  163. package/dist/src/icons/MicOff.d.ts +5 -0
  164. package/dist/src/icons/MicOff.js +9 -0
  165. package/dist/src/icons/MicOff.js.map +1 -0
  166. package/dist/src/icons/Participants.d.ts +5 -0
  167. package/dist/src/icons/Participants.js +9 -0
  168. package/dist/src/icons/Participants.js.map +1 -0
  169. package/dist/src/icons/Phone.d.ts +5 -0
  170. package/dist/src/icons/Phone.js +9 -0
  171. package/dist/src/icons/Phone.js.map +1 -0
  172. package/dist/src/icons/PhoneDown.d.ts +5 -0
  173. package/dist/src/icons/PhoneDown.js +10 -0
  174. package/dist/src/icons/PhoneDown.js.map +1 -0
  175. package/dist/src/icons/Pin.d.ts +5 -0
  176. package/dist/src/icons/Pin.js +9 -0
  177. package/dist/src/icons/Pin.js.map +1 -0
  178. package/dist/src/icons/Reaction.d.ts +5 -0
  179. package/dist/src/icons/Reaction.js +9 -0
  180. package/dist/src/icons/Reaction.js.map +1 -0
  181. package/dist/src/icons/ScreenShare.d.ts +5 -0
  182. package/dist/src/icons/ScreenShare.js +40 -0
  183. package/dist/src/icons/ScreenShare.js.map +1 -0
  184. package/dist/src/icons/Settings.d.ts +5 -0
  185. package/dist/src/icons/Settings.js +34 -0
  186. package/dist/src/icons/Settings.js.map +1 -0
  187. package/dist/src/icons/Spotlight.d.ts +5 -0
  188. package/dist/src/icons/Spotlight.js +9 -0
  189. package/dist/src/icons/Spotlight.js.map +1 -0
  190. package/dist/src/icons/ThreeDots.d.ts +5 -0
  191. package/dist/src/icons/ThreeDots.js +11 -0
  192. package/dist/src/icons/ThreeDots.js.map +1 -0
  193. package/dist/src/icons/Video.d.ts +5 -0
  194. package/dist/src/icons/Video.js +9 -0
  195. package/dist/src/icons/Video.js.map +1 -0
  196. package/dist/src/icons/VideoDisabled.d.ts +5 -0
  197. package/dist/src/icons/VideoDisabled.js +10 -0
  198. package/dist/src/icons/VideoDisabled.js.map +1 -0
  199. package/dist/src/icons/VideoOff.d.ts +5 -0
  200. package/dist/src/icons/VideoOff.js +10 -0
  201. package/dist/src/icons/VideoOff.js.map +1 -0
  202. package/dist/src/icons/VideoSlash.d.ts +5 -0
  203. package/dist/src/icons/VideoSlash.js +10 -0
  204. package/dist/src/icons/VideoSlash.js.map +1 -0
  205. package/dist/src/icons/index.d.ts +19 -0
  206. package/dist/src/icons/index.js +36 -0
  207. package/dist/src/icons/index.js.map +1 -0
  208. package/dist/src/providers/MediaDevices.d.ts +9 -0
  209. package/dist/src/providers/MediaDevices.js +43 -0
  210. package/dist/src/providers/MediaDevices.js.map +1 -0
  211. package/dist/src/providers/StreamCall.d.ts +81 -0
  212. package/dist/src/providers/StreamCall.js +74 -0
  213. package/dist/src/providers/StreamCall.js.map +1 -0
  214. package/dist/src/providers/StreamVideo.d.ts +10 -0
  215. package/dist/src/providers/StreamVideo.js +66 -0
  216. package/dist/src/providers/StreamVideo.js.map +1 -0
  217. package/dist/src/providers/index.d.ts +2 -0
  218. package/dist/src/providers/index.js +19 -0
  219. package/dist/src/providers/index.js.map +1 -0
  220. package/dist/src/theme/avatar.d.ts +2 -0
  221. package/dist/src/theme/avatar.js +11 -0
  222. package/dist/src/theme/avatar.js.map +1 -0
  223. package/dist/src/theme/button.d.ts +2 -0
  224. package/dist/src/theme/button.js +11 -0
  225. package/dist/src/theme/button.js.map +1 -0
  226. package/dist/src/theme/colors.d.ts +3 -0
  227. package/dist/src/theme/colors.js +49 -0
  228. package/dist/src/theme/colors.js.map +1 -0
  229. package/dist/src/theme/constants.d.ts +47 -0
  230. package/dist/src/theme/constants.js +54 -0
  231. package/dist/src/theme/constants.js.map +1 -0
  232. package/dist/src/theme/fonts.d.ts +2 -0
  233. package/dist/src/theme/fonts.js +67 -0
  234. package/dist/src/theme/fonts.js.map +1 -0
  235. package/dist/src/theme/icon.d.ts +2 -0
  236. package/dist/src/theme/icon.js +11 -0
  237. package/dist/src/theme/icon.js.map +1 -0
  238. package/dist/src/theme/index.d.ts +2 -0
  239. package/dist/src/theme/index.js +26 -0
  240. package/dist/src/theme/index.js.map +1 -0
  241. package/dist/src/theme/margin.d.ts +2 -0
  242. package/dist/src/theme/margin.js +11 -0
  243. package/dist/src/theme/margin.js.map +1 -0
  244. package/dist/src/theme/padding.d.ts +2 -0
  245. package/dist/src/theme/padding.js +11 -0
  246. package/dist/src/theme/padding.js.map +1 -0
  247. package/dist/src/theme/rounded.d.ts +2 -0
  248. package/dist/src/theme/rounded.js +11 -0
  249. package/dist/src/theme/rounded.js.map +1 -0
  250. package/dist/src/theme/spacing.d.ts +2 -0
  251. package/dist/src/theme/spacing.js +11 -0
  252. package/dist/src/theme/spacing.js.map +1 -0
  253. package/dist/src/theme/types.d.ts +45 -0
  254. package/dist/src/theme/types.js +3 -0
  255. package/dist/src/theme/types.js.map +1 -0
  256. package/dist/src/utils/StreamVideoRN.d.ts +25 -0
  257. package/dist/src/utils/StreamVideoRN.js +23 -0
  258. package/dist/src/utils/StreamVideoRN.js.map +1 -0
  259. package/dist/src/utils/hooks/index.d.ts +3 -0
  260. package/dist/src/utils/hooks/index.js +20 -0
  261. package/dist/src/utils/hooks/index.js.map +1 -0
  262. package/dist/src/utils/hooks/useAppStateListener.d.ts +1 -0
  263. package/dist/src/utils/hooks/useAppStateListener.js +41 -0
  264. package/dist/src/utils/hooks/useAppStateListener.js.map +1 -0
  265. package/dist/src/utils/hooks/useDebouncedValue.d.ts +7 -0
  266. package/dist/src/utils/hooks/useDebouncedValue.js +22 -0
  267. package/dist/src/utils/hooks/useDebouncedValue.js.map +1 -0
  268. package/dist/src/utils/hooks/usePrevious.d.ts +1 -0
  269. package/dist/src/utils/hooks/usePrevious.js +13 -0
  270. package/dist/src/utils/hooks/usePrevious.js.map +1 -0
  271. package/dist/src/utils/index.d.ts +5 -0
  272. package/dist/src/utils/index.js +53 -0
  273. package/dist/src/utils/index.js.map +1 -0
  274. package/dist/src/utils/verifyAndroidBluetoothPermissions.d.ts +1 -0
  275. package/dist/src/utils/verifyAndroidBluetoothPermissions.js +30 -0
  276. package/dist/src/utils/verifyAndroidBluetoothPermissions.js.map +1 -0
  277. package/index.ts +22 -0
  278. package/package.json +70 -0
  279. package/src/components/ActiveCall.tsx +122 -0
  280. package/src/components/Avatar.tsx +88 -0
  281. package/src/components/CallControlsButton.tsx +72 -0
  282. package/src/components/CallControlsView.tsx +128 -0
  283. package/src/components/CallParticipantsBadge.tsx +57 -0
  284. package/src/components/CallParticipantsInfoView.tsx +287 -0
  285. package/src/components/CallParticipantsList.tsx +172 -0
  286. package/src/components/CallParticipantsOptions.tsx +248 -0
  287. package/src/components/CallParticipantsSpotlightView.tsx +53 -0
  288. package/src/components/CallParticipantsView.tsx +30 -0
  289. package/src/components/IncomingCallView.tsx +133 -0
  290. package/src/components/LobbyView.tsx +236 -0
  291. package/src/components/LocalVideoView.tsx +141 -0
  292. package/src/components/NetworkQualityIndicator.tsx +72 -0
  293. package/src/components/OutgoingCallView.tsx +133 -0
  294. package/src/components/ParticipantReaction.tsx +59 -0
  295. package/src/components/ParticipantView.tsx +315 -0
  296. package/src/components/ReactionsModal.tsx +90 -0
  297. package/src/components/ToggleAudioButton.tsx +103 -0
  298. package/src/components/ToggleVideoButton.tsx +103 -0
  299. package/src/components/UserInfoView.tsx +118 -0
  300. package/src/components/VideoRenderer.tsx +85 -0
  301. package/src/components/index.ts +12 -0
  302. package/src/constants/A11yLabels.ts +24 -0
  303. package/src/constants/index.ts +28 -0
  304. package/src/contexts/StreamVideoContext/createStoreContext.tsx +117 -0
  305. package/src/contexts/StreamVideoContext/index.tsx +37 -0
  306. package/src/contexts/index.ts +1 -0
  307. package/src/hooks/index.ts +10 -0
  308. package/src/hooks/useCallControls.tsx +186 -0
  309. package/src/hooks/useCallCycleEffect.tsx +68 -0
  310. package/src/hooks/useCallKeep.tsx +51 -0
  311. package/src/hooks/useCreateStreamVideoClient.tsx +77 -0
  312. package/src/hooks/useIncallManager.tsx +23 -0
  313. package/src/hooks/useLocalVideoStream.ts +36 -0
  314. package/src/hooks/useMutingState.ts +24 -0
  315. package/src/hooks/usePermissionNotification.tsx +53 -0
  316. package/src/hooks/usePermissionRequest.tsx +67 -0
  317. package/src/hooks/usePublishMediaStreams.ts +59 -0
  318. package/src/icons/ArrowRight.tsx +16 -0
  319. package/src/icons/CameraSwitch.tsx +14 -0
  320. package/src/icons/Chat.tsx +14 -0
  321. package/src/icons/Cross.tsx +14 -0
  322. package/src/icons/Mic.tsx +18 -0
  323. package/src/icons/MicOff.tsx +14 -0
  324. package/src/icons/Participants.tsx +16 -0
  325. package/src/icons/Phone.tsx +14 -0
  326. package/src/icons/PhoneDown.tsx +15 -0
  327. package/src/icons/Pin.tsx +16 -0
  328. package/src/icons/Reaction.tsx +14 -0
  329. package/src/icons/ScreenShare.tsx +32 -0
  330. package/src/icons/Settings.tsx +13 -0
  331. package/src/icons/Spotlight.tsx +16 -0
  332. package/src/icons/ThreeDots.tsx +13 -0
  333. package/src/icons/Video.tsx +14 -0
  334. package/src/icons/VideoDisabled.tsx +22 -0
  335. package/src/icons/VideoOff.tsx +20 -0
  336. package/src/icons/VideoSlash.tsx +15 -0
  337. package/src/icons/index.tsx +19 -0
  338. package/src/providers/MediaDevices.tsx +45 -0
  339. package/src/providers/StreamCall.tsx +136 -0
  340. package/src/providers/StreamVideo.tsx +50 -0
  341. package/src/providers/index.ts +2 -0
  342. package/src/theme/avatar.ts +9 -0
  343. package/src/theme/button.ts +9 -0
  344. package/src/theme/colors.ts +49 -0
  345. package/src/theme/constants.ts +51 -0
  346. package/src/theme/fonts.ts +65 -0
  347. package/src/theme/icon.ts +9 -0
  348. package/src/theme/index.ts +25 -0
  349. package/src/theme/margin.ts +9 -0
  350. package/src/theme/padding.ts +9 -0
  351. package/src/theme/rounded.ts +9 -0
  352. package/src/theme/spacing.ts +9 -0
  353. package/src/theme/types.ts +64 -0
  354. package/src/utils/StreamVideoRN.ts +35 -0
  355. package/src/utils/hooks/index.ts +3 -0
  356. package/src/utils/hooks/useAppStateListener.ts +48 -0
  357. package/src/utils/hooks/useDebouncedValue.ts +21 -0
  358. package/src/utils/hooks/usePrevious.ts +11 -0
  359. package/src/utils/index.ts +45 -0
  360. package/src/utils/verifyAndroidBluetoothPermissions.ts +31 -0
@@ -0,0 +1,51 @@
1
+ const ref = {
2
+ palette: {
3
+ green50: '#F6FEF9',
4
+ green100: '#E9F1FF',
5
+ green200: '#A6F2C6',
6
+ green300: '#79ECA9',
7
+ green400: '#4CE68C',
8
+ green500: '#20E070',
9
+ green600: '#19B359',
10
+ green700: '#138643',
11
+ green800: '#0D592C',
12
+ green900: '#062D16',
13
+ green950: '#041B0D',
14
+ blue50: '#F5FAFF',
15
+ blue100: '#E0F0FF',
16
+ blue200: '#CCDFFF',
17
+ blue300: '#669FFF',
18
+ blue400: '#337EFF',
19
+ blue500: '#005FFF',
20
+ blue600: '#004CCC',
21
+ blue700: '#003999',
22
+ blue800: '#002666',
23
+ blue900: '#00163D',
24
+ blue950: '#000D24',
25
+ red50: '#FFF5F5',
26
+ red100: '#FFE5E7',
27
+ red200: '#FF999F',
28
+ red300: '#FF666E',
29
+ red400: '#FF3742',
30
+ red500: '#FF000E',
31
+ red600: '#CC000B',
32
+ red700: '#990008',
33
+ red800: '#660006',
34
+ red900: '#330003',
35
+ red950: '#1F0002',
36
+ grey50: '#FFFFFF',
37
+ grey100: '#F7F7F8',
38
+ grey200: '#E9EAED',
39
+ grey300: '#DBDDE1',
40
+ grey400: '#B4B7BB',
41
+ grey500: '#72767E',
42
+ grey600: '#4C525C',
43
+ grey700: '#272A30',
44
+ grey800: '#1C1E22',
45
+ grey900: '#121416',
46
+ grey950: '#080707',
47
+ },
48
+ };
49
+
50
+ const { palette } = ref;
51
+ export { palette };
@@ -0,0 +1,65 @@
1
+ import { Platform } from 'react-native';
2
+ import { FontStyle, FontTypes } from './types';
3
+
4
+ export const fonts: Record<FontTypes, FontStyle> = Platform.select({
5
+ ios: {
6
+ heading4: {
7
+ fontSize: 34,
8
+ fontWeight: '400',
9
+ },
10
+ heading5: {
11
+ fontSize: 24,
12
+ fontWeight: '400',
13
+ },
14
+ heading6: {
15
+ fontSize: 20,
16
+ fontWeight: '500',
17
+ },
18
+ subtitle: {
19
+ fontSize: 16,
20
+ fontWeight: '400',
21
+ },
22
+ subtitleBold: {
23
+ fontSize: 16,
24
+ fontWeight: '500',
25
+ },
26
+ bodyBold: {
27
+ fontSize: 16,
28
+ fontWeight: '600',
29
+ },
30
+ caption: {
31
+ fontSize: 10,
32
+ fontWeight: '400',
33
+ },
34
+ },
35
+ default: {
36
+ heading4: {
37
+ fontSize: 34,
38
+ fontWeight: '400',
39
+ },
40
+ heading5: {
41
+ fontSize: 24,
42
+ fontWeight: '400',
43
+ },
44
+ heading6: {
45
+ fontSize: 20,
46
+ fontWeight: '500',
47
+ },
48
+ subtitle: {
49
+ fontSize: 16,
50
+ fontWeight: '400',
51
+ },
52
+ subtitleBold: {
53
+ fontSize: 16,
54
+ fontWeight: '500',
55
+ },
56
+ bodyBold: {
57
+ fontSize: 16,
58
+ fontWeight: '600',
59
+ },
60
+ caption: {
61
+ fontSize: 10,
62
+ fontWeight: '400',
63
+ },
64
+ },
65
+ });
@@ -0,0 +1,9 @@
1
+ import { IconScheme } from './types';
2
+
3
+ export const icon: IconScheme = {
4
+ xs: { height: 15, width: 15 },
5
+ sm: { height: 20, width: 20 },
6
+ md: { height: 25, width: 25 },
7
+ lg: { height: 30, width: 30 },
8
+ xl: { height: 35, width: 35 },
9
+ };
@@ -0,0 +1,25 @@
1
+ import { colors } from './colors';
2
+ import { fonts } from './fonts';
3
+ import { padding } from './padding';
4
+ import { margin } from './margin';
5
+ import { Theme } from './types';
6
+ import { icon } from './icon';
7
+ import { button } from './button';
8
+ import { avatar } from './avatar';
9
+ import { spacing } from './spacing';
10
+ import { rounded } from './rounded';
11
+
12
+ const { light, dark } = colors;
13
+
14
+ export const theme: Theme = {
15
+ light,
16
+ dark,
17
+ fonts,
18
+ padding,
19
+ margin,
20
+ icon,
21
+ button,
22
+ avatar,
23
+ spacing,
24
+ rounded,
25
+ };
@@ -0,0 +1,9 @@
1
+ import { MarginScheme } from './types';
2
+
3
+ export const margin: MarginScheme = {
4
+ xs: 4,
5
+ sm: 8,
6
+ md: 16,
7
+ lg: 24,
8
+ xl: 32,
9
+ };
@@ -0,0 +1,9 @@
1
+ import { PaddingScheme } from './types';
2
+
3
+ export const padding: PaddingScheme = {
4
+ xs: 4,
5
+ sm: 8,
6
+ md: 16,
7
+ lg: 24,
8
+ xl: 32,
9
+ };
@@ -0,0 +1,9 @@
1
+ import { RoundedScheme } from './types';
2
+
3
+ export const rounded: RoundedScheme = {
4
+ xs: 5,
5
+ sm: 10,
6
+ md: 15,
7
+ lg: 20,
8
+ xl: 30,
9
+ };
@@ -0,0 +1,9 @@
1
+ import { SpacingScheme } from './types';
2
+
3
+ export const spacing: SpacingScheme = {
4
+ xs: 4,
5
+ sm: 6,
6
+ md: 8,
7
+ lg: 10,
8
+ xl: 12,
9
+ };
@@ -0,0 +1,64 @@
1
+ import { StyleProp, TextStyle, ViewStyle } from 'react-native';
2
+
3
+ export type ColorScheme = {
4
+ primary: string;
5
+ error: string;
6
+ info: string;
7
+ static_black: string;
8
+ static_white: string;
9
+ static_overlay: string;
10
+ static_grey: string;
11
+ disabled: string;
12
+ text_low_emphasis: string;
13
+ text_high_emphasis: string;
14
+ controls_bg: string;
15
+ borders: string;
16
+ overlay: string;
17
+ overlay_dark: string;
18
+ bars: string;
19
+ content_bg: string;
20
+ };
21
+
22
+ export type ColorType = Record<'light' | 'dark', ColorScheme>;
23
+
24
+ export type FontTypes =
25
+ | 'heading4'
26
+ | 'heading5'
27
+ | 'heading6'
28
+ | 'subtitle'
29
+ | 'subtitleBold'
30
+ | 'caption'
31
+ | 'bodyBold';
32
+ export type FontStyle = {
33
+ fontSize: TextStyle['fontSize'];
34
+ fontWeight: TextStyle['fontWeight'];
35
+ };
36
+
37
+ export type FontsScheme = Record<FontTypes, FontStyle>;
38
+
39
+ type SizingTypes = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
40
+
41
+ export type PaddingScheme = Record<SizingTypes, number>;
42
+
43
+ export type MarginScheme = Record<SizingTypes, number>;
44
+
45
+ export type IconScheme = Record<SizingTypes, StyleProp<ViewStyle>>;
46
+
47
+ export type ButtonScheme = Record<SizingTypes, StyleProp<ViewStyle>>;
48
+
49
+ export type AvatarScheme = Record<SizingTypes, number>;
50
+
51
+ export type SpacingScheme = Record<SizingTypes, number>;
52
+
53
+ export type RoundedScheme = Record<SizingTypes, number>;
54
+
55
+ export type Theme = ColorType & {
56
+ fonts: FontsScheme;
57
+ padding: PaddingScheme;
58
+ margin: MarginScheme;
59
+ icon: IconScheme;
60
+ button: ButtonScheme;
61
+ avatar: AvatarScheme;
62
+ spacing: SpacingScheme;
63
+ rounded: RoundedScheme;
64
+ };
@@ -0,0 +1,35 @@
1
+ import { StreamReaction } from '@stream-io/video-client';
2
+ import { defaultEmojiReactions } from '../constants';
3
+
4
+ type StreamReactionType = StreamReaction & {
5
+ icon: string | JSX.Element;
6
+ };
7
+
8
+ type StreamVideoConfig = {
9
+ /**
10
+ * Reactions that are to be supported in the app.
11
+ *
12
+ * Note: This is an array of reactions that is rendered in the Reaction list.
13
+ */
14
+ supportedReactions: StreamReactionType[];
15
+ };
16
+
17
+ const DEFAULT_STREAM_VIDEO_CONFIG = {
18
+ supportedReactions: defaultEmojiReactions,
19
+ };
20
+
21
+ export class StreamVideoRN {
22
+ /**
23
+ * Global config for StreamVideoRN.
24
+ */
25
+ static config: StreamVideoConfig = DEFAULT_STREAM_VIDEO_CONFIG;
26
+
27
+ /**
28
+ * Set global config for StreamVideoRN allows you to set wished CDN hosts for resizing images.
29
+ * This function accepts an config object that will be merged with the default config.
30
+ * @example StreamVideoRN.setConfig({ onOpenCallParticipantsInfoView: () => {} });
31
+ */
32
+ static setConfig(config: Partial<StreamVideoConfig>) {
33
+ this.config = { ...this.config, ...config };
34
+ }
35
+ }
@@ -0,0 +1,3 @@
1
+ export * from './useAppStateListener';
2
+ export * from './useDebouncedValue';
3
+ export * from './usePrevious';
@@ -0,0 +1,48 @@
1
+ import { useEffect, useRef } from 'react';
2
+ import { AppState, AppStateStatus } from 'react-native';
3
+
4
+ export const useAppStateListener = (
5
+ onForeground?: () => void,
6
+ onBackground?: () => void,
7
+ ) => {
8
+ const appStateRef = useRef(AppState.currentState);
9
+ const onForegroundRef = useRef(onForeground);
10
+ const onBackgroundRef = useRef(onBackground);
11
+
12
+ // setting refs to avoid passing the functions as dependencies to useEffect
13
+ onForegroundRef.current = onForeground;
14
+ onBackgroundRef.current = onBackground;
15
+
16
+ useEffect(() => {
17
+ const handleAppStateChange = (nextAppState: AppStateStatus) => {
18
+ const prevAppState = appStateRef.current;
19
+ if (
20
+ prevAppState.match(/inactive|background/) &&
21
+ nextAppState === 'active'
22
+ ) {
23
+ onForegroundRef.current?.();
24
+ } else if (
25
+ prevAppState === 'active' &&
26
+ nextAppState.match(/inactive|background/)
27
+ ) {
28
+ onBackgroundRef.current?.();
29
+ }
30
+ appStateRef.current = nextAppState;
31
+ };
32
+ const subscription = AppState.addEventListener(
33
+ 'change',
34
+ handleAppStateChange,
35
+ );
36
+
37
+ return () => {
38
+ // Following if-else logic is to support RN >= 0.65 and RN < 0.65 versions.
39
+ // https://github.com/react-native-community/releases/blob/master/CHANGELOG.md#:~:text=EventEmitter%23removeSubscription%20is%20now%20deprecated.%20(cb6cbd12f8%20by%20%40yungsters)
40
+ if (subscription?.remove) {
41
+ subscription.remove();
42
+ } else {
43
+ // @ts-ignore
44
+ AppState.removeEventListener('change', handleAppStateChange);
45
+ }
46
+ };
47
+ }, []);
48
+ };
@@ -0,0 +1,21 @@
1
+ import { useEffect, useState } from 'react';
2
+
3
+ /**
4
+ * this is a custom hook that takes a value and a delay and returns a debounced value
5
+ * @param {T} value
6
+ * @param {number} delay
7
+ * @returns {T}
8
+ */
9
+ export function useDebouncedValue<T>(value: T, delay: number): T {
10
+ const [debouncedValue, setDebouncedValue] = useState<T>(value);
11
+
12
+ useEffect(() => {
13
+ const timer = setTimeout(() => setDebouncedValue(value), delay);
14
+
15
+ return () => {
16
+ clearTimeout(timer);
17
+ };
18
+ }, [value, delay]);
19
+
20
+ return debouncedValue;
21
+ }
@@ -0,0 +1,11 @@
1
+ import { useEffect, useRef } from 'react';
2
+
3
+ export const usePrevious = (value: any) => {
4
+ const valueRef = useRef(value);
5
+
6
+ useEffect(() => {
7
+ valueRef.current = value;
8
+ }, [value]);
9
+
10
+ return valueRef.current;
11
+ };
@@ -0,0 +1,45 @@
1
+ import { theme } from '../theme';
2
+
3
+ // Utility to join strings with commas and 'and'
4
+ export const generateCallTitle = (
5
+ memberUserIds: string[],
6
+ totalMembersToShow?: number,
7
+ ) => {
8
+ const supportedAmountOfMemberUserIds = memberUserIds.slice(
9
+ 0,
10
+ totalMembersToShow,
11
+ );
12
+ if (
13
+ totalMembersToShow &&
14
+ supportedAmountOfMemberUserIds.length < totalMembersToShow
15
+ ) {
16
+ return supportedAmountOfMemberUserIds.join(' and ');
17
+ }
18
+
19
+ const allMembersExceptLast = supportedAmountOfMemberUserIds.slice(0, -1);
20
+ const lastMember = supportedAmountOfMemberUserIds.slice(-1)[0];
21
+ return `${allMembersExceptLast.join(', ')}, and ${lastMember}`;
22
+ };
23
+
24
+ // Utility to truncate long strings
25
+ export const generateParticipantTitle = (memberUserId: string) => {
26
+ return memberUserId.length > 15
27
+ ? memberUserId.slice(0, 15) + '...'
28
+ : memberUserId;
29
+ };
30
+
31
+ // Utility to get initials of a name
32
+ export const getInitialsOfName = (name: string) => {
33
+ const names = name.split(' ');
34
+ let initials = names[0].substring(0, 1).toUpperCase();
35
+ if (names.length > 1) {
36
+ initials += names[names.length - 1].substring(0, 1).toUpperCase();
37
+ }
38
+ return initials;
39
+ };
40
+
41
+ export const muteStatusColor = (status: boolean) => {
42
+ return status ? theme.light.overlay_dark : theme.light.static_white;
43
+ };
44
+
45
+ export * from './StreamVideoRN';
@@ -0,0 +1,31 @@
1
+ import { Platform, PermissionsAndroid } from 'react-native';
2
+
3
+ export const verifyAndroidBluetoothPermissions = async () => {
4
+ const shouldCheckForPermissions = Number(Platform.Version) >= 31;
5
+ if (!shouldCheckForPermissions) return true;
6
+ const getCheckPermissionPromise = () => {
7
+ return PermissionsAndroid.check(
8
+ PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT,
9
+ );
10
+ };
11
+ const hasPermission = await getCheckPermissionPromise();
12
+ if (!hasPermission) {
13
+ const getRequestPermissionPromise = async () => {
14
+ const result = await PermissionsAndroid.request(
15
+ PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT,
16
+ {
17
+ buttonNegative: 'Deny',
18
+ buttonNeutral: 'Ask Me Later',
19
+ buttonPositive: 'Allow',
20
+ message:
21
+ 'Permissions are required to route audio to bluetooth devices.',
22
+ title: 'Bluetooth connect Access',
23
+ },
24
+ ).then((status) => status === PermissionsAndroid.RESULTS.GRANTED);
25
+ return result;
26
+ };
27
+ const granted = await getRequestPermissionPromise();
28
+ return granted;
29
+ }
30
+ return true;
31
+ };