@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
@@ -1,6 +1,18 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
declare type TGridSizeValues = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12';
|
3
3
|
export interface IBenefit {
|
4
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
5
|
+
dataAttrs?: {
|
6
|
+
root?: Record<string, string>;
|
7
|
+
};
|
8
|
+
/** Дополнительные классы для корневого и внутренних элементов */
|
9
|
+
classes?: {
|
10
|
+
root?: string;
|
11
|
+
icon?: string;
|
12
|
+
title?: string;
|
13
|
+
text?: string;
|
14
|
+
contentWrapper?: string;
|
15
|
+
};
|
4
16
|
/** Заголовок бенефита */
|
5
17
|
title?: string | React.ReactNode | React.ReactNode[];
|
6
18
|
/** Основной текст в бенефите */
|
@@ -5,6 +5,11 @@ export declare const ButtonColor: {
|
|
5
5
|
readonly PURPLE: "purple";
|
6
6
|
};
|
7
7
|
declare type ButtonColorType = typeof ButtonColor[keyof typeof ButtonColor];
|
8
|
+
export declare const ButtonTypes: {
|
9
|
+
readonly PRIMARY: "primary";
|
10
|
+
readonly OUTLINE: "outline";
|
11
|
+
};
|
12
|
+
declare type ButtonTypesType = typeof ButtonTypes[keyof typeof ButtonTypes];
|
8
13
|
export declare const ButtonTarget: {
|
9
14
|
readonly SELF: "_self";
|
10
15
|
readonly BLANK: "_blank";
|
@@ -46,6 +51,8 @@ export interface IButtonBannerProps {
|
|
46
51
|
buttonTarget?: ButtonTargetType;
|
47
52
|
/** Цвет кнопки */
|
48
53
|
buttonColor?: ButtonColorType;
|
54
|
+
/** Тип кнопки */
|
55
|
+
buttonType?: ButtonTypesType;
|
49
56
|
/** Rel - атрибут тега <a> */
|
50
57
|
buttonRel?: string;
|
51
58
|
/** Масштабирование изображения */
|
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
6
6
|
value: true
|
7
7
|
});
|
8
|
-
exports["default"] = exports.ImageScaling = exports.ButtonTarget = exports.ButtonColor = void 0;
|
8
|
+
exports["default"] = exports.ImageScaling = exports.ButtonTarget = exports.ButtonTypes = exports.ButtonColor = void 0;
|
9
9
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
11
11
|
|
@@ -30,6 +30,11 @@ var ButtonColor = {
|
|
30
30
|
PURPLE: 'purple'
|
31
31
|
};
|
32
32
|
exports.ButtonColor = ButtonColor;
|
33
|
+
var ButtonTypes = {
|
34
|
+
PRIMARY: 'primary',
|
35
|
+
OUTLINE: 'outline'
|
36
|
+
};
|
37
|
+
exports.ButtonTypes = ButtonTypes;
|
33
38
|
var ButtonTarget = {
|
34
39
|
SELF: '_self',
|
35
40
|
BLANK: '_blank'
|
@@ -67,6 +72,8 @@ var ButtonBanner = function ButtonBanner(_ref) {
|
|
67
72
|
buttonTarget = _ref$buttonTarget === void 0 ? '_self' : _ref$buttonTarget,
|
68
73
|
_ref$buttonColor = _ref.buttonColor,
|
69
74
|
buttonColor = _ref$buttonColor === void 0 ? 'green' : _ref$buttonColor,
|
75
|
+
_ref$buttonType = _ref.buttonType,
|
76
|
+
buttonType = _ref$buttonType === void 0 ? 'primary' : _ref$buttonType,
|
70
77
|
buttonRel = _ref.buttonRel,
|
71
78
|
_ref$imageScaling = _ref.imageScaling,
|
72
79
|
imageScaling = _ref$imageScaling === void 0 ? 'cover' : _ref$imageScaling,
|
@@ -81,6 +88,7 @@ var ButtonBanner = function ButtonBanner(_ref) {
|
|
81
88
|
rel: buttonRel,
|
82
89
|
target: buttonTarget,
|
83
90
|
theme: buttonColor,
|
91
|
+
type: buttonType,
|
84
92
|
onClick: onButtonClick,
|
85
93
|
download: buttonDownload
|
86
94
|
}, buttonText);
|
@@ -138,6 +146,7 @@ ButtonBanner.propTypes = {
|
|
138
146
|
buttonDownload: PropTypes.bool,
|
139
147
|
buttonTarget: PropTypes.oneOf(Object.values(ButtonTarget)),
|
140
148
|
buttonColor: PropTypes.oneOf(Object.values(ButtonColor)),
|
149
|
+
buttonType: PropTypes.oneOf(Object.values(ButtonTypes)),
|
141
150
|
buttonRel: PropTypes.string,
|
142
151
|
onButtonClick: PropTypes.func
|
143
152
|
};
|
@@ -43,6 +43,13 @@ export interface IImageBannerProps {
|
|
43
43
|
classes?: {
|
44
44
|
root?: string;
|
45
45
|
image?: string;
|
46
|
+
title?: string;
|
47
|
+
description?: string;
|
48
|
+
cost?: string;
|
49
|
+
badgesContainer?: string;
|
50
|
+
badges?: string;
|
51
|
+
badge?: string;
|
52
|
+
adBlock?: string;
|
46
53
|
};
|
47
54
|
/** Ссылка на корневой элемент */
|
48
55
|
rootRef?: Ref<HTMLDivElement>;
|
@@ -121,11 +121,12 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
121
121
|
var hasImage = !!(imageMobile || imageMobile2x || imageDesktop || imageDesktop2x);
|
122
122
|
|
123
123
|
var renderBadges = !!badges.length && /*#__PURE__*/_react["default"].createElement("div", {
|
124
|
-
className: cn('badges')
|
124
|
+
className: cn('badges', [classes.badges])
|
125
125
|
}, badges.map(function (_ref3) {
|
126
126
|
var text = _ref3.text,
|
127
127
|
iconType = _ref3.iconType;
|
128
128
|
return /*#__PURE__*/_react["default"].createElement(_uiCore.PriceBadge, {
|
129
|
+
className: classes.badge,
|
129
130
|
theme: navTheme,
|
130
131
|
iconType: iconType,
|
131
132
|
key: text
|
@@ -133,22 +134,22 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
133
134
|
}));
|
134
135
|
|
135
136
|
var renderAdBlock = !!adBlock && /*#__PURE__*/_react["default"].createElement("div", {
|
136
|
-
className: cn('ad-block')
|
137
|
+
className: cn('ad-block', [classes.adBlock])
|
137
138
|
}, adBlock);
|
138
139
|
|
139
140
|
var renderContent = /*#__PURE__*/_react["default"].createElement("div", {
|
140
141
|
className: cn('content')
|
141
142
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
142
|
-
className: cn('badges-container')
|
143
|
+
className: cn('badges-container', [classes.badgesContainer])
|
143
144
|
}, renderBadges, renderAdBlock), !!title && /*#__PURE__*/_react["default"].createElement(_uiCore.Header, {
|
144
|
-
className: cn('title'),
|
145
|
+
className: cn('title', [classes.title]),
|
145
146
|
color: "inherit"
|
146
147
|
}, typeof title === 'string' ? (0, _uiHelpers.convert)(title, _uiHelpers.titleConvertConfig) : title), !!description && /*#__PURE__*/_react["default"].createElement(_uiCore.Header, {
|
147
|
-
className: cn('description'),
|
148
|
+
className: cn('description', [classes.description]),
|
148
149
|
as: "h5",
|
149
150
|
color: "inherit"
|
150
151
|
}, typeof description === 'string' ? (0, _uiHelpers.convert)(description, _uiHelpers.titleConvertConfig) : description), !!cost && /*#__PURE__*/_react["default"].createElement("div", {
|
151
|
-
className: cn('cost')
|
152
|
+
className: cn('cost', [classes.cost])
|
152
153
|
}, (0, _uiHelpers.convert)(cost, typographyConfig)), !!children && !!_react["default"].Children.count(children) && /*#__PURE__*/_react["default"].createElement("div", {
|
153
154
|
className: cn('children')
|
154
155
|
}, children));
|
@@ -191,7 +192,14 @@ ImageBanner.propTypes = {
|
|
191
192
|
className: PropTypes.string,
|
192
193
|
classes: PropTypes.shape({
|
193
194
|
root: PropTypes.string,
|
194
|
-
image: PropTypes.string
|
195
|
+
image: PropTypes.string,
|
196
|
+
title: PropTypes.string,
|
197
|
+
description: PropTypes.string,
|
198
|
+
cost: PropTypes.string,
|
199
|
+
badgesContainer: PropTypes.string,
|
200
|
+
badges: PropTypes.string,
|
201
|
+
badge: PropTypes.string,
|
202
|
+
adBlock: PropTypes.string
|
195
203
|
}),
|
196
204
|
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
197
205
|
current: PropTypes.elementType
|
@@ -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
|
}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports["default"] = exports.arrowTheme = exports.pictureBackgroundColorTypes = exports.pictureMaskTypes = exports.pictureVerticalAlignTypes = exports.pictureAlignTypes = void 0;
|
6
|
+
exports["default"] = exports.elementOrderTypes = exports.arrowTheme = exports.pictureBackgroundColorTypes = exports.pictureMaskTypes = exports.pictureVerticalAlignTypes = exports.pictureAlignTypes = void 0;
|
7
7
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
9
|
|
@@ -44,7 +44,9 @@ var pictureMaskTypes = {
|
|
44
44
|
BLACK_IPHONE: 'black-iphone',
|
45
45
|
WHITE_IPHONE: 'white-iphone',
|
46
46
|
LAPTOP: 'laptop',
|
47
|
+
LAPTOP_NEW: 'laptop-new',
|
47
48
|
IPHONE_12: 'iphone-12',
|
49
|
+
IPHONE_15: 'iphone-15',
|
48
50
|
IPHONE_CROPPED: 'iphone-cropped',
|
49
51
|
NONE: 'none'
|
50
52
|
};
|
@@ -58,6 +60,11 @@ var arrowTheme = {
|
|
58
60
|
DARK: 'dark'
|
59
61
|
};
|
60
62
|
exports.arrowTheme = arrowTheme;
|
63
|
+
var elementOrderTypes = {
|
64
|
+
DEFAULT: 'default',
|
65
|
+
REVERSED: 'reversed'
|
66
|
+
};
|
67
|
+
exports.elementOrderTypes = elementOrderTypes;
|
61
68
|
var testIdPrefix = 'Instructions';
|
62
69
|
var cn = (0, _uiHelpers.cnCreate)('mfui-instructions');
|
63
70
|
var swiperSlideCn = cn('slide');
|
@@ -92,6 +99,8 @@ var Instructions = function Instructions(_ref) {
|
|
92
99
|
showArrows = _ref.showArrows,
|
93
100
|
_ref$arrowsTheme = _ref.arrowsTheme,
|
94
101
|
arrowsTheme = _ref$arrowsTheme === void 0 ? arrowTheme.DARK : _ref$arrowsTheme,
|
102
|
+
_ref$elementOrder = _ref.elementOrder,
|
103
|
+
elementOrder = _ref$elementOrder === void 0 ? 'default' : _ref$elementOrder,
|
95
104
|
children = _ref.children;
|
96
105
|
|
97
106
|
var _React$useState = _react["default"].useState(),
|
@@ -104,6 +113,8 @@ var Instructions = function Instructions(_ref) {
|
|
104
113
|
slideIndex = _React$useState4[0],
|
105
114
|
setSlideIndex = _React$useState4[1];
|
106
115
|
|
116
|
+
var isMobileReversed = elementOrder === 'reversed';
|
117
|
+
|
107
118
|
var getSwiperInstance = _react["default"].useCallback(function (swiper) {
|
108
119
|
setSwiperInstance(swiper);
|
109
120
|
getSwiper && getSwiper(swiper);
|
@@ -160,6 +171,23 @@ var Instructions = function Instructions(_ref) {
|
|
160
171
|
}));
|
161
172
|
}, [dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image]);
|
162
173
|
|
174
|
+
var renderMobileDots = _react["default"].useCallback(function () {
|
175
|
+
return /*#__PURE__*/_react["default"].createElement("ul", {
|
176
|
+
className: cn('articles-dots', {
|
177
|
+
reversed: isMobileReversed
|
178
|
+
}),
|
179
|
+
"data-testid": "".concat(testIdPrefix, "-articles-dots-mobile")
|
180
|
+
}, instructionItems.map(function (_item, i) {
|
181
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, i + 1), {
|
182
|
+
key: i,
|
183
|
+
className: cn('articles-dot', {
|
184
|
+
active: slideIndex === i
|
185
|
+
}, [getActiveCustomClass(i, slideIndex), instructionItem, mobileInstructionItem]),
|
186
|
+
onClick: handleArticleClick(i)
|
187
|
+
}));
|
188
|
+
}));
|
189
|
+
}, [instructionItems, dataAttrs, slideIndex, instructionItem, mobileInstructionItem, getActiveCustomClass, handleArticleClick, isMobileReversed]);
|
190
|
+
|
163
191
|
var renderSlider = _react["default"].useCallback(function () {
|
164
192
|
return /*#__PURE__*/_react["default"].createElement(_react2.Swiper, {
|
165
193
|
noSwiping: false,
|
@@ -268,7 +296,9 @@ var Instructions = function Instructions(_ref) {
|
|
268
296
|
}),
|
269
297
|
"data-testid": "".concat(testIdPrefix, "-articles-list-mobile")
|
270
298
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
271
|
-
className: cn('articles-title-block'
|
299
|
+
className: cn('articles-title-block', {
|
300
|
+
reversed: isMobileReversed
|
301
|
+
})
|
272
302
|
}, instructionItems.map(function (_ref6, i) {
|
273
303
|
var itemTitle = _ref6.title;
|
274
304
|
return slideIndex === i && /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
@@ -277,23 +307,8 @@ var Instructions = function Instructions(_ref) {
|
|
277
307
|
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.mobileItemText, i + 1), {
|
278
308
|
className: cn('articles-title', [mobileItemTitle])
|
279
309
|
}), itemTitle);
|
280
|
-
})), /*#__PURE__*/_react["default"].createElement("ul", {
|
281
|
-
className: cn('articles-dots', {
|
282
|
-
'text-after': !!text
|
283
|
-
}),
|
284
|
-
"data-testid": "".concat(testIdPrefix, "-articles-dots-mobile")
|
285
|
-
}, instructionItems.map(function (_item, i) {
|
286
|
-
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, i + 1), {
|
287
|
-
key: i,
|
288
|
-
className: cn('articles-dot', {
|
289
|
-
active: slideIndex === i
|
290
|
-
}, [getActiveCustomClass(i, slideIndex), instructionItem, mobileInstructionItem]),
|
291
|
-
onClick: handleArticleClick(i)
|
292
|
-
}), /*#__PURE__*/_react["default"].createElement("span", {
|
293
|
-
className: cn('articles-dot-number')
|
294
|
-
}, i + 1));
|
295
310
|
})));
|
296
|
-
}, [dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.mobileItemText,
|
311
|
+
}, [dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.mobileItemText, instructionItems, mobileItemTitle, slideIndex, isMobileReversed]);
|
297
312
|
|
298
313
|
var renderArrows = _react["default"].useCallback(function () {
|
299
314
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_uiCore.NavArrow, {
|
@@ -322,7 +337,8 @@ var Instructions = function Instructions(_ref) {
|
|
322
337
|
|
323
338
|
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
324
339
|
className: cn({
|
325
|
-
mask: pictureMask
|
340
|
+
mask: pictureMask,
|
341
|
+
reversed: isMobileReversed
|
326
342
|
}),
|
327
343
|
ref: rootRef
|
328
344
|
}), /*#__PURE__*/_react["default"].createElement(_uiCore.Grid, {
|
@@ -339,11 +355,11 @@ var Instructions = function Instructions(_ref) {
|
|
339
355
|
background: pictureBackgroundColor
|
340
356
|
}),
|
341
357
|
"data-testid": "".concat(testIdPrefix, "-picture")
|
342
|
-
}, renderPicture(), !!showArrows && renderArrows(), renderQrCode()), /*#__PURE__*/_react["default"].createElement("div", {
|
358
|
+
}, isMobileReversed && renderMobileArticles(), renderPicture(), !!showArrows && renderArrows(), renderQrCode()), renderMobileDots(), /*#__PURE__*/_react["default"].createElement("div", {
|
343
359
|
className: cn('articles', {
|
344
360
|
align: pictureAlign
|
345
361
|
})
|
346
|
-
}, !!title && renderTitle('desktop'), renderMobileArticles(), renderDesktopArticles(), text && renderText(), children)))));
|
362
|
+
}, !!title && renderTitle('desktop'), !isMobileReversed && renderMobileArticles(), renderDesktopArticles(), text && renderText(), children)))));
|
347
363
|
};
|
348
364
|
|
349
365
|
Instructions.propTypes = {
|
@@ -380,10 +396,11 @@ Instructions.propTypes = {
|
|
380
396
|
}).isRequired).isRequired,
|
381
397
|
pictureAlign: _propTypes["default"].oneOf([pictureAlignTypes.LEFT, pictureAlignTypes.RIGHT]),
|
382
398
|
pictureVerticalAlign: _propTypes["default"].oneOf([pictureVerticalAlignTypes.CENTER, pictureVerticalAlignTypes.TOP, pictureVerticalAlignTypes.UNSET]),
|
383
|
-
pictureMask: _propTypes["default"].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]),
|
399
|
+
pictureMask: _propTypes["default"].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]),
|
384
400
|
pictureBackgroundColor: _propTypes["default"].oneOf([pictureBackgroundColorTypes.SPB_SKY_0]),
|
385
401
|
showArrows: _propTypes["default"].bool,
|
386
402
|
arrowsTheme: _propTypes["default"].oneOf([arrowTheme.DARK, arrowTheme.PURPLE]),
|
403
|
+
elementOrder: _propTypes["default"].oneOf([elementOrderTypes.DEFAULT, elementOrderTypes.REVERSED]),
|
387
404
|
getSwiper: _propTypes["default"].func
|
388
405
|
};
|
389
406
|
var _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">;
|