@megafon/ui-shared 6.4.0 → 6.5.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.
- package/CHANGELOG.md +21 -0
- package/dist/es/components/Container/Container.css +36 -0
- package/dist/es/components/DarkGradientCards/DarkGradientCards.css +18 -0
- package/dist/es/components/DarkGradientCards/DarkGradientCards.d.ts +28 -0
- package/dist/es/components/DarkGradientCards/DarkGradientCards.js +88 -0
- package/dist/es/components/DarkGradientCards/components/DarkGradientCard.css +175 -0
- package/dist/es/components/DarkGradientCards/components/DarkGradientCard.d.ts +15 -0
- package/dist/es/components/DarkGradientCards/components/DarkGradientCard.js +52 -0
- package/dist/es/components/DarkGradientCards/types.d.ts +21 -0
- package/dist/es/components/DarkGradientCards/types.js +0 -0
- package/dist/es/components/ImageBanner/ImageBanner.d.ts +2 -0
- package/dist/es/components/ImageBanner/ImageBanner.js +5 -1
- package/dist/es/helpers/getColumnConfig.d.ts +1 -1
- package/dist/es/hooks/useResolutions.d.ts +1 -0
- package/dist/es/hooks/useResolutions.js +12 -1
- package/dist/es/index.d.ts +2 -0
- package/dist/es/index.js +2 -0
- package/dist/lib/components/Container/Container.css +36 -0
- package/dist/lib/components/DarkGradientCards/DarkGradientCards.css +18 -0
- package/dist/lib/components/DarkGradientCards/DarkGradientCards.d.ts +28 -0
- package/dist/lib/components/DarkGradientCards/DarkGradientCards.js +104 -0
- package/dist/lib/components/DarkGradientCards/components/DarkGradientCard.css +175 -0
- package/dist/lib/components/DarkGradientCards/components/DarkGradientCard.d.ts +15 -0
- package/dist/lib/components/DarkGradientCards/components/DarkGradientCard.js +65 -0
- package/dist/lib/components/DarkGradientCards/types.d.ts +21 -0
- package/dist/lib/components/DarkGradientCards/types.js +1 -0
- package/dist/lib/components/ImageBanner/ImageBanner.d.ts +2 -0
- package/dist/lib/components/ImageBanner/ImageBanner.js +5 -1
- package/dist/lib/helpers/getColumnConfig.d.ts +1 -1
- package/dist/lib/hooks/useResolutions.d.ts +1 -0
- package/dist/lib/hooks/useResolutions.js +12 -1
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.js +16 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,27 @@
|
|
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
|
+
## [6.5.1](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@6.5.0...@megafon/ui-shared@6.5.1) (2024-09-24)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @megafon/ui-shared
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
# [6.5.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@6.4.0...@megafon/ui-shared@6.5.0) (2024-09-17)
|
15
|
+
|
16
|
+
|
17
|
+
### Features
|
18
|
+
|
19
|
+
* **container:** add default margin for k27 (dark-gradient-cards) ([06438e6](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/06438e62c49683b61b20261684e31a1f38c76667))
|
20
|
+
* **darkgradientcards:** create component DarkGradientCards ([09626dd](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/09626ddb47c71f5502210958268fb768ca05cdc1))
|
21
|
+
* **imagebanner:** add fetchpriority to ImageBanner ([db83e1a](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/db83e1a63af693ca1a6e594011b1e9f39407c6b1))
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
6
27
|
# [6.4.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@6.3.0...@megafon/ui-shared@6.4.0) (2024-09-10)
|
7
28
|
|
8
29
|
|
@@ -3723,6 +3723,9 @@ h5 {
|
|
3723
3723
|
.mfui-container .mfui-dark-gradient-cards + .mfui-side-picture-cards {
|
3724
3724
|
margin-top: 56px;
|
3725
3725
|
}
|
3726
|
+
.mfui-container .mfui-dark-gradient-cards + .mfui-info-cards {
|
3727
|
+
margin-top: 56px;
|
3728
|
+
}
|
3726
3729
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
3727
3730
|
.mfui-container .mfui-dark-gradient-cards + .mfui-benefits-icons {
|
3728
3731
|
margin-top: 48px;
|
@@ -3784,6 +3787,9 @@ h5 {
|
|
3784
3787
|
.mfui-container .mfui-dark-gradient-cards + .mfui-side-picture-cards {
|
3785
3788
|
margin-top: 48px;
|
3786
3789
|
}
|
3790
|
+
.mfui-container .mfui-dark-gradient-cards + .mfui-info-cards {
|
3791
|
+
margin-top: 48px;
|
3792
|
+
}
|
3787
3793
|
}
|
3788
3794
|
@media screen and (max-width: 767px) {
|
3789
3795
|
.mfui-container .mfui-dark-gradient-cards + .mfui-benefits-icons {
|
@@ -3840,6 +3846,9 @@ h5 {
|
|
3840
3846
|
.mfui-container .mfui-dark-gradient-cards + .mfui-side-picture-cards {
|
3841
3847
|
margin-top: 40px;
|
3842
3848
|
}
|
3849
|
+
.mfui-container .mfui-dark-gradient-cards + .mfui-info-cards {
|
3850
|
+
margin-top: 40px;
|
3851
|
+
}
|
3843
3852
|
}
|
3844
3853
|
.mfui-container .mfui-side-picture-cards + .mfui-benefits-icons {
|
3845
3854
|
margin-top: 56px;
|
@@ -3901,6 +3910,9 @@ h5 {
|
|
3901
3910
|
.mfui-container .mfui-side-picture-cards + .mfui-dark-gradient-cards {
|
3902
3911
|
margin-top: 56px;
|
3903
3912
|
}
|
3913
|
+
.mfui-container .mfui-side-picture-cards + .mfui-info-cards {
|
3914
|
+
margin-top: 56px;
|
3915
|
+
}
|
3904
3916
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
3905
3917
|
.mfui-container .mfui-side-picture-cards + .mfui-benefits-icons {
|
3906
3918
|
margin-top: 48px;
|
@@ -3962,6 +3974,9 @@ h5 {
|
|
3962
3974
|
.mfui-container .mfui-side-picture-cards + .mfui-dark-gradient-cards {
|
3963
3975
|
margin-top: 48px;
|
3964
3976
|
}
|
3977
|
+
.mfui-container .mfui-side-picture-cards + .mfui-info-cards {
|
3978
|
+
margin-top: 48px;
|
3979
|
+
}
|
3965
3980
|
}
|
3966
3981
|
@media screen and (max-width: 767px) {
|
3967
3982
|
.mfui-container .mfui-side-picture-cards + .mfui-benefits-icons {
|
@@ -4018,6 +4033,9 @@ h5 {
|
|
4018
4033
|
.mfui-container .mfui-side-picture-cards + .mfui-dark-gradient-cards {
|
4019
4034
|
margin-top: 40px;
|
4020
4035
|
}
|
4036
|
+
.mfui-container .mfui-side-picture-cards + .mfui-info-cards {
|
4037
|
+
margin-top: 40px;
|
4038
|
+
}
|
4021
4039
|
}
|
4022
4040
|
.mfui-container .mfui-info-cards + .mfui-benefits-icons {
|
4023
4041
|
margin-top: 56px;
|
@@ -4070,6 +4088,12 @@ h5 {
|
|
4070
4088
|
.mfui-container .mfui-info-cards + .mfui-steps {
|
4071
4089
|
margin-top: 56px;
|
4072
4090
|
}
|
4091
|
+
.mfui-container .mfui-info-cards + .mfui-dark-gradient-cards {
|
4092
|
+
margin-top: 56px;
|
4093
|
+
}
|
4094
|
+
.mfui-container .mfui-info-cards + .mfui-side-picture-cards {
|
4095
|
+
margin-top: 56px;
|
4096
|
+
}
|
4073
4097
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
4074
4098
|
.mfui-container .mfui-info-cards + .mfui-benefits-icons {
|
4075
4099
|
margin-top: 48px;
|
@@ -4122,6 +4146,12 @@ h5 {
|
|
4122
4146
|
.mfui-container .mfui-info-cards + .mfui-steps {
|
4123
4147
|
margin-top: 48px;
|
4124
4148
|
}
|
4149
|
+
.mfui-container .mfui-info-cards + .mfui-dark-gradient-cards {
|
4150
|
+
margin-top: 48px;
|
4151
|
+
}
|
4152
|
+
.mfui-container .mfui-info-cards + .mfui-side-picture-cards {
|
4153
|
+
margin-top: 48px;
|
4154
|
+
}
|
4125
4155
|
}
|
4126
4156
|
@media screen and (max-width: 767px) {
|
4127
4157
|
.mfui-container .mfui-info-cards + .mfui-benefits-icons {
|
@@ -4175,4 +4205,10 @@ h5 {
|
|
4175
4205
|
.mfui-container .mfui-info-cards + .mfui-steps {
|
4176
4206
|
margin-top: 40px;
|
4177
4207
|
}
|
4208
|
+
.mfui-container .mfui-info-cards + .mfui-dark-gradient-cards {
|
4209
|
+
margin-top: 40px;
|
4210
|
+
}
|
4211
|
+
.mfui-container .mfui-info-cards + .mfui-side-picture-cards {
|
4212
|
+
margin-top: 40px;
|
4213
|
+
}
|
4178
4214
|
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
h1,
|
2
|
+
h2,
|
3
|
+
h3,
|
4
|
+
h4,
|
5
|
+
h5 {
|
6
|
+
margin: 0;
|
7
|
+
}
|
8
|
+
.mfui-dark-gradient-cards__cards {
|
9
|
+
display: -webkit-box;
|
10
|
+
display: -ms-flexbox;
|
11
|
+
display: flex;
|
12
|
+
gap: 20px;
|
13
|
+
}
|
14
|
+
.mfui-dark-gradient-cards__cards .mfui-dark-gradient-cards__card {
|
15
|
+
-webkit-box-flex: 1;
|
16
|
+
-ms-flex-positive: 1;
|
17
|
+
flex-grow: 1;
|
18
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Carousel } from '@megafon/ui-core';
|
3
|
+
import { ItemType } from './types';
|
4
|
+
import './DarkGradientCards.less';
|
5
|
+
declare type CarouselProps = React.ComponentProps<typeof Carousel>;
|
6
|
+
export interface IDarkGradientCards {
|
7
|
+
/** Карточки. Минимальное количество 3 карточки */
|
8
|
+
items: ItemType[];
|
9
|
+
/** Тема навигации для карусели */
|
10
|
+
carouselNavTheme?: CarouselProps['navTheme'];
|
11
|
+
/** Цвет градиента для карусели */
|
12
|
+
carouselGradientColor?: CarouselProps['gradientColor'];
|
13
|
+
/** Дополнительный класс для компонента */
|
14
|
+
className?: string;
|
15
|
+
/** Дополнительные классы для внутренних элементов */
|
16
|
+
classes?: {
|
17
|
+
root?: string;
|
18
|
+
item?: string;
|
19
|
+
};
|
20
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
21
|
+
dataAttrs?: {
|
22
|
+
root?: Record<string, string>;
|
23
|
+
carousel?: Record<string, string>;
|
24
|
+
item?: Record<string, string>;
|
25
|
+
};
|
26
|
+
}
|
27
|
+
declare const DarkGradientCards: React.FC<IDarkGradientCards>;
|
28
|
+
export default DarkGradientCards;
|
@@ -0,0 +1,88 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
3
|
+
import "core-js/modules/es.array.map.js";
|
4
|
+
import React from 'react';
|
5
|
+
import { Carousel } from '@megafon/ui-core';
|
6
|
+
import { cnCreate, breakpoints, filterDataAttrs } from '@megafon/ui-helpers';
|
7
|
+
import PropTypes from 'prop-types';
|
8
|
+
import useResolutions from "../../hooks/useResolutions";
|
9
|
+
import DarkGradientCard from "./components/DarkGradientCard";
|
10
|
+
import "./DarkGradientCards.css";
|
11
|
+
|
12
|
+
var carouselParams = _defineProperty({}, breakpoints.MOBILE_SMALL_START, {
|
13
|
+
slidesPerView: 'auto',
|
14
|
+
spaceBetween: 20
|
15
|
+
});
|
16
|
+
|
17
|
+
var CAROUSEL_THRESHOLD = 5;
|
18
|
+
var MIN_ITEMS_COUNT = 3;
|
19
|
+
var cn = cnCreate('mfui-dark-gradient-cards');
|
20
|
+
|
21
|
+
var DarkGradientCards = function DarkGradientCards(_ref) {
|
22
|
+
var items = _ref.items,
|
23
|
+
_ref$carouselGradient = _ref.carouselGradientColor,
|
24
|
+
carouselGradientColor = _ref$carouselGradient === void 0 ? 'default' : _ref$carouselGradient,
|
25
|
+
_ref$carouselNavTheme = _ref.carouselNavTheme,
|
26
|
+
carouselNavTheme = _ref$carouselNavTheme === void 0 ? 'light' : _ref$carouselNavTheme,
|
27
|
+
className = _ref.className,
|
28
|
+
_ref$classes = _ref.classes,
|
29
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
30
|
+
dataAttrs = _ref.dataAttrs;
|
31
|
+
|
32
|
+
var _useResolutions = useResolutions(),
|
33
|
+
isDesktopWide = _useResolutions.isDesktopWide;
|
34
|
+
|
35
|
+
var isCarouselActive = items.length > MIN_ITEMS_COUNT || items.length === MIN_ITEMS_COUNT && !isDesktopWide;
|
36
|
+
var cards = items.map(function (item, i) {
|
37
|
+
return /*#__PURE__*/React.createElement(DarkGradientCard, _extends({
|
38
|
+
className: cn('card')
|
39
|
+
}, item, {
|
40
|
+
key: item.title + i,
|
41
|
+
size: i === 0 ? 'big' : 'small',
|
42
|
+
classes: {
|
43
|
+
root: classes.item
|
44
|
+
},
|
45
|
+
dataAttrs: {
|
46
|
+
root: _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, i + 1))
|
47
|
+
}
|
48
|
+
}));
|
49
|
+
});
|
50
|
+
|
51
|
+
if (items.length < MIN_ITEMS_COUNT) {
|
52
|
+
return null;
|
53
|
+
}
|
54
|
+
|
55
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
56
|
+
className: cn([className, classes.root])
|
57
|
+
}), isCarouselActive ? /*#__PURE__*/React.createElement(Carousel, {
|
58
|
+
dataAttrs: {
|
59
|
+
root: _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.carousel))
|
60
|
+
},
|
61
|
+
slidesSettings: carouselParams,
|
62
|
+
navTheme: carouselNavTheme,
|
63
|
+
threshold: CAROUSEL_THRESHOLD,
|
64
|
+
gradient: true,
|
65
|
+
gradientColor: carouselGradientColor
|
66
|
+
}, cards) : /*#__PURE__*/React.createElement("div", {
|
67
|
+
className: cn('cards')
|
68
|
+
}, cards));
|
69
|
+
};
|
70
|
+
|
71
|
+
DarkGradientCards.propTypes = {
|
72
|
+
items: PropTypes.arrayOf(PropTypes.shape({
|
73
|
+
imageSrc: PropTypes.string.isRequired,
|
74
|
+
title: PropTypes.string.isRequired,
|
75
|
+
subtitle: PropTypes.string,
|
76
|
+
moreIcon: PropTypes.element,
|
77
|
+
moreText: PropTypes.string,
|
78
|
+
href: PropTypes.string,
|
79
|
+
target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
|
80
|
+
rel: PropTypes.string
|
81
|
+
}).isRequired).isRequired,
|
82
|
+
className: PropTypes.string,
|
83
|
+
classes: PropTypes.objectOf(PropTypes.string),
|
84
|
+
dataAttrs: PropTypes.objectOf(PropTypes.object),
|
85
|
+
carouselNavTheme: PropTypes.oneOf(['light', 'green']),
|
86
|
+
carouselGradientColor: PropTypes.oneOf(['green', 'default', 'black', 'spbSky0', 'spbSky1', 'spbSky2'])
|
87
|
+
};
|
88
|
+
export default DarkGradientCards;
|
@@ -0,0 +1,175 @@
|
|
1
|
+
h1,
|
2
|
+
h2,
|
3
|
+
h3,
|
4
|
+
h4,
|
5
|
+
h5 {
|
6
|
+
margin: 0;
|
7
|
+
}
|
8
|
+
.mfui-dark-gradient-card {
|
9
|
+
position: relative;
|
10
|
+
display: -webkit-box;
|
11
|
+
display: -ms-flexbox;
|
12
|
+
display: flex;
|
13
|
+
width: 298px;
|
14
|
+
min-height: 420px;
|
15
|
+
padding: 24px;
|
16
|
+
border-radius: 24px;
|
17
|
+
color: var(--stcWhite);
|
18
|
+
text-decoration: none;
|
19
|
+
background-position: center;
|
20
|
+
background-size: cover;
|
21
|
+
}
|
22
|
+
@media screen and (max-width: 359px) {
|
23
|
+
.mfui-dark-gradient-card {
|
24
|
+
width: 265px;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
28
|
+
.mfui-dark-gradient-card {
|
29
|
+
width: 211px;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
@media screen and (min-width: 1024px) {
|
33
|
+
.mfui-dark-gradient-card {
|
34
|
+
min-height: 520px;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
@media screen and (min-width: 1024px) and (max-width: 1279px) {
|
38
|
+
.mfui-dark-gradient-card {
|
39
|
+
width: 285px;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
@media screen and (min-width: 1280px) and (max-width: 1439px) {
|
43
|
+
.mfui-dark-gradient-card {
|
44
|
+
width: 265px;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
@media screen and (min-width: 1280px) {
|
48
|
+
.mfui-dark-gradient-card {
|
49
|
+
padding: 32px;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
@media screen and (min-width: 1440px) {
|
53
|
+
.mfui-dark-gradient-card {
|
54
|
+
width: 345px;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
.mfui-dark-gradient-card:hover {
|
58
|
+
text-decoration: none;
|
59
|
+
}
|
60
|
+
.mfui-dark-gradient-card:before {
|
61
|
+
content: '';
|
62
|
+
position: absolute;
|
63
|
+
top: 0;
|
64
|
+
right: 0;
|
65
|
+
bottom: 0;
|
66
|
+
left: 0;
|
67
|
+
z-index: 0;
|
68
|
+
border-radius: inherit;
|
69
|
+
background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), to(#000000));
|
70
|
+
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), #000000);
|
71
|
+
}
|
72
|
+
.mfui-dark-gradient-card_active:hover.mfui-dark-gradient-card:before {
|
73
|
+
background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), to(rgba(0, 0, 0, 0.9)));
|
74
|
+
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.9));
|
75
|
+
}
|
76
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
77
|
+
.mfui-dark-gradient-card_size_big {
|
78
|
+
width: 441px;
|
79
|
+
}
|
80
|
+
}
|
81
|
+
@media screen and (min-width: 1024px) and (max-width: 1279px) {
|
82
|
+
.mfui-dark-gradient-card_size_big {
|
83
|
+
width: 591px;
|
84
|
+
}
|
85
|
+
}
|
86
|
+
@media screen and (min-width: 1280px) and (max-width: 1439px) {
|
87
|
+
.mfui-dark-gradient-card_size_big {
|
88
|
+
width: 550px;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
@media screen and (min-width: 1440px) {
|
92
|
+
.mfui-dark-gradient-card_size_big {
|
93
|
+
width: 710px;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
.mfui-dark-gradient-card__inner {
|
97
|
+
position: relative;
|
98
|
+
z-index: 1;
|
99
|
+
display: -webkit-box;
|
100
|
+
display: -ms-flexbox;
|
101
|
+
display: flex;
|
102
|
+
-webkit-box-orient: vertical;
|
103
|
+
-webkit-box-direction: normal;
|
104
|
+
-ms-flex-direction: column;
|
105
|
+
flex-direction: column;
|
106
|
+
gap: 12px;
|
107
|
+
width: 100%;
|
108
|
+
}
|
109
|
+
.mfui-dark-gradient-card__title {
|
110
|
+
margin-top: auto;
|
111
|
+
}
|
112
|
+
.mfui-dark-gradient-card_size_small .mfui-dark-gradient-card__title {
|
113
|
+
font-weight: 500;
|
114
|
+
font-size: 18px;
|
115
|
+
line-height: 24px;
|
116
|
+
letter-spacing: 0.5px;
|
117
|
+
}
|
118
|
+
@media screen and (min-width: 1280px) {
|
119
|
+
.mfui-dark-gradient-card_size_small .mfui-dark-gradient-card__title {
|
120
|
+
font-size: 20px;
|
121
|
+
line-height: 28px;
|
122
|
+
}
|
123
|
+
}
|
124
|
+
.mfui-dark-gradient-card_size_big .mfui-dark-gradient-card__title {
|
125
|
+
font-weight: 600;
|
126
|
+
font-size: 22px;
|
127
|
+
line-height: 28px;
|
128
|
+
letter-spacing: 0.5px;
|
129
|
+
}
|
130
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
131
|
+
.mfui-dark-gradient-card_size_big .mfui-dark-gradient-card__title {
|
132
|
+
font-size: 26px;
|
133
|
+
line-height: 32px;
|
134
|
+
}
|
135
|
+
}
|
136
|
+
@media screen and (min-width: 1024px) {
|
137
|
+
.mfui-dark-gradient-card_size_big .mfui-dark-gradient-card__title {
|
138
|
+
font-size: 28px;
|
139
|
+
line-height: 36px;
|
140
|
+
}
|
141
|
+
}
|
142
|
+
@media screen and (min-width: 1280px) {
|
143
|
+
.mfui-dark-gradient-card_size_big .mfui-dark-gradient-card__title {
|
144
|
+
font-size: 32px;
|
145
|
+
line-height: 40px;
|
146
|
+
}
|
147
|
+
}
|
148
|
+
.mfui-dark-gradient-card__subtitle {
|
149
|
+
font-size: 15px;
|
150
|
+
line-height: 24px;
|
151
|
+
}
|
152
|
+
.mfui-dark-gradient-card__more {
|
153
|
+
font-size: 15px;
|
154
|
+
line-height: 24px;
|
155
|
+
font-weight: 500;
|
156
|
+
display: -webkit-box;
|
157
|
+
display: -ms-flexbox;
|
158
|
+
display: flex;
|
159
|
+
gap: 8px;
|
160
|
+
-webkit-box-align: start;
|
161
|
+
-ms-flex-align: start;
|
162
|
+
align-items: flex-start;
|
163
|
+
}
|
164
|
+
.mfui-dark-gradient-card__more-icon {
|
165
|
+
display: block;
|
166
|
+
width: 24px;
|
167
|
+
min-width: 24px;
|
168
|
+
max-height: 24px;
|
169
|
+
}
|
170
|
+
.mfui-dark-gradient-card__more-icon svg {
|
171
|
+
display: block;
|
172
|
+
width: 100%;
|
173
|
+
height: 100%;
|
174
|
+
fill: var(--stcWhite);
|
175
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ItemType } from '../types';
|
3
|
+
import './DarkGradientCard.less';
|
4
|
+
export declare type DarkGradientCardType = ItemType & {
|
5
|
+
size?: 'small' | 'big';
|
6
|
+
className?: string;
|
7
|
+
classes?: {
|
8
|
+
root?: string;
|
9
|
+
};
|
10
|
+
dataAttrs?: {
|
11
|
+
root?: Record<string, string>;
|
12
|
+
};
|
13
|
+
};
|
14
|
+
declare const DarkGradientCard: React.FC<DarkGradientCardType>;
|
15
|
+
export default DarkGradientCard;
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import React from 'react';
|
3
|
+
import { cnCreate, convert } from '@megafon/ui-helpers';
|
4
|
+
import { setRelAttribute } from "../../../helpers/setRelAttribute";
|
5
|
+
import "./DarkGradientCard.css";
|
6
|
+
var cn = cnCreate('mfui-dark-gradient-card');
|
7
|
+
|
8
|
+
var DarkGradientCard = function DarkGradientCard(_ref) {
|
9
|
+
var imageSrc = _ref.imageSrc,
|
10
|
+
title = _ref.title,
|
11
|
+
subtitle = _ref.subtitle,
|
12
|
+
moreIcon = _ref.moreIcon,
|
13
|
+
moreText = _ref.moreText,
|
14
|
+
href = _ref.href,
|
15
|
+
_ref$target = _ref.target,
|
16
|
+
target = _ref$target === void 0 ? '_self' : _ref$target,
|
17
|
+
rel = _ref.rel,
|
18
|
+
_ref$size = _ref.size,
|
19
|
+
size = _ref$size === void 0 ? 'small' : _ref$size,
|
20
|
+
className = _ref.className,
|
21
|
+
_ref$classes = _ref.classes,
|
22
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
23
|
+
dataAttrs = _ref.dataAttrs;
|
24
|
+
var isLink = !!href;
|
25
|
+
var ElementType = isLink ? 'a' : 'div';
|
26
|
+
var currentRel = setRelAttribute(rel, target);
|
27
|
+
return /*#__PURE__*/React.createElement(ElementType, _extends({
|
28
|
+
className: cn({
|
29
|
+
size: size,
|
30
|
+
active: isLink
|
31
|
+
}, [className, classes.root])
|
32
|
+
}, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root, {
|
33
|
+
href: href,
|
34
|
+
target: isLink ? target : undefined,
|
35
|
+
rel: isLink ? currentRel : undefined,
|
36
|
+
style: {
|
37
|
+
backgroundImage: "url(".concat(imageSrc, ")")
|
38
|
+
}
|
39
|
+
}), /*#__PURE__*/React.createElement("div", {
|
40
|
+
className: cn('inner')
|
41
|
+
}, /*#__PURE__*/React.createElement("div", {
|
42
|
+
className: cn('title')
|
43
|
+
}, convert(title, {})), subtitle && /*#__PURE__*/React.createElement("div", {
|
44
|
+
className: cn('subtitle')
|
45
|
+
}, convert(subtitle, {})), !!moreText && /*#__PURE__*/React.createElement("div", {
|
46
|
+
className: cn('more')
|
47
|
+
}, !!moreIcon && /*#__PURE__*/React.createElement("div", {
|
48
|
+
className: cn('more-icon')
|
49
|
+
}, moreIcon), convert(moreText, {}))));
|
50
|
+
};
|
51
|
+
|
52
|
+
export default DarkGradientCard;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
declare type TargetType = '_self' | '_blank' | '_parent' | '_top';
|
3
|
+
export declare type ItemType = {
|
4
|
+
/** Изображение */
|
5
|
+
imageSrc: string;
|
6
|
+
/** Заголовок */
|
7
|
+
title: string;
|
8
|
+
/** Подзаголовок */
|
9
|
+
subtitle?: string;
|
10
|
+
/** Иконка */
|
11
|
+
moreIcon?: JSX.Element;
|
12
|
+
/** Текст */
|
13
|
+
moreText?: string;
|
14
|
+
/** Ссылка */
|
15
|
+
href?: string;
|
16
|
+
/** Атрибут ссылки target */
|
17
|
+
target?: TargetType;
|
18
|
+
/** Атрибут ссылки rel */
|
19
|
+
rel?: string;
|
20
|
+
};
|
21
|
+
export {};
|
File without changes
|
@@ -72,6 +72,8 @@ export interface IImageBannerProps {
|
|
72
72
|
imageDesktop2x?: string;
|
73
73
|
/** Значение тега alt для изображения */
|
74
74
|
imageAlt?: string;
|
75
|
+
/** Приоритет загрузки изображения */
|
76
|
+
fetchPriority?: 'auto' | 'high' | 'low';
|
75
77
|
/** Выравнивание изображения по вертикали (по умолчанию center) */
|
76
78
|
imageVerticalAlign?: ImageVerticalAlignType;
|
77
79
|
/** Высота баннера зависит от высоты контента (по умолчанию фиксированная) */
|
@@ -72,6 +72,8 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
72
72
|
imageDesktop2x = _ref2$imageDesktop2x === void 0 ? '' : _ref2$imageDesktop2x,
|
73
73
|
_ref2$imageAlt = _ref2.imageAlt,
|
74
74
|
imageAlt = _ref2$imageAlt === void 0 ? '' : _ref2$imageAlt,
|
75
|
+
_ref2$fetchPriority = _ref2.fetchPriority,
|
76
|
+
fetchPriority = _ref2$fetchPriority === void 0 ? 'auto' : _ref2$fetchPriority,
|
75
77
|
_ref2$imageVerticalAl = _ref2.imageVerticalAlign,
|
76
78
|
imageVerticalAlign = _ref2$imageVerticalAl === void 0 ? ImageVerticalAlign.CENTER : _ref2$imageVerticalAl,
|
77
79
|
title = _ref2.title,
|
@@ -148,7 +150,8 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
148
150
|
className: cn('image', [classes.image]),
|
149
151
|
src: imageMobile || imageMobile2x,
|
150
152
|
srcSet: imageMobile2x ? "".concat(imageMobile2x, " 2x") : undefined,
|
151
|
-
alt: imageAlt
|
153
|
+
alt: imageAlt,
|
154
|
+
fetchPriority: fetchPriority
|
152
155
|
})));
|
153
156
|
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
154
157
|
className: cn({
|
@@ -197,6 +200,7 @@ ImageBanner.propTypes = {
|
|
197
200
|
imageDesktop: PropTypes.string,
|
198
201
|
imageDesktop2x: PropTypes.string,
|
199
202
|
imageAlt: PropTypes.string,
|
203
|
+
fetchPriority: PropTypes.oneOf(['auto', 'high', 'low']),
|
200
204
|
imageVerticalAlign: PropTypes.oneOf(Object.values(ImageVerticalAlign)),
|
201
205
|
autoHeight: PropTypes.bool,
|
202
206
|
isImageFullWidth: PropTypes.bool,
|
@@ -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">;
|
@@ -5,7 +5,8 @@ import { breakpoints } from '@megafon/ui-helpers';
|
|
5
5
|
var MOBILE_MIDDLE_END = breakpoints.MOBILE_MIDDLE_END,
|
6
6
|
MOBILE_BIG_START = breakpoints.MOBILE_BIG_START,
|
7
7
|
MOBILE_BIG_END = breakpoints.MOBILE_BIG_END,
|
8
|
-
DESKTOP_SMALL_START = breakpoints.DESKTOP_SMALL_START
|
8
|
+
DESKTOP_SMALL_START = breakpoints.DESKTOP_SMALL_START,
|
9
|
+
DESKTOP_MIDDLE_START = breakpoints.DESKTOP_MIDDLE_START;
|
9
10
|
|
10
11
|
var useResolutions = function useResolutions() {
|
11
12
|
var _React$useState = React.useState(false),
|
@@ -23,6 +24,11 @@ var useResolutions = function useResolutions() {
|
|
23
24
|
isDesktop = _React$useState6[0],
|
24
25
|
setIsDesktop = _React$useState6[1];
|
25
26
|
|
27
|
+
var _React$useState7 = React.useState(false),
|
28
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
29
|
+
isDesktopWide = _React$useState8[0],
|
30
|
+
setIsDesktopWide = _React$useState8[1];
|
31
|
+
|
26
32
|
React.useEffect(function () {
|
27
33
|
if (typeof window === 'undefined') {
|
28
34
|
return undefined;
|
@@ -33,24 +39,29 @@ var useResolutions = function useResolutions() {
|
|
33
39
|
var mobileQuery = matchMedia("(max-width: ".concat(MOBILE_MIDDLE_END, "px)"));
|
34
40
|
var tabletQuery = matchMedia("(min-width: ".concat(MOBILE_BIG_START, "px) and (max-width: ").concat(MOBILE_BIG_END, "px)"));
|
35
41
|
var desktopQuery = matchMedia("(min-width: ".concat(DESKTOP_SMALL_START, "px)"));
|
42
|
+
var desktopWideQuery = matchMedia("(min-width: ".concat(DESKTOP_MIDDLE_START, "px)"));
|
36
43
|
|
37
44
|
var handleResize = function handleResize() {
|
38
45
|
setIsMobile(mobileQuery.matches);
|
39
46
|
setIsTablet(tabletQuery.matches);
|
40
47
|
setIsDesktop(desktopQuery.matches);
|
48
|
+
setIsDesktopWide(desktopWideQuery.matches);
|
41
49
|
};
|
42
50
|
|
43
51
|
handleResize();
|
44
52
|
mobileQuery.addEventListener('change', handleResize);
|
45
53
|
tabletQuery.addEventListener('change', handleResize);
|
46
54
|
desktopQuery.addEventListener('change', handleResize);
|
55
|
+
desktopWideQuery.addEventListener('change', handleResize);
|
47
56
|
return function () {
|
48
57
|
mobileQuery.removeEventListener('change', handleResize);
|
49
58
|
tabletQuery.removeEventListener('change', handleResize);
|
50
59
|
desktopQuery.removeEventListener('change', handleResize);
|
60
|
+
desktopWideQuery.addEventListener('change', handleResize);
|
51
61
|
};
|
52
62
|
}, []);
|
53
63
|
return {
|
64
|
+
isDesktopWide: isDesktopWide,
|
54
65
|
isDesktop: isDesktop,
|
55
66
|
isMobile: isMobile,
|
56
67
|
isTablet: isTablet
|
package/dist/es/index.d.ts
CHANGED
@@ -17,6 +17,8 @@ export { default as Card } from './components/Card/Card';
|
|
17
17
|
export { default as CardsBox } from './components/CardsBox/CardsBox';
|
18
18
|
export { default as CarouselBox } from './components/CarouselBox/CarouselBox';
|
19
19
|
export { default as Container } from './components/Container/Container';
|
20
|
+
export { default as DarkGradientCard } from './components/DarkGradientCards/components/DarkGradientCard';
|
21
|
+
export { default as DarkGradientCards } from './components/DarkGradientCards/DarkGradientCards';
|
20
22
|
export { default as DownloadLink } from './components/DownloadLinks/DownloadLink';
|
21
23
|
export { default as DownloadLinks } from './components/DownloadLinks/DownloadLinks';
|
22
24
|
export { default as FaqWrapper } from './components/FaqWrapper/FaqWrapper';
|
package/dist/es/index.js
CHANGED
@@ -17,6 +17,8 @@ export { default as Card } from "./components/Card/Card";
|
|
17
17
|
export { default as CardsBox } from "./components/CardsBox/CardsBox";
|
18
18
|
export { default as CarouselBox } from "./components/CarouselBox/CarouselBox";
|
19
19
|
export { default as Container } from "./components/Container/Container";
|
20
|
+
export { default as DarkGradientCard } from "./components/DarkGradientCards/components/DarkGradientCard";
|
21
|
+
export { default as DarkGradientCards } from "./components/DarkGradientCards/DarkGradientCards";
|
20
22
|
export { default as DownloadLink } from "./components/DownloadLinks/DownloadLink";
|
21
23
|
export { default as DownloadLinks } from "./components/DownloadLinks/DownloadLinks";
|
22
24
|
export { default as FaqWrapper } from "./components/FaqWrapper/FaqWrapper";
|