@alma/widgets 2.6.0 → 2.8.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 (38) hide show
  1. package/dist/raw/widgets.css +14 -0
  2. package/dist/raw/widgets.js +267 -65
  3. package/dist/raw/widgets.js.map +1 -1
  4. package/dist/raw/widgets.m.js +267 -65
  5. package/dist/raw/widgets.m.js.map +1 -1
  6. package/dist/raw/widgets.modern.js +260 -67
  7. package/dist/raw/widgets.modern.js.map +1 -1
  8. package/dist/raw/widgets.umd.js +267 -65
  9. package/dist/raw/widgets.umd.js.map +1 -1
  10. package/dist/types/Widgets/EligibilityModal/DesktopModal/index.d.ts +2 -0
  11. package/dist/types/Widgets/EligibilityModal/MobileModal/index.d.ts +2 -0
  12. package/dist/types/Widgets/EligibilityModal/ModalContainer.d.ts +2 -1
  13. package/dist/types/Widgets/EligibilityModal/{modal.test.d.ts → __tests__/Basics.test.d.ts} +0 -0
  14. package/dist/types/Widgets/EligibilityModal/__tests__/Cards.test.d.ts +1 -0
  15. package/dist/types/Widgets/EligibilityModal/__tests__/ModalContainer.test.d.ts +1 -0
  16. package/dist/types/Widgets/EligibilityModal/__tests__/Plans.test.d.ts +1 -0
  17. package/dist/types/Widgets/EligibilityModal/classNames.const.d.ts +1 -0
  18. package/dist/types/Widgets/EligibilityModal/components/Cards/index.d.ts +7 -0
  19. package/dist/types/Widgets/EligibilityModal/index.d.ts +2 -1
  20. package/dist/types/Widgets/PaymentPlans/__tests__/Monochrome.test.d.ts +1 -0
  21. package/dist/types/Widgets/PaymentPlans/index.d.ts +3 -1
  22. package/dist/types/assets/Logo.d.ts +3 -2
  23. package/dist/types/assets/cards/amex.d.ts +3 -0
  24. package/dist/types/assets/cards/cb.d.ts +3 -0
  25. package/dist/types/assets/cards/mastercard.d.ts +3 -0
  26. package/dist/types/assets/cards/visa.d.ts +3 -0
  27. package/dist/types/types.d.ts +8 -4
  28. package/dist/types/widgets_controller.d.ts +1 -2
  29. package/dist/widgets.css +2 -1
  30. package/dist/widgets.js +1 -1
  31. package/dist/widgets.js.map +1 -1
  32. package/dist/widgets.m.js +1 -1
  33. package/dist/widgets.m.js.map +1 -1
  34. package/dist/widgets.modern.js +1 -1
  35. package/dist/widgets.modern.js.map +1 -1
  36. package/dist/widgets.umd.js +1 -1
  37. package/dist/widgets.umd.js.map +1 -1
  38. package/package.json +1 -1
@@ -1819,7 +1819,7 @@ var messagesDE = {
1819
1819
  "eligibility-modal.title": "<highlighted>Bezahlen Sie in Raten</highlighted> per Kreditkarte mit Alma.",
1820
1820
  "eligibility-modal.title-deferred": "<highlighted>Bezahlen Sie in Raten</highlighted> oder später per Kreditkarte mit Alma.",
1821
1821
  "eligibility-modal.total": "Insgesamt",
1822
- "installments.today": "Heutzutage",
1822
+ "installments.today": "Heute",
1823
1823
  "payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
1824
1824
  "payment-plan-strings.default-message": "Bezahlen Sie in Raten mit Alma",
1825
1825
  "payment-plan-strings.deferred": "{totalAmount} zu zahlen am {dueDate}",
@@ -1862,7 +1862,7 @@ var messagesES = {
1862
1862
  "eligibility-modal.credit-cost": "Coste de crédito (incl. en el total)",
1863
1863
  "eligibility-modal.credit-cost-amount": "{creditCost} (TAE {TAEG})",
1864
1864
  "eligibility-modal.no-eligibility": "Uy, parece que la simulación no ha funcionado.",
1865
- "eligibility-modal.title": "<highlighted>Paga a plazos</highlighted> con tarjeta de crédito con Alma.",
1865
+ "eligibility-modal.title": "<highlighted>Paga a plazos</highlighted> con tu tarjeta, a través de Alma.",
1866
1866
  "eligibility-modal.title-deferred": "<highlighted>Paga a plazos</highlighted> o más adelante con tu tarjeta, a través de Alma.",
1867
1867
  "eligibility-modal.total": "Total",
1868
1868
  "installments.today": "Hoy",
@@ -1908,8 +1908,8 @@ var messagesIT = {
1908
1908
  "eligibility-modal.credit-cost": "Di cui commissioni",
1909
1909
  "eligibility-modal.credit-cost-amount": "{creditCost} (TAEG {TAEG})",
1910
1910
  "eligibility-modal.no-eligibility": "Ops, sembra che la simulazione non abbia funzionato.",
1911
- "eligibility-modal.title": "<highlighted>Paga a rate</highlighted> con carta di credito con Alma.",
1912
- "eligibility-modal.title-deferred": "<highlighted>Paga a rate</highlighted> e posticipa il pagamento con Alma, senza interessi.",
1911
+ "eligibility-modal.title": "<highlighted>Paga a rate</highlighted> con Alma, senza interessi.",
1912
+ "eligibility-modal.title-deferred": "<highlighted>Paga a rate</highlighted> o posticipa il pagamento con Alma, senza interessi.",
1913
1913
  "eligibility-modal.total": "Totale",
1914
1914
  "installments.today": "Oggi",
1915
1915
  "payment-plan-strings.day-abbreviation": "G{numberOfDeferredDays}",
@@ -1950,9 +1950,6 @@ const getTranslationsByLocale = locale => {
1950
1950
  case Locale.fr:
1951
1951
  return messagesFR;
1952
1952
 
1953
- case Locale.en:
1954
- return messagesEN;
1955
-
1956
1953
  case Locale.es:
1957
1954
  return messagesES;
1958
1955
 
@@ -1967,6 +1964,7 @@ const getTranslationsByLocale = locale => {
1967
1964
  case Locale['nl-NL']:
1968
1965
  return messagesNL;
1969
1966
 
1967
+ case Locale.en:
1970
1968
  default:
1971
1969
  return messagesEN;
1972
1970
  }
@@ -2155,6 +2153,7 @@ const STATIC_CUSTOMISATION_CLASSES = {
2155
2153
  scheduleDetails: prefix + '-schedule-details',
2156
2154
  scheduleTotal: prefix + '-schedule-total',
2157
2155
  scheduleCredit: prefix + '-schedule-credit',
2156
+ cardContainer: prefix + '-card-logos',
2158
2157
  summary: prefix + '-summary'
2159
2158
  };
2160
2159
 
@@ -2171,6 +2170,7 @@ const ControlledModal = _ref => {
2171
2170
  } = _ref,
2172
2171
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
2173
2172
 
2173
+ /* istanbul ignore next */
2174
2174
  Modal.setAppElement('body');
2175
2175
  return /*#__PURE__*/React.createElement(Modal, Object.assign({
2176
2176
  className: cx(s$1.modal, className),
@@ -2423,15 +2423,177 @@ const Schedule = ({
2423
2423
  }))));
2424
2424
  };
2425
2425
 
2426
- var s$4 = {"list":"_180ro","listItem":"_1HqCO","bullet":"_3B8wx"};
2426
+ const AmexCard = () => /*#__PURE__*/React.createElement("svg", {
2427
+ xmlns: "http://www.w3.org/2000/svg",
2428
+ width: "24",
2429
+ height: "16",
2430
+ viewBox: "0 0 24 16"
2431
+ }, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
2432
+ id: "cardamex",
2433
+ x1: "10.914%",
2434
+ x2: "87.432%",
2435
+ y1: "86.279%",
2436
+ y2: "15.035%"
2437
+ }, /*#__PURE__*/React.createElement("stop", {
2438
+ offset: "0%",
2439
+ stopColor: "#3FA9F5"
2440
+ }), /*#__PURE__*/React.createElement("stop", {
2441
+ offset: "100%",
2442
+ stopColor: "#0071BC"
2443
+ }))), /*#__PURE__*/React.createElement("g", {
2444
+ fill: "none",
2445
+ fillRule: "evenodd"
2446
+ }, /*#__PURE__*/React.createElement("path", {
2447
+ fill: "url(#cardamex)",
2448
+ fillRule: "nonzero",
2449
+ d: "M22.559 16H1.379C.627 16 0 15.392 0 14.662V1.338C0 .608.627 0 1.379 0H22.62C23.373 0 24 .608 24 1.338v13.324c-.063.73-.627 1.338-1.441 1.338z"
2450
+ }), /*#__PURE__*/React.createElement("g", {
2451
+ fill: "#FFF"
2452
+ }, /*#__PURE__*/React.createElement("path", {
2453
+ d: "M10.115 8.711L8.889 6.044H7.295v3.852L5.517 6.044H4.17l-1.778 4.03h1.103l.368-.889h2.023l.368.89h2.084V7.11l1.349 2.963h.92l1.348-2.904v2.904h.98v-4.03H11.28l-1.165 2.667zm-5.272-.474H4.23l.613-1.422v.06l.613 1.362h-.613z"
2454
+ }), /*#__PURE__*/React.createElement("path", {
2455
+ fillRule: "nonzero",
2456
+ d: "M19.372 7.94l.735-.77 1.042-1.185h-1.287L18.697 7.23l-1.164-1.245h-3.985v3.97h3.923l1.226-1.303 1.165 1.304h1.287L20.107 8.71l-.735-.77zM16.92 9.186h-2.33v-.77h2.268v-.77H14.59v-.712h2.33L18.084 8 16.92 9.185z"
2457
+ }))));
2458
+
2459
+ const VisaCard = () => /*#__PURE__*/React.createElement("svg", {
2460
+ xmlns: "http://www.w3.org/2000/svg",
2461
+ width: "24",
2462
+ height: "16",
2463
+ viewBox: "0 0 24 16"
2464
+ }, /*#__PURE__*/React.createElement("g", {
2465
+ fill: "none",
2466
+ fillRule: "nonzero"
2467
+ }, /*#__PURE__*/React.createElement("path", {
2468
+ fill: "#FCFCFC",
2469
+ d: "M22.684 16H1.38C.627 16 0 15.39 0 14.656V1.344C0 .61.627 0 1.379 0H22.62C23.373 0 24 .61 24 1.344v13.374c0 .671-.564 1.282-1.316 1.282z"
2470
+ }), ' ', /*#__PURE__*/React.createElement("path", {
2471
+ fill: "#005098",
2472
+ d: "M8.889 10.726l.948-5.393h1.482l-.949 5.393zM15.704 5.452a3.658 3.658 0 0 0-1.304-.237c-1.481 0-2.489.71-2.489 1.778 0 .77.711 1.185 1.304 1.481.592.237.77.415.77.652 0 .355-.474.533-.889.533-.592 0-.889-.059-1.363-.296l-.177-.06-.178 1.186c.355.178 1.007.296 1.659.296 1.54 0 2.548-.71 2.548-1.837 0-.592-.415-1.067-1.244-1.481-.534-.237-.83-.415-.83-.652 0-.237.237-.474.83-.474.474 0 .83.118 1.126.178l.118.059.119-1.126M19.496 5.333H18.37c-.355 0-.592.119-.77.474l-2.193 4.919h1.541s.237-.652.296-.83h1.897c.059.178.178.83.178.83h1.362l-1.185-5.393zM17.66 8.77l.593-1.481s.118-.296.178-.533l.118.474s.296 1.303.356 1.54h-1.245zM7.644 5.333L6.222 9.007l-.178-.77C5.748 7.348 4.92 6.459 4.03 5.985l1.303 4.682h1.541l2.311-5.393h-1.54"
2473
+ }), /*#__PURE__*/React.createElement("path", {
2474
+ fill: "#F6A500",
2475
+ d: "M4.919 5.333h-2.37v.119c1.836.474 3.08 1.54 3.555 2.844L5.57 5.807c-.118-.414-.355-.474-.651-.474"
2476
+ }), /*#__PURE__*/React.createElement("path", {
2477
+ fill: "#0A5296",
2478
+ d: "M23.937 3.23H0V1.316C0 .598.627 0 1.379 0H22.62C23.373 0 24 .598 24 1.316V3.23h-.063z"
2479
+ }), /*#__PURE__*/React.createElement("path", {
2480
+ fill: "#F4A428",
2481
+ d: "M.063 13H24v1.8c0 .655-.625 1.2-1.375 1.2H1.375C.625 16 0 15.455 0 14.8V13h.063z"
2482
+ })));
2483
+
2484
+ const MasterCard = () => /*#__PURE__*/React.createElement("svg", {
2485
+ width: "24px",
2486
+ height: "16px",
2487
+ viewBox: "0 0 24 16",
2488
+ version: "1.1",
2489
+ xmlns: "http://www.w3.org/2000/svg"
2490
+ }, /*#__PURE__*/React.createElement("g", {
2491
+ id: "Parcours-1C-B",
2492
+ stroke: "none",
2493
+ strokeWidth: "1",
2494
+ fill: "none",
2495
+ fillRule: "evenodd"
2496
+ }, /*#__PURE__*/React.createElement("g", {
2497
+ id: "mobile-1C-Paiement-V1",
2498
+ transform: "translate(-269.000000, -313.000000)"
2499
+ }, /*#__PURE__*/React.createElement("g", {
2500
+ id: "mastercard",
2501
+ transform: "translate(269.000000, 313.000000)"
2502
+ }, /*#__PURE__*/React.createElement("rect", {
2503
+ id: "Rectangle",
2504
+ fill: "#FFFFFF",
2505
+ x: "0",
2506
+ y: "0",
2507
+ width: "24",
2508
+ height: "16",
2509
+ rx: "1"
2510
+ }), /*#__PURE__*/React.createElement("g", {
2511
+ id: "Group-6",
2512
+ transform: "translate(4.000000, 3.000000)"
2513
+ }, /*#__PURE__*/React.createElement("circle", {
2514
+ id: "Oval-4-Copy",
2515
+ fill: "#EA001B",
2516
+ cx: "5.05263158",
2517
+ cy: "5.05263158",
2518
+ r: "5.05263158"
2519
+ }), /*#__PURE__*/React.createElement("circle", {
2520
+ id: "Oval-4",
2521
+ fillOpacity: "0.25",
2522
+ fill: "#F79F1A",
2523
+ cx: "10.9473684",
2524
+ cy: "5.05263158",
2525
+ r: "5.05263158"
2526
+ }), /*#__PURE__*/React.createElement("circle", {
2527
+ id: "Oval-4-Copy-2",
2528
+ fillOpacity: "0.9",
2529
+ fill: "#F79F1A",
2530
+ cx: "10.9473684",
2531
+ cy: "5.05263158",
2532
+ r: "5.05263158"
2533
+ }), /*#__PURE__*/React.createElement("circle", {
2534
+ id: "Oval-4-Copy-3",
2535
+ fillOpacity: "0.3",
2536
+ fill: "#EA001B",
2537
+ cx: "5.05263158",
2538
+ cy: "5.05263158",
2539
+ r: "5.05263158"
2540
+ }))))));
2541
+
2542
+ const CbCard = () => /*#__PURE__*/React.createElement("svg", {
2543
+ xmlns: "http://www.w3.org/2000/svg",
2544
+ width: "24",
2545
+ height: "16",
2546
+ viewBox: "0 0 24 16"
2547
+ }, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
2548
+ id: "cardcb",
2549
+ x1: "5.842%",
2550
+ x2: "95.393%",
2551
+ y1: "81.753%",
2552
+ y2: "17.344%"
2553
+ }, /*#__PURE__*/React.createElement("stop", {
2554
+ offset: "0%",
2555
+ stopColor: "#39B54A"
2556
+ }), ' ', /*#__PURE__*/React.createElement("stop", {
2557
+ offset: "100%",
2558
+ stopColor: "#0A5296"
2559
+ }))), /*#__PURE__*/React.createElement("g", {
2560
+ fill: "none",
2561
+ fillRule: "nonzero"
2562
+ }, /*#__PURE__*/React.createElement("path", {
2563
+ fill: "url(#cardcb)",
2564
+ d: "M22.621 16H1.38C.627 16 0 15.392 0 14.662V1.338C0 .608.627 0 1.379 0H22.62C23.373 0 24 .608 24 1.338v13.324c-.063.73-.627 1.338-1.379 1.338z"
2565
+ }), /*#__PURE__*/React.createElement("g", {
2566
+ fill: "#FFF"
2567
+ }, /*#__PURE__*/React.createElement("path", {
2568
+ d: "M19.094 4.03h-6.437V8h6.498c1.165 0 2.084-.889 2.084-2.015-.06-1.066-.98-1.955-2.145-1.955zM19.094 8.593h-6.437v3.97h6.498c1.165 0 2.084-.889 2.084-2.015-.06-1.067-.98-1.955-2.145-1.955zM7.017 8.06h4.966c-.245-2.371-2.391-4.267-4.966-4.267-2.758 0-5.027 2.074-5.027 4.681s2.269 4.682 5.027 4.682c2.698 0 4.904-2.015 5.027-4.563H7.017v-.534z"
2569
+ }))));
2570
+
2571
+ var s$4 = {"cardContainer":"_1N3yO","card":"_83cGn"};
2572
+
2573
+ const Cards = ({
2574
+ cards
2575
+ }) => {
2576
+ // We transform to a Set and back to avoid duplicate values (ex : amex, amex)
2577
+ const uniqueCards = Array.from(new Set(cards));
2578
+ return /*#__PURE__*/React.createElement("div", {
2579
+ "data-testid": "card-logos",
2580
+ className: cx(s$4.cardContainer, STATIC_CUSTOMISATION_CLASSES.cardContainer)
2581
+ }, uniqueCards.map(card => /*#__PURE__*/React.createElement("div", {
2582
+ key: card,
2583
+ className: s$4.card,
2584
+ "data-testid": `card-logo-${card}`
2585
+ }, card === 'cb' && /*#__PURE__*/React.createElement(CbCard, null), card === 'amex' && /*#__PURE__*/React.createElement(AmexCard, null), card === 'mastercard' && /*#__PURE__*/React.createElement(MasterCard, null), card === 'visa' && /*#__PURE__*/React.createElement(VisaCard, null))));
2586
+ };
2587
+
2588
+ var s$5 = {"list":"_180ro","listItem":"_1HqCO","bullet":"_3B8wx"};
2427
2589
 
2428
2590
  const Info = () => /*#__PURE__*/React.createElement("div", {
2429
- className: cx(s$4.list, STATIC_CUSTOMISATION_CLASSES.info),
2591
+ className: cx(s$5.list, STATIC_CUSTOMISATION_CLASSES.info),
2430
2592
  "data-testid": "modal-info-element"
2431
2593
  }, /*#__PURE__*/React.createElement("div", {
2432
- className: s$4.listItem
2594
+ className: s$5.listItem
2433
2595
  }, /*#__PURE__*/React.createElement("div", {
2434
- className: s$4.bullet
2596
+ className: s$5.bullet
2435
2597
  }, "1"), /*#__PURE__*/React.createElement("div", {
2436
2598
  className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2437
2599
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
@@ -2441,9 +2603,9 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
2441
2603
  strong: (...chunks) => /*#__PURE__*/React.createElement("strong", null, chunks)
2442
2604
  }
2443
2605
  }))), /*#__PURE__*/React.createElement("div", {
2444
- className: s$4.listItem
2606
+ className: s$5.listItem
2445
2607
  }, /*#__PURE__*/React.createElement("div", {
2446
- className: s$4.bullet
2608
+ className: s$5.bullet
2447
2609
  }, "2"), /*#__PURE__*/React.createElement("div", {
2448
2610
  className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2449
2611
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
@@ -2453,9 +2615,9 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
2453
2615
  strong: (...chunks) => /*#__PURE__*/React.createElement("strong", null, chunks)
2454
2616
  }
2455
2617
  }))), /*#__PURE__*/React.createElement("div", {
2456
- className: s$4.listItem
2618
+ className: s$5.listItem
2457
2619
  }, /*#__PURE__*/React.createElement("div", {
2458
- className: s$4.bullet
2620
+ className: s$5.bullet
2459
2621
  }, "3"), /*#__PURE__*/React.createElement("div", {
2460
2622
  className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2461
2623
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
@@ -2466,11 +2628,20 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
2466
2628
  }
2467
2629
  }))));
2468
2630
 
2631
+ var COLORS;
2632
+
2633
+ (function (COLORS) {
2634
+ COLORS["ALMA"] = "#FF414D";
2635
+ COLORS["MONOCHROME"] = "#00425D";
2636
+ })(COLORS || (COLORS = {}));
2637
+
2469
2638
  function LogoIcon({
2470
- color = '#00425D',
2471
- underlineColor = '#00425D',
2472
- className
2639
+ className,
2640
+ color = COLORS.MONOCHROME,
2641
+ monochrome = true,
2642
+ underlineColor
2473
2643
  }) {
2644
+ const defaultUnderlineColor = monochrome ? COLORS.MONOCHROME : COLORS.ALMA;
2474
2645
  return /*#__PURE__*/React.createElement("svg", {
2475
2646
  className: className,
2476
2647
  width: "35",
@@ -2494,24 +2665,24 @@ function LogoIcon({
2494
2665
  y: "20",
2495
2666
  width: "40",
2496
2667
  height: "3",
2497
- fill: underlineColor
2668
+ fill: underlineColor || defaultUnderlineColor
2498
2669
  }));
2499
2670
  }
2500
2671
 
2501
- var s$5 = {"logo":"_3Oyv_"};
2672
+ var s$6 = {"logo":"_3Oyv_"};
2502
2673
 
2503
2674
  const Logo = () => /*#__PURE__*/React.createElement("div", {
2504
- className: s$5.logo
2675
+ className: s$6.logo
2505
2676
  }, /*#__PURE__*/React.createElement(LogoIcon, {
2506
2677
  underlineColor: "#FF414D"
2507
2678
  }));
2508
2679
 
2509
- var s$6 = {"title":"_3ERx-"};
2680
+ var s$7 = {"title":"_3ERx-"};
2510
2681
 
2511
2682
  const Title = ({
2512
2683
  isSomePlanDeferred
2513
2684
  }) => /*#__PURE__*/React.createElement("div", {
2514
- className: cx(s$6.title, STATIC_CUSTOMISATION_CLASSES.title),
2685
+ className: cx(s$7.title, STATIC_CUSTOMISATION_CLASSES.title),
2515
2686
  "data-testid": "modal-title-element"
2516
2687
  }, isSomePlanDeferred ? /*#__PURE__*/React.createElement(FormattedMessage, {
2517
2688
  id: 'eligibility-modal.title-deferred',
@@ -2527,41 +2698,48 @@ const Title = ({
2527
2698
  }
2528
2699
  }));
2529
2700
 
2530
- var s$7 = {"container":"_21g6u","block":"_3zaP5","left":"_2SBRC"};
2701
+ var s$8 = {"container":"_21g6u","block":"_3zaP5","left":"_2SBRC"};
2531
2702
 
2532
2703
  const DesktopModal = ({
2533
2704
  children,
2534
- isSomePlanDeferred
2705
+ isSomePlanDeferred,
2706
+ cards
2535
2707
  }) => /*#__PURE__*/React.createElement("div", {
2536
- className: s$7.container,
2708
+ className: s$8.container,
2537
2709
  "data-testid": "modal-container"
2538
2710
  }, /*#__PURE__*/React.createElement("div", {
2539
- className: cx([s$7.block, s$7.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
2711
+ className: cx([s$8.block, s$8.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
2540
2712
  }, /*#__PURE__*/React.createElement(Title, {
2541
2713
  isSomePlanDeferred: isSomePlanDeferred
2542
- }), /*#__PURE__*/React.createElement(Info, null), /*#__PURE__*/React.createElement(Logo, null)), /*#__PURE__*/React.createElement("div", {
2543
- className: cx(s$7.block, STATIC_CUSTOMISATION_CLASSES.rightSide)
2714
+ }), /*#__PURE__*/React.createElement(Info, null), cards && /*#__PURE__*/React.createElement(Cards, {
2715
+ cards: cards
2716
+ }), /*#__PURE__*/React.createElement(Logo, null)), /*#__PURE__*/React.createElement("div", {
2717
+ className: cx(s$8.block, STATIC_CUSTOMISATION_CLASSES.rightSide)
2544
2718
  }, children));
2545
2719
 
2546
- var s$8 = {"noEligibility":"_17qNJ","loader":"_2oTJq"};
2720
+ var s$9 = {"noEligibility":"_17qNJ","loader":"_2oTJq"};
2547
2721
 
2548
- var s$9 = {"container":"_2G7Ch"};
2722
+ var s$a = {"container":"_2G7Ch"};
2549
2723
 
2550
2724
  const MobileModal = ({
2551
2725
  children,
2552
- isSomePlanDeferred
2726
+ isSomePlanDeferred,
2727
+ cards
2553
2728
  }) => /*#__PURE__*/React.createElement("div", {
2554
- className: s$9.container,
2729
+ className: s$a.container,
2555
2730
  "data-testid": "modal-container"
2556
2731
  }, /*#__PURE__*/React.createElement(Title, {
2557
2732
  isSomePlanDeferred: isSomePlanDeferred
2558
- }), children, /*#__PURE__*/React.createElement(Info, null), /*#__PURE__*/React.createElement(Logo, null));
2733
+ }), children, /*#__PURE__*/React.createElement(Info, null), cards && /*#__PURE__*/React.createElement(Cards, {
2734
+ cards: cards
2735
+ }), /*#__PURE__*/React.createElement(Logo, null));
2559
2736
 
2560
2737
  const EligibilityModal = ({
2561
2738
  initialPlanIndex,
2562
2739
  onClose,
2563
2740
  eligibilityPlans,
2564
- status
2741
+ status,
2742
+ cards
2565
2743
  }) => {
2566
2744
  const [currentPlanIndex, setCurrentPlanIndex] = useState(initialPlanIndex || 0);
2567
2745
  const isBigScreen = useMediaQuery({
@@ -2577,11 +2755,12 @@ const EligibilityModal = ({
2577
2755
  scrollable: true,
2578
2756
  isOpen: true
2579
2757
  }, /*#__PURE__*/React.createElement(ModalComponent, {
2580
- isSomePlanDeferred: isSomePlanDeferred
2758
+ isSomePlanDeferred: isSomePlanDeferred,
2759
+ cards: cards
2581
2760
  }, status === apiStatus.PENDING && /*#__PURE__*/React.createElement("div", {
2582
- className: s$8.loader
2761
+ className: s$9.loader
2583
2762
  }, /*#__PURE__*/React.createElement(LoadingIndicator, null)), status === apiStatus.SUCCESS && eligiblePlans.length === 0 && /*#__PURE__*/React.createElement("div", {
2584
- className: s$8.noEligibility
2763
+ className: s$9.noEligibility
2585
2764
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
2586
2765
  id: "eligibility-modal.no-eligibility",
2587
2766
  defaultMessage: "Oups, il semblerait que la simulation n'ait pas fonctionn\u00E9."
@@ -2602,29 +2781,31 @@ const ModalContainer = ({
2602
2781
  purchaseAmount,
2603
2782
  apiData,
2604
2783
  configPlans,
2605
- onClose
2784
+ onClose,
2785
+ cards
2606
2786
  }) => {
2607
2787
  const [eligibilityPlans, status] = useFetchEligibility(purchaseAmount, apiData, configPlans);
2608
2788
  return /*#__PURE__*/React.createElement(EligibilityModal, {
2609
2789
  initialPlanIndex: 0,
2610
2790
  onClose: onClose,
2611
2791
  eligibilityPlans: eligibilityPlans,
2612
- status: status
2792
+ status: status,
2793
+ cards: cards
2613
2794
  });
2614
2795
  };
2615
2796
 
2616
- var s$a = {"loadingIndicator":"_2SwwZ","line1":"_2qODo","line2":"_2YO01"};
2797
+ var s$b = {"loadingIndicator":"_2SwwZ","line1":"_2qODo","line2":"_2YO01"};
2617
2798
 
2618
2799
  const Loader = ({
2619
2800
  className
2620
2801
  }) => {
2621
2802
  return /*#__PURE__*/React.createElement("div", {
2622
- className: cx(s$a.loadingIndicator, className),
2803
+ className: cx(s$b.loadingIndicator, className),
2623
2804
  "data-testid": "loader"
2624
2805
  }, /*#__PURE__*/React.createElement("div", {
2625
- className: s$a.line1
2806
+ className: s$b.line1
2626
2807
  }), /*#__PURE__*/React.createElement("div", {
2627
- className: s$a.line2
2808
+ className: s$b.line2
2628
2809
  }));
2629
2810
  };
2630
2811
 
@@ -2704,18 +2885,20 @@ const STATIC_CUSTOMISATION_CLASSES$1 = {
2704
2885
  activeOption: prefix$1 + '-active-option'
2705
2886
  };
2706
2887
 
2707
- var s$b = {"widgetButton":"_TSkFv","logo":"_LJ4nZ","primaryContainer":"_bMClc","paymentPlans":"_17c_S","plan":"_2Kqjn","active":"_3dG_J","notEligible":"_3O1bg","info":"_25GrF","loader":"_30j1O","error":"_R0YlN","errorText":"_2kGhu","errorButton":"_73d_Y","pending":"_1ZDMS","clickable":"_UksZa","unClickable":"_1lr-q"};
2888
+ var s$c = {"widgetButton":"_TSkFv","logo":"_LJ4nZ","primaryContainer":"_bMClc","paymentPlans":"_17c_S","plan":"_2Kqjn","active":"_3dG_J","polychrome":"_2icEF","notEligible":"_3O1bg","info":"_25GrF","loader":"_30j1O","error":"_R0YlN","errorText":"_2kGhu","errorButton":"_73d_Y","pending":"_1ZDMS","clickable":"_UksZa","unClickable":"_1lr-q"};
2708
2889
 
2709
2890
  const VERY_LONG_TIME_IN_MS = 1000 * 3600 * 24 * 365;
2710
2891
  const DEFAULT_TRANSITION_TIME = 5500;
2711
2892
 
2712
2893
  const PaymentPlanWidget = ({
2713
- purchaseAmount,
2714
2894
  apiData,
2715
2895
  configPlans,
2716
- transitionDelay,
2717
2896
  hideIfNotEligible,
2718
- suggestedPaymentPlan
2897
+ monochrome,
2898
+ purchaseAmount,
2899
+ suggestedPaymentPlan,
2900
+ cards,
2901
+ transitionDelay
2719
2902
  }) => {
2720
2903
  const [eligibilityPlans, status] = useFetchEligibility(purchaseAmount, apiData, configPlans);
2721
2904
  const eligiblePlans = eligibilityPlans.filter(plan => plan.eligible);
@@ -2780,7 +2963,7 @@ const PaymentPlanWidget = ({
2780
2963
 
2781
2964
  if (status === apiStatus.PENDING) {
2782
2965
  return /*#__PURE__*/React.createElement("div", {
2783
- className: cx(s$b.widgetButton, s$b.pending)
2966
+ className: cx(s$c.widgetButton, s$c.pending)
2784
2967
  }, /*#__PURE__*/React.createElement(Loader, null));
2785
2968
  }
2786
2969
 
@@ -2798,36 +2981,40 @@ const PaymentPlanWidget = ({
2798
2981
 
2799
2982
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2800
2983
  onClick: handleOpenModal,
2801
- className: cx(s$b.widgetButton, {
2802
- [s$b.clickable]: eligiblePlans.length > 0,
2803
- [s$b.unClickable]: eligiblePlans.length === 0
2984
+ className: cx(s$c.widgetButton, {
2985
+ [s$c.clickable]: eligiblePlans.length > 0,
2986
+ [s$c.unClickable]: eligiblePlans.length === 0
2804
2987
  }, STATIC_CUSTOMISATION_CLASSES$1.container),
2805
2988
  "data-testid": "widget-button"
2806
2989
  }, /*#__PURE__*/React.createElement("div", {
2807
- className: cx(s$b.primaryContainer, STATIC_CUSTOMISATION_CLASSES$1.eligibilityLine)
2990
+ className: cx(s$c.primaryContainer, STATIC_CUSTOMISATION_CLASSES$1.eligibilityLine)
2808
2991
  }, /*#__PURE__*/React.createElement(LogoIcon, {
2809
- className: s$b.logo
2992
+ className: s$c.logo,
2993
+ monochrome: monochrome
2810
2994
  }), /*#__PURE__*/React.createElement("div", {
2811
- className: cx(s$b.paymentPlans, STATIC_CUSTOMISATION_CLASSES$1.eligibilityOptions)
2995
+ className: cx(s$c.paymentPlans, STATIC_CUSTOMISATION_CLASSES$1.eligibilityOptions)
2812
2996
  }, eligibilityPlans.map((eligibilityPlan, key) => {
2997
+ const isCurrent = key === current;
2813
2998
  return /*#__PURE__*/React.createElement("div", {
2814
2999
  key: key,
2815
3000
  onMouseEnter: () => onHover(key),
2816
3001
  onMouseOut: onLeave,
2817
- className: cx(s$b.plan, {
2818
- [cx(s$b.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)]: current === key,
2819
- [cx(s$b.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)]: !eligibilityPlan.eligible
3002
+ className: cx(s$c.plan, {
3003
+ [cx(s$c.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)]: isCurrent,
3004
+ [s$c.polychrome]: !monochrome && isCurrent,
3005
+ [cx(s$c.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)]: !eligibilityPlan.eligible
2820
3006
  })
2821
3007
  }, paymentPlanShorthandName(eligibilityPlan));
2822
3008
  }))), /*#__PURE__*/React.createElement("div", {
2823
- className: cx(s$b.info, {
2824
- [cx(s$b.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)]: eligibilityPlans[current] && !eligibilityPlans[current].eligible
3009
+ className: cx(s$c.info, {
3010
+ [cx(s$c.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)]: eligibilityPlans[current] && !eligibilityPlans[current].eligible
2825
3011
  }, STATIC_CUSTOMISATION_CLASSES$1.paymentInfo)
2826
3012
  }, eligibilityPlans.length !== 0 && paymentPlanInfoText(eligibilityPlans[current]))), isOpen && /*#__PURE__*/React.createElement(EligibilityModal, {
2827
3013
  initialPlanIndex: getIndexWithinEligiblePlans(current),
2828
3014
  onClose: closeModal,
2829
3015
  eligibilityPlans: eligiblePlans,
2830
- status: status
3016
+ status: status,
3017
+ cards: cards
2831
3018
  }));
2832
3019
  };
2833
3020
 
@@ -2850,20 +3037,24 @@ class WidgetsController {
2850
3037
  plans,
2851
3038
  transitionDelay,
2852
3039
  hideIfNotEligible,
3040
+ monochrome = true,
2853
3041
  suggestedPaymentPlan,
2854
- locale = Locale.en
3042
+ locale = Locale.en,
3043
+ cards
2855
3044
  } = options;
2856
3045
 
2857
3046
  if (containerDiv) {
2858
3047
  render( /*#__PURE__*/React.createElement(Provider, {
2859
3048
  locale: locale
2860
3049
  }, /*#__PURE__*/React.createElement(PaymentPlanWidget, {
2861
- purchaseAmount: purchaseAmount,
2862
3050
  apiData: this.apiData,
2863
3051
  configPlans: plans,
2864
- transitionDelay: transitionDelay,
2865
3052
  hideIfNotEligible: hideIfNotEligible,
2866
- suggestedPaymentPlan: suggestedPaymentPlan
3053
+ monochrome: monochrome,
3054
+ purchaseAmount: purchaseAmount,
3055
+ suggestedPaymentPlan: suggestedPaymentPlan,
3056
+ cards: cards,
3057
+ transitionDelay: transitionDelay
2867
3058
  })), document.querySelector(container));
2868
3059
  }
2869
3060
  }
@@ -2874,7 +3065,8 @@ class WidgetsController {
2874
3065
  clickableSelector,
2875
3066
  purchaseAmount,
2876
3067
  plans,
2877
- locale = Locale.en
3068
+ locale = Locale.en,
3069
+ cards
2878
3070
  } = options;
2879
3071
 
2880
3072
  const close = () => containerDiv && unmountComponentAtNode(containerDiv);
@@ -2886,7 +3078,8 @@ class WidgetsController {
2886
3078
  purchaseAmount: purchaseAmount,
2887
3079
  apiData: this.apiData,
2888
3080
  configPlans: plans,
2889
- onClose: close
3081
+ onClose: close,
3082
+ cards: cards
2890
3083
  })), document.querySelector(container));
2891
3084
  }; // if clickableSelector is provided, add an onClick event handler to open the Modal.
2892
3085