@mychoice/mychoice-sdk-components 1.0.1 → 2.0.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 (81) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/components/buttons/interfaces.d.ts +6 -6
  3. package/dist/cjs/components/headers/interfaces.d.ts +2 -2
  4. package/dist/cjs/components/icons/IconArrow.d.ts +3 -0
  5. package/dist/cjs/components/icons/IconClock.d.ts +3 -0
  6. package/dist/cjs/components/icons/IconDropdownArrow.d.ts +3 -0
  7. package/dist/cjs/components/icons/IconTabArrow.d.ts +3 -0
  8. package/dist/cjs/components/icons/index.d.ts +1 -0
  9. package/dist/cjs/components/inputs/interfaces.d.ts +4 -3
  10. package/dist/cjs/components/messages/interfaces.d.ts +1 -1
  11. package/dist/cjs/components/navigations/Step/Step.d.ts +1 -0
  12. package/dist/cjs/components/navigations/Step/index.d.ts +1 -1
  13. package/dist/cjs/components/navigations/interfaces.d.ts +5 -2
  14. package/dist/cjs/components/quotes/BrokerLink/BrokerLink.d.ts +3 -0
  15. package/dist/cjs/components/quotes/BrokerLink/index.d.ts +1 -0
  16. package/dist/cjs/components/quotes/interfaces.d.ts +7 -7
  17. package/dist/cjs/components/selects/interfaces.d.ts +1 -1
  18. package/dist/cjs/components/titles/interfaces.d.ts +1 -1
  19. package/dist/cjs/components/tooltips/interfaces.d.ts +4 -2
  20. package/dist/cjs/constants/api.d.ts +4 -0
  21. package/dist/cjs/constants/application.d.ts +5 -2
  22. package/dist/cjs/constants/device.d.ts +2 -1
  23. package/dist/cjs/constants/insurances/home/pages/address.d.ts +2 -6
  24. package/dist/cjs/constants/insurances/home/pages/applicant.d.ts +4 -4
  25. package/dist/cjs/constants/insurances/home/pages/property.d.ts +26 -2
  26. package/dist/cjs/constants/insurances/index.d.ts +1 -0
  27. package/dist/cjs/constants/insurances/life/index.d.ts +1 -0
  28. package/dist/cjs/constants/insurances/life/pages/coverage.d.ts +12 -0
  29. package/dist/cjs/constants/insurances/life/pages/index.d.ts +1 -0
  30. package/dist/cjs/constants/insurances/shared/index.d.ts +1 -0
  31. package/dist/cjs/constants/insurances/shared/options.d.ts +1 -1
  32. package/dist/cjs/constants/insurances/shared/postal.d.ts +1 -0
  33. package/dist/cjs/constants/modals.d.ts +1 -0
  34. package/dist/cjs/helpers/main.d.ts +11 -0
  35. package/dist/cjs/index.js +302 -97
  36. package/dist/cjs/index.js.map +1 -1
  37. package/dist/cjs/interfaces/general.d.ts +7 -7
  38. package/dist/cjs/interfaces/inputs.d.ts +6 -3
  39. package/dist/cjs/utils/InputValueReducer/interfaces.d.ts +1 -5
  40. package/dist/esm/components/buttons/interfaces.d.ts +6 -6
  41. package/dist/esm/components/headers/interfaces.d.ts +2 -2
  42. package/dist/esm/components/icons/IconArrow.d.ts +3 -0
  43. package/dist/esm/components/icons/IconClock.d.ts +3 -0
  44. package/dist/esm/components/icons/IconDropdownArrow.d.ts +3 -0
  45. package/dist/esm/components/icons/IconTabArrow.d.ts +3 -0
  46. package/dist/esm/components/icons/index.d.ts +1 -0
  47. package/dist/esm/components/inputs/interfaces.d.ts +4 -3
  48. package/dist/esm/components/messages/interfaces.d.ts +1 -1
  49. package/dist/esm/components/navigations/Step/Step.d.ts +1 -0
  50. package/dist/esm/components/navigations/Step/index.d.ts +1 -1
  51. package/dist/esm/components/navigations/interfaces.d.ts +5 -2
  52. package/dist/esm/components/quotes/BrokerLink/BrokerLink.d.ts +3 -0
  53. package/dist/esm/components/quotes/BrokerLink/index.d.ts +1 -0
  54. package/dist/esm/components/quotes/interfaces.d.ts +7 -7
  55. package/dist/esm/components/selects/interfaces.d.ts +1 -1
  56. package/dist/esm/components/titles/interfaces.d.ts +1 -1
  57. package/dist/esm/components/tooltips/interfaces.d.ts +4 -2
  58. package/dist/esm/constants/api.d.ts +4 -0
  59. package/dist/esm/constants/application.d.ts +5 -2
  60. package/dist/esm/constants/device.d.ts +2 -1
  61. package/dist/esm/constants/insurances/home/pages/address.d.ts +2 -6
  62. package/dist/esm/constants/insurances/home/pages/applicant.d.ts +4 -4
  63. package/dist/esm/constants/insurances/home/pages/property.d.ts +26 -2
  64. package/dist/esm/constants/insurances/index.d.ts +1 -0
  65. package/dist/esm/constants/insurances/life/index.d.ts +1 -0
  66. package/dist/esm/constants/insurances/life/pages/coverage.d.ts +12 -0
  67. package/dist/esm/constants/insurances/life/pages/index.d.ts +1 -0
  68. package/dist/esm/constants/insurances/shared/index.d.ts +1 -0
  69. package/dist/esm/constants/insurances/shared/options.d.ts +1 -1
  70. package/dist/esm/constants/insurances/shared/postal.d.ts +1 -0
  71. package/dist/esm/constants/modals.d.ts +1 -0
  72. package/dist/esm/helpers/main.d.ts +11 -0
  73. package/dist/esm/index.js +279 -95
  74. package/dist/esm/index.js.map +1 -1
  75. package/dist/esm/interfaces/general.d.ts +7 -7
  76. package/dist/esm/interfaces/inputs.d.ts +6 -3
  77. package/dist/esm/utils/InputValueReducer/interfaces.d.ts +1 -5
  78. package/dist/index.d.ts +167 -105
  79. package/package.json +3 -3
  80. package/dist/cjs/components/icons/loaders/IconLoaderVideo.d.ts +0 -5
  81. package/dist/esm/components/icons/loaders/IconLoaderVideo.d.ts +0 -5
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
- # `@mychoice/mychoice-sdk-components`
1
+ # `@groksmith/mychoice-sdk-components`
2
2
 
3
3
  > TODO: description
4
4
 
5
5
  ## Usage
6
6
 
7
7
  ```
8
- const mychoiceSdkComponents = require('@mychoice/mychoice-sdk-components');
8
+ const mychoiceSdkComponents = require('@groksmith/mychoice-sdk-components');
9
9
 
10
10
  // TODO: DEMONSTRATE API
11
11
  ```
@@ -1,6 +1,6 @@
1
1
  import { MouseEventHandler, ReactElement } from 'react';
2
2
  import { SizeTypes, ButtonTypes, ButtonVariantTypes, CategoryTypes, ColorTypes, DirectionTypes } from '../../constants';
3
- export declare type ButtonBaseProps = {
3
+ export type ButtonBaseProps = {
4
4
  label?: string;
5
5
  category?: CategoryTypes;
6
6
  color?: ColorTypes;
@@ -11,25 +11,25 @@ export declare type ButtonBaseProps = {
11
11
  type?: ButtonTypes;
12
12
  onClick?: () => void;
13
13
  };
14
- export declare type ButtonArrowProps = ButtonBaseProps & {
14
+ export type ButtonArrowProps = ButtonBaseProps & {
15
15
  direction?: DirectionTypes;
16
16
  };
17
- export declare type ButtonTabArrowProps = {
17
+ export type ButtonTabArrowProps = {
18
18
  className?: string;
19
19
  onClick?: () => void;
20
20
  direction?: DirectionTypes;
21
21
  };
22
- export declare type ButtonMenuProps = {
22
+ export type ButtonMenuProps = {
23
23
  className?: string;
24
24
  onClick?: () => void;
25
25
  };
26
- export declare type ButtonFormProps = {
26
+ export type ButtonFormProps = {
27
27
  className?: string;
28
28
  selected?: boolean;
29
29
  onClick?: () => void;
30
30
  label?: string;
31
31
  };
32
- export declare type NavigationTabProps = {
32
+ export type NavigationTabProps = {
33
33
  className?: string;
34
34
  selfDelete?: boolean;
35
35
  iconClick?: MouseEventHandler<SVGSVGElement | HTMLButtonElement>;
@@ -2,11 +2,11 @@ export interface NavItemInterface {
2
2
  name: string;
3
3
  link: string;
4
4
  }
5
- export declare type HeaderNavGroupProps = {
5
+ export type HeaderNavGroupProps = {
6
6
  className?: string;
7
7
  navItems: NavItemInterface[];
8
8
  isExternal?: boolean;
9
9
  };
10
- export declare type HeaderDropDownProps = HeaderNavGroupProps & {
10
+ export type HeaderDropDownProps = HeaderNavGroupProps & {
11
11
  name: string;
12
12
  };
@@ -0,0 +1,3 @@
1
+ import { SdkFC } from '../../interfaces';
2
+ import { IconPropsInterface } from './interfaces';
3
+ export declare const IconArrow: SdkFC<IconPropsInterface>;
@@ -0,0 +1,3 @@
1
+ import { IconPropsInterface } from './interfaces';
2
+ import { SdkFC } from '../../interfaces';
3
+ export declare const IconClock: SdkFC<IconPropsInterface>;
@@ -0,0 +1,3 @@
1
+ import { IconPropsInterface } from './interfaces';
2
+ import { SdkFC } from '../../interfaces';
3
+ export declare const IconDropdownArrow: SdkFC<IconPropsInterface>;
@@ -0,0 +1,3 @@
1
+ import { SdkFC } from '../../interfaces';
2
+ import { IconPropsInterface } from './interfaces';
3
+ export declare const IconTabArrow: SdkFC<IconPropsInterface>;
@@ -6,3 +6,4 @@ export { IconTooltip } from './IconTooltip';
6
6
  export { IconSuccess } from './IconSuccess';
7
7
  export { IconChecked } from './IconChecked';
8
8
  export { IconDecline } from './IconDecline';
9
+ export { IconClock } from './IconClock';
@@ -1,11 +1,12 @@
1
1
  import { InputTypes, SizeTypes, ValidationStatusTypes } from '../../constants';
2
2
  import { DefaultInputProps, OnChangeEventInterface } from '../../interfaces';
3
- export declare type InputProps = DefaultInputProps & {
3
+ export type InputProps = DefaultInputProps & {
4
4
  size?: SizeTypes;
5
5
  type?: InputTypes;
6
6
  onChange?: (option: OnChangeEventInterface) => void;
7
+ manipulateInput?: (value: string) => string;
7
8
  };
8
- export declare type CheckboxProps = {
9
+ export type CheckboxProps = {
9
10
  className?: string;
10
11
  name: string;
11
12
  label?: string;
@@ -13,7 +14,7 @@ export declare type CheckboxProps = {
13
14
  onChange?: (option: OnChangeEventInterface) => void;
14
15
  disabled?: boolean;
15
16
  };
16
- export declare type EmailInputProps = DefaultInputProps & {
17
+ export type EmailInputProps = DefaultInputProps & {
17
18
  validationStatus?: ValidationStatusTypes;
18
19
  onChange?: (option: OnChangeEventInterface) => void;
19
20
  };
@@ -1,4 +1,4 @@
1
- export declare type MessageProps = {
1
+ export type MessageProps = {
2
2
  className?: string;
3
3
  isRemovable?: boolean;
4
4
  onIconClick?: () => void;
@@ -1,3 +1,4 @@
1
1
  import { SdkFC } from '../../../interfaces';
2
2
  import { StepProps } from '../interfaces';
3
3
  export declare const Step: SdkFC<StepProps>;
4
+ export declare const MychoiceStep: SdkFC<StepProps>;
@@ -1 +1 @@
1
- export { Step } from './Step';
1
+ export { Step, MychoiceStep } from './Step';
@@ -4,22 +4,25 @@ export interface NavigationItemInterface {
4
4
  name?: string;
5
5
  icon?: SdkElement;
6
6
  title?: string;
7
+ mychoiceTitle?: string;
7
8
  key?: number;
8
9
  }
9
10
  export interface ValidationOptionsInterface {
10
11
  validate: (isRedirect?: boolean) => boolean;
11
12
  isValid: boolean;
13
+ requestFn?: () => Promise<void>;
12
14
  }
13
15
  export interface ValidationHookInterface {
14
16
  path?: string;
15
17
  name?: string;
16
18
  validateOptions: ValidationOptionsInterface;
19
+ requestFn?: () => Promise<void>;
17
20
  key?: number;
18
21
  }
19
- export declare type StepProps = {
22
+ export type StepProps = {
20
23
  item?: NavigationItemInterface;
21
24
  itemsCount?: number;
22
- index?: number;
25
+ index: number;
23
26
  className?: string;
24
27
  isMobile?: boolean;
25
28
  };
@@ -0,0 +1,3 @@
1
+ import { SdkFC } from '../../../interfaces';
2
+ import { BrokerLinkProps } from '../interfaces';
3
+ export declare const BrokerLink: SdkFC<BrokerLinkProps>;
@@ -0,0 +1 @@
1
+ export { BrokerLink } from './BrokerLink';
@@ -1,4 +1,4 @@
1
- export declare type OfferHeaderProps = {
1
+ export type OfferHeaderProps = {
2
2
  className?: string;
3
3
  companyName?: string;
4
4
  isBestOffer?: boolean;
@@ -8,30 +8,30 @@ export interface PriceInterface {
8
8
  monthly?: number | string;
9
9
  yearly?: number | string;
10
10
  }
11
- export declare type OfferPriceProps = {
11
+ export type OfferPriceProps = {
12
12
  className?: string;
13
13
  companyLogo?: string;
14
14
  price?: PriceInterface;
15
15
  };
16
- export declare type OfferDetailTitleProps = {
16
+ export type OfferDetailTitleProps = {
17
17
  className?: string;
18
18
  name?: string;
19
19
  title?: string;
20
20
  companyType?: string;
21
21
  };
22
- export declare type OfferDetailInfoProps = {
22
+ export type OfferDetailInfoProps = {
23
23
  className?: string;
24
24
  logo?: string;
25
25
  description?: string;
26
26
  };
27
- export declare type OfferDetailProps = OfferDetailTitleProps & OfferDetailInfoProps;
28
- export declare type OperationHoursInfoProps = {
27
+ export type OfferDetailProps = OfferDetailTitleProps & OfferDetailInfoProps;
28
+ export type OperationHoursInfoProps = {
29
29
  className?: string;
30
30
  weekdayHours?: string;
31
31
  saturdayHours?: string;
32
32
  sundayHours?: string;
33
33
  };
34
- export declare type QuoteEditProps = {
34
+ export type QuoteEditProps = {
35
35
  className?: string;
36
36
  editClick?: ((index: number) => () => void);
37
37
  title?: string;
@@ -1,6 +1,6 @@
1
1
  import { DefaultInputProps, OnChangeEventInterface, SelectOptionGroupInterface, SelectOptionInterface } from '../../interfaces';
2
2
  import { SizeTypes } from '../../constants';
3
- export declare type SelectProps = DefaultInputProps & {
3
+ export type SelectProps = DefaultInputProps & {
4
4
  size?: SizeTypes;
5
5
  autoSelectIfValueIsOutOfOptions?: boolean;
6
6
  onChange?: (option: OnChangeEventInterface) => void;
@@ -1,4 +1,4 @@
1
- export declare type TitleProps = {
1
+ export type TitleProps = {
2
2
  title: string;
3
3
  subTitle?: string;
4
4
  className?: string;
@@ -1,4 +1,6 @@
1
- export declare type TooltipProps = {
1
+ import { SdkElement } from '../../interfaces';
2
+ export type TooltipProps = {
2
3
  id?: string;
3
- description?: string;
4
+ description?: string | SdkElement;
5
+ color?: string;
4
6
  };
@@ -25,6 +25,10 @@ export declare const API_FORM_CAR: {
25
25
  };
26
26
  export declare const API_FORM_HOME: {
27
27
  GET_POSTAL: string;
28
+ GET_PLACE: string;
29
+ POST_QUOTE_DATA: string;
30
+ };
31
+ export declare const API_FORM_LIFE: {
28
32
  POST_QUOTE_DATA: string;
29
33
  };
30
34
  export declare enum HttpRequestHeaderTypes {
@@ -5,8 +5,11 @@ export declare enum AppTypes {
5
5
  }
6
6
  export declare enum InsuranceTypes {
7
7
  Car = "car",
8
- Life = "life",
9
- Home = "home"
8
+ Home = "home",
9
+ Condo = "condo",
10
+ Tenant = "tenant",
11
+ Life = "life"
10
12
  }
11
13
  export declare const defaultLocalIndex = "insurance";
12
14
  export declare const MAX_LOCAL_STORAGE_HOURS = 168;
15
+ export declare const MAX_LOCAL_STORAGE_HOURS_THEBIG = 8;
@@ -1,6 +1,7 @@
1
1
  export declare enum DeviceTypes {
2
2
  Desktop = "desktop",
3
- Mobile = "mobile"
3
+ Mobile = "mobile",
4
+ Tablet = "tablet"
4
5
  }
5
6
  export declare const DeviceTypeWidthList: {
6
7
  type: DeviceTypes;
@@ -1,10 +1,6 @@
1
- export declare enum HomeOwnerTypes {
2
- Home = "home",
3
- Condo = "condo",
4
- Tenant = "tenant"
5
- }
1
+ import { InsuranceTypes } from '../../../application';
6
2
  export declare const homeOwnerTypeOptions: {
7
- value: string;
3
+ value: InsuranceTypes;
8
4
  name: string;
9
5
  }[];
10
6
  export declare const comprehensiveCoverages: {
@@ -6,11 +6,11 @@ export declare const insuredYearsOptions: {
6
6
  value: string;
7
7
  name: string;
8
8
  }[];
9
+ export declare enum ApplicantListTypes {
10
+ InsuranceCancellation = "insuranceCancellationList",
11
+ InsuranceClaim = "insuranceClaimList"
12
+ }
9
13
  export declare const claimTypeOptions: {
10
14
  value: string;
11
15
  name: string;
12
16
  }[];
13
- export declare enum ApplicantListTypes {
14
- InsuranceCancellation = "insuranceCancellationList",
15
- InsuranceClaim = "InsuranceClaimList"
16
- }
@@ -16,7 +16,15 @@ export declare const garageTypeOptions: {
16
16
  value: string;
17
17
  name: string;
18
18
  }[];
19
- export declare const buildingStructureOptions: {
19
+ export declare const homeBuildingStructureOptions: {
20
+ value: string;
21
+ name: string;
22
+ }[];
23
+ export declare const condoBuildingStructureOptions: {
24
+ value: string;
25
+ name: string;
26
+ }[];
27
+ export declare const tenantBuildingStructureOptions: {
20
28
  value: string;
21
29
  name: string;
22
30
  }[];
@@ -28,7 +36,23 @@ export declare const fireHydrantDistanceOptions: {
28
36
  value: string;
29
37
  name: string;
30
38
  }[];
31
- export declare const heatingTypeOptions: {
39
+ export declare const primaryHeatingTypeOptions: {
40
+ value: string;
41
+ name: string;
42
+ }[];
43
+ export declare const auxHeatingTypeOptions: {
32
44
  value: string;
33
45
  name: string;
34
46
  }[];
47
+ export declare const homeCoverageOptions: {
48
+ name: string;
49
+ value: string;
50
+ }[];
51
+ export declare const homeLiabilityOptions: {
52
+ name: string;
53
+ value: string;
54
+ }[];
55
+ export declare const ppOptions: {
56
+ name: string;
57
+ value: string;
58
+ }[];
@@ -1,3 +1,4 @@
1
1
  export * from './car';
2
2
  export * from './home';
3
+ export * from './life';
3
4
  export * from './shared';
@@ -0,0 +1 @@
1
+ export * from './pages';
@@ -0,0 +1,12 @@
1
+ export declare const lifeProvinceOptions: {
2
+ value: string;
3
+ name: string;
4
+ }[];
5
+ export declare const lifeInsuranceTypeOptions: {
6
+ value: string;
7
+ name: string;
8
+ }[];
9
+ export declare const lifeCoverageOptions: {
10
+ value: string;
11
+ name: string;
12
+ }[];
@@ -0,0 +1 @@
1
+ export * from './coverage';
@@ -1 +1,2 @@
1
1
  export * from './options';
2
+ export * from './postal';
@@ -2,7 +2,7 @@ export declare const yesNoOptions: {
2
2
  name: string;
3
3
  value: boolean;
4
4
  }[];
5
- export declare const yesNoOptionsTemporary: {
5
+ export declare const smokerOptions: {
6
6
  name: string;
7
7
  value: boolean;
8
8
  }[];
@@ -0,0 +1 @@
1
+ export declare const supportedProvinceCodes: string[];
@@ -2,5 +2,6 @@ export declare enum ModalTypes {
2
2
  MessageModal = "MessageModal",
3
3
  ConfirmModal = "ConfirmModal",
4
4
  PostalModal = "PostalModal",
5
+ AddressModal = "AddressModal",
5
6
  FinaleModal = "FinaleModal"
6
7
  }
@@ -1,5 +1,16 @@
1
1
  import { SelectOptionInterface } from '../interfaces';
2
+ import { DriverLicenceTypes, InsuranceTypes } from '../constants';
2
3
  export declare const getNumericOptions: (start: number, end: number, suffix?: string) => SelectOptionInterface[];
3
4
  export declare const formatPostalCode: (str?: string) => string;
4
5
  export declare const postalCodeFormat: (postalCode?: string) => string;
5
6
  export declare const numberWithCommas: (value: number) => string;
7
+ export declare const getLicenceTypeOptions: (options: SelectOptionInterface[], optionValues: string[], disabled: boolean) => SelectOptionInterface[];
8
+ export declare const checkDateIsSpecial: (defaultMinDate: string, specialDate: string) => boolean;
9
+ export declare const getLicenceMinDate: (licenceType: DriverLicenceTypes, defaultMinDate: string, config: any) => string;
10
+ export declare const getLicenceMaxDate: (licenceType: DriverLicenceTypes, minDate: string, config: any) => string;
11
+ export declare const getDisabledLicenceTypes: (gBlock: boolean, g2Block: boolean, g1Block: boolean) => string[];
12
+ export declare const getInsuranceYearsOptions: (maxValue: string) => {
13
+ value: string;
14
+ name: string;
15
+ }[];
16
+ export declare const getInsuranceType: () => InsuranceTypes;