@networkinternational/ni-card-management-sdk 1.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 (416) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +651 -0
  3. package/android/build.gradle +95 -0
  4. package/android/gradle.properties +5 -0
  5. package/android/src/main/AndroidManifest.xml +3 -0
  6. package/android/src/main/AndroidManifestNew.xml +2 -0
  7. package/android/src/main/java/com/nicardmanagement/JsonDeserialization.kt +24 -0
  8. package/android/src/main/java/com/nicardmanagement/NiCardManagementModule.kt +163 -0
  9. package/android/src/main/java/com/nicardmanagement/NiCardManagementPackage.kt +17 -0
  10. package/ios/NiCardManagement-Bridging-Header.h +2 -0
  11. package/ios/NiCardManagement.mm +29 -0
  12. package/ios/NiCardManagement.swift +142 -0
  13. package/lib/commonjs/NICardManagementComponents/CardDetailsComponent.js +71 -0
  14. package/lib/commonjs/NICardManagementComponents/CardDetailsComponent.js.map +1 -0
  15. package/lib/commonjs/NICardManagementComponents/ChangePinView.js +44 -0
  16. package/lib/commonjs/NICardManagementComponents/ChangePinView.js.map +1 -0
  17. package/lib/commonjs/NICardManagementComponents/NiInputInterfaces.js +17 -0
  18. package/lib/commonjs/NICardManagementComponents/NiInputInterfaces.js.map +1 -0
  19. package/lib/commonjs/NICardManagementComponents/SetPinView.js +44 -0
  20. package/lib/commonjs/NICardManagementComponents/SetPinView.js.map +1 -0
  21. package/lib/commonjs/NICardManagementComponents/VerifyPinView.js +44 -0
  22. package/lib/commonjs/NICardManagementComponents/VerifyPinView.js.map +1 -0
  23. package/lib/commonjs/NICardManagementComponents/ViewPinComponent.js +52 -0
  24. package/lib/commonjs/NICardManagementComponents/ViewPinComponent.js.map +1 -0
  25. package/lib/commonjs/assets/icons/content-copy.png +0 -0
  26. package/lib/commonjs/assets/icons/eye-off-outline.png +0 -0
  27. package/lib/commonjs/assets/icons/eye-outline.png +0 -0
  28. package/lib/commonjs/assets/icons/icons8-arrow-100.png +0 -0
  29. package/lib/commonjs/assets/icons/icons8-arrow-100_1.png +0 -0
  30. package/lib/commonjs/assets/icons/red-eye-off-outline.png +0 -0
  31. package/lib/commonjs/assets/icons/red-eye-outline.png +0 -0
  32. package/lib/commonjs/assets/images/grayCard.png +0 -0
  33. package/lib/commonjs/components/CardDetails/CardDetails.js +27 -0
  34. package/lib/commonjs/components/CardDetails/CardDetails.js.map +1 -0
  35. package/lib/commonjs/components/CardDetails/CardDetailsBackgroundImage.js +29 -0
  36. package/lib/commonjs/components/CardDetails/CardDetailsBackgroundImage.js.map +1 -0
  37. package/lib/commonjs/components/CardDetails/CardDetailsGroups.js +94 -0
  38. package/lib/commonjs/components/CardDetails/CardDetailsGroups.js.map +1 -0
  39. package/lib/commonjs/components/CardDetails/CardHolderNameGroups.js +67 -0
  40. package/lib/commonjs/components/CardDetails/CardHolderNameGroups.js.map +1 -0
  41. package/lib/commonjs/components/CardDetails/CardNumberGroup.js +69 -0
  42. package/lib/commonjs/components/CardDetails/CardNumberGroup.js.map +1 -0
  43. package/lib/commonjs/components/CardDetails/DateCVVGroupOneRow.js +104 -0
  44. package/lib/commonjs/components/CardDetails/DateCVVGroupOneRow.js.map +1 -0
  45. package/lib/commonjs/components/CardDetails/styles.js +98 -0
  46. package/lib/commonjs/components/CardDetails/styles.js.map +1 -0
  47. package/lib/commonjs/components/ChangePin/CaptureCurrentPin.js +50 -0
  48. package/lib/commonjs/components/ChangePin/CaptureCurrentPin.js.map +1 -0
  49. package/lib/commonjs/components/ChangePin/CaptureNewPin.js +50 -0
  50. package/lib/commonjs/components/ChangePin/CaptureNewPin.js.map +1 -0
  51. package/lib/commonjs/components/ChangePin/ChangePin.js +135 -0
  52. package/lib/commonjs/components/ChangePin/ChangePin.js.map +1 -0
  53. package/lib/commonjs/components/ChangePin/ConfirmPin.js +39 -0
  54. package/lib/commonjs/components/ChangePin/ConfirmPin.js.map +1 -0
  55. package/lib/commonjs/components/ChangePin/ReenterNewPin.js +53 -0
  56. package/lib/commonjs/components/ChangePin/ReenterNewPin.js.map +1 -0
  57. package/lib/commonjs/components/ChangePin/styles.js +29 -0
  58. package/lib/commonjs/components/ChangePin/styles.js.map +1 -0
  59. package/lib/commonjs/components/NIButton/NIButton.js +46 -0
  60. package/lib/commonjs/components/NIButton/NIButton.js.map +1 -0
  61. package/lib/commonjs/components/NIButton/styles.js +15 -0
  62. package/lib/commonjs/components/NIButton/styles.js.map +1 -0
  63. package/lib/commonjs/components/Pin/CapturePin.js +152 -0
  64. package/lib/commonjs/components/Pin/CapturePin.js.map +1 -0
  65. package/lib/commonjs/components/Pin/NextButton.js +40 -0
  66. package/lib/commonjs/components/Pin/NextButton.js.map +1 -0
  67. package/lib/commonjs/components/Pin/ShowHideButton.js +48 -0
  68. package/lib/commonjs/components/Pin/ShowHideButton.js.map +1 -0
  69. package/lib/commonjs/components/Pin/styles.js +61 -0
  70. package/lib/commonjs/components/Pin/styles.js.map +1 -0
  71. package/lib/commonjs/components/PinState/LoadingState.js +29 -0
  72. package/lib/commonjs/components/PinState/LoadingState.js.map +1 -0
  73. package/lib/commonjs/components/PinState/PinState.js +29 -0
  74. package/lib/commonjs/components/PinState/PinState.js.map +1 -0
  75. package/lib/commonjs/components/SetPin/ConfirmPin.js +39 -0
  76. package/lib/commonjs/components/SetPin/ConfirmPin.js.map +1 -0
  77. package/lib/commonjs/components/SetPin/ReenterCardPin.js +53 -0
  78. package/lib/commonjs/components/SetPin/ReenterCardPin.js.map +1 -0
  79. package/lib/commonjs/components/SetPin/SetPin.js +118 -0
  80. package/lib/commonjs/components/SetPin/SetPin.js.map +1 -0
  81. package/lib/commonjs/components/SetPin/SetUpNewCardPin.js +50 -0
  82. package/lib/commonjs/components/SetPin/SetUpNewCardPin.js.map +1 -0
  83. package/lib/commonjs/components/SetPin/styles.js +29 -0
  84. package/lib/commonjs/components/SetPin/styles.js.map +1 -0
  85. package/lib/commonjs/components/VerifyPin/CaptureVerifyPin.js +50 -0
  86. package/lib/commonjs/components/VerifyPin/CaptureVerifyPin.js.map +1 -0
  87. package/lib/commonjs/components/VerifyPin/ConfirmPin.js +40 -0
  88. package/lib/commonjs/components/VerifyPin/ConfirmPin.js.map +1 -0
  89. package/lib/commonjs/components/VerifyPin/VerifyPin.js +92 -0
  90. package/lib/commonjs/components/VerifyPin/VerifyPin.js.map +1 -0
  91. package/lib/commonjs/components/VerifyPin/styles.js +26 -0
  92. package/lib/commonjs/components/VerifyPin/styles.js.map +1 -0
  93. package/lib/commonjs/components/ViewPin/ViewPin.js +76 -0
  94. package/lib/commonjs/components/ViewPin/ViewPin.js.map +1 -0
  95. package/lib/commonjs/components/ViewPin/styles.js +19 -0
  96. package/lib/commonjs/components/ViewPin/styles.js.map +1 -0
  97. package/lib/commonjs/components/icons/PredeterminedIcon.js +43 -0
  98. package/lib/commonjs/components/icons/PredeterminedIcon.js.map +1 -0
  99. package/lib/commonjs/config/configCard.js +9 -0
  100. package/lib/commonjs/config/configCard.js.map +1 -0
  101. package/lib/commonjs/config/localization.js +47 -0
  102. package/lib/commonjs/config/localization.js.map +1 -0
  103. package/lib/commonjs/config/themeColors.js +34 -0
  104. package/lib/commonjs/config/themeColors.js.map +1 -0
  105. package/lib/commonjs/hooks/useChangePin.js +37 -0
  106. package/lib/commonjs/hooks/useChangePin.js.map +1 -0
  107. package/lib/commonjs/hooks/useGetCardDetails.js +37 -0
  108. package/lib/commonjs/hooks/useGetCardDetails.js.map +1 -0
  109. package/lib/commonjs/hooks/useSetPin.js +37 -0
  110. package/lib/commonjs/hooks/useSetPin.js.map +1 -0
  111. package/lib/commonjs/hooks/useVerifyPin.js +37 -0
  112. package/lib/commonjs/hooks/useVerifyPin.js.map +1 -0
  113. package/lib/commonjs/hooks/useViewPin.js +37 -0
  114. package/lib/commonjs/hooks/useViewPin.js.map +1 -0
  115. package/lib/commonjs/index.js +72 -0
  116. package/lib/commonjs/index.js.map +1 -0
  117. package/lib/commonjs/interfaces/NiCardManagementInterfaces.js +2 -0
  118. package/lib/commonjs/interfaces/NiCardManagementInterfaces.js.map +1 -0
  119. package/lib/commonjs/interfaces/NiInputInterfaces.js +39 -0
  120. package/lib/commonjs/interfaces/NiInputInterfaces.js.map +1 -0
  121. package/lib/commonjs/interfaces/NiInterfaces.js +14 -0
  122. package/lib/commonjs/interfaces/NiInterfaces.js.map +1 -0
  123. package/lib/commonjs/nativeComponents/NICardManagementSDKModule.js +9 -0
  124. package/lib/commonjs/nativeComponents/NICardManagementSDKModule.js.map +1 -0
  125. package/lib/commonjs/utils/formatInput.js +10 -0
  126. package/lib/commonjs/utils/formatInput.js.map +1 -0
  127. package/lib/commonjs/utils/localization.js +13 -0
  128. package/lib/commonjs/utils/localization.js.map +1 -0
  129. package/lib/module/NICardManagementComponents/CardDetailsComponent.js +57 -0
  130. package/lib/module/NICardManagementComponents/CardDetailsComponent.js.map +1 -0
  131. package/lib/module/NICardManagementComponents/ChangePinView.js +32 -0
  132. package/lib/module/NICardManagementComponents/ChangePinView.js.map +1 -0
  133. package/lib/module/NICardManagementComponents/NiInputInterfaces.js +3 -0
  134. package/lib/module/NICardManagementComponents/NiInputInterfaces.js.map +1 -0
  135. package/lib/module/NICardManagementComponents/SetPinView.js +32 -0
  136. package/lib/module/NICardManagementComponents/SetPinView.js.map +1 -0
  137. package/lib/module/NICardManagementComponents/VerifyPinView.js +32 -0
  138. package/lib/module/NICardManagementComponents/VerifyPinView.js.map +1 -0
  139. package/lib/module/NICardManagementComponents/ViewPinComponent.js +38 -0
  140. package/lib/module/NICardManagementComponents/ViewPinComponent.js.map +1 -0
  141. package/lib/module/assets/icons/content-copy.png +0 -0
  142. package/lib/module/assets/icons/eye-off-outline.png +0 -0
  143. package/lib/module/assets/icons/eye-outline.png +0 -0
  144. package/lib/module/assets/icons/icons8-arrow-100.png +0 -0
  145. package/lib/module/assets/icons/icons8-arrow-100_1.png +0 -0
  146. package/lib/module/assets/icons/red-eye-off-outline.png +0 -0
  147. package/lib/module/assets/icons/red-eye-outline.png +0 -0
  148. package/lib/module/assets/images/grayCard.png +0 -0
  149. package/lib/module/components/CardDetails/CardDetails.js +20 -0
  150. package/lib/module/components/CardDetails/CardDetails.js.map +1 -0
  151. package/lib/module/components/CardDetails/CardDetailsBackgroundImage.js +22 -0
  152. package/lib/module/components/CardDetails/CardDetailsBackgroundImage.js.map +1 -0
  153. package/lib/module/components/CardDetails/CardDetailsGroups.js +85 -0
  154. package/lib/module/components/CardDetails/CardDetailsGroups.js.map +1 -0
  155. package/lib/module/components/CardDetails/CardHolderNameGroups.js +60 -0
  156. package/lib/module/components/CardDetails/CardHolderNameGroups.js.map +1 -0
  157. package/lib/module/components/CardDetails/CardNumberGroup.js +62 -0
  158. package/lib/module/components/CardDetails/CardNumberGroup.js.map +1 -0
  159. package/lib/module/components/CardDetails/DateCVVGroupOneRow.js +97 -0
  160. package/lib/module/components/CardDetails/DateCVVGroupOneRow.js.map +1 -0
  161. package/lib/module/components/CardDetails/styles.js +92 -0
  162. package/lib/module/components/CardDetails/styles.js.map +1 -0
  163. package/lib/module/components/ChangePin/CaptureCurrentPin.js +43 -0
  164. package/lib/module/components/ChangePin/CaptureCurrentPin.js.map +1 -0
  165. package/lib/module/components/ChangePin/CaptureNewPin.js +43 -0
  166. package/lib/module/components/ChangePin/CaptureNewPin.js.map +1 -0
  167. package/lib/module/components/ChangePin/ChangePin.js +126 -0
  168. package/lib/module/components/ChangePin/ChangePin.js.map +1 -0
  169. package/lib/module/components/ChangePin/ConfirmPin.js +32 -0
  170. package/lib/module/components/ChangePin/ConfirmPin.js.map +1 -0
  171. package/lib/module/components/ChangePin/ReenterNewPin.js +46 -0
  172. package/lib/module/components/ChangePin/ReenterNewPin.js.map +1 -0
  173. package/lib/module/components/ChangePin/styles.js +23 -0
  174. package/lib/module/components/ChangePin/styles.js.map +1 -0
  175. package/lib/module/components/NIButton/NIButton.js +38 -0
  176. package/lib/module/components/NIButton/NIButton.js.map +1 -0
  177. package/lib/module/components/NIButton/styles.js +9 -0
  178. package/lib/module/components/NIButton/styles.js.map +1 -0
  179. package/lib/module/components/Pin/CapturePin.js +143 -0
  180. package/lib/module/components/Pin/CapturePin.js.map +1 -0
  181. package/lib/module/components/Pin/NextButton.js +33 -0
  182. package/lib/module/components/Pin/NextButton.js.map +1 -0
  183. package/lib/module/components/Pin/ShowHideButton.js +41 -0
  184. package/lib/module/components/Pin/ShowHideButton.js.map +1 -0
  185. package/lib/module/components/Pin/styles.js +55 -0
  186. package/lib/module/components/Pin/styles.js.map +1 -0
  187. package/lib/module/components/PinState/LoadingState.js +22 -0
  188. package/lib/module/components/PinState/LoadingState.js.map +1 -0
  189. package/lib/module/components/PinState/PinState.js +22 -0
  190. package/lib/module/components/PinState/PinState.js.map +1 -0
  191. package/lib/module/components/SetPin/ConfirmPin.js +32 -0
  192. package/lib/module/components/SetPin/ConfirmPin.js.map +1 -0
  193. package/lib/module/components/SetPin/ReenterCardPin.js +46 -0
  194. package/lib/module/components/SetPin/ReenterCardPin.js.map +1 -0
  195. package/lib/module/components/SetPin/SetPin.js +109 -0
  196. package/lib/module/components/SetPin/SetPin.js.map +1 -0
  197. package/lib/module/components/SetPin/SetUpNewCardPin.js +43 -0
  198. package/lib/module/components/SetPin/SetUpNewCardPin.js.map +1 -0
  199. package/lib/module/components/SetPin/styles.js +23 -0
  200. package/lib/module/components/SetPin/styles.js.map +1 -0
  201. package/lib/module/components/VerifyPin/CaptureVerifyPin.js +43 -0
  202. package/lib/module/components/VerifyPin/CaptureVerifyPin.js.map +1 -0
  203. package/lib/module/components/VerifyPin/ConfirmPin.js +33 -0
  204. package/lib/module/components/VerifyPin/ConfirmPin.js.map +1 -0
  205. package/lib/module/components/VerifyPin/VerifyPin.js +83 -0
  206. package/lib/module/components/VerifyPin/VerifyPin.js.map +1 -0
  207. package/lib/module/components/VerifyPin/styles.js +20 -0
  208. package/lib/module/components/VerifyPin/styles.js.map +1 -0
  209. package/lib/module/components/ViewPin/ViewPin.js +67 -0
  210. package/lib/module/components/ViewPin/ViewPin.js.map +1 -0
  211. package/lib/module/components/ViewPin/styles.js +13 -0
  212. package/lib/module/components/ViewPin/styles.js.map +1 -0
  213. package/lib/module/components/icons/PredeterminedIcon.js +35 -0
  214. package/lib/module/components/icons/PredeterminedIcon.js.map +1 -0
  215. package/lib/module/config/configCard.js +3 -0
  216. package/lib/module/config/configCard.js.map +1 -0
  217. package/lib/module/config/localization.js +41 -0
  218. package/lib/module/config/localization.js.map +1 -0
  219. package/lib/module/config/themeColors.js +29 -0
  220. package/lib/module/config/themeColors.js.map +1 -0
  221. package/lib/module/hooks/useChangePin.js +29 -0
  222. package/lib/module/hooks/useChangePin.js.map +1 -0
  223. package/lib/module/hooks/useGetCardDetails.js +29 -0
  224. package/lib/module/hooks/useGetCardDetails.js.map +1 -0
  225. package/lib/module/hooks/useSetPin.js +29 -0
  226. package/lib/module/hooks/useSetPin.js.map +1 -0
  227. package/lib/module/hooks/useVerifyPin.js +29 -0
  228. package/lib/module/hooks/useVerifyPin.js.map +1 -0
  229. package/lib/module/hooks/useViewPin.js +29 -0
  230. package/lib/module/hooks/useViewPin.js.map +1 -0
  231. package/lib/module/index.js +7 -0
  232. package/lib/module/index.js.map +1 -0
  233. package/lib/module/interfaces/NiCardManagementInterfaces.js +2 -0
  234. package/lib/module/interfaces/NiCardManagementInterfaces.js.map +1 -0
  235. package/lib/module/interfaces/NiInputInterfaces.js +33 -0
  236. package/lib/module/interfaces/NiInputInterfaces.js.map +1 -0
  237. package/lib/module/interfaces/NiInterfaces.js +8 -0
  238. package/lib/module/interfaces/NiInterfaces.js.map +1 -0
  239. package/lib/module/nativeComponents/NICardManagementSDKModule.js +3 -0
  240. package/lib/module/nativeComponents/NICardManagementSDKModule.js.map +1 -0
  241. package/lib/module/utils/formatInput.js +4 -0
  242. package/lib/module/utils/formatInput.js.map +1 -0
  243. package/lib/module/utils/localization.js +7 -0
  244. package/lib/module/utils/localization.js.map +1 -0
  245. package/lib/typescript/src/NICardManagementComponents/CardDetailsComponent.d.ts +7 -0
  246. package/lib/typescript/src/NICardManagementComponents/CardDetailsComponent.d.ts.map +1 -0
  247. package/lib/typescript/src/NICardManagementComponents/ChangePinView.d.ts +6 -0
  248. package/lib/typescript/src/NICardManagementComponents/ChangePinView.d.ts.map +1 -0
  249. package/lib/typescript/src/NICardManagementComponents/NiInputInterfaces.d.ts +4 -0
  250. package/lib/typescript/src/NICardManagementComponents/NiInputInterfaces.d.ts.map +1 -0
  251. package/lib/typescript/src/NICardManagementComponents/SetPinView.d.ts +6 -0
  252. package/lib/typescript/src/NICardManagementComponents/SetPinView.d.ts.map +1 -0
  253. package/lib/typescript/src/NICardManagementComponents/VerifyPinView.d.ts +6 -0
  254. package/lib/typescript/src/NICardManagementComponents/VerifyPinView.d.ts.map +1 -0
  255. package/lib/typescript/src/NICardManagementComponents/ViewPinComponent.d.ts +6 -0
  256. package/lib/typescript/src/NICardManagementComponents/ViewPinComponent.d.ts.map +1 -0
  257. package/lib/typescript/src/components/CardDetails/CardDetails.d.ts +4 -0
  258. package/lib/typescript/src/components/CardDetails/CardDetails.d.ts.map +1 -0
  259. package/lib/typescript/src/components/CardDetails/CardDetailsBackgroundImage.d.ts +4 -0
  260. package/lib/typescript/src/components/CardDetails/CardDetailsBackgroundImage.d.ts.map +1 -0
  261. package/lib/typescript/src/components/CardDetails/CardDetailsGroups.d.ts +4 -0
  262. package/lib/typescript/src/components/CardDetails/CardDetailsGroups.d.ts.map +1 -0
  263. package/lib/typescript/src/components/CardDetails/CardHolderNameGroups.d.ts +4 -0
  264. package/lib/typescript/src/components/CardDetails/CardHolderNameGroups.d.ts.map +1 -0
  265. package/lib/typescript/src/components/CardDetails/CardNumberGroup.d.ts +4 -0
  266. package/lib/typescript/src/components/CardDetails/CardNumberGroup.d.ts.map +1 -0
  267. package/lib/typescript/src/components/CardDetails/DateCVVGroupOneRow.d.ts +4 -0
  268. package/lib/typescript/src/components/CardDetails/DateCVVGroupOneRow.d.ts.map +1 -0
  269. package/lib/typescript/src/components/CardDetails/styles.d.ts +90 -0
  270. package/lib/typescript/src/components/CardDetails/styles.d.ts.map +1 -0
  271. package/lib/typescript/src/components/ChangePin/CaptureCurrentPin.d.ts +4 -0
  272. package/lib/typescript/src/components/ChangePin/CaptureCurrentPin.d.ts.map +1 -0
  273. package/lib/typescript/src/components/ChangePin/CaptureNewPin.d.ts +4 -0
  274. package/lib/typescript/src/components/ChangePin/CaptureNewPin.d.ts.map +1 -0
  275. package/lib/typescript/src/components/ChangePin/ChangePin.d.ts +5 -0
  276. package/lib/typescript/src/components/ChangePin/ChangePin.d.ts.map +1 -0
  277. package/lib/typescript/src/components/ChangePin/ConfirmPin.d.ts +4 -0
  278. package/lib/typescript/src/components/ChangePin/ConfirmPin.d.ts.map +1 -0
  279. package/lib/typescript/src/components/ChangePin/ReenterNewPin.d.ts +4 -0
  280. package/lib/typescript/src/components/ChangePin/ReenterNewPin.d.ts.map +1 -0
  281. package/lib/typescript/src/components/ChangePin/styles.d.ts +22 -0
  282. package/lib/typescript/src/components/ChangePin/styles.d.ts.map +1 -0
  283. package/lib/typescript/src/components/NIButton/NIButton.d.ts +13 -0
  284. package/lib/typescript/src/components/NIButton/NIButton.d.ts.map +1 -0
  285. package/lib/typescript/src/components/NIButton/styles.d.ts +8 -0
  286. package/lib/typescript/src/components/NIButton/styles.d.ts.map +1 -0
  287. package/lib/typescript/src/components/Pin/CapturePin.d.ts +4 -0
  288. package/lib/typescript/src/components/Pin/CapturePin.d.ts.map +1 -0
  289. package/lib/typescript/src/components/Pin/NextButton.d.ts +4 -0
  290. package/lib/typescript/src/components/Pin/NextButton.d.ts.map +1 -0
  291. package/lib/typescript/src/components/Pin/ShowHideButton.d.ts +4 -0
  292. package/lib/typescript/src/components/Pin/ShowHideButton.d.ts.map +1 -0
  293. package/lib/typescript/src/components/Pin/styles.d.ts +54 -0
  294. package/lib/typescript/src/components/Pin/styles.d.ts.map +1 -0
  295. package/lib/typescript/src/components/PinState/LoadingState.d.ts +7 -0
  296. package/lib/typescript/src/components/PinState/LoadingState.d.ts.map +1 -0
  297. package/lib/typescript/src/components/PinState/PinState.d.ts +8 -0
  298. package/lib/typescript/src/components/PinState/PinState.d.ts.map +1 -0
  299. package/lib/typescript/src/components/SetPin/ConfirmPin.d.ts +4 -0
  300. package/lib/typescript/src/components/SetPin/ConfirmPin.d.ts.map +1 -0
  301. package/lib/typescript/src/components/SetPin/ReenterCardPin.d.ts +4 -0
  302. package/lib/typescript/src/components/SetPin/ReenterCardPin.d.ts.map +1 -0
  303. package/lib/typescript/src/components/SetPin/SetPin.d.ts +5 -0
  304. package/lib/typescript/src/components/SetPin/SetPin.d.ts.map +1 -0
  305. package/lib/typescript/src/components/SetPin/SetUpNewCardPin.d.ts +4 -0
  306. package/lib/typescript/src/components/SetPin/SetUpNewCardPin.d.ts.map +1 -0
  307. package/lib/typescript/src/components/SetPin/styles.d.ts +22 -0
  308. package/lib/typescript/src/components/SetPin/styles.d.ts.map +1 -0
  309. package/lib/typescript/src/components/VerifyPin/CaptureVerifyPin.d.ts +4 -0
  310. package/lib/typescript/src/components/VerifyPin/CaptureVerifyPin.d.ts.map +1 -0
  311. package/lib/typescript/src/components/VerifyPin/ConfirmPin.d.ts +5 -0
  312. package/lib/typescript/src/components/VerifyPin/ConfirmPin.d.ts.map +1 -0
  313. package/lib/typescript/src/components/VerifyPin/VerifyPin.d.ts +5 -0
  314. package/lib/typescript/src/components/VerifyPin/VerifyPin.d.ts.map +1 -0
  315. package/lib/typescript/src/components/VerifyPin/styles.d.ts +19 -0
  316. package/lib/typescript/src/components/VerifyPin/styles.d.ts.map +1 -0
  317. package/lib/typescript/src/components/ViewPin/ViewPin.d.ts +5 -0
  318. package/lib/typescript/src/components/ViewPin/ViewPin.d.ts.map +1 -0
  319. package/lib/typescript/src/components/ViewPin/styles.d.ts +12 -0
  320. package/lib/typescript/src/components/ViewPin/styles.d.ts.map +1 -0
  321. package/lib/typescript/src/components/icons/PredeterminedIcon.d.ts +7 -0
  322. package/lib/typescript/src/components/icons/PredeterminedIcon.d.ts.map +1 -0
  323. package/lib/typescript/src/config/configCard.d.ts +3 -0
  324. package/lib/typescript/src/config/configCard.d.ts.map +1 -0
  325. package/lib/typescript/src/config/localization.d.ts +39 -0
  326. package/lib/typescript/src/config/localization.d.ts.map +1 -0
  327. package/lib/typescript/src/config/themeColors.d.ts +29 -0
  328. package/lib/typescript/src/config/themeColors.d.ts.map +1 -0
  329. package/lib/typescript/src/hooks/useChangePin.d.ts +9 -0
  330. package/lib/typescript/src/hooks/useChangePin.d.ts.map +1 -0
  331. package/lib/typescript/src/hooks/useGetCardDetails.d.ts +9 -0
  332. package/lib/typescript/src/hooks/useGetCardDetails.d.ts.map +1 -0
  333. package/lib/typescript/src/hooks/useSetPin.d.ts +9 -0
  334. package/lib/typescript/src/hooks/useSetPin.d.ts.map +1 -0
  335. package/lib/typescript/src/hooks/useVerifyPin.d.ts +9 -0
  336. package/lib/typescript/src/hooks/useVerifyPin.d.ts.map +1 -0
  337. package/lib/typescript/src/hooks/useViewPin.d.ts +9 -0
  338. package/lib/typescript/src/hooks/useViewPin.d.ts.map +1 -0
  339. package/lib/typescript/src/index.d.ts +7 -0
  340. package/lib/typescript/src/index.d.ts.map +1 -0
  341. package/lib/typescript/src/interfaces/NiCardManagementInterfaces.d.ts +37 -0
  342. package/lib/typescript/src/interfaces/NiCardManagementInterfaces.d.ts.map +1 -0
  343. package/lib/typescript/src/interfaces/NiInputInterfaces.d.ts +62 -0
  344. package/lib/typescript/src/interfaces/NiInputInterfaces.d.ts.map +1 -0
  345. package/lib/typescript/src/interfaces/NiInterfaces.d.ts +232 -0
  346. package/lib/typescript/src/interfaces/NiInterfaces.d.ts.map +1 -0
  347. package/lib/typescript/src/nativeComponents/NICardManagementSDKModule.d.ts +4 -0
  348. package/lib/typescript/src/nativeComponents/NICardManagementSDKModule.d.ts.map +1 -0
  349. package/lib/typescript/src/utils/formatInput.d.ts +4 -0
  350. package/lib/typescript/src/utils/formatInput.d.ts.map +1 -0
  351. package/lib/typescript/src/utils/localization.d.ts +20 -0
  352. package/lib/typescript/src/utils/localization.d.ts.map +1 -0
  353. package/package.json +167 -0
  354. package/react-native-ni-card-management.podspec +43 -0
  355. package/src/NICardManagementComponents/CardDetailsComponent.tsx +77 -0
  356. package/src/NICardManagementComponents/ChangePinView.tsx +41 -0
  357. package/src/NICardManagementComponents/NiInputInterfaces.ts +14 -0
  358. package/src/NICardManagementComponents/SetPinView.tsx +38 -0
  359. package/src/NICardManagementComponents/VerifyPinView.tsx +42 -0
  360. package/src/NICardManagementComponents/ViewPinComponent.tsx +48 -0
  361. package/src/assets/icons/content-copy.png +0 -0
  362. package/src/assets/icons/eye-off-outline.png +0 -0
  363. package/src/assets/icons/eye-outline.png +0 -0
  364. package/src/assets/icons/icons8-arrow-100.png +0 -0
  365. package/src/assets/icons/icons8-arrow-100_1.png +0 -0
  366. package/src/assets/icons/red-eye-off-outline.png +0 -0
  367. package/src/assets/icons/red-eye-outline.png +0 -0
  368. package/src/assets/images/grayCard.png +0 -0
  369. package/src/components/CardDetails/CardDetails.tsx +24 -0
  370. package/src/components/CardDetails/CardDetailsBackgroundImage.tsx +33 -0
  371. package/src/components/CardDetails/CardDetailsGroups.tsx +119 -0
  372. package/src/components/CardDetails/CardHolderNameGroups.tsx +101 -0
  373. package/src/components/CardDetails/CardNumberGroup.tsx +101 -0
  374. package/src/components/CardDetails/DateCVVGroupOneRow.tsx +146 -0
  375. package/src/components/CardDetails/styles.ts +105 -0
  376. package/src/components/ChangePin/CaptureCurrentPin.tsx +39 -0
  377. package/src/components/ChangePin/CaptureNewPin.tsx +39 -0
  378. package/src/components/ChangePin/ChangePin.tsx +153 -0
  379. package/src/components/ChangePin/ConfirmPin.tsx +47 -0
  380. package/src/components/ChangePin/ReenterNewPin.tsx +45 -0
  381. package/src/components/ChangePin/styles.ts +24 -0
  382. package/src/components/NIButton/NIButton.tsx +57 -0
  383. package/src/components/NIButton/styles.ts +10 -0
  384. package/src/components/Pin/CapturePin.tsx +227 -0
  385. package/src/components/Pin/NextButton.tsx +50 -0
  386. package/src/components/Pin/ShowHideButton.tsx +53 -0
  387. package/src/components/Pin/styles.ts +56 -0
  388. package/src/components/PinState/LoadingState.tsx +30 -0
  389. package/src/components/PinState/PinState.tsx +33 -0
  390. package/src/components/SetPin/ConfirmPin.tsx +47 -0
  391. package/src/components/SetPin/ReenterCardPin.tsx +45 -0
  392. package/src/components/SetPin/SetPin.tsx +140 -0
  393. package/src/components/SetPin/SetUpNewCardPin.tsx +39 -0
  394. package/src/components/SetPin/styles.ts +24 -0
  395. package/src/components/VerifyPin/CaptureVerifyPin.tsx +39 -0
  396. package/src/components/VerifyPin/ConfirmPin.tsx +49 -0
  397. package/src/components/VerifyPin/VerifyPin.tsx +105 -0
  398. package/src/components/VerifyPin/styles.ts +21 -0
  399. package/src/components/ViewPin/ViewPin.tsx +99 -0
  400. package/src/components/ViewPin/styles.ts +14 -0
  401. package/src/components/icons/PredeterminedIcon.tsx +41 -0
  402. package/src/config/configCard.ts +2 -0
  403. package/src/config/localization.ts +44 -0
  404. package/src/config/themeColors.ts +37 -0
  405. package/src/hooks/useChangePin.ts +39 -0
  406. package/src/hooks/useGetCardDetails.ts +38 -0
  407. package/src/hooks/useSetPin.ts +37 -0
  408. package/src/hooks/useVerifyPin.ts +37 -0
  409. package/src/hooks/useViewPin.ts +35 -0
  410. package/src/index.tsx +6 -0
  411. package/src/interfaces/NiCardManagementInterfaces.ts +61 -0
  412. package/src/interfaces/NiInputInterfaces.ts +78 -0
  413. package/src/interfaces/NiInterfaces.ts +259 -0
  414. package/src/nativeComponents/NICardManagementSDKModule.ts +5 -0
  415. package/src/utils/formatInput.ts +8 -0
  416. package/src/utils/localization.ts +10 -0
@@ -0,0 +1,140 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import {
3
+ Platform,
4
+ TouchableWithoutFeedback,
5
+ Keyboard,
6
+ type TextStyle,
7
+ View,
8
+ I18nManager,
9
+ } from 'react-native';
10
+
11
+ import {
12
+ NIThemeEnum,
13
+ NILanguageEnum,
14
+ NIPinTypeEnum,
15
+ } from '../../interfaces/NiInputInterfaces';
16
+ import { NIStepEnum, type NISetupPin } from '../../interfaces/NiInterfaces';
17
+ import SetUpNewCardPin from './SetUpNewCardPin';
18
+ import ReenterCardPin from './ReenterCardPin';
19
+ import NextButton from '../Pin/NextButton';
20
+ import ConfirmPin from './ConfirmPin';
21
+ import styles from './styles';
22
+ import { themeColors } from '../../config/themeColors';
23
+
24
+ function SetPin({
25
+ input,
26
+ pinType,
27
+ result,
28
+ isLoading,
29
+ onSetPin,
30
+ callback,
31
+ }: NISetupPin): JSX.Element {
32
+ const [pin, setPin] = useState<string>('');
33
+ const [confirmationPin, setConfirmationPin] = useState<string>('');
34
+ const [step, setNextStep] = useState(NIStepEnum.setupPinStep);
35
+ const [pinEditable, setPinEditable] = useState(true);
36
+ const [keyboardHeight, setKeyboardHeight] = useState<number>(0);
37
+ const [initialKeyboardHeight, setInitialKeyboardHeight] = useState<number>(0);
38
+
39
+ const language =
40
+ (input && (input.displayAttributes?.language as string)) ||
41
+ NILanguageEnum.english;
42
+ const theme = input?.displayAttributes?.theme || NIThemeEnum.light;
43
+
44
+ const container: TextStyle = {
45
+ backgroundColor:
46
+ theme === NIThemeEnum.light
47
+ ? themeColors.light.background
48
+ : themeColors.dark.background,
49
+ paddingBottom: Platform.OS === 'ios' ? keyboardHeight : 0,
50
+ };
51
+
52
+ const isVisibleConfirmationButtonStep = step === NIStepEnum.reEnterPinStep;
53
+ const isVisibleConfirmationButton =
54
+ isVisibleConfirmationButtonStep && pin === confirmationPin;
55
+ const disabled = !isVisibleConfirmationButton || isLoading || !!result;
56
+
57
+ const pinLength =
58
+ pinType === NIPinTypeEnum.dynamicFourToSix
59
+ ? NIPinTypeEnum.sixDigits
60
+ : pinType;
61
+ const isPinDone =
62
+ pinType === NIPinTypeEnum.dynamicFourToSix
63
+ ? pin.length >= NIPinTypeEnum.fourDigits
64
+ : pin.length === pinLength;
65
+ function onConfirmPin(): void {
66
+ !disabled && input && onSetPin && onSetPin(pin, input, callback);
67
+ setPinEditable(false);
68
+ }
69
+
70
+ useEffect(() => {
71
+ Keyboard.addListener('keyboardDidShow', () => {
72
+ const metrics = Keyboard.metrics();
73
+ if (!initialKeyboardHeight) {
74
+ setInitialKeyboardHeight(metrics?.height || 0);
75
+ }
76
+
77
+ setKeyboardHeight(metrics?.height || 0);
78
+ });
79
+ Keyboard.addListener('keyboardWillHide', () => {
80
+ setKeyboardHeight(0);
81
+ });
82
+ Keyboard.addListener('keyboardWillShow', () => {
83
+ if (initialKeyboardHeight) {
84
+ setKeyboardHeight(initialKeyboardHeight);
85
+ }
86
+ });
87
+ }, [initialKeyboardHeight]);
88
+
89
+ return (
90
+ <TouchableWithoutFeedback onPress={Keyboard.dismiss}>
91
+ <View style={[styles.container, container]}>
92
+ <SetUpNewCardPin
93
+ setPin={{ pin, setPin, pinEditable }}
94
+ setNextStep={{ step, setNextStep }}
95
+ pinType={pinType}
96
+ language={language}
97
+ theme={theme}
98
+ input={input}
99
+ />
100
+ <ReenterCardPin
101
+ setPin={{
102
+ confirmationPin,
103
+ setConfirmationPin,
104
+ pin,
105
+ pinEditable,
106
+ }}
107
+ setNextStep={{ step, onConfirmPin }}
108
+ pinType={pinType}
109
+ language={language}
110
+ theme={theme}
111
+ input={input}
112
+ />
113
+ {!isVisibleConfirmationButtonStep && (
114
+ <View
115
+ style={[
116
+ styles.capturePinSection,
117
+ I18nManager.isRTL ? { flexDirection: 'row' } : {},
118
+ ]}
119
+ >
120
+ <NextButton
121
+ setNextStep={{ step, setNextStep }}
122
+ disabled={!isPinDone}
123
+ theme={theme}
124
+ />
125
+ </View>
126
+ )}
127
+ {isVisibleConfirmationButtonStep && (
128
+ <ConfirmPin
129
+ language={language}
130
+ theme={theme}
131
+ disabled={!pinEditable || disabled}
132
+ onConfirmPin={onConfirmPin}
133
+ />
134
+ )}
135
+ </View>
136
+ </TouchableWithoutFeedback>
137
+ );
138
+ }
139
+
140
+ export default SetPin;
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+
3
+ import { NILabels } from '../../interfaces/NiInputInterfaces';
4
+ import {
5
+ type NISetUpNewCardPin,
6
+ NIStepEnum,
7
+ } from '../../interfaces/NiInterfaces';
8
+ import CapturePin from '../Pin/CapturePin';
9
+ import localLabels from '../../utils/localization';
10
+
11
+ export default function SetUpNewCardPin({
12
+ setPin: { pin, setPin, pinEditable },
13
+ setNextStep: { step, setNextStep },
14
+ pinType,
15
+ language,
16
+ theme,
17
+ input,
18
+ }: NISetUpNewCardPin): JSX.Element {
19
+ return (
20
+ <>
21
+ {step === NIStepEnum.setupPinStep && (
22
+ <CapturePin
23
+ setPin={{ pin, setPin, pinEditable }}
24
+ setNextStep={{ step, setNextStep }}
25
+ pinType={pinType}
26
+ title={localLabels(language).setPinButtonLabel}
27
+ pinLabel={localLabels(language).enterNewCardPin}
28
+ pinLabelIndex={NILabels.setPinDescriptionLabel}
29
+ showHideLabels={{
30
+ show: localLabels(language).show,
31
+ hide: localLabels(language).hide,
32
+ }}
33
+ theme={theme}
34
+ input={input}
35
+ />
36
+ )}
37
+ </>
38
+ );
39
+ }
@@ -0,0 +1,24 @@
1
+ import { StyleSheet } from 'react-native';
2
+
3
+ const styles = StyleSheet.create({
4
+ pinContainer: {
5
+ flex: 1,
6
+ },
7
+ container: {
8
+ flexDirection: 'column',
9
+ flex: 1,
10
+ justifyContent: 'space-between',
11
+ alignItems: 'center',
12
+ },
13
+ confirmButton: {
14
+ alignItems: 'center',
15
+ width: '80%',
16
+ marginBottom: 24,
17
+ height: 35,
18
+ },
19
+ capturePinSection: {
20
+ width: '80%',
21
+ },
22
+ });
23
+
24
+ export default styles;
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+
3
+ import { NILabels } from '../../interfaces/NiInputInterfaces';
4
+ import {
5
+ NIStepEnum,
6
+ type NICaptureVerifyPin,
7
+ } from '../../interfaces/NiInterfaces';
8
+ import CapturePin from '../Pin/CapturePin';
9
+ import localLabels from '../../utils/localization';
10
+
11
+ export default function CaptureVerifyPin({
12
+ setPin: { pin, setPin, pinEditable },
13
+ setNextStep: { step, onConfirmPin },
14
+ pinType,
15
+ language,
16
+ theme,
17
+ input,
18
+ }: NICaptureVerifyPin): JSX.Element {
19
+ return (
20
+ <>
21
+ {step === NIStepEnum.verifyStep && (
22
+ <CapturePin
23
+ setPin={{ pin, setPin: setPin, pinEditable }}
24
+ setNextStep={{ step, onConfirmPin }}
25
+ pinType={pinType}
26
+ title={localLabels(language).verifyPinButtonLabel}
27
+ pinLabel={localLabels(language).enterVerifyCardPin}
28
+ pinLabelIndex={NILabels.setPinDescriptionLabel}
29
+ showHideLabels={{
30
+ show: localLabels(language).show,
31
+ hide: localLabels(language).hide,
32
+ }}
33
+ theme={theme}
34
+ input={input}
35
+ />
36
+ )}
37
+ </>
38
+ );
39
+ }
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ import { type TextStyle, View } from 'react-native';
3
+
4
+ import { NIThemeEnum } from '../../interfaces/NiInputInterfaces';
5
+ import { type NIConfirmPin } from '../../interfaces/NiInterfaces';
6
+ import { themeColors } from '../../config/themeColors';
7
+ import { NIButton } from '../NIButton/NIButton';
8
+ import styles from './styles';
9
+ import localLabels from '../../utils/localization';
10
+
11
+ function ConfirmPin({
12
+ language,
13
+ theme,
14
+ disabled,
15
+ onConfirmPin,
16
+ }: NIConfirmPin): JSX.Element {
17
+ const buttonConfirmColorDisabled =
18
+ theme === NIThemeEnum.light
19
+ ? themeColors.light.buttonConfirmColorDisabled
20
+ : themeColors.dark.buttonConfirmColorDisabled;
21
+ const confirmButton: TextStyle = {
22
+ backgroundColor: buttonConfirmColorDisabled,
23
+ borderRadius: 20,
24
+ };
25
+
26
+ const textColor =
27
+ theme === NIThemeEnum.light
28
+ ? themeColors.light.buttonConfirmTextColor
29
+ : themeColors.dark.buttonConfirmTextColor;
30
+
31
+ const confirmPinButtonsLinearGradientColors =
32
+ theme === NIThemeEnum.light
33
+ ? themeColors.light.confirmPinButtonsLinearGradientColors
34
+ : themeColors.dark.confirmPinButtonsLinearGradientColors;
35
+ return (
36
+ <View style={[styles.confirmButton, confirmButton]}>
37
+ <NIButton
38
+ title={localLabels(language).verifyPinButtonLabel}
39
+ mode="text"
40
+ disabled={disabled}
41
+ textColor={textColor}
42
+ colors={confirmPinButtonsLinearGradientColors}
43
+ onPress={onConfirmPin}
44
+ />
45
+ </View>
46
+ );
47
+ }
48
+
49
+ export default ConfirmPin;
@@ -0,0 +1,105 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import {
3
+ View,
4
+ Platform,
5
+ TouchableWithoutFeedback,
6
+ Keyboard,
7
+ type TextStyle,
8
+ } from 'react-native';
9
+
10
+ import {
11
+ NILanguageEnum,
12
+ NIPinTypeEnum,
13
+ NIThemeEnum,
14
+ } from '../../interfaces/NiInputInterfaces';
15
+ import { NIStepEnum, type NIVerifyPin } from '../../interfaces/NiInterfaces';
16
+ import CaptureVerifyPin from './CaptureVerifyPin';
17
+ import ConfirmPin from './ConfirmPin';
18
+ import styles from './styles';
19
+ import { themeColors } from '../../config/themeColors';
20
+
21
+ function VerifyPin({
22
+ pinType,
23
+ input,
24
+ result,
25
+ isLoading,
26
+ onVerifyPin,
27
+ callback,
28
+ }: NIVerifyPin): JSX.Element {
29
+ const [pin, setPin] = useState<string>('');
30
+ const [step, setNextStep] = useState(NIStepEnum.verifyStep);
31
+ const [pinEditable, setPinEditable] = useState(true);
32
+ const [keyboardHeight, setKeyboardHeight] = useState<number>(0);
33
+ const [initialKeyboardHeight, setInitialKeyboardHeight] = useState<number>(0);
34
+
35
+ const { displayAttributes } = input || {};
36
+ const language =
37
+ (displayAttributes?.language as string) || NILanguageEnum.english;
38
+ const theme = input?.displayAttributes?.theme || NIThemeEnum.light;
39
+
40
+ const container: TextStyle = {
41
+ backgroundColor:
42
+ theme === NIThemeEnum.light
43
+ ? themeColors.light.background
44
+ : themeColors.dark.background,
45
+ paddingBottom: Platform.OS === 'ios' ? keyboardHeight : 0,
46
+ };
47
+
48
+ const isVisibleConfirmationButton = step === NIStepEnum.verifyStep;
49
+ const disabled = !isVisibleConfirmationButton || isLoading || !!result;
50
+
51
+ const pinLength =
52
+ pinType === NIPinTypeEnum.dynamicFourToSix
53
+ ? NIPinTypeEnum.sixDigits
54
+ : pinType;
55
+ const isPinDone =
56
+ pinType === NIPinTypeEnum.dynamicFourToSix
57
+ ? pin.length >= NIPinTypeEnum.fourDigits
58
+ : pin.length === pinLength;
59
+ function onConfirmPin() {
60
+ !disabled && input && onVerifyPin && onVerifyPin(pin, input, callback);
61
+ setPinEditable(false);
62
+ }
63
+
64
+ useEffect(() => {
65
+ Keyboard.addListener('keyboardDidShow', () => {
66
+ const metrics = Keyboard.metrics();
67
+ if (!initialKeyboardHeight) {
68
+ setInitialKeyboardHeight(metrics?.height || 0);
69
+ }
70
+
71
+ setKeyboardHeight(metrics?.height || 0);
72
+ });
73
+ Keyboard.addListener('keyboardWillHide', () => {
74
+ setKeyboardHeight(0);
75
+ });
76
+ Keyboard.addListener('keyboardWillShow', () => {
77
+ if (initialKeyboardHeight) {
78
+ setKeyboardHeight(initialKeyboardHeight);
79
+ }
80
+ });
81
+ }, [initialKeyboardHeight]);
82
+
83
+ return (
84
+ <TouchableWithoutFeedback onPress={Keyboard.dismiss}>
85
+ <View style={[styles.container, container]}>
86
+ <CaptureVerifyPin
87
+ setPin={{ pin, setPin, pinEditable }}
88
+ setNextStep={{ step, setNextStep, onConfirmPin }}
89
+ pinType={pinType}
90
+ language={language}
91
+ theme={theme}
92
+ input={input}
93
+ />
94
+ <ConfirmPin
95
+ language={language}
96
+ theme={theme}
97
+ disabled={!pinEditable || !isPinDone}
98
+ onConfirmPin={onConfirmPin}
99
+ />
100
+ </View>
101
+ </TouchableWithoutFeedback>
102
+ );
103
+ }
104
+
105
+ export default VerifyPin;
@@ -0,0 +1,21 @@
1
+ import { StyleSheet } from 'react-native';
2
+
3
+ const styles = StyleSheet.create({
4
+ pinContainer: {
5
+ flex: 1,
6
+ },
7
+ container: {
8
+ flexDirection: 'column',
9
+ flex: 1,
10
+ justifyContent: 'space-between',
11
+ alignItems: 'center',
12
+ },
13
+ confirmButton: {
14
+ alignItems: 'center',
15
+ width: '80%',
16
+ marginBottom: 24,
17
+ height: 35,
18
+ },
19
+ });
20
+
21
+ export default styles;
@@ -0,0 +1,99 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { Text, type TextStyle, View } from 'react-native';
3
+
4
+ import styles from './styles';
5
+ import { themeColors } from '../../config/themeColors';
6
+ import {
7
+ NILabels,
8
+ NILanguageEnum,
9
+ NIThemeEnum,
10
+ } from '../../interfaces/NiInputInterfaces';
11
+ import { type NIViewPin } from '../../interfaces/NiInterfaces';
12
+ import CapturePin from '../Pin/CapturePin';
13
+ import localLabels from '../../utils/localization';
14
+
15
+ function ViewPin({
16
+ pinType,
17
+ input,
18
+ result,
19
+ countdownTime,
20
+ }: NIViewPin): JSX.Element {
21
+ const [showPin, setShowPin] = useState<boolean>(true);
22
+ const [pinCount, setPinCount] = useState<number>(countdownTime);
23
+
24
+ const { displayAttributes } = input || {};
25
+ const language =
26
+ (displayAttributes?.language as string) || NILanguageEnum.english;
27
+ const theme = displayAttributes?.theme || NIThemeEnum.light;
28
+
29
+ const countdownLabelFont =
30
+ input &&
31
+ input.displayAttributes &&
32
+ input.displayAttributes.fonts &&
33
+ input.displayAttributes.fonts.filter(
34
+ (item) => item.label === NILabels.viewPinCountDownDescription
35
+ );
36
+ const countdownLabelStyle: TextStyle = {
37
+ color:
38
+ theme === NIThemeEnum.light
39
+ ? themeColors.light.color
40
+ : themeColors.dark.color,
41
+ fontSize:
42
+ countdownLabelFont === undefined || countdownLabelFont === null
43
+ ? 17
44
+ : countdownLabelFont[0]?.font.size,
45
+ fontFamily:
46
+ countdownLabelFont === undefined || countdownLabelFont === null
47
+ ? 'Helvetica'
48
+ : countdownLabelFont[0]?.font.name,
49
+ };
50
+
51
+ useEffect(() => {
52
+ if (result && countdownTime > 0) {
53
+ let counter = 0;
54
+ let interval = setInterval(() => {
55
+ setPinCount(countdownTime - 1 - counter);
56
+ if (++counter > countdownTime - 1) {
57
+ setShowPin(false);
58
+ clearInterval(interval);
59
+ }
60
+ }, 1000);
61
+ }
62
+ }, [result, countdownTime]);
63
+
64
+ return (
65
+ <View style={styles.container}>
66
+ {result && (
67
+ <CapturePin
68
+ setPin={{
69
+ pin: result,
70
+ setPin: (pin: string) => pin,
71
+ pinEditable: false,
72
+ }}
73
+ setNextStep={{
74
+ step: 0,
75
+ setNextStep: (step: number) => step,
76
+ }}
77
+ pinType={pinType}
78
+ title={''}
79
+ pinLabel={''}
80
+ pinLabelIndex={NILabels.viewPinDescriptionLabel}
81
+ showHideLabels={{
82
+ show: '',
83
+ hide: '',
84
+ }}
85
+ theme={theme}
86
+ input={input}
87
+ showPin={showPin}
88
+ />
89
+ )}
90
+ {!!result && !!pinCount && (
91
+ <Text style={[styles.countdownLabelSection, countdownLabelStyle]}>
92
+ {(localLabels(language).viewPinCountdownLabel as Function)(pinCount)}
93
+ </Text>
94
+ )}
95
+ </View>
96
+ );
97
+ }
98
+
99
+ export default ViewPin;
@@ -0,0 +1,14 @@
1
+ import { StyleSheet } from 'react-native';
2
+
3
+ const styles = StyleSheet.create({
4
+ container: {
5
+ width: '80%',
6
+ marginTop: 2,
7
+ },
8
+ countdownLabelSection: {
9
+ marginTop: 8,
10
+ alignSelf: 'center',
11
+ },
12
+ });
13
+
14
+ export default styles;
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { Image, type ImageStyle, type ImageURISource } from 'react-native';
3
+
4
+ export interface IconProps {
5
+ name: string;
6
+ size: number;
7
+ }
8
+
9
+ export const PredeterminedIcon = ({ name, size }: IconProps) => {
10
+ let imageSource;
11
+ switch (name) {
12
+ case 'red-eye':
13
+ imageSource =
14
+ require('../../assets/icons/red-eye-outline.png') as ImageURISource;
15
+ break;
16
+ case 'red-eye-off':
17
+ imageSource =
18
+ require('../../assets/icons/red-eye-off-outline.png') as ImageURISource;
19
+ break;
20
+ case 'eye':
21
+ imageSource =
22
+ require('../../assets/icons/eye-outline.png') as ImageURISource;
23
+ break;
24
+ case 'eye-off':
25
+ imageSource =
26
+ require('../../assets/icons/eye-off-outline.png') as ImageURISource;
27
+ break;
28
+ case 'content-copy':
29
+ default:
30
+ imageSource =
31
+ require('../../assets/icons/content-copy.png') as ImageURISource;
32
+ break;
33
+ }
34
+
35
+ const imageStyle: ImageStyle = {
36
+ width: size,
37
+ height: size,
38
+ };
39
+
40
+ return <Image source={imageSource} style={imageStyle} />;
41
+ };
@@ -0,0 +1,2 @@
1
+ export const HEIGHT_CARD = 210;
2
+ export const WIDTH_CARD = 95;
@@ -0,0 +1,44 @@
1
+ const english = {
2
+ cardNumber: 'CARD NUMBER',
3
+ expiry: 'Expiry',
4
+ CVV: 'CVV',
5
+ cardHolderName: 'Name',
6
+ enterNewCardPin: 'Enter your new card PIN to secure your card.',
7
+ confirmCardPIN: 'Confirm your card PIN.',
8
+ wrongCardPin: 'PIN does not match.\nPlease re-enter the card PIN',
9
+ enterCurrentCardPin: 'Enter your current card PIN to secure your card.',
10
+ enterVerifyCardPin: 'Enter your current card PIN for verification.',
11
+ verifyPinButtonLabel: 'Verify PIN',
12
+ setPinButtonLabel: 'Set PIN',
13
+ changePinButtonLabel: 'Change PIN',
14
+ copiedToClipboard: 'Copied to clipboard',
15
+ viewPinCountdownLabel: (count: number) =>
16
+ 'PIN will be hidden in ' + count + ' seconds',
17
+ show: 'Show',
18
+ hide: 'Hide',
19
+ };
20
+
21
+ const arabic = {
22
+ cardNumber: 'رقم البطاقة',
23
+ expiry: 'تاريخ الانتهاء',
24
+ CVV: '\u200Eرقم التحقق من البطاقة (CVV)',
25
+ cardHolderName: 'الإسم',
26
+ enterNewCardPin: '\u200Eالرجاء ادخال الرقم السري الجديد (PIN)',
27
+ confirmCardPIN: '\u200Eيرجى إعادة إدخال رقم السري لبطاقتك (PIN)',
28
+ wrongCardPin: '\u200Eالرقم السري لبطاقتك غير متطابق\n\u200Eيرجى إعادة إدخال رقم السري لبطاقتك (PIN)',
29
+ enterCurrentCardPin: '\u200Eالرجاء ادخال الرقم السري الحالي (PIN)',
30
+ enterVerifyCardPin: '\u200Eالرجاء إدخال رقم السري لبطاقتك للتحقق (PIN)',
31
+ verifyPinButtonLabel: 'التحقق من رقم السري لبطاقتك',
32
+ setPinButtonLabel: 'تعيين الرقم السري',
33
+ changePinButtonLabel: '\u200Eتغيير الرقم السري (PIN)',
34
+ copiedToClipboard: 'تم النسخ إلى الحافظة',
35
+ viewPinCountdownLabel: (count: number) =>
36
+ '\u200Eثواني\u200E ' + count + '\u200E سيتم إخفاء الرقم السري للبطاقة خلال',
37
+ show: '\u200Eعرض',
38
+ hide: '\u200Eإخفاء',
39
+ };
40
+
41
+ export const localization = {
42
+ english: english,
43
+ arabic: arabic,
44
+ };
@@ -0,0 +1,37 @@
1
+ const themeColors = {
2
+ light: {
3
+ background: 'white',
4
+ color: 'black',
5
+ colorCard: 'white',
6
+ colorActivityIndicator: '#041584"',
7
+
8
+ buttonConfirmTextColor: 'white',
9
+ buttonConfirmColorDisabled: 'gainsboro',
10
+
11
+ buttonCopiedTextColor: 'white',
12
+
13
+ buttonShowHideTextColor: 'red',
14
+ buttonShowHideColor: 'red',
15
+
16
+ buttonPrimaryTextColor: 'black',
17
+ confirmPinButtonsLinearGradientColors: ['#888888', '#555555', '#222222'],
18
+ },
19
+ dark: {
20
+ background: 'black',
21
+ color: 'white',
22
+ colorCard: 'white',
23
+ colorActivityIndicator: 'white',
24
+
25
+ buttonConfirmTextColor: 'white',
26
+ buttonConfirmColorDisabled: 'gainsboro',
27
+
28
+ buttonCopiedTextColor: 'white',
29
+
30
+ buttonShowHideTextColor: 'red',
31
+
32
+ buttonPrimaryTextColor: 'white',
33
+ confirmPinButtonsLinearGradientColors: ['#888888', '#555555', '#222222'],
34
+ },
35
+ };
36
+
37
+ export { themeColors };