@megafon/ui-shared 9.6.0 → 9.6.2
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/es/components/ImageBanner/ImageBanner.css +1 -1
- package/dist/es/components/ImageBanner/ImageBanner.d.ts +0 -23
- package/dist/es/components/ImageBanner/ImageBanner.js +5 -35
- package/dist/lib/components/ImageBanner/ImageBanner.css +1 -1
- package/dist/lib/components/ImageBanner/ImageBanner.d.ts +0 -23
- package/dist/lib/components/ImageBanner/ImageBanner.js +6 -36
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
h1,h2,h3,h4,h5{margin:0}.mfui-9-image-banner{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;overflow:hidden}@media screen and (min-width:1024px){.mfui-9-image-banner{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:420px}}.mfui-9-image-banner__picture{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}@media screen and (min-width:1024px){.mfui-9-image-banner__picture{height:100%;max-width:672px;width:50%}}.mfui-9-image-banner__picture_v-align_top{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.mfui-9-image-banner__picture_v-align_center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.mfui-9-image-banner__picture_v-align_bottom{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-9-image-banner{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;overflow:hidden}@media screen and (min-width:1024px){.mfui-9-image-banner{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:420px}}.mfui-9-image-banner__picture{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}@media screen and (min-width:1024px){.mfui-9-image-banner__picture{height:100%;max-width:672px;width:50%}}.mfui-9-image-banner__picture_v-align_top{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.mfui-9-image-banner__picture_v-align_center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.mfui-9-image-banner__picture_v-align_bottom{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.mfui-9-image-banner__image{display:block;max-height:150px;max-width:100%}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-image-banner__image{max-height:230px}}@media screen and (min-width:1024px){.mfui-9-image-banner__image{max-height:100%;-o-object-fit:contain;object-fit:contain}}.mfui-9-image-banner__content{z-index:1;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}@media screen and (max-width:1023px){.mfui-9-image-banner__content{padding:24px}}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-image-banner__content{text-align:center}}@media screen and (min-width:1024px){.mfui-9-image-banner__content{padding:0 80px;width:50%}}.mfui-9-image-banner__description{white-space:pre-wrap}.mfui-9-image-banner__cost,.mfui-9-image-banner__description{font-size:15px;font-weight:500;line-height:24px;margin-top:16px}.mfui-9-image-banner__value{display:inline;margin:0 4px}@media screen and (max-width:1023px),screen and (min-width:1024px) and (max-width:1279px){.mfui-9-image-banner__value{line-height:21px}}.mfui-9-image-banner__text,.mfui-9-image-banner__title{white-space:pre-wrap}.mfui-9-image-banner__children{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-top:32px}@media screen and (max-width:767px){.mfui-9-image-banner__children{-webkit-box-align:center;-ms-flex-align:center;align-items:center}}@media screen and (min-width:768px){.mfui-9-image-banner__children{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}}@media screen and (min-width:1024px){.mfui-9-image-banner__children{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}}@media screen and (max-width:1023px){.mfui-9-image-banner__badges-container{display:-webkit-box;display:-ms-flexbox;display:flex;gap:8px}}.mfui-9-image-banner__badges{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:8px;margin-bottom:16px}.mfui-9-image-banner__ad-block{margin:0 0 16px auto}@media screen and (min-width:1024px){.mfui-9-image-banner__ad-block{position:absolute;right:24px;top:24px}}.mfui-9-image-banner_margin-top{margin-top:24px}.mfui-9-image-banner_radius_rounded{border-radius:24px}@media screen and (max-width:1023px){.mfui-9-image-banner_full-height-on-mobile{height:100%}}@media screen and (min-width:1024px){.mfui-9-image-banner_auto-height .mfui-9-image-banner__content{padding:48px 80px}.mfui-9-image-banner_auto-height{height:auto}.mfui-9-image-banner_has-image .mfui-9-image-banner__content{padding-right:0}.mfui-9-image-banner_full-width .mfui-9-image-banner__image{bottom:0;display:block;max-width:unset;position:absolute;right:0}.mfui-9-image-banner_full-width.mfui-9-image-banner_auto-height .mfui-9-image-banner__image{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}}.mfui-9-image-banner_background-color_green{background-color:var(--brandGreen)}.mfui-9-image-banner_background-color_purple{background-color:var(--brandPurple)}.mfui-9-image-banner_background-color_gradient{background:-webkit-gradient(linear,right top,left top,from(#ada6ba),to(#f6f2f9));background:linear-gradient(270deg,#ada6ba,#f6f2f9)}.mfui-9-image-banner_background-color_light{background-color:#f6f2f9}.mfui-9-image-banner_background-color_spbSky0{background-color:var(--spbSky0)}.mfui-9-image-banner_text-color_light .mfui-9-image-banner__content{color:var(--stcWhite)}.mfui-9-image-banner_text-color_dark .mfui-9-image-banner__content{color:var(--stcBlack)}
|
|
@@ -26,16 +26,6 @@ export declare const ImageVerticalAlign: {
|
|
|
26
26
|
readonly BOTTOM: "bottom";
|
|
27
27
|
};
|
|
28
28
|
export type ImageVerticalAlignType = (typeof ImageVerticalAlign)[keyof typeof ImageVerticalAlign];
|
|
29
|
-
export declare const ImageHorizontalAlign: {
|
|
30
|
-
readonly CENTER: "center";
|
|
31
|
-
readonly RIGHT: "right";
|
|
32
|
-
};
|
|
33
|
-
export type ImageHorizontalAlignType = (typeof ImageHorizontalAlign)[keyof typeof ImageHorizontalAlign];
|
|
34
|
-
export declare const ChildrenHorizontalAlign: {
|
|
35
|
-
readonly CENTER: "center";
|
|
36
|
-
readonly LEFT: "left";
|
|
37
|
-
};
|
|
38
|
-
export type ChildrenHorizontalAlignType = (typeof ChildrenHorizontalAlign)[keyof typeof ChildrenHorizontalAlign];
|
|
39
29
|
export interface IImageBannerProps {
|
|
40
30
|
/** Дополнительные data атрибуты к внутренним элементам */
|
|
41
31
|
dataAttrs?: {
|
|
@@ -56,7 +46,6 @@ export interface IImageBannerProps {
|
|
|
56
46
|
badges?: string;
|
|
57
47
|
adBlock?: string;
|
|
58
48
|
children?: string;
|
|
59
|
-
content?: string;
|
|
60
49
|
};
|
|
61
50
|
/** Ссылка на корневой элемент */
|
|
62
51
|
rootRef?: React.Ref<HTMLDivElement>;
|
|
@@ -74,12 +63,6 @@ export interface IImageBannerProps {
|
|
|
74
63
|
headerTag?: IHeaderProps['tag'];
|
|
75
64
|
/** Фоновый цвет */
|
|
76
65
|
backgroundColor?: BackgroundColorType;
|
|
77
|
-
/** Угол наклона градиента (используется только с фоном = gradient, по умолчанию 270deg) */
|
|
78
|
-
gradientAngle?: string;
|
|
79
|
-
/** Первый цвет градиента (используется только с фоном = gradient, по умолчанию #ADA6BA) */
|
|
80
|
-
gradientFirstColor?: string;
|
|
81
|
-
/** Второй цвет градиента (используется только с фоном = gradient, по умолчанию #F6F2F9) */
|
|
82
|
-
gradientSecondColor?: string;
|
|
83
66
|
/** Радиус границы */
|
|
84
67
|
radius?: RadiusType;
|
|
85
68
|
/** Изображение на разрешении экрана 0-1023 */
|
|
@@ -94,8 +77,6 @@ export interface IImageBannerProps {
|
|
|
94
77
|
imageAlt?: string;
|
|
95
78
|
/** Выравнивание изображения по вертикали (по умолчанию center) */
|
|
96
79
|
imageVerticalAlign?: ImageVerticalAlignType;
|
|
97
|
-
/** Выравнивание изображения по горизонтали на разрешениях 1024+ (по умолчанию center) */
|
|
98
|
-
imageHorizontalAlignDesktop?: ImageHorizontalAlignType;
|
|
99
80
|
/** Приоритет загрузки изображения */
|
|
100
81
|
fetchPriority?: 'auto' | 'high' | 'low';
|
|
101
82
|
/** Высота баннера зависит от высоты контента (по умолчанию фиксированная) */
|
|
@@ -110,10 +91,6 @@ export interface IImageBannerProps {
|
|
|
110
91
|
adBlock?: JSX.Element | null;
|
|
111
92
|
/** Отступ сверху */
|
|
112
93
|
hasMarginTop?: boolean;
|
|
113
|
-
/** Увеличенный размер текста-описания */
|
|
114
|
-
isDescriptionLarge?: boolean;
|
|
115
|
-
/** Выравнивание chiildren по горизонтали на разрешениях 767- (по умолчанию center) */
|
|
116
|
-
childrenHorizontalAlignMobile?: ChildrenHorizontalAlignType;
|
|
117
94
|
children?: React.ReactNode;
|
|
118
95
|
}
|
|
119
96
|
declare const ImageBanner: React.FC<IImageBannerProps>;
|
|
@@ -28,14 +28,6 @@ export var ImageVerticalAlign = {
|
|
|
28
28
|
CENTER: 'center',
|
|
29
29
|
BOTTOM: 'bottom'
|
|
30
30
|
};
|
|
31
|
-
export var ImageHorizontalAlign = {
|
|
32
|
-
CENTER: 'center',
|
|
33
|
-
RIGHT: 'right'
|
|
34
|
-
};
|
|
35
|
-
export var ChildrenHorizontalAlign = {
|
|
36
|
-
CENTER: 'center',
|
|
37
|
-
LEFT: 'left'
|
|
38
|
-
};
|
|
39
31
|
var getTheme = function getTheme(backgrounColor) {
|
|
40
32
|
switch (backgrounColor) {
|
|
41
33
|
case BackgroundColor.GREEN:
|
|
@@ -76,8 +68,6 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
|
76
68
|
imageAlt = _ref2$imageAlt === void 0 ? '' : _ref2$imageAlt,
|
|
77
69
|
_ref2$imageVerticalAl = _ref2.imageVerticalAlign,
|
|
78
70
|
imageVerticalAlign = _ref2$imageVerticalAl === void 0 ? ImageVerticalAlign.CENTER : _ref2$imageVerticalAl,
|
|
79
|
-
_ref2$imageHorizontal = _ref2.imageHorizontalAlignDesktop,
|
|
80
|
-
imageHorizontalAlignDesktop = _ref2$imageHorizontal === void 0 ? ImageHorizontalAlign.CENTER : _ref2$imageHorizontal,
|
|
81
71
|
_ref2$fetchPriority = _ref2.fetchPriority,
|
|
82
72
|
fetchPriority = _ref2$fetchPriority === void 0 ? 'auto' : _ref2$fetchPriority,
|
|
83
73
|
title = _ref2.title,
|
|
@@ -90,12 +80,6 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
|
90
80
|
headerTag = _ref2.headerTag,
|
|
91
81
|
_ref2$backgroundColor = _ref2.backgroundColor,
|
|
92
82
|
backgroundColor = _ref2$backgroundColor === void 0 ? BackgroundColor.TRANSPARENT : _ref2$backgroundColor,
|
|
93
|
-
_ref2$gradientAngle = _ref2.gradientAngle,
|
|
94
|
-
gradientAngle = _ref2$gradientAngle === void 0 ? '270deg' : _ref2$gradientAngle,
|
|
95
|
-
_ref2$gradientFirstCo = _ref2.gradientFirstColor,
|
|
96
|
-
gradientFirstColor = _ref2$gradientFirstCo === void 0 ? '#ADA6BA' : _ref2$gradientFirstCo,
|
|
97
|
-
_ref2$gradientSecondC = _ref2.gradientSecondColor,
|
|
98
|
-
gradientSecondColor = _ref2$gradientSecondC === void 0 ? '#F6F2F9' : _ref2$gradientSecondC,
|
|
99
83
|
_ref2$radius = _ref2.radius,
|
|
100
84
|
radius = _ref2$radius === void 0 ? Radius.CORNERS : _ref2$radius,
|
|
101
85
|
autoHeight = _ref2.autoHeight,
|
|
@@ -106,10 +90,6 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
|
106
90
|
hasMarginTop = _ref2$hasMarginTop === void 0 ? false : _ref2$hasMarginTop,
|
|
107
91
|
_ref2$fullHeightOnMob = _ref2.fullHeightOnMobile,
|
|
108
92
|
fullHeightOnMobile = _ref2$fullHeightOnMob === void 0 ? false : _ref2$fullHeightOnMob,
|
|
109
|
-
_ref2$isDescriptionLa = _ref2.isDescriptionLarge,
|
|
110
|
-
isDescriptionLarge = _ref2$isDescriptionLa === void 0 ? false : _ref2$isDescriptionLa,
|
|
111
|
-
_ref2$childrenHorizon = _ref2.childrenHorizontalAlignMobile,
|
|
112
|
-
childrenHorizontalAlignMobile = _ref2$childrenHorizon === void 0 ? ChildrenHorizontalAlign.CENTER : _ref2$childrenHorizon,
|
|
113
93
|
_ref2$children = _ref2.children,
|
|
114
94
|
children = _ref2$children === void 0 ? [] : _ref2$children;
|
|
115
95
|
var _React$useState = React.useState(false),
|
|
@@ -137,7 +117,7 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
|
137
117
|
className: cn('ad-block', [classes.adBlock])
|
|
138
118
|
}, adBlock);
|
|
139
119
|
var renderContent = /*#__PURE__*/React.createElement("div", {
|
|
140
|
-
className: cn('content'
|
|
120
|
+
className: cn('content')
|
|
141
121
|
}, /*#__PURE__*/React.createElement("div", {
|
|
142
122
|
className: cn('badges-container', [classes.badgesContainer])
|
|
143
123
|
}, renderBadges, renderAdBlock), !!title && /*#__PURE__*/React.createElement(Header, {
|
|
@@ -146,20 +126,15 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
|
146
126
|
as: isMobile ? headerLevelMobile : headerLevel,
|
|
147
127
|
tag: headerTag
|
|
148
128
|
}, typeof title === 'string' ? convert(title, titleConvertConfig) : title), !!description && /*#__PURE__*/React.createElement("div", {
|
|
149
|
-
className: cn('description',
|
|
150
|
-
large: isDescriptionLarge
|
|
151
|
-
}, [classes.description])
|
|
129
|
+
className: cn('description', [classes.description])
|
|
152
130
|
}, typeof description === 'string' ? convert(description, titleConvertConfig) : description), !!cost && /*#__PURE__*/React.createElement("div", {
|
|
153
131
|
className: cn('cost', [classes.cost])
|
|
154
132
|
}, convert(cost, typographyConfig)), !!children && !!React.Children.count(children) && /*#__PURE__*/React.createElement("div", {
|
|
155
|
-
className: cn('children',
|
|
156
|
-
'h-align-mobile': childrenHorizontalAlignMobile
|
|
157
|
-
}, [classes.children])
|
|
133
|
+
className: cn('children', [classes.children])
|
|
158
134
|
}, children));
|
|
159
135
|
var renderImage = /*#__PURE__*/React.createElement("picture", {
|
|
160
136
|
className: cn('picture', {
|
|
161
|
-
'v-align': imageVerticalAlign
|
|
162
|
-
'h-align-desktop': imageHorizontalAlignDesktop
|
|
137
|
+
'v-align': imageVerticalAlign
|
|
163
138
|
})
|
|
164
139
|
}, /*#__PURE__*/React.createElement("source", {
|
|
165
140
|
className: classes.imageSource,
|
|
@@ -183,12 +158,7 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
|
183
158
|
'full-height-on-mobile': fullHeightOnMobile,
|
|
184
159
|
radius: radius
|
|
185
160
|
}, [className, classes.root]),
|
|
186
|
-
ref: rootRef
|
|
187
|
-
style: {
|
|
188
|
-
'--gradient-angle': gradientAngle,
|
|
189
|
-
'--gradient-first-color': gradientFirstColor,
|
|
190
|
-
'--gradient-second-color': gradientSecondColor
|
|
191
|
-
}
|
|
161
|
+
ref: rootRef
|
|
192
162
|
}), renderContent, hasImage && renderImage);
|
|
193
163
|
};
|
|
194
164
|
export default ImageBanner;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
h1,h2,h3,h4,h5{margin:0}.mfui-9-image-banner{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;overflow:hidden}@media screen and (min-width:1024px){.mfui-9-image-banner{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:420px}}.mfui-9-image-banner__picture{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}@media screen and (min-width:1024px){.mfui-9-image-banner__picture{height:100%;max-width:672px;width:50%}}.mfui-9-image-banner__picture_v-align_top{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.mfui-9-image-banner__picture_v-align_center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.mfui-9-image-banner__picture_v-align_bottom{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-9-image-banner{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;overflow:hidden}@media screen and (min-width:1024px){.mfui-9-image-banner{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:420px}}.mfui-9-image-banner__picture{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}@media screen and (min-width:1024px){.mfui-9-image-banner__picture{height:100%;max-width:672px;width:50%}}.mfui-9-image-banner__picture_v-align_top{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.mfui-9-image-banner__picture_v-align_center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.mfui-9-image-banner__picture_v-align_bottom{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.mfui-9-image-banner__image{display:block;max-height:150px;max-width:100%}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-image-banner__image{max-height:230px}}@media screen and (min-width:1024px){.mfui-9-image-banner__image{max-height:100%;-o-object-fit:contain;object-fit:contain}}.mfui-9-image-banner__content{z-index:1;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}@media screen and (max-width:1023px){.mfui-9-image-banner__content{padding:24px}}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-image-banner__content{text-align:center}}@media screen and (min-width:1024px){.mfui-9-image-banner__content{padding:0 80px;width:50%}}.mfui-9-image-banner__description{white-space:pre-wrap}.mfui-9-image-banner__cost,.mfui-9-image-banner__description{font-size:15px;font-weight:500;line-height:24px;margin-top:16px}.mfui-9-image-banner__value{display:inline;margin:0 4px}@media screen and (max-width:1023px),screen and (min-width:1024px) and (max-width:1279px){.mfui-9-image-banner__value{line-height:21px}}.mfui-9-image-banner__text,.mfui-9-image-banner__title{white-space:pre-wrap}.mfui-9-image-banner__children{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-top:32px}@media screen and (max-width:767px){.mfui-9-image-banner__children{-webkit-box-align:center;-ms-flex-align:center;align-items:center}}@media screen and (min-width:768px){.mfui-9-image-banner__children{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}}@media screen and (min-width:1024px){.mfui-9-image-banner__children{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}}@media screen and (max-width:1023px){.mfui-9-image-banner__badges-container{display:-webkit-box;display:-ms-flexbox;display:flex;gap:8px}}.mfui-9-image-banner__badges{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:8px;margin-bottom:16px}.mfui-9-image-banner__ad-block{margin:0 0 16px auto}@media screen and (min-width:1024px){.mfui-9-image-banner__ad-block{position:absolute;right:24px;top:24px}}.mfui-9-image-banner_margin-top{margin-top:24px}.mfui-9-image-banner_radius_rounded{border-radius:24px}@media screen and (max-width:1023px){.mfui-9-image-banner_full-height-on-mobile{height:100%}}@media screen and (min-width:1024px){.mfui-9-image-banner_auto-height .mfui-9-image-banner__content{padding:48px 80px}.mfui-9-image-banner_auto-height{height:auto}.mfui-9-image-banner_has-image .mfui-9-image-banner__content{padding-right:0}.mfui-9-image-banner_full-width .mfui-9-image-banner__image{bottom:0;display:block;max-width:unset;position:absolute;right:0}.mfui-9-image-banner_full-width.mfui-9-image-banner_auto-height .mfui-9-image-banner__image{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}}.mfui-9-image-banner_background-color_green{background-color:var(--brandGreen)}.mfui-9-image-banner_background-color_purple{background-color:var(--brandPurple)}.mfui-9-image-banner_background-color_gradient{background:-webkit-gradient(linear,right top,left top,from(#ada6ba),to(#f6f2f9));background:linear-gradient(270deg,#ada6ba,#f6f2f9)}.mfui-9-image-banner_background-color_light{background-color:#f6f2f9}.mfui-9-image-banner_background-color_spbSky0{background-color:var(--spbSky0)}.mfui-9-image-banner_text-color_light .mfui-9-image-banner__content{color:var(--stcWhite)}.mfui-9-image-banner_text-color_dark .mfui-9-image-banner__content{color:var(--stcBlack)}
|
|
@@ -26,16 +26,6 @@ export declare const ImageVerticalAlign: {
|
|
|
26
26
|
readonly BOTTOM: "bottom";
|
|
27
27
|
};
|
|
28
28
|
export type ImageVerticalAlignType = (typeof ImageVerticalAlign)[keyof typeof ImageVerticalAlign];
|
|
29
|
-
export declare const ImageHorizontalAlign: {
|
|
30
|
-
readonly CENTER: "center";
|
|
31
|
-
readonly RIGHT: "right";
|
|
32
|
-
};
|
|
33
|
-
export type ImageHorizontalAlignType = (typeof ImageHorizontalAlign)[keyof typeof ImageHorizontalAlign];
|
|
34
|
-
export declare const ChildrenHorizontalAlign: {
|
|
35
|
-
readonly CENTER: "center";
|
|
36
|
-
readonly LEFT: "left";
|
|
37
|
-
};
|
|
38
|
-
export type ChildrenHorizontalAlignType = (typeof ChildrenHorizontalAlign)[keyof typeof ChildrenHorizontalAlign];
|
|
39
29
|
export interface IImageBannerProps {
|
|
40
30
|
/** Дополнительные data атрибуты к внутренним элементам */
|
|
41
31
|
dataAttrs?: {
|
|
@@ -56,7 +46,6 @@ export interface IImageBannerProps {
|
|
|
56
46
|
badges?: string;
|
|
57
47
|
adBlock?: string;
|
|
58
48
|
children?: string;
|
|
59
|
-
content?: string;
|
|
60
49
|
};
|
|
61
50
|
/** Ссылка на корневой элемент */
|
|
62
51
|
rootRef?: React.Ref<HTMLDivElement>;
|
|
@@ -74,12 +63,6 @@ export interface IImageBannerProps {
|
|
|
74
63
|
headerTag?: IHeaderProps['tag'];
|
|
75
64
|
/** Фоновый цвет */
|
|
76
65
|
backgroundColor?: BackgroundColorType;
|
|
77
|
-
/** Угол наклона градиента (используется только с фоном = gradient, по умолчанию 270deg) */
|
|
78
|
-
gradientAngle?: string;
|
|
79
|
-
/** Первый цвет градиента (используется только с фоном = gradient, по умолчанию #ADA6BA) */
|
|
80
|
-
gradientFirstColor?: string;
|
|
81
|
-
/** Второй цвет градиента (используется только с фоном = gradient, по умолчанию #F6F2F9) */
|
|
82
|
-
gradientSecondColor?: string;
|
|
83
66
|
/** Радиус границы */
|
|
84
67
|
radius?: RadiusType;
|
|
85
68
|
/** Изображение на разрешении экрана 0-1023 */
|
|
@@ -94,8 +77,6 @@ export interface IImageBannerProps {
|
|
|
94
77
|
imageAlt?: string;
|
|
95
78
|
/** Выравнивание изображения по вертикали (по умолчанию center) */
|
|
96
79
|
imageVerticalAlign?: ImageVerticalAlignType;
|
|
97
|
-
/** Выравнивание изображения по горизонтали на разрешениях 1024+ (по умолчанию center) */
|
|
98
|
-
imageHorizontalAlignDesktop?: ImageHorizontalAlignType;
|
|
99
80
|
/** Приоритет загрузки изображения */
|
|
100
81
|
fetchPriority?: 'auto' | 'high' | 'low';
|
|
101
82
|
/** Высота баннера зависит от высоты контента (по умолчанию фиксированная) */
|
|
@@ -110,10 +91,6 @@ export interface IImageBannerProps {
|
|
|
110
91
|
adBlock?: JSX.Element | null;
|
|
111
92
|
/** Отступ сверху */
|
|
112
93
|
hasMarginTop?: boolean;
|
|
113
|
-
/** Увеличенный размер текста-описания */
|
|
114
|
-
isDescriptionLarge?: boolean;
|
|
115
|
-
/** Выравнивание chiildren по горизонтали на разрешениях 767- (по умолчанию center) */
|
|
116
|
-
childrenHorizontalAlignMobile?: ChildrenHorizontalAlignType;
|
|
117
94
|
children?: React.ReactNode;
|
|
118
95
|
}
|
|
119
96
|
declare const ImageBanner: React.FC<IImageBannerProps>;
|
|
@@ -4,7 +4,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports["default"] = exports.Radius = exports.NavTheme = exports.ImageVerticalAlign = exports.
|
|
7
|
+
exports["default"] = exports.Radius = exports.NavTheme = exports.ImageVerticalAlign = exports.BackgroundColor = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
require("core-js/modules/es.symbol.js");
|
|
@@ -36,14 +36,6 @@ var ImageVerticalAlign = exports.ImageVerticalAlign = {
|
|
|
36
36
|
CENTER: 'center',
|
|
37
37
|
BOTTOM: 'bottom'
|
|
38
38
|
};
|
|
39
|
-
var ImageHorizontalAlign = exports.ImageHorizontalAlign = {
|
|
40
|
-
CENTER: 'center',
|
|
41
|
-
RIGHT: 'right'
|
|
42
|
-
};
|
|
43
|
-
var ChildrenHorizontalAlign = exports.ChildrenHorizontalAlign = {
|
|
44
|
-
CENTER: 'center',
|
|
45
|
-
LEFT: 'left'
|
|
46
|
-
};
|
|
47
39
|
var getTheme = function getTheme(backgrounColor) {
|
|
48
40
|
switch (backgrounColor) {
|
|
49
41
|
case BackgroundColor.GREEN:
|
|
@@ -84,8 +76,6 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
|
84
76
|
imageAlt = _ref2$imageAlt === void 0 ? '' : _ref2$imageAlt,
|
|
85
77
|
_ref2$imageVerticalAl = _ref2.imageVerticalAlign,
|
|
86
78
|
imageVerticalAlign = _ref2$imageVerticalAl === void 0 ? ImageVerticalAlign.CENTER : _ref2$imageVerticalAl,
|
|
87
|
-
_ref2$imageHorizontal = _ref2.imageHorizontalAlignDesktop,
|
|
88
|
-
imageHorizontalAlignDesktop = _ref2$imageHorizontal === void 0 ? ImageHorizontalAlign.CENTER : _ref2$imageHorizontal,
|
|
89
79
|
_ref2$fetchPriority = _ref2.fetchPriority,
|
|
90
80
|
fetchPriority = _ref2$fetchPriority === void 0 ? 'auto' : _ref2$fetchPriority,
|
|
91
81
|
title = _ref2.title,
|
|
@@ -98,12 +88,6 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
|
98
88
|
headerTag = _ref2.headerTag,
|
|
99
89
|
_ref2$backgroundColor = _ref2.backgroundColor,
|
|
100
90
|
backgroundColor = _ref2$backgroundColor === void 0 ? BackgroundColor.TRANSPARENT : _ref2$backgroundColor,
|
|
101
|
-
_ref2$gradientAngle = _ref2.gradientAngle,
|
|
102
|
-
gradientAngle = _ref2$gradientAngle === void 0 ? '270deg' : _ref2$gradientAngle,
|
|
103
|
-
_ref2$gradientFirstCo = _ref2.gradientFirstColor,
|
|
104
|
-
gradientFirstColor = _ref2$gradientFirstCo === void 0 ? '#ADA6BA' : _ref2$gradientFirstCo,
|
|
105
|
-
_ref2$gradientSecondC = _ref2.gradientSecondColor,
|
|
106
|
-
gradientSecondColor = _ref2$gradientSecondC === void 0 ? '#F6F2F9' : _ref2$gradientSecondC,
|
|
107
91
|
_ref2$radius = _ref2.radius,
|
|
108
92
|
radius = _ref2$radius === void 0 ? Radius.CORNERS : _ref2$radius,
|
|
109
93
|
autoHeight = _ref2.autoHeight,
|
|
@@ -114,10 +98,6 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
|
114
98
|
hasMarginTop = _ref2$hasMarginTop === void 0 ? false : _ref2$hasMarginTop,
|
|
115
99
|
_ref2$fullHeightOnMob = _ref2.fullHeightOnMobile,
|
|
116
100
|
fullHeightOnMobile = _ref2$fullHeightOnMob === void 0 ? false : _ref2$fullHeightOnMob,
|
|
117
|
-
_ref2$isDescriptionLa = _ref2.isDescriptionLarge,
|
|
118
|
-
isDescriptionLarge = _ref2$isDescriptionLa === void 0 ? false : _ref2$isDescriptionLa,
|
|
119
|
-
_ref2$childrenHorizon = _ref2.childrenHorizontalAlignMobile,
|
|
120
|
-
childrenHorizontalAlignMobile = _ref2$childrenHorizon === void 0 ? ChildrenHorizontalAlign.CENTER : _ref2$childrenHorizon,
|
|
121
101
|
_ref2$children = _ref2.children,
|
|
122
102
|
children = _ref2$children === void 0 ? [] : _ref2$children;
|
|
123
103
|
var _React$useState = React.useState(false),
|
|
@@ -145,7 +125,7 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
|
145
125
|
className: cn('ad-block', [classes.adBlock])
|
|
146
126
|
}, adBlock);
|
|
147
127
|
var renderContent = /*#__PURE__*/React.createElement("div", {
|
|
148
|
-
className: cn('content'
|
|
128
|
+
className: cn('content')
|
|
149
129
|
}, /*#__PURE__*/React.createElement("div", {
|
|
150
130
|
className: cn('badges-container', [classes.badgesContainer])
|
|
151
131
|
}, renderBadges, renderAdBlock), !!title && /*#__PURE__*/React.createElement(_uiCore.Header, {
|
|
@@ -154,20 +134,15 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
|
154
134
|
as: isMobile ? headerLevelMobile : headerLevel,
|
|
155
135
|
tag: headerTag
|
|
156
136
|
}, typeof title === 'string' ? (0, _uiHelpers.convert)(title, _uiHelpers.titleConvertConfig) : title), !!description && /*#__PURE__*/React.createElement("div", {
|
|
157
|
-
className: cn('description',
|
|
158
|
-
large: isDescriptionLarge
|
|
159
|
-
}, [classes.description])
|
|
137
|
+
className: cn('description', [classes.description])
|
|
160
138
|
}, typeof description === 'string' ? (0, _uiHelpers.convert)(description, _uiHelpers.titleConvertConfig) : description), !!cost && /*#__PURE__*/React.createElement("div", {
|
|
161
139
|
className: cn('cost', [classes.cost])
|
|
162
140
|
}, (0, _uiHelpers.convert)(cost, typographyConfig)), !!children && !!React.Children.count(children) && /*#__PURE__*/React.createElement("div", {
|
|
163
|
-
className: cn('children',
|
|
164
|
-
'h-align-mobile': childrenHorizontalAlignMobile
|
|
165
|
-
}, [classes.children])
|
|
141
|
+
className: cn('children', [classes.children])
|
|
166
142
|
}, children));
|
|
167
143
|
var renderImage = /*#__PURE__*/React.createElement("picture", {
|
|
168
144
|
className: cn('picture', {
|
|
169
|
-
'v-align': imageVerticalAlign
|
|
170
|
-
'h-align-desktop': imageHorizontalAlignDesktop
|
|
145
|
+
'v-align': imageVerticalAlign
|
|
171
146
|
})
|
|
172
147
|
}, /*#__PURE__*/React.createElement("source", {
|
|
173
148
|
className: classes.imageSource,
|
|
@@ -191,12 +166,7 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
|
191
166
|
'full-height-on-mobile': fullHeightOnMobile,
|
|
192
167
|
radius: radius
|
|
193
168
|
}, [className, classes.root]),
|
|
194
|
-
ref: rootRef
|
|
195
|
-
style: {
|
|
196
|
-
'--gradient-angle': gradientAngle,
|
|
197
|
-
'--gradient-first-color': gradientFirstColor,
|
|
198
|
-
'--gradient-second-color': gradientSecondColor
|
|
199
|
-
}
|
|
169
|
+
ref: rootRef
|
|
200
170
|
}), renderContent, hasImage && renderImage);
|
|
201
171
|
};
|
|
202
172
|
var _default = exports["default"] = ImageBanner;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@megafon/ui-shared",
|
|
3
|
-
"version": "9.6.
|
|
3
|
+
"version": "9.6.2",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -77,13 +77,13 @@
|
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"@babel/runtime": "^7.8.4",
|
|
80
|
-
"@megafon/ui-core": "^9.
|
|
80
|
+
"@megafon/ui-core": "^9.14.0",
|
|
81
81
|
"@megafon/ui-helpers": "^5.1.0",
|
|
82
|
-
"@megafon/ui-icons": "^4.
|
|
82
|
+
"@megafon/ui-icons": "^4.6.0",
|
|
83
83
|
"core-js": "^3.6.4",
|
|
84
84
|
"htmr": "^1.0.2",
|
|
85
85
|
"lodash.throttle": "^4.1.1",
|
|
86
86
|
"swiper": "^12.1.2"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "ef292c261d35466982191cd7df70f0568459f96a"
|
|
89
89
|
}
|