@paypal/checkout-components 5.0.376 → 5.0.378-alpha-6f98b0f0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paypal/checkout-components",
3
- "version": "5.0.376",
3
+ "version": "5.0.378-alpha-6f98b0f0.0",
4
4
  "description": "PayPal Checkout components, for integrating checkout products.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -29,17 +29,21 @@ function getLabelText(fundingEligibility: FundingEligibilityType): ?string {
29
29
  }
30
30
 
31
31
  if (
32
- paylater?.products?.payIn3?.eligible &&
33
- paylater?.products?.payIn3?.variant === "ES"
32
+ (paylater?.products?.payIn3?.eligible &&
33
+ paylater?.products?.payIn3?.variant === "ES") ||
34
+ (paylater?.products?.paylater?.eligible &&
35
+ paylater?.products?.paylater?.variant === "ES")
34
36
  ) {
35
- labelText = "Paga en 3 plazos";
37
+ labelText = "Paga a plazos";
36
38
  }
37
39
 
38
40
  if (
39
- paylater?.products?.payIn3?.eligible &&
40
- paylater?.products?.payIn3?.variant === "IT"
41
+ (paylater?.products?.payIn3?.eligible &&
42
+ paylater?.products?.payIn3?.variant === "IT") ||
43
+ (paylater?.products?.paylater?.eligible &&
44
+ paylater?.products?.paylater?.variant === "IT")
41
45
  ) {
42
- labelText = "Paga in 3 rate";
46
+ labelText = "Paga a rate";
43
47
  }
44
48
 
45
49
  if (paylater?.products?.payIn4?.eligible) {
@@ -632,6 +632,7 @@ export type ButtonProps = {|
632
632
  hostedButtonId?: string,
633
633
  message?: ButtonMessage,
634
634
  messageMarkup?: string,
635
+ hideSubmitButtonForCardForm?: boolean,
635
636
  |};
636
637
 
637
638
  // eslint-disable-next-line flowtype/require-exact-type
@@ -868,3 +868,31 @@ describe("getButtonColor", () => {
868
868
  });
869
869
  });
870
870
  });
871
+
872
+ describe("HideSubmitButtonProps type validation", () => {
873
+ it("should allow hideSubmitButtonForCardForm as an optional boolean property", () => {
874
+ // This test ensures the Flow type definition accepts the new property
875
+ const validButtonProps = {
876
+ hideSubmitButtonForCardForm: true,
877
+ };
878
+
879
+ // This would fail Flow type checking if the property isn't properly defined
880
+ expect(typeof validButtonProps.hideSubmitButtonForCardForm).toBe("boolean");
881
+ });
882
+
883
+ it("should allow hideSubmitButtonForCardForm to be undefined", () => {
884
+ const validButtonProps = {
885
+ // hideSubmitButtonForCardForm is optional
886
+ };
887
+
888
+ expect(validButtonProps.hideSubmitButtonForCardForm).toBeUndefined();
889
+ });
890
+
891
+ it("should allow hideSubmitButtonForCardForm to be false", () => {
892
+ const validButtonProps = {
893
+ hideSubmitButtonForCardForm: false,
894
+ };
895
+
896
+ expect(validButtonProps.hideSubmitButtonForCardForm).toBe(false);
897
+ });
898
+ });
@@ -120,7 +120,9 @@ export function getResponsiveStyleVariables({
120
120
  const shouldResizeLabel =
121
121
  paylater?.products?.paylater?.variant === "DE" ||
122
122
  paylater?.products?.payIn3?.variant === "IT" ||
123
- paylater?.products?.payIn3?.variant === "ES";
123
+ paylater?.products?.paylater?.variant === "IT" ||
124
+ paylater?.products?.payIn3?.variant === "ES" ||
125
+ paylater?.products?.paylater?.variant === "ES";
124
126
 
125
127
  const textPercPercentage = shouldResizeLabel ? 32 : 36;
126
128
  const labelPercPercentage = shouldResizeLabel ? 32 : 35;
@@ -174,7 +176,9 @@ export function getDisableMaxHeightResponsiveStyleVariables({
174
176
  const shouldResizeLabel =
175
177
  paylater?.products?.paylater?.variant === "DE" ||
176
178
  paylater?.products?.payIn3?.variant === "IT" ||
177
- paylater?.products?.payIn3?.variant === "ES";
179
+ paylater?.products?.paylater?.variant === "IT" ||
180
+ paylater?.products?.payIn3?.variant === "ES" ||
181
+ paylater?.products?.paylater?.variant === "ES";
178
182
 
179
183
  const labelHeight = getLabelHeight({
180
184
  height: buttonHeight,
@@ -1298,6 +1298,18 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
1298
1298
  required: false,
1299
1299
  default: () => window.__TEST_WALLET__,
1300
1300
  },
1301
+
1302
+ hideSubmitButtonForCardForm: {
1303
+ type: "boolean",
1304
+ required: false,
1305
+ queryParam: true,
1306
+ },
1307
+ },
1308
+
1309
+ exports: {
1310
+ submitCardForm: {
1311
+ type: "function",
1312
+ },
1301
1313
  },
1302
1314
  });
1303
1315
  });
@@ -202,6 +202,12 @@ export function getCardFormComponent(): CardFormComponent {
202
202
  value: getDisableCard,
203
203
  },
204
204
  },
205
+
206
+ exports: {
207
+ submit: {
208
+ type: "function",
209
+ },
210
+ },
205
211
  });
206
212
  });
207
213
  }