@alma/widgets 2.7.1 → 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.
@@ -18622,12 +18622,21 @@
18622
18622
  }))));
18623
18623
  };
18624
18624
 
18625
+ var COLORS;
18626
+
18627
+ (function (COLORS) {
18628
+ COLORS["ALMA"] = "#FF414D";
18629
+ COLORS["MONOCHROME"] = "#00425D";
18630
+ })(COLORS || (COLORS = {}));
18631
+
18625
18632
  function LogoIcon(_ref) {
18626
- var _ref$color = _ref.color,
18627
- color = _ref$color === void 0 ? '#00425D' : _ref$color,
18628
- _ref$underlineColor = _ref.underlineColor,
18629
- underlineColor = _ref$underlineColor === void 0 ? '#00425D' : _ref$underlineColor,
18630
- className = _ref.className;
18633
+ var className = _ref.className,
18634
+ _ref$color = _ref.color,
18635
+ color = _ref$color === void 0 ? COLORS.MONOCHROME : _ref$color,
18636
+ _ref$monochrome = _ref.monochrome,
18637
+ monochrome = _ref$monochrome === void 0 ? true : _ref$monochrome,
18638
+ underlineColor = _ref.underlineColor;
18639
+ var defaultUnderlineColor = monochrome ? COLORS.MONOCHROME : COLORS.ALMA;
18631
18640
  return /*#__PURE__*/react.createElement("svg", {
18632
18641
  className: className,
18633
18642
  width: "35",
@@ -18651,7 +18660,7 @@
18651
18660
  y: "20",
18652
18661
  width: "40",
18653
18662
  height: "3",
18654
- fill: underlineColor
18663
+ fill: underlineColor || defaultUnderlineColor
18655
18664
  }));
18656
18665
  }
18657
18666
 
@@ -18902,7 +18911,7 @@
18902
18911
  activeOption: prefix$1 + '-active-option'
18903
18912
  };
18904
18913
 
18905
- var s$c = {"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"};
18914
+ 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"};
18906
18915
 
18907
18916
  var VERY_LONG_TIME_IN_MS = 1000 * 3600 * 24 * 365;
18908
18917
  var DEFAULT_TRANSITION_TIME = 5500;
@@ -18910,13 +18919,14 @@
18910
18919
  var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
18911
18920
  var _cx, _cx3;
18912
18921
 
18913
- var purchaseAmount = _ref.purchaseAmount,
18914
- apiData = _ref.apiData,
18922
+ var apiData = _ref.apiData,
18915
18923
  configPlans = _ref.configPlans,
18916
- transitionDelay = _ref.transitionDelay,
18917
18924
  hideIfNotEligible = _ref.hideIfNotEligible,
18925
+ monochrome = _ref.monochrome,
18926
+ purchaseAmount = _ref.purchaseAmount,
18918
18927
  suggestedPaymentPlan = _ref.suggestedPaymentPlan,
18919
- cards = _ref.cards;
18928
+ cards = _ref.cards,
18929
+ transitionDelay = _ref.transitionDelay;
18920
18930
 
18921
18931
  var _useFetchEligibility = useFetchEligibility(purchaseAmount, apiData, configPlans),
18922
18932
  eligibilityPlans = _useFetchEligibility[0],
@@ -19019,19 +19029,21 @@
19019
19029
  }, /*#__PURE__*/react.createElement("div", {
19020
19030
  className: classnames(s$c.primaryContainer, STATIC_CUSTOMISATION_CLASSES$1.eligibilityLine)
19021
19031
  }, /*#__PURE__*/react.createElement(LogoIcon, {
19022
- className: s$c.logo
19032
+ className: s$c.logo,
19033
+ monochrome: monochrome
19023
19034
  }), /*#__PURE__*/react.createElement("div", {
19024
19035
  className: classnames(s$c.paymentPlans, STATIC_CUSTOMISATION_CLASSES$1.eligibilityOptions)
19025
19036
  }, eligibilityPlans.map(function (eligibilityPlan, key) {
19026
19037
  var _cx2;
19027
19038
 
19039
+ var isCurrent = key === current;
19028
19040
  return /*#__PURE__*/react.createElement("div", {
19029
19041
  key: key,
19030
19042
  onMouseEnter: function onMouseEnter() {
19031
19043
  return onHover(key);
19032
19044
  },
19033
19045
  onMouseOut: onLeave,
19034
- className: classnames(s$c.plan, (_cx2 = {}, _cx2[classnames(s$c.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)] = current === key, _cx2[classnames(s$c.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)] = !eligibilityPlan.eligible, _cx2))
19046
+ className: classnames(s$c.plan, (_cx2 = {}, _cx2[classnames(s$c.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)] = isCurrent, _cx2[s$c.polychrome] = !monochrome && isCurrent, _cx2[classnames(s$c.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)] = !eligibilityPlan.eligible, _cx2))
19035
19047
  }, paymentPlanShorthandName(eligibilityPlan));
19036
19048
  }))), /*#__PURE__*/react.createElement("div", {
19037
19049
  className: classnames(s$c.info, (_cx3 = {}, _cx3[classnames(s$c.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)] = eligibilityPlans[current] && !eligibilityPlans[current].eligible, _cx3), STATIC_CUSTOMISATION_CLASSES$1.paymentInfo)
@@ -19066,6 +19078,8 @@
19066
19078
  plans = options.plans,
19067
19079
  transitionDelay = options.transitionDelay,
19068
19080
  hideIfNotEligible = options.hideIfNotEligible,
19081
+ _options$monochrome = options.monochrome,
19082
+ monochrome = _options$monochrome === void 0 ? true : _options$monochrome,
19069
19083
  suggestedPaymentPlan = options.suggestedPaymentPlan,
19070
19084
  _options$locale = options.locale,
19071
19085
  locale = _options$locale === void 0 ? Locale.en : _options$locale,
@@ -19075,13 +19089,14 @@
19075
19089
  reactDom.render( /*#__PURE__*/react.createElement(Provider$1, {
19076
19090
  locale: locale
19077
19091
  }, /*#__PURE__*/react.createElement(PaymentPlanWidget, {
19078
- purchaseAmount: purchaseAmount,
19079
19092
  apiData: this.apiData,
19080
19093
  configPlans: plans,
19081
- transitionDelay: transitionDelay,
19082
19094
  hideIfNotEligible: hideIfNotEligible,
19095
+ monochrome: monochrome,
19096
+ purchaseAmount: purchaseAmount,
19083
19097
  suggestedPaymentPlan: suggestedPaymentPlan,
19084
- cards: cards
19098
+ cards: cards,
19099
+ transitionDelay: transitionDelay
19085
19100
  })), document.querySelector(container));
19086
19101
  }
19087
19102
  }