@alma/widgets 2.11.0 → 2.12.1

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.
@@ -1531,6 +1531,7 @@ var Locale;
1531
1531
  Locale["it"] = "it";
1532
1532
  Locale["es"] = "es";
1533
1533
  Locale["nl"] = "nl";
1534
+ Locale["pt"] = "pt";
1534
1535
  Locale["nl-NL"] = "nl-NL";
1535
1536
  Locale["nl-BE"] = "nl-BE";
1536
1537
  })(Locale || (Locale = {}));
@@ -1544,6 +1545,7 @@ function priceFromCents(cents) {
1544
1545
  function formatCents(cents) {
1545
1546
  return String(priceFromCents(cents)).replace('.', ',');
1546
1547
  }
1548
+ const desktopWidth = 800;
1547
1549
 
1548
1550
  /* eslint-disable */
1549
1551
 
@@ -1853,7 +1855,7 @@ if (!''.trim) String.prototype.trim = function () {
1853
1855
  var messagesDE = {
1854
1856
  "eligibility-modal.bullet-1": "Wählen Sie an der Kasse <strong>Alma</strong> .",
1855
1857
  "eligibility-modal.bullet-2": "Füllen Sie die <strong>angeforderten</strong> Informationen aus.",
1856
- "eligibility-modal.bullet-3": "Die Bestätigung Ihrer Zahlung <strong>sofort</strong> !",
1858
+ "eligibility-modal.bullet-3": "Die Bestätigung Ihrer Zahlung erfolgt <strong>sofort</strong> !",
1857
1859
  "eligibility-modal.cost": "Davon Kosten",
1858
1860
  "eligibility-modal.credit-commitment": "Ein Kredit verpflichtet Sie und muss zurückgezahlt werden. Prüfen Sie Ihre Rückzahlungsfähigkeit, bevor Sie sich verpflichten.",
1859
1861
  "eligibility-modal.credit-cost": "Davon Kreditkosten",
@@ -1876,7 +1878,7 @@ var messagesDE = {
1876
1878
  var messagesEN = {
1877
1879
  "eligibility-modal.bullet-1": "Choose <strong>Alma</strong> at checkout.",
1878
1880
  "eligibility-modal.bullet-2": "Fill in the <strong>information</strong> requested.",
1879
- "eligibility-modal.bullet-3": "Validation of your payment <strong>instantaneous</strong>!",
1881
+ "eligibility-modal.bullet-3": "The validation of your payment is <strong>instantaneous</strong> !",
1880
1882
  "eligibility-modal.cost": "Of which costs",
1881
1883
  "eligibility-modal.credit-commitment": "A loan commits you and must be repaid. Check your ability to repay before committing yourself.",
1882
1884
  "eligibility-modal.credit-cost": "Of which cost of credit",
@@ -1899,7 +1901,7 @@ var messagesEN = {
1899
1901
  var messagesES = {
1900
1902
  "eligibility-modal.bullet-1": "Elige <strong>Alma</strong> como método de pago.",
1901
1903
  "eligibility-modal.bullet-2": "Completa la <strong>información</strong> solicitada.",
1902
- "eligibility-modal.bullet-3": "¡Validación <strong>inmediata</strong> de tu pago!",
1904
+ "eligibility-modal.bullet-3": "¡La validación de su pago es <strong>instantánea</strong> !",
1903
1905
  "eligibility-modal.cost": "Gastos (incl. en el total)",
1904
1906
  "eligibility-modal.credit-commitment": "Un préstamo te compromete y debe ser devuelto. Comprueba tu capacidad financiera antes de comprometerte.",
1905
1907
  "eligibility-modal.credit-cost": "Coste de crédito (incl. en el total)",
@@ -1922,7 +1924,7 @@ var messagesES = {
1922
1924
  var messagesFR = {
1923
1925
  "eligibility-modal.bullet-1": "Choisissez <strong>Alma</strong> au moment du paiement.",
1924
1926
  "eligibility-modal.bullet-2": "Renseignez les <strong>informations</strong> demandées.",
1925
- "eligibility-modal.bullet-3": "La validation de votre paiement <strong>instantanée</strong> !",
1927
+ "eligibility-modal.bullet-3": "La validation de votre paiement est <strong>instantanée</strong> !",
1926
1928
  "eligibility-modal.cost": "Dont frais",
1927
1929
  "eligibility-modal.credit-commitment": "Un crédit vous engage et doit être remboursé. Vérifiez vos capacités de remboursement avant de vous engager.",
1928
1930
  "eligibility-modal.credit-cost": "Dont coût du crédit",
@@ -1945,7 +1947,7 @@ var messagesFR = {
1945
1947
  var messagesIT = {
1946
1948
  "eligibility-modal.bullet-1": "Scegli <strong>Alma</strong> alla cassa.",
1947
1949
  "eligibility-modal.bullet-2": "Compila le informazioni <strong></strong> richieste.",
1948
- "eligibility-modal.bullet-3": "Convalida del tuo pagamento <strong>istantanea</strong>!",
1950
+ "eligibility-modal.bullet-3": "La convalida del pagamento è <strong>istantanea</strong> !",
1949
1951
  "eligibility-modal.cost": "Di cui commissioni",
1950
1952
  "eligibility-modal.credit-commitment": "Un pagamento rateale ti impegna e deve essere ripagato. Verifica la tua capacità di rimborso prima di impegnarti.",
1951
1953
  "eligibility-modal.credit-cost": "Di cui commissioni",
@@ -1968,24 +1970,47 @@ var messagesIT = {
1968
1970
  var messagesNL = {
1969
1971
  "eligibility-modal.bullet-1": "Kies <strong>Alma</strong> bij het afrekenen.",
1970
1972
  "eligibility-modal.bullet-2": "Vul de <strong>gevraagde informatie</strong> in.",
1971
- "eligibility-modal.bullet-3": "Onmiddelijke validatie van uw betaling ",
1973
+ "eligibility-modal.bullet-3": "De validatie van uw betaling is <strong>onmiddellijk</strong> !",
1972
1974
  "eligibility-modal.cost": "Waarvan kosten",
1973
1975
  "eligibility-modal.credit-commitment": "Een lening bindt je en moet worden terugbetaald. Ga na of u kunt terugbetalen voordat u zich vastlegt.",
1974
1976
  "eligibility-modal.credit-cost": "Waarvan kosten van krediet",
1975
- "eligibility-modal.credit-cost-amount": "{creditCost} (APR {TAEG})",
1977
+ "eligibility-modal.credit-cost-amount": "{creditCost} (gemiddeld rente percentage {TAEG})",
1976
1978
  "eligibility-modal.no-eligibility": "Oeps, het lijkt erop dat de simulatie niet werkte.",
1977
- "eligibility-modal.title": "<highlighted>Betaal in termijnen</highlighted> met kredietkaart bij Alma.",
1978
- "eligibility-modal.title-deferred": "<highlighted>Betaal in termijnen</highlighted> of later per credit card met Alma.",
1979
+ "eligibility-modal.title": "<highlighted>Betaal in termijnen</highlighted> met bank- en kredietkaart bij Alma.",
1980
+ "eligibility-modal.title-deferred": "<highlighted>Betaal in termijnen</highlighted> of later per bank- en kredietkaart met Alma.",
1979
1981
  "eligibility-modal.total": "Totaal",
1980
1982
  "installments.today": "Tegenwoordig",
1981
- "payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
1983
+ "payment-plan-strings.day-abbreviation": "D{numberOfDeferredDays}",
1982
1984
  "payment-plan-strings.default-message": "Betaal in termijnen met Alma",
1983
1985
  "payment-plan-strings.deferred": "{totalAmount} te betalen op {dueDate}",
1984
1986
  "payment-plan-strings.ineligible-greater-than-max": "Tot {maxAmount}",
1985
1987
  "payment-plan-strings.ineligible-lower-than-min": "Van {minAmount}",
1986
1988
  "payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} dan {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} dan {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
1987
1989
  "payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
1988
- "payment-plan-strings.no-fee": "(gratis)"
1990
+ "payment-plan-strings.no-fee": "(zonder kosten)"
1991
+ };
1992
+
1993
+ var messagesPT = {
1994
+ "eligibility-modal.bullet-1": "Escolha a <strong>Alma</strong> no checkout.",
1995
+ "eligibility-modal.bullet-2": "Preencha os <strong>dados</strong> solicitados.",
1996
+ "eligibility-modal.bullet-3": "A validação do seu pagamento é <strong>instantaneamente</strong> !",
1997
+ "eligibility-modal.cost": "Incluindo encargos",
1998
+ "eligibility-modal.credit-commitment": "Um crédito é um compromisso e deve ser reembolsado. Verifique a sua capacidade de pagar antes de se comprometer.",
1999
+ "eligibility-modal.credit-cost": "Incluindo custo do crédito",
2000
+ "eligibility-modal.credit-cost-amount": "{creditCost} (TAEG {TAEG})",
2001
+ "eligibility-modal.no-eligibility": "Ups, parece que a simulação não funcionou.",
2002
+ "eligibility-modal.title": "<highlighted>Pague em prestações</highlighted> com cartão bancário através da Alma.",
2003
+ "eligibility-modal.title-deferred": "<highlighted>Pague em prestações</highlighted> ou mais tarde com cartão bancário através da Alma.",
2004
+ "eligibility-modal.total": "Total",
2005
+ "installments.today": "Hoje",
2006
+ "payment-plan-strings.day-abbreviation": "D{numberOfDeferredDays}",
2007
+ "payment-plan-strings.default-message": "Pague em prestações através da Alma",
2008
+ "payment-plan-strings.deferred": "{totalAmount} a pagar em {dueDate}",
2009
+ "payment-plan-strings.ineligible-greater-than-max": "Até {maxAmount}",
2010
+ "payment-plan-strings.ineligible-lower-than-min": "A partir de {minAmount}",
2011
+ "payment-plan-strings.multiple-installments": "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} depois {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} depois {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
2012
+ "payment-plan-strings.multiple-installments-same-amount": "{installmentsCount} x {totalAmount}",
2013
+ "payment-plan-strings.no-fee": "(sem encargos)"
1989
2014
  };
1990
2015
 
1991
2016
  const getTranslationsByLocale = locale => {
@@ -2002,6 +2027,9 @@ const getTranslationsByLocale = locale => {
2002
2027
  case Locale.de:
2003
2028
  return messagesDE;
2004
2029
 
2030
+ case Locale.pt:
2031
+ return messagesPT;
2032
+
2005
2033
  case Locale.nl:
2006
2034
  case Locale['nl-BE']:
2007
2035
  case Locale['nl-NL']:
@@ -2184,7 +2212,10 @@ const prefix = 'alma-eligibility-modal';
2184
2212
  */
2185
2213
 
2186
2214
  const STATIC_CUSTOMISATION_CLASSES = {
2215
+ desktopModal: prefix + '-desktop-modal',
2216
+ mobileModal: prefix + '-mobile-modal',
2187
2217
  leftSide: prefix + '-left-side',
2218
+ bullet: prefix + '-bullet',
2188
2219
  rightSide: prefix + '-right-side',
2189
2220
  title: prefix + '-title',
2190
2221
  info: prefix + '-info',
@@ -2394,11 +2425,11 @@ var s$3 = {"schedule":"_MPKjS","scheduleLine":"_1A7Qv","total":"_14Ejo","summary
2394
2425
  const Schedule = ({
2395
2426
  currentPlan
2396
2427
  }) => {
2397
- const total = currentPlan && priceFromCents(currentPlan.purchase_amount + currentPlan.customer_total_cost_amount);
2398
- const creditCost = currentPlan ? priceFromCents(currentPlan.customer_total_cost_amount) : 0;
2428
+ const total = priceFromCents(currentPlan.purchase_amount + currentPlan.customer_total_cost_amount);
2429
+ const creditCost = priceFromCents(currentPlan.customer_total_cost_amount);
2399
2430
  const TAEG = (currentPlan == null ? void 0 : currentPlan.annual_interest_rate) && currentPlan.annual_interest_rate / 10000;
2400
- const customerFees = priceFromCents(currentPlan ? currentPlan.customer_total_cost_amount : 0);
2401
- const isCredit = currentPlan && currentPlan.installments_count > 4;
2431
+ const customerFees = priceFromCents(currentPlan.customer_total_cost_amount);
2432
+ const isCredit = currentPlan.installments_count > 4;
2402
2433
  const intl = useIntl();
2403
2434
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2404
2435
  className: cx(s$3.schedule, STATIC_CUSTOMISATION_CLASSES.scheduleDetails),
@@ -2635,7 +2666,7 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
2635
2666
  }, /*#__PURE__*/React.createElement("div", {
2636
2667
  className: s$5.listItem
2637
2668
  }, /*#__PURE__*/React.createElement("div", {
2638
- className: s$5.bullet
2669
+ className: cx(s$5.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
2639
2670
  }, "1"), /*#__PURE__*/React.createElement("div", {
2640
2671
  className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2641
2672
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
@@ -2647,7 +2678,7 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
2647
2678
  }))), /*#__PURE__*/React.createElement("div", {
2648
2679
  className: s$5.listItem
2649
2680
  }, /*#__PURE__*/React.createElement("div", {
2650
- className: s$5.bullet
2681
+ className: cx(s$5.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
2651
2682
  }, "2"), /*#__PURE__*/React.createElement("div", {
2652
2683
  className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2653
2684
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
@@ -2659,12 +2690,12 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
2659
2690
  }))), /*#__PURE__*/React.createElement("div", {
2660
2691
  className: s$5.listItem
2661
2692
  }, /*#__PURE__*/React.createElement("div", {
2662
- className: s$5.bullet
2693
+ className: cx(s$5.bullet, STATIC_CUSTOMISATION_CLASSES.bullet)
2663
2694
  }, "3"), /*#__PURE__*/React.createElement("div", {
2664
2695
  className: STATIC_CUSTOMISATION_CLASSES.infoMessage
2665
2696
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
2666
2697
  id: "eligibility-modal.bullet-3",
2667
- defaultMessage: "La validation de votre paiement <strong>instantan\u00E9e</strong> !",
2698
+ defaultMessage: "La validation de votre paiement est <strong>instantan\u00E9e</strong> !",
2668
2699
  values: {
2669
2700
  strong: (...chunks) => /*#__PURE__*/React.createElement("strong", null, chunks)
2670
2701
  }
@@ -2747,7 +2778,7 @@ const DesktopModal = ({
2747
2778
  isSomePlanDeferred,
2748
2779
  cards
2749
2780
  }) => /*#__PURE__*/React.createElement("div", {
2750
- className: s$8.container,
2781
+ className: cx(s$8.container, STATIC_CUSTOMISATION_CLASSES.desktopModal),
2751
2782
  "data-testid": "modal-container"
2752
2783
  }, /*#__PURE__*/React.createElement("div", {
2753
2784
  className: cx([s$8.block, s$8.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
@@ -2768,7 +2799,7 @@ const MobileModal = ({
2768
2799
  isSomePlanDeferred,
2769
2800
  cards
2770
2801
  }) => /*#__PURE__*/React.createElement("div", {
2771
- className: s$a.container,
2802
+ className: cx(s$a.container, STATIC_CUSTOMISATION_CLASSES.mobileModal),
2772
2803
  "data-testid": "modal-container"
2773
2804
  }, /*#__PURE__*/React.createElement(Title, {
2774
2805
  isSomePlanDeferred: isSomePlanDeferred
@@ -2785,7 +2816,7 @@ const EligibilityModal = ({
2785
2816
  }) => {
2786
2817
  const [currentPlanIndex, setCurrentPlanIndex] = useState(initialPlanIndex || 0);
2787
2818
  const isBigScreen = useMediaQuery({
2788
- minWidth: 800
2819
+ minWidth: desktopWidth
2789
2820
  });
2790
2821
  const ModalComponent = isBigScreen ? DesktopModal : MobileModal;
2791
2822
  const eligiblePlans = eligibilityPlans.filter(plan => plan.eligible);