@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.
- package/dist/raw/widgets.css +14 -0
- package/dist/raw/widgets.js +267 -65
- package/dist/raw/widgets.js.map +1 -1
- package/dist/raw/widgets.m.js +267 -65
- package/dist/raw/widgets.m.js.map +1 -1
- package/dist/raw/widgets.modern.js +260 -67
- package/dist/raw/widgets.modern.js.map +1 -1
- package/dist/raw/widgets.umd.js +267 -65
- package/dist/raw/widgets.umd.js.map +1 -1
- package/dist/types/Widgets/EligibilityModal/DesktopModal/index.d.ts +2 -0
- package/dist/types/Widgets/EligibilityModal/MobileModal/index.d.ts +2 -0
- package/dist/types/Widgets/EligibilityModal/ModalContainer.d.ts +2 -1
- package/dist/types/Widgets/EligibilityModal/{modal.test.d.ts → __tests__/Basics.test.d.ts} +0 -0
- package/dist/types/Widgets/EligibilityModal/__tests__/Cards.test.d.ts +1 -0
- package/dist/types/Widgets/EligibilityModal/__tests__/ModalContainer.test.d.ts +1 -0
- package/dist/types/Widgets/EligibilityModal/__tests__/Plans.test.d.ts +1 -0
- package/dist/types/Widgets/EligibilityModal/classNames.const.d.ts +1 -0
- package/dist/types/Widgets/EligibilityModal/components/Cards/index.d.ts +7 -0
- package/dist/types/Widgets/EligibilityModal/index.d.ts +2 -1
- package/dist/types/Widgets/PaymentPlans/__tests__/Monochrome.test.d.ts +1 -0
- package/dist/types/Widgets/PaymentPlans/index.d.ts +3 -1
- package/dist/types/assets/Logo.d.ts +3 -2
- package/dist/types/assets/cards/amex.d.ts +3 -0
- package/dist/types/assets/cards/cb.d.ts +3 -0
- package/dist/types/assets/cards/mastercard.d.ts +3 -0
- package/dist/types/assets/cards/visa.d.ts +3 -0
- package/dist/types/types.d.ts +8 -4
- package/dist/types/widgets_controller.d.ts +1 -2
- package/dist/widgets.css +2 -1
- package/dist/widgets.js +1 -1
- package/dist/widgets.js.map +1 -1
- package/dist/widgets.m.js +1 -1
- package/dist/widgets.m.js.map +1 -1
- package/dist/widgets.modern.js +1 -1
- package/dist/widgets.modern.js.map +1 -1
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/raw/widgets.m.js
CHANGED
|
@@ -1839,7 +1839,7 @@ var messagesDE = {
|
|
|
1839
1839
|
"eligibility-modal.title": "<highlighted>Bezahlen Sie in Raten</highlighted> per Kreditkarte mit Alma.",
|
|
1840
1840
|
"eligibility-modal.title-deferred": "<highlighted>Bezahlen Sie in Raten</highlighted> oder später per Kreditkarte mit Alma.",
|
|
1841
1841
|
"eligibility-modal.total": "Insgesamt",
|
|
1842
|
-
"installments.today": "
|
|
1842
|
+
"installments.today": "Heute",
|
|
1843
1843
|
"payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
|
|
1844
1844
|
"payment-plan-strings.default-message": "Bezahlen Sie in Raten mit Alma",
|
|
1845
1845
|
"payment-plan-strings.deferred": "{totalAmount} zu zahlen am {dueDate}",
|
|
@@ -1882,7 +1882,7 @@ var messagesES = {
|
|
|
1882
1882
|
"eligibility-modal.credit-cost": "Coste de crédito (incl. en el total)",
|
|
1883
1883
|
"eligibility-modal.credit-cost-amount": "{creditCost} (TAE {TAEG})",
|
|
1884
1884
|
"eligibility-modal.no-eligibility": "Uy, parece que la simulación no ha funcionado.",
|
|
1885
|
-
"eligibility-modal.title": "<highlighted>Paga a plazos</highlighted> con tarjeta
|
|
1885
|
+
"eligibility-modal.title": "<highlighted>Paga a plazos</highlighted> con tu tarjeta, a través de Alma.",
|
|
1886
1886
|
"eligibility-modal.title-deferred": "<highlighted>Paga a plazos</highlighted> o más adelante con tu tarjeta, a través de Alma.",
|
|
1887
1887
|
"eligibility-modal.total": "Total",
|
|
1888
1888
|
"installments.today": "Hoy",
|
|
@@ -1928,8 +1928,8 @@ var messagesIT = {
|
|
|
1928
1928
|
"eligibility-modal.credit-cost": "Di cui commissioni",
|
|
1929
1929
|
"eligibility-modal.credit-cost-amount": "{creditCost} (TAEG {TAEG})",
|
|
1930
1930
|
"eligibility-modal.no-eligibility": "Ops, sembra che la simulazione non abbia funzionato.",
|
|
1931
|
-
"eligibility-modal.title": "<highlighted>Paga a rate</highlighted> con
|
|
1932
|
-
"eligibility-modal.title-deferred": "<highlighted>Paga a rate</highlighted>
|
|
1931
|
+
"eligibility-modal.title": "<highlighted>Paga a rate</highlighted> con Alma, senza interessi.",
|
|
1932
|
+
"eligibility-modal.title-deferred": "<highlighted>Paga a rate</highlighted> o posticipa il pagamento con Alma, senza interessi.",
|
|
1933
1933
|
"eligibility-modal.total": "Totale",
|
|
1934
1934
|
"installments.today": "Oggi",
|
|
1935
1935
|
"payment-plan-strings.day-abbreviation": "G{numberOfDeferredDays}",
|
|
@@ -1970,9 +1970,6 @@ var getTranslationsByLocale = function getTranslationsByLocale(locale) {
|
|
|
1970
1970
|
case Locale.fr:
|
|
1971
1971
|
return messagesFR;
|
|
1972
1972
|
|
|
1973
|
-
case Locale.en:
|
|
1974
|
-
return messagesEN;
|
|
1975
|
-
|
|
1976
1973
|
case Locale.es:
|
|
1977
1974
|
return messagesES;
|
|
1978
1975
|
|
|
@@ -1987,6 +1984,7 @@ var getTranslationsByLocale = function getTranslationsByLocale(locale) {
|
|
|
1987
1984
|
case Locale['nl-NL']:
|
|
1988
1985
|
return messagesNL;
|
|
1989
1986
|
|
|
1987
|
+
case Locale.en:
|
|
1990
1988
|
default:
|
|
1991
1989
|
return messagesEN;
|
|
1992
1990
|
}
|
|
@@ -2194,6 +2192,7 @@ var STATIC_CUSTOMISATION_CLASSES = {
|
|
|
2194
2192
|
scheduleDetails: prefix + '-schedule-details',
|
|
2195
2193
|
scheduleTotal: prefix + '-schedule-total',
|
|
2196
2194
|
scheduleCredit: prefix + '-schedule-credit',
|
|
2195
|
+
cardContainer: prefix + '-card-logos',
|
|
2197
2196
|
summary: prefix + '-summary'
|
|
2198
2197
|
};
|
|
2199
2198
|
|
|
@@ -2211,6 +2210,7 @@ var ControlledModal = function ControlledModal(_ref) {
|
|
|
2211
2210
|
scrollable = _ref$scrollable === void 0 ? false : _ref$scrollable,
|
|
2212
2211
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
2213
2212
|
|
|
2213
|
+
/* istanbul ignore next */
|
|
2214
2214
|
Modal.setAppElement('body');
|
|
2215
2215
|
return /*#__PURE__*/React.createElement(Modal, Object.assign({
|
|
2216
2216
|
className: cx(s$1.modal, className),
|
|
@@ -2469,16 +2469,187 @@ var Schedule = function Schedule(_ref) {
|
|
|
2469
2469
|
}))));
|
|
2470
2470
|
};
|
|
2471
2471
|
|
|
2472
|
-
var
|
|
2472
|
+
var AmexCard = function AmexCard() {
|
|
2473
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
2474
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2475
|
+
width: "24",
|
|
2476
|
+
height: "16",
|
|
2477
|
+
viewBox: "0 0 24 16"
|
|
2478
|
+
}, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
|
2479
|
+
id: "cardamex",
|
|
2480
|
+
x1: "10.914%",
|
|
2481
|
+
x2: "87.432%",
|
|
2482
|
+
y1: "86.279%",
|
|
2483
|
+
y2: "15.035%"
|
|
2484
|
+
}, /*#__PURE__*/React.createElement("stop", {
|
|
2485
|
+
offset: "0%",
|
|
2486
|
+
stopColor: "#3FA9F5"
|
|
2487
|
+
}), /*#__PURE__*/React.createElement("stop", {
|
|
2488
|
+
offset: "100%",
|
|
2489
|
+
stopColor: "#0071BC"
|
|
2490
|
+
}))), /*#__PURE__*/React.createElement("g", {
|
|
2491
|
+
fill: "none",
|
|
2492
|
+
fillRule: "evenodd"
|
|
2493
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
2494
|
+
fill: "url(#cardamex)",
|
|
2495
|
+
fillRule: "nonzero",
|
|
2496
|
+
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"
|
|
2497
|
+
}), /*#__PURE__*/React.createElement("g", {
|
|
2498
|
+
fill: "#FFF"
|
|
2499
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
2500
|
+
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"
|
|
2501
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
2502
|
+
fillRule: "nonzero",
|
|
2503
|
+
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"
|
|
2504
|
+
}))));
|
|
2505
|
+
};
|
|
2506
|
+
|
|
2507
|
+
var VisaCard = function VisaCard() {
|
|
2508
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
2509
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2510
|
+
width: "24",
|
|
2511
|
+
height: "16",
|
|
2512
|
+
viewBox: "0 0 24 16"
|
|
2513
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
2514
|
+
fill: "none",
|
|
2515
|
+
fillRule: "nonzero"
|
|
2516
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
2517
|
+
fill: "#FCFCFC",
|
|
2518
|
+
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"
|
|
2519
|
+
}), ' ', /*#__PURE__*/React.createElement("path", {
|
|
2520
|
+
fill: "#005098",
|
|
2521
|
+
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"
|
|
2522
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
2523
|
+
fill: "#F6A500",
|
|
2524
|
+
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"
|
|
2525
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
2526
|
+
fill: "#0A5296",
|
|
2527
|
+
d: "M23.937 3.23H0V1.316C0 .598.627 0 1.379 0H22.62C23.373 0 24 .598 24 1.316V3.23h-.063z"
|
|
2528
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
2529
|
+
fill: "#F4A428",
|
|
2530
|
+
d: "M.063 13H24v1.8c0 .655-.625 1.2-1.375 1.2H1.375C.625 16 0 15.455 0 14.8V13h.063z"
|
|
2531
|
+
})));
|
|
2532
|
+
};
|
|
2533
|
+
|
|
2534
|
+
var MasterCard = function MasterCard() {
|
|
2535
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
2536
|
+
width: "24px",
|
|
2537
|
+
height: "16px",
|
|
2538
|
+
viewBox: "0 0 24 16",
|
|
2539
|
+
version: "1.1",
|
|
2540
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2541
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
2542
|
+
id: "Parcours-1C-B",
|
|
2543
|
+
stroke: "none",
|
|
2544
|
+
strokeWidth: "1",
|
|
2545
|
+
fill: "none",
|
|
2546
|
+
fillRule: "evenodd"
|
|
2547
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
2548
|
+
id: "mobile-1C-Paiement-V1",
|
|
2549
|
+
transform: "translate(-269.000000, -313.000000)"
|
|
2550
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
2551
|
+
id: "mastercard",
|
|
2552
|
+
transform: "translate(269.000000, 313.000000)"
|
|
2553
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
2554
|
+
id: "Rectangle",
|
|
2555
|
+
fill: "#FFFFFF",
|
|
2556
|
+
x: "0",
|
|
2557
|
+
y: "0",
|
|
2558
|
+
width: "24",
|
|
2559
|
+
height: "16",
|
|
2560
|
+
rx: "1"
|
|
2561
|
+
}), /*#__PURE__*/React.createElement("g", {
|
|
2562
|
+
id: "Group-6",
|
|
2563
|
+
transform: "translate(4.000000, 3.000000)"
|
|
2564
|
+
}, /*#__PURE__*/React.createElement("circle", {
|
|
2565
|
+
id: "Oval-4-Copy",
|
|
2566
|
+
fill: "#EA001B",
|
|
2567
|
+
cx: "5.05263158",
|
|
2568
|
+
cy: "5.05263158",
|
|
2569
|
+
r: "5.05263158"
|
|
2570
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
2571
|
+
id: "Oval-4",
|
|
2572
|
+
fillOpacity: "0.25",
|
|
2573
|
+
fill: "#F79F1A",
|
|
2574
|
+
cx: "10.9473684",
|
|
2575
|
+
cy: "5.05263158",
|
|
2576
|
+
r: "5.05263158"
|
|
2577
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
2578
|
+
id: "Oval-4-Copy-2",
|
|
2579
|
+
fillOpacity: "0.9",
|
|
2580
|
+
fill: "#F79F1A",
|
|
2581
|
+
cx: "10.9473684",
|
|
2582
|
+
cy: "5.05263158",
|
|
2583
|
+
r: "5.05263158"
|
|
2584
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
2585
|
+
id: "Oval-4-Copy-3",
|
|
2586
|
+
fillOpacity: "0.3",
|
|
2587
|
+
fill: "#EA001B",
|
|
2588
|
+
cx: "5.05263158",
|
|
2589
|
+
cy: "5.05263158",
|
|
2590
|
+
r: "5.05263158"
|
|
2591
|
+
}))))));
|
|
2592
|
+
};
|
|
2593
|
+
|
|
2594
|
+
var CbCard = function CbCard() {
|
|
2595
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
2596
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2597
|
+
width: "24",
|
|
2598
|
+
height: "16",
|
|
2599
|
+
viewBox: "0 0 24 16"
|
|
2600
|
+
}, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
|
2601
|
+
id: "cardcb",
|
|
2602
|
+
x1: "5.842%",
|
|
2603
|
+
x2: "95.393%",
|
|
2604
|
+
y1: "81.753%",
|
|
2605
|
+
y2: "17.344%"
|
|
2606
|
+
}, /*#__PURE__*/React.createElement("stop", {
|
|
2607
|
+
offset: "0%",
|
|
2608
|
+
stopColor: "#39B54A"
|
|
2609
|
+
}), ' ', /*#__PURE__*/React.createElement("stop", {
|
|
2610
|
+
offset: "100%",
|
|
2611
|
+
stopColor: "#0A5296"
|
|
2612
|
+
}))), /*#__PURE__*/React.createElement("g", {
|
|
2613
|
+
fill: "none",
|
|
2614
|
+
fillRule: "nonzero"
|
|
2615
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
2616
|
+
fill: "url(#cardcb)",
|
|
2617
|
+
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"
|
|
2618
|
+
}), /*#__PURE__*/React.createElement("g", {
|
|
2619
|
+
fill: "#FFF"
|
|
2620
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
2621
|
+
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"
|
|
2622
|
+
}))));
|
|
2623
|
+
};
|
|
2624
|
+
|
|
2625
|
+
var s$4 = {"cardContainer":"_1N3yO","card":"_83cGn"};
|
|
2626
|
+
|
|
2627
|
+
var Cards = function Cards(_ref) {
|
|
2628
|
+
var cards = _ref.cards;
|
|
2629
|
+
// We transform to a Set and back to avoid duplicate values (ex : amex, amex)
|
|
2630
|
+
var uniqueCards = Array.from(new Set(cards));
|
|
2631
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2632
|
+
"data-testid": "card-logos",
|
|
2633
|
+
className: cx(s$4.cardContainer, STATIC_CUSTOMISATION_CLASSES.cardContainer)
|
|
2634
|
+
}, uniqueCards.map(function (card) {
|
|
2635
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2636
|
+
key: card,
|
|
2637
|
+
className: s$4.card,
|
|
2638
|
+
"data-testid": "card-logo-" + card
|
|
2639
|
+
}, 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));
|
|
2640
|
+
}));
|
|
2641
|
+
};
|
|
2642
|
+
|
|
2643
|
+
var s$5 = {"list":"_180ro","listItem":"_1HqCO","bullet":"_3B8wx"};
|
|
2473
2644
|
|
|
2474
2645
|
var Info = function Info() {
|
|
2475
2646
|
return /*#__PURE__*/React.createElement("div", {
|
|
2476
|
-
className: cx(s$
|
|
2647
|
+
className: cx(s$5.list, STATIC_CUSTOMISATION_CLASSES.info),
|
|
2477
2648
|
"data-testid": "modal-info-element"
|
|
2478
2649
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2479
|
-
className: s$
|
|
2650
|
+
className: s$5.listItem
|
|
2480
2651
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2481
|
-
className: s$
|
|
2652
|
+
className: s$5.bullet
|
|
2482
2653
|
}, "1"), /*#__PURE__*/React.createElement("div", {
|
|
2483
2654
|
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2484
2655
|
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
@@ -2490,9 +2661,9 @@ var Info = function Info() {
|
|
|
2490
2661
|
}
|
|
2491
2662
|
}
|
|
2492
2663
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
2493
|
-
className: s$
|
|
2664
|
+
className: s$5.listItem
|
|
2494
2665
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2495
|
-
className: s$
|
|
2666
|
+
className: s$5.bullet
|
|
2496
2667
|
}, "2"), /*#__PURE__*/React.createElement("div", {
|
|
2497
2668
|
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2498
2669
|
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
@@ -2504,9 +2675,9 @@ var Info = function Info() {
|
|
|
2504
2675
|
}
|
|
2505
2676
|
}
|
|
2506
2677
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
2507
|
-
className: s$
|
|
2678
|
+
className: s$5.listItem
|
|
2508
2679
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2509
|
-
className: s$
|
|
2680
|
+
className: s$5.bullet
|
|
2510
2681
|
}, "3"), /*#__PURE__*/React.createElement("div", {
|
|
2511
2682
|
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2512
2683
|
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
@@ -2520,12 +2691,21 @@ var Info = function Info() {
|
|
|
2520
2691
|
}))));
|
|
2521
2692
|
};
|
|
2522
2693
|
|
|
2694
|
+
var COLORS;
|
|
2695
|
+
|
|
2696
|
+
(function (COLORS) {
|
|
2697
|
+
COLORS["ALMA"] = "#FF414D";
|
|
2698
|
+
COLORS["MONOCHROME"] = "#00425D";
|
|
2699
|
+
})(COLORS || (COLORS = {}));
|
|
2700
|
+
|
|
2523
2701
|
function LogoIcon(_ref) {
|
|
2524
|
-
var
|
|
2525
|
-
|
|
2526
|
-
_ref$
|
|
2527
|
-
|
|
2528
|
-
|
|
2702
|
+
var className = _ref.className,
|
|
2703
|
+
_ref$color = _ref.color,
|
|
2704
|
+
color = _ref$color === void 0 ? COLORS.MONOCHROME : _ref$color,
|
|
2705
|
+
_ref$monochrome = _ref.monochrome,
|
|
2706
|
+
monochrome = _ref$monochrome === void 0 ? true : _ref$monochrome,
|
|
2707
|
+
underlineColor = _ref.underlineColor;
|
|
2708
|
+
var defaultUnderlineColor = monochrome ? COLORS.MONOCHROME : COLORS.ALMA;
|
|
2529
2709
|
return /*#__PURE__*/React.createElement("svg", {
|
|
2530
2710
|
className: className,
|
|
2531
2711
|
width: "35",
|
|
@@ -2549,26 +2729,26 @@ function LogoIcon(_ref) {
|
|
|
2549
2729
|
y: "20",
|
|
2550
2730
|
width: "40",
|
|
2551
2731
|
height: "3",
|
|
2552
|
-
fill: underlineColor
|
|
2732
|
+
fill: underlineColor || defaultUnderlineColor
|
|
2553
2733
|
}));
|
|
2554
2734
|
}
|
|
2555
2735
|
|
|
2556
|
-
var s$
|
|
2736
|
+
var s$6 = {"logo":"_3Oyv_"};
|
|
2557
2737
|
|
|
2558
2738
|
var Logo = function Logo() {
|
|
2559
2739
|
return /*#__PURE__*/React.createElement("div", {
|
|
2560
|
-
className: s$
|
|
2740
|
+
className: s$6.logo
|
|
2561
2741
|
}, /*#__PURE__*/React.createElement(LogoIcon, {
|
|
2562
2742
|
underlineColor: "#FF414D"
|
|
2563
2743
|
}));
|
|
2564
2744
|
};
|
|
2565
2745
|
|
|
2566
|
-
var s$
|
|
2746
|
+
var s$7 = {"title":"_3ERx-"};
|
|
2567
2747
|
|
|
2568
2748
|
var Title = function Title(_ref) {
|
|
2569
2749
|
var isSomePlanDeferred = _ref.isSomePlanDeferred;
|
|
2570
2750
|
return /*#__PURE__*/React.createElement("div", {
|
|
2571
|
-
className: cx(s$
|
|
2751
|
+
className: cx(s$7.title, STATIC_CUSTOMISATION_CLASSES.title),
|
|
2572
2752
|
"data-testid": "modal-title-element"
|
|
2573
2753
|
}, isSomePlanDeferred ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2574
2754
|
id: 'eligibility-modal.title-deferred',
|
|
@@ -2589,43 +2769,50 @@ var Title = function Title(_ref) {
|
|
|
2589
2769
|
}));
|
|
2590
2770
|
};
|
|
2591
2771
|
|
|
2592
|
-
var s$
|
|
2772
|
+
var s$8 = {"container":"_21g6u","block":"_3zaP5","left":"_2SBRC"};
|
|
2593
2773
|
|
|
2594
2774
|
var DesktopModal = function DesktopModal(_ref) {
|
|
2595
2775
|
var children = _ref.children,
|
|
2596
|
-
isSomePlanDeferred = _ref.isSomePlanDeferred
|
|
2776
|
+
isSomePlanDeferred = _ref.isSomePlanDeferred,
|
|
2777
|
+
cards = _ref.cards;
|
|
2597
2778
|
return /*#__PURE__*/React.createElement("div", {
|
|
2598
|
-
className: s$
|
|
2779
|
+
className: s$8.container,
|
|
2599
2780
|
"data-testid": "modal-container"
|
|
2600
2781
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2601
|
-
className: cx([s$
|
|
2782
|
+
className: cx([s$8.block, s$8.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
|
|
2602
2783
|
}, /*#__PURE__*/React.createElement(Title, {
|
|
2603
2784
|
isSomePlanDeferred: isSomePlanDeferred
|
|
2604
|
-
}), /*#__PURE__*/React.createElement(Info, null),
|
|
2605
|
-
|
|
2785
|
+
}), /*#__PURE__*/React.createElement(Info, null), cards && /*#__PURE__*/React.createElement(Cards, {
|
|
2786
|
+
cards: cards
|
|
2787
|
+
}), /*#__PURE__*/React.createElement(Logo, null)), /*#__PURE__*/React.createElement("div", {
|
|
2788
|
+
className: cx(s$8.block, STATIC_CUSTOMISATION_CLASSES.rightSide)
|
|
2606
2789
|
}, children));
|
|
2607
2790
|
};
|
|
2608
2791
|
|
|
2609
|
-
var s$
|
|
2792
|
+
var s$9 = {"noEligibility":"_17qNJ","loader":"_2oTJq"};
|
|
2610
2793
|
|
|
2611
|
-
var s$
|
|
2794
|
+
var s$a = {"container":"_2G7Ch"};
|
|
2612
2795
|
|
|
2613
2796
|
var MobileModal = function MobileModal(_ref) {
|
|
2614
2797
|
var children = _ref.children,
|
|
2615
|
-
isSomePlanDeferred = _ref.isSomePlanDeferred
|
|
2798
|
+
isSomePlanDeferred = _ref.isSomePlanDeferred,
|
|
2799
|
+
cards = _ref.cards;
|
|
2616
2800
|
return /*#__PURE__*/React.createElement("div", {
|
|
2617
|
-
className: s$
|
|
2801
|
+
className: s$a.container,
|
|
2618
2802
|
"data-testid": "modal-container"
|
|
2619
2803
|
}, /*#__PURE__*/React.createElement(Title, {
|
|
2620
2804
|
isSomePlanDeferred: isSomePlanDeferred
|
|
2621
|
-
}), children, /*#__PURE__*/React.createElement(Info, null), /*#__PURE__*/React.createElement(
|
|
2805
|
+
}), children, /*#__PURE__*/React.createElement(Info, null), cards && /*#__PURE__*/React.createElement(Cards, {
|
|
2806
|
+
cards: cards
|
|
2807
|
+
}), /*#__PURE__*/React.createElement(Logo, null));
|
|
2622
2808
|
};
|
|
2623
2809
|
|
|
2624
2810
|
var EligibilityModal = function EligibilityModal(_ref) {
|
|
2625
2811
|
var initialPlanIndex = _ref.initialPlanIndex,
|
|
2626
2812
|
onClose = _ref.onClose,
|
|
2627
2813
|
eligibilityPlans = _ref.eligibilityPlans,
|
|
2628
|
-
status = _ref.status
|
|
2814
|
+
status = _ref.status,
|
|
2815
|
+
cards = _ref.cards;
|
|
2629
2816
|
|
|
2630
2817
|
var _useState = useState(initialPlanIndex || 0),
|
|
2631
2818
|
currentPlanIndex = _useState[0],
|
|
@@ -2648,11 +2835,12 @@ var EligibilityModal = function EligibilityModal(_ref) {
|
|
|
2648
2835
|
scrollable: true,
|
|
2649
2836
|
isOpen: true
|
|
2650
2837
|
}, /*#__PURE__*/React.createElement(ModalComponent, {
|
|
2651
|
-
isSomePlanDeferred: isSomePlanDeferred
|
|
2838
|
+
isSomePlanDeferred: isSomePlanDeferred,
|
|
2839
|
+
cards: cards
|
|
2652
2840
|
}, status === apiStatus.PENDING && /*#__PURE__*/React.createElement("div", {
|
|
2653
|
-
className: s$
|
|
2841
|
+
className: s$9.loader
|
|
2654
2842
|
}, /*#__PURE__*/React.createElement(LoadingIndicator, null)), status === apiStatus.SUCCESS && eligiblePlans.length === 0 && /*#__PURE__*/React.createElement("div", {
|
|
2655
|
-
className: s$
|
|
2843
|
+
className: s$9.noEligibility
|
|
2656
2844
|
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2657
2845
|
id: "eligibility-modal.no-eligibility",
|
|
2658
2846
|
defaultMessage: "Oups, il semblerait que la simulation n'ait pas fonctionn\xE9."
|
|
@@ -2673,7 +2861,8 @@ var ModalContainer = function ModalContainer(_ref) {
|
|
|
2673
2861
|
var purchaseAmount = _ref.purchaseAmount,
|
|
2674
2862
|
apiData = _ref.apiData,
|
|
2675
2863
|
configPlans = _ref.configPlans,
|
|
2676
|
-
onClose = _ref.onClose
|
|
2864
|
+
onClose = _ref.onClose,
|
|
2865
|
+
cards = _ref.cards;
|
|
2677
2866
|
|
|
2678
2867
|
var _useFetchEligibility = useFetchEligibility(purchaseAmount, apiData, configPlans),
|
|
2679
2868
|
eligibilityPlans = _useFetchEligibility[0],
|
|
@@ -2683,21 +2872,22 @@ var ModalContainer = function ModalContainer(_ref) {
|
|
|
2683
2872
|
initialPlanIndex: 0,
|
|
2684
2873
|
onClose: onClose,
|
|
2685
2874
|
eligibilityPlans: eligibilityPlans,
|
|
2686
|
-
status: status
|
|
2875
|
+
status: status,
|
|
2876
|
+
cards: cards
|
|
2687
2877
|
});
|
|
2688
2878
|
};
|
|
2689
2879
|
|
|
2690
|
-
var s$
|
|
2880
|
+
var s$b = {"loadingIndicator":"_2SwwZ","line1":"_2qODo","line2":"_2YO01"};
|
|
2691
2881
|
|
|
2692
2882
|
var Loader = function Loader(_ref) {
|
|
2693
2883
|
var className = _ref.className;
|
|
2694
2884
|
return /*#__PURE__*/React.createElement("div", {
|
|
2695
|
-
className: cx(s$
|
|
2885
|
+
className: cx(s$b.loadingIndicator, className),
|
|
2696
2886
|
"data-testid": "loader"
|
|
2697
2887
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2698
|
-
className: s$
|
|
2888
|
+
className: s$b.line1
|
|
2699
2889
|
}), /*#__PURE__*/React.createElement("div", {
|
|
2700
|
-
className: s$
|
|
2890
|
+
className: s$b.line2
|
|
2701
2891
|
}));
|
|
2702
2892
|
};
|
|
2703
2893
|
|
|
@@ -2790,7 +2980,7 @@ var STATIC_CUSTOMISATION_CLASSES$1 = {
|
|
|
2790
2980
|
activeOption: prefix$1 + '-active-option'
|
|
2791
2981
|
};
|
|
2792
2982
|
|
|
2793
|
-
var s$
|
|
2983
|
+
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"};
|
|
2794
2984
|
|
|
2795
2985
|
var VERY_LONG_TIME_IN_MS = 1000 * 3600 * 24 * 365;
|
|
2796
2986
|
var DEFAULT_TRANSITION_TIME = 5500;
|
|
@@ -2798,12 +2988,14 @@ var DEFAULT_TRANSITION_TIME = 5500;
|
|
|
2798
2988
|
var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
|
|
2799
2989
|
var _cx, _cx3;
|
|
2800
2990
|
|
|
2801
|
-
var
|
|
2802
|
-
apiData = _ref.apiData,
|
|
2991
|
+
var apiData = _ref.apiData,
|
|
2803
2992
|
configPlans = _ref.configPlans,
|
|
2804
|
-
transitionDelay = _ref.transitionDelay,
|
|
2805
2993
|
hideIfNotEligible = _ref.hideIfNotEligible,
|
|
2806
|
-
|
|
2994
|
+
monochrome = _ref.monochrome,
|
|
2995
|
+
purchaseAmount = _ref.purchaseAmount,
|
|
2996
|
+
suggestedPaymentPlan = _ref.suggestedPaymentPlan,
|
|
2997
|
+
cards = _ref.cards,
|
|
2998
|
+
transitionDelay = _ref.transitionDelay;
|
|
2807
2999
|
|
|
2808
3000
|
var _useFetchEligibility = useFetchEligibility(purchaseAmount, apiData, configPlans),
|
|
2809
3001
|
eligibilityPlans = _useFetchEligibility[0],
|
|
@@ -2883,7 +3075,7 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
|
|
|
2883
3075
|
|
|
2884
3076
|
if (status === apiStatus.PENDING) {
|
|
2885
3077
|
return /*#__PURE__*/React.createElement("div", {
|
|
2886
|
-
className: cx(s$
|
|
3078
|
+
className: cx(s$c.widgetButton, s$c.pending)
|
|
2887
3079
|
}, /*#__PURE__*/React.createElement(Loader, null));
|
|
2888
3080
|
}
|
|
2889
3081
|
|
|
@@ -2901,32 +3093,35 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
|
|
|
2901
3093
|
|
|
2902
3094
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
2903
3095
|
onClick: handleOpenModal,
|
|
2904
|
-
className: cx(s$
|
|
3096
|
+
className: cx(s$c.widgetButton, (_cx = {}, _cx[s$c.clickable] = eligiblePlans.length > 0, _cx[s$c.unClickable] = eligiblePlans.length === 0, _cx), STATIC_CUSTOMISATION_CLASSES$1.container),
|
|
2905
3097
|
"data-testid": "widget-button"
|
|
2906
3098
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2907
|
-
className: cx(s$
|
|
3099
|
+
className: cx(s$c.primaryContainer, STATIC_CUSTOMISATION_CLASSES$1.eligibilityLine)
|
|
2908
3100
|
}, /*#__PURE__*/React.createElement(LogoIcon, {
|
|
2909
|
-
className: s$
|
|
3101
|
+
className: s$c.logo,
|
|
3102
|
+
monochrome: monochrome
|
|
2910
3103
|
}), /*#__PURE__*/React.createElement("div", {
|
|
2911
|
-
className: cx(s$
|
|
3104
|
+
className: cx(s$c.paymentPlans, STATIC_CUSTOMISATION_CLASSES$1.eligibilityOptions)
|
|
2912
3105
|
}, eligibilityPlans.map(function (eligibilityPlan, key) {
|
|
2913
3106
|
var _cx2;
|
|
2914
3107
|
|
|
3108
|
+
var isCurrent = key === current;
|
|
2915
3109
|
return /*#__PURE__*/React.createElement("div", {
|
|
2916
3110
|
key: key,
|
|
2917
3111
|
onMouseEnter: function onMouseEnter() {
|
|
2918
3112
|
return onHover(key);
|
|
2919
3113
|
},
|
|
2920
3114
|
onMouseOut: onLeave,
|
|
2921
|
-
className: cx(s$
|
|
3115
|
+
className: cx(s$c.plan, (_cx2 = {}, _cx2[cx(s$c.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)] = isCurrent, _cx2[s$c.polychrome] = !monochrome && isCurrent, _cx2[cx(s$c.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)] = !eligibilityPlan.eligible, _cx2))
|
|
2922
3116
|
}, paymentPlanShorthandName(eligibilityPlan));
|
|
2923
3117
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
2924
|
-
className: cx(s$
|
|
3118
|
+
className: cx(s$c.info, (_cx3 = {}, _cx3[cx(s$c.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)] = eligibilityPlans[current] && !eligibilityPlans[current].eligible, _cx3), STATIC_CUSTOMISATION_CLASSES$1.paymentInfo)
|
|
2925
3119
|
}, eligibilityPlans.length !== 0 && paymentPlanInfoText(eligibilityPlans[current]))), isOpen && /*#__PURE__*/React.createElement(EligibilityModal, {
|
|
2926
3120
|
initialPlanIndex: getIndexWithinEligiblePlans(current),
|
|
2927
3121
|
onClose: closeModal,
|
|
2928
3122
|
eligibilityPlans: eligiblePlans,
|
|
2929
|
-
status: status
|
|
3123
|
+
status: status,
|
|
3124
|
+
cards: cards
|
|
2930
3125
|
}));
|
|
2931
3126
|
};
|
|
2932
3127
|
|
|
@@ -2952,20 +3147,25 @@ var WidgetsController = /*#__PURE__*/function () {
|
|
|
2952
3147
|
plans = options.plans,
|
|
2953
3148
|
transitionDelay = options.transitionDelay,
|
|
2954
3149
|
hideIfNotEligible = options.hideIfNotEligible,
|
|
3150
|
+
_options$monochrome = options.monochrome,
|
|
3151
|
+
monochrome = _options$monochrome === void 0 ? true : _options$monochrome,
|
|
2955
3152
|
suggestedPaymentPlan = options.suggestedPaymentPlan,
|
|
2956
3153
|
_options$locale = options.locale,
|
|
2957
|
-
locale = _options$locale === void 0 ? Locale.en : _options$locale
|
|
3154
|
+
locale = _options$locale === void 0 ? Locale.en : _options$locale,
|
|
3155
|
+
cards = options.cards;
|
|
2958
3156
|
|
|
2959
3157
|
if (containerDiv) {
|
|
2960
3158
|
render( /*#__PURE__*/React.createElement(Provider, {
|
|
2961
3159
|
locale: locale
|
|
2962
3160
|
}, /*#__PURE__*/React.createElement(PaymentPlanWidget, {
|
|
2963
|
-
purchaseAmount: purchaseAmount,
|
|
2964
3161
|
apiData: this.apiData,
|
|
2965
3162
|
configPlans: plans,
|
|
2966
|
-
transitionDelay: transitionDelay,
|
|
2967
3163
|
hideIfNotEligible: hideIfNotEligible,
|
|
2968
|
-
|
|
3164
|
+
monochrome: monochrome,
|
|
3165
|
+
purchaseAmount: purchaseAmount,
|
|
3166
|
+
suggestedPaymentPlan: suggestedPaymentPlan,
|
|
3167
|
+
cards: cards,
|
|
3168
|
+
transitionDelay: transitionDelay
|
|
2969
3169
|
})), document.querySelector(container));
|
|
2970
3170
|
}
|
|
2971
3171
|
}
|
|
@@ -2976,7 +3176,8 @@ var WidgetsController = /*#__PURE__*/function () {
|
|
|
2976
3176
|
_purchaseAmount = options.purchaseAmount,
|
|
2977
3177
|
_plans = options.plans,
|
|
2978
3178
|
_options$locale2 = options.locale,
|
|
2979
|
-
_locale = _options$locale2 === void 0 ? Locale.en : _options$locale2
|
|
3179
|
+
_locale = _options$locale2 === void 0 ? Locale.en : _options$locale2,
|
|
3180
|
+
_cards = options.cards;
|
|
2980
3181
|
|
|
2981
3182
|
var close = function close() {
|
|
2982
3183
|
return containerDiv && unmountComponentAtNode(containerDiv);
|
|
@@ -2989,7 +3190,8 @@ var WidgetsController = /*#__PURE__*/function () {
|
|
|
2989
3190
|
purchaseAmount: _purchaseAmount,
|
|
2990
3191
|
apiData: _this.apiData,
|
|
2991
3192
|
configPlans: _plans,
|
|
2992
|
-
onClose: close
|
|
3193
|
+
onClose: close,
|
|
3194
|
+
cards: _cards
|
|
2993
3195
|
})), document.querySelector(_container));
|
|
2994
3196
|
}; // if clickableSelector is provided, add an onClick event handler to open the Modal.
|
|
2995
3197
|
|