@tap-payments/auth-jsconnect 1.0.11 → 1.0.16

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 (155) hide show
  1. package/build/assets/locales/ar.json +200 -88
  2. package/build/assets/locales/en.json +216 -90
  3. package/build/components/DatePicker/DatePicker.js +6 -17
  4. package/build/components/ExpandIcon/ExpandIcon.d.ts +7 -0
  5. package/build/components/ExpandIcon/ExpandIcon.js +24 -0
  6. package/build/components/ExpandIcon/index.d.ts +2 -0
  7. package/build/components/ExpandIcon/index.js +2 -0
  8. package/build/components/Footer/Footer.js +1 -1
  9. package/build/components/Loader/Loader.js +2 -2
  10. package/build/components/Warning/Warning.d.ts +1 -2
  11. package/build/components/Warning/Warning.js +1 -2
  12. package/build/constants/app.d.ts +1 -1
  13. package/build/constants/app.js +32 -8
  14. package/build/constants/dummy.js +3 -3
  15. package/build/features/bank/screens/BankDetails/BankName.js +1 -1
  16. package/build/features/bank/screens/BankDetails/Beneficiary.js +5 -5
  17. package/build/features/bank/screens/BankDetails/IBAN.js +3 -3
  18. package/build/features/bank/screens/BankDetails/validation.js +9 -4
  19. package/build/features/bank/screens/Success/Success.d.ts +5 -0
  20. package/build/features/bank/screens/Success/Success.js +14 -0
  21. package/build/features/bank/screens/Success/index.d.ts +3 -0
  22. package/build/features/bank/screens/Success/index.js +2 -0
  23. package/build/features/business/screens/Activities/ActivitiesList.d.ts +0 -16
  24. package/build/features/business/screens/Activities/ActivitiesList.js +3 -17
  25. package/build/features/business/screens/Activities/OperationStartDate.js +1 -1
  26. package/build/features/business/screens/Activities/SalesChannels.js +1 -1
  27. package/build/features/business/screens/Activities/validation.js +3 -3
  28. package/build/features/business/screens/BusinessType/CRNumber.js +2 -1
  29. package/build/features/business/screens/BusinessType/CompanyLicense.js +2 -2
  30. package/build/features/business/screens/BusinessType/FLNumber.js +2 -1
  31. package/build/features/business/screens/BusinessType/FreelanceLicense.js +2 -2
  32. package/build/features/business/screens/BusinessType/SelectType.js +1 -1
  33. package/build/features/business/screens/BusinessType/validation.js +2 -8
  34. package/build/features/business/screens/Confirm/Confirm.js +1 -1
  35. package/build/features/business/screens/Customers/CustomerLocations.d.ts +0 -24
  36. package/build/features/business/screens/Customers/CustomerLocations.js +3 -17
  37. package/build/features/business/screens/Customers/Customers.js +5 -41
  38. package/build/features/business/screens/Customers/ExpectedCustomers.js +7 -11
  39. package/build/features/business/screens/Customers/ExpectedSalesRange.js +7 -6
  40. package/build/features/business/screens/Customers/RefundPolicy.d.ts +0 -8
  41. package/build/features/business/screens/Customers/RefundPolicy.js +2 -10
  42. package/build/features/business/screens/Customers/TransactionPolicy.js +3 -2
  43. package/build/features/business/screens/Customers/validation.d.ts +6 -6
  44. package/build/features/business/screens/Customers/validation.js +10 -5
  45. package/build/features/business/screens/IDBOD/DOB.js +3 -11
  46. package/build/features/business/screens/IDBOD/ID.js +1 -1
  47. package/build/features/business/screens/IDBOD/validation.js +7 -2
  48. package/build/features/business/screens/OTP/OTP.js +18 -58
  49. package/build/features/business/screens/OTP/OTPInput.js +9 -21
  50. package/build/features/business/screens/OTP/validation.js +1 -1
  51. package/build/features/business/screens/Success/Success.js +1 -2
  52. package/build/features/business/screens/VerifyNumber/OTPInput.d.ts +1 -2
  53. package/build/features/business/screens/VerifyNumber/OTPInput.js +13 -42
  54. package/build/features/business/screens/VerifyNumber/VerifyNumber.js +20 -66
  55. package/build/features/business/screens/VerifyNumber/validation.js +1 -1
  56. package/build/features/connect/screens/Individual/Email.js +7 -1
  57. package/build/features/connect/screens/Individual/Individual.js +0 -28
  58. package/build/features/connect/screens/Individual/Name.js +9 -3
  59. package/build/features/connect/screens/Individual/validation.js +5 -2
  60. package/build/features/connect/screens/MID/BusinessCountry.d.ts +1 -0
  61. package/build/features/connect/screens/MID/BusinessCountry.js +2 -2
  62. package/build/features/connect/screens/MID/DOB.d.ts +6 -0
  63. package/build/features/connect/screens/MID/DOB.js +38 -0
  64. package/build/features/connect/screens/MID/IDNumber.js +3 -14
  65. package/build/features/connect/screens/MID/MID.js +13 -7
  66. package/build/features/connect/screens/MID/MobileNumber.d.ts +1 -0
  67. package/build/features/connect/screens/MID/MobileNumber.js +34 -10
  68. package/build/features/connect/screens/MID/validation.d.ts +1 -1
  69. package/build/features/connect/screens/MID/validation.js +9 -4
  70. package/build/features/connect/screens/Merchant/BrandName.js +3 -1
  71. package/build/features/connect/screens/Merchant/SocialMedia.js +7 -2
  72. package/build/features/connect/screens/Merchant/TAC.js +1 -1
  73. package/build/features/connect/screens/Merchant/validation.d.ts +9 -9
  74. package/build/features/connect/screens/Merchant/validation.js +42 -11
  75. package/build/features/connect/screens/OTP/OTP.js +4 -3
  76. package/build/features/connect/screens/OTP/OTPInput.js +2 -1
  77. package/build/features/connect/screens/OTP/validation.js +1 -1
  78. package/build/features/connect/screens/Password/PasswordInput.js +2 -1
  79. package/build/features/connect/screens/Password/validation.js +1 -1
  80. package/build/features/connect/screens/ThankYou/ThankYou.js +1 -2
  81. package/build/features/featuresScreens.d.ts +1 -1
  82. package/build/features/featuresScreens.js +27 -7
  83. package/build/features/individual/Individual.d.ts +6 -0
  84. package/build/features/individual/Individual.js +50 -0
  85. package/build/features/individual/index.d.ts +1 -0
  86. package/build/features/individual/index.js +1 -0
  87. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +8 -0
  88. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +81 -0
  89. package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.d.ts +10 -0
  90. package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.js +81 -0
  91. package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.d.ts +6 -0
  92. package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.js +40 -0
  93. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +6 -0
  94. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +45 -0
  95. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +6 -0
  96. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +36 -0
  97. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +6 -0
  98. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +45 -0
  99. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +9 -0
  100. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +87 -0
  101. package/build/features/individual/screens/AdditionalIndividualInfo/index.d.ts +3 -0
  102. package/build/features/individual/screens/AdditionalIndividualInfo/index.js +2 -0
  103. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +25 -0
  104. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +35 -0
  105. package/build/features/individual/screens/ShowIndividualInfo/ShowOwnerInfo.d.ts +19 -0
  106. package/build/features/individual/screens/ShowIndividualInfo/ShowOwnerInfo.js +52 -0
  107. package/build/features/individual/screens/ShowIndividualInfo/index.d.ts +3 -0
  108. package/build/features/individual/screens/ShowIndividualInfo/index.js +2 -0
  109. package/build/features/individual/screens/ShowIndividualInfo/info.d.ts +7 -0
  110. package/build/features/individual/screens/ShowIndividualInfo/info.js +28 -0
  111. package/build/features/individual/screens/Success/Success.d.ts +5 -0
  112. package/build/features/individual/screens/Success/Success.js +14 -0
  113. package/build/features/individual/screens/Success/index.d.ts +3 -0
  114. package/build/features/individual/screens/Success/index.js +2 -0
  115. package/build/features/owner/screens/AdditionalOwnerInfo/AdditionalOwnerInfo.js +1 -1
  116. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerLocation.js +1 -1
  117. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerName.js +7 -2
  118. package/build/features/owner/screens/AdditionalOwnerInfo/InfluencerSwitch.js +1 -1
  119. package/build/features/owner/screens/AdditionalOwnerInfo/MonthlyIncome.js +1 -1
  120. package/build/features/owner/screens/AdditionalOwnerInfo/PEPSwitch.js +1 -1
  121. package/build/features/owner/screens/AdditionalOwnerInfo/SourceOfIncome.js +1 -1
  122. package/build/features/owner/screens/AdditionalOwnerInfo/validation.js +6 -3
  123. package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.js +1 -1
  124. package/build/features/owner/screens/Success/Success.d.ts +5 -0
  125. package/build/features/owner/screens/Success/Success.js +14 -0
  126. package/build/features/owner/screens/Success/index.d.ts +3 -0
  127. package/build/features/owner/screens/Success/index.js +2 -0
  128. package/build/features/password/Password.js +2 -2
  129. package/build/features/password/screens/CreatePassword/ConfirmPassword.d.ts +4 -1
  130. package/build/features/password/screens/CreatePassword/ConfirmPassword.js +3 -8
  131. package/build/features/password/screens/CreatePassword/Password.js +2 -1
  132. package/build/features/password/screens/CreatePassword/validation.js +3 -3
  133. package/build/features/password/screens/Success/Success.d.ts +5 -0
  134. package/build/features/password/screens/Success/Success.js +14 -0
  135. package/build/features/password/screens/Success/index.d.ts +3 -0
  136. package/build/features/password/screens/Success/index.js +2 -0
  137. package/build/features/shared/Button/Button.js +7 -1
  138. package/build/features/shared/Footer/Footer.js +1 -1
  139. package/build/features/shared/SuccessScreen/SuccessScreen.js +10 -1
  140. package/build/features/tax/screens/Success/Success.d.ts +5 -0
  141. package/build/features/tax/screens/Success/Success.js +14 -0
  142. package/build/features/tax/screens/Success/index.d.ts +3 -0
  143. package/build/features/tax/screens/Success/index.js +2 -0
  144. package/build/features/tax/screens/TaxDetails/VATId.js +3 -4
  145. package/build/features/tax/screens/TaxDetails/validation.js +1 -1
  146. package/build/index.css +105 -3
  147. package/build/index.d.ts +3 -3
  148. package/build/index.js +4 -4
  149. package/build/theme/typography.js +2 -2
  150. package/build/utils/string.js +2 -2
  151. package/package.json +120 -120
  152. package/build/features/business/screens/OTP/OTPTimer.d.ts +0 -5
  153. package/build/features/business/screens/OTP/OTPTimer.js +0 -20
  154. package/build/features/business/screens/VerifyNumber/OTPTimer.d.ts +0 -5
  155. package/build/features/business/screens/VerifyNumber/OTPTimer.js +0 -20
@@ -30,7 +30,9 @@ import { useLanguage } from '../../../../hooks';
30
30
  import { EXPECTED_SALES_RANGE } from '../../../../constants';
31
31
  import SimpleList from '../../../../components/SimpleList';
32
32
  import Collapse from '../../../../components/Collapse';
33
- import { InputLabelStyled, BoxStyled, CheckIconStyled, ExpandIcon, RemainingCheck, InputStyled, NameContainer } from './CustomerLocations';
33
+ import ExpandIcon from '../../../../components/ExpandIcon';
34
+ import { ScreenContainer } from '../../../shared/Containers';
35
+ import { InputLabelStyled, CheckIconStyled, InputStyled, NameContainer } from './CustomerLocations';
34
36
  var ListItemContainer = styled(Box)(function () { return ({
35
37
  display: 'flex'
36
38
  }); });
@@ -62,13 +64,12 @@ var ExpectedSalesRange = function (_a) {
62
64
  };
63
65
  var onSelectItem = function (expectedSalesRange) {
64
66
  onCloseList();
65
- var remaining = expectedSalesRangeList.filter(function (saleRange) { return saleRange.id <= expectedSalesRange.id; });
66
- expectedSalesRangeControl.field.onChange(remaining);
67
+ expectedSalesRangeControl.field.onChange(expectedSalesRange);
67
68
  };
68
69
  var expectedSalesRangeValue = expectedSalesRangeControl.field.value || expectedSalesRangeList;
69
- var expectedSalesRangeSelected = expectedSalesRangeValue[expectedSalesRangeValue.length - 1];
70
- return (_jsxs(BoxStyled, { children: [_jsx(InputLabelStyled, { children: t('expected_sales_range') }), _jsx(InputStyled, { readOnly: true, value: isAr ? expectedSalesRangeSelected === null || expectedSalesRangeSelected === void 0 ? void 0 : expectedSalesRangeSelected.nameAR : expectedSalesRangeSelected === null || expectedSalesRangeSelected === void 0 ? void 0 : expectedSalesRangeSelected.name, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 100 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name', list: expectedSalesRangeList, onSelectItem: onSelectItem, renderItem: function (item) {
71
- return (_jsxs(_Fragment, { children: [_jsx(ListItemContainer, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === (expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.id) }, { children: isAr ? item.nameAR : item.name })) }), item.id === (expectedSalesRangeSelected === null || expectedSalesRangeSelected === void 0 ? void 0 : expectedSalesRangeSelected.id) && _jsx(CheckIconStyled, {}), checkRemainingCondition(item) && item.id != (expectedSalesRangeSelected === null || expectedSalesRangeSelected === void 0 ? void 0 : expectedSalesRangeSelected.id) && _jsx(RemainingCheck, {})] }));
70
+ var expectedSalesRangeSelected = expectedSalesRangeValue;
71
+ return (_jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_sales_yearly') }), _jsx(InputStyled, { readOnly: true, value: isAr ? expectedSalesRangeSelected === null || expectedSalesRangeSelected === void 0 ? void 0 : expectedSalesRangeSelected.nameAR : expectedSalesRangeSelected === null || expectedSalesRangeSelected === void 0 ? void 0 : expectedSalesRangeSelected.name, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, placeholder: t('choose_expected_sales'), endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name', list: expectedSalesRangeList, onSelectItem: onSelectItem, renderItem: function (item) {
72
+ return (_jsxs(_Fragment, { children: [_jsx(ListItemContainer, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === (expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.id) }, { children: isAr ? item.nameAR : item.name })) }), item.id === (expectedSalesRangeSelected === null || expectedSalesRangeSelected === void 0 ? void 0 : expectedSalesRangeSelected.id) && _jsx(CheckIconStyled, {})] }));
72
73
  } }) }))] }));
73
74
  };
74
75
  export default ExpectedSalesRange;
@@ -1,12 +1,4 @@
1
1
  import * as React from 'react';
2
- export declare const BoxStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
3
- children?: React.ReactNode;
4
- component?: React.ElementType<any> | undefined;
5
- ref?: React.Ref<unknown> | undefined;
6
- sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
7
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
8
- ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
9
- }, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "ref" | "children" | "component" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
10
2
  export declare const ContainerStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
11
3
  children?: React.ReactNode;
12
4
  component?: React.ElementType<any> | undefined;
@@ -21,15 +21,7 @@ import Text from '../../../../components/Text';
21
21
  import Link from '@mui/material/Link';
22
22
  import Warning from '../../../../components/Warning';
23
23
  import { EXTERNAL_LINKS } from '../../../../constants';
24
- export var BoxStyled = styled(Box)(function (_a) {
25
- var theme = _a.theme;
26
- return ({
27
- direction: theme.direction,
28
- display: 'flex',
29
- flexDirection: 'column',
30
- marginBlockStart: theme.spacing(2.75)
31
- });
32
- });
24
+ import { ScreenContainer } from '../../../shared/Containers';
33
25
  export var ContainerStyled = styled(Box)(function (_a) {
34
26
  var theme = _a.theme;
35
27
  return ({
@@ -81,6 +73,6 @@ var RefundPolicy = function () {
81
73
  var handleRefundCheckedChange = function (event, checked) {
82
74
  refundControl.field.onChange(checked);
83
75
  };
84
- return (_jsxs(BoxStyled, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: refundChecked, onChange: handleRefundCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_refund_policy'), _jsx(LinkStyled, __assign({ href: isAr ? EXTERNAL_LINKS.REFUND_AR : EXTERNAL_LINKS.REFUND_EN, target: '_blank', underline: 'always' }, { children: t('refund_policy_compliance') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage })) }))] }));
76
+ return (_jsxs(ScreenContainer, __assign({ sx: { mt: 2.75 } }, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: refundChecked, onChange: handleRefundCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_refund_policy'), _jsx(LinkStyled, __assign({ href: isAr ? EXTERNAL_LINKS.REFUND_AR : EXTERNAL_LINKS.REFUND_EN, target: '_blank', underline: 'always' }, { children: t('refund_policy_compliance') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] })));
85
77
  };
86
78
  export default RefundPolicy;
@@ -17,7 +17,8 @@ import { useLanguage } from '../../../../hooks';
17
17
  import { useController, useFormContext } from 'react-hook-form';
18
18
  import Warning from '../../../../components/Warning';
19
19
  import { EXTERNAL_LINKS } from '../../../../constants';
20
- import { BoxStyled, ContainerStyled, CheckboxStyled, TextStyled, LinkStyled } from './RefundPolicy';
20
+ import { ContainerStyled, CheckboxStyled, TextStyled, LinkStyled } from './RefundPolicy';
21
+ import { ScreenContainer } from '../../../shared/Containers';
21
22
  var CollapseStyled = styled(Collapse)(function () { return ({
22
23
  width: '100%'
23
24
  }); });
@@ -32,6 +33,6 @@ var TransactionPolicy = function () {
32
33
  var handleTransactionCheckedChange = function (event, checked) {
33
34
  transactionControl.field.onChange(checked);
34
35
  };
35
- return (_jsxs(BoxStyled, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: transactionChecked, onChange: handleTransactionCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_transaction_policy'), _jsx(LinkStyled, __assign({ href: isAr ? EXTERNAL_LINKS.TRANSACTION_AR : EXTERNAL_LINKS.TRANSACTION_EN, target: '_blank', underline: 'always' }, { children: t('transaction_policy') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage })) }))] }));
36
+ return (_jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: transactionChecked, onChange: handleTransactionCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_chargeback_policy'), _jsx(LinkStyled, __assign({ href: isAr ? EXTERNAL_LINKS.TRANSACTION_AR : EXTERNAL_LINKS.TRANSACTION_EN, target: '_blank', underline: 'always' }, { children: t('chargeback_policy') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }));
36
37
  };
37
38
  export default TransactionPolicy;
@@ -1,20 +1,20 @@
1
1
  import * as yup from 'yup';
2
2
  export declare const CustomerInfoValidation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
3
  customerLocations: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
4
- expectedCustomers: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
5
- expectedSalesRange: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
4
+ expectedCustomers: any;
5
+ expectedSalesRange: any;
6
6
  refundPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
7
7
  transactionPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
8
8
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
9
9
  customerLocations: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
10
- expectedCustomers: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
11
- expectedSalesRange: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
10
+ expectedCustomers: any;
11
+ expectedSalesRange: any;
12
12
  refundPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
13
13
  transactionPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
14
14
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
15
15
  customerLocations: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
16
- expectedCustomers: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
17
- expectedSalesRange: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
16
+ expectedCustomers: any;
17
+ expectedSalesRange: any;
18
18
  refundPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
19
19
  transactionPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
20
20
  }>>>;
@@ -1,8 +1,13 @@
1
1
  import * as yup from 'yup';
2
+ var objectElements = {
3
+ id: yup.number(),
4
+ name: yup.string(),
5
+ nameAR: yup.string()
6
+ };
2
7
  export var CustomerInfoValidation = yup.object().shape({
3
- customerLocations: yup.array().required(''),
4
- expectedCustomers: yup.array().required(''),
5
- expectedSalesRange: yup.array().required(''),
6
- refundPolicy: yup.boolean().required().isTrue('Please accept the refund policy'),
7
- transactionPolicy: yup.boolean().required().isTrue('Please accept the transaction policy')
8
+ customerLocations: yup.array().required('please_choose_base'),
9
+ expectedCustomers: yup.object().shape(objectElements).required('select_expected_customers_serve'),
10
+ expectedSalesRange: yup.object().shape(objectElements).required('select_expected_sales'),
11
+ refundPolicy: yup.boolean().required().isTrue('refund_policy_error'),
12
+ transactionPolicy: yup.boolean().required().isTrue('transaction_policy_error')
8
13
  });
@@ -11,20 +11,12 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
- import Box from '@mui/material/Box';
15
14
  import { useTranslation } from 'react-i18next';
16
15
  import { useController, useFormContext } from 'react-hook-form';
17
16
  import { styled, alpha } from '@mui/material/styles';
18
17
  import Text from '../../../../components/Text';
19
18
  import DatePicker from '../../../../components/DatePicker';
20
- var BoxStyled = styled(Box)(function (_a) {
21
- var theme = _a.theme;
22
- return ({
23
- display: 'flex',
24
- flexDirection: 'column',
25
- direction: theme.direction
26
- });
27
- });
19
+ import { ScreenContainer } from '../../../../features/shared/Containers';
28
20
  var InputLabelStyled = styled(Text)(function (_a) {
29
21
  var theme = _a.theme;
30
22
  return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption), { cursor: 'pointer' }));
@@ -39,9 +31,9 @@ var BOD = function (_a) {
39
31
  dobControl.field.onChange(data);
40
32
  };
41
33
  var dateValue = (_b = dobControl === null || dobControl === void 0 ? void 0 : dobControl.field) === null || _b === void 0 ? void 0 : _b.value;
42
- return (_jsxs(BoxStyled, { children: [_jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
34
+ return (_jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
43
35
  var spacing = _a.spacing;
44
36
  return spacing(2.5, 2.5, 1.5, 2.5);
45
- } } }, { children: t('date_of_birth') })), _jsx(DatePicker, { readOnly: true, defaultValue: dateValue ? new Date(dateValue) : new Date(), dir: 'ltr', locale: 'en', onClick: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(true); }, onDatePicked: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(false); }, onDateChange: handleBirthDateChange })] }));
37
+ } } }, { children: t('enter_birth_date') })), _jsx(DatePicker, { readOnly: true, defaultValue: dateValue ? new Date(dateValue) : new Date(), dir: 'ltr', locale: 'en', onClick: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(true); }, onDatePicked: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(false); }, onDateChange: handleBirthDateChange })] }));
46
38
  };
47
39
  export default React.memo(BOD);
@@ -23,6 +23,6 @@ var IDNumber = function (_a) {
23
23
  };
24
24
  var nidValue = nidControl.field.value;
25
25
  var error = (_b = nidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
26
- return (_jsx(ScreenContainer, { children: _jsx(Input, { label: t('id_number_label'), inputProps: { maxLength: ID_NUMBER_LENGTH }, onChange: handleIdChange, value: nidValue, endAdornment: !error && nidValue ? _jsx(CheckIcon, {}) : nidValue && _jsx(ClearIcon, { onClick: clearIdNumber }), placeholder: '0000000000', warningType: 'alert', warningMessage: error && t(error) }) }));
26
+ return (_jsx(ScreenContainer, { children: _jsx(Input, { label: t('enter_national_id'), inputProps: { maxLength: ID_NUMBER_LENGTH }, onChange: handleIdChange, value: nidValue, endAdornment: !error && nidValue ? _jsx(CheckIcon, {}) : nidValue && _jsx(ClearIcon, { onClick: clearIdNumber }), placeholder: '0000000000', warningType: 'alert', warningMessage: error && t(error, { number: '1' }) }) }));
27
27
  };
28
28
  export default React.memo(IDNumber);
@@ -1,5 +1,10 @@
1
1
  import * as yup from 'yup';
2
2
  export var NIDValidationSchema = yup.object().shape({
3
- dob: yup.string().min(5).required('dob_is_required'),
4
- nid: yup.string().min(8, 'id_number_label_error').max(10, 'id_number_label_error').required('id_number_label_error')
3
+ dob: yup.string().min(5).required('enter_valid_birth_date'),
4
+ nid: yup
5
+ .string()
6
+ .matches(/^(1)([0-9]{1,})$/g, 'signup_invalid_national_id_format')
7
+ .min(8, 'signup_invalid_national_id_format')
8
+ .max(10, 'signup_invalid_national_id_format')
9
+ .required('signup_invalid_national_id')
5
10
  });
@@ -10,82 +10,41 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import Box from '@mui/material/Box/Box';
14
- import { styled } from '@mui/material/styles';
15
13
  import * as React from 'react';
16
- import { useTranslation } from 'react-i18next';
17
- import Text from '../../../../components/Text';
18
- import OTPTimer from './OTPTimer';
19
- import Icon from '../../../../components/Icon';
20
- import Button from '../../../../components/Button';
21
- import Loader from '../../../../components/Loader';
22
- import { ICONS_NAMES } from '../../../../constants/assets';
23
14
  import { useAppDispatch } from '../../../../hooks';
24
- import { handleNextScreenStep } from '../../../../app/settings';
25
- import { useLanguage } from '../../../../hooks';
15
+ import { useTranslation } from 'react-i18next';
26
16
  import { useForm, FormProvider } from 'react-hook-form';
27
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 } from '../../../../app/settings';
21
+ import { useLanguage } from '../../../../hooks';
28
22
  import Form from '../../../../components/Form';
23
+ import Text from '../../../../components/Text';
24
+ import { ScreenContainer } from '../../../shared/Containers';
25
+ import Button from '../../../shared/Button';
29
26
  import { maskID } from '../../../../utils';
30
27
  import { OTPValidation } from './validation';
31
28
  import OTPInput from './OTPInput';
32
- var BoxStyled = styled(Box)(function (_a) {
29
+ var OTPTitleContainerStyled = styled(Box)(function (_a) {
33
30
  var theme = _a.theme;
34
31
  return ({
35
- display: 'flex',
36
- flexDirection: 'column',
37
- overflow: 'hidden',
38
- direction: theme.direction
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)
39
38
  });
40
39
  });
41
- var OTPTitleContainerStyled = styled(Box)(function (_a) {
42
- var _b;
43
- var theme = _a.theme;
44
- return (_b = {
45
- background: theme.palette.common.white,
46
- border: '1px solid',
47
- borderColor: theme.palette.divider,
48
- direction: theme.direction,
49
- borderRadius: theme.spacing(0, 0, 1.25, 1.25)
50
- },
51
- _b[theme.breakpoints.up('sm')] = {
52
- marginBottom: theme.spacing(6)
53
- },
54
- _b);
55
- });
56
40
  var OTPTitleStyled = styled(Text)(function (_a) {
57
41
  var theme = _a.theme;
58
- return (__assign(__assign({}, theme.typography.body1), { fontWeight: theme.typography.fontWeightLight, color: theme.palette.text.primary, marginBlock: theme.spacing(1.75), marginInlineStart: theme.spacing(2.5) }));
59
- });
60
- var LoaderStyled = styled(Loader)(function (_a) {
61
- var theme = _a.theme;
62
- return ({
63
- marginInlineStart: theme.spacing(-6.25),
64
- '& .loader-box-container': {
65
- marginInlineStart: theme.spacing(2.5)
66
- }
67
- });
42
+ return (__assign(__assign({}, theme.typography.body1), { fontWeight: theme.typography.fontWeightLight, color: theme.palette.text.primary, marginBlock: theme.spacing(1.75), marginInlineStart: theme.spacing(2.5), lineHeight: 1.75 }));
68
43
  });
69
44
  var FormStyled = styled(Form)(function () { return ({
70
45
  display: 'flex',
71
46
  flexDirection: 'column'
72
47
  }); });
73
- var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
74
- var theme = _a.theme, isAr = _a.isAr;
75
- return ({
76
- width: theme.spacing(3),
77
- height: theme.spacing(3),
78
- paddingInlineStart: theme.spacing(1.5),
79
- paddingInlineEnd: theme.spacing(0.5),
80
- transform: isAr ? 'scaleX(-1)' : 'scaleX(1)'
81
- });
82
- });
83
- var ButtonContainer = styled(Box)(function (_a) {
84
- var theme = _a.theme;
85
- return ({
86
- margin: theme.spacing(2.5)
87
- });
88
- });
89
48
  var OTP = function (_a) {
90
49
  var idNumber = _a.idNumber;
91
50
  var dispatch = useAppDispatch();
@@ -104,7 +63,8 @@ var OTP = function (_a) {
104
63
  return dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
105
64
  dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
106
65
  };
107
- return (_jsx(BoxStyled, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [t('opt_nid_sent_title'), " ", _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskID(idNumber || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(OTPTimer, {}), _jsx(ButtonContainer, { children: _jsx(Button, __assign({ disabled: !methods.formState.isValid, type: 'submit', startIcon: _jsx(LoaderStyled, { innerColor: 'white', outerColor: 'white', size: 30 }), endIcon: _jsx(IconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) }, { children: t('next') })) })] })) })) }));
66
+ var loading = false;
67
+ 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('opt_nid_sent_title', { provider: 'ABSHER' }), ' ', _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskID(idNumber || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ disabled: !methods.formState.isValid, type: 'submit', isAr: isAr, loading: loading }, { children: t('next') }))] })) })) }));
108
68
  };
109
69
  OTP.defaultProps = {
110
70
  idNumber: '1234567891'
@@ -10,42 +10,30 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ import * as React from 'react';
13
14
  import Box from '@mui/material/Box/Box';
14
15
  import { styled } from '@mui/material/styles';
15
- import OTPField from '../../../../components/OTPField';
16
- import * as React from 'react';
16
+ import OTPField from '../../../../features/shared/OTP';
17
17
  import { useController, useFormContext } from 'react-hook-form';
18
+ import { useTranslation } from 'react-i18next';
19
+ import { DEFAULT_TIMER_VALUE } from '../../../../constants';
18
20
  var BoxStyled = styled(Box)(function (_a) {
19
21
  var theme = _a.theme;
20
22
  return ({
21
23
  display: 'flex',
22
- flexDirection: 'column'
24
+ flexDirection: 'column',
25
+ fontFamily: theme.typography.fontFamily,
26
+ marginBottom: theme.spacing(5)
23
27
  });
24
28
  });
25
- var OTPStyled = styled(OTPField)(function (_a) {
26
- var _b;
27
- var theme = _a.theme;
28
- return (_b = {
29
- marginInlineStart: theme.spacing(2.0),
30
- input: {
31
- width: "".concat(theme.spacing(3.75), " !important")
32
- },
33
- '& :focus': {
34
- borderColor: theme.palette.primary.main
35
- }
36
- },
37
- _b[theme.breakpoints.down('sm')] = {
38
- marginInlineStart: theme.spacing(3)
39
- },
40
- _b);
41
- });
42
29
  var OTPInput = function (_a) {
43
30
  var control = useFormContext().control;
31
+ var t = useTranslation().t;
44
32
  var otpControl = useController({ name: 'otp', control: control });
45
33
  var handleOnOTPChange = function (otp) {
46
34
  otpControl.field.onChange(otp);
47
35
  };
48
36
  var otpValue = otpControl.field.value;
49
- return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPStyled, { value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
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()); } }) })));
50
38
  };
51
39
  export default React.memo(OTPInput);
@@ -1,4 +1,4 @@
1
1
  import * as yup from 'yup';
2
2
  export var OTPValidation = yup.object().shape({
3
- otp: yup.string().min(6).required('OTP is required')
3
+ otp: yup.string().min(6, 'otp_min_length').required('otp_required')
4
4
  });
@@ -8,8 +8,7 @@ var Success = function (_a) {
8
8
  console.log('success');
9
9
  alert('Account created successfully, please check your email');
10
10
  alert("It's a fake message, plz wait us to integrate with the backend. <A.Sharkawy>");
11
- window.location.href = '/new/business';
12
11
  };
13
- return _jsx(SuccessScreen, { title: t('success_message'), onSuccess: onSuccess });
12
+ return _jsx(SuccessScreen, { title: t('ide_successfully_verified_message'), onSuccess: onSuccess });
14
13
  };
15
14
  export default React.memo(Success);
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
2
  export interface OTPProps {
3
- onOTPChange?: (otp: string) => void;
4
3
  }
5
- declare const _default: React.MemoExoticComponent<({ onOTPChange }: OTPProps) => JSX.Element>;
4
+ declare const _default: React.MemoExoticComponent<({}: OTPProps) => JSX.Element>;
6
5
  export default _default;
@@ -10,59 +10,30 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ import * as React from 'react';
13
14
  import Box from '@mui/material/Box/Box';
14
15
  import { styled } from '@mui/material/styles';
15
- import OTPField from '../../../../components/OTPField';
16
- import * as React from 'react';
17
- import { useForm, FormProvider, useController, useFormContext } from 'react-hook-form';
18
- import { yupResolver } from '@hookform/resolvers/yup';
19
- import { OTPValidation } from './validation';
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
20
  var BoxStyled = styled(Box)(function (_a) {
21
- var _b;
22
- var theme = _a.theme;
23
- return (_b = {
24
- display: 'flex',
25
- flexDirection: 'column',
26
- direction: theme.direction
27
- },
28
- _b[theme.breakpoints.down('sm')] = {
29
- paddingTop: theme.spacing(2.5)
30
- },
31
- _b);
32
- });
33
- var OTPStyled = styled(OTPField)(function (_a) {
34
- var _b;
35
21
  var theme = _a.theme;
36
- return (_b = {
37
- marginInlineStart: theme.spacing(2.0),
38
- input: {
39
- width: "".concat(theme.spacing(3.75), " !important")
40
- },
41
- '& :focus': {
42
- borderColor: theme.palette.primary.main
43
- }
44
- },
45
- _b[theme.breakpoints.down('sm')] = {
46
- marginInlineStart: theme.spacing(3)
47
- },
48
- _b);
22
+ return ({
23
+ display: 'flex',
24
+ flexDirection: 'column',
25
+ fontFamily: theme.typography.fontFamily,
26
+ marginBottom: theme.spacing(5)
27
+ });
49
28
  });
50
29
  var OTPInput = function (_a) {
51
- var onOTPChange = _a.onOTPChange;
52
- var methods = useForm({
53
- resolver: yupResolver(OTPValidation),
54
- defaultValues: {
55
- otp: ''
56
- },
57
- mode: 'onChange'
58
- });
59
30
  var control = useFormContext().control;
31
+ var t = useTranslation().t;
60
32
  var otpControl = useController({ name: 'otp', control: control });
61
33
  var handleOnOTPChange = function (otp) {
62
34
  otpControl.field.onChange(otp);
63
- onOTPChange === null || onOTPChange === void 0 ? void 0 : onOTPChange(otp);
64
35
  };
65
36
  var otpValue = otpControl.field.value;
66
- return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsx(OTPStyled, { value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })) })));
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()); } }) })));
67
38
  };
68
39
  export default React.memo(OTPInput);
@@ -10,88 +10,41 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import Box from '@mui/material/Box/Box';
14
- import { styled } from '@mui/material/styles';
15
13
  import * as React from 'react';
16
- import { useTranslation } from 'react-i18next';
17
- import Text from '../../../../components/Text';
18
- import OTPTimer from './OTPTimer';
19
- import Icon from '../../../../components/Icon';
20
- import Button from '../../../../components/Button';
21
- import Loader from '../../../../components/Loader';
22
- import { ICONS_NAMES } from '../../../../constants/assets';
23
14
  import { useAppDispatch } from '../../../../hooks';
24
- import { handleNextScreenStep } from '../../../../app/settings';
25
- import { useLanguage } from '../../../../hooks';
15
+ import { useTranslation } from 'react-i18next';
26
16
  import { useForm, FormProvider } from 'react-hook-form';
27
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 } from '../../../../app/settings';
21
+ import { useLanguage } from '../../../../hooks';
28
22
  import Form from '../../../../components/Form';
23
+ import Text from '../../../../components/Text';
24
+ import { ScreenContainer } from '../../../shared/Containers';
25
+ import Button from '../../../shared/Button';
29
26
  import { maskPhone } from '../../../../utils';
30
27
  import { OTPValidation } from './validation';
31
28
  import OTPInput from './OTPInput';
32
- var BoxStyled = styled(Box)(function (_a) {
33
- var theme = _a.theme;
34
- return ({
35
- display: 'flex',
36
- flexDirection: 'column',
37
- overflow: 'hidden',
38
- direction: theme.direction
39
- });
40
- });
41
- var InputsContainerStyled = styled(Box)(function (_a) {
29
+ var OTPTitleContainerStyled = styled(Box)(function (_a) {
42
30
  var theme = _a.theme;
43
31
  return ({
44
- paddingBottom: theme.spacing(3.75)
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)
45
38
  });
46
39
  });
47
- var OTPTitleContainerStyled = styled(Box)(function (_a) {
48
- var _b;
49
- var theme = _a.theme;
50
- return (_b = {
51
- background: theme.palette.common.white,
52
- border: '1px solid',
53
- borderColor: theme.palette.divider,
54
- direction: theme.direction,
55
- borderRadius: theme.spacing(0, 0, 1.25, 1.25)
56
- },
57
- _b[theme.breakpoints.up('sm')] = {
58
- marginBottom: theme.spacing(6)
59
- },
60
- _b);
61
- });
62
40
  var OTPTitleStyled = styled(Text)(function (_a) {
63
41
  var theme = _a.theme;
64
- return (__assign(__assign({}, theme.typography.body1), { fontWeight: theme.typography.fontWeightLight, color: theme.palette.text.primary, marginBlock: theme.spacing(1.75), marginInlineStart: theme.spacing(2.5) }));
65
- });
66
- var LoaderStyled = styled(Loader)(function (_a) {
67
- var theme = _a.theme;
68
- return ({
69
- marginInlineStart: theme.spacing(-6.25),
70
- '& .loader-box-container': {
71
- marginInlineStart: theme.spacing(2.5)
72
- }
73
- });
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 }));
74
43
  });
75
44
  var FormStyled = styled(Form)(function () { return ({
76
45
  display: 'flex',
77
46
  flexDirection: 'column'
78
47
  }); });
79
- var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
80
- var theme = _a.theme, isAr = _a.isAr;
81
- return ({
82
- width: theme.spacing(3),
83
- height: theme.spacing(3),
84
- paddingInlineStart: theme.spacing(1.5),
85
- paddingInlineEnd: theme.spacing(0.5),
86
- transform: isAr ? 'scaleX(-1)' : 'scaleX(1)'
87
- });
88
- });
89
- var ButtonContainer = styled(Box)(function (_a) {
90
- var theme = _a.theme;
91
- return ({
92
- margin: theme.spacing(2.5)
93
- });
94
- });
95
48
  var VerifyNumber = function (_a) {
96
49
  var phone = _a.phone, code = _a.code;
97
50
  var dispatch = useAppDispatch();
@@ -110,10 +63,11 @@ var VerifyNumber = function (_a) {
110
63
  return dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
111
64
  dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
112
65
  };
113
- return (_jsx(BoxStyled, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(InputsContainerStyled, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [t('service_otp_send_title'), " ", _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(code, " ").concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(OTPTimer, {})] }), _jsx(ButtonContainer, { children: _jsx(Button, __assign({ disabled: !methods.formState.isValid, type: 'submit', startIcon: _jsx(LoaderStyled, { innerColor: 'white', outerColor: 'white', size: 30 }), endIcon: _jsx(IconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) }, { children: t('next') })) })] })) })) }));
66
+ var loading = false;
67
+ 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(code, " ").concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ disabled: !methods.formState.isValid, type: 'submit', isAr: isAr, loading: loading }, { children: t('next') }))] })) })) }));
114
68
  };
115
69
  VerifyNumber.defaultProps = {
116
- phone: '8940298292',
117
- code: '+91'
70
+ phone: '564656085',
71
+ code: '+996'
118
72
  };
119
73
  export default React.memo(VerifyNumber);
@@ -1,4 +1,4 @@
1
1
  import * as yup from 'yup';
2
2
  export var OTPValidation = yup.object().shape({
3
- otp: yup.string().min(6).required('OTP is required')
3
+ otp: yup.string().min(6, 'otp_min_length').required('otp_required')
4
4
  });
@@ -16,6 +16,8 @@ import { ScreenContainer } from '../../../shared/Containers';
16
16
  import Input from '../../../shared/Input';
17
17
  import { keepEmailCharacters } from '../../../../utils';
18
18
  import { useController, useFormContext } from 'react-hook-form';
19
+ import ClearIcon from '../../../shared/ClearIcon';
20
+ import CheckIcon from '../../../shared/CheckIcon';
19
21
  var Email = function (_a) {
20
22
  var _b;
21
23
  var t = useTranslation().t;
@@ -26,6 +28,10 @@ var Email = function (_a) {
26
28
  emailControl.field.onChange(value);
27
29
  };
28
30
  var emailValue = emailControl.field.value;
29
- return (_jsx(ScreenContainer, __assign({ sx: { mb: 5 } }, { children: _jsx(Input, { label: t('signup_enter_email'), value: emailValue, onChange: handleEmailChange, type: 'email', placeholder: t('signin_email_placeholder'), warningType: 'alert', warningMessage: (_b = emailControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message }) })));
31
+ var error = (_b = emailControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
32
+ var clearNumber = function () {
33
+ emailControl.field.onChange('');
34
+ };
35
+ return (_jsx(ScreenContainer, __assign({ sx: { mb: 5 } }, { children: _jsx(Input, { label: t('signup_email_lable'), value: emailValue, onChange: handleEmailChange, type: 'email', placeholder: t('signup_email_placeholder'), warningType: 'alert', warningMessage: error && t(error), endAdornment: !error && emailValue ? _jsx(CheckIcon, {}) : emailValue && _jsx(ClearIcon, { onClick: clearNumber }) }) })));
30
36
  };
31
37
  export default React.memo(Email);