@paypal/checkout-components 5.0.336 → 5.0.337

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paypal/checkout-components",
3
- "version": "5.0.336",
3
+ "version": "5.0.337",
4
4
  "description": "PayPal Checkout components, for integrating checkout products.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -111,9 +111,19 @@ export function Button({
111
111
 
112
112
  // if no color option is passed in via style props
113
113
  if (color === "" || typeof color === "undefined") {
114
- // if multiple buttons are being rendered (smart stack), we set default color as gold
115
114
  // if a single button is rendered, we set color to first option in the fundingSource config
116
- color = multiple ? "gold" : colors[0];
115
+ color = colors[0];
116
+
117
+ // if multiple buttons are being rendered (smart stack), we set default color as gold > first
118
+ if (multiple) {
119
+ color = "gold";
120
+ }
121
+ }
122
+
123
+ // validate the first button rendered has a valid color
124
+ // this check is needed to validate the first button in a smart stack gets the correct color
125
+ if (i === 0 && !colors.includes(color)) {
126
+ color = colors[0];
117
127
  }
118
128
 
119
129
  // The secondary colors are used to render the smart stack (multiple buttons)