@airxpay/sdk-ui 1.0.0 → 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 (34) hide show
  1. package/README.md +266 -112
  2. package/dist/api/seller.d.ts +9 -0
  3. package/dist/api/seller.js +13 -4
  4. package/dist/components/common/CountryDropdown.d.ts +17 -0
  5. package/dist/components/common/CountryDropdown.js +2 -2
  6. package/dist/components/common/FileUploader.d.ts +16 -0
  7. package/dist/components/common/FileUploader.js +17 -8
  8. package/dist/components/common/StepIndicator.d.ts +11 -0
  9. package/dist/components/steps/BankDetails.d.ts +10 -0
  10. package/dist/components/steps/BankDetails.js +23 -16
  11. package/dist/components/steps/BasicDetailsForm.d.ts +10 -0
  12. package/dist/components/steps/BasicDetailsForm.js +8 -19
  13. package/dist/components/steps/KYCVerification.d.ts +11 -0
  14. package/dist/components/steps/KYCVerification.js +13 -4
  15. package/dist/components/steps/OnboardingComplete.d.ts +16 -0
  16. package/dist/components/ui/SellerOnboard/CustomSegmentedButtons.d.ts +15 -0
  17. package/dist/components/ui/SellerOnboard/SellerOnboarding.d.ts +4 -0
  18. package/dist/components/ui/SellerOnboard/SellerOnboarding.js +10 -23
  19. package/dist/contexts/AirXPayProvider.d.ts +14 -0
  20. package/dist/contexts/AirXPayProvider.js +9 -8
  21. package/dist/hooks/SellerOnboarding.d.ts +3 -0
  22. package/dist/hooks/SellerOnboarding.js +2 -2
  23. package/dist/index.d.ts +4 -0
  24. package/dist/index.js +9 -3
  25. package/dist/sdk/airxpay.d.ts +7 -0
  26. package/dist/sdk/airxpay.js +16 -5
  27. package/dist/types/dev.d.ts +1 -0
  28. package/dist/types/dev.js +5 -0
  29. package/dist/types/dev.ts +2 -0
  30. package/dist/types/sellertypes.d.ts +69 -0
  31. package/dist/types/sellertypes.ts +85 -0
  32. package/dist/types/type.d.ts +9 -0
  33. package/dist/types/type.ts +10 -0
  34. package/package.json +7 -15
@@ -0,0 +1,69 @@
1
+ export type BusinessType = "individual" | "company";
2
+ export type Mode = "test" | "live";
3
+ export type KYCStatus = "not_submitted" | "pending" | "verified" | "rejected";
4
+ export type SellerStatus = "active" | "suspended" | "blocked";
5
+ export interface KYCDocuments {
6
+ panCardUrl?: string;
7
+ aadhaarUrl?: string;
8
+ identityProofUrl?: string;
9
+ addressProofUrl?: string;
10
+ selfieUrl?: string;
11
+ businessRegistrationUrl?: string;
12
+ gstCertificateUrl?: string;
13
+ }
14
+ export interface BankDetails {
15
+ accountHolderName: string;
16
+ bankName: string;
17
+ accountNumber: string;
18
+ ifscCode: string;
19
+ upiId?: string;
20
+ cancelledChequeUrl?: string;
21
+ }
22
+ export interface Seller {
23
+ _id?: string;
24
+ sellerName: string;
25
+ sellerEmail: string;
26
+ sellerPhone?: string;
27
+ businessName?: string;
28
+ businessType: BusinessType;
29
+ businessCategory?: string;
30
+ country: string;
31
+ dob?: string;
32
+ nationality?: string;
33
+ mode: Mode;
34
+ kycStatus: KYCStatus;
35
+ isKycCompleted: boolean;
36
+ kycDocuments?: KYCDocuments;
37
+ bankDetails?: BankDetails;
38
+ isBankDetailsCompleted: boolean;
39
+ status: SellerStatus;
40
+ sellerDID?: string;
41
+ walletId?: string;
42
+ developerId?: string;
43
+ developerUserId?: string;
44
+ developerClientKey?: string;
45
+ onboardedPlatforms?: string[];
46
+ }
47
+ export interface SellerOnboardingProps {
48
+ sellerId?: string;
49
+ mode: Mode;
50
+ initialStep?: number;
51
+ isKycCompleted: boolean;
52
+ isBankDetailsCompleted: boolean;
53
+ kycStatus: KYCStatus;
54
+ status: SellerStatus;
55
+ initialData?: Partial<Seller>;
56
+ onNext: (stepData: Partial<Seller>, step: number) => void;
57
+ onBack: (currentStep: number) => void;
58
+ onComplete: (sellerData: Seller) => void;
59
+ loading?: boolean;
60
+ }
61
+ export interface StepConfig {
62
+ id: number;
63
+ name: string;
64
+ key: "basic" | "kyc" | "bank" | "complete";
65
+ isRequired: boolean;
66
+ }
67
+ export interface FormErrors {
68
+ [key: string]: string | undefined;
69
+ }
@@ -0,0 +1,85 @@
1
+ // types/sellertypes.ts
2
+
3
+ export type BusinessType = "individual" | "company";
4
+ // For future use, in case we want to support more business types like 'partnership', 'sole proprietorship', etc.
5
+
6
+ export type Mode = "test" | "live";
7
+
8
+ // KYCStatus represents the various stages of the KYC process for a seller.
9
+
10
+ export type KYCStatus = "not_submitted" | "pending" | "verified" | "rejected";
11
+ // SellerStatus represents the current status of the seller's account in the system.
12
+
13
+ export type SellerStatus = "active" | "suspended" | "blocked";
14
+ // KYCDocuments represents the various documents that a seller may need to submit for KYC verification. Each document is optional, as not all sellers may be required to submit all types of documents depending on their business type and location.
15
+ export interface KYCDocuments {
16
+ panCardUrl?: string;
17
+ aadhaarUrl?: string;
18
+ identityProofUrl?: string;
19
+ addressProofUrl?: string;
20
+ selfieUrl?: string;
21
+ businessRegistrationUrl?: string;
22
+ gstCertificateUrl?: string;
23
+ }
24
+ // BankDetails represents the bank account information that a seller needs to provide for payouts. Some fields are optional, such as upiId and cancelledChequeUrl, as not all sellers may use UPI or have a cancelled cheque available.
25
+ export interface BankDetails {
26
+ accountHolderName: string;
27
+ bankName: string;
28
+ accountNumber: string;
29
+ ifscCode: string;
30
+ upiId?: string;
31
+ cancelledChequeUrl?: string;
32
+ }
33
+ // Seller represents the main data structure for a seller in the system, including their personal and business information, KYC status, bank details, and other relevant fields. Some fields are optional to allow for flexibility in the onboarding process and to accommodate different types of sellers.
34
+ export interface Seller {
35
+ _id?: string;
36
+ sellerName: string;
37
+ sellerEmail: string;
38
+ sellerPhone?: string;
39
+ businessName?: string;
40
+ businessType: BusinessType;
41
+ businessCategory?: string;
42
+ country: string;
43
+ dob?: string;
44
+ nationality?: string;
45
+ mode: Mode;
46
+ kycStatus: KYCStatus;
47
+ isKycCompleted: boolean;
48
+ kycDocuments?: KYCDocuments;
49
+ bankDetails?: BankDetails;
50
+ isBankDetailsCompleted: boolean;
51
+ status: SellerStatus;
52
+ sellerDID?: string;
53
+ walletId?: string;
54
+ developerId?: string;
55
+ developerUserId?: string;
56
+ developerClientKey?: string;
57
+ onboardedPlatforms?: string[];
58
+ }
59
+ // SellerOnboardingProps defines the properties that are passed to the seller onboarding component. It includes information about the seller's current status, KYC completion, bank details completion, and callback functions for navigating through the onboarding steps and completing the process.
60
+ export interface SellerOnboardingProps {
61
+ sellerId?: string;
62
+ mode: Mode;
63
+ initialStep?: number;
64
+ isKycCompleted: boolean;
65
+ isBankDetailsCompleted: boolean;
66
+ kycStatus: KYCStatus;
67
+ status: SellerStatus;
68
+ initialData?: Partial<Seller>;
69
+ onNext: (stepData: Partial<Seller>, step: number) => void;
70
+ onBack: (currentStep: number) => void;
71
+ onComplete: (sellerData: Seller) => void;
72
+ loading?: boolean;
73
+ }
74
+ // StepConfig defines the structure of each step in the seller onboarding process, including its unique identifier, display name, key for internal use, and whether the step is required to complete the onboarding.
75
+ export interface StepConfig {
76
+ id: number;
77
+ name: string;
78
+ key: "basic" | "kyc" | "bank" | "complete";
79
+ isRequired: boolean;
80
+ }
81
+ // FormErrors is a simple interface that defines the structure of an object used to store validation error messages for form fields. The keys are the names of the form fields, and the values are the corresponding error messages, which can be undefined if there are no errors for that field.
82
+ export interface FormErrors {
83
+ [key: string]: string | undefined;
84
+ }
85
+ // This file defines the TypeScript types and interfaces related to sellers in the system, including their KYC status, bank details, and onboarding process. These types will be used throughout the application to ensure type safety and consistency when working with seller data.
@@ -0,0 +1,9 @@
1
+ export interface AirXPayConfig {
2
+ baseUrl: string;
3
+ publicKey: string;
4
+ }
5
+ export interface SellerData {
6
+ sellerName: string;
7
+ sellerEmail: string;
8
+ phone?: string;
9
+ }
@@ -0,0 +1,10 @@
1
+ export interface AirXPayConfig {
2
+ baseUrl: string;
3
+ publicKey: string;
4
+ }
5
+
6
+ export interface SellerData {
7
+ sellerName: string;
8
+ sellerEmail: string;
9
+ phone?: string;
10
+ }
package/package.json CHANGED
@@ -1,33 +1,29 @@
1
1
  {
2
2
  "name": "@airxpay/sdk-ui",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "AirXPay Initialization UI Components for React & React Native",
5
5
  "author": "Tafseel Khan",
6
6
  "license": "MIT",
7
-
7
+ "types": "dist/index.d.ts",
8
8
  "main": "dist/index.js",
9
-
10
9
  "files": [
11
10
  "dist"
12
11
  ],
13
-
14
12
  "scripts": {
15
- "build": "tsc --project tsconfig.json --outDir dist --declaration false",
13
+ "build": "tsc --project tsconfig.json --outDir dist && cpx \"src/types/**/*\" dist/types",
16
14
  "prepare": "npm run build"
17
15
  },
18
-
19
16
  "peerDependencies": {
20
17
  "react": ">=18",
21
18
  "react-native": ">=0.72"
22
19
  },
23
-
24
20
  "dependencies": {
25
21
  "axios": "^1.13.5"
26
22
  },
27
-
28
23
  "devDependencies": {
29
24
  "@react-native-community/datetimepicker": "^8.6.0",
30
25
  "@types/react": "^19.2.14",
26
+ "cpx": "^1.5.0",
31
27
  "expo-image-picker": "^17.0.10",
32
28
  "expo-linear-gradient": "^15.0.8",
33
29
  "react": "^19.2.4",
@@ -36,12 +32,10 @@
36
32
  "react-native-paper": "^5.15.0",
37
33
  "typescript": "^5.9.3"
38
34
  },
39
-
40
35
  "repository": {
41
36
  "type": "git",
42
- "url": "https://github.com/tafseelkhan/airxpay-initialization-ui.git"
37
+ "url": "https://github.com/tafseelkhan/airxpay-sdk-ui.git"
43
38
  },
44
-
45
39
  "keywords": [
46
40
  "airxpay",
47
41
  "react-native",
@@ -49,10 +43,8 @@
49
43
  "payments",
50
44
  "ui"
51
45
  ],
52
-
53
46
  "bugs": {
54
- "url": "https://github.com/tafseelkhan/airxpay-initialization-ui/issues"
47
+ "url": "https://github.com/tafseelkhan/airxpay-sdk-ui/issues"
55
48
  },
56
-
57
- "homepage": "https://github.com/tafseelkhan/airxpay-initialization-ui#readme"
49
+ "homepage": "https://github.com/tafseelkhan/airxpay-sdk-ui#readme"
58
50
  }