@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.
@@ -2628,11 +2628,20 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
2628
2628
  }
2629
2629
  }))));
2630
2630
 
2631
+ var COLORS;
2632
+
2633
+ (function (COLORS) {
2634
+ COLORS["ALMA"] = "#FF414D";
2635
+ COLORS["MONOCHROME"] = "#00425D";
2636
+ })(COLORS || (COLORS = {}));
2637
+
2631
2638
  function LogoIcon({
2632
- color = '#00425D',
2633
- underlineColor = '#00425D',
2634
- className
2639
+ className,
2640
+ color = COLORS.MONOCHROME,
2641
+ monochrome = true,
2642
+ underlineColor
2635
2643
  }) {
2644
+ const defaultUnderlineColor = monochrome ? COLORS.MONOCHROME : COLORS.ALMA;
2636
2645
  return /*#__PURE__*/React.createElement("svg", {
2637
2646
  className: className,
2638
2647
  width: "35",
@@ -2656,7 +2665,7 @@ function LogoIcon({
2656
2665
  y: "20",
2657
2666
  width: "40",
2658
2667
  height: "3",
2659
- fill: underlineColor
2668
+ fill: underlineColor || defaultUnderlineColor
2660
2669
  }));
2661
2670
  }
2662
2671
 
@@ -2876,19 +2885,20 @@ const STATIC_CUSTOMISATION_CLASSES$1 = {
2876
2885
  activeOption: prefix$1 + '-active-option'
2877
2886
  };
2878
2887
 
2879
- 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"};
2888
+ 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"};
2880
2889
 
2881
2890
  const VERY_LONG_TIME_IN_MS = 1000 * 3600 * 24 * 365;
2882
2891
  const DEFAULT_TRANSITION_TIME = 5500;
2883
2892
 
2884
2893
  const PaymentPlanWidget = ({
2885
- purchaseAmount,
2886
2894
  apiData,
2887
2895
  configPlans,
2888
- transitionDelay,
2889
2896
  hideIfNotEligible,
2897
+ monochrome,
2898
+ purchaseAmount,
2890
2899
  suggestedPaymentPlan,
2891
- cards
2900
+ cards,
2901
+ transitionDelay
2892
2902
  }) => {
2893
2903
  const [eligibilityPlans, status] = useFetchEligibility(purchaseAmount, apiData, configPlans);
2894
2904
  const eligiblePlans = eligibilityPlans.filter(plan => plan.eligible);
@@ -2979,16 +2989,19 @@ const PaymentPlanWidget = ({
2979
2989
  }, /*#__PURE__*/React.createElement("div", {
2980
2990
  className: cx(s$c.primaryContainer, STATIC_CUSTOMISATION_CLASSES$1.eligibilityLine)
2981
2991
  }, /*#__PURE__*/React.createElement(LogoIcon, {
2982
- className: s$c.logo
2992
+ className: s$c.logo,
2993
+ monochrome: monochrome
2983
2994
  }), /*#__PURE__*/React.createElement("div", {
2984
2995
  className: cx(s$c.paymentPlans, STATIC_CUSTOMISATION_CLASSES$1.eligibilityOptions)
2985
2996
  }, eligibilityPlans.map((eligibilityPlan, key) => {
2997
+ const isCurrent = key === current;
2986
2998
  return /*#__PURE__*/React.createElement("div", {
2987
2999
  key: key,
2988
3000
  onMouseEnter: () => onHover(key),
2989
3001
  onMouseOut: onLeave,
2990
3002
  className: cx(s$c.plan, {
2991
- [cx(s$c.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)]: current === key,
3003
+ [cx(s$c.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)]: isCurrent,
3004
+ [s$c.polychrome]: !monochrome && isCurrent,
2992
3005
  [cx(s$c.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)]: !eligibilityPlan.eligible
2993
3006
  })
2994
3007
  }, paymentPlanShorthandName(eligibilityPlan));
@@ -3024,6 +3037,7 @@ class WidgetsController {
3024
3037
  plans,
3025
3038
  transitionDelay,
3026
3039
  hideIfNotEligible,
3040
+ monochrome = true,
3027
3041
  suggestedPaymentPlan,
3028
3042
  locale = Locale.en,
3029
3043
  cards
@@ -3033,13 +3047,14 @@ class WidgetsController {
3033
3047
  render( /*#__PURE__*/React.createElement(Provider, {
3034
3048
  locale: locale
3035
3049
  }, /*#__PURE__*/React.createElement(PaymentPlanWidget, {
3036
- purchaseAmount: purchaseAmount,
3037
3050
  apiData: this.apiData,
3038
3051
  configPlans: plans,
3039
- transitionDelay: transitionDelay,
3040
3052
  hideIfNotEligible: hideIfNotEligible,
3053
+ monochrome: monochrome,
3054
+ purchaseAmount: purchaseAmount,
3041
3055
  suggestedPaymentPlan: suggestedPaymentPlan,
3042
- cards: cards
3056
+ cards: cards,
3057
+ transitionDelay: transitionDelay
3043
3058
  })), document.querySelector(container));
3044
3059
  }
3045
3060
  }