@finspringinnovations/fdsdk 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 (315) hide show
  1. package/README.md +184 -0
  2. package/lib/api/applicationApi.d.ts +1 -0
  3. package/lib/api/applicationApi.js +11 -0
  4. package/lib/api/bankApi.d.ts +352 -0
  5. package/lib/api/bankApi.js +54 -0
  6. package/lib/api/baseApi.d.ts +8 -0
  7. package/lib/api/baseApi.js +456 -0
  8. package/lib/api/customerApi.d.ts +855 -0
  9. package/lib/api/customerApi.js +213 -0
  10. package/lib/api/fdApi.d.ts +979 -0
  11. package/lib/api/fdApi.js +112 -0
  12. package/lib/api/fdCalculatorApi.d.ts +179 -0
  13. package/lib/api/fdCalculatorApi.js +36 -0
  14. package/lib/api/index.d.ts +14 -0
  15. package/lib/api/index.js +45 -0
  16. package/lib/api/interestRateApi.d.ts +585 -0
  17. package/lib/api/interestRateApi.js +101 -0
  18. package/lib/api/kycApi.d.ts +486 -0
  19. package/lib/api/kycApi.js +71 -0
  20. package/lib/api/masterDataApi.d.ts +158 -0
  21. package/lib/api/masterDataApi.js +32 -0
  22. package/lib/api/nomineeApi.d.ts +325 -0
  23. package/lib/api/nomineeApi.js +46 -0
  24. package/lib/api/onboardingApi.d.ts +192 -0
  25. package/lib/api/onboardingApi.js +41 -0
  26. package/lib/api/panApi.d.ts +0 -0
  27. package/lib/api/panApi.js +23 -0
  28. package/lib/api/paymentApi.d.ts +325 -0
  29. package/lib/api/paymentApi.js +46 -0
  30. package/lib/api/workflowApi.d.ts +654 -0
  31. package/lib/api/workflowApi.js +90 -0
  32. package/lib/assets/images/images.d.ts +4 -0
  33. package/lib/assets/images/images.js +10 -0
  34. package/lib/components/AadhaarInput.d.ts +13 -0
  35. package/lib/components/AadhaarInput.js +47 -0
  36. package/lib/components/ActionButton.d.ts +12 -0
  37. package/lib/components/ActionButton.js +87 -0
  38. package/lib/components/ActiveFDCard.d.ts +16 -0
  39. package/lib/components/ActiveFDCard.js +95 -0
  40. package/lib/components/AmountInput.d.ts +20 -0
  41. package/lib/components/AmountInput.js +144 -0
  42. package/lib/components/CheckboxOption.d.ts +11 -0
  43. package/lib/components/CheckboxOption.js +41 -0
  44. package/lib/components/CompanyHeader.d.ts +7 -0
  45. package/lib/components/CompanyHeader.js +57 -0
  46. package/lib/components/DropdownSelector.d.ts +9 -0
  47. package/lib/components/DropdownSelector.js +49 -0
  48. package/lib/components/EmptyState.d.ts +17 -0
  49. package/lib/components/EmptyState.js +44 -0
  50. package/lib/components/ErrorDisplay.d.ts +17 -0
  51. package/lib/components/ErrorDisplay.js +69 -0
  52. package/lib/components/FAQItem.d.ts +9 -0
  53. package/lib/components/FAQItem.js +52 -0
  54. package/lib/components/FDCard.d.ts +21 -0
  55. package/lib/components/FDCard.js +96 -0
  56. package/lib/components/FormDropdown.d.ts +18 -0
  57. package/lib/components/FormDropdown.js +155 -0
  58. package/lib/components/FormSection.d.ts +14 -0
  59. package/lib/components/FormSection.js +38 -0
  60. package/lib/components/Header.d.ts +14 -0
  61. package/lib/components/Header.js +52 -0
  62. package/lib/components/IFSCSearchResultCard.d.ts +13 -0
  63. package/lib/components/IFSCSearchResultCard.js +70 -0
  64. package/lib/components/InfoBox.d.ts +8 -0
  65. package/lib/components/InfoBox.js +39 -0
  66. package/lib/components/InterestRateCard.d.ts +8 -0
  67. package/lib/components/InterestRateCard.js +46 -0
  68. package/lib/components/LoadingIndicator.d.ts +12 -0
  69. package/lib/components/LoadingIndicator.js +30 -0
  70. package/lib/components/OTPInput.d.ts +17 -0
  71. package/lib/components/OTPInput.js +144 -0
  72. package/lib/components/PaymentDetailsCard.d.ts +20 -0
  73. package/lib/components/PaymentDetailsCard.js +68 -0
  74. package/lib/components/PendingFDBottomSheet.d.ts +18 -0
  75. package/lib/components/PendingFDBottomSheet.js +122 -0
  76. package/lib/components/SafeAreaWrapper.d.ts +13 -0
  77. package/lib/components/SafeAreaWrapper.js +41 -0
  78. package/lib/components/ScreenHeader.d.ts +11 -0
  79. package/lib/components/ScreenHeader.js +46 -0
  80. package/lib/components/StatusDisplay.d.ts +15 -0
  81. package/lib/components/StatusDisplay.js +88 -0
  82. package/lib/components/TextFieldWithLabel.d.ts +46 -0
  83. package/lib/components/TextFieldWithLabel.js +326 -0
  84. package/lib/components/TrustBox.d.ts +8 -0
  85. package/lib/components/TrustBox.js +45 -0
  86. package/lib/components/ValidationErrorAlert.d.ts +23 -0
  87. package/lib/components/ValidationErrorAlert.js +39 -0
  88. package/lib/components/ValidationMessage.d.ts +9 -0
  89. package/lib/components/ValidationMessage.js +98 -0
  90. package/lib/components/index.d.ts +35 -0
  91. package/lib/components/index.js +64 -0
  92. package/lib/config/apiConfig.d.ts +34 -0
  93. package/lib/config/apiConfig.js +158 -0
  94. package/lib/config/appDataConfig.d.ts +114 -0
  95. package/lib/config/appDataConfig.js +264 -0
  96. package/lib/config/encryptionConfig.d.ts +21 -0
  97. package/lib/config/encryptionConfig.js +61 -0
  98. package/lib/config/workflowConstants.d.ts +37 -0
  99. package/lib/config/workflowConstants.js +38 -0
  100. package/lib/constants/strings/bank.d.ts +72 -0
  101. package/lib/constants/strings/bank.js +86 -0
  102. package/lib/constants/strings/base64Images.d.ts +25 -0
  103. package/lib/constants/strings/base64Images.js +28 -0
  104. package/lib/constants/strings/common.d.ts +53 -0
  105. package/lib/constants/strings/common.js +62 -0
  106. package/lib/constants/strings/employee.d.ts +61 -0
  107. package/lib/constants/strings/employee.js +77 -0
  108. package/lib/constants/strings/faq.d.ts +14 -0
  109. package/lib/constants/strings/faq.js +20 -0
  110. package/lib/constants/strings/fd.d.ts +122 -0
  111. package/lib/constants/strings/fd.js +151 -0
  112. package/lib/constants/strings/home.d.ts +49 -0
  113. package/lib/constants/strings/home.js +62 -0
  114. package/lib/constants/strings/index.d.ts +16 -0
  115. package/lib/constants/strings/index.js +44 -0
  116. package/lib/constants/strings/kyc.d.ts +80 -0
  117. package/lib/constants/strings/kyc.js +94 -0
  118. package/lib/constants/strings/nominee.d.ts +64 -0
  119. package/lib/constants/strings/nominee.js +81 -0
  120. package/lib/hooks/useAuth.d.ts +25 -0
  121. package/lib/hooks/useAuth.js +39 -0
  122. package/lib/hooks/useFDData.d.ts +11 -0
  123. package/lib/hooks/useFDData.js +40 -0
  124. package/lib/index.d.ts +69 -0
  125. package/lib/index.js +182 -0
  126. package/lib/navigation/RootNavigator.d.ts +8 -0
  127. package/lib/navigation/RootNavigator.js +205 -0
  128. package/lib/navigation/SimpleNavigator.d.ts +11 -0
  129. package/lib/navigation/SimpleNavigator.js +107 -0
  130. package/lib/navigation/helpers.d.ts +11 -0
  131. package/lib/navigation/helpers.js +83 -0
  132. package/lib/navigation/index.d.ts +15 -0
  133. package/lib/navigation/index.js +42 -0
  134. package/lib/navigation/types.d.ts +113 -0
  135. package/lib/navigation/types.js +2 -0
  136. package/lib/navigation/workflowNavigator.d.ts +22 -0
  137. package/lib/navigation/workflowNavigator.js +104 -0
  138. package/lib/providers/ApiProvider.d.ts +7 -0
  139. package/lib/providers/ApiProvider.js +34 -0
  140. package/lib/providers/MasterDataProvider.d.ts +10 -0
  141. package/lib/providers/MasterDataProvider.js +54 -0
  142. package/lib/screens/AadhaarVerification.d.ts +7 -0
  143. package/lib/screens/AadhaarVerification.js +627 -0
  144. package/lib/screens/AddBankAccount.d.ts +22 -0
  145. package/lib/screens/AddBankAccount.js +381 -0
  146. package/lib/screens/BankDetail.d.ts +16 -0
  147. package/lib/screens/BankDetail.js +596 -0
  148. package/lib/screens/BookFD.d.ts +0 -0
  149. package/lib/screens/BookFD.js +315 -0
  150. package/lib/screens/Employee.d.ts +18 -0
  151. package/lib/screens/Employee.js +594 -0
  152. package/lib/screens/FDCalculator.d.ts +18 -0
  153. package/lib/screens/FDCalculator.js +759 -0
  154. package/lib/screens/FDList.d.ts +27 -0
  155. package/lib/screens/FDList.js +1008 -0
  156. package/lib/screens/FindIFSC.d.ts +16 -0
  157. package/lib/screens/FindIFSC.js +248 -0
  158. package/lib/screens/Home.d.ts +0 -0
  159. package/lib/screens/Home.js +143 -0
  160. package/lib/screens/NomineeDetail.d.ts +17 -0
  161. package/lib/screens/NomineeDetail.js +592 -0
  162. package/lib/screens/PayNow.d.ts +14 -0
  163. package/lib/screens/PayNow.js +230 -0
  164. package/lib/screens/Payment.d.ts +11 -0
  165. package/lib/screens/Payment.js +191 -0
  166. package/lib/screens/PaymentStatus.d.ts +16 -0
  167. package/lib/screens/PaymentStatus.js +397 -0
  168. package/lib/screens/ReviewKYC.d.ts +21 -0
  169. package/lib/screens/ReviewKYC.js +660 -0
  170. package/lib/state/paymentSession.d.ts +8 -0
  171. package/lib/state/paymentSession.js +13 -0
  172. package/lib/store/fdListSelectedSlice.d.ts +21 -0
  173. package/lib/store/fdListSelectedSlice.js +26 -0
  174. package/lib/store/hooks.d.ts +8 -0
  175. package/lib/store/hooks.js +31 -0
  176. package/lib/store/index.d.ts +3 -0
  177. package/lib/store/index.js +8 -0
  178. package/lib/store/onboardingSlice.d.ts +12 -0
  179. package/lib/store/onboardingSlice.js +32 -0
  180. package/lib/store/store.d.ts +13 -0
  181. package/lib/store/store.js +33 -0
  182. package/lib/theme/ThemeContext.d.ts +210 -0
  183. package/lib/theme/ThemeContext.js +90 -0
  184. package/lib/theme/colors.d.ts +80 -0
  185. package/lib/theme/colors.js +85 -0
  186. package/lib/theme/index.d.ts +34 -0
  187. package/lib/theme/index.js +69 -0
  188. package/lib/theme/shadows.d.ts +53 -0
  189. package/lib/theme/shadows.js +58 -0
  190. package/lib/theme/typography.d.ts +134 -0
  191. package/lib/theme/typography.js +143 -0
  192. package/lib/types/dataTypes.d.ts +34 -0
  193. package/lib/types/dataTypes.js +2 -0
  194. package/lib/types/workflowTypes.d.ts +2 -0
  195. package/lib/types/workflowTypes.js +2 -0
  196. package/lib/utils/apiLogger.d.ts +48 -0
  197. package/lib/utils/apiLogger.js +105 -0
  198. package/lib/utils/encryption.d.ts +28 -0
  199. package/lib/utils/encryption.js +113 -0
  200. package/lib/utils/getFDData.d.ts +48 -0
  201. package/lib/utils/getFDData.js +154 -0
  202. package/lib/utils/globalData.d.ts +2 -0
  203. package/lib/utils/globalData.js +10 -0
  204. package/package.json +76 -0
  205. package/src/api/applicationApi.ts +12 -0
  206. package/src/api/bankApi.ts +42 -0
  207. package/src/api/baseApi.ts +513 -0
  208. package/src/api/customerApi.ts +291 -0
  209. package/src/api/fdApi.ts +150 -0
  210. package/src/api/fdCalculatorApi.ts +41 -0
  211. package/src/api/index.ts +29 -0
  212. package/src/api/interestRateApi.ts +143 -0
  213. package/src/api/kycApi.ts +63 -0
  214. package/src/api/masterDataApi.ts +34 -0
  215. package/src/api/nomineeApi.ts +34 -0
  216. package/src/api/onboardingApi.ts +64 -0
  217. package/src/api/panApi.ts +25 -0
  218. package/src/api/paymentApi.ts +34 -0
  219. package/src/api/workflowApi.ts +94 -0
  220. package/src/assets/images/arrow-filled.png +0 -0
  221. package/src/assets/images/arrow-left.png +0 -0
  222. package/src/assets/images/backicon.png +0 -0
  223. package/src/assets/images/calendar.png +0 -0
  224. package/src/assets/images/chevron-down.png +0 -0
  225. package/src/assets/images/chevron-down@2x.png +0 -0
  226. package/src/assets/images/chevron-down@3x.png +0 -0
  227. package/src/assets/images/images.js +8 -0
  228. package/src/components/AadhaarInput.tsx +91 -0
  229. package/src/components/ActionButton.tsx +129 -0
  230. package/src/components/ActiveFDCard.tsx +158 -0
  231. package/src/components/AmountInput.tsx +217 -0
  232. package/src/components/CheckboxOption.tsx +93 -0
  233. package/src/components/CompanyHeader.tsx +78 -0
  234. package/src/components/DropdownSelector.tsx +77 -0
  235. package/src/components/EmptyState.tsx +109 -0
  236. package/src/components/ErrorDisplay.tsx +135 -0
  237. package/src/components/FAQItem.tsx +90 -0
  238. package/src/components/FDCard.tsx +165 -0
  239. package/src/components/FormDropdown.tsx +214 -0
  240. package/src/components/FormSection.tsx +86 -0
  241. package/src/components/Header.tsx +110 -0
  242. package/src/components/IFSCSearchResultCard.tsx +139 -0
  243. package/src/components/InfoBox.tsx +55 -0
  244. package/src/components/InterestRateCard.tsx +77 -0
  245. package/src/components/LoadingIndicator.tsx +63 -0
  246. package/src/components/OTPInput.tsx +213 -0
  247. package/src/components/PaymentDetailsCard.tsx +120 -0
  248. package/src/components/PendingFDBottomSheet.tsx +235 -0
  249. package/src/components/README.md +210 -0
  250. package/src/components/SafeAreaWrapper.tsx +68 -0
  251. package/src/components/ScreenHeader.tsx +83 -0
  252. package/src/components/StatusDisplay.tsx +139 -0
  253. package/src/components/TextFieldWithLabel.tsx +502 -0
  254. package/src/components/TrustBox.tsx +63 -0
  255. package/src/components/ValidationErrorAlert.tsx +57 -0
  256. package/src/components/ValidationMessage.tsx +134 -0
  257. package/src/components/index.tsx +47 -0
  258. package/src/config/apiConfig.ts +217 -0
  259. package/src/config/appDataConfig.ts +279 -0
  260. package/src/config/encryptionConfig.ts +65 -0
  261. package/src/config/workflowConstants.ts +43 -0
  262. package/src/constants/strings/README.md +146 -0
  263. package/src/constants/strings/bank.ts +92 -0
  264. package/src/constants/strings/base64Images.ts +29 -0
  265. package/src/constants/strings/common.ts +63 -0
  266. package/src/constants/strings/employee.ts +85 -0
  267. package/src/constants/strings/faq.ts +23 -0
  268. package/src/constants/strings/fd.ts +172 -0
  269. package/src/constants/strings/home.ts +67 -0
  270. package/src/constants/strings/index.ts +21 -0
  271. package/src/constants/strings/kyc.ts +100 -0
  272. package/src/constants/strings/nominee.ts +90 -0
  273. package/src/hooks/useAuth.ts +42 -0
  274. package/src/hooks/useFDData.ts +48 -0
  275. package/src/index.tsx +173 -0
  276. package/src/navigation/RootNavigator.tsx +352 -0
  277. package/src/navigation/SimpleNavigator.tsx +107 -0
  278. package/src/navigation/helpers.ts +85 -0
  279. package/src/navigation/index.tsx +81 -0
  280. package/src/navigation/types.ts +124 -0
  281. package/src/navigation/workflowNavigator.ts +131 -0
  282. package/src/providers/ApiProvider.tsx +43 -0
  283. package/src/providers/MasterDataProvider.tsx +30 -0
  284. package/src/screens/AadhaarVerification.tsx +809 -0
  285. package/src/screens/AddBankAccount.tsx +541 -0
  286. package/src/screens/BankDetail.tsx +826 -0
  287. package/src/screens/BookFD.tsx +330 -0
  288. package/src/screens/Employee.tsx +822 -0
  289. package/src/screens/FDCalculator.tsx +987 -0
  290. package/src/screens/FDList.tsx +1284 -0
  291. package/src/screens/FindIFSC.tsx +332 -0
  292. package/src/screens/Home.tsx +152 -0
  293. package/src/screens/NomineeDetail.tsx +800 -0
  294. package/src/screens/PayNow.tsx +282 -0
  295. package/src/screens/Payment.tsx +224 -0
  296. package/src/screens/PaymentStatus.tsx +561 -0
  297. package/src/screens/ReviewKYC.tsx +956 -0
  298. package/src/state/paymentSession.ts +13 -0
  299. package/src/store/fdListSelectedSlice.ts +42 -0
  300. package/src/store/hooks.ts +27 -0
  301. package/src/store/index.ts +3 -0
  302. package/src/store/onboardingSlice.ts +37 -0
  303. package/src/store/store.ts +35 -0
  304. package/src/theme/ThemeContext.tsx +82 -0
  305. package/src/theme/colors.ts +90 -0
  306. package/src/theme/index.ts +64 -0
  307. package/src/theme/shadows.ts +61 -0
  308. package/src/theme/typography.ts +151 -0
  309. package/src/types/dataTypes.ts +37 -0
  310. package/src/types/env.d.ts +93 -0
  311. package/src/types/workflowTypes.ts +12 -0
  312. package/src/utils/apiLogger.ts +166 -0
  313. package/src/utils/encryption.ts +159 -0
  314. package/src/utils/getFDData.ts +175 -0
  315. package/src/utils/globalData.ts +7 -0
@@ -0,0 +1,13 @@
1
+ let lastPaymentUrl: string | undefined;
2
+ let lastTransactionId: string | undefined;
3
+
4
+ export function setPaymentSession(params: { paymentUrl?: string; transactionId?: string }) {
5
+ lastPaymentUrl = params.paymentUrl;
6
+ lastTransactionId = params.transactionId;
7
+ }
8
+
9
+ export function getPaymentSession() {
10
+ return { paymentUrl: lastPaymentUrl, transactionId: lastTransactionId };
11
+ }
12
+
13
+
@@ -0,0 +1,42 @@
1
+ import { createSlice, PayloadAction, createReducer } from '@reduxjs/toolkit';
2
+
3
+ export interface FDListSelectedData {
4
+ id: string;
5
+ providerId: string;
6
+ name: string;
7
+ accountNumber: string;
8
+ roi: string;
9
+ tenure: string;
10
+ amount: number;
11
+ maturityDate: string;
12
+ status: 'active' | 'matured' | 'pending';
13
+ creditRating: string;
14
+ // Additional fields for PayNow display
15
+ companyName: string;
16
+ fdRate: string;
17
+ interestPayout: string;
18
+ }
19
+
20
+ const initialState: FDListSelectedData | null = null;
21
+
22
+ const fdListSelectedSlice = createSlice({
23
+ name: 'fdListSelected',
24
+ initialState: initialState as any,
25
+ reducers: {
26
+ setFDListSelected: (state: any, action: PayloadAction<FDListSelectedData>) => {
27
+ // Replace the entire state with the new payload
28
+ return action.payload;
29
+ },
30
+ clearFDListSelected: (state: any) => {
31
+ return null;
32
+ },
33
+ updateFDListSelectedField: (state: any, action: PayloadAction<{ field: keyof FDListSelectedData; value: any }>) => {
34
+ if (state) {
35
+ state[action.payload.field] = action.payload.value;
36
+ }
37
+ },
38
+ },
39
+ });
40
+
41
+ export const { setFDListSelected, clearFDListSelected, updateFDListSelectedField } = fdListSelectedSlice.actions;
42
+ export default fdListSelectedSlice.reducer;
@@ -0,0 +1,27 @@
1
+ import { useDispatch, useSelector, TypedUseSelectorHook } from 'react-redux';
2
+ import type { RootState, AppDispatch } from './store';
3
+
4
+ // Use throughout your app instead of plain `useDispatch` and `useSelector`
5
+ // ✅ These hooks automatically use the nearest Redux Provider's store
6
+ // Since SDK screens are wrapped in ApiProvider, they will use SDK's store
7
+ export const useAppDispatch = () => {
8
+ try {
9
+ return useDispatch<AppDispatch>();
10
+ } catch (error) {
11
+ if (__DEV__) {
12
+ console.error('❌ [useAppDispatch] Error: Component must be wrapped in ApiProvider', error);
13
+ }
14
+ throw error;
15
+ }
16
+ };
17
+
18
+ export const useAppSelector: TypedUseSelectorHook<RootState> = (selector) => {
19
+ try {
20
+ return useSelector(selector);
21
+ } catch (error) {
22
+ if (__DEV__) {
23
+ console.error('❌ [useAppSelector] Error: Component must be wrapped in ApiProvider', error);
24
+ }
25
+ throw error;
26
+ }
27
+ };
@@ -0,0 +1,3 @@
1
+ export { store } from './store';
2
+ export { useAppDispatch, useAppSelector } from './hooks';
3
+ export type { RootState, AppDispatch } from './store';
@@ -0,0 +1,37 @@
1
+ import { createSlice, PayloadAction } from '@reduxjs/toolkit';
2
+
3
+ export interface OnboardingIds {
4
+ workflowInstanceId?: string;
5
+ applicationId?: string;
6
+ entityid?: string;
7
+ customerId?: string;
8
+ fdId?: string;
9
+ providerId?: string;
10
+ wfStatus?: string;
11
+ }
12
+
13
+ const initialState: OnboardingIds = {};
14
+
15
+ const onboardingSlice = createSlice({
16
+ name: 'onboarding',
17
+ initialState,
18
+ reducers: {
19
+ setOnboardingIds: (state, action: PayloadAction<OnboardingIds>) => {
20
+ const { workflowInstanceId, applicationId, entityid, customerId, fdId, providerId, wfStatus } = action.payload;
21
+ if (workflowInstanceId) state.workflowInstanceId = workflowInstanceId;
22
+ if (applicationId) state.applicationId = applicationId;
23
+ if (entityid) state.entityid = entityid;
24
+ if (customerId) state.customerId = customerId;
25
+ if (fdId) state.fdId = fdId;
26
+ if (providerId) state.providerId = providerId;
27
+ if (wfStatus) state.wfStatus = wfStatus;
28
+ },
29
+ clearOnboardingIds: () => initialState,
30
+
31
+ },
32
+ });
33
+
34
+ export const { setOnboardingIds, clearOnboardingIds } = onboardingSlice.actions;
35
+ export default onboardingSlice.reducer;
36
+
37
+
@@ -0,0 +1,35 @@
1
+ import { configureStore } from '@reduxjs/toolkit';
2
+ import { baseApi, setSDKStoreRef } from '../api/baseApi';
3
+ import onboardingReducer from './onboardingSlice';
4
+ import fdListSelectedReducer from './fdListSelectedSlice';
5
+
6
+ // Configure the Redux store
7
+ export const store = configureStore({
8
+ reducer: {
9
+ // Add the generated reducer as a specific top-level slice
10
+ [baseApi.reducerPath]: baseApi.reducer,
11
+ onboarding: onboardingReducer,
12
+ fdListSelected: fdListSelectedReducer,
13
+ },
14
+ // Adding the api middleware enables caching, invalidation, polling,
15
+ // and other useful features of `rtk-query`.
16
+ middleware: (getDefaultMiddleware) =>
17
+ getDefaultMiddleware({
18
+ serializableCheck: {
19
+ // Ignore these action types for serializable check
20
+ ignoredActions: ['persist/PERSIST', 'persist/REHYDRATE'],
21
+ },
22
+ }).concat(baseApi.middleware),
23
+ });
24
+
25
+ // ✅ FIX: Set SDK store reference in baseApi to ensure interceptor always uses SDK's store
26
+ // This prevents conflicts when parent app also uses baseApi.middleware
27
+ setSDKStoreRef(store);
28
+
29
+ if (__DEV__) {
30
+ console.log('✅ [SDK Store] Store created and reference set in baseApi');
31
+ }
32
+
33
+ // Infer the `RootState` and `AppDispatch` types from the store itself
34
+ export type RootState = ReturnType<typeof store.getState>;
35
+ export type AppDispatch = typeof store.dispatch;
@@ -0,0 +1,82 @@
1
+ import React, { createContext, useContext, ReactNode } from 'react';
2
+ import { createTheme, type Theme, type ThemeName, defaultTheme } from './index';
3
+
4
+ interface ThemeContextType {
5
+ theme: Theme;
6
+ themeName: ThemeName;
7
+ setTheme: (themeName: ThemeName) => void;
8
+ }
9
+
10
+ const ThemeContext = createContext<ThemeContextType | undefined>(undefined);
11
+
12
+ interface ThemeProviderProps {
13
+ children: ReactNode;
14
+ initialTheme?: ThemeName;
15
+ theme?: Theme; // Allow custom theme override
16
+ }
17
+
18
+ export const ThemeProvider: React.FC<ThemeProviderProps> = ({
19
+ children,
20
+ initialTheme = 'primary',
21
+ theme: customTheme,
22
+ }) => {
23
+ const [currentThemeName, setCurrentThemeName] = React.useState<ThemeName>(initialTheme);
24
+
25
+ const theme = customTheme || createTheme(currentThemeName);
26
+
27
+ const setTheme = React.useCallback((themeName: ThemeName) => {
28
+ setCurrentThemeName(themeName);
29
+ }, []);
30
+
31
+ const value = React.useMemo(
32
+ () => ({
33
+ theme,
34
+ themeName: currentThemeName,
35
+ setTheme,
36
+ }),
37
+ [theme, currentThemeName, setTheme]
38
+ );
39
+
40
+ return (
41
+ <ThemeContext.Provider value={value}>
42
+ {children}
43
+ </ThemeContext.Provider>
44
+ );
45
+ };
46
+
47
+ export const useTheme = (): ThemeContextType => {
48
+ const context = useContext(ThemeContext);
49
+ if (context === undefined) {
50
+ // Return default theme if no provider
51
+ return {
52
+ theme: defaultTheme,
53
+ themeName: 'primary',
54
+ setTheme: () => { },
55
+ };
56
+ }
57
+ return context;
58
+ };
59
+
60
+ // Hook for just getting theme colors
61
+ export const useColors = () => {
62
+ const { theme } = useTheme();
63
+ return theme.colors;
64
+ };
65
+
66
+ // Hook for getting typography
67
+ export const useTypography = () => {
68
+ const { theme } = useTheme();
69
+ return theme.typography;
70
+ };
71
+
72
+ // Hook for getting shadows
73
+ export const useShadows = () => {
74
+ const { theme } = useTheme();
75
+ return theme.shadows;
76
+ };
77
+
78
+ // Hook for getting spacing
79
+ export const useSpacing = () => {
80
+ const { theme } = useTheme();
81
+ return theme.spacing;
82
+ };
@@ -0,0 +1,90 @@
1
+ // Color palette for the SDK
2
+ export const colors = {
3
+ // Primary Theme (Default)
4
+ primary: {
5
+ primary: '#3073e0', // Main primary color
6
+ tabSelected: '#3073e0',
7
+ headerBg: '#415fe6',
8
+ headerText: '#ffffff', // White header text
9
+ success: '#32c997', // 7.5% ap
10
+ textSecondary: '#8f8f8f', // ROI text
11
+ border: '#606677', // with 36% opacity
12
+ shadow: '#000000', // with 10% opacity
13
+
14
+ // Additional colors for complete theme
15
+ background: '#ffffff',
16
+ surface: '#f8f9fa',
17
+ text: '#1a1a1a',
18
+ textLight: '#6c757d',
19
+ error: '#dc3545',
20
+ warning: '#ffc107',
21
+ info: '#17a2b8',
22
+ muted: '#f0f0f0',
23
+ black: '#000000',
24
+ inputBackground: '#ffffff', // Input and box background color for primary theme
25
+ inputBorder: '#606677', // Input border color for primary theme
26
+ placeholderColor: 'rgba(0,0,0,0.2)', // Placeholder color for primary theme
27
+ labelColor: '#1a1a1a', // Label text color for primary theme
28
+ buttonBackground: '#415fe6', // Button background color for primary theme
29
+ buttonTextColor: '#ffffff', // Button text color for primary theme
30
+ cancelButtonBg: '#f8f9fa', // Cancel button background for primary theme
31
+ },
32
+
33
+ // Alternative themes can be added here
34
+ dark: {
35
+ primary: '#4285f4', // Main primary color
36
+ tabSelected: '#ffc631',
37
+ headerBg: '#051620',
38
+ headerText: '#ffffff', // White header text for dark theme
39
+ success: '#48bb78',
40
+ textSecondary: '#a0aec0',
41
+ border: '#154c6e',
42
+ shadow: '#154c6e',
43
+
44
+ background: '#000000', // Pure black background
45
+ surface: '#082739',
46
+ text: '#ffffff',
47
+ textLight: '#a0aec0',
48
+ error: '#f56565',
49
+ warning: '#ed8936',
50
+ info: '#4299e1',
51
+ muted: '#2a2a2a',
52
+ inputBackground: '#082739', // Input and box background color for dark theme
53
+ inputBorder: '#195C86', // Input border color for dark theme
54
+ placeholderColor: '#a0aec0', // Placeholder color for dark theme (light gray)
55
+ labelColor: '#ffffff', // Label text color for dark theme (white)
56
+ buttonBackground: '#ffc631', // Button background color for dark theme
57
+ buttonTextColor: '#000000', // Button text color for dark theme (black)
58
+ cancelButtonBg: '#0d3248', // Cancel button background for dark theme
59
+ },
60
+
61
+ corporate: {
62
+ primary: '#1e40af', // Main primary color
63
+ tabSelected: '#1e40af',
64
+ headerBg: '#3730a3',
65
+ headerText: '#ffffff', // White header text
66
+ success: '#059669',
67
+ textSecondary: '#6b7280',
68
+ border: '#9ca3af',
69
+ shadow: '#000000',
70
+
71
+ background: '#f9fafb',
72
+ surface: '#ffffff',
73
+ text: '#111827',
74
+ textLight: '#6b7280',
75
+ error: '#dc2626',
76
+ warning: '#d97706',
77
+ info: '#2563eb',
78
+ muted: '#e5e7eb',
79
+ inputBackground: '#ffffff', // Input and box background color for corporate theme
80
+ inputBorder: '#9ca3af', // Input border color for corporate theme
81
+ placeholderColor: 'rgba(0,0,0,0.2)', // Placeholder color for corporate theme
82
+ labelColor: '#111827', // Label text color for corporate theme
83
+ buttonBackground: '#3730a3', // Button background color for corporate theme
84
+ buttonTextColor: '#ffffff', // Button text color for corporate theme
85
+ cancelButtonBg: '#ffffff', // Cancel button background for corporate theme
86
+ },
87
+ } as const;
88
+
89
+ export type ThemeName = keyof typeof colors;
90
+ export type ColorScheme = typeof colors[ThemeName];
@@ -0,0 +1,64 @@
1
+ import { colors, type ThemeName, type ColorScheme } from './colors';
2
+ import { typography } from './typography';
3
+ import { shadows } from './shadows';
4
+
5
+ // Spacing scale
6
+ export const spacing = {
7
+ xs: 4,
8
+ sm: 8,
9
+ md: 12,
10
+ lg: 16,
11
+ xl: 20,
12
+ xxl: 24,
13
+ xxxl: 32,
14
+ } as const;
15
+
16
+ // Border radius scale
17
+ export const borderRadius = {
18
+ none: 0,
19
+ sm: 4,
20
+ md: 8,
21
+ lg: 12,
22
+ xl: 16,
23
+ full: 9999,
24
+ } as const;
25
+
26
+ // Complete theme interface
27
+ export interface Theme {
28
+ colors: ColorScheme;
29
+ typography: typeof typography;
30
+ shadows: typeof shadows;
31
+ spacing: typeof spacing;
32
+ borderRadius: typeof borderRadius;
33
+ }
34
+
35
+ // Theme factory function
36
+ export const createTheme = (themeName: ThemeName = 'primary'): Theme => ({
37
+ colors: colors[themeName] as ColorScheme,
38
+ typography,
39
+ shadows,
40
+ spacing,
41
+ borderRadius,
42
+ });
43
+
44
+ // Helper function to get border with opacity
45
+ export const getBorderColor = (theme: Theme, opacity: number = 0.36) => {
46
+ const hex = theme.colors.border.replace('#', '');
47
+ const r = parseInt(hex.substring(0, 2), 16);
48
+ const g = parseInt(hex.substring(2, 4), 16);
49
+ const b = parseInt(hex.substring(4, 6), 16);
50
+ return `rgba(${r}, ${g}, ${b}, ${opacity})`;
51
+ };
52
+
53
+ // Helper function to get shadow color with opacity
54
+ export const getShadowColor = (opacity: number = 0.1) => {
55
+ return `rgba(0, 0, 0, ${opacity})`;
56
+ };
57
+
58
+ // Export everything
59
+ export { colors, typography, shadows, type ThemeName, type ColorScheme };
60
+ export * from './typography';
61
+ export * from './shadows';
62
+
63
+ // Default theme export
64
+ export const defaultTheme = createTheme('primary');
@@ -0,0 +1,61 @@
1
+ // Shadow configuration
2
+ export const shadows = {
3
+ // Default shadow (black 10% spread)
4
+ default: {
5
+ shadowColor: '#000000',
6
+ shadowOffset: {
7
+ width: 0,
8
+ height: 2,
9
+ },
10
+ shadowOpacity: 0.1,
11
+ shadowRadius: 4,
12
+ elevation: 3, // Android
13
+ },
14
+
15
+ // Additional shadow variations
16
+ light: {
17
+ shadowColor: '#000000',
18
+ shadowOffset: {
19
+ width: 0,
20
+ height: 1,
21
+ },
22
+ shadowOpacity: 0.05,
23
+ shadowRadius: 2,
24
+ elevation: 1,
25
+ },
26
+
27
+ medium: {
28
+ shadowColor: '#000000',
29
+ shadowOffset: {
30
+ width: 0,
31
+ height: 4,
32
+ },
33
+ shadowOpacity: 0.15,
34
+ shadowRadius: 6,
35
+ elevation: 5,
36
+ },
37
+
38
+ heavy: {
39
+ shadowColor: '#000000',
40
+ shadowOffset: {
41
+ width: 0,
42
+ height: 6,
43
+ },
44
+ shadowOpacity: 0.2,
45
+ shadowRadius: 8,
46
+ elevation: 8,
47
+ },
48
+
49
+ card: {
50
+ shadowColor: '#000000',
51
+ shadowOffset: {
52
+ width: 0,
53
+ height: 2,
54
+ },
55
+ shadowOpacity: 0.1,
56
+ shadowRadius: 4,
57
+ elevation: 3,
58
+ },
59
+ } as const;
60
+
61
+ export type ShadowType = keyof typeof shadows;
@@ -0,0 +1,151 @@
1
+ // Typography configuration with Poppins font
2
+ export const typography = {
3
+ fontFamily: {
4
+ primary: 'poppins.regular',
5
+ medium: 'poppins.medium',
6
+ semiBold: 'poppins.semibold',
7
+ bold: 'poppins.bold',
8
+ },
9
+
10
+ fontSize: {
11
+ xxs: 8, // 8px
12
+ xs: 10, // 10px
13
+ sm: 12, // 12px
14
+ md: 14,
15
+ lg: 16,
16
+ xl: 18,
17
+ xxl: 20,
18
+ xxxl: 24,
19
+ },
20
+
21
+ fontWeight: {
22
+ regular: '400' as const,
23
+ medium: '500' as const,
24
+ semiBold: '600' as const,
25
+ bold: '700' as const,
26
+ },
27
+
28
+ lineHeight: {
29
+ tight: 1.2,
30
+ normal: 1.4,
31
+ relaxed: 1.6,
32
+ },
33
+
34
+ // Predefined text styles
35
+ styles: {
36
+ // Headers
37
+ h1: {
38
+ fontFamily: 'poppins.bold',
39
+ fontSize: 24,
40
+ fontWeight: '700' as const,
41
+ lineHeight: 32,
42
+ },
43
+ h2: {
44
+ fontFamily: 'poppins.semibold',
45
+ fontSize: 20,
46
+ fontWeight: '600' as const,
47
+ lineHeight: 28,
48
+ },
49
+ h3: {
50
+ fontFamily: 'poppins.medium',
51
+ fontSize: 16,
52
+ fontWeight: '500' as const,
53
+ lineHeight: 24,
54
+ },
55
+
56
+ // Body text
57
+ bodyLarge: {
58
+ fontFamily: 'poppins.regular',
59
+ fontSize: 16,
60
+ fontWeight: '400' as const,
61
+ lineHeight: 24,
62
+ },
63
+ bodyMedium: {
64
+ fontFamily: 'poppins.regular',
65
+ fontSize: 14,
66
+ fontWeight: '400' as const,
67
+ lineHeight: 20,
68
+ },
69
+ bodySmall: {
70
+ fontFamily: 'poppins.regular',
71
+ fontSize: 12,
72
+ fontWeight: '400' as const,
73
+ lineHeight: 16,
74
+ },
75
+
76
+ // Specific sizes requested
77
+ text14Medium: {
78
+ fontFamily: 'poppins.medium',
79
+ fontSize: 14,
80
+ fontWeight: '600' as const,
81
+ lineHeight: 12,
82
+ },
83
+ text12Regular: {
84
+ fontFamily: 'poppins.regular',
85
+ fontSize: 12,
86
+ fontWeight: '400' as const,
87
+ lineHeight: 16,
88
+ },
89
+
90
+ text12Medium: {
91
+ fontFamily: 'poppins.medium',
92
+ fontSize: 12,
93
+ fontWeight: '500' as const,
94
+ lineHeight: 12,
95
+ },
96
+ text11Regular: {
97
+ fontFamily: 'poppins.regular',
98
+ fontSize: 11,
99
+ fontWeight: '400' as const,
100
+ lineHeight: 11,
101
+ },
102
+ text10Regular: {
103
+ fontFamily: 'poppins.regular',
104
+ fontSize: 10,
105
+ fontWeight: '400' as const,
106
+ lineHeight: 12,
107
+ },
108
+ text10Medium: {
109
+ fontFamily: 'poppins.medium',
110
+ fontSize: 10,
111
+ fontWeight: '500' as const,
112
+ lineHeight: 14,
113
+ },
114
+ text8Regular: {
115
+ fontFamily: 'poppins.regular',
116
+ fontSize: 8,
117
+ fontWeight: '400' as const,
118
+ lineHeight: 10,
119
+ },
120
+
121
+ // Labels and captions
122
+ label: {
123
+ fontFamily: 'poppins.medium',
124
+ fontSize: 12,
125
+ fontWeight: '500' as const,
126
+ lineHeight: 16,
127
+ },
128
+ caption: {
129
+ fontFamily: 'poppins.regular',
130
+ fontSize: 10,
131
+ fontWeight: '400' as const,
132
+ lineHeight: 14,
133
+ },
134
+
135
+ // Buttons
136
+ button: {
137
+ fontFamily: 'poppins.medium',
138
+ fontSize: 16,
139
+ fontWeight: '500' as const,
140
+ lineHeight: 20,
141
+ },
142
+ buttonSmall: {
143
+ fontFamily: 'poppins.medium',
144
+ fontSize: 14,
145
+ fontWeight: '500' as const,
146
+ lineHeight: 18,
147
+ },
148
+ },
149
+ } as const;
150
+
151
+ export type TypographyStyle = keyof typeof typography.styles;
@@ -0,0 +1,37 @@
1
+ export interface InvestmentData {
2
+ amount?: number;
3
+ tenure?: string;
4
+ interestRate?: string;
5
+ interestPayout?: string;
6
+ companyName?: string;
7
+ }
8
+
9
+ export interface CustomerData {
10
+ name?: string;
11
+ email?: string;
12
+ phone?: string;
13
+ panNumber?: string;
14
+ aadhaarNumber?: string;
15
+ customerId?: string;
16
+ }
17
+
18
+ export interface AppData {
19
+ userReferenceId?: string;
20
+ ifsc?: string;
21
+ accountNo?: string;
22
+ nameOfBank?: string;
23
+ typeOfAccount?: string;
24
+ }
25
+
26
+ export interface FDData {
27
+ id: string;
28
+ providerId: string;
29
+ name: string;
30
+ accountNumber: string;
31
+ roi: string;
32
+ tenure: string;
33
+ amount: number;
34
+ maturityDate: string;
35
+ status: 'active' | 'matured' | 'pending';
36
+ creditRating: string;
37
+ }