@alma/widgets 3.4.0 → 4.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 (101) hide show
  1. package/README.md +1 -1
  2. package/dist/types/{Widgets → src/Widgets}/EligibilityModal/DesktopModal/index.d.ts +9 -9
  3. package/dist/types/{Widgets → src/Widgets}/EligibilityModal/MobileModal/index.d.ts +9 -9
  4. package/dist/types/{Widgets → src/Widgets}/EligibilityModal/ModalContainer.d.ts +16 -16
  5. package/dist/types/{Widgets → src/Widgets}/EligibilityModal/ModalContainer.test.d.ts +1 -1
  6. package/dist/types/{Widgets/PaymentPlans → src/Widgets/EligibilityModal}/__tests__/Basics.test.d.ts +1 -1
  7. package/dist/types/{Widgets → src/Widgets}/EligibilityModal/__tests__/Cards.test.d.ts +1 -1
  8. package/dist/types/{Widgets → src/Widgets}/EligibilityModal/__tests__/ModalContainer.test.d.ts +1 -1
  9. package/dist/types/{Widgets → src/Widgets}/EligibilityModal/__tests__/Plans.test.d.ts +1 -1
  10. package/dist/types/{Widgets → src/Widgets}/EligibilityModal/__tests__/Schedule.test.d.ts +1 -1
  11. package/dist/types/{Widgets → src/Widgets}/EligibilityModal/classNames.const.d.ts +23 -23
  12. package/dist/types/src/Widgets/EligibilityModal/components/Cards/index.d.ts +7 -0
  13. package/dist/types/{Widgets → src/Widgets}/EligibilityModal/components/EligibilityPlansButtons/index.d.ts +8 -8
  14. package/dist/types/{Widgets → src/Widgets}/EligibilityModal/components/Info/index.d.ts +5 -5
  15. package/dist/types/src/Widgets/EligibilityModal/components/Schedule/index.d.ts +6 -0
  16. package/dist/types/{Widgets → src/Widgets}/EligibilityModal/components/Title/index.d.ts +6 -6
  17. package/dist/types/{Widgets → src/Widgets}/EligibilityModal/index.d.ts +11 -11
  18. package/dist/types/{Widgets/EligibilityModal → src/Widgets/PaymentPlans}/__tests__/Basics.test.d.ts +1 -1
  19. package/dist/types/{Widgets → src/Widgets}/PaymentPlans/__tests__/Credit.test.d.ts +1 -1
  20. package/dist/types/{Widgets → src/Widgets}/PaymentPlans/__tests__/CustomTransitionDelay.test.d.ts +1 -1
  21. package/dist/types/{Widgets → src/Widgets}/PaymentPlans/__tests__/HideBorder.test.d.ts +1 -1
  22. package/dist/types/{Widgets → src/Widgets}/PaymentPlans/__tests__/HideWidget.test.d.ts +1 -1
  23. package/dist/types/{Widgets → src/Widgets}/PaymentPlans/__tests__/IneligibleOptions.test.d.ts +1 -1
  24. package/dist/types/{Widgets → src/Widgets}/PaymentPlans/__tests__/LanguageCheck.test.d.ts +1 -1
  25. package/dist/types/{Widgets → src/Widgets}/PaymentPlans/__tests__/LaunchModal.test.d.ts +1 -1
  26. package/dist/types/{Widgets → src/Widgets}/PaymentPlans/__tests__/Monochrome.test.d.ts +1 -1
  27. package/dist/types/{Widgets → src/Widgets}/PaymentPlans/__tests__/PaymentPlanContainer.test.d.ts +1 -1
  28. package/dist/types/{Widgets → src/Widgets}/PaymentPlans/__tests__/SuggestedPaymentPlan.test.d.ts +1 -1
  29. package/dist/types/{Widgets → src/Widgets}/PaymentPlans/__tests__/WithoutPlans.test.d.ts +1 -1
  30. package/dist/types/{Widgets → src/Widgets}/PaymentPlans/classNames.const.d.ts +13 -13
  31. package/dist/types/{Widgets → src/Widgets}/PaymentPlans/index.d.ts +18 -18
  32. package/dist/types/{assets → src/assets}/Cross.d.ts +5 -6
  33. package/dist/types/{assets → src/assets}/almaLogo.d.ts +6 -6
  34. package/dist/types/{assets → src/assets}/cards/amex.d.ts +3 -3
  35. package/dist/types/{assets → src/assets}/cards/cb.d.ts +3 -3
  36. package/dist/types/{assets → src/assets}/cards/mastercard.d.ts +3 -3
  37. package/dist/types/{assets → src/assets}/cards/visa.d.ts +3 -3
  38. package/dist/types/{components → src/components}/Installments/Installment/index.d.ts +8 -8
  39. package/dist/types/src/components/Installments/TotalBlock/index.d.ts +6 -0
  40. package/dist/types/src/components/Loader/index.d.ts +5 -0
  41. package/dist/types/src/components/LoadingIndicator/LoadingIndicator.d.ts +4 -0
  42. package/dist/types/{components → src/components}/Modal/index.d.ts +12 -12
  43. package/dist/types/{consts.d.ts → src/consts.d.ts} +6 -6
  44. package/dist/types/{hooks → src/hooks}/useButtonAnimation.d.ts +7 -7
  45. package/dist/types/src/hooks/useFetchEligibility.d.ts +3 -0
  46. package/dist/types/{hooks → src/hooks}/useSessionStorage.d.ts +20 -20
  47. package/dist/types/{hooks → src/hooks}/useSessionStorage.test.d.ts +1 -1
  48. package/dist/types/{index.d.ts → src/index.d.ts} +16 -18
  49. package/dist/types/{intl → src/intl}/IntlProvider.d.ts +8 -8
  50. package/dist/types/src/intl/messages/messages.de.json.d.ts +35 -0
  51. package/dist/types/src/intl/messages/messages.en.json.d.ts +35 -0
  52. package/dist/types/src/intl/messages/messages.es.json.d.ts +35 -0
  53. package/dist/types/src/intl/messages/messages.fr.json.d.ts +35 -0
  54. package/dist/types/src/intl/messages/messages.it.json.d.ts +35 -0
  55. package/dist/types/src/intl/messages/messages.nl.json.d.ts +35 -0
  56. package/dist/types/src/intl/messages/messages.pt.json.d.ts +35 -0
  57. package/dist/types/{intl → src/intl}/utils.d.ts +2 -2
  58. package/dist/types/{types.d.ts → src/types.d.ts} +97 -97
  59. package/dist/types/src/utils/fetch.d.ts +6 -0
  60. package/dist/types/{utils → src/utils}/filterEligibility.d.ts +3 -3
  61. package/dist/types/{utils → src/utils}/index.d.ts +7 -7
  62. package/dist/types/{utils → src/utils}/index.test.d.ts +1 -1
  63. package/dist/types/{utils → src/utils}/merchantOrderPreferences.d.ts +14 -14
  64. package/dist/types/{utils → src/utils}/paymentPlanStrings.d.ts +4 -4
  65. package/dist/types/{utils → src/utils}/utilsForStorage.d.ts +2 -2
  66. package/dist/types/{utils → src/utils}/utilsForStorage.test.d.ts +1 -1
  67. package/dist/types/src/widgets_controller.d.ts +15 -0
  68. package/dist/types/vite.config.d.ts +2 -0
  69. package/dist/widgets-wc.umd.js +55 -1
  70. package/dist/widgets-wc.umd.js.map +1 -0
  71. package/dist/widgets.css +1 -16
  72. package/dist/widgets.js +7332 -1
  73. package/dist/widgets.js.map +1 -1
  74. package/dist/widgets.min.css +1 -0
  75. package/dist/widgets.umd.js +55 -1
  76. package/dist/widgets.umd.js.map +1 -1
  77. package/package.json +14 -8
  78. package/dist/raw/widgets-wc.umd.js +0 -17971
  79. package/dist/raw/widgets.css +0 -577
  80. package/dist/raw/widgets.js +0 -3422
  81. package/dist/raw/widgets.js.map +0 -1
  82. package/dist/raw/widgets.m.js +0 -3426
  83. package/dist/raw/widgets.m.js.map +0 -1
  84. package/dist/raw/widgets.modern.js +0 -3360
  85. package/dist/raw/widgets.modern.js.map +0 -1
  86. package/dist/raw/widgets.umd.js +0 -17971
  87. package/dist/raw/widgets.umd.js.map +0 -1
  88. package/dist/types/Widgets/EligibilityModal/components/Cards/index.d.ts +0 -7
  89. package/dist/types/Widgets/EligibilityModal/components/Schedule/index.d.ts +0 -6
  90. package/dist/types/components/Installments/TotalBlock/index.d.ts +0 -6
  91. package/dist/types/components/Loader/index.d.ts +0 -5
  92. package/dist/types/components/LoadingIndicator/LoadingIndicator.d.ts +0 -4
  93. package/dist/types/hooks/useFetchEligibility.d.ts +0 -3
  94. package/dist/types/setupTests.d.ts +0 -1
  95. package/dist/types/utils/fetch.d.ts +0 -6
  96. package/dist/types/widgets_controller.d.ts +0 -15
  97. package/dist/widgets.m.js +0 -2
  98. package/dist/widgets.m.js.map +0 -1
  99. package/dist/widgets.modern.js +0 -2
  100. package/dist/widgets.modern.js.map +0 -1
  101. /package/dist/{raw/widgets-wc.umd.js.map → types/src/setupTests.d.ts} +0 -0
package/README.md CHANGED
@@ -7,7 +7,7 @@ View all [Changelog](https://github.com/alma/widgets/releases)
7
7
  ## Setup
8
8
 
9
9
  ### Add the widget to your page
10
-
10
+ TODO: remove => Changes to test precommit
11
11
  ##### CSS
12
12
 
13
13
  ```html
@@ -1,9 +1,9 @@
1
- import { FC } from 'react';
2
- import { Card } from 'types';
3
- declare type Props = {
4
- isCurrentPlanP1X: boolean;
5
- isSomePlanDeferred: boolean;
6
- cards?: Card[];
7
- };
8
- declare const DesktopModal: FC<Props>;
9
- export default DesktopModal;
1
+ import { FC, PropsWithChildren } from '../../../../preact/compat';
2
+ import { Card } from '../../../types';
3
+ type Props = {
4
+ isCurrentPlanP1X: boolean;
5
+ isSomePlanDeferred: boolean;
6
+ cards?: Card[];
7
+ } & PropsWithChildren;
8
+ declare const DesktopModal: FC<Props>;
9
+ export default DesktopModal;
@@ -1,9 +1,9 @@
1
- import { FC } from 'react';
2
- import { Card } from 'types';
3
- declare type Props = {
4
- isCurrentPlanP1X: boolean;
5
- isSomePlanDeferred: boolean;
6
- cards?: Card[];
7
- };
8
- declare const MobileModal: FC<Props>;
9
- export default MobileModal;
1
+ import { FC, PropsWithChildren } from '../../../../preact/compat';
2
+ import { Card } from '../../../types';
3
+ type Props = {
4
+ isCurrentPlanP1X: boolean;
5
+ isSomePlanDeferred: boolean;
6
+ cards?: Card[];
7
+ } & PropsWithChildren;
8
+ declare const MobileModal: FC<Props>;
9
+ export default MobileModal;
@@ -1,16 +1,16 @@
1
- import React from 'react';
2
- import { ApiConfig, Card, ConfigPlan } from 'types';
3
- declare type Props = {
4
- purchaseAmount: number;
5
- apiData: ApiConfig;
6
- configPlans?: ConfigPlan[];
7
- customerBillingCountry?: string;
8
- customerShippingCountry?: string;
9
- onClose: (event: React.MouseEvent | React.KeyboardEvent) => void;
10
- cards?: Card[];
11
- };
12
- /**
13
- * This component allows to display only the modal, without PaymentPlans.
14
- */
15
- declare const ModalContainer: React.FC<Props>;
16
- export default ModalContainer;
1
+ import { default as React } from '../../../preact/compat';
2
+ import { ApiConfig, Card, ConfigPlan } from '../../types';
3
+ type Props = {
4
+ purchaseAmount: number;
5
+ apiData: ApiConfig;
6
+ configPlans?: ConfigPlan[];
7
+ customerBillingCountry?: string;
8
+ customerShippingCountry?: string;
9
+ onClose: (event: React.MouseEvent | React.KeyboardEvent) => void;
10
+ cards?: Card[];
11
+ };
12
+ /**
13
+ * This component allows to display only the modal, without PaymentPlans.
14
+ */
15
+ declare const ModalContainer: React.FC<Props>;
16
+ export { ModalContainer };
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,23 +1,23 @@
1
- /**
2
- * Class names for the **eligibility modale** widget.
3
- * Those classes are intended to be used by the **merchant developer**.
4
- */
5
- declare const STATIC_CUSTOMISATION_CLASSES: {
6
- desktopModal: string;
7
- mobileModal: string;
8
- leftSide: string;
9
- bullet: string;
10
- rightSide: string;
11
- title: string;
12
- info: string;
13
- infoMessage: string;
14
- eligibilityOptions: string;
15
- activeOption: string;
16
- closeButton: string;
17
- scheduleDetails: string;
18
- scheduleTotal: string;
19
- scheduleCredit: string;
20
- cardContainer: string;
21
- summary: string;
22
- };
23
- export default STATIC_CUSTOMISATION_CLASSES;
1
+ /**
2
+ * Class names for the **eligibility modale** widget.
3
+ * Those classes are intended to be used by the **merchant developer**.
4
+ */
5
+ declare const STATIC_CUSTOMISATION_CLASSES: {
6
+ desktopModal: string;
7
+ mobileModal: string;
8
+ leftSide: string;
9
+ bullet: string;
10
+ rightSide: string;
11
+ title: string;
12
+ info: string;
13
+ infoMessage: string;
14
+ eligibilityOptions: string;
15
+ activeOption: string;
16
+ closeButton: string;
17
+ scheduleDetails: string;
18
+ scheduleTotal: string;
19
+ scheduleCredit: string;
20
+ cardContainer: string;
21
+ summary: string;
22
+ };
23
+ export default STATIC_CUSTOMISATION_CLASSES;
@@ -0,0 +1,7 @@
1
+ import { FC } from '../../../../../preact/compat';
2
+ import { Card } from '../../../../types';
3
+ type Props = {
4
+ cards: Card[];
5
+ };
6
+ declare const Cards: FC<Props>;
7
+ export default Cards;
@@ -1,8 +1,8 @@
1
- import { FC } from 'react';
2
- import { EligibilityPlan } from 'types';
3
- declare const EligibilityPlansButtons: FC<{
4
- eligibilityPlans: EligibilityPlan[];
5
- currentPlanIndex: number;
6
- setCurrentPlanIndex: (index: number) => void;
7
- }>;
8
- export default EligibilityPlansButtons;
1
+ import { FC } from '../../../../../preact/compat';
2
+ import { EligibilityPlan } from '../../../../types';
3
+ declare const EligibilityPlansButtons: FC<{
4
+ eligibilityPlans: EligibilityPlan[];
5
+ currentPlanIndex: number;
6
+ setCurrentPlanIndex: (index: number) => void;
7
+ }>;
8
+ export default EligibilityPlansButtons;
@@ -1,5 +1,5 @@
1
- import { FC } from 'react';
2
- declare const Info: FC<{
3
- isCurrentPlanP1X: boolean;
4
- }>;
5
- export default Info;
1
+ import { FC } from '../../../../../preact/compat';
2
+ declare const Info: FC<{
3
+ isCurrentPlanP1X: boolean;
4
+ }>;
5
+ export default Info;
@@ -0,0 +1,6 @@
1
+ import { FC } from '../../../../../preact/compat';
2
+ import { EligibilityPlan } from '../../../../types';
3
+ declare const Schedule: FC<{
4
+ currentPlan: EligibilityPlan;
5
+ }>;
6
+ export default Schedule;
@@ -1,6 +1,6 @@
1
- import { FC } from 'react';
2
- declare const Title: FC<{
3
- isSomePlanDeferred: boolean;
4
- isCurrentPlanP1X: boolean;
5
- }>;
6
- export default Title;
1
+ import { FC } from '../../../../../preact/compat';
2
+ declare const Title: FC<{
3
+ isSomePlanDeferred: boolean;
4
+ isCurrentPlanP1X: boolean;
5
+ }>;
6
+ export default Title;
@@ -1,11 +1,11 @@
1
- import React, { FunctionComponent } from 'react';
2
- import { statusResponse, Card, EligibilityPlan } from 'types';
3
- declare type Props = {
4
- initialPlanIndex?: number;
5
- onClose: (event: React.MouseEvent | React.KeyboardEvent) => void;
6
- eligibilityPlans: EligibilityPlan[];
7
- status: statusResponse;
8
- cards?: Card[];
9
- };
10
- declare const EligibilityModal: FunctionComponent<Props>;
11
- export default EligibilityModal;
1
+ import { default as React, FunctionComponent } from '../../../preact/compat';
2
+ import { Card, EligibilityPlan, statusResponse } from '../../types';
3
+ type Props = {
4
+ initialPlanIndex?: number;
5
+ onClose: (event: React.MouseEvent | React.KeyboardEvent) => void;
6
+ eligibilityPlans: EligibilityPlan[];
7
+ status: statusResponse;
8
+ cards?: Card[];
9
+ };
10
+ declare const EligibilityModal: FunctionComponent<Props>;
11
+ export default EligibilityModal;
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,13 +1,13 @@
1
- /**
2
- * Class names for the **payment plans** widget.
3
- * Those classes are intended to be used by the **merchant developer**.
4
- */
5
- declare const STATIC_CUSTOMISATION_CLASSES: {
6
- container: string;
7
- eligibilityLine: string;
8
- eligibilityOptions: string;
9
- notEligibleOption: string;
10
- paymentInfo: string;
11
- activeOption: string;
12
- };
13
- export default STATIC_CUSTOMISATION_CLASSES;
1
+ /**
2
+ * Class names for the **payment plans** widget.
3
+ * Those classes are intended to be used by the **merchant developer**.
4
+ */
5
+ declare const STATIC_CUSTOMISATION_CLASSES: {
6
+ container: string;
7
+ eligibilityLine: string;
8
+ eligibilityOptions: string;
9
+ notEligibleOption: string;
10
+ paymentInfo: string;
11
+ activeOption: string;
12
+ };
13
+ export default STATIC_CUSTOMISATION_CLASSES;
@@ -1,18 +1,18 @@
1
- import React, { VoidFunctionComponent } from 'react';
2
- import { ApiConfig, Card, ConfigPlan } from 'types';
3
- declare type Props = {
4
- purchaseAmount: number;
5
- apiData: ApiConfig;
6
- configPlans?: ConfigPlan[];
7
- transitionDelay?: number;
8
- customerBillingCountry?: string;
9
- customerShippingCountry?: string;
10
- hideIfNotEligible?: boolean;
11
- monochrome?: boolean;
12
- suggestedPaymentPlan?: number | number[];
13
- cards?: Card[];
14
- hideBorder?: boolean;
15
- onModalClose?: (event: React.MouseEvent | React.KeyboardEvent) => void;
16
- };
17
- declare const PaymentPlanWidget: VoidFunctionComponent<Props>;
18
- export default PaymentPlanWidget;
1
+ import { default as React, FunctionComponent } from '../../../preact/compat';
2
+ import { ApiConfig, Card, ConfigPlan } from '../../types';
3
+ type Props = {
4
+ purchaseAmount: number;
5
+ apiData: ApiConfig;
6
+ configPlans?: ConfigPlan[];
7
+ transitionDelay?: number;
8
+ customerBillingCountry?: string;
9
+ customerShippingCountry?: string;
10
+ hideIfNotEligible?: boolean;
11
+ monochrome?: boolean;
12
+ suggestedPaymentPlan?: number | number[];
13
+ cards?: Card[];
14
+ hideBorder?: boolean;
15
+ onModalClose?: (event: React.MouseEvent | React.KeyboardEvent) => void;
16
+ };
17
+ declare const PaymentPlanWidget: FunctionComponent<Props>;
18
+ export default PaymentPlanWidget;
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
- declare function CrossIcon({ color, className, }: {
3
- color?: string;
4
- className?: string;
5
- }): JSX.Element;
6
- export default CrossIcon;
1
+ declare function CrossIcon({ color, className, }: {
2
+ color?: string;
3
+ className?: string;
4
+ }): JSX.Element;
5
+ export default CrossIcon;
@@ -1,6 +1,6 @@
1
- import { SVGAttributes, VoidFunctionComponent } from 'react';
2
- declare type Props = {
3
- color?: string;
4
- } & SVGAttributes<SVGElement>;
5
- export declare const AlmaLogo: VoidFunctionComponent<Props>;
6
- export {};
1
+ import { SVGAttributes, VoidFunctionComponent } from '../../preact/compat';
2
+ type Props = {
3
+ color?: string;
4
+ } & SVGAttributes<SVGElement>;
5
+ export declare const AlmaLogo: VoidFunctionComponent<Props>;
6
+ export {};
@@ -1,3 +1,3 @@
1
- import { FC } from 'react';
2
- declare const AmexCard: FC;
3
- export default AmexCard;
1
+ import { FC } from '../../../preact/compat';
2
+ declare const AmexCard: FC;
3
+ export default AmexCard;
@@ -1,3 +1,3 @@
1
- import { FC } from 'react';
2
- declare const CbCard: FC;
3
- export default CbCard;
1
+ import { FC } from '../../../preact/compat';
2
+ declare const CbCard: FC;
3
+ export default CbCard;
@@ -1,3 +1,3 @@
1
- import { FC } from 'react';
2
- declare const MasterCard: FC;
3
- export default MasterCard;
1
+ import { FC } from '../../../preact/compat';
2
+ declare const MasterCard: FC;
3
+ export default MasterCard;
@@ -1,3 +1,3 @@
1
- import { FC } from 'react';
2
- declare const VisaCard: FC;
3
- export default VisaCard;
1
+ import { FC } from '../../../preact/compat';
2
+ declare const VisaCard: FC;
3
+ export default VisaCard;
@@ -1,8 +1,8 @@
1
- import { FC } from 'react';
2
- import { PaymentPlan } from 'types';
3
- declare type Props = {
4
- installment: PaymentPlan;
5
- index: number;
6
- };
7
- declare const Installment: FC<Props>;
8
- export default Installment;
1
+ import { FC } from '../../../../preact/compat';
2
+ import { PaymentPlan } from '../../../types';
3
+ type Props = {
4
+ installment: PaymentPlan;
5
+ index: number;
6
+ };
7
+ declare const Installment: FC<Props>;
8
+ export default Installment;
@@ -0,0 +1,6 @@
1
+ import { FunctionComponent } from '../../../../preact/compat';
2
+ import { EligibilityPlan } from '../../../types';
3
+ declare const TotalBlock: FunctionComponent<{
4
+ currentPlan: EligibilityPlan;
5
+ }>;
6
+ export default TotalBlock;
@@ -0,0 +1,5 @@
1
+ import { FunctionComponent } from '../../../preact/compat';
2
+ declare const Loader: FunctionComponent<{
3
+ className?: string;
4
+ }>;
5
+ export default Loader;
@@ -0,0 +1,4 @@
1
+ import { FunctionComponent } from '../../../preact/compat';
2
+ export declare const LoadingIndicator: FunctionComponent<{
3
+ className?: string;
4
+ }>;
@@ -1,12 +1,12 @@
1
- import React, { FunctionComponent, ReactNode } from 'react';
2
- import Modal from 'react-modal';
3
- export declare type Props = Modal.Props & {
4
- children: ReactNode;
5
- isOpen: boolean;
6
- onClose: (event: React.MouseEvent | React.KeyboardEvent) => void;
7
- className?: string;
8
- contentClassName?: string;
9
- scrollable?: boolean;
10
- };
11
- declare const ControlledModal: FunctionComponent<Props>;
12
- export default ControlledModal;
1
+ import { default as React, FunctionComponent, ReactNode } from '../../../preact/compat';
2
+ import { default as Modal } from 'react-modal';
3
+ export type Props = Modal.Props & {
4
+ children: ReactNode;
5
+ isOpen: boolean;
6
+ onClose: (event: React.MouseEvent | React.KeyboardEvent) => void;
7
+ className?: string;
8
+ contentClassName?: string;
9
+ scrollable?: boolean;
10
+ };
11
+ declare const ControlledModal: FunctionComponent<Props>;
12
+ export default ControlledModal;
@@ -1,6 +1,6 @@
1
- export declare const SANDBOX_API_URL = "https://api.sandbox.getalma.eu";
2
- export declare const LIVE_API_URL = "https://api.getalma.eu";
3
- export declare enum ApiMode {
4
- LIVE = "https://api.getalma.eu",
5
- TEST = "https://api.sandbox.getalma.eu"
6
- }
1
+ export declare const SANDBOX_API_URL = "https://api.sandbox.getalma.eu";
2
+ export declare const LIVE_API_URL = "https://api.getalma.eu";
3
+ export declare enum ApiMode {
4
+ LIVE = "https://api.getalma.eu",
5
+ TEST = "https://api.sandbox.getalma.eu"
6
+ }
@@ -1,7 +1,7 @@
1
- declare type Props = {
2
- current: number;
3
- onHover: (current: number) => void;
4
- onLeave: () => void;
5
- };
6
- declare const useButtonAnimation: (iterateValues: number[], transitionDelay: number) => Props;
7
- export default useButtonAnimation;
1
+ type Props = {
2
+ current: number;
3
+ onHover: (current: number) => void;
4
+ onLeave: () => void;
5
+ };
6
+ declare const useButtonAnimation: (iterateValues: number[], transitionDelay: number) => Props;
7
+ export default useButtonAnimation;
@@ -0,0 +1,3 @@
1
+ import { ApiConfig, ConfigPlan, EligibilityPlan, statusResponse } from '../types';
2
+ declare const useFetchEligibility: (purchaseAmount: number, { domain, merchantId }: ApiConfig, plans?: ConfigPlan[], customerBillingCountry?: string, customerShippingCountry?: string) => [EligibilityPlan[], statusResponse];
3
+ export default useFetchEligibility;
@@ -1,20 +1,20 @@
1
- import { ConfigPlan, EligibilityPlan } from 'types';
2
- declare type CreateKeyType = {
3
- purchaseAmount: number;
4
- plans?: ConfigPlan[];
5
- customerBillingCountry?: string;
6
- customerShippingCountry?: string;
7
- };
8
- declare type StorageType = {
9
- value: EligibilityPlan[];
10
- timestamp: number;
11
- };
12
- declare type UseSessionStorageType = {
13
- getCache: (key: string) => StorageType | null;
14
- setCache: (key: string, value: EligibilityPlan[]) => void;
15
- clearCache: () => void;
16
- deleteCache: (key: string) => void;
17
- createKey: (params: CreateKeyType) => string;
18
- };
19
- export declare const useSessionStorage: () => UseSessionStorageType;
20
- export {};
1
+ import { ConfigPlan, EligibilityPlan } from '../types';
2
+ type CreateKeyType = {
3
+ purchaseAmount: number;
4
+ plans?: ConfigPlan[];
5
+ customerBillingCountry?: string;
6
+ customerShippingCountry?: string;
7
+ };
8
+ type StorageType = {
9
+ value: EligibilityPlan[];
10
+ timestamp: number;
11
+ };
12
+ type UseSessionStorageType = {
13
+ getCache: (key: string) => StorageType | null;
14
+ setCache: (key: string, value: EligibilityPlan[]) => void;
15
+ clearCache: () => void;
16
+ deleteCache: (key: string) => void;
17
+ createKey: (params: CreateKeyType) => string;
18
+ };
19
+ export declare const useSessionStorage: () => UseSessionStorageType;
20
+ export {};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,18 +1,16 @@
1
- import 'core-js/stable/array/from';
2
- import { widgetTypes } from 'types';
3
- import { ApiMode } from './consts';
4
- import './main.css';
5
- import * as utils from './utils';
6
- import './utils/polyfills';
7
- import { WidgetsController } from './widgets_controller';
8
- export declare namespace Widgets {
9
- function initialize(merchantId: string, mode: ApiMode): WidgetsController;
10
- const PaymentPlans = widgetTypes.PaymentPlans;
11
- const Modal = widgetTypes.Modal;
12
- }
13
- export declare namespace Utils {
14
- const priceToCents: typeof utils.priceToCents;
15
- const priceFromCents: typeof utils.priceFromCents;
16
- const formatCents: typeof utils.formatCents;
17
- }
18
- export { ApiMode } from './consts';
1
+ import { ApiMode } from './consts';
2
+ import { widgetTypes } from './types';
3
+ import * as utils from '@/utils';
4
+ export declare namespace Widgets {
5
+ function initialize(merchantId: string, mode: ApiMode): {
6
+ add: (widget: import("@/types").WidgetNames, options: import("@/types").WidgetOptions) => import("@/widgets_controller").AddReturnType;
7
+ };
8
+ const PaymentPlans = widgetTypes.PaymentPlans;
9
+ const Modal = widgetTypes.Modal;
10
+ }
11
+ export declare namespace Utils {
12
+ const priceToCents: typeof utils.priceToCents;
13
+ const priceFromCents: typeof utils.priceFromCents;
14
+ const formatCents: typeof utils.formatCents;
15
+ }
16
+ export { ApiMode } from './consts';
@@ -1,8 +1,8 @@
1
- import { FC, ReactNode } from 'react';
2
- import { Locale } from 'types';
3
- declare type Props = {
4
- children: ReactNode;
5
- locale: Locale;
6
- };
7
- declare const Provider: FC<Props>;
8
- export default Provider;
1
+ import { FC, ReactNode } from '../../preact/compat';
2
+ import { Locale } from '../types';
3
+ type Props = {
4
+ children: ReactNode;
5
+ locale: Locale;
6
+ };
7
+ declare const Provider: FC<Props>;
8
+ export default Provider;