@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.
@@ -562,6 +562,10 @@
562
562
  border-bottom: 3px solid var(--blue-300);
563
563
  }
564
564
 
565
+ ._2Kqjn._3dG_J._2icEF {
566
+ border-bottom-color: var(--red-600);
567
+ }
568
+
565
569
  ._2Kqjn._3dG_J._3O1bg {
566
570
  border-bottom-color: var(--gray-600);
567
571
  cursor: not-allowed;
@@ -2694,12 +2694,21 @@ var Info = function Info() {
2694
2694
  }))));
2695
2695
  };
2696
2696
 
2697
+ var COLORS;
2698
+
2699
+ (function (COLORS) {
2700
+ COLORS["ALMA"] = "#FF414D";
2701
+ COLORS["MONOCHROME"] = "#00425D";
2702
+ })(COLORS || (COLORS = {}));
2703
+
2697
2704
  function LogoIcon(_ref) {
2698
- var _ref$color = _ref.color,
2699
- color = _ref$color === void 0 ? '#00425D' : _ref$color,
2700
- _ref$underlineColor = _ref.underlineColor,
2701
- underlineColor = _ref$underlineColor === void 0 ? '#00425D' : _ref$underlineColor,
2702
- className = _ref.className;
2705
+ var className = _ref.className,
2706
+ _ref$color = _ref.color,
2707
+ color = _ref$color === void 0 ? COLORS.MONOCHROME : _ref$color,
2708
+ _ref$monochrome = _ref.monochrome,
2709
+ monochrome = _ref$monochrome === void 0 ? true : _ref$monochrome,
2710
+ underlineColor = _ref.underlineColor;
2711
+ var defaultUnderlineColor = monochrome ? COLORS.MONOCHROME : COLORS.ALMA;
2703
2712
  return /*#__PURE__*/React__default.createElement("svg", {
2704
2713
  className: className,
2705
2714
  width: "35",
@@ -2723,7 +2732,7 @@ function LogoIcon(_ref) {
2723
2732
  y: "20",
2724
2733
  width: "40",
2725
2734
  height: "3",
2726
- fill: underlineColor
2735
+ fill: underlineColor || defaultUnderlineColor
2727
2736
  }));
2728
2737
  }
2729
2738
 
@@ -2974,7 +2983,7 @@ var STATIC_CUSTOMISATION_CLASSES$1 = {
2974
2983
  activeOption: prefix$1 + '-active-option'
2975
2984
  };
2976
2985
 
2977
- 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"};
2986
+ 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"};
2978
2987
 
2979
2988
  var VERY_LONG_TIME_IN_MS = 1000 * 3600 * 24 * 365;
2980
2989
  var DEFAULT_TRANSITION_TIME = 5500;
@@ -2982,13 +2991,14 @@ var DEFAULT_TRANSITION_TIME = 5500;
2982
2991
  var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
2983
2992
  var _cx, _cx3;
2984
2993
 
2985
- var purchaseAmount = _ref.purchaseAmount,
2986
- apiData = _ref.apiData,
2994
+ var apiData = _ref.apiData,
2987
2995
  configPlans = _ref.configPlans,
2988
- transitionDelay = _ref.transitionDelay,
2989
2996
  hideIfNotEligible = _ref.hideIfNotEligible,
2997
+ monochrome = _ref.monochrome,
2998
+ purchaseAmount = _ref.purchaseAmount,
2990
2999
  suggestedPaymentPlan = _ref.suggestedPaymentPlan,
2991
- cards = _ref.cards;
3000
+ cards = _ref.cards,
3001
+ transitionDelay = _ref.transitionDelay;
2992
3002
 
2993
3003
  var _useFetchEligibility = useFetchEligibility(purchaseAmount, apiData, configPlans),
2994
3004
  eligibilityPlans = _useFetchEligibility[0],
@@ -3091,19 +3101,21 @@ var PaymentPlanWidget = function PaymentPlanWidget(_ref) {
3091
3101
  }, /*#__PURE__*/React__default.createElement("div", {
3092
3102
  className: cx(s$c.primaryContainer, STATIC_CUSTOMISATION_CLASSES$1.eligibilityLine)
3093
3103
  }, /*#__PURE__*/React__default.createElement(LogoIcon, {
3094
- className: s$c.logo
3104
+ className: s$c.logo,
3105
+ monochrome: monochrome
3095
3106
  }), /*#__PURE__*/React__default.createElement("div", {
3096
3107
  className: cx(s$c.paymentPlans, STATIC_CUSTOMISATION_CLASSES$1.eligibilityOptions)
3097
3108
  }, eligibilityPlans.map(function (eligibilityPlan, key) {
3098
3109
  var _cx2;
3099
3110
 
3111
+ var isCurrent = key === current;
3100
3112
  return /*#__PURE__*/React__default.createElement("div", {
3101
3113
  key: key,
3102
3114
  onMouseEnter: function onMouseEnter() {
3103
3115
  return onHover(key);
3104
3116
  },
3105
3117
  onMouseOut: onLeave,
3106
- className: cx(s$c.plan, (_cx2 = {}, _cx2[cx(s$c.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)] = current === key, _cx2[cx(s$c.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)] = !eligibilityPlan.eligible, _cx2))
3118
+ 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))
3107
3119
  }, paymentPlanShorthandName(eligibilityPlan));
3108
3120
  }))), /*#__PURE__*/React__default.createElement("div", {
3109
3121
  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)
@@ -3138,6 +3150,8 @@ var WidgetsController = /*#__PURE__*/function () {
3138
3150
  plans = options.plans,
3139
3151
  transitionDelay = options.transitionDelay,
3140
3152
  hideIfNotEligible = options.hideIfNotEligible,
3153
+ _options$monochrome = options.monochrome,
3154
+ monochrome = _options$monochrome === void 0 ? true : _options$monochrome,
3141
3155
  suggestedPaymentPlan = options.suggestedPaymentPlan,
3142
3156
  _options$locale = options.locale,
3143
3157
  locale = _options$locale === void 0 ? Locale.en : _options$locale,
@@ -3147,13 +3161,14 @@ var WidgetsController = /*#__PURE__*/function () {
3147
3161
  reactDom.render( /*#__PURE__*/React__default.createElement(Provider, {
3148
3162
  locale: locale
3149
3163
  }, /*#__PURE__*/React__default.createElement(PaymentPlanWidget, {
3150
- purchaseAmount: purchaseAmount,
3151
3164
  apiData: this.apiData,
3152
3165
  configPlans: plans,
3153
- transitionDelay: transitionDelay,
3154
3166
  hideIfNotEligible: hideIfNotEligible,
3167
+ monochrome: monochrome,
3168
+ purchaseAmount: purchaseAmount,
3155
3169
  suggestedPaymentPlan: suggestedPaymentPlan,
3156
- cards: cards
3170
+ cards: cards,
3171
+ transitionDelay: transitionDelay
3157
3172
  })), document.querySelector(container));
3158
3173
  }
3159
3174
  }