@alma/widgets 2.10.0 → 2.12.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.
@@ -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
 
@@ -1968,7 +1970,7 @@ 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": "Onmiddellijke validatie van uw betaling ",
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",
@@ -1988,6 +1990,29 @@ var messagesNL = {
1988
1990
  "payment-plan-strings.no-fee": "(gratis)"
1989
1991
  };
1990
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": "Validação do seu pagamento <strong>imediata</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)"
2014
+ };
2015
+
1991
2016
  const getTranslationsByLocale = locale => {
1992
2017
  switch (locale) {
1993
2018
  case Locale.fr:
@@ -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,7 +2690,7 @@ 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, {
@@ -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);