@mvf/external-components 3.16.0 → 3.16.2-dev.0

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 (51) hide show
  1. package/Components/Atoms/AnimationWrapper/makeAnimationWrapperStyling.d.ts +1 -1
  2. package/Components/Atoms/Button/makeButtonStyling.d.ts +1 -1
  3. package/Components/Atoms/CardButton/makeCardButtonStyling.d.ts +2 -2
  4. package/Components/Atoms/CircularProgress/makeCircularProgressStyling.d.ts +1 -1
  5. package/Components/Atoms/ErrorMessage/makeErrorMessageStyles.d.ts +1 -1
  6. package/Components/Atoms/FormControl/makeFormControlStyles.d.ts +1 -1
  7. package/Components/Atoms/IconButton/makeIconButtonStyling.d.ts +1 -1
  8. package/Components/Atoms/InfoPanel/makeInfoPanelStyling.d.ts +5 -5
  9. package/Components/Atoms/Input/makeInputStyles.d.ts +4 -4
  10. package/Components/Atoms/InputLabel/makeInputLabelStyles.d.ts +1 -1
  11. package/Components/Atoms/Link/makeLinkStyling.d.ts +1 -1
  12. package/Components/Atoms/LoadingIndicator/makeLinearProgressStyling.d.ts +1 -1
  13. package/Components/Atoms/Modal/makeModalStylings.d.ts +3 -3
  14. package/Components/Atoms/ProgressBar/makeProgressBarStyling.d.ts +3 -3
  15. package/Components/Atoms/Text/makeTextStyling.d.ts +1 -1
  16. package/Components/Molecules/CheckBox/makeCheckBoxStyling.d.ts +10 -10
  17. package/Components/Molecules/DatePicker/__tests__/DatePicker.test.js +1 -1
  18. package/Components/Molecules/DatePicker/__tests__/DatePicker.test.js.map +1 -1
  19. package/Components/Molecules/DatePicker/makeDatePickerStyling.d.ts +3 -3
  20. package/Components/Molecules/DropDownSelect/makeDropDownSelectStyling.d.ts +3 -3
  21. package/Components/Molecules/IconTileCheckBox/makeIconTileCheckBoxStyling.d.ts +5 -5
  22. package/Components/Molecules/IconTileRadioButton/makeIconTileRadioButtonStyling.d.ts +4 -4
  23. package/Components/Molecules/NavBar/makeNavBarStyles.d.ts +4 -4
  24. package/Components/Molecules/PhoneNumberTextField/IPhoneNumberTextFieldProps.d.ts +2 -0
  25. package/Components/Molecules/PhoneNumberTextField/PhoneNumberTextField.d.ts +1 -0
  26. package/Components/Molecules/PhoneNumberTextField/PhoneNumberTextField.js +60 -31
  27. package/Components/Molecules/PhoneNumberTextField/PhoneNumberTextField.js.map +1 -1
  28. package/Components/Molecules/PhoneNumberTextField/PhoneNumberTextFieldStory.d.ts +1 -0
  29. package/Components/Molecules/PhoneNumberTextField/PhoneNumberTextFieldStory.js +11 -18
  30. package/Components/Molecules/PhoneNumberTextField/PhoneNumberTextFieldStory.js.map +1 -1
  31. package/Components/Molecules/PhoneNumberTextField/__tests__/PhoneNumberTextField.test.js +215 -0
  32. package/Components/Molecules/PhoneNumberTextField/__tests__/PhoneNumberTextField.test.js.map +1 -0
  33. package/Components/Molecules/PhoneNumberTextField/makeFormControlPhoneNumberStyling.d.ts +1 -1
  34. package/Components/Molecules/PhoneNumberTextField/makeFormControlPhoneNumberStyling.js +20 -8
  35. package/Components/Molecules/PhoneNumberTextField/makeFormControlPhoneNumberStyling.js.map +1 -1
  36. package/Components/Molecules/RadioButton/makeRadioButtonStyling.d.ts +7 -7
  37. package/Components/Molecules/ScrollContainer/makeScrollContainerStyling.d.ts +3 -3
  38. package/Components/Molecules/SupplierCard/makeSupplierCardStyling.d.ts +12 -12
  39. package/Components/Molecules/ThankYouBanner/makeThankYouBannerStyling.d.ts +2 -2
  40. package/Components/Organisms/ListLayout/makeListLayoutStyling.d.ts +2 -2
  41. package/Components/Organisms/TileLayout/makeTileLayoutStyling.d.ts +3 -3
  42. package/Experiments/Example/Atoms/CardButton/makeCardButtonStyling.d.ts +2 -2
  43. package/Experiments/Example/Atoms/FormControl/makeFormControlStyles.d.ts +1 -1
  44. package/Experiments/Example/Atoms/Input/makeInputStyles.d.ts +4 -4
  45. package/Experiments/Example/Atoms/InputLabel/makeInputLabelStyles.d.ts +1 -1
  46. package/Experiments/Example/Atoms/Text/makeTextStyling.d.ts +1 -1
  47. package/Experiments/Example/Molecules/CheckBox/makeCheckBoxStyling.d.ts +10 -10
  48. package/package.json +8 -5
  49. package/Components/Molecules/PhoneNumberTextField/PhoneNumberTextField.test.js +0 -44
  50. package/Components/Molecules/PhoneNumberTextField/PhoneNumberTextField.test.js.map +0 -1
  51. /package/Components/Molecules/PhoneNumberTextField/{PhoneNumberTextField.test.d.ts → __tests__/PhoneNumberTextField.test.d.ts} +0 -0
@@ -2,5 +2,5 @@ declare const makeAnimationWrapperStyling: ({ effect, delay, animationTime, }: {
2
2
  effect?: string | undefined;
3
3
  delay?: number | undefined;
4
4
  animationTime?: number | undefined;
5
- }) => import("@emotion/utils").SerializedStyles;
5
+ }) => import("@emotion/react").SerializedStyles;
6
6
  export default makeAnimationWrapperStyling;
@@ -1,3 +1,3 @@
1
1
  import { Theme } from '@emotion/react';
2
- declare const makeButtonStyling: (disabled: boolean, theme: Theme, textOverflowHandling: string, invertColors: boolean) => import("@emotion/utils").SerializedStyles;
2
+ declare const makeButtonStyling: (disabled: boolean, theme: Theme, textOverflowHandling: string, invertColors: boolean) => import("@emotion/react").SerializedStyles;
3
3
  export default makeButtonStyling;
@@ -3,9 +3,9 @@ interface ICardStylingProps {
3
3
  selected: boolean;
4
4
  outlined?: boolean;
5
5
  }
6
- declare const makeCardButtonStyling: ({ isError, selected, outlined, }: ICardStylingProps) => import("@emotion/utils").SerializedStyles;
6
+ declare const makeCardButtonStyling: ({ isError, selected, outlined, }: ICardStylingProps) => import("@emotion/react").SerializedStyles;
7
7
  interface ICardStylingOverlayProps {
8
8
  selected: boolean;
9
9
  }
10
- export declare const makeCardButtonSelectedOverlayStyling: ({ selected, }: ICardStylingOverlayProps) => import("@emotion/utils").SerializedStyles;
10
+ export declare const makeCardButtonSelectedOverlayStyling: ({ selected, }: ICardStylingOverlayProps) => import("@emotion/react").SerializedStyles;
11
11
  export default makeCardButtonStyling;
@@ -1,3 +1,3 @@
1
1
  import { ITheme } from '../../../Themes/themes';
2
- declare const makeCircularProgressStyling: (theme: ITheme) => import("@emotion/utils").SerializedStyles;
2
+ declare const makeCircularProgressStyling: (theme: ITheme) => import("@emotion/react").SerializedStyles;
3
3
  export default makeCircularProgressStyling;
@@ -1,3 +1,3 @@
1
1
  import { ITheme } from '../../../Themes/themes';
2
- declare const makeErrorMessageStyles: (theme: ITheme) => import("@emotion/utils").SerializedStyles;
2
+ declare const makeErrorMessageStyles: (theme: ITheme) => import("@emotion/react").SerializedStyles;
3
3
  export default makeErrorMessageStyles;
@@ -1,5 +1,5 @@
1
1
  declare const makeFormControlStyles: ({ isAutoFilledActive, isSafari, }: {
2
2
  isAutoFilledActive: boolean;
3
3
  isSafari: boolean;
4
- }) => import("@emotion/utils").SerializedStyles;
4
+ }) => import("@emotion/react").SerializedStyles;
5
5
  export default makeFormControlStyles;
@@ -1,2 +1,2 @@
1
- export declare const makeIconButtonStyling: (variant: "inline" | "stacked") => import("@emotion/utils").SerializedStyles;
1
+ export declare const makeIconButtonStyling: (variant: "inline" | "stacked") => import("@emotion/react").SerializedStyles;
2
2
  export default makeIconButtonStyling;
@@ -1,8 +1,8 @@
1
1
  declare const makeInfoPanelStyling: () => {
2
- panel: import("@emotion/utils").SerializedStyles;
3
- iconBox: import("@emotion/utils").SerializedStyles;
4
- textBox: import("@emotion/utils").SerializedStyles;
5
- title: import("@emotion/utils").SerializedStyles;
6
- children: import("@emotion/utils").SerializedStyles;
2
+ panel: import("@emotion/react").SerializedStyles;
3
+ iconBox: import("@emotion/react").SerializedStyles;
4
+ textBox: import("@emotion/react").SerializedStyles;
5
+ title: import("@emotion/react").SerializedStyles;
6
+ children: import("@emotion/react").SerializedStyles;
7
7
  };
8
8
  export default makeInfoPanelStyling;
@@ -6,9 +6,9 @@ interface IInputStyleProps {
6
6
  error: boolean;
7
7
  }
8
8
  declare const makeInputStyles: ({ isAnswered, isOtherOption, isSafari, isAutoFilledActive, error, }: IInputStyleProps) => {
9
- input: import("@emotion/utils").SerializedStyles;
10
- validationIcon: import("@emotion/utils").SerializedStyles;
11
- adornmentEnd: import("@emotion/utils").SerializedStyles;
12
- adornmentStart: import("@emotion/utils").SerializedStyles;
9
+ input: import("@emotion/react").SerializedStyles;
10
+ validationIcon: import("@emotion/react").SerializedStyles;
11
+ adornmentEnd: import("@emotion/react").SerializedStyles;
12
+ adornmentStart: import("@emotion/react").SerializedStyles;
13
13
  };
14
14
  export default makeInputStyles;
@@ -1,5 +1,5 @@
1
1
  interface IInputStyleProps {
2
2
  isAnswered?: boolean;
3
3
  }
4
- declare const makeInputLabelStyles: ({ isAnswered }: IInputStyleProps) => import("@emotion/utils").SerializedStyles;
4
+ declare const makeInputLabelStyles: ({ isAnswered }: IInputStyleProps) => import("@emotion/react").SerializedStyles;
5
5
  export default makeInputLabelStyles;
@@ -1,5 +1,5 @@
1
1
  interface ILinkStylingProps {
2
2
  variant?: 'button' | 'footer' | 'text';
3
3
  }
4
- declare const makeLinkStyling: ({ variant }: ILinkStylingProps) => import("@emotion/utils").SerializedStyles;
4
+ declare const makeLinkStyling: ({ variant }: ILinkStylingProps) => import("@emotion/react").SerializedStyles;
5
5
  export default makeLinkStyling;
@@ -1,2 +1,2 @@
1
- declare const makeLinearProgressStyling: () => import("@emotion/utils").SerializedStyles;
1
+ declare const makeLinearProgressStyling: () => import("@emotion/react").SerializedStyles;
2
2
  export default makeLinearProgressStyling;
@@ -1,6 +1,6 @@
1
1
  declare const makeModalStylings: () => {
2
- box: import("@emotion/utils").SerializedStyles;
3
- close: import("@emotion/utils").SerializedStyles;
4
- text: import("@emotion/utils").SerializedStyles;
2
+ box: import("@emotion/react").SerializedStyles;
3
+ close: import("@emotion/react").SerializedStyles;
4
+ text: import("@emotion/react").SerializedStyles;
5
5
  };
6
6
  export default makeModalStylings;
@@ -1,7 +1,7 @@
1
1
  import { ITheme } from '../../../Themes/themes';
2
2
  declare const makeProgressBarStyling: (theme: ITheme, useLightText: boolean) => {
3
- container: import("@emotion/utils").SerializedStyles;
4
- progressBar: import("@emotion/utils").SerializedStyles;
5
- text: import("@emotion/utils").SerializedStyles;
3
+ container: import("@emotion/react").SerializedStyles;
4
+ progressBar: import("@emotion/react").SerializedStyles;
5
+ text: import("@emotion/react").SerializedStyles;
6
6
  };
7
7
  export default makeProgressBarStyling;
@@ -1,5 +1,5 @@
1
1
  interface IStyleProps {
2
2
  variant: 'header' | 'summary' | 'note' | 'question' | 'text' | 'footer' | 'listItem' | 'tileItem' | 'contentWithList' | 'tickedList';
3
3
  }
4
- declare const makeTextStyling: ({ variant }: IStyleProps) => import("@emotion/utils").SerializedStyles;
4
+ declare const makeTextStyling: ({ variant }: IStyleProps) => import("@emotion/react").SerializedStyles;
5
5
  export default makeTextStyling;
@@ -1,13 +1,13 @@
1
- export declare const getPlaceholderStyles: (isTextCentered: boolean, isIconPresent: boolean) => import("@emotion/utils").SerializedStyles;
1
+ export declare const getPlaceholderStyles: (isTextCentered: boolean, isIconPresent: boolean) => import("@emotion/react").SerializedStyles;
2
2
  declare const makeCheckBoxStyling: () => {
3
- checkbox: import("@emotion/utils").SerializedStyles;
4
- checkboxContainerRight: import("@emotion/utils").SerializedStyles;
5
- grid: import("@emotion/utils").SerializedStyles;
6
- centerIcon: import("@emotion/utils").SerializedStyles;
7
- leftIcon: import("@emotion/utils").SerializedStyles;
8
- imgDiv: import("@emotion/utils").SerializedStyles;
9
- innerGrid: import("@emotion/utils").SerializedStyles;
10
- textGrid: import("@emotion/utils").SerializedStyles;
11
- otherInput: import("@emotion/utils").SerializedStyles;
3
+ checkbox: import("@emotion/react").SerializedStyles;
4
+ checkboxContainerRight: import("@emotion/react").SerializedStyles;
5
+ grid: import("@emotion/react").SerializedStyles;
6
+ centerIcon: import("@emotion/react").SerializedStyles;
7
+ leftIcon: import("@emotion/react").SerializedStyles;
8
+ imgDiv: import("@emotion/react").SerializedStyles;
9
+ innerGrid: import("@emotion/react").SerializedStyles;
10
+ textGrid: import("@emotion/react").SerializedStyles;
11
+ otherInput: import("@emotion/react").SerializedStyles;
12
12
  };
13
13
  export default makeCheckBoxStyling;
@@ -49,7 +49,7 @@ describe('DatePicker', function () {
49
49
  var mockDate = new Date(2022, 2, 1);
50
50
  var mockedDateText = 'March 2022';
51
51
  beforeAll(function () {
52
- jest.useFakeTimers('modern');
52
+ jest.useFakeTimers({ now: mockDate, advanceTimers: true });
53
53
  jest.setSystemTime(mockDate);
54
54
  });
55
55
  afterAll(function () {
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.test.js","sourceRoot":"","sources":["../../../../../src/Components/Molecules/DatePicker/__tests__/DatePicker.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAA2D;AAC3D,sGAAgF;AAChF,6DAAuC;AACvC,qEAAoE;AACpE,gDAAsD;AAEtD,QAAQ,CAAC,YAAY,EAAE;IACrB,IAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACtC,IAAM,cAAc,GAAG,YAAY,CAAC;IAEpC,SAAS,CAAC;QACR,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC;QACP,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+BAA+B,EAAE;QAClC,IAAM,YAAY,GAAG,cAAO,CAAC,CAAC;QAC9B,IAAM,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;QAEpB,IAAA,oBAAoB,GAAK,IAAA,6BAAmB,EAClD,uBAAC,qCAAoB,IAAC,WAAW,EAAE,+BAAc,YAC/C,uBAAC,oBAAU,IACT,EAAE,EAAC,cAAc,EACjB,MAAM,EAAC,YAAY,EACnB,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,QAAQ,GACf,GACmB,CACx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AAY,CAAE,WAAW,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;wCAClE,MAAM,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;6BACxE,CAAC,EAAA;;oBAXF,SAWE,CAAC;;;;SACJ,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"DatePicker.test.js","sourceRoot":"","sources":["../../../../../src/Components/Molecules/DatePicker/__tests__/DatePicker.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAA2D;AAC3D,sGAAgF;AAChF,6DAAuC;AACvC,qEAAoE;AACpE,gDAAsD;AAEtD,QAAQ,CAAC,YAAY,EAAE;IACrB,IAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACtC,IAAM,cAAc,GAAG,YAAY,CAAC;IAEpC,SAAS,CAAC;QACR,IAAI,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC;QACP,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+BAA+B,EAAE;QAClC,IAAM,YAAY,GAAG,cAAO,CAAC,CAAC;QAC9B,IAAM,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;QAEpB,IAAA,oBAAoB,GAAK,IAAA,6BAAmB,EAClD,uBAAC,qCAAoB,IAAC,WAAW,EAAE,+BAAc,YAC/C,uBAAC,oBAAU,IACT,EAAE,EAAC,cAAc,EACjB,MAAM,EAAC,YAAY,EACnB,QAA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,CAAC;wCACjD,eAAe,GAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;wCAClE,MAAM,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;6BACxE,CAAC,EAAA;;oBAXF,SAWE,CAAC;;;;SACJ,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -3,8 +3,8 @@ interface ITextFieldStyleProps {
3
3
  isError: boolean;
4
4
  }
5
5
  declare const makeDatePickerStyling: ({ isValid, isError }: ITextFieldStyleProps) => {
6
- datePickerContainer: import("@emotion/utils").SerializedStyles;
7
- inputAdornmentEnd: import("@emotion/utils").SerializedStyles;
8
- globalStyles: import("@emotion/utils").SerializedStyles;
6
+ datePickerContainer: import("@emotion/react").SerializedStyles;
7
+ inputAdornmentEnd: import("@emotion/react").SerializedStyles;
8
+ globalStyles: import("@emotion/react").SerializedStyles;
9
9
  };
10
10
  export default makeDatePickerStyling;
@@ -4,8 +4,8 @@ interface IDropDownSelectStyleProps {
4
4
  isError: boolean;
5
5
  }
6
6
  declare const useDropDownSelectStyles: ({ isIconPresent, isDisabled, isError, }: IDropDownSelectStyleProps) => {
7
- listItems: import("@emotion/utils").SerializedStyles;
8
- formControl: import("@emotion/utils").SerializedStyles;
9
- label: import("@emotion/utils").SerializedStyles;
7
+ listItems: import("@emotion/react").SerializedStyles;
8
+ formControl: import("@emotion/react").SerializedStyles;
9
+ label: import("@emotion/react").SerializedStyles;
10
10
  };
11
11
  export default useDropDownSelectStyles;
@@ -1,10 +1,10 @@
1
1
  declare const makeIconTileCheckBoxStyling: ({ showText }: {
2
2
  showText: boolean;
3
3
  }) => {
4
- container: import("@emotion/utils").SerializedStyles;
5
- icon: import("@emotion/utils").SerializedStyles;
6
- checkbox: import("@emotion/utils").SerializedStyles;
7
- otherInput: import("@emotion/utils").SerializedStyles;
8
- imgDiv: import("@emotion/utils").SerializedStyles;
4
+ container: import("@emotion/react").SerializedStyles;
5
+ icon: import("@emotion/react").SerializedStyles;
6
+ checkbox: import("@emotion/react").SerializedStyles;
7
+ otherInput: import("@emotion/react").SerializedStyles;
8
+ imgDiv: import("@emotion/react").SerializedStyles;
9
9
  };
10
10
  export default makeIconTileCheckBoxStyling;
@@ -1,7 +1,7 @@
1
1
  declare const makeIconTileRadioButtonStyling: () => {
2
- container: import("@emotion/utils").SerializedStyles;
3
- icon: import("@emotion/utils").SerializedStyles;
4
- otherInput: import("@emotion/utils").SerializedStyles;
5
- imgDiv: import("@emotion/utils").SerializedStyles;
2
+ container: import("@emotion/react").SerializedStyles;
3
+ icon: import("@emotion/react").SerializedStyles;
4
+ otherInput: import("@emotion/react").SerializedStyles;
5
+ imgDiv: import("@emotion/react").SerializedStyles;
6
6
  };
7
7
  export default makeIconTileRadioButtonStyling;
@@ -1,7 +1,7 @@
1
1
  declare const makeNavBarStyles: () => {
2
- container: import("@emotion/utils").SerializedStyles;
3
- space: import("@emotion/utils").SerializedStyles;
4
- continueButton: import("@emotion/utils").SerializedStyles;
5
- backButton: import("@emotion/utils").SerializedStyles;
2
+ container: import("@emotion/react").SerializedStyles;
3
+ space: import("@emotion/react").SerializedStyles;
4
+ continueButton: import("@emotion/react").SerializedStyles;
5
+ backButton: import("@emotion/react").SerializedStyles;
6
6
  };
7
7
  export default makeNavBarStyles;
@@ -13,10 +13,12 @@ interface IPhoneNumberTextFieldProps {
13
13
  label: string;
14
14
  onBlur: () => void;
15
15
  onChange: (item: IPhoneNumberTextFieldCallbackParams) => void;
16
+ onCountryChange: (item: IPhoneNumberTextFieldCallbackParams) => void;
16
17
  onClick: MouseEventHandler<HTMLInputElement>;
17
18
  placeholder?: string;
18
19
  value: string;
19
20
  isSafari: boolean;
20
21
  isAutoFilledActive: boolean;
22
+ countryCodeIso2: string;
21
23
  }
22
24
  export default IPhoneNumberTextFieldProps;
@@ -1,3 +1,4 @@
1
+ import 'intl-tel-input/build/css/intlTelInput.min.css';
1
2
  import { FunctionComponentWithDefaultProps } from '../../../Helpers/React';
2
3
  import IPhoneNumberTextFieldProps from './IPhoneNumberTextFieldProps';
3
4
  import defaultProps from './defaultProps';
@@ -10,6 +10,29 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
13
36
  var __rest = (this && this.__rest) || function (s, e) {
14
37
  var t = {};
15
38
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -30,51 +53,57 @@ var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
30
53
  var FormControl_1 = __importDefault(require("@mui/material/FormControl"));
31
54
  var FormHelperText_1 = __importDefault(require("@mui/material/FormHelperText"));
32
55
  var intl_tel_input_1 = __importDefault(require("intl-tel-input"));
56
+ require("intl-tel-input/build/css/intlTelInput.min.css");
33
57
  var react_1 = require("react");
34
- var Input_1 = __importDefault(require("../../../Components/Atoms/Input"));
35
- var InputLabel_1 = __importDefault(require("../../../Components/Atoms/InputLabel"));
58
+ var Input_1 = __importDefault(require("../../Atoms/Input/Input"));
59
+ var InputLabel_1 = __importDefault(require("../../Atoms/InputLabel/InputLabel"));
36
60
  var defaultProps_1 = __importDefault(require("./defaultProps"));
37
61
  var makeFormControlPhoneNumberStyling_1 = __importDefault(require("./makeFormControlPhoneNumberStyling"));
38
- var makeFormControlStyles_1 = __importDefault(require("../../../Components/Atoms/FormControl/makeFormControlStyles"));
39
- var setUserAgent = function (userAgent) {
40
- Object.defineProperty(navigator, 'userAgent', {
41
- get: function () {
42
- return userAgent; // customized user agent
43
- },
44
- configurable: true,
45
- });
46
- };
47
- var getInput = function (id) {
48
- return document.querySelector("#".concat(id));
49
- };
50
- var initIntlTelInput = function (input) {
51
- // Keep the initial userAgent
52
- var initialUserAgent = navigator.userAgent;
53
- // Set mobile layout in userAgent
54
- setUserAgent('iPhone');
55
- // Init plugin
56
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call
57
- (0, intl_tel_input_1.default)(input, {
58
- utilsScript: 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.13/js/utils.min.js',
59
- });
60
- // Restore the initial userAgent
61
- setUserAgent(initialUserAgent);
62
- };
62
+ var makeFormControlStyles_1 = __importDefault(require("../../Atoms/FormControl/makeFormControlStyles"));
63
63
  var PhoneNumberTextField = function (_a) {
64
- var errorMessage = _a.errorMessage, id = _a.id, isAnswered = _a.isAnswered, onChange = _a.onChange, value = _a.value, label = _a.label, isSafari = _a.isSafari, isAutoFilledActive = _a.isAutoFilledActive, props = __rest(_a, ["errorMessage", "id", "isAnswered", "onChange", "value", "label", "isSafari", "isAutoFilledActive"]);
64
+ var errorMessage = _a.errorMessage, id = _a.id, isAnswered = _a.isAnswered, onChange = _a.onChange, onCountryChange = _a.onCountryChange, value = _a.value, label = _a.label, isSafari = _a.isSafari, isAutoFilledActive = _a.isAutoFilledActive, _b = _a.countryCodeIso2, countryCodeIso2 = _b === void 0 ? 'us' : _b, props = __rest(_a, ["errorMessage", "id", "isAnswered", "onChange", "onCountryChange", "value", "label", "isSafari", "isAutoFilledActive", "countryCodeIso2"]);
65
+ var inputRef = (0, react_1.useRef)(null);
65
66
  (0, react_1.useEffect)(function () {
66
- var input = getInput(id);
67
- initIntlTelInput(input);
67
+ var input = inputRef.current;
68
+ if (!input)
69
+ return;
70
+ var options = {
71
+ allowDropdown: true,
72
+ separateDialCode: false,
73
+ showFlags: true,
74
+ searchInput: true,
75
+ showDialCodeInSelection: true,
76
+ countryOrder: ['us', 'gb'],
77
+ separateDialCodeInDropdown: true,
78
+ nationalMode: false, // ensure placeholder is shown
79
+ customContainer: 'iti iti--container iti--fullscreen-popup hide-search',
80
+ useFullscreenPopup: true,
81
+ initialCountry: countryCodeIso2,
82
+ loadUtils: function () { return Promise.resolve().then(function () { return __importStar(require('intl-tel-input/build/js/utils')); }); },
83
+ };
84
+ var iti = (0, intl_tel_input_1.default)(input, options);
68
85
  input.addEventListener('countrychange', function (e) {
86
+ var countryData = iti === null || iti === void 0 ? void 0 : iti.getSelectedCountryData();
87
+ if (countryData === null || countryData === void 0 ? void 0 : countryData.iso2) {
88
+ onCountryChange({
89
+ id: id,
90
+ value: countryData.iso2,
91
+ });
92
+ }
69
93
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
70
94
  // @ts-ignore
71
95
  onChange({ id: id, value: e.target.value });
72
96
  });
97
+ return function () {
98
+ if (iti && iti.destroy) {
99
+ iti.destroy();
100
+ }
101
+ };
73
102
  }, []);
74
103
  return ((0, jsx_runtime_1.jsxs)(FormControl_1.default, { variant: "standard", error: !!errorMessage, fullWidth: true, css: [
75
104
  (0, makeFormControlPhoneNumberStyling_1.default)({ isAnswered: isAnswered }),
76
105
  (0, makeFormControlStyles_1.default)({ isAutoFilledActive: isAutoFilledActive, isSafari: isSafari }),
77
- ], children: [label && ((0, jsx_runtime_1.jsx)(InputLabel_1.default, { isAnswered: isAnswered, htmlFor: id, shrink: true, children: label })), (0, jsx_runtime_1.jsx)(Input_1.default, __assign({ error: !!errorMessage, id: id, onChange: onChange, isAnswered: isAnswered, value: value, isSafari: isSafari, isAutoFilledActive: isAutoFilledActive }, props)), errorMessage && (0, jsx_runtime_1.jsx)(FormHelperText_1.default, { children: errorMessage })] }));
106
+ ], children: [label && ((0, jsx_runtime_1.jsx)(InputLabel_1.default, { isAnswered: isAnswered, htmlFor: id, shrink: true, children: label })), (0, jsx_runtime_1.jsx)(Input_1.default, __assign({ error: !!errorMessage, id: id, onChange: onChange, isAnswered: isAnswered, value: value, isSafari: isSafari, isAutoFilledActive: isAutoFilledActive, inputRef: inputRef }, props)), errorMessage && (0, jsx_runtime_1.jsx)(FormHelperText_1.default, { children: errorMessage })] }));
78
107
  };
79
108
  PhoneNumberTextField.defaultProps = defaultProps_1.default;
80
109
  exports.default = PhoneNumberTextField;
@@ -1 +1 @@
1
- {"version":3,"file":"PhoneNumberTextField.js","sourceRoot":"","sources":["../../../../src/Components/Molecules/PhoneNumberTextField/PhoneNumberTextField.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,0EAAoD;AACpD,gFAA0D;AAC1D,kEAA0C;AAC1C,+BAAkC;AAClC,0EAAoD;AACpD,oFAA8D;AAG9D,gEAA0C;AAC1C,0GAAoF;AACpF,sHAAgG;AAQhG,IAAM,YAAY,GAAG,UAAC,SAAiB;IACrC,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,WAAW,EAAE;QAC5C,GAAG;YACD,OAAO,SAAS,CAAC,CAAC,wBAAwB;QAC5C,CAAC;QACD,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,IAAM,QAAQ,GAAG,UAAC,EAAU;IAC1B,OAAO,QAAQ,CAAC,aAAa,CAAC,WAAI,EAAE,CAAE,CAAqB,C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IAAI,CACR,uBAAC,oBAAU,IAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBACpD,KAAK,GACK,CACd,EACD,uBAAC,eAAK,aACJ,KAAK,EAAE,CAAC,CAAC,YAAY,EACrB,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,kBAAkB,EAAE,kBAAkB,IAClC,KAAK,EACT,EACD,YAAY,IAAI,uBAAC,wBAAc,cAAE,YAAY,GAAkB,IACpD,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,oBAAoB,CAAC,YAAY,GAAG,sBAAY,CAAC;AAEjD,kBAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"PhoneNumberTextField.js","sourceRoot":"","sources":["../../../../src/Components/Molecules/PhoneNumberTextField/PhoneNumberTextField.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,0EAAoD;AACpD,gFAA0D;AAC1D,kEAAoE;AACpE,yDAAuD;AACvD,+BAA0C;AAC1C,kEAA4C;AAC5C,iFAA2D;AAG3D,gEAA0C;AAC1C,0GAAoF;AACpF,wGAAkF;AAQlF,IAAM,oBAAoB,GAA6B,UAAC,EAYvD;IAXC,IAAA,YAAY,kBAAA,EACZ,EAAE,QAAA,EACF,UAAU,gBAAA,EACV,QAAQ,cAAA,EACR,eAAe,qBAAA,EACf,KAAK,WAAA,EACL,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,kBAAkB,wBAAA,EAClB,uBAAsB,EAAtB,eAAe,mBAAG,IAAI,KAAA,EACnB,KAAK,cAX8C,0IAYvD,CADS;IAER,IAAM,QAAQ,GAAG,IAAA,cAAM,EAAmB,IAAI,CAAC,CAAC;IAEhD,IAAA,iBAAS,EAAC;QACR,IAAM,KAAK,GAAG,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AClB,KAAK,EAAE,CAAC,CAAC,YAAY,EACrB,SAAS,EAAE,IAAI,EACf,GAAG,EAAE;YACH,IAAA,2CAAiC,EAAC,EAAE,UAAU,YAAA,EAAE,CAAC;YACjD,IAAA,+BAAqB,EAAC,EAAE,kBAAkB,oBAAA,EAAE,QAAQ,UAAA,EAAE,CAAC;SACxD,aAEA,KAAK,IAAI,CACR,uBAAC,oBAAU,IAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBACpD,KAAK,GACK,CACd,EACD,uBAAC,eAAK,aACJ,KAAK,EAAE,CAAC,CAAC,YAAY,EACrB,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,QAAQ,IACd,KAAK,EACT,EACD,YAAY,IAAI,uBAAC,wBAAc,cAAE,YAAY,GAAkB,IACpD,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,oBAAoB,CAAC,YAAY,GAAG,sBAAY,CAAC;AAEjD,kBAAe,oBAAoB,CAAC"}
@@ -10,6 +10,7 @@ type StoryType = React.FunctionComponent<{
10
10
  parentContainerMaxWidth: number;
11
11
  isSafari: boolean;
12
12
  isAutoFilledActive: boolean;
13
+ countryCodeIso2: string;
13
14
  }>;
14
15
  declare const PhoneNumberTextFieldStory: StoryType;
15
16
  export default PhoneNumberTextFieldStory;
@@ -7,26 +7,19 @@ var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
7
7
  var addon_actions_1 = require("@storybook/addon-actions");
8
8
  require("intl-tel-input/build/css/intlTelInput.css");
9
9
  var PhoneNumberTextField_1 = __importDefault(require("./PhoneNumberTextField"));
10
- var getInput = function (id) {
11
- return document.querySelector("#".concat(id));
12
- };
13
- var getCountryCode = function (id) {
14
- var input = getInput(id);
15
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
16
- var iti = window.intlTelInputGlobals.getInstance(input);
17
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
18
- var iso2 = iti.getSelectedCountryData().iso2;
19
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
20
- return iso2;
21
- };
22
- var handleChange = function (_a) {
23
- var id = _a.id, value = _a.value;
24
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
25
- (0, addon_actions_1.action)('Input Change')({ phone: value, countryCode: getCountryCode(id) });
26
- };
27
10
  var PhoneNumberTextFieldStory = function (_a) {
28
11
  var disabled = _a.disabled, errorMessage = _a.errorMessage, type = _a.type, isAnswered = _a.isAnswered, label = _a.label, placeholder = _a.placeholder, parentContainerMaxWidth = _a.parentContainerMaxWidth, isSafari = _a.isSafari, isAutoFilledActive = _a.isAutoFilledActive;
29
- return ((0, jsx_runtime_1.jsx)("div", { style: { maxWidth: parentContainerMaxWidth }, children: (0, jsx_runtime_1.jsx)(PhoneNumberTextField_1.default, { disabled: disabled, errorMessage: errorMessage, onChange: handleChange, type: type, id: "id", isAnswered: isAnswered, label: label, placeholder: placeholder, isSafari: isSafari, isAutoFilledActive: isAutoFilledActive }) }));
12
+ var countryCodeIso2 = 'us';
13
+ var handleCountryChange = function (_a) {
14
+ var id = _a.id, value = _a.value;
15
+ countryCodeIso2 = value;
16
+ (0, addon_actions_1.action)('Country Change')({ id: id, phone: value });
17
+ };
18
+ var handleChange = function (_a) {
19
+ var id = _a.id, value = _a.value;
20
+ (0, addon_actions_1.action)('Input Change')({ id: id, phone: value });
21
+ };
22
+ return ((0, jsx_runtime_1.jsx)("div", { style: { maxWidth: parentContainerMaxWidth }, children: (0, jsx_runtime_1.jsx)(PhoneNumberTextField_1.default, { disabled: disabled, errorMessage: errorMessage, onChange: handleChange, onCountryChange: handleCountryChange, type: type, id: "id", isAnswered: isAnswered, label: label, placeholder: placeholder, isSafari: isSafari, isAutoFilledActive: isAutoFilledActive, countryCodeIso2: countryCodeIso2 }) }));
30
23
  };
31
24
  exports.default = PhoneNumberTextFieldStory;
32
25
  //# sourceMappingURL=PhoneNumberTextFieldStory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PhoneNumberTextFieldStory.js","sourceRoot":"","sources":["../../../../src/Components/Molecules/PhoneNumberTextField/PhoneNumberTextFieldStory.tsx"],"names":[],"mappings":";;;;;;AAAA,0DAAkD;AAClD,qDAAmD;AAGnD,gFAA0D;AAc1D,IAAM,QAAQ,GAAG,UAAC,EAAU;IAC1B,OAAO,QAAQ,CAAC,aAAa,CAAC,WAAI,EAAE,CAAE,CAAqB,CAAC;AAC9D,CAAC,CAAC;AAEF,IAAM,cAAc,GAAG,UAAC,EAAU;IAChC,IAAM,KAAK,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC3B,gJAAgJ;IAChJ,IAAM,GAAG,GAAG,MAAM,CAAC,mBAAmB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC1D,gJAAgJ;IACxI,IAAA,IAAI,GAAK,GAAG,CAAC,sBAAsB,EAAE,KAAjC,CAAkC;IAC9C,+DAA+D;IAC/D,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,IAAM,YAAY,GAAG,UAAC,EAAkD;QAAhD,EAAE,QAAA,EAAE,KAAK,WAAA;IAC/B,mEAAmE;IACnE,IAAA,sBAAM,EAAC,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,cAAc,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAC5E,CAAC,CAAC;AAEF,IAAM,yBAAyB,GAAc,UAAC,EAU7C;QATC,QAAQ,cAAA,EACR,YAAY,kBAAA,EACZ,IAAI,UAAA,EACJ,UAAU,gBAAA,EACV,KAAK,WAAA,EACL,WAAW,iBAAA,EACX,uBAAuB,6BAAA,EACvB,QAAQ,cAAA,EACR,kBAAkB,wBAAA;IAElB,OAAO,CACL,gCAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,uBAAuB,EAAE,YAC/C,uBAAC,8BAAoB,IACnB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,IAAI,EACV,EAAE,EAAC,IAAI,EACP,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,kBAAkB,EAAE,kBAAkB,GACtC,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"PhoneNumberTextFieldStory.js","sourceRoot":"","sources":["../../../../src/Components/Molecules/PhoneNumberTextField/PhoneNumberTextFieldStory.tsx"],"names":[],"mappings":";;;;;;AAAA,0DAAkD;AAClD,qDAAmD;AAGnD,gFAA0D;AAe1D,IAAM,yBAAyB,GAAc,UAAC,EAU7C;QATC,QAAQ,cAAA,EACR,YAAY,kBAAA,EACZ,IAAI,UAAA,EACJ,UAAU,gBAAA,EACV,KAAK,WAAA,EACL,WAAW,iBAAA,EACX,uBAAuB,6BAAA,EACvB,QAAQ,cAAA,EACR,kBAAkB,wBAAA;IAElB,IAAI,eAAe,GAAG,IAAI,CAAC;IAE3B,IAAM,mBAAmB,GAAG,UAAC,EAGS;YAFpC,EAAE,QAAA,EACF,KAAK,WAAA;QAEL,eAAe,GAAG,KAAK,CAAC;QACxB,IAAA,sBAAM,EAAC,gBAAgB,CAAC,CAAC,EAAE,EAAE,IAAA,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACjD,CAAC,CAAC;IAEF,IAAM,YAAY,GAAG,UAAC,EAAkD;YAAhD,EAAE,QAAA,EAAE,KAAK,WAAA;QAC/B,IAAA,sBAAM,EAAC,cAAc,CAAC,CAAC,EAAE,EAAE,IAAA,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC/C,CAAC,CAAC;IAEF,OAAO,CACL,gCAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,uBAAuB,EAAE,YAC/C,uBAAC,8BAAoB,IACnB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,YAAY,EACtB,eAAe,EAAE,mBAAmB,EACpC,IAAI,EAAE,IAAI,EACV,EAAE,EAAC,IAAI,EACP,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,kBAAkB,EAAE,kBAAkB,EACtC,eAAe,EAAE,eAAe,GAChC,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,yBAAyB,CAAC"}
@@ -0,0 +1,215 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
18
+ /* eslint-disable @typescript-eslint/no-unsafe-return */
19
+ /* eslint-disable @typescript-eslint/no-unsafe-call */
20
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
21
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
22
+ var user_event_1 = __importDefault(require("@testing-library/user-event"));
23
+ var react_1 = require("@testing-library/react");
24
+ var renderWithProviders_1 = __importDefault(require("../../../../Helpers/React/renderWithProviders"));
25
+ var PhoneNumberTextField_1 = __importDefault(require("../PhoneNumberTextField"));
26
+ // Mock the main package
27
+ jest.mock('intl-tel-input', function () {
28
+ var instances = new Set();
29
+ var mockIti = {
30
+ getNumber: jest.fn(function () { return '+1234567890'; }),
31
+ getNumberType: jest.fn(function () { return 1; }),
32
+ getSelectedCountryData: jest.fn(function () { return ({
33
+ name: 'United States',
34
+ iso2: 'us',
35
+ dialCode: '1',
36
+ }); }),
37
+ isValidNumber: jest.fn(function () { return true; }),
38
+ setCountry: jest.fn(),
39
+ setNumber: jest.fn(),
40
+ destroy: jest.fn(function () {
41
+ instances.delete(this);
42
+ }),
43
+ };
44
+ // This is the constructor function that gets called with 'new'
45
+ var constructor = jest.fn(function (input, options) {
46
+ var _a;
47
+ // Create the flag container structure
48
+ var container = document.createElement('div');
49
+ container.className = 'iti iti--container';
50
+ var flagContainer = document.createElement('div');
51
+ flagContainer.className = 'iti__flag-container';
52
+ var selectedFlag = document.createElement('div');
53
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
54
+ selectedFlag.className = "iti__selected-flag iti__".concat(options.initialCountry);
55
+ selectedFlag.setAttribute('role', 'button');
56
+ selectedFlag.setAttribute('aria-label', 'Select country');
57
+ var flag = document.createElement('div');
58
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
59
+ flag.className = "iti__flag iti__".concat(options.initialCountry);
60
+ selectedFlag.appendChild(flag);
61
+ flagContainer.appendChild(selectedFlag);
62
+ container.appendChild(flagContainer);
63
+ // Insert the container before the input
64
+ (_a = input.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(container, input);
65
+ // Format the input value whenever it changes
66
+ var originalAddEventListener = input.addEventListener.bind(input);
67
+ input.addEventListener = jest.fn(function (event, handler) {
68
+ if (event === 'input' || event === 'change') {
69
+ var originalHandler_1 = handler;
70
+ handler = function (e) {
71
+ var target = e.target;
72
+ var value = target.value;
73
+ if (value.length === 10) {
74
+ target.value = "(".concat(value.slice(0, 3), ") ").concat(value.slice(3, 6), "-").concat(value.slice(6));
75
+ }
76
+ originalHandler_1(e);
77
+ };
78
+ }
79
+ return originalAddEventListener(event, handler);
80
+ });
81
+ // Add click handler to flag
82
+ selectedFlag.addEventListener('click', function () {
83
+ // Simulate country change
84
+ mockIti.getSelectedCountryData.mockReturnValue({
85
+ name: 'United Kingdom',
86
+ iso2: 'gb',
87
+ dialCode: '44',
88
+ });
89
+ var countryChangeEvent = new Event('countrychange');
90
+ input.dispatchEvent(countryChangeEvent);
91
+ });
92
+ // Create a new instance with its own container reference
93
+ var instance = __assign(__assign({}, mockIti), { container: container, destroy: function () {
94
+ container.remove();
95
+ input.removeEventListener = originalAddEventListener;
96
+ instances.delete(this);
97
+ } });
98
+ instances.add(instance);
99
+ return instance;
100
+ });
101
+ return constructor;
102
+ });
103
+ // Mock utils
104
+ jest.mock('intl-tel-input/build/js/utils', function () { return ({
105
+ __esModule: true,
106
+ default: {
107
+ formatNumber: function (number) {
108
+ if (number.length === 10) {
109
+ return "(".concat(number.slice(0, 3), ") ").concat(number.slice(3, 6), "-").concat(number.slice(6));
110
+ }
111
+ return number;
112
+ },
113
+ numberType: {
114
+ FIXED_LINE: 0,
115
+ MOBILE: 1,
116
+ FIXED_LINE_OR_MOBILE: 2,
117
+ TOLL_FREE: 3,
118
+ PREMIUM_RATE: 4,
119
+ SHARED_COST: 5,
120
+ VOIP: 6,
121
+ PERSONAL_NUMBER: 7,
122
+ PAGER: 8,
123
+ UAN: 9,
124
+ VOICEMAIL: 10,
125
+ UNKNOWN: -1,
126
+ },
127
+ getNumberType: function () { return 1; },
128
+ isValidNumber: function () { return true; },
129
+ getValidationError: function () { return null; },
130
+ getExampleNumber: function () { return '123 1233 1234'; },
131
+ },
132
+ }); });
133
+ describe('PhoneNumberTextField', function () {
134
+ var mockOnCountryChange = jest.fn();
135
+ var mockGetNumber = jest.fn(function () { return '+1234567890'; });
136
+ var mockIsValidNumber = jest.fn(function () { return true; });
137
+ beforeEach(function () {
138
+ mockOnCountryChange.mockClear();
139
+ mockGetNumber.mockClear();
140
+ mockIsValidNumber.mockClear();
141
+ jest.clearAllMocks();
142
+ });
143
+ afterEach(function () {
144
+ jest.resetAllMocks();
145
+ });
146
+ it('should display PhoneNumberTextField Component', function () {
147
+ var getByText = (0, renderWithProviders_1.default)((0, jsx_runtime_1.jsx)(PhoneNumberTextField_1.default, { label: "Question", id: "phone-input", onCountryChange: mockOnCountryChange, countryCodeIso2: "us" })).getByText;
148
+ expect(getByText('Question')).toBeTruthy();
149
+ });
150
+ it('should be able to input values', function () {
151
+ var getByRole = (0, renderWithProviders_1.default)((0, jsx_runtime_1.jsx)(PhoneNumberTextField_1.default, { label: "Zipcode", id: "phone-input", onCountryChange: mockOnCountryChange, countryCodeIso2: "us" })).getByRole;
152
+ user_event_1.default.type(getByRole('textbox'), '90210');
153
+ expect(getByRole('textbox')).toHaveValue('90210');
154
+ });
155
+ it('should have an input type of tel by default', function () {
156
+ var _a;
157
+ var container = (0, renderWithProviders_1.default)((0, jsx_runtime_1.jsx)(PhoneNumberTextField_1.default, { label: "Phone", id: "phone-input", onCountryChange: mockOnCountryChange, countryCodeIso2: "us" })).container;
158
+ expect((_a = container.querySelector('input')) === null || _a === void 0 ? void 0 : _a.type).toEqual('tel');
159
+ });
160
+ it('should pass text input type through', function () {
161
+ var _a;
162
+ var container = (0, renderWithProviders_1.default)((0, jsx_runtime_1.jsx)(PhoneNumberTextField_1.default, { label: "Phone?", id: "phone-input", type: "text", onCountryChange: mockOnCountryChange, countryCodeIso2: "us" })).container;
163
+ expect((_a = container.querySelector('input')) === null || _a === void 0 ? void 0 : _a.type).toEqual('text');
164
+ });
165
+ it('should display validity icon on error', function () {
166
+ var getByTestId = (0, renderWithProviders_1.default)((0, jsx_runtime_1.jsx)(PhoneNumberTextField_1.default, { label: "Phone", id: "phone-input", type: "none", errorMessage: "test error message", onCountryChange: mockOnCountryChange, countryCodeIso2: "us" })).getByTestId;
167
+ expect(getByTestId('endAdornment-invalid')).toBeTruthy();
168
+ });
169
+ it('should display validity icon on validation success', function () {
170
+ var getByTestId = (0, renderWithProviders_1.default)((0, jsx_runtime_1.jsx)(PhoneNumberTextField_1.default, { label: "Phone", id: "phone-input", type: "none", isAnswered: true, onCountryChange: mockOnCountryChange, countryCodeIso2: "us" })).getByTestId;
171
+ expect(getByTestId('endAdornment-valid')).toBeTruthy();
172
+ });
173
+ it('should display error icon on validation success and error message', function () {
174
+ var _a = (0, renderWithProviders_1.default)((0, jsx_runtime_1.jsx)(PhoneNumberTextField_1.default, { label: "Phone", id: "phone-input", type: "none", isAnswered: true, errorMessage: "test error message", onCountryChange: mockOnCountryChange, countryCodeIso2: "us" })), getByTestId = _a.getByTestId, queryByTestId = _a.queryByTestId;
175
+ expect(getByTestId('endAdornment-invalid')).toBeTruthy();
176
+ expect(queryByTestId('endAdornment-valid')).not.toBeTruthy();
177
+ });
178
+ it('should call onChange with the input value', function () {
179
+ var mockOnChange = jest.fn();
180
+ var getByRole = (0, renderWithProviders_1.default)((0, jsx_runtime_1.jsx)(PhoneNumberTextField_1.default, { label: "Phone", id: "phone-input", onCountryChange: mockOnCountryChange, countryCodeIso2: "us", onChange: mockOnChange })).getByRole;
181
+ // Update the mock implementation to capture the formatted value
182
+ var input = getByRole('textbox');
183
+ react_1.fireEvent.change(input, { target: { value: '1234567890' } });
184
+ // The mock intl-tel-input will format the number, so we should expect the formatted value
185
+ expect(mockOnChange).toHaveBeenCalledWith({
186
+ id: 'phone-input',
187
+ value: '1234567890',
188
+ });
189
+ });
190
+ it('should call onCountryChange when country is changed', function () {
191
+ var container = (0, renderWithProviders_1.default)((0, jsx_runtime_1.jsx)(PhoneNumberTextField_1.default, { label: "Phone", id: "phone-input", onCountryChange: mockOnCountryChange, countryCodeIso2: "us" })).container;
192
+ // Find and click the country selector
193
+ var countrySelector = container.querySelector('.iti__selected-flag');
194
+ if (countrySelector) {
195
+ react_1.fireEvent.click(countrySelector);
196
+ expect(mockOnCountryChange).toHaveBeenCalledWith({
197
+ id: 'phone-input',
198
+ value: 'gb',
199
+ });
200
+ }
201
+ });
202
+ it('should handle invalid phone numbers', function () {
203
+ var _a;
204
+ // Mock isValidNumber to return false for this test
205
+ var originalIsValidNumber = (_a = jest.requireMock('intl-tel-input').mock.instances[0]) === null || _a === void 0 ? void 0 : _a.isValidNumber;
206
+ if (originalIsValidNumber) {
207
+ originalIsValidNumber.mockImplementationOnce(function () { return false; });
208
+ }
209
+ var getByRole = (0, renderWithProviders_1.default)((0, jsx_runtime_1.jsx)(PhoneNumberTextField_1.default, { label: "Phone", id: "phone-input", onCountryChange: mockOnCountryChange, countryCodeIso2: "us" })).getByRole;
210
+ var input = getByRole('textbox');
211
+ react_1.fireEvent.change(input, { target: { value: 'invalid' } });
212
+ expect(input).toHaveValue('invalid');
213
+ });
214
+ });
215
+ //# sourceMappingURL=PhoneNumberTextField.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PhoneNumberTextField.test.js","sourceRoot":"","sources":["../../../../../src/Components/Molecules/PhoneNumberTextField/__tests__/PhoneNumberTextField.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,wDAAwD;AACxD,sDAAsD;AACtD,+DAA+D;AAC/D,4DAA4D;AAC5D,2EAAoD;AACpD,gDAAmD;AACnD,sGAAgF;AAChF,iFAA2D;AAE3D,wBAAwB;AACxB,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;IAC1B,IAAM,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;IAY5B,IAAM,OAAO,GAAG;QACd,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,cAAM,OAAA,aAAa,EAAb,CAAa,CAAC;QACvC,aAAa,EAAE,IAAI,CAAC,EAAE,CAAC,cAAM,OAAA,CAAC,EAAD,CAAC,CAAC;QAC/B,sBAAsB,EAAE,IAAI,CAAC,EAAE,CAAC,cAAM,OAAA,CAAC;YACrC,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,GAAG;SACd,CAAC,EAJoC,CAIpC,CA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AAe,EAAE,mBAAmB,EACpC,eAAe,EAAC,IAAI,GACpB,CACH,UAPgB,CAOf;QAEF,IAAM,KAAK,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;QACnC,iBAAS,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;QAC1D,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  interface IMakeFormControlPhoneNumberStylingProps {
2
2
  isAnswered: boolean;
3
3
  }
4
- declare const makeFormControlPhoneNumberStyling: ({ isAnswered, }: IMakeFormControlPhoneNumberStylingProps) => import("@emotion/utils").SerializedStyles;
4
+ declare const makeFormControlPhoneNumberStyling: ({ isAnswered, }: IMakeFormControlPhoneNumberStylingProps) => import("@emotion/react").SerializedStyles;
5
5
  export default makeFormControlPhoneNumberStyling;
@@ -26,25 +26,25 @@ var makeFormControlPhoneNumberStyling = function (_a) {
26
26
  width: 'calc(100% - 71px)',
27
27
  paddingLeft: '1.2rem !important',
28
28
  },
29
- '& .iti__flag-container': __assign({ borderRight: "".concat(theme.mvf.border.width.thin, "px solid ").concat(theme.mvf.palette.component.answerUnselectedColor), '& .iti__selected-flag': {
30
- paddingLeft: theme.mvf.spacing.smedium,
31
- paddingRight: theme.mvf.spacing.smedium,
29
+ '& .iti__country-container': __assign({ borderRight: "".concat(theme.mvf.border.width.thin, "px solid ").concat(theme.mvf.palette.component.answerUnselectedColor), '& .iti__selected-country': {
30
+ paddingLeft: theme.mvf.spacing.petite,
31
+ paddingRight: theme.mvf.spacing.petite,
32
32
  } }, (isAnswered && {
33
33
  borderRight: "".concat(theme.mvf.border.width.thin, "px solid ").concat(theme.mvf.palette.component.answerSelectedColor),
34
34
  })),
35
- '& .Mui-error .iti__flag-container': {
35
+ '& .Mui-error .iti__country-container': {
36
36
  borderRight: "".concat(theme.mvf.border.width.thin, "px solid ").concat(theme.mvf.palette.status.error),
37
37
  },
38
- '&:hover .Mui-error .iti__flag-container': {
38
+ '&:hover .Mui-error .iti__country-container': {
39
39
  borderRight: "".concat(theme.mvf.border.width.thin, "px solid ").concat(theme.mvf.palette.status.error),
40
40
  },
41
- '& .Mui-focused .iti__flag-container': {
41
+ '& .Mui-focused .iti__country-container': {
42
42
  borderColor: theme.mvf.palette.component.answerSelectedColor,
43
43
  },
44
- '&:hover .iti__flag-container': {
44
+ '&:hover .iti__country-container': {
45
45
  borderColor: theme.mvf.palette.component.answerSelectedColor,
46
46
  },
47
- '& .iti--allow-dropdown .iti__flag-container:hover .iti__selected-flag': {
47
+ '& .iti--allow-dropdown .iti__country-container:hover .iti__selected-country': {
48
48
  backgroundColor: (0, material_1.lighten)(theme.mvf.palette.component.answerSelectedColor, theme.mvf.filters.lighten.extreme),
49
49
  },
50
50
  '& .MuiInputBase-root.MuiInputBase-formControl': {
@@ -54,6 +54,18 @@ var makeFormControlPhoneNumberStyling = function (_a) {
54
54
  width: '100%',
55
55
  position: 'unset',
56
56
  },
57
+ '& #iti-0__dropdown-content.iti__dropdown-content .iti__search-input': {
58
+ display: 'none',
59
+ },
60
+ '& .iti__dropdown-content.iti--flexible-dropdown-width .iti__search-input': {
61
+ display: 'none',
62
+ },
63
+ '& .iti__search-input': {
64
+ display: 'none !important',
65
+ },
66
+ '.iti--hide-search .iti__search-input': {
67
+ display: 'none !important',
68
+ },
57
69
  });
58
70
  };
59
71
  exports.default = makeFormControlPhoneNumberStyling;
@@ -1 +1 @@
1
- {"version":3,"file":"makeFormControlPhoneNumberStyling.js","sourceRoot":"","sources":["../../../../src/Components/Molecules/PhoneNumberTextField/makeFormControlPhoneNumberStyling.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,wCAA+C;AAC/C,0CAAwC;AAMxC,IAAM,iCAAiC,GAAG,UAAC,EAED;QADxC,UAAU,gBAAA;IAEV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AAK,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,mBAAmB;SAC7D;QACD,uEAAuE,EAAE;YACvE,eAAe,EAAE,IAAA,kBAAO,EACtB,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,mBAAmB,EAC/C,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAClC;SACF;QACD,+CAA+C,EAAE;YAC/C,KAAK,EAAE,MAAM;SACd;QACD,wBAAwB,EAAE;YACxB,KAAK,EAAE,MAAM;YACb,QAAQ,EAAE,OAAO;SAClB;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,kBAAe,iCAAiC,CAAC"}
1
+ {"version":3,"file":"makeFormControlPhoneNumberStyling.js","sourceRoot":"","sources":["../../../../src/Components/Molecules/PhoneNumberTextField/makeFormControlPhoneNumberStyling.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,wCAA+C;AAC/C,0CAAwC;AAMxC,IAAM,iCAAiC,GAAG,UAAC,EAED;QADxC,UAAU,gBAAA;IAEV,IAAM,KAAK,GAAG,IAAA,gBAAQ,GAAE,CAAC;IACzB,OAAO,IAAA,WAAG,EAAC;QACT,KAAK,EAAE,MAAM;QACb,yBAAyB,EAAE;YACzB,UAAU,EAAE,EAAE;SACf;QACD,4BAA4B,EAAE;YAC5B,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EAAE,mBAAmB;SACjC;QACD,2BAA2B,aACzB,WAAW,EAAE,UAAG,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,sBAAY,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,qBAAqB,CAAE,EAC1G,0BAA0B,EAAE;gBAC1B,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM;gBACrC,YAAY,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM;aACvC,IACE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;SAC3B;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,kBAAe,iCAAiC,CAAC"}
@@ -1,10 +1,10 @@
1
1
  declare const makeRadioButtonStyling: () => {
2
- radio: import("@emotion/utils").SerializedStyles;
3
- grid: import("@emotion/utils").SerializedStyles;
4
- icon: import("@emotion/utils").SerializedStyles;
5
- imgDiv: import("@emotion/utils").SerializedStyles;
6
- innerGrid: import("@emotion/utils").SerializedStyles;
7
- textGrid: import("@emotion/utils").SerializedStyles;
8
- otherInput: import("@emotion/utils").SerializedStyles;
2
+ radio: import("@emotion/react").SerializedStyles;
3
+ grid: import("@emotion/react").SerializedStyles;
4
+ icon: import("@emotion/react").SerializedStyles;
5
+ imgDiv: import("@emotion/react").SerializedStyles;
6
+ innerGrid: import("@emotion/react").SerializedStyles;
7
+ textGrid: import("@emotion/react").SerializedStyles;
8
+ otherInput: import("@emotion/react").SerializedStyles;
9
9
  };
10
10
  export default makeRadioButtonStyling;
@@ -5,8 +5,8 @@ interface IScrollContainerStyleProps {
5
5
  export declare const SCROLL_BUFFER_HEIGHT = 17;
6
6
  export declare const SCROLL_PADDING_HEIGHT: number;
7
7
  declare const makeScrollContainerStyling: ({ scrollBufferOffset, scrollBufferOpacity, }: IScrollContainerStyleProps) => {
8
- scrollBox: import("@emotion/utils").SerializedStyles;
9
- scrollPadding: import("@emotion/utils").SerializedStyles;
10
- scrollBuffer: import("@emotion/utils").SerializedStyles;
8
+ scrollBox: import("@emotion/react").SerializedStyles;
9
+ scrollPadding: import("@emotion/react").SerializedStyles;
10
+ scrollBuffer: import("@emotion/react").SerializedStyles;
11
11
  };
12
12
  export default makeScrollContainerStyling;
@@ -6,17 +6,17 @@ declare const makeSupplierCardStyling: ({ isClickable }: ISupplierCardStyleProps
6
6
  cursor?: string | undefined;
7
7
  pointerEvents?: React.CSSProperties["pointerEvents"];
8
8
  };
9
- badge: import("@emotion/utils").SerializedStyles;
10
- badgeText: import("@emotion/utils").SerializedStyles;
11
- supplierName: import("@emotion/utils").SerializedStyles;
12
- supplierNameText: import("@emotion/utils").SerializedStyles;
13
- buttonContainer: import("@emotion/utils").SerializedStyles;
14
- cardContainer: import("@emotion/utils").SerializedStyles;
15
- logoGridContainer: import("@emotion/utils").SerializedStyles;
16
- logoGridItem: import("@emotion/utils").SerializedStyles;
17
- rightCheckbox: import("@emotion/utils").SerializedStyles;
18
- rightText: import("@emotion/utils").SerializedStyles;
19
- textGridItem: import("@emotion/utils").SerializedStyles;
20
- topRightCheckbox: import("@emotion/utils").SerializedStyles;
9
+ badge: import("@emotion/react").SerializedStyles;
10
+ badgeText: import("@emotion/react").SerializedStyles;
11
+ supplierName: import("@emotion/react").SerializedStyles;
12
+ supplierNameText: import("@emotion/react").SerializedStyles;
13
+ buttonContainer: import("@emotion/react").SerializedStyles;
14
+ cardContainer: import("@emotion/react").SerializedStyles;
15
+ logoGridContainer: import("@emotion/react").SerializedStyles;
16
+ logoGridItem: import("@emotion/react").SerializedStyles;
17
+ rightCheckbox: import("@emotion/react").SerializedStyles;
18
+ rightText: import("@emotion/react").SerializedStyles;
19
+ textGridItem: import("@emotion/react").SerializedStyles;
20
+ topRightCheckbox: import("@emotion/react").SerializedStyles;
21
21
  };
22
22
  export default makeSupplierCardStyling;
@@ -1,5 +1,5 @@
1
1
  declare const makeThankYouBannerStyling: () => {
2
- brandLogo: import("@emotion/utils").SerializedStyles;
3
- thankYouBanner: import("@emotion/utils").SerializedStyles;
2
+ brandLogo: import("@emotion/react").SerializedStyles;
3
+ thankYouBanner: import("@emotion/react").SerializedStyles;
4
4
  };
5
5
  export default makeThankYouBannerStyling;
@@ -1,5 +1,5 @@
1
1
  declare const makeListLayoutStyling: () => {
2
- container: import("@emotion/utils").SerializedStyles;
3
- item: import("@emotion/utils").SerializedStyles;
2
+ container: import("@emotion/react").SerializedStyles;
3
+ item: import("@emotion/react").SerializedStyles;
4
4
  };
5
5
  export default makeListLayoutStyling;
@@ -2,8 +2,8 @@ interface ITileLayoutStyleProps {
2
2
  tileCount: number;
3
3
  }
4
4
  declare const makeTileLayoutStyling: ({ tileCount }: ITileLayoutStyleProps) => {
5
- root: import("@emotion/utils").SerializedStyles;
6
- tileContainer: import("@emotion/utils").SerializedStyles;
7
- imgDiv: import("@emotion/utils").SerializedStyles;
5
+ root: import("@emotion/react").SerializedStyles;
6
+ tileContainer: import("@emotion/react").SerializedStyles;
7
+ imgDiv: import("@emotion/react").SerializedStyles;
8
8
  };
9
9
  export default makeTileLayoutStyling;
@@ -3,9 +3,9 @@ interface ICardStylingProps {
3
3
  selected: boolean;
4
4
  outlined?: boolean;
5
5
  }
6
- declare const makeCardButtonStyling: ({ isError, selected, outlined, }: ICardStylingProps) => import("@emotion/utils").SerializedStyles;
6
+ declare const makeCardButtonStyling: ({ isError, selected, outlined, }: ICardStylingProps) => import("@emotion/react").SerializedStyles;
7
7
  interface ICardStylingOverlayProps {
8
8
  selected: boolean;
9
9
  }
10
- export declare const makeCardButtonSelectedOverlayStyling: ({ selected, }: ICardStylingOverlayProps) => import("@emotion/utils").SerializedStyles;
10
+ export declare const makeCardButtonSelectedOverlayStyling: ({ selected, }: ICardStylingOverlayProps) => import("@emotion/react").SerializedStyles;
11
11
  export default makeCardButtonStyling;
@@ -1,5 +1,5 @@
1
1
  declare const makeFormControlStyles: ({ isAutoFilledActive, isSafari, }: {
2
2
  isAutoFilledActive: boolean;
3
3
  isSafari: boolean;
4
- }) => import("@emotion/utils").SerializedStyles;
4
+ }) => import("@emotion/react").SerializedStyles;
5
5
  export default makeFormControlStyles;
@@ -6,9 +6,9 @@ interface IInputStyleProps {
6
6
  error: boolean;
7
7
  }
8
8
  declare const makeInputStyles: ({ isAnswered, isOtherOption, isSafari, isAutoFilledActive, error, }: IInputStyleProps) => {
9
- input: import("@emotion/utils").SerializedStyles;
10
- validationIcon: import("@emotion/utils").SerializedStyles;
11
- adornmentEnd: import("@emotion/utils").SerializedStyles;
12
- adornmentStart: import("@emotion/utils").SerializedStyles;
9
+ input: import("@emotion/react").SerializedStyles;
10
+ validationIcon: import("@emotion/react").SerializedStyles;
11
+ adornmentEnd: import("@emotion/react").SerializedStyles;
12
+ adornmentStart: import("@emotion/react").SerializedStyles;
13
13
  };
14
14
  export default makeInputStyles;
@@ -1,5 +1,5 @@
1
1
  interface IInputStyleProps {
2
2
  isAnswered?: boolean;
3
3
  }
4
- declare const makeInputLabelStyles: ({ isAnswered }: IInputStyleProps) => import("@emotion/utils").SerializedStyles;
4
+ declare const makeInputLabelStyles: ({ isAnswered }: IInputStyleProps) => import("@emotion/react").SerializedStyles;
5
5
  export default makeInputLabelStyles;
@@ -1,5 +1,5 @@
1
1
  interface IStyleProps {
2
2
  variant: 'header' | 'summary' | 'note' | 'question' | 'text' | 'footer' | 'listItem' | 'tileItem' | 'contentWithList' | 'tickedList';
3
3
  }
4
- declare const makeTextStyling: ({ variant }: IStyleProps) => import("@emotion/utils").SerializedStyles;
4
+ declare const makeTextStyling: ({ variant }: IStyleProps) => import("@emotion/react").SerializedStyles;
5
5
  export default makeTextStyling;
@@ -1,13 +1,13 @@
1
- export declare const getPlaceholderStyles: (isTextCentered: boolean, isIconPresent: boolean) => import("@emotion/utils").SerializedStyles;
1
+ export declare const getPlaceholderStyles: (isTextCentered: boolean, isIconPresent: boolean) => import("@emotion/react").SerializedStyles;
2
2
  declare const makeCheckBoxStyling: () => {
3
- checkbox: import("@emotion/utils").SerializedStyles;
4
- checkboxContainerRight: import("@emotion/utils").SerializedStyles;
5
- grid: import("@emotion/utils").SerializedStyles;
6
- centerIcon: import("@emotion/utils").SerializedStyles;
7
- leftIcon: import("@emotion/utils").SerializedStyles;
8
- imgDiv: import("@emotion/utils").SerializedStyles;
9
- innerGrid: import("@emotion/utils").SerializedStyles;
10
- textGrid: import("@emotion/utils").SerializedStyles;
11
- otherInput: import("@emotion/utils").SerializedStyles;
3
+ checkbox: import("@emotion/react").SerializedStyles;
4
+ checkboxContainerRight: import("@emotion/react").SerializedStyles;
5
+ grid: import("@emotion/react").SerializedStyles;
6
+ centerIcon: import("@emotion/react").SerializedStyles;
7
+ leftIcon: import("@emotion/react").SerializedStyles;
8
+ imgDiv: import("@emotion/react").SerializedStyles;
9
+ innerGrid: import("@emotion/react").SerializedStyles;
10
+ textGrid: import("@emotion/react").SerializedStyles;
11
+ otherInput: import("@emotion/react").SerializedStyles;
12
12
  };
13
13
  export default makeCheckBoxStyling;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mvf/external-components",
3
- "version": "3.16.0",
3
+ "version": "3.16.2-dev.0",
4
4
  "license": "UNLICENSED",
5
5
  "scripts": {
6
6
  "dev": "scripts/up.sh",
@@ -12,7 +12,10 @@
12
12
  "lint:fix": "npm run lint -- --fix"
13
13
  },
14
14
  "devDependencies": {
15
- "@babel/core": "^7.22.0",
15
+ "@babel/core": "^7.26.9",
16
+ "@babel/preset-env": "^7.26.9",
17
+ "@babel/preset-react": "^7.26.3",
18
+ "@babel/preset-typescript": "^7.26.0",
16
19
  "@mui/codemod": "^5.14.11",
17
20
  "@mvf/eslint-config-mvf-typescript-react": "^1.0.2",
18
21
  "@storybook/addon-actions": "^6.5.16",
@@ -25,14 +28,14 @@
25
28
  "@testing-library/jest-dom": "^5.14.1",
26
29
  "@testing-library/react": "^12.0.0",
27
30
  "@testing-library/user-event": "^13.2.1",
28
- "@types/intl-tel-input": "^17.0.4",
29
- "@types/jest": "^29.5.11",
31
+ "@types/jest": "^27.0.4",
30
32
  "@types/lodash": "^4.14.171",
31
33
  "@types/node": "^16.4.5",
32
34
  "@types/react": "^17.0.15",
33
35
  "@types/react-dom": "^17.0.9",
34
36
  "@typescript-eslint/eslint-plugin": "^5.29.0",
35
37
  "@typescript-eslint/parser": "^5.0.0",
38
+ "babel-jest": "^29.7.0",
36
39
  "babel-loader": "^8.3.0",
37
40
  "eslint": "^8.18.0",
38
41
  "eslint-config-airbnb-typescript": "^17.0.0",
@@ -60,7 +63,7 @@
60
63
  "@mui/styles": "^5.14.11",
61
64
  "@mui/x-date-pickers": "^6.16.2",
62
65
  "date-fns": "^2.29.3",
63
- "intl-tel-input": "^17.0.16",
66
+ "intl-tel-input": "25.3.0",
64
67
  "lodash": "^4.17.21",
65
68
  "react": "^17.0.2",
66
69
  "react-dom": "^17.0.2"
@@ -1,44 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
7
- var user_event_1 = __importDefault(require("@testing-library/user-event"));
8
- var renderWithProviders_1 = __importDefault(require("../../../Helpers/React/renderWithProviders"));
9
- var PhoneNumberTextField_1 = __importDefault(require("./PhoneNumberTextField"));
10
- describe('PhoneNumberTextField', function () {
11
- it('should display PhoneNumberTextField Component', function () {
12
- var getByText = (0, renderWithProviders_1.default)((0, jsx_runtime_1.jsx)(PhoneNumberTextField_1.default, { label: "Question", id: "phone-input" })).getByText;
13
- expect(getByText('Question')).toBeTruthy();
14
- });
15
- it('should be able to input values', function () {
16
- var getByRole = (0, renderWithProviders_1.default)((0, jsx_runtime_1.jsx)(PhoneNumberTextField_1.default, { label: "Zipcode", id: "phone-input" })).getByRole;
17
- user_event_1.default.type(getByRole('textbox'), '90210');
18
- expect(getByRole('textbox')).toHaveValue('90210');
19
- });
20
- it('should have an input type of tel by default', function () {
21
- var _a;
22
- var container = (0, renderWithProviders_1.default)((0, jsx_runtime_1.jsx)(PhoneNumberTextField_1.default, { label: "Phone", id: "phone-input" })).container;
23
- expect((_a = container.querySelector('input')) === null || _a === void 0 ? void 0 : _a.type).toEqual('tel');
24
- });
25
- it('should pass text input type through', function () {
26
- var _a;
27
- var container = (0, renderWithProviders_1.default)((0, jsx_runtime_1.jsx)(PhoneNumberTextField_1.default, { label: "Phone?", id: "phone-input", type: "text" })).container;
28
- expect((_a = container.querySelector('input')) === null || _a === void 0 ? void 0 : _a.type).toEqual('text');
29
- });
30
- it('should display validity icon on error', function () {
31
- var getByTestId = (0, renderWithProviders_1.default)((0, jsx_runtime_1.jsx)(PhoneNumberTextField_1.default, { label: "Phone", id: "phone-input", type: "none", errorMessage: "test error message" })).getByTestId;
32
- expect(getByTestId('endAdornment-invalid')).toBeTruthy();
33
- });
34
- it('should display validity icon on validation success', function () {
35
- var getByTestId = (0, renderWithProviders_1.default)((0, jsx_runtime_1.jsx)(PhoneNumberTextField_1.default, { label: "Phone", id: "phone-input", type: "none", isAnswered: true })).getByTestId;
36
- expect(getByTestId('endAdornment-valid')).toBeTruthy();
37
- });
38
- it('should display error icon on validation success and error message', function () {
39
- var _a = (0, renderWithProviders_1.default)((0, jsx_runtime_1.jsx)(PhoneNumberTextField_1.default, { label: "Phone", id: "phone-input", type: "none", isAnswered: true, errorMessage: "test error message" })), getByTestId = _a.getByTestId, queryByTestId = _a.queryByTestId;
40
- expect(getByTestId('endAdornment-invalid')).toBeTruthy();
41
- expect(queryByTestId('endAdornment-valid')).not.toBeTruthy();
42
- });
43
- });
44
- //# sourceMappingURL=PhoneNumberTextField.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PhoneNumberTextField.test.js","sourceRoot":"","sources":["../../../../src/Components/Molecules/PhoneNumberTextField/PhoneNumberTextField.test.tsx"],"names":[],"mappings":";;;;;;AAAA,2EAAoD;AACpD,mGAA6E;AAC7E,gFAA0D;AAE1D,QAAQ,CAAC,sBAAsB,EAAE;IAC/B,EAAE,CAAC,+CAA+C,EAAE;QAC1C,IAAA,SAAS,GAAK,IAAA,6BAAmB,EACvC,uBAAC,8BAAoB,IAAC,KAAK,EAAC,UAAU,EAAC,EAAE,EAAC,aAAa,GAAG,CAC3D,UAFgB,CAEf;QACF,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gCAAgC,EAAE;QAC3B,IAAA,SAAS,GAAK,IAAA,6BAAmB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