@megafon/ui-shared 5.15.0 → 5.17.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 CHANGED
@@ -3,6 +3,46 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.17.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@5.16.0...@megafon/ui-shared@5.17.0) (2024-07-17)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **imagebanner:** fix aligning for children ([cafb869](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/cafb8699b601a3bfa2aa149d64e1dbdf4b05b1c5))
12
+ * **imagebanner:** fix image width for mobile ([0bcd718](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/0bcd718e37627f30dfeb440a54786bbcdec1dcc1))
13
+
14
+
15
+ ### Features
16
+
17
+ * **card:** increase root and image border-radius ([45b6796](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/45b6796d9711c2818a6fc40c5e8491c7f978534c))
18
+ * **container:** add layer with background color '--background' ([a4af59e](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/a4af59e7b71363fea59b457f45187bd61b7e84d9))
19
+
20
+
21
+
22
+
23
+
24
+ # [5.16.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@5.15.0...@megafon/ui-shared@5.16.0) (2024-07-08)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * **imagebanner:** fix size for mobile ([45e6e67](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/45e6e67a914d27f9b91c81a1216917cf399d4973))
30
+ * **imagebanner:** review fixes ([1522d02](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/1522d0292428c7d04636d73b04ed679b81a1771c))
31
+
32
+
33
+ ### Features
34
+
35
+ * **card:** add new props: markerList, badge; add new value hover-shadow to prop view; ([c73c54b](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/c73c54b158e4b6e38a77e569e874763feaa593b4))
36
+ * **container:** add border-radius to root element ([419ec1f](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/419ec1fb16fffe138c772438768eab04e43f3589))
37
+ * **imagebanner:** update badges for ImageBanner ([554e1ad](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/554e1ada1dc9dc7b7e7f9214056cdb83e4af9ba0))
38
+ * **imagebanner:** update classes props for ImageBanner ([8ec0df4](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/8ec0df4ce74e1e4f00fc5edab52357f9f6aa9ede))
39
+ * **imagebanner:** update image size for ImageBanner ([cd0242e](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/cd0242e24085bc2e1e8f0339ae8c7f0781c3fb39))
40
+ * **textwithicon:** add border for icon ([1af5774](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/1af57741ebc67abe503c842ee181f0d36f04db26))
41
+
42
+
43
+
44
+
45
+
6
46
  # [5.15.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@5.14.0...@megafon/ui-shared@5.15.0) (2024-07-01)
7
47
 
8
48
 
@@ -18,7 +18,7 @@ h5 {
18
18
  -ms-flex-direction: column;
19
19
  flex-direction: column;
20
20
  padding: 16px 16px 24px;
21
- border-radius: 12px;
21
+ border-radius: 24px;
22
22
  color: var(--content);
23
23
  text-decoration: none !important;
24
24
  background-color: var(--base);
@@ -42,6 +42,7 @@ h5 {
42
42
  -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
43
43
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
44
44
  }
45
+ .mfui-card_link.mfui-card_view_hover-shadow:hover,
45
46
  .mfui-card_link.mfui-card_view_shadow:hover {
46
47
  -webkit-box-shadow: 0 8px 28px 0 rgba(0, 0, 0, 0.1);
47
48
  box-shadow: 0 8px 28px 0 rgba(0, 0, 0, 0.1);
@@ -60,6 +61,18 @@ h5 {
60
61
  padding: 32px;
61
62
  }
62
63
  }
64
+ .mfui-card__header {
65
+ display: -webkit-box;
66
+ display: -ms-flexbox;
67
+ display: flex;
68
+ gap: 12px;
69
+ -webkit-box-align: start;
70
+ -ms-flex-align: start;
71
+ align-items: start;
72
+ -webkit-box-pack: justify;
73
+ -ms-flex-pack: justify;
74
+ justify-content: space-between;
75
+ }
63
76
  .mfui-card__icon {
64
77
  width: 40px;
65
78
  height: 40px;
@@ -67,23 +80,24 @@ h5 {
67
80
  }
68
81
  .mfui-card__img-box {
69
82
  position: relative;
70
- margin-bottom: 24px;
71
83
  padding-bottom: 56.25%;
72
- border-radius: 12px;
84
+ border-radius: 24px;
73
85
  overflow: hidden;
74
86
  }
87
+ .mfui-card__img-box_position_top {
88
+ margin: -6px -6px 24px -6px;
89
+ }
75
90
  @media screen and (min-width: 1280px) {
76
- .mfui-card__img-box {
77
- margin-bottom: 32px;
91
+ .mfui-card__img-box_position_top {
92
+ margin: -12px -12px 32px -12px;
78
93
  }
79
94
  }
80
95
  .mfui-card__img-box_position_bottom {
81
- margin-top: 24px;
82
- margin-bottom: 0;
96
+ margin: 24px -6px 0 -6px;
83
97
  }
84
98
  @media screen and (min-width: 1280px) {
85
99
  .mfui-card__img-box_position_bottom {
86
- margin-top: 32px;
100
+ margin: 32px -12px 0 -12px;
87
101
  }
88
102
  }
89
103
  .mfui-card__img {
@@ -101,6 +115,35 @@ h5 {
101
115
  -webkit-transform: scale(1.2);
102
116
  transform: scale(1.2);
103
117
  }
118
+ .mfui-card__marker-list {
119
+ margin: 16px 0 0 0;
120
+ padding: 0;
121
+ list-style-type: none;
122
+ }
123
+ .mfui-card__marker-item {
124
+ position: relative;
125
+ padding-left: 20px;
126
+ }
127
+ .mfui-card__marker-item:not(:last-child) {
128
+ margin-bottom: 12px;
129
+ }
130
+ .mfui-card__marker-item:before {
131
+ content: '';
132
+ position: absolute;
133
+ top: 7px;
134
+ left: 0;
135
+ width: 6px;
136
+ height: 6px;
137
+ border-radius: 50%;
138
+ background-color: var(--stcBlack20);
139
+ opacity: 0.8;
140
+ }
141
+ .mfui-card__marker-note {
142
+ display: block;
143
+ margin: 4px 0 0 0;
144
+ padding: 0;
145
+ font-weight: 500;
146
+ }
104
147
  .mfui-card__texts {
105
148
  display: -webkit-box;
106
149
  display: -ms-flexbox;
@@ -117,6 +160,9 @@ h5 {
117
160
  margin: 0;
118
161
  padding-left: 24px;
119
162
  }
163
+ .mfui-card__texts ul {
164
+ list-style-type: disc;
165
+ }
120
166
  .mfui-card__texts-title {
121
167
  font-weight: 500;
122
168
  }
@@ -1,6 +1,6 @@
1
- import React, { Ref } from 'react';
1
+ import React, { ReactElement, Ref } from 'react';
2
2
  import './Card.less';
3
- import { ButtonType, FeaturesList, IconsList, Image, Link, Price, TextsList, Title } from './types';
3
+ import { ButtonType, FeaturesList, IconsList, Image, Link, MarkerList, Price, TextsList, Title } from './types';
4
4
  export interface ICard {
5
5
  /** Дополнительные data атрибуты к внутренним элементам */
6
6
  dataAttrs?: {
@@ -22,7 +22,7 @@ export interface ICard {
22
22
  rootRef?: Ref<HTMLDivElement | HTMLAnchorElement>;
23
23
  isFullHeight?: boolean;
24
24
  /** Вид */
25
- view?: 'shadow' | 'background';
25
+ view?: 'shadow' | 'hover-shadow' | 'background';
26
26
  /** Ссылка для карточки */
27
27
  link?: Link;
28
28
  /** Изображение */
@@ -31,6 +31,8 @@ export interface ICard {
31
31
  icon?: React.ReactNode;
32
32
  /** Заголовок */
33
33
  title: Title;
34
+ /** Маркированный список */
35
+ markerList?: MarkerList;
34
36
  /** Список текстов */
35
37
  textsList?: TextsList;
36
38
  /** Список характеристик */
@@ -43,6 +45,8 @@ export interface ICard {
43
45
  button?: ButtonType;
44
46
  /** Дополнительная кнопка */
45
47
  extraButton?: ButtonType;
48
+ /** Бейдж */
49
+ badge?: ReactElement;
46
50
  /** Обработчик клика по карточке */
47
51
  onClick?: () => void;
48
52
  }
@@ -47,14 +47,16 @@ var Card = function Card(_ref5) {
47
47
  image = _ref5.image,
48
48
  icon = _ref5.icon,
49
49
  title = _ref5.title,
50
+ markerList = _ref5.markerList,
50
51
  textsList = _ref5.textsList,
51
52
  featuresList = _ref5.featuresList,
52
53
  iconsList = _ref5.iconsList,
53
54
  price = _ref5.price,
54
55
  button = _ref5.button,
55
56
  extraButton = _ref5.extraButton,
57
+ badge = _ref5.badge,
56
58
  onClick = _ref5.onClick;
57
- var isOnlyTitle = !image && !icon && !textsList && !featuresList && !iconsList && !price && !button && !extraButton;
59
+ var isOnlyTitle = !image && !icon && !markerList && !textsList && !featuresList && !iconsList && !price && !button && !extraButton;
58
60
  var isLink = (link === null || link === void 0 ? void 0 : link.href) && !button && !extraButton;
59
61
  var isBottomImage = (image === null || image === void 0 ? void 0 : image.position) === 'bottom';
60
62
  var ElementType = isLink ? 'a' : 'div';
@@ -64,14 +66,18 @@ var Card = function Card(_ref5) {
64
66
  return null;
65
67
  }
66
68
 
69
+ var _image$position = image.position,
70
+ position = _image$position === void 0 ? 'top' : _image$position,
71
+ src = image.src,
72
+ alt = image.alt;
67
73
  return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.imgBox), {
68
74
  className: cn('img-box', {
69
- position: image.position
75
+ position: position
70
76
  })
71
77
  }), /*#__PURE__*/React.createElement("img", {
72
78
  className: cn('img'),
73
- src: image.src,
74
- alt: image.alt
79
+ src: src,
80
+ alt: alt
75
81
  }));
76
82
  };
77
83
 
@@ -86,6 +92,19 @@ var Card = function Card(_ref5) {
86
92
  };
87
93
 
88
94
  var renderContent = function renderContent() {
95
+ if (markerList) {
96
+ return /*#__PURE__*/React.createElement("ul", {
97
+ className: cn('marker-list')
98
+ }, markerList.map(function (item, i) {
99
+ return /*#__PURE__*/React.createElement("li", {
100
+ className: cn('marker-item'),
101
+ key: i
102
+ }, convert(item.title, {}), !!item.note && /*#__PURE__*/React.createElement("span", {
103
+ className: cn('marker-note')
104
+ }, convert(item.note, {})));
105
+ }));
106
+ }
107
+
89
108
  if (textsList) {
90
109
  return /*#__PURE__*/React.createElement("div", {
91
110
  className: cn('texts')
@@ -210,11 +229,13 @@ var Card = function Card(_ref5) {
210
229
  target: isLink ? link === null || link === void 0 ? void 0 : link.target : undefined,
211
230
  onClick: isLink ? onClick : undefined,
212
231
  ref: rootRef
213
- }), renderIcon(), !isBottomImage && renderImage(), /*#__PURE__*/React.createElement(Header, {
232
+ }), renderIcon(), !isBottomImage && renderImage(), /*#__PURE__*/React.createElement("div", {
233
+ className: cn('header')
234
+ }, /*#__PURE__*/React.createElement(Header, {
214
235
  className: cn('title'),
215
236
  as: "h3",
216
237
  align: title.align
217
- }, title.text), renderContent(), renderFooter());
238
+ }, title.text), badge), renderContent(), renderFooter());
218
239
  };
219
240
 
220
241
  Card.propTypes = {
@@ -20,6 +20,12 @@ export declare type Title = {
20
20
  /** Выравнивание */
21
21
  align?: 'left' | 'center';
22
22
  };
23
+ export declare type MarkerList = {
24
+ /** Заголовок */
25
+ title: string;
26
+ /** Примечание */
27
+ note?: string;
28
+ }[];
23
29
  export declare type TextsList = {
24
30
  /** Заголовок */
25
31
  title?: string;