@paypal/checkout-components 5.0.402 → 5.0.404-alpha-e012ebc.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/dist/button.js +1 -1
- package/dist/test/button.js +1 -1
- package/package.json +1 -1
- package/src/constants/class.js +0 -2
- package/src/funding/paylater/config.jsx +7 -0
- package/src/ui/buttons/button.jsx +1 -5
- package/src/ui/buttons/buttons.jsx +1 -7
- package/src/ui/buttons/props.js +0 -4
- package/src/ui/buttons/styles/button.js +0 -7
- package/src/ui/buttons/styles/styleUtils.js +2 -0
- package/src/ui/buttons/styles/styleUtils.test.constants.js +738 -0
- package/src/ui/buttons/styles/styleUtils.test.js +192 -647
- package/src/zoid/buttons/component.jsx +0 -6
- package/src/ui/buttons/button.test.js +0 -59
package/package.json
CHANGED
package/src/constants/class.js
CHANGED
|
@@ -37,6 +37,13 @@ function getLabelText(
|
|
|
37
37
|
labelText = "Später Bezahlen";
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
if (
|
|
41
|
+
paylater?.products?.paylater?.eligible &&
|
|
42
|
+
paylater?.products?.paylater?.variant === "AT"
|
|
43
|
+
) {
|
|
44
|
+
labelText = "Später Bezahlen";
|
|
45
|
+
}
|
|
46
|
+
|
|
40
47
|
if (
|
|
41
48
|
(paylater?.products?.payIn3?.eligible &&
|
|
42
49
|
paylater?.products?.payIn3?.variant === "ES") ||
|
|
@@ -72,7 +72,6 @@ type IndividualButtonProps = {|
|
|
|
72
72
|
instrument: ?WalletInstrument,
|
|
73
73
|
showPayLabel: boolean,
|
|
74
74
|
showLoadingSpinner?: boolean,
|
|
75
|
-
disabled?: boolean,
|
|
76
75
|
|};
|
|
77
76
|
|
|
78
77
|
export function Button({
|
|
@@ -98,7 +97,6 @@ export function Button({
|
|
|
98
97
|
userIDToken,
|
|
99
98
|
vault,
|
|
100
99
|
showLoadingSpinner = false,
|
|
101
|
-
disabled = false,
|
|
102
100
|
}: IndividualButtonProps): ElementNode {
|
|
103
101
|
const { layout, shape, borderRadius } = style;
|
|
104
102
|
|
|
@@ -313,7 +311,6 @@ export function Button({
|
|
|
313
311
|
CLASS.BUTTON,
|
|
314
312
|
`${shouldApplyRebrandedStyles ? CLASS.BUTTON_REBRAND : ""}`,
|
|
315
313
|
`${showLoadingSpinner ? CLASS.LOADING : ""}`,
|
|
316
|
-
`${disabled ? CLASS.DISABLED : ""}`,
|
|
317
314
|
`${CLASS.NUMBER}-${i}`,
|
|
318
315
|
`${CLASS.LAYOUT}-${layout}`,
|
|
319
316
|
`${CLASS.NUMBER}-${
|
|
@@ -329,8 +326,7 @@ export function Button({
|
|
|
329
326
|
onClick={clickHandler}
|
|
330
327
|
onRender={onButtonRender}
|
|
331
328
|
onKeyPress={keypressHandler}
|
|
332
|
-
tabindex=
|
|
333
|
-
aria-disabled={showLoadingSpinner || disabled ? "true" : "false"}
|
|
329
|
+
tabindex="0"
|
|
334
330
|
aria-label={labelText}
|
|
335
331
|
>
|
|
336
332
|
<div class={CLASS.BUTTON_LABEL} aria-hidden="true">
|
|
@@ -128,7 +128,6 @@ type ButtonsProps = ButtonPropsInputs & {|
|
|
|
128
128
|
onClick?: Function,
|
|
129
129
|
wallet?: ?Wallet,
|
|
130
130
|
showLoadingSpinner?: boolean,
|
|
131
|
-
disabled?: boolean,
|
|
132
131
|
|};
|
|
133
132
|
|
|
134
133
|
export function validateButtonProps(props: ButtonPropsInputs) {
|
|
@@ -136,11 +135,7 @@ export function validateButtonProps(props: ButtonPropsInputs) {
|
|
|
136
135
|
}
|
|
137
136
|
|
|
138
137
|
export function Buttons(props: ButtonsProps): ElementNode {
|
|
139
|
-
const {
|
|
140
|
-
onClick = noop,
|
|
141
|
-
showLoadingSpinner = false,
|
|
142
|
-
disabled = false,
|
|
143
|
-
} = props;
|
|
138
|
+
const { onClick = noop, showLoadingSpinner = false } = props;
|
|
144
139
|
const {
|
|
145
140
|
applePaySupport,
|
|
146
141
|
buyerCountry,
|
|
@@ -301,7 +296,6 @@ export function Buttons(props: ButtonsProps): ElementNode {
|
|
|
301
296
|
instrument={instruments[source]}
|
|
302
297
|
showPayLabel={showPayLabel}
|
|
303
298
|
showLoadingSpinner={showLoadingSpinner}
|
|
304
|
-
disabled={disabled}
|
|
305
299
|
/>
|
|
306
300
|
))}
|
|
307
301
|
|
package/src/ui/buttons/props.js
CHANGED
|
@@ -568,10 +568,6 @@ type ThrowErrorForInvalidButtonColorArgs = {|
|
|
|
568
568
|
export type ButtonProps = {|
|
|
569
569
|
// app switch properties
|
|
570
570
|
appSwitchWhenAvailable: boolean,
|
|
571
|
-
|
|
572
|
-
// Disabled state
|
|
573
|
-
disabled?: boolean,
|
|
574
|
-
|
|
575
571
|
preferences?: {|
|
|
576
572
|
appSwitchWhenAvailable?: boolean,
|
|
577
573
|
launchAppSwitchIn?: "newTab" | "sameTab",
|
|
@@ -35,13 +35,6 @@ export const buttonStyle = `
|
|
|
35
35
|
overflow: hidden;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
.${CLASS.BUTTON}.${CLASS.DISABLED} {
|
|
40
|
-
pointer-events: none !important;
|
|
41
|
-
cursor: not-allowed !important;
|
|
42
|
-
opacity: 0.6 !important;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
38
|
.${CLASS.BUTTON} * {
|
|
46
39
|
cursor: pointer;
|
|
47
40
|
}
|
|
@@ -124,6 +124,7 @@ export function getResponsiveStyleVariables({
|
|
|
124
124
|
|
|
125
125
|
const shouldResizeLabel =
|
|
126
126
|
paylater?.products?.paylater?.variant === "DE" ||
|
|
127
|
+
paylater?.products?.paylater?.variant === "AT" ||
|
|
127
128
|
paylater?.products?.payIn3?.variant === "IT" ||
|
|
128
129
|
paylater?.products?.paylater?.variant === "IT" ||
|
|
129
130
|
paylater?.products?.payIn3?.variant === "ES" ||
|
|
@@ -225,6 +226,7 @@ export function getDisableMaxHeightResponsiveStyleVariables({
|
|
|
225
226
|
|
|
226
227
|
const shouldResizeLabel =
|
|
227
228
|
paylater?.products?.paylater?.variant === "DE" ||
|
|
229
|
+
paylater?.products?.paylater?.variant === "AT" ||
|
|
228
230
|
paylater?.products?.payIn3?.variant === "IT" ||
|
|
229
231
|
paylater?.products?.paylater?.variant === "IT" ||
|
|
230
232
|
paylater?.products?.payIn3?.variant === "ES" ||
|