@megafon/ui-shared 5.11.0 → 5.13.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/CHANGELOG.md +30 -0
- package/dist/es/components/BenefitsIcons/BenefitsIcons.d.ts +4 -0
- package/dist/es/components/BenefitsIcons/BenefitsIcons.js +25 -6
- package/dist/es/components/BenefitsIcons/BenefitsIconsTile.js +24 -10
- package/dist/es/components/BenefitsIcons/types.d.ts +12 -0
- package/dist/es/components/ButtonBanner/ButtonBanner.d.ts +7 -0
- package/dist/es/components/ButtonBanner/ButtonBanner.js +8 -0
- package/dist/es/components/ImageBanner/ImageBanner.css +3 -0
- package/dist/es/components/ImageBanner/ImageBanner.d.ts +7 -0
- package/dist/es/components/ImageBanner/ImageBanner.js +15 -7
- package/dist/es/components/Instructions/Instructions.css +176 -39
- package/dist/es/components/Instructions/Instructions.d.ts +9 -0
- package/dist/es/components/Instructions/Instructions.js +35 -21
- package/dist/es/components/Instructions/img/iphone15.png +0 -0
- package/dist/es/components/Instructions/img/laptop-new.png +0 -0
- package/dist/es/helpers/getColumnConfig.d.ts +1 -1
- package/dist/lib/components/BenefitsIcons/BenefitsIcons.d.ts +4 -0
- package/dist/lib/components/BenefitsIcons/BenefitsIcons.js +24 -5
- package/dist/lib/components/BenefitsIcons/BenefitsIconsTile.js +26 -11
- package/dist/lib/components/BenefitsIcons/types.d.ts +12 -0
- package/dist/lib/components/ButtonBanner/ButtonBanner.d.ts +7 -0
- package/dist/lib/components/ButtonBanner/ButtonBanner.js +10 -1
- package/dist/lib/components/ImageBanner/ImageBanner.css +3 -0
- package/dist/lib/components/ImageBanner/ImageBanner.d.ts +7 -0
- package/dist/lib/components/ImageBanner/ImageBanner.js +15 -7
- package/dist/lib/components/Instructions/Instructions.css +176 -39
- package/dist/lib/components/Instructions/Instructions.d.ts +9 -0
- package/dist/lib/components/Instructions/Instructions.js +39 -22
- package/dist/lib/components/Instructions/img/iphone15.png +0 -0
- package/dist/lib/components/Instructions/img/laptop-new.png +0 -0
- package/dist/lib/helpers/getColumnConfig.d.ts +1 -1
- package/package.json +5 -5
@@ -11,7 +11,7 @@ h5 {
|
|
11
11
|
}
|
12
12
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
13
13
|
.mfui-instructions__title_resolution_mobile {
|
14
|
-
margin-bottom:
|
14
|
+
margin-bottom: 40px;
|
15
15
|
}
|
16
16
|
}
|
17
17
|
@media screen and (min-width: 1024px) {
|
@@ -59,6 +59,9 @@ h5 {
|
|
59
59
|
align-items: unset;
|
60
60
|
}
|
61
61
|
}
|
62
|
+
.mfui-instructions__text {
|
63
|
+
margin-top: 48px;
|
64
|
+
}
|
62
65
|
@media screen and (max-width: 1023px) {
|
63
66
|
.mfui-instructions__text {
|
64
67
|
text-align: center;
|
@@ -72,12 +75,7 @@ h5 {
|
|
72
75
|
}
|
73
76
|
@media screen and (max-width: 1023px) {
|
74
77
|
.mfui-instructions__picture {
|
75
|
-
margin: 0 auto
|
76
|
-
}
|
77
|
-
}
|
78
|
-
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
79
|
-
.mfui-instructions__picture {
|
80
|
-
margin: 0 auto 48px;
|
78
|
+
margin: 0 auto;
|
81
79
|
}
|
82
80
|
}
|
83
81
|
@media screen and (min-width: 1024px) {
|
@@ -235,6 +233,35 @@ h5 {
|
|
235
233
|
border-radius: 20px;
|
236
234
|
overflow: hidden;
|
237
235
|
}
|
236
|
+
.mfui-instructions_mask_iphone-15 .mfui-instructions__img-wrapper {
|
237
|
+
height: 487px;
|
238
|
+
}
|
239
|
+
@media screen and (max-width: 1023px) {
|
240
|
+
.mfui-instructions_mask_iphone-15 .mfui-instructions__img-wrapper:before {
|
241
|
+
display: none;
|
242
|
+
}
|
243
|
+
}
|
244
|
+
.mfui-instructions_mask_iphone-15 .mfui-instructions__device-screen {
|
245
|
+
position: relative;
|
246
|
+
z-index: 2;
|
247
|
+
width: 100%;
|
248
|
+
height: 486px;
|
249
|
+
margin: auto;
|
250
|
+
background: url('./img/iphone15.png') 50% no-repeat;
|
251
|
+
background-size: contain;
|
252
|
+
}
|
253
|
+
.mfui-instructions_mask_iphone-15 .mfui-instructions__swiper {
|
254
|
+
position: absolute;
|
255
|
+
top: 10px;
|
256
|
+
right: 0;
|
257
|
+
left: 0;
|
258
|
+
z-index: 1;
|
259
|
+
width: 217px;
|
260
|
+
height: 468px;
|
261
|
+
margin: auto;
|
262
|
+
border-radius: 20px;
|
263
|
+
overflow: hidden;
|
264
|
+
}
|
238
265
|
.mfui-instructions_mask_android-cropped .mfui-instructions__img-wrapper {
|
239
266
|
height: 420px;
|
240
267
|
min-height: 420px;
|
@@ -324,7 +351,10 @@ h5 {
|
|
324
351
|
}
|
325
352
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
326
353
|
.mfui-instructions_mask_laptop .mfui-instructions__img-wrapper {
|
327
|
-
height:
|
354
|
+
height: 0;
|
355
|
+
padding-bottom: 53.4%;
|
356
|
+
background: url('./img/laptop.png') 50% 0% no-repeat;
|
357
|
+
background-size: 100%;
|
328
358
|
}
|
329
359
|
}
|
330
360
|
@media screen and (min-width: 480px) and (max-width: 767px) {
|
@@ -410,11 +440,95 @@ h5 {
|
|
410
440
|
transform: translate(-50%, -53%);
|
411
441
|
}
|
412
442
|
}
|
443
|
+
@media screen and (max-width: 1023px) {
|
444
|
+
.mfui-instructions_mask_laptop-new .mfui-instructions__img-wrapper {
|
445
|
+
height: 0;
|
446
|
+
padding-bottom: 58.9%;
|
447
|
+
background: url('./img/laptop-new.png') 50% 0% no-repeat;
|
448
|
+
background-size: 100%;
|
449
|
+
}
|
450
|
+
}
|
451
|
+
.mfui-instructions_mask_laptop-new .mfui-instructions__img-wrapper:before {
|
452
|
+
display: none;
|
453
|
+
}
|
454
|
+
.mfui-instructions_mask_laptop-new .mfui-instructions__device-screen {
|
455
|
+
position: relative;
|
456
|
+
width: 100%;
|
457
|
+
height: 100%;
|
458
|
+
margin: auto;
|
459
|
+
background: url('./img/laptop-new.png') 50% 0% no-repeat;
|
460
|
+
background-size: 100%;
|
461
|
+
}
|
462
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
463
|
+
.mfui-instructions_mask_laptop-new .mfui-instructions__device-screen {
|
464
|
+
width: 530px;
|
465
|
+
}
|
466
|
+
}
|
467
|
+
@media screen and (min-width: 480px) and (max-width: 767px) {
|
468
|
+
.mfui-instructions_mask_laptop-new .mfui-instructions__device-screen {
|
469
|
+
width: 450px;
|
470
|
+
}
|
471
|
+
}
|
472
|
+
@media screen and (max-width: 479px) {
|
473
|
+
.mfui-instructions_mask_laptop-new .mfui-instructions__device-screen {
|
474
|
+
width: 270px;
|
475
|
+
}
|
476
|
+
}
|
477
|
+
@media screen and (min-width: 1024px) {
|
478
|
+
.mfui-instructions_mask_laptop-new .mfui-instructions__device-screen {
|
479
|
+
background: url('./img/laptop-new.png') 50% no-repeat;
|
480
|
+
background-size: contain;
|
481
|
+
}
|
482
|
+
}
|
483
|
+
.mfui-instructions_mask_laptop-new .mfui-instructions__swiper {
|
484
|
+
position: absolute;
|
485
|
+
top: 4px;
|
486
|
+
right: 0;
|
487
|
+
left: 50%;
|
488
|
+
width: 78%;
|
489
|
+
margin: auto;
|
490
|
+
overflow: hidden;
|
491
|
+
-webkit-transform: translate(-49.5%, 0);
|
492
|
+
transform: translate(-49.5%, 0);
|
493
|
+
}
|
494
|
+
@media screen and (min-width: 480px) and (max-width: 767px) {
|
495
|
+
.mfui-instructions_mask_laptop-new .mfui-instructions__swiper {
|
496
|
+
top: 7px;
|
497
|
+
max-width: 415px;
|
498
|
+
}
|
499
|
+
}
|
500
|
+
@media screen and (max-width: 479px) {
|
501
|
+
.mfui-instructions_mask_laptop-new .mfui-instructions__swiper {
|
502
|
+
max-width: 302px;
|
503
|
+
}
|
504
|
+
}
|
505
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
506
|
+
.mfui-instructions_mask_laptop-new .mfui-instructions__swiper {
|
507
|
+
top: 12px;
|
508
|
+
}
|
509
|
+
}
|
510
|
+
@media screen and (min-width: 1024px) {
|
511
|
+
.mfui-instructions_mask_laptop-new .mfui-instructions__swiper {
|
512
|
+
top: 50%;
|
513
|
+
-webkit-transform: translate(-49.5%, -55%);
|
514
|
+
transform: translate(-49.5%, -55%);
|
515
|
+
}
|
516
|
+
}
|
413
517
|
.mfui-instructions__slide {
|
414
518
|
-ms-flex-negative: 0;
|
415
519
|
flex-shrink: 0;
|
416
520
|
height: 100%;
|
417
521
|
}
|
522
|
+
@media screen and (max-width: 767px) {
|
523
|
+
.mfui-instructions__articles {
|
524
|
+
margin-top: 24px;
|
525
|
+
}
|
526
|
+
}
|
527
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
528
|
+
.mfui-instructions__articles {
|
529
|
+
margin-top: 32px;
|
530
|
+
}
|
531
|
+
}
|
418
532
|
@media screen and (min-width: 1024px) {
|
419
533
|
.mfui-instructions__articles {
|
420
534
|
-webkit-box-ordinal-group: 2;
|
@@ -433,9 +547,6 @@ h5 {
|
|
433
547
|
padding: 0;
|
434
548
|
list-style-type: none;
|
435
549
|
}
|
436
|
-
.mfui-instructions__articles-list_text-after {
|
437
|
-
margin-bottom: 48px;
|
438
|
-
}
|
439
550
|
@media screen and (min-width: 1024px) {
|
440
551
|
.mfui-instructions__articles-list_mobile {
|
441
552
|
display: none;
|
@@ -476,8 +587,7 @@ h5 {
|
|
476
587
|
margin-bottom: 0;
|
477
588
|
}
|
478
589
|
}
|
479
|
-
.mfui-instructions__articles-item-dot
|
480
|
-
.mfui-instructions__articles-dot {
|
590
|
+
.mfui-instructions__articles-item-dot {
|
481
591
|
position: absolute;
|
482
592
|
display: inline-block;
|
483
593
|
width: 40px;
|
@@ -492,13 +602,11 @@ h5 {
|
|
492
602
|
cursor: pointer;
|
493
603
|
}
|
494
604
|
@media screen and (max-width: 479px) {
|
495
|
-
.mfui-instructions__articles-item-dot
|
496
|
-
.mfui-instructions__articles-dot {
|
605
|
+
.mfui-instructions__articles-item-dot {
|
497
606
|
min-width: 40px;
|
498
607
|
}
|
499
608
|
}
|
500
|
-
.mfui-instructions__articles-item-dot:before
|
501
|
-
.mfui-instructions__articles-dot:before {
|
609
|
+
.mfui-instructions__articles-item-dot:before {
|
502
610
|
content: '';
|
503
611
|
position: absolute;
|
504
612
|
top: 50%;
|
@@ -509,8 +617,7 @@ h5 {
|
|
509
617
|
-webkit-transition: all 0.3s ease;
|
510
618
|
transition: all 0.3s ease;
|
511
619
|
}
|
512
|
-
.mfui-instructions__articles-item-dot-number
|
513
|
-
.mfui-instructions__articles-dot-number {
|
620
|
+
.mfui-instructions__articles-item-dot-number {
|
514
621
|
position: relative;
|
515
622
|
}
|
516
623
|
.mfui-instructions__articles-item-title {
|
@@ -537,44 +644,51 @@ h5 {
|
|
537
644
|
padding: 0;
|
538
645
|
list-style-type: none;
|
539
646
|
}
|
540
|
-
.mfui-instructions__articles-dots_text-after {
|
541
|
-
margin-bottom: 48px;
|
542
|
-
}
|
543
|
-
.mfui-instructions__articles-dot {
|
544
|
-
position: relative;
|
545
|
-
}
|
546
647
|
@media screen and (max-width: 767px) {
|
547
|
-
.mfui-instructions__articles-
|
548
|
-
margin-
|
648
|
+
.mfui-instructions__articles-dots {
|
649
|
+
margin-top: 16px;
|
549
650
|
}
|
550
651
|
}
|
551
652
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
552
|
-
.mfui-instructions__articles-
|
553
|
-
margin-
|
653
|
+
.mfui-instructions__articles-dots {
|
654
|
+
margin-top: 24px;
|
655
|
+
}
|
656
|
+
}
|
657
|
+
@media screen and (min-width: 1024px) {
|
658
|
+
.mfui-instructions__articles-dots {
|
659
|
+
display: none;
|
554
660
|
}
|
555
661
|
}
|
662
|
+
.mfui-instructions__articles-dots_text-after {
|
663
|
+
margin-bottom: 48px;
|
664
|
+
}
|
665
|
+
.mfui-instructions__articles-dot {
|
666
|
+
position: relative;
|
667
|
+
display: inline-block;
|
668
|
+
width: 8px;
|
669
|
+
height: 8px;
|
670
|
+
margin-right: 12px;
|
671
|
+
border-radius: 4px;
|
672
|
+
background: var(--spbSky2);
|
673
|
+
cursor: pointer;
|
674
|
+
}
|
556
675
|
.mfui-instructions__articles-dot:hover,
|
557
676
|
.mfui-instructions__articles-dot_active {
|
558
|
-
color: var(--stcWhite);
|
559
|
-
}
|
560
|
-
.mfui-instructions__articles-dot:hover:before,
|
561
|
-
.mfui-instructions__articles-dot_active:before {
|
562
|
-
top: 0;
|
563
|
-
right: 0;
|
564
|
-
bottom: 0;
|
565
|
-
left: 0;
|
566
677
|
background: var(--brandGreen);
|
567
678
|
}
|
679
|
+
.mfui-instructions__articles-dot_active {
|
680
|
+
width: 20px;
|
681
|
+
}
|
568
682
|
.mfui-instructions__articles-dot:last-child {
|
569
683
|
margin-right: 0;
|
570
684
|
}
|
571
685
|
.mfui-instructions__articles-title-block {
|
686
|
+
margin: 0 auto;
|
572
687
|
text-align: center;
|
573
688
|
}
|
574
689
|
@media screen and (max-width: 767px) {
|
575
690
|
.mfui-instructions__articles-title-block {
|
576
691
|
width: 55%;
|
577
|
-
margin: 0 auto 24px;
|
578
692
|
}
|
579
693
|
}
|
580
694
|
@media screen and (max-width: 479px) {
|
@@ -585,7 +699,6 @@ h5 {
|
|
585
699
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
586
700
|
.mfui-instructions__articles-title-block {
|
587
701
|
width: 55%;
|
588
|
-
margin: 0 auto 32px;
|
589
702
|
}
|
590
703
|
}
|
591
704
|
.mfui-instructions__articles-title {
|
@@ -651,3 +764,27 @@ h5 {
|
|
651
764
|
line-height: 12px;
|
652
765
|
text-align: center;
|
653
766
|
}
|
767
|
+
.mfui-instructions_reversed .mfui-instructions__title_resolution_mobile {
|
768
|
+
margin-bottom: 16px;
|
769
|
+
}
|
770
|
+
@media screen and (max-width: 1023px) {
|
771
|
+
.mfui-instructions_reversed .mfui-instructions__picture {
|
772
|
+
max-height: 100%;
|
773
|
+
margin-bottom: 0;
|
774
|
+
}
|
775
|
+
}
|
776
|
+
@media screen and (max-width: 1023px) {
|
777
|
+
.mfui-instructions_reversed .mfui-instructions__articles {
|
778
|
+
display: none;
|
779
|
+
}
|
780
|
+
}
|
781
|
+
@media screen and (max-width: 767px) {
|
782
|
+
.mfui-instructions_reversed .mfui-instructions__articles-title-block {
|
783
|
+
margin-bottom: 32px;
|
784
|
+
}
|
785
|
+
}
|
786
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
787
|
+
.mfui-instructions_reversed .mfui-instructions__articles-title-block {
|
788
|
+
margin-bottom: 40px;
|
789
|
+
}
|
790
|
+
}
|
@@ -17,7 +17,9 @@ export declare const pictureMaskTypes: {
|
|
17
17
|
readonly BLACK_IPHONE: "black-iphone";
|
18
18
|
readonly WHITE_IPHONE: "white-iphone";
|
19
19
|
readonly LAPTOP: "laptop";
|
20
|
+
readonly LAPTOP_NEW: "laptop-new";
|
20
21
|
readonly IPHONE_12: "iphone-12";
|
22
|
+
readonly IPHONE_15: "iphone-15";
|
21
23
|
readonly IPHONE_CROPPED: "iphone-cropped";
|
22
24
|
readonly NONE: "none";
|
23
25
|
};
|
@@ -28,11 +30,16 @@ export declare const arrowTheme: {
|
|
28
30
|
readonly PURPLE: "purple";
|
29
31
|
readonly DARK: "dark";
|
30
32
|
};
|
33
|
+
export declare const elementOrderTypes: {
|
34
|
+
readonly DEFAULT: "default";
|
35
|
+
readonly REVERSED: "reversed";
|
36
|
+
};
|
31
37
|
declare type PictureAlignTypesType = typeof pictureAlignTypes[keyof typeof pictureAlignTypes];
|
32
38
|
declare type PictureVerticalAlignTypesType = typeof pictureVerticalAlignTypes[keyof typeof pictureVerticalAlignTypes];
|
33
39
|
declare type PictureMaskTypesType = typeof pictureMaskTypes[keyof typeof pictureMaskTypes];
|
34
40
|
declare type PictureBackgroundColorsType = typeof pictureBackgroundColorTypes[keyof typeof pictureBackgroundColorTypes];
|
35
41
|
declare type ArrowThemeType = typeof arrowTheme[keyof typeof arrowTheme];
|
42
|
+
declare type ElementOrderType = typeof elementOrderTypes[keyof typeof elementOrderTypes];
|
36
43
|
export declare type InstructionItemType = {
|
37
44
|
title: string | React.ReactNode | React.ReactNode[];
|
38
45
|
mediaUrl: string;
|
@@ -87,6 +94,8 @@ export interface IInstructionsProps {
|
|
87
94
|
showArrows?: boolean;
|
88
95
|
/** Цветовая тема стрелок навигации */
|
89
96
|
arrowsTheme?: ArrowThemeType;
|
97
|
+
/** Вертикальный порядок элементов на мобильных устройствах и планшетах */
|
98
|
+
elementOrder?: ElementOrderType;
|
90
99
|
/** Ref на swiper */
|
91
100
|
getSwiper?: (instance: SwiperCore) => void;
|
92
101
|
}
|
@@ -27,7 +27,9 @@ export var pictureMaskTypes = {
|
|
27
27
|
BLACK_IPHONE: 'black-iphone',
|
28
28
|
WHITE_IPHONE: 'white-iphone',
|
29
29
|
LAPTOP: 'laptop',
|
30
|
+
LAPTOP_NEW: 'laptop-new',
|
30
31
|
IPHONE_12: 'iphone-12',
|
32
|
+
IPHONE_15: 'iphone-15',
|
31
33
|
IPHONE_CROPPED: 'iphone-cropped',
|
32
34
|
NONE: 'none'
|
33
35
|
};
|
@@ -38,6 +40,10 @@ export var arrowTheme = {
|
|
38
40
|
PURPLE: 'purple',
|
39
41
|
DARK: 'dark'
|
40
42
|
};
|
43
|
+
export var elementOrderTypes = {
|
44
|
+
DEFAULT: 'default',
|
45
|
+
REVERSED: 'reversed'
|
46
|
+
};
|
41
47
|
var testIdPrefix = 'Instructions';
|
42
48
|
var cn = cnCreate('mfui-instructions');
|
43
49
|
var swiperSlideCn = cn('slide');
|
@@ -72,6 +78,8 @@ var Instructions = function Instructions(_ref) {
|
|
72
78
|
showArrows = _ref.showArrows,
|
73
79
|
_ref$arrowsTheme = _ref.arrowsTheme,
|
74
80
|
arrowsTheme = _ref$arrowsTheme === void 0 ? arrowTheme.DARK : _ref$arrowsTheme,
|
81
|
+
_ref$elementOrder = _ref.elementOrder,
|
82
|
+
elementOrder = _ref$elementOrder === void 0 ? 'default' : _ref$elementOrder,
|
75
83
|
children = _ref.children;
|
76
84
|
|
77
85
|
var _React$useState = React.useState(),
|
@@ -84,6 +92,7 @@ var Instructions = function Instructions(_ref) {
|
|
84
92
|
slideIndex = _React$useState4[0],
|
85
93
|
setSlideIndex = _React$useState4[1];
|
86
94
|
|
95
|
+
var isMobileReversed = elementOrder === 'reversed';
|
87
96
|
var getSwiperInstance = React.useCallback(function (swiper) {
|
88
97
|
setSwiperInstance(swiper);
|
89
98
|
getSwiper && getSwiper(swiper);
|
@@ -133,6 +142,22 @@ var Instructions = function Instructions(_ref) {
|
|
133
142
|
type: "video/mp4"
|
134
143
|
}));
|
135
144
|
}, [dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image]);
|
145
|
+
var renderMobileDots = React.useCallback(function () {
|
146
|
+
return /*#__PURE__*/React.createElement("ul", {
|
147
|
+
className: cn('articles-dots', {
|
148
|
+
reversed: isMobileReversed
|
149
|
+
}),
|
150
|
+
"data-testid": "".concat(testIdPrefix, "-articles-dots-mobile")
|
151
|
+
}, instructionItems.map(function (_item, i) {
|
152
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, i + 1), {
|
153
|
+
key: i,
|
154
|
+
className: cn('articles-dot', {
|
155
|
+
active: slideIndex === i
|
156
|
+
}, [getActiveCustomClass(i, slideIndex), instructionItem, mobileInstructionItem]),
|
157
|
+
onClick: handleArticleClick(i)
|
158
|
+
}));
|
159
|
+
}));
|
160
|
+
}, [instructionItems, dataAttrs, slideIndex, instructionItem, mobileInstructionItem, getActiveCustomClass, handleArticleClick, isMobileReversed]);
|
136
161
|
var renderSlider = React.useCallback(function () {
|
137
162
|
return /*#__PURE__*/React.createElement(Swiper, {
|
138
163
|
noSwiping: false,
|
@@ -235,7 +260,9 @@ var Instructions = function Instructions(_ref) {
|
|
235
260
|
}),
|
236
261
|
"data-testid": "".concat(testIdPrefix, "-articles-list-mobile")
|
237
262
|
}, /*#__PURE__*/React.createElement("div", {
|
238
|
-
className: cn('articles-title-block'
|
263
|
+
className: cn('articles-title-block', {
|
264
|
+
reversed: isMobileReversed
|
265
|
+
})
|
239
266
|
}, instructionItems.map(function (_ref6, i) {
|
240
267
|
var itemTitle = _ref6.title;
|
241
268
|
return slideIndex === i && /*#__PURE__*/React.createElement("div", _extends({
|
@@ -244,23 +271,8 @@ var Instructions = function Instructions(_ref) {
|
|
244
271
|
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.mobileItemText, i + 1), {
|
245
272
|
className: cn('articles-title', [mobileItemTitle])
|
246
273
|
}), itemTitle);
|
247
|
-
})), /*#__PURE__*/React.createElement("ul", {
|
248
|
-
className: cn('articles-dots', {
|
249
|
-
'text-after': !!text
|
250
|
-
}),
|
251
|
-
"data-testid": "".concat(testIdPrefix, "-articles-dots-mobile")
|
252
|
-
}, instructionItems.map(function (_item, i) {
|
253
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, i + 1), {
|
254
|
-
key: i,
|
255
|
-
className: cn('articles-dot', {
|
256
|
-
active: slideIndex === i
|
257
|
-
}, [getActiveCustomClass(i, slideIndex), instructionItem, mobileInstructionItem]),
|
258
|
-
onClick: handleArticleClick(i)
|
259
|
-
}), /*#__PURE__*/React.createElement("span", {
|
260
|
-
className: cn('articles-dot-number')
|
261
|
-
}, i + 1));
|
262
274
|
})));
|
263
|
-
}, [dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.mobileItemText,
|
275
|
+
}, [dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.mobileItemText, instructionItems, mobileItemTitle, slideIndex, isMobileReversed]);
|
264
276
|
var renderArrows = React.useCallback(function () {
|
265
277
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(NavArrow, {
|
266
278
|
dataAttrs: {
|
@@ -287,7 +299,8 @@ var Instructions = function Instructions(_ref) {
|
|
287
299
|
}, [handlePrevClick, handleNextClick, arrowsTheme, arrowPrev, arrowNext, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowPrev, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowNext, slideIndex, instructionItems.length]);
|
288
300
|
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
289
301
|
className: cn({
|
290
|
-
mask: pictureMask
|
302
|
+
mask: pictureMask,
|
303
|
+
reversed: isMobileReversed
|
291
304
|
}),
|
292
305
|
ref: rootRef
|
293
306
|
}), /*#__PURE__*/React.createElement(Grid, {
|
@@ -304,11 +317,11 @@ var Instructions = function Instructions(_ref) {
|
|
304
317
|
background: pictureBackgroundColor
|
305
318
|
}),
|
306
319
|
"data-testid": "".concat(testIdPrefix, "-picture")
|
307
|
-
}, renderPicture(), !!showArrows && renderArrows(), renderQrCode()), /*#__PURE__*/React.createElement("div", {
|
320
|
+
}, isMobileReversed && renderMobileArticles(), renderPicture(), !!showArrows && renderArrows(), renderQrCode()), renderMobileDots(), /*#__PURE__*/React.createElement("div", {
|
308
321
|
className: cn('articles', {
|
309
322
|
align: pictureAlign
|
310
323
|
})
|
311
|
-
}, !!title && renderTitle('desktop'), renderMobileArticles(), renderDesktopArticles(), text && renderText(), children)))));
|
324
|
+
}, !!title && renderTitle('desktop'), !isMobileReversed && renderMobileArticles(), renderDesktopArticles(), text && renderText(), children)))));
|
312
325
|
};
|
313
326
|
|
314
327
|
Instructions.propTypes = {
|
@@ -345,10 +358,11 @@ Instructions.propTypes = {
|
|
345
358
|
}).isRequired).isRequired,
|
346
359
|
pictureAlign: PropTypes.oneOf([pictureAlignTypes.LEFT, pictureAlignTypes.RIGHT]),
|
347
360
|
pictureVerticalAlign: PropTypes.oneOf([pictureVerticalAlignTypes.CENTER, pictureVerticalAlignTypes.TOP, pictureVerticalAlignTypes.UNSET]),
|
348
|
-
pictureMask: PropTypes.oneOf([pictureMaskTypes.ANDROID, pictureMaskTypes.ANDROID_CROPPED, pictureMaskTypes.NEW_IPHONE, pictureMaskTypes.WHITE_IPHONE, pictureMaskTypes.BLACK_IPHONE, pictureMaskTypes.LAPTOP, pictureMaskTypes.IPHONE_12, pictureMaskTypes.IPHONE_CROPPED, pictureMaskTypes.NONE]),
|
361
|
+
pictureMask: PropTypes.oneOf([pictureMaskTypes.ANDROID, pictureMaskTypes.ANDROID_CROPPED, pictureMaskTypes.NEW_IPHONE, pictureMaskTypes.WHITE_IPHONE, pictureMaskTypes.BLACK_IPHONE, pictureMaskTypes.LAPTOP, pictureMaskTypes.LAPTOP_NEW, pictureMaskTypes.IPHONE_12, pictureMaskTypes.IPHONE_15, pictureMaskTypes.IPHONE_CROPPED, pictureMaskTypes.NONE]),
|
349
362
|
pictureBackgroundColor: PropTypes.oneOf([pictureBackgroundColorTypes.SPB_SKY_0]),
|
350
363
|
showArrows: PropTypes.bool,
|
351
364
|
arrowsTheme: PropTypes.oneOf([arrowTheme.DARK, arrowTheme.PURPLE]),
|
365
|
+
elementOrder: PropTypes.oneOf([elementOrderTypes.DEFAULT, elementOrderTypes.REVERSED]),
|
352
366
|
getSwiper: PropTypes.func
|
353
367
|
};
|
354
368
|
export default Instructions;
|
Binary file
|
Binary file
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
export declare const getColumnConfig: (isFullWidth: boolean) => Pick<React.PropsWithChildren<import("
|
2
|
+
export declare const getColumnConfig: (isFullWidth: boolean) => Pick<React.PropsWithChildren<import("@megafon/ui-core/dist/lib/components/Grid/GridColumn").IGridColumn>, "all" | "wide" | "mobile" | "desktop" | "tablet">;
|
@@ -2,6 +2,10 @@ import * as React from 'react';
|
|
2
2
|
import { IconPosition, IBenefit, BackgroundType } from './types';
|
3
3
|
import './style/BenefitsIcons.less';
|
4
4
|
export interface IBenefitsIcons {
|
5
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
6
|
+
dataAttrs?: {
|
7
|
+
root?: Record<string, string>;
|
8
|
+
};
|
5
9
|
/** Ссылка на корневой элемент */
|
6
10
|
rootRef?: React.Ref<HTMLDivElement>;
|
7
11
|
/** Позиция иконки */
|
@@ -43,7 +43,8 @@ var testIdPrefix = 'BenefitsIcons';
|
|
43
43
|
var cn = (0, _uiHelpers.cnCreate)('mfui-benefits-icons');
|
44
44
|
|
45
45
|
var BenefitsIcons = function BenefitsIcons(_ref) {
|
46
|
-
var
|
46
|
+
var dataAttrs = _ref.dataAttrs,
|
47
|
+
rootRef = _ref.rootRef,
|
47
48
|
_ref$iconPosition = _ref.iconPosition,
|
48
49
|
iconPosition = _ref$iconPosition === void 0 ? 'left-top' : _ref$iconPosition,
|
49
50
|
_ref$background = _ref.background,
|
@@ -86,13 +87,13 @@ var BenefitsIcons = function BenefitsIcons(_ref) {
|
|
86
87
|
window.removeEventListener('resize', resizeHandlerThrottled);
|
87
88
|
};
|
88
89
|
}, [iconPosition, inOneColumn, resizeHandler]);
|
89
|
-
return /*#__PURE__*/React.createElement("div", {
|
90
|
+
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
90
91
|
className: cn({
|
91
92
|
'one-column': inOneColumn,
|
92
93
|
background: background
|
93
94
|
}, [className, classes.root]),
|
94
95
|
ref: rootRef
|
95
|
-
}, /*#__PURE__*/React.createElement("div", {
|
96
|
+
}), /*#__PURE__*/React.createElement("div", {
|
96
97
|
className: cn('inner')
|
97
98
|
}, /*#__PURE__*/React.createElement(_uiCore.Grid, {
|
98
99
|
className: classes.grid,
|
@@ -110,7 +111,9 @@ var BenefitsIcons = function BenefitsIcons(_ref) {
|
|
110
111
|
var title = _ref2.title,
|
111
112
|
text = _ref2.text,
|
112
113
|
icon = _ref2.icon,
|
113
|
-
alt = _ref2.alt
|
114
|
+
alt = _ref2.alt,
|
115
|
+
itemClasses = _ref2.classes,
|
116
|
+
itemDataAttrs = _ref2.dataAttrs;
|
114
117
|
var columnConfig = inOneColumn ? (0, _helpers.getOneColumnConfig)(iconPosition) : (0, _helpers["default"])(iconPosition, items.length, i);
|
115
118
|
return /*#__PURE__*/React.createElement(_uiCore.GridColumn, (0, _extends2["default"])({
|
116
119
|
className: cn('column', [classes.gridColumn]),
|
@@ -122,6 +125,8 @@ var BenefitsIcons = function BenefitsIcons(_ref) {
|
|
122
125
|
}
|
123
126
|
}, columnConfig), /*#__PURE__*/React.createElement(_BenefitsIconsTile["default"], {
|
124
127
|
className: cn('tile', [classes.item]),
|
128
|
+
classes: itemClasses,
|
129
|
+
dataAttrs: itemDataAttrs,
|
125
130
|
title: title,
|
126
131
|
text: text,
|
127
132
|
icon: icon,
|
@@ -133,6 +138,9 @@ var BenefitsIcons = function BenefitsIcons(_ref) {
|
|
133
138
|
};
|
134
139
|
|
135
140
|
BenefitsIcons.propTypes = {
|
141
|
+
dataAttrs: _propTypes["default"].shape({
|
142
|
+
root: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired)
|
143
|
+
}),
|
136
144
|
rootRef: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
137
145
|
current: _propTypes["default"].elementType
|
138
146
|
}), _propTypes["default"].any])]),
|
@@ -140,9 +148,20 @@ BenefitsIcons.propTypes = {
|
|
140
148
|
background: _propTypes["default"].oneOf(Object.values(_types.BackgroundEnum)),
|
141
149
|
inOneColumn: _propTypes["default"].bool,
|
142
150
|
items: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
151
|
+
dataAttrs: _propTypes["default"].shape({
|
152
|
+
root: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired)
|
153
|
+
}),
|
154
|
+
classes: _propTypes["default"].shape({
|
155
|
+
root: _propTypes["default"].string,
|
156
|
+
icon: _propTypes["default"].string,
|
157
|
+
title: _propTypes["default"].string,
|
158
|
+
text: _propTypes["default"].string,
|
159
|
+
contentWrapper: _propTypes["default"].string
|
160
|
+
}),
|
143
161
|
title: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].node, _propTypes["default"].arrayOf(_propTypes["default"].node)]),
|
144
162
|
text: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].node, _propTypes["default"].arrayOf(_propTypes["default"].node)]),
|
145
|
-
icon: _propTypes["default"].node.isRequired
|
163
|
+
icon: _propTypes["default"].node.isRequired,
|
164
|
+
alt: _propTypes["default"].string
|
146
165
|
}).isRequired).isRequired,
|
147
166
|
className: _propTypes["default"].string,
|
148
167
|
classes: _propTypes["default"].shape({
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
});
|
8
8
|
exports["default"] = void 0;
|
9
9
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
11
|
+
|
10
12
|
require("core-js/modules/es.object.values.js");
|
11
13
|
|
12
14
|
var React = _interopRequireWildcard(require("react"));
|
@@ -19,17 +21,20 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
21
|
|
20
22
|
var _types = require("./types");
|
21
23
|
|
22
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
23
|
-
|
24
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
25
25
|
|
26
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
27
27
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
29
|
+
|
28
30
|
var testIdPrefix = 'BenefitsIconsTile';
|
29
31
|
var cn = (0, _uiHelpers.cnCreate)('mfui-benefits-icons-tile');
|
30
32
|
|
31
33
|
var BenefitsIconsTile = function BenefitsIconsTile(_ref) {
|
32
|
-
var
|
34
|
+
var dataAttrs = _ref.dataAttrs,
|
35
|
+
_ref$classes = _ref.classes,
|
36
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
37
|
+
title = _ref.title,
|
33
38
|
text = _ref.text,
|
34
39
|
icon = _ref.icon,
|
35
40
|
iconPosition = _ref.iconPosition,
|
@@ -40,7 +45,7 @@ var BenefitsIconsTile = function BenefitsIconsTile(_ref) {
|
|
40
45
|
var renderIcon = function renderIcon() {
|
41
46
|
if (typeof icon === 'string') {
|
42
47
|
return /*#__PURE__*/React.createElement("img", {
|
43
|
-
className: cn('img-icon'),
|
48
|
+
className: cn('img-icon', [classes.icon]),
|
44
49
|
src: icon,
|
45
50
|
alt: alt,
|
46
51
|
"data-testid": "".concat(testIdPrefix, "-img")
|
@@ -48,32 +53,42 @@ var BenefitsIconsTile = function BenefitsIconsTile(_ref) {
|
|
48
53
|
}
|
49
54
|
|
50
55
|
return /*#__PURE__*/React.createElement("div", {
|
51
|
-
className: cn('svg-icon'),
|
56
|
+
className: cn('svg-icon', [classes.icon]),
|
52
57
|
"data-testid": "".concat(testIdPrefix, "-svg")
|
53
58
|
}, icon);
|
54
59
|
};
|
55
60
|
|
56
|
-
return /*#__PURE__*/React.createElement("div", {
|
61
|
+
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
57
62
|
className: cn({
|
58
63
|
'icon-position': iconPosition,
|
59
64
|
background: background,
|
60
65
|
image: typeof icon === 'string'
|
61
|
-
}, [className]),
|
66
|
+
}, [className, classes.root]),
|
62
67
|
"data-testid": "".concat(testIdPrefix, "-root")
|
63
|
-
}, /*#__PURE__*/React.createElement("div", {
|
68
|
+
}), /*#__PURE__*/React.createElement("div", {
|
64
69
|
className: cn('inner')
|
65
70
|
}, renderIcon(), /*#__PURE__*/React.createElement("div", {
|
66
|
-
className: cn('content-wrapper')
|
71
|
+
className: cn('content-wrapper', [classes.contentWrapper])
|
67
72
|
}, title && /*#__PURE__*/React.createElement(_uiCore.Header, {
|
68
|
-
className: cn('title'),
|
73
|
+
className: cn('title', [classes.title]),
|
69
74
|
as: "h5"
|
70
75
|
}, title), text && /*#__PURE__*/React.createElement("div", {
|
71
|
-
className: cn('content')
|
76
|
+
className: cn('content', [classes.text])
|
72
77
|
}, text))));
|
73
78
|
};
|
74
79
|
|
75
80
|
BenefitsIconsTile.propTypes = {
|
81
|
+
dataAttrs: _propTypes["default"].shape({
|
82
|
+
root: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired)
|
83
|
+
}),
|
76
84
|
className: _propTypes["default"].string,
|
85
|
+
classes: _propTypes["default"].shape({
|
86
|
+
root: _propTypes["default"].string,
|
87
|
+
icon: _propTypes["default"].string,
|
88
|
+
title: _propTypes["default"].string,
|
89
|
+
text: _propTypes["default"].string,
|
90
|
+
contentWrapper: _propTypes["default"].string
|
91
|
+
}),
|
77
92
|
title: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].node, _propTypes["default"].arrayOf(_propTypes["default"].node)]),
|
78
93
|
text: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].node, _propTypes["default"].arrayOf(_propTypes["default"].node)]),
|
79
94
|
iconPosition: _propTypes["default"].oneOf(Object.values(_types.IconPositionEnum)),
|