@megafon/ui-shared 4.5.3 → 4.7.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 +29 -0
- package/dist/es/components/AccordionBox/AccordionBox.d.ts +2 -0
- package/dist/es/components/AccordionBox/AccordionBox.js +1 -0
- package/dist/es/components/Breadcrumbs/Breadcrumbs.css +0 -6
- package/dist/es/components/Breadcrumbs/Breadcrumbs.d.ts +22 -12
- package/dist/es/components/Breadcrumbs/Breadcrumbs.js +43 -37
- package/dist/es/components/Breadcrumbs/components/BreadcrumbsItem.css +16 -0
- package/dist/es/components/Breadcrumbs/components/BreadcrumbsItem.d.ts +29 -0
- package/dist/es/components/Breadcrumbs/components/BreadcrumbsItem.js +82 -0
- package/dist/es/components/FaqWrapper/FaqWrapper.d.ts +3 -0
- package/dist/es/components/FaqWrapper/FaqWrapper.js +11 -0
- package/dist/es/components/PageTitle/PageTitle.d.ts +2 -0
- package/dist/es/components/PageTitle/PageTitle.js +4 -0
- package/dist/es/components/TextWithIcon/TextWithIconItem.d.ts +5 -0
- package/dist/es/components/TextWithIcon/TextWithIconItem.js +20 -7
- package/dist/es/components/VideoBanner/VideoBanner.d.ts +2 -0
- package/dist/es/components/VideoBanner/VideoBanner.js +6 -2
- package/dist/es/components/VideoBlock/VideoBlock.d.ts +2 -0
- package/dist/es/components/VideoBlock/VideoBlock.js +9 -4
- package/dist/es/index.d.ts +2 -0
- package/dist/es/index.js +2 -0
- package/dist/lib/components/AccordionBox/AccordionBox.d.ts +2 -0
- package/dist/lib/components/AccordionBox/AccordionBox.js +1 -0
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.css +0 -6
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.d.ts +22 -12
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.js +51 -41
- package/dist/lib/components/Breadcrumbs/components/BreadcrumbsItem.css +16 -0
- package/dist/lib/components/Breadcrumbs/components/BreadcrumbsItem.d.ts +29 -0
- package/dist/lib/components/Breadcrumbs/components/BreadcrumbsItem.js +99 -0
- package/dist/lib/components/FaqWrapper/FaqWrapper.d.ts +3 -0
- package/dist/lib/components/FaqWrapper/FaqWrapper.js +21 -0
- package/dist/lib/components/PageTitle/PageTitle.d.ts +2 -0
- package/dist/lib/components/PageTitle/PageTitle.js +4 -0
- package/dist/lib/components/TextWithIcon/TextWithIconItem.d.ts +5 -0
- package/dist/lib/components/TextWithIcon/TextWithIconItem.js +21 -6
- package/dist/lib/components/VideoBanner/VideoBanner.d.ts +2 -0
- package/dist/lib/components/VideoBanner/VideoBanner.js +6 -2
- package/dist/lib/components/VideoBlock/VideoBlock.d.ts +2 -0
- package/dist/lib/components/VideoBlock/VideoBlock.js +9 -4
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.js +16 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,35 @@
|
|
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
|
+
# [4.7.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@4.6.0...@megafon/ui-shared@4.7.0) (2022-12-12)
|
7
|
+
|
8
|
+
|
9
|
+
### Features
|
10
|
+
|
11
|
+
* **accordionbox:** add isMicrodata prop ([07cce83](https://github.com/MegafonWebLab/megafon-ui/commit/07cce8335c062687c4d1dc33b3569c89d6388181))
|
12
|
+
* **breadcrumbs:** add optional microdata attributes ([e1a30e8](https://github.com/MegafonWebLab/megafon-ui/commit/e1a30e8b3bd20479b7fc8c15cf86fc0fb9431571))
|
13
|
+
* **faqwrapper:** add new component FaqWrapper ([694e564](https://github.com/MegafonWebLab/megafon-ui/commit/694e56421bbae73566f0b18812f6206b3a065030))
|
14
|
+
* **pagetitle:** add hasBreadcrumbsMicrodata prop ([30c3ca5](https://github.com/MegafonWebLab/megafon-ui/commit/30c3ca51f7c9b0ef6095ca649e557e74dffa0875))
|
15
|
+
* **videobanner:** add hasBreadcrumbsMicrodata prop ([819996d](https://github.com/MegafonWebLab/megafon-ui/commit/819996d5600e2c32c22da9d9dfa30c64c4062f63))
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
# [4.6.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@4.5.3...@megafon/ui-shared@4.6.0) (2022-12-06)
|
22
|
+
|
23
|
+
|
24
|
+
### Features
|
25
|
+
|
26
|
+
* **textwithicon:** fix playground ([44c4b6a](https://github.com/MegafonWebLab/megafon-ui/commit/44c4b6ad323a88f48d3b79191e3be4c44fa2ac14))
|
27
|
+
* **textwithiconitem:** add example and fix text ([3db8692](https://github.com/MegafonWebLab/megafon-ui/commit/3db869242615caacf1101e4fcff1877ee43c9c95))
|
28
|
+
* **textwithiconitem:** add render html and classes ([74e21bc](https://github.com/MegafonWebLab/megafon-ui/commit/74e21bcb78e3f4764ceb58d8fa102b6b000c5ae2))
|
29
|
+
* **videoblock:** add playsinline prop ([c383928](https://github.com/MegafonWebLab/megafon-ui/commit/c383928473596bb962e68a15125fa9574bce4a64))
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
6
35
|
## [4.5.3](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@4.5.2...@megafon/ui-shared@4.5.3) (2022-11-29)
|
7
36
|
|
8
37
|
|
@@ -21,6 +21,8 @@ export interface IAccordionBox {
|
|
21
21
|
title: string;
|
22
22
|
/** Состояние аккордеона, заданное извне */
|
23
23
|
isOpened?: boolean;
|
24
|
+
/** Включить микроразметку */
|
25
|
+
hasMicrodata?: boolean;
|
24
26
|
/** Отключить ограничение ширины */
|
25
27
|
isFullWidth?: boolean;
|
26
28
|
/** Центрирование по горизонтали для расширения 1280+ */
|
@@ -21,12 +21,6 @@ h5 {
|
|
21
21
|
.mfui-breadcrumbs_color_white .mfui-breadcrumbs__item:before {
|
22
22
|
color: var(--stcWhite);
|
23
23
|
}
|
24
|
-
.mfui-breadcrumbs__icon {
|
25
|
-
position: relative;
|
26
|
-
width: 14px;
|
27
|
-
height: 3px;
|
28
|
-
margin-right: 10px;
|
29
|
-
}
|
30
24
|
.mfui-breadcrumbs__item {
|
31
25
|
position: relative;
|
32
26
|
margin-right: 10px;
|
@@ -1,27 +1,37 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
import { TextColor } from './components/BreadcrumbsItem';
|
2
3
|
import './Breadcrumbs.less';
|
3
4
|
declare type ItemObjectType = {
|
4
5
|
title?: string;
|
5
6
|
href?: string;
|
6
7
|
};
|
7
8
|
declare type ItemType = JSX.Element | ItemObjectType;
|
8
|
-
export declare
|
9
|
-
readonly DEFAULT: "default";
|
10
|
-
readonly BLACK: "black";
|
11
|
-
readonly WHITE: "white";
|
12
|
-
};
|
13
|
-
declare type TextColorType = typeof TextColor[keyof typeof TextColor];
|
9
|
+
export declare type TextColorType = typeof TextColor[keyof typeof TextColor];
|
14
10
|
export declare type Props = {
|
15
|
-
|
16
|
-
root?: Record<string, string>;
|
17
|
-
link?: Record<string, string>;
|
18
|
-
};
|
11
|
+
/** Дополнительный класс корневого элемента */
|
19
12
|
className?: string;
|
13
|
+
/** Список элементов */
|
14
|
+
items: ItemType[];
|
15
|
+
/** Цвет */
|
16
|
+
color?: TextColorType;
|
17
|
+
/** Включить микроразметку */
|
18
|
+
hasMicrodata?: boolean;
|
19
|
+
/** Дополнительные классы для корневого и внутренних элементов */
|
20
20
|
classes?: {
|
21
21
|
item?: string;
|
22
|
+
itemTitle?: string;
|
23
|
+
lastItemTitle?: string;
|
24
|
+
link?: string;
|
25
|
+
};
|
26
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
27
|
+
dataAttrs?: {
|
28
|
+
root?: Record<string, string>;
|
29
|
+
item?: Record<string, string>;
|
30
|
+
itemInner?: Record<string, string>;
|
31
|
+
itemTitle?: Record<string, string>;
|
32
|
+
itemMeta?: Record<string, string>;
|
33
|
+
link?: Record<string, string>;
|
22
34
|
};
|
23
|
-
items: ItemType[];
|
24
|
-
color?: TextColorType;
|
25
35
|
};
|
26
36
|
declare const Breadcrumbs: React.FC<Props>;
|
27
37
|
export default Breadcrumbs;
|
@@ -3,23 +3,14 @@ import "core-js/modules/es.object.values";
|
|
3
3
|
import "core-js/modules/es.string.link";
|
4
4
|
import _extends from "@babel/runtime/helpers/extends";
|
5
5
|
import React from 'react';
|
6
|
-
import { TextLink } from '@megafon/ui-core';
|
7
6
|
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
8
7
|
import PropTypes from 'prop-types';
|
8
|
+
import BreadcrumbsItem, { TextColor } from "./components/BreadcrumbsItem";
|
9
9
|
import "./Breadcrumbs.css";
|
10
|
-
export var TextColor = {
|
11
|
-
DEFAULT: 'default',
|
12
|
-
BLACK: 'black',
|
13
|
-
WHITE: 'white'
|
14
|
-
};
|
15
10
|
|
16
|
-
function isObjectElement(item) {
|
11
|
+
var isObjectElement = function isObjectElement(item) {
|
17
12
|
return !React.isValidElement(item);
|
18
|
-
}
|
19
|
-
|
20
|
-
function isJSXElement(item) {
|
21
|
-
return React.isValidElement(item);
|
22
|
-
}
|
13
|
+
};
|
23
14
|
|
24
15
|
var cn = cnCreate('mfui-breadcrumbs');
|
25
16
|
|
@@ -30,49 +21,64 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
30
21
|
className = _ref.className,
|
31
22
|
_ref$classes = _ref.classes,
|
32
23
|
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
33
|
-
dataAttrs = _ref.dataAttrs
|
34
|
-
|
24
|
+
dataAttrs = _ref.dataAttrs,
|
25
|
+
_ref$hasMicrodata = _ref.hasMicrodata,
|
26
|
+
hasMicrodata = _ref$hasMicrodata === void 0 ? false : _ref$hasMicrodata;
|
27
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
35
28
|
className: cn({
|
36
29
|
color: color
|
37
30
|
}, className)
|
31
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), hasMicrodata && {
|
32
|
+
itemScope: true,
|
33
|
+
itemType: 'https://schema.org/BreadcrumbList'
|
38
34
|
}), items.map(function (item, i) {
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
dataAttrs:
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
35
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
36
|
+
className: cn('item', classes.item)
|
37
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, i + 1), {
|
38
|
+
key: i
|
39
|
+
}), isObjectElement(item) ? /*#__PURE__*/React.createElement(BreadcrumbsItem, {
|
40
|
+
title: item.title,
|
41
|
+
href: item.href,
|
42
|
+
color: color,
|
43
|
+
index: i,
|
44
|
+
isLastItem: i === items.length - 1,
|
45
|
+
hasMicrodata: hasMicrodata,
|
46
|
+
dataAttrs: {
|
47
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.itemInner,
|
48
|
+
link: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link,
|
49
|
+
itemTitle: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.itemTitle,
|
50
|
+
meta: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.itemMeta
|
51
|
+
},
|
52
|
+
classes: {
|
53
|
+
link: classes === null || classes === void 0 ? void 0 : classes.link,
|
54
|
+
itemTitle: classes === null || classes === void 0 ? void 0 : classes.itemTitle,
|
55
|
+
lastItemTitle: classes === null || classes === void 0 ? void 0 : classes.lastItemTitle
|
56
|
+
}
|
57
|
+
}) : item);
|
60
58
|
}));
|
61
59
|
};
|
62
60
|
|
63
61
|
Breadcrumbs.propTypes = {
|
64
62
|
dataAttrs: PropTypes.shape({
|
65
63
|
root: PropTypes.objectOf(PropTypes.string.isRequired),
|
64
|
+
item: PropTypes.objectOf(PropTypes.string.isRequired),
|
65
|
+
itemInner: PropTypes.objectOf(PropTypes.string.isRequired),
|
66
|
+
itemTitle: PropTypes.objectOf(PropTypes.string.isRequired),
|
67
|
+
itemMeta: PropTypes.objectOf(PropTypes.string.isRequired),
|
66
68
|
link: PropTypes.objectOf(PropTypes.string.isRequired)
|
67
69
|
}),
|
68
70
|
className: PropTypes.string,
|
69
71
|
classes: PropTypes.shape({
|
70
|
-
item: PropTypes.string
|
72
|
+
item: PropTypes.string,
|
73
|
+
itemTitle: PropTypes.string,
|
74
|
+
lastItemTitle: PropTypes.string,
|
75
|
+
link: PropTypes.string
|
71
76
|
}),
|
72
77
|
items: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.arrayOf(PropTypes.shape({
|
73
78
|
title: PropTypes.string,
|
74
79
|
href: PropTypes.string
|
75
80
|
}).isRequired)]).isRequired,
|
76
|
-
color: PropTypes.oneOf(Object.values(TextColor))
|
81
|
+
color: PropTypes.oneOf(Object.values(TextColor)),
|
82
|
+
hasMicrodata: PropTypes.bool
|
77
83
|
};
|
78
84
|
export default Breadcrumbs;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
h1,
|
2
|
+
h2,
|
3
|
+
h3,
|
4
|
+
h4,
|
5
|
+
h5 {
|
6
|
+
margin: 0;
|
7
|
+
}
|
8
|
+
.mfui-breadcrumbs-item_color_default {
|
9
|
+
color: var(--content);
|
10
|
+
}
|
11
|
+
.mfui-breadcrumbs-item_color_black {
|
12
|
+
color: var(--stcBlack);
|
13
|
+
}
|
14
|
+
.mfui-breadcrumbs-item_color_white {
|
15
|
+
color: var(--stcWhite);
|
16
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import './BreadcrumbsItem.less';
|
3
|
+
export declare const TextColor: {
|
4
|
+
readonly DEFAULT: "default";
|
5
|
+
readonly BLACK: "black";
|
6
|
+
readonly WHITE: "white";
|
7
|
+
};
|
8
|
+
declare type TextColorType = typeof TextColor[keyof typeof TextColor];
|
9
|
+
export declare type Props = {
|
10
|
+
title?: string;
|
11
|
+
href?: string;
|
12
|
+
color?: TextColorType;
|
13
|
+
index?: number;
|
14
|
+
isLastItem?: boolean;
|
15
|
+
hasMicrodata?: boolean;
|
16
|
+
classes?: {
|
17
|
+
link?: string;
|
18
|
+
itemTitle?: string;
|
19
|
+
lastItemTitle?: string;
|
20
|
+
};
|
21
|
+
dataAttrs?: {
|
22
|
+
root?: Record<string, string>;
|
23
|
+
link?: Record<string, string>;
|
24
|
+
itemTitle?: Record<string, string>;
|
25
|
+
meta?: Record<string, string>;
|
26
|
+
};
|
27
|
+
};
|
28
|
+
declare const BreadcrumbsItem: React.FC<Props>;
|
29
|
+
export default BreadcrumbsItem;
|
@@ -0,0 +1,82 @@
|
|
1
|
+
import "core-js/modules/es.object.values";
|
2
|
+
import "core-js/modules/es.string.link";
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
4
|
+
import React from 'react';
|
5
|
+
import { TextLink } from '@megafon/ui-core';
|
6
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
7
|
+
import PropTypes from 'prop-types';
|
8
|
+
import "./BreadcrumbsItem.css";
|
9
|
+
export var TextColor = {
|
10
|
+
DEFAULT: 'default',
|
11
|
+
BLACK: 'black',
|
12
|
+
WHITE: 'white'
|
13
|
+
};
|
14
|
+
var cn = cnCreate('mfui-breadcrumbs-item');
|
15
|
+
|
16
|
+
var BreadcrumbsItem = function BreadcrumbsItem(_ref) {
|
17
|
+
var title = _ref.title,
|
18
|
+
href = _ref.href,
|
19
|
+
color = _ref.color,
|
20
|
+
_ref$index = _ref.index,
|
21
|
+
index = _ref$index === void 0 ? 0 : _ref$index,
|
22
|
+
_ref$isLastItem = _ref.isLastItem,
|
23
|
+
isLastItem = _ref$isLastItem === void 0 ? false : _ref$isLastItem,
|
24
|
+
_ref$hasMicrodata = _ref.hasMicrodata,
|
25
|
+
hasMicrodata = _ref$hasMicrodata === void 0 ? false : _ref$hasMicrodata,
|
26
|
+
classes = _ref.classes,
|
27
|
+
dataAttrs = _ref.dataAttrs;
|
28
|
+
|
29
|
+
if (isLastItem) {
|
30
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
31
|
+
className: cn({
|
32
|
+
color: color
|
33
|
+
})
|
34
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root, index + 1)), /*#__PURE__*/React.createElement("span", _extends({
|
35
|
+
className: classes === null || classes === void 0 ? void 0 : classes.lastItemTitle
|
36
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.itemTitle, index + 1)), title));
|
37
|
+
}
|
38
|
+
|
39
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
40
|
+
className: cn()
|
41
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root, index + 1), hasMicrodata && {
|
42
|
+
itemScope: true,
|
43
|
+
itemProp: 'itemListElement',
|
44
|
+
itemType: 'https://schema.org/ListItem'
|
45
|
+
}), /*#__PURE__*/React.createElement(TextLink, {
|
46
|
+
className: classes === null || classes === void 0 ? void 0 : classes.link,
|
47
|
+
href: href,
|
48
|
+
color: color,
|
49
|
+
dataAttrs: {
|
50
|
+
root: (dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link) ? _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link, index + 1)) : undefined
|
51
|
+
},
|
52
|
+
itemProp: hasMicrodata ? 'item' : undefined
|
53
|
+
}, /*#__PURE__*/React.createElement("span", _extends({
|
54
|
+
className: classes === null || classes === void 0 ? void 0 : classes.itemTitle
|
55
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.itemTitle, index + 1), hasMicrodata && {
|
56
|
+
itemProp: 'name'
|
57
|
+
}), title)), hasMicrodata && /*#__PURE__*/React.createElement("meta", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.meta, index + 1), {
|
58
|
+
itemProp: "position",
|
59
|
+
content: String(index + 1)
|
60
|
+
})));
|
61
|
+
};
|
62
|
+
|
63
|
+
BreadcrumbsItem.propTypes = {
|
64
|
+
title: PropTypes.string,
|
65
|
+
href: PropTypes.string,
|
66
|
+
color: PropTypes.oneOf(Object.values(TextColor)),
|
67
|
+
index: PropTypes.number,
|
68
|
+
isLastItem: PropTypes.bool,
|
69
|
+
hasMicrodata: PropTypes.bool,
|
70
|
+
classes: PropTypes.shape({
|
71
|
+
link: PropTypes.string,
|
72
|
+
itemTitle: PropTypes.string,
|
73
|
+
lastItemTitle: PropTypes.string
|
74
|
+
}),
|
75
|
+
dataAttrs: PropTypes.shape({
|
76
|
+
root: PropTypes.objectOf(PropTypes.string),
|
77
|
+
link: PropTypes.objectOf(PropTypes.string),
|
78
|
+
itemTitle: PropTypes.objectOf(PropTypes.string),
|
79
|
+
meta: PropTypes.objectOf(PropTypes.string)
|
80
|
+
})
|
81
|
+
};
|
82
|
+
export default BreadcrumbsItem;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
|
3
|
+
var FaqWrapper = function FaqWrapper(_ref) {
|
4
|
+
var children = _ref.children;
|
5
|
+
return /*#__PURE__*/React.createElement("div", {
|
6
|
+
itemScope: true,
|
7
|
+
itemType: "http://schema.org/FAQPage"
|
8
|
+
}, children);
|
9
|
+
};
|
10
|
+
|
11
|
+
export default FaqWrapper;
|
@@ -16,6 +16,8 @@ declare type Props = {
|
|
16
16
|
badge?: string;
|
17
17
|
/** Растягивание компонента на всю доступную ширину */
|
18
18
|
isFullWidth?: boolean;
|
19
|
+
/** Включить микроразметку для хлебных крошек */
|
20
|
+
hasBreadcrumbsMicrodata?: boolean;
|
19
21
|
/** Класс для корневого элемента */
|
20
22
|
className?: string;
|
21
23
|
/** Дополнительные классы для внутренних элементов */
|
@@ -14,6 +14,8 @@ var PageTitle = function PageTitle(_ref) {
|
|
14
14
|
badge = _ref.badge,
|
15
15
|
_ref$isFullWidth = _ref.isFullWidth,
|
16
16
|
isFullWidth = _ref$isFullWidth === void 0 ? true : _ref$isFullWidth,
|
17
|
+
_ref$hasBreadcrumbsMi = _ref.hasBreadcrumbsMicrodata,
|
18
|
+
hasBreadcrumbsMicrodata = _ref$hasBreadcrumbsMi === void 0 ? false : _ref$hasBreadcrumbsMi,
|
17
19
|
className = _ref.className,
|
18
20
|
_ref$classes = _ref.classes,
|
19
21
|
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
@@ -43,6 +45,7 @@ var PageTitle = function PageTitle(_ref) {
|
|
43
45
|
className: cn([className]),
|
44
46
|
ref: rootRef
|
45
47
|
}), (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) && /*#__PURE__*/React.createElement(Breadcrumbs, {
|
48
|
+
hasMicrodata: hasBreadcrumbsMicrodata,
|
46
49
|
items: breadcrumbs,
|
47
50
|
dataAttrs: {
|
48
51
|
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.breadcrumbs,
|
@@ -65,6 +68,7 @@ PageTitle.propTypes = {
|
|
65
68
|
}).isRequired),
|
66
69
|
badge: PropTypes.string,
|
67
70
|
isFullWidth: PropTypes.bool,
|
71
|
+
hasBreadcrumbsMicrodata: PropTypes.bool,
|
68
72
|
className: PropTypes.string,
|
69
73
|
classes: PropTypes.shape({
|
70
74
|
breadcrumbs: PropTypes.string
|
@@ -1,6 +1,11 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import './TextWithIconItem.less';
|
3
3
|
export interface ITextWithIconItem {
|
4
|
+
/** Дополнительные классы для внутренних элементов */
|
5
|
+
classes?: {
|
6
|
+
icon?: string;
|
7
|
+
text?: string;
|
8
|
+
};
|
4
9
|
/** Текст */
|
5
10
|
text: string | string[];
|
6
11
|
/** Иконка */
|
@@ -1,28 +1,41 @@
|
|
1
|
+
import "core-js/modules/es.array.is-array";
|
2
|
+
import "core-js/modules/es.array.map";
|
1
3
|
import _extends from "@babel/runtime/helpers/extends";
|
2
4
|
import * as React from 'react';
|
3
|
-
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
5
|
+
import { cnCreate, convert, filterDataAttrs, textConvertConfig } from '@megafon/ui-helpers';
|
4
6
|
import * as PropTypes from 'prop-types';
|
5
7
|
import "./TextWithIconItem.css";
|
6
8
|
var cn = cnCreate('mfui-text-with-icon-item');
|
7
9
|
|
8
10
|
var TextWithIconItem = function TextWithIconItem(_ref) {
|
9
|
-
var
|
11
|
+
var className = _ref.className,
|
12
|
+
_ref$classes = _ref.classes,
|
13
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
14
|
+
text = _ref.text,
|
10
15
|
icon = _ref.icon,
|
11
16
|
rootRef = _ref.rootRef,
|
12
17
|
dataAttrs = _ref.dataAttrs,
|
13
18
|
_ref$centeringOnMobil = _ref.centeringOnMobile,
|
14
|
-
centeringOnMobile = _ref$centeringOnMobil === void 0 ? true : _ref$centeringOnMobil
|
15
|
-
|
19
|
+
centeringOnMobile = _ref$centeringOnMobil === void 0 ? true : _ref$centeringOnMobil;
|
20
|
+
var renderText = React.useMemo(function () {
|
21
|
+
if (Array.isArray(text)) {
|
22
|
+
return text.map(function (item) {
|
23
|
+
return convert(item, textConvertConfig);
|
24
|
+
});
|
25
|
+
}
|
26
|
+
|
27
|
+
return convert(text, textConvertConfig);
|
28
|
+
}, [text]);
|
16
29
|
return /*#__PURE__*/React.createElement("div", _extends({
|
17
30
|
className: cn({
|
18
31
|
'centering-on-mobile': centeringOnMobile
|
19
32
|
}, [className]),
|
20
33
|
ref: rootRef
|
21
34
|
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement("div", {
|
22
|
-
className: cn('svg-icon')
|
35
|
+
className: cn('svg-icon', [classes.icon])
|
23
36
|
}, icon), /*#__PURE__*/React.createElement("div", {
|
24
|
-
className: cn('text')
|
25
|
-
},
|
37
|
+
className: cn('text', [classes.text])
|
38
|
+
}, renderText));
|
26
39
|
};
|
27
40
|
|
28
41
|
TextWithIconItem.propTypes = {
|
@@ -96,6 +96,8 @@ interface IVideoBannerProps {
|
|
96
96
|
imageDesktopWide?: string;
|
97
97
|
/** Хлебные крошки */
|
98
98
|
breadcrumbs?: BreadCrumbsItemsType;
|
99
|
+
/** Включить микроразметку хлебных крошек */
|
100
|
+
hasBreadcrumbsMicrodata?: boolean;
|
99
101
|
}
|
100
102
|
declare const VideoBanner: React.FC<IVideoBannerProps>;
|
101
103
|
export default VideoBanner;
|
@@ -65,7 +65,9 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
65
65
|
isMuted = _ref2$isMuted === void 0 ? true : _ref2$isMuted,
|
66
66
|
breadcrumbs = _ref2.breadcrumbs,
|
67
67
|
_ref2$videoMobile = _ref2.videoMobile,
|
68
|
-
videoMobile = _ref2$videoMobile === void 0 ? false : _ref2$videoMobile
|
68
|
+
videoMobile = _ref2$videoMobile === void 0 ? false : _ref2$videoMobile,
|
69
|
+
_ref2$hasBreadcrumbsM = _ref2.hasBreadcrumbsMicrodata,
|
70
|
+
hasBreadcrumbsMicrodata = _ref2$hasBreadcrumbsM === void 0 ? false : _ref2$hasBreadcrumbsM;
|
69
71
|
|
70
72
|
var _React$useState = React.useState(true),
|
71
73
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
@@ -207,6 +209,7 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
207
209
|
}), /*#__PURE__*/React.createElement(ContentArea, null, /*#__PURE__*/React.createElement("div", {
|
208
210
|
className: cn('wrapper')
|
209
211
|
}, !!(breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) && /*#__PURE__*/React.createElement(Breadcrumbs, {
|
212
|
+
hasMicrodata: hasBreadcrumbsMicrodata,
|
210
213
|
dataAttrs: {
|
211
214
|
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.breadcrumbs,
|
212
215
|
link: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.breadcrumbsLink
|
@@ -278,6 +281,7 @@ VideoBanner.propTypes = {
|
|
278
281
|
breadcrumbs: PropTypes.arrayOf(PropTypes.shape({
|
279
282
|
title: PropTypes.string.isRequired,
|
280
283
|
href: PropTypes.string
|
281
|
-
}).isRequired)
|
284
|
+
}).isRequired),
|
285
|
+
hasBreadcrumbsMicrodata: PropTypes.bool
|
282
286
|
};
|
283
287
|
export default VideoBanner;
|
@@ -49,6 +49,8 @@ export interface IVideoBlockProps {
|
|
49
49
|
poster?: string;
|
50
50
|
/** Расположение контента справа от видео. Только для десктопа */
|
51
51
|
contentPositionRight?: boolean;
|
52
|
+
/** Воспроизводит видео на iOS устройствах без перехода в полноэкранный режим */
|
53
|
+
playsinline?: boolean;
|
52
54
|
}
|
53
55
|
declare const VideoBlock: React.FC<IVideoBlockProps>;
|
54
56
|
export default VideoBlock;
|
@@ -30,7 +30,9 @@ var VideoBlock = function VideoBlock(_ref) {
|
|
30
30
|
isAutoplay = _ref$isAutoplay === void 0 ? false : _ref$isAutoplay,
|
31
31
|
_ref$contentPositionR = _ref.contentPositionRight,
|
32
32
|
contentPositionRight = _ref$contentPositionR === void 0 ? false : _ref$contentPositionR,
|
33
|
-
poster = _ref.poster
|
33
|
+
poster = _ref.poster,
|
34
|
+
_ref$playsinline = _ref.playsinline,
|
35
|
+
playsinline = _ref$playsinline === void 0 ? false : _ref$playsinline;
|
34
36
|
var renderVideo = React.useCallback(function () {
|
35
37
|
switch (videoType) {
|
36
38
|
case VideoTypes.YOUTUBE:
|
@@ -44,7 +46,8 @@ var VideoBlock = function VideoBlock(_ref) {
|
|
44
46
|
var showinfo = "&showinfo=0";
|
45
47
|
var ivLoadPolicy = "&iv_load_policy=3";
|
46
48
|
var playlist = "&playlist=".concat(videoSrc);
|
47
|
-
var
|
49
|
+
var playsinlineProp = "&playsinline=".concat(playsinline ? 1 : 0);
|
50
|
+
var src = "".concat(url).concat(autoplay).concat(mute).concat(loop).concat(rel).concat(controls).concat(showinfo).concat(ivLoadPolicy).concat(playlist).concat(playsinlineProp);
|
48
51
|
return /*#__PURE__*/React.createElement("div", {
|
49
52
|
className: cn('youtube')
|
50
53
|
}, /*#__PURE__*/React.createElement("iframe", {
|
@@ -70,7 +73,8 @@ var VideoBlock = function VideoBlock(_ref) {
|
|
70
73
|
muted: isMuted,
|
71
74
|
controls: !isAutoplay,
|
72
75
|
loop: true,
|
73
|
-
poster: poster
|
76
|
+
poster: poster,
|
77
|
+
playsInline: playsinline
|
74
78
|
}, /*#__PURE__*/React.createElement("source", {
|
75
79
|
src: videoSrc,
|
76
80
|
type: "video/mp4"
|
@@ -83,7 +87,7 @@ var VideoBlock = function VideoBlock(_ref) {
|
|
83
87
|
return null;
|
84
88
|
}
|
85
89
|
}
|
86
|
-
}, [videoType, videoSrc, isAutoplay, isMuted, poster]);
|
90
|
+
}, [videoType, videoSrc, isAutoplay, isMuted, poster, playsinline]);
|
87
91
|
var renderContent = React.useCallback(function (_ref2) {
|
88
92
|
var title = _ref2.title,
|
89
93
|
description = _ref2.description,
|
@@ -175,6 +179,7 @@ VideoBlock.propTypes = {
|
|
175
179
|
isMuted: PropTypes.bool,
|
176
180
|
isAutoplay: PropTypes.bool,
|
177
181
|
poster: PropTypes.string,
|
182
|
+
playsinline: PropTypes.bool,
|
178
183
|
contentPositionRight: PropTypes.bool
|
179
184
|
};
|
180
185
|
export default VideoBlock;
|
package/dist/es/index.d.ts
CHANGED
@@ -4,6 +4,7 @@ export { default as BenefitsIcons } from './components/BenefitsIcons/BenefitsIco
|
|
4
4
|
export { default as BenefitsIconsTile } from './components/BenefitsIcons/BenefitsIconsTile';
|
5
5
|
export { default as BenefitsPictures } from './components/BenefitsPictures/BenefitsPictures';
|
6
6
|
export { default as Breadcrumbs } from './components/Breadcrumbs/Breadcrumbs';
|
7
|
+
export { default as BreadcrumbsItem } from './components/Breadcrumbs/components/BreadcrumbsItem';
|
7
8
|
export { default as ButtonBanner } from './components/ButtonBanner/ButtonBanner';
|
8
9
|
export { default as ButtonLinkBox } from './components/ButtonLinkBox/ButtonLinkBox';
|
9
10
|
export { default as Card } from './components/Card/Card';
|
@@ -12,6 +13,7 @@ export { default as CarouselBox } from './components/CarouselBox/CarouselBox';
|
|
12
13
|
export { default as Container } from './components/Container/Container';
|
13
14
|
export { default as DownloadLink } from './components/DownloadLinks/DownloadLink';
|
14
15
|
export { default as DownloadLinks } from './components/DownloadLinks/DownloadLinks';
|
16
|
+
export { default as FaqWrapper } from './components/FaqWrapper/FaqWrapper';
|
15
17
|
export { default as Instructions } from './components/Instructions/Instructions';
|
16
18
|
export { default as PageTitle } from './components/PageTitle/PageTitle';
|
17
19
|
export { default as Partners } from './components/Partners/Partners';
|
package/dist/es/index.js
CHANGED
@@ -4,6 +4,7 @@ export { default as BenefitsIcons } from "./components/BenefitsIcons/BenefitsIco
|
|
4
4
|
export { default as BenefitsIconsTile } from "./components/BenefitsIcons/BenefitsIconsTile";
|
5
5
|
export { default as BenefitsPictures } from "./components/BenefitsPictures/BenefitsPictures";
|
6
6
|
export { default as Breadcrumbs } from "./components/Breadcrumbs/Breadcrumbs";
|
7
|
+
export { default as BreadcrumbsItem } from "./components/Breadcrumbs/components/BreadcrumbsItem";
|
7
8
|
export { default as ButtonBanner } from "./components/ButtonBanner/ButtonBanner";
|
8
9
|
export { default as ButtonLinkBox } from "./components/ButtonLinkBox/ButtonLinkBox";
|
9
10
|
export { default as Card } from "./components/Card/Card";
|
@@ -12,6 +13,7 @@ export { default as CarouselBox } from "./components/CarouselBox/CarouselBox";
|
|
12
13
|
export { default as Container } from "./components/Container/Container";
|
13
14
|
export { default as DownloadLink } from "./components/DownloadLinks/DownloadLink";
|
14
15
|
export { default as DownloadLinks } from "./components/DownloadLinks/DownloadLinks";
|
16
|
+
export { default as FaqWrapper } from "./components/FaqWrapper/FaqWrapper";
|
15
17
|
export { default as Instructions } from "./components/Instructions/Instructions";
|
16
18
|
export { default as PageTitle } from "./components/PageTitle/PageTitle";
|
17
19
|
export { default as Partners } from "./components/Partners/Partners";
|
@@ -21,6 +21,8 @@ export interface IAccordionBox {
|
|
21
21
|
title: string;
|
22
22
|
/** Состояние аккордеона, заданное извне */
|
23
23
|
isOpened?: boolean;
|
24
|
+
/** Включить микроразметку */
|
25
|
+
hasMicrodata?: boolean;
|
24
26
|
/** Отключить ограничение ширины */
|
25
27
|
isFullWidth?: boolean;
|
26
28
|
/** Центрирование по горизонтали для расширения 1280+ */
|
@@ -21,12 +21,6 @@ h5 {
|
|
21
21
|
.mfui-breadcrumbs_color_white .mfui-breadcrumbs__item:before {
|
22
22
|
color: var(--stcWhite);
|
23
23
|
}
|
24
|
-
.mfui-breadcrumbs__icon {
|
25
|
-
position: relative;
|
26
|
-
width: 14px;
|
27
|
-
height: 3px;
|
28
|
-
margin-right: 10px;
|
29
|
-
}
|
30
24
|
.mfui-breadcrumbs__item {
|
31
25
|
position: relative;
|
32
26
|
margin-right: 10px;
|