@tap-payments/auth-jsconnect 1.0.5 → 1.0.6

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 (241) hide show
  1. package/build/@types/app.d.ts +61 -3
  2. package/build/@types/app.js +5 -0
  3. package/build/app/settings.d.ts +3 -3
  4. package/build/app/settings.js +26 -11
  5. package/build/assets/locales/ar.json +51 -3
  6. package/build/assets/locales/en.json +50 -2
  7. package/build/components/AnimationFlow/BottomSheet.js +1 -1
  8. package/build/components/AnimationFlow/Dialog.js +7 -22
  9. package/build/components/Footer/Footer.js +1 -1
  10. package/build/components/Loader/Loader.js +12 -11
  11. package/build/components/OTPField/OTPField.js +3 -23
  12. package/build/components/OTPTimer/OTPTimer.d.ts +4 -3
  13. package/build/components/OTPTimer/OTPTimer.js +19 -6
  14. package/build/components/SimpleList/SimpleList.d.ts +1 -1
  15. package/build/components/SimpleList/SimpleList.js +2 -5
  16. package/build/components/Warning/Warning.js +2 -18
  17. package/build/constants/app.d.ts +9 -0
  18. package/build/constants/app.js +112 -2
  19. package/build/constants/assets.d.ts +4 -0
  20. package/build/constants/assets.js +4 -0
  21. package/build/constants/dummy.d.ts +103 -0
  22. package/build/constants/dummy.js +219 -0
  23. package/build/constants/validation.d.ts +4 -0
  24. package/build/constants/validation.js +4 -0
  25. package/build/features/bank/Bank.d.ts +6 -0
  26. package/build/features/bank/Bank.js +48 -0
  27. package/build/features/bank/index.d.ts +1 -0
  28. package/build/features/bank/index.js +1 -0
  29. package/build/features/bank/screens/BankDetails/BankDetails.d.ts +5 -0
  30. package/build/features/bank/screens/BankDetails/BankDetails.js +57 -0
  31. package/build/features/bank/screens/BankDetails/BankName.d.ts +3 -0
  32. package/build/features/bank/screens/BankDetails/BankName.js +27 -0
  33. package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +5 -0
  34. package/build/features/bank/screens/BankDetails/Beneficiary.js +34 -0
  35. package/build/features/bank/screens/BankDetails/IBAN.d.ts +5 -0
  36. package/build/features/bank/screens/BankDetails/IBAN.js +35 -0
  37. package/build/features/bank/screens/BankDetails/index.d.ts +3 -0
  38. package/build/features/bank/screens/BankDetails/index.js +2 -0
  39. package/build/features/bank/screens/BankDetails/validation.d.ts +14 -0
  40. package/build/features/bank/screens/BankDetails/validation.js +9 -0
  41. package/build/features/business/Business.d.ts +6 -0
  42. package/build/features/business/Business.js +61 -0
  43. package/build/features/business/index.d.ts +1 -0
  44. package/build/features/business/index.js +1 -1
  45. package/build/features/business/screens/Activities/Activities.d.ts +5 -0
  46. package/build/features/business/screens/Activities/Activities.js +83 -0
  47. package/build/features/business/screens/Activities/ActivitiesList.d.ts +70 -0
  48. package/build/features/business/screens/Activities/ActivitiesList.js +136 -0
  49. package/build/features/business/screens/Activities/SalesChannels.d.ts +5 -0
  50. package/build/features/business/screens/Activities/SalesChannels.js +107 -0
  51. package/build/features/business/screens/Activities/index.d.ts +3 -0
  52. package/build/features/business/screens/Activities/index.js +2 -0
  53. package/build/features/business/screens/Activities/validation.d.ts +119 -0
  54. package/build/features/business/screens/Activities/validation.js +17 -0
  55. package/build/features/business/screens/BusinessType/BusinessType.d.ts +12 -0
  56. package/build/features/business/screens/BusinessType/BusinessType.js +85 -0
  57. package/build/features/business/screens/BusinessType/CRNumber.d.ts +6 -0
  58. package/build/features/business/screens/BusinessType/CRNumber.js +40 -0
  59. package/build/features/business/screens/BusinessType/CompanyLicense.d.ts +11 -0
  60. package/build/features/business/screens/BusinessType/CompanyLicense.js +109 -0
  61. package/build/features/business/screens/BusinessType/FLNumber.d.ts +6 -0
  62. package/build/features/business/screens/BusinessType/FLNumber.js +40 -0
  63. package/build/features/business/screens/BusinessType/FreelanceLicense.d.ts +11 -0
  64. package/build/features/business/screens/BusinessType/FreelanceLicense.js +112 -0
  65. package/build/features/business/screens/BusinessType/SelectType.d.ts +8 -0
  66. package/build/features/business/screens/BusinessType/SelectType.js +106 -0
  67. package/build/features/business/screens/BusinessType/Switch.d.ts +7 -0
  68. package/build/features/business/screens/BusinessType/Switch.js +35 -0
  69. package/build/features/business/screens/BusinessType/index.d.ts +3 -0
  70. package/build/features/business/screens/BusinessType/index.js +2 -0
  71. package/build/features/business/screens/BusinessType/validation.d.ts +15 -0
  72. package/build/features/business/screens/BusinessType/validation.js +14 -0
  73. package/build/features/business/screens/Confirm/Confirm.d.ts +5 -0
  74. package/build/features/business/screens/Confirm/Confirm.js +53 -0
  75. package/build/features/business/screens/Confirm/index.d.ts +3 -0
  76. package/build/features/business/screens/Confirm/index.js +2 -0
  77. package/build/features/business/screens/Customers/CustomerLocations.d.ts +92 -0
  78. package/build/features/business/screens/Customers/CustomerLocations.js +122 -0
  79. package/build/features/business/screens/Customers/Customers.d.ts +5 -0
  80. package/build/features/business/screens/Customers/Customers.js +92 -0
  81. package/build/features/business/screens/Customers/ExpectedCustomers.d.ts +7 -0
  82. package/build/features/business/screens/Customers/ExpectedCustomers.js +78 -0
  83. package/build/features/business/screens/Customers/ExpectedSalesRange.d.ts +7 -0
  84. package/build/features/business/screens/Customers/ExpectedSalesRange.js +74 -0
  85. package/build/features/business/screens/Customers/RefundPolicy.d.ts +44 -0
  86. package/build/features/business/screens/Customers/RefundPolicy.js +86 -0
  87. package/build/features/business/screens/Customers/TransactionPolicy.d.ts +3 -0
  88. package/build/features/business/screens/Customers/TransactionPolicy.js +37 -0
  89. package/build/features/business/screens/Customers/index.d.ts +3 -0
  90. package/build/features/business/screens/Customers/index.js +2 -0
  91. package/build/features/business/screens/Customers/validation.d.ts +20 -0
  92. package/build/features/business/screens/Customers/validation.js +8 -0
  93. package/build/features/business/screens/IDBOD/DOB.js +8 -8
  94. package/build/features/business/screens/IDBOD/ID.js +8 -7
  95. package/build/features/business/screens/IDBOD/IDBOD.js +5 -6
  96. package/build/features/business/screens/OTP/OTP.d.ts +11 -0
  97. package/build/features/business/screens/OTP/OTP.js +112 -0
  98. package/build/features/business/screens/OTP/OTPInput.d.ts +5 -0
  99. package/build/features/business/screens/OTP/OTPInput.js +51 -0
  100. package/build/features/{connect → business}/screens/OTP/OTPTimer.d.ts +0 -0
  101. package/build/features/business/screens/OTP/OTPTimer.js +20 -0
  102. package/build/features/business/screens/OTP/index.d.ts +3 -0
  103. package/build/features/business/screens/OTP/index.js +2 -0
  104. package/build/features/business/screens/OTP/validation.d.ts +8 -0
  105. package/build/features/business/screens/OTP/validation.js +4 -0
  106. package/build/features/business/screens/Success/Success.d.ts +5 -0
  107. package/build/features/business/screens/Success/Success.js +15 -0
  108. package/build/features/business/screens/Success/index.d.ts +3 -0
  109. package/build/features/business/screens/Success/index.js +2 -0
  110. package/build/features/business/screens/VerifyNumber/OTPInput.d.ts +6 -0
  111. package/build/features/business/screens/VerifyNumber/OTPInput.js +68 -0
  112. package/build/features/business/screens/VerifyNumber/OTPTimer.d.ts +5 -0
  113. package/build/features/business/screens/VerifyNumber/OTPTimer.js +20 -0
  114. package/build/features/business/screens/VerifyNumber/VerifyNumber.d.ts +13 -0
  115. package/build/features/business/screens/VerifyNumber/VerifyNumber.js +119 -0
  116. package/build/features/business/screens/VerifyNumber/index.d.ts +3 -0
  117. package/build/features/business/screens/VerifyNumber/index.js +2 -0
  118. package/build/features/business/screens/VerifyNumber/validation.d.ts +8 -0
  119. package/build/features/business/screens/VerifyNumber/validation.js +4 -0
  120. package/build/features/connect/Connect.js +6 -18
  121. package/build/features/connect/screens/Individual/Email.d.ts +1 -1
  122. package/build/features/connect/screens/Individual/Email.js +6 -31
  123. package/build/features/connect/screens/Individual/Individual.js +7 -16
  124. package/build/features/connect/screens/Individual/Name.d.ts +1 -1
  125. package/build/features/connect/screens/Individual/Name.js +7 -34
  126. package/build/features/connect/screens/MID/BusinessCountry.js +5 -40
  127. package/build/features/connect/screens/MID/IDNumber.js +13 -28
  128. package/build/features/connect/screens/MID/MID.js +6 -43
  129. package/build/features/connect/screens/MID/MobileNumber.js +22 -41
  130. package/build/features/connect/screens/Merchant/BrandName.js +5 -31
  131. package/build/features/connect/screens/Merchant/Merchant.js +6 -50
  132. package/build/features/connect/screens/Merchant/SocialMedia.js +3 -11
  133. package/build/features/connect/screens/Merchant/TAC.js +4 -13
  134. package/build/features/connect/screens/OTP/OTP.js +17 -61
  135. package/build/features/connect/screens/OTP/OTPInput.js +8 -21
  136. package/build/features/connect/screens/Password/Password.js +12 -49
  137. package/build/features/connect/screens/Password/PasswordInput.js +16 -51
  138. package/build/features/connect/screens/ThankYou/ThankYou.js +4 -65
  139. package/build/features/featuresScreens.d.ts +5 -0
  140. package/build/features/featuresScreens.js +78 -7
  141. package/build/features/owner/Owner.d.ts +6 -0
  142. package/build/features/owner/Owner.js +50 -0
  143. package/build/features/owner/index.d.ts +1 -0
  144. package/build/features/owner/index.js +1 -0
  145. package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.d.ts +19 -0
  146. package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.js +52 -0
  147. package/build/features/owner/screens/ShowOwnerInfo/index.d.ts +3 -0
  148. package/build/features/owner/screens/ShowOwnerInfo/index.js +2 -0
  149. package/build/features/owner/screens/ShowOwnerInfo/info.d.ts +7 -0
  150. package/build/features/owner/screens/ShowOwnerInfo/info.js +28 -0
  151. package/build/features/password/Password.d.ts +6 -0
  152. package/build/features/password/Password.js +50 -0
  153. package/build/features/password/index.d.ts +1 -0
  154. package/build/features/password/index.js +1 -0
  155. package/build/features/password/screens/CreatePassword/ConditionText.d.ts +7 -0
  156. package/build/features/password/screens/CreatePassword/ConditionText.js +23 -0
  157. package/build/features/password/screens/CreatePassword/ConfirmPassword.d.ts +5 -0
  158. package/build/features/password/screens/CreatePassword/ConfirmPassword.js +27 -0
  159. package/build/features/password/screens/CreatePassword/CreatePassword.d.ts +5 -0
  160. package/build/features/password/screens/CreatePassword/CreatePassword.js +51 -0
  161. package/build/features/password/screens/CreatePassword/Password.d.ts +5 -0
  162. package/build/features/password/screens/CreatePassword/Password.js +75 -0
  163. package/build/features/password/screens/CreatePassword/PasswordBar.d.ts +7 -0
  164. package/build/features/password/screens/CreatePassword/PasswordBar.js +29 -0
  165. package/build/features/password/screens/CreatePassword/index.d.ts +3 -0
  166. package/build/features/password/screens/CreatePassword/index.js +2 -0
  167. package/build/features/password/screens/CreatePassword/validation.d.ts +11 -0
  168. package/build/features/password/screens/CreatePassword/validation.js +8 -0
  169. package/build/features/shared/Button/Button.d.ts +8 -0
  170. package/build/features/shared/Button/Button.js +49 -0
  171. package/build/features/shared/Button/index.d.ts +2 -0
  172. package/build/features/shared/Button/index.js +2 -0
  173. package/build/features/shared/CheckIcon/CheckIcon.d.ts +2 -0
  174. package/build/features/shared/CheckIcon/CheckIcon.js +14 -0
  175. package/build/features/shared/CheckIcon/index.d.ts +2 -0
  176. package/build/features/shared/CheckIcon/index.js +2 -0
  177. package/build/features/shared/ClearIcon/ClearIcon.d.ts +6 -0
  178. package/build/features/shared/ClearIcon/ClearIcon.js +26 -0
  179. package/build/features/shared/ClearIcon/index.d.ts +2 -0
  180. package/build/features/shared/ClearIcon/index.js +2 -0
  181. package/build/features/shared/Containers/FeatureContainer.d.ts +4 -0
  182. package/build/features/shared/Containers/FeatureContainer.js +33 -0
  183. package/build/features/shared/Containers/ScreenContainer.d.ts +4 -0
  184. package/build/features/shared/Containers/ScreenContainer.js +28 -0
  185. package/build/features/shared/Containers/index.d.ts +3 -0
  186. package/build/features/shared/Containers/index.js +3 -0
  187. package/build/features/shared/ExpandIcon/ExpandIcon.d.ts +7 -0
  188. package/build/features/shared/ExpandIcon/ExpandIcon.js +24 -0
  189. package/build/features/shared/ExpandIcon/index.d.ts +2 -0
  190. package/build/features/shared/ExpandIcon/index.js +2 -0
  191. package/build/features/shared/Footer/Footer.d.ts +2 -0
  192. package/build/features/shared/Footer/Footer.js +16 -0
  193. package/build/features/shared/Footer/index.d.ts +2 -0
  194. package/build/features/shared/Footer/index.js +2 -0
  195. package/build/features/shared/Input/Input.d.ts +27 -0
  196. package/build/features/shared/Input/Input.js +59 -0
  197. package/build/features/shared/Input/index.d.ts +2 -0
  198. package/build/features/shared/Input/index.js +2 -0
  199. package/build/features/shared/OTP/OTP.d.ts +9 -0
  200. package/build/features/shared/OTP/OTP.js +85 -0
  201. package/build/features/shared/OTP/index.d.ts +2 -0
  202. package/build/features/shared/OTP/index.js +2 -0
  203. package/build/features/shared/PasswordIcon/PasswordIcon.d.ts +8 -0
  204. package/build/features/shared/PasswordIcon/PasswordIcon.js +37 -0
  205. package/build/features/shared/PasswordIcon/index.d.ts +2 -0
  206. package/build/features/shared/PasswordIcon/index.js +2 -0
  207. package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +7 -0
  208. package/build/features/shared/SuccessScreen/SuccessScreen.js +54 -0
  209. package/build/features/shared/SuccessScreen/index.d.ts +2 -0
  210. package/build/features/shared/SuccessScreen/index.js +2 -0
  211. package/build/features/tax/Tax.d.ts +6 -0
  212. package/build/features/tax/Tax.js +50 -0
  213. package/build/features/tax/index.d.ts +1 -0
  214. package/build/features/tax/index.js +1 -0
  215. package/build/features/tax/screens/TaxDetails/TaxDetails.d.ts +5 -0
  216. package/build/features/tax/screens/TaxDetails/TaxDetails.js +45 -0
  217. package/build/features/tax/screens/TaxDetails/VATId.d.ts +3 -0
  218. package/build/features/tax/screens/TaxDetails/VATId.js +27 -0
  219. package/build/features/tax/screens/TaxDetails/index.d.ts +3 -0
  220. package/build/features/tax/screens/TaxDetails/index.js +2 -0
  221. package/build/features/tax/screens/TaxDetails/validation.d.ts +8 -0
  222. package/build/features/tax/screens/TaxDetails/validation.js +4 -0
  223. package/build/hooks/index.d.ts +1 -0
  224. package/build/hooks/index.js +1 -0
  225. package/build/hooks/useContainerDimensions.d.ts +4 -0
  226. package/build/hooks/useContainerDimensions.js +21 -0
  227. package/build/index.css +1 -1
  228. package/build/index.d.ts +7 -2
  229. package/build/index.js +17 -2
  230. package/build/theme/palette.js +10 -4
  231. package/build/theme/typography.js +2 -2
  232. package/build/utils/array.d.ts +3 -1
  233. package/build/utils/array.js +7 -3
  234. package/build/utils/string.d.ts +2 -0
  235. package/build/utils/string.js +11 -0
  236. package/build/utils/validation.d.ts +6 -0
  237. package/build/utils/validation.js +19 -1
  238. package/package.json +1 -1
  239. package/build/features/connect/Footer.d.ts +0 -4
  240. package/build/features/connect/Footer.js +0 -16
  241. package/build/features/connect/screens/OTP/OTPTimer.js +0 -35
@@ -0,0 +1,54 @@
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 { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
13
+ import Box from '@mui/material/Box/Box';
14
+ import { styled } from '@mui/material/styles';
15
+ import * as React from 'react';
16
+ import Text from '../../../components/Text';
17
+ import Button from '../../../components/Button';
18
+ import Container from '../Containers/ScreenContainer';
19
+ import { ICONS_NAMES } from '../../../constants';
20
+ var ButtonStyled = styled(Button)(function (_a) {
21
+ var theme = _a.theme;
22
+ return ({
23
+ width: theme.spacing(5),
24
+ height: theme.spacing(5),
25
+ minHeight: theme.spacing(5),
26
+ minWidth: theme.spacing(5),
27
+ background: theme.palette.primary.main,
28
+ margin: theme.spacing(2.5),
29
+ borderRadius: theme.spacing(5)
30
+ });
31
+ });
32
+ var TextContainerStyled = styled(Box)(function (_a) {
33
+ var _b;
34
+ var theme = _a.theme;
35
+ return (_b = {
36
+ background: theme.palette.common.white,
37
+ border: '1px solid',
38
+ borderColor: theme.palette.divider,
39
+ borderRadius: theme.spacing(0, 0, 1.25, 1.25)
40
+ },
41
+ _b[theme.breakpoints.up('sm')] = {
42
+ marginBottom: theme.spacing(6)
43
+ },
44
+ _b);
45
+ });
46
+ var TitleStyled = styled(Text)(function (_a) {
47
+ var theme = _a.theme;
48
+ return (__assign({ fontWeight: theme.typography.fontWeightRegular, color: theme.palette.text.primary, marginBlock: theme.spacing(1.75), lineHeight: 1.75, padding: '0px 20px' }, theme.typography.subtitle2));
49
+ });
50
+ var ThankYou = function (_a) {
51
+ var onSuccess = _a.onSuccess, title = _a.title;
52
+ return (_jsxs(Container, __assign({ sx: { alignItems: 'center' } }, { children: [title && (_jsx(TextContainerStyled, { children: _jsxs(TitleStyled, { children: [title, " "] }) })), _jsx(ButtonStyled, __assign({ onClick: onSuccess }, { children: _jsx("img", { src: ICONS_NAMES.SUCCESS, alt: 'success Icon' }) }))] })));
53
+ };
54
+ export default React.memo(ThankYou);
@@ -0,0 +1,2 @@
1
+ import SuccessScreen from './SuccessScreen';
2
+ export default SuccessScreen;
@@ -0,0 +1,2 @@
1
+ import SuccessScreen from './SuccessScreen';
2
+ export default SuccessScreen;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export interface TaxLibProps {
3
+ }
4
+ export declare function TaxLib(props: TaxLibProps): JSX.Element;
5
+ export declare function renderTaxLib(config: TaxLibProps, elementId: string): void;
6
+ export declare function unmountTaxLib(elementId: string): void;
@@ -0,0 +1,50 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import React, { memo, useEffect } from 'react';
14
+ import { useTranslation } from 'react-i18next';
15
+ import { useAppTheme, useAppDispatch, useAppSelector } from '../../hooks';
16
+ import { handleActiveFlowScreens, settingsSelector } from '../../app/settings';
17
+ import AnimationFlow from '../../components/AnimationFlow';
18
+ import { store } from '../../app/store';
19
+ import { ReduxProvider, ThemeProvider } from '../../components/Providers';
20
+ import Collapse from '../../components/Collapse';
21
+ import { reactElement } from '../../utils';
22
+ import { TAX_SCREENS_NAVIGATION } from '../../constants';
23
+ import { taxFeatureScreens } from '../featuresScreens';
24
+ import CustomFooter from '../shared/Footer';
25
+ import { FeatureContainer } from '../shared/Containers';
26
+ var Tax = memo(function (props) {
27
+ var open = React.useState(true)[0];
28
+ var t = useTranslation().t;
29
+ var theme = useAppTheme().theme;
30
+ var dispatch = useAppDispatch();
31
+ var data = useAppSelector(settingsSelector).data;
32
+ var activeScreen = data.activeScreen;
33
+ useEffect(function () {
34
+ dispatch(handleActiveFlowScreens(TAX_SCREENS_NAVIGATION));
35
+ }, []);
36
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(AnimationFlow, __assign({ open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: taxFeatureScreens.map(function (_a, index) {
37
+ var Element = _a.element, name = _a.name;
38
+ var isActive = activeScreen.name === name;
39
+ return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 300, appear: 300, exit: 400 } }, { children: _jsx(Element, {}) }), index));
40
+ }) }) })) })));
41
+ });
42
+ export function TaxLib(props) {
43
+ return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(Tax, __assign({}, props)) })));
44
+ }
45
+ export function renderTaxLib(config, elementId) {
46
+ reactElement(elementId).render(_jsx(TaxLib, __assign({}, config)));
47
+ }
48
+ export function unmountTaxLib(elementId) {
49
+ reactElement(elementId).unmount();
50
+ }
@@ -0,0 +1 @@
1
+ export * from './Tax';
@@ -0,0 +1 @@
1
+ export * from './Tax';
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export interface TaxDetailsProps {
3
+ }
4
+ declare const TaxDetails: () => JSX.Element;
5
+ export default TaxDetails;
@@ -0,0 +1,45 @@
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 Button from '../../../shared/Button';
15
+ import { useAppDispatch, useLanguage } from '../../../../hooks';
16
+ import { useTranslation } from 'react-i18next';
17
+ import { styled } from '@mui/material/styles';
18
+ import { useForm, FormProvider } from 'react-hook-form';
19
+ import Form from '../../../../components/Form';
20
+ import { handleNextScreenStep } from '../../../../app/settings';
21
+ import { Validation } from './validation';
22
+ import { yupResolver } from '@hookform/resolvers/yup';
23
+ import VATId from './VATId';
24
+ var FormStyled = styled(Form)(function () { return ({
25
+ display: 'flex',
26
+ flexDirection: 'column'
27
+ }); });
28
+ var TaxDetails = function () {
29
+ var dispatch = useAppDispatch();
30
+ var methods = useForm({
31
+ resolver: yupResolver(Validation),
32
+ defaultValues: {
33
+ vatId: ''
34
+ },
35
+ mode: 'onChange'
36
+ });
37
+ var t = useTranslation().t;
38
+ var isAr = useLanguage().isAr;
39
+ var onSubmit = function (data) {
40
+ console.log('data', data);
41
+ dispatch(handleNextScreenStep());
42
+ };
43
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(VATId, {}), _jsx(Button, __assign({ isAr: isAr, disabled: !methods.formState.isValid }, { children: t('next') }))] })) })) }));
44
+ };
45
+ export default TaxDetails;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const VATId: () => JSX.Element;
3
+ export default VATId;
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { FeatureContainer } from '../../../shared/Containers';
3
+ import Input from '../../../shared/Input';
4
+ import { useTranslation } from 'react-i18next';
5
+ import { useController, useFormContext } from 'react-hook-form';
6
+ import { VAT_ID_LENGTH } from '../../../../constants';
7
+ import ClearIcon from '../../../shared/ClearIcon';
8
+ import CheckIcon from '../../../shared/CheckIcon';
9
+ import { removeAllOtherThanCharsAndNumber } from '../../../../utils';
10
+ var VATId = function () {
11
+ var _a;
12
+ var t = useTranslation().t;
13
+ var control = useFormContext().control;
14
+ var vatControl = useController({ name: 'vatId', control: control });
15
+ var handleOnChange = function (vat) {
16
+ var value = removeAllOtherThanCharsAndNumber(vat);
17
+ vatControl.field.onChange(value);
18
+ };
19
+ var vatValue = vatControl.field.value;
20
+ var vatError = (_a = vatControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
21
+ var hasError = !!vatError;
22
+ var clearValue = function () {
23
+ vatControl.field.onChange('');
24
+ };
25
+ return (_jsx(FeatureContainer, { children: _jsx(Input, { label: t('vat_id_label'), inputProps: { maxLength: VAT_ID_LENGTH }, value: vatValue, onChange: function (event) { return handleOnChange(event.target.value); }, placeholder: '00000000000', warningType: 'alert', warningMessage: vatError, required: true, endAdornment: !hasError && vatValue ? _jsx(CheckIcon, {}) : vatValue && _jsx(ClearIcon, { onClick: clearValue }) }) }));
26
+ };
27
+ export default VATId;
@@ -0,0 +1,3 @@
1
+ import TaxDetails, { TaxDetailsProps } from './TaxDetails';
2
+ export type { TaxDetailsProps };
3
+ export default TaxDetails;
@@ -0,0 +1,2 @@
1
+ import TaxDetails from './TaxDetails';
2
+ export default TaxDetails;
@@ -0,0 +1,8 @@
1
+ import * as yup from 'yup';
2
+ export declare const Validation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
+ vatId: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
5
+ vatId: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
6
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
7
+ vatId: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
+ }>>>;
@@ -0,0 +1,4 @@
1
+ import * as yup from 'yup';
2
+ export var Validation = yup.object().shape({
3
+ vatId: yup.string().min(9).max(15).required('VAT ID is required')
4
+ });
@@ -5,3 +5,4 @@ export * from './useAppSelector';
5
5
  export * from './useAppDispatch';
6
6
  export * from './useEventListener';
7
7
  export * from './useLanguage';
8
+ export * from './useContainerDimensions';
@@ -5,3 +5,4 @@ export * from './useAppSelector';
5
5
  export * from './useAppDispatch';
6
6
  export * from './useEventListener';
7
7
  export * from './useLanguage';
8
+ export * from './useContainerDimensions';
@@ -0,0 +1,4 @@
1
+ export declare const useContainerDimensions: (ref: any) => {
2
+ width: number;
3
+ height: number;
4
+ };
@@ -0,0 +1,21 @@
1
+ import { useEffect, useState } from 'react';
2
+ export var useContainerDimensions = function (ref) {
3
+ var getDimensions = function () { return ({
4
+ width: ref.current.offsetWidth,
5
+ height: ref.current.offsetHeight
6
+ }); };
7
+ var _a = useState({ width: 0, height: 0 }), dimensions = _a[0], setDimensions = _a[1];
8
+ useEffect(function () {
9
+ var handleResize = function () {
10
+ setDimensions(getDimensions());
11
+ };
12
+ if (ref.current) {
13
+ setDimensions(getDimensions());
14
+ }
15
+ window.addEventListener('resize', handleResize);
16
+ return function () {
17
+ window.removeEventListener('resize', handleResize);
18
+ };
19
+ }, [ref]);
20
+ return dimensions;
21
+ };
package/build/index.css CHANGED
@@ -1,6 +1,6 @@
1
+ @import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');
1
2
  @import url('https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap');
2
3
  @import url('https://fonts.googleapis.com/icon?family=Material+Icons');
3
- @import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');
4
4
 
5
5
  body {
6
6
  margin: 0;
package/build/index.d.ts CHANGED
@@ -1,5 +1,10 @@
1
1
  import './index.css';
2
2
  import './i18n';
3
3
  import { ConnectLib, renderConnectLib, ConnectLibProps, unmountConnectLib } from './features/connect';
4
- export type { ConnectLibProps };
5
- export { ConnectLib, renderConnectLib, unmountConnectLib };
4
+ import { BusinessLib, renderBusinessLib, BusinessLibProps, unmountBusinessLib } from './features/business';
5
+ import { PasswordLib, renderPasswordLib, PasswordLibProps, unmountPasswordLib } from './features/password';
6
+ import { OwnerLib, renderOwnerLib, OwnerLibProps, unmountOwnerLib } from './features/owner';
7
+ import { BankLib, renderBankLib, BankLibProps, unmountBankLib } from './features/bank';
8
+ import { TaxLib, renderTaxLib, TaxLibProps, unmountTaxLib } from './features/tax';
9
+ export type { ConnectLibProps, BusinessLibProps, PasswordLibProps, OwnerLibProps, BankLibProps, TaxLibProps };
10
+ export { ConnectLib, renderConnectLib, unmountConnectLib, BusinessLib, renderBusinessLib, unmountBusinessLib, PasswordLib, renderPasswordLib, unmountPasswordLib, OwnerLib, renderOwnerLib, unmountOwnerLib, BankLib, renderBankLib, unmountBankLib, TaxLib, renderTaxLib, unmountTaxLib };
package/build/index.js CHANGED
@@ -1,8 +1,23 @@
1
1
  import './index.css';
2
2
  import './i18n';
3
3
  import { ConnectLib, renderConnectLib, unmountConnectLib } from './features/connect';
4
- export { ConnectLib, renderConnectLib, unmountConnectLib };
4
+ import { BusinessLib, renderBusinessLib, unmountBusinessLib } from './features/business';
5
+ import { PasswordLib, renderPasswordLib, unmountPasswordLib } from './features/password';
6
+ import { OwnerLib, renderOwnerLib, unmountOwnerLib } from './features/owner';
7
+ import { BankLib, renderBankLib, unmountBankLib } from './features/bank';
8
+ import { TaxLib, renderTaxLib, unmountTaxLib } from './features/tax';
9
+ export { ConnectLib, renderConnectLib, unmountConnectLib, BusinessLib, renderBusinessLib, unmountBusinessLib, PasswordLib, renderPasswordLib, unmountPasswordLib, OwnerLib, renderOwnerLib, unmountOwnerLib, BankLib, renderBankLib, unmountBankLib, TaxLib, renderTaxLib, unmountTaxLib };
5
10
  window['TapAuth'] = {
6
11
  renderConnectLib: renderConnectLib,
7
- unmountConnectLib: unmountConnectLib
12
+ unmountConnectLib: unmountConnectLib,
13
+ renderBusinessLib: renderBusinessLib,
14
+ unmountBusinessLib: unmountBusinessLib,
15
+ renderPasswordLib: renderPasswordLib,
16
+ unmountPasswordLib: unmountPasswordLib,
17
+ renderOwnerLib: renderOwnerLib,
18
+ unmountOwnerLib: unmountOwnerLib,
19
+ renderBankLib: renderBankLib,
20
+ unmountBankLib: unmountBankLib,
21
+ renderTaxLib: renderTaxLib,
22
+ unmountTaxLib: unmountTaxLib
8
23
  };
@@ -2,10 +2,13 @@ export var lightPalette = {
2
2
  mode: 'light',
3
3
  divider: '#e3e8ee',
4
4
  primary: {
5
- main: '#007aff'
5
+ main: '#007aff',
6
+ dark: '#9CA0A94D'
6
7
  },
7
8
  success: {
8
- main: '#1ECB40'
9
+ light: '#2CCE01',
10
+ main: '#1ECB40',
11
+ dark: '#3A4155'
9
12
  },
10
13
  common: {
11
14
  black: '#000',
@@ -16,7 +19,9 @@ export var lightPalette = {
16
19
  default: '#ffffff'
17
20
  },
18
21
  text: {
19
- primary: '#3A4154'
22
+ primary: '#3f424d',
23
+ secondary: '#ABAEB6',
24
+ disabled: '#3A4154B3'
20
25
  },
21
26
  action: {
22
27
  selected: 'rgba(0, 0, 0, 0.08)',
@@ -24,7 +29,8 @@ export var lightPalette = {
24
29
  },
25
30
  secondary: {
26
31
  light: '#FAFBFC',
27
- main: '#CECECE'
32
+ main: '#c2c6cc',
33
+ dark: '#ABAEB6'
28
34
  },
29
35
  error: {
30
36
  main: '#EB3746',
@@ -1,13 +1,13 @@
1
1
  export var typography = {
2
2
  htmlFontSize: 16,
3
- fontFamily: '"Lato", "Roboto"',
3
+ fontFamily: '"Lato", "Roboto", "Tajawal"',
4
4
  fontSize: 14,
5
5
  fontWeightLight: 300,
6
6
  fontWeightRegular: 400,
7
7
  fontWeightMedium: 500,
8
8
  fontWeightBold: 700,
9
9
  allVariants: {
10
- fontFamily: '"Lato", "Roboto"',
10
+ fontFamily: '"Lato", "Roboto", "Tajawal"',
11
11
  fontSize: '0.875rem',
12
12
  lineHeight: 'normal',
13
13
  fontStyle: 'normal',
@@ -1,6 +1,8 @@
1
- export declare const isArray: (items?: Array<any>) => boolean;
1
+ export declare const isArray: (value: any) => value is any[];
2
2
  export declare const joinArray: (items: Array<any>, joiner?: string) => string;
3
3
  export declare const replaceStringArrayItems: (items: Array<string>, include: string, withThis: string) => string[];
4
4
  export declare const uniqueArray: (items: Array<string>) => string[];
5
5
  export declare const removeArrayItem: (items: Array<string>, item: string) => string[];
6
6
  export declare const splitString: (string: string, splitter?: string) => string[];
7
+ export declare const isInclude: (items: Array<string | number>, item: any) => boolean;
8
+ export declare const findItem: (items: Array<string | number>, key: any) => string | number | undefined;
@@ -1,6 +1,4 @@
1
- export var isArray = function (items) {
2
- return Array.isArray(items);
3
- };
1
+ export var isArray = function (value) { return Array.isArray(value); };
4
2
  export var joinArray = function (items, joiner) {
5
3
  if (joiner === void 0) { joiner = '__'; }
6
4
  if (!items)
@@ -32,3 +30,9 @@ export var splitString = function (string, splitter) {
32
30
  return [];
33
31
  return string.split(splitter);
34
32
  };
33
+ export var isInclude = function (items, item) {
34
+ return items.includes(item);
35
+ };
36
+ export var findItem = function (items, key) {
37
+ return items.find(function (item) { return item === key; });
38
+ };
@@ -1 +1,3 @@
1
1
  export declare const string = "";
2
+ export declare const maskPhone: (str?: string) => string;
3
+ export declare const maskID: (str: string) => string;
@@ -1 +1,12 @@
1
1
  export var string = '';
2
+ export var maskPhone = function (str) {
3
+ if (str === void 0) { str = ''; }
4
+ var first = str.substring(0, 5);
5
+ var lastTwo = str.substring(11, str.length);
6
+ return first + '••••' + lastTwo;
7
+ };
8
+ export var maskID = function (str) {
9
+ var first = str.substring(0, 1);
10
+ var lastTwo = str.substring(str.length - 2, str.length);
11
+ return first + '••••••' + lastTwo;
12
+ };
@@ -3,3 +3,9 @@ export declare const removeAllCharsFromNumber: (str: string) => string;
3
3
  export declare const removeAllOtherThanAlphabet: (str: string) => string;
4
4
  export declare const removeAllNumberFromChars: (str: string) => string;
5
5
  export declare const keepEmailCharacters: (str: string) => string;
6
+ export declare const removeAllOtherThanCharsAndNumber: (str: string) => string;
7
+ export declare function PasswordMatchLength(password: string): boolean;
8
+ export declare function isPasswordHasUpperLetter(password: string): boolean;
9
+ export declare function isPasswordHasLowerLetter(password: string): boolean;
10
+ export declare function isPasswordHasSpecialLetter(password: string): boolean;
11
+ export declare const keepLettersAndSpace: (str: string) => string;
@@ -8,8 +8,26 @@ export var removeAllOtherThanAlphabet = function (str) {
8
8
  return str.replace(/[^[A-Za-z]/g, '');
9
9
  };
10
10
  export var removeAllNumberFromChars = function (str) {
11
- return str.replace(/[^a-zA-Z ]/g, '');
11
+ return str.replace(/[^a-zA-Z]/g, '');
12
12
  };
13
13
  export var keepEmailCharacters = function (str) {
14
14
  return str.replace(/[^a-zA-Z@.]/g, '');
15
15
  };
16
+ export var removeAllOtherThanCharsAndNumber = function (str) {
17
+ return str.replace(/[^A-Za-z0-9]/g, '');
18
+ };
19
+ export function PasswordMatchLength(password) {
20
+ return password.length > 7;
21
+ }
22
+ export function isPasswordHasUpperLetter(password) {
23
+ return /[A-Z]/.test(password);
24
+ }
25
+ export function isPasswordHasLowerLetter(password) {
26
+ return /[a-z]/.test(password);
27
+ }
28
+ export function isPasswordHasSpecialLetter(password) {
29
+ return /[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(password);
30
+ }
31
+ export var keepLettersAndSpace = function (str) {
32
+ return str.replace(/[^a-zA-Z] /g, '');
33
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- export interface FooterProps {
3
- }
4
- export default function Footer(): JSX.Element;
@@ -1,16 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { styled } from '@mui/material/styles';
3
- import { useTranslation } from 'react-i18next';
4
- import FooterComponent from '../../components/Footer';
5
- var FooterStyled = styled(FooterComponent)(function (_a) {
6
- var theme = _a.theme;
7
- return ({
8
- position: 'relative',
9
- bottom: 0,
10
- marginBottom: theme.spacing(-3.75)
11
- });
12
- });
13
- export default function Footer() {
14
- var t = useTranslation().t;
15
- return _jsx(FooterStyled, { onSwitchLanguage: function () { }, followUsTitle: t('follow_us'), language: t('language') });
16
- }
@@ -1,35 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import * as React from 'react';
3
- import Box from '@mui/material/Box/Box';
4
- import { styled } from '@mui/material/styles';
5
- import { useTranslation } from 'react-i18next';
6
- import OTPTimer from '../../../../components/OTPTimer';
7
- import { DEFAULT_TIMER_VALUE } from '../../../../constants';
8
- var BoxStyled = styled(Box)(function (_a) {
9
- var theme = _a.theme;
10
- return ({
11
- display: 'flex',
12
- flexDirection: 'column',
13
- padding: theme.spacing(2.5, 0, 6.5, 0)
14
- });
15
- });
16
- var Timer = function (_a) {
17
- var _b = React.useState(DEFAULT_TIMER_VALUE), timeValue = _b[0], seTimeValue = _b[1];
18
- var t = useTranslation().t;
19
- React.useEffect(function () {
20
- if (timeValue <= 0)
21
- return;
22
- var interval = setInterval(function () {
23
- seTimeValue(timeValue - 1);
24
- }, 1000);
25
- return function () { return clearInterval(interval); };
26
- }, [timeValue]);
27
- var resetTimer = function () {
28
- seTimeValue(DEFAULT_TIMER_VALUE);
29
- };
30
- return (_jsx(BoxStyled, { children: _jsx(OTPTimer, { time: timeValue, onClick: function () {
31
- if (timeValue <= 0)
32
- resetTimer();
33
- }, resendText: t('resend_otp') }) }));
34
- };
35
- export default React.memo(Timer);