@megafon/ui-shared 9.5.2 → 9.6.1

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.
@@ -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}.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)}
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}@media screen and (min-width:1024px){.mfui-9-image-banner__picture_h-align-desktop_right{-webkit-box-pack:end;-ms-flex-pack:end;justify-content: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{font-size:15px;font-weight:500;line-height:24px;margin-top:16px;white-space:pre-wrap}.mfui-9-image-banner__description_large{font-size:18px;line-height:24px}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-image-banner__description_large{font-size:20px;letter-spacing:.5px;line-height:28px}}.mfui-9-image-banner__cost{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:767px){.mfui-9-image-banner__children_h-align-mobile_left{-webkit-box-align:start;-ms-flex-align:start;align-items: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,left top,left bottom,from(var(--gradient-angle)),color-stop(0,var(--gradient-first-color)),to(var(--gradient-second-color)));background:linear-gradient(var(--gradient-angle),var(--gradient-first-color) 0,var(--gradient-second-color) 100%)}.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,6 +26,16 @@ 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];
29
39
  export interface IImageBannerProps {
30
40
  /** Дополнительные data атрибуты к внутренним элементам */
31
41
  dataAttrs?: {
@@ -46,6 +56,7 @@ export interface IImageBannerProps {
46
56
  badges?: string;
47
57
  adBlock?: string;
48
58
  children?: string;
59
+ content?: string;
49
60
  };
50
61
  /** Ссылка на корневой элемент */
51
62
  rootRef?: React.Ref<HTMLDivElement>;
@@ -63,6 +74,12 @@ export interface IImageBannerProps {
63
74
  headerTag?: IHeaderProps['tag'];
64
75
  /** Фоновый цвет */
65
76
  backgroundColor?: BackgroundColorType;
77
+ /** Угол наклона градиента (используется только с фоном = gradient, по умолчанию 270deg) */
78
+ gradientAngle?: string;
79
+ /** Первый цвет градиента (используется только с фоном = gradient, по умолчанию #ADA6BA) */
80
+ gradientFirstColor?: string;
81
+ /** Второй цвет градиента (используется только с фоном = gradient, по умолчанию #F6F2F9) */
82
+ gradientSecondColor?: string;
66
83
  /** Радиус границы */
67
84
  radius?: RadiusType;
68
85
  /** Изображение на разрешении экрана 0-1023 */
@@ -77,6 +94,8 @@ export interface IImageBannerProps {
77
94
  imageAlt?: string;
78
95
  /** Выравнивание изображения по вертикали (по умолчанию center) */
79
96
  imageVerticalAlign?: ImageVerticalAlignType;
97
+ /** Выравнивание изображения по горизонтали на разрешениях 1024+ (по умолчанию center) */
98
+ imageHorizontalAlignDesktop?: ImageHorizontalAlignType;
80
99
  /** Приоритет загрузки изображения */
81
100
  fetchPriority?: 'auto' | 'high' | 'low';
82
101
  /** Высота баннера зависит от высоты контента (по умолчанию фиксированная) */
@@ -91,6 +110,10 @@ export interface IImageBannerProps {
91
110
  adBlock?: JSX.Element | null;
92
111
  /** Отступ сверху */
93
112
  hasMarginTop?: boolean;
113
+ /** Увеличенный размер текста-описания */
114
+ isDescriptionLarge?: boolean;
115
+ /** Выравнивание chiildren по горизонтали на разрешениях 767- (по умолчанию center) */
116
+ childrenHorizontalAlignMobile?: ChildrenHorizontalAlignType;
94
117
  children?: React.ReactNode;
95
118
  }
96
119
  declare const ImageBanner: React.FC<IImageBannerProps>;
@@ -28,6 +28,14 @@ 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
+ };
31
39
  var getTheme = function getTheme(backgrounColor) {
32
40
  switch (backgrounColor) {
33
41
  case BackgroundColor.GREEN:
@@ -68,6 +76,8 @@ var ImageBanner = function ImageBanner(_ref2) {
68
76
  imageAlt = _ref2$imageAlt === void 0 ? '' : _ref2$imageAlt,
69
77
  _ref2$imageVerticalAl = _ref2.imageVerticalAlign,
70
78
  imageVerticalAlign = _ref2$imageVerticalAl === void 0 ? ImageVerticalAlign.CENTER : _ref2$imageVerticalAl,
79
+ _ref2$imageHorizontal = _ref2.imageHorizontalAlignDesktop,
80
+ imageHorizontalAlignDesktop = _ref2$imageHorizontal === void 0 ? ImageHorizontalAlign.CENTER : _ref2$imageHorizontal,
71
81
  _ref2$fetchPriority = _ref2.fetchPriority,
72
82
  fetchPriority = _ref2$fetchPriority === void 0 ? 'auto' : _ref2$fetchPriority,
73
83
  title = _ref2.title,
@@ -80,6 +90,12 @@ var ImageBanner = function ImageBanner(_ref2) {
80
90
  headerTag = _ref2.headerTag,
81
91
  _ref2$backgroundColor = _ref2.backgroundColor,
82
92
  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,
83
99
  _ref2$radius = _ref2.radius,
84
100
  radius = _ref2$radius === void 0 ? Radius.CORNERS : _ref2$radius,
85
101
  autoHeight = _ref2.autoHeight,
@@ -90,6 +106,10 @@ var ImageBanner = function ImageBanner(_ref2) {
90
106
  hasMarginTop = _ref2$hasMarginTop === void 0 ? false : _ref2$hasMarginTop,
91
107
  _ref2$fullHeightOnMob = _ref2.fullHeightOnMobile,
92
108
  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,
93
113
  _ref2$children = _ref2.children,
94
114
  children = _ref2$children === void 0 ? [] : _ref2$children;
95
115
  var _React$useState = React.useState(false),
@@ -117,7 +137,7 @@ var ImageBanner = function ImageBanner(_ref2) {
117
137
  className: cn('ad-block', [classes.adBlock])
118
138
  }, adBlock);
119
139
  var renderContent = /*#__PURE__*/React.createElement("div", {
120
- className: cn('content')
140
+ className: cn('content', [classes.content])
121
141
  }, /*#__PURE__*/React.createElement("div", {
122
142
  className: cn('badges-container', [classes.badgesContainer])
123
143
  }, renderBadges, renderAdBlock), !!title && /*#__PURE__*/React.createElement(Header, {
@@ -126,15 +146,20 @@ var ImageBanner = function ImageBanner(_ref2) {
126
146
  as: isMobile ? headerLevelMobile : headerLevel,
127
147
  tag: headerTag
128
148
  }, typeof title === 'string' ? convert(title, titleConvertConfig) : title), !!description && /*#__PURE__*/React.createElement("div", {
129
- className: cn('description', [classes.description])
149
+ className: cn('description', {
150
+ large: isDescriptionLarge
151
+ }, [classes.description])
130
152
  }, typeof description === 'string' ? convert(description, titleConvertConfig) : description), !!cost && /*#__PURE__*/React.createElement("div", {
131
153
  className: cn('cost', [classes.cost])
132
154
  }, convert(cost, typographyConfig)), !!children && !!React.Children.count(children) && /*#__PURE__*/React.createElement("div", {
133
- className: cn('children', [classes.children])
155
+ className: cn('children', {
156
+ 'h-align-mobile': childrenHorizontalAlignMobile
157
+ }, [classes.children])
134
158
  }, children));
135
159
  var renderImage = /*#__PURE__*/React.createElement("picture", {
136
160
  className: cn('picture', {
137
- 'v-align': imageVerticalAlign
161
+ 'v-align': imageVerticalAlign,
162
+ 'h-align-desktop': imageHorizontalAlignDesktop
138
163
  })
139
164
  }, /*#__PURE__*/React.createElement("source", {
140
165
  className: classes.imageSource,
@@ -158,7 +183,12 @@ var ImageBanner = function ImageBanner(_ref2) {
158
183
  'full-height-on-mobile': fullHeightOnMobile,
159
184
  radius: radius
160
185
  }, [className, classes.root]),
161
- ref: rootRef
186
+ ref: rootRef,
187
+ style: {
188
+ '--gradient-angle': gradientAngle,
189
+ '--gradient-first-color': gradientFirstColor,
190
+ '--gradient-second-color': gradientSecondColor
191
+ }
162
192
  }), renderContent, hasImage && renderImage);
163
193
  };
164
194
  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}.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)}
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}@media screen and (min-width:1024px){.mfui-9-image-banner__picture_h-align-desktop_right{-webkit-box-pack:end;-ms-flex-pack:end;justify-content: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{font-size:15px;font-weight:500;line-height:24px;margin-top:16px;white-space:pre-wrap}.mfui-9-image-banner__description_large{font-size:18px;line-height:24px}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-image-banner__description_large{font-size:20px;letter-spacing:.5px;line-height:28px}}.mfui-9-image-banner__cost{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:767px){.mfui-9-image-banner__children_h-align-mobile_left{-webkit-box-align:start;-ms-flex-align:start;align-items: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,left top,left bottom,from(var(--gradient-angle)),color-stop(0,var(--gradient-first-color)),to(var(--gradient-second-color)));background:linear-gradient(var(--gradient-angle),var(--gradient-first-color) 0,var(--gradient-second-color) 100%)}.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,6 +26,16 @@ 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];
29
39
  export interface IImageBannerProps {
30
40
  /** Дополнительные data атрибуты к внутренним элементам */
31
41
  dataAttrs?: {
@@ -46,6 +56,7 @@ export interface IImageBannerProps {
46
56
  badges?: string;
47
57
  adBlock?: string;
48
58
  children?: string;
59
+ content?: string;
49
60
  };
50
61
  /** Ссылка на корневой элемент */
51
62
  rootRef?: React.Ref<HTMLDivElement>;
@@ -63,6 +74,12 @@ export interface IImageBannerProps {
63
74
  headerTag?: IHeaderProps['tag'];
64
75
  /** Фоновый цвет */
65
76
  backgroundColor?: BackgroundColorType;
77
+ /** Угол наклона градиента (используется только с фоном = gradient, по умолчанию 270deg) */
78
+ gradientAngle?: string;
79
+ /** Первый цвет градиента (используется только с фоном = gradient, по умолчанию #ADA6BA) */
80
+ gradientFirstColor?: string;
81
+ /** Второй цвет градиента (используется только с фоном = gradient, по умолчанию #F6F2F9) */
82
+ gradientSecondColor?: string;
66
83
  /** Радиус границы */
67
84
  radius?: RadiusType;
68
85
  /** Изображение на разрешении экрана 0-1023 */
@@ -77,6 +94,8 @@ export interface IImageBannerProps {
77
94
  imageAlt?: string;
78
95
  /** Выравнивание изображения по вертикали (по умолчанию center) */
79
96
  imageVerticalAlign?: ImageVerticalAlignType;
97
+ /** Выравнивание изображения по горизонтали на разрешениях 1024+ (по умолчанию center) */
98
+ imageHorizontalAlignDesktop?: ImageHorizontalAlignType;
80
99
  /** Приоритет загрузки изображения */
81
100
  fetchPriority?: 'auto' | 'high' | 'low';
82
101
  /** Высота баннера зависит от высоты контента (по умолчанию фиксированная) */
@@ -91,6 +110,10 @@ export interface IImageBannerProps {
91
110
  adBlock?: JSX.Element | null;
92
111
  /** Отступ сверху */
93
112
  hasMarginTop?: boolean;
113
+ /** Увеличенный размер текста-описания */
114
+ isDescriptionLarge?: boolean;
115
+ /** Выравнивание chiildren по горизонтали на разрешениях 767- (по умолчанию center) */
116
+ childrenHorizontalAlignMobile?: ChildrenHorizontalAlignType;
94
117
  children?: React.ReactNode;
95
118
  }
96
119
  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.BackgroundColor = void 0;
7
+ exports["default"] = exports.Radius = exports.NavTheme = exports.ImageVerticalAlign = exports.ImageHorizontalAlign = exports.ChildrenHorizontalAlign = 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,6 +36,14 @@ 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
+ };
39
47
  var getTheme = function getTheme(backgrounColor) {
40
48
  switch (backgrounColor) {
41
49
  case BackgroundColor.GREEN:
@@ -76,6 +84,8 @@ var ImageBanner = function ImageBanner(_ref2) {
76
84
  imageAlt = _ref2$imageAlt === void 0 ? '' : _ref2$imageAlt,
77
85
  _ref2$imageVerticalAl = _ref2.imageVerticalAlign,
78
86
  imageVerticalAlign = _ref2$imageVerticalAl === void 0 ? ImageVerticalAlign.CENTER : _ref2$imageVerticalAl,
87
+ _ref2$imageHorizontal = _ref2.imageHorizontalAlignDesktop,
88
+ imageHorizontalAlignDesktop = _ref2$imageHorizontal === void 0 ? ImageHorizontalAlign.CENTER : _ref2$imageHorizontal,
79
89
  _ref2$fetchPriority = _ref2.fetchPriority,
80
90
  fetchPriority = _ref2$fetchPriority === void 0 ? 'auto' : _ref2$fetchPriority,
81
91
  title = _ref2.title,
@@ -88,6 +98,12 @@ var ImageBanner = function ImageBanner(_ref2) {
88
98
  headerTag = _ref2.headerTag,
89
99
  _ref2$backgroundColor = _ref2.backgroundColor,
90
100
  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,
91
107
  _ref2$radius = _ref2.radius,
92
108
  radius = _ref2$radius === void 0 ? Radius.CORNERS : _ref2$radius,
93
109
  autoHeight = _ref2.autoHeight,
@@ -98,6 +114,10 @@ var ImageBanner = function ImageBanner(_ref2) {
98
114
  hasMarginTop = _ref2$hasMarginTop === void 0 ? false : _ref2$hasMarginTop,
99
115
  _ref2$fullHeightOnMob = _ref2.fullHeightOnMobile,
100
116
  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,
101
121
  _ref2$children = _ref2.children,
102
122
  children = _ref2$children === void 0 ? [] : _ref2$children;
103
123
  var _React$useState = React.useState(false),
@@ -125,7 +145,7 @@ var ImageBanner = function ImageBanner(_ref2) {
125
145
  className: cn('ad-block', [classes.adBlock])
126
146
  }, adBlock);
127
147
  var renderContent = /*#__PURE__*/React.createElement("div", {
128
- className: cn('content')
148
+ className: cn('content', [classes.content])
129
149
  }, /*#__PURE__*/React.createElement("div", {
130
150
  className: cn('badges-container', [classes.badgesContainer])
131
151
  }, renderBadges, renderAdBlock), !!title && /*#__PURE__*/React.createElement(_uiCore.Header, {
@@ -134,15 +154,20 @@ var ImageBanner = function ImageBanner(_ref2) {
134
154
  as: isMobile ? headerLevelMobile : headerLevel,
135
155
  tag: headerTag
136
156
  }, typeof title === 'string' ? (0, _uiHelpers.convert)(title, _uiHelpers.titleConvertConfig) : title), !!description && /*#__PURE__*/React.createElement("div", {
137
- className: cn('description', [classes.description])
157
+ className: cn('description', {
158
+ large: isDescriptionLarge
159
+ }, [classes.description])
138
160
  }, typeof description === 'string' ? (0, _uiHelpers.convert)(description, _uiHelpers.titleConvertConfig) : description), !!cost && /*#__PURE__*/React.createElement("div", {
139
161
  className: cn('cost', [classes.cost])
140
162
  }, (0, _uiHelpers.convert)(cost, typographyConfig)), !!children && !!React.Children.count(children) && /*#__PURE__*/React.createElement("div", {
141
- className: cn('children', [classes.children])
163
+ className: cn('children', {
164
+ 'h-align-mobile': childrenHorizontalAlignMobile
165
+ }, [classes.children])
142
166
  }, children));
143
167
  var renderImage = /*#__PURE__*/React.createElement("picture", {
144
168
  className: cn('picture', {
145
- 'v-align': imageVerticalAlign
169
+ 'v-align': imageVerticalAlign,
170
+ 'h-align-desktop': imageHorizontalAlignDesktop
146
171
  })
147
172
  }, /*#__PURE__*/React.createElement("source", {
148
173
  className: classes.imageSource,
@@ -166,7 +191,12 @@ var ImageBanner = function ImageBanner(_ref2) {
166
191
  'full-height-on-mobile': fullHeightOnMobile,
167
192
  radius: radius
168
193
  }, [className, classes.root]),
169
- ref: rootRef
194
+ ref: rootRef,
195
+ style: {
196
+ '--gradient-angle': gradientAngle,
197
+ '--gradient-first-color': gradientFirstColor,
198
+ '--gradient-second-color': gradientSecondColor
199
+ }
170
200
  }), renderContent, hasImage && renderImage);
171
201
  };
172
202
  var _default = exports["default"] = ImageBanner;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megafon/ui-shared",
3
- "version": "9.5.2",
3
+ "version": "9.6.1",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -77,7 +77,7 @@
77
77
  },
78
78
  "dependencies": {
79
79
  "@babel/runtime": "^7.8.4",
80
- "@megafon/ui-core": "^9.11.0",
80
+ "@megafon/ui-core": "^9.13.0",
81
81
  "@megafon/ui-helpers": "^5.1.0",
82
82
  "@megafon/ui-icons": "^4.5.0",
83
83
  "core-js": "^3.6.4",
@@ -85,5 +85,5 @@
85
85
  "lodash.throttle": "^4.1.1",
86
86
  "swiper": "^12.1.2"
87
87
  },
88
- "gitHead": "794eaf9b2e1eeaefd6d2be44430a28b34b72d8c3"
88
+ "gitHead": "c8fce5d048ee7757c0f47a91a2f345f70eb1eef1"
89
89
  }