@paypal/checkout-components 5.0.412-alpha-84b7728.0 → 5.0.412
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/saved-payment-methods.js +1 -0
- package/dist/test/button.js +1 -1
- package/package.json +2 -2
- package/src/funding/common.jsx +0 -6
- package/src/funding/itau/config.jsx +5 -15
- package/src/funding/sepa/config.jsx +1 -29
- package/src/lib/appSwitchResume.js +4 -1
- package/src/lib/appSwithResume.test.js +19 -0
- package/src/ui/buttons/config.js +26 -50
- package/src/ui/buttons/poweredBy.jsx +3 -8
- package/src/ui/buttons/props.js +29 -2
- package/src/ui/buttons/props.test.js +42 -0
- package/src/ui/buttons/styles/button.js +3 -21
- package/src/ui/buttons/styles/color.js +41 -59
- package/src/ui/buttons/styles/labels.js +0 -1
- package/src/ui/buttons/styles/responsive.js +39 -69
- package/src/ui/buttons/styles/styleUtils.js +5 -9
- package/src/ui/buttons/styles/styleUtils.test.js +54 -18
- package/src/ui/buttons/tagline.jsx +3 -1
- package/src/ui/saved-payment-methods/index.js +3 -0
- package/src/ui/saved-payment-methods/template.jsx +255 -0
- package/src/ui/saved-payment-methods/template.test.jsx +23 -0
- package/src/zoid/saved-payment-methods/container.jsx +0 -1
- package/src/zoid/saved-payment-methods/prerender.jsx +9 -19
- package/src/ui/buttons/styles/disableMaxHeightConfig.test.js +0 -71
|
@@ -72,7 +72,6 @@ export const labelStyle = `
|
|
|
72
72
|
CLASS.BUTTON_LABEL
|
|
73
73
|
} {
|
|
74
74
|
font-family: PayPal Pro Book, system-ui, -apple-system, Roboto, "Segoe UI", Helvetica-Neue, Helvetica, Arial, sans-serif;
|
|
75
|
-
font-weight: 500;
|
|
76
75
|
}
|
|
77
76
|
|
|
78
77
|
.${CLASS.BUTTON_REBRAND}[data-funding-source=venmo] .${CLASS.BUTTON_LABEL} {
|
|
@@ -18,8 +18,6 @@ import {
|
|
|
18
18
|
BUTTON_RELATIVE_STYLE,
|
|
19
19
|
BUTTON_DISABLE_MAX_HEIGHT_STYLE,
|
|
20
20
|
BUTTON_REDESIGN_STYLE,
|
|
21
|
-
BUTTON_REDESIGN_DISABLEMAXHEIGHT_STYLE,
|
|
22
|
-
REBRAND_LABEL_HEIGHT_RATIO,
|
|
23
21
|
} from "../config";
|
|
24
22
|
import { isBorderRadiusNumber } from "../util";
|
|
25
23
|
|
|
@@ -181,23 +179,20 @@ const generateButtonSizeStyles = ({
|
|
|
181
179
|
.${CLASS.BUTTON}.${CLASS.BORDER_RADIUS} {
|
|
182
180
|
${
|
|
183
181
|
borderRadius && isBorderRadiusNumber(borderRadius)
|
|
184
|
-
?
|
|
182
|
+
? `border-radius: ${borderRadius}px`
|
|
185
183
|
: ""
|
|
186
184
|
}
|
|
187
185
|
}
|
|
188
186
|
|
|
189
187
|
.${CLASS.BUTTON}.${CLASS.SHAPE}-${BUTTON_SHAPE.SHARP} {
|
|
190
|
-
--btn-radius: 0px;
|
|
191
188
|
border-radius: 0px;
|
|
192
189
|
}
|
|
193
190
|
|
|
194
191
|
.${CLASS.BUTTON}.${CLASS.SHAPE}-${BUTTON_SHAPE.RECT} {
|
|
195
|
-
--btn-radius: 4px;
|
|
196
192
|
border-radius: 4px;
|
|
197
193
|
}
|
|
198
194
|
|
|
199
195
|
.${CLASS.BUTTON}.${CLASS.SHAPE}-${BUTTON_SHAPE.PILL} {
|
|
200
|
-
--btn-radius: ${pillBorderRadius}px;
|
|
201
196
|
border-radius: ${pillBorderRadius}px;
|
|
202
197
|
}
|
|
203
198
|
|
|
@@ -404,7 +399,7 @@ const generateDisableMaxHeightStyles = ({
|
|
|
404
399
|
const { minHeight, maxHeight } = disableHeightStyle;
|
|
405
400
|
|
|
406
401
|
return `
|
|
407
|
-
@
|
|
402
|
+
@media (min-height: ${minHeight}px) and (max-height: ${maxHeight}px) {
|
|
408
403
|
.${CLASS.BUTTON_LABEL} {
|
|
409
404
|
gap: ${gap}px;
|
|
410
405
|
}
|
|
@@ -459,11 +454,10 @@ const generateDisableMaxHeightStyles = ({
|
|
|
459
454
|
}
|
|
460
455
|
|
|
461
456
|
.${CLASS.BUTTON}.${CLASS.SHAPE}-${BUTTON_SHAPE.PILL} {
|
|
462
|
-
--btn-radius: ${pillBorderRadius}px;
|
|
463
457
|
border-radius: ${pillBorderRadius}px;
|
|
464
458
|
}
|
|
465
459
|
|
|
466
|
-
.${CLASS.BUTTON_ROW}.${CLASS.SHAPE}-${BUTTON_SHAPE.PILL}
|
|
460
|
+
.${CLASS.BUTTON_ROW}.${CLASS.SHAPE}-${BUTTON_SHAPE.PILL}
|
|
467
461
|
.menu-button {
|
|
468
462
|
border-top-right-radius: ${pillBorderRadius}px;
|
|
469
463
|
border-bottom-right-radius: ${pillBorderRadius}px;
|
|
@@ -488,26 +482,21 @@ const generateDisableMaxHeightStyles = ({
|
|
|
488
482
|
};
|
|
489
483
|
|
|
490
484
|
const generateRebrandedDisableMaxHeightStyles = (): string => {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
const maxHeightQuery = isLastSizeBucket
|
|
498
|
-
? ""
|
|
499
|
-
: `and (max-height: ${maxHeight}px)`;
|
|
485
|
+
return Object.keys(BUTTON_REDESIGN_STYLE)
|
|
486
|
+
.map((redesign_size) => {
|
|
487
|
+
const { gap, fontSize, minHeight, maxHeight } =
|
|
488
|
+
getResponsiveRebrandedStyleVariables({
|
|
489
|
+
redesign_size,
|
|
490
|
+
});
|
|
500
491
|
|
|
501
492
|
return `
|
|
502
|
-
@
|
|
493
|
+
@media (min-height: ${minHeight}px) and (max-height: ${maxHeight}px) {
|
|
503
494
|
.${CLASS.BUTTON_REBRAND} > .${CLASS.BUTTON_LABEL} {
|
|
504
495
|
gap: ${gap}px;
|
|
505
496
|
}
|
|
506
|
-
.${CLASS.CONTAINER} .${CLASS.BUTTON_ROW} .${CLASS.
|
|
507
|
-
.${CLASS.CONTAINER} .${CLASS.BUTTON_ROW} .${CLASS.
|
|
497
|
+
.${CLASS.CONTAINER} .${CLASS.BUTTON_ROW} .${CLASS.TEXT},
|
|
498
|
+
.${CLASS.CONTAINER} .${CLASS.BUTTON_ROW} .${CLASS.SPACE} {
|
|
508
499
|
font-size: ${fontSize}px;
|
|
509
|
-
line-height: 1.2;
|
|
510
|
-
margin: 0;
|
|
511
500
|
}
|
|
512
501
|
}
|
|
513
502
|
`;
|
|
@@ -528,10 +517,8 @@ const generateRebrandedButtonSizeStyles = ({
|
|
|
528
517
|
borderRadius?: ?number,
|
|
529
518
|
shouldApplyRebrandedStyles?: boolean,
|
|
530
519
|
|}): string => {
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
.map((redesignSize, sizeIndex) => {
|
|
534
|
-
const isLastSizeBucket = sizeIndex === redesignSizeKeys.length - 1;
|
|
520
|
+
return Object.keys(BUTTON_REDESIGN_STYLE)
|
|
521
|
+
.map((redesign_size) => {
|
|
535
522
|
const {
|
|
536
523
|
buttonHeight,
|
|
537
524
|
pillBorderRadius,
|
|
@@ -545,13 +532,9 @@ const generateRebrandedButtonSizeStyles = ({
|
|
|
545
532
|
minDualWidth,
|
|
546
533
|
} = getResponsiveRebrandedStyleVariables({
|
|
547
534
|
height,
|
|
548
|
-
|
|
535
|
+
redesign_size,
|
|
549
536
|
});
|
|
550
537
|
|
|
551
|
-
const maxWidthQuery = isLastSizeBucket
|
|
552
|
-
? ""
|
|
553
|
-
: `and (max-width: ${maxWidth}px)`;
|
|
554
|
-
|
|
555
538
|
const widthBasedStyles = `
|
|
556
539
|
@media only screen and (min-width: ${minWidth}px) {
|
|
557
540
|
.${CLASS.CONTAINER} {
|
|
@@ -573,9 +556,7 @@ const generateRebrandedButtonSizeStyles = ({
|
|
|
573
556
|
.${CLASS.BUTTON_REBRAND} > .${CLASS.BUTTON_LABEL} {
|
|
574
557
|
margin: 0px 4vw;
|
|
575
558
|
box-sizing: border-box;
|
|
576
|
-
height: ${
|
|
577
|
-
buttonHeight * REBRAND_LABEL_HEIGHT_RATIO
|
|
578
|
-
)}px;
|
|
559
|
+
height: ${buttonHeight * 0.76}px;
|
|
579
560
|
}
|
|
580
561
|
|
|
581
562
|
.${CLASS.BUTTON_REBRAND}.${CLASS.NUMBER}-${BUTTON_NUMBER.MULTIPLE} .${
|
|
@@ -584,8 +565,20 @@ const generateRebrandedButtonSizeStyles = ({
|
|
|
584
565
|
gap: ${gap}px;
|
|
585
566
|
}
|
|
586
567
|
|
|
587
|
-
.${CLASS.
|
|
588
|
-
|
|
568
|
+
.${CLASS.CONTAINER} .${CLASS.BUTTON_ROW}.${CLASS.NUMBER}-${
|
|
569
|
+
BUTTON_NUMBER.MULTIPLE
|
|
570
|
+
} .${CLASS.TEXT},
|
|
571
|
+
.${CLASS.CONTAINER} .${CLASS.BUTTON_ROW}.${CLASS.NUMBER}-${
|
|
572
|
+
BUTTON_NUMBER.MULTIPLE
|
|
573
|
+
} .${CLASS.SPACE} {
|
|
574
|
+
font-size: ${fontSize}px;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.${CLASS.BUTTON_ROW}.${CLASS.NUMBER}-${BUTTON_NUMBER.MULTIPLE} .${
|
|
578
|
+
CLASS.BUTTON_REBRAND
|
|
579
|
+
} .${CLASS.TEXT} {
|
|
580
|
+
line-height: 1.2;
|
|
581
|
+
margin: 0;
|
|
589
582
|
}
|
|
590
583
|
|
|
591
584
|
.${CLASS.BUTTON_ROW}.${CLASS.LAYOUT}-${BUTTON_LAYOUT.VERTICAL}.${
|
|
@@ -604,20 +597,7 @@ const generateRebrandedButtonSizeStyles = ({
|
|
|
604
597
|
margin-bottom: 0;
|
|
605
598
|
}
|
|
606
599
|
}
|
|
607
|
-
|
|
608
|
-
@media only screen and (min-width: ${minWidth}px) ${maxWidthQuery} {
|
|
609
|
-
.${CLASS.CONTAINER} .${CLASS.BUTTON_ROW} .${CLASS.BUTTON_REBRAND} .${
|
|
610
|
-
CLASS.TEXT
|
|
611
|
-
},
|
|
612
|
-
.${CLASS.CONTAINER} .${CLASS.BUTTON_ROW} .${CLASS.BUTTON_REBRAND} .${
|
|
613
|
-
CLASS.SPACE
|
|
614
|
-
} {
|
|
615
|
-
font-size: ${fontSize}px;
|
|
616
|
-
line-height: 1.2;
|
|
617
|
-
margin: 0;
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
|
|
600
|
+
|
|
621
601
|
@media only screen and (min-width: ${minWidth}px) and (max-width: ${minDualWidth}px) {
|
|
622
602
|
.${CLASS.BUTTON_ROW}.${CLASS.LAYOUT}-${BUTTON_LAYOUT.HORIZONTAL}.${
|
|
623
603
|
CLASS.NUMBER
|
|
@@ -692,18 +672,17 @@ const generateRebrandedButtonSizeStyles = ({
|
|
|
692
672
|
`;
|
|
693
673
|
|
|
694
674
|
const heightBasedStyles = `
|
|
695
|
-
@
|
|
675
|
+
@media only screen and (min-height: ${minHeight}px) and (max-height: ${maxHeight}px) {
|
|
696
676
|
.${CLASS.BUTTON_REBRAND} > .${CLASS.BUTTON_LABEL} {
|
|
697
677
|
gap: ${gap}px;
|
|
698
678
|
}
|
|
699
679
|
|
|
700
|
-
.${CLASS.CONTAINER} .${CLASS.BUTTON_ROW} .${CLASS.
|
|
701
|
-
|
|
702
|
-
} .${CLASS.TEXT},
|
|
703
|
-
.${CLASS.CONTAINER} .${CLASS.BUTTON_ROW} .${CLASS.BUTTON_REBRAND}.${
|
|
704
|
-
CLASS.BUTTON_REBRAND
|
|
705
|
-
} .${CLASS.SPACE} {
|
|
680
|
+
.${CLASS.CONTAINER} .${CLASS.BUTTON_ROW} .${CLASS.TEXT},
|
|
681
|
+
.${CLASS.CONTAINER} .${CLASS.BUTTON_ROW} .${CLASS.SPACE} {
|
|
706
682
|
font-size: ${fontSize}px;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
.${CLASS.BUTTON_ROW} .${CLASS.BUTTON_REBRAND} .${CLASS.TEXT} {
|
|
707
686
|
line-height: 1.2;
|
|
708
687
|
margin: 0;
|
|
709
688
|
}
|
|
@@ -758,23 +737,20 @@ const generateRebrandedButtonSizeStyles = ({
|
|
|
758
737
|
.${CLASS.BUTTON}.${CLASS.BORDER_RADIUS} {
|
|
759
738
|
${
|
|
760
739
|
borderRadius && isBorderRadiusNumber(borderRadius)
|
|
761
|
-
?
|
|
740
|
+
? `border-radius: ${borderRadius}px`
|
|
762
741
|
: ""
|
|
763
742
|
}
|
|
764
743
|
}
|
|
765
744
|
|
|
766
745
|
.${CLASS.BUTTON}.${CLASS.SHAPE}-${BUTTON_SHAPE.SHARP} {
|
|
767
|
-
--btn-radius: 0px;
|
|
768
746
|
border-radius: 0px;
|
|
769
747
|
}
|
|
770
748
|
|
|
771
749
|
.${CLASS.BUTTON}.${CLASS.SHAPE}-${BUTTON_SHAPE.RECT} {
|
|
772
|
-
--btn-radius: 4px;
|
|
773
750
|
border-radius: 4px;
|
|
774
751
|
}
|
|
775
752
|
|
|
776
753
|
.${CLASS.BUTTON}.${CLASS.SHAPE}-${BUTTON_SHAPE.PILL} {
|
|
777
|
-
--btn-radius: ${pillBorderRadius}px;
|
|
778
754
|
border-radius: ${pillBorderRadius}px;
|
|
779
755
|
}
|
|
780
756
|
|
|
@@ -893,16 +869,14 @@ export function buttonResponsiveStyle({
|
|
|
893
869
|
.${CLASS.BUTTON}.${CLASS.BORDER_RADIUS} {
|
|
894
870
|
${
|
|
895
871
|
borderRadius && isBorderRadiusNumber(borderRadius)
|
|
896
|
-
?
|
|
872
|
+
? `border-radius: ${borderRadius}px`
|
|
897
873
|
: ""
|
|
898
874
|
};
|
|
899
875
|
}
|
|
900
876
|
.${CLASS.BUTTON}.${CLASS.SHAPE}-${BUTTON_SHAPE.SHARP} {
|
|
901
|
-
--btn-radius: 0px;
|
|
902
877
|
border-radius: 0px;
|
|
903
878
|
}
|
|
904
879
|
.${CLASS.BUTTON}.${CLASS.SHAPE}-${BUTTON_SHAPE.RECT} {
|
|
905
|
-
--btn-radius: 4px;
|
|
906
880
|
border-radius: 4px;
|
|
907
881
|
}
|
|
908
882
|
|
|
@@ -928,10 +902,6 @@ export function buttonResponsiveStyle({
|
|
|
928
902
|
.${CLASS.CARD} {
|
|
929
903
|
display: inline-block;
|
|
930
904
|
height: 100%;
|
|
931
|
-
}
|
|
932
|
-
|
|
933
|
-
.${CLASS.BUTTON_ROW} {
|
|
934
|
-
container-type: size;
|
|
935
905
|
}`;
|
|
936
906
|
|
|
937
907
|
const rebrandedStyles = shouldApplyRebrandedStyles
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
BUTTON_DISABLE_MAX_HEIGHT_STYLE,
|
|
8
8
|
BUTTON_SIZE_STYLE,
|
|
9
9
|
BUTTON_REDESIGN_STYLE,
|
|
10
|
-
REBRAND_LABEL_HEIGHT_RATIO,
|
|
11
10
|
} from "../config";
|
|
12
11
|
import {
|
|
13
12
|
BUTTON_SIZE,
|
|
@@ -33,7 +32,7 @@ function getLabelHeight({
|
|
|
33
32
|
let labelHeight = max(roundUp(perc(height, labelPercPercentage) + 5, 2), 12);
|
|
34
33
|
|
|
35
34
|
if (shouldApplyRebrandedStyles) {
|
|
36
|
-
labelHeight = roundUp(perc(height,
|
|
35
|
+
labelHeight = roundUp(perc(height, 76), 1);
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
return parseInt(labelHeight, 10);
|
|
@@ -142,10 +141,7 @@ export function getResponsiveStyleVariables({
|
|
|
142
141
|
const pillBorderRadius = Math.ceil(buttonHeight / 2);
|
|
143
142
|
|
|
144
143
|
if (shouldApplyRebrandedStyles) {
|
|
145
|
-
labelHeight = roundUp(
|
|
146
|
-
perc(buttonHeight, REBRAND_LABEL_HEIGHT_RATIO * 100),
|
|
147
|
-
1
|
|
148
|
-
);
|
|
144
|
+
labelHeight = roundUp(perc(buttonHeight, 76), 1);
|
|
149
145
|
// smallerLabelHeight gets triggered at widths < 320px
|
|
150
146
|
// We will need to investigate why the labels need to get significantly smaller at this breakpoint
|
|
151
147
|
smallerLabelHeight = labelHeight;
|
|
@@ -169,12 +165,12 @@ export function getResponsiveStyleVariables({
|
|
|
169
165
|
|
|
170
166
|
export function getResponsiveRebrandedStyleVariables({
|
|
171
167
|
height,
|
|
172
|
-
|
|
168
|
+
redesign_size,
|
|
173
169
|
}: {|
|
|
174
170
|
height?: ?number,
|
|
175
|
-
|
|
171
|
+
redesign_size: $Values<typeof BUTTON_REDESIGN_SIZE>,
|
|
176
172
|
|}): Object {
|
|
177
|
-
const style = BUTTON_REDESIGN_STYLE[
|
|
173
|
+
const style = BUTTON_REDESIGN_STYLE[redesign_size];
|
|
178
174
|
const {
|
|
179
175
|
minHeight,
|
|
180
176
|
maxHeight,
|
|
@@ -398,7 +398,7 @@ const expectedRebrandDisableMaxHeightStylesTiny = {
|
|
|
398
398
|
buttonHeight: 25,
|
|
399
399
|
disableHeightStyle:
|
|
400
400
|
BUTTON_DISABLE_MAX_HEIGHT_STYLE[BUTTON_DISABLE_MAX_HEIGHT_SIZE.TINY],
|
|
401
|
-
labelHeight:
|
|
401
|
+
labelHeight: 19,
|
|
402
402
|
fontSize: 10,
|
|
403
403
|
marginTop: 1,
|
|
404
404
|
pillBorderRadius: 13,
|
|
@@ -412,7 +412,7 @@ const expectedRebrandDisableMaxHeightStylesSmall = {
|
|
|
412
412
|
buttonHeight: 30,
|
|
413
413
|
disableHeightStyle:
|
|
414
414
|
BUTTON_DISABLE_MAX_HEIGHT_STYLE[BUTTON_DISABLE_MAX_HEIGHT_SIZE.SMALL],
|
|
415
|
-
labelHeight:
|
|
415
|
+
labelHeight: 23,
|
|
416
416
|
fontSize: 11,
|
|
417
417
|
marginTop: 1,
|
|
418
418
|
pillBorderRadius: 15,
|
|
@@ -428,7 +428,7 @@ const expectedRebrandDisableMaxHeightStylesMediumSmall = {
|
|
|
428
428
|
BUTTON_DISABLE_MAX_HEIGHT_STYLE[
|
|
429
429
|
BUTTON_DISABLE_MAX_HEIGHT_SIZE.MEDIUM_SMALL
|
|
430
430
|
],
|
|
431
|
-
labelHeight:
|
|
431
|
+
labelHeight: 27,
|
|
432
432
|
fontSize: 13,
|
|
433
433
|
marginTop: 1,
|
|
434
434
|
pillBorderRadius: 18,
|
|
@@ -442,7 +442,7 @@ const expectedRebrandDisableMaxHeightStylesMediumBig = {
|
|
|
442
442
|
buttonHeight: 40,
|
|
443
443
|
disableHeightStyle:
|
|
444
444
|
BUTTON_DISABLE_MAX_HEIGHT_STYLE[BUTTON_DISABLE_MAX_HEIGHT_SIZE.MEDIUM_BIG],
|
|
445
|
-
labelHeight:
|
|
445
|
+
labelHeight: 30,
|
|
446
446
|
fontSize: 14,
|
|
447
447
|
marginTop: 1,
|
|
448
448
|
pillBorderRadius: 20,
|
|
@@ -456,7 +456,7 @@ const expectedRebrandDisableMaxHeightStylesLargeSmall = {
|
|
|
456
456
|
buttonHeight: 45,
|
|
457
457
|
disableHeightStyle:
|
|
458
458
|
BUTTON_DISABLE_MAX_HEIGHT_STYLE[BUTTON_DISABLE_MAX_HEIGHT_SIZE.LARGE_SMALL],
|
|
459
|
-
labelHeight:
|
|
459
|
+
labelHeight: 34,
|
|
460
460
|
fontSize: 16,
|
|
461
461
|
marginTop: 2,
|
|
462
462
|
pillBorderRadius: 23,
|
|
@@ -470,7 +470,7 @@ const expectedRebrandDisableMaxHeightStylesLargeBig = {
|
|
|
470
470
|
buttonHeight: 50,
|
|
471
471
|
disableHeightStyle:
|
|
472
472
|
BUTTON_DISABLE_MAX_HEIGHT_STYLE[BUTTON_DISABLE_MAX_HEIGHT_SIZE.LARGE_BIG],
|
|
473
|
-
labelHeight:
|
|
473
|
+
labelHeight: 38,
|
|
474
474
|
fontSize: 18,
|
|
475
475
|
marginTop: 2,
|
|
476
476
|
pillBorderRadius: 25,
|
|
@@ -484,7 +484,7 @@ const expectedRebrandDisableMaxHeightStylesXL = {
|
|
|
484
484
|
buttonHeight: 55,
|
|
485
485
|
disableHeightStyle:
|
|
486
486
|
BUTTON_DISABLE_MAX_HEIGHT_STYLE[BUTTON_DISABLE_MAX_HEIGHT_SIZE.XL],
|
|
487
|
-
labelHeight:
|
|
487
|
+
labelHeight: 42,
|
|
488
488
|
fontSize: 20,
|
|
489
489
|
marginTop: 2,
|
|
490
490
|
pillBorderRadius: 28,
|
|
@@ -498,7 +498,7 @@ const expectedRebrandDisableMaxHeightStylesXXL = {
|
|
|
498
498
|
buttonHeight: 65,
|
|
499
499
|
disableHeightStyle:
|
|
500
500
|
BUTTON_DISABLE_MAX_HEIGHT_STYLE[BUTTON_DISABLE_MAX_HEIGHT_SIZE.XXL],
|
|
501
|
-
labelHeight:
|
|
501
|
+
labelHeight: 49,
|
|
502
502
|
fontSize: 23,
|
|
503
503
|
marginTop: 2,
|
|
504
504
|
pillBorderRadius: 33,
|
|
@@ -512,7 +512,7 @@ const expectedRebrandDisableMaxHeightStylesXXXL = {
|
|
|
512
512
|
buttonHeight: 75,
|
|
513
513
|
disableHeightStyle:
|
|
514
514
|
BUTTON_DISABLE_MAX_HEIGHT_STYLE[BUTTON_DISABLE_MAX_HEIGHT_SIZE.XXXL],
|
|
515
|
-
labelHeight:
|
|
515
|
+
labelHeight: 57,
|
|
516
516
|
fontSize: 27,
|
|
517
517
|
marginTop: 3,
|
|
518
518
|
pillBorderRadius: 38,
|
|
@@ -532,7 +532,7 @@ const expectedRebrandedResponsiveStylesExtraSmall = {
|
|
|
532
532
|
minWidth: 50,
|
|
533
533
|
minDualWidth: 300,
|
|
534
534
|
maxWidth: 75,
|
|
535
|
-
fontSize:
|
|
535
|
+
fontSize: 12,
|
|
536
536
|
};
|
|
537
537
|
|
|
538
538
|
const expectedRebrandedResponsiveStylesTiny = {
|
|
@@ -546,7 +546,7 @@ const expectedRebrandedResponsiveStylesTiny = {
|
|
|
546
546
|
minWidth: 75,
|
|
547
547
|
minDualWidth: 300,
|
|
548
548
|
maxWidth: 200,
|
|
549
|
-
fontSize:
|
|
549
|
+
fontSize: 12,
|
|
550
550
|
};
|
|
551
551
|
|
|
552
552
|
const expectedRebrandedResponsiveStylesSmall = {
|
|
@@ -560,7 +560,7 @@ const expectedRebrandedResponsiveStylesSmall = {
|
|
|
560
560
|
minWidth: 200,
|
|
561
561
|
minDualWidth: 300,
|
|
562
562
|
maxWidth: 250,
|
|
563
|
-
fontSize:
|
|
563
|
+
fontSize: 14,
|
|
564
564
|
};
|
|
565
565
|
|
|
566
566
|
const expectedRebrandedResponsiveStylesMediumSmall = {
|
|
@@ -574,7 +574,7 @@ const expectedRebrandedResponsiveStylesMediumSmall = {
|
|
|
574
574
|
minWidth: 250,
|
|
575
575
|
minDualWidth: 300,
|
|
576
576
|
maxWidth: 300,
|
|
577
|
-
fontSize:
|
|
577
|
+
fontSize: 16,
|
|
578
578
|
};
|
|
579
579
|
|
|
580
580
|
const expectedRebrandedResponsiveStylesMediumBig = {
|
|
@@ -588,7 +588,7 @@ const expectedRebrandedResponsiveStylesMediumBig = {
|
|
|
588
588
|
minWidth: 300,
|
|
589
589
|
minDualWidth: 300,
|
|
590
590
|
maxWidth: 350,
|
|
591
|
-
fontSize:
|
|
591
|
+
fontSize: 16,
|
|
592
592
|
};
|
|
593
593
|
|
|
594
594
|
const expectedRebrandedResponsiveStylesLargeSmall = {
|
|
@@ -602,7 +602,7 @@ const expectedRebrandedResponsiveStylesLargeSmall = {
|
|
|
602
602
|
minWidth: 350,
|
|
603
603
|
minDualWidth: 300,
|
|
604
604
|
maxWidth: 425,
|
|
605
|
-
fontSize:
|
|
605
|
+
fontSize: 18,
|
|
606
606
|
};
|
|
607
607
|
|
|
608
608
|
const expectedRebrandedResponsiveStylesLargeBig = {
|
|
@@ -616,7 +616,7 @@ const expectedRebrandedResponsiveStylesLargeBig = {
|
|
|
616
616
|
minWidth: 425,
|
|
617
617
|
minDualWidth: 300,
|
|
618
618
|
maxWidth: 500,
|
|
619
|
-
fontSize:
|
|
619
|
+
fontSize: 20,
|
|
620
620
|
};
|
|
621
621
|
|
|
622
622
|
const expectedRebrandedResponsiveStylesXlSmall = {
|
|
@@ -629,8 +629,36 @@ const expectedRebrandedResponsiveStylesXlSmall = {
|
|
|
629
629
|
maxHeight: 60,
|
|
630
630
|
minWidth: 500,
|
|
631
631
|
minDualWidth: 300,
|
|
632
|
+
maxWidth: 550,
|
|
633
|
+
fontSize: 22,
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
const expectedRebrandedResponsiveStylesXlBig = {
|
|
637
|
+
style: BUTTON_REDESIGN_STYLE[BUTTON_REDESIGN_SIZE.XL_BIG],
|
|
638
|
+
buttonHeight: 55,
|
|
639
|
+
pillBorderRadius: 28,
|
|
640
|
+
gap: 7,
|
|
641
|
+
defaultHeight: 55,
|
|
642
|
+
minHeight: 60,
|
|
643
|
+
maxHeight: 65,
|
|
644
|
+
minWidth: 550,
|
|
645
|
+
minDualWidth: 300,
|
|
646
|
+
maxWidth: 650,
|
|
647
|
+
fontSize: 24,
|
|
648
|
+
};
|
|
649
|
+
|
|
650
|
+
const expectedRebrandedResponsiveStylesXXL = {
|
|
651
|
+
style: BUTTON_REDESIGN_STYLE[BUTTON_REDESIGN_SIZE.XXL],
|
|
652
|
+
buttonHeight: 55,
|
|
653
|
+
pillBorderRadius: 28,
|
|
654
|
+
gap: 7,
|
|
655
|
+
defaultHeight: 55,
|
|
656
|
+
minHeight: 65,
|
|
657
|
+
maxHeight: 100,
|
|
658
|
+
minWidth: 650,
|
|
659
|
+
minDualWidth: 300,
|
|
632
660
|
maxWidth: 750,
|
|
633
|
-
fontSize:
|
|
661
|
+
fontSize: 26,
|
|
634
662
|
};
|
|
635
663
|
|
|
636
664
|
describe("test responsive style variables for legacy", () => {
|
|
@@ -756,12 +784,20 @@ describe("test responsive style variables for rebranded buttons", () => {
|
|
|
756
784
|
input: BUTTON_REDESIGN_SIZE.XL_SMALL,
|
|
757
785
|
expected: expectedRebrandedResponsiveStylesXlSmall,
|
|
758
786
|
},
|
|
787
|
+
{
|
|
788
|
+
input: BUTTON_REDESIGN_SIZE.XL_BIG,
|
|
789
|
+
expected: expectedRebrandedResponsiveStylesXlBig,
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
input: BUTTON_REDESIGN_SIZE.XXL,
|
|
793
|
+
expected: expectedRebrandedResponsiveStylesXXL,
|
|
794
|
+
},
|
|
759
795
|
])(
|
|
760
796
|
`should return rebrand responsive styles for size $input`,
|
|
761
797
|
({ input, expected }) => {
|
|
762
798
|
expect(
|
|
763
799
|
getResponsiveRebrandedStyleVariables({
|
|
764
|
-
|
|
800
|
+
redesign_size: input,
|
|
765
801
|
})
|
|
766
802
|
).toEqual(expected);
|
|
767
803
|
}
|
|
@@ -42,7 +42,9 @@ export function TagLine({
|
|
|
42
42
|
<div class={CLASS.TAGLINE}>
|
|
43
43
|
{tagline ? (
|
|
44
44
|
<Fragment>
|
|
45
|
-
|
|
45
|
+
<span>
|
|
46
|
+
{tagline.Component ? <tagline.Component /> : tagline.text}
|
|
47
|
+
</span>
|
|
46
48
|
{tagline.tracking && tagline.tracking.impression && (
|
|
47
49
|
<TrackingBeacon url={tagline.tracking.impression} nonce={nonce} />
|
|
48
50
|
)}
|