@tap-payments/auth-jsconnect 1.0.35 → 1.0.38

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 (102) hide show
  1. package/build/components/AnimationFlow/BottomSheet.js +26 -2
  2. package/build/components/OTPTimer/OTPTimer.js +4 -2
  3. package/build/constants/app.js +1 -1
  4. package/build/constants/validation.d.ts +1 -0
  5. package/build/constants/validation.js +1 -0
  6. package/build/features/app/business/businessStore.d.ts +1 -1
  7. package/build/features/app/business/businessStore.js +32 -23
  8. package/build/features/app/connect/connectStore.d.ts +1 -1
  9. package/build/features/app/connect/connectStore.js +17 -11
  10. package/build/features/business/screens/BusinessType/BusinessType.js +16 -23
  11. package/build/features/business/screens/BusinessType/CompanyLicense.js +23 -9
  12. package/build/features/business/screens/BusinessType/FreelanceLicense.js +23 -9
  13. package/build/features/business/screens/Confirm/Confirm.js +4 -3
  14. package/build/features/business/screens/OTP/OTPInput.js +1 -2
  15. package/build/features/business/screens/Verify/OTPInput.js +1 -2
  16. package/build/features/business/screens/Verify/Verify.js +3 -3
  17. package/build/features/connect/screens/Individual/Email.js +10 -1
  18. package/build/features/connect/screens/Individual/Individual.js +8 -10
  19. package/build/features/connect/screens/Individual/MobileNumber.js +3 -16
  20. package/build/features/connect/screens/Merchant/Merchant.js +11 -11
  21. package/build/features/connect/screens/Merchant/SocialMedia.js +2 -1
  22. package/build/features/connect/screens/Merchant/TAC.js +1 -1
  23. package/build/features/connect/screens/Merchant/validation.js +3 -2
  24. package/build/features/connect/screens/Mobile/BusinessCountry.js +1 -1
  25. package/build/features/connect/screens/Mobile/Mobile.js +1 -9
  26. package/build/features/connect/screens/Mobile/MobileNumber.js +3 -16
  27. package/build/features/connect/screens/NID/IDNumber.d.ts +0 -1
  28. package/build/features/connect/screens/NID/IDNumber.js +2 -2
  29. package/build/features/connect/screens/NID/NID.js +1 -6
  30. package/build/features/connect/screens/OTP/OTP.js +2 -4
  31. package/build/features/connect/screens/Password/Password.js +1 -6
  32. package/build/features/shared/Button/Button.js +16 -11
  33. package/build/features/shared/SuccessScreen/SuccessScreen.js +10 -5
  34. package/build/hooks/index.d.ts +1 -0
  35. package/build/hooks/index.js +1 -0
  36. package/build/hooks/useWindowSize.d.ts +6 -0
  37. package/build/hooks/useWindowSize.js +19 -0
  38. package/package.json +126 -126
  39. package/build/features/app/business/midStore.d.ts +0 -10
  40. package/build/features/app/business/midStore.js +0 -18
  41. package/build/features/app/connect/midStore.d.ts +0 -10
  42. package/build/features/app/connect/midStore.js +0 -18
  43. package/build/features/business/screens/VerifyNumber/OTPInput.d.ts +0 -5
  44. package/build/features/business/screens/VerifyNumber/OTPInput.js +0 -39
  45. package/build/features/business/screens/VerifyNumber/VerifyNumber.d.ts +0 -13
  46. package/build/features/business/screens/VerifyNumber/VerifyNumber.js +0 -76
  47. package/build/features/business/screens/VerifyNumber/index.d.ts +0 -3
  48. package/build/features/business/screens/VerifyNumber/index.js +0 -2
  49. package/build/features/business/screens/VerifyNumber/validation.d.ts +0 -8
  50. package/build/features/business/screens/VerifyNumber/validation.js +0 -4
  51. package/build/features/connect/screens/MID/BusinessCountry.d.ts +0 -11
  52. package/build/features/connect/screens/MID/BusinessCountry.js +0 -92
  53. package/build/features/connect/screens/MID/DOB.d.ts +0 -6
  54. package/build/features/connect/screens/MID/DOB.js +0 -38
  55. package/build/features/connect/screens/MID/IDNumber.d.ts +0 -7
  56. package/build/features/connect/screens/MID/IDNumber.js +0 -70
  57. package/build/features/connect/screens/MID/MID.d.ts +0 -5
  58. package/build/features/connect/screens/MID/MID.js +0 -87
  59. package/build/features/connect/screens/MID/MIDTitle.d.ts +0 -8
  60. package/build/features/connect/screens/MID/MIDTitle.js +0 -29
  61. package/build/features/connect/screens/MID/MobileNumber.d.ts +0 -12
  62. package/build/features/connect/screens/MID/MobileNumber.js +0 -148
  63. package/build/features/connect/screens/MID/index.d.ts +0 -3
  64. package/build/features/connect/screens/MID/index.js +0 -2
  65. package/build/features/connect/screens/MID/validation.d.ts +0 -18
  66. package/build/features/connect/screens/MID/validation.js +0 -15
  67. package/build/features/owner/Owner.d.ts +0 -6
  68. package/build/features/owner/Owner.js +0 -50
  69. package/build/features/owner/index.d.ts +0 -1
  70. package/build/features/owner/index.js +0 -1
  71. package/build/features/owner/screens/AdditionalOwnerInfo/AdditionalOwnerInfo.d.ts +0 -8
  72. package/build/features/owner/screens/AdditionalOwnerInfo/AdditionalOwnerInfo.js +0 -77
  73. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerLocation.d.ts +0 -10
  74. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerLocation.js +0 -80
  75. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerName.d.ts +0 -6
  76. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerName.js +0 -40
  77. package/build/features/owner/screens/AdditionalOwnerInfo/InfluencerSwitch.d.ts +0 -6
  78. package/build/features/owner/screens/AdditionalOwnerInfo/InfluencerSwitch.js +0 -45
  79. package/build/features/owner/screens/AdditionalOwnerInfo/MonthlyIncome.d.ts +0 -6
  80. package/build/features/owner/screens/AdditionalOwnerInfo/MonthlyIncome.js +0 -35
  81. package/build/features/owner/screens/AdditionalOwnerInfo/PEPSwitch.d.ts +0 -6
  82. package/build/features/owner/screens/AdditionalOwnerInfo/PEPSwitch.js +0 -45
  83. package/build/features/owner/screens/AdditionalOwnerInfo/SourceOfIncome.d.ts +0 -9
  84. package/build/features/owner/screens/AdditionalOwnerInfo/SourceOfIncome.js +0 -85
  85. package/build/features/owner/screens/AdditionalOwnerInfo/index.d.ts +0 -3
  86. package/build/features/owner/screens/AdditionalOwnerInfo/index.js +0 -2
  87. package/build/features/owner/screens/AdditionalOwnerInfo/validation.d.ts +0 -25
  88. package/build/features/owner/screens/AdditionalOwnerInfo/validation.js +0 -35
  89. package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.d.ts +0 -19
  90. package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.js +0 -52
  91. package/build/features/owner/screens/ShowOwnerInfo/index.d.ts +0 -3
  92. package/build/features/owner/screens/ShowOwnerInfo/index.js +0 -2
  93. package/build/features/owner/screens/ShowOwnerInfo/info.d.ts +0 -7
  94. package/build/features/owner/screens/ShowOwnerInfo/info.js +0 -28
  95. package/build/features/owner/screens/Success/Success.d.ts +0 -5
  96. package/build/features/owner/screens/Success/Success.js +0 -14
  97. package/build/features/owner/screens/Success/index.d.ts +0 -3
  98. package/build/features/owner/screens/Success/index.js +0 -2
  99. package/build/features/shared/ExpandIcon/ExpandIcon.d.ts +0 -7
  100. package/build/features/shared/ExpandIcon/ExpandIcon.js +0 -24
  101. package/build/features/shared/ExpandIcon/index.d.ts +0 -2
  102. package/build/features/shared/ExpandIcon/index.js +0 -2
package/package.json CHANGED
@@ -1,126 +1,126 @@
1
- {
2
- "name": "@tap-payments/auth-jsconnect",
3
- "version": "1.0.35",
4
- "description": "connect library, auth",
5
- "private": false,
6
- "main": "build/index.js",
7
- "module": "build/index.js",
8
- "types": "build/index.d.ts",
9
- "files": [
10
- "build",
11
- "README.md"
12
- ],
13
- "scripts": {
14
- "husky:setup": "npx husky install",
15
- "prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
16
- "prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
17
- "lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
18
- "lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
19
- "start": "cross-env NODE_ENV=development webpack serve",
20
- "build": "cross-env NODE_ENV=production webpack",
21
- "copy:files": "copyfiles -u 1 src/**/*.css build/",
22
- "tsc:alias": "tsc-alias -p tsconfig.json",
23
- "ts:build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
24
- "push": "npm publish --access public"
25
- },
26
- "keywords": [],
27
- "author": {
28
- "name": "Ahmed Elsharkawy",
29
- "email": "a.elsharkawy@tap.company"
30
- },
31
- "license": "ISC",
32
- "devDependencies": {
33
- "@babel/core": "^7.18.6",
34
- "@babel/preset-env": "^7.18.6",
35
- "@babel/preset-react": "^7.18.6",
36
- "@babel/preset-typescript": "^7.18.6",
37
- "@types/lodash-es": "^4.17.6",
38
- "@types/moment-hijri": "^2.1.0",
39
- "@types/react": "^18.0.15",
40
- "@types/react-calendar": "~3.5.1",
41
- "@types/react-dom": "^18.0.6",
42
- "@typescript-eslint/eslint-plugin": "^5.30.5",
43
- "@typescript-eslint/parser": "^5.30.5",
44
- "babel-loader": "^8.2.5",
45
- "copyfiles": "^2.4.1",
46
- "cross-env": "^7.0.3",
47
- "css-loader": "^6.7.1",
48
- "css-minimizer-webpack-plugin": "^4.0.0",
49
- "eslint": "^8.19.0",
50
- "eslint-config-airbnb": "^19.0.4",
51
- "eslint-config-prettier": "^8.5.0",
52
- "eslint-plugin-import": "^2.26.0",
53
- "eslint-plugin-jsx-a11y": "^6.6.0",
54
- "eslint-plugin-node": "^11.1.0",
55
- "eslint-plugin-prettier": "^4.2.1",
56
- "eslint-plugin-react": "^7.30.1",
57
- "eslint-plugin-react-hooks": "^4.6.0",
58
- "file-loader": "^6.2.0",
59
- "fork-ts-checker-webpack-plugin": "^7.2.12",
60
- "html-loader": "^3.1.2",
61
- "html-webpack-plugin": "^5.5.0",
62
- "husky": "^8.0.1",
63
- "lint-staged": "^13.0.3",
64
- "mini-css-extract-plugin": "^2.6.1",
65
- "prettier": "^2.7.1",
66
- "sass": "^1.53.0",
67
- "sass-loader": "^13.0.2",
68
- "style-loader": "^3.3.1",
69
- "terser-webpack-plugin": "^5.3.3",
70
- "tsc-alias": "^1.6.11",
71
- "typescript": "^4.7.4",
72
- "webpack": "^5.73.0",
73
- "webpack-cli": "^4.10.0",
74
- "webpack-dev-server": "^4.9.3",
75
- "webpack-merge": "^5.8.0"
76
- },
77
- "dependencies": {
78
- "@emotion/react": "^11.9.3",
79
- "@emotion/styled": "^11.9.3",
80
- "@fingerprintjs/fingerprintjs": "~3.3.4",
81
- "@hookform/resolvers": "^2.9.6",
82
- "@mui/icons-material": "^5.8.4",
83
- "@mui/material": "^5.8.7",
84
- "@reduxjs/toolkit": "^1.8.3",
85
- "axios": "^0.27.2",
86
- "device-detector-js": "^3.0.3",
87
- "i18next": "^21.8.14",
88
- "i18next-browser-languagedetector": "^6.1.4",
89
- "i18next-http-backend": "^1.4.1",
90
- "jsencrypt": "^3.2.1",
91
- "lodash-es": "^4.17.21",
92
- "moment-hijri": "~2.1.2",
93
- "react": "^18.2.0",
94
- "react-calendar": "~3.7.0",
95
- "react-dom": "^18.2.0",
96
- "react-hook-form": "^7.33.1",
97
- "react-i18next": "^11.18.1",
98
- "react-otp-input": "^2.4.0",
99
- "react-redux": "^8.0.2",
100
- "react-spring-bottom-sheet": "^3.4.1",
101
- "yup": "^0.32.11"
102
- },
103
- "peerDependencies": {
104
- "react": "^18.2.0",
105
- "react-dom": "^18.2.0"
106
- },
107
- "lint-staged": {
108
- "src/**/*.{ts,tsx,json,js,jsx}": [
109
- "yarn run prettier:fix",
110
- "yarn run lint",
111
- "git add ."
112
- ]
113
- },
114
- "browserslist": {
115
- "production": [
116
- ">0.2%",
117
- "not dead",
118
- "not op_mini all"
119
- ],
120
- "development": [
121
- "last 1 chrome version",
122
- "last 1 firefox version",
123
- "last 1 safari version"
124
- ]
125
- }
126
- }
1
+ {
2
+ "name": "@tap-payments/auth-jsconnect",
3
+ "version": "1.0.38",
4
+ "description": "connect library, auth",
5
+ "private": false,
6
+ "main": "build/index.js",
7
+ "module": "build/index.js",
8
+ "types": "build/index.d.ts",
9
+ "files": [
10
+ "build",
11
+ "README.md"
12
+ ],
13
+ "scripts": {
14
+ "husky:setup": "npx husky install",
15
+ "prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
16
+ "prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
17
+ "lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
18
+ "lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
19
+ "start": "cross-env NODE_ENV=development webpack serve",
20
+ "build": "cross-env NODE_ENV=production webpack",
21
+ "copy:files": "copyfiles -u 1 src/**/*.css build/",
22
+ "tsc:alias": "tsc-alias -p tsconfig.json",
23
+ "ts:build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
24
+ "push": "npm publish --access public"
25
+ },
26
+ "keywords": [],
27
+ "author": {
28
+ "name": "Ahmed Elsharkawy",
29
+ "email": "a.elsharkawy@tap.company"
30
+ },
31
+ "license": "ISC",
32
+ "devDependencies": {
33
+ "@babel/core": "^7.18.6",
34
+ "@babel/preset-env": "^7.18.6",
35
+ "@babel/preset-react": "^7.18.6",
36
+ "@babel/preset-typescript": "^7.18.6",
37
+ "@types/lodash-es": "^4.17.6",
38
+ "@types/moment-hijri": "^2.1.0",
39
+ "@types/react": "^18.0.15",
40
+ "@types/react-calendar": "~3.5.1",
41
+ "@types/react-dom": "^18.0.6",
42
+ "@typescript-eslint/eslint-plugin": "^5.30.5",
43
+ "@typescript-eslint/parser": "^5.30.5",
44
+ "babel-loader": "^8.2.5",
45
+ "copyfiles": "^2.4.1",
46
+ "cross-env": "^7.0.3",
47
+ "css-loader": "^6.7.1",
48
+ "css-minimizer-webpack-plugin": "^4.0.0",
49
+ "eslint": "^8.19.0",
50
+ "eslint-config-airbnb": "^19.0.4",
51
+ "eslint-config-prettier": "^8.5.0",
52
+ "eslint-plugin-import": "^2.26.0",
53
+ "eslint-plugin-jsx-a11y": "^6.6.0",
54
+ "eslint-plugin-node": "^11.1.0",
55
+ "eslint-plugin-prettier": "^4.2.1",
56
+ "eslint-plugin-react": "^7.30.1",
57
+ "eslint-plugin-react-hooks": "^4.6.0",
58
+ "file-loader": "^6.2.0",
59
+ "fork-ts-checker-webpack-plugin": "^7.2.12",
60
+ "html-loader": "^3.1.2",
61
+ "html-webpack-plugin": "^5.5.0",
62
+ "husky": "^8.0.1",
63
+ "lint-staged": "^13.0.3",
64
+ "mini-css-extract-plugin": "^2.6.1",
65
+ "prettier": "^2.7.1",
66
+ "sass": "^1.53.0",
67
+ "sass-loader": "^13.0.2",
68
+ "style-loader": "^3.3.1",
69
+ "terser-webpack-plugin": "^5.3.3",
70
+ "tsc-alias": "^1.6.11",
71
+ "typescript": "^4.7.4",
72
+ "webpack": "^5.73.0",
73
+ "webpack-cli": "^4.10.0",
74
+ "webpack-dev-server": "^4.9.3",
75
+ "webpack-merge": "^5.8.0"
76
+ },
77
+ "dependencies": {
78
+ "@emotion/react": "^11.9.3",
79
+ "@emotion/styled": "^11.9.3",
80
+ "@fingerprintjs/fingerprintjs": "~3.3.4",
81
+ "@hookform/resolvers": "^2.9.6",
82
+ "@mui/icons-material": "^5.8.4",
83
+ "@mui/material": "^5.8.7",
84
+ "@reduxjs/toolkit": "^1.8.3",
85
+ "axios": "^0.27.2",
86
+ "device-detector-js": "^3.0.3",
87
+ "i18next": "^21.8.14",
88
+ "i18next-browser-languagedetector": "^6.1.4",
89
+ "i18next-http-backend": "^1.4.1",
90
+ "jsencrypt": "^3.2.1",
91
+ "lodash-es": "^4.17.21",
92
+ "moment-hijri": "~2.1.2",
93
+ "react": "^18.2.0",
94
+ "react-calendar": "~3.7.0",
95
+ "react-dom": "^18.2.0",
96
+ "react-hook-form": "^7.33.1",
97
+ "react-i18next": "^11.18.1",
98
+ "react-otp-input": "^2.4.0",
99
+ "react-redux": "^8.0.2",
100
+ "react-spring-bottom-sheet": "^3.4.1",
101
+ "yup": "^0.32.11"
102
+ },
103
+ "peerDependencies": {
104
+ "react": "^18.2.0",
105
+ "react-dom": "^18.2.0"
106
+ },
107
+ "lint-staged": {
108
+ "src/**/*.{ts,tsx,json,js,jsx}": [
109
+ "yarn run prettier:fix",
110
+ "yarn run lint",
111
+ "git add ."
112
+ ]
113
+ },
114
+ "browserslist": {
115
+ "production": [
116
+ ">0.2%",
117
+ "not dead",
118
+ "not op_mini all"
119
+ ],
120
+ "development": [
121
+ "last 1 chrome version",
122
+ "last 1 firefox version",
123
+ "last 1 safari version"
124
+ ]
125
+ }
126
+ }
@@ -1,10 +0,0 @@
1
- import { RootState } from '../../../app/store';
2
- import { SharedState } from '../../../@types';
3
- export interface MIDData {
4
- }
5
- export interface MIDState extends SharedState<MIDData> {
6
- }
7
- export declare const midSlice: import("@reduxjs/toolkit").Slice<MIDState, {}, "connect/mid">;
8
- declare const _default: import("redux").Reducer<MIDState, import("redux").AnyAction>;
9
- export default _default;
10
- export declare const midSelector: (state: RootState) => MIDState;
@@ -1,18 +0,0 @@
1
- var _a;
2
- import { createSlice } from '@reduxjs/toolkit';
3
- var initialState = {
4
- error: null,
5
- loading: false,
6
- data: {}
7
- };
8
- export var midSlice = createSlice({
9
- name: 'connect/mid',
10
- initialState: initialState,
11
- reducers: {},
12
- extraReducers: function (builder) {
13
- console.log(builder);
14
- }
15
- });
16
- export var _b = _a = midSlice.actions;
17
- export default midSlice.reducer;
18
- export var midSelector = function (state) { return state.connect; };
@@ -1,10 +0,0 @@
1
- import { RootState } from '../../../app/store';
2
- import { SharedState } from '../../../@types';
3
- export interface MIDData {
4
- }
5
- export interface MIDState extends SharedState<MIDData> {
6
- }
7
- export declare const midSlice: import("@reduxjs/toolkit").Slice<MIDState, {}, "connect/mid">;
8
- declare const _default: import("redux").Reducer<MIDState, import("redux").AnyAction>;
9
- export default _default;
10
- export declare const midSelector: (state: RootState) => MIDState;
@@ -1,18 +0,0 @@
1
- var _a;
2
- import { createSlice } from '@reduxjs/toolkit';
3
- var initialState = {
4
- error: null,
5
- loading: false,
6
- data: {}
7
- };
8
- export var midSlice = createSlice({
9
- name: 'connect/mid',
10
- initialState: initialState,
11
- reducers: {},
12
- extraReducers: function (builder) {
13
- console.log(builder);
14
- }
15
- });
16
- export var _b = _a = midSlice.actions;
17
- export default midSlice.reducer;
18
- export var midSelector = function (state) { return state.mid; };
@@ -1,5 +0,0 @@
1
- import * as React from 'react';
2
- export interface OTPProps {
3
- }
4
- declare const _default: React.MemoExoticComponent<({}: OTPProps) => JSX.Element>;
5
- export default _default;
@@ -1,39 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import * as React from 'react';
14
- import Box from '@mui/material/Box/Box';
15
- import { styled } from '@mui/material/styles';
16
- import OTPField from '../../../../features/shared/OTP';
17
- import { useController, useFormContext } from 'react-hook-form';
18
- import { useTranslation } from 'react-i18next';
19
- import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
- var BoxStyled = styled(Box)(function (_a) {
21
- var theme = _a.theme;
22
- return ({
23
- display: 'flex',
24
- flexDirection: 'column',
25
- fontFamily: theme.typography.fontFamily,
26
- marginBottom: theme.spacing(5)
27
- });
28
- });
29
- var OTPInput = function (_a) {
30
- var control = useFormContext().control;
31
- var t = useTranslation().t;
32
- var otpControl = useController({ name: 'otp', control: control });
33
- var handleOnOTPChange = function (otp) {
34
- otpControl.field.onChange(otp);
35
- };
36
- var otpValue = otpControl.field.value;
37
- return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: function () { }, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
38
- };
39
- export default React.memo(OTPInput);
@@ -1,13 +0,0 @@
1
- import * as React from 'react';
2
- export interface OTPProps {
3
- phone?: string;
4
- code?: string;
5
- }
6
- declare const _default: React.MemoExoticComponent<{
7
- ({ phone, code }: OTPProps): JSX.Element;
8
- defaultProps: {
9
- phone: string;
10
- code: string;
11
- };
12
- }>;
13
- export default _default;
@@ -1,76 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import * as React from 'react';
14
- import { useAppDispatch } from '../../../../hooks';
15
- import { useTranslation } from 'react-i18next';
16
- import { useForm, FormProvider } from 'react-hook-form';
17
- import { yupResolver } from '@hookform/resolvers/yup';
18
- import Box from '@mui/material/Box/Box';
19
- import { styled } from '@mui/material/styles';
20
- import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/settings';
21
- import { useLanguage } from '../../../../hooks';
22
- import Form from '../../../../components/Form';
23
- import Text from '../../../../components/Text';
24
- import { ScreenContainer } from '../../../shared/Containers';
25
- import Button from '../../../shared/Button';
26
- import { maskPhone } from '../../../../utils';
27
- import { OTPValidation } from './validation';
28
- import OTPInput from './OTPInput';
29
- var OTPTitleContainerStyled = styled(Box)(function (_a) {
30
- var theme = _a.theme;
31
- return ({
32
- background: theme.palette.common.white,
33
- border: '1px solid',
34
- borderColor: theme.palette.divider,
35
- direction: theme.direction,
36
- borderRadius: theme.spacing(0, 0, 1.25, 1.25),
37
- marginBottom: theme.spacing(5.75)
38
- });
39
- });
40
- var OTPTitleStyled = styled(Text)(function (_a) {
41
- var theme = _a.theme;
42
- return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightLight, marginBlock: theme.spacing(1.75), marginInlineStart: theme.spacing(2.5), lineHeight: 1.75 }));
43
- });
44
- var FormStyled = styled(Form)(function () { return ({
45
- display: 'flex',
46
- flexDirection: 'column'
47
- }); });
48
- var VerifyNumber = function (_a) {
49
- var phone = _a.phone, code = _a.code;
50
- var dispatch = useAppDispatch();
51
- var methods = useForm({
52
- resolver: yupResolver(OTPValidation),
53
- defaultValues: {
54
- otp: ''
55
- },
56
- mode: 'onChange'
57
- });
58
- var t = useTranslation().t;
59
- var isAr = useLanguage().isAr;
60
- var onSubmit = function (data) {
61
- console.log('data', data);
62
- if (data.otp === '123456')
63
- return dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
64
- dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
65
- };
66
- var onBack = function () {
67
- dispatch(handlePrevScreenStep());
68
- };
69
- var loading = false;
70
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: !methods.formState.isValid, type: 'submit', isAr: isAr, loading: loading }, { children: t('next') }))] })) })) }));
71
- };
72
- VerifyNumber.defaultProps = {
73
- phone: '564656085',
74
- code: '+996'
75
- };
76
- export default React.memo(VerifyNumber);
@@ -1,3 +0,0 @@
1
- import OTP, { OTPProps } from './VerifyNumber';
2
- export type { OTPProps };
3
- export default OTP;
@@ -1,2 +0,0 @@
1
- import OTP from './VerifyNumber';
2
- export default OTP;
@@ -1,8 +0,0 @@
1
- import * as yup from 'yup';
2
- export declare const OTPValidation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
- otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
- }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
5
- otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
6
- }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
7
- otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
- }>>>;
@@ -1,4 +0,0 @@
1
- import * as yup from 'yup';
2
- export var OTPValidation = yup.object().shape({
3
- otp: yup.string().min(6, 'otp_min_length').required('otp_required')
4
- });
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- import { CountryCode } from '../../../../@types';
3
- interface BusinessCountryProps {
4
- countries: Array<CountryCode>;
5
- show: boolean;
6
- setMobileLength?: (length: number) => void;
7
- onListOpen?: () => void;
8
- onListClose?: () => void;
9
- }
10
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<BusinessCountryProps & React.RefAttributes<unknown>>>;
11
- export default _default;
@@ -1,92 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
24
- import * as React from 'react';
25
- import Box from '@mui/material/Box';
26
- import { styled } from '@mui/material/styles';
27
- import { useTranslation } from 'react-i18next';
28
- import { useController, useFormContext } from 'react-hook-form';
29
- import Text from '../../../../components/Text';
30
- import Collapse from '../../../../components/Collapse';
31
- import CheckIcon from '@mui/icons-material/Check';
32
- import ScreenContainer from '../../../shared/Containers/ScreenContainer';
33
- import Icon from '../../../../components/Icon';
34
- import Input from '../../../shared/Input';
35
- import ExpandIcon from '../../../../components/ExpandIcon';
36
- import SimpleList from '../../../../components/SimpleList';
37
- import { useLanguage } from '../../../../hooks';
38
- var CountryItemContainer = styled(Box)(function () { return ({
39
- display: 'flex'
40
- }); });
41
- var CountryNameText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
42
- var theme = _a.theme, isSelected = _a.isSelected;
43
- return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
44
- });
45
- var CheckIconStyled = styled(CheckIcon)(function (_a) {
46
- var theme = _a.theme;
47
- return ({
48
- color: theme.palette.success.main,
49
- display: 'flex',
50
- alignItems: 'flex-end'
51
- });
52
- });
53
- var CountrySpanStyled = styled(Text)(function () { return ({
54
- cursor: 'pointer'
55
- }); });
56
- var CountryIconStyled = styled(Icon)(function (_a) {
57
- var theme = _a.theme;
58
- return ({
59
- width: theme.spacing(2.75),
60
- height: theme.spacing(2),
61
- verticalAlign: 'middle'
62
- });
63
- });
64
- var BusinessCountry = React.forwardRef(function (_a, ref) {
65
- var _b, _c;
66
- var countries = _a.countries, rest = __rest(_a, ["countries"]);
67
- var businessCountries = React.useState(countries)[0];
68
- var _d = React.useState(null), anchorEl = _d[0], setAnchorEl = _d[1];
69
- var t = useTranslation().t;
70
- var isAr = useLanguage().isAr;
71
- var control = useFormContext().control;
72
- var businessCountryControl = useController({ control: control, name: 'businessCountry' });
73
- var onOpenCountrySelect = function (event) {
74
- var _a;
75
- setAnchorEl(event.currentTarget);
76
- (_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
77
- };
78
- var onCloseCountrySelect = function () {
79
- var _a;
80
- setAnchorEl(null);
81
- (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
82
- };
83
- var onSelectItem = function (country) {
84
- onCloseCountrySelect();
85
- businessCountryControl.field.onChange(country);
86
- };
87
- var businessCountry = businessCountryControl.field.value;
88
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { marginBottom: '25px' } }, { children: [_jsx(Input, { label: t('signup_select_country'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseCountrySelect(); } : onOpenCountrySelect, startAdornment: _jsx(CountrySpanStyled, { children: _jsx(CountryIconStyled, { src: (businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.logo) || '' }) }), endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('ide_mobile_placeholder'), value: (isAr ? (_b = businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.name) === null || _b === void 0 ? void 0 : _b.arabic : (_c = businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.name) === null || _c === void 0 ? void 0 : _c.english) || '' }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', list: businessCountries, onSelectItem: onSelectItem, renderItem: function (item) {
89
- return (_jsxs(_Fragment, { children: [_jsxs(CountryItemContainer, { children: [_jsx(CountryIconStyled, { src: item.logo, alt: item.iso3 }), _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english }))] }), item.idd_prefix === (businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.idd_prefix) && _jsx(CheckIconStyled, {})] }));
90
- } }) }))] })) })));
91
- });
92
- export default React.memo(BusinessCountry);
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- interface DOBProps {
3
- onDateClicked?: (flag: boolean) => void;
4
- }
5
- declare const DOB: ({ onDateClicked }: DOBProps) => JSX.Element;
6
- export default DOB;
@@ -1,38 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { ScreenContainer } from '../../../shared/Containers';
14
- import DatePicker from '../../../../components/DatePicker';
15
- import { useTranslation } from 'react-i18next';
16
- import { useController, useFormContext } from 'react-hook-form';
17
- import { alpha, styled } from '@mui/material/styles';
18
- import Text from '../../../../components/Text';
19
- var InputLabelStyled = styled(Text)(function (_a) {
20
- var theme = _a.theme;
21
- return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
22
- });
23
- var DOB = function (_a) {
24
- var _b;
25
- var onDateClicked = _a.onDateClicked;
26
- var t = useTranslation().t;
27
- var control = useFormContext().control;
28
- var dobControl = useController({ control: control, name: 'dob' });
29
- var handleBirthDateChange = function (data) {
30
- dobControl.field.onChange(data);
31
- };
32
- var dateValue = (_b = dobControl === null || dobControl === void 0 ? void 0 : dobControl.field) === null || _b === void 0 ? void 0 : _b.value;
33
- return (_jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
34
- var spacing = _a.spacing;
35
- return spacing(2.5, 2.5, 1.5, 2.5);
36
- } } }, { children: t('enter_birth_date') })), _jsx(DatePicker, { defaultValue: dateValue ? new Date(dateValue) : new Date(), readOnly: true, dir: 'ltr', locale: 'en', onDateChange: handleBirthDateChange, onClick: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(true); }, onDatePicked: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(false); } })] }));
37
- };
38
- export default DOB;
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- interface IDNumberProps {
3
- show: boolean;
4
- onSwitchToMobileNumber?: () => void;
5
- }
6
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<IDNumberProps & React.RefAttributes<unknown>>>;
7
- export default _default;