@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
@@ -10,7 +10,6 @@ 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
13
  import { styled } from '@mui/material/styles';
15
14
  import Email from './Email';
16
15
  import Name from './Name';
@@ -18,44 +17,17 @@ import * as React from 'react';
18
17
  import { useTranslation } from 'react-i18next';
19
18
  import { useForm, FormProvider } from 'react-hook-form';
20
19
  import { yupResolver } from '@hookform/resolvers/yup';
21
- import Icon from '../../../../components/Icon';
22
20
  import { useAppDispatch } from '../../../../hooks';
23
21
  import { handleNextScreenStep } from '../../../../app/settings';
24
22
  import { IndividualValidation } from './validation';
25
23
  import Form from '../../../../components/Form';
26
24
  import Button from '../../../shared/Button';
27
25
  import { ScreenContainer } from '../../../shared/Containers';
28
- import Loader from '../../../../components/Loader';
29
26
  import { useLanguage } from '../../../../hooks';
30
27
  var FormStyled = styled(Form)(function () { return ({
31
28
  display: 'flex',
32
29
  flexDirection: 'column'
33
30
  }); });
34
- var ButtonContainer = styled(Box)(function (_a) {
35
- var theme = _a.theme;
36
- return ({
37
- margin: theme.spacing(5, 2.5, 0, 2.5)
38
- });
39
- });
40
- var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
41
- var theme = _a.theme, isAr = _a.isAr;
42
- return ({
43
- width: theme.spacing(3),
44
- height: theme.spacing(3),
45
- paddingInlineStart: theme.spacing(1.5),
46
- paddingInlineEnd: theme.spacing(0.5),
47
- transform: isAr ? 'scaleX(-1)' : 'scaleX(1)'
48
- });
49
- });
50
- var LoaderStyled = styled(Loader)(function (_a) {
51
- var theme = _a.theme;
52
- return ({
53
- marginInlineStart: theme.spacing(-6.25),
54
- '& .loader-box-container': {
55
- marginInlineStart: theme.spacing(2.5)
56
- }
57
- });
58
- });
59
31
  var Individual = function (_a) {
60
32
  var dispatch = useAppDispatch();
61
33
  var methods = useForm({
@@ -14,18 +14,24 @@ import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { ScreenContainer } from '../../../shared/Containers';
16
16
  import Input from '../../../shared/Input';
17
- import { removeAllNumberFromChars } from '../../../../utils';
17
+ import { removeOnlyNumbers } 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 Name = function (_a) {
20
22
  var _b;
21
23
  var t = useTranslation().t;
22
24
  var control = useFormContext().control;
23
25
  var nameControl = useController({ name: 'name', control: control });
24
26
  var handleNameChange = function (event) {
25
- var value = removeAllNumberFromChars(event.target.value);
27
+ var value = removeOnlyNumbers(event.target.value);
26
28
  nameControl.field.onChange(value);
27
29
  };
28
30
  var nameValue = nameControl.field.value;
29
- return (_jsx(ScreenContainer, __assign({ sx: { mb: 3, mt: 2.5 } }, { children: _jsx(Input, { label: t('signup_merchant_name_label'), value: nameValue, onChange: handleNameChange, placeholder: t('signup_merchant_name_label'), warningType: 'alert', warningMessage: (_b = nameControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message }) })));
31
+ var error = (_b = nameControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
32
+ var clearNumber = function () {
33
+ nameControl.field.onChange('');
34
+ };
35
+ return (_jsx(ScreenContainer, __assign({ sx: { mb: 3, mt: 2.5 } }, { children: _jsx(Input, { label: t('signup_merchant_name_label'), value: nameValue, onChange: handleNameChange, placeholder: t('signup_merchant_name_label'), warningType: 'alert', warningMessage: error && t(error), endAdornment: !error && nameValue ? _jsx(CheckIcon, {}) : nameValue && _jsx(ClearIcon, { onClick: clearNumber }) }) })));
30
36
  };
31
37
  export default React.memo(Name);
@@ -1,5 +1,8 @@
1
1
  import * as yup from 'yup';
2
2
  export var IndividualValidation = yup.object().shape({
3
- name: yup.string().min(3).required('Name is required'),
4
- email: yup.string().email().required('Email is required')
3
+ name: yup
4
+ .string()
5
+ .matches(/^([a-zA-Z0-9]+\s{1}[a-zA-Z0-9]{2,}|[a-zA-Z0-9]+\s{1}[a-zA-Z0-9]{1,}\s{1}[a-zA-Z0-9]{2,})$/g, 'please write your first and last name')
6
+ .required('please write your first and last name'),
7
+ email: yup.string().email('email_not_valid').required('email_not_valid')
5
8
  });
@@ -3,6 +3,7 @@ import { CountryCode } from '../../../../@types';
3
3
  interface BusinessCountryProps {
4
4
  countries: Array<CountryCode>;
5
5
  show: boolean;
6
+ setMobileLength?: (length: number) => void;
6
7
  onListOpen?: () => void;
7
8
  onListClose?: () => void;
8
9
  }
@@ -32,7 +32,7 @@ import CheckIcon from '@mui/icons-material/Check';
32
32
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
33
33
  import Icon from '../../../../components/Icon';
34
34
  import Input from '../../../shared/Input';
35
- import ExpandIcon from '../../../shared/ExpandIcon';
35
+ import ExpandIcon from '../../../../components/ExpandIcon';
36
36
  import SimpleList from '../../../../components/SimpleList';
37
37
  import { useLanguage } from '../../../../hooks';
38
38
  var CountryItemContainer = styled(Box)(function () { return ({
@@ -85,7 +85,7 @@ var BusinessCountry = React.forwardRef(function (_a, ref) {
85
85
  businessCountryControl.field.onChange(country);
86
86
  };
87
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('business_country_label'), 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('business_country_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) {
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
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
90
  } }) }))] })) })));
91
91
  });
@@ -0,0 +1,6 @@
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;
@@ -0,0 +1,38 @@
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;
@@ -22,7 +22,6 @@ import Input from '../../../shared/Input';
22
22
  import ClearIcon from '../../../shared/ClearIcon';
23
23
  import CheckIcon from '../../../shared/CheckIcon';
24
24
  import Collapse from '../../../../components/Collapse';
25
- import DatePicker from '../../../../components/DatePicker';
26
25
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
27
26
  import { removeAllCharsFromNumber } from '../../../../utils';
28
27
  import { ICONS_NAMES, ID_NUMBER_LENGTH } from '../../../../constants';
@@ -47,17 +46,14 @@ var IconStyled = styled(Icon)(function (_a) {
47
46
  });
48
47
  });
49
48
  var IDNumber = React.forwardRef(function (_a, ref) {
50
- var _b, _c;
49
+ var _b;
51
50
  var onSwitchToMobileNumber = _a.onSwitchToMobileNumber, show = _a.show;
52
51
  var t = useTranslation().t;
53
- var _d = useFormContext(), control = _d.control, setValue = _d.setValue;
52
+ var _c = useFormContext(), control = _c.control, setValue = _c.setValue;
54
53
  var nidControl = useController({ control: control, name: 'nid' });
55
- var dobControl = useController({ control: control, name: 'dob' });
56
54
  React.useEffect(function () {
57
55
  if (nidControl.field.value)
58
56
  setValue('nid', nidControl.field.value, { shouldValidate: true });
59
- if (dobControl.field.value)
60
- setValue('dob', dobControl.field.value, { shouldValidate: true });
61
57
  }, [show]);
62
58
  var handleIdChange = function (_a) {
63
59
  var target = _a.target;
@@ -67,15 +63,8 @@ var IDNumber = React.forwardRef(function (_a, ref) {
67
63
  var clearIdNumber = function () {
68
64
  nidControl.field.onChange('');
69
65
  };
70
- var handleBirthDateChange = function (data) {
71
- dobControl.field.onChange(data);
72
- };
73
66
  var nidValue = nidControl.field.value;
74
67
  var error = (_b = nidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
75
- var dateValue = (_c = dobControl === null || dobControl === void 0 ? void 0 : dobControl.field) === null || _c === void 0 ? void 0 : _c.value;
76
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('id_number_label') }), _jsx(Tooltip, __assign({ title: t('switch_to_mobile') }, { children: _jsx(IconStyled, { onClick: onSwitchToMobileNumber, alt: 'switcher icon', src: ICONS_NAMES.MOBILE_IMAGE }) }))] }), _jsx(Input, { dir: 'ltr', 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), required: true }), _jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
77
- var spacing = _a.spacing;
78
- return spacing(2.5, 2.5, 1.5, 2.5);
79
- } } }, { children: t('date_of_birth') })), _jsx(DatePicker, { defaultValue: dateValue ? new Date(dateValue) : new Date(), readOnly: true, dir: 'ltr', locale: 'en', onDateChange: handleBirthDateChange })] })) })));
68
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('enter_national_id') }), _jsx(Tooltip, __assign({ title: t('switch_to_mobile') }, { children: _jsx(IconStyled, { onClick: onSwitchToMobileNumber, alt: 'switcher icon', src: ICONS_NAMES.MOBILE_IMAGE }) }))] }), _jsx(Input, { dir: 'ltr', 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' }), required: true })] })) })));
80
69
  });
81
70
  export default React.memo(IDNumber);
@@ -18,7 +18,7 @@ import { useTranslation } from 'react-i18next';
18
18
  import { styled } from '@mui/material/styles';
19
19
  import Collapse from '../../../../components/Collapse';
20
20
  import Form from '../../../../components/Form';
21
- import Button from '../../../../features/shared/Button';
21
+ import Button from '../../../shared/Button';
22
22
  import { useAppDispatch } from '../../../../hooks';
23
23
  import { handleNextScreenStep } from '../../../../app/settings';
24
24
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
@@ -29,6 +29,7 @@ import IDNumber from './IDNumber';
29
29
  import BusinessCountry from './BusinessCountry';
30
30
  import { NIDValidationSchema, PhoneValidationSchema } from './validation';
31
31
  import { countriesCode, defaultCountry, businessCountries } from '../../../../constants/dummy';
32
+ import DOB from './DOB';
32
33
  var FormStyled = styled(Form)(function () { return ({
33
34
  display: 'flex',
34
35
  flexDirection: 'column'
@@ -50,17 +51,19 @@ var ListType;
50
51
  ListType["CountryCodeList"] = "CountryCodeList";
51
52
  })(ListType || (ListType = {}));
52
53
  var MID = function (_a) {
53
- var _b = React.useState(false), isNID = _b[0], setIsNID = _b[1];
54
- var _c = React.useState(), listType = _c[0], setListType = _c[1];
54
+ var _b = React.useState(false), collapse = _b[0], setCollapse = _b[1];
55
+ var _c = React.useState(false), isNID = _c[0], setIsNID = _c[1];
56
+ var _d = React.useState(10), mobileLength = _d[0], setMobileLength = _d[1];
57
+ var _e = React.useState(), listType = _e[0], setListType = _e[1];
55
58
  var dispatch = useAppDispatch();
56
59
  var methods = useForm({
57
- resolver: yupResolver(isNID ? NIDValidationSchema : PhoneValidationSchema(10)),
60
+ resolver: yupResolver(isNID ? NIDValidationSchema : PhoneValidationSchema(mobileLength)),
58
61
  defaultValues: {
59
62
  countryCode: defaultCountry,
60
63
  businessCountry: defaultCountry,
61
64
  nid: '',
62
- dob: '',
63
- mobile: ''
65
+ dob: '1998-08-22',
66
+ mobile: null
64
67
  },
65
68
  mode: 'onChange'
66
69
  });
@@ -73,9 +76,12 @@ var MID = function (_a) {
73
76
  console.log('data', data);
74
77
  dispatch(handleNextScreenStep());
75
78
  };
79
+ var handleCollapseOpenClose = function (flag) {
80
+ setCollapse(flag);
81
+ };
76
82
  var isBusinessListActive = listType === ListType.BusinessList;
77
83
  var isCountryListActive = listType === ListType.CountryCodeList;
78
84
  var listActive = isBusinessListActive || isCountryListActive;
79
- return (_jsxs(ScreenContainer, { children: [_jsx(MIDTitle, { show: !listActive, title: t('mobile_id_title'), description: t('mobile_id_description') }), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(InputsContainerStyled, __assign({ listActive: listActive }, { children: [_jsx(BusinessCountry, { show: !isCountryListActive, countries: businessCountries, onListOpen: function () { return handleMenuListClick(ListType.BusinessList); }, onListClose: function () { return handleMenuListClick(); } }), _jsx(Collapse, __assign({ in: !isNID }, { children: _jsx(MobileNumber, { show: !isBusinessListActive, countries: countriesCode, onSwitchToIdNumber: function () { return setIsNID(true); }, onListOpen: function () { return handleMenuListClick(ListType.CountryCodeList); }, onListClose: function () { return handleMenuListClick(); } }) })), _jsx(Collapse, __assign({ in: isNID }, { children: _jsx(IDNumber, { show: !listActive, onSwitchToMobileNumber: function () { return setIsNID(false); } }) }))] })), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(Button, __assign({ isAr: isAr, disabled: !methods.formState.isValid, loading: false }, { children: t('next') })) }))] })) }))] }));
85
+ return (_jsxs(ScreenContainer, { children: [_jsx(MIDTitle, { show: !listActive, title: t('join_our_community'), description: t('ide_terms_and_conditions_description') }), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(InputsContainerStyled, __assign({ listActive: listActive }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(BusinessCountry, { show: !isCountryListActive, setMobileLength: setMobileLength, countries: businessCountries, onListOpen: function () { return handleMenuListClick(ListType.BusinessList); }, onListClose: function () { return handleMenuListClick(); } }) })), _jsx(Collapse, __assign({ in: !isNID }, { children: _jsx(MobileNumber, { show: !isBusinessListActive, setMobileLength: setMobileLength, countries: countriesCode, onSwitchToIdNumber: function () { return setIsNID(true); }, onListOpen: function () { return handleMenuListClick(ListType.CountryCodeList); }, onListClose: function () { return handleMenuListClick(); } }) })), _jsxs(Collapse, __assign({ in: isNID }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(IDNumber, { show: !listActive, onSwitchToMobileNumber: function () { return setIsNID(false); } }) })), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(DOB, { onDateClicked: handleCollapseOpenClose }) }))] }))] })), _jsx(Collapse, __assign({ in: !listActive && !collapse }, { children: _jsx(Button, __assign({ isAr: isAr, disabled: !methods.formState.isValid, loading: false }, { children: t('next') })) }))] })) }))] }));
80
86
  };
81
87
  export default React.memo(MID);
@@ -3,6 +3,7 @@ import { CountryCode } from '../../../../@types';
3
3
  interface MobileNumberProps {
4
4
  countries: Array<CountryCode>;
5
5
  show: boolean;
6
+ setMobileLength?: (length: number) => void;
6
7
  onSwitchToIdNumber?: () => void;
7
8
  onListOpen?: () => void;
8
9
  onListClose?: () => void;
@@ -29,11 +29,11 @@ import { styled, alpha } from '@mui/material/styles';
29
29
  import Text from '../../../../components/Text';
30
30
  import Collapse from '../../../../components/Collapse';
31
31
  import Tooltip from '@mui/material/Tooltip';
32
- import ExpandIcon from '../../../shared/ExpandIcon';
33
32
  import ClearIcon from '../../../shared/ClearIcon';
34
33
  import CheckIcon from '../../../shared/CheckIcon';
35
34
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
36
35
  import Icon from '../../../../components/Icon';
36
+ import ExpandIcon from '../../../../components/ExpandIcon';
37
37
  import Input from '../../../shared/Input';
38
38
  import SimpleList from '../../../../components/SimpleList';
39
39
  import { ICONS_NAMES } from '../../../../constants';
@@ -58,9 +58,11 @@ var LabelContainerStyled = styled(Box)(function (_a) {
58
58
  var CountryItemContainer = styled(Box)(function () { return ({
59
59
  display: 'flex'
60
60
  }); });
61
- var CountryCodeText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
61
+ var CountryCodeText = styled(Text, {
62
+ shouldForwardProp: function (prop) { return prop !== 'isSelected'; }
63
+ })(function (_a) {
62
64
  var theme = _a.theme, isSelected = _a.isSelected;
63
- return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { width: theme.spacing(10), fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight }));
65
+ return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { width: theme.spacing(10), textAlign: 'start', fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight }));
64
66
  });
65
67
  var CountryNameText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
66
68
  var theme = _a.theme, isSelected = _a.isSelected;
@@ -74,24 +76,42 @@ var InputLabelStyled = styled(Text)(function (_a) {
74
76
  var theme = _a.theme;
75
77
  return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
76
78
  });
79
+ var ExpandIconStyled = styled(ExpandIcon)(function (_a) {
80
+ var theme = _a.theme;
81
+ return ({
82
+ marginInlineStart: theme.spacing(1)
83
+ });
84
+ });
77
85
  var MobileNumber = React.forwardRef(function (_a, ref) {
78
- var _b;
86
+ var _b, _c, _d;
79
87
  var countries = _a.countries, rest = __rest(_a, ["countries"]);
80
88
  var countriesCode = React.useState(countries)[0];
81
- var _c = React.useState(null), anchorEl = _c[0], setAnchorEl = _c[1];
89
+ var _e = React.useState(null), anchorEl = _e[0], setAnchorEl = _e[1];
82
90
  var t = useTranslation().t;
83
91
  var isAr = useLanguage().isAr;
84
- var _d = useFormContext(), control = _d.control, setValue = _d.setValue;
92
+ var _f = useFormContext(), control = _f.control, setValue = _f.setValue, getValues = _f.getValues;
85
93
  var phoneControl = useController({ name: 'mobile', control: control });
86
94
  var countryCodeControl = useController({ name: 'countryCode', control: control });
95
+ var businessCountry = getValues('businessCountry');
87
96
  React.useEffect(function () {
97
+ var _a;
88
98
  if (phoneControl.field.value) {
89
99
  setValue('mobile', phoneControl.field.value, { shouldValidate: true });
90
100
  }
91
101
  if (countryCodeControl.field.value) {
92
- setValue('countryCode', countryCodeControl.field.value, { shouldValidate: true });
102
+ var country = countryCodeControl.field.value;
103
+ setValue('countryCode', country, { shouldValidate: true });
104
+ (_a = rest.setMobileLength) === null || _a === void 0 ? void 0 : _a.call(rest, (country === null || country === void 0 ? void 0 : country.digits) || 10);
93
105
  }
94
106
  }, []);
107
+ React.useEffect(function () {
108
+ var _a;
109
+ var mobile = phoneControl.field.value;
110
+ if (mobile == null) {
111
+ setValue('countryCode', businessCountry);
112
+ (_a = rest.setMobileLength) === null || _a === void 0 ? void 0 : _a.call(rest, (businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.digits) || 10);
113
+ }
114
+ }, [businessCountry]);
95
115
  var onPhoneNumberChange = function (_a) {
96
116
  var target = _a.target;
97
117
  var value = removeAllCharsFromNumber(target.value);
@@ -111,13 +131,17 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
111
131
  (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
112
132
  };
113
133
  var onSelectItem = function (country) {
134
+ var _a;
114
135
  onCloseCountryList();
136
+ setValue('mobile', '');
137
+ (_a = rest.setMobileLength) === null || _a === void 0 ? void 0 : _a.call(rest, (country === null || country === void 0 ? void 0 : country.digits) || 10);
115
138
  countryCodeControl.field.onChange(country);
116
139
  };
117
- var mobileValue = phoneControl.field.value;
118
140
  var countryCodeValue = countryCodeControl.field.value;
119
- var error = (_b = phoneControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
120
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('mobile_number_label') }), _jsx(Collapse, __assign({ in: !anchorEl }, { children: _jsx(Tooltip, __assign({ title: t('switch_to_id') }, { children: _jsx(IconStyled, { onClick: rest.onSwitchToIdNumber, alt: 'switcher icon', src: ICONS_NAMES.ID_IMAGE }) })) }))] }), _jsx(Input, { sx: { direction: 'ltr' }, inputProps: { maxLength: (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.digits) || 10 }, onChange: onPhoneNumberChange, value: mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: onOpenCountryList }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), _jsx(ExpandIcon, { anchorEl: !!anchorEl })] })), endAdornment: !error && mobileValue ? _jsx(CheckIcon, {}) : mobileValue && _jsx(ClearIcon, { onClick: clearMobileNumber }), placeholder: "".concat((countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.iso2) === 'SA' ? '5' : '0', "00000000"), warningType: 'alert', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
141
+ var mobileValue = phoneControl.field.value || '';
142
+ var countryName = (isAr ? (_b = countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.name) === null || _b === void 0 ? void 0 : _b.arabic : (_c = countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.name) === null || _c === void 0 ? void 0 : _c.english) || '';
143
+ var error = (_d = phoneControl.fieldState.error) === null || _d === void 0 ? void 0 : _d.message;
144
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('signup_enter_mobile') }), _jsx(Collapse, __assign({ in: !anchorEl }, { children: _jsx(Tooltip, __assign({ title: t('switch_to_id') }, { children: _jsx(IconStyled, { onClick: rest.onSwitchToIdNumber, alt: 'switcher icon', src: ICONS_NAMES.ID_IMAGE }) })) }))] }), _jsx(Input, { sx: { direction: 'ltr' }, inputProps: { maxLength: (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.digits) || 10 }, onChange: onPhoneNumberChange, value: !!anchorEl ? countryName : mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: onOpenCountryList }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), !anchorEl && _jsx(ExpandIconStyled, { anchorEl: !!anchorEl })] })), endAdornment: !!anchorEl ? (_jsx(ExpandIconStyled, { anchorEl: !!anchorEl })) : !error && mobileValue ? (_jsx(CheckIcon, {})) : (mobileValue && _jsx(ClearIcon, { onClick: clearMobileNumber })), placeholder: "".concat((countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.iso2) === 'SA' ? '5' : '0', "00000000"), warningType: 'alert', warningMessage: error && t(error, { length: countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.digits }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
121
145
  return (_jsxs(_Fragment, { children: [_jsxs(CountryItemContainer, { children: [_jsxs(CountryCodeText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: ["+", item.idd_prefix] })), _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english }))] }), item.idd_prefix === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) && _jsx(CheckIcon, {})] }));
122
146
  } }) }))] })) })));
123
147
  });
@@ -9,7 +9,7 @@ export declare const NIDValidationSchema: yup.ObjectSchema<import("yup/lib/objec
9
9
  dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
10
10
  nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
11
11
  }>>>;
12
- export declare const PhoneValidationSchema: (min: number) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
12
+ export declare const PhoneValidationSchema: (length: number) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
13
13
  mobile: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
14
14
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
15
15
  mobile: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
@@ -1,10 +1,15 @@
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).max(10).required('NID is required')
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
  });
6
- export var PhoneValidationSchema = function (min) {
11
+ export var PhoneValidationSchema = function (length) {
7
12
  return yup.object().shape({
8
- mobile: yup.string().min(min).required('mobile_number_error')
13
+ mobile: yup.string().length(length, 'enter_valid_mobile_number').required('mobile_number_error')
9
14
  });
10
15
  };
@@ -23,6 +23,7 @@ import Input from '../../../shared/Input';
23
23
  import ClearIcon from '../../../shared/ClearIcon';
24
24
  import Tooltip from '../../../../components/Tooltip';
25
25
  import { removeAllOtherThanCharsNumbersAndSpace } from '../../../../utils';
26
+ import CheckIcon from '../../../shared/CheckIcon';
26
27
  var LabelContainerStyled = styled(Box)(function (_a) {
27
28
  var theme = _a.theme;
28
29
  return ({
@@ -68,6 +69,7 @@ var BrandName = function (_a) {
68
69
  brandControl.field.onChange('');
69
70
  };
70
71
  var brandNameValue = brandControl.field.value;
71
- return (_jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 3 } }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('brand_name_label') }), _jsx(Tooltip, __assign({ title: t('brand_name_description'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsx(Input, { onChange: handleBrandNameChange, value: brandNameValue, endAdornment: brandNameValue && _jsx(ClearIcon, { onClick: clearBrandName }), placeholder: t('brand_name_placeholder'), warningType: 'alert', warningMessage: (_b = brandControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message })] })));
72
+ var error = (_b = brandControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
73
+ return (_jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 3 } }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('signup_brand_name_label') }), _jsx(Tooltip, __assign({ title: t('brand_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsx(Input, { onChange: handleBrandNameChange, value: brandNameValue, placeholder: t('signup_brand_name_placeholder'), warningType: 'alert', warningMessage: error && t(error), endAdornment: !error && brandNameValue ? _jsx(CheckIcon, {}) : brandNameValue && _jsx(ClearIcon, { onClick: clearBrandName }) })] })));
72
74
  };
73
75
  export default React.memo(BrandName);
@@ -21,6 +21,7 @@ import Text from '../../../../components/Text';
21
21
  import Collapse from '../../../../components/Collapse';
22
22
  import SocialMediaGroup from '../../../../components/SocialMediaGroup';
23
23
  import { ScreenContainer } from '../../../shared/Containers';
24
+ import CheckIcon from '../../../shared/CheckIcon';
24
25
  var SocialMediaGroupStyled = styled(SocialMediaGroup)(function (_a) {
25
26
  var theme = _a.theme, defaultValue = _a.defaultValue;
26
27
  return ({
@@ -32,6 +33,7 @@ var InputStyled = styled(Input)(function (_a) {
32
33
  var theme = _a.theme;
33
34
  return ({
34
35
  padding: theme.spacing(0, 2, 0, 0),
36
+ paddingInlineEnd: theme.spacing(2),
35
37
  input: {
36
38
  paddingInlineStart: theme.spacing(0)
37
39
  }
@@ -72,8 +74,11 @@ var SocialMedia = function (_a) {
72
74
  var twitterValue = links.twitter || '';
73
75
  var instagramValue = links.instagram || '';
74
76
  var errors = linksControl.fieldState.error;
75
- return (_jsxs(ScreenContainer, __assign({ sx: { mb: 3 } }, { children: [_jsx(SocialMediaGroupStyled, { defaultValue: socialMediaType, exclusive: true, onChange: function (e, value) {
77
+ var websiteError = (_b = errors === null || errors === void 0 ? void 0 : errors.website) === null || _b === void 0 ? void 0 : _b.message;
78
+ var twitterError = (_c = errors === null || errors === void 0 ? void 0 : errors.twitter) === null || _c === void 0 ? void 0 : _c.message;
79
+ var instagramError = (_d = errors === null || errors === void 0 ? void 0 : errors.instagram) === null || _d === void 0 ? void 0 : _d.message;
80
+ return (_jsxs(ScreenContainer, __assign({ sx: { mb: 3, direction: 'ltr' } }, { children: [_jsx(SocialMediaGroupStyled, { defaultValue: socialMediaType, exclusive: true, onChange: function (e, value) {
76
81
  setSocialMediaType(value);
77
- } }), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.WEB, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: websiteValue, startAdornment: _jsx(TextStyled, { children: "https://" }), endAdornment: websiteValue && _jsx(ClearIconStyled, { onClick: handleClear }), placeholder: t('website_placeholder'), warningType: 'alert', warningMessage: (_b = errors === null || errors === void 0 ? void 0 : errors.website) === null || _b === void 0 ? void 0 : _b.message }) })), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.TWITTER, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: twitterValue, startAdornment: _jsx(TextStyled, { children: "@" }), endAdornment: twitterValue && _jsx(ClearIconStyled, { onClick: handleClear }), placeholder: t('twitter_placeholder'), warningType: 'alert', warningMessage: (_c = errors === null || errors === void 0 ? void 0 : errors.twitter) === null || _c === void 0 ? void 0 : _c.message }) })), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.INSTAGRAM, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: instagramValue, startAdornment: _jsx(TextStyled, { children: "@" }), endAdornment: instagramValue && _jsx(ClearIconStyled, { onClick: handleClear }), placeholder: t('instagram_placeholder'), warningType: 'alert', warningMessage: (_d = errors === null || errors === void 0 ? void 0 : errors.instagram) === null || _d === void 0 ? void 0 : _d.message }) }))] })));
82
+ } }), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.WEB, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: websiteValue, startAdornment: _jsx(TextStyled, { children: "https://" }), placeholder: t('signup_website_placeholder'), warningType: 'alert', warningMessage: websiteError && t(websiteError), endAdornment: !websiteError && websiteValue ? _jsx(CheckIcon, {}) : websiteValue && _jsx(ClearIconStyled, { onClick: handleClear }) }) })), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.TWITTER, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: twitterValue, startAdornment: _jsx(TextStyled, { children: "@" }), placeholder: t('signup_twitter_placeholder'), warningType: 'alert', warningMessage: twitterError && t(twitterError), endAdornment: !twitterError && twitterValue ? _jsx(CheckIcon, {}) : twitterValue && _jsx(ClearIconStyled, { onClick: handleClear }) }) })), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.INSTAGRAM, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: instagramValue, startAdornment: _jsx(TextStyled, { children: "@" }), placeholder: t('signup_instagram_placeholder'), warningType: 'alert', warningMessage: instagramError && t(instagramError), endAdornment: !instagramError && instagramValue ? (_jsx(CheckIcon, {})) : (instagramValue && _jsx(ClearIconStyled, { onClick: handleClear })) }) }))] })));
78
83
  };
79
84
  export default React.memo(SocialMedia);
@@ -74,6 +74,6 @@ var TAC = function (_a) {
74
74
  var handleTACCheckedChange = function (event, checked) {
75
75
  tacControl.field.onChange(checked);
76
76
  };
77
- return (_jsxs(ScreenContainer, __assign({ sx: { mb: 5 } }, { children: [_jsxs(TACContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr ? EXTERNAL_LINKS.TOS_AR : EXTERNAL_LINKS.TOS_EN, target: '_blank', underline: 'always' }, { children: t('terms_and_conditions_link_title') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage })) }))] })));
77
+ return (_jsxs(ScreenContainer, __assign({ sx: { mb: 5 } }, { children: [_jsxs(TACContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr ? EXTERNAL_LINKS.TOS_AR : EXTERNAL_LINKS.TOS_EN, target: '_blank', underline: 'always' }, { children: t('terms_and_conditions_link_title') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] })));
78
78
  };
79
79
  export default React.memo(TAC);
@@ -3,15 +3,15 @@ export declare const MerchantValidationSchema: yup.ObjectSchema<import("yup/lib/
3
3
  brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
4
  termAndConditionChecked: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
5
5
  links: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
6
- website: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
6
+ website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
7
7
  instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
8
8
  twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
9
9
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
10
- website: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
10
+ website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
11
11
  instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
12
12
  twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
13
13
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
14
- website: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
14
+ website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
15
15
  instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
16
16
  twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
17
17
  }>>>;
@@ -19,15 +19,15 @@ export declare const MerchantValidationSchema: yup.ObjectSchema<import("yup/lib/
19
19
  brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
20
20
  termAndConditionChecked: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
21
21
  links: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
22
- website: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
22
+ website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
23
23
  instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
24
24
  twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
25
25
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
26
- website: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
26
+ website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
27
27
  instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
28
28
  twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
29
29
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
30
- website: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
30
+ website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
31
31
  instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
32
32
  twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
33
33
  }>>>;
@@ -35,15 +35,15 @@ export declare const MerchantValidationSchema: yup.ObjectSchema<import("yup/lib/
35
35
  brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
36
36
  termAndConditionChecked: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
37
37
  links: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
38
- website: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
38
+ website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
39
39
  instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
40
40
  twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
41
41
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
42
- website: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
42
+ website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
43
43
  instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
44
44
  twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
45
45
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
46
- website: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
46
+ website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
47
47
  instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
48
48
  twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
49
49
  }>>>;