@tap-payments/os-micro-frontend-shared 0.1.300 → 0.1.301

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.
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { FullInfoProps } from '../CustomerForms/FullInfo';
3
- interface CustomerDropdownProps extends FullInfoProps {
2
+ import { CustomerFullInfoProps } from '../CustomerForms/CustomerFullInfo';
3
+ export interface CustomerDropdownProps extends CustomerFullInfoProps {
4
4
  isDisabled?: boolean;
5
5
  }
6
6
  declare function CustomerDropdown({ ...props }: Readonly<CustomerDropdownProps>): import("react/jsx-runtime").JSX.Element;
@@ -17,7 +17,7 @@ import { getRandomGradientColor } from '../../../utils/index.js';
17
17
  import { CustomBackdrop } from '../../index.js';
18
18
  import { customerIcon2 } from '../../../constants/index.js';
19
19
  import { Wrapper, AvatarStyled, Button } from './style';
20
- import FullInfo from '../CustomerForms/FullInfo';
20
+ import FullInfo from '../CustomerForms/CustomerFullInfo';
21
21
  function CustomerDropdown(_a) {
22
22
  var _b, _c;
23
23
  var props = __rest(_a, []);
@@ -1 +1 @@
1
- export { default } from './CustomerDropdown';
1
+ export { default, CustomerDropdownProps } from './CustomerDropdown';
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { Item } from '../../../types/index.js';
3
+ import { CustomerFullInfoProps } from './CustomerFullInfo';
4
+ export interface CustomerEmailFormProps extends Pick<CustomerFullInfoProps, 'onCustomerChange' | 'isCustomerNotValid' | 'customer'> {
5
+ items: Item[];
6
+ isItemsNotValid: boolean;
7
+ submitButtonText: string;
8
+ onSubmit: () => void;
9
+ }
10
+ declare function CustomerEmailForm({ submitButtonText, onSubmit, customer, isItemsNotValid, items, onCustomerChange }: Readonly<CustomerEmailFormProps>): import("react/jsx-runtime").JSX.Element;
11
+ declare const _default: import("react").MemoExoticComponent<typeof CustomerEmailForm>;
12
+ export default _default;
@@ -17,7 +17,7 @@ import { Controller, useForm } from 'react-hook-form';
17
17
  import { useTranslation } from 'react-i18next';
18
18
  import { FormWrapper, InputStyled, SubmitButton, ErrorStyled } from './style';
19
19
  import { validationEmailFromSchema } from './validation';
20
- function EmailForm({ submitButtonText, onSubmit, customer, isItemsNotValid, items, onCustomerChange }) {
20
+ function CustomerEmailForm({ submitButtonText, onSubmit, customer, isItemsNotValid, items, onCustomerChange }) {
21
21
  const firstNameRef = useRef();
22
22
  const lastNameRef = useRef();
23
23
  const emailRef = useRef();
@@ -73,4 +73,4 @@ function EmailForm({ submitButtonText, onSubmit, customer, isItemsNotValid, item
73
73
  }, error: Boolean(error === null || error === void 0 ? void 0 : error.message) })), (error === null || error === void 0 ? void 0 : error.message) && _jsx(ErrorStyled, { error: t(error.message) })] })));
74
74
  } }), _jsx(SubmitButton, Object.assign({ type: "button", "data-testid": "EmailForm_submit", onClick: onSubmit, disabled: !isValid || isItemsNotValid || !items.length }, { children: submitButtonText }))] })));
75
75
  }
76
- export default memo(EmailForm);
76
+ export default memo(CustomerEmailForm);
@@ -1,5 +1,5 @@
1
1
  import { Country, CustomerInfo, SegmentCountry } from '../../../types/index.js';
2
- export interface FullInfoProps {
2
+ export interface CustomerFullInfoProps {
3
3
  customer: CustomerInfo;
4
4
  country: Country;
5
5
  defaultCountry: SegmentCountry;
@@ -9,5 +9,5 @@ export interface FullInfoProps {
9
9
  onCustomerChange: (customer: CustomerInfo) => void;
10
10
  isCustomerNotValid?: (value: boolean, err?: string) => void;
11
11
  }
12
- declare function FullInfo({ customer, country, defaultCountry, countries, isCountriesLoading, onCustomerChange, onCountryChange, isCustomerNotValid, }: Readonly<FullInfoProps>): import("react/jsx-runtime").JSX.Element;
13
- export default FullInfo;
12
+ declare function CustomerFullInfo({ customer, country, defaultCountry, countries, isCountriesLoading, onCustomerChange, onCountryChange, isCustomerNotValid, }: Readonly<CustomerFullInfoProps>): import("react/jsx-runtime").JSX.Element;
13
+ export default CustomerFullInfo;
@@ -18,7 +18,7 @@ import { useTranslation } from 'react-i18next';
18
18
  import { MobileWrapper, FormWrapper, InputStyled, InputNumberStyled, ErrorStyled } from './style';
19
19
  import { validationFullInfoSchema } from './validation';
20
20
  import CountriesDropdown from '../../Inputs/CountriesDropDown';
21
- function FullInfo({ customer, country, defaultCountry, countries, isCountriesLoading, onCustomerChange, onCountryChange, isCustomerNotValid, }) {
21
+ function CustomerFullInfo({ customer, country, defaultCountry, countries, isCountriesLoading, onCustomerChange, onCountryChange, isCustomerNotValid, }) {
22
22
  const firstNameRef = useRef();
23
23
  const lastNameRef = useRef();
24
24
  const emailRef = useRef();
@@ -69,4 +69,4 @@ function FullInfo({ customer, country, defaultCountry, countries, isCountriesLoa
69
69
  }, hideArrows: true }))] })), (error === null || error === void 0 ? void 0 : error.message) && _jsx(ErrorStyled, { error: t(error.message, { numberLen: country.max_digits }) })] })));
70
70
  } }, "fullInfoPhoneNumber")] })));
71
71
  }
72
- export default FullInfo;
72
+ export default CustomerFullInfo;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import type { Item } from '../../../types/index.js';
3
+ import { CustomerFullInfoProps } from './CustomerFullInfo';
4
+ export interface CustomerFullInfoFormProps extends CustomerFullInfoProps {
5
+ items: Item[];
6
+ isItemsNotValid: boolean;
7
+ submitButtonText: string;
8
+ onSubmit: () => void;
9
+ }
10
+ declare function CustomerFullInfoForm({ submitButtonText, onSubmit, customer, country, items, isItemsNotValid, defaultCountry, countries, isCountriesLoading, onCustomerChange, onCountryChange, }: Readonly<CustomerFullInfoFormProps>): import("react/jsx-runtime").JSX.Element;
11
+ declare const _default: import("react").MemoExoticComponent<typeof CustomerFullInfoForm>;
12
+ export default _default;
@@ -19,7 +19,7 @@ import { InputNumberStyled, MobileWrapper } from '../../index.js';
19
19
  import { FormWrapper, SubmitButton, InputStyled, ErrorStyled } from './style';
20
20
  import { validationFullInfoSchema } from './validation';
21
21
  import CountriesDropdown from '../../Inputs/CountriesDropDown';
22
- function FullInfoForm({ submitButtonText, onSubmit, customer, country, items, isItemsNotValid, defaultCountry, countries, isCountriesLoading, onCustomerChange, onCountryChange, }) {
22
+ function CustomerFullInfoForm({ submitButtonText, onSubmit, customer, country, items, isItemsNotValid, defaultCountry, countries, isCountriesLoading, onCustomerChange, onCountryChange, }) {
23
23
  const firstNameRef = useRef();
24
24
  const lastNameRef = useRef();
25
25
  const emailRef = useRef();
@@ -71,4 +71,4 @@ function FullInfoForm({ submitButtonText, onSubmit, customer, country, items, is
71
71
  }, hideArrows: true }))] })), (error === null || error === void 0 ? void 0 : error.message) && _jsx(ErrorStyled, { error: t(error.message, { numberLen: country.max_digits }) })] })));
72
72
  } }), _jsx(SubmitButton, Object.assign({ onClick: onSubmit, disabled: !isValid || isItemsNotValid || !items.length }, { children: submitButtonText }))] })));
73
73
  }
74
- export default memo(FullInfoForm);
74
+ export default memo(CustomerFullInfoForm);
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { Item } from '../../../types/index.js';
3
+ import { CustomerFullInfoProps } from './CustomerFullInfo';
4
+ export interface CustomerPhoneNumberFormProps extends Pick<CustomerFullInfoProps, 'customer' | 'country' | 'onCountryChange' | 'onCustomerChange' | 'defaultCountry' | 'countries' | 'isCountriesLoading'> {
5
+ isItemsNotValid: boolean;
6
+ items: Item[];
7
+ submitButtonText: string;
8
+ onSubmit: () => void;
9
+ }
10
+ declare function CustomerPhoneNumberForm({ submitButtonText, onSubmit, customer, country, isItemsNotValid, items, defaultCountry, countries, isCountriesLoading, onCustomerChange, onCountryChange, }: Readonly<CustomerPhoneNumberFormProps>): import("react/jsx-runtime").JSX.Element;
11
+ declare const _default: import("react").MemoExoticComponent<typeof CustomerPhoneNumberForm>;
12
+ export default _default;
@@ -18,7 +18,7 @@ import { useTranslation } from 'react-i18next';
18
18
  import { CountriesDropdown, InputNumberStyled, MobileWrapper } from '../../index.js';
19
19
  import { FormWrapper, SubmitButton, InputStyled, ErrorStyled } from './style';
20
20
  import { validationPhoneNumberSchema } from './validation';
21
- function PhoneNumberForm({ submitButtonText, onSubmit, customer, country, isItemsNotValid, items, defaultCountry, countries, isCountriesLoading, onCustomerChange, onCountryChange, }) {
21
+ function CustomerPhoneNumberForm({ submitButtonText, onSubmit, customer, country, isItemsNotValid, items, defaultCountry, countries, isCountriesLoading, onCustomerChange, onCountryChange, }) {
22
22
  const firstNameRef = useRef();
23
23
  const lastNameRef = useRef();
24
24
  const phoneNumberRef = useRef();
@@ -68,4 +68,4 @@ function PhoneNumberForm({ submitButtonText, onSubmit, customer, country, isItem
68
68
  return (_jsxs(Box, Object.assign({ ref: lastNameRef }, { children: [_jsx(InputStyled, Object.assign({}, field, { placeholder: t('lastName'), inputProps: { autoComplete: 'off' }, error: Boolean(error === null || error === void 0 ? void 0 : error.message) })), (error === null || error === void 0 ? void 0 : error.message) && _jsx(ErrorStyled, { error: t(error.message) })] })));
69
69
  } }, "phoneNumberFormLastName"), _jsx(SubmitButton, Object.assign({ onClick: onSubmit, disabled: !isValid || isItemsNotValid || !items.length }, { children: submitButtonText }))] })));
70
70
  }
71
- export default memo(PhoneNumberForm);
71
+ export default memo(CustomerPhoneNumberForm);
@@ -1,9 +1,9 @@
1
1
  export * from './validation';
2
- export * from './EmailForm';
3
- export { default as EmailForm } from './EmailForm';
4
- export * from './FullInfo';
5
- export { default as FullInfo } from './FullInfo';
6
- export * from './FullInfoForm';
7
- export { default as FullInfoForm } from './FullInfoForm';
8
- export * from './PhoneNumberForm';
9
- export { default as PhoneNumberForm } from './PhoneNumberForm';
2
+ export * from './CustomerEmailForm';
3
+ export { default as CustomerEmailForm } from './CustomerEmailForm';
4
+ export * from './CustomerFullInfo';
5
+ export { default as CustomerFullInfo } from './CustomerFullInfo';
6
+ export * from './CustomerFullInfoForm';
7
+ export { default as CustomerFullInfoForm } from './CustomerFullInfoForm';
8
+ export * from './CustomerPhoneNumberForm';
9
+ export { default as CustomerPhoneNumberForm } from './CustomerPhoneNumberForm';
@@ -1,9 +1,9 @@
1
1
  export * from './validation';
2
- export * from './EmailForm';
3
- export { default as EmailForm } from './EmailForm';
4
- export * from './FullInfo';
5
- export { default as FullInfo } from './FullInfo';
6
- export * from './FullInfoForm';
7
- export { default as FullInfoForm } from './FullInfoForm';
8
- export * from './PhoneNumberForm';
9
- export { default as PhoneNumberForm } from './PhoneNumberForm';
2
+ export * from './CustomerEmailForm';
3
+ export { default as CustomerEmailForm } from './CustomerEmailForm';
4
+ export * from './CustomerFullInfo';
5
+ export { default as CustomerFullInfo } from './CustomerFullInfo';
6
+ export * from './CustomerFullInfoForm';
7
+ export { default as CustomerFullInfoForm } from './CustomerFullInfoForm';
8
+ export * from './CustomerPhoneNumberForm';
9
+ export { default as CustomerPhoneNumberForm } from './CustomerPhoneNumberForm';
@@ -1 +1,2 @@
1
- export { default as CustomerDropdown } from './CustomerDropdown';
1
+ export { default as CustomerDropdown, type CustomerDropdownProps } from './CustomerDropdown';
2
+ export { CustomerEmailForm, CustomerFullInfoForm, CustomerPhoneNumberForm, type CustomerFullInfoProps, type CustomerFullInfoFormProps, type CustomerPhoneNumberFormProps, type CustomerEmailFormProps, } from './CustomerForms';
@@ -1 +1,2 @@
1
1
  export { default as CustomerDropdown } from './CustomerDropdown';
2
+ export { CustomerEmailForm, CustomerFullInfoForm, CustomerPhoneNumberForm, } from './CustomerForms';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tap-payments/os-micro-frontend-shared",
3
3
  "description": "Shared components and utilities for Tap Payments micro frontends",
4
- "version": "0.1.300",
4
+ "version": "0.1.301",
5
5
  "testVersion": 0,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { Item } from '../../../types/index.js';
3
- import { FullInfoProps } from './FullInfo';
4
- export interface EmailFormProps extends Pick<FullInfoProps, 'onCustomerChange' | 'isCustomerNotValid' | 'customer'> {
5
- items: Item[];
6
- isItemsNotValid: boolean;
7
- submitButtonText: string;
8
- onSubmit: () => void;
9
- }
10
- declare function EmailForm({ submitButtonText, onSubmit, customer, isItemsNotValid, items, onCustomerChange }: Readonly<EmailFormProps>): import("react/jsx-runtime").JSX.Element;
11
- declare const _default: import("react").MemoExoticComponent<typeof EmailForm>;
12
- export default _default;
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import type { Item } from '../../../types/index.js';
3
- import { FullInfoProps } from './FullInfo';
4
- export interface FullInfoFormProps extends FullInfoProps {
5
- items: Item[];
6
- isItemsNotValid: boolean;
7
- submitButtonText: string;
8
- onSubmit: () => void;
9
- }
10
- declare function FullInfoForm({ submitButtonText, onSubmit, customer, country, items, isItemsNotValid, defaultCountry, countries, isCountriesLoading, onCustomerChange, onCountryChange, }: Readonly<FullInfoFormProps>): import("react/jsx-runtime").JSX.Element;
11
- declare const _default: import("react").MemoExoticComponent<typeof FullInfoForm>;
12
- export default _default;
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { Item } from '../../../types/index.js';
3
- import { FullInfoProps } from './FullInfo';
4
- export interface PhoneNumberFormProps extends Pick<FullInfoProps, 'customer' | 'country' | 'onCountryChange' | 'onCustomerChange' | 'defaultCountry' | 'countries' | 'isCountriesLoading'> {
5
- isItemsNotValid: boolean;
6
- items: Item[];
7
- submitButtonText: string;
8
- onSubmit: () => void;
9
- }
10
- declare function PhoneNumberForm({ submitButtonText, onSubmit, customer, country, isItemsNotValid, items, defaultCountry, countries, isCountriesLoading, onCustomerChange, onCountryChange, }: Readonly<PhoneNumberFormProps>): import("react/jsx-runtime").JSX.Element;
11
- declare const _default: import("react").MemoExoticComponent<typeof PhoneNumberForm>;
12
- export default _default;